@zanichelli/albe-web-components 16.4.0-rc-2 → 16.4.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/CHANGELOG.md +9 -0
- package/dist/cjs/{index-1bcf6013.js → index-22bdf239.js} +2 -2
- package/dist/cjs/index-22bdf239.js.map +1 -0
- package/dist/cjs/{index-59c3bcbe.js → index-6726b7d2.js} +2 -2
- package/dist/cjs/{index-59c3bcbe.js.map → index-6726b7d2.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +14 -3
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/z-table.cjs.entry.js +2 -2
- package/dist/cjs/z-th.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +2 -2
- package/dist/collection/beans/index.js.map +1 -1
- package/dist/collection/components/css-components/z-fab/index.stories.js.map +1 -1
- package/dist/collection/components/css-components/z-link/index.stories.js.map +1 -1
- package/dist/collection/components/date-picker/utils.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js.map +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.stories.js.map +1 -1
- package/dist/collection/components/index.js.map +1 -1
- package/dist/collection/components/list/z-list/index.js.map +1 -1
- package/dist/collection/components/list/z-list/index.stories.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.stories.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.stories.js.map +1 -1
- package/dist/collection/components/table/cells/z-td/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-th/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-th/styles.css +1 -1
- package/dist/collection/components/table/z-table/index.js.map +1 -1
- package/dist/collection/components/table/z-table/index.stories.js.map +1 -1
- package/dist/collection/components/table/z-tbody/index.js.map +1 -1
- package/dist/collection/components/table/z-tfoot/index.js.map +1 -1
- package/dist/collection/components/table/z-thead/index.js.map +1 -1
- package/dist/collection/components/table/z-tr/index.js.map +1 -1
- package/dist/collection/components/z-accordion/index.js.map +1 -1
- package/dist/collection/components/z-accordion/index.stories.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.stories.js.map +1 -1
- package/dist/collection/components/z-app-header/index.js.map +1 -1
- package/dist/collection/components/z-app-header/index.stories.js.map +1 -1
- package/dist/collection/components/z-aria-alert/index.js.map +1 -1
- package/dist/collection/components/z-aria-alert/index.stories.js.map +1 -1
- package/dist/collection/components/z-avatar/index.js.map +1 -1
- package/dist/collection/components/z-avatar/index.stories.js.map +1 -1
- package/dist/collection/components/z-book-card/index.js.map +1 -1
- package/dist/collection/components/z-book-card/index.stories.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.stories.js.map +1 -1
- package/dist/collection/components/z-button/index.js.map +1 -1
- package/dist/collection/components/z-button/index.stories.js.map +1 -1
- package/dist/collection/components/z-button-sort/index.js.map +1 -1
- package/dist/collection/components/z-button-sort/index.stories.js.map +1 -1
- package/dist/collection/components/z-card/index.js.map +1 -1
- package/dist/collection/components/z-card/index.stories.js.map +1 -1
- package/dist/collection/components/z-carousel/index.js.map +1 -1
- package/dist/collection/components/z-carousel/index.stories.js.map +1 -1
- package/dist/collection/components/z-chip/index.js.map +1 -1
- package/dist/collection/components/z-chip/index.stories.js.map +1 -1
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/index.stories.js.map +1 -1
- package/dist/collection/components/z-cover-hero/index.js.map +1 -1
- package/dist/collection/components/z-cover-hero/index.stories.js.map +1 -1
- package/dist/collection/components/z-divider/index.js.map +1 -1
- package/dist/collection/components/z-divider/index.stories.js.map +1 -1
- package/dist/collection/components/z-ghost-loading/index.js.map +1 -1
- package/dist/collection/components/z-ghost-loading/index.stories.js.map +1 -1
- package/dist/collection/components/z-icon/index.js.map +1 -1
- package/dist/collection/components/z-icon/index.stories.js.map +1 -1
- package/dist/collection/components/z-info-box/index.js.map +1 -1
- package/dist/collection/components/z-info-box/index.stories.js.map +1 -1
- package/dist/collection/components/z-info-reveal/index.js.map +1 -1
- package/dist/collection/components/z-info-reveal/index.stories.js.map +1 -1
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/collection/components/z-input/index.stories.js.map +1 -1
- package/dist/collection/components/z-input-message/index.js.map +1 -1
- package/dist/collection/components/z-input-message/index.stories.js.map +1 -1
- package/dist/collection/components/z-logo/index.js.map +1 -1
- package/dist/collection/components/z-logo/index.stories.js.map +1 -1
- package/dist/collection/components/z-menu/index.js.map +1 -1
- package/dist/collection/components/z-menu/index.stories.js.map +1 -1
- package/dist/collection/components/z-menu/styles.css +1 -0
- package/dist/collection/components/z-menu-section/index.js.map +1 -1
- package/dist/collection/components/z-menu-section/index.stories.js.map +1 -1
- package/dist/collection/components/z-modal/index.js.map +1 -1
- package/dist/collection/components/z-modal/index.stories.js.map +1 -1
- package/dist/collection/components/z-navigation-tabs/index.js.map +1 -1
- package/dist/collection/components/z-navigation-tabs/index.stories.js.map +1 -1
- package/dist/collection/components/z-notification/index.js.map +1 -1
- package/dist/collection/components/z-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.js +27 -3
- package/dist/collection/components/z-offcanvas/index.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.stories.js +12 -46
- package/dist/collection/components/z-offcanvas/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/styles.css +10 -15
- package/dist/collection/components/z-pagination/index.js.map +1 -1
- package/dist/collection/components/z-pagination/index.stories.js.map +1 -1
- package/dist/collection/components/z-panel-elem/index.js.map +1 -1
- package/dist/collection/components/z-panel-elem/index.stories.js.map +1 -1
- package/dist/collection/components/z-popover/index.js.map +1 -1
- package/dist/collection/components/z-popover/index.stories.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.stories.js.map +1 -1
- package/dist/collection/components/z-section-title/index.js.map +1 -1
- package/dist/collection/components/z-section-title/index.stories.js.map +1 -1
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-select/index.stories.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.stories.js.map +1 -1
- package/dist/collection/components/z-stepper/index.js.map +1 -1
- package/dist/collection/components/z-stepper/index.stories.js.map +1 -1
- package/dist/collection/components/z-stepper-item/index.js.map +1 -1
- package/dist/collection/components/z-stepper-item/index.stories.js.map +1 -1
- package/dist/collection/components/z-tag/index.js.map +1 -1
- package/dist/collection/components/z-tag/index.stories.js.map +1 -1
- package/dist/collection/components/z-toast-notification/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-toast-notification-list/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification-list/index.stories.js.map +1 -1
- package/dist/collection/components/z-toggle-button/index.js.map +1 -1
- package/dist/collection/components/z-toggle-button/index.stories.js.map +1 -1
- package/dist/collection/components/z-toggle-switch/index.js.map +1 -1
- package/dist/collection/components/z-toggle-switch/index.stories.js.map +1 -1
- package/dist/collection/components/z-tooltip/index.js.map +1 -1
- package/dist/collection/components/z-tooltip/index.stories.js.map +1 -1
- package/dist/collection/components/z-visually-hidden/index.js.map +1 -1
- package/dist/collection/components/z-visually-hidden/index.stories.js.map +1 -1
- package/dist/collection/constants/breakpoints.js.map +1 -1
- package/dist/collection/constants/icons.js.map +1 -1
- package/dist/collection/constants/iconset.js +2 -0
- package/dist/collection/constants/iconset.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-slideshow/index.js.map +1 -1
- package/dist/collection/utils/storybook-utils.js.map +1 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/iconset.js +2 -0
- package/dist/components/iconset.js.map +1 -1
- package/dist/components/index21.js +13 -4
- package/dist/components/index21.js.map +1 -1
- package/dist/components/z-menu.js +1 -1
- package/dist/components/z-menu.js.map +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-th.js.map +1 -1
- package/dist/docs/grid/index.stories.js +54 -0
- package/dist/docs/grid/index.stories.js.map +1 -0
- package/dist/docs/iconset/index.stories.js +32 -0
- package/dist/docs/iconset/index.stories.js.map +1 -0
- package/dist/docs/themes/index.stories.js +90 -0
- package/dist/docs/themes/index.stories.js.map +1 -0
- package/dist/docs/typography/index.stories.js +186 -0
- package/dist/docs/typography/index.stories.js.map +1 -0
- package/dist/esm/{index-fcf764b5.js → index-681cc2b7.js} +2 -2
- package/dist/esm/index-681cc2b7.js.map +1 -0
- package/dist/esm/{index-2b5c2515.js → index-7b64c875.js} +2 -2
- package/dist/esm/{index-2b5c2515.js.map → index-7b64c875.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +14 -3
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-menu.entry.js.map +1 -1
- package/dist/esm/z-table.entry.js +2 -2
- package/dist/esm/z-th.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/types/components/z-offcanvas/index.d.ts +5 -0
- package/dist/types/components/z-offcanvas/index.stories.d.ts +4 -6
- package/dist/types/components.d.ts +2 -2
- package/dist/types/constants/iconset.d.ts +4 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/grid/index.stories.d.ts +9 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/iconset/index.stories.d.ts +11 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/themes/index.stories.d.ts +27 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/typography/index.stories.d.ts +96 -0
- package/dist/web-components-library/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
- package/dist/web-components-library/{p-cce46031.js → p-13366542.js} +2 -2
- package/dist/web-components-library/p-456f984f.js +2 -0
- package/dist/web-components-library/p-456f984f.js.map +1 -0
- package/dist/web-components-library/p-477f4446.entry.js +2 -0
- package/dist/web-components-library/p-477f4446.entry.js.map +1 -0
- package/dist/web-components-library/p-6b791915.entry.js +2 -0
- package/dist/web-components-library/p-8d443cac.entry.js +2 -0
- package/dist/web-components-library/p-ceb4403d.entry.js +2 -0
- package/dist/web-components-library/p-ceb4403d.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.css +529 -28
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
- package/www/build/{p-cce46031.js → p-13366542.js} +2 -2
- package/www/build/p-456f984f.js +2 -0
- package/www/build/p-456f984f.js.map +1 -0
- package/www/build/p-477f4446.entry.js +2 -0
- package/www/build/p-477f4446.entry.js.map +1 -0
- package/www/build/p-6b791915.entry.js +2 -0
- package/www/build/p-8d443cac.entry.js +2 -0
- package/www/build/p-bb21356b.js +2 -0
- package/www/build/p-ceb4403d.entry.js +2 -0
- package/www/build/p-ceb4403d.entry.js.map +1 -0
- package/www/build/{p-ae0a33a2.css → p-d9dbe303.css} +529 -28
- package/www/build/web-components-library.css +529 -28
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/index-1bcf6013.js.map +0 -1
- package/dist/esm/index-fcf764b5.js.map +0 -1
- package/dist/web-components-library/p-0c813477.entry.js +0 -2
- package/dist/web-components-library/p-0c813477.entry.js.map +0 -1
- package/dist/web-components-library/p-47bf778e.js +0 -2
- package/dist/web-components-library/p-47bf778e.js.map +0 -1
- package/dist/web-components-library/p-67896876.entry.js +0 -2
- package/dist/web-components-library/p-822a2097.entry.js +0 -2
- package/dist/web-components-library/p-b72a4b5e.entry.js +0 -2
- package/dist/web-components-library/p-b72a4b5e.entry.js.map +0 -1
- package/www/build/p-0c813477.entry.js +0 -2
- package/www/build/p-0c813477.entry.js.map +0 -1
- package/www/build/p-47bf778e.js +0 -2
- package/www/build/p-47bf778e.js.map +0 -1
- package/www/build/p-67896876.entry.js +0 -2
- package/www/build/p-822a2097.entry.js +0 -2
- package/www/build/p-88640e60.js +0 -2
- package/www/build/p-b72a4b5e.entry.js +0 -2
- package/www/build/p-b72a4b5e.entry.js.map +0 -1
- /package/dist/web-components-library/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cce46031.js.map → p-13366542.js.map} +0 -0
- /package/dist/web-components-library/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
- /package/www/build/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
- /package/www/build/{p-cce46031.js.map → p-13366542.js.map} +0 -0
- /package/www/build/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
- /package/www/build/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-tfoot/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEvD;;;GAGG;AAMH,MAAM,OAAO,MAAM;;sBAKR,KAAK;;IAEd,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU;YACnB,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, Prop, h} from \"@stencil/core\";\n\n/**\n * ZTFoot component.\n * @slot - ZTFoot content (`z-tr`).\n */\n@Component({\n tag: \"z-tfoot\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTfoot {\n /**\n * If true, the footer will be stuck to the bottom of the table.\n */\n @Prop({reflect: true})\n sticky = false;\n\n render(): void {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-thead/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEvD;;;GAGG;AAMH,MAAM,OAAO,MAAM;;sBAKR,KAAK;;IAEd,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU;YACnB,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, Prop, h} from \"@stencil/core\";\n\n/**\n * ZThead component.\n * @slot - ZThead content (`z-tr`).\n */\n@Component({\n tag: \"z-thead\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZThead {\n /**\n * If true, the header will be stuck to the top of the table.\n */\n @Prop({reflect: true})\n sticky = false;\n\n render(): HTMLZTheadElement {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-tr/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,qBAAqB,CAAC;AAE7B;;;;;GAKG;AAMH,MAAM,OAAO,GAAG;;0BAaD,KAAK;wBAMP,KAAK;;;IAeN,aAAa;QACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAkC,YAAY,CAAC,CAAC,CAAC;QACpG,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,KAAK,CAAC,GAAG,EAAE,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,iBAAiB,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YACtC,iBAAiB,CAAC,EAAE,GAAG,iBAAiB,CAAC,EAAE,IAAI,2BAA2B,QAAQ,EAAE,EAAE,CAAC;YACvF,IAAI,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,EAAE,CAAC;QAClD,CAAC;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prop, State, Watch, h} from \"@stencil/core\";\nimport {randomId} from \"../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTr {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n if (this.expandable) {\n cells.pop();\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n onClick={this.onRowClick.bind(this)}\n expanded={this.expanded}\n >\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-accordion/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AAMH,MAAM,OAAO,UAAU;;;;oBAiBd,WAAW,CAAC,GAAG;0BAMT,KAAK;oBAMX,KAAK;yBAMA,KAAK;uBAMW,gBAAgB,CAAC,OAAO;sBAM3C,IAAI;;IASH,gBAAgB;QACxB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;IAID;;;;OAIG;IACK,eAAe;QACrB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC;YAE7B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,OAAO,CA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lSize} from \"../../beans\";\n\n/**\n * Accordion component.\n *\n * @slot - Slot for the main content.\n * @slot tag - Slot for tags.\n * @cssprop --z-accordion-highlight-color - Color of the highlight band on the summary's left edge. Only applies when `highlight` is true. Default: `transparent`.\n * @cssprop --z-accordion-bg - Background color of the summary. Default: `--color-surface02`.\n * @cssprop --z-accordion-label-color - Label color. Default: `--color-default-text`.\n * @cssprop --z-accordion-disabled-label-color - Label color when disabled. Default: `--color-text03`.\n * @cssprop --z-accordion-content-bg - Background color of the accordion. Default: `--color-surface02`.\n * @cssprop --z-accordion-content-fg - Content text color. Default: `--color-default-text`.\n * @cssprop --z-accordion-hover-color - Hover color of the summary. Default: `--color-surface03`.\n * @cssprop --z-accordion-left-padding - Left padding of the summary. Default: `--space-unit` * 2.\n * @cssprop --z-accordion-right-padding - Right padding of the summary. Default: `--space-unit`.\n * @cssprop --z-accordion-label-font-weight - Font weight of the summary label. Default: `--font-sb`.\n */\n@Component({\n tag: \"z-accordion\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAccordion {\n /**\n * Text label.\n */\n @Prop()\n label: string;\n\n /**\n * Name of the z-icon to display before the label's text.\n */\n @Prop()\n icon: string;\n\n /**\n * Size of the component.\n */\n @Prop({reflect: true})\n size = ControlSize.BIG;\n\n /**\n * Disabled state of the accordion.\n */\n @Prop({reflect: true})\n isDisabled = false;\n\n /**\n * The open state of the accordion.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Enable highlight band on the `summary`'s left edge.\n */\n @Prop({reflect: true})\n highlight = false;\n\n /**\n * Accordion variant.\n */\n @Prop({reflect: true})\n variant: AccordionVariant = AccordionVariant.DEFAULT;\n\n /**\n * Enable box-shadow on the accordion. Only applies when `variant` is `BACKGROUND`.\n */\n @Prop({reflect: true})\n shadow = true;\n\n /**\n * Event fired when the accordion is toggled.\n */\n @Event()\n toggled: EventEmitter<boolean>;\n\n @Watch(\"isDisabled\")\n protected onDisabledChange(): void {\n if (this.isDisabled) {\n this.open = false;\n }\n }\n\n private detailsElm: HTMLDetailsElement;\n\n /**\n * Handle `details` element toggle.\n * If currently disabled, prevent toggling by forcing the `open` state to `false`.\n * Unfortunately the \"toggle\" event is not cancelable and when catched, the `open` state is already changed.\n */\n private onDetailsToggle(): void {\n if (this.isDisabled) {\n this.open = false;\n this.detailsElm.open = false;\n\n return;\n }\n\n this.open = this.detailsElm.open;\n this.toggled.emit(this.open);\n }\n\n render(): HTMLDetailsElement {\n return (\n <details\n ref={(elm: HTMLDetailsElement) => (this.detailsElm = elm)}\n onToggle={this.onDetailsToggle.bind(this)}\n open={this.open}\n >\n <summary\n tabIndex={this.isDisabled ? -1 : null}\n part=\"summary\"\n >\n {this.icon && (\n <z-icon\n class=\"z-accordion-label-icon\"\n name={this.icon}\n />\n )}\n <span class=\"z-accordion-label\">{this.label}</span>\n <span class=\"z-accordion-tags\">\n <slot name=\"tag\" />\n </span>\n <z-icon\n class=\"z-accordion-chevron\"\n name={this.open ? \"chevron-up\" : \"chevron-down\"}\n />\n </summary>\n {!this.isDisabled && (\n <div\n class=\"z-accordion-content\"\n part=\"content\"\n >\n <slot />\n </div>\n )}\n </details>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../src/components/z-accordion/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAmB,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AAEjB,MAAM,YAAY,GAAG;IACnB,kBAAkB,EAAE,sBAAsB,CAAC,IAA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kB,CAAC;QAC5C,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,oCAAoC,EAAE,IAAI,CAAC,oCAAoC,CAAC;QAChF,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC;QAClE,4BAA4B,EAAE,IAAI,CAAC,4BAA4B,CAAC;QAChE,iCAAiC,EAAE,IAAI,CAAC,iCAAiC,CAAC;KAC3E,CAAC;;;;;;;;;;;GAWL;CACc,CAAC","sourcesContent":["import {Args, Meta, StoryObj} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {styleMap} from \"lit/directives/style-map.js\";\nimport {type ZAccordion} from \".\";\nimport {AccordionVariant, ControlSize} from \"../../beans\";\nimport {ICONS} from \"../../constants/iconset\";\nimport {CSSVarsArguments, getColorTokenArgConfig} from \"../../utils/storybook-utils\";\nimport \"../z-tag/index\";\nimport \"./index\";\n\nconst cssPropsArgs = {\n \"--z-accordion-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-label-color\": getColorTokenArgConfig(true),\n \"--z-accordion-disabled-label-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"isDisabled\",\n truthy: true,\n },\n },\n \"--z-accordion-content-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-content-fg\": getColorTokenArgConfig(true),\n \"--z-accordion-hover-color\": getColorTokenArgConfig(true),\n \"--z-accordion-highlight-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"highlight\",\n truthy: true,\n },\n },\n} as const;\n\ntype ZAccordionStoriesArgs = ZAccordion &\n CSSVarsArguments<\n | keyof typeof cssPropsArgs\n | `z-accordion-${\"left\" | \"right\"}-padding`\n | \"z-accordion-label-font-weight\"\n | `z-accordion-highlight-color${number | undefined}`\n >;\n\n/**\n * To add the highlight band on the left, set the `highlight` property to `true` then set the `--z-accordion-highlight-color` CSS variable to the desired color.\n */\nconst StoryMeta = {\n title: \"ZAccordion\",\n component: \"z-accordion\",\n argTypes: {\n ...cssPropsArgs,\n icon: {\n options: [null, ...Object.keys(ICONS).sort()],\n control: {\n type: \"select\",\n labels: {\n null: \"—\",\n },\n },\n },\n shadow: {\n if: {\n arg: \"variant\",\n eq: AccordionVariant.BACKGROUND,\n },\n },\n size: {\n options: Object.values(ControlSize),\n control: {\n type: \"inline-radio\",\n },\n },\n variant: {\n options: Object.values(AccordionVariant),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n \"--z-accordion-bg\": null,\n \"--z-accordion-label-color\": null,\n \"--z-accordion-disabled-label-color\": null,\n \"--z-accordion-content-bg\": null,\n \"--z-accordion-content-fg\": null,\n \"--z-accordion-hover-color\": null,\n \"--z-accordion-highlight-color\": null,\n \"--z-accordion-right-padding\": \"var(--space-unit)\",\n \"--z-accordion-left-padding\": \"calc(var(--space-unit) * 2)\",\n \"--z-accordion-label-font-weight\": \"var(--font-sb)\",\n \"highlight\": false,\n \"icon\": null,\n \"isDisabled\": false,\n \"label\": \"Text label\",\n \"open\": false,\n \"shadow\": true,\n \"size\": ControlSize.BIG,\n \"variant\": AccordionVariant.DEFAULT,\n },\n render: (args: Args): TemplateResult =>\n html`<z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>`,\n} satisfies Meta<ZAccordionStoriesArgs>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZAccordionStoriesArgs>;\n\nexport const Default = {};\n\n/**\n * When multiple `ZAccordion`s are placed in stack, the style is automatically optimized through global styles.\n */\nexport const Stack = {\n argTypes: {\n \"--z-accordion-highlight-color2\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color3\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color4\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n },\n args: {\n \"--z-accordion-highlight-color2\": null,\n \"--z-accordion-highlight-color3\": null,\n \"--z-accordion-highlight-color4\": null,\n },\n parameters: {\n controls: {\n exclude: [\"open\"],\n },\n },\n render: (args) =>\n html`${[\n StoryMeta.render(args),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color2\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color3\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color4\"],\n }),\n ]}`,\n} satisfies Story;\n\nexport const WithTags = {\n render: (args) => html`\n <z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n <z-tag slot=\"tag\">Tag 1</z-tag>\n <z-tag slot=\"tag\">Tag 2</z-tag>\n <z-tag slot=\"tag\">Tag 3</z-tag>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>\n `,\n} satisfies Story;\n"]}
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/z-accordion/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,gBAAgB,EAAE,W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,IAAI;oBACH,IAAI,CAAC,UAAU;cACrB,IAAI,CAAC,IAAI;gBACP,IAAI,CAAC,MAAM;cACb,IAAI,CAAC,KAAK;aACX,IAAI,CAAC,IAAI;gBACN,IAAI,CAAC,OAAO;cACd,QAAQ,CAAC;QACf,+BAA+B,EAAE,IAAI,CAAC,+BAA+B,CAAC;QACtE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC;QAC5C,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,oCAAoC,EAAE,IAAI,CAAC,oCAAoC,CAAC;QAChF,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC;QAClE,4BAA4B,EAAE,IAAI,CAAC,4BAA4B,CAAC;QAChE,iCAAiC,EAAE,IAAI,CAAC,iCAAiC,CAAC;KAC3E,CAAC;;;;;;;;;;;GAWL;CACc,CAAC","sourcesContent":["import {Args, Meta, StoryObj} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {styleMap} from \"lit/directives/style-map.js\";\nimport {type ZAccordion} from \".\";\nimport {AccordionVariant, ControlSize} from \"../../beans\";\nimport {ICONS} from \"../../constants/iconset\";\nimport {CSSVarsArguments, getColorTokenArgConfig} from \"../../utils/storybook-utils\";\nimport \"../z-tag/index\";\nimport \"./index\";\n\nconst cssPropsArgs = {\n \"--z-accordion-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-label-color\": getColorTokenArgConfig(true),\n \"--z-accordion-disabled-label-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"isDisabled\",\n truthy: true,\n },\n },\n \"--z-accordion-content-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-content-fg\": getColorTokenArgConfig(true),\n \"--z-accordion-hover-color\": getColorTokenArgConfig(true),\n \"--z-accordion-highlight-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"highlight\",\n truthy: true,\n },\n },\n} as const;\n\ntype ZAccordionStoriesArgs = ZAccordion &\n CSSVarsArguments<\n | keyof typeof cssPropsArgs\n | `z-accordion-${\"left\" | \"right\"}-padding`\n | \"z-accordion-label-font-weight\"\n | `z-accordion-highlight-color${number | undefined}`\n >;\n\n/**\n * To add the highlight band on the left, set the `highlight` property to `true` then set the `--z-accordion-highlight-color` CSS variable to the desired color.\n */\nconst StoryMeta = {\n title: \"ZAccordion\",\n component: \"z-accordion\",\n argTypes: {\n ...cssPropsArgs,\n icon: {\n options: [null, ...Object.keys(ICONS).sort()],\n control: {\n type: \"select\",\n labels: {\n null: \"—\",\n },\n },\n },\n shadow: {\n if: {\n arg: \"variant\",\n eq: AccordionVariant.BACKGROUND,\n },\n },\n size: {\n options: Object.values(ControlSize),\n control: {\n type: \"inline-radio\",\n },\n },\n variant: {\n options: Object.values(AccordionVariant),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n \"--z-accordion-bg\": null,\n \"--z-accordion-label-color\": null,\n \"--z-accordion-disabled-label-color\": null,\n \"--z-accordion-content-bg\": null,\n \"--z-accordion-content-fg\": null,\n \"--z-accordion-hover-color\": null,\n \"--z-accordion-highlight-color\": null,\n \"--z-accordion-right-padding\": \"var(--space-unit)\",\n \"--z-accordion-left-padding\": \"calc(var(--space-unit) * 2)\",\n \"--z-accordion-label-font-weight\": \"var(--font-sb)\",\n \"highlight\": false,\n \"icon\": null,\n \"isDisabled\": false,\n \"label\": \"Text label\",\n \"open\": false,\n \"shadow\": true,\n \"size\": ControlSize.BIG,\n \"variant\": AccordionVariant.DEFAULT,\n },\n render: (args: Args): TemplateResult =>\n html`<z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>`,\n} satisfies Meta<ZAccordionStoriesArgs>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZAccordionStoriesArgs>;\n\nexport const Default = {};\n\n/**\n * When multiple `ZAccordion`s are placed in stack, the style is automatically optimized through global styles.\n */\nexport const Stack = {\n argTypes: {\n \"--z-accordion-highlight-color2\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color3\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color4\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n },\n args: {\n \"--z-accordion-highlight-color2\": null,\n \"--z-accordion-highlight-color3\": null,\n \"--z-accordion-highlight-color4\": null,\n },\n parameters: {\n controls: {\n exclude: [\"open\"],\n },\n },\n render: (args) =>\n html`${[\n StoryMeta.render(args),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color2\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color3\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color4\"],\n }),\n ]}`,\n} satisfies Story;\n\nexport const WithTags = {\n render: (args) => html`\n <z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n <z-tag slot=\"tag\">Tag 1</z-tag>\n <z-tag slot=\"tag\">Tag 2</z-tag>\n <z-tag slot=\"tag\">Tag 3</z-tag>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>\n `,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-anchor-navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACvE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AAMH,MAAM,OAAO,iBAAiB;;8BAMX,KAAK;2BASR,IAAI;yBAMN,KAAK;;IAOjB;;OAEG;IACK,UAAU;QAChB,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CACpE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAClE,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC7C,MAAM,MAAM,GAAG,IAAI,YAAY,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YAClF,MAAM,SAAS,GAAG,MAAM,KAAK,cAAc,CAAC;YAC5C,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1D,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,eAAe;QACrB,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;IACnC,CAAC;IAED,gBAAgB;QACd,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAClE,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,oBAAoB;QAClB,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,SAAS,EAAE,IAAI,CAAC,SAAS;YAC7B,iEACE,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,aAAa,CAAC,SAAS,EAChC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACpD,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,cAG/B;YACX,4DAAK,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;gBAC/B,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, h, Host, Prop, State} from \"@stencil/core\";\nimport {ButtonVariant} from \"../../beans\";\n\n/**\n * Anchor navigation component.\n * @slot - Anchor navigation items. Use `<a>` elements inside. If you need an extra action element, use a wrapper around it and the anchor.\n * @example\n * ```\n * <z-anchor-navigation>\n * <div>\n * <a href=\"#section-id\">Section name</a>\n * <button type=\"button\">\n * <z-icon name=\"share\" />\n * </button>\n * </div>\n * </z-anchor-navigation>\n * ```\n */\n@Component({\n tag: \"z-anchor-navigation\",\n styleUrl: \"styles.css\",\n shadow: false,\n})\nexport class ZAnchorNavigation {\n /**\n * If enabled, the text of each anchor will be hidden unless\n * for the current one or the one the user is hovering.\n */\n @Prop({reflect: true})\n hideUnselected = false;\n\n /**\n * Enables automatic inference of the current item, listening for hash change\n * and checking the `href` of the slotted anchors.\n * When disabled, the highlight of current item must be handled manually by setting the `data-current`\n * attribute to the correct slotted items and the `aria-current` attribute to the anchors.\n */\n @Prop()\n autoCurrent = true;\n\n /**\n * Whether the mobile list is collapsed.\n */\n @State()\n collapsed = false;\n\n @Element() host: HTMLZAnchorNavigationElement;\n\n /** Reference to the nav element. */\n private nav: HTMLElement;\n\n /**\n * Set `aria-current` attribute to the anchors.\n */\n private setCurrent(): void {\n const currentElement = Array.from(this.nav.querySelectorAll(\"a\")).find(\n (anchor) => anchor.href === this.host.ownerDocument.location.href\n );\n Array.from(this.nav.children).forEach((item) => {\n const anchor = item instanceof HTMLAnchorElement ? item : item.querySelector(\"a\");\n const isCurrent = anchor === currentElement;\n anchor.setAttribute(\"aria-current\", isCurrent.toString());\n item.toggleAttribute(\"data-current\", isCurrent);\n });\n }\n\n /**\n * Toggle collapsed state.\n */\n private toggleCollapsed(): void {\n this.collapsed = !this.collapsed;\n }\n\n componentDidLoad(): void {\n if (this.autoCurrent) {\n window.addEventListener(\"hashchange\", this.setCurrent.bind(this));\n this.setCurrent();\n }\n }\n\n disconnectedCallback(): void {\n window.removeEventListener(\"hashchange\", this.setCurrent);\n }\n\n render(): HTMLZAnchorNavigationElement {\n return (\n <Host collapsed={this.collapsed}>\n <z-button\n class=\"toggle\"\n variant={ButtonVariant.SECONDARY}\n icon={this.collapsed ? \"chevron-up\" : \"chevron-down\"}\n onClick={this.toggleCollapsed.bind(this)}\n >\n salta a\n </z-button>\n <nav ref={(el) => (this.nav = el)}>\n <slot></slot>\n </nav>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../src/components/z-anchor-navigation/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAE7B,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,qBAAqB;IAChC,IAAI,EAAE;QACJ,cAAc,EAAE,KAAK;KACtB;CACgC,CAAC;AAEpC,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;6CAEqB,IAAI,CAAC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4H7D;CACoC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE;QACJ,WAAW,EAAE,KAAK;KACnB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,aAAa,CAAC;SACzB;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA+CE,IAAI,CAAC,cAAc;uBACtB,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HpC;CACoC,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZAnchorNavigation} from \".\";\nimport \"../z-button/index\";\nimport \"../z-icon/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\nconst StoryMeta = {\n title: \"ZAnchorNavigation\",\n component: \"z-anchor-navigation\",\n args: {\n hideUnselected: false,\n },\n} satisfies Meta<ZAnchorNavigation>;\n\nexport default StoryMeta;\n\nexport const Default = {\n render: (args) => html`\n <div class=\"z-anchor-navigation-story-wrapper\">\n <z-anchor-navigation .hideUnselected=${args.hideUnselected}>\n <div>\n <a\n href=\"#first-section\"\n target=\"_self\"\n >First section</a\n >\n <z-button\n variant=\"tertiary\"\n icon=\"share\"\n size=\"x-small\"\n ></z-button>\n </div>\n <div>\n <a\n href=\"#second-section\"\n target=\"_self\"\n >Second section</a\n >\n </div>\n <div>\n <a\n href=\"#third-section\"\n target=\"_self\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n <button\n type=\"button\"\n aria-label=\"share\"\n >\n <z-icon name=\"share\" />\n </button>\n </div>\n <a\n href=\"#fourth-section\"\n target=\"_self\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n </z-anchor-navigation>\n <div>\n <div id=\"first-section\">\n <h4>First section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div id=\"second-section\">\n <h4>Second section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div id=\"third-section\">\n <h4>Third section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div id=\"fourth-section\">\n <h4>Fourth section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n </div>\n </div>\n `,\n} satisfies StoryObj<ZAnchorNavigation>;\n\n/**\n * Setting `autoCurrent` to `false` disables the automatic highlighting of the current section in the anchor navigation\n * and allows manual handling.\n * In this story, for example, the highlighting of the current section is done by clicking on the related button.\n */\nexport const AutoCurrentDisabling = {\n args: {\n autoCurrent: false,\n },\n parameters: {\n controls: {\n exclude: [\"autoCurrent\"],\n },\n },\n render: (args) => html`\n <script>\n Array.from(document.querySelectorAll(\".z-anchor-navigation-manual-current z-button\")).forEach((item) =>\n item.addEventListener(\"click\", (ev) => {\n const sectionID = ev.target.closest(\"z-button\")?.dataset.to;\n const current = document.querySelector(\"#\" + sectionID + \"-anchor\");\n const nav = current?.closest(\"nav\");\n Array.from(nav?.children ?? []).forEach((item) => {\n const isCurrent = item.contains(current);\n if (isCurrent) {\n item.setAttribute(\"data-current\", \"\");\n } else {\n item.removeAttribute(\"data-current\");\n }\n const anchor = item.tagName === \"A\" ? item : item.querySelector(\"a\");\n item?.setAttribute(\"aria-current\", isCurrent.toString());\n });\n const section = document.querySelector(\"#\" + sectionID);\n section?.scrollIntoView();\n })\n );\n </script>\n\n <div class=\"z-anchor-navigation-manual-current\">\n <z-button\n size=\"x-small\"\n data-to=\"first-section\"\n >To first section</z-button\n >\n <z-button\n size=\"x-small\"\n data-to=\"second-section\"\n >To second section</z-button\n >\n <z-button\n size=\"x-small\"\n data-to=\"third-section\"\n >To third section</z-button\n >\n <z-button\n size=\"x-small\"\n data-to=\"fourth-section\"\n >Highlight fourth section</z-button\n >\n </div>\n <div class=\"z-anchor-navigation-story-wrapper\">\n <z-anchor-navigation\n .hideUnselected=${args.hideUnselected}\n .autoCurrent=${args.autoCurrent}\n >\n <div>\n <a id=\"first-section-anchor\">First section</a>\n <z-button\n variant=\"tertiary\"\n icon=\"share\"\n size=\"x-small\"\n ></z-button>\n </div>\n <div>\n <a id=\"second-section-anchor\">Second section</a>\n </div>\n <div>\n <a id=\"third-section-anchor\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n <button\n type=\"button\"\n aria-label=\"share\"\n >\n <z-icon name=\"share\" />\n </button>\n </div>\n <a id=\"fourth-section-anchor\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n </z-anchor-navigation>\n <div class=\"z-anchor-navigation-demo-sections\">\n <div\n class=\"section\"\n id=\"first-section\"\n >\n <h4>First section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div\n class=\"section\"\n id=\"second-section\"\n >\n <h4>Second section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div\n class=\"section\"\n id=\"third-section\"\n >\n <h4>Third section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div\n class=\"section\"\n id=\"fourth-section\"\n >\n <h4>Fourth section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n </div>\n </div>\n `,\n} satisfies StoryObj<ZAnchorNavigation>;\n"]}
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/z-anchor-navigation/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAE7B,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,qBAAqB;IAChC,IAAI,EAAE;QACJ,cAAc,EAAE,KAAK;KACtB;CACgC,CAAC;AAEpC,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;6CAEqB,IAAI,CAAC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4H7D;CACoC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE;QACJ,WAAW,EAAE,KAAK;KACnB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,aAAa,CAAC;SACzB;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA+CE,IAAI,CAAC,cAAc;uBACtB,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HpC;CACoC,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZAnchorNavigation} from \".\";\nimport \"../z-button/index\";\nimport \"../z-icon/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\nconst StoryMeta = {\n title: \"ZAnchorNavigation\",\n component: \"z-anchor-navigation\",\n args: {\n hideUnselected: false,\n },\n} satisfies Meta<ZAnchorNavigation>;\n\nexport default StoryMeta;\n\nexport const Default = {\n render: (args) => html`\n <div class=\"z-anchor-navigation-story-wrapper\">\n <z-anchor-navigation .hideUnselected=${args.hideUnselected}>\n <div>\n <a\n href=\"#first-section\"\n target=\"_self\"\n >First section</a\n >\n <z-button\n variant=\"tertiary\"\n icon=\"share\"\n size=\"x-small\"\n ></z-button>\n </div>\n <div>\n <a\n href=\"#second-section\"\n target=\"_self\"\n >Second section</a\n >\n </div>\n <div>\n <a\n href=\"#third-section\"\n target=\"_self\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n <button\n type=\"button\"\n aria-label=\"share\"\n >\n <z-icon name=\"share\" />\n </button>\n </div>\n <a\n href=\"#fourth-section\"\n target=\"_self\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n </z-anchor-navigation>\n <div>\n <div id=\"first-section\">\n <h4>First section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div id=\"second-section\">\n <h4>Second section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div id=\"third-section\">\n <h4>Third section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div id=\"fourth-section\">\n <h4>Fourth section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n </div>\n </div>\n `,\n} satisfies StoryObj<ZAnchorNavigation>;\n\n/**\n * Setting `autoCurrent` to `false` disables the automatic highlighting of the current section in the anchor navigation\n * and allows manual handling.\n * In this story, for example, the highlighting of the current section is done by clicking on the related button.\n */\nexport const AutoCurrentDisabling = {\n args: {\n autoCurrent: false,\n },\n parameters: {\n controls: {\n exclude: [\"autoCurrent\"],\n },\n },\n render: (args) => html`\n <script>\n Array.from(document.querySelectorAll(\".z-anchor-navigation-manual-current z-button\")).forEach((item) =>\n item.addEventListener(\"click\", (ev) => {\n const sectionID = ev.target.closest(\"z-button\")?.dataset.to;\n const current = document.querySelector(\"#\" + sectionID + \"-anchor\");\n const nav = current?.closest(\"nav\");\n Array.from(nav?.children ?? []).forEach((item) => {\n const isCurrent = item.contains(current);\n if (isCurrent) {\n item.setAttribute(\"data-current\", \"\");\n } else {\n item.removeAttribute(\"data-current\");\n }\n const anchor = item.tagName === \"A\" ? item : item.querySelector(\"a\");\n item?.setAttribute(\"aria-current\", isCurrent.toString());\n });\n const section = document.querySelector(\"#\" + sectionID);\n section?.scrollIntoView();\n })\n );\n </script>\n\n <div class=\"z-anchor-navigation-manual-current\">\n <z-button\n size=\"x-small\"\n data-to=\"first-section\"\n >To first section</z-button\n >\n <z-button\n size=\"x-small\"\n data-to=\"second-section\"\n >To second section</z-button\n >\n <z-button\n size=\"x-small\"\n data-to=\"third-section\"\n >To third section</z-button\n >\n <z-button\n size=\"x-small\"\n data-to=\"fourth-section\"\n >Highlight fourth section</z-button\n >\n </div>\n <div class=\"z-anchor-navigation-story-wrapper\">\n <z-anchor-navigation\n .hideUnselected=${args.hideUnselected}\n .autoCurrent=${args.autoCurrent}\n >\n <div>\n <a id=\"first-section-anchor\">First section</a>\n <z-button\n variant=\"tertiary\"\n icon=\"share\"\n size=\"x-small\"\n ></z-button>\n </div>\n <div>\n <a id=\"second-section-anchor\">Second section</a>\n </div>\n <div>\n <a id=\"third-section-anchor\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n <button\n type=\"button\"\n aria-label=\"share\"\n >\n <z-icon name=\"share\" />\n </button>\n </div>\n <a id=\"fourth-section-anchor\"\n >Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n Third section with a very very long title and an icon and the title is repeated so it can go over 2 lines\n </a>\n </z-anchor-navigation>\n <div class=\"z-anchor-navigation-demo-sections\">\n <div\n class=\"section\"\n id=\"first-section\"\n >\n <h4>First section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div\n class=\"section\"\n id=\"second-section\"\n >\n <h4>Second section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div\n class=\"section\"\n id=\"third-section\"\n >\n <h4>Third section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n <div\n class=\"section\"\n id=\"fourth-section\"\n >\n <h4>Fourth section</h4>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in\n Archimede, qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit?\n Possumusne ergo in vita summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo\n affectus, exul, orbus, egens, torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo,\n oblivisci non possum quae volo. Nec vero sum nescius esse utilitatem in historia, non modo voluptatem. Duo\n Reges: constructio interrete. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Hoc autem\n loco tantum explicemus haec honesta, quae dico, praeterquam quod nosmet ipsos diligamus, praeterea suapte\n natura per se esse expetenda. Te enim iudicem aequum puto, modo quae dicat ille bene noris. Si enim Zenoni\n licuit, cum rem aliquam invenisset inusitatam, inauditum quoque ei rei nomen inponere, cur non liceat\n Catoni? Ita cum ea volunt retinere, quae superiori sententiae conveniunt, in Aristonem incidunt; Istam\n voluptatem perpetuam quis potest praestare sapienti? Urgent tamen et nihil remittunt. Sin te auctoritas\n commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Stuprata per vim Lucretia a regis\n filio testata civis se ipsa interemit. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium,\n quod non referatur ad corpus.\n </p>\n </div>\n <div class=\"separator\"></div>\n </div>\n </div>\n `,\n} satisfies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AY,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CACxD;gBAEN,4DACE,KAAK,EAAC,gBAAgB,gBACV,IAAI,CAAC,KAAK,IAAI,SAAS,IAElC,IAAI,CAAC,WAAW,IAAI,CACnB,4DACE,IAAI,EAAC,SAAS,gBACF,IAAI,CAAC,KAAK,IAAI,SAAS;oBAEnC,6DACE,IAAI,EAAC,MAAM,EACX,YAAY,EAAE,IAAI,CAAC,mBAAmB,GACtC,CACE,CACP,CACG,CACF;YACL,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAC7B,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Fragment, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, KeyboardCode, OffCanvasVariant, TransitionDirection} from \"../../beans\";\nimport {Breakpoints} from \"../../constants/breakpoints\";\nimport {containsElement} from \"../../utils/utils\";\n\nconst SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== \"undefined\";\n\n/**\n * @slot title - Slot for the main title\n * @slot top-subtitle - Slot for the top subtitle. It will not appear in stuck header.\n * @slot stucked-title - Title for the stuck header. By default it uses the text from the `title` slot.\n * @slot product-logo - To insert the product logo, it should be used with an img tag.\n * @cssprop --app-header-content-max-width - Use it to set header's content max width. Useful when the project use a fixed width layout. Defaults to `100%`.\n * @cssprop --app-header-top-offset - Top offset for the stuck header. Useful when there are other fixed elements above the header. Defaults to `48px` (the height of the main topbar).\n * @cssprop --app-header-bg - Header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-text-color - Header text color. Defaults to `--color-default-text`.\n * @cssprop --app-header-stucked-bg - Stuck header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-stucked-text-color - Stuck header text color. Defaults to `--color-default-text`.\n */\n@Component({\n tag: \"z-app-header\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAppHeader {\n @Element() hostElement: HTMLZAppHeaderElement;\n\n /**\n * Stuck mode for the header.\n * You can programmatically set it using an IntersectionObserver.\n */\n @Prop({reflect: true})\n stuck = false;\n\n /**\n * When enabled, the menu bar is not displayed and a burger icon appears to open the offcanvas menu. Automatically enabled on mobile and when the menu items overflow the container.\n */\n @Prop({reflect: true, mutable: true})\n enableOffcanvas = false;\n\n /**\n * Enable the search bar.\n */\n @Prop({reflect: true})\n enableSearch = false;\n\n /**\n * Placeholder text for the search bar.\n */\n @Prop()\n searchPlaceholder = \"Cerca\";\n\n /**\n * Search string for the search bar.\n */\n @Prop({mutable: true})\n searchString = \"\";\n\n /**\n * Url to the search page.\n * Set this prop and `enableSearch` to show a link-button on mobile and tablet viewports, instead of the normal searchbar.\n * The link will also appear on the sticky header.\n */\n @Prop()\n searchPageUrl: string;\n\n /**\n * Enable laZ logo.\n */\n @Prop({reflect: true})\n enableZLogo = true;\n\n /**\n * The opening state of the drawer.\n */\n @Prop({mutable: true})\n drawerOpen = false;\n\n /**\n * Emitted when the `stuck` state of the header changes\n */\n @Event()\n sticking: EventEmitter;\n\n /**\n * The stuck state of the bar.\n */\n @State()\n private _stuck = false;\n\n /**\n * Current count of menu items.\n */\n @State()\n private menuLength: number;\n\n @State()\n private isMobile = true;\n\n @State()\n private isTablet = false;\n\n private container?: HTMLDivElement;\n\n private menuElements: HTMLZMenuElement[] = [];\n\n private menuWidth: number;\n\n private closeDrawerButton: HTMLButtonElement;\n\n private burgerButton: HTMLButtonElement;\n\n private menuResizeObserver: ResizeObserver;\n\n private stuckIntersecObserver?: IntersectionObserver = SUPPORT_INTERSECTION_OBSERVER\n ? new IntersectionObserver(\n ([entry]) => {\n this._stuck = !entry.isIntersecting;\n },\n {threshold: 0.5}\n )\n : undefined;\n\n @Watch(\"_stuck\")\n onStuck(): void {\n const scrollParent = this.scrollParent;\n if (!scrollParent) {\n return;\n }\n\n this.sticking.emit(this._stuck);\n }\n\n @Watch(\"drawerOpen\")\n setMenuFloatingMode(): void {\n if (this.menuElements.length === 0) {\n return;\n }\n\n this.menuElements.forEach((element) => {\n element.open = false;\n element.verticalContext = this.drawerOpen;\n });\n }\n\n @Watch(\"stuck\")\n onStuckChange(): void {\n if (!this.container) {\n return;\n }\n\n if (this.stuck) {\n this.stuckIntersecObserver?.observe(this.container);\n } else {\n this._stuck = false;\n this.stuckIntersecObserver?.unobserve(this.container);\n }\n }\n\n private get title(): string {\n return this.hostElement.querySelector('[slot=\"title\"]')?.textContent.trim();\n }\n\n private get scrollParent(): Window | Element {\n const parent = this.hostElement.offsetParent;\n if (parent === document.body || parent === document.documentElement) {\n return window;\n }\n\n return parent;\n }\n\n private get canShowMenu(): boolean {\n return !this.enableOffcanvas && this.menuElements.length > 0 && !this.isMobile && !this.drawerOpen;\n }\n\n private get focusableMenu(): HTMLZMenuElement {\n return this.menuElements.find((el) => el.htmlTabindex === 0);\n }\n\n private openDrawer(): void {\n this.drawerOpen = true;\n this.menuElements.forEach((element, index) => (element.htmlTabindex = index === 0 ? 0 : -1));\n setTimeout(() => this.menuElements[0].setFocus(), 400); /* wait for the 400ms offcanvas transition */\n }\n\n private closeDrawer(): void {\n this.drawerOpen = false;\n setTimeout(() => this.burgerButton.focus(), 100);\n }\n\n private collectMenuElements(): void {\n this.menuElements = Array.from(this.hostElement.querySelectorAll('[slot=\"menu\"]'));\n this.menuElements.forEach((element, index) => (element.htmlTabindex = index === 0 ? 0 : -1));\n this.menuLength = this.menuElements.length;\n if (!this.enableOffcanvas) {\n this.menuWidth =\n this.menuElements.reduce((acc, el) => acc + el.getBoundingClientRect().width, 0) +\n (this.menuLength - 1) * 32 /* 32px is the gap between each menu item */;\n }\n this.setMenuFloatingMode();\n }\n\n /** Automatically use offcanvas mode when the menubar doesn't fit in the header. */\n private setupMenuResizeObserver(): void {\n if (this.enableOffcanvas) {\n return;\n }\n\n this.menuResizeObserver = new ResizeObserver((entries) => {\n if (this.isMobile) {\n this.enableOffcanvas = true;\n\n return;\n }\n\n const containerWidth = entries[0].contentBoxSize[0].inlineSize;\n if (this.menuWidth === 0) {\n return;\n }\n\n if (this.menuWidth > containerWidth && !this.enableOffcanvas) {\n this.enableOffcanvas = true;\n } else if (this.menuWidth <= containerWidth && this.enableOffcanvas) {\n this.enableOffcanvas = false;\n }\n });\n this.menuResizeObserver.observe(this.container);\n }\n\n private hasSlot(slotName: string): boolean {\n return this.hostElement.querySelector(`[slot=\"${slotName}\"]`) !== null;\n }\n\n private moveFocus(current: HTMLZMenuElement, receiver: HTMLZMenuElement): void {\n current.htmlTabindex = -1;\n receiver.setFocus();\n }\n\n private onOffcanvasKeydown(ev: KeyboardEvent): void {\n if (ev.key !== KeyboardCode.TAB || !this.drawerOpen) {\n return;\n }\n\n const closestMenu = (ev.target as HTMLElement).closest(\"z-menu\");\n if (closestMenu) {\n ev.preventDefault();\n ev.stopPropagation();\n // restore tabindex to the zmenu containing the focused element\n closestMenu.htmlTabindex = 0;\n this.closeDrawerButton.focus();\n } else if (ev.target === this.closeDrawerButton) {\n ev.preventDefault();\n ev.stopPropagation();\n if (ev.shiftKey) {\n // give focus to the last open menu if any or the last menu otherwhise\n (this.menuElements.filter((menu) => menu.open).pop() ?? this.menuElements[this.menuLength - 1]).setFocus();\n } else {\n // give focus to the first open menu if any or the first menu otherwhise\n (this.menuElements.find((menu) => menu.open) ?? this.menuElements[0]).setFocus();\n }\n }\n }\n\n /** Close each menu except the one receiving focus/click, if any */\n @Listen(\"focusin\", {target: \"document\", passive: true})\n @Listen(\"click\", {target: \"document\", passive: true})\n manageMenus(ev: FocusEvent | PointerEvent): void {\n const targetMenu = this.menuElements.find((menu) => containsElement(menu, ev.target as Element));\n if (targetMenu) {\n this.menuElements.forEach((menu) => {\n if (menu === targetMenu) {\n return;\n }\n\n menu.htmlTabindex = -1;\n if (!this.drawerOpen) {\n menu.open = false;\n }\n });\n } else if (!this.drawerOpen) {\n this.menuElements.forEach((menu) => {\n menu.open = false;\n });\n }\n }\n\n @Listen(\"keydown\", {passive: true})\n handleKeydown(ev: KeyboardEvent): void {\n if (ev.key === KeyboardCode.ESC && this.drawerOpen) {\n this.closeDrawer();\n\n return;\n }\n\n if (!this.menuElements.some((elem) => elem.contains(ev.target as HTMLElement))) {\n return;\n }\n\n const current = this.focusableMenu;\n const currentIndex = this.menuElements.indexOf(current);\n let receiver: HTMLZMenuElement;\n if (\n (ev.key === KeyboardCode.ARROW_RIGHT && !current.verticalContext) ||\n (ev.key === KeyboardCode.ARROW_DOWN && current.verticalContext)\n ) {\n receiver = this.menuElements[currentIndex + 1] ?? this.menuElements[0];\n } else if (\n (ev.key === KeyboardCode.ARROW_LEFT && !current.verticalContext) ||\n (ev.key === KeyboardCode.ARROW_UP && current.verticalContext)\n ) {\n receiver = this.menuElements[currentIndex - 1] ?? this.menuElements[this.menuLength - 1];\n }\n if (!receiver) {\n return;\n }\n\n if (ev.key === KeyboardCode.ARROW_UP && current.verticalContext) {\n if (receiver.open) {\n current.htmlTabindex = -1;\n receiver.focusLastItem();\n\n return;\n }\n }\n\n this.moveFocus(current, receiver);\n }\n\n private renderSeachbar(): HTMLZButtonElement | HTMLZSearchbarElement | undefined {\n if (this.isMobile && !this.searchPageUrl && this._stuck) {\n return;\n }\n\n if (this.searchPageUrl && (this.isMobile || this.isTablet)) {\n return (\n <z-button\n class=\"search-page-button\"\n variant={ButtonVariant.SECONDARY}\n href={this.searchPageUrl}\n icon=\"search\"\n size={ControlSize.X_SMALL}\n />\n );\n }\n\n return (\n <z-searchbar\n value={this.searchString}\n placeholder={this.searchPlaceholder}\n showSearchButton={true}\n searchButtonIconOnly={this.isMobile || this.isTablet}\n size={ControlSize.X_SMALL}\n variant={ButtonVariant.SECONDARY}\n preventSubmit={this.searchString.length < 3}\n onSearchTyping={(e) => (this.searchString = e.detail)}\n />\n );\n }\n\n private renderProductLogos(): HTMLElement | null {\n return (\n <Fragment>\n {this.enableZLogo && (\n <span class=\"z-logo\">\n <img alt=\"Logo Zanichelli\" />\n </span>\n )}\n {this.hostElement.querySelector(\"[slot='product-logo']\") && (\n <span class=\"product-logo\">\n <slot name=\"product-logo\" />\n </span>\n )}\n </Fragment>\n );\n }\n\n private renderMenuButton(): HTMLButtonElement {\n return (\n this.menuLength > 0 &&\n (this.enableOffcanvas || this._stuck || this.isMobile) && (\n <button\n ref={(el) => (this.burgerButton = el as HTMLButtonElement)}\n class=\"drawer-trigger\"\n aria-label=\"Apri menu\"\n aria-haspopup=\"menu\"\n aria-expanded={`${this.drawerOpen}`}\n aria-controls=\"offcanvas-menu\"\n onClick={this.openDrawer}\n >\n <z-icon name=\"burger-menu\" />\n </button>\n )\n );\n }\n\n private renderOffcanvas(): HTMLZOffcanvasElement {\n return (\n <z-offcanvas\n id=\"offcanvas-menu\"\n variant={OffCanvasVariant.OVERLAY}\n transitiondirection={TransitionDirection.RIGHT}\n open={this.drawerOpen}\n onCanvasOpenStatusChanged={(ev) => (this.drawerOpen = ev.detail)}\n onKeyDown={this.onOffcanvasKeydown}\n >\n <div slot=\"canvasContent\">\n <button\n ref={(el) => (this.closeDrawerButton = el)}\n class=\"drawer-close\"\n aria-label=\"Chiudi menu\"\n onClick={this.closeDrawer}\n aria-hidden={`${!this.drawerOpen}`}\n disabled={!this.drawerOpen}\n >\n <z-icon name=\"close\" />\n </button>\n\n <div\n class=\"drawer-content\"\n aria-hidden={`${!this.drawerOpen}`}\n >\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n />\n </div>\n </div>\n </z-offcanvas>\n );\n }\n\n private renderStuck(): HTMLElement {\n return (\n <div class=\"heading-stuck\">\n <div class=\"heading-stuck-content\">\n {this.renderMenuButton()}\n <div class=\"heading-title\">\n {this.renderProductLogos()}\n <div class=\"stucked-title\">\n <slot name=\"stucked-title\">{this.title}</slot>\n </div>\n </div>\n {this.enableSearch && this.renderSeachbar()}\n </div>\n </div>\n );\n }\n\n constructor() {\n this.openDrawer = this.openDrawer.bind(this);\n this.closeDrawer = this.closeDrawer.bind(this);\n this.collectMenuElements = this.collectMenuElements.bind(this);\n this.onOffcanvasKeydown = this.onOffcanvasKeydown.bind(this);\n }\n\n componentWillLoad(): void {\n this.collectMenuElements();\n\n // mobile and tablet media queries listeners\n const mobileMediaQuery = window.matchMedia(`(max-width: ${Breakpoints.MOBILE}px)`);\n this.isMobile = mobileMediaQuery.matches;\n mobileMediaQuery.addEventListener(\"change\", (e) => (this.isMobile = e.matches));\n const tabletMediaQuery = window.matchMedia(\n `(min-width: ${Breakpoints.MOBILE + 1}px) and (max-width: ${Breakpoints.TABLET}px)`\n );\n this.isTablet = tabletMediaQuery.matches;\n tabletMediaQuery.addEventListener(\"change\", (e) => (this.isTablet = e.matches));\n }\n\n componentDidLoad(): void {\n this.onStuckChange();\n this.setupMenuResizeObserver();\n }\n\n disconnectedCallback(): void {\n this.menuResizeObserver?.disconnect();\n }\n\n render(): HTMLZAppHeaderElement {\n const hasTopSubtitle = this.hasSlot(\"top-subtitle\");\n\n return (\n <Host menu-length={this.menuLength}>\n <div\n class={{\"heading-panel\": true, \"has-menubar\": this.menuLength > 0 && !this.enableOffcanvas}}\n ref={(el) => (this.container = el)}\n >\n <div class=\"heading-container\">\n {((!this.enableSearch && this.isMobile) || !this.isMobile) && (\n <div class=\"top-subtitle\">\n <slot name=\"top-subtitle\" />\n </div>\n )}\n <div class=\"heading-title\">\n {this.renderMenuButton()}\n {!hasTopSubtitle && !this._stuck && this.renderProductLogos()}\n <slot name=\"title\" />\n {this.enableSearch && !this.isMobile && this.renderSeachbar()}\n </div>\n {this.enableSearch && this.isMobile && this.renderSeachbar()}\n </div>\n\n <nav\n class=\"menu-container\"\n aria-label={this.title || undefined}\n >\n {this.canShowMenu && (\n <div\n role=\"menubar\"\n aria-label={this.title || undefined}\n >\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n />\n </div>\n )}\n </nav>\n </div>\n {this.renderOffcanvas()}\n {this._stuck && this.renderStuck()}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-app-header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACrH,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAC5G,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,MAAM,6BAA6B,GAAG,OAAO,oBAAoB,KAAK,WAAW,CAAC;AAElF;;;;;;;;;;;GAWG;AAMH,MAAM,OAAO,UAAU;IAoGrB,OAAO;QACL,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACvC,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAGD,mBAAmB;QACjB,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;YACrB,OAAO,CAAC,eAAe,GAAG,IAAI,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IAAI,CAAC,kBAAkB,EAAE;wBAC7D,6DAAM,IAAI,EAAC,OAAO,GAAG;wBACpB,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CACzD;oBACL,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CACxD;gBAEN,4DACE,KAAK,EAAC,gBAAgB,gBACV,IAAI,CAAC,KAAK,IAAI,SAAS,IAElC,IAAI,CAAC,WAAW,IAAI,CACnB,4DACE,IAAI,EAAC,SAAS,gBACF,IAAI,CAAC,KAAK,IAAI,SAAS;oBAEnC,6DACE,IAAI,EAAC,MAAM,EACX,YAAY,EAAE,IAAI,CAAC,mBAAmB,GACtC,CACE,CACP,CACG,CACF;YACL,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAC7B,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Fragment, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, KeyboardCode, OffCanvasVariant, TransitionDirection} from \"../../beans\";\nimport {Breakpoints} from \"../../constants/breakpoints\";\nimport {containsElement} from \"../../utils/utils\";\n\nconst SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== \"undefined\";\n\n/**\n * @slot title - Slot for the main title\n * @slot top-subtitle - Slot for the top subtitle. It will not appear in stuck header.\n * @slot stucked-title - Title for the stuck header. By default it uses the text from the `title` slot.\n * @slot product-logo - To insert the product logo, it should be used with an img tag.\n * @cssprop --app-header-content-max-width - Use it to set header's content max width. Useful when the project use a fixed width layout. Defaults to `100%`.\n * @cssprop --app-header-top-offset - Top offset for the stuck header. Useful when there are other fixed elements above the header. Defaults to `48px` (the height of the main topbar).\n * @cssprop --app-header-bg - Header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-text-color - Header text color. Defaults to `--color-default-text`.\n * @cssprop --app-header-stucked-bg - Stuck header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-stucked-text-color - Stuck header text color. Defaults to `--color-default-text`.\n */\n@Component({\n tag: \"z-app-header\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAppHeader {\n @Element() hostElement: HTMLZAppHeaderElement;\n\n /**\n * Stuck mode for the header.\n * You can programmatically set it using an IntersectionObserver.\n */\n @Prop({reflect: true})\n stuck = false;\n\n /**\n * When enabled, the menu bar is not displayed and a burger icon appears to open the offcanvas menu. Automatically enabled on mobile and when the menu items overflow the container.\n */\n @Prop({reflect: true, mutable: true})\n enableOffcanvas = false;\n\n /**\n * Enable the search bar.\n */\n @Prop({reflect: true})\n enableSearch = false;\n\n /**\n * Placeholder text for the search bar.\n */\n @Prop()\n searchPlaceholder = \"Cerca\";\n\n /**\n * Search string for the search bar.\n */\n @Prop({mutable: true})\n searchString = \"\";\n\n /**\n * Url to the search page.\n * Set this prop and `enableSearch` to show a link-button on mobile and tablet viewports, instead of the normal searchbar.\n * The link will also appear on the sticky header.\n */\n @Prop()\n searchPageUrl: string;\n\n /**\n * Enable laZ logo.\n */\n @Prop({reflect: true})\n enableZLogo = true;\n\n /**\n * The opening state of the drawer.\n */\n @Prop({mutable: true})\n drawerOpen = false;\n\n /**\n * Emitted when the `stuck` state of the header changes\n */\n @Event()\n sticking: EventEmitter;\n\n /**\n * The stuck state of the bar.\n */\n @State()\n private _stuck = false;\n\n /**\n * Current count of menu items.\n */\n @State()\n private menuLength: number;\n\n @State()\n private isMobile = true;\n\n @State()\n private isTablet = false;\n\n private container?: HTMLDivElement;\n\n private menuElements: HTMLZMenuElement[] = [];\n\n private menuWidth: number;\n\n private closeDrawerButton: HTMLButtonElement;\n\n private burgerButton: HTMLButtonElement;\n\n private menuResizeObserver: ResizeObserver;\n\n private stuckIntersecObserver?: IntersectionObserver = SUPPORT_INTERSECTION_OBSERVER\n ? new IntersectionObserver(\n ([entry]) => {\n this._stuck = !entry.isIntersecting;\n },\n {threshold: 0.5}\n )\n : undefined;\n\n @Watch(\"_stuck\")\n onStuck(): void {\n const scrollParent = this.scrollParent;\n if (!scrollParent) {\n return;\n }\n\n this.sticking.emit(this._stuck);\n }\n\n @Watch(\"drawerOpen\")\n setMenuFloatingMode(): void {\n if (this.menuElements.length === 0) {\n return;\n }\n\n this.menuElements.forEach((element) => {\n element.open = false;\n element.verticalContext = this.drawerOpen;\n });\n }\n\n @Watch(\"stuck\")\n onStuckChange(): void {\n if (!this.container) {\n return;\n }\n\n if (this.stuck) {\n this.stuckIntersecObserver?.observe(this.container);\n } else {\n this._stuck = false;\n this.stuckIntersecObserver?.unobserve(this.container);\n }\n }\n\n private get title(): string {\n return this.hostElement.querySelector('[slot=\"title\"]')?.textContent.trim();\n }\n\n private get scrollParent(): Window | Element {\n const parent = this.hostElement.offsetParent;\n if (parent === document.body || parent === document.documentElement) {\n return window;\n }\n\n return parent;\n }\n\n private get canShowMenu(): boolean {\n return !this.enableOffcanvas && this.menuElements.length > 0 && !this.isMobile && !this.drawerOpen;\n }\n\n private get focusableMenu(): HTMLZMenuElement {\n return this.menuElements.find((el) => el.htmlTabindex === 0);\n }\n\n private openDrawer(): void {\n this.drawerOpen = true;\n this.menuElements.forEach((element, index) => (element.htmlTabindex = index === 0 ? 0 : -1));\n setTimeout(() => this.menuElements[0].setFocus(), 400); /* wait for the 400ms offcanvas transition */\n }\n\n private closeDrawer(): void {\n this.drawerOpen = false;\n setTimeout(() => this.burgerButton.focus(), 100);\n }\n\n private collectMenuElements(): void {\n this.menuElements = Array.from(this.hostElement.querySelectorAll('[slot=\"menu\"]'));\n this.menuElements.forEach((element, index) => (element.htmlTabindex = index === 0 ? 0 : -1));\n this.menuLength = this.menuElements.length;\n if (!this.enableOffcanvas) {\n this.menuWidth =\n this.menuElements.reduce((acc, el) => acc + el.getBoundingClientRect().width, 0) +\n (this.menuLength - 1) * 32 /* 32px is the gap between each menu item */;\n }\n this.setMenuFloatingMode();\n }\n\n /** Automatically use offcanvas mode when the menubar doesn't fit in the header. */\n private setupMenuResizeObserver(): void {\n if (this.enableOffcanvas) {\n return;\n }\n\n this.menuResizeObserver = new ResizeObserver((entries) => {\n if (this.isMobile) {\n this.enableOffcanvas = true;\n\n return;\n }\n\n const containerWidth = entries[0].contentBoxSize[0].inlineSize;\n if (this.menuWidth === 0) {\n return;\n }\n\n if (this.menuWidth > containerWidth && !this.enableOffcanvas) {\n this.enableOffcanvas = true;\n } else if (this.menuWidth <= containerWidth && this.enableOffcanvas) {\n this.enableOffcanvas = false;\n }\n });\n this.menuResizeObserver.observe(this.container);\n }\n\n private hasSlot(slotName: string): boolean {\n return this.hostElement.querySelector(`[slot=\"${slotName}\"]`) !== null;\n }\n\n private moveFocus(current: HTMLZMenuElement, receiver: HTMLZMenuElement): void {\n current.htmlTabindex = -1;\n receiver.setFocus();\n }\n\n private onOffcanvasKeydown(ev: KeyboardEvent): void {\n if (ev.key !== KeyboardCode.TAB || !this.drawerOpen) {\n return;\n }\n\n const closestMenu = (ev.target as HTMLElement).closest(\"z-menu\");\n if (closestMenu) {\n ev.preventDefault();\n ev.stopPropagation();\n // restore tabindex to the zmenu containing the focused element\n closestMenu.htmlTabindex = 0;\n this.closeDrawerButton.focus();\n } else if (ev.target === this.closeDrawerButton) {\n ev.preventDefault();\n ev.stopPropagation();\n if (ev.shiftKey) {\n // give focus to the last open menu if any or the last menu otherwhise\n (this.menuElements.filter((menu) => menu.open).pop() ?? this.menuElements[this.menuLength - 1]).setFocus();\n } else {\n // give focus to the first open menu if any or the first menu otherwhise\n (this.menuElements.find((menu) => menu.open) ?? this.menuElements[0]).setFocus();\n }\n }\n }\n\n /** Close each menu except the one receiving focus/click, if any */\n @Listen(\"focusin\", {target: \"document\", passive: true})\n @Listen(\"click\", {target: \"document\", passive: true})\n manageMenus(ev: FocusEvent | PointerEvent): void {\n const targetMenu = this.menuElements.find((menu) => containsElement(menu, ev.target as Element));\n if (targetMenu) {\n this.menuElements.forEach((menu) => {\n if (menu === targetMenu) {\n return;\n }\n\n menu.htmlTabindex = -1;\n if (!this.drawerOpen) {\n menu.open = false;\n }\n });\n } else if (!this.drawerOpen) {\n this.menuElements.forEach((menu) => {\n menu.open = false;\n });\n }\n }\n\n @Listen(\"keydown\", {passive: true})\n handleKeydown(ev: KeyboardEvent): void {\n if (ev.key === KeyboardCode.ESC && this.drawerOpen) {\n this.closeDrawer();\n\n return;\n }\n\n if (!this.menuElements.some((elem) => elem.contains(ev.target as HTMLElement))) {\n return;\n }\n\n const current = this.focusableMenu;\n const currentIndex = this.menuElements.indexOf(current);\n let receiver: HTMLZMenuElement;\n if (\n (ev.key === KeyboardCode.ARROW_RIGHT && !current.verticalContext) ||\n (ev.key === KeyboardCode.ARROW_DOWN && current.verticalContext)\n ) {\n receiver = this.menuElements[currentIndex + 1] ?? this.menuElements[0];\n } else if (\n (ev.key === KeyboardCode.ARROW_LEFT && !current.verticalContext) ||\n (ev.key === KeyboardCode.ARROW_UP && current.verticalContext)\n ) {\n receiver = this.menuElements[currentIndex - 1] ?? this.menuElements[this.menuLength - 1];\n }\n if (!receiver) {\n return;\n }\n\n if (ev.key === KeyboardCode.ARROW_UP && current.verticalContext) {\n if (receiver.open) {\n current.htmlTabindex = -1;\n receiver.focusLastItem();\n\n return;\n }\n }\n\n this.moveFocus(current, receiver);\n }\n\n private renderSeachbar(): HTMLZButtonElement | HTMLZSearchbarElement | undefined {\n if (this.isMobile && !this.searchPageUrl && this._stuck) {\n return;\n }\n\n if (this.searchPageUrl && (this.isMobile || this.isTablet)) {\n return (\n <z-button\n class=\"search-page-button\"\n variant={ButtonVariant.SECONDARY}\n href={this.searchPageUrl}\n icon=\"search\"\n size={ControlSize.X_SMALL}\n />\n );\n }\n\n return (\n <z-searchbar\n value={this.searchString}\n placeholder={this.searchPlaceholder}\n showSearchButton={true}\n searchButtonIconOnly={this.isMobile || this.isTablet}\n size={ControlSize.X_SMALL}\n variant={ButtonVariant.SECONDARY}\n preventSubmit={this.searchString.length < 3}\n onSearchTyping={(e) => (this.searchString = e.detail)}\n />\n );\n }\n\n private renderProductLogos(): HTMLElement | null {\n return (\n <Fragment>\n {this.enableZLogo && (\n <span class=\"z-logo\">\n <img alt=\"Logo Zanichelli\" />\n </span>\n )}\n {this.hostElement.querySelector(\"[slot='product-logo']\") && (\n <span class=\"product-logo\">\n <slot name=\"product-logo\" />\n </span>\n )}\n </Fragment>\n );\n }\n\n private renderMenuButton(): HTMLButtonElement {\n return (\n this.menuLength > 0 &&\n (this.enableOffcanvas || this._stuck || this.isMobile) && (\n <button\n ref={(el) => (this.burgerButton = el as HTMLButtonElement)}\n class=\"drawer-trigger\"\n aria-label=\"Apri menu\"\n aria-haspopup=\"menu\"\n aria-expanded={`${this.drawerOpen}`}\n aria-controls=\"offcanvas-menu\"\n onClick={this.openDrawer}\n >\n <z-icon name=\"burger-menu\" />\n </button>\n )\n );\n }\n\n private renderOffcanvas(): HTMLZOffcanvasElement {\n return (\n <z-offcanvas\n id=\"offcanvas-menu\"\n variant={OffCanvasVariant.OVERLAY}\n transitiondirection={TransitionDirection.RIGHT}\n open={this.drawerOpen}\n onCanvasOpenStatusChanged={(ev) => (this.drawerOpen = ev.detail)}\n onKeyDown={this.onOffcanvasKeydown}\n >\n <div slot=\"canvasContent\">\n <button\n ref={(el) => (this.closeDrawerButton = el)}\n class=\"drawer-close\"\n aria-label=\"Chiudi menu\"\n onClick={this.closeDrawer}\n aria-hidden={`${!this.drawerOpen}`}\n disabled={!this.drawerOpen}\n >\n <z-icon name=\"close\" />\n </button>\n\n <div\n class=\"drawer-content\"\n aria-hidden={`${!this.drawerOpen}`}\n >\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n />\n </div>\n </div>\n </z-offcanvas>\n );\n }\n\n private renderStuck(): HTMLElement {\n return (\n <div class=\"heading-stuck\">\n <div class=\"heading-stuck-content\">\n {this.renderMenuButton()}\n <div class=\"heading-title\">\n {this.renderProductLogos()}\n <div class=\"stucked-title\">\n <slot name=\"stucked-title\">{this.title}</slot>\n </div>\n </div>\n {this.enableSearch && this.renderSeachbar()}\n </div>\n </div>\n );\n }\n\n constructor() {\n this.openDrawer = this.openDrawer.bind(this);\n this.closeDrawer = this.closeDrawer.bind(this);\n this.collectMenuElements = this.collectMenuElements.bind(this);\n this.onOffcanvasKeydown = this.onOffcanvasKeydown.bind(this);\n }\n\n componentWillLoad(): void {\n this.collectMenuElements();\n\n // mobile and tablet media queries listeners\n const mobileMediaQuery = window.matchMedia(`(max-width: ${Breakpoints.MOBILE}px)`);\n this.isMobile = mobileMediaQuery.matches;\n mobileMediaQuery.addEventListener(\"change\", (e) => (this.isMobile = e.matches));\n const tabletMediaQuery = window.matchMedia(\n `(min-width: ${Breakpoints.MOBILE + 1}px) and (max-width: ${Breakpoints.TABLET}px)`\n );\n this.isTablet = tabletMediaQuery.matches;\n tabletMediaQuery.addEventListener(\"change\", (e) => (this.isTablet = e.matches));\n }\n\n componentDidLoad(): void {\n this.onStuckChange();\n this.setupMenuResizeObserver();\n }\n\n disconnectedCallback(): void {\n this.menuResizeObserver?.disconnect();\n }\n\n render(): HTMLZAppHeaderElement {\n const hasTopSubtitle = this.hasSlot(\"top-subtitle\");\n\n return (\n <Host menu-length={this.menuLength}>\n <div\n class={{\"heading-panel\": true, \"has-menubar\": this.menuLength > 0 && !this.enableOffcanvas}}\n ref={(el) => (this.container = el)}\n >\n <div class=\"heading-container\">\n {((!this.enableSearch && this.isMobile) || !this.isMobile) && (\n <div class=\"top-subtitle\">\n <slot name=\"top-subtitle\" />\n </div>\n )}\n <div class=\"heading-title\">\n {this.renderMenuButton()}\n {!hasTopSubtitle && !this._stuck && this.renderProductLogos()}\n <slot name=\"title\" />\n {this.enableSearch && !this.isMobile && this.renderSeachbar()}\n </div>\n {this.enableSearch && this.isMobile && this.renderSeachbar()}\n </div>\n\n <nav\n class=\"menu-container\"\n aria-label={this.title || undefined}\n >\n {this.canShowMenu && (\n <div\n role=\"menubar\"\n aria-label={this.title || undefined}\n >\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n />\n </div>\n )}\n </nav>\n </div>\n {this.renderOffcanvas()}\n {this._stuck && this.renderStuck()}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../src/components/z-app-header/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,IAAI,EAAC,MAAM,KAAK,CAAC;AAGzC,OAAO,yBAAyB,CAAC;AACjC,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAI7B,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;IACD,aAAa,EAAE;QACb,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,gBAAgB;KAC/B;IACD,IAAI,EAAE;QACJ,gCAAgC,EAAE,MAAM;QACxC,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,KAAK;KACzB;CACoC,CAAC;AAExC,eAAe,SAAS,CAAC;AAEzB,MAAM,iBAAiB,GAAG,GAAmB,EAAE;IAC7C,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgDS,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,GAAm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CAAC;;;QAG7E,YAAY,EAAE;oBACF;CACH,CAAC;AAElB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,iBAAiB,CAAC;SAC9D;KACF;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;;;QAIX,KAAK,EAAE;KACV;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;qBAEa,IAAI,CAAC,WAAW;;+CAEU,IAAI,CAAC,gCAAgC,CAAC;;;;QAI7E,YAAY,EAAE;oBACF;CACH,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {TemplateResult, html} from \"lit\";\nimport {ZAppHeader} from \".\";\nimport {CSSVarsArguments} from \"../../utils/storybook-utils\";\nimport \"../z-menu-section/index\";\nimport \"../z-menu/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\ntype ZAppHeaderStoriesArgs = ZAppHeader & CSSVarsArguments<\"app-header-content-max-width\">;\n\nconst StoryMeta = {\n title: \"ZAppHeader\",\n component: \"z-app-header\",\n parameters: {\n layout: \"fullscreen\",\n },\n subcomponents: {\n ZMenu: \"z-menu\",\n ZMenuSection: \"z-menu-section\",\n },\n args: {\n \"--app-header-content-max-width\": \"100%\",\n \"enableSearch\": false,\n \"searchPageUrl\": \"\",\n \"enableZLogo\": false,\n \"enableOffcanvas\": false,\n },\n} satisfies Meta<ZAppHeaderStoriesArgs>;\n\nexport default StoryMeta;\n\nconst menuItemsTemplate = (): TemplateResult => {\n return html`<a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <z-menu-section slot=\"item\">\n <h3>Item 2</h3>\n <a\n href=\"\"\n slot=\"section\"\n >Item 2.1</a\n >\n <a\n href=\"\"\n slot=\"section\"\n >Item 2.2</a\n >\n </z-menu-section>\n <z-menu-section slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"section\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"section\"\n >Item 3.2</a\n >\n </z-menu-section>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4</a\n >\n <z-menu-section slot=\"item\">\n <h3>Item 5</h3>\n <a\n href=\"\"\n slot=\"section\"\n >Item 5.1</a\n >\n <a\n href=\"\"\n slot=\"section\"\n >Item 5.2</a\n >\n </z-menu-section>`;\n};\n\nconst menuTemplate = (): TemplateResult => {\n return html`\n <z-menu slot=\"menu\">\n <h3>Menu label 1</h3>\n ${menuItemsTemplate()}\n </z-menu>\n\n <z-menu slot=\"menu\">\n <a href>Menu label 2</a>\n </z-menu>\n\n <z-menu slot=\"menu\">\n <h3>Menu label 3</h3>\n ${menuItemsTemplate()}\n </z-menu>\n\n <z-menu slot=\"menu\">\n <h3>Menu label 4</h3>\n ${menuItemsTemplate()}\n </z-menu>\n `;\n};\n\ntype Story = Meta<ZAppHeaderStoriesArgs>;\n\nexport const Title = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .enableZLogo=${args.enableZLogo}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <a href=\"zanichelli.it\" slot=\"title\">Applicazione</h1>\n </z-app-header>`,\n} satisfies Story;\n\nexport const ProductLogo = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .enableZLogo=${args.enableZLogo}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <div\n class=\"story-product-logo\"\n slot=\"product-logo\"\n ></div>\n </z-app-header>`,\n} satisfies Story;\n\nexport const TopTitle = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\", \"enableZLogo\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h2 slot=\"top-subtitle\">Payoff dell'applicazione</h2>\n <h1 slot=\"title\">Applicazione</h1>\n </z-app-header>`,\n} satisfies Story;\n\nexport const MenuWithTopTitle = {\n parameters: {\n controls: {\n exclude: [\"enableZLogo\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableOffcanvas=${args.enableOffcanvas}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h2 slot=\"top-subtitle\">Payoff dell'applicazione</h2>\n <h1 slot=\"title\">Applicazione</h1>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const LongTitle = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\", \"enableZLogo\", \"enableSearch\", \"searchPageUrl\"],\n },\n },\n render: (args) =>\n html`<z-app-header style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\">\n <h1 slot=\"title\">Fondamenti di fisica 8e - Meccanica, Onde, Termodinamica, Elettromagnetismo, Ottica</h1>\n <h2 slot=\"top-subtitle\">Jearl Walker, David Halliday, Robert Resnick</h2>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const OffcanvasMenu = {\n args: {\n enableOffcanvas: true,\n },\n render: (args) =>\n html`<z-app-header\n .enableOffcanvas=${args.enableOffcanvas}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .enableZLogo=${args.enableZLogo}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const Stuck = {\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">Scroll to see <code>stuck</code> prop in action.</div>\n <div style=\"height: 200vh\">${Story()}</div>\n `,\n ],\n parameters: {\n docs: {\n story: {\n inline: false,\n iframeHeight: \"400px\",\n },\n },\n controls: {\n exclude: [\"enableOffcanvas\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n stuck\n .enableZLogo=${args.enableZLogo}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}; --app-header-top-offset: 0\"\n >\n <h1 slot=\"title\">Fondamenti di fisica 8e - Meccanica, Onde, Termodinamica, Elettromagnetismo, Ottica</h1>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const SearchPageButton = {\n parameters: {\n controls: {\n exclude: [\"searchPageUrl\", \"enableSearch\", \"enableOffcanvas\"],\n },\n },\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">\n The prop <code>searchPageUrl</code> only affects the component in tablet and mobile viewports.\n </div>\n ${Story()}\n `,\n ],\n render: (args) =>\n html`<z-app-header\n enable-search\n .enableZLogo=${args.enableZLogo}\n search-page-url=\"https://www.zanichelli.it\"\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n"]}
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/z-app-header/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,IAAI,EAAC,MAAM,KAAK,CAAC;AAGzC,OAAO,yBAAyB,CAAC;AACjC,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAI7B,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,YAAY;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C;;;QAG7E,YAAY,EAAE;oBACF;CACH,CAAC;AAElB,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;mCAEgB,KAAK,EAAE;KACrC;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,KAAK,EAAE;gBACL,MAAM,EAAE,KAAK;gBACb,YAAY,EAAE,OAAO;aACtB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC7B;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;qBAEa,IAAI,CAAC,WAAW;sBACf,IAAI,CAAC,YAAY;uBAChB,IAAI,CAAC,aAAa;+CACM,IAAI,CAAC,gCAAgC,CAAC;;;QAG7E,YAAY,EAAE;oBACF;CACH,CAAC;AAElB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,iBAAiB,CAAC;SAC9D;KACF;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;;;QAIX,KAAK,EAAE;KACV;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;qBAEa,IAAI,CAAC,WAAW;;+CAEU,IAAI,CAAC,gCAAgC,CAAC;;;;QAI7E,YAAY,EAAE;oBACF;CACH,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {TemplateResult, html} from \"lit\";\nimport {ZAppHeader} from \".\";\nimport {CSSVarsArguments} from \"../../utils/storybook-utils\";\nimport \"../z-menu-section/index\";\nimport \"../z-menu/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\ntype ZAppHeaderStoriesArgs = ZAppHeader & CSSVarsArguments<\"app-header-content-max-width\">;\n\nconst StoryMeta = {\n title: \"ZAppHeader\",\n component: \"z-app-header\",\n parameters: {\n layout: \"fullscreen\",\n },\n subcomponents: {\n ZMenu: \"z-menu\",\n ZMenuSection: \"z-menu-section\",\n },\n args: {\n \"--app-header-content-max-width\": \"100%\",\n \"enableSearch\": false,\n \"searchPageUrl\": \"\",\n \"enableZLogo\": false,\n \"enableOffcanvas\": false,\n },\n} satisfies Meta<ZAppHeaderStoriesArgs>;\n\nexport default StoryMeta;\n\nconst menuItemsTemplate = (): TemplateResult => {\n return html`<a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <z-menu-section slot=\"item\">\n <h3>Item 2</h3>\n <a\n href=\"\"\n slot=\"section\"\n >Item 2.1</a\n >\n <a\n href=\"\"\n slot=\"section\"\n >Item 2.2</a\n >\n </z-menu-section>\n <z-menu-section slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"section\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"section\"\n >Item 3.2</a\n >\n </z-menu-section>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4</a\n >\n <z-menu-section slot=\"item\">\n <h3>Item 5</h3>\n <a\n href=\"\"\n slot=\"section\"\n >Item 5.1</a\n >\n <a\n href=\"\"\n slot=\"section\"\n >Item 5.2</a\n >\n </z-menu-section>`;\n};\n\nconst menuTemplate = (): TemplateResult => {\n return html`\n <z-menu slot=\"menu\">\n <h3>Menu label 1</h3>\n ${menuItemsTemplate()}\n </z-menu>\n\n <z-menu slot=\"menu\">\n <a href>Menu label 2</a>\n </z-menu>\n\n <z-menu slot=\"menu\">\n <h3>Menu label 3</h3>\n ${menuItemsTemplate()}\n </z-menu>\n\n <z-menu slot=\"menu\">\n <h3>Menu label 4</h3>\n ${menuItemsTemplate()}\n </z-menu>\n `;\n};\n\ntype Story = Meta<ZAppHeaderStoriesArgs>;\n\nexport const Title = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .enableZLogo=${args.enableZLogo}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <a href=\"zanichelli.it\" slot=\"title\">Applicazione</h1>\n </z-app-header>`,\n} satisfies Story;\n\nexport const ProductLogo = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .enableZLogo=${args.enableZLogo}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <div\n class=\"story-product-logo\"\n slot=\"product-logo\"\n ></div>\n </z-app-header>`,\n} satisfies Story;\n\nexport const TopTitle = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\", \"enableZLogo\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h2 slot=\"top-subtitle\">Payoff dell'applicazione</h2>\n <h1 slot=\"title\">Applicazione</h1>\n </z-app-header>`,\n} satisfies Story;\n\nexport const MenuWithTopTitle = {\n parameters: {\n controls: {\n exclude: [\"enableZLogo\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n .enableOffcanvas=${args.enableOffcanvas}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h2 slot=\"top-subtitle\">Payoff dell'applicazione</h2>\n <h1 slot=\"title\">Applicazione</h1>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const LongTitle = {\n parameters: {\n controls: {\n exclude: [\"enableOffcanvas\", \"enableZLogo\", \"enableSearch\", \"searchPageUrl\"],\n },\n },\n render: (args) =>\n html`<z-app-header style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\">\n <h1 slot=\"title\">Fondamenti di fisica 8e - Meccanica, Onde, Termodinamica, Elettromagnetismo, Ottica</h1>\n <h2 slot=\"top-subtitle\">Jearl Walker, David Halliday, Robert Resnick</h2>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const OffcanvasMenu = {\n args: {\n enableOffcanvas: true,\n },\n render: (args) =>\n html`<z-app-header\n .enableOffcanvas=${args.enableOffcanvas}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .enableZLogo=${args.enableZLogo}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const Stuck = {\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">Scroll to see <code>stuck</code> prop in action.</div>\n <div style=\"height: 200vh\">${Story()}</div>\n `,\n ],\n parameters: {\n docs: {\n story: {\n inline: false,\n iframeHeight: \"400px\",\n },\n },\n controls: {\n exclude: [\"enableOffcanvas\"],\n },\n },\n render: (args) =>\n html`<z-app-header\n stuck\n .enableZLogo=${args.enableZLogo}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}; --app-header-top-offset: 0\"\n >\n <h1 slot=\"title\">Fondamenti di fisica 8e - Meccanica, Onde, Termodinamica, Elettromagnetismo, Ottica</h1>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n\nexport const SearchPageButton = {\n parameters: {\n controls: {\n exclude: [\"searchPageUrl\", \"enableSearch\", \"enableOffcanvas\"],\n },\n },\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">\n The prop <code>searchPageUrl</code> only affects the component in tablet and mobile viewports.\n </div>\n ${Story()}\n `,\n ],\n render: (args) =>\n html`<z-app-header\n enable-search\n .enableZLogo=${args.enableZLogo}\n search-page-url=\"https://www.zanichelli.it\"\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header>`,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-aria-alert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAM3C,MAAM,OAAO,UAAU;;oBAGE,cAAc,CAAC,MAAM;;IAE5C,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,kEACQ,IAAI,CAAC,IAAI,iBACR,MAAM,mBACJ,WAAW;YAEzB,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, Prop, h} from \"@stencil/core\";\nimport {ZAriaAlertMode} from \"../../beans\";\n\n@Component({\n tag: \"z-aria-alert\",\n shadow: false,\n})\nexport class ZAriaAlert {\n /** Aria live mode */\n @Prop()\n mode: ZAriaAlertMode = ZAriaAlertMode.POLITE;\n\n render(): HTMLZAriaAlertElement {\n return (\n <Host\n aria-live={this.mode}\n aria-atomic=\"true\"\n aria-relevant=\"additions\"\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/z-aria-alert/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,4BAA4B,CAAC;AACpC,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,cAAc;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;SACvC;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,cAAc,CAAC,MAAM;KAC5B;CACyB,CAAC;AAC7B,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;;;;;;;;;;;;;;;;kBAiBU,IAAI,CAAC,IAAI;;;;aAId;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;oBAsBY,IAAI,CAAC,IAAI;;;;;aAKhB;CACZ,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZAriaAlert} from \".\";\nimport {ZAriaAlertMode} from \"../../beans\";\nimport \"../z-button/index\";\nimport \"../z-visually-hidden/index\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"ZAriaAlert\",\n component: \"z-aria-alert\",\n argTypes: {\n mode: {\n control: {\n type: \"select\",\n },\n options: Object.values(ZAriaAlertMode),\n },\n },\n args: {\n mode: ZAriaAlertMode.POLITE,\n },\n} satisfies Meta<ZAriaAlert>;\nexport default StoryMeta;\n\nexport const Default = {\n render: (args) =>\n html`<script>\n function myFunction() {\n const myTimeout = setTimeout(myDelayedFunction, 3000);\n }\n function myDelayedFunction() {\n var myalert = document.getElementById(\"idAlert\");\n myalert.innerHTML = \"Ecco un numero a caso: \" + Math.random();\n }\n </script>\n <div>\n <h2 class=\"heading-2\">ZAriaAlert deafult</h2>\n <span>\n Open your ScreenReader, Click on the button and wait 3 seconds, the screenreader will read a message\n </span>\n <z-button onclick=\"myFunction()\">Click to say something</z-button>\n <z-aria-alert\n id=\"idAlert\"\n mode=\"${args.mode}\"\n >\n Testo NON nascosto\n </z-aria-alert>\n </div>`,\n};\n\nexport const VisuallyHidden = {\n render: (args) =>\n html`<script>\n function myFunction2() {\n const myTimeout = setTimeout(myDelayedFunction2, 3000);\n }\n function myDelayedFunction2() {\n var myalert = document.getElementById(\"idAlert2\");\n myalert.innerHTML = \"Ecco un numero a caso: \" + Math.random();\n }\n </script>\n <div>\n <h2 class=\"heading-2\">ZAriaAlert with VisuallyHidden</h2>\n <span>\n You can also wrap your <code>z-aria-alert</code> with a <code>z-visually-hidden</code> tag in order to\n visually hide the text.\n </span>\n <span>\n Open your ScreenReader, Click on the button and wait 3 seconds, the screenreader will read a message\n </span>\n <z-button onclick=\"myFunction2()\">Click to say something but visually hidden</z-button>\n <z-visually-hidden>\n <z-aria-alert\n id=\"idAlert2\"\n mode=\"${args.mode}\"\n >\n Testo qua\n </z-aria-alert>\n </z-visually-hidden>\n </div>`,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAOvC,MAAM,OAAO,OAAO;IAqBlB;;oBAlBoB,UAAU,CAAC,MAAM;;yBAQhB,aAAa;+BAIP,SAAS;;QAOlC,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, Prop, h} from \"@stencil/core\";\nimport {AvatarSize} from \"../../beans\";\n\n@Component({\n tag: \"z-avatar\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAvatar {\n /** [optional] Avatar size */\n @Prop()\n size?: AvatarSize = AvatarSize.MEDIUM;\n\n /** [optional] Avatar text */\n @Prop()\n text?: string;\n\n /** [optional] Avatar text color */\n @Prop()\n textColor?: string = \"color-white\";\n\n /** [optional] Avatar background color */\n @Prop()\n backgroundColor?: string = \"gray700\";\n\n /** [optional] Avatar image */\n @Prop({mutable: true})\n image?: string;\n\n constructor() {\n if (this.text?.length === 0 && this.image?.length === 0) {\n console.warn(\"z-avatar must contain at least one prop between text and image\");\n }\n }\n\n private getTextSize(): string {\n if (this.size === AvatarSize.SMALL) {\n return \"5\";\n } else if (this.size === AvatarSize.MEDIUM) {\n return \"4\";\n } else if (this.size === AvatarSize.LARGE) {\n return \"2\";\n }\n }\n\n render(): HTMLZAvatarElement {\n return (\n <Host\n class={{[this.size]: true, [`body-${this.getTextSize()}-sb`]: true}}\n style={{\n color: `var(--${this.textColor})`,\n backgroundColor: `var(--${this.backgroundColor})`,\n }}\n >\n {this.text && !this.image && <span>{this.text.substring(0, 2)}</span>}\n {this.image && (\n <img\n src={this.image}\n onError={() => (this.image = \"\")}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/z-avatar/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,SAAS,CAAC;AAEjB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;YAClC,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;SACF;QACD,eAAe,EAAE;YACf,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;SACF;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU,CAAC,MAAM;QACvB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,aAAa;QACxB,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,qEAAqE;KAC7E;CACsB,CAAC;AAE1B,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;cACM,IAAI,CAAC,IAAI;cACT,IAAI,CAAC,IAAI;oBACH,IAAI,CAAC,SAAS;0BACR,IAAI,CAAC,eAAe;eAC/B,IAAI,CAAC,KAAK;iBACR;CACY,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZAvatar} from \".\";\nimport {AvatarSize} from \"../../beans\";\nimport {getColorTokens} from \"../../utils/storybook-utils\";\nimport \"./index\";\n\nconst colorTokens = getColorTokens().map((token) => token.replace(\"--\", \"\"));\n\n/**\n * Pass at least one prop between `text` and `image`.\n * If prop `image` contains a broken URL, the component will show `text` prop, if given.\n */\nconst StoryMeta = {\n title: \"ZAvatar\",\n component: \"z-avatar\",\n argTypes: {\n size: {\n options: Object.values(AvatarSize),\n control: {\n type: \"inline-radio\",\n },\n },\n textColor: {\n options: colorTokens,\n control: {\n type: \"select\",\n },\n },\n backgroundColor: {\n options: colorTokens,\n control: {\n type: \"select\",\n },\n },\n },\n args: {\n size: AvatarSize.MEDIUM,\n text: \"Avatar\",\n textColor: \"color-white\",\n backgroundColor: \"gray700\",\n image: \"https://www.cinematographe.it/wp-content/uploads/2019/04/Avatar.jpg\",\n },\n} satisfies Meta<ZAvatar>;\n\nexport default StoryMeta;\n\nexport const Default = {\n render: (args) =>\n html`<z-avatar\n size=\"${args.size}\"\n text=\"${args.text}\"\n text-color=\"${args.textColor}\"\n background-color=\"${args.backgroundColor}\"\n image=\"${args.image}\"\n ></z-avatar>`,\n} satisfies StoryObj<ZAvatar>;\n"]}
|