Conversation
a8726e3 to
4f31706
Compare
| ); | ||
|
|
||
| // temporary wrapper for deprecated validation | ||
| const renderTitleWithValidation = () => ( |
There was a problem hiding this comment.
suggestion (non-blocking): honestly we could drop this completely and just let the validation related props have no effect. Depends on how nice we want to be with this, could be worth testing the water to see what the actual consumer impact would be.
But if you want to leave this in, It's completely fine and won't be a blocker on my end.
There was a problem hiding this comment.
I don't mind, thought I would be nice for this one but hopefully no one is using these anymore. I'll probably just remove to clean it up a bit more.
| <Button | ||
| data-role="accordion-simple-button" | ||
| id={headerId} | ||
| aria-expanded={isExpanded} |
There was a problem hiding this comment.
suggestion (non-blocking): in this ternary here when we're rendering the "simple button" or the title container, bothy have a lot of shared props. We could potentially put all shared props between the two in an object like titleProps etc, then spread them onto both instances.
This is just personal preference though, if you prefer to do it like this feel free to leave it.
There was a problem hiding this comment.
I personally avoid putting props into objects as I've seen in some legacy components they can get quite messy, I'll probably leave it like this, I also think it helps in terms of readability.
| role="button" | ||
| $size={standardSize} | ||
| $iconAlign={iconAlign} | ||
| {...headerSpacing} |
There was a problem hiding this comment.
question: would consumers expect this header spacing to also be applied to the "simple button"?
There was a problem hiding this comment.
Depends I guess, I was mainly repurposing this prop to apply the different header spacing variations in the DS so I didn't think it was really necessary to pass it to both variants. Since the title prop also accepts a node if someone really wanted to change the default button spacing they could just pass their own wrapper with spacing.
| > | ||
| {actualVariant === "simple" && <StyledAccordionLine />} | ||
| <StyledAccordionContent | ||
| role="region" |
There was a problem hiding this comment.
question: do we need a role of "region" here? I understand you didn't add this and its a legacy implementation, but an aria-live region seems unnecessary as the other aria- attributes we're using should be enough.
There was a problem hiding this comment.
I don't think "region" roles come with an aria-live, but I agree that its probably not necessary. I'll double check with the accessibility team.
| isExpanded={isExpanded} | ||
| maxHeight={contentHeight} | ||
| $isExpanded={isExpanded} | ||
| $height={contentHeight} |
There was a problem hiding this comment.
suggestion: I see we're passing height down here, which we get from a useResizeObserver and a side effect. We then use this height in the styled component file like so
${$height}px;
I think we can avoid doing this by simply making the height of the accordion when expanded fit its content.
height: fit-content;
If this suggestion does work, we can remove this expensive computations which is re-triggered on every re-size event or when the component is expanded.
There was a problem hiding this comment.
I'll have another look but I tested quite a few ways to set the height and they all seemed to break the animation in some way - I'll try to see if I can simplify the events anyways.
| width?: string; | ||
| /** Sets accordion variant */ | ||
| variant?: "standard" | "subtle"; | ||
| interface StyledAccordionContainerProps { |
There was a problem hiding this comment.
suggestion a similar sort of interface is declared a lot here with various different combinations of the transient $ prefix props you've used. You could benefit from using one shared interface, then just picking from that wherever you need below.
| /** Sets accordion variant */ | ||
| variant?: "standard" | "subtle"; | ||
| interface StyledAccordionContainerProps { | ||
| $borders?: "default" | "full" | "none"; |
There was a problem hiding this comment.
suggestion (non-blocking): even though these are transient props you could link up their types to be that of the OG interface, therefore if more types are ever added in the actual prop these don't have to be updated manually.
|
|
||
| const testData = [CHARACTERS.DIACRITICS, CHARACTERS.SPECIALCHARACTERS]; | ||
|
|
||
| test.describe("should render Accordion component", () => { |
There was a problem hiding this comment.
suggestion (non-blocking): after a quick glance through this file we could purge even more tests which are not strictly interaction tests (not including the accessibility tests) e.g. asserting the title or subtitle props work could be removed as these are covered in unit tests and chromatic snapshots
| accordionContent, | ||
| accordion, | ||
| }; | ||
| export default accordionDefaultTitle; |
There was a problem hiding this comment.
suggestion we no longer use this in accordions pw tests it seems, just seems to be left in action-popover and split-button. You could just replace those instances with a direct data-element check and delete this entire folder.
3e5f634 to
41c3e1a
Compare
|
Hi @nuria1110 , all looks great, just a few finding here:
|
|
Checked with @nuria1110 regarding these findings. Those options are deprecated and will be removed in the future breaking change as per the general approach. @ljemmo are we aligned to proceed as-is? Once confirmed, I'll move this to QA passed. |
|
@designerlisa yes thats the expectation. We want to give consuming teams a chance to understand that elements will be removed in the near future and have chance to migrate to alternative properties. |
cb6f2f6
aacde63 to
cb6f2f6
Compare
cb6f2f6 to
c76a9b3
Compare
Aligns `Accordion` to Fusion DS. Deprecates props which are no longer relevant and updates styleswith fusion-tokens.
c76a9b3 to
735123a
Compare
|
🎉 This PR is included in version 158.42.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Proposed behaviour
Aligns
Accordionwith Fusion DS and updates styles with fusion-tokens.variant/sizeselected.sizeas default.HeaderSpacingstorybook example shows how to achieve 'No padding' variation."Standard"
variant:size"small" and "medium""Simple"
variant:variantto "simple".Button.variantsupportssize"small", "medium" and "large":Deprecated props:
bordersvariantdisableContentPaddingiconTypeiconAlignerrorwarninginfoCurrent behaviour
Accordionis not aligned with Fusion DS.Checklist
d.tsfile added or updated if requiredQA
Additional context
Testing instructions