@pnx-mixtape/mxds 0.0.13 → 0.0.15
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/README.md +37 -23
- package/dist/build/accordion.css +1 -98
- package/dist/build/accordion.entry.js +1 -83
- package/dist/build/base.css +1 -996
- package/dist/build/breadcrumb.css +1 -51
- package/dist/build/button.css +1 -132
- package/dist/build/callout.css +1 -11
- package/dist/build/card.css +1 -149
- package/dist/build/carousel.css +1 -0
- package/dist/build/chunks/Accordion-RtUfbsTy.js +1 -0
- package/dist/build/chunks/disclosure-widget-CPdkUWkq.js +1 -0
- package/dist/build/chunks/drop-menu.entry-BqBzLfVC.js +1 -0
- package/dist/build/chunks/keyboard-Cs0cduxq.js +1 -0
- package/dist/build/chunks/polyfills-5KNOJw2W.js +1 -0
- package/dist/build/chunks/popover-CiVl-0jk.js +1 -0
- package/dist/build/chunks/utilities-CE6xwgqF.js +2 -0
- package/dist/build/constants.css +1 -120
- package/dist/build/container-grid.css +1 -208
- package/dist/build/content-block.css +1 -36
- package/dist/build/dialog.css +1 -98
- package/dist/build/dialog.entry.js +1 -113
- package/dist/build/drop-menu.css +1 -78
- package/dist/build/drop-menu.entry.js +1 -2
- package/dist/build/drupal.css +1 -74
- package/dist/build/filters.css +1 -105
- package/dist/build/filters.entry.js +1 -137
- package/dist/build/footer.css +1 -151
- package/dist/build/form.css +1 -517
- package/dist/build/global-alert.css +1 -60
- package/dist/build/global-alert.entry.js +1 -68
- package/dist/build/grid.css +1 -200
- package/dist/build/header.css +1 -153
- package/dist/build/header.entry.js +1 -103
- package/dist/build/hero-banner.css +1 -62
- package/dist/build/icon.css +1 -399
- package/dist/build/in-page-alert.css +1 -94
- package/dist/build/in-page-navigation.css +1 -17
- package/dist/build/in-page-navigation.entry.js +1 -99
- package/dist/build/link-list.css +1 -45
- package/dist/build/list-item.css +1 -114
- package/dist/build/masthead.css +1 -53
- package/dist/build/navigation.css +1 -396
- package/dist/build/navigation.entry.js +1 -124
- package/dist/build/page.css +1 -80
- package/dist/build/pagination.css +1 -130
- package/dist/build/results-bar.css +1 -0
- package/dist/build/section.css +1 -163
- package/dist/build/side-navigation.css +1 -88
- package/dist/build/sidebar.css +1 -59
- package/dist/build/social-links.css +1 -20
- package/dist/build/steps.css +1 -118
- package/dist/build/sticky.css +1 -47
- package/dist/build/sticky.entry.js +1 -60
- package/dist/build/tabs.css +1 -109
- package/dist/build/tabs.entry.js +1 -202
- package/dist/build/tag.css +1 -71
- package/dist/build/utilities.css +1 -178
- package/package.json +56 -64
- package/src/Atom/Background/Backgrounds.stories.ts +13 -1
- package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +157 -81
- package/src/Atom/Background/_background.css +16 -10
- package/src/Atom/Base.mdx +25 -17
- package/src/Atom/Button/Button.stories.ts +1 -4
- package/src/Atom/Button/Button.stories.tsx +1 -1
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +47 -37
- package/src/Atom/Button/_buttons-styles.css +7 -7
- package/src/Atom/Button/_buttons.css +1 -6
- package/src/Atom/DefinitionList/DefinitionList.stories.ts +32 -0
- package/src/Atom/DefinitionList/DefinitionList.stories.tsx +1 -1
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +32 -0
- package/src/Atom/DefinitionList/definition-list.twig +9 -0
- package/src/Atom/Heading/Heading.stories.ts +1 -1
- package/src/Atom/Heading/Heading.stories.tsx +1 -1
- package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +5 -3
- package/src/Atom/Heading/_headings.css +24 -24
- package/src/Atom/Icon/Icon.mdx +1 -1
- package/src/Atom/Icon/Icon.stories.ts +1 -1
- package/src/Atom/Icon/Icon.stories.tsx +1 -1
- package/src/Atom/Icon/Icon.tsx +2 -2
- package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +14 -8
- package/src/Atom/Icon/_icon.css +4 -4
- package/src/Atom/Image/Image.stories.ts +1 -1
- package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +7 -5
- package/src/Atom/Image/_image.css +2 -7
- package/src/Atom/Link/Link.stories.ts +1 -1
- package/src/Atom/Link/Link.stories.tsx +1 -1
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +50 -37
- package/src/Atom/Link/_links.css +2 -22
- package/src/Atom/Link/link.twig +1 -0
- package/src/Atom/Media/Media.stories.ts +2 -1
- package/src/Atom/Media/Media.stories.tsx +1 -1
- package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +11 -24
- package/src/Atom/Media/_media.css +8 -8
- package/src/Atom/Spacing/Spacing.stories.ts +1 -1
- package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -3
- package/src/Atom/Table/Table.stories.ts +1 -1
- package/src/Atom/Table/TableResponsive.stories.ts +1 -1
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +256 -248
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +65 -63
- package/src/Atom/Text/Text.stories.tsx +1 -1
- package/src/Atom/Text/TextSizes.stories.ts +1 -1
- package/src/Atom/Text/__snapshots__/TextSizes.stories.ts.snap +59 -55
- package/src/Atom/Text/_text-sizes.css +17 -17
- package/src/Atom/Text/rich-text.twig +9 -0
- package/src/Atom/Video/Video.stories.ts +1 -1
- package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +9 -7
- package/src/Atom/_animated.css +0 -14
- package/src/Atom/_generic.css +57 -15
- package/src/Atom/base.css +1 -1
- package/src/Component/Accordion/Accordion.stories.ts +1 -4
- package/src/Component/Accordion/Accordion.stories.tsx +1 -2
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +60 -56
- package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +0 -1
- package/src/Component/Accordion/accordion.css +16 -4
- package/src/Component/Breadcrumb/Breadcrumb.stories.ts +1 -1
- package/src/Component/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +31 -29
- package/src/Component/Breadcrumb/breadcrumb.css +4 -0
- package/src/Component/Callout/Callout.stories.ts +1 -9
- package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +9 -7
- package/src/Component/Card/Card.stories.ts +11 -18
- package/src/Component/Card/Card.stories.tsx +1 -1
- package/src/Component/Card/Card.tsx +9 -5
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +257 -229
- package/src/Component/Card/card.css +36 -33
- package/src/Component/Card/card.twig +6 -6
- package/src/Component/Carousel/Carousel.stories.ts +201 -0
- package/src/Component/Carousel/Elements/Carousel.ts +241 -0
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +912 -0
- package/src/Component/Carousel/carousel.css +119 -0
- package/src/Component/Carousel/carousel.twig +27 -0
- package/src/Component/ContentBlock/ContentBlock.stories.ts +27 -19
- package/src/Component/ContentBlock/ContentBlock.stories.tsx +1 -1
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +153 -93
- package/src/Component/Dialog/Dialog.stories.ts +75 -7
- package/src/Component/Dialog/Dialog.stories.tsx +1 -1
- package/src/Component/Dialog/Elements/Dialog.ts +14 -34
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +102 -66
- package/src/Component/Dialog/dialog.css +32 -20
- package/src/Component/Dialog/dialog.twig +14 -15
- package/src/Component/DropMenu/Components/DropMenuContext.tsx +7 -9
- package/src/Component/DropMenu/Components/DropMenuItem.tsx +1 -1
- package/src/Component/DropMenu/DropMenu.stories.ts +1 -1
- package/src/Component/DropMenu/DropMenu.stories.tsx +1 -1
- package/src/Component/DropMenu/Elements/DropMenu.ts +1 -1
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +28 -26
- package/src/Component/DropMenu/drop-menu.css +11 -3
- package/src/Component/Filters/Filters.stories.ts +1 -4
- package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +397 -389
- package/src/Component/Filters/filters.css +14 -5
- package/src/Component/GlobalAlert/GlobalAlert.stories.ts +1 -1
- package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +1 -1
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +33 -29
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +2 -2
- package/src/Component/GlobalAlert/global-alert.css +2 -2
- package/src/Component/HeroBanner/HeroBanner.stories.ts +1 -4
- package/src/Component/HeroBanner/HeroBanner.stories.tsx +1 -1
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +68 -64
- package/src/Component/HeroBanner/hero-banner.css +6 -1
- package/src/Component/HeroBanner/hero-banner.twig +3 -4
- package/src/Component/InPageAlert/InPageAlert.stories.ts +1 -1
- package/src/Component/InPageAlert/InPageAlert.stories.tsx +1 -1
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +10 -8
- package/src/Component/InPageAlert/in-page-alert.css +8 -8
- package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +1 -1
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +1 -4
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +1 -1
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +64 -62
- package/src/Component/LinkList/LinkList.stories.ts +1 -1
- package/src/Component/LinkList/LinkList.stories.tsx +1 -1
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +31 -29
- package/src/Component/ListItem/ListItem.stories.ts +2 -4
- package/src/Component/ListItem/ListItem.stories.tsx +1 -1
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +162 -148
- package/src/Component/ListItem/list-item.css +7 -88
- package/src/Component/ListItem/list-item.twig +8 -8
- package/src/Component/Navigation/Dropdown.stories.tsx +1 -1
- package/src/Component/Navigation/Navigation.stories.ts +1 -1
- package/src/Component/Navigation/Navigation.stories.tsx +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +291 -283
- package/src/Component/Navigation/_navigation-collapsible.css +11 -14
- package/src/Component/Navigation/_navigation-dropdown.css +11 -17
- package/src/Component/Pagination/Components/PaginationContext.tsx +4 -8
- package/src/Component/Pagination/Pagination.stories.ts +1 -1
- package/src/Component/Pagination/Pagination.stories.tsx +1 -1
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +59 -57
- package/src/Component/Pagination/pagination.css +2 -8
- package/src/Component/ResultsBar/Components/ResultsBarInfo.tsx +28 -0
- package/src/Component/ResultsBar/Components/ResultsBarSort.tsx +17 -0
- package/src/Component/ResultsBar/ResultsBar.stories.ts +37 -0
- package/src/Component/ResultsBar/ResultsBar.stories.tsx +50 -0
- package/src/Component/ResultsBar/ResultsBar.tsx +7 -0
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +54 -0
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +53 -0
- package/src/Component/ResultsBar/results-bar.css +19 -0
- package/src/Component/ResultsBar/results-bar.twig +24 -0
- package/src/Component/SideNavigation/SideNavigation.stories.ts +1 -1
- package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +82 -80
- package/src/Component/SideNavigation/side-navigation.css +2 -8
- package/src/Component/SocialLinks/SocialLinks.stories.ts +1 -1
- package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +30 -28
- package/src/Component/Steps/Steps.stories.ts +1 -1
- package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +86 -78
- package/src/Component/Steps/steps.css +1 -1
- package/src/Component/Sticky/Sticky.stories.ts +1 -1
- package/src/Component/Sticky/Sticky.stories.tsx +1 -1
- package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +9 -7
- package/src/Component/Tabs/Tabs.stories.ts +1 -1
- package/src/Component/Tabs/Tabs.stories.tsx +1 -1
- package/src/Component/Tabs/Tabs.tsx +4 -4
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +73 -71
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +0 -2
- package/src/Component/Tabs/tabs.css +14 -21
- package/src/Component/Tag/Tag.stories.ts +1 -1
- package/src/Component/Tag/Tag.stories.tsx +1 -1
- package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +59 -53
- package/src/Component/Tag/tag.css +6 -6
- package/src/Component/Tile/Tile.stories.ts +38 -12
- package/src/Component/Tile/Tile.stories.tsx +2 -2
- package/src/Component/Tile/Tile.tsx +30 -17
- package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +49 -75
- package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +6 -16
- package/src/Form/Checkbox/Checkbox.stories.ts +1 -1
- package/src/Form/Checkbox/FormCheckbox.stories.tsx +1 -1
- package/src/Form/Checkbox/FormCheckbox.tsx +5 -7
- package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +23 -19
- package/src/Form/Description/Description.stories.ts +1 -1
- package/src/Form/Description/FormDescription.stories.tsx +1 -1
- package/src/Form/Description/FormStatus.stories.ts +1 -1
- package/src/Form/Description/__snapshots__/Description.stories.ts.snap +7 -5
- package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +14 -10
- package/src/Form/Form/Form.stories.tsx +1 -1
- package/src/Form/Form/FormTitle.stories.tsx +1 -1
- package/src/Form/FormItem/FormItem.stories.ts +1 -4
- package/src/Form/FormItem/FormItem.stories.tsx +1 -1
- package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +119 -109
- package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +4 -4
- package/src/Form/Label/FormLabel.stories.tsx +1 -1
- package/src/Form/Label/FormLabel.tsx +1 -1
- package/src/Form/Label/Label.stories.ts +1 -1
- package/src/Form/Label/__snapshots__/Label.stories.ts.snap +21 -15
- package/src/Form/Radio/FormRadio.stories.tsx +1 -1
- package/src/Form/Radio/FormRadio.tsx +4 -4
- package/src/Form/Radio/Radio.stories.ts +1 -1
- package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +55 -51
- package/src/Form/Search/Search.stories.ts +1 -4
- package/src/Form/Search/__snapshots__/Search.stories.ts.snap +23 -21
- package/src/Form/Select/FormSelect.stories.tsx +1 -1
- package/src/Form/Select/FormSelect.tsx +1 -1
- package/src/Form/Select/Select.stories.ts +1 -1
- package/src/Form/Select/__snapshots__/Select.stories.ts.snap +18 -16
- package/src/Form/TextInput/FormText.stories.tsx +1 -1
- package/src/Form/TextInput/InputDivider.stories.ts +1 -1
- package/src/Form/TextInput/TextInput.stories.ts +1 -1
- package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +1 -1
- package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +24 -22
- package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +18 -14
- package/src/Form/Textarea/FormTextarea.stories.tsx +1 -1
- package/src/Form/Textarea/Textarea.stories.ts +1 -1
- package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +1 -1
- package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +9 -7
- package/src/Form/form.css +24 -34
- package/src/Introduction.mdx +40 -0
- package/src/Layout/Footer/Footer.stories.ts +1 -6
- package/src/Layout/Footer/Footer.stories.tsx +1 -1
- package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +10 -10
- package/src/Layout/Footer/footer.css +2 -6
- package/src/Layout/Footer/footer.twig +0 -1
- package/src/Layout/Grid/Grid.stories.ts +8 -8
- package/src/Layout/Grid/Grid.stories.tsx +2 -2
- package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +38 -32
- package/src/Layout/Grid/container-grid.css +10 -10
- package/src/Layout/Grid/grid-item.twig +3 -1
- package/src/Layout/Grid/grid.css +3 -3
- package/src/Layout/Header/Header.stories.ts +1 -6
- package/src/Layout/Header/Header.stories.tsx +1 -1
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +11 -11
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
- package/src/Layout/Header/_header.css +18 -16
- package/src/Layout/Header/header.twig +1 -2
- package/src/Layout/Masthead/Masthead.stories.ts +1 -3
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +6 -6
- package/src/Layout/Masthead/masthead.twig +0 -2
- package/src/Layout/Page/Page.stories.tsx +1 -1
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +3 -3
- package/src/Layout/Page/page.css +16 -40
- package/src/Layout/Page/page.twig +6 -1
- package/src/Layout/Section/Background.stories.ts +60 -8
- package/src/Layout/Section/Breakouts.stories.ts +1 -3
- package/src/Layout/Section/Flow.stories.ts +1 -3
- package/src/Layout/Section/Section.stories.ts +1 -6
- package/src/Layout/Section/Section.stories.tsx +1 -1
- package/src/Layout/Section/SectionGrid.stories.tsx +1 -1
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +36 -24
- package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +54 -52
- package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +18 -18
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +2 -2
- package/src/Layout/Section/section.css +15 -18
- package/src/Layout/Section/section.twig +0 -1
- package/src/Layout/Section/twig/section-background.twig +29 -10
- package/src/Layout/Section/twig/sections-breakout.twig +28 -33
- package/src/Layout/Section/twig/sections-flow.twig +17 -17
- package/src/Layout/Section/twig/sections-stacked.twig +4 -4
- package/src/Layout/Sidebar/Sidebar.stories.ts +1 -3
- package/src/Layout/Sidebar/Sidebar.stories.tsx +1 -1
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +5 -5
- package/src/Layout/Sidebar/sidebar.css +2 -18
- package/src/Utility/Context/ImageComponent.tsx +3 -6
- package/src/Utility/Context/LinkComponent.tsx +3 -6
- package/src/Utility/Drupal/drupal.css +1 -5
- package/src/Utility/Elements/breakpoint-loader.ts +0 -1
- package/src/Utility/Elements/cookie-compliance.ts +0 -1
- package/src/Utility/Elements/io-loader.ts +0 -1
- package/src/Utility/Hooks/useLocalStorage.ts +0 -1
- package/src/Utility/Hooks/useMediaQuery.ts +0 -1
- package/src/Utility/Hooks/useToggle.ts +0 -1
- package/src/Utility/global.d.ts +0 -1
- package/src/Utility/utilities.ts +0 -1
- package/src/constants.css +53 -24
- package/src/enums.ts +1 -2
- package/src/react.ts +3 -0
- package/src/tokens.js +19 -19
- package/dist/build/accordion.entry.js.map +0 -1
- package/dist/build/chunks/Accordion-DSze7pxN.js +0 -61
- package/dist/build/chunks/Accordion-DSze7pxN.js.map +0 -1
- package/dist/build/chunks/disclosure-widget-CQLPJ8Ta.js +0 -124
- package/dist/build/chunks/disclosure-widget-CQLPJ8Ta.js.map +0 -1
- package/dist/build/chunks/drop-menu.entry-BC6x9vst.js +0 -132
- package/dist/build/chunks/drop-menu.entry-BC6x9vst.js.map +0 -1
- package/dist/build/chunks/keyboard-C73DHu0c.js +0 -101
- package/dist/build/chunks/keyboard-C73DHu0c.js.map +0 -1
- package/dist/build/chunks/polyfills-CJ5uTmUJ.js +0 -749
- package/dist/build/chunks/polyfills-CJ5uTmUJ.js.map +0 -1
- package/dist/build/chunks/popover-wbPSyFRj.js +0 -654
- package/dist/build/chunks/popover-wbPSyFRj.js.map +0 -1
- package/dist/build/chunks/utilities-B4YZb689.js +0 -243
- package/dist/build/chunks/utilities-B4YZb689.js.map +0 -1
- package/dist/build/dialog.entry.js.map +0 -1
- package/dist/build/drop-menu.entry.js.map +0 -1
- package/dist/build/filters.entry.js.map +0 -1
- package/dist/build/global-alert.entry.js.map +0 -1
- package/dist/build/header.entry.js.map +0 -1
- package/dist/build/in-page-navigation.entry.js.map +0 -1
- package/dist/build/navigation.entry.js.map +0 -1
- package/dist/build/sticky.entry.js.map +0 -1
- package/dist/build/tabs.entry.js.map +0 -1
- package/dist/build/tiles.css +0 -61
- package/src/Component/Tile/tile.twig +0 -10
- package/src/Component/Tile/tiles.css +0 -58
- package/src/Component/Tile/twig/tiles.twig +0 -18
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@layer design-system.components.carousel {
|
|
6
|
+
.mx-carousel {
|
|
7
|
+
display: block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mx-carousel__scrollable {
|
|
11
|
+
list-style: none;
|
|
12
|
+
display: flex;
|
|
13
|
+
block-size: var(--block-size, auto);
|
|
14
|
+
overflow: auto hidden;
|
|
15
|
+
scroll-snap-type: x mandatory;
|
|
16
|
+
-webkit-overflow-scrolling: touch;
|
|
17
|
+
scroll-behavior: smooth;
|
|
18
|
+
scrollbar-color: var(--colour-foreground) var(--colour-background);
|
|
19
|
+
|
|
20
|
+
&::-webkit-scrollbar {
|
|
21
|
+
block-size: 1rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&::-webkit-scrollbar-track {
|
|
25
|
+
background-color: var(--colour-background);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar-thumb {
|
|
29
|
+
background-color: var(--colour-foreground);
|
|
30
|
+
background-image: linear-gradient(
|
|
31
|
+
var(--colour-background) 0,
|
|
32
|
+
var(--colour-background) 0.25rem,
|
|
33
|
+
var(--colour-foreground) 0.25rem,
|
|
34
|
+
var(--colour-foreground) 0.75rem,
|
|
35
|
+
var(--colour-background) 0.75rem
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
& > li {
|
|
40
|
+
flex: 0 0 var(--inline-size, 25ch);
|
|
41
|
+
display: flex;
|
|
42
|
+
scroll-snap-align: start;
|
|
43
|
+
|
|
44
|
+
&[inert] {
|
|
45
|
+
opacity: 0.3;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
& + li {
|
|
49
|
+
margin-inline-start: var(--gap);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
& .mx-container {
|
|
53
|
+
inline-size: 100%;
|
|
54
|
+
display: flex;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:not(:first-child) {
|
|
59
|
+
padding-block-start: var(--gap);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.overflowing:not(.no-bar) {
|
|
63
|
+
padding-block-end: var(--gap);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.no-bar {
|
|
67
|
+
scrollbar-width: none;
|
|
68
|
+
|
|
69
|
+
&::-webkit-scrollbar {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.mx-carousel__buttons {
|
|
76
|
+
&:not([hidden]) {
|
|
77
|
+
display: flex;
|
|
78
|
+
gap: var(--gap-s);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& button[disabled] {
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.mx-carousel__pagination {
|
|
87
|
+
list-style: none;
|
|
88
|
+
padding-inline: 0;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: var(--spacing-xxxs);
|
|
92
|
+
|
|
93
|
+
&[data-pagination="counter"] {
|
|
94
|
+
--border-radius: var(--border-radius-round);
|
|
95
|
+
--indent: 200%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
& button {
|
|
99
|
+
border-radius: var(--border-radius);
|
|
100
|
+
border: var(--line-width, 2px) solid
|
|
101
|
+
var(--line-colour, var(--colour-border));
|
|
102
|
+
background-color: var(--background, var(--colour-background));
|
|
103
|
+
color: var(--foreground, var(--colour-foreground));
|
|
104
|
+
min-block-size: 2em;
|
|
105
|
+
min-inline-size: 2em;
|
|
106
|
+
font-family: inherit;
|
|
107
|
+
text-align: center;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
text-indent: var(--indent, unset);
|
|
111
|
+
|
|
112
|
+
&[disabled] {
|
|
113
|
+
--background: var(--active-background, var(--colour-border));
|
|
114
|
+
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{% set classes = [
|
|
2
|
+
'mx-carousel',
|
|
3
|
+
'mx-vertical-flow'
|
|
4
|
+
] %}
|
|
5
|
+
{% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
|
|
6
|
+
|
|
7
|
+
<mx-carousel{{ attributes }} role="group" {% if loop %} loop{% endif %}>
|
|
8
|
+
<div class="mx-carousel__buttons" data-buttons hidden>
|
|
9
|
+
<button class="mx-carousel__prev mx-button mx-button--icon-only" type="button">
|
|
10
|
+
<span class="sr-only">previous</span>
|
|
11
|
+
<span class="mx-icon mx-icon--chevron-left"></span>
|
|
12
|
+
</button>
|
|
13
|
+
<button class="mx-carousel__next mx-button mx-button--icon-only" type="button">
|
|
14
|
+
<span class="sr-only">next</span>
|
|
15
|
+
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
<ul class="mx-carousel__scrollable">
|
|
19
|
+
{% for item in items %}
|
|
20
|
+
<li>{{ item }}</li>
|
|
21
|
+
{% endfor %}
|
|
22
|
+
</ul>
|
|
23
|
+
{% if pagination or counter %}
|
|
24
|
+
{% set type = pagination ? 'pagination' : 'counter' %}
|
|
25
|
+
<ol class="mx-carousel__pagination" data-pagination="{{ type }}" hidden></ol>
|
|
26
|
+
{% endif %}
|
|
27
|
+
</mx-carousel>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/html"
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/html-vite"
|
|
2
2
|
import Component from "./content-block.twig"
|
|
3
|
-
import Heading from "../../Atom/Heading/heading.twig"
|
|
4
|
-
import Link from "../../Atom/Link/link.twig"
|
|
5
|
-
import Image from "../../Atom/Image/image.twig"
|
|
6
|
-
import LinkList from "../LinkList/link-list.twig"
|
|
7
|
-
import Icon from "../../Atom/Icon/icon.twig"
|
|
8
3
|
import "./content-block.css"
|
|
9
|
-
import "../LinkList/link-list.css"
|
|
10
4
|
import {
|
|
11
5
|
ContentBlock as ContentBlockType,
|
|
12
6
|
HeadingTypes,
|
|
13
7
|
} from "@pnx-mixtape/ids-shape"
|
|
14
8
|
import { Icons } from "../../enums"
|
|
15
9
|
|
|
10
|
+
// Deps.
|
|
11
|
+
import Heading from "../../Atom/Heading/heading.twig"
|
|
12
|
+
import Link from "../../Atom/Link/link.twig"
|
|
13
|
+
import Image from "../../Atom/Image/image.twig"
|
|
14
|
+
import LinkList from "../LinkList/link-list.twig"
|
|
15
|
+
import Icon from "../../Atom/Icon/icon.twig"
|
|
16
|
+
import "../LinkList/link-list.css"
|
|
17
|
+
|
|
16
18
|
const meta: Meta<ContentBlockType> = {
|
|
17
19
|
tags: ["autodocs", "ids-mvp"],
|
|
18
20
|
component: Component,
|
|
@@ -30,24 +32,30 @@ const meta: Meta<ContentBlockType> = {
|
|
|
30
32
|
"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>",
|
|
31
33
|
linkList: LinkList({
|
|
32
34
|
items: [
|
|
33
|
-
{
|
|
34
|
-
title: "
|
|
35
|
+
Link({
|
|
36
|
+
title: "Music",
|
|
35
37
|
href: "#",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
iconEnd: Icon({
|
|
39
|
+
icon: Icons.CHEVRON_RIGHT,
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
Link({
|
|
43
|
+
title: "Performances",
|
|
39
44
|
href: "#",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
iconEnd: Icon({
|
|
46
|
+
icon: Icons.CHEVRON_RIGHT,
|
|
47
|
+
}),
|
|
48
|
+
}),
|
|
49
|
+
Link({
|
|
50
|
+
title: "Get involved",
|
|
43
51
|
href: "#",
|
|
44
|
-
|
|
52
|
+
iconEnd: Icon({
|
|
53
|
+
icon: Icons.CHEVRON_RIGHT,
|
|
54
|
+
}),
|
|
55
|
+
}),
|
|
45
56
|
],
|
|
46
57
|
}),
|
|
47
58
|
},
|
|
48
|
-
parameters: {
|
|
49
|
-
deepControls: { enabled: true },
|
|
50
|
-
},
|
|
51
59
|
argTypes: {
|
|
52
60
|
// @ts-expect-error The controls follow the shape
|
|
53
61
|
"image.src": { control: "text" },
|
|
@@ -1,105 +1,165 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Component/ContentBlock ContentBlock smoke-test 1`] = `
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
4
|
+
<div class="mx-page default">
|
|
5
|
+
<article class="mx-content-block">
|
|
6
|
+
<div class="mx-content-block__content mx-vertical-flow-flex">
|
|
7
|
+
<h3>
|
|
8
|
+
Content block title
|
|
9
|
+
</h3>
|
|
10
|
+
<p>
|
|
11
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
12
|
+
</p>
|
|
13
|
+
<ul class="mx-link-list">
|
|
14
|
+
<li>
|
|
15
|
+
<a href="#">
|
|
16
|
+
<span>
|
|
17
|
+
Music
|
|
18
|
+
</span>
|
|
19
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
20
|
+
</span>
|
|
21
|
+
</a>
|
|
22
|
+
</li>
|
|
23
|
+
<li>
|
|
24
|
+
<a href="#">
|
|
25
|
+
<span>
|
|
26
|
+
Performances
|
|
27
|
+
</span>
|
|
28
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
29
|
+
</span>
|
|
30
|
+
</a>
|
|
31
|
+
</li>
|
|
32
|
+
<li>
|
|
33
|
+
<a href="#">
|
|
34
|
+
<span>
|
|
35
|
+
Get involved
|
|
36
|
+
</span>
|
|
37
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
38
|
+
</span>
|
|
39
|
+
</a>
|
|
40
|
+
</li>
|
|
41
|
+
</ul>
|
|
42
|
+
<a class="mx-link--more"
|
|
43
|
+
href="#"
|
|
44
|
+
>
|
|
45
|
+
<span>
|
|
46
|
+
Find out more
|
|
47
|
+
</span>
|
|
48
|
+
</a>
|
|
49
|
+
</div>
|
|
50
|
+
</article>
|
|
51
|
+
</div>
|
|
32
52
|
`;
|
|
33
53
|
|
|
34
54
|
exports[`Component/ContentBlock WithIcon smoke-test 1`] = `
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
</div>
|
|
40
|
-
<div class="mx-content-block__content mx-vertical-flow-flex">
|
|
41
|
-
<h3>
|
|
42
|
-
Content block title
|
|
43
|
-
</h3>
|
|
44
|
-
<p>
|
|
45
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
46
|
-
</p>
|
|
47
|
-
<ul class="mx-link-list">
|
|
48
|
-
<li>
|
|
49
|
-
[object Object]
|
|
50
|
-
</li>
|
|
51
|
-
<li>
|
|
52
|
-
[object Object]
|
|
53
|
-
</li>
|
|
54
|
-
<li>
|
|
55
|
-
[object Object]
|
|
56
|
-
</li>
|
|
57
|
-
</ul>
|
|
58
|
-
<a class="mx-link--more"
|
|
59
|
-
href="#"
|
|
60
|
-
>
|
|
61
|
-
<span>
|
|
62
|
-
Find out more
|
|
55
|
+
<div class="mx-page default">
|
|
56
|
+
<article class="mx-content-block">
|
|
57
|
+
<div class="mx-content-block__icon">
|
|
58
|
+
<span class="mx-icon mx-icon--heart-selected ">
|
|
63
59
|
</span>
|
|
64
|
-
</
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
</div>
|
|
61
|
+
<div class="mx-content-block__content mx-vertical-flow-flex">
|
|
62
|
+
<h3>
|
|
63
|
+
Content block title
|
|
64
|
+
</h3>
|
|
65
|
+
<p>
|
|
66
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
67
|
+
</p>
|
|
68
|
+
<ul class="mx-link-list">
|
|
69
|
+
<li>
|
|
70
|
+
<a href="#">
|
|
71
|
+
<span>
|
|
72
|
+
Music
|
|
73
|
+
</span>
|
|
74
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
75
|
+
</span>
|
|
76
|
+
</a>
|
|
77
|
+
</li>
|
|
78
|
+
<li>
|
|
79
|
+
<a href="#">
|
|
80
|
+
<span>
|
|
81
|
+
Performances
|
|
82
|
+
</span>
|
|
83
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
84
|
+
</span>
|
|
85
|
+
</a>
|
|
86
|
+
</li>
|
|
87
|
+
<li>
|
|
88
|
+
<a href="#">
|
|
89
|
+
<span>
|
|
90
|
+
Get involved
|
|
91
|
+
</span>
|
|
92
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
93
|
+
</span>
|
|
94
|
+
</a>
|
|
95
|
+
</li>
|
|
96
|
+
</ul>
|
|
97
|
+
<a class="mx-link--more"
|
|
98
|
+
href="#"
|
|
99
|
+
>
|
|
100
|
+
<span>
|
|
101
|
+
Find out more
|
|
102
|
+
</span>
|
|
103
|
+
</a>
|
|
104
|
+
</div>
|
|
105
|
+
</article>
|
|
106
|
+
</div>
|
|
67
107
|
`;
|
|
68
108
|
|
|
69
109
|
exports[`Component/ContentBlock WithImage smoke-test 1`] = `
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
|
|
110
|
+
<div class="mx-page default">
|
|
111
|
+
<article class="mx-content-block">
|
|
112
|
+
<figure class="mx-content-block__media">
|
|
113
|
+
<picture>
|
|
114
|
+
<img src="https://picsum.photos/id/56/558/418?grayscale"
|
|
115
|
+
alt="Blurry bubbles"
|
|
116
|
+
>
|
|
117
|
+
</picture>
|
|
118
|
+
</figure>
|
|
119
|
+
<div class="mx-content-block__content mx-vertical-flow-flex">
|
|
120
|
+
<h3>
|
|
121
|
+
Content block title
|
|
122
|
+
</h3>
|
|
123
|
+
<p>
|
|
124
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
125
|
+
</p>
|
|
126
|
+
<ul class="mx-link-list">
|
|
127
|
+
<li>
|
|
128
|
+
<a href="#">
|
|
129
|
+
<span>
|
|
130
|
+
Music
|
|
131
|
+
</span>
|
|
132
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
133
|
+
</span>
|
|
134
|
+
</a>
|
|
135
|
+
</li>
|
|
136
|
+
<li>
|
|
137
|
+
<a href="#">
|
|
138
|
+
<span>
|
|
139
|
+
Performances
|
|
140
|
+
</span>
|
|
141
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
142
|
+
</span>
|
|
143
|
+
</a>
|
|
144
|
+
</li>
|
|
145
|
+
<li>
|
|
146
|
+
<a href="#">
|
|
147
|
+
<span>
|
|
148
|
+
Get involved
|
|
149
|
+
</span>
|
|
150
|
+
<span class="mx-icon mx-icon--chevron-right ">
|
|
151
|
+
</span>
|
|
152
|
+
</a>
|
|
153
|
+
</li>
|
|
154
|
+
</ul>
|
|
155
|
+
<a class="mx-link--more"
|
|
156
|
+
href="#"
|
|
75
157
|
>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
84
|
-
</p>
|
|
85
|
-
<ul class="mx-link-list">
|
|
86
|
-
<li>
|
|
87
|
-
[object Object]
|
|
88
|
-
</li>
|
|
89
|
-
<li>
|
|
90
|
-
[object Object]
|
|
91
|
-
</li>
|
|
92
|
-
<li>
|
|
93
|
-
[object Object]
|
|
94
|
-
</li>
|
|
95
|
-
</ul>
|
|
96
|
-
<a class="mx-link--more"
|
|
97
|
-
href="#"
|
|
98
|
-
>
|
|
99
|
-
<span>
|
|
100
|
-
Find out more
|
|
101
|
-
</span>
|
|
102
|
-
</a>
|
|
103
|
-
</div>
|
|
104
|
-
</article>
|
|
158
|
+
<span>
|
|
159
|
+
Find out more
|
|
160
|
+
</span>
|
|
161
|
+
</a>
|
|
162
|
+
</div>
|
|
163
|
+
</article>
|
|
164
|
+
</div>
|
|
105
165
|
`;
|
|
@@ -1,28 +1,96 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/html"
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/html-vite"
|
|
2
2
|
import Component from "./dialog.twig"
|
|
3
3
|
import "./dialog.css"
|
|
4
|
+
import "./Elements/Dialog"
|
|
5
|
+
import {
|
|
6
|
+
ButtonModifiers,
|
|
7
|
+
Dialog as DialogType,
|
|
8
|
+
HeadingTypes,
|
|
9
|
+
} from "@pnx-mixtape/ids-shape"
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
// Deps.
|
|
12
|
+
import Heading from "../../Atom/Heading/heading.twig"
|
|
13
|
+
import Button from "../../Atom/Button/button.twig"
|
|
14
|
+
import Link from "../../Atom/Link/link.twig"
|
|
15
|
+
import DrupalAttribute from "drupal-attribute"
|
|
16
|
+
|
|
17
|
+
type MxDialogType = DialogType & {
|
|
6
18
|
fullscreen?: boolean
|
|
7
19
|
}
|
|
8
20
|
|
|
9
|
-
const meta: Meta<
|
|
10
|
-
tags: ["autodocs"],
|
|
21
|
+
const meta: Meta<MxDialogType> = {
|
|
22
|
+
tags: ["autodocs", "ids-mvp"],
|
|
11
23
|
component: Component,
|
|
24
|
+
args: {
|
|
25
|
+
id: "example-dialog",
|
|
26
|
+
title: Heading({
|
|
27
|
+
title: "Dialog heading",
|
|
28
|
+
as: HeadingTypes.TWO,
|
|
29
|
+
}),
|
|
30
|
+
content:
|
|
31
|
+
"<p>I'm baby air plant hashtag letterpress blue bottle. Cloud bread dreamcatcher everyday carry lumbersexual, iceland cardigan swag chicharrones lo-fi fanny pack affogato freegan XOXO shaman. Shoreditch cloud bread waistcoat tbh XOXO. Chillwave pour-over umami pug glossier health goth.</p>",
|
|
32
|
+
link: Button({
|
|
33
|
+
title: "Let's go",
|
|
34
|
+
modifiers: [ButtonModifiers.DARK],
|
|
35
|
+
|
|
36
|
+
attributes: new DrupalAttribute()?.setAttribute("data-close", ""),
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
12
39
|
argTypes: {
|
|
40
|
+
open: { control: "boolean" },
|
|
41
|
+
modal: { control: "boolean" },
|
|
13
42
|
fullscreen: { control: "boolean" },
|
|
14
43
|
},
|
|
44
|
+
render: args => `
|
|
45
|
+
${Link({
|
|
46
|
+
title: "Open dialog",
|
|
47
|
+
modifiers: [ButtonModifiers.DARK],
|
|
48
|
+
href: "#example-dialog",
|
|
49
|
+
})}
|
|
50
|
+
${Component(args)}
|
|
51
|
+
`,
|
|
15
52
|
}
|
|
16
53
|
|
|
17
54
|
export default meta
|
|
18
|
-
type Story = StoryObj<
|
|
55
|
+
type Story = StoryObj<MxDialogType>
|
|
56
|
+
|
|
57
|
+
export const Dialog: Story = {}
|
|
19
58
|
|
|
20
|
-
export const
|
|
21
|
-
args: {
|
|
59
|
+
export const Modal: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
id: "example-modal",
|
|
62
|
+
modal: true,
|
|
63
|
+
},
|
|
64
|
+
render: args => `
|
|
65
|
+
${Button({
|
|
66
|
+
title: "Open modal",
|
|
67
|
+
modifiers: [ButtonModifiers.DARK],
|
|
68
|
+
|
|
69
|
+
attributes: new DrupalAttribute()?.setAttribute(
|
|
70
|
+
"aria-controls",
|
|
71
|
+
"example-modal",
|
|
72
|
+
),
|
|
73
|
+
})}
|
|
74
|
+
${Component(args)}
|
|
75
|
+
`,
|
|
22
76
|
}
|
|
23
77
|
|
|
24
78
|
export const Fullscreen: Story = {
|
|
25
79
|
args: {
|
|
80
|
+
id: "example-fullscreen",
|
|
26
81
|
fullscreen: true,
|
|
82
|
+
modal: true,
|
|
27
83
|
},
|
|
84
|
+
render: args => `
|
|
85
|
+
${Button({
|
|
86
|
+
title: "Open fullscreen modal",
|
|
87
|
+
modifiers: [ButtonModifiers.DARK],
|
|
88
|
+
|
|
89
|
+
attributes: new DrupalAttribute()?.setAttribute(
|
|
90
|
+
"aria-controls",
|
|
91
|
+
"example-fullscreen",
|
|
92
|
+
),
|
|
93
|
+
})}
|
|
94
|
+
${Component(args)}
|
|
95
|
+
`,
|
|
28
96
|
}
|
|
@@ -17,34 +17,18 @@ export default class Dialog extends HTMLElement {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
connectedCallback(): void {
|
|
20
|
-
if (!this.
|
|
20
|
+
if (!this.dialog) return
|
|
21
21
|
|
|
22
22
|
const { signal }: AbortController = this.controller
|
|
23
23
|
|
|
24
24
|
// Open on toggle click.
|
|
25
|
-
|
|
26
|
-
"click",
|
|
27
|
-
(e: MouseEvent): void => {
|
|
28
|
-
if (![...this.openBtns].includes(e.target as HTMLButtonElement)) return
|
|
29
|
-
this.handleOpen()
|
|
30
|
-
e.preventDefault()
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
signal,
|
|
34
|
-
},
|
|
25
|
+
this.openBtns?.forEach(btn =>
|
|
26
|
+
btn.addEventListener("click", this.handleOpen, { signal }),
|
|
35
27
|
)
|
|
36
28
|
|
|
37
29
|
// Close on close button click.
|
|
38
|
-
this.
|
|
39
|
-
"click",
|
|
40
|
-
(e: MouseEvent): void => {
|
|
41
|
-
if (![...this.closeBtns].includes(e.target as HTMLButtonElement)) return
|
|
42
|
-
this.handleClose()
|
|
43
|
-
e.preventDefault()
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
signal,
|
|
47
|
-
},
|
|
30
|
+
this.closeBtns?.forEach(btn =>
|
|
31
|
+
btn.addEventListener("click", this.handleClose, { signal }),
|
|
48
32
|
)
|
|
49
33
|
|
|
50
34
|
// Close on outside click.
|
|
@@ -77,31 +61,32 @@ export default class Dialog extends HTMLElement {
|
|
|
77
61
|
disconnectedCallback(): void {
|
|
78
62
|
if (!this.dialog) return
|
|
79
63
|
if (typeof this.dialog.close === "function") this.dialog.close()
|
|
80
|
-
this.openBtns
|
|
64
|
+
this.openBtns?.forEach((btn: Element) =>
|
|
81
65
|
btn.setAttribute("aria-expanded", "false"),
|
|
82
66
|
)
|
|
83
|
-
document.body.classList.remove(this.scrollLockClass)
|
|
67
|
+
if (this.isModal) document.body.classList.remove(this.scrollLockClass)
|
|
84
68
|
this.controller.abort()
|
|
85
69
|
}
|
|
86
70
|
|
|
87
|
-
handleOpen = (): void => {
|
|
71
|
+
handleOpen = (event: MouseEvent): void => {
|
|
88
72
|
if (!this.dialog) return
|
|
73
|
+
event.preventDefault()
|
|
89
74
|
if (typeof this.dialog.show === "function") {
|
|
90
75
|
this.isModal ? this.dialog.showModal() : this.dialog.show()
|
|
91
76
|
}
|
|
92
|
-
this.openBtns
|
|
77
|
+
this.openBtns?.forEach((btn: Element) =>
|
|
93
78
|
btn.setAttribute("aria-expanded", "true"),
|
|
94
79
|
)
|
|
95
|
-
document.body.classList.add(this.scrollLockClass)
|
|
80
|
+
if (this.isModal) document.body.classList.add(this.scrollLockClass)
|
|
96
81
|
}
|
|
97
82
|
|
|
98
83
|
handleClose = (): void => {
|
|
99
84
|
if (!this.dialog) return
|
|
100
85
|
if (typeof this.dialog.close === "function") this.dialog.close()
|
|
101
|
-
this.openBtns
|
|
86
|
+
this.openBtns?.forEach((btn: Element) =>
|
|
102
87
|
btn.setAttribute("aria-expanded", "false"),
|
|
103
88
|
)
|
|
104
|
-
document.body.classList.remove(this.scrollLockClass)
|
|
89
|
+
if (this.isModal) document.body.classList.remove(this.scrollLockClass)
|
|
105
90
|
}
|
|
106
91
|
|
|
107
92
|
get dialog(): HTMLDialogElement | null {
|
|
@@ -116,12 +101,7 @@ export default class Dialog extends HTMLElement {
|
|
|
116
101
|
const btns: NodeListOf<HTMLButtonElement> = document.querySelectorAll(
|
|
117
102
|
`[href="#${this.id}"], [aria-controls="${this.id}"]`,
|
|
118
103
|
)
|
|
119
|
-
|
|
120
|
-
throw new Error(
|
|
121
|
-
`${this.localName} must have an associated opening element.`,
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
btns.forEach((btn: HTMLButtonElement): void => {
|
|
104
|
+
btns?.forEach((btn: HTMLButtonElement): void => {
|
|
125
105
|
btn.setAttribute("aria-controls", this.id)
|
|
126
106
|
})
|
|
127
107
|
return btns
|