@content-blocks/js 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/content-accordion_11.cjs.entry.js +69 -1556
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
- package/dist/cjs/content-blocks.cjs.js +1 -1
- package/dist/cjs/content-carousel.cjs.entry.js +6 -5
- package/dist/cjs/content-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js +43 -26
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
- package/dist/cjs/content-split-block.cjs.entry.js +2 -2
- package/dist/cjs/content-tabs.cjs.entry.js +2 -2
- package/dist/cjs/focus-trap.esm-a1e3774c.js +1509 -0
- package/dist/cjs/focus-trap.esm-a1e3774c.js.map +1 -0
- package/dist/cjs/index-f38d389e.js +5224 -0
- package/dist/cjs/index-f38d389e.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{swiper-4fade542.js → swiper-e5a68ae2.js} +68 -469
- package/dist/cjs/swiper-e5a68ae2.js.map +1 -0
- package/dist/cjs/utils-c04e978e.js +457 -0
- package/dist/cjs/utils-c04e978e.js.map +1 -0
- package/dist/cjs/{utils-db61cd70.js → utils-f8ccab0a.js} +35 -29
- package/dist/cjs/utils-f8ccab0a.js.map +1 -0
- package/dist/cjs/{window-resize-service-ac5c2012.js → window-resize-service-bc8cf256.js} +2 -2
- package/dist/cjs/{window-resize-service-ac5c2012.js.map → window-resize-service-bc8cf256.js.map} +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +1 -1
- package/dist/collection/blocks/content-tout-block/content-tout-block.css +1 -1
- package/dist/collection/components/content-carousel/content-carousel.js +5 -4
- package/dist/collection/components/content-carousel/content-carousel.js.map +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.css +55 -14
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +51 -24
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -1
- package/dist/collection/components/content-overlay/content-overlay.css +23 -10
- package/dist/collection/components/content-overlay/content-overlay.js +100 -39
- package/dist/collection/components/content-overlay/content-overlay.js.map +1 -1
- package/dist/collection/elements/content-button/content-button.js +3 -3
- package/dist/collection/elements/content-button/content-button.js.map +1 -1
- package/dist/collection/elements/content-image/content-image.js +4 -4
- package/dist/collection/elements/content-image/content-image.js.map +1 -1
- package/dist/collection/elements/content-video/content-video.css +1 -19
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +5 -4
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +36 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
- package/dist/collection/formatters/content-spacer/content-spacer.css +6 -4
- package/dist/collection/formatters/content-spacer/content-spacer.js +13 -5
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -1
- package/dist/collection/services/window-resize-service.js.map +1 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js +1 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js.map +1 -1
- package/dist/collection/stories/ContentTextBlock.stories.js +5 -5
- package/dist/collection/stories/ContentTextBlock.stories.js.map +1 -1
- package/dist/collection/stories/FullPageExample.stories.js +164 -214
- package/dist/collection/stories/FullPageExample.stories.js.map +1 -1
- package/dist/collection/utils/utils.js +31 -25
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/collection/utils/utils.spec.js +28 -3
- package/dist/collection/utils/utils.spec.js.map +1 -1
- package/dist/components/content-button.js +3 -3
- package/dist/components/content-button.js.map +1 -1
- package/dist/components/content-carousel.js +5 -4
- package/dist/components/content-carousel.js.map +1 -1
- package/dist/components/content-grid-formatter2.js +8 -1
- package/dist/components/content-grid-formatter2.js.map +1 -1
- package/dist/components/content-hero-block.js +1 -1
- package/dist/components/content-hero-block.js.map +1 -1
- package/dist/components/content-image.js +4 -4
- package/dist/components/content-image.js.map +1 -1
- package/dist/components/content-navigation-block.js +48 -25
- package/dist/components/content-navigation-block.js.map +1 -1
- package/dist/components/content-overlay.js +51 -1543
- package/dist/components/content-overlay.js.map +1 -1
- package/dist/components/content-spacer.js +3 -3
- package/dist/components/content-spacer.js.map +1 -1
- package/dist/components/content-tout-block.js +1 -1
- package/dist/components/content-tout-block.js.map +1 -1
- package/dist/components/content-video.js +1 -1
- package/dist/components/content-video.js.map +1 -1
- package/dist/components/focus-trap.esm.js +1507 -0
- package/dist/components/focus-trap.esm.js.map +1 -0
- package/dist/components/index2.js +5200 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/swiper.js +1 -402
- package/dist/components/swiper.js.map +1 -1
- package/dist/components/utils.js +34 -28
- package/dist/components/utils.js.map +1 -1
- package/dist/components/utils2.js +433 -0
- package/dist/components/utils2.js.map +1 -0
- package/dist/components/window-resize-service.js.map +1 -1
- package/dist/content-blocks/content-blocks.esm.js +1 -1
- package/dist/content-blocks/content-blocks.esm.js.map +1 -1
- package/dist/content-blocks/index.esm.js +1 -1
- package/dist/content-blocks/p-0131bfdf.entry.js +2 -0
- package/dist/content-blocks/p-0131bfdf.entry.js.map +1 -0
- package/dist/content-blocks/{p-4bfbd7ef.entry.js → p-1b448306.entry.js} +2 -2
- package/dist/content-blocks/p-39788531.entry.js +2 -0
- package/dist/content-blocks/p-39788531.entry.js.map +1 -0
- package/dist/content-blocks/{p-8cc22c1e.entry.js → p-3bd97960.entry.js} +2 -2
- package/dist/content-blocks/{p-cfb4593f.js → p-3fe594af.js} +2 -2
- package/dist/content-blocks/{p-cfb4593f.js.map → p-3fe594af.js.map} +1 -1
- package/dist/content-blocks/p-75ac85e9.js +2 -0
- package/dist/content-blocks/p-75ac85e9.js.map +1 -0
- package/dist/content-blocks/p-878dc806.js +10 -0
- package/dist/content-blocks/p-878dc806.js.map +1 -0
- package/dist/content-blocks/p-97c4ca9d.js +2 -0
- package/dist/content-blocks/p-97c4ca9d.js.map +1 -0
- package/dist/content-blocks/{p-271fb304.entry.js → p-cbc1dd73.entry.js} +2 -2
- package/dist/content-blocks/p-cbc1dd73.entry.js.map +1 -0
- package/dist/content-blocks/p-cc7397cf.js +2 -0
- package/dist/content-blocks/p-cc7397cf.js.map +1 -0
- package/dist/content-blocks/p-e2907508.js +2 -0
- package/dist/content-blocks/p-e2907508.js.map +1 -0
- package/dist/esm/content-accordion_11.entry.js +69 -1556
- package/dist/esm/content-accordion_11.entry.js.map +1 -1
- package/dist/esm/content-blocks.js +1 -1
- package/dist/esm/content-carousel.entry.js +6 -5
- package/dist/esm/content-carousel.entry.js.map +1 -1
- package/dist/esm/content-navigation-block.entry.js +43 -26
- package/dist/esm/content-navigation-block.entry.js.map +1 -1
- package/dist/esm/content-split-block.entry.js +2 -2
- package/dist/esm/content-tabs.entry.js +2 -2
- package/dist/esm/focus-trap.esm-49c9613c.js +1507 -0
- package/dist/esm/focus-trap.esm-49c9613c.js.map +1 -0
- package/dist/esm/index-d9f353de.js +5200 -0
- package/dist/esm/index-d9f353de.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{swiper-3e7be625.js → swiper-3394f7fd.js} +2 -403
- package/dist/esm/swiper-3394f7fd.js.map +1 -0
- package/dist/esm/utils-075121ec.js +433 -0
- package/dist/esm/utils-075121ec.js.map +1 -0
- package/dist/esm/{utils-4f78228e.js → utils-9a901aa9.js} +35 -29
- package/dist/esm/utils-9a901aa9.js.map +1 -0
- package/dist/esm/{window-resize-service-f40ec51c.js → window-resize-service-a6537000.js} +2 -2
- package/dist/esm/{window-resize-service-f40ec51c.js.map → window-resize-service-a6537000.js.map} +1 -1
- package/dist/types/components/content-carousel/content-carousel.d.ts +3 -3
- package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +11 -0
- package/dist/types/components/content-overlay/content-overlay.d.ts +11 -0
- package/dist/types/components.d.ts +34 -2
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +8 -1
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +2 -1
- package/dist/types/stories/ContentNavigationBlock.stories.d.ts +1 -3
- package/dist/types/stories/ContentTextBlock.stories.d.ts +1 -7
- package/dist/types/utils/utils.d.ts +8 -3
- package/package.json +2 -2
- package/dist/cjs/swiper-4fade542.js.map +0 -1
- package/dist/cjs/utils-db61cd70.js.map +0 -1
- package/dist/content-blocks/p-10819bfa.js +0 -2
- package/dist/content-blocks/p-10819bfa.js.map +0 -1
- package/dist/content-blocks/p-24657e66.entry.js +0 -10
- package/dist/content-blocks/p-24657e66.entry.js.map +0 -1
- package/dist/content-blocks/p-271fb304.entry.js.map +0 -1
- package/dist/content-blocks/p-6a177aef.entry.js +0 -2
- package/dist/content-blocks/p-6a177aef.entry.js.map +0 -1
- package/dist/content-blocks/p-b04fe808.js +0 -2
- package/dist/content-blocks/p-b04fe808.js.map +0 -1
- package/dist/esm/swiper-3e7be625.js.map +0 -1
- package/dist/esm/utils-4f78228e.js.map +0 -1
- /package/dist/content-blocks/{p-4bfbd7ef.entry.js.map → p-1b448306.entry.js.map} +0 -0
- /package/dist/content-blocks/{p-8cc22c1e.entry.js.map → p-3bd97960.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullPageExample.stories.js","sourceRoot":"","sources":["../../../src/stories/FullPageExample.stories.ts"],"names":[],"mappings":"AACA,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EAAE,8CAA8C;aAC1D;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,KAAK,EAAE,2DAA2D;aACnE;SACF;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAucP;CACR,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nconst meta: Meta = {\n title: 'Full Page Examples',\n tags: ['autodocs'],\n parameters: {\n docs: {\n description: {\n component: 'Another description, overriding the comments',\n },\n },\n },\n};\n\nexport default meta;\ntype Story = StoryObj;\n\n/**\n * # Primary Button\n * This is the primary button\n */\nexport const BasicExample: Story = {\n parameters: {\n docs: {\n description: {\n story: 'Another description on the story, overriding the comments',\n },\n },\n },\n render: () => `<style>\n html,body {\n font-size: 14px;\n font-family: \"Helvetica Neue\", \"Arial\", sans-serif;\n line-height: 1\n }\n \n @media screen and (min-width: 768px) {\n html,body {\n font-size:16px\n }\n }\n \n .page-wrapper {\n max-width: 1366px;\n margin: auto\n }\n \n .text-style--header-1 {\n font-weight: bold;\n text-transform: uppercase;\n line-height: .88;\n font-size: 72px\n }\n \n @media screen and (min-width: 768px) {\n .text-style--header-1 {\n font-size:80px\n }\n }\n \n @media screen and (min-width: 1024px) {\n .text-style--header-1 {\n font-size:224px\n }\n }\n \n .text-style--header-2 {\n font-size: 24px;\n text-transform: uppercase;\n font-weight: bold\n }\n \n @media screen and (min-width: 768px) {\n .text-style--header-2 {\n font-size:32px\n }\n }\n \n @media screen and (min-width: 1024px) {\n .text-style--header-2 {\n font-size:36px\n }\n }\n \n .text-style--header {\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1;\n font-size: 60px\n }\n \n .text-style--subheader {\n font-size: 24px;\n line-height: 1\n }\n \n @media screen and (min-width: 768px) {\n .text-style--subheader {\n font-size:32px\n }\n }\n \n @media screen and (min-width: 1024px) {\n .text-style--subheader {\n font-size:36px\n }\n }\n \n .text-style--small-copy {\n font-size: 12px;\n text-transform: uppercase\n }\n \n .text-style--tout-media-content {\n color: white;\n font-size: 12px\n }\n \n .button {\n display: inline-flex;\n text-decoration: none;\n }\n \n .button a {\n color: inherit;\n font-size: inherit;\n text-decoration: inherit; \n }\n .button--primary {\n background: black;\n color: white;\n height: 50px;\n padding: 0 30px\n }\n \n .button--primary:hover {\n background: #333\n }\n \n .button--play {\n color: white;\n font-size: 32px;\n font-weight: bold\n }\n \n .link a {\n text-decoration: none;\n color: inherit\n }\n \n .link:hover a {\n color: red\n }\n \n .link--large a {\n font-weight: bold;\n font-size: 32px\n }\n \n .grid--spaced .content-grid-formatter-grid {\n grid-column-gap: 15px;\n grid-row-gap: 15px\n }\n \n .grid--cast .content-grid-formatter-grid>content-tout-block {\n margin-bottom: 20px\n }\n \n .text-style--large-copy {\n font-size: 24px;\n line-height: 1.3\n }\n \n .content-block--40 {\n max-width: 100%\n }\n \n @media screen and (min-width: 768px) {\n .content-block--40 {\n max-width:40%\n }\n }\n \n .content-block--35 {\n max-width: 100%\n }\n \n @media screen and (min-width: 768px) {\n .content-block--35 {\n max-width:35%\n }\n }\n \n .swiper-button-prev {\n left: 0\n }\n \n .swiper-button-next {\n right: 0\n }\n \n .swiper-button-next,.swiper-button-prev {\n width: 64px;\n height: 64px;\n background: rgba(0,0,0,0.6)\n }\n \n .swiper-button-next:after,.swiper-button-prev:after {\n color: white\n }\n \n .swiper-scrollbar {\n display: none\n }\n \n content-spacer,content-text-block,content-tout-block, content-hero-block, content-image {\n opacity: 0;\n transition: all 1s\n }\n \n content-spacer.hydrated,content-text-block.hydrated,content-tout-block.hydrated, content-hero-block.hydrated, content-image.hydrated {\n opacity: 1;\n transform: translateY(0)\n }\n \n .content-image {\n transition: all 1s\n }\n </style>\n <div class=\"page-wrapper\">\n <content-spacer max-width=\"150px\">\n <content-image width=\"172\" height=\"54\" src=\"https://picsum.photos/172/54?random=1&grayscale\n \"></content-image>\n </content-spacer>\n <content-text-block slot=\"header\">\n <content-spacer max-width=\"90\" horizontal=\"left\" text-align=\"left\">\n <content-line classes=\"text-style--header-1\">Invent Yourself</content-line>\n </content-spacer>\n </content-text-block>\n <content-grid-formatter class=\"grid--cast\" columns=\"1|2|4\" type=\"grid\">\n <content-tout-block hover=\"false\">\n <content-image slot=\"background\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" src=\"https://picsum.photos/200/300?random=1&grayscale\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Cast Name</content-line>\n <content-line classes=\"text-style--tout-media-content\">Proession/Aspiration</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n <content-tout-block hover=\"false\">\n <content-image slot=\"background\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" src=\"https://picsum.photos/200/300?random=2&grayscale\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Cast Name</content-line>\n <content-line classes=\"text-style--tout-media-content\">Proession/Aspiration</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n <content-tout-block hover=\"false\">\n <content-image slot=\"background\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" src=\"https://picsum.photos/200/300?random=3&grayscale\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Cast Name</content-line>\n <content-line classes=\"text-style--tout-media-content\">Proession/Aspiration</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n <content-tout-block hover=\"false\">\n <content-image slot=\"background\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" src=\"https://picsum.photos/200/300?random=4&grayscale\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Cast Name</content-line>\n <content-line classes=\"text-style--tout-media-content\">Proession/Aspiration</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n \n </content-grid-formatter>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=1&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer max-width=\"100|50\" left-offset=\"2\" top-offset=\"2\">\n <content-line classes=\"text-style--header\" max-width=\"100|70\">Lorem Ipsum</content-line>\n <content-line classes=\"text-style--subheader\">Benefit copy goes here.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">START NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n \n <content-grid-formatter type=\"flex\" flex-grow=\"true\" columns=\"1|2\">\n <content-text-block class=\"content-block--40\">\n <content-spacer left-offset=\"2\" right-offset=\"2\" top-offset=\"2\"> \n <content-line classes=\"text-style--header\">GET THE COVETED BOX-BAG</content-line>\n <content-line classes=\"text-style--subheader\">No time to wait</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n <content-image src=\"https://picsum.photos/1600/900?random=2&grayscale\"></content-image>\n </content-grid-formatter>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=3&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer left-offset=\"2\">\n <content-line classes=\"text-style--header\">Daily Rescue</content-line>\n <content-line classes=\"text-style--subheader\">Benefit copy goes here.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n \n <content-spacer top-offset=\"1\" bottom-offset=\"1\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=4&grayscale\"></content-image>\n <content-text-block slot=\"content\" vertical=\"center\">\n <content-spacer left-offset=\"4\" max-width=\"100|75|65\">\n <content-line classes=\"text-style--header\">Get Down WIth The Best Daily Routine</content-line>\n <content-spacer top-offset=\"4\">\n <content-button classes=\"button button--play\" href=\"#heroVideoOverlay\">PLAY</content-button>\n </content-spacer>\n </content-spacer>\n <content-overlay id=\"heroVideoOverlay\" target=\"#\" full-screen=\"false\">\n <content-video slot=\"content\" fit-container=\"true\" src=\"https://www.youtube.com/watch?v=IY4x85zqoJM\" autoplay=\"true\"></content-video>\n <script slot=\"content\" type=\"text/template\">\n </script>\n </content-overlay>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n \n <content-grid-formatter columns=\"1|3\" type=\"grid\" class=\"grid--spaced\">\n <content-image src=\"https://picsum.photos/400/300?random=1&grayscale\"></content-image>\n <content-image src=\"https://picsum.photos/400/300?random=2&grayscale\"></content-image>\n <content-image src=\"https://picsum.photos/400/300?random=3&grayscale\"></content-image>\n </content-grid-formatter>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-grid-formatter columns=\"1|2\">\n <content-spacer>\n <content-line classes=\"text-style--header\">Expert Chat</content-line>\n </content-spacer>\n <content-spacer>\n <content-line classes=\"text-style--large-copy\">We know shopping for your skincare needs can be overwhelming. Let us help! There's no such thing as a silly question! <content-button classes=\"link\">Give it a try ></content-button></content-line>\n </content-spacer>\n </content-grid-formatter>\n </content-spacer>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=4&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer max-width=\"100|50\" left-offset=\"2\" top-offset=\"2\">\n <content-line classes=\"text-style--header\" max-width=\"100|50\">Lorem Ipsum</content-line>\n <content-line classes=\"text-style--subheader\">Benefit copy goes here.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"link link--large\">Learn more ></content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n \n <content-text-block slot=\"header\">\n <content-line classes=\"text-style--header-2\">By Series</content-line>\n </content-text-block>\n <content-carousel init-method=\"load\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=5&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer left-offset=\"2\">\n <content-line classes=\"text-style--header\">Daily Rescue</content-line>\n <content-line classes=\"text-style--subheader\">Benefit copy goes here.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=6&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer left-offset=\"2\">\n <content-line classes=\"text-style--header\">Daily Rescue</content-line>\n <content-line classes=\"text-style--subheader\">Benefit copy goes here.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=7&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer left-offset=\"2\">\n <content-line classes=\"text-style--header\">Daily Rescue</content-line>\n <content-line classes=\"text-style--subheader\">Benefit copy goes here.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-carousel>\n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-grid-formatter type=\"flex\" flex-grow=\"true\" columns=\"1|2\">\n <content-tout-block hover=\"false\">\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=8&grayscale\"></content-image>\n <content-spacer slot=\"mediaContent\" top-offset=\"8\" bottom-offset=\"5\" left-offset=\"6\" right-offset=\"4\">\n <content-text-block color-class=\"light\">\n <content-line classes=\"text-style--header-2\">/Instructions</content-line>\n <content-spacer slot=\"footer\">\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n </content-spacer>\n </content-text-block>\n </content-tout-block>\n </content-tout-block>\n <content-spacer left-offset=\"4\" class=\"content-block--35\">\n <content-text-block>\n <content-line classes=\"text-style--header\">BE PART OF THE CHANGE</content-line>\n <content-line classes=\"text-style--subheader\">Sustainability is our priority and we are the first men's skincare brand to introduce refillable packaging.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"link link--large\">Learn more ></content-button>\n </content-spacer>\n </content-text-block>\n </content-spacer>\n </content-grid-formatter>\n </content-spacer>\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=9&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer max-width=\"90|75|55|35\" top-offset=\"2|8\" left-offset=\"2\" right-offset=\"2|7\" horizontal=\"left|right\">\n <content-line classes=\"text-style--header\">Just The Tip</content-line>\n <content-line classes=\"text-style--subheader\">Master your skills on how to up your skincare game.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"link link--large\">Sign up ></content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=10&grayscale\"></content-image>\n <content-text-block slot=\"content\" vertical=\"center\">\n <content-spacer max-width=\"90|75|55|35\" left-offset=\"2\" right-offset=\"10\" horizontal=\"left\">\n <content-line classes=\"text-style--header\">THE DROP:</content-line>\n <content-line classes=\"text-style--subheader\">BE THBE FIRST TO OWN OUR NEW MAXELLENCE MATTE BLACK PACKAGING ></content-line>\n <content-line classes=\"text-style--header\">09/01/21</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"link link--large\">Learn more ></content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n \n <content-spacer bottom-offset=\"2\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=11&grayscale\"></content-image>\n <content-text-block slot=\"content\" vertical=\"top\">\n <content-spacer max-width=\"90|75|55|45\" left-offset=\"2|0\" top-offset=\"2\" right-offset=\"0\" horizontal=\"left|right\">\n <content-line classes=\"text-style--header\">Invigorate Yourself</content-line>\n <content-line classes=\"text-style--subheader\" max-width=\"100|82\">Shop our Molecule Shop products</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n </div>`,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"FullPageExample.stories.js","sourceRoot":"","sources":["../../../src/stories/FullPageExample.stories.ts"],"names":[],"mappings":"AACA,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EAAE,8CAA8C;aAC1D;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,KAAK,EAAE,2DAA2D;aACnE;SACF;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAqZP;CACR,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nconst meta: Meta = {\n title: 'Full Page Examples',\n tags: ['autodocs'],\n parameters: {\n docs: {\n description: {\n component: 'Another description, overriding the comments',\n },\n },\n },\n};\n\nexport default meta;\ntype Story = StoryObj;\n\n/**\n * # Primary Button\n * This is the primary button\n */\nexport const BasicExample: Story = {\n parameters: {\n docs: {\n description: {\n story: 'Another description on the story, overriding the comments',\n },\n },\n },\n render: () => `<style>\n html,body {\n font-size: 14px;\n font-family: \"Helvetica\", \"Arial\", sans-serif;\n line-height: 1.2;\n }\n \n @media screen and (min-width: 768px) {\n html,body {\n font-size:16px\n }\n }\n\n content-navigation-block ul,\n content-navigation-block ol,\n content-navigation-block li {\n padding: 0;\n list-style: none;\n display: block;\n }\n\n content-navigation-block .nav-level-1 a {\n font-size: 1.15rem;\n line-height:2;\n text-decoration: none;\n font-weight: bold;\n }\n \n .logo {\n width: 100px;\n height: 100px;\n background: #888;\n color: #FFF;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n overflow: hidden;\n }\n \n .page-wrapper {\n max-width: 1366px;\n margin: auto\n }\n \n .text-style--header-1 {\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1.2;\n font-size: 3.5rem;\n }\n \n .text-style--header-2 {\n font-size: 24px;\n text-transform: uppercase;\n font-weight: bold\n }\n\n .text-style--header {\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1;\n font-size: 2.5rem;\n }\n \n .text-style--subheader {\n font-size: 24px;\n line-height: 1\n }\n \n \n .text-style--small-copy {\n font-size: 12px;\n text-transform: uppercase\n }\n \n .text-style--tout-media-content {\n color: white;\n font-size: 12px\n }\n \n .button {\n display: inline-flex;\n text-decoration: none;\n }\n \n .button a {\n color: inherit;\n font-size: inherit;\n text-decoration: inherit; \n }\n \n content-button a {\n width: auto;\n }\n .button--primary a {\n background: black;\n color: white;\n height: 50px;\n padding: 0 30px;\n width: auto;\n }\n \n .button--primary a:hover {\n background: #333\n }\n \n .button--play {\n color: white;\n font-size: 32px;\n font-weight: bold\n }\n \n .link a {\n text-decoration: none;\n color: inherit\n }\n \n .link:hover a {\n color: red\n }\n \n .link--large a {\n font-weight: bold;\n font-size: 32px\n }\n \n .grid--spaced .content-grid-formatter-grid {\n grid-column-gap: 15px;\n grid-row-gap: 15px\n }\n \n .grid--cast .content-grid-formatter-grid>content-tout-block {\n margin-bottom: 20px\n }\n \n .text-style--large-copy {\n font-size: 24px;\n line-height: 1.3\n }\n\n .swiper-button-prev {\n left: 0\n }\n \n .swiper-button-next {\n right: 0\n }\n \n .swiper-button-next,.swiper-button-prev {\n width: 64px;\n height: 64px;\n background: rgba(0,0,0,0.6)\n }\n \n .swiper-button-next:after,.swiper-button-prev:after {\n color: white\n }\n \n .swiper-scrollbar {\n display: none\n }\n \n \n content-spacer.hydrated,content-text-block.hydrated,content-tout-block.hydrated, content-hero-block.hydrated, content-image.hydrated {\n opacity: 1;\n }\n .relative {\n position: relative;\n }\n content-navigation-block[aria-expanded=\"true\"] .logo {\n display: none;\n }\n\n </style>\n <div class=\"page-wrapper\">\n <div class=\"\">\n <content-spacer max-width=\"1440px\" horizontal=\"center\">\n <content-navigation-block hamburger=\"fixed|none\" flex-shrink=\"true\">\n <content-button slot=\"skipContent\">Skip to main content</content-button>\n <div slot=\"content\">\n <nav>\n <content-spacer left-offset=\"40px|0\">\n <content-grid-formatter class=\"nav-level-1\" columns=\"1|5\" vertical=\"center\" type=\"flex|grid\" horizontal=\"flex-start|flex-end\">\n <div style=\"margin-right: auto;\"><content-line classes=\"logo\">Logo</content-line></div>\n <div><content-button href=\"#link1\" target=\"_blank\">Link 1\n </content-button>\n <content-overlay id=\"link1\" full-screen=\"false\" position=\"static|absolute\">\n <content-spacer left-offset=\"20px\" right-offset=\"20px\">\n <content-grid-formatter columns=\"1|3\">\n <ul class=\"nav-level-2\">\n <li><a href=\"#\">Link</a></li>\n <li><a href=\"#\">Link</a></li>\n <li><a href=\"#\">Link</a></li>\n </ul>\n <ul class=\"nav-level-2\">\n <li><a href=\"#\">Link</a></li>\n <li><a href=\"#\">Link</a></li>\n <li><a href=\"#\">Link</a></li>\n </ul>\n <ul class=\"nav-level-2\">\n <li><a href=\"#\">Link</a></li>\n <li><a href=\"#\">Link</a></li>\n <li><a href=\"#\">Link</a></li>\n </ul>\n </content-grid-formatter>\n </content-spacer>\n </content-overlay>\n </div>\n <div>\n <content-button href=\"#link2\" target=\"_blank\">Link 2</content-button>\n </div>\n </content-grid-formatter>\n </content-spacer>\n </nav>\n </div>\n </content-navigation-block>\n </content-spacer>\n </div>\n <content-text-block slot=\"header\">\n <content-spacer max-width=\"90\" horizontal=\"left\" text-align=\"left\">\n <content-line classes=\"text-style--header-1\">Latest Works</content-line>\n </content-spacer>\n </content-text-block>\n \n <content-spacer top-offset=\"1\" bottom-offset=\"20px\">\n <content-hero-block content-position=\"above\">\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=4&grayscale\"></content-image>\n <content-text-block slot=\"content\" vertical=\"center\">\n <content-spacer left-offset=\"4\" right-offset=\"4\" max-width=\"100|75|65\">\n <content-line classes=\"text-style--header\">Watch Travel Video</content-line>\n <content-spacer top-offset=\"4\">\n <content-button classes=\"button button--play\" href=\"#heroVideoOverlay\">PLAY</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n <content-overlay id=\"heroVideoOverlay\" position=\"absolute\">\n Hello World\n <script slot=\"content\" type=\"text/template\">\n <content-video fit-container=\"true\" src=\"https://www.youtube.com/watch?v=IY4x85zqoJM\" autoplay=\"true\"></content-video>\n </script>\n </content-overlay>\n </content-hero-block>\n </content-spacer>\n\n <content-grid-formatter class=\"grid--cast\" columns=\"2|4\" type=\"grid\" column-gap=\"10px\" row-gap=\"10px\">\n <content-tout-block hover=\"false\">\n <content-image slot=\"media\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" aspect-ratio=\"2/3\" src=\"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Tourist Destination</content-line>\n <content-line classes=\"text-style--tout-media-content\">Malaysia</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n <content-tout-block hover=\"false\">\n <content-image slot=\"media\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" aspect-ratio=\"2/3\" src=\"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4\" aspect-ratio=\"2/3\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Tourist Destination</content-line>\n <content-line classes=\"text-style--tout-media-content\">Malaysia</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n <content-tout-block hover=\"false\">\n <content-image slot=\"media\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" aspect-ratio=\"2/3\" src=\"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Tourist Destination</content-line>\n <content-line classes=\"text-style--tout-media-content\">Malaysia</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n <content-tout-block hover=\"false\">\n <content-image slot=\"media\" alt=\"Test Alt Text\" lazy-load=\"false\" width=\"2\" height=\"3\" aspect-ratio=\"2/3\" src=\"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4\"></content-image>\n <content-text-block slot=\"mediaContent\" vertical=\"bottom\">\n <content-spacer text-align=\"left\" left-offset=\"4\" bottom-offset=\"4\">\n <content-line classes=\"text-style--tout-media-content\">Tourist Destination</content-line>\n <content-line classes=\"text-style--tout-media-content\">Malaysia</content-line>\n </content-spacer>\n </content-text-block> \n </content-tout-block>\n \n </content-grid-formatter>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-hero-block>\n <content-image slot=\"background\" aspect-ratio=\"3/4|4/1\" src=\"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer max-width=\"100|400px\" left-offset=\"2\" top-offset=\"2\">\n <content-line classes=\"text-style--header\">Travel Vlog</content-line>\n <content-line classes=\"text-style--subheader\">Follow along with my guide to the best of this travel destination.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">Explore</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n \n <content-grid-formatter type=\"flex\" flex-grow=\"true\" columns=\"1|2\">\n <content-text-block class=\"content-block--40\">\n <content-spacer left-offset=\"2\" right-offset=\"2\" top-offset=\"2\" bottom-offset=\"4\"> \n <content-line classes=\"text-style--header\">Favorite Destinations</content-line>\n <content-line classes=\"text-style--subheader\">No time to wait</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">Travel With Me</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n <content-image src=\"https://picsum.photos/1600/900?random=2&grayscale\"></content-image>\n </content-grid-formatter>\n\n \n <content-grid-formatter columns=\"1|3\" type=\"grid\" class=\"grid--spaced\" row-gap=\"20px\" row-gap=\"20px\">\n <content-image src=\"https://picsum.photos/400/300?random=1&grayscale\"></content-image>\n <content-image src=\"https://picsum.photos/400/300?random=2&grayscale\"></content-image>\n <content-image src=\"https://picsum.photos/400/300?random=3&grayscale\"></content-image>\n </content-grid-formatter>\n\n \n <content-text-block slot=\"header\">\n <content-spacer bottom-offset=\"20px\"><content-line classes=\"text-style--header-2\">Carousel</content-line></content-spacer>\n </content-text-block>\n <content-carousel init-method=\"load\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=5&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer left-offset=\"2\" top-offset=\"20px\">\n <content-line classes=\"text-style--header\">Japan</content-line>\n <content-line classes=\"text-style--subheader\">Taken amongst the Cherry Blossom trees of Tokyo.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=5&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer left-offset=\"2\" top-offset=\"20px\">\n <content-line classes=\"text-style--header\">Norway</content-line>\n <content-line classes=\"text-style--subheader\">Explore the Northern Lights.</content-line>\n <content-spacer top-offset=\"2\">\n <content-button classes=\"button button--primary\">SHOP NOW</content-button>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-carousel>\n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-grid-formatter type=\"flex\" flex-grow=\"true\" columns=\"1|2\">\n <content-tout-block hover=\"false\">\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=8&grayscale\"></content-image>\n <content-spacer slot=\"mediaContent\" top-offset=\"8\" bottom-offset=\"5\" left-offset=\"6\" right-offset=\"4\">\n <content-text-block color-class=\"light\">\n <content-line classes=\"text-style--header-2\">/Instructions</content-line>\n <content-spacer slot=\"footer\">\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n <content-line classes=\"text-style--small-copy\">/01 Twist base of bottle counter-clockwise to lock</content-line>\n </content-spacer>\n </content-text-block>\n </content-tout-block>\n </content-tout-block>\n <content-spacer left-offset=\"4\" class=\"content-block--35\">\n <content-text-block>\n <content-line classes=\"text-style--header\">Editorial Content</content-line>\n <content-line classes=\"text-style--subheader\">Donec sed odio dui. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</content-line>\n <content-spacer top-offset=\"2\">\n <div><content-button classes=\"link link--large\">Learn more ></content-button></div>\n </content-spacer>\n </content-text-block>\n </content-spacer>\n </content-grid-formatter>\n </content-spacer>\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=9&grayscale\"></content-image>\n <content-text-block slot=\"content\">\n <content-spacer max-width=\"90|75|55|35\" top-offset=\"2|8\" left-offset=\"2\" right-offset=\"2|7\" horizontal=\"left|right\">\n <content-line classes=\"text-style--header\">Editorial Content</content-line>\n <content-line classes=\"text-style--subheader\">Freeform text layouts.</content-line>\n <content-spacer top-offset=\"2\">\n <div><content-button classes=\"link link--large\">Example CTA</content-button></div>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n \n <content-spacer top-offset=\"5\" bottom-offset=\"5\">\n <content-hero-block>\n <content-image slot=\"background\" src=\"https://picsum.photos/1600/900?random=10&grayscale\"></content-image>\n <content-text-block slot=\"content\" vertical=\"center\">\n <content-spacer max-width=\"90|75|55|35\" left-offset=\"2\" right-offset=\"10\" horizontal=\"left\">\n <content-line classes=\"text-style--header\">Editorial Content</content-line>\n <content-line classes=\"text-style--subheader\">Donec sed odio dui.</content-line>\n <content-spacer top-offset=\"2\">\n <div><content-button classes=\"link link--large\">Learn more ></content-button></div>\n </content-spacer>\n </content-spacer>\n </content-text-block>\n </content-hero-block>\n </content-spacer>\n </div>`,\n};\n"]}
|
|
@@ -2,29 +2,12 @@ export const breakpoints = ['mobile', 'tablet-portrait', 'tablet-landscape', 'ta
|
|
|
2
2
|
export const breakpointLabels = ['Mobile', 'Tablet (Portrait)', 'Tablet (Landscape)', 'iPad Pro', 'Desktop Large', 'Desktop Wide'];
|
|
3
3
|
export const breakpointValues = [0, 768, 1024, 1366, 1440, 1920];
|
|
4
4
|
export function getBreakpointValues() {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Only inject the element if it's not yet present
|
|
10
|
-
if (!element) {
|
|
11
|
-
element = document.createElement('link');
|
|
12
|
-
element.setAttribute('rel', 'stylesheet');
|
|
13
|
-
element.setAttribute('href', fontCssUrl);
|
|
14
|
-
document.head.prepend(element);
|
|
5
|
+
if (!window.$contentBlocks)
|
|
6
|
+
window.$contentBlocks = {};
|
|
7
|
+
if (!window.$contentBlocks.breakpointValues) {
|
|
8
|
+
window.$contentBlocks.breakpointValues = breakpointValues;
|
|
15
9
|
}
|
|
16
|
-
|
|
17
|
-
export function generateResponsiveClass(classPrefix, responsiveValue) {
|
|
18
|
-
let index = -1;
|
|
19
|
-
let classString = '';
|
|
20
|
-
responsiveValue.split('|').forEach(value => {
|
|
21
|
-
index++;
|
|
22
|
-
if (!value || value === 'false') {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
classString += ` ${classPrefix}-${breakpoints[index]}-${value}`;
|
|
26
|
-
});
|
|
27
|
-
return classString;
|
|
10
|
+
return window.$contentBlocks.breakpointValues;
|
|
28
11
|
}
|
|
29
12
|
// Fills in default value if none exists for a breakpoint
|
|
30
13
|
export function generateResponsiveValues(responsiveValue) {
|
|
@@ -34,7 +17,7 @@ export function generateResponsiveValues(responsiveValue) {
|
|
|
34
17
|
let responseArray = [];
|
|
35
18
|
let splitResponsiveValues = responsiveValue.split('|');
|
|
36
19
|
let lastGoodValue = splitResponsiveValues[0];
|
|
37
|
-
|
|
20
|
+
getBreakpointValues().forEach((_value, index) => {
|
|
38
21
|
let thisBreakpointValue = splitResponsiveValues[index];
|
|
39
22
|
if (thisBreakpointValue) {
|
|
40
23
|
lastGoodValue = thisBreakpointValue;
|
|
@@ -46,11 +29,11 @@ export function generateResponsiveValues(responsiveValue) {
|
|
|
46
29
|
export function getCurrentBreakpointIndex() {
|
|
47
30
|
let activeBreakpointIndex = 0;
|
|
48
31
|
let windowWidth = window.innerWidth;
|
|
49
|
-
|
|
32
|
+
getBreakpointValues().some(width => {
|
|
50
33
|
// The first time this is true will end the loop
|
|
51
34
|
let condition = width > windowWidth;
|
|
52
35
|
if (!condition) {
|
|
53
|
-
activeBreakpointIndex =
|
|
36
|
+
activeBreakpointIndex = getBreakpointValues().indexOf(width);
|
|
54
37
|
}
|
|
55
38
|
return condition;
|
|
56
39
|
});
|
|
@@ -71,6 +54,7 @@ export function getCurrentValue(responsiveValue) {
|
|
|
71
54
|
}
|
|
72
55
|
return returnValue;
|
|
73
56
|
}
|
|
57
|
+
/* Below Functions are Deprecated */
|
|
74
58
|
export function getValueAtIndex(index, responsiveValue) {
|
|
75
59
|
let responsiveValues = generateResponsiveValues(responsiveValue.toString());
|
|
76
60
|
return responsiveValues[index].trim();
|
|
@@ -94,4 +78,26 @@ export function objectToCssString(object) {
|
|
|
94
78
|
}
|
|
95
79
|
return string;
|
|
96
80
|
}
|
|
81
|
+
export function generateResponsiveClass(classPrefix, responsiveValue) {
|
|
82
|
+
let index = -1;
|
|
83
|
+
let classString = '';
|
|
84
|
+
responsiveValue.split('|').forEach(value => {
|
|
85
|
+
index++;
|
|
86
|
+
if (!value || value === 'false') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
classString += ` ${classPrefix}-${breakpoints[index]}-${value}`;
|
|
90
|
+
});
|
|
91
|
+
return classString;
|
|
92
|
+
}
|
|
93
|
+
export function insertCssIntoHead(document, fontCssUrl) {
|
|
94
|
+
let element = document.querySelector(`link[href="${fontCssUrl}"]`);
|
|
95
|
+
// Only inject the element if it's not yet present
|
|
96
|
+
if (!element) {
|
|
97
|
+
element = document.createElement('link');
|
|
98
|
+
element.setAttribute('rel', 'stylesheet');
|
|
99
|
+
element.setAttribute('href', fontCssUrl);
|
|
100
|
+
document.head.prepend(element);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
97
103
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,cA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AAmB,EAAE,eAAuB;IAClF,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IACf,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,WAAW,IAAI,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAkB,EAAE,UAAkB;IACtE,IAAI,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,UAAU,IAAI,CAAC,CAAC;IACnE,kDAAkD;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC1C,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACzC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;AACH,CAAC","sourcesContent":["import { ResponsiveString } from \"../typings\";\n\nexport const breakpoints = ['mobile', 'tablet-portrait', 'tablet-landscape', 'tablet-pro', 'desktop-large', 'desktop-wide'];\nexport const breakpointLabels = ['Mobile', 'Tablet (Portrait)', 'Tablet (Landscape)', 'iPad Pro', 'Desktop Large', 'Desktop Wide'];\nexport const breakpointValues = [0,768,1024,1366,1440,1920];\ndeclare global {\n interface Window {\n $contentBlocks?: any;\n }\n}\nexport function getBreakpointValues() {\n if (!window.$contentBlocks) window.$contentBlocks = {};\n if (!window.$contentBlocks.breakpointValues) {\n window.$contentBlocks.breakpointValues = breakpointValues;\n }\n return window.$contentBlocks.breakpointValues;\n}\n\n// Fills in default value if none exists for a breakpoint\nexport function generateResponsiveValues(responsiveValue: string): string[] {\n if (!responsiveValue) {\n return [];\n }\n let responseArray = [];\n let splitResponsiveValues = responsiveValue.split('|');\n let lastGoodValue = splitResponsiveValues[0];\n getBreakpointValues().forEach((_value, index) => {\n let thisBreakpointValue = splitResponsiveValues[index];\n if (thisBreakpointValue) {\n lastGoodValue = thisBreakpointValue;\n }\n responseArray.push(thisBreakpointValue ? thisBreakpointValue : lastGoodValue);\n });\n return responseArray;\n}\n\nexport function getCurrentBreakpointIndex(): number {\n let activeBreakpointIndex: number = 0;\n let windowWidth = window.innerWidth;\n getBreakpointValues().some(width => {\n // The first time this is true will end the loop\n let condition = width > windowWidth;\n if (!condition) {\n activeBreakpointIndex = getBreakpointValues().indexOf(width);\n }\n return condition;\n });\n return activeBreakpointIndex;\n}\n\nexport function getCurrentValue(responsiveValue: string | boolean): string {\n if (!responsiveValue) {\n return '';\n }\n let currentBreakpoint = getCurrentBreakpointIndex();\n let responsiveValues = generateResponsiveValues(responsiveValue.toString());\n let returnValue: string;\n for (var i = currentBreakpoint; i >= 0; i--) {\n if (responsiveValues[i]) {\n returnValue = responsiveValues[i];\n i = -1;\n }\n }\n return returnValue;\n}\n\n/* Below Functions are Deprecated */\n\nexport function getValueAtIndex(index: number, responsiveValue: ResponsiveString): string {\n let responsiveValues = generateResponsiveValues(responsiveValue.toString());\n return responsiveValues[index].trim();\n}\n\nexport function getHydratedClassString(classString: string): string {\n let cleanedString = getCurrentValue(classString).trim();\n if (cleanedString.includes('hydrated')) {\n return cleanedString.trim();\n }\n if (cleanedString) {\n return cleanedString.trim() + ' hydrated';\n }\n return 'hydrated';\n}\n\nexport function objectToCssString(object: object): string {\n let string = '';\n for (var key in object) {\n if (object[key].length > 0 && !['px', '%'].includes(object[key])) {\n string += `${key}: ${object[key]};`;\n }\n }\n return string;\n}\nexport function generateResponsiveClass(classPrefix: string, responsiveValue: string) {\n let index = -1;\n let classString = '';\n responsiveValue.split('|').forEach(value => {\n index++;\n if (!value || value === 'false') {\n return false;\n }\n classString += ` ${classPrefix}-${breakpoints[index]}-${value}`;\n });\n return classString;\n}\n\nexport function insertCssIntoHead(document: Document, fontCssUrl: string) {\n let element = document.querySelector(`link[href=\"${fontCssUrl}\"]`);\n // Only inject the element if it's not yet present\n if (!element) {\n element = document.createElement('link');\n element.setAttribute('rel', 'stylesheet');\n element.setAttribute('href', fontCssUrl);\n document.head.prepend(element);\n }\n}"]}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ResponsiveUtils } from "..";
|
|
2
|
+
describe('generateResponsiveValues', () => {
|
|
3
|
+
it('should return a proper array of values', () => {
|
|
4
|
+
expect(ResponsiveUtils.generateResponsiveValues('1|2|3')).toEqual(['1', '2', '3', '3', '3', '3']);
|
|
5
|
+
});
|
|
6
|
+
it('should handle custom values', () => {
|
|
7
|
+
expect(ResponsiveUtils.generateResponsiveValues('1|2|3')).toEqual(['1', '2', '3', '3', '3', '3']);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
describe('getCurrentBreakpointIndex', () => {
|
|
11
|
+
it('should return a proper array of values', () => {
|
|
12
|
+
window.innerWidth = 768;
|
|
13
|
+
expect(ResponsiveUtils.getCurrentBreakpointIndex()).toEqual(1);
|
|
14
|
+
window.innerWidth = 1024;
|
|
15
|
+
expect(ResponsiveUtils.getCurrentBreakpointIndex()).toEqual(2);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('getCurrentValue', () => {
|
|
19
|
+
it('should return a proper array of values', () => {
|
|
20
|
+
window.innerWidth = 1920;
|
|
21
|
+
expect(ResponsiveUtils.getCurrentValue('1|2')).toEqual('2');
|
|
22
|
+
});
|
|
23
|
+
it('should handle custom values', () => {
|
|
24
|
+
window.innerWidth = 1920;
|
|
25
|
+
window.$contentBlocks = {
|
|
26
|
+
breakpointValues: [0, 768, 1920, 2560],
|
|
27
|
+
};
|
|
28
|
+
expect(ResponsiveUtils.getCurrentValue('1|2|3|4')).toEqual('3');
|
|
4
29
|
});
|
|
5
30
|
});
|
|
6
31
|
//# sourceMappingURL=utils.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../../src/utils/utils.spec.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../../src/utils/utils.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAErC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACpG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACpG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,UAAU,GAAG,GAAG,CAAC;QACxB,MAAM,CAAC,eAAe,CAAC,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAE/D,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,MAAM,CAAC,eAAe,CAAC,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,MAAM,CAAC,cAAc,GAAG;YACtB,gBAAgB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;SACvC,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { ResponsiveUtils } from '..';\n\ndescribe('generateResponsiveValues', () => {\n it('should return a proper array of values', () => {\n expect(ResponsiveUtils.generateResponsiveValues('1|2|3')).toEqual(['1', '2', '3', '3', '3', '3']);\n });\n\n it('should handle custom values', () => {\n expect(ResponsiveUtils.generateResponsiveValues('1|2|3')).toEqual(['1', '2', '3', '3', '3', '3']);\n });\n});\n\ndescribe('getCurrentBreakpointIndex', () => {\n it('should return a proper array of values', () => {\n window.innerWidth = 768;\n expect(ResponsiveUtils.getCurrentBreakpointIndex()).toEqual(1);\n\n window.innerWidth = 1024;\n expect(ResponsiveUtils.getCurrentBreakpointIndex()).toEqual(2);\n });\n});\n\ndescribe('getCurrentValue', () => {\n it('should return a proper array of values', () => {\n window.innerWidth = 1920;\n expect(ResponsiveUtils.getCurrentValue('1|2')).toEqual('2');\n });\n\n it('should handle custom values', () => {\n window.innerWidth = 1920;\n window.$contentBlocks = {\n breakpointValues: [0, 768, 1920, 2560],\n };\n expect(ResponsiveUtils.getCurrentValue('1|2|3|4')).toEqual('3');\n });\n});\n"]}
|
|
@@ -36,7 +36,7 @@ const ContentButton$1 = /*@__PURE__*/ proxyCustomElement(class ContentButton ext
|
|
|
36
36
|
if (this.hasContentToActivate) {
|
|
37
37
|
ev.preventDefault();
|
|
38
38
|
// ev.stopPropagation();
|
|
39
|
-
this.activatedContent.dispatchEvent(new CustomEvent('
|
|
39
|
+
this.activatedContent.dispatchEvent(new CustomEvent('open', { detail: this.activatedContent }));
|
|
40
40
|
this.activatedContent.scrollIntoView({ behavior: 'smooth' });
|
|
41
41
|
}
|
|
42
42
|
else if (this.href && this.href.length > 1 && this.href.substring(0, 1) === '#') {
|
|
@@ -44,8 +44,8 @@ const ContentButton$1 = /*@__PURE__*/ proxyCustomElement(class ContentButton ext
|
|
|
44
44
|
if (element) {
|
|
45
45
|
ev.preventDefault();
|
|
46
46
|
// ev.stopPropagation();
|
|
47
|
-
element.dispatchEvent(new CustomEvent('
|
|
48
|
-
|
|
47
|
+
element.dispatchEvent(new CustomEvent('open', { detail: element }));
|
|
48
|
+
element.scrollIntoView({ behavior: 'smooth' });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"content-button.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,knBAAknB;;MCe9nBA,eAAa;;;;;;uBAmBN,EAAE;2BACG,EAAE;8BAIS,KAAK;;;;;;;IAmCvC,iBAAiB;QACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;QACpF,IAAI,CAAC,oBAAoB,GAA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AAO,EAAE,EAAE,IAAI,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,mBAC3B,IAAI,CAAC,QAAQ,mBACb,IAAI,CAAC,QAAQ,EAC5B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAElB,CAAC,IAAI,CAAC,cAAc,IACnB,gBACE,YAAM,IAAI,EAAC,SAAS,GAAQ,EAC5B,eAAa,CACR,KAEP,WAAK,KAAK,EAAC,mCAAmC,IAC5C,YAAM,IAAI,EAAC,SAAS,GAAQ,EAC5B,eAAa,CACT,CACP,CACC,EACJ,YAAM,IAAI,EAAC,kBAAkB,GAAQ,CAChC,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ContentButton"],"sources":["src/elements/content-button/content-button.scss?tag=content-button","src/elements/content-button/content-button.tsx"],"sourcesContent":["content-button {\n display: inline-block;\n > a, > button {\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n }\n > button {\n appearance: none;\n background: inherit;\n cursor: pointer;\n }\n\n &[clickable-block=\"true\"] {\n display: block;\n width: 100%;\n height: 100%;\n > a,\n > button {\n height: 100%;\n width: 100%;\n > * {\n display: block;\n width: 100%;\n }\n }\n .content-button__clickable-content {\n width: 100%;\n height: 100%;\n }\n }\n\n}","import { Component, h, Host, Prop } from '@stencil/core';\nimport { Element, HostElement, HTMLStencilElement, State } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveString } from '../../typings';\n\n/**\n * @slot content - Inner contents of the button, usually plaintext.\n * @slot - Default slot, same as content slot.\n * @slot activatedContent - If this slot is used, the content in this will be scrolled to and triggered.\n */\n@Component({\n tag: 'content-button',\n styleUrl: 'content-button.scss',\n shadow: false,\n})\nexport class ContentButton {\n @Element() hostElement: HostElement;\n /**\n * @type URL\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n href: string;\n /**\n * @type String\n */\n @Prop() target: string;\n /**\n * The classes for the button.\n * @type String\n * @responsive\n */\n @Prop() classes = '';\n @State() classString = '';\n /**\n * @type Boolean\n */\n @Prop() clickableBlock: boolean = false;\n /**\n * @type Boolean\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n expanded: string;\n /**\n\n /**\n * Aria-controls value\n * @type Target\n */\n @Prop() controls: string;\n\n /**\n * @type String\n * @responsive\n */\n @Prop() linkLabel: ResponsiveString;\n /**\n * @type String\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n linkClass: ResponsiveString;\n @State() hasContentToActivate: boolean;\n\n public activatedContent: HTMLDivElement;\n\n componentWillLoad() {\n this.activatedContent = this.hostElement.querySelector('[slot=\"activatedContent\"]');\n this.hasContentToActivate = !!this.activatedContent;\n // If this is a clickable block, forcefully add a # to force an anchor link\n if (!this.href || this.href === '#') {\n this.href = 'javascript:void(0);';\n }\n\n WindowResizeService.registerProp(this.linkClass).subscribe(newValue => {\n this.linkClass = newValue as string;\n });\n\n WindowResizeService.registerProp(this.classes).subscribe(newValue => {\n this.classString = newValue as string;\n });\n }\n\n onHandleClickEvent(ev) {\n if (this.hasContentToActivate) {\n ev.preventDefault();\n // ev.stopPropagation();\n this.activatedContent.dispatchEvent(new CustomEvent('open', { detail: this.activatedContent }));\n this.activatedContent.scrollIntoView({ behavior: 'smooth' });\n } else if (this.href && this.href.length > 1 && this.href.substring(0, 1) === '#') {\n let element = document.getElementById(this.href.substring(1));\n if (element) {\n ev.preventDefault();\n // ev.stopPropagation();\n element.dispatchEvent(new CustomEvent('open', { detail: element }));\n element.scrollIntoView({ behavior: 'smooth' });\n }\n }\n }\n\n render() {\n return (\n <Host class={this.classString}>\n <a\n aria-label={this.linkLabel}\n class={this.linkClass}\n role={this.href === 'javascript:void(0);' ? 'button' : ''}\n onClick={ev => this.onHandleClickEvent(ev)}\n aria-expanded={this.expanded}\n aria-controls={this.controls}\n href={this.href}\n target={this.target}\n >\n {!this.clickableBlock ? (\n <span>\n <slot name=\"content\"></slot>\n <slot></slot>\n </span>\n ) : (\n <div class=\"content-button__clickable-content\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n )}\n </a>\n <slot name=\"activatedContent\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -12,7 +12,6 @@ const ContentCarousel$1 = /*@__PURE__*/ proxyCustomElement(class ContentCarousel
|
|
|
12
12
|
this.swiperOptions = '{"slidesPerView": 1, "slidesPerGroup": 1, "autoplay": true, "loop": false}';
|
|
13
13
|
}
|
|
14
14
|
getSwiperOptions(newOptions) {
|
|
15
|
-
console.log(this.swiperNextElement);
|
|
16
15
|
return Object.assign({
|
|
17
16
|
observer: true,
|
|
18
17
|
observeParents: true,
|
|
@@ -38,7 +37,7 @@ const ContentCarousel$1 = /*@__PURE__*/ proxyCustomElement(class ContentCarousel
|
|
|
38
37
|
rootMargin: '0px',
|
|
39
38
|
threshold: 0.1,
|
|
40
39
|
};
|
|
41
|
-
let observer = new IntersectionObserver(
|
|
40
|
+
let observer = new IntersectionObserver(entries => {
|
|
42
41
|
entries.forEach(async (entry) => {
|
|
43
42
|
if (entry.isIntersecting && !this.loadStatus.getValue()) {
|
|
44
43
|
await this.initSwiper();
|
|
@@ -60,16 +59,18 @@ const ContentCarousel$1 = /*@__PURE__*/ proxyCustomElement(class ContentCarousel
|
|
|
60
59
|
}
|
|
61
60
|
async initSwiper() {
|
|
62
61
|
let Swiper = await import('./swiper.js');
|
|
62
|
+
let SwiperModules = await import('./index2.js');
|
|
63
63
|
for (const slide of this.swiperWrapper.children) {
|
|
64
64
|
slide.classList.add('swiper-slide');
|
|
65
65
|
}
|
|
66
|
+
console.log(this.swiperOptionsFinal);
|
|
66
67
|
// configure Swiper to use modules
|
|
67
68
|
this.swiperCarousel = new Swiper.Swiper(this.swiper, Object.assign(Object.assign({}, this.swiperOptionsFinal), {
|
|
68
|
-
|
|
69
|
+
modules: [SwiperModules.A11y, SwiperModules.Navigation, SwiperModules.Pagination],
|
|
69
70
|
}));
|
|
70
71
|
}
|
|
71
72
|
render() {
|
|
72
|
-
return (h(Host, null, h("div", { class: "swiper", ref: el => this.swiper = el }, h("div", { class: "swiper-wrapper", ref: el => this.swiperWrapper = el }, h("slot", { name: "content" }), h("slot", null)), h("div", { class: "swiper-pagination", ref: el => this.swiperPagination = el }), h("
|
|
73
|
+
return (h(Host, null, h("div", { class: "swiper", ref: el => (this.swiper = el) }, h("div", { class: "swiper-wrapper", ref: el => (this.swiperWrapper = el) }, h("slot", { name: "content" }), h("slot", null)), h("div", { class: "swiper-pagination", ref: el => (this.swiperPagination = el) }), h("button", { class: "swiper-button-prev", ref: el => (this.swiperPrevElement = el) }), h("button", { class: "swiper-button-next", ref: el => (this.swiperNextElement = el) }), h("div", { class: "swiper-scrollbar", ref: el => (this.swiperScrollbar = el) }))));
|
|
73
74
|
}
|
|
74
75
|
get hostElement() { return this; }
|
|
75
76
|
static get style() { return contentCarouselCss; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"content-carousel.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,20jBAA20jB;;MCez1jBA,iBAAe;;;;QAsB1B,eAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;0BAf7B,MAAM;6BAKX,4EAA4E;;IAY5G,gBAAgB,CAAC,UAAkB;QACjC,OAAO,
|
|
1
|
+
{"file":"content-carousel.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,20jBAA20jB;;MCez1jBA,iBAAe;;;;QAsB1B,eAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;0BAf7B,MAAM;6BAKX,4EAA4E;;IAY5G,gBAAgB,CAAC,UAAkB;QACjC,OAAO,MAAM,CAAC,MAAM,CAClB;YACE,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE;gBACV,EAAE,EAAE,IAAI,CAAC,gBAAgB;aAC1B;YACD,UAAU,EAAE;gBACV,MAAM,EAAE,IAAI,CAAC,iBAA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,eAAe,GAAG,EAAoB,CAAC,GAAQ,CAC1F,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ContentCarousel"],"sources":["src/components/content-carousel/content-carousel.scss?tag=content-carousel","src/components/content-carousel/content-carousel.tsx"],"sourcesContent":["@import \"~swiper/swiper-bundle.min.css\";\ncontent-carousel {\n display: block;\n overflow: hidden;\n}","import { Component, h, Host, Prop, Listen, Element } from '@stencil/core';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nimport { BehaviorSubject } from 'rxjs';\n// import { A11y, Navigation, Pagination } from 'swiper/modules';\n\n/**\n * @slot content - This slot will usually serve a content hero block or image.\n * @slot - Default slot, same as content slot.\n */\nexport type InitMethodType = 'load' | 'event';\n@Component({\n tag: 'content-carousel',\n styleUrl: 'content-carousel.scss',\n shadow: false,\n})\nexport class ContentCarousel {\n @Element() hostElement: HTMLStencilElement;\n /**\n * @type Select\n * @options load\n * @options init\n */\n @Prop() initMethod: InitMethodType = 'load';\n /**\n * @type JSON\n * @schema Swiper Options\n */\n @Prop() swiperOptions: string = '{\"slidesPerView\": 1, \"slidesPerGroup\": 1, \"autoplay\": true, \"loop\": false}';\n public swiperCarousel: any;\n public swiper?: HTMLDivElement;\n public swiperWrapper?: HTMLDivElement;\n public swiperPagination?: HTMLDivElement;\n public swiperPrevElement?: HTMLButtonElement;\n public swiperNextElement?: HTMLButtonElement;\n public swiperScrollbar?: HTMLDivElement;\n public swiperOptionsFinal;\n\n loadStatus: BehaviorSubject<boolean> = new BehaviorSubject(false);\n\n getSwiperOptions(newOptions: string): object {\n return Object.assign(\n {\n observer: true,\n observeParents: true,\n pagination: {\n el: this.swiperPagination,\n },\n navigation: {\n nextEl: this.swiperNextElement,\n prevEl: this.swiperPrevElement,\n },\n scrollbar: {\n el: this.swiperScrollbar,\n },\n },\n newOptions,\n );\n }\n componentDidLoad() {\n if (this.initMethod === 'load') {\n if (this.swiperOptions) {\n this.swiperOptionsFinal = this.getSwiperOptions(JSON.parse((this.swiperOptions as string) || ''));\n }\n\n let options = {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n };\n\n let observer = new IntersectionObserver(entries => {\n entries.forEach(async entry => {\n if (entry.isIntersecting && !this.loadStatus.getValue()) {\n await this.initSwiper();\n this.loadStatus.next(true);\n }\n });\n }, options);\n observer.observe(this.hostElement);\n }\n }\n\n @Listen('setSwiperOptions')\n setSwiperOptionsCallback(event: CustomEvent) {\n this.loadStatus.subscribe(async () => {\n let loaded = this.loadStatus.value;\n if (loaded) {\n this.swiperOptionsFinal = this.getSwiperOptions(event.detail);\n await this.initSwiper();\n }\n });\n }\n\n async initSwiper() {\n let Swiper = await import('swiper');\n let SwiperModules = await import('swiper/modules');\n\n for (const slide of this.swiperWrapper.children as any) {\n slide.classList.add('swiper-slide');\n }\n console.log(this.swiperOptionsFinal);\n // configure Swiper to use modules\n this.swiperCarousel = new Swiper.Swiper(this.swiper, {\n ...this.swiperOptionsFinal,\n ...{\n modules: [SwiperModules.A11y, SwiperModules.Navigation, SwiperModules.Pagination],\n },\n });\n }\n\n render() {\n return (\n <Host>\n <div class=\"swiper\" ref={el => (this.swiper = el as HTMLDivElement)}>\n <div class=\"swiper-wrapper\" ref={el => (this.swiperWrapper = el as HTMLDivElement)}>\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n <div class=\"swiper-pagination\" ref={el => (this.swiperPagination = el as HTMLDivElement)}></div>\n\n <button class=\"swiper-button-prev\" ref={el => (this.swiperPrevElement = el as HTMLButtonElement)}></button>\n <button class=\"swiper-button-next\" ref={el => (this.swiperNextElement = el as HTMLButtonElement)}></button>\n\n <div class=\"swiper-scrollbar\" ref={el => (this.swiperScrollbar = el as HTMLDivElement)}></div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { W as WindowResizeService } from './window-resize-service.js';
|
|
3
3
|
|
|
4
|
-
const contentGridFormatterCss = "*{box-sizing:border-box}content-grid-formatter{width:100%;overflow:auto
|
|
4
|
+
const contentGridFormatterCss = "*{box-sizing:border-box}content-grid-formatter{width:100%;overflow:auto;align-items:var(--align-items, flex-start);justify-content:var(--justify-content);grid-template-columns:repeat(var(--columns), 1fr);column-gap:var(--column-gap, 0);row-gap:var(--row-gap, 0)}content-grid-formatter *{box-sizing:border-box}content-grid-formatter[type=grid]{display:grid}content-grid-formatter[type=flex]{display:flex;flex-wrap:wrap}content-grid-formatter[type=flex]>*{overflow:auto;flex:0 0 auto;width:calc(100% / var(--columns))}content-grid-formatter>[flex-shrink=true]{width:auto;flex-shrink:1}content-grid-formatter[flex-shrink=true]>*{flex-shrink:1}content-grid-formatter[flex-grow=true]>*{flex-grow:1}content-grid-formatter>[flex-grow=true]{width:auto;flex-grow:1}";
|
|
5
5
|
|
|
6
6
|
const ContentGridFormatter = /*@__PURE__*/ proxyCustomElement(class ContentGridFormatter extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -16,6 +16,7 @@ const ContentGridFormatter = /*@__PURE__*/ proxyCustomElement(class ContentGridF
|
|
|
16
16
|
this.horizontal = 'space-between';
|
|
17
17
|
this.columns = '1';
|
|
18
18
|
this.columnGap = '0';
|
|
19
|
+
this.rowGap = '0';
|
|
19
20
|
this.activeClassString = undefined;
|
|
20
21
|
this.inlineStyle = {};
|
|
21
22
|
}
|
|
@@ -40,12 +41,17 @@ const ContentGridFormatter = /*@__PURE__*/ proxyCustomElement(class ContentGridF
|
|
|
40
41
|
this.columnGap = newValue;
|
|
41
42
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--column-gap': newValue });
|
|
42
43
|
}),
|
|
44
|
+
WindowResizeService.registerProp(this.rowGap).subscribe(newValue => {
|
|
45
|
+
this.rowGap = newValue;
|
|
46
|
+
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--row-gap': newValue });
|
|
47
|
+
}),
|
|
43
48
|
WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue)),
|
|
44
49
|
]);
|
|
45
50
|
}
|
|
46
51
|
render() {
|
|
47
52
|
return (h(Host, { class: this.classString, style: this.inlineStyle }, h("slot", null)));
|
|
48
53
|
}
|
|
54
|
+
get hostElement() { return this; }
|
|
49
55
|
static get style() { return contentGridFormatterCss; }
|
|
50
56
|
}, [4, "content-grid-formatter", {
|
|
51
57
|
"classes": [1],
|
|
@@ -56,6 +62,7 @@ const ContentGridFormatter = /*@__PURE__*/ proxyCustomElement(class ContentGridF
|
|
|
56
62
|
"horizontal": [1537],
|
|
57
63
|
"columns": [1537],
|
|
58
64
|
"columnGap": [1537, "column-gap"],
|
|
65
|
+
"rowGap": [1537, "row-gap"],
|
|
59
66
|
"classString": [32],
|
|
60
67
|
"activeClassString": [32],
|
|
61
68
|
"inlineStyle": [32]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"content-grid-formatter2.js","mappings":";;;AAAA,MAAM,uBAAuB,GAAG,
|
|
1
|
+
{"file":"content-grid-formatter2.js","mappings":";;;AAAA,MAAM,uBAAuB,GAAG,svBAAsvB;;MCczwB,oBAAoB;;;;;;oBAmBO,MAAM;wBAUd,OAAO;0BAUL,OAAO;wBAcN,eAAe;0BAeb,eAAe;uBAStB,GAAG;yBAUD,GAAG;sBAUN,GAAG;;2BAIoB,EAAE;;IAEpD,iBAAiB;QACf,OAAO,OAAO,CAAC,UAAU,CAAC;YACxB,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,IAAI,GAAG,QAAsB,CAAC,CAAC;YACvG,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,QAAQ;gBAChE,IAAI,CAAC,QAAQ,GAAG,QAAgC,CAAC;gBACjD,IAAI,CAAC,WAAW,mCACX,IAAI,CAAC,WAAW,KACnB,eAAe,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mB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC,CAAC;SAC9G,CAAC,CAAC;KACJ;IAED,MAAM;QACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,IACpD,eAAQ,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/formatters/content-grid-formatter/content-grid-formatter.scss?tag=content-grid-formatter","src/formatters/content-grid-formatter/content-grid-formatter.tsx"],"sourcesContent":["content-grid-formatter {\n width: 100%;\n overflow: auto;\n align-items: var(--align-items, flex-start);\n justify-content: var(--justify-content);\n grid-template-columns: repeat(var(--columns), 1fr);\n column-gap: var(--column-gap, 0);\n row-gap: var(--row-gap, 0);\n * {\n box-sizing: border-box;\n }\n &[type=\"grid\"] {\n display: grid;\n }\n\n &[type=\"flex\"] {\n display: flex;\n flex-wrap: wrap; \n > * {\n overflow: auto;\n flex: 0 0 auto;\n width: calc(100%/var(--columns));\n }\n }\n > [flex-shrink=\"true\"] {\n width: auto;\n flex-shrink: 1;\n }\n &[flex-shrink=\"true\"] > * {\n flex-shrink: 1;\n }\n &[flex-grow=\"true\"] > * {\n flex-grow: 1;\n }\n > [flex-grow=\"true\"] {\n width: auto;\n flex-grow: 1;\n }\n}","import { Component, h, Host, Prop, State } from '@stencil/core';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { FLEX_JUSTIFY_OPTIONS, GRID_TYPES, ResponsiveBoolean, ResponsiveNumber, ResponsiveString } from '../../typings';\nimport { Element, HTMLStencilElement } from '@stencil/core/internal';\n\n/**\n * @slot media - This slot can either be a video or image component.\n * @slot content - This slot will usually serve a content text block.\n */\n@Component({\n tag: 'content-grid-formatter',\n styleUrl: 'content-grid-formatter.scss',\n shadow: false,\n})\nexport class ContentGridFormatter {\n /**\n * @type String\n * @responsive\n */\n @Prop() classes: ResponsiveString;\n @State() classString;\n /**\n * Flex or grid\n * @type Select\n * @options none\n * @options flex\n * @options grid\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n type: GRID_TYPES | ResponsiveString = 'flex';\n /**\n * Setting this true to will grow all children. Alternatively, add the attribute [flex-grow=\"true\"] to a specific grid child and that child will grow.\n * @type Boolean\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n flexGrow: ResponsiveBoolean = 'false';\n /**\n * Setting this true to will shrink all children. Alternatively, add the attribute [flex-shrink=\"true\"] to a specific grid child and that child will shrink.\n * @type Boolean\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n flexShrink: ResponsiveBoolean = 'false';\n /**\n * Vertical axis alignment\n * @type Select\n * @options flex-start\n * @options space-between\n * @options center\n * @options space-evenly\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n vertical: FLEX_JUSTIFY_OPTIONS = 'space-between';\n\n /**\n * Horizontal axis alignment\n * @type Select\n * @options flex-start\n * @options space-between\n * @options center\n * @options space-evenly\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n horizontal: FLEX_JUSTIFY_OPTIONS = 'space-between';\n /**\n * @type Number\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n columns: ResponsiveNumber = '1';\n\n /**\n * @type Number\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n columnGap: ResponsiveNumber = '0';\n\n /**\n * @type Number\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n rowGap: ResponsiveNumber = '0';\n\n @Element() hostElement: HTMLStencilElement;\n @State() activeClassString: string;\n @State() inlineStyle: { [key: string]: string } = {};\n\n componentWillLoad() {\n return Promise.allSettled([\n WindowResizeService.registerProp(this.type).subscribe(newValue => (this.type = newValue as GRID_TYPES)),\n WindowResizeService.registerProp(this.vertical).subscribe(newValue => {\n this.vertical = newValue as FLEX_JUSTIFY_OPTIONS;\n this.inlineStyle = {\n ...this.inlineStyle,\n '--align-items': this.vertical,\n };\n }),\n WindowResizeService.registerProp(this.horizontal).subscribe(newValue => {\n this.horizontal = newValue as FLEX_JUSTIFY_OPTIONS;\n this.inlineStyle = {\n ...this.inlineStyle,\n '--justify-content': this.horizontal,\n };\n }),\n WindowResizeService.registerProp(this.flexShrink).subscribe(newValue => (this.flexShrink = newValue as string)),\n WindowResizeService.registerProp(this.flexGrow).subscribe(newValue => (this.flexGrow = newValue as string)),\n WindowResizeService.registerProp(this.columns).subscribe(newValue => {\n this.columns = newValue as string;\n this.inlineStyle = {\n ...this.inlineStyle,\n '--columns': newValue as string,\n };\n }),\n WindowResizeService.registerProp(this.columnGap).subscribe(newValue => {\n this.columnGap = newValue as string;\n this.inlineStyle = {\n ...this.inlineStyle,\n '--column-gap': newValue as string,\n };\n }),\n WindowResizeService.registerProp(this.rowGap).subscribe(newValue => {\n this.rowGap = newValue as string;\n this.inlineStyle = {\n ...this.inlineStyle,\n '--row-gap': newValue as string,\n };\n }),\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue as string)),\n ]);\n }\n\n render() {\n return (\n <Host class={this.classString} style={this.inlineStyle}>\n <slot />\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -35,7 +35,7 @@ const ContentHeroBlock$1 = /*@__PURE__*/ proxyCustomElement(class ContentHeroBlo
|
|
|
35
35
|
"hasBackground": [32],
|
|
36
36
|
"classString": [32],
|
|
37
37
|
"revealHiddenContent": [32]
|
|
38
|
-
}, [[8, "
|
|
38
|
+
}, [[8, "open", "contentBlockActivationHandler"]]]);
|
|
39
39
|
function defineCustomElement$1() {
|
|
40
40
|
if (typeof customElements === "undefined") {
|
|
41
41
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"content-hero-block.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,ksCAAksC;;MCgBjtCA,kBAAgB;;;;6BAEO,KAAK;+BAY2B,aAAa;;;mCAQvC,KAAK;;IAG7C,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;QAC7E,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;QACtF,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,eAAe,GAAG,QAAkB,CAAC,CAAC,CAAC;QAC1H,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC,CAAC,CAAC;KAC/G;IAGD,6BAA6B,CAAC,KAA+B;QAC3D,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,MAAM,EAAE;YACrC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;SACpD;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,IAC1B,IAAI,CAAC,aAAa,KACjB,WAAK,KAAK,EAAC,gCAAgC,IACzC,YAAM,IAAI,EAAC,YAAY,GAAQ,CAC3B,CACP,EACD,WAAK,KAAK,EAAC,6BAA6B,IACtC,YAAM,IAAI,EAAC,SAAS,GAAQ,EAC5B,eAAa,CACT,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ContentHeroBlock"],"sources":["src/blocks/content-hero-block/content-hero-block.scss?tag=content-hero-block","src/blocks/content-hero-block/content-hero-block.tsx"],"sourcesContent":["content-hero-block {\n position: relative;\n &[content-position=\"above\"] {\n display: grid;\n grid-template-columns: 1fr;\n .content-hero-block__background,\n .content-hero-block__content {\n grid-row-start: 1;\n grid-column-start: 1;\n }\n .content-hero-block__background {\n height: 100%;\n overflow: hidden;\n\n content-image,\n content-image picture,\n content-image img,\n content-image video {\n height: 100%;\n }\n }\n .content-hero-block__content {\n display: flex;\n // position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n grid-row-start: 1;\n grid-column-start: 1;\n \n > * {\n // display: block;\n width: 100%;\n }\n \n }\n .content-hero-block__content {\n position: relative;\n z-index: 1;\n }\n }\n &[content-position=\"below\"] {\n display: block;\n }\n}","import { Component, h, Host, Prop } from '@stencil/core';\nimport { Element, HTMLStencilElement, Listen, State } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveString } from '../../typings';\nimport { getHydratedClassString } from '../../utils/utils';\nexport type HeroContentPlacementOptions = 'above' | 'below';\n/**\n * @slot background - This slot is usually either a video or image component.\n * @slot content - This slot will usually serve a text block.\n * @slot - Default slot, same as content slot\n */\n@Component({\n tag: 'content-hero-block',\n styleUrl: 'content-hero-block.scss',\n shadow: false,\n})\nexport class ContentHeroBlock {\n @Element() hostElement: HTMLStencilElement;\n @State() hasBackground: boolean = false;\n /**\n * Pipe separated HeroContentPlacementOptions that will determine whether the content sits below the media slot or overlapped above.\n * @type Select\n * @options below\n * @options above\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n contentPosition: ResponsiveString | HeroContentPlacementOptions = 'below|above';\n\n /**\n * @type String\n * @responsive\n */\n @Prop() classes: ResponsiveString;\n @State() classString;\n @State() revealHiddenContent: boolean = false;\n hasHiddenContent: boolean;\n\n componentWillLoad() {\n this.hasBackground = !!this.hostElement.querySelector('[slot=\"background\"]');\n this.hasHiddenContent = !!this.hostElement.querySelector('[slot=\"activatedContent\"]');\n WindowResizeService.registerProp(this.contentPosition).subscribe(newValue => (this.contentPosition = newValue as string));\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue as string));\n }\n\n @Listen('
|
|
1
|
+
{"file":"content-hero-block.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,ksCAAksC;;MCgBjtCA,kBAAgB;;;;6BAEO,KAAK;+BAY2B,aAAa;;;mCAQvC,KAAK;;IAG7C,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;QAC7E,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;QACtF,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,eAAe,GAAG,QAAkB,CAAC,CAAC,CAAC;QAC1H,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC,CAAC,CAAC;KAC/G;IAGD,6BAA6B,CAAC,KAA+B;QAC3D,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,MAAM,EAAE;YACrC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;SACpD;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,IAC1B,IAAI,CAAC,aAAa,KACjB,WAAK,KAAK,EAAC,gCAAgC,IACzC,YAAM,IAAI,EAAC,YAAY,GAAQ,CAC3B,CACP,EACD,WAAK,KAAK,EAAC,6BAA6B,IACtC,YAAM,IAAI,EAAC,SAAS,GAAQ,EAC5B,eAAa,CACT,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ContentHeroBlock"],"sources":["src/blocks/content-hero-block/content-hero-block.scss?tag=content-hero-block","src/blocks/content-hero-block/content-hero-block.tsx"],"sourcesContent":["content-hero-block {\n position: relative;\n &[content-position=\"above\"] {\n display: grid;\n grid-template-columns: 1fr;\n .content-hero-block__background,\n .content-hero-block__content {\n grid-row-start: 1;\n grid-column-start: 1;\n }\n .content-hero-block__background {\n height: 100%;\n overflow: hidden;\n\n content-image,\n content-image picture,\n content-image img,\n content-image video {\n height: 100%;\n }\n }\n .content-hero-block__content {\n display: flex;\n // position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n grid-row-start: 1;\n grid-column-start: 1;\n \n > * {\n // display: block;\n width: 100%;\n }\n \n }\n .content-hero-block__content {\n position: relative;\n z-index: 1;\n }\n }\n &[content-position=\"below\"] {\n display: block;\n }\n}","import { Component, h, Host, Prop } from '@stencil/core';\nimport { Element, HTMLStencilElement, Listen, State } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveString } from '../../typings';\nimport { getHydratedClassString } from '../../utils/utils';\nexport type HeroContentPlacementOptions = 'above' | 'below';\n/**\n * @slot background - This slot is usually either a video or image component.\n * @slot content - This slot will usually serve a text block.\n * @slot - Default slot, same as content slot\n */\n@Component({\n tag: 'content-hero-block',\n styleUrl: 'content-hero-block.scss',\n shadow: false,\n})\nexport class ContentHeroBlock {\n @Element() hostElement: HTMLStencilElement;\n @State() hasBackground: boolean = false;\n /**\n * Pipe separated HeroContentPlacementOptions that will determine whether the content sits below the media slot or overlapped above.\n * @type Select\n * @options below\n * @options above\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n contentPosition: ResponsiveString | HeroContentPlacementOptions = 'below|above';\n\n /**\n * @type String\n * @responsive\n */\n @Prop() classes: ResponsiveString;\n @State() classString;\n @State() revealHiddenContent: boolean = false;\n hasHiddenContent: boolean;\n\n componentWillLoad() {\n this.hasBackground = !!this.hostElement.querySelector('[slot=\"background\"]');\n this.hasHiddenContent = !!this.hostElement.querySelector('[slot=\"activatedContent\"]');\n WindowResizeService.registerProp(this.contentPosition).subscribe(newValue => (this.contentPosition = newValue as string));\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue as string));\n }\n\n @Listen('open', { target: 'window' })\n contentBlockActivationHandler(event: CustomEvent<HTMLElement>) {\n if (this.hostElement === event.detail) {\n this.hostElement.setAttribute('activated', 'true');\n }\n }\n\n render() {\n return (\n <Host class={this.classString}>\n {this.hasBackground && (\n <div class=\"content-hero-block__background\">\n <slot name=\"background\"></slot>\n </div>\n )}\n <div class=\"content-hero-block__content\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -64,9 +64,9 @@ const ContentImage$1 = /*@__PURE__*/ proxyCustomElement(class ContentImage exten
|
|
|
64
64
|
});
|
|
65
65
|
}, {
|
|
66
66
|
root: null,
|
|
67
|
-
|
|
68
|
-
rootMargin: `0px`,
|
|
69
|
-
threshold: 0
|
|
67
|
+
rootMargin: `${Math.max(100, window.innerHeight * 1)}px`,
|
|
68
|
+
// rootMargin: `0px`,
|
|
69
|
+
threshold: 0,
|
|
70
70
|
});
|
|
71
71
|
observer.observe(this.hostElement);
|
|
72
72
|
}
|
|
@@ -84,7 +84,7 @@ const ContentImage$1 = /*@__PURE__*/ proxyCustomElement(class ContentImage exten
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (h("div", { class: "content-image__media-content" }, h("slot", { name: "mediaContent" }))), this.showVideoAsGif
|
|
87
|
+
return (h(Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (h("div", { class: "content-image__media-content" }, h("slot", { name: "mediaContent" }))), this.showVideoAsGif && (h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, h("source", { src: this.lazyLoadIsComplete ? this.pictureImageSrc : null, type: this.videoType }))), this.pictureImageSrc && !this.showVideoAsGif && h("img", { width: this.width, height: this.height, src: this.pictureImageSrc, alt: this.alt })));
|
|
88
88
|
}
|
|
89
89
|
get hostElement() { return this; }
|
|
90
90
|
static get watchers() { return {
|