@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
|
@@ -3,6 +3,10 @@ import Component from "./drop-menu.twig"
|
|
|
3
3
|
import "./drop-menu.css"
|
|
4
4
|
import "./Elements/DropMenu"
|
|
5
5
|
|
|
6
|
+
// Deps.
|
|
7
|
+
import "../Popover/popover.css"
|
|
8
|
+
import { PopoverPlacementModifier } from "@pnx-mixtape/ids-shape"
|
|
9
|
+
|
|
6
10
|
type DropMenuItemType = {
|
|
7
11
|
label: string
|
|
8
12
|
href?: string
|
|
@@ -13,8 +17,14 @@ type DropMenuType = {
|
|
|
13
17
|
items: DropMenuItemType[]
|
|
14
18
|
label: string
|
|
15
19
|
id?: string
|
|
20
|
+
role?: "menu" | "tablist"
|
|
21
|
+
placement?: PopoverPlacementModifier
|
|
16
22
|
}
|
|
17
23
|
|
|
24
|
+
/**
|
|
25
|
+
* The DropMenu extends [Popoover](/?path=/docs/component-popover--docs) to support a menu selection.
|
|
26
|
+
* It requires the `DropMenu` custom element javascript.
|
|
27
|
+
*/
|
|
18
28
|
const meta: Meta<DropMenuType> = {
|
|
19
29
|
tags: ["autodocs", "ids-mvp"],
|
|
20
30
|
component: Component,
|
|
@@ -23,8 +33,46 @@ const meta: Meta<DropMenuType> = {
|
|
|
23
33
|
items: [
|
|
24
34
|
{ label: "News", href: "#news" },
|
|
25
35
|
{ label: "Events", href: "#events" },
|
|
26
|
-
{ label: "Stories",
|
|
36
|
+
{ label: "Stories", href: "#stories" },
|
|
27
37
|
],
|
|
38
|
+
placement: PopoverPlacementModifier.BOTTOM_START,
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
placement: {
|
|
42
|
+
description: "Places the DropMenu relative to the trigger element.",
|
|
43
|
+
control: "select",
|
|
44
|
+
options: Object.values(PopoverPlacementModifier),
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: `${PopoverPlacementModifier.BOTTOM_START}` },
|
|
47
|
+
type: { summary: "enum" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
label: {
|
|
51
|
+
description: "The text to display inside the trigger button",
|
|
52
|
+
type: {
|
|
53
|
+
name: "string",
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
items: {
|
|
58
|
+
description:
|
|
59
|
+
"A list of `DropMenuItem<{ label: string, href?: string }>` objects for links or `DropMenuItem<{ label: string, id?: string }>` for buttons.",
|
|
60
|
+
type: {
|
|
61
|
+
name: "other",
|
|
62
|
+
required: true,
|
|
63
|
+
value: "array",
|
|
64
|
+
},
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "DropMenuItem[]" },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
role: {
|
|
70
|
+
description:
|
|
71
|
+
"An optional ARIA role attribute for the popover, for use when DropMenuItem is a list of buttons.",
|
|
72
|
+
control: "select",
|
|
73
|
+
options: ["menu", "tablist"],
|
|
74
|
+
type: "string",
|
|
75
|
+
},
|
|
28
76
|
},
|
|
29
77
|
}
|
|
30
78
|
|
|
@@ -34,3 +82,14 @@ type Story = StoryObj<DropMenuType>
|
|
|
34
82
|
export const DropMenu: Story = {
|
|
35
83
|
args: {},
|
|
36
84
|
}
|
|
85
|
+
|
|
86
|
+
export const Buttons: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
role: "menu",
|
|
89
|
+
items: [
|
|
90
|
+
{ label: "News", id: "news" },
|
|
91
|
+
{ label: "Events", id: "events" },
|
|
92
|
+
{ label: "Stories", id: "stories" },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
}
|
|
@@ -7,11 +7,7 @@ type ContainerProps = ComponentPropsWithoutRef<"div"> &
|
|
|
7
7
|
condition: boolean
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const Container = ({
|
|
11
|
-
condition,
|
|
12
|
-
children,
|
|
13
|
-
...props
|
|
14
|
-
}: ContainerProps): JSX.Element =>
|
|
10
|
+
const Container = ({ condition, children, ...props }: ContainerProps): JSX.Element =>
|
|
15
11
|
condition ? <div {...props}>{children}</div> : <>{children}</>
|
|
16
12
|
|
|
17
13
|
type DropMenuProps = PropsWithChildren & {
|
|
@@ -42,8 +38,7 @@ const DropMenu = ({
|
|
|
42
38
|
ariaLabel,
|
|
43
39
|
description = "Results will update when you make a selection. Press escape to close.",
|
|
44
40
|
}: DropMenuProps): JSX.Element => {
|
|
45
|
-
const { dropMenuId, triggerId, descriptionId, popoverRef } =
|
|
46
|
-
useDropMenuContext()
|
|
41
|
+
const { dropMenuId, triggerId, descriptionId, popoverRef } = useDropMenuContext()
|
|
47
42
|
|
|
48
43
|
return (
|
|
49
44
|
<Container className={classNames(className)} condition={!!className}>
|
|
@@ -1,51 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DropMenu
|
|
3
|
-
* @file Create a DropMenu using the Popover and Anchor APIs
|
|
3
|
+
* @file Create a DropMenu using the Popover and Anchor APIs.
|
|
4
|
+
* Handle's menu item select.
|
|
5
|
+
*
|
|
6
|
+
* Once polyfills are no longer needed, this can just extent HTMLElement
|
|
7
|
+
* instead of Popover.
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
|
-
import
|
|
10
|
+
import Popover from "../../Popover/Elements/Popover"
|
|
7
11
|
|
|
8
12
|
export type DropMenuEvent = CustomEvent<{
|
|
9
13
|
event: MouseEvent | KeyboardEvent
|
|
10
14
|
target: HTMLButtonElement | HTMLAnchorElement
|
|
11
15
|
}>
|
|
12
16
|
|
|
13
|
-
export default class DropMenu extends
|
|
14
|
-
internals_: ElementInternals
|
|
17
|
+
export default class DropMenu extends Popover {
|
|
15
18
|
controller: AbortController
|
|
16
|
-
keyboard: Keyboard = new Keyboard()
|
|
17
19
|
closeOnClick: boolean
|
|
18
20
|
|
|
19
21
|
constructor() {
|
|
20
22
|
super()
|
|
21
|
-
this.internals_ = this.attachInternals()
|
|
22
23
|
this.controller = new AbortController()
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
async connectedCallback() {
|
|
26
|
-
|
|
27
|
+
await super.connectedCallback()
|
|
28
|
+
if (!this.container || !this.trigger) return
|
|
27
29
|
|
|
28
|
-
// Polyfill anchor (everywhere so far).
|
|
29
|
-
if (!("anchorName" in document.documentElement.style)) {
|
|
30
|
-
const { default: Polyfills } = await import("../polyfills.js")
|
|
31
|
-
new Polyfills(this.menu)
|
|
32
|
-
}
|
|
33
|
-
// Polyfill popover (FF only)
|
|
34
|
-
if (!Object.hasOwn(HTMLElement, "popover")) {
|
|
35
|
-
await import("@oddbird/popover-polyfill")
|
|
36
|
-
}
|
|
37
30
|
this.closeOnClick = this.hasAttribute("closeonclick")
|
|
38
31
|
|
|
39
32
|
const { signal }: AbortController = this.controller
|
|
40
33
|
document.addEventListener(
|
|
41
34
|
"click",
|
|
42
35
|
(event: MouseEvent): void => {
|
|
43
|
-
const
|
|
36
|
+
const targetElement = event.target as HTMLElement
|
|
37
|
+
const selectable = targetElement.closest("a, button")
|
|
44
38
|
if (
|
|
45
|
-
(
|
|
46
|
-
![...this.items].includes(
|
|
47
|
-
target as HTMLButtonElement | HTMLAnchorElement,
|
|
48
|
-
)
|
|
39
|
+
(targetElement as HTMLElement) !== this.container &&
|
|
40
|
+
![...this.items].includes(selectable as HTMLButtonElement | HTMLAnchorElement)
|
|
49
41
|
)
|
|
50
42
|
return
|
|
51
43
|
this.handleSelect(event)
|
|
@@ -61,10 +53,8 @@ export default class DropMenu extends HTMLElement {
|
|
|
61
53
|
(event: KeyboardEvent): void => {
|
|
62
54
|
const { target, key } = event
|
|
63
55
|
if (
|
|
64
|
-
(target as HTMLElement) !== this.
|
|
65
|
-
![...this.items].includes(
|
|
66
|
-
target as HTMLButtonElement | HTMLAnchorElement,
|
|
67
|
-
)
|
|
56
|
+
(target as HTMLElement) !== this.container &&
|
|
57
|
+
![...this.items].includes(target as HTMLButtonElement | HTMLAnchorElement)
|
|
68
58
|
)
|
|
69
59
|
return
|
|
70
60
|
if (key === "Enter") this.handleSelect(event)
|
|
@@ -74,27 +64,15 @@ export default class DropMenu extends HTMLElement {
|
|
|
74
64
|
signal,
|
|
75
65
|
},
|
|
76
66
|
)
|
|
77
|
-
|
|
78
|
-
this.keyboard.attachEventListeners(signal)
|
|
79
|
-
this.menu.addEventListener("focusin", this.attachKeyboardMenu, {
|
|
80
|
-
signal,
|
|
81
|
-
})
|
|
82
|
-
this.menu.addEventListener("focusout", this.detachKeyboardMenu, {
|
|
83
|
-
signal,
|
|
84
|
-
})
|
|
85
|
-
this.menu.addEventListener("toggle", this.handleToggle, {
|
|
86
|
-
signal,
|
|
87
|
-
})
|
|
88
67
|
}
|
|
89
68
|
|
|
90
69
|
disconnectedCallback(): void {
|
|
91
70
|
this.controller.abort()
|
|
92
|
-
this.keyboard.detachMenu()
|
|
93
71
|
}
|
|
94
72
|
|
|
95
73
|
handleSelect = (event: MouseEvent | KeyboardEvent): void => {
|
|
96
74
|
const target = event.target as HTMLButtonElement | HTMLAnchorElement
|
|
97
|
-
this.items
|
|
75
|
+
this.items?.forEach(item => {
|
|
98
76
|
if (!(item instanceof HTMLButtonElement)) return
|
|
99
77
|
item.setAttribute("aria-checked", String(item === target))
|
|
100
78
|
})
|
|
@@ -106,64 +84,16 @@ export default class DropMenu extends HTMLElement {
|
|
|
106
84
|
target,
|
|
107
85
|
},
|
|
108
86
|
})
|
|
109
|
-
this.
|
|
110
|
-
if (this.closeOnClick) this.
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
handleToggle = ({ newState }: ToggleEvent): void => {
|
|
114
|
-
const handleClose = () => this.menu.togglePopover()
|
|
115
|
-
if (newState === "open") {
|
|
116
|
-
this.keyboard.attachPopup(this.menu.id, handleClose)
|
|
117
|
-
} else {
|
|
118
|
-
this.keyboard.detachPopup(this.menu.id)
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
attachKeyboardMenu = (): void => {
|
|
123
|
-
this.keyboard.attachMenu(this.menu, this.items)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
detachKeyboardMenu = (): void => {
|
|
127
|
-
this.keyboard.detachMenu()
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
get menu(): HTMLDivElement | null {
|
|
131
|
-
const menu: HTMLDivElement | null = this.querySelector("[popover]")
|
|
132
|
-
if (!menu) {
|
|
133
|
-
throw new Error(`${this.localName} must contain a <div popover> element.`)
|
|
134
|
-
}
|
|
135
|
-
menu.id = menu.id || this.generatedId()
|
|
136
|
-
return menu
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
get items(): NodeListOf<HTMLButtonElement | HTMLAnchorElement> {
|
|
140
|
-
const items: NodeListOf<HTMLButtonElement | HTMLAnchorElement> =
|
|
141
|
-
this.menu.querySelectorAll(":scope > *")
|
|
142
|
-
if (!items) {
|
|
143
|
-
throw new Error(`${this.localName} must contain some menu items.`)
|
|
144
|
-
}
|
|
145
|
-
return items
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
get trigger(): HTMLButtonElement | null {
|
|
149
|
-
const trigger: HTMLButtonElement | null = this.querySelector(
|
|
150
|
-
`[popovertarget=${this.menu?.id}]`,
|
|
151
|
-
)
|
|
152
|
-
if (!trigger) {
|
|
153
|
-
throw new Error(
|
|
154
|
-
`${this.localName} must contain a <button popovertarget="${this.menu.id}">`,
|
|
155
|
-
)
|
|
156
|
-
}
|
|
157
|
-
return trigger
|
|
87
|
+
this.container.dispatchEvent(newEvent)
|
|
88
|
+
if (this.closeOnClick) this.container.togglePopover()
|
|
158
89
|
}
|
|
159
90
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return !string ? "" : makeAnchor(string)
|
|
91
|
+
get items(): NodeListOf<HTMLButtonElement | HTMLAnchorElement> | null {
|
|
92
|
+
return this.container.querySelectorAll("a, button")
|
|
163
93
|
}
|
|
164
94
|
}
|
|
165
95
|
|
|
166
|
-
customElements.define("mx-dropmenu", DropMenu)
|
|
96
|
+
if (!customElements.get("mx-dropmenu")) customElements.define("mx-dropmenu", DropMenu)
|
|
167
97
|
|
|
168
98
|
declare global {
|
|
169
99
|
interface HTMLElementTagNameMap {
|
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
-
exports[`Component/DropMenu
|
|
3
|
+
exports[`Component/DropMenu Buttons smoke-test 1`] = `
|
|
4
4
|
<div class="mx-page default">
|
|
5
5
|
<mx-dropmenu closeonclick>
|
|
6
6
|
<button id="unique-0"
|
|
7
|
-
class="mx-
|
|
7
|
+
class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end"
|
|
8
8
|
popovertarget="dropdown-menu"
|
|
9
|
-
style="anchor-name: --
|
|
9
|
+
style="anchor-name: --dropdown-menu"
|
|
10
10
|
>
|
|
11
11
|
Categories
|
|
12
12
|
</button>
|
|
13
|
-
<div class="mx-drop-menu"
|
|
13
|
+
<div class="mx-popover mx-drop-menu"
|
|
14
14
|
id="dropdown-menu"
|
|
15
|
-
aria-
|
|
16
|
-
style="position-anchor: --
|
|
15
|
+
aria-describedby="unique-0"
|
|
16
|
+
style="position-anchor: --dropdown-menu"
|
|
17
|
+
data-placement="bottom-start"
|
|
17
18
|
popover
|
|
19
|
+
role="menu"
|
|
18
20
|
>
|
|
19
|
-
<
|
|
21
|
+
<button type="button"
|
|
22
|
+
data-id="news"
|
|
23
|
+
role="menuitemradio"
|
|
24
|
+
aria-checked="false"
|
|
25
|
+
>
|
|
20
26
|
News
|
|
21
|
-
</
|
|
22
|
-
<
|
|
27
|
+
</button>
|
|
28
|
+
<button type="button"
|
|
29
|
+
data-id="events"
|
|
30
|
+
role="menuitemradio"
|
|
31
|
+
aria-checked="false"
|
|
32
|
+
>
|
|
23
33
|
Events
|
|
24
|
-
</
|
|
34
|
+
</button>
|
|
25
35
|
<button type="button"
|
|
26
36
|
data-id="stories"
|
|
37
|
+
role="menuitemradio"
|
|
27
38
|
aria-checked="false"
|
|
28
39
|
>
|
|
29
40
|
Stories
|
|
@@ -32,3 +43,34 @@ exports[`Component/DropMenu DropMenu smoke-test 1`] = `
|
|
|
32
43
|
</mx-dropmenu>
|
|
33
44
|
</div>
|
|
34
45
|
`;
|
|
46
|
+
|
|
47
|
+
exports[`Component/DropMenu DropMenu smoke-test 1`] = `
|
|
48
|
+
<div class="mx-page default">
|
|
49
|
+
<mx-dropmenu closeonclick>
|
|
50
|
+
<button id="unique-0"
|
|
51
|
+
class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end"
|
|
52
|
+
popovertarget="dropdown-menu"
|
|
53
|
+
style="anchor-name: --dropdown-menu"
|
|
54
|
+
>
|
|
55
|
+
Categories
|
|
56
|
+
</button>
|
|
57
|
+
<div class="mx-popover mx-drop-menu"
|
|
58
|
+
id="dropdown-menu"
|
|
59
|
+
aria-describedby="unique-0"
|
|
60
|
+
style="position-anchor: --dropdown-menu"
|
|
61
|
+
data-placement="bottom-start"
|
|
62
|
+
popover
|
|
63
|
+
>
|
|
64
|
+
<a href="#news">
|
|
65
|
+
News
|
|
66
|
+
</a>
|
|
67
|
+
<a href="#events">
|
|
68
|
+
Events
|
|
69
|
+
</a>
|
|
70
|
+
<a href="#stories">
|
|
71
|
+
Stories
|
|
72
|
+
</a>
|
|
73
|
+
</div>
|
|
74
|
+
</mx-dropmenu>
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
@@ -6,51 +6,23 @@
|
|
|
6
6
|
* **Experimental** Using new CSS Anchoring and Popover API's, requires JS polyfill.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
@layer design-system.
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
@layer design-system.defaults {
|
|
10
|
+
mx-drop-menu {
|
|
11
|
+
display: block;
|
|
12
12
|
|
|
13
|
-
&:
|
|
14
|
-
|
|
13
|
+
&:not(:defined) :where(.mx-drop-menu :is(a, button):not([class])) {
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
opacity: 0.7;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
18
|
+
}
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
background-color: var(
|
|
23
|
-
--drop-menu-background,
|
|
24
|
-
var(--background, var(--colour-background))
|
|
25
|
-
);
|
|
26
|
-
color: var(
|
|
27
|
-
--drop-menu-foreground,
|
|
28
|
-
var(--foreground, var(--colour-foreground))
|
|
29
|
-
);
|
|
30
|
-
border: var(--line-width, 2px) solid
|
|
31
|
-
var(--line-colour, var(--colour-border));
|
|
32
|
-
margin: 0;
|
|
33
|
-
|
|
34
|
-
@supports (inline-size: anchor-size(width)) {
|
|
35
|
-
position-anchor: --drop-menu;
|
|
36
|
-
inset-area: bottom;
|
|
37
|
-
position-area: bottom;
|
|
38
|
-
position-try-fallbacks: flip-block;
|
|
39
|
-
position-try-fallback: flip-block;
|
|
40
|
-
min-inline-size: anchor-size(width);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&:popover-open {
|
|
44
|
-
opacity: 1;
|
|
45
|
-
display: block;
|
|
46
|
-
|
|
47
|
-
@starting-style {
|
|
48
|
-
opacity: 0;
|
|
49
|
-
display: block;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
20
|
+
@layer design-system.components {
|
|
21
|
+
:where(.mx-drop-menu) {
|
|
22
|
+
--popover-padding: 0px;
|
|
23
|
+
--popover-top: 0px;
|
|
52
24
|
|
|
53
|
-
& button {
|
|
25
|
+
& :where(button:not([class])) {
|
|
54
26
|
appearance: none;
|
|
55
27
|
line-height: inherit;
|
|
56
28
|
font-family: inherit;
|
|
@@ -65,7 +37,7 @@
|
|
|
65
37
|
}
|
|
66
38
|
}
|
|
67
39
|
|
|
68
|
-
& :is(a, button) {
|
|
40
|
+
& :where(:is(a, button):not([class])) {
|
|
69
41
|
padding-block: var(--spacing-xxxs);
|
|
70
42
|
padding-inline: var(--spacing-xs);
|
|
71
43
|
cursor: pointer;
|
|
@@ -3,24 +3,26 @@
|
|
|
3
3
|
{% set name = id ~ '-target' %}
|
|
4
4
|
<button
|
|
5
5
|
id="{{ name }}"
|
|
6
|
-
class="mx-
|
|
6
|
+
class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end"
|
|
7
7
|
popovertarget="{{ id }}"
|
|
8
|
-
style="anchor-name: --
|
|
8
|
+
style="anchor-name: --{{ id }}"
|
|
9
9
|
>
|
|
10
10
|
{{ label }}
|
|
11
11
|
</button>
|
|
12
12
|
<div
|
|
13
|
-
class="mx-drop-menu"
|
|
13
|
+
class="mx-popover mx-drop-menu"
|
|
14
14
|
id="{{ id }}"
|
|
15
|
-
aria-
|
|
16
|
-
style="position-anchor: --
|
|
15
|
+
aria-describedby="{{ name }}"
|
|
16
|
+
style="position-anchor: --{{ id }}"
|
|
17
|
+
data-placement="{{ placement|default('bottom-start') }}"
|
|
17
18
|
popover
|
|
19
|
+
{% if role %} role="{{ role }}"{% endif %}
|
|
18
20
|
>
|
|
19
21
|
{% for item in items %}
|
|
20
22
|
{% if item.href is not empty %}
|
|
21
23
|
<a href="{{ item.href }}">{{ item.label }}</a>
|
|
22
24
|
{% else %}
|
|
23
|
-
<button type="button" data-id="{{ item.id }}" aria-checked="false">{{ item.label }}</button>
|
|
25
|
+
<button type="button" data-id="{{ item.id }}" role="{{ role == "menu" ? "menuitemradio" : "tab" }}" aria-checked="false">{{ item.label }}</button>
|
|
24
26
|
{% endif %}
|
|
25
27
|
{% endfor %}
|
|
26
28
|
</div>
|
|
@@ -32,10 +32,13 @@ export default class Filters extends HTMLElement {
|
|
|
32
32
|
this.closeBtn?.addEventListener("click", this.handleClose, {
|
|
33
33
|
signal,
|
|
34
34
|
})
|
|
35
|
+
this.showBtn?.previousElementSibling.setAttribute("hidden", "until-found")
|
|
35
36
|
this.showBtn?.addEventListener("click", this.handleShow, {
|
|
36
37
|
signal,
|
|
37
38
|
})
|
|
38
39
|
|
|
40
|
+
this.resetBtn?.setAttribute("disabled", "")
|
|
41
|
+
this.submitBtn?.setAttribute("disabled", "")
|
|
39
42
|
this.handleCounters()
|
|
40
43
|
this.addEventListener("change", this.handleCounters, { signal })
|
|
41
44
|
this.form?.addEventListener("submit", this.handleCounters, { signal })
|
|
@@ -46,11 +49,7 @@ export default class Filters extends HTMLElement {
|
|
|
46
49
|
this.controller.abort()
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
attributeChangedCallback(
|
|
50
|
-
name: string,
|
|
51
|
-
oldValue: string,
|
|
52
|
-
newValue: string,
|
|
53
|
-
): void {
|
|
52
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void {
|
|
54
53
|
if (name === "count" && oldValue !== newValue) {
|
|
55
54
|
const qualifier = parseInt(newValue, 10) > 0
|
|
56
55
|
this.resetBtn?.toggleAttribute("disabled", !qualifier)
|
|
@@ -101,12 +100,9 @@ export default class Filters extends HTMLElement {
|
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
get items(): NodeListOf<HTMLElement> | null {
|
|
104
|
-
const items: NodeListOf<HTMLElement> =
|
|
105
|
-
this.querySelectorAll(".mx-filter-item")
|
|
103
|
+
const items: NodeListOf<HTMLElement> = this.querySelectorAll(".mx-filter-item")
|
|
106
104
|
if (!items) {
|
|
107
|
-
throw new Error(
|
|
108
|
-
`${this.localName} must contain a .mx-filter-item element.`,
|
|
109
|
-
)
|
|
105
|
+
throw new Error(`${this.localName} must contain a .mx-filter-item element.`)
|
|
110
106
|
}
|
|
111
107
|
this.entries = new Map()
|
|
112
108
|
items.forEach(item => {
|
|
@@ -148,7 +144,7 @@ export default class Filters extends HTMLElement {
|
|
|
148
144
|
}
|
|
149
145
|
}
|
|
150
146
|
|
|
151
|
-
customElements.define("mx-filters", Filters)
|
|
147
|
+
if (!customElements.get("mx-filters")) customElements.define("mx-filters", Filters)
|
|
152
148
|
|
|
153
149
|
declare global {
|
|
154
150
|
interface HTMLElementTagNameMap {
|