@content-blocks/js 0.7.6 → 0.8.0
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/LICENSE +1 -1
- package/README.md +111 -3
- package/THIRD-PARTY-NOTICES.md +21 -0
- package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -2
- package/dist/cjs/content-accordion.cjs.entry.js +87 -0
- package/dist/cjs/content-blocks.cjs.js +35 -11
- package/dist/cjs/content-button.cjs.entry.js +113 -0
- package/dist/cjs/content-carousel.cjs.entry.js +153 -47
- package/dist/cjs/content-grid-formatter.cjs.entry.js +102 -0
- package/dist/cjs/content-hero-block.cjs.entry.js +45 -0
- package/dist/cjs/content-image.cjs.entry.js +153 -0
- package/dist/cjs/content-line.cjs.entry.js +61 -0
- package/dist/cjs/content-navigation-block.cjs.entry.js +51 -34
- package/dist/cjs/content-overlay.cjs.entry.js +641 -0
- package/dist/cjs/content-spacer.cjs.entry.js +75 -0
- package/dist/cjs/content-split-block.cjs.entry.js +22 -19
- package/dist/cjs/content-tabs.cjs.entry.js +38 -21
- package/dist/cjs/content-text-block.cjs.entry.js +63 -0
- package/dist/cjs/content-tout-block.cjs.entry.js +34 -0
- package/dist/cjs/{content-accordion_11.cjs.entry.js → content-video.cjs.entry.js} +14560 -12927
- package/dist/cjs/{focus-trap.esm-7bc384a0.js → focus-trap.esm-ZwN-anf1.js} +484 -190
- package/dist/cjs/{index-2e0ce692.js → index-B1U6Gweq.js} +348 -246
- package/dist/cjs/index-ClnpH9XB.js +2170 -0
- package/dist/cjs/index-CyalvZJn.js +1719 -0
- package/dist/cjs/index-DUvWvBDN.js +290 -0
- package/dist/cjs/index-voGY4Tkl.js +4705 -0
- package/dist/cjs/index.cjs.js +2 -5
- package/dist/cjs/loader.cjs.js +3 -8
- package/dist/cjs/responsive-component-C5eJS82z.js +171 -0
- package/dist/cjs/responsive-component-DMdnQIPV.js +171 -0
- package/dist/cjs/swiper-KLYbvU1K.js +3931 -0
- package/dist/cjs/{swiper-8221f4e8.js → swiper-_Z8Y4IJI.js} +269 -236
- package/dist/cjs/utils-BCHaRGm_.js +462 -0
- package/dist/cjs/{utils-df044337.js → utils-C3gXIS2t.js} +51 -49
- package/dist/cjs/utils-DUvWvBDN.js +290 -0
- package/dist/collection/blocks/content-hero-block/content-hero-block.css +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js +33 -48
- package/dist/collection/blocks/content-split-block/content-split-block.css +16 -5
- package/dist/collection/blocks/content-split-block/content-split-block.js +29 -48
- package/dist/collection/blocks/content-text-block/content-text-block.js +65 -59
- package/dist/collection/blocks/content-tout-block/content-tout-block.css +3 -0
- package/dist/collection/blocks/content-tout-block/content-tout-block.js +22 -47
- package/dist/collection/collection-manifest.json +8 -5
- package/dist/collection/components/content-accordion/content-accordion.css +20 -1
- package/dist/collection/components/content-accordion/content-accordion.js +67 -33
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js +0 -1
- package/dist/collection/components/content-carousel/content-carousel.css +60 -4
- package/dist/collection/components/content-carousel/content-carousel.js +294 -44
- package/dist/collection/components/content-navigation-block/content-navigation-block.css +15 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +86 -42
- package/dist/collection/components/content-overlay/content-overlay.css +36 -5
- package/dist/collection/components/content-overlay/content-overlay.js +181 -120
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js +0 -1
- package/dist/collection/components/content-tabs/content-tabs.js +7 -49
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js +0 -1
- package/dist/collection/elements/content-button/content-button.css +8 -7
- package/dist/collection/elements/content-button/content-button.js +103 -84
- package/dist/collection/elements/content-image/content-image.css +3 -1
- package/dist/collection/elements/content-image/content-image.js +176 -95
- package/dist/collection/elements/content-line/content-line.js +63 -54
- package/dist/collection/elements/content-video/content-video.css +1 -1
- package/dist/collection/elements/content-video/content-video.js +165 -92
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +8 -2
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +167 -89
- package/dist/collection/formatters/content-spacer/content-spacer.js +86 -209
- package/dist/collection/global/content-blocks-reset.css +77 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/sass/_mixins.scss +21 -5
- package/dist/collection/sass/_variables.scss +15 -15
- package/dist/collection/setupFiles.js +0 -1
- package/dist/collection/site/site.js +67 -0
- package/dist/collection/utils/breakpoints.js +162 -0
- package/dist/collection/utils/responsive-component.js +249 -0
- package/dist/collection/utils/utils.js +32 -42
- package/dist/components/content-accordion.js +65 -44
- package/dist/components/content-button.js +89 -43
- package/dist/components/content-carousel.js +172 -55
- package/dist/components/content-grid-formatter.js +127 -3
- package/dist/components/content-hero-block.js +33 -26
- package/dist/components/content-image.js +127 -71
- package/dist/components/content-line.js +56 -35
- package/dist/components/content-navigation-block.js +62 -39
- package/dist/components/content-overlay.js +128 -67
- package/dist/components/content-spacer.js +70 -54
- package/dist/components/content-split-block.js +33 -32
- package/dist/components/content-tabs.js +46 -25
- package/dist/components/content-text-block.js +55 -35
- package/dist/components/content-tout-block.js +29 -27
- package/dist/components/content-video.js +14624 -11972
- package/dist/{esm/focus-trap.esm-8fb54175.js → components/focus-trap.esm.js} +484 -190
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +3 -3
- package/dist/components/{p-5a91aa1b.js → index2.js} +348 -246
- package/dist/components/p-BWRCeMvO.js +1 -0
- package/dist/components/p-CYF5GU_q.js +1 -0
- package/dist/components/p-DXUoPIwl.js +10 -0
- package/dist/components/p-D_Ll4QNj.js +1 -0
- package/dist/components/p-DhIoW7H3.js +1 -0
- package/dist/components/responsive-component.js +168 -0
- package/dist/components/{p-e5dc4ea4.js → swiper.js} +268 -235
- package/dist/components/utils.js +4969 -0
- package/dist/{esm/utils-1c9f0ec1.js → components/utils2.js} +51 -50
- package/dist/content-blocks/content-accordion.entry.js +85 -0
- package/dist/content-blocks/content-blocks.esm.js +47 -2
- package/dist/content-blocks/content-button.entry.js +111 -0
- package/dist/content-blocks/content-carousel.entry.js +188 -0
- package/dist/content-blocks/content-grid-formatter.entry.js +100 -0
- package/dist/content-blocks/content-hero-block.entry.js +43 -0
- package/dist/content-blocks/content-image.entry.js +151 -0
- package/dist/content-blocks/content-line.entry.js +59 -0
- package/dist/content-blocks/content-navigation-block.entry.js +105 -0
- package/dist/content-blocks/content-overlay.entry.js +639 -0
- package/dist/content-blocks/content-spacer.entry.js +73 -0
- package/dist/content-blocks/content-split-block.entry.js +34 -0
- package/dist/content-blocks/content-tabs.entry.js +245 -0
- package/dist/content-blocks/content-text-block.entry.js +61 -0
- package/dist/content-blocks/content-tout-block.entry.js +32 -0
- package/dist/{esm/content-accordion_11.entry.js → content-blocks/content-video.entry.js} +14535 -12890
- package/dist/{components/p-a2fedf8a.js → content-blocks/focus-trap.esm-DXUoPIwl.js} +484 -190
- package/dist/content-blocks/global/content-blocks-reset.css +77 -0
- package/dist/content-blocks/index-BFDJMblF.js +4690 -0
- package/dist/{esm/index-f45a9c45.js → content-blocks/index-P1YnSd-O.js} +348 -246
- package/dist/content-blocks/index.esm.js +1 -2
- package/dist/content-blocks/p-008457f0.entry.js +1 -0
- package/dist/content-blocks/p-052692f1.entry.js +1 -0
- package/dist/content-blocks/p-0f71bd32.entry.js +1 -0
- package/dist/content-blocks/p-1f154617.entry.js +1 -0
- package/dist/content-blocks/p-2554ebd8.entry.js +1 -0
- package/dist/content-blocks/p-4afd6511.entry.js +1 -0
- package/dist/content-blocks/p-78d5de9f.entry.js +1 -0
- package/dist/content-blocks/p-7bcf7e7e.entry.js +1 -0
- package/dist/content-blocks/p-9058031c.entry.js +1 -0
- package/dist/content-blocks/p-9c41ac23.entry.js +17 -0
- package/dist/content-blocks/p-CLwOzPEO.js +3 -0
- package/dist/content-blocks/p-CYF5GU_q.js +1 -0
- package/dist/content-blocks/p-CjR_4mPu.js +1 -0
- package/dist/content-blocks/p-DQuL1Twl.js +1 -0
- package/dist/content-blocks/p-DXUoPIwl.js +10 -0
- package/dist/content-blocks/p-D_Ll4QNj.js +1 -0
- package/dist/content-blocks/p-DhIoW7H3.js +1 -0
- package/dist/content-blocks/p-DzYwy_62.js +1 -0
- package/dist/content-blocks/p-b2e6358a.entry.js +1 -0
- package/dist/content-blocks/p-c783bc68.entry.js +1 -0
- package/dist/content-blocks/p-e3d81e15.entry.js +1 -0
- package/dist/content-blocks/p-f23b4aae.entry.js +1 -0
- package/dist/content-blocks/p-f75c9094.entry.js +1 -0
- package/dist/content-blocks/responsive-component-BsLrcKbS.js +169 -0
- package/dist/content-blocks/sass/_mixins.scss +21 -5
- package/dist/content-blocks/sass/_variables.scss +15 -15
- package/dist/{esm/swiper-e9621adb.js → content-blocks/swiper-nBv069TB.js} +268 -235
- package/dist/{components/p-b85cfa86.js → content-blocks/utils--SDsQnWS.js} +51 -50
- package/dist/content-blocks/utils-Bak__24s.js +280 -0
- package/dist/docs.d.ts +480 -0
- package/dist/docs.json +5312 -0
- package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -2
- package/dist/esm/content-accordion.entry.js +85 -0
- package/dist/esm/content-blocks.js +33 -8
- package/dist/esm/content-button.entry.js +111 -0
- package/dist/esm/content-carousel.entry.js +153 -45
- package/dist/esm/content-grid-formatter.entry.js +100 -0
- package/dist/esm/content-hero-block.entry.js +43 -0
- package/dist/esm/content-image.entry.js +151 -0
- package/dist/esm/content-line.entry.js +59 -0
- package/dist/esm/content-navigation-block.entry.js +51 -32
- package/dist/esm/content-overlay.entry.js +639 -0
- package/dist/esm/content-spacer.entry.js +73 -0
- package/dist/esm/content-split-block.entry.js +22 -17
- package/dist/esm/content-tabs.entry.js +38 -19
- package/dist/esm/content-text-block.entry.js +61 -0
- package/dist/esm/content-tout-block.entry.js +32 -0
- package/dist/esm/content-video.entry.js +72033 -0
- package/dist/esm/focus-trap.esm-DXUoPIwl.js +1801 -0
- package/dist/esm/index-BASCLGuP.js +1713 -0
- package/dist/esm/index-BFDJMblF.js +4690 -0
- package/dist/esm/index-CLwOzPEO.js +2161 -0
- package/dist/esm/index-CjR_4mPu.js +280 -0
- package/dist/esm/index-P1YnSd-O.js +5397 -0
- package/dist/esm/index.js +1 -3
- package/dist/esm/loader.js +3 -6
- package/dist/esm/responsive-component-BsLrcKbS.js +169 -0
- package/dist/esm/responsive-component-D7dJHMp0.js +169 -0
- package/dist/esm/swiper-CtypHPwF.js +3928 -0
- package/dist/esm/swiper-nBv069TB.js +3941 -0
- package/dist/esm/utils--SDsQnWS.js +460 -0
- package/dist/esm/utils-Bak__24s.js +280 -0
- package/dist/esm/utils-CYF5GU_q.js +438 -0
- package/dist/node_modules/video.js/dist/video-js.min.css +1 -0
- package/dist/test/axe.js +60 -0
- package/dist/types/Users/shahrukceo/Developer/content-blocks/packages/js/.stencil/test/axe.d.ts +16 -0
- package/dist/types/blocks/content-hero-block/content-hero-block.d.ts +7 -11
- package/dist/types/blocks/content-split-block/content-split-block.d.ts +5 -9
- package/dist/types/blocks/content-text-block/content-text-block.d.ts +4 -9
- package/dist/types/blocks/content-tout-block/content-tout-block.d.ts +5 -10
- package/dist/types/components/content-accordion/content-accordion.d.ts +4 -3
- package/dist/types/components/content-accordion/libraries/w3_disclosure_button.d.ts +0 -1
- package/dist/types/components/content-carousel/content-carousel.d.ts +44 -7
- package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +14 -8
- package/dist/types/components/content-overlay/content-overlay.d.ts +15 -16
- package/dist/types/components/content-overlay/libraries/aria-dialog.d.ts +0 -1
- package/dist/types/components/content-overlay/libraries/aria-utilities.d.ts +0 -1
- package/dist/types/components/content-tabs/content-tabs.d.ts +4 -10
- package/dist/types/components/content-tabs/libraries/w3_tabs.d.ts +0 -1
- package/dist/types/components.d.ts +900 -196
- package/dist/types/elements/content-button/content-button.d.ts +8 -13
- package/dist/types/elements/content-image/content-image.d.ts +15 -9
- package/dist/types/elements/content-line/content-line.d.ts +5 -12
- package/dist/types/elements/content-video/content-video.d.ts +12 -11
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +14 -9
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +4 -36
- package/dist/types/index.d.ts +3 -1
- package/dist/types/setupFiles.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +265 -60
- package/dist/types/typings.d.ts +10 -0
- package/dist/types/utils/breakpoints.d.ts +57 -0
- package/dist/types/utils/responsive-component.d.ts +49 -0
- package/dist/types/utils/utils.d.ts +11 -8
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +75 -65
- package/dist/cjs/BehaviorSubject-12116537.js +0 -655
- package/dist/cjs/BehaviorSubject-12116537.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +0 -1
- package/dist/cjs/content-blocks.cjs.js.map +0 -1
- package/dist/cjs/content-carousel.cjs.entry.js.map +0 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +0 -1
- package/dist/cjs/content-split-block.cjs.entry.js.map +0 -1
- package/dist/cjs/content-tabs.cjs.entry.js.map +0 -1
- package/dist/cjs/focus-trap.esm-7bc384a0.js.map +0 -1
- package/dist/cjs/index-2e0ce692.js.map +0 -1
- package/dist/cjs/index-8af2820a.js +0 -1650
- package/dist/cjs/index-8af2820a.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/swiper-8221f4e8.js.map +0 -1
- package/dist/cjs/utils-df044337.js.map +0 -1
- package/dist/cjs/utils-f8ccab0a.js +0 -126
- package/dist/cjs/utils-f8ccab0a.js.map +0 -1
- package/dist/cjs/window-resize-service-65a5a370.js +0 -37
- package/dist/cjs/window-resize-service-65a5a370.js.map +0 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +0 -1
- package/dist/collection/blocks/content-split-block/content-split-block.js.map +0 -1
- package/dist/collection/blocks/content-text-block/content-text-block.js.map +0 -1
- package/dist/collection/blocks/content-tout-block/content-tout-block.js.map +0 -1
- package/dist/collection/components/content-accordion/content-accordion.js.map +0 -1
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js.map +0 -1
- package/dist/collection/components/content-carousel/content-carousel.js.map +0 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +0 -1
- package/dist/collection/components/content-overlay/content-overlay.js.map +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js.map +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js.map +0 -1
- package/dist/collection/components/content-tabs/content-tabs.js.map +0 -1
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js.map +0 -1
- package/dist/collection/elements/content-button/content-button.js.map +0 -1
- package/dist/collection/elements/content-image/content-image.js.map +0 -1
- package/dist/collection/elements/content-line/content-line.js.map +0 -1
- package/dist/collection/elements/content-video/content-video.js.map +0 -1
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +0 -1
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +0 -1
- package/dist/collection/globalScript.js +0 -15
- package/dist/collection/globalScript.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/services/content-events-service.js +0 -23
- package/dist/collection/services/content-events-service.js.map +0 -1
- package/dist/collection/services/window-resize-service.js +0 -31
- package/dist/collection/services/window-resize-service.js.map +0 -1
- package/dist/collection/setupFiles.js.map +0 -1
- package/dist/collection/stories/ContentHeroBlock.stories.js +0 -51
- package/dist/collection/stories/ContentHeroBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js +0 -33
- package/dist/collection/stories/ContentNavigationBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentSpacer.stories.js +0 -20
- package/dist/collection/stories/ContentSpacer.stories.js.map +0 -1
- package/dist/collection/stories/ContentTextBlock.stories.js +0 -17
- package/dist/collection/stories/ContentTextBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentToutBlock.stories.js +0 -17
- package/dist/collection/stories/ContentToutBlock.stories.js.map +0 -1
- package/dist/collection/stories/FullPageExample.stories.js +0 -432
- package/dist/collection/stories/FullPageExample.stories.js.map +0 -1
- package/dist/collection/stories/assets/accessibility.svg +0 -5
- package/dist/collection/stories/assets/discord.svg +0 -15
- package/dist/collection/stories/assets/github.svg +0 -3
- package/dist/collection/stories/assets/tutorials.svg +0 -12
- package/dist/collection/stories/assets/youtube.svg +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/content-accordion.js.map +0 -1
- package/dist/components/content-button.js.map +0 -1
- package/dist/components/content-carousel.js.map +0 -1
- package/dist/components/content-grid-formatter.js.map +0 -1
- package/dist/components/content-hero-block.js.map +0 -1
- package/dist/components/content-image.js.map +0 -1
- package/dist/components/content-line.js.map +0 -1
- package/dist/components/content-navigation-block.js.map +0 -1
- package/dist/components/content-overlay.js.map +0 -1
- package/dist/components/content-spacer.js.map +0 -1
- package/dist/components/content-split-block.js.map +0 -1
- package/dist/components/content-tabs.js.map +0 -1
- package/dist/components/content-text-block.js.map +0 -1
- package/dist/components/content-tout-block.js.map +0 -1
- package/dist/components/content-video.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-26483b46.js +0 -35
- package/dist/components/p-26483b46.js.map +0 -1
- package/dist/components/p-5a91aa1b.js.map +0 -1
- package/dist/components/p-74be971f.js +0 -652
- package/dist/components/p-74be971f.js.map +0 -1
- package/dist/components/p-7a436263.js +0 -122
- package/dist/components/p-7a436263.js.map +0 -1
- package/dist/components/p-a2fedf8a.js.map +0 -1
- package/dist/components/p-b85cfa86.js.map +0 -1
- package/dist/components/p-e28db040.js +0 -1452
- package/dist/components/p-e28db040.js.map +0 -1
- package/dist/components/p-e5dc4ea4.js.map +0 -1
- package/dist/components/p-e9bce2ab.js +0 -88
- package/dist/components/p-e9bce2ab.js.map +0 -1
- package/dist/content-blocks/content-blocks.esm.js.map +0 -1
- package/dist/content-blocks/index.esm.js.map +0 -1
- package/dist/content-blocks/p-13c3cc4f.js +0 -3
- package/dist/content-blocks/p-13c3cc4f.js.map +0 -1
- package/dist/content-blocks/p-5422c25b.entry.js +0 -2
- package/dist/content-blocks/p-5422c25b.entry.js.map +0 -1
- package/dist/content-blocks/p-5a91aa1b.js +0 -2
- package/dist/content-blocks/p-5a91aa1b.js.map +0 -1
- package/dist/content-blocks/p-650d1757.js +0 -2
- package/dist/content-blocks/p-650d1757.js.map +0 -1
- package/dist/content-blocks/p-74be971f.js +0 -2
- package/dist/content-blocks/p-74be971f.js.map +0 -1
- package/dist/content-blocks/p-8deb755c.entry.js +0 -26
- package/dist/content-blocks/p-8deb755c.entry.js.map +0 -1
- package/dist/content-blocks/p-a2fedf8a.js +0 -10
- package/dist/content-blocks/p-a2fedf8a.js.map +0 -1
- package/dist/content-blocks/p-b305392e.entry.js +0 -2
- package/dist/content-blocks/p-b305392e.entry.js.map +0 -1
- package/dist/content-blocks/p-b85cfa86.js +0 -2
- package/dist/content-blocks/p-b85cfa86.js.map +0 -1
- package/dist/content-blocks/p-cc7397cf.js +0 -2
- package/dist/content-blocks/p-cc7397cf.js.map +0 -1
- package/dist/content-blocks/p-d62775d7.entry.js +0 -2
- package/dist/content-blocks/p-d62775d7.entry.js.map +0 -1
- package/dist/content-blocks/p-e1255160.js +0 -2
- package/dist/content-blocks/p-e1255160.js.map +0 -1
- package/dist/content-blocks/p-e5dc4ea4.js +0 -2
- package/dist/content-blocks/p-e5dc4ea4.js.map +0 -1
- package/dist/content-blocks/p-f73f934a.entry.js +0 -2
- package/dist/content-blocks/p-f73f934a.entry.js.map +0 -1
- package/dist/esm/BehaviorSubject-f7a12fd8.js +0 -652
- package/dist/esm/BehaviorSubject-f7a12fd8.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/content-accordion_11.entry.js.map +0 -1
- package/dist/esm/content-blocks.js.map +0 -1
- package/dist/esm/content-carousel.entry.js.map +0 -1
- package/dist/esm/content-navigation-block.entry.js.map +0 -1
- package/dist/esm/content-split-block.entry.js.map +0 -1
- package/dist/esm/content-tabs.entry.js.map +0 -1
- package/dist/esm/focus-trap.esm-8fb54175.js.map +0 -1
- package/dist/esm/index-ec24af7a.js +0 -1621
- package/dist/esm/index-ec24af7a.js.map +0 -1
- package/dist/esm/index-f45a9c45.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/swiper-e9621adb.js.map +0 -1
- package/dist/esm/utils-1c9f0ec1.js.map +0 -1
- package/dist/esm/utils-9a901aa9.js +0 -122
- package/dist/esm/utils-9a901aa9.js.map +0 -1
- package/dist/esm/window-resize-service-354f2ac5.js +0 -35
- package/dist/esm/window-resize-service-354f2ac5.js.map +0 -1
- package/dist/types/globalScript.d.ts +0 -1
- package/dist/types/old-components.d.ts +0 -1239
- package/dist/types/services/content-events-service.d.ts +0 -11
- package/dist/types/services/window-resize-service.d.ts +0 -11
- package/dist/types/stories/ContentHeroBlock.stories.d.ts +0 -11
- package/dist/types/stories/ContentNavigationBlock.stories.d.ts +0 -9
- package/dist/types/stories/ContentSpacer.stories.d.ts +0 -15
- package/dist/types/stories/ContentTextBlock.stories.d.ts +0 -9
- package/dist/types/stories/ContentToutBlock.stories.d.ts +0 -9
- package/dist/types/stories/FullPageExample.stories.d.ts +0 -10
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, a as getElement, h, d as Host } from './index-BFDJMblF.js';
|
|
2
|
+
import { R as ResponsiveComponent } from './responsive-component-BsLrcKbS.js';
|
|
3
|
+
import { c as createFocusTrap } from './focus-trap.esm-DXUoPIwl.js';
|
|
4
|
+
import './utils-Bak__24s.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @namespace aria
|
|
8
|
+
*/
|
|
9
|
+
var aria$1 = aria$1 || {};
|
|
10
|
+
aria$1.Utils = aria$1.Utils || {};
|
|
11
|
+
// Polyfill src https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
12
|
+
aria$1.Utils.matches = function (element, selector) {
|
|
13
|
+
return element.matches(selector);
|
|
14
|
+
};
|
|
15
|
+
aria$1.Utils.remove = function (item) {
|
|
16
|
+
if (item.remove && typeof item.remove === 'function') {
|
|
17
|
+
return item.remove();
|
|
18
|
+
}
|
|
19
|
+
if (item.parentNode &&
|
|
20
|
+
item.parentNode.removeChild &&
|
|
21
|
+
typeof item.parentNode.removeChild === 'function') {
|
|
22
|
+
return item.parentNode.removeChild(item);
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
};
|
|
26
|
+
aria$1.Utils.isFocusable = function (element) {
|
|
27
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (element.disabled) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
switch (element.nodeName) {
|
|
34
|
+
case 'A':
|
|
35
|
+
return !!element.href && element.rel != 'ignore';
|
|
36
|
+
case 'INPUT':
|
|
37
|
+
return element.type != 'hidden' && element.type != 'file';
|
|
38
|
+
case 'BUTTON':
|
|
39
|
+
case 'SELECT':
|
|
40
|
+
case 'TEXTAREA':
|
|
41
|
+
return true;
|
|
42
|
+
default:
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
aria$1.Utils.getAncestorBySelector = function (element, selector) {
|
|
47
|
+
if (!aria$1.Utils.matches(element, selector + ' ' + element.tagName)) {
|
|
48
|
+
// Element is not inside an element that matches selector
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
// Move up the DOM tree until a parent matching the selector is found
|
|
52
|
+
var currentNode = element;
|
|
53
|
+
var ancestor = null;
|
|
54
|
+
while (ancestor === null) {
|
|
55
|
+
if (aria$1.Utils.matches(currentNode.parentNode, selector)) {
|
|
56
|
+
ancestor = currentNode.parentNode;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
currentNode = currentNode.parentNode;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return ancestor;
|
|
63
|
+
};
|
|
64
|
+
aria$1.Utils.hasClass = function (element, className) {
|
|
65
|
+
return (new RegExp('(\\s|^)' + className + '(\\s|$)')).test(element.className);
|
|
66
|
+
};
|
|
67
|
+
aria$1.Utils.addClass = function (element, className) {
|
|
68
|
+
if (!aria$1.Utils.hasClass(element, className)) {
|
|
69
|
+
element.className += ' ' + className;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
aria$1.Utils.removeClass = function (element, className) {
|
|
73
|
+
var classRegex = new RegExp('(\\s|^)' + className + '(\\s|$)');
|
|
74
|
+
element.className = element.className.replace(classRegex, ' ').trim();
|
|
75
|
+
};
|
|
76
|
+
aria$1.Utils.bindMethods = function (object) {
|
|
77
|
+
var methodNames = Array.prototype.slice.call(arguments, 1);
|
|
78
|
+
methodNames.forEach(function (method) {
|
|
79
|
+
object[method] = object[method].bind(object);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
window.aria = aria$1;
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* This content is licensed according to the W3C Software License at
|
|
86
|
+
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* @namespace aria
|
|
90
|
+
*/
|
|
91
|
+
var aria = aria || {};
|
|
92
|
+
aria.Utils = aria.Utils || {};
|
|
93
|
+
// Polyfill src https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
94
|
+
aria.Utils.matches = function (element, selector) {
|
|
95
|
+
return element.matches(selector);
|
|
96
|
+
};
|
|
97
|
+
aria.Utils.remove = function (item) {
|
|
98
|
+
if (item.remove && typeof item.remove === 'function') {
|
|
99
|
+
return item.remove();
|
|
100
|
+
}
|
|
101
|
+
if (item.parentNode &&
|
|
102
|
+
item.parentNode.removeChild &&
|
|
103
|
+
typeof item.parentNode.removeChild === 'function') {
|
|
104
|
+
return item.parentNode.removeChild(item);
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
107
|
+
};
|
|
108
|
+
aria.Utils.isFocusable = function (element) {
|
|
109
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
if (element.disabled) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
switch (element.nodeName) {
|
|
116
|
+
case 'A':
|
|
117
|
+
return !!element.href && element.rel != 'ignore';
|
|
118
|
+
case 'INPUT':
|
|
119
|
+
return element.type != 'hidden' && element.type != 'file';
|
|
120
|
+
case 'BUTTON':
|
|
121
|
+
case 'SELECT':
|
|
122
|
+
case 'TEXTAREA':
|
|
123
|
+
return true;
|
|
124
|
+
default:
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
aria.Utils.getAncestorBySelector = function (element, selector) {
|
|
129
|
+
if (!aria.Utils.matches(element, selector + ' ' + element.tagName)) {
|
|
130
|
+
// Element is not inside an element that matches selector
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
// Move up the DOM tree until a parent matching the selector is found
|
|
134
|
+
var currentNode = element;
|
|
135
|
+
var ancestor = null;
|
|
136
|
+
while (ancestor === null) {
|
|
137
|
+
if (aria.Utils.matches(currentNode.parentNode, selector)) {
|
|
138
|
+
ancestor = currentNode.parentNode;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
currentNode = currentNode.parentNode;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return ancestor;
|
|
145
|
+
};
|
|
146
|
+
aria.Utils.hasClass = function (element, className) {
|
|
147
|
+
return (new RegExp('(\\s|^)' + className + '(\\s|$)')).test(element.className);
|
|
148
|
+
};
|
|
149
|
+
aria.Utils.addClass = function (element, className) {
|
|
150
|
+
if (!aria.Utils.hasClass(element, className)) {
|
|
151
|
+
element.className += ' ' + className;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
aria.Utils.removeClass = function (element, className) {
|
|
155
|
+
var classRegex = new RegExp('(\\s|^)' + className + '(\\s|$)');
|
|
156
|
+
element.className = element.className.replace(classRegex, ' ').trim();
|
|
157
|
+
};
|
|
158
|
+
aria.Utils.bindMethods = function (object) {
|
|
159
|
+
var methodNames = Array.prototype.slice.call(arguments, 1);
|
|
160
|
+
methodNames.forEach(function (method) {
|
|
161
|
+
object[method] = object[method].bind(object);
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
/*
|
|
165
|
+
* When util functions move focus around, set this true so the focus listener
|
|
166
|
+
* can ignore the events.
|
|
167
|
+
*/
|
|
168
|
+
aria.Utils.IgnoreUtilFocusChanges = false;
|
|
169
|
+
aria.Utils.dialogOpenClass = 'has-dialog';
|
|
170
|
+
/**
|
|
171
|
+
* @desc Set focus on descendant nodes until the first focusable element is
|
|
172
|
+
* found.
|
|
173
|
+
* @param element
|
|
174
|
+
* DOM node for which to find the first focusable descendant.
|
|
175
|
+
* @returns
|
|
176
|
+
* true if a focusable element is found and focus is set.
|
|
177
|
+
*/
|
|
178
|
+
aria.Utils.focusFirstDescendant = function (element) {
|
|
179
|
+
for (var i = 0; i < element.childNodes.length; i++) {
|
|
180
|
+
var child = element.childNodes[i];
|
|
181
|
+
if (aria.Utils.attemptFocus(child) ||
|
|
182
|
+
aria.Utils.focusFirstDescendant(child)) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return false;
|
|
187
|
+
}; // end focusFirstDescendant
|
|
188
|
+
/**
|
|
189
|
+
* @desc Find the last descendant node that is focusable.
|
|
190
|
+
* @param element
|
|
191
|
+
* DOM node for which to find the last focusable descendant.
|
|
192
|
+
* @returns
|
|
193
|
+
* true if a focusable element is found and focus is set.
|
|
194
|
+
*/
|
|
195
|
+
aria.Utils.focusLastDescendant = function (element) {
|
|
196
|
+
for (var i = element.childNodes.length - 1; i >= 0; i--) {
|
|
197
|
+
var child = element.childNodes[i];
|
|
198
|
+
if (aria.Utils.attemptFocus(child) ||
|
|
199
|
+
aria.Utils.focusLastDescendant(child)) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
}; // end focusLastDescendant
|
|
205
|
+
/**
|
|
206
|
+
* @desc Set Attempt to set focus on the current node.
|
|
207
|
+
* @param element
|
|
208
|
+
* The node to attempt to focus on.
|
|
209
|
+
* @returns
|
|
210
|
+
* true if element is focused.
|
|
211
|
+
*/
|
|
212
|
+
aria.Utils.attemptFocus = function (element) {
|
|
213
|
+
if (!aria.Utils.isFocusable(element)) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
aria.Utils.IgnoreUtilFocusChanges = true;
|
|
217
|
+
try {
|
|
218
|
+
element.focus();
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
}
|
|
222
|
+
aria.Utils.IgnoreUtilFocusChanges = false;
|
|
223
|
+
return (document.activeElement === element);
|
|
224
|
+
}; // end attemptFocus
|
|
225
|
+
/* Modals can open modals. Keep track of them with this array. */
|
|
226
|
+
aria.OpenDialogList = aria.OpenDialogList || new Array(0);
|
|
227
|
+
/**
|
|
228
|
+
* @returns the last opened dialog (the current dialog)
|
|
229
|
+
*/
|
|
230
|
+
aria.getCurrentDialog = function () {
|
|
231
|
+
if (aria.OpenDialogList && aria.OpenDialogList.length) {
|
|
232
|
+
return aria.OpenDialogList[aria.OpenDialogList.length - 1];
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
aria.closeCurrentDialog = function () {
|
|
236
|
+
var currentDialog = aria.getCurrentDialog();
|
|
237
|
+
if (currentDialog) {
|
|
238
|
+
currentDialog.close();
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
};
|
|
243
|
+
aria.handleEscape = function (event) {
|
|
244
|
+
if (event.key === 'Escape' && aria.closeCurrentDialog()) {
|
|
245
|
+
event.stopPropagation();
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
document.addEventListener('keyup', aria.handleEscape);
|
|
249
|
+
/**
|
|
250
|
+
* @constructor
|
|
251
|
+
* @desc Dialog object providing modal focus management.
|
|
252
|
+
*
|
|
253
|
+
* Assumptions: The element serving as the dialog container is present in the
|
|
254
|
+
* DOM and hidden. The dialog container has role='dialog'.
|
|
255
|
+
*
|
|
256
|
+
* @param dialogNode
|
|
257
|
+
* The element serving as the dialog container.
|
|
258
|
+
* @param focusAfterClosed
|
|
259
|
+
* Either the DOM node or the ID of the DOM node to focus when the
|
|
260
|
+
* dialog closes.
|
|
261
|
+
* @param focusFirst
|
|
262
|
+
* Optional parameter containing either the DOM node or the ID of the
|
|
263
|
+
* DOM node to focus when the dialog opens. If not specified, the
|
|
264
|
+
* first focusable element in the dialog will receive focus.
|
|
265
|
+
*/
|
|
266
|
+
aria.Dialog = function (dialogNode, focusAfterClosed, focusFirst, isFullScreen) {
|
|
267
|
+
this.dialogNode = dialogNode;
|
|
268
|
+
if (this.dialogNode === null) {
|
|
269
|
+
throw new Error('No element found');
|
|
270
|
+
}
|
|
271
|
+
var validRoles = ['dialog', 'alertdialog'];
|
|
272
|
+
var isDialog = (this.dialogNode.getAttribute('role') || '')
|
|
273
|
+
.trim()
|
|
274
|
+
.split(/\s+/g)
|
|
275
|
+
.some(function (token) {
|
|
276
|
+
return validRoles.some(function (role) {
|
|
277
|
+
return token === role;
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
if (!isDialog) {
|
|
281
|
+
throw new Error('Dialog() requires a DOM element with ARIA role of dialog or alertdialog.');
|
|
282
|
+
}
|
|
283
|
+
// Wrap in an individual backdrop element if one doesn't exist
|
|
284
|
+
// Native <dialog> elements use the ::backdrop pseudo-element, which
|
|
285
|
+
// works similarly.
|
|
286
|
+
var backdropClass = 'content-overlay-background';
|
|
287
|
+
if (this.dialogNode.parentNode.classList.contains(backdropClass)) {
|
|
288
|
+
this.backdropNode = this.dialogNode.parentNode;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this.backdropNode = document.createElement('div');
|
|
292
|
+
this.backdropNode.className = backdropClass;
|
|
293
|
+
this.dialogNode.parentNode.insertBefore(this.backdropNode, this.dialogNode);
|
|
294
|
+
this.backdropNode.appendChild(this.dialogNode);
|
|
295
|
+
}
|
|
296
|
+
this.backdropNode.classList.add('active');
|
|
297
|
+
setTimeout(() => {
|
|
298
|
+
this.backdropNode.classList.add('transition');
|
|
299
|
+
}, 1);
|
|
300
|
+
// Disable scroll on the body element
|
|
301
|
+
this.isFullscreen = isFullScreen;
|
|
302
|
+
if (isFullScreen) {
|
|
303
|
+
document.body.classList.add(aria.Utils.dialogOpenClass);
|
|
304
|
+
}
|
|
305
|
+
if (typeof focusAfterClosed === 'string') {
|
|
306
|
+
this.focusAfterClosed = document.getElementById(focusAfterClosed);
|
|
307
|
+
}
|
|
308
|
+
else if (typeof focusAfterClosed === 'object') {
|
|
309
|
+
this.focusAfterClosed = focusAfterClosed;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
throw new Error('the focusAfterClosed parameter is required for the aria.Dialog constructor.');
|
|
313
|
+
}
|
|
314
|
+
if (typeof focusFirst === 'string') {
|
|
315
|
+
this.focusFirst = document.getElementById(focusFirst);
|
|
316
|
+
}
|
|
317
|
+
else if (typeof focusFirst === 'object') {
|
|
318
|
+
this.focusFirst = focusFirst;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
this.focusFirst = null;
|
|
322
|
+
}
|
|
323
|
+
// Bracket the dialog node with two invisible, focusable nodes.
|
|
324
|
+
// While this dialog is open, we use these to make sure that focus never
|
|
325
|
+
// leaves the document even if dialogNode is the first or last node.
|
|
326
|
+
var preDiv = document.createElement('div');
|
|
327
|
+
this.preNode = this.dialogNode.parentNode.insertBefore(preDiv, this.dialogNode);
|
|
328
|
+
this.preNode.tabIndex = 0;
|
|
329
|
+
var postDiv = document.createElement('div');
|
|
330
|
+
this.postNode = this.dialogNode.parentNode.insertBefore(postDiv, this.dialogNode.nextSibling);
|
|
331
|
+
this.postNode.tabIndex = 0;
|
|
332
|
+
// If this modal is opening on top of one that is already open,
|
|
333
|
+
// get rid of the document focus listener of the open dialog.
|
|
334
|
+
if (aria.OpenDialogList.length > 0) {
|
|
335
|
+
aria.getCurrentDialog().removeListeners();
|
|
336
|
+
}
|
|
337
|
+
if (isFullScreen) {
|
|
338
|
+
this.addListeners();
|
|
339
|
+
}
|
|
340
|
+
aria.OpenDialogList.push(this);
|
|
341
|
+
this.dialogNode.className = 'content-overlay-dialog'; // make visible
|
|
342
|
+
if (this.focusFirst) {
|
|
343
|
+
this.focusFirst.focus();
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
aria.Utils.focusFirstDescendant(this.dialogNode);
|
|
347
|
+
}
|
|
348
|
+
this.lastFocus = document.activeElement;
|
|
349
|
+
}; // end Dialog constructor
|
|
350
|
+
/**
|
|
351
|
+
* @desc
|
|
352
|
+
* Hides the current top dialog,
|
|
353
|
+
* removes listeners of the top dialog,
|
|
354
|
+
* restore listeners of a parent dialog if one was open under the one that just closed,
|
|
355
|
+
* and sets focus on the element specified for focusAfterClosed.
|
|
356
|
+
*/
|
|
357
|
+
aria.Dialog.prototype.close = function () {
|
|
358
|
+
aria.OpenDialogList.pop();
|
|
359
|
+
this.removeListeners();
|
|
360
|
+
aria.Utils.remove(this.preNode);
|
|
361
|
+
aria.Utils.remove(this.postNode);
|
|
362
|
+
this.dialogNode.className = 'hidden';
|
|
363
|
+
this.backdropNode.classList.remove('active');
|
|
364
|
+
this.backdropNode.classList.remove('transition');
|
|
365
|
+
this.focusAfterClosed.focus();
|
|
366
|
+
// If a dialog was open underneath this one, restore its listeners.
|
|
367
|
+
if (aria.OpenDialogList.length > 0 && aria.OpenDialogList.filter(dialog => dialog.isFullscreen === true).length) {
|
|
368
|
+
aria.getCurrentDialog().addListeners();
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
document.body.classList.remove(aria.Utils.dialogOpenClass);
|
|
372
|
+
}
|
|
373
|
+
this.dialogNode.dispatchEvent(new CustomEvent("ariaDialog.closed", {
|
|
374
|
+
bubbles: true,
|
|
375
|
+
"detail": {}
|
|
376
|
+
}));
|
|
377
|
+
}; // end close
|
|
378
|
+
/**
|
|
379
|
+
* @desc
|
|
380
|
+
* Hides the current dialog and replaces it with another.
|
|
381
|
+
*
|
|
382
|
+
* @param newDialogId
|
|
383
|
+
* ID of the dialog that will replace the currently open top dialog.
|
|
384
|
+
* @param newFocusAfterClosed
|
|
385
|
+
* Optional ID or DOM node specifying where to place focus when the new dialog closes.
|
|
386
|
+
* If not specified, focus will be placed on the element specified by the dialog being replaced.
|
|
387
|
+
* @param newFocusFirst
|
|
388
|
+
* Optional ID or DOM node specifying where to place focus in the new dialog when it opens.
|
|
389
|
+
* If not specified, the first focusable element will receive focus.
|
|
390
|
+
*/
|
|
391
|
+
aria.Dialog.prototype.replace = function (newDialogId, newFocusAfterClosed, newFocusFirst) {
|
|
392
|
+
// var closedDialog = aria.getCurrentDialog();
|
|
393
|
+
aria.OpenDialogList.pop();
|
|
394
|
+
this.removeListeners();
|
|
395
|
+
aria.Utils.remove(this.preNode);
|
|
396
|
+
aria.Utils.remove(this.postNode);
|
|
397
|
+
this.dialogNode.className = 'hidden';
|
|
398
|
+
this.backdropNode.classList.remove('active');
|
|
399
|
+
this.backdropNode.classList.remove('transition');
|
|
400
|
+
var focusAfterClosed = newFocusAfterClosed || this.focusAfterClosed;
|
|
401
|
+
new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst);
|
|
402
|
+
// var dialog = new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst);
|
|
403
|
+
}; // end replace
|
|
404
|
+
aria.Dialog.prototype.addListeners = function () {
|
|
405
|
+
document.addEventListener('focus', this.trapFocus, true);
|
|
406
|
+
}; // end addListeners
|
|
407
|
+
aria.Dialog.prototype.removeListeners = function () {
|
|
408
|
+
document.removeEventListener('focus', this.trapFocus, true);
|
|
409
|
+
}; // end removeListeners
|
|
410
|
+
aria.Dialog.prototype.trapFocus = function (event) {
|
|
411
|
+
if (aria.Utils.IgnoreUtilFocusChanges) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
var currentDialog = aria.getCurrentDialog();
|
|
415
|
+
if (currentDialog.dialogNode.contains(event.target)) {
|
|
416
|
+
currentDialog.lastFocus = event.target;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
aria.Utils.focusFirstDescendant(currentDialog.dialogNode);
|
|
420
|
+
if (currentDialog.lastFocus == document.activeElement) {
|
|
421
|
+
aria.Utils.focusLastDescendant(currentDialog.dialogNode);
|
|
422
|
+
}
|
|
423
|
+
currentDialog.lastFocus = document.activeElement;
|
|
424
|
+
}
|
|
425
|
+
}; // end trapFocus
|
|
426
|
+
aria.closeDialog = function (closeButton) {
|
|
427
|
+
var topDialog = aria.getCurrentDialog();
|
|
428
|
+
if (topDialog.dialogNode.contains(closeButton)) {
|
|
429
|
+
topDialog.close();
|
|
430
|
+
}
|
|
431
|
+
}; // end closeDialog
|
|
432
|
+
aria.replaceDialog = function (newDialogId, newFocusAfterClosed, newFocusFirst) {
|
|
433
|
+
var topDialog = aria.getCurrentDialog();
|
|
434
|
+
if (topDialog.dialogNode.contains(document.activeElement)) {
|
|
435
|
+
topDialog.replace(newDialogId, newFocusAfterClosed, newFocusFirst);
|
|
436
|
+
}
|
|
437
|
+
}; // end replaceDialog
|
|
438
|
+
window.aria = aria;
|
|
439
|
+
|
|
440
|
+
const contentOverlayCss = () => `*{box-sizing:border-box}.content-overlay-open--fixed{overflow:hidden}.content-block-overlay-container{position:relative;display:block;width:100%;height:100%}content-overlay{display:none;position:relative;flex:0}content-overlay[size=mini] .content-overlay-background.active{display:flex;align-items:center;justify-content:center}content-overlay .content-overlay__content>*[slot=content]{height:100%;overflow:auto}content-overlay.content-overlay-active{display:flex}content-overlay[vertical=left]{align-items:flex-start}content-overlay[vertical=center]{align-items:center}content-overlay[vertical=right]{align-items:flex-end}content-overlay[vertical=top]{justify-content:flex-start;top:0}content-overlay[vertical=center]{justify-content:center}content-overlay[vertical=bottom]{justify-content:flex-end;bottom:0}content-overlay .content-overlay-background{background:var(--content-overlay-backdrop, rgba(255, 255, 255, 0.6));bottom:0;display:none;top:0;z-index:100000;right:0;left:0;width:100%}content-overlay .content-overlay-background.active{display:block}content-overlay .content-overlay__header{display:flex;align-items:center}content-overlay:not([size=mini]) .content-overlay__header--floating{position:absolute;top:0;right:0;z-index:2}content-overlay [role=dialog]{position:relative}content-overlay .content-overlay__close{order:2;margin-left:auto;cursor:pointer;z-index:1;appearance:none;background:none;border:none;min-width:40px;color:inherit}content-overlay[data-position=fixed] .content-overlay-background{position:fixed}content-overlay[data-position=absolute]{position:absolute;box-sizing:border-box;z-index:100000;height:100%;width:100%;top:0;left:0}content-overlay[data-position=absolute] .content-overlay-background{position:static}content-overlay[data-position=absolute] .content-overlay__content,content-overlay[data-position=fixed] .content-overlay__content{flex:1;overflow:auto}content-overlay [role=dialog]{display:flex;flex-direction:column;height:100%;justify-content:flex-start}content-overlay [role=dialog].hidden{display:none}content-overlay[full-screen=true]{height:100%}content-overlay[full-screen=true] .content-overlay-background{height:100%}content-overlay:where([size=mini]) .content-overlay-background.active{padding:1rem;background:var(--content-overlay-backdrop, rgba(0, 0, 0, 0.7))}content-overlay:where([size=mini]) [role=dialog]{width:100%;height:auto;max-width:var(--content-overlay-max-width, 640px);max-height:100%;padding:var(--content-overlay-padding, 1.5rem);overflow:auto;background:var(--content-overlay-background, #fff);border-radius:var(--content-overlay-radius, 4px)}body.has-dialog{overflow:hidden}`;
|
|
441
|
+
|
|
442
|
+
let overlayCount = 0;
|
|
443
|
+
const ContentOverlay = class extends ResponsiveComponent {
|
|
444
|
+
constructor(hostRef) {
|
|
445
|
+
super();
|
|
446
|
+
registerInstance(this, hostRef);
|
|
447
|
+
this.contentOverlayActivated = createEvent(this, "contentOverlayActivated", 7);
|
|
448
|
+
this.contentOverlayDeactivated = createEvent(this, "contentOverlayDeactivated", 7);
|
|
449
|
+
}
|
|
450
|
+
get hostElement() { return getElement(this); }
|
|
451
|
+
/**
|
|
452
|
+
* What the overlay covers. "body", the default, covers the whole screen. A CSS selector, such as "#hero",
|
|
453
|
+
* covers that element instead: the overlay moves into it when it opens. Use pipes to cover the screen on
|
|
454
|
+
* phones and an element on wider screens: fill="body|#hero".
|
|
455
|
+
* @type String
|
|
456
|
+
* @responsive
|
|
457
|
+
*/
|
|
458
|
+
fill = 'body';
|
|
459
|
+
/**
|
|
460
|
+
* @type Boolean
|
|
461
|
+
* @responsive
|
|
462
|
+
*/
|
|
463
|
+
open = 'false';
|
|
464
|
+
/**
|
|
465
|
+
* @type Boolean
|
|
466
|
+
* @responsive
|
|
467
|
+
*/
|
|
468
|
+
fullScreen = 'true';
|
|
469
|
+
/**
|
|
470
|
+
* A pipe delimited setting for horizontal alignment. This only applies when fullscreen mode is activated.
|
|
471
|
+
* @type Select
|
|
472
|
+
* @options default
|
|
473
|
+
* @options left
|
|
474
|
+
* @options center
|
|
475
|
+
* @options right
|
|
476
|
+
* @responsive
|
|
477
|
+
*/
|
|
478
|
+
horizontal = 'center';
|
|
479
|
+
/**
|
|
480
|
+
* A pipe delimited setting for vertical alignment. This only applies when fullscreen mode is activated.
|
|
481
|
+
* @type Select
|
|
482
|
+
* @options top
|
|
483
|
+
* @options center
|
|
484
|
+
* @options bottom
|
|
485
|
+
*/
|
|
486
|
+
vertical = 'center';
|
|
487
|
+
/**
|
|
488
|
+
* Title attribute value for the close button.
|
|
489
|
+
* @type String
|
|
490
|
+
*/
|
|
491
|
+
closeTitle = 'Close Overlay';
|
|
492
|
+
/**
|
|
493
|
+
* The accessible name of the dialog. Only needed when there is no header slot, which names it otherwise.
|
|
494
|
+
* @type String
|
|
495
|
+
*/
|
|
496
|
+
label;
|
|
497
|
+
headerId;
|
|
498
|
+
// Worked out from fill: fixed over the screen, or absolute inside the element it fills.
|
|
499
|
+
position = 'fixed';
|
|
500
|
+
// The body class added when it opened, so closing removes that one even if the breakpoint changed since.
|
|
501
|
+
openClass;
|
|
502
|
+
isActive = false;
|
|
503
|
+
activeClass = '';
|
|
504
|
+
contentOverlayActivated;
|
|
505
|
+
contentOverlayDeactivated;
|
|
506
|
+
contentSlot;
|
|
507
|
+
dialogElement;
|
|
508
|
+
contentElement;
|
|
509
|
+
isFullScreen = false;
|
|
510
|
+
hasCloseButton = false;
|
|
511
|
+
originalMarkup;
|
|
512
|
+
ariaDialog;
|
|
513
|
+
focusTrap;
|
|
514
|
+
onContentBlockToggle(event) {
|
|
515
|
+
if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
|
|
516
|
+
event.preventDefault();
|
|
517
|
+
if (!this.isActive) {
|
|
518
|
+
this.openOverlay();
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
this.closeOverlay();
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
onContentBlockActivated(event) {
|
|
526
|
+
if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
|
|
527
|
+
event.preventDefault();
|
|
528
|
+
this.openOverlay();
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
onContentBlockDeactivated(event) {
|
|
532
|
+
if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
|
|
533
|
+
event.preventDefault();
|
|
534
|
+
this.closeOverlay();
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
async openOverlay() {
|
|
538
|
+
this.isActive = true;
|
|
539
|
+
if (this.openClass)
|
|
540
|
+
document.body.classList.remove(this.openClass);
|
|
541
|
+
this.openClass = `content-overlay-open--${this.position}`;
|
|
542
|
+
document.body.classList.add(`content-overlay-open`, this.openClass);
|
|
543
|
+
document.body.classList.remove('content-overlay-close');
|
|
544
|
+
if (!this.originalMarkup) {
|
|
545
|
+
this.originalMarkup = this.contentSlot.innerHTML;
|
|
546
|
+
}
|
|
547
|
+
// Filling an element: move into it, so it is what the absolute overlay is placed against.
|
|
548
|
+
if (this.position === 'absolute') {
|
|
549
|
+
const fillElement = document.querySelector(this.fill);
|
|
550
|
+
if (fillElement) {
|
|
551
|
+
fillElement.classList.add('content-block-overlay-container');
|
|
552
|
+
if (this.hostElement.parentElement !== fillElement)
|
|
553
|
+
fillElement.appendChild(this.hostElement);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (this.originalMarkup.length) {
|
|
557
|
+
// this.contentSlot.appendChild(this.contentSlot);
|
|
558
|
+
if (this.contentSlot.children[0] === this.contentSlot.querySelector('script[slot="content"][type="text/template"]')) {
|
|
559
|
+
this.contentSlot.innerHTML = this.contentSlot.children[0].innerHTML;
|
|
560
|
+
}
|
|
561
|
+
this.setComputedActiveClass();
|
|
562
|
+
this.focusTrap = createFocusTrap(this.hostElement, {
|
|
563
|
+
fallbackFocus: this.hostElement,
|
|
564
|
+
allowOutsideClick: true,
|
|
565
|
+
clickOutsideDeactivates: true,
|
|
566
|
+
onDeactivate: () => {
|
|
567
|
+
this.closeOverlay();
|
|
568
|
+
// this.contentSlot.innerHTML = '';
|
|
569
|
+
},
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
this.contentOverlayActivated.emit(this.hostElement);
|
|
573
|
+
}
|
|
574
|
+
async closeOverlay() {
|
|
575
|
+
this.open = 'false';
|
|
576
|
+
this.isActive = false;
|
|
577
|
+
document.body.classList.add('content-overlay-close');
|
|
578
|
+
document.body.classList.remove(`content-overlay-open`);
|
|
579
|
+
if (this.openClass)
|
|
580
|
+
document.body.classList.remove(this.openClass);
|
|
581
|
+
this.openClass = undefined;
|
|
582
|
+
this.activeClass = '';
|
|
583
|
+
this.setComputedActiveClass();
|
|
584
|
+
this.contentOverlayDeactivated.emit(this.hostElement);
|
|
585
|
+
if (this.focusTrap) {
|
|
586
|
+
try {
|
|
587
|
+
this.focusTrap.deactivate();
|
|
588
|
+
}
|
|
589
|
+
catch (e) {
|
|
590
|
+
console.log(e);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
setComputedActiveClass() {
|
|
595
|
+
this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${this.position}`;
|
|
596
|
+
}
|
|
597
|
+
componentWillLoad() {
|
|
598
|
+
this.responsive({
|
|
599
|
+
fill: value => (this.position = !value || value === 'body' ? 'fixed' : 'absolute'),
|
|
600
|
+
horizontal: true,
|
|
601
|
+
vertical: true,
|
|
602
|
+
fullScreen: value => (this.isFullScreen = value === 'true'),
|
|
603
|
+
open: true,
|
|
604
|
+
});
|
|
605
|
+
this.hasCloseButton = !!this.hostElement.querySelector('[slot="closeButton"]');
|
|
606
|
+
// A dialog needs an accessible name. Use the header when there is one.
|
|
607
|
+
const header = this.hostElement.querySelector('[slot="header"]');
|
|
608
|
+
if (header) {
|
|
609
|
+
if (!header.id)
|
|
610
|
+
header.id = `${this.hostElement.id || 'content-overlay'}-header-${++overlayCount}`;
|
|
611
|
+
this.headerId = header.id;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
closeOverlayButtonClicked(event) {
|
|
615
|
+
event.preventDefault();
|
|
616
|
+
this.closeOverlay();
|
|
617
|
+
}
|
|
618
|
+
render() {
|
|
619
|
+
return (h(Host, { key: '5583180cde2dc429eb16f061b7ee27127b5a5fdc', class: `${this.activeClass} ${this.classes ?? ''}`, "data-position": this.position }, h("div", { key: '0c3f8c4d3cdfb2e5b9760f35cda0cedc323cc613', class: "content-block-overlay-container" }, h("div", { key: 'afc077dc0358c21f6dd5598de7c52a6736974d4a', class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, h("div", { key: '3ea4cc41fc92ba137773ac47876298aa67301714', ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", "aria-labelledby": this.label ? null : this.headerId, "aria-label": this.label, class: this.isActive ? 'active' : 'hidden' }, h("div", { key: 'bb6c54519e56db042dd105383ab101ceb574b65c', class: `content-overlay__header ${this.headerId ? '' : 'content-overlay__header--floating'}` }, h("button", { key: 'a61445e4018523b78c736cec722e012c300decbf', onClick: e => {
|
|
620
|
+
this.closeOverlayButtonClicked(e);
|
|
621
|
+
}, class: "content-overlay__close", title: this.closeTitle }, !this.hasCloseButton && (h("svg", { key: 'e8200f0bed44bde0f2cee06461b9a265cfdd8a32', xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { key: '53eaa272b533de926676af3e6c5b80db34b950a4', "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }))), h("slot", { key: '476576100dac59d8add01d0e1ea87f793931acaf', name: "closeButton" })), h("slot", { key: '5f78cb80a79591c7769c14986f9f5b8bef85dda1', name: "header" })), h("div", { key: 'f3119738fa6d2d15b60194d544a401217d95ec14', class: "content-overlay__content", ref: (el) => (this.contentSlot = el) }, h("slot", { key: 'd94ffcf5050c24b447f6515d4085f499103d0dbf', name: "content" }), h("slot", { key: '6509e134526d04be323399f4ae8559bb3a52dfbd' })))))));
|
|
622
|
+
}
|
|
623
|
+
componentDidRender() {
|
|
624
|
+
if (this.open === 'true') {
|
|
625
|
+
this.openOverlay();
|
|
626
|
+
}
|
|
627
|
+
if (this.isActive && this.focusTrap && !this.focusTrap.active) {
|
|
628
|
+
try {
|
|
629
|
+
this.focusTrap.activate();
|
|
630
|
+
}
|
|
631
|
+
catch (e) {
|
|
632
|
+
console.log(e);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
ContentOverlay.style = contentOverlayCss();
|
|
638
|
+
|
|
639
|
+
export { ContentOverlay as content_overlay };
|