Skip to content
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

Merged
merged 6 commits into from
Feb 17, 2022

Conversation

kimallen
Copy link
Contributor

Summary

This allows the Accordion component to accept any heading level. Previously, it was fixed at h4. For backwards compatibility, the default is h4.

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 in items Accordion prop of anything other than the default h4.

@kimallen kimallen changed the title Accept accordion headingLevel prop [feat] Accept accordion headingLevel prop Feb 17, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2022

Warnings
⚠️ This PR does not include changes to storybook, even though it affects component code.

Generated by 🚫 dangerJS against d381c89

@kimallen kimallen changed the title [feat] Accept accordion headingLevel prop feat: Accept Accordion headingLevel in items prop Feb 17, 2022
@@ -379,4 +379,119 @@ describe('Accordion component', () => {
)
})
})
describe('custom headingLevel for AccordionItems', () => {
it('passes on the headingLevel', () => {
const customTestItems: AccordionItemProps[] = [
Copy link
Contributor

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

brandonlenz
brandonlenz previously approved these changes Feb 17, 2022
Copy link
Contributor

@brandonlenz brandonlenz left a 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

@brandonlenz
Copy link
Contributor

Looking at Happo diffs, it looks like they're all IE, on all components. Something about the margin or screen size:
image

Happo usually issues a warning when something like that happens, but i don't see one. Still I'm inclined to approve that since it appears to be an IE issue or some update with happo runners on IE, not related to these changes.

…n-headinglevel-prop-1904' into kma-accept-accordion-headinglevel-prop-1904
@kimallen kimallen merged commit 5090110 into main Feb 17, 2022
@kimallen kimallen deleted the kma-accept-accordion-headinglevel-prop-1904 branch February 17, 2022 21:30
@kimallen kimallen mentioned this pull request Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Allow Accordion component to accept different heading levels
3 participants