-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Accept Accordion headingLevel in items prop #1905
Conversation
@@ -379,4 +379,119 @@ describe('Accordion component', () => { | |||
) | |||
}) | |||
}) | |||
describe('custom headingLevel for AccordionItems', () => { | |||
it('passes on the headingLevel', () => { | |||
const customTestItems: AccordionItemProps[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For other potential reviewers:
AccordionItemProps needed to be renamed (from AccordianItem) so that it could be exported without conflict and used here so that the type inference on headingLevel
would match instead of just being string
which caused type errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I would definitely recommend at least using the existing testItems
in the default h4 test
…n-headinglevel-prop-1904' into kma-accept-accordion-headinglevel-prop-1904
Summary
This allows the Accordion component to accept any heading level. Previously, it was fixed at
h4
. For backwards compatibility, the default ish4
.Related Issues or PRs
closes #1904
How To Test
To test, one can try running storybook locally and adding a
headingLevel
prop to an item initems
Accordion prop of anything other than the defaulth4
.