@pnx-mixtape/mxds 0.0.22 → 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 +17 -39
- package/dist/build/button.css +9 -10
- 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.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 +9 -23
- 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 +4 -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 +2 -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 +16 -16
- package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +1 -1
- package/src/Component/Card/card.css +2 -6
- 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 +288 -2
- 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 +2 -6
- 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 +97 -16
- 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 +5 -5
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
- 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
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
class UtilityList extends HTMLElement {
|
|
2
|
+
internals_;
|
|
3
|
+
controller;
|
|
4
|
+
copyOriginalText;
|
|
5
|
+
copyOriginalIcon;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.internals_ = this.attachInternals();
|
|
9
|
+
this.controller = new AbortController();
|
|
10
|
+
this.copyOriginalIcon = "mx-icon--link";
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
const { signal } = this.controller;
|
|
14
|
+
this.copyBtn?.addEventListener(
|
|
15
|
+
"click",
|
|
16
|
+
() => {
|
|
17
|
+
void this.handleCopy();
|
|
18
|
+
},
|
|
19
|
+
{ signal }
|
|
20
|
+
);
|
|
21
|
+
this.printBtn?.addEventListener(
|
|
22
|
+
"click",
|
|
23
|
+
() => {
|
|
24
|
+
this.handlePrint();
|
|
25
|
+
},
|
|
26
|
+
{ signal }
|
|
27
|
+
);
|
|
28
|
+
this.pdfBtn?.addEventListener(
|
|
29
|
+
"click",
|
|
30
|
+
() => {
|
|
31
|
+
this.handlePDF();
|
|
32
|
+
},
|
|
33
|
+
{ signal }
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
this.controller.abort();
|
|
38
|
+
}
|
|
39
|
+
handleCopy = async () => {
|
|
40
|
+
try {
|
|
41
|
+
await navigator.clipboard.write([
|
|
42
|
+
new ClipboardItem({
|
|
43
|
+
["text/plain"]: window.location.href
|
|
44
|
+
})
|
|
45
|
+
]).then(() => {
|
|
46
|
+
this.copyLabel.textContent = "Copied!";
|
|
47
|
+
this.copyIcon.classList.replace(this.copyOriginalIcon, "mx-icon--tick");
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
this.copyLabel.textContent = this.copyOriginalText;
|
|
50
|
+
this.copyIcon.classList.replace("mx-icon--tick", this.copyOriginalIcon);
|
|
51
|
+
}, 3e3);
|
|
52
|
+
});
|
|
53
|
+
} catch {
|
|
54
|
+
console.error("Could not copy the url to clipboard");
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
handlePrint = () => window.print();
|
|
58
|
+
// Defaults to Print dialog, to allow Save to PDF.
|
|
59
|
+
// if this needs to be changed, please extend the class.
|
|
60
|
+
handlePDF = () => window.print();
|
|
61
|
+
get copyBtn() {
|
|
62
|
+
return this.querySelector("button[data-copy]");
|
|
63
|
+
}
|
|
64
|
+
get copyLabel() {
|
|
65
|
+
const el = this.copyBtn.querySelector("span[data-copy-label]");
|
|
66
|
+
this.copyOriginalText = el?.textContent ?? void 0;
|
|
67
|
+
return el;
|
|
68
|
+
}
|
|
69
|
+
get copyIcon() {
|
|
70
|
+
return this.copyBtn.querySelector(".mx-icon");
|
|
71
|
+
}
|
|
72
|
+
get printBtn() {
|
|
73
|
+
return this.querySelector("button[data-print]");
|
|
74
|
+
}
|
|
75
|
+
get pdfBtn() {
|
|
76
|
+
return this.querySelector("button[data-pdf]");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!customElements.get("mx-utility-list")) customElements.define("mx-utility-list", UtilityList);
|
|
80
|
+
//# sourceMappingURL=utility-list.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility-list.entry.js","sources":["../../src/Component/UtilityList/Elements/UtilityList.ts"],"sourcesContent":["/**\n * UtilityList\n * @file Support copy and print functions.\n */\n\nexport default class UtilityList extends HTMLElement {\n internals_: ElementInternals\n controller: AbortController\n copyOriginalText?: string\n copyOriginalIcon?: string\n\n constructor() {\n super()\n this.internals_ = this.attachInternals()\n this.controller = new AbortController()\n this.copyOriginalIcon = \"mx-icon--link\"\n }\n\n connectedCallback(): void {\n const { signal }: AbortController = this.controller\n\n // Handle copy.\n this.copyBtn?.addEventListener(\n \"click\",\n (): void => {\n void this.handleCopy()\n },\n { signal },\n )\n\n // Handle print.\n this.printBtn?.addEventListener(\n \"click\",\n (): void => {\n this.handlePrint()\n },\n { signal },\n )\n\n // Handle PDF.\n this.pdfBtn?.addEventListener(\n \"click\",\n (): void => {\n this.handlePDF()\n },\n { signal },\n )\n }\n\n disconnectedCallback(): void {\n this.controller.abort()\n }\n\n handleCopy = async (): Promise<void> => {\n try {\n await navigator.clipboard\n .write([\n new ClipboardItem({\n [\"text/plain\"]: window.location.href,\n }),\n ])\n .then(() => {\n this.copyLabel.textContent = \"Copied!\"\n this.copyIcon.classList.replace(this.copyOriginalIcon, \"mx-icon--tick\")\n setTimeout(() => {\n this.copyLabel.textContent = this.copyOriginalText\n this.copyIcon.classList.replace(\"mx-icon--tick\", this.copyOriginalIcon)\n }, 3000)\n })\n } catch {\n console.error(\"Could not copy the url to clipboard\")\n }\n }\n\n handlePrint = (): void => window.print()\n\n // Defaults to Print dialog, to allow Save to PDF.\n // if this needs to be changed, please extend the class.\n handlePDF = (): void => window.print()\n\n get copyBtn(): HTMLButtonElement | null {\n return this.querySelector(\"button[data-copy]\")\n }\n\n get copyLabel(): HTMLSpanElement | null {\n const el: HTMLSpanElement = this.copyBtn.querySelector(\"span[data-copy-label]\")\n this.copyOriginalText = el?.textContent ?? undefined\n return el\n }\n\n get copyIcon(): HTMLSpanElement | null {\n return this.copyBtn.querySelector(\".mx-icon\")\n }\n\n get printBtn(): HTMLButtonElement | null {\n return this.querySelector(\"button[data-print]\")\n }\n\n get pdfBtn(): HTMLButtonElement | null {\n return this.querySelector(\"button[data-pdf]\")\n }\n}\n\nif (!customElements.get(\"mx-utility-list\")) customElements.define(\"mx-utility-list\", UtilityList)\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"mx-utility-list\": UtilityList\n }\n}\n"],"names":[],"mappings":"AAKA,MAAqB,oBAAoB,YAAY;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,cAAc;AACZ,UAAA;AACA,SAAK,aAAa,KAAK,gBAAA;AACvB,SAAK,aAAa,IAAI,gBAAA;AACtB,SAAK,mBAAmB;AAAA,EAC1B;AAAA,EAEA,oBAA0B;AACxB,UAAM,EAAE,WAA4B,KAAK;AAGzC,SAAK,SAAS;AAAA,MACZ;AAAA,MACA,MAAY;AACV,aAAK,KAAK,WAAA;AAAA,MACZ;AAAA,MACA,EAAE,OAAA;AAAA,IAAO;AAIX,SAAK,UAAU;AAAA,MACb;AAAA,MACA,MAAY;AACV,aAAK,YAAA;AAAA,MACP;AAAA,MACA,EAAE,OAAA;AAAA,IAAO;AAIX,SAAK,QAAQ;AAAA,MACX;AAAA,MACA,MAAY;AACV,aAAK,UAAA;AAAA,MACP;AAAA,MACA,EAAE,OAAA;AAAA,IAAO;AAAA,EAEb;AAAA,EAEA,uBAA6B;AAC3B,SAAK,WAAW,MAAA;AAAA,EAClB;AAAA,EAEA,aAAa,YAA2B;AACtC,QAAI;AACF,YAAM,UAAU,UACb,MAAM;AAAA,QACL,IAAI,cAAc;AAAA,UAChB,CAAC,YAAY,GAAG,OAAO,SAAS;AAAA,QAAA,CACjC;AAAA,MAAA,CACF,EACA,KAAK,MAAM;AACV,aAAK,UAAU,cAAc;AAC7B,aAAK,SAAS,UAAU,QAAQ,KAAK,kBAAkB,eAAe;AACtE,mBAAW,MAAM;AACf,eAAK,UAAU,cAAc,KAAK;AAClC,eAAK,SAAS,UAAU,QAAQ,iBAAiB,KAAK,gBAAgB;AAAA,QACxE,GAAG,GAAI;AAAA,MACT,CAAC;AAAA,IACL,QAAQ;AACN,cAAQ,MAAM,qCAAqC;AAAA,IACrD;AAAA,EACF;AAAA,EAEA,cAAc,MAAY,OAAO,MAAA;AAAA;AAAA;AAAA,EAIjC,YAAY,MAAY,OAAO,MAAA;AAAA,EAE/B,IAAI,UAAoC;AACtC,WAAO,KAAK,cAAc,mBAAmB;AAAA,EAC/C;AAAA,EAEA,IAAI,YAAoC;AACtC,UAAM,KAAsB,KAAK,QAAQ,cAAc,uBAAuB;AAC9E,SAAK,mBAAmB,IAAI,eAAe;AAC3C,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,WAAmC;AACrC,WAAO,KAAK,QAAQ,cAAc,UAAU;AAAA,EAC9C;AAAA,EAEA,IAAI,WAAqC;AACvC,WAAO,KAAK,cAAc,oBAAoB;AAAA,EAChD;AAAA,EAEA,IAAI,SAAmC;AACrC,WAAO,KAAK,cAAc,kBAAkB;AAAA,EAC9C;AACF;AAEA,IAAI,CAAC,eAAe,IAAI,iBAAiB,EAAG,gBAAe,OAAO,mBAAmB,WAAW;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnx-mixtape/mxds",
|
|
3
3
|
"description": "The Mixtape Design System",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.23",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/dom": "^1.7.3",
|
|
7
7
|
"@oddbird/popover-polyfill": "^0.6.1",
|
|
@@ -20,14 +20,13 @@
|
|
|
20
20
|
"@csstools/postcss-global-data": "^3.0.0",
|
|
21
21
|
"@csstools/stylelint-formatter-github": "^1.0.0",
|
|
22
22
|
"@rollup/plugin-terser": "^0.4.4",
|
|
23
|
-
"@storybook/addon-a11y": "^
|
|
24
|
-
"@storybook/addon-docs": "^
|
|
25
|
-
"@storybook/addon-links": "^
|
|
26
|
-
"@storybook/html": "^
|
|
27
|
-
"@storybook/
|
|
28
|
-
"@storybook/react": "^
|
|
29
|
-
"@storybook/
|
|
30
|
-
"@storybook/test-runner": "^0.23.0",
|
|
23
|
+
"@storybook/addon-a11y": "^10.0.7",
|
|
24
|
+
"@storybook/addon-docs": "^10.0.7",
|
|
25
|
+
"@storybook/addon-links": "^10.0.7",
|
|
26
|
+
"@storybook/html-vite": "^10.0.7",
|
|
27
|
+
"@storybook/react": "^10.0.7",
|
|
28
|
+
"@storybook/react-vite": "^10.0.7",
|
|
29
|
+
"@storybook/test-runner": "^0.24.1",
|
|
31
30
|
"@svgr/rollup": "^8.1.0",
|
|
32
31
|
"@testing-library/dom": "^10.4.1",
|
|
33
32
|
"@testing-library/jest-dom": "^6.7.0",
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
"postcss-preset-env": "^10.2.4",
|
|
56
55
|
"postcss-pxtorem": "^6.1.0",
|
|
57
56
|
"prettier": "^3.6.2",
|
|
58
|
-
"storybook": "^
|
|
57
|
+
"storybook": "^10.0.7",
|
|
59
58
|
"stylelint": "^16.23.1",
|
|
60
59
|
"stylelint-config-standard": "^39.0.0",
|
|
61
60
|
"stylelint-use-logical-spec": "^5.0.1",
|
|
@@ -7,34 +7,51 @@ type BackgroundsType = {
|
|
|
7
7
|
modifier?: BackgroundStyles
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Background colours also set appropriate foreground colours to ensure contrast is met.
|
|
12
|
+
*/
|
|
10
13
|
const meta: Meta<BackgroundsType> = {
|
|
11
14
|
title: "Atom/Backgrounds",
|
|
12
15
|
tags: ["autodocs"],
|
|
13
16
|
component: Component,
|
|
14
17
|
argTypes: {
|
|
15
|
-
modifier: {
|
|
18
|
+
modifier: {
|
|
19
|
+
description: "Define the colour the use.",
|
|
20
|
+
options: Object.values(BackgroundStyles),
|
|
21
|
+
control: "select",
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: "enum" },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
16
26
|
},
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
export default meta
|
|
20
30
|
type Story = StoryObj<BackgroundsType>
|
|
21
31
|
|
|
22
|
-
export const Backgrounds: Story = {
|
|
23
|
-
args: {},
|
|
24
|
-
}
|
|
32
|
+
export const Backgrounds: Story = {}
|
|
25
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Nested elements can have their background reset to the default using the `.mx-background--reset` class.
|
|
36
|
+
*/
|
|
26
37
|
export const Alt: Story = {
|
|
27
38
|
args: {
|
|
28
39
|
modifier: BackgroundStyles.ALT,
|
|
29
40
|
},
|
|
30
41
|
}
|
|
31
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Dark background set the colour scheme to `dark` to ensure foreground text meets contrast requirements.
|
|
45
|
+
*/
|
|
32
46
|
export const Reverse: Story = {
|
|
33
47
|
args: {
|
|
34
48
|
modifier: BackgroundStyles.REVERSE,
|
|
35
49
|
},
|
|
36
50
|
}
|
|
37
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Link and line colour can also be customised per background.
|
|
54
|
+
*/
|
|
38
55
|
export const Primary: Story = {
|
|
39
56
|
args: {
|
|
40
57
|
modifier: BackgroundStyles.PRIMARY,
|
|
@@ -42,8 +42,7 @@
|
|
|
42
42
|
position: absolute;
|
|
43
43
|
inline-size: 100%;
|
|
44
44
|
min-block-size: 100%;
|
|
45
|
-
filter: brightness(var(--bg-img-brightness, 1))
|
|
46
|
-
saturate(var(--bg-img-saturate, 1.25))
|
|
45
|
+
filter: brightness(var(--bg-img-brightness, 1)) saturate(var(--bg-img-saturate, 1.25))
|
|
47
46
|
opacity(var(--bg-img-opacity, 0.5));
|
|
48
47
|
}
|
|
49
48
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer design-system.defaults {
|
|
2
2
|
blockquote {
|
|
3
3
|
padding-inline-start: var(--line-gap, var(--gap));
|
|
4
|
-
border-inline-start: var(--line-width, 6px) solid
|
|
5
|
-
var(--line-colour, var(--colour-border));
|
|
4
|
+
border-inline-start: var(--line-width, 6px) solid var(--line-colour, var(--colour-border));
|
|
6
5
|
}
|
|
7
6
|
}
|
|
@@ -2,13 +2,12 @@ import { Meta, StoryObj } from "@storybook/html-vite"
|
|
|
2
2
|
import Component from "./button.twig"
|
|
3
3
|
import Icon from "../Icon/icon.twig"
|
|
4
4
|
import "./button.css"
|
|
5
|
-
import {
|
|
6
|
-
Button as ButtonType,
|
|
7
|
-
ButtonModifiers,
|
|
8
|
-
ButtonTypes,
|
|
9
|
-
} from "@pnx-mixtape/ids-shape"
|
|
5
|
+
import { Button as ButtonType, ButtonModifiers, ButtonTypes } from "@pnx-mixtape/ids-shape"
|
|
10
6
|
import { Icons } from "../../enums"
|
|
11
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A button atom with optional icon.
|
|
10
|
+
*/
|
|
12
11
|
const meta: Meta<ButtonType> = {
|
|
13
12
|
title: "Atom/Button",
|
|
14
13
|
tags: ["autodocs", "ids-mvp"],
|
|
@@ -18,40 +17,124 @@ const meta: Meta<ButtonType> = {
|
|
|
18
17
|
as: ButtonTypes.BUTTON,
|
|
19
18
|
},
|
|
20
19
|
argTypes: {
|
|
20
|
+
title: {
|
|
21
|
+
description: "The button label",
|
|
22
|
+
type: {
|
|
23
|
+
name: "string",
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
as: {
|
|
28
|
+
description: "Choose the type of button, or use a link instead.",
|
|
29
|
+
options: Object.values(ButtonTypes),
|
|
30
|
+
control: "select",
|
|
31
|
+
table: {
|
|
32
|
+
defaultValue: { summary: ButtonTypes.BUTTON },
|
|
33
|
+
type: { summary: "enum" },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
href: {
|
|
37
|
+
description: "When using a Link, set the `href` value.",
|
|
38
|
+
type: "string",
|
|
39
|
+
if: { arg: "as", eq: ButtonTypes.LINK },
|
|
40
|
+
},
|
|
21
41
|
modifiers: {
|
|
42
|
+
description:
|
|
43
|
+
"Define the style of the button. **outline** and **full-width** can be used with the other colour options.",
|
|
22
44
|
options: Object.values(ButtonModifiers),
|
|
23
45
|
control: "multi-select",
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: "enum" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
description: "Add the `[disabled]` attribute to the button.",
|
|
52
|
+
type: "boolean",
|
|
53
|
+
table: { defaultValue: { summary: "false" } },
|
|
54
|
+
if: { arg: "as", neq: ButtonTypes.LINK },
|
|
55
|
+
},
|
|
56
|
+
iconStart: {
|
|
57
|
+
description:
|
|
58
|
+
"An [Icon](/?path=/docs/atom-icon--docs) object, to display **before** the title.",
|
|
59
|
+
table: {
|
|
60
|
+
subcategory: "Icon",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
iconEnd: {
|
|
64
|
+
description:
|
|
65
|
+
"An [Icon](/?path=/docs/atom-icon--docs) object, to display **after** the title.",
|
|
66
|
+
table: {
|
|
67
|
+
subcategory: "Icon",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
iconOnly: {
|
|
71
|
+
description:
|
|
72
|
+
"When an icon is added, visually hide the button text so that only the icon is displayed.",
|
|
73
|
+
control: "boolean",
|
|
74
|
+
table: {
|
|
75
|
+
defaultValue: { summary: "false" },
|
|
76
|
+
subcategory: "Icon",
|
|
77
|
+
},
|
|
24
78
|
},
|
|
25
|
-
as: { options: Object.values(ButtonTypes), control: "select" },
|
|
26
|
-
title: { control: "text" },
|
|
27
|
-
href: { control: "text" },
|
|
28
|
-
disabled: { control: "boolean" },
|
|
29
|
-
// @ts-expect-error The controls follow the shape
|
|
30
|
-
"iconStart.icon": { options: Object.values(Icons), control: "select" },
|
|
31
|
-
"iconEnd.icon": { options: Object.values(Icons), control: "select" },
|
|
32
|
-
iconOnly: { control: "boolean" },
|
|
33
79
|
},
|
|
34
80
|
}
|
|
35
81
|
|
|
36
82
|
export default meta
|
|
37
83
|
type Story = StoryObj<ButtonType>
|
|
38
84
|
|
|
39
|
-
export const Button: Story = {
|
|
40
|
-
args: {},
|
|
41
|
-
}
|
|
85
|
+
export const Button: Story = {}
|
|
42
86
|
|
|
43
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Primary style uses the **dark** modifier.
|
|
89
|
+
*/
|
|
90
|
+
export const Dark: Story = {
|
|
44
91
|
args: {
|
|
45
92
|
modifiers: [ButtonModifiers.DARK],
|
|
46
93
|
},
|
|
47
94
|
}
|
|
48
95
|
|
|
49
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Outline can be combined with the **dark** or **destructive** modifier.
|
|
98
|
+
*/
|
|
99
|
+
export const Outline: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
modifiers: [ButtonModifiers.DARK, ButtonModifiers.OUTLINE],
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Buttons can look more like hyperlinks by using the **light** modifier.
|
|
107
|
+
*/
|
|
108
|
+
export const Light: Story = {
|
|
50
109
|
args: {
|
|
51
110
|
modifiers: [ButtonModifiers.LIGHT],
|
|
52
111
|
},
|
|
53
112
|
}
|
|
54
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Destructive style should be reserved for cancel or delete buttons.
|
|
116
|
+
*/
|
|
117
|
+
export const Destructive: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
modifiers: [ButtonModifiers.DESTRUCTIVE],
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* White style is useful when on a dark background or overlaying an image.
|
|
125
|
+
*/
|
|
126
|
+
export const White: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
modifiers: [ButtonModifiers.WHITE],
|
|
129
|
+
},
|
|
130
|
+
globals: {
|
|
131
|
+
background: "mx-background--alt",
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Button's can be a hyperlink element, though this usage should be limited (or combined with the **light** modifier).
|
|
137
|
+
*/
|
|
55
138
|
export const Link: Story = {
|
|
56
139
|
args: {
|
|
57
140
|
as: ButtonTypes.LINK,
|
|
@@ -59,10 +142,36 @@ export const Link: Story = {
|
|
|
59
142
|
},
|
|
60
143
|
}
|
|
61
144
|
|
|
62
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Icons can be added after the button text.
|
|
147
|
+
*/
|
|
148
|
+
export const IconEnd: Story = {
|
|
63
149
|
args: {
|
|
64
150
|
iconEnd: Icon({
|
|
65
151
|
icon: Icons.ARROW_RIGHT,
|
|
66
152
|
}),
|
|
67
153
|
},
|
|
68
154
|
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Icons can be added before the button text.
|
|
158
|
+
*/
|
|
159
|
+
export const IconStart: Story = {
|
|
160
|
+
args: {
|
|
161
|
+
iconStart: Icon({
|
|
162
|
+
icon: Icons.ARROW_LEFT,
|
|
163
|
+
}),
|
|
164
|
+
},
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Or the icon can visually hide the button text.
|
|
169
|
+
*/
|
|
170
|
+
export const IconOnly: Story = {
|
|
171
|
+
args: {
|
|
172
|
+
iconStart: Icon({
|
|
173
|
+
icon: Icons.SEARCH,
|
|
174
|
+
}),
|
|
175
|
+
iconOnly: true,
|
|
176
|
+
},
|
|
177
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`Atom/Button Button smoke-test 1`] = `
|
|
4
4
|
<div class="mx-page default">
|
|
5
|
-
<button class="mx-button
|
|
5
|
+
<button class="mx-button"
|
|
6
6
|
type="button"
|
|
7
7
|
>
|
|
8
8
|
<span>
|
|
@@ -12,15 +12,79 @@ exports[`Atom/Button Button smoke-test 1`] = `
|
|
|
12
12
|
</div>
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
|
-
exports[`Atom/Button
|
|
15
|
+
exports[`Atom/Button Dark smoke-test 1`] = `
|
|
16
16
|
<div class="mx-page default">
|
|
17
|
-
<button class="mx-button "
|
|
17
|
+
<button class="mx-button mx-button--dark"
|
|
18
18
|
type="button"
|
|
19
19
|
>
|
|
20
20
|
<span>
|
|
21
21
|
Button
|
|
22
22
|
</span>
|
|
23
|
-
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`Atom/Button Destructive smoke-test 1`] = `
|
|
28
|
+
<div class="mx-page default">
|
|
29
|
+
<button class="mx-button mx-button--destructive"
|
|
30
|
+
type="button"
|
|
31
|
+
>
|
|
32
|
+
<span>
|
|
33
|
+
Button
|
|
34
|
+
</span>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`Atom/Button IconEnd smoke-test 1`] = `
|
|
40
|
+
<div class="mx-page default">
|
|
41
|
+
<button class="mx-button"
|
|
42
|
+
type="button"
|
|
43
|
+
>
|
|
44
|
+
<span>
|
|
45
|
+
Button
|
|
46
|
+
</span>
|
|
47
|
+
<span class="mx-icon mx-icon--arrow-right">
|
|
48
|
+
</span>
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
exports[`Atom/Button IconOnly smoke-test 1`] = `
|
|
54
|
+
<div class="mx-page default">
|
|
55
|
+
<button class="mx-button mx-button--icon-only"
|
|
56
|
+
type="button"
|
|
57
|
+
>
|
|
58
|
+
<span class="mx-icon mx-icon--search">
|
|
59
|
+
</span>
|
|
60
|
+
<span class="sr-only">
|
|
61
|
+
Button
|
|
62
|
+
</span>
|
|
63
|
+
</button>
|
|
64
|
+
</div>
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
exports[`Atom/Button IconStart smoke-test 1`] = `
|
|
68
|
+
<div class="mx-page default">
|
|
69
|
+
<button class="mx-button"
|
|
70
|
+
type="button"
|
|
71
|
+
>
|
|
72
|
+
<span class="mx-icon mx-icon--arrow-left">
|
|
73
|
+
</span>
|
|
74
|
+
<span>
|
|
75
|
+
Button
|
|
76
|
+
</span>
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
exports[`Atom/Button Light smoke-test 1`] = `
|
|
82
|
+
<div class="mx-page default">
|
|
83
|
+
<button class="mx-button mx-button--light"
|
|
84
|
+
type="button"
|
|
85
|
+
>
|
|
86
|
+
<span>
|
|
87
|
+
Button
|
|
24
88
|
</span>
|
|
25
89
|
</button>
|
|
26
90
|
</div>
|
|
@@ -28,7 +92,7 @@ exports[`Atom/Button IconButton smoke-test 1`] = `
|
|
|
28
92
|
|
|
29
93
|
exports[`Atom/Button Link smoke-test 1`] = `
|
|
30
94
|
<div class="mx-page default">
|
|
31
|
-
<a class="mx-button
|
|
95
|
+
<a class="mx-button"
|
|
32
96
|
href="#"
|
|
33
97
|
>
|
|
34
98
|
<span>
|
|
@@ -38,9 +102,9 @@ exports[`Atom/Button Link smoke-test 1`] = `
|
|
|
38
102
|
</div>
|
|
39
103
|
`;
|
|
40
104
|
|
|
41
|
-
exports[`Atom/Button
|
|
105
|
+
exports[`Atom/Button Outline smoke-test 1`] = `
|
|
42
106
|
<div class="mx-page default">
|
|
43
|
-
<button class="mx-button
|
|
107
|
+
<button class="mx-button mx-button--dark mx-button--outline"
|
|
44
108
|
type="button"
|
|
45
109
|
>
|
|
46
110
|
<span>
|
|
@@ -50,9 +114,9 @@ exports[`Atom/Button Primary smoke-test 1`] = `
|
|
|
50
114
|
</div>
|
|
51
115
|
`;
|
|
52
116
|
|
|
53
|
-
exports[`Atom/Button
|
|
54
|
-
<div class="mx-page
|
|
55
|
-
<button class="mx-button
|
|
117
|
+
exports[`Atom/Button White smoke-test 1`] = `
|
|
118
|
+
<div class="mx-page mx-background--alt">
|
|
119
|
+
<button class="mx-button mx-button--white"
|
|
56
120
|
type="button"
|
|
57
121
|
>
|
|
58
122
|
<span>
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
font-weight: var(--font-weight-bold);
|
|
14
14
|
font-family: var(--font-family);
|
|
15
15
|
line-height: var(--line-height-ui);
|
|
16
|
-
border: var(--line-width, 2px) solid
|
|
17
|
-
var(--line-colour, var(--colour-border));
|
|
16
|
+
border: var(--line-width, 2px) solid var(--line-colour, var(--colour-border));
|
|
18
17
|
border-radius: var(--radius, var(--border-radius-l));
|
|
19
18
|
padding-block: var(--vertical-padding, var(--spacing-xxs));
|
|
20
19
|
padding-inline: var(--horizontal-padding, var(--spacing-m));
|
|
@@ -49,9 +48,7 @@
|
|
|
49
48
|
--horizontal-padding: var(--spacing-s);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
.mx-
|
|
53
|
-
--icon-size: 100%;
|
|
54
|
-
|
|
51
|
+
.mx-button--icon-only {
|
|
55
52
|
inline-size: var(--spacing-xl);
|
|
56
53
|
block-size: var(--spacing-xl);
|
|
57
54
|
padding: 0;
|
|
@@ -61,6 +58,8 @@
|
|
|
61
58
|
|
|
62
59
|
&::before,
|
|
63
60
|
&::after {
|
|
61
|
+
--icon-size: 100%;
|
|
62
|
+
|
|
64
63
|
mask-size: var(--spacing-s);
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -2,7 +2,12 @@ import { Meta, StoryObj } from "@storybook/html-vite"
|
|
|
2
2
|
import Component from "./definition-list.twig"
|
|
3
3
|
import "../_base.css"
|
|
4
4
|
import { DefinitionList as DefinitionListType } from "@pnx-mixtape/ids-shape"
|
|
5
|
+
import { Icons } from "../../enums"
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The definition list is useful for categorising short pieces of content.
|
|
9
|
+
* It uses `subgrid` to maintain alignment.
|
|
10
|
+
*/
|
|
6
11
|
const meta: Meta<DefinitionListType> = {
|
|
7
12
|
tags: ["autodocs", "ids-mvp"],
|
|
8
13
|
component: Component,
|
|
@@ -22,11 +27,23 @@ const meta: Meta<DefinitionListType> = {
|
|
|
22
27
|
},
|
|
23
28
|
],
|
|
24
29
|
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
items: {
|
|
32
|
+
description:
|
|
33
|
+
"A list of title/content objects to use, where title is the `<dt>` value and content is the `<dd>` value.",
|
|
34
|
+
type: {
|
|
35
|
+
name: "other",
|
|
36
|
+
required: true,
|
|
37
|
+
value: "array",
|
|
38
|
+
},
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "{ title: string, content: string }[]" },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
25
44
|
}
|
|
26
45
|
|
|
27
46
|
export default meta
|
|
28
47
|
type Story = StoryObj<DefinitionListType>
|
|
29
48
|
|
|
30
|
-
export const DefinitionList: Story = {
|
|
31
|
-
args: {},
|
|
32
|
-
}
|
|
49
|
+
export const DefinitionList: Story = {}
|
|
@@ -7,15 +7,9 @@ const meta: Meta<typeof Component> = {
|
|
|
7
7
|
args: {
|
|
8
8
|
children: (
|
|
9
9
|
<>
|
|
10
|
-
<DefinitionListItem title="Item #1">
|
|
11
|
-
|
|
12
|
-
</DefinitionListItem>
|
|
13
|
-
<DefinitionListItem title="Item #2">
|
|
14
|
-
Data for item #2
|
|
15
|
-
</DefinitionListItem>
|
|
16
|
-
<DefinitionListItem title="Item #3">
|
|
17
|
-
Data for item #3
|
|
18
|
-
</DefinitionListItem>
|
|
10
|
+
<DefinitionListItem title="Item #1">Data for item #1</DefinitionListItem>
|
|
11
|
+
<DefinitionListItem title="Item #2">Data for item #2</DefinitionListItem>
|
|
12
|
+
<DefinitionListItem title="Item #3">Data for item #3</DefinitionListItem>
|
|
19
13
|
</>
|
|
20
14
|
),
|
|
21
15
|
},
|
|
@@ -2,10 +2,9 @@ import { JSX, ComponentPropsWithoutRef, PropsWithChildren } from "react"
|
|
|
2
2
|
|
|
3
3
|
type DefinitionListProps = ComponentPropsWithoutRef<"dl"> & PropsWithChildren
|
|
4
4
|
|
|
5
|
-
const DefinitionList = ({
|
|
6
|
-
children
|
|
7
|
-
|
|
8
|
-
}: DefinitionListProps): JSX.Element => <dl {...props}>{children}</dl>
|
|
5
|
+
const DefinitionList = ({ children, ...props }: DefinitionListProps): JSX.Element => (
|
|
6
|
+
<dl {...props}>{children}</dl>
|
|
7
|
+
)
|
|
9
8
|
|
|
10
9
|
type DefinitionListItemProps = ComponentPropsWithoutRef<"div"> &
|
|
11
10
|
PropsWithChildren & {
|