Skip to content

Commit 3067626

Browse files
Accordion - Add Showcase examples of flush variant within containers (#3124)
1 parent 64e1d27 commit 3067626

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

showcase/app/styles/showcase-pages/accordion.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,15 @@ body.page-components-accordion {
2222
// this variable is set on the parent element
2323
--hds-accordion-item-focus-ring-offset: 0;
2424
}
25+
26+
.shw-component-flyout-sample-item {
27+
// Note: Percy wasn't seeing the styles applied via selecting by the [open] attribute
28+
// (which the Flyout showpage uses for similar examples)
29+
.hds-flyout {
30+
position: relative;
31+
z-index: initial;
32+
display: flex;
33+
height: 40vh;
34+
}
35+
}
2536
}

showcase/app/templates/page-components/accordion.hbs

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,101 @@
453453

454454
<Shw::Divider />
455455

456+
<Shw::Text::H2>Context</Shw::Text::H2>
457+
458+
<Shw::Text::H3>Flush Accordion used within containers</Shw::Text::H3>
459+
460+
<Shw::Grid @columns={{2}} @gap="2rem" as |SG|>
461+
<SG.Item @label="In a Card w/ no padding">
462+
<Hds::Card::Container @hasBorder={{true}}>
463+
<Hds::Accordion @type="flush" as |A|>
464+
<A.Item>
465+
<:toggle>Item one</:toggle>
466+
<:content>
467+
<Shw::Placeholder @text="generic content" @height="40" />
468+
</:content>
469+
</A.Item>
470+
471+
<A.Item @isStatic={{true}}>
472+
<:toggle>Item two</:toggle>
473+
<:content>
474+
<Shw::Placeholder @text="generic content" @height="40" />
475+
</:content>
476+
</A.Item>
477+
478+
<A.Item @containsInteractive={{true}}>
479+
<:toggle>Item three</:toggle>
480+
<:content>
481+
<Shw::Placeholder @text="generic content" @height="40" />
482+
</:content>
483+
</A.Item>
484+
</Hds::Accordion>
485+
</Hds::Card::Container>
486+
</SG.Item>
487+
488+
<SG.Item @label="in a Card w/ padding">
489+
<Hds::Card::Container @hasBorder={{true}} {{style padding="16px"}}>
490+
<Hds::Accordion @type="flush" as |A|>
491+
<A.Item>
492+
<:toggle>Item one</:toggle>
493+
<:content>
494+
<Shw::Placeholder @text="generic content" @height="40" />
495+
</:content>
496+
</A.Item>
497+
498+
<A.Item @isStatic={{true}}>
499+
<:toggle>Item two</:toggle>
500+
<:content>
501+
<Shw::Placeholder @text="generic content" @height="40" />
502+
</:content>
503+
</A.Item>
504+
505+
<A.Item @containsInteractive={{true}}>
506+
<:toggle>Item three</:toggle>
507+
<:content>
508+
<Shw::Placeholder @text="generic content" @height="40" />
509+
</:content>
510+
</A.Item>
511+
</Hds::Accordion>
512+
</Hds::Card::Container>
513+
</SG.Item>
514+
515+
<SG.Item @label="in a Flyout" class="shw-component-flyout-sample-item">
516+
<Hds::Flyout open id="flyout-example-one-action" as |F|>
517+
<F.Header>Title</F.Header>
518+
<F.Body>
519+
<Hds::Accordion @type="flush" as |A|>
520+
<A.Item>
521+
<:toggle>Item one</:toggle>
522+
<:content>
523+
<Shw::Placeholder @text="generic content" @height="40" />
524+
</:content>
525+
</A.Item>
526+
527+
<A.Item @isStatic={{true}}>
528+
<:toggle>Item two</:toggle>
529+
<:content>
530+
<Shw::Placeholder @text="generic content" @height="40" />
531+
</:content>
532+
</A.Item>
533+
534+
<A.Item @containsInteractive={{true}}>
535+
<:toggle>Item three</:toggle>
536+
<:content>
537+
<Shw::Placeholder @text="generic content" @height="40" />
538+
</:content>
539+
</A.Item>
540+
</Hds::Accordion>
541+
</F.Body>
542+
<F.Footer>
543+
<Hds::Button type="submit" @text="Primary" />
544+
</F.Footer>
545+
</Hds::Flyout>
546+
</SG.Item>
547+
</Shw::Grid>
548+
549+
<Shw::Divider />
550+
456551
<Shw::Text::H2>Base elements</Shw::Text::H2>
457552

458553
<Shw::Text::H3>Accordion::Item</Shw::Text::H3>

0 commit comments

Comments
 (0)