@pnx-mixtape/mxds 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/accordion.entry.js +32 -43
- package/dist/build/accordion.entry.js.map +1 -1
- package/dist/build/base.css +19 -39
- package/dist/build/button.css +7 -8
- package/dist/build/chunks/{Accordion-O-huO4At.js → Accordion-D1HQ0FDq.js} +23 -21
- package/dist/build/chunks/{Accordion-O-huO4At.js.map → Accordion-D1HQ0FDq.js.map} +1 -1
- package/dist/build/chunks/disclosure-widget-CdjCdx7t.js +129 -0
- package/dist/build/chunks/disclosure-widget-CdjCdx7t.js.map +1 -0
- package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js +70 -0
- package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js.map +1 -0
- package/dist/build/chunks/{polyfills-C-B7iqDG.js → polyfills-DnrsypYs.js} +35 -26
- package/dist/build/chunks/polyfills-DnrsypYs.js.map +1 -0
- package/dist/build/chunks/popover.entry-BQvyR0d5.js +38 -0
- package/dist/build/chunks/popover.entry-BQvyR0d5.js.map +1 -0
- package/dist/build/chunks/{utilities-DXELy_An.js → utilities-Ci7wwNeg.js} +9 -106
- package/dist/build/chunks/utilities-Ci7wwNeg.js.map +1 -0
- package/dist/build/constants.css +10 -31
- package/dist/build/dialog.entry.js +23 -31
- package/dist/build/dialog.entry.js.map +1 -1
- package/dist/build/drop-menu.entry.js +1 -1
- package/dist/build/drupal.css +5 -9
- package/dist/build/filters.entry.js +54 -50
- package/dist/build/filters.entry.js.map +1 -1
- package/dist/build/form.css +12 -26
- package/dist/build/global-alert.entry.js +26 -19
- package/dist/build/global-alert.entry.js.map +1 -1
- package/dist/build/grid.css +3 -9
- package/dist/build/header.css +5 -3
- package/dist/build/header.entry.js +93 -88
- package/dist/build/header.entry.js.map +1 -1
- package/dist/build/icon.css +3 -3
- package/dist/build/in-page-navigation.entry.js +16 -12
- package/dist/build/in-page-navigation.entry.js.map +1 -1
- package/dist/build/navigation.css +21 -56
- package/dist/build/navigation.entry.js +148 -50
- package/dist/build/navigation.entry.js.map +1 -1
- package/dist/build/page.css +1 -1
- package/dist/build/popover.css +119 -0
- package/dist/build/popover.entry.js +2 -0
- package/dist/build/popover.entry.js.map +1 -0
- package/dist/build/section.css +1 -1
- package/dist/build/sticky.entry.js +11 -12
- package/dist/build/sticky.entry.js.map +1 -1
- package/dist/build/tabs.entry.js +108 -91
- package/dist/build/tabs.entry.js.map +1 -1
- package/dist/build/utility-list.css +43 -0
- package/dist/build/utility-list.entry.js +80 -0
- package/dist/build/utility-list.entry.js.map +1 -0
- package/package.json +9 -10
- package/src/Atom/{Base.mdx → Atom.mdx} +1 -1
- package/src/Atom/Background/Backgrounds.stories.ts +21 -4
- package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +1 -1
- package/src/Atom/Background/_background.css +1 -2
- package/src/Atom/Blockquote/_blockquote.css +1 -2
- package/src/Atom/Button/Button.stories.ts +128 -19
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +75 -11
- package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +1 -1
- package/src/Atom/Button/_buttons.css +5 -5
- package/src/Atom/DefinitionList/DefinitionList.stories.ts +20 -3
- package/src/Atom/DefinitionList/DefinitionList.stories.tsx +3 -9
- package/src/Atom/DefinitionList/DefinitionList.tsx +3 -4
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +1 -1
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
- package/src/Atom/Heading/Heading.stories.ts +49 -7
- package/src/Atom/Heading/Heading.tsx +1 -6
- package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +9 -1
- package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
- package/src/Atom/Heading/_headings.css +1 -2
- package/src/Atom/Icon/Icon.mdx +5 -1
- package/src/Atom/Icon/Icon.stories.ts +76 -6
- package/src/Atom/Icon/Icon.tsx +1 -8
- package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +18 -4
- package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +1 -1
- package/src/Atom/Icon/_icon.css +1 -1
- package/src/Atom/Image/Image.stories.ts +4 -3
- package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
- package/src/Atom/Link/Link.stories.ts +74 -7
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +4 -4
- package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +1 -1
- package/src/Atom/Media/Media.stories.ts +34 -5
- package/src/Atom/Media/Media.tsx +1 -6
- package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +2 -2
- package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +1 -1
- package/src/Atom/Media/_media.css +2 -10
- package/src/Atom/Spacing/Spacing.stories.ts +45 -31
- package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -4
- package/src/Atom/Spacing/spacing.twig +5 -2
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +1 -1
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
- package/src/Atom/Table/_table.css +1 -2
- package/src/Atom/Text/Text.stories.ts +62 -0
- package/src/Atom/Text/__snapshots__/{TextSizes.stories.ts.snap → Text.stories.ts.snap} +14 -27
- package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
- package/src/Atom/Text/_text-sizes.css +2 -4
- package/src/Atom/Text/text-style.twig +11 -1
- package/src/Atom/Text/text-styles-example.twig +2 -16
- package/src/Atom/Video/Video.stories.ts +6 -4
- package/src/Atom/Video/Video.tsx +1 -5
- package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +1 -1
- package/src/Atom/_generic.css +4 -4
- package/src/Atom/_hr.css +1 -2
- package/src/Component/Accordion/Accordion.stories.ts +26 -8
- package/src/Component/Accordion/Accordion.stories.tsx +8 -10
- package/src/Component/Accordion/Accordion.tsx +2 -13
- package/src/Component/Accordion/AccordionItem.stories.ts +90 -0
- package/src/Component/Accordion/Components/AccordionContent.tsx +1 -5
- package/src/Component/Accordion/Components/AccordionTitle.tsx +1 -4
- package/src/Component/Accordion/Elements/Accordion.ts +1 -1
- package/src/Component/Accordion/Elements/AccordionDiv.ts +4 -11
- package/src/Component/Accordion/Elements/AccordionGroup.ts +10 -24
- package/src/Component/Accordion/Elements/AccordionMobile.ts +4 -4
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +17 -6
- package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
- package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +90 -0
- package/src/Component/Accordion/accordion.css +7 -5
- package/src/Component/Accordion/twig/accordion-div.twig +13 -11
- package/src/Component/Accordion/twig/accordion-mobile.twig +13 -11
- package/src/Component/Breadcrumb/Breadcrumb.stories.ts +14 -0
- package/src/Component/Breadcrumb/Breadcrumb.tsx +2 -12
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +1 -1
- package/src/Component/Breadcrumb/breadcrumb.css +1 -4
- package/src/Component/Callout/Callout.stories.ts +20 -0
- package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +1 -1
- package/src/Component/Callout/callout.css +1 -2
- package/src/Component/Card/Card.stories.ts +129 -14
- package/src/Component/Card/Card.stories.tsx +2 -2
- package/src/Component/Card/Components/CardContent.tsx +1 -5
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +24 -24
- package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +1 -1
- package/src/Component/Card/card.css +2 -6
- package/src/Component/Card/card.twig +1 -1
- package/src/Component/Carousel/Carousel.stories.ts +61 -8
- package/src/Component/Carousel/Elements/Carousel.ts +10 -19
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +321 -35
- package/src/Component/Carousel/carousel.css +1 -2
- package/src/Component/ContentBlock/Components/ContentBlockContent.tsx +1 -5
- package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -4
- package/src/Component/ContentBlock/ContentBlock.stories.ts +63 -13
- package/src/Component/ContentBlock/ContentBlock.stories.tsx +2 -2
- package/src/Component/ContentBlock/ContentBlock.tsx +1 -5
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +11 -11
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
- package/src/Component/Dialog/Dialog.stories.ts +78 -21
- package/src/Component/Dialog/Dialog.stories.tsx +2 -3
- package/src/Component/Dialog/Elements/Dialog.ts +7 -16
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +8 -11
- package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
- package/src/Component/Dialog/dialog.css +1 -2
- package/src/Component/Dialog/dialog.twig +1 -1
- package/src/Component/DropMenu/Components/DropMenuContext.tsx +4 -12
- package/src/Component/DropMenu/DropMenu.stories.ts +60 -1
- package/src/Component/DropMenu/DropMenu.tsx +2 -7
- package/src/Component/DropMenu/Elements/DropMenu.ts +21 -91
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +53 -11
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
- package/src/Component/DropMenu/drop-menu.css +13 -41
- package/src/Component/DropMenu/drop-menu.twig +8 -6
- package/src/Component/Filters/Elements/Filters.ts +7 -11
- package/src/Component/Filters/FilterItem.stories.ts +180 -0
- package/src/Component/Filters/Filters.stories.ts +83 -8
- package/src/Component/Filters/__snapshots__/FilterItem.stories.ts.snap +135 -0
- package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +43 -41
- package/src/Component/Filters/filter-item.twig +1 -1
- package/src/Component/Filters/filters.css +33 -17
- package/src/Component/GlobalAlert/Elements/ClosableAlert.ts +8 -7
- package/src/Component/GlobalAlert/GlobalAlert.stories.ts +60 -12
- package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +1 -2
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +8 -6
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +3 -3
- package/src/Component/HeroBanner/HeroBanner.stories.ts +84 -7
- package/src/Component/HeroBanner/HeroBanner.stories.tsx +4 -4
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +91 -99
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
- package/src/Component/HeroSearch/HeroSearch.stories.ts +23 -4
- package/src/Component/HeroSearch/HeroSearch.stories.tsx +4 -4
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +10 -10
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +1 -1
- package/src/Component/InPageAlert/InPageAlert.stories.ts +76 -8
- package/src/Component/InPageAlert/InPageAlert.stories.tsx +1 -2
- package/src/Component/InPageAlert/InPageAlert.tsx +1 -4
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +80 -2
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +1 -1
- package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +7 -9
- package/src/Component/InPageNavigation/Hooks/useInPageNavigation.ts +3 -5
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +44 -9
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +32 -40
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +152 -5
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
- package/src/Component/LinkList/LinkList.stories.ts +23 -0
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +8 -8
- package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +1 -1
- package/src/Component/LinkList/link-list.css +1 -2
- package/src/Component/ListItem/Components/ListItemContent.tsx +1 -5
- package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -4
- package/src/Component/ListItem/ListItem.stories.ts +91 -11
- package/src/Component/ListItem/ListItem.stories.tsx +6 -7
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +1 -1
- package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +1 -1
- package/src/Component/ListItem/list-item.css +1 -2
- package/src/Component/Navigation/Components/DropdownLevel.tsx +5 -13
- package/src/Component/Navigation/Elements/Navigation.ts +6 -13
- package/src/Component/Navigation/Navigation.stories.ts +48 -0
- package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +1 -1
- package/src/Component/Navigation/_navigation-collapsible.css +2 -4
- package/src/Component/Navigation/_navigation-dropdown.css +10 -32
- package/src/Component/Navigation/_navigation-mega.css +1 -4
- package/src/Component/Navigation/_navigation.css +1 -4
- package/src/Component/Pagination/Components/PaginationContext.tsx +5 -19
- package/src/Component/Pagination/Components/PaginationItem.tsx +1 -5
- package/src/Component/Pagination/Pagination.stories.ts +28 -0
- package/src/Component/Pagination/Pagination.tsx +3 -11
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +3 -3
- package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
- package/src/Component/Pagination/pagination.css +1 -4
- package/src/Component/Popover/Elements/Popover.ts +55 -0
- package/src/Component/Popover/Popover.stories.ts +259 -0
- package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +508 -0
- package/src/Component/{DropMenu → Popover}/polyfills.js +6 -4
- package/src/Component/Popover/popover.css +113 -0
- package/src/Component/Popover/popover.entry.js +1 -0
- package/src/Component/Popover/popover.twig +27 -0
- package/src/Component/ResultsBar/Components/ResultsBarInfo.tsx +2 -7
- package/src/Component/ResultsBar/Components/ResultsBarSort.tsx +1 -6
- package/src/Component/ResultsBar/ResultsBar.stories.ts +34 -4
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +3 -3
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +1 -1
- package/src/Component/SideNavigation/SideNavigation.stories.ts +40 -0
- package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +1 -1
- package/src/Component/SideNavigation/side-navigation.css +3 -6
- package/src/Component/SocialLinks/SocialLinks.stories.ts +20 -0
- package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +5 -5
- package/src/Component/SocialShare/SocialShare.stories.ts +37 -0
- package/src/Component/SocialShare/SocialShare.tsx +2 -4
- package/src/Component/SocialShare/__snapshots__/SocialShare.stories.ts.snap +40 -0
- package/src/Component/SocialShare/__snapshots__/SocialShare.stories.tsx.snap +1 -1
- package/src/Component/SocialShare/social-share.twig +34 -0
- package/src/Component/Steps/StepItem.stories.ts +48 -0
- package/src/Component/Steps/Steps.stories.ts +82 -13
- package/src/Component/Steps/__snapshots__/StepItem.stories.ts.snap +31 -0
- package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +109 -28
- package/src/Component/Steps/step-item.twig +1 -1
- package/src/Component/Steps/steps.css +4 -11
- package/src/Component/Sticky/Elements/Sticky.ts +3 -8
- package/src/Component/Sticky/Sticky.stories.ts +35 -3
- package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +1 -1
- package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
- package/src/Component/Sticky/sticky.twig +1 -1
- package/src/Component/Tabs/Components/Tab.tsx +2 -8
- package/src/Component/Tabs/Components/TabPanel.tsx +1 -5
- package/src/Component/Tabs/Elements/Tabs.ts +21 -31
- package/src/Component/Tabs/TabItem.stories.ts +52 -0
- package/src/Component/Tabs/Tabs.stories.ts +51 -8
- package/src/Component/Tabs/Tabs.tsx +6 -22
- package/src/Component/Tabs/__snapshots__/TabItem.stories.ts.snap +12 -0
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +127 -11
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
- package/src/Component/Tabs/tab-item.twig +1 -2
- package/src/Component/Tabs/tabs.css +56 -59
- package/src/Component/Tag/Tag.stories.ts +30 -0
- package/src/Component/Tag/Tag.tsx +1 -5
- package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +1 -1
- package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
- package/src/Component/Tag/tag.css +1 -4
- package/src/Component/UtilityList/Elements/UtilityList.ts +110 -0
- package/src/Component/UtilityList/UtilityList.stories.ts +72 -0
- package/src/Component/UtilityList/__snapshots__/UtilityList.stories.ts.snap +274 -0
- package/src/Component/UtilityList/utility-list.css +40 -0
- package/src/Component/UtilityList/utility-list.entry.js +1 -0
- package/src/Component/UtilityList/utility-list.twig +66 -0
- package/src/Form/Checkbox/FormCheckbox.stories.tsx +1 -3
- package/src/Form/Checkbox/FormCheckbox.tsx +4 -25
- package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +3 -3
- package/src/Form/Description/Description.stories.ts +1 -2
- package/src/Form/Description/FormStatus.stories.ts +1 -4
- package/src/Form/Description/__snapshots__/Description.stories.ts.snap +1 -1
- package/src/Form/Description/__snapshots__/FormDescription.stories.tsx.snap +1 -1
- package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +3 -3
- package/src/Form/Form/Form.tsx +1 -3
- package/src/Form/Form/__snapshots__/Form.stories.tsx.snap +1 -1
- package/src/Form/Form/__snapshots__/FormTitle.stories.tsx.snap +1 -1
- package/src/Form/FormItem/FormItem.stories.ts +3 -9
- package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +18 -18
- package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +1 -1
- package/src/Form/Label/FormLabel.tsx +1 -5
- package/src/Form/Label/__snapshots__/FormLabel.stories.tsx.snap +1 -1
- package/src/Form/Label/__snapshots__/Label.stories.ts.snap +3 -3
- package/src/Form/Radio/FormRadio.stories.tsx +1 -3
- package/src/Form/Radio/FormRadio.tsx +4 -25
- package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +9 -9
- package/src/Form/Search/__snapshots__/Search.stories.ts.snap +1 -1
- package/src/Form/Select/FormSelect.tsx +3 -9
- package/src/Form/Select/__snapshots__/FormSelect.stories.tsx.snap +1 -1
- package/src/Form/Select/__snapshots__/Select.stories.ts.snap +2 -2
- package/src/Form/TextInput/FormText.tsx +3 -9
- package/src/Form/TextInput/TextInput.stories.ts +1 -4
- package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +1 -1
- package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +1 -1
- package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +3 -3
- package/src/Form/Textarea/FormTextarea.tsx +3 -9
- package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +1 -1
- package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +2 -2
- package/src/Form/form.css +6 -14
- package/src/Introduction.mdx +1 -2
- package/src/Layout/Footer/Footer.stories.ts +1 -5
- package/src/Layout/Footer/Footer.stories.tsx +2 -3
- package/src/Layout/Footer/Footer.tsx +3 -12
- package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +4 -4
- package/src/Layout/Footer/__snapshots__/Footer.stories.tsx.snap +1 -1
- package/src/Layout/Grid/Grid.stories.ts +40 -8
- package/src/Layout/Grid/Grid.tsx +1 -2
- package/src/Layout/Grid/GridItem.stories.ts +63 -0
- package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +29 -4
- package/src/Layout/Grid/__snapshots__/Grid.stories.tsx.snap +1 -1
- package/src/Layout/Grid/__snapshots__/GridItem.stories.ts.snap +19 -0
- package/src/Layout/Grid/grid-item.twig +3 -9
- package/src/Layout/Grid/grid.css +1 -4
- package/src/Layout/Header/Elements/GlobalToggle.ts +9 -29
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +25 -45
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
- package/src/Layout/Header/_toggles.css +2 -2
- package/src/Layout/Header/header.twig +1 -1
- package/src/Layout/Masthead/Masthead.stories.ts +1 -4
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +3 -3
- package/src/Layout/Page/Page.stories.tsx +2 -2
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +3 -3
- package/src/Layout/Page/page.css +2 -10
- package/src/Layout/Section/Background.stories.ts +14 -39
- package/src/Layout/Section/Breakouts.stories.ts +3 -0
- package/src/Layout/Section/Flow.stories.ts +3 -0
- package/src/Layout/Section/Section.stories.ts +93 -11
- package/src/Layout/Section/Section.tsx +3 -13
- package/src/Layout/Section/SectionGrid.tsx +2 -9
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +4 -4
- package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +1 -1
- package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +1 -1
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +93 -3
- package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +1 -1
- package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +1 -1
- package/src/Layout/Section/section.css +2 -5
- package/src/Layout/Section/section.twig +1 -3
- package/src/Layout/Sidebar/Sidebar.stories.ts +46 -4
- package/src/Layout/Sidebar/Sidebar.tsx +1 -3
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +4 -4
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +1 -1
- package/src/Utility/Context/ImageComponent.tsx +4 -8
- package/src/Utility/Context/LinkComponent.tsx +1 -5
- package/src/Utility/Drupal/drupal.css +2 -4
- package/src/Utility/Elements/breakpoint-loader.ts +4 -10
- package/src/Utility/Elements/cookie-compliance.ts +2 -8
- package/src/Utility/Elements/disclosure-widget.ts +11 -18
- package/src/Utility/Elements/io-loader.ts +4 -6
- package/src/Utility/Elements/keyboard.ts +4 -14
- package/src/Utility/Hooks/useLocalStorage.ts +5 -18
- package/src/Utility/Hooks/useMediaQuery.ts +1 -4
- package/src/Utility/Hooks/useToggle.ts +1 -3
- package/src/Utility/global.d.ts +1 -5
- package/src/Utility/utilities.ts +20 -45
- package/src/constants.css +7 -28
- package/src/enums.ts +3 -1
- package/src/react.ts +5 -21
- package/src/tokens.js +2 -2
- package/dist/build/chunks/disclosure-widget-DVpnRsTI.js +0 -126
- package/dist/build/chunks/disclosure-widget-DVpnRsTI.js.map +0 -1
- package/dist/build/chunks/drop-menu.entry-B4TtnC50.js +0 -132
- package/dist/build/chunks/drop-menu.entry-B4TtnC50.js.map +0 -1
- package/dist/build/chunks/keyboard-rvZ4dfGF.js +0 -104
- package/dist/build/chunks/keyboard-rvZ4dfGF.js.map +0 -1
- package/dist/build/chunks/polyfills-C-B7iqDG.js.map +0 -1
- package/dist/build/chunks/utilities-DXELy_An.js.map +0 -1
- package/src/Atom/Text/TextSizes.stories.ts +0 -25
- package/src/Atom/Text/text-alignment.twig +0 -5
- package/src/Component/Accordion/twig/accordion-example.twig +0 -36
- package/src/Component/Tile/README.md +0 -3
- package/src/Component/Tile/Tile.stories.ts +0 -49
- package/src/Component/Tile/Tile.stories.tsx +0 -35
- package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +0 -57
- package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +0 -23
|
@@ -24,8 +24,7 @@ type TabContextValues = {
|
|
|
24
24
|
tabsId: string
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const TabContext: Context<TabContextValues> =
|
|
28
|
-
createContext<TabContextValues>(null)
|
|
27
|
+
const TabContext: Context<TabContextValues> = createContext<TabContextValues>(null)
|
|
29
28
|
export const useTabContext = () => use(TabContext)
|
|
30
29
|
|
|
31
30
|
type TabsProps = PropsWithChildren & {
|
|
@@ -39,24 +38,15 @@ const Tabs = ({ children, active, modifier, id }: TabsProps): JSX.Element => {
|
|
|
39
38
|
const [activeTabLabel, setActiveTabLabel] = useState<string>("Tabs")
|
|
40
39
|
const tabsId: string = id || useId()
|
|
41
40
|
|
|
42
|
-
const handleClick = (
|
|
43
|
-
event: MouseEvent | KeyboardEvent,
|
|
44
|
-
key: string,
|
|
45
|
-
): void => {
|
|
41
|
+
const handleClick = (event: MouseEvent | KeyboardEvent, key: string): void => {
|
|
46
42
|
setActiveTab(key)
|
|
47
43
|
const target = event.target as HTMLButtonElement
|
|
48
44
|
setActiveTabLabel(target.textContent)
|
|
49
45
|
if (typeof window === "undefined") return
|
|
50
|
-
const urlParams: URLSearchParams = new URLSearchParams(
|
|
51
|
-
window.location.search,
|
|
52
|
-
)
|
|
46
|
+
const urlParams: URLSearchParams = new URLSearchParams(window.location.search)
|
|
53
47
|
if (urlParams.get("tab") === key) return
|
|
54
48
|
urlParams.set("tab", key)
|
|
55
|
-
window.history.replaceState(
|
|
56
|
-
{},
|
|
57
|
-
"",
|
|
58
|
-
`${window.location.pathname}?${urlParams.toString()}`,
|
|
59
|
-
)
|
|
49
|
+
window.history.replaceState({}, "", `${window.location.pathname}?${urlParams.toString()}`)
|
|
60
50
|
}
|
|
61
51
|
|
|
62
52
|
useEffect(() => {
|
|
@@ -66,9 +56,7 @@ const Tabs = ({ children, active, modifier, id }: TabsProps): JSX.Element => {
|
|
|
66
56
|
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
67
57
|
setActiveTab(tabParam)
|
|
68
58
|
}
|
|
69
|
-
const label: string = document.querySelector(
|
|
70
|
-
`[aria-controls="${activeTab}"]`,
|
|
71
|
-
)?.textContent
|
|
59
|
+
const label: string = document.querySelector(`[aria-controls="${activeTab}"]`)?.textContent
|
|
72
60
|
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
73
61
|
if (label) setActiveTabLabel(label)
|
|
74
62
|
}, [activeTab])
|
|
@@ -80,11 +68,7 @@ const Tabs = ({ children, active, modifier, id }: TabsProps): JSX.Element => {
|
|
|
80
68
|
|
|
81
69
|
return (
|
|
82
70
|
<TabContext value={values}>
|
|
83
|
-
<DropMenuProvider
|
|
84
|
-
id={tabsId}
|
|
85
|
-
onClick={handleClick}
|
|
86
|
-
selectedItem={[activeTab]}
|
|
87
|
-
>
|
|
71
|
+
<DropMenuProvider id={tabsId} onClick={handleClick} selectedItem={[activeTab]}>
|
|
88
72
|
<div
|
|
89
73
|
className={classNames("mx-tabs", {
|
|
90
74
|
[`mx-tabs--${modifier}`]: modifier,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
+
|
|
3
|
+
exports[`Component/Tabs/TabItem TabItem smoke-test 1`] = `
|
|
4
|
+
<div class="mx-page default">
|
|
5
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
6
|
+
id="tab-1"
|
|
7
|
+
data-tab="Funk"
|
|
8
|
+
>
|
|
9
|
+
Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
`;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`Component/Tabs Tabs smoke-test 1`] = `
|
|
4
4
|
<div class="mx-page default">
|
|
5
|
-
<mx-tabs class="mx-tabs mx-tabs--lined"
|
|
5
|
+
<mx-tabs class="mx-tabs mx-tabs--lined"
|
|
6
|
+
id="tab-example"
|
|
7
|
+
>
|
|
6
8
|
<mx-dropmenu closeonclick="true">
|
|
7
9
|
<button id="unique-0"
|
|
8
|
-
class="mx-
|
|
9
|
-
popovertarget="tab-
|
|
10
|
+
class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end"
|
|
11
|
+
popovertarget="tab-example"
|
|
12
|
+
style="anchor-name: --tab-example"
|
|
10
13
|
hidden
|
|
11
14
|
>
|
|
12
15
|
Funk
|
|
13
16
|
</button>
|
|
14
|
-
<div class="mx-drop-menu"
|
|
15
|
-
id="tab-
|
|
16
|
-
aria-
|
|
17
|
-
|
|
17
|
+
<div class="mx-popover mx-drop-menu"
|
|
18
|
+
id="tab-example"
|
|
19
|
+
aria-describedby="unique-0"
|
|
20
|
+
style="position-anchor: --tab-example"
|
|
21
|
+
data-placement="bottom-start"
|
|
18
22
|
popover
|
|
19
23
|
role="tablist"
|
|
20
24
|
>
|
|
@@ -69,16 +73,18 @@ exports[`Component/Tabs Tabs smoke-test 1`] = `
|
|
|
69
73
|
Motown
|
|
70
74
|
</button>
|
|
71
75
|
</div>
|
|
72
|
-
<div class="mx-tabs__panel mx-vertical-flow mx-container
|
|
76
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
73
77
|
id="unique-1"
|
|
78
|
+
data-tab="Funk"
|
|
74
79
|
role="tabpanel"
|
|
75
80
|
tabindex="0"
|
|
76
81
|
aria-label="Funk"
|
|
77
82
|
>
|
|
78
83
|
Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
79
84
|
</div>
|
|
80
|
-
<div class="mx-tabs__panel mx-vertical-flow mx-container
|
|
85
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
81
86
|
id="unique-2"
|
|
87
|
+
data-tab="Soul"
|
|
82
88
|
role="tabpanel"
|
|
83
89
|
tabindex="0"
|
|
84
90
|
aria-label="Soul"
|
|
@@ -86,8 +92,118 @@ exports[`Component/Tabs Tabs smoke-test 1`] = `
|
|
|
86
92
|
>
|
|
87
93
|
Soul music ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem.
|
|
88
94
|
</div>
|
|
89
|
-
<div class="mx-tabs__panel mx-vertical-flow mx-container
|
|
95
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
90
96
|
id="unique-3"
|
|
97
|
+
data-tab="Motown"
|
|
98
|
+
role="tabpanel"
|
|
99
|
+
tabindex="0"
|
|
100
|
+
aria-label="Motown"
|
|
101
|
+
inert
|
|
102
|
+
>
|
|
103
|
+
Motown lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
104
|
+
</div>
|
|
105
|
+
</mx-tabs>
|
|
106
|
+
</div>
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
exports[`Component/Tabs WithHeading smoke-test 1`] = `
|
|
110
|
+
<div class="mx-page default">
|
|
111
|
+
<h2>
|
|
112
|
+
Tabs heading
|
|
113
|
+
</h2>
|
|
114
|
+
<mx-tabs class="mx-tabs mx-tabs--lined"
|
|
115
|
+
id="tab-example"
|
|
116
|
+
>
|
|
117
|
+
<mx-dropmenu closeonclick="true">
|
|
118
|
+
<button id="unique-0"
|
|
119
|
+
class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end"
|
|
120
|
+
popovertarget="tab-example"
|
|
121
|
+
style="anchor-name: --tab-example"
|
|
122
|
+
hidden
|
|
123
|
+
>
|
|
124
|
+
Funk
|
|
125
|
+
</button>
|
|
126
|
+
<div class="mx-popover mx-drop-menu"
|
|
127
|
+
id="tab-example"
|
|
128
|
+
aria-describedby="unique-0"
|
|
129
|
+
style="position-anchor: --tab-example"
|
|
130
|
+
data-placement="bottom-start"
|
|
131
|
+
popover
|
|
132
|
+
role="tablist"
|
|
133
|
+
>
|
|
134
|
+
<button type="button"
|
|
135
|
+
role="tab"
|
|
136
|
+
aria-controls="unique-1"
|
|
137
|
+
aria-selected="false"
|
|
138
|
+
>
|
|
139
|
+
Funk
|
|
140
|
+
</button>
|
|
141
|
+
<button type="button"
|
|
142
|
+
role="tab"
|
|
143
|
+
aria-controls="unique-2"
|
|
144
|
+
aria-selected="false"
|
|
145
|
+
>
|
|
146
|
+
Soul
|
|
147
|
+
</button>
|
|
148
|
+
<button type="button"
|
|
149
|
+
role="tab"
|
|
150
|
+
aria-controls="unique-3"
|
|
151
|
+
aria-selected="false"
|
|
152
|
+
>
|
|
153
|
+
Motown
|
|
154
|
+
</button>
|
|
155
|
+
</div>
|
|
156
|
+
</mx-dropmenu>
|
|
157
|
+
<div class="mx-tabs__list"
|
|
158
|
+
role="tablist"
|
|
159
|
+
>
|
|
160
|
+
<button type="button"
|
|
161
|
+
role="tab"
|
|
162
|
+
aria-controls="unique-4"
|
|
163
|
+
aria-selected="true"
|
|
164
|
+
tab-index="0"
|
|
165
|
+
>
|
|
166
|
+
Funk
|
|
167
|
+
</button>
|
|
168
|
+
<button type="button"
|
|
169
|
+
role="tab"
|
|
170
|
+
aria-controls="unique-5"
|
|
171
|
+
aria-selected="false"
|
|
172
|
+
tab-index="-1"
|
|
173
|
+
>
|
|
174
|
+
Soul
|
|
175
|
+
</button>
|
|
176
|
+
<button type="button"
|
|
177
|
+
role="tab"
|
|
178
|
+
aria-controls="unique-6"
|
|
179
|
+
aria-selected="false"
|
|
180
|
+
tab-index="-1"
|
|
181
|
+
>
|
|
182
|
+
Motown
|
|
183
|
+
</button>
|
|
184
|
+
</div>
|
|
185
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
186
|
+
id="unique-1"
|
|
187
|
+
data-tab="Funk"
|
|
188
|
+
role="tabpanel"
|
|
189
|
+
tabindex="0"
|
|
190
|
+
aria-label="Funk"
|
|
191
|
+
>
|
|
192
|
+
Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
|
|
193
|
+
</div>
|
|
194
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
195
|
+
id="unique-2"
|
|
196
|
+
data-tab="Soul"
|
|
197
|
+
role="tabpanel"
|
|
198
|
+
tabindex="0"
|
|
199
|
+
aria-label="Soul"
|
|
200
|
+
inert
|
|
201
|
+
>
|
|
202
|
+
Soul music ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem.
|
|
203
|
+
</div>
|
|
204
|
+
<div class="mx-tabs__panel mx-vertical-flow mx-container"
|
|
205
|
+
id="unique-3"
|
|
206
|
+
data-tab="Motown"
|
|
91
207
|
role="tabpanel"
|
|
92
208
|
tabindex="0"
|
|
93
209
|
aria-label="Motown"
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
baseClass,
|
|
4
4
|
'mx-vertical-flow',
|
|
5
5
|
'mx-container',
|
|
6
|
-
'mx-section--l'
|
|
7
6
|
] %}
|
|
8
7
|
{% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
|
|
9
|
-
<div{{ attributes }} id="{{ id }}"
|
|
8
|
+
<div{{ attributes }} id="{{ id }}" data-tab="{{ title }}"{% if active %} data-active{% endif %}>
|
|
10
9
|
{{ content }}
|
|
11
10
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
@layer design-system.defaults {
|
|
6
|
-
|
|
6
|
+
mx-tabs {
|
|
7
7
|
display: block;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -18,81 +18,78 @@
|
|
|
18
18
|
margin-block-start: var(--flow-gap, var(--gap));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
&:not(:defined) {
|
|
22
|
+
gap: var(--flow-gap, var(--gap));
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
& mx-dropmenu {
|
|
22
26
|
grid-area: tabs;
|
|
23
27
|
}
|
|
28
|
+
}
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
.mx-tabs__list {
|
|
31
|
+
grid-area: tabs;
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
@media (--medium-up) {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
gap: var(--spacing-xxs);
|
|
37
|
+
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color: var(
|
|
46
|
-
|
|
47
|
-
var(--foreground, var(--colour-foreground))
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
&[aria-selected="true"] {
|
|
51
|
-
background-color: var(
|
|
52
|
-
--tab-active-background,
|
|
53
|
-
var(--colour-background-alt)
|
|
54
|
-
);
|
|
55
|
-
color: var(--tab-active-foreground, var(--colour-foreground));
|
|
56
|
-
}
|
|
39
|
+
& button {
|
|
40
|
+
border: 0;
|
|
41
|
+
display: block;
|
|
42
|
+
font-family: inherit;
|
|
43
|
+
min-inline-size: var(--tab-min-width, 0);
|
|
44
|
+
padding-block: var(--vertical-padding, var(--spacing-xxs));
|
|
45
|
+
padding-inline: var(--horizontal-padding, var(--spacing-m));
|
|
46
|
+
background-color: var(--tab-background, var(--background, var(--colour-background)));
|
|
47
|
+
color: var(--tab-foreground, var(--foreground, var(--colour-foreground)));
|
|
48
|
+
|
|
49
|
+
&[aria-selected="true"] {
|
|
50
|
+
background-color: var(--tab-active-background, var(--colour-background-alt));
|
|
51
|
+
color: var(--tab-active-foreground, var(--colour-foreground));
|
|
57
52
|
}
|
|
58
53
|
}
|
|
54
|
+
}
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
opacity: 1;
|
|
56
|
+
.mx-tabs__panel {
|
|
57
|
+
inline-size: 100%;
|
|
58
|
+
opacity: 1;
|
|
64
59
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
@starting-style {
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
64
|
+
&[inert] {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
transition-duration: 0.4s;
|
|
73
67
|
}
|
|
68
|
+
}
|
|
74
69
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
.mx-tabs:defined .mx-tabs__panel {
|
|
71
|
+
grid-area: panels;
|
|
72
|
+
padding: var(--tab-panels-padding, var(--section-l, var(--spacing-xl)) 0);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.mx-tabs--lined {
|
|
76
|
+
@media (--medium-up) {
|
|
77
|
+
& .mx-tabs__list {
|
|
78
|
+
border-block-end: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
|
|
79
|
+
|
|
80
|
+
& button {
|
|
81
|
+
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
|
82
|
+
border: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
|
|
83
|
+
border-block-end: 0;
|
|
87
84
|
}
|
|
88
85
|
}
|
|
89
86
|
}
|
|
87
|
+
}
|
|
90
88
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
89
|
+
.mx-tabs--centered {
|
|
90
|
+
@media (--medium-up) {
|
|
91
|
+
& .mx-tabs__list {
|
|
92
|
+
place-content: center;
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
}
|
|
@@ -3,6 +3,9 @@ import Component from "./tags.twig"
|
|
|
3
3
|
import "./tag.css"
|
|
4
4
|
import { Tags as TagType, TagTypes } from "@pnx-mixtape/ids-shape"
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Tags can help categorise content.
|
|
8
|
+
*/
|
|
6
9
|
const meta: Meta<TagType> = {
|
|
7
10
|
tags: ["autodocs", "ids-mvp"],
|
|
8
11
|
component: Component,
|
|
@@ -10,6 +13,27 @@ const meta: Meta<TagType> = {
|
|
|
10
13
|
items: ["Music", "News"],
|
|
11
14
|
type: TagTypes.TEXT,
|
|
12
15
|
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
type: {
|
|
18
|
+
description:
|
|
19
|
+
"Define the type of the tags. Changing the type also requires a different item shape.",
|
|
20
|
+
options: Object.values(TagTypes),
|
|
21
|
+
control: "radio",
|
|
22
|
+
table: {
|
|
23
|
+
defaultValue: { summary: TagTypes.TEXT },
|
|
24
|
+
type: { summary: "enum" },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
items: {
|
|
28
|
+
description: "A list of items to use for the tags, which is different for each `type`.",
|
|
29
|
+
table: {
|
|
30
|
+
type: {
|
|
31
|
+
summary:
|
|
32
|
+
"string[] | { title: string, href: string }[] | { label: string, id: string, name: string, value: string }[]",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
13
37
|
}
|
|
14
38
|
|
|
15
39
|
export default meta
|
|
@@ -17,6 +41,9 @@ type Story = StoryObj<TagType>
|
|
|
17
41
|
|
|
18
42
|
export const Tag: Story = {}
|
|
19
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Tags can be links.
|
|
46
|
+
*/
|
|
20
47
|
export const Link: Story = {
|
|
21
48
|
args: {
|
|
22
49
|
type: TagTypes.LINK,
|
|
@@ -33,6 +60,9 @@ export const Link: Story = {
|
|
|
33
60
|
},
|
|
34
61
|
}
|
|
35
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Tags can also be checkboxes, often used for filters.
|
|
65
|
+
*/
|
|
36
66
|
export const Checkbox: Story = {
|
|
37
67
|
args: {
|
|
38
68
|
type: TagTypes.CHECKBOX,
|
|
@@ -7,11 +7,7 @@ type TagProps = PropsWithChildren & {
|
|
|
7
7
|
as?: AsTags
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const Tag = ({
|
|
11
|
-
children,
|
|
12
|
-
className,
|
|
13
|
-
as = AsTags.DIV,
|
|
14
|
-
}: TagProps): JSX.Element => {
|
|
10
|
+
const Tag = ({ children, className, as = AsTags.DIV }: TagProps): JSX.Element => {
|
|
15
11
|
const Tag: JSX.ElementType = `${as}` as unknown as JSX.ElementType
|
|
16
12
|
return <Tag className={classNames("mx-tag", className)}>{children}</Tag>
|
|
17
13
|
}
|
|
@@ -7,10 +7,7 @@
|
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
inline-size: fit-content;
|
|
9
9
|
padding-inline: var(--horizontal-padding, var(--spacing-xxxs));
|
|
10
|
-
background: var(
|
|
11
|
-
--tag-background,
|
|
12
|
-
var(--background, var(--colour-background))
|
|
13
|
-
);
|
|
10
|
+
background: var(--tag-background, var(--background, var(--colour-background)));
|
|
14
11
|
color: var(--tag-foreground, var(--foreground, var(--colour-foreground)));
|
|
15
12
|
text-transform: uppercase;
|
|
16
13
|
font-weight: var(--font-weight, var(--font-weight-bold));
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UtilityList
|
|
3
|
+
* @file Support copy and print functions.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default class UtilityList extends HTMLElement {
|
|
7
|
+
internals_: ElementInternals
|
|
8
|
+
controller: AbortController
|
|
9
|
+
copyOriginalText?: string
|
|
10
|
+
copyOriginalIcon?: string
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super()
|
|
14
|
+
this.internals_ = this.attachInternals()
|
|
15
|
+
this.controller = new AbortController()
|
|
16
|
+
this.copyOriginalIcon = "mx-icon--link"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
connectedCallback(): void {
|
|
20
|
+
const { signal }: AbortController = this.controller
|
|
21
|
+
|
|
22
|
+
// Handle copy.
|
|
23
|
+
this.copyBtn?.addEventListener(
|
|
24
|
+
"click",
|
|
25
|
+
(): void => {
|
|
26
|
+
void this.handleCopy()
|
|
27
|
+
},
|
|
28
|
+
{ signal },
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
// Handle print.
|
|
32
|
+
this.printBtn?.addEventListener(
|
|
33
|
+
"click",
|
|
34
|
+
(): void => {
|
|
35
|
+
this.handlePrint()
|
|
36
|
+
},
|
|
37
|
+
{ signal },
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
// Handle PDF.
|
|
41
|
+
this.pdfBtn?.addEventListener(
|
|
42
|
+
"click",
|
|
43
|
+
(): void => {
|
|
44
|
+
this.handlePDF()
|
|
45
|
+
},
|
|
46
|
+
{ signal },
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
disconnectedCallback(): void {
|
|
51
|
+
this.controller.abort()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
handleCopy = async (): Promise<void> => {
|
|
55
|
+
try {
|
|
56
|
+
await navigator.clipboard
|
|
57
|
+
.write([
|
|
58
|
+
new ClipboardItem({
|
|
59
|
+
["text/plain"]: window.location.href,
|
|
60
|
+
}),
|
|
61
|
+
])
|
|
62
|
+
.then(() => {
|
|
63
|
+
this.copyLabel.textContent = "Copied!"
|
|
64
|
+
this.copyIcon.classList.replace(this.copyOriginalIcon, "mx-icon--tick")
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
this.copyLabel.textContent = this.copyOriginalText
|
|
67
|
+
this.copyIcon.classList.replace("mx-icon--tick", this.copyOriginalIcon)
|
|
68
|
+
}, 3000)
|
|
69
|
+
})
|
|
70
|
+
} catch {
|
|
71
|
+
console.error("Could not copy the url to clipboard")
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
handlePrint = (): void => window.print()
|
|
76
|
+
|
|
77
|
+
// Defaults to Print dialog, to allow Save to PDF.
|
|
78
|
+
// if this needs to be changed, please extend the class.
|
|
79
|
+
handlePDF = (): void => window.print()
|
|
80
|
+
|
|
81
|
+
get copyBtn(): HTMLButtonElement | null {
|
|
82
|
+
return this.querySelector("button[data-copy]")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
get copyLabel(): HTMLSpanElement | null {
|
|
86
|
+
const el: HTMLSpanElement = this.copyBtn.querySelector("span[data-copy-label]")
|
|
87
|
+
this.copyOriginalText = el?.textContent ?? undefined
|
|
88
|
+
return el
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get copyIcon(): HTMLSpanElement | null {
|
|
92
|
+
return this.copyBtn.querySelector(".mx-icon")
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get printBtn(): HTMLButtonElement | null {
|
|
96
|
+
return this.querySelector("button[data-print]")
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get pdfBtn(): HTMLButtonElement | null {
|
|
100
|
+
return this.querySelector("button[data-pdf]")
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!customElements.get("mx-utility-list")) customElements.define("mx-utility-list", UtilityList)
|
|
105
|
+
|
|
106
|
+
declare global {
|
|
107
|
+
interface HTMLElementTagNameMap {
|
|
108
|
+
"mx-utility-list": UtilityList
|
|
109
|
+
}
|
|
110
|
+
}
|