@zanichelli/albe-web-components 20.0.2-RC → 21.0.0-RC1
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 +8 -0
- package/dist/cjs/z-app-header_12.cjs.entry.js +7 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/collection/components/z-input/index.js +7 -1
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/{utils.js → p-8C_CrFxp.js} +3 -3
- package/dist/components/p-B3VFztJH.js +6 -0
- package/dist/components/p-B5U9pSXR.js +2 -0
- package/dist/components/{index14.js.map → p-B5U9pSXR.js.map} +1 -1
- package/dist/components/p-B6jtvVtV.js +2 -0
- package/dist/components/{utils2.js.map → p-B6jtvVtV.js.map} +1 -1
- package/dist/components/{_commonjsHelpers.js → p-B85MJLTf.js} +1 -1
- package/dist/components/p-BAguKZnb.js +2 -0
- package/dist/components/{index4.js.map → p-BAguKZnb.js.map} +1 -1
- package/dist/components/p-BbZelagf.js +2 -0
- package/dist/components/{index20.js.map → p-BbZelagf.js.map} +1 -1
- package/dist/components/p-BeSVHdId.js +2 -0
- package/dist/components/{index9.js.map → p-BeSVHdId.js.map} +1 -1
- package/dist/components/p-Bj8MyegH.js +2 -0
- package/dist/components/{index18.js.map → p-Bj8MyegH.js.map} +1 -1
- package/dist/components/p-BoiZb7m1.js +2 -0
- package/dist/components/{index13.js.map → p-BoiZb7m1.js.map} +1 -1
- package/dist/components/p-BolVsvfr.js +2 -0
- package/dist/components/{index5.js.map → p-BolVsvfr.js.map} +1 -1
- package/dist/components/p-CGSP8diU.js +2 -0
- package/dist/components/{index15.js.map → p-CGSP8diU.js.map} +1 -1
- package/dist/components/p-CJjo0ntH.js +2 -0
- package/dist/components/{index12.js.map → p-CJjo0ntH.js.map} +1 -1
- package/dist/components/p-CaSvyuw6.js +2 -0
- package/dist/components/{index17.js.map → p-CaSvyuw6.js.map} +1 -1
- package/dist/components/p-CbXEdwLi.js +2 -0
- package/dist/components/{index3.js.map → p-CbXEdwLi.js.map} +1 -1
- package/dist/components/p-CdBqnUF6.js +2 -0
- package/dist/components/{index7.js.map → p-CdBqnUF6.js.map} +1 -1
- package/dist/components/p-Ch6o4_VN.js +2 -0
- package/dist/components/{index21.js.map → p-Ch6o4_VN.js.map} +1 -1
- package/dist/components/{iconset.js → p-D1c5gR45.js} +1 -1
- package/dist/components/p-D8wde41u.js +2 -0
- package/dist/components/{index16.js.map → p-D8wde41u.js.map} +1 -1
- package/dist/components/p-DL2QAfIP.js +2 -0
- package/dist/components/{index11.js.map → p-DL2QAfIP.js.map} +1 -1
- package/dist/components/{index2.js → p-DdetsoIY.js} +1 -1
- package/dist/components/p-LXvmZzZa.js +2 -0
- package/dist/components/p-LXvmZzZa.js.map +1 -0
- package/dist/components/{breakpoints.js → p-Q-tWjk7P.js} +1 -1
- package/dist/components/p-RmbDDbWd.js +2 -0
- package/dist/components/p-RmbDDbWd.js.map +1 -0
- package/dist/components/p-VP75-vje.js +2 -0
- package/dist/components/{index19.js.map → p-VP75-vje.js.map} +1 -1
- package/dist/components/p-cpTAMdcF.js +2 -0
- package/dist/components/{index8.js.map → p-cpTAMdcF.js.map} +1 -1
- package/dist/components/p-mphirYN3.js +2 -0
- package/dist/components/{index10.js.map → p-mphirYN3.js.map} +1 -1
- package/dist/components/z-accordion.js +1 -1
- package/dist/components/z-accordion.js.map +1 -1
- package/dist/components/z-anchor-navigation.js +1 -1
- package/dist/components/z-anchor-navigation.js.map +1 -1
- package/dist/components/z-app-header.js +1 -1
- package/dist/components/z-app-header.js.map +1 -1
- package/dist/components/z-aria-alert.js +1 -1
- package/dist/components/z-aria-alert.js.map +1 -1
- package/dist/components/z-avatar.js +1 -1
- package/dist/components/z-avatar.js.map +1 -1
- package/dist/components/z-book-card-app.js +1 -1
- package/dist/components/z-book-card-app.js.map +1 -1
- package/dist/components/z-book-card.js +1 -1
- package/dist/components/z-book-card.js.map +1 -1
- package/dist/components/z-book-cover.js +1 -1
- package/dist/components/z-breadcrumb.js +1 -1
- package/dist/components/z-breadcrumb.js.map +1 -1
- package/dist/components/z-button-sort.js +1 -1
- package/dist/components/z-button-sort.js.map +1 -1
- package/dist/components/z-button.js +1 -1
- package/dist/components/z-card.js +1 -1
- package/dist/components/z-card.js.map +1 -1
- package/dist/components/z-carousel.js +1 -1
- package/dist/components/z-carousel.js.map +1 -1
- package/dist/components/z-chip.js +1 -1
- package/dist/components/z-color-picker.js +1 -1
- package/dist/components/z-color-picker.js.map +1 -1
- package/dist/components/z-combobox.js +1 -1
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/components/z-cover-hero.js +1 -1
- package/dist/components/z-cover-hero.js.map +1 -1
- package/dist/components/z-date-picker.js +2 -2
- package/dist/components/z-date-picker.js.map +1 -1
- package/dist/components/z-divider.js +1 -1
- package/dist/components/z-dragdrop-area.js +1 -1
- package/dist/components/z-file-upload.js +1 -1
- package/dist/components/z-file-upload.js.map +1 -1
- package/dist/components/z-file.js +1 -1
- package/dist/components/z-file.js.map +1 -1
- package/dist/components/z-ghost-loading.js +1 -1
- package/dist/components/z-icon.js +1 -1
- package/dist/components/z-info-box.js +1 -1
- package/dist/components/z-info-box.js.map +1 -1
- package/dist/components/z-info-reveal.js +1 -1
- package/dist/components/z-input-message.js +1 -1
- package/dist/components/z-input-range.js +1 -1
- package/dist/components/z-input-range.js.map +1 -1
- package/dist/components/z-input.js +1 -1
- package/dist/components/z-list-element.js +1 -1
- package/dist/components/z-list-group.js +1 -1
- package/dist/components/z-list.js +1 -1
- package/dist/components/z-logo.js +1 -1
- package/dist/components/z-logo.js.map +1 -1
- package/dist/components/z-menu-section.js +1 -1
- package/dist/components/z-menu-section.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-modal.js +1 -1
- package/dist/components/z-navigation-tabs.js +1 -1
- package/dist/components/z-navigation-tabs.js.map +1 -1
- package/dist/components/z-notification.js +1 -1
- package/dist/components/z-notification.js.map +1 -1
- package/dist/components/z-offcanvas.js +1 -1
- package/dist/components/z-pagination.js +1 -1
- package/dist/components/z-pagination.js.map +1 -1
- package/dist/components/z-popover.js +1 -1
- package/dist/components/z-range-picker.js +1 -1
- package/dist/components/z-range-picker.js.map +1 -1
- package/dist/components/z-result-card.js +1 -1
- package/dist/components/z-result-card.js.map +1 -1
- package/dist/components/z-searchbar.js +1 -1
- package/dist/components/z-select.js +1 -1
- package/dist/components/z-select.js.map +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-skip-to-content.js.map +1 -1
- package/dist/components/z-stepper-item.js +1 -1
- package/dist/components/z-stepper-item.js.map +1 -1
- package/dist/components/z-stepper.js +1 -1
- package/dist/components/z-stepper.js.map +1 -1
- package/dist/components/z-table.js +1 -1
- package/dist/components/z-table.js.map +1 -1
- package/dist/components/z-tag.js +1 -1
- package/dist/components/z-tbody.js +1 -1
- package/dist/components/z-tbody.js.map +1 -1
- package/dist/components/z-td.js +1 -1
- package/dist/components/z-td.js.map +1 -1
- package/dist/components/z-tfoot.js +1 -1
- package/dist/components/z-tfoot.js.map +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-th.js.map +1 -1
- package/dist/components/z-thead.js +1 -1
- package/dist/components/z-thead.js.map +1 -1
- package/dist/components/z-toast-notification-list.js +1 -1
- package/dist/components/z-toast-notification-list.js.map +1 -1
- package/dist/components/z-toast-notification.js +3 -3
- package/dist/components/z-toggle-switch.js +1 -1
- package/dist/components/z-toggle-switch.js.map +1 -1
- package/dist/components/z-tool.js +1 -1
- package/dist/components/z-tool.js.map +1 -1
- package/dist/components/z-toolbar.js +1 -1
- package/dist/components/z-toolbar.js.map +1 -1
- package/dist/components/z-tooltip.js +1 -1
- package/dist/components/z-tr.js +1 -1
- package/dist/components/z-tr.js.map +1 -1
- package/dist/components/z-tree-list.js +1 -1
- package/dist/components/z-tree-list.js.map +1 -1
- package/dist/components/z-visually-hidden.js +1 -1
- package/dist/components/z-visually-hidden.js.map +1 -1
- package/dist/esm/z-app-header_12.entry.js +7 -1
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/types/components/z-input/index.d.ts +1 -0
- package/dist/web-components-library/p-e2eea612.entry.js +2 -0
- package/dist/web-components-library/p-e2eea612.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +8 -4
- package/react/components.d.ts +68 -66
- package/react/components.js +134 -69
- package/react/z-accordion.d.ts +12 -0
- package/react/z-accordion.js +18 -0
- package/react/z-anchor-navigation.d.ts +9 -0
- package/react/z-anchor-navigation.js +18 -0
- package/react/z-app-header.d.ts +12 -0
- package/react/z-app-header.js +18 -0
- package/react/z-aria-alert.d.ts +9 -0
- package/react/z-aria-alert.js +18 -0
- package/react/z-avatar.d.ts +9 -0
- package/react/z-avatar.js +18 -0
- package/react/z-book-card-app.d.ts +12 -0
- package/react/z-book-card-app.js +18 -0
- package/react/z-book-card.d.ts +14 -0
- package/react/z-book-card.js +22 -0
- package/react/z-book-cover.d.ts +9 -0
- package/react/z-book-cover.js +18 -0
- package/react/z-breadcrumb.d.ts +12 -0
- package/react/z-breadcrumb.js +18 -0
- package/react/z-button-sort.d.ts +12 -0
- package/react/z-button-sort.js +18 -0
- package/react/z-button.d.ts +9 -0
- package/react/z-button.js +18 -0
- package/react/z-card.d.ts +9 -0
- package/react/z-card.js +18 -0
- package/react/z-carousel.d.ts +14 -0
- package/react/z-carousel.js +18 -0
- package/react/z-chip.d.ts +12 -0
- package/react/z-chip.js +18 -0
- package/react/z-color-picker.d.ts +12 -0
- package/react/z-color-picker.js +18 -0
- package/react/z-combobox.d.ts +12 -0
- package/react/z-combobox.js +18 -0
- package/react/z-cover-hero.d.ts +9 -0
- package/react/z-cover-hero.js +18 -0
- package/react/z-date-picker.d.ts +12 -0
- package/react/z-date-picker.js +18 -0
- package/react/z-divider.d.ts +9 -0
- package/react/z-divider.js +18 -0
- package/react/z-dragdrop-area.d.ts +12 -0
- package/react/z-dragdrop-area.js +18 -0
- package/react/z-file-upload.d.ts +16 -0
- package/react/z-file-upload.js +21 -0
- package/react/z-file.d.ts +12 -0
- package/react/z-file.js +18 -0
- package/react/z-ghost-loading.d.ts +9 -0
- package/react/z-ghost-loading.js +18 -0
- package/react/z-icon.d.ts +9 -0
- package/react/z-icon.js +18 -0
- package/react/z-info-box.d.ts +14 -0
- package/react/z-info-box.js +18 -0
- package/react/z-info-reveal.d.ts +9 -0
- package/react/z-info-reveal.js +18 -0
- package/react/z-input-message.d.ts +9 -0
- package/react/z-input-message.js +18 -0
- package/react/z-input-range.d.ts +13 -0
- package/react/z-input-range.js +21 -0
- package/react/z-input.d.ts +17 -0
- package/react/z-input.js +25 -0
- package/react/z-list-element.d.ts +14 -0
- package/react/z-list-element.js +22 -0
- package/react/z-list-group.d.ts +9 -0
- package/react/z-list-group.js +18 -0
- package/react/z-list.d.ts +9 -0
- package/react/z-list.js +18 -0
- package/react/z-logo.d.ts +9 -0
- package/react/z-logo.js +18 -0
- package/react/z-menu-section.d.ts +13 -0
- package/react/z-menu-section.js +21 -0
- package/react/z-menu.d.ts +13 -0
- package/react/z-menu.js +21 -0
- package/react/z-modal.d.ts +14 -0
- package/react/z-modal.js +22 -0
- package/react/z-navigation-tabs.d.ts +12 -0
- package/react/z-navigation-tabs.js +18 -0
- package/react/z-notification.d.ts +13 -0
- package/react/z-notification.js +21 -0
- package/react/z-offcanvas.d.ts +12 -0
- package/react/z-offcanvas.js +18 -0
- package/react/z-pagination.d.ts +12 -0
- package/react/z-pagination.js +18 -0
- package/react/z-popover.d.ts +17 -0
- package/react/z-popover.js +21 -0
- package/react/z-range-picker.d.ts +12 -0
- package/react/z-range-picker.js +18 -0
- package/react/z-result-card.d.ts +9 -0
- package/react/z-result-card.js +18 -0
- package/react/z-searchbar.d.ts +14 -0
- package/react/z-searchbar.js +22 -0
- package/react/z-select.d.ts +13 -0
- package/react/z-select.js +21 -0
- package/react/z-skip-to-content.d.ts +9 -0
- package/react/z-skip-to-content.js +18 -0
- package/react/z-stepper-item.d.ts +9 -0
- package/react/z-stepper-item.js +18 -0
- package/react/z-stepper.d.ts +9 -0
- package/react/z-stepper.js +18 -0
- package/react/z-table.d.ts +9 -0
- package/react/z-table.js +18 -0
- package/react/z-tag.d.ts +9 -0
- package/react/z-tag.js +18 -0
- package/react/z-tbody.d.ts +9 -0
- package/react/z-tbody.js +18 -0
- package/react/z-td.d.ts +12 -0
- package/react/z-td.js +18 -0
- package/react/z-tfoot.d.ts +9 -0
- package/react/z-tfoot.js +18 -0
- package/react/z-th.d.ts +12 -0
- package/react/z-th.js +18 -0
- package/react/z-thead.d.ts +9 -0
- package/react/z-thead.js +18 -0
- package/react/z-toast-notification-list.d.ts +9 -0
- package/react/z-toast-notification-list.js +18 -0
- package/react/z-toast-notification.d.ts +12 -0
- package/react/z-toast-notification.js +18 -0
- package/react/z-toggle-switch.d.ts +12 -0
- package/react/z-toggle-switch.js +18 -0
- package/react/z-tool.d.ts +13 -0
- package/react/z-tool.js +21 -0
- package/react/z-toolbar.d.ts +9 -0
- package/react/z-toolbar.js +18 -0
- package/react/z-tooltip.d.ts +14 -0
- package/react/z-tooltip.js +18 -0
- package/react/z-tr.d.ts +12 -0
- package/react/z-tr.js +18 -0
- package/react/z-tree-list.d.ts +16 -0
- package/react/z-tree-list.js +18 -0
- package/react/z-visually-hidden.d.ts +9 -0
- package/react/z-visually-hidden.js +18 -0
- package/readme.md +7 -4
- package/www/build/{p-9a93e186.js → p-de6e8c2b.js} +1 -1
- package/www/build/p-e2eea612.entry.js +2 -0
- package/www/build/p-e2eea612.entry.js.map +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/components/index10.js +0 -2
- package/dist/components/index11.js +0 -2
- package/dist/components/index12.js +0 -2
- package/dist/components/index13.js +0 -2
- package/dist/components/index14.js +0 -2
- package/dist/components/index15.js +0 -2
- package/dist/components/index16.js +0 -2
- package/dist/components/index17.js +0 -2
- package/dist/components/index18.js +0 -2
- package/dist/components/index19.js +0 -2
- package/dist/components/index20.js +0 -2
- package/dist/components/index21.js +0 -2
- package/dist/components/index3.js +0 -2
- package/dist/components/index4.js +0 -2
- package/dist/components/index5.js +0 -2
- package/dist/components/index6.js +0 -2
- package/dist/components/index6.js.map +0 -1
- package/dist/components/index7.js +0 -2
- package/dist/components/index8.js +0 -2
- package/dist/components/index9.js +0 -2
- package/dist/components/reactive-controller.js +0 -6
- package/dist/components/utils2.js +0 -2
- package/dist/web-components-library/p-1fad41b2.entry.js +0 -2
- package/dist/web-components-library/p-1fad41b2.entry.js.map +0 -1
- package/react/react-component-lib/createComponent.d.ts +0 -10
- package/react/react-component-lib/createComponent.js +0 -101
- package/react/react-component-lib/createOverlayComponent.d.ts +0 -21
- package/react/react-component-lib/createOverlayComponent.js +0 -115
- package/react/react-component-lib/index.d.ts +0 -2
- package/react/react-component-lib/index.js +0 -7
- package/react/react-component-lib/interfaces.d.ts +0 -29
- package/react/react-component-lib/interfaces.js +0 -2
- package/react/react-component-lib/utils/attachProps.d.ts +0 -16
- package/react/react-component-lib/utils/attachProps.js +0 -115
- package/react/react-component-lib/utils/case.d.ts +0 -2
- package/react/react-component-lib/utils/case.js +0 -11
- package/react/react-component-lib/utils/dev.d.ts +0 -2
- package/react/react-component-lib/utils/dev.js +0 -17
- package/react/react-component-lib/utils/index.d.ts +0 -10
- package/react/react-component-lib/utils/index.js +0 -55
- package/www/build/p-1fad41b2.entry.js +0 -2
- package/www/build/p-1fad41b2.entry.js.map +0 -1
- /package/dist/components/{utils.js.map → p-8C_CrFxp.js.map} +0 -0
- /package/dist/components/{reactive-controller.js.map → p-B3VFztJH.js.map} +0 -0
- /package/dist/components/{_commonjsHelpers.js.map → p-B85MJLTf.js.map} +0 -0
- /package/dist/components/{iconset.js.map → p-D1c5gR45.js.map} +0 -0
- /package/dist/components/{index2.js.map → p-DdetsoIY.js.map} +0 -0
- /package/dist/components/{breakpoints.js.map → p-Q-tWjk7P.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZChip","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","type","ZChipType","DEFAULT","variant","ZChipVariant","OUTLINE","disabled","render","h","key","class","interactiveIcon","undefined","icon","name","onClick","interactiveIconClick","emit","htmlAriaLabel"],"sources":["src/components/z-chip/styles.css?tag=z-chip&encapsulation=scoped","src/components/z-chip/index.tsx"],"sourcesContent":[":host,\n:host * {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n:host > .z-chip-container {\n display: inline-flex;\n min-height: 28px;\n align-items: center;\n padding: 0 calc(var(--space-unit) * 2);\n border: var(--border-size-small) solid var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: 14px;\n color: var(--color-primary01);\n fill: var(--color-default-icon);\n font-family: var(--font-family-sans);\n font-size: 14px;\n font-weight: var(--font-sb);\n gap: var(--space-unit);\n line-height: 1;\n}\n\n:host > .z-chip-container > button {\n position: relative;\n display: flex;\n width: 28px;\n height: 28px;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n background-color: transparent;\n border-radius: 50%;\n cursor: pointer;\n}\n\n:host > .z-chip-container .interactive-icon {\n fill: var(--color-primary01);\n}\n\n:host > .z-chip-container:not([aria-disabled]) button:hover .interactive-icon {\n color: var(--color-hover-primary);\n fill: var(--color-hover-primary);\n}\n\n/* Variants */\n:host > .z-chip-container.filled {\n border-color: transparent;\n background-color: var(--color-primary01);\n color: var(--color-text-inverse);\n fill: var(--color-inverse-icon);\n}\n\n:host > .z-chip-container.filled .interactive-icon {\n fill: var(--color-inverse-icon);\n}\n\n:host > .z-chip-container.filled:not([aria-disabled]) button::before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: var(--color-inverse-icon);\n border-radius: 50%;\n content: \"\";\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n}\n\n:host > .z-chip-container.filled:not([aria-disabled]) button:hover::before {\n opacity: 0.16;\n}\n\n:host > .z-chip-container.filled:not([aria-disabled]) button:hover .interactive-icon {\n color: var(--color-inverse-icon);\n fill: var(--color-inverse-icon);\n}\n\n:host > .z-chip-container.soft {\n border-color: transparent;\n background-color: var(--color-primary02);\n color: var(--color-default-text);\n}\n\n:host > .z-chip-container.soft .interactive-icon {\n fill: var(--color-primary01);\n}\n\n/* Disabled state */\n:host > .z-chip-container[aria-disabled],\n:host > .z-chip-container[aria-disabled] .interactive-icon {\n color: var(--color-disabled03);\n cursor: auto;\n fill: var(--color-disabled03);\n}\n\n:host > .z-chip-container[aria-disabled] {\n border: var(--border-size-small) solid var(--color-disabled01);\n background-color: transparent;\n}\n\n:host > .z-chip-container.filled[aria-disabled],\n:host > .z-chip-container.soft[aria-disabled] {\n border-color: transparent;\n background-color: var(--color-disabled01);\n}\n\n:host > .z-chip-container > button:focus:focus-visible {\n border-radius: 100%;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host > .z-chip-container > z-icon,\n:host > .z-chip-container .interactive-icon {\n --z-icon-width: 22px;\n --z-icon-height: 22px;\n}\n\n/* :host type */\n:host > .z-chip-container.default {\n min-height: 44px;\n border-radius: 22px;\n}\n\n:host > .z-chip-container.medium {\n min-height: 40px;\n border-radius: 22px;\n}\n\n:host > .z-chip-container.small {\n min-height: 36px;\n border-radius: 22px;\n}\n\n/* Desktop breakpoint */\n@media (min-width: 1152px) {\n :host > .z-chip-container {\n padding: 0 calc(var(--space-unit) * 1.5);\n font-size: 12px;\n gap: calc(var(--space-unit) / 2);\n }\n\n /* :host type */\n :host > .z-chip-container.default {\n min-height: 32px;\n border-radius: 16px;\n }\n\n :host > .z-chip-container.medium {\n min-height: 28px;\n border-radius: 16px;\n }\n\n :host > .z-chip-container.small {\n min-height: 24px;\n border-radius: 16px;\n }\n\n :host > .z-chip-container > z-icon,\n :host > .z-chip-container .interactive-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n }\n\n :host > .z-chip-container > button {\n width: 20px;\n height: 20px;\n }\n}\n","import {Component, ComponentInterface, Element, Event, EventEmitter, Prop, h} from \"@stencil/core\";\nimport {ZChipType, ZChipVariant} from \"../../beans\";\n\n@Component({\n tag: \"z-chip\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZChip implements ComponentInterface {\n @Element() el: HTMLZChipElement;\n\n /** Non interactive icon */\n @Prop()\n icon?: string;\n\n /** z-chip size type, can be default, medium or small */\n @Prop({reflect: true})\n type?: ZChipType = ZChipType.DEFAULT;\n\n /** z-chip variant type, can be outline, filled or soft */\n @Prop({reflect: true})\n variant?: ZChipVariant = ZChipVariant.OUTLINE;\n\n /** z-chip interactive icon */\n @Prop({reflect: true})\n interactiveIcon?: string;\n\n /** set z-chip as disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** `aria-label` for the icon button */\n @Prop()\n htmlAriaLabel?: string;\n\n /** click on interactive icon */\n @Event()\n interactiveIconClick: EventEmitter;\n\n render(): HTMLDivElement {\n return (\n <div\n class={{\n \"z-chip-container\": true,\n \"z-chip-interactive\": !!this.interactiveIcon,\n [this.type]: true,\n [this.variant]: true,\n }}\n aria-disabled={this.disabled ? \"true\" : undefined}\n >\n {this.icon && <z-icon name={this.icon} />}\n <slot />\n {this.interactiveIcon && (\n <button\n type=\"button\"\n onClick={() => this.interactiveIconClick.emit()}\n aria-label={this.htmlAriaLabel || undefined}\n disabled={this.disabled}\n >\n <z-icon\n class=\"interactive-icon\"\n name={this.interactiveIcon}\n />\n </button>\n )}\n </div>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZChip","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","type","ZChipType","DEFAULT","variant","ZChipVariant","OUTLINE","disabled","render","h","key","class","interactiveIcon","undefined","icon","name","onClick","interactiveIconClick","emit","htmlAriaLabel"],"sources":["src/components/z-chip/styles.css?tag=z-chip&encapsulation=scoped","src/components/z-chip/index.tsx"],"sourcesContent":[":host,\n:host * {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n:host > .z-chip-container {\n display: inline-flex;\n min-height: 28px;\n align-items: center;\n padding: 0 calc(var(--space-unit) * 2);\n border: var(--border-size-small) solid var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: 14px;\n color: var(--color-primary01);\n fill: var(--color-default-icon);\n font-family: var(--font-family-sans);\n font-size: 14px;\n font-weight: var(--font-sb);\n gap: var(--space-unit);\n line-height: 1;\n}\n\n:host > .z-chip-container > button {\n position: relative;\n display: flex;\n width: 28px;\n height: 28px;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n background-color: transparent;\n border-radius: 50%;\n cursor: pointer;\n}\n\n:host > .z-chip-container .interactive-icon {\n fill: var(--color-primary01);\n}\n\n:host > .z-chip-container:not([aria-disabled]) button:hover .interactive-icon {\n color: var(--color-hover-primary);\n fill: var(--color-hover-primary);\n}\n\n/* Variants */\n:host > .z-chip-container.filled {\n border-color: transparent;\n background-color: var(--color-primary01);\n color: var(--color-text-inverse);\n fill: var(--color-inverse-icon);\n}\n\n:host > .z-chip-container.filled .interactive-icon {\n fill: var(--color-inverse-icon);\n}\n\n:host > .z-chip-container.filled:not([aria-disabled]) button::before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: var(--color-inverse-icon);\n border-radius: 50%;\n content: \"\";\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n}\n\n:host > .z-chip-container.filled:not([aria-disabled]) button:hover::before {\n opacity: 0.16;\n}\n\n:host > .z-chip-container.filled:not([aria-disabled]) button:hover .interactive-icon {\n color: var(--color-inverse-icon);\n fill: var(--color-inverse-icon);\n}\n\n:host > .z-chip-container.soft {\n border-color: transparent;\n background-color: var(--color-primary02);\n color: var(--color-default-text);\n}\n\n:host > .z-chip-container.soft .interactive-icon {\n fill: var(--color-primary01);\n}\n\n/* Disabled state */\n:host > .z-chip-container[aria-disabled],\n:host > .z-chip-container[aria-disabled] .interactive-icon {\n color: var(--color-disabled03);\n cursor: auto;\n fill: var(--color-disabled03);\n}\n\n:host > .z-chip-container[aria-disabled] {\n border: var(--border-size-small) solid var(--color-disabled01);\n background-color: transparent;\n}\n\n:host > .z-chip-container.filled[aria-disabled],\n:host > .z-chip-container.soft[aria-disabled] {\n border-color: transparent;\n background-color: var(--color-disabled01);\n}\n\n:host > .z-chip-container > button:focus:focus-visible {\n border-radius: 100%;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host > .z-chip-container > z-icon,\n:host > .z-chip-container .interactive-icon {\n --z-icon-width: 22px;\n --z-icon-height: 22px;\n}\n\n/* :host type */\n:host > .z-chip-container.default {\n min-height: 44px;\n border-radius: 22px;\n}\n\n:host > .z-chip-container.medium {\n min-height: 40px;\n border-radius: 22px;\n}\n\n:host > .z-chip-container.small {\n min-height: 36px;\n border-radius: 22px;\n}\n\n/* Desktop breakpoint */\n@media (min-width: 1152px) {\n :host > .z-chip-container {\n padding: 0 calc(var(--space-unit) * 1.5);\n font-size: 12px;\n gap: calc(var(--space-unit) / 2);\n }\n\n /* :host type */\n :host > .z-chip-container.default {\n min-height: 32px;\n border-radius: 16px;\n }\n\n :host > .z-chip-container.medium {\n min-height: 28px;\n border-radius: 16px;\n }\n\n :host > .z-chip-container.small {\n min-height: 24px;\n border-radius: 16px;\n }\n\n :host > .z-chip-container > z-icon,\n :host > .z-chip-container .interactive-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n }\n\n :host > .z-chip-container > button {\n width: 20px;\n height: 20px;\n }\n}\n","import {Component, ComponentInterface, Element, Event, EventEmitter, Prop, h} from \"@stencil/core\";\nimport {ZChipType, ZChipVariant} from \"../../beans\";\n\n@Component({\n tag: \"z-chip\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZChip implements ComponentInterface {\n @Element() el: HTMLZChipElement;\n\n /** Non interactive icon */\n @Prop()\n icon?: string;\n\n /** z-chip size type, can be default, medium or small */\n @Prop({reflect: true})\n type?: ZChipType = ZChipType.DEFAULT;\n\n /** z-chip variant type, can be outline, filled or soft */\n @Prop({reflect: true})\n variant?: ZChipVariant = ZChipVariant.OUTLINE;\n\n /** z-chip interactive icon */\n @Prop({reflect: true})\n interactiveIcon?: string;\n\n /** set z-chip as disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** `aria-label` for the icon button */\n @Prop()\n htmlAriaLabel?: string;\n\n /** click on interactive icon */\n @Event()\n interactiveIconClick: EventEmitter;\n\n render(): HTMLDivElement {\n return (\n <div\n class={{\n \"z-chip-container\": true,\n \"z-chip-interactive\": !!this.interactiveIcon,\n [this.type]: true,\n [this.variant]: true,\n }}\n aria-disabled={this.disabled ? \"true\" : undefined}\n >\n {this.icon && <z-icon name={this.icon} />}\n <slot />\n {this.interactiveIcon && (\n <button\n type=\"button\"\n onClick={() => this.interactiveIconClick.emit()}\n aria-label={this.htmlAriaLabel || undefined}\n disabled={this.disabled}\n >\n <z-icon\n class=\"interactive-icon\"\n name={this.interactiveIcon}\n />\n </button>\n )}\n </div>\n );\n }\n}\n"],"mappings":"+IAAA,MAAMA,EAAY,IAAM,yzH,MCSXC,EAAKC,EAAA,MAAAD,UAAAE,EANlB,WAAAC,CAAAC,G,uGAeEC,KAAAC,KAAmBC,EAAUC,QAI7BH,KAAAI,QAAyBC,EAAaC,QAQtCN,KAAAO,SAAqB,KAuCtB,CA7BC,MAAAC,GACE,OACEC,EAAA,OAAAC,IAAA,2CACEC,MAAO,CACL,mBAAoB,KACpB,uBAAwBX,KAAKY,gBAC7B,CAACZ,KAAKC,MAAO,KACb,CAACD,KAAKI,SAAU,MACjB,gBACcJ,KAAKO,SAAW,OAASM,WAEvCb,KAAKc,MAAQL,EAAA,UAAAC,IAAA,2CAAQK,KAAMf,KAAKc,OACjCL,EAAA,QAAAC,IAAA,6CACCV,KAAKY,iBACJH,EAAA,UAAAC,IAAA,2CACET,KAAK,SACLe,QAAS,IAAMhB,KAAKiB,qBAAqBC,OAAM,aACnClB,KAAKmB,eAAiBN,UAClCN,SAAUP,KAAKO,UAEfE,EAAA,UAAAC,IAAA,2CACEC,MAAM,mBACNI,KAAMf,KAAKY,mB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as t,H as a,h as e,d as i,t as s}from"./p-RmbDDbWd.js";import{d as r}from"./p-CbXEdwLi.js";const c=()=>`.sc-z-tag-h{--z-icon-width:14px;--z-icon-height:14px;display:flex;width:fit-content;max-width:inherit;height:fit-content;max-height:inherit;align-items:flex-start;padding:calc(var(--space-unit) / 2);background-color:var(--z-tag-bg, var(--color-hover-primary));border-radius:var(--border-radius);color:var(--z-tag-text-color, var(--color-text-inverse));fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);letter-spacing:0.32px;line-height:14px;text-transform:uppercase}.sc-z-tag-h>z-icon.sc-z-tag{margin-right:0;transition:margin-right 0.3s ease-out}.has-text.sc-z-tag-h:not(.expandable)>z-icon.sc-z-tag{margin-right:var(--space-unit)}.has-text.expandable.sc-z-tag-h:hover>z-icon.sc-z-tag{margin-right:var(--space-unit)}.expandable.sc-z-tag-h>div.sc-z-tag{overflow:hidden;max-width:0;max-height:0}.expandable.sc-z-tag-h:hover>div.sc-z-tag{max-width:100%;max-height:100%}`;const n=t(class t extends a{constructor(t){super();if(t!==false){this.__registerHost()}}render(){return e(i,{key:"656a936ce4073db7a7895cac9f07e1ba6b9b5c2f",class:{expandable:this.expandable&&!!this.icon,"has-text":!!this.host.textContent.trim()}},this.icon&&e("z-icon",{key:"df213cce44c020028985d53064c3d0cd1ba645e9",name:this.icon}),e("div",{key:"2fa92332ae99d54527d7ab347e66f4424d241cf3"},e("slot",{key:"c52c05d031edbe81a9547c72479dae5c8d924a60"})))}get host(){return this}static get style(){return c()}},[262,"z-tag",{icon:[1],expandable:[4]}]);function o(){if(typeof customElements==="undefined"){return}const t=["z-tag","z-icon"];t.forEach((t=>{switch(t){case"z-tag":if(!customElements.get(s(t))){customElements.define(s(t),n)}break;case"z-icon":if(!customElements.get(s(t))){r()}break}}))}export{n as Z,o as d};
|
|
2
|
+
//# sourceMappingURL=p-BoiZb7m1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZTag","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key","class","expandable","this","icon","host","textContent","trim","name"],"sources":["src/components/z-tag/styles.css?tag=z-tag&encapsulation=scoped","src/components/z-tag/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-tag-text-color: text and icon color using tokens.\n * @prop --z-tag-bg: background color of the z-tag.\n */\n\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n\n display: flex;\n width: fit-content;\n max-width: inherit;\n height: fit-content;\n max-height: inherit;\n align-items: flex-start;\n padding: calc(var(--space-unit) / 2);\n background-color: var(--z-tag-bg, var(--color-hover-primary));\n border-radius: var(--border-radius);\n color: var(--z-tag-text-color, var(--color-text-inverse));\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: var(--font-size-1);\n font-weight: var(--font-sb);\n letter-spacing: 0.32px;\n line-height: 14px;\n text-transform: uppercase;\n}\n\n:host > z-icon {\n margin-right: 0;\n transition: margin-right 0.3s ease-out;\n}\n\n:host(.has-text):not(.expandable) > z-icon {\n margin-right: var(--space-unit);\n}\n\n:host(.has-text).expandable:hover > z-icon {\n margin-right: var(--space-unit);\n}\n\n:host(.expandable) > div {\n overflow: hidden;\n max-width: 0;\n max-height: 0;\n}\n\n:host(.expandable:hover) > div {\n max-width: 100%;\n max-height: 100%;\n}\n","import {Component, ComponentInterface, Element, Host, Prop, h} from \"@stencil/core\";\n\n/**\n * Ztag component.\n * @slot - The text of the z-tag.\n */\n@Component({\n tag: \"z-tag\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZTag implements ComponentInterface {\n @Element() host: HTMLZTagElement;\n\n /** [optional] Tag icon */\n @Prop()\n icon?: string;\n\n /** [optional] Hide the text and show it on hover*/\n @Prop()\n expandable?: boolean;\n\n render(): HTMLZTagElement {\n return (\n <Host\n class={{\n \"expandable\": this.expandable && !!this.icon,\n \"has-text\": !!this.host.textContent.trim(),\n }}\n >\n {this.icon && <z-icon name={this.icon} />}\n <div>\n <slot />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZTag","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key","class","expandable","this","icon","host","textContent","trim","name"],"sources":["src/components/z-tag/styles.css?tag=z-tag&encapsulation=scoped","src/components/z-tag/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-tag-text-color: text and icon color using tokens.\n * @prop --z-tag-bg: background color of the z-tag.\n */\n\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n\n display: flex;\n width: fit-content;\n max-width: inherit;\n height: fit-content;\n max-height: inherit;\n align-items: flex-start;\n padding: calc(var(--space-unit) / 2);\n background-color: var(--z-tag-bg, var(--color-hover-primary));\n border-radius: var(--border-radius);\n color: var(--z-tag-text-color, var(--color-text-inverse));\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: var(--font-size-1);\n font-weight: var(--font-sb);\n letter-spacing: 0.32px;\n line-height: 14px;\n text-transform: uppercase;\n}\n\n:host > z-icon {\n margin-right: 0;\n transition: margin-right 0.3s ease-out;\n}\n\n:host(.has-text):not(.expandable) > z-icon {\n margin-right: var(--space-unit);\n}\n\n:host(.has-text).expandable:hover > z-icon {\n margin-right: var(--space-unit);\n}\n\n:host(.expandable) > div {\n overflow: hidden;\n max-width: 0;\n max-height: 0;\n}\n\n:host(.expandable:hover) > div {\n max-width: 100%;\n max-height: 100%;\n}\n","import {Component, ComponentInterface, Element, Host, Prop, h} from \"@stencil/core\";\n\n/**\n * Ztag component.\n * @slot - The text of the z-tag.\n */\n@Component({\n tag: \"z-tag\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZTag implements ComponentInterface {\n @Element() host: HTMLZTagElement;\n\n /** [optional] Tag icon */\n @Prop()\n icon?: string;\n\n /** [optional] Hide the text and show it on hover*/\n @Prop()\n expandable?: boolean;\n\n render(): HTMLZTagElement {\n return (\n <Host\n class={{\n \"expandable\": this.expandable && !!this.icon,\n \"has-text\": !!this.host.textContent.trim(),\n }}\n >\n {this.icon && <z-icon name={this.icon} />}\n <div>\n <slot />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAY,IAAM,k6B,MCYXC,EAAIC,EAAA,MAAAD,UAAAE,E,4DAWf,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACLC,WAAcC,KAAKD,cAAgBC,KAAKC,KACxC,aAAcD,KAAKE,KAAKC,YAAYC,SAGrCJ,KAAKC,MAAQN,EAAA,UAAAE,IAAA,2CAAQQ,KAAML,KAAKC,OACjCN,EAAA,OAAAE,IAAA,4CACEF,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as i,H as d,h as e,d as r,t as s}from"./p-RmbDDbWd.js";import{D as t,h as a}from"./p-DdetsoIY.js";const v=()=>`.sc-z-divider-h{display:block;padding:0;margin:0}.divider-horizontal.sc-z-divider-h{width:100%}.divider-vertical.sc-z-divider-h{height:100%}.divider-small.divider-horizontal.sc-z-divider-h{height:var(--border-size-small)}.divider-medium.divider-horizontal.sc-z-divider-h{height:var(--border-size-medium)}.divider-large.divider-horizontal.sc-z-divider-h{height:var(--border-size-large)}.divider-small.divider-vertical.sc-z-divider-h{width:var(--border-size-small)}.divider-medium.divider-vertical.sc-z-divider-h{width:var(--border-size-medium)}.divider-large.divider-vertical.sc-z-divider-h{width:var(--border-size-large)}`;const o=i(class i extends d{constructor(i){super();if(i!==false){this.__registerHost()}this.size=t.SMALL;this.color="gray200";this.orientation=a.HORIZONTAL}render(){return e(r,{key:"372389b3d857bf0c3cc5ad9191224bc1b0c94580",class:`divider-${this.size} divider-${this.orientation}`,style:{backgroundColor:`var(--${this.color})`}})}static get style(){return v()}},[2,"z-divider",{size:[1],color:[1],orientation:[1]}]);function c(){if(typeof customElements==="undefined"){return}const i=["z-divider"];i.forEach((i=>{switch(i){case"z-divider":if(!customElements.get(s(i))){customElements.define(s(i),o)}break}}))}export{o as Z,c as d};
|
|
2
|
+
//# sourceMappingURL=p-BolVsvfr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZDivider","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","size","DividerSize","SMALL","color","orientation","DividerOrientation","HORIZONTAL","render","h","Host","key","class","style","backgroundColor"],"sources":["src/components/z-divider/styles.css?tag=z-divider&encapsulation=scoped","src/components/z-divider/index.tsx"],"sourcesContent":[":host {\n display: block;\n padding: 0;\n margin: 0;\n}\n\n:host.divider-horizontal {\n width: 100%;\n}\n\n:host.divider-vertical {\n height: 100%;\n}\n\n:host.divider-small.divider-horizontal {\n height: var(--border-size-small);\n}\n\n:host.divider-medium.divider-horizontal {\n height: var(--border-size-medium);\n}\n\n:host.divider-large.divider-horizontal {\n height: var(--border-size-large);\n}\n\n:host.divider-small.divider-vertical {\n width: var(--border-size-small);\n}\n\n:host.divider-medium.divider-vertical {\n width: var(--border-size-medium);\n}\n\n:host.divider-large.divider-vertical {\n width: var(--border-size-large);\n}\n","import {Component, ComponentInterface, Host, Prop, h} from \"@stencil/core\";\nimport {DividerOrientation, DividerSize} from \"../../beans\";\n@Component({\n tag: \"z-divider\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZDivider implements ComponentInterface {\n /** [optional] Divider size */\n @Prop()\n size?: DividerSize = DividerSize.SMALL;\n\n /** [optional] Divider color */\n @Prop()\n color?: string = \"gray200\";\n\n /** [optional] Divider orintation */\n @Prop()\n orientation?: DividerOrientation = DividerOrientation.HORIZONTAL;\n\n render(): HTMLZDividerElement {\n return (\n <Host\n class={`divider-${this.size} divider-${this.orientation}`}\n style={{backgroundColor: `var(--${this.color})`}}\n />\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZDivider","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","size","DividerSize","SMALL","color","orientation","DividerOrientation","HORIZONTAL","render","h","Host","key","class","style","backgroundColor"],"sources":["src/components/z-divider/styles.css?tag=z-divider&encapsulation=scoped","src/components/z-divider/index.tsx"],"sourcesContent":[":host {\n display: block;\n padding: 0;\n margin: 0;\n}\n\n:host.divider-horizontal {\n width: 100%;\n}\n\n:host.divider-vertical {\n height: 100%;\n}\n\n:host.divider-small.divider-horizontal {\n height: var(--border-size-small);\n}\n\n:host.divider-medium.divider-horizontal {\n height: var(--border-size-medium);\n}\n\n:host.divider-large.divider-horizontal {\n height: var(--border-size-large);\n}\n\n:host.divider-small.divider-vertical {\n width: var(--border-size-small);\n}\n\n:host.divider-medium.divider-vertical {\n width: var(--border-size-medium);\n}\n\n:host.divider-large.divider-vertical {\n width: var(--border-size-large);\n}\n","import {Component, ComponentInterface, Host, Prop, h} from \"@stencil/core\";\nimport {DividerOrientation, DividerSize} from \"../../beans\";\n@Component({\n tag: \"z-divider\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZDivider implements ComponentInterface {\n /** [optional] Divider size */\n @Prop()\n size?: DividerSize = DividerSize.SMALL;\n\n /** [optional] Divider color */\n @Prop()\n color?: string = \"gray200\";\n\n /** [optional] Divider orintation */\n @Prop()\n orientation?: DividerOrientation = DividerOrientation.HORIZONTAL;\n\n render(): HTMLZDividerElement {\n return (\n <Host\n class={`divider-${this.size} divider-${this.orientation}`}\n style={{backgroundColor: `var(--${this.color})`}}\n />\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAY,IAAM,gnB,MCQXC,EAAQC,EAAA,MAAAD,UAAAE,EANrB,WAAAC,CAAAC,G,4CASEC,KAAAC,KAAqBC,EAAYC,MAIjCH,KAAAI,MAAiB,UAIjBJ,KAAAK,YAAmCC,EAAmBC,UAUvD,CARC,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,WAAWZ,KAAKC,gBAAgBD,KAAKK,cAC5CQ,MAAO,CAACC,gBAAiB,SAASd,KAAKI,W","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as i,h as t,d as o,t as a}from"./p-RmbDDbWd.js";import{M as n,e as r}from"./p-DdetsoIY.js";import{d as s}from"./p-CbXEdwLi.js";const l=()=>`:host{--z-info-reveal-panel-width:384px;--trigger-size:44px;position:relative}:host *{box-sizing:border-box}button{--trigger-icon-size:calc(var(--trigger-size) / 2);display:flex;align-items:center;justify-content:center;padding:0;border:none;background-color:transparent;cursor:pointer;font-family:inherit;letter-spacing:inherit}button:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-info-reveal-trigger{min-width:var(--trigger-size);height:var(--trigger-size);padding:calc((var(--trigger-size) - var(--trigger-icon-size)) / 2);background-color:var(--color-surface05);border-radius:var(--border-radius);color:var(--color-text-inverse);column-gap:var(--space-unit);font-weight:var(--font-sb);line-height:1rem}:host([size="big"]) .z-info-reveal-trigger{font-size:var(--font-size-2)}:host([size="small"]) .z-info-reveal-trigger{--trigger-size:36px;font-size:var(--font-size-2)}:host([size="x-small"]) .z-info-reveal-trigger{--trigger-size:32px;padding:var(--space-unit);font-size:var(--font-size-1)}:host>.z-info-reveal-trigger z-icon{--z-icon-width:var(--trigger-icon-size);--z-icon-height:var(--trigger-icon-size);display:flex;fill:var(--color-inverse-icon)}:host([size="small"])>.z-info-reveal-trigger z-icon{--trigger-icon-size:var(--trigger-icon-size-small, 18px)}:host([size="x-small"])>.z-info-reveal-trigger z-icon{--trigger-icon-size:var(--trigger-icon-size-x-small, 16px)}.z-info-reveal-panel{position:absolute;z-index:19;display:flex;width:var(--z-info-reveal-panel-width);height:fit-content;align-items:flex-start;padding:calc(var(--space-unit) * 1.5);background-color:var(--color-surface05);border-radius:var(--border-radius);box-shadow:var(--shadow-4);color:var(--color-text-inverse);column-gap:var(--space-unit)}.z-info-reveal-panel[hidden]{display:none}:host([position="top_left"]) .z-info-reveal-panel,:host([position="top_right"]) .z-info-reveal-panel{top:0}:host([position="bottom_left"]) .z-info-reveal-panel,:host([position="bottom_right"]) .z-info-reveal-panel{bottom:0}:host([position="top_right"]) .z-info-reveal-panel,:host([position="bottom_right"]) .z-info-reveal-panel{right:0}:host([position="top_left"]) .z-info-reveal-panel,:host([position="bottom_left"]) .z-info-reveal-panel{left:0}.z-info-reveal-panel .z-info-reveal-close{margin-left:auto}.z-info-reveal-panel z-icon{fill:var(--color-inverse-icon)}@media (max-width: 767px){.z-info-reveal-panel{top:auto !important;bottom:auto !important;width:calc(var(--z-info-reveal-panel-width) - (var(--grid-margin) * 4)) !important;margin-top:calc(var(--trigger-size) * -1)}}`;const c=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.icon="informationsource";this.position=n.BOTTOM_RIGHT;this.htmlAriaLabel="Apri pannello informazioni";this.size=r.BIG;this.open=false}adjustPanelPosition(){if(!this.open||!this.panel){return}const e=this.host.getBoundingClientRect();const i=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--grid-margin"),10);const t=document.documentElement.offsetWidth;const o=Math.round((this.position.includes("left")?t-e.left:e.right)-i);this.panel.style.maxWidth=`${o}px`}togglePanel(){this.open=!this.open}closePanel(){this.open=false}handleEscapeKey(e){if(e.key==="Escape"&&this.open){this.closePanel()}}render(){return t(o,{key:"456b67472d702e40b1538bdc69a9342644628efb",open:this.open},t("button",{key:"e1e841a3501d121f20d4df94933be44823914780",class:"z-info-reveal-trigger",type:"button",onClick:this.togglePanel.bind(this),"aria-label":!this.label?this.htmlAriaLabel||undefined:undefined,"aria-expanded":this.open?"true":"false","aria-controls":"z-info-reveal-panel"},this.icon&&t("z-icon",{key:"cd5bb0cba3669a6f9eee1e5160100da91aae4a16",name:this.icon}),this.label&&t("span",{key:"d2406f47dc98ad9c7a5270ea0f37f6b5fc6d3352",class:"z-info-reveal-label"},this.label)),t("div",{key:"1b7909bedb5fd4932c132dc39d0900b64f6a4270",class:"z-info-reveal-panel",id:"z-info-reveal-panel",ref:e=>this.panel=e,hidden:!this.open},t("slot",{key:"c2e848d9baeb458f7ef496d89b20371cff1ffddb"}),t("button",{key:"2db2647813ecbd127d141df0ea08cfca9eaf2677",class:"z-info-reveal-close",type:"button",onClick:this.closePanel.bind(this),"aria-label":"Chiudi pannello informazioni"},t("z-icon",{key:"5c37b3a18b053f953d91a299bd19008866e8c1f4",name:"multiply"}))))}get host(){return this}static get watchers(){return{position:[{adjustPanelPosition:0}],open:[{adjustPanelPosition:0}]}}static get style(){return l()}},[257,"z-info-reveal",{icon:[1],position:[513],label:[1],htmlAriaLabel:[1,"html-aria-label"],size:[513],open:[32]},[[9,"resize","adjustPanelPosition"],[10,"keydown","handleEscapeKey"]],{position:[{adjustPanelPosition:0}],open:[{adjustPanelPosition:0}]}]);function f(){if(typeof customElements==="undefined"){return}const e=["z-info-reveal","z-icon"];e.forEach((e=>{switch(e){case"z-info-reveal":if(!customElements.get(a(e))){customElements.define(a(e),c)}break;case"z-icon":if(!customElements.get(a(e))){s()}break}}))}export{c as Z,f as d};
|
|
2
|
+
//# sourceMappingURL=p-CGSP8diU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZInfoReveal","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","icon","position","InfoRevealPosition","BOTTOM_RIGHT","htmlAriaLabel","size","ControlSize","BIG","open","adjustPanelPosition","panel","rect","host","getBoundingClientRect","gridMargin","parseInt","getComputedStyle","document","documentElement","getPropertyValue","pageWidth","offsetWidth","availableSpace","Math","round","includes","left","right","style","maxWidth","togglePanel","closePanel","handleEscapeKey","event","key","render","h","Host","class","type","onClick","bind","label","undefined","name","id","ref","el","hidden"],"sources":["src/components/z-info-reveal/styles.css?tag=z-info-reveal&encapsulation=shadow","src/components/z-info-reveal/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-info-reveal-panel-width: Width of the info panel.\n * @prop --trigger-icon-size: Size of the trigger icon for big size.\n * @prop --trigger-icon-size-small: Size of the trigger icon for small size.\n * @prop --trigger-icon-size-x-small: Size of the trigger icon for x-small size.\n */\n --z-info-reveal-panel-width: 384px; /* defaults to half the maximum size of the mobile breakpoint */\n --trigger-size: 44px;\n\n position: relative;\n}\n\n:host * {\n box-sizing: border-box;\n}\n\nbutton {\n --trigger-icon-size: calc(var(--trigger-size) / 2);\n\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n background-color: transparent;\n cursor: pointer;\n font-family: inherit;\n letter-spacing: inherit;\n}\n\nbutton:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-info-reveal-trigger {\n min-width: var(--trigger-size);\n height: var(--trigger-size);\n padding: calc((var(--trigger-size) - var(--trigger-icon-size)) / 2);\n background-color: var(--color-surface05);\n border-radius: var(--border-radius);\n color: var(--color-text-inverse);\n column-gap: var(--space-unit);\n font-weight: var(--font-sb);\n line-height: 1rem;\n}\n\n:host([size=\"big\"]) .z-info-reveal-trigger {\n font-size: var(--font-size-2);\n}\n\n:host([size=\"small\"]) .z-info-reveal-trigger {\n --trigger-size: 36px;\n\n font-size: var(--font-size-2);\n}\n\n:host([size=\"x-small\"]) .z-info-reveal-trigger {\n --trigger-size: 32px;\n\n padding: var(--space-unit);\n font-size: var(--font-size-1);\n}\n\n:host > .z-info-reveal-trigger z-icon {\n --z-icon-width: var(--trigger-icon-size);\n --z-icon-height: var(--trigger-icon-size);\n\n display: flex;\n fill: var(--color-inverse-icon);\n}\n\n:host([size=\"small\"]) > .z-info-reveal-trigger z-icon {\n --trigger-icon-size: var(--trigger-icon-size-small, 18px);\n}\n\n:host([size=\"x-small\"]) > .z-info-reveal-trigger z-icon {\n --trigger-icon-size: var(--trigger-icon-size-x-small, 16px);\n}\n\n.z-info-reveal-panel {\n position: absolute;\n z-index: 19;\n display: flex;\n width: var(--z-info-reveal-panel-width);\n height: fit-content;\n align-items: flex-start;\n padding: calc(var(--space-unit) * 1.5);\n background-color: var(--color-surface05);\n border-radius: var(--border-radius);\n box-shadow: var(--shadow-4);\n color: var(--color-text-inverse);\n column-gap: var(--space-unit);\n}\n\n.z-info-reveal-panel[hidden] {\n display: none;\n}\n\n:host([position=\"top_left\"]) .z-info-reveal-panel,\n:host([position=\"top_right\"]) .z-info-reveal-panel {\n top: 0;\n}\n\n:host([position=\"bottom_left\"]) .z-info-reveal-panel,\n:host([position=\"bottom_right\"]) .z-info-reveal-panel {\n bottom: 0;\n}\n\n:host([position=\"top_right\"]) .z-info-reveal-panel,\n:host([position=\"bottom_right\"]) .z-info-reveal-panel {\n right: 0;\n}\n\n:host([position=\"top_left\"]) .z-info-reveal-panel,\n:host([position=\"bottom_left\"]) .z-info-reveal-panel {\n left: 0;\n}\n\n.z-info-reveal-panel .z-info-reveal-close {\n margin-left: auto;\n}\n\n.z-info-reveal-panel z-icon {\n fill: var(--color-inverse-icon);\n}\n\n@media (max-width: 767px) {\n .z-info-reveal-panel {\n top: auto !important;\n bottom: auto !important;\n width: calc(var(--z-info-reveal-panel-width) - (var(--grid-margin) * 4)) !important;\n margin-top: calc(var(--trigger-size) * -1);\n }\n}\n","import {Component, ComponentInterface, Element, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ControlSize, InfoRevealPosition} from \"../../beans\";\n\n/**\n * Info reveal component.\n *\n * @slot - content of the info panel.\n */\n@Component({\n tag: \"z-info-reveal\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZInfoReveal implements ComponentInterface {\n /** Name of the icon for the trigger button */\n @Prop()\n icon? = \"informationsource\";\n\n /**\n * The position of the z-info-reveal in the page. This helps to correctly place the info panel.\n * The panel will grow in the opposite direction of the position.\n * For example, with the default position `BOTTOM_RIGHT`, the panel will grow vertically upwards and horizontally to the left.\n */\n @Prop({reflect: true})\n position?: InfoRevealPosition = InfoRevealPosition.BOTTOM_RIGHT;\n\n /** Label of the trigger button. */\n @Prop()\n label?: string;\n\n /** `aria-label` of the trigger button. It will be used only when the `label` prop is empty. */\n @Prop()\n htmlAriaLabel = \"Apri pannello informazioni\";\n\n /** Size of the trigger button */\n @Prop({reflect: true})\n size?: ControlSize = ControlSize.BIG;\n\n /** Whether the info panel is open. */\n @State()\n open = false;\n\n @Element() host: HTMLZInfoRevealElement;\n\n private panel: HTMLDivElement;\n\n /**\n * Adjust the position of the info panel to prevent exiting the viewport.\n */\n @Watch(\"position\")\n @Watch(\"open\")\n @Listen(\"resize\", {target: \"window\", passive: true})\n adjustPanelPosition(): void {\n if (!this.open || !this.panel) {\n return;\n }\n\n const rect = this.host.getBoundingClientRect();\n const gridMargin = parseInt(getComputedStyle(document.documentElement).getPropertyValue(\"--grid-margin\"), 10);\n const pageWidth = document.documentElement.offsetWidth;\n // Available space for the info panel to grow towards the edge of the page, based on the `position` prop.\n const availableSpace = Math.round(\n (this.position.includes(\"left\") ? pageWidth - rect.left : rect.right) - gridMargin\n );\n this.panel.style.maxWidth = `${availableSpace}px`;\n }\n\n /**\n * Toggle the open state of the info panel.\n */\n private togglePanel(): void {\n this.open = !this.open;\n }\n\n /**\n * Close the info panel.\n */\n private closePanel(): void {\n this.open = false;\n }\n\n @Listen(\"keydown\", {target: \"window\", capture: true})\n handleEscapeKey(event: KeyboardEvent): void {\n if (event.key === \"Escape\" && this.open) {\n this.closePanel();\n }\n }\n\n render(): HTMLZInfoRevealElement {\n return (\n <Host open={this.open}>\n <button\n class=\"z-info-reveal-trigger\"\n type=\"button\"\n onClick={this.togglePanel.bind(this)}\n aria-label={!this.label ? this.htmlAriaLabel || undefined : undefined}\n aria-expanded={this.open ? \"true\" : \"false\"}\n aria-controls=\"z-info-reveal-panel\"\n >\n {this.icon && <z-icon name={this.icon} />}\n {this.label && <span class=\"z-info-reveal-label\">{this.label}</span>}\n </button>\n <div\n class=\"z-info-reveal-panel\"\n id=\"z-info-reveal-panel\"\n ref={(el) => (this.panel = el)}\n hidden={!this.open}\n >\n <slot></slot>\n <button\n class=\"z-info-reveal-close\"\n type=\"button\"\n onClick={this.closePanel.bind(this)}\n aria-label=\"Chiudi pannello informazioni\"\n >\n <z-icon name=\"multiply\" />\n </button>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZInfoReveal","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","icon","position","InfoRevealPosition","BOTTOM_RIGHT","htmlAriaLabel","size","ControlSize","BIG","open","adjustPanelPosition","panel","rect","host","getBoundingClientRect","gridMargin","parseInt","getComputedStyle","document","documentElement","getPropertyValue","pageWidth","offsetWidth","availableSpace","Math","round","includes","left","right","style","maxWidth","togglePanel","closePanel","handleEscapeKey","event","key","render","h","Host","class","type","onClick","bind","label","undefined","name","id","ref","el","hidden"],"sources":["src/components/z-info-reveal/styles.css?tag=z-info-reveal&encapsulation=shadow","src/components/z-info-reveal/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-info-reveal-panel-width: Width of the info panel.\n * @prop --trigger-icon-size: Size of the trigger icon for big size.\n * @prop --trigger-icon-size-small: Size of the trigger icon for small size.\n * @prop --trigger-icon-size-x-small: Size of the trigger icon for x-small size.\n */\n --z-info-reveal-panel-width: 384px; /* defaults to half the maximum size of the mobile breakpoint */\n --trigger-size: 44px;\n\n position: relative;\n}\n\n:host * {\n box-sizing: border-box;\n}\n\nbutton {\n --trigger-icon-size: calc(var(--trigger-size) / 2);\n\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n background-color: transparent;\n cursor: pointer;\n font-family: inherit;\n letter-spacing: inherit;\n}\n\nbutton:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-info-reveal-trigger {\n min-width: var(--trigger-size);\n height: var(--trigger-size);\n padding: calc((var(--trigger-size) - var(--trigger-icon-size)) / 2);\n background-color: var(--color-surface05);\n border-radius: var(--border-radius);\n color: var(--color-text-inverse);\n column-gap: var(--space-unit);\n font-weight: var(--font-sb);\n line-height: 1rem;\n}\n\n:host([size=\"big\"]) .z-info-reveal-trigger {\n font-size: var(--font-size-2);\n}\n\n:host([size=\"small\"]) .z-info-reveal-trigger {\n --trigger-size: 36px;\n\n font-size: var(--font-size-2);\n}\n\n:host([size=\"x-small\"]) .z-info-reveal-trigger {\n --trigger-size: 32px;\n\n padding: var(--space-unit);\n font-size: var(--font-size-1);\n}\n\n:host > .z-info-reveal-trigger z-icon {\n --z-icon-width: var(--trigger-icon-size);\n --z-icon-height: var(--trigger-icon-size);\n\n display: flex;\n fill: var(--color-inverse-icon);\n}\n\n:host([size=\"small\"]) > .z-info-reveal-trigger z-icon {\n --trigger-icon-size: var(--trigger-icon-size-small, 18px);\n}\n\n:host([size=\"x-small\"]) > .z-info-reveal-trigger z-icon {\n --trigger-icon-size: var(--trigger-icon-size-x-small, 16px);\n}\n\n.z-info-reveal-panel {\n position: absolute;\n z-index: 19;\n display: flex;\n width: var(--z-info-reveal-panel-width);\n height: fit-content;\n align-items: flex-start;\n padding: calc(var(--space-unit) * 1.5);\n background-color: var(--color-surface05);\n border-radius: var(--border-radius);\n box-shadow: var(--shadow-4);\n color: var(--color-text-inverse);\n column-gap: var(--space-unit);\n}\n\n.z-info-reveal-panel[hidden] {\n display: none;\n}\n\n:host([position=\"top_left\"]) .z-info-reveal-panel,\n:host([position=\"top_right\"]) .z-info-reveal-panel {\n top: 0;\n}\n\n:host([position=\"bottom_left\"]) .z-info-reveal-panel,\n:host([position=\"bottom_right\"]) .z-info-reveal-panel {\n bottom: 0;\n}\n\n:host([position=\"top_right\"]) .z-info-reveal-panel,\n:host([position=\"bottom_right\"]) .z-info-reveal-panel {\n right: 0;\n}\n\n:host([position=\"top_left\"]) .z-info-reveal-panel,\n:host([position=\"bottom_left\"]) .z-info-reveal-panel {\n left: 0;\n}\n\n.z-info-reveal-panel .z-info-reveal-close {\n margin-left: auto;\n}\n\n.z-info-reveal-panel z-icon {\n fill: var(--color-inverse-icon);\n}\n\n@media (max-width: 767px) {\n .z-info-reveal-panel {\n top: auto !important;\n bottom: auto !important;\n width: calc(var(--z-info-reveal-panel-width) - (var(--grid-margin) * 4)) !important;\n margin-top: calc(var(--trigger-size) * -1);\n }\n}\n","import {Component, ComponentInterface, Element, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ControlSize, InfoRevealPosition} from \"../../beans\";\n\n/**\n * Info reveal component.\n *\n * @slot - content of the info panel.\n */\n@Component({\n tag: \"z-info-reveal\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZInfoReveal implements ComponentInterface {\n /** Name of the icon for the trigger button */\n @Prop()\n icon? = \"informationsource\";\n\n /**\n * The position of the z-info-reveal in the page. This helps to correctly place the info panel.\n * The panel will grow in the opposite direction of the position.\n * For example, with the default position `BOTTOM_RIGHT`, the panel will grow vertically upwards and horizontally to the left.\n */\n @Prop({reflect: true})\n position?: InfoRevealPosition = InfoRevealPosition.BOTTOM_RIGHT;\n\n /** Label of the trigger button. */\n @Prop()\n label?: string;\n\n /** `aria-label` of the trigger button. It will be used only when the `label` prop is empty. */\n @Prop()\n htmlAriaLabel = \"Apri pannello informazioni\";\n\n /** Size of the trigger button */\n @Prop({reflect: true})\n size?: ControlSize = ControlSize.BIG;\n\n /** Whether the info panel is open. */\n @State()\n open = false;\n\n @Element() host: HTMLZInfoRevealElement;\n\n private panel: HTMLDivElement;\n\n /**\n * Adjust the position of the info panel to prevent exiting the viewport.\n */\n @Watch(\"position\")\n @Watch(\"open\")\n @Listen(\"resize\", {target: \"window\", passive: true})\n adjustPanelPosition(): void {\n if (!this.open || !this.panel) {\n return;\n }\n\n const rect = this.host.getBoundingClientRect();\n const gridMargin = parseInt(getComputedStyle(document.documentElement).getPropertyValue(\"--grid-margin\"), 10);\n const pageWidth = document.documentElement.offsetWidth;\n // Available space for the info panel to grow towards the edge of the page, based on the `position` prop.\n const availableSpace = Math.round(\n (this.position.includes(\"left\") ? pageWidth - rect.left : rect.right) - gridMargin\n );\n this.panel.style.maxWidth = `${availableSpace}px`;\n }\n\n /**\n * Toggle the open state of the info panel.\n */\n private togglePanel(): void {\n this.open = !this.open;\n }\n\n /**\n * Close the info panel.\n */\n private closePanel(): void {\n this.open = false;\n }\n\n @Listen(\"keydown\", {target: \"window\", capture: true})\n handleEscapeKey(event: KeyboardEvent): void {\n if (event.key === \"Escape\" && this.open) {\n this.closePanel();\n }\n }\n\n render(): HTMLZInfoRevealElement {\n return (\n <Host open={this.open}>\n <button\n class=\"z-info-reveal-trigger\"\n type=\"button\"\n onClick={this.togglePanel.bind(this)}\n aria-label={!this.label ? this.htmlAriaLabel || undefined : undefined}\n aria-expanded={this.open ? \"true\" : \"false\"}\n aria-controls=\"z-info-reveal-panel\"\n >\n {this.icon && <z-icon name={this.icon} />}\n {this.label && <span class=\"z-info-reveal-label\">{this.label}</span>}\n </button>\n <div\n class=\"z-info-reveal-panel\"\n id=\"z-info-reveal-panel\"\n ref={(el) => (this.panel = el)}\n hidden={!this.open}\n >\n <slot></slot>\n <button\n class=\"z-info-reveal-close\"\n type=\"button\"\n onClick={this.closePanel.bind(this)}\n aria-label=\"Chiudi pannello informazioni\"\n >\n <z-icon name=\"multiply\" />\n </button>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+IAAA,MAAMA,EAAY,IAAM,ghF,MCaXC,EAAWC,EAAA,MAAAD,UAAAE,EALxB,WAAAC,CAAAC,G,kEAQEC,KAAAC,KAAQ,oBAQRD,KAAAE,SAAgCC,EAAmBC,aAQnDJ,KAAAK,cAAgB,6BAIhBL,KAAAM,KAAqBC,EAAYC,IAIjCR,KAAAS,KAAO,KAiFR,CArEC,mBAAAC,GACE,IAAKV,KAAKS,OAAST,KAAKW,MAAO,CAC7B,M,CAGF,MAAMC,E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t as n}from"./p-RmbDDbWd.js";import{e as a,B as r,g as l}from"./p-DdetsoIY.js";import{r as h,n as d}from"./p-8C_CrFxp.js";import{d as f}from"./p-BAguKZnb.js";import{d as b}from"./p-BolVsvfr.js";import{d as c}from"./p-CbXEdwLi.js";import{d as g}from"./p-LXvmZzZa.js";import{d as v}from"./p-CdBqnUF6.js";import{d as m}from"./p-cpTAMdcF.js";import{d as p}from"./p-BeSVHdId.js";import{d as u}from"./p-mphirYN3.js";import{d as z}from"./p-BoiZb7m1.js";const w=()=>`:host{--z-searchbar-tag-text-color:var(--color-primary03);--z-searchbar-tag-bg:var(--color-hover-primary);--z-searchbar-item-height:2.75rem;z-index:15;display:flex;align-items:flex-end;column-gap:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,*,::after,::before{box-sizing:border-box}.input-container{position:relative;display:flex;width:100%;flex-direction:column}.input-container z-input{z-index:1}.results{--item-icon-size:1rem;--z-icon-height:var(--item-icon-size);--z-icon-width:var(--item-icon-size);--item-inline-padding:calc(var(--space-unit) * 1.5);--item-col-gap:var(--space-unit);position:absolute;top:calc(100% - 1px);left:0;overflow:auto;width:100%;max-height:var(--z-searchbar-results-height, 540px);border:var(--border-size-small) solid var(--color-form-surface03);border-top:none;background:var(--color-form-background)}.results z-list-element{--background-color-list-element:var(--color-form-background);position:relative;display:block}.results>z-list>z-list-element::part(list-item-container){padding:0 var(--item-inline-padding)}.results z-list-element>.list-item{position:relative;display:flex;align-items:center;padding:calc(var(--space-unit) * 1.25) calc(var(--space-unit) / 4);background-color:transparent;color:var(--color-form-default-text);fill:var(--color-form-default-icon);gap:var(--item-col-gap)}.results z-list-element>.list-item:hover{background-color:var(--gray100);cursor:pointer}.results z-list-element>.list-item:focus-visible{z-index:1;box-shadow:var(--shadow-focus-primary);outline:none}.results>z-list>z-list-element:not(:last-child)>.list-item,.results z-list-group:not(:last-child)>z-list-element:not(.category-heading){border-bottom:1px solid var(--color-form-surface03)}.results z-list-group{padding:0 var(--item-inline-padding)}.results z-list-group>z-list-element::part(list-item-container){padding:0}.results .sub-list{padding-left:calc(var(--item-icon-size) + var(--item-col-gap))}.results .sub-list z-list-element::part(list-item-container){padding:0}.results .sub-list z-list-element>.list-item{position:relative}.results .sub-list>z-list-element:not(:last-child)::before,.results .sub-list>z-list-element>.list-item::before{position:absolute;top:0;left:calc(0px - var(--item-col-gap) - var(--item-icon-size) / 2 + 1px);border-left:1px solid var(--color-form-surface03);content:""}.results .sub-list>z-list-element:not(:last-child)::before{top:-4px;height:calc(100% + 4px)}.results .sub-list z-list-element>.list-item::before{width:14px;height:calc(var(--z-searchbar-item-height) / 2);border-bottom:1px solid var(--color-form-surface03)}.results .category-heading>.category{font-style:italic}.results .category-heading>.subcategory{text-transform:uppercase}.results z-list-element>.list-item .ellipsis{overflow:hidden}.results .ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item-label mark{background:var(--color-primary03);color:var(--color-default-text)}.results .list-item>z-tag{--z-tag-bg:var(--z-searchbar-tag-bg);--z-tag-text-color:var(--z-searchbar-tag-text-color);margin-left:auto;white-space:nowrap}.results .item-show-all{width:100%;color:var(--color-primary01);cursor:pointer;text-align:center}.results .item-no-results{display:block;padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5);font-style:italic}.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){.results{--item-icon-size:1.125rem}}`;const y=()=>`.z-label{display:block;padding-bottom:var(--space-unit);color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}`;const k=()=>`.z-scrollbar::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}.z-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}.z-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}:host([theme="dark"]) .z-scrollbar,.z-scrollbar--dark{--z-scrollbar-track-gradient:linear-gradient( to right, transparent 0 1px, var(--gray600) 1px 5px, transparent 5px 6px );--z-scrollbar-track-color:var(--gray600);--z-scrollbar-thumb-color:var(--color-primary03);--z-scrollbar-thumb-hover-color:var(--color-hover-primary);--z-scrollbar-corner-color:transparent}@supports not selector(.z-scrollbar::-webkit-scrollbar-track){.z-scrollbar{scrollbar-color:var(--color-primary01) transparent}:host([theme="dark"]) .z-scrollbar,.z-scrollbar--dark{scrollbar-color:var(--z-scrollbar-thumb-color, var(--color-primary03)) var(--z-scrollbar-track-color, var(--gray600))}}`;const x=()=>`:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}`;const C=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.searchSubmit=i(this,"searchSubmit",7);this.searchTyping=i(this,"searchTyping",7);this.searchItemClick=i(this,"searchItemClick",7);this.htmlid=`searchbar-${h()}`;this.preventSubmit=false;this.autocomplete=false;this.autocompleteMinChars=3;this.searchHelperLabel="Cerca {searchString}";this.sortResultsItems=false;this.showSearchButton=false;this.searchButtonIconOnly=false;this.searchButtonLabel="CERCA";this.size=a.BIG;this.variant=r.PRIMARY;this.searchString=this.value;this.currResultsCount=this.resultsCount;this.showResults=false;this.isMobile=false;this.resultsItemsList=null}emitSearchItemClick(t){this.searchItemClick.emit(t);this.selectedItem=t;this.searchString=""}emitSearchSubmit(){this.searchSubmit.emit(this.inputRef.value)}watchItems(){this.resultsItemsList=this.getResultsItemsList()}watchResultsCount(){this.currResultsCount=this.resultsCount}watchValue(){this.searchString=this.value}watchSearchString(){this.searchTyping.emit(this.searchString);if(!this.searchString){this.currResultsCount=this.resultsCount}}getResultsItemsList(){return typeof this.resultsItems==="string"?JSON.parse(this.resultsItems):this.resultsItems}getGroupedItems(){const t={};this.resultsItemsList.forEach((e=>{var i;const s=`${e===null||e===void 0?void 0:e.category}${e===null||e===void 0?void 0:e.subcategory}`;t[s]=(i=t[s])!==null&&i!==void 0?i:{category:e===null||e===void 0?void 0:e.category,subcategory:e===null||e===void 0?void 0:e.subcategory,items:[]};t[s]["items"].push(e)}));if(this.sortResultsItems){return Object.keys(t).sort().reduce(((e,i)=>{e[i]=Object.assign(Object.assign({},t[i]),{items:t[i]["items"].sort(((t,e)=>{const i=t.label.toUpperCase();const s=e.label.toUpperCase();if(i<s){return-1}if(i>s){return 1}return 0}))});return e}),{})}return t}onListItemKeyDown(t,e){if(t.key===l.ENTER){t.preventDefault();this.emitSearchItemClick(e);return}this.handleArrowsNavigation(t)}onSearchHelperKeyDown(t){if(t.key===l.ENTER){t.preventDefault();this.emitSearchSubmit();return}this.handleArrowsNavigation(t)}handleArrowsNavigation(t){var e,i,s,o,n,a;if(![l.ARROW_DOWN,l.ARROW_UP].includes(t.key)){return}const r=t.target;const h=Array.from((i=(e=this.host.shadowRoot)===null||e===void 0?void 0:e.querySelectorAll("z-list .list-item"))!==null&&i!==void 0?i:[]);const d=h.indexOf(r);if(t.key===l.ARROW_DOWN){t.preventDefault();const e=d+1;if(e<h.length){h[e].focus()}}if(t.key===l.ARROW_UP){t.preventDefault();const e=d-1;if(e<0){(o=(s=this.host.shadowRoot)===null||s===void 0?void 0:s.querySelector("input"))===null||o===void 0?void 0:o.focus();(a=(n=this.host.shadowRoot)===null||n===void 0?void 0:n.querySelector("input"))===null||a===void 0?void 0:a.setSelectionRange(this.inputRef.value.length,this.inputRef.value.length)}if(e>=0){h[e].focus()}}}handleStopTyping(t){t.stopPropagation();this.searchString=t.detail.value;this.selectedItem=undefined}handleSubmit(){if(this.preventSubmit){return}this.emitSearchSubmit()}handleOutsideClick(t){const e=t.composedPath();if(e.includes(this.host)){return}this.showResults=false}componentWillLoad(){this.resultsItemsList=this.getResultsItemsList();this.mql=matchMedia("(max-width: 767px)");this.onMobileViewChange=t=>this.isMobile=t.matches;this.mql.addEventListener("change",this.onMobileViewChange);this.isMobile=this.mql.matches}disconnectedCallback(){var t;(t=this.mql)===null||t===void 0?void 0:t.removeEventListener("change",this.onMobileViewChange)}renderItemLabel(t){if(!this.searchString){return t}return t.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gmi"),(t=>`<mark>${t}</mark>`))}renderItem(t,e){var i;return s("z-list-element",{id:`list-item-${this.htmlid}-${e}`,role:"presentation",htmlTabindex:-1,onKeyDown:e=>this.onListItemKeyDown(e,t),onClick:e=>{e.stopPropagation();this.emitSearchItemClick(t)}},s("div",{class:"list-item ellipsis",role:"option",tabindex:0},!!(t===null||t===void 0?void 0:t.icon)&&s("z-icon",{class:"item-icon",name:t.icon}),s("div",{class:"item-label body-3 mobile-body-4",title:t.label,innerHTML:this.renderItemLabel(t.label)}),!!(t===null||t===void 0?void 0:t.tag)&&s("z-tag",{icon:t.tag.icon},!this.isMobile?t.tag.text:"")),!!((i=t.children)===null||i===void 0?void 0:i.length)&&s("z-list",{class:"sub-list",role:"group","aria-label":t.label||undefined},t.children.map(((t,e)=>this.renderItem(t,e)))))}renderItemGroups(){var t;if(!((t=this.resultsItemsList)===null||t===void 0?void 0:t.length)){return}const e=Object.values(this.getGroupedItems());const i=[];const o=!!this.currResultsCount;let n=0;for(const t of e){const e=o?this.currResultsCount-n:t.items.length;if(e<=0){break}const a=t.items.slice(0,e);const r=a.map(((t,e)=>this.renderItem(t,e)));n+=r.length;if(!r.length){continue}const l=[t.category,t.subcategory].filter(Boolean).join(" ");i.push(s("z-list-group",{"aria-label":l||undefined},t.category&&s("z-list-element",{class:"category-heading body-3 mobile-body-4",slot:"header-title",role:"presentation",htmlTabindex:-1},s("div",{class:"category"},t.category),t.subcategory&&s("div",{class:"subcategory"},t.subcategory)),r))}return i}render(){var t,e,i,n,a;return s(o,{key:"82c926179762db33e8d1c425cac474affd59fea6",onFocus:()=>this.showResults=true,onClick:t=>this.handleOutsideClick(t),class:{"has-submit":!!this.showSearchButton,"has-results":!!this.autocomplete}},s("div",{key:"689d1cda6b0c217e5afe892627f31100858c1a72",class:"input-container"},s("z-input",{key:"d596769c9a346c4548c5b71d10bbe9b2456556ee",ref:t=>this.inputRef=t,htmlid:`input-${this.htmlid}`,message:false,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>{d(t,(()=>this.handleSubmit()));this.handleArrowsNavigation(t)},onFocus:()=>this.showResults=true,value:this.searchString||((t=this.selectedItem)===null||t===void 0?void 0:t.label),size:this.size,label:this.label,"aria-label":this.htmlAriaLabel||this.placeholder||undefined}),!!(this.showResults&&this.autocomplete&&this.searchString&&this.searchString.length>=this.autocompleteMinChars&&this.resultsItemsList)&&s("div",{key:"954f6984c04ba133c1637220ed47e778d7440e22",class:"results z-scrollbar"},this.preventSubmit&&!((e=this.resultsItemsList)===null||e===void 0?void 0:e.length)?s("div",{class:"item-no-results body-3 mobile-body-4"},"Non abbiamo trovato risultati per ",s("b",null,this.searchString),s("br",null),s("br",null),"Cosa puoi fare?",s("ul",null,s("li",null,"Verificare di aver scritto bene"),s("li",null,"Provare a cercare un'altra parola"),s("li",null,"Provare a cercare qualcosa di più generico"))):s("z-list",{role:"listbox",id:`list-${this.htmlid}`,"aria-label":this.htmlAriaLabel||this.label||undefined},this.autocomplete&&!this.preventSubmit&&!!this.searchString&&s("z-list-element",{role:"presentation",htmlTabindex:-1,id:`list-item-${this.htmlid}-search`,onKeyDown:t=>this.onSearchHelperKeyDown(t),onClick:()=>this.emitSearchSubmit()},s("div",{class:"list-item item-search",role:"option",tabindex:0},s("z-icon",{class:"search-icon",name:"left-magnifying-glass"}),s("div",{class:"item-label body-3 mobile-body-4",innerHTML:(i=this.searchHelperLabel)===null||i===void 0?void 0:i.replace("{searchString}",`<mark>${this.searchString}</mark>`)}))),this.renderItemGroups(),!!(this.searchString&&((n=this.resultsItemsList)===null||n===void 0?void 0:n.length)&&this.currResultsCount&&this.currResultsCount<((a=this.resultsItemsList)===null||a===void 0?void 0:a.length))&&s("z-list-element",{role:"presentation",htmlTabindex:-1,id:`list-item-${this.htmlid}-show-all`},s("div",{role:"option",class:"item-show-all body-3 mobile-body-4",tabindex:0,onClick:()=>this.currResultsCount=undefined},"Vedi tutti i risultati"))))),this.showSearchButton&&s("z-button",{key:"898d0c61de5c60e3e78be3b2336c1cbb4adcc3e3",icon:this.searchButtonIconOnly?"search":undefined,"aria-label":this.searchButtonIconOnly?this.searchButtonLabel.trim()||"CERCA":undefined,disabled:!!this.preventSubmit,variant:this.variant,size:this.size,onClick:()=>this.handleSubmit()},this.searchButtonIconOnly?"":this.searchButtonLabel.trim()||"CERCA"))}get host(){return this}static get watchers(){return{resultsItems:[{watchItems:0}],resultsCount:[{watchResultsCount:0}],value:[{watchValue:0}],searchString:[{watchSearchString:0}]}}static get style(){return w()+(y()+(k()+x()))}},[1,"z-searchbar",{htmlid:[513],preventSubmit:[4,"prevent-submit"],label:[1],htmlAriaLabel:[1,"html-aria-label"],value:[1],placeholder:[1],autocomplete:[4],autocompleteMinChars:[2,"autocomplete-min-chars"],resultsCount:[2,"results-count"],searchHelperLabel:[1,"search-helper-label"],resultsItems:[1,"results-items"],sortResultsItems:[4,"sort-results-items"],showSearchButton:[4,"show-search-button"],searchButtonIconOnly:[4,"search-button-icon-only"],searchButtonLabel:[1,"search-button-label"],size:[1],variant:[1],searchString:[32],currResultsCount:[32],showResults:[32],isMobile:[32],selectedItem:[32]},[[4,"click","handleOutsideClick"]],{resultsItems:[{watchItems:0}],resultsCount:[{watchResultsCount:0}],value:[{watchValue:0}],searchString:[{watchSearchString:0}]}]);function S(){if(typeof customElements==="undefined"){return}const t=["z-searchbar","z-button","z-divider","z-icon","z-input","z-input-message","z-list","z-list-element","z-list-group","z-tag"];t.forEach((t=>{switch(t){case"z-searchbar":if(!customElements.get(n(t))){customElements.define(n(t),C)}break;case"z-button":if(!customElements.get(n(t))){f()}break;case"z-divider":if(!customElements.get(n(t))){b()}break;case"z-icon":if(!customElements.get(n(t))){c()}break;case"z-input":if(!customElements.get(n(t))){g()}break;case"z-input-message":if(!customElements.get(n(t))){v()}break;case"z-list":if(!customElements.get(n(t))){m()}break;case"z-list-element":if(!customElements.get(n(t))){p()}break;case"z-list-group":if(!customElements.get(n(t))){u()}break;case"z-tag":if(!customElements.get(n(t))){z()}break}}))}export{C as Z,S as d};
|
|
2
|
+
//# sourceMappingURL=p-CJjo0ntH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","typographyCss","ZSearchbar","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","htmlid","randomId","preventSubmit","autocomplete","autocompleteMinChars","searchHelperLabel","sortResultsItems","showSearchButton","searchButtonIconOnly","searchButtonLabel","size","ControlSize","BIG","variant","ButtonVariant","PRIMARY","searchString","value","currResultsCount","resultsCount","showResults","isMobile","resultsItemsList","emitSearchItemClick","item","searchItemClick","emit","selectedItem","emitSearchSubmit","searchSubmit","inputRef","watchItems","getResultsItemsList","watchResultsCount","watchValue","watchSearchString","searchTyping","resultsItems","JSON","parse","getGroupedItems","groupedItems","forEach","key","category","subcategory","_a","items","push","Object","keys","sort","reduce","obj","assign","a","b","nameA","label","toUpperCase","nameB","onListItemKeyDown","e","KeyboardCode","ENTER","preventDefault","handleArrowsNavigation","onSearchHelperKeyDown","ARROW_DOWN","ARROW_UP","includes","currentElement","target","Array","from","_b","host","shadowRoot","querySelectorAll","currentIndex","indexOf","nextIndex","length","focus","prevIndex","_d","_c","querySelector","_f","_e","setSelectionRange","handleStopTyping","stopPropagation","detail","undefined","handleSubmit","handleOutsideClick","cp","composedPath","componentWillLoad","mql","matchMedia","onMobileViewChange","matches","addEventListener","disconnectedCallback","removeEventListener","renderItemLabel","replace","RegExp","found","renderItem","index","h","id","role","htmlTabindex","onKeyDown","onClick","class","tabindex","icon","name","title","innerHTML","tag","text","children","map","child","renderItemGroups","values","listGroups","hasResultsLimit","renderedCount","groupItem","remaining","visibleItems","slice","listGroupsElements","subindex","ariaLabel","filter","Boolean","join","slot","render","Host","onFocus","ref","el","message","placeholder","onStopTyping","onKeyUp","handleEnterKeydSubmit","htmlAriaLabel","trim","disabled"],"sources":["src/components/z-searchbar/styles.css?tag=z-searchbar&encapsulation=shadow","src/components/css-components/z-label/styles.css?tag=z-searchbar&encapsulation=shadow","src/components/css-components/z-scrollbar/styles.css?tag=z-searchbar&encapsulation=shadow","src/tokens/typography.css?tag=z-searchbar&encapsulation=shadow","src/components/z-searchbar/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-searchbar-results-height: Max height of the results container (default: 540px)\n * @prop --z-searchbar-tag-text-color: Color of tag's text (default --color-primary03);\n * @prop --z-searchbar-tag-bg: Color of tag's background (default --color-hover-primary);\n */\n --z-searchbar-tag-text-color: var(--color-primary03);\n --z-searchbar-tag-bg: var(--color-hover-primary);\n --z-searchbar-item-height: 2.75rem;\n\n z-index: 15;\n display: flex;\n align-items: flex-end;\n column-gap: calc(var(--space-unit) * 2);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host,\n*,\n::after,\n::before {\n box-sizing: border-box;\n}\n\n.input-container {\n position: relative;\n display: flex;\n width: 100%;\n flex-direction: column;\n}\n\n.input-container z-input {\n z-index: 1;\n}\n\n.results {\n --item-icon-size: 1rem;\n --z-icon-height: var(--item-icon-size);\n --z-icon-width: var(--item-icon-size);\n --item-inline-padding: calc(var(--space-unit) * 1.5);\n --item-col-gap: var(--space-unit);\n\n position: absolute;\n top: calc(100% - 1px);\n left: 0;\n overflow: auto;\n width: 100%;\n max-height: var(--z-searchbar-results-height, 540px);\n border: var(--border-size-small) solid var(--color-form-surface03);\n border-top: none;\n background: var(--color-form-background);\n}\n\n.results z-list-element {\n --background-color-list-element: var(--color-form-background);\n\n position: relative;\n display: block;\n}\n\n.results > z-list > z-list-element::part(list-item-container) {\n padding: 0 var(--item-inline-padding);\n}\n\n.results z-list-element > .list-item {\n position: relative;\n display: flex;\n align-items: center;\n padding: calc(var(--space-unit) * 1.25) calc(var(--space-unit) / 4);\n background-color: transparent;\n color: var(--color-form-default-text);\n fill: var(--color-form-default-icon);\n gap: var(--item-col-gap);\n}\n\n.results z-list-element > .list-item:hover {\n background-color: var(--gray100); /* TODO: use correct form-related token when available */\n cursor: pointer;\n}\n\n.results z-list-element > .list-item:focus-visible {\n z-index: 1;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n/* list elements separator */\n.results > z-list > z-list-element:not(:last-child) > .list-item,\n.results z-list-group:not(:last-child) > z-list-element:not(.category-heading) {\n border-bottom: 1px solid var(--color-form-surface03);\n}\n\n.results z-list-group {\n padding: 0 var(--item-inline-padding);\n}\n\n.results z-list-group > z-list-element::part(list-item-container) {\n padding: 0;\n}\n\n.results .sub-list {\n padding-left: calc(var(--item-icon-size) + var(--item-col-gap));\n}\n\n.results .sub-list z-list-element::part(list-item-container) {\n padding: 0;\n}\n\n.results .sub-list z-list-element > .list-item {\n position: relative;\n}\n\n/* tree indicators */\n.results .sub-list > z-list-element:not(:last-child)::before,\n.results .sub-list > z-list-element > .list-item::before {\n position: absolute;\n top: 0;\n left: calc(0px - var(--item-col-gap) - var(--item-icon-size) / 2 + 1px);\n border-left: 1px solid var(--color-form-surface03);\n content: \"\";\n}\n\n/* \"|\" tree indicator */\n.results .sub-list > z-list-element:not(:last-child)::before {\n top: -4px;\n height: calc(100% + 4px);\n}\n\n/* \"—\" tree indicator */\n.results .sub-list z-list-element > .list-item::before {\n width: 14px;\n height: calc(var(--z-searchbar-item-height) / 2);\n border-bottom: 1px solid var(--color-form-surface03);\n}\n\n.results .category-heading > .category {\n font-style: italic;\n}\n\n.results .category-heading > .subcategory {\n text-transform: uppercase;\n}\n\n.results z-list-element > .list-item .ellipsis {\n overflow: hidden;\n}\n\n.results .ellipsis > .item-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.results .item-label mark {\n background: var(--color-primary03);\n color: var(--color-default-text);\n}\n\n.results .list-item > z-tag {\n --z-tag-bg: var(--z-searchbar-tag-bg);\n --z-tag-text-color: var(--z-searchbar-tag-text-color);\n\n margin-left: auto;\n white-space: nowrap;\n}\n\n.results .item-show-all {\n width: 100%;\n color: var(--color-primary01);\n cursor: pointer;\n text-align: center;\n}\n\n.results .item-no-results {\n display: block;\n padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5);\n font-style: italic;\n}\n\n.results .item-no-results > ul {\n padding-left: calc(var(--space-unit) * 2);\n margin: var(--space-unit);\n}\n\n@media (min-width: 768px) {\n .results {\n --item-icon-size: 1.125rem;\n }\n}\n",".z-label {\n display: block;\n padding-bottom: var(--space-unit);\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n font-size: var(--font-size-1);\n font-weight: var(--font-sb);\n text-align: left;\n text-transform: uppercase;\n}\n","/* Webkit Scrollbar */\n.z-scrollbar::-webkit-scrollbar {\n width: 6px;\n background: linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px);\n}\n\n.z-scrollbar::-webkit-scrollbar-thumb {\n background-color: var(--color-primary01);\n}\n\n.z-scrollbar::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n:host([theme=\"dark\"]) .z-scrollbar,\n.z-scrollbar--dark {\n --z-scrollbar-track-gradient: linear-gradient(\n to right,\n transparent 0 1px,\n var(--gray600) 1px 5px,\n transparent 5px 6px\n );\n --z-scrollbar-track-color: var(--gray600);\n --z-scrollbar-thumb-color: var(--color-primary03);\n --z-scrollbar-thumb-hover-color: var(--color-hover-primary);\n --z-scrollbar-corner-color: transparent;\n}\n\n/* Firefox scrollbar */\n@supports not selector(.z-scrollbar::-webkit-scrollbar-track) {\n .z-scrollbar {\n scrollbar-color: var(--color-primary01) transparent;\n }\n\n :host([theme=\"dark\"]) .z-scrollbar,\n .z-scrollbar--dark {\n scrollbar-color: var(--z-scrollbar-thumb-color, var(--color-primary03))\n var(--z-scrollbar-track-color, var(--gray600));\n }\n}\n",":root {\n /* font-family */\n --font-family-sans: \"IBM Plex Sans\", sans-serif;\n --font-family-serif: \"IBM Plex Serif\", serif;\n\n /* font-weight */\n --font-lt: 300;\n --font-rg: 400;\n --font-sb: 600;\n --font-bd: 700;\n\n /* font-size type scale */\n --font-size-1: 0.75rem; /* 12px */\n --font-size-2: 0.875rem; /* 14px */\n --font-size-3: 1rem; /* assuming 16px */\n --font-size-4: 1.125rem; /* 18px */\n --font-size-5: 1.25rem; /* 20px */\n --font-size-6: 1.5rem; /* 24px */\n --font-size-7: 1.75rem; /* 28px */\n --font-size-8: 2rem; /* 32px */\n --font-size-9: 2.25rem; /* 36px */\n --font-size-10: 2.625rem; /* 42px */\n --font-size-11: 3rem; /* 48px */\n --font-size-12: 3.375rem; /* 54px */\n --font-size-13: 3.75rem; /* 60px */\n --font-size-14: 4.25rem; /* 68px */\n --font-size-15: 4.75rem; /* 76px */\n --font-size-16: 5.25rem; /* 84px */\n --font-size-17: 5.75rem; /* 92px */\n\n /* cssprops to use with `font` shorthand property */\n --section-title-1: var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);\n --section-title-2: var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);\n --section-title-3: var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);\n --section-title-4: var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);\n --section-title-5: var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);\n --section-title-6: var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif);\n}\n\n/* Typography classes */\n.heading-1,\n.heading-1-sb,\n.heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n}\n\n.heading-2,\n.heading-2-sb,\n.heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-3,\n.heading-3-sb,\n.heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-4,\n.heading-4-sb,\n.heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-1,\n.body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-2,\n.body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-3,\n.body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-4,\n.body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.body-5,\n.body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.interactive-1,\n.interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.interactive-2,\n.interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.interactive-3,\n.interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.helper,\n.helper-sb {\n font-size: var(--font-size-1);\n font-style: italic;\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n/* section title */\n.section-title-1 {\n font: var(--section-title-1);\n}\n\n.section-title-2 {\n font: var(--section-title-2);\n}\n\n.section-title-3 {\n font: var(--section-title-3);\n}\n\n.section-title-4 {\n font: var(--section-title-4);\n}\n\n.section-title-5 {\n font: var(--section-title-5);\n}\n\n.section-title-6 {\n font: var(--section-title-6);\n}\n\n/* heading-1/2 for desktop and wide viewports */\n@media (min-width: 1152px) {\n .heading-1,\n .heading-1-sb,\n .heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .heading-2,\n .heading-2-sb,\n .heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n}\n\n/* viewport classes */\n@media (max-width: 767px) {\n .mobile-heading-1,\n .mobile-heading-1-sb,\n .mobile-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .mobile-heading-2,\n .mobile-heading-2-sb,\n .mobile-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-3,\n .mobile-heading-3-sb,\n .mobile-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-4,\n .mobile-heading-4-sb,\n .mobile-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-1,\n .mobile-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-2,\n .mobile-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-3,\n .mobile-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-4,\n .mobile-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-body-5,\n .mobile-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-interactive-1,\n .mobile-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-interactive-2,\n .mobile-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-interactive-3,\n .mobile-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-section-title-1 {\n font: var(--section-title-1);\n }\n\n .mobile-section-title-2 {\n font: var(--section-title-2);\n }\n\n .mobile-section-title-3 {\n font: var(--section-title-3);\n }\n\n .mobile-section-title-4 {\n font: var(--section-title-4);\n }\n\n .mobile-section-title-5 {\n font: var(--section-title-5);\n }\n\n .mobile-section-title-6 {\n font: var(--section-title-6);\n }\n\n .mobile-heading-1-lt,\n .mobile-heading-2-lt,\n .mobile-heading-3-lt,\n .mobile-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .mobile-heading-1-sb,\n .mobile-heading-2-sb,\n .mobile-heading-3-sb,\n .mobile-heading-4-sb,\n .mobile-body-1-sb,\n .mobile-body-2-sb,\n .mobile-body-3-sb,\n .mobile-body-4-sb,\n .mobile-body-5-sb,\n .mobile-interactive-1-sb,\n .mobile-interactive-2-sb,\n .mobile-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 768px) and (max-width: 1151px) {\n .tablet-heading-1,\n .tablet-heading-1-sb,\n .tablet-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .tablet-heading-2,\n .tablet-heading-2-sb,\n .tablet-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-3,\n .tablet-heading-3-sb,\n .tablet-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-4,\n .tablet-heading-4-sb,\n .tablet-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-1,\n .tablet-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-2,\n .tablet-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-3,\n .tablet-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-4,\n .tablet-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-body-5,\n .tablet-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-interactive-1,\n .tablet-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-interactive-2,\n .tablet-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-interactive-3,\n .tablet-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-section-title-1 {\n font: var(--section-title-1);\n }\n\n .tablet-section-title-2 {\n font: var(--section-title-2);\n }\n\n .tablet-section-title-3 {\n font: var(--section-title-3);\n }\n\n .tablet-section-title-4 {\n font: var(--section-title-4);\n }\n\n .tablet-section-title-5 {\n font: var(--section-title-5);\n }\n\n .tablet-section-title-6 {\n font: var(--section-title-6);\n }\n\n .tablet-heading-1-lt,\n .tablet-heading-2-lt,\n .tablet-heading-3-lt,\n .tablet-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .tablet-heading-1-sb,\n .tablet-heading-2-sb,\n .tablet-heading-3-sb,\n .tablet-heading-4-sb,\n .tablet-body-1-sb,\n .tablet-body-2-sb,\n .tablet-body-3-sb,\n .tablet-body-4-sb,\n .tablet-body-5-sb,\n .tablet-interactive-1-sb,\n .tablet-interactive-2-sb,\n .tablet-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1152px) and (max-width: 1365px) {\n .desktop-heading-1,\n .desktop-heading-1-sb,\n .desktop-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .desktop-heading-2,\n .desktop-heading-2-sb,\n .desktop-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .desktop-heading-3,\n .desktop-heading-3-sb,\n .desktop-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .desktop-heading-4,\n .desktop-heading-4-sb,\n .desktop-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-1,\n .desktop-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-2,\n .desktop-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-3,\n .desktop-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-4,\n .desktop-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-body-5,\n .desktop-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-interactive-1,\n .desktop-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-interactive-2,\n .desktop-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-interactive-3,\n .desktop-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-section-title-1 {\n font: var(--section-title-1);\n }\n\n .desktop-section-title-2 {\n font: var(--section-title-2);\n }\n\n .desktop-section-title-3 {\n font: var(--section-title-3);\n }\n\n .desktop-section-title-4 {\n font: var(--section-title-4);\n }\n\n .desktop-section-title-5 {\n font: var(--section-title-5);\n }\n\n .desktop-section-title-6 {\n font: var(--section-title-6);\n }\n\n .desktop-heading-1-lt,\n .desktop-heading-2-lt,\n .desktop-heading-3-lt,\n .desktop-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .desktop-heading-1-sb,\n .desktop-heading-2-sb,\n .desktop-heading-3-sb,\n .desktop-heading-4-sb,\n .desktop-body-1-sb,\n .desktop-body-2-sb,\n .desktop-body-3-sb,\n .desktop-body-4-sb,\n .desktop-body-5-sb,\n .desktop-interactive-1-sb,\n .desktop-interactive-2-sb,\n .desktop-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1366px) {\n .wide-heading-1,\n .wide-heading-1-sb,\n .wide-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .wide-heading-2,\n .wide-heading-2-sb,\n .wide-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .wide-heading-3,\n .wide-heading-3-sb,\n .wide-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .wide-heading-4,\n .wide-heading-4-sb,\n .wide-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-1,\n .wide-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-2,\n .wide-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-3,\n .wide-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-4,\n .wide-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-body-5,\n .wide-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-interactive-1,\n .wide-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-interactive-2,\n .wide-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-interactive-3,\n .wide-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-section-title-1 {\n font: var(--section-title-1);\n }\n\n .wide-section-title-2 {\n font: var(--section-title-2);\n }\n\n .wide-section-title-3 {\n font: var(--section-title-3);\n }\n\n .wide-section-title-4 {\n font: var(--section-title-4);\n }\n\n .wide-section-title-5 {\n font: var(--section-title-5);\n }\n\n .wide-section-title-6 {\n font: var(--section-title-6);\n }\n\n .wide-heading-1-lt,\n .wide-heading-2-lt,\n .wide-heading-3-lt,\n .wide-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .wide-heading-1-sb,\n .wide-heading-2-sb,\n .wide-heading-3-sb,\n .wide-heading-4-sb,\n .wide-body-1-sb,\n .wide-body-2-sb,\n .wide-body-3-sb,\n .wide-body-4-sb,\n .wide-body-5-sb,\n .wide-interactive-1-sb,\n .wide-interactive-2-sb,\n .wide-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n/* font-weight variants */\n.heading-1-lt,\n.heading-2-lt,\n.heading-3-lt,\n.heading-4-lt {\n font-weight: var(--font-lt);\n}\n\n.heading-1-sb,\n.heading-2-sb,\n.heading-3-sb,\n.heading-4-sb,\n.body-1-sb,\n.body-2-sb,\n.body-3-sb,\n.body-4-sb,\n.body-5-sb,\n.interactive-1-sb,\n.interactive-2-sb,\n.interactive-3-sb,\n.helper-sb {\n font-weight: var(--font-sb);\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {\n ButtonVariant,\n ControlSize,\n KeyboardCode,\n SearchbarGroup,\n SearchbarGroupedItem,\n SearchbarItem,\n} from \"../../beans\";\nimport {handleEnterKeydSubmit, randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-searchbar\",\n styleUrls: [\n \"styles.css\",\n \"../css-components/z-label/styles.css\",\n \"../css-components/z-scrollbar/styles.css\",\n \"../../tokens/typography.css\",\n ],\n shadow: true,\n})\nexport class ZSearchbar implements ComponentInterface {\n @Element() host: HTMLZSearchbarElement;\n\n /** The id of the searchbar element */\n @Prop({reflect: true})\n htmlid = `searchbar-${randomId()}`;\n\n /** Prevent submit action */\n @Prop()\n preventSubmit?: boolean = false;\n\n /** The input label */\n @Prop()\n label?: string;\n\n /** The input aria-label */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Input search string */\n @Prop()\n value?: string;\n\n /** Search input placeholder */\n @Prop()\n placeholder?: string;\n\n /** Show autocomplete results */\n @Prop()\n autocomplete?: boolean = false;\n\n /** Minimun number of characters to dispatch typing event */\n @Prop()\n autocompleteMinChars?: number = 3;\n\n /** Number of results shown. Default: all */\n @Prop()\n resultsCount?: number;\n\n /** Search helper text */\n @Prop()\n searchHelperLabel?: string = \"Cerca {searchString}\";\n\n /** Autocomplete results items */\n @Prop()\n resultsItems?: SearchbarItem[] | string;\n\n /** Sort autocomplete results items */\n @Prop()\n sortResultsItems?: boolean = false;\n\n /** Show submit button */\n @Prop()\n showSearchButton?: boolean = false;\n\n /** Hide the label of the submit button, showing only the icon */\n @Prop()\n searchButtonIconOnly?: boolean = false;\n\n /** The label of the submit button */\n @Prop()\n searchButtonLabel?: string = \"CERCA\";\n\n /** Size of the `z-input` and submit `z-button` */\n @Prop()\n size?: ControlSize = ControlSize.BIG;\n\n /** Submit `z-button` variant */\n @Prop()\n variant?: ButtonVariant = ButtonVariant.PRIMARY;\n\n @State()\n searchString = this.value;\n\n @State()\n currResultsCount: number | undefined = this.resultsCount;\n\n @State()\n showResults = false;\n\n @State()\n isMobile = false;\n\n @State()\n selectedItem?: SearchbarItem;\n\n private resultsItemsList: SearchbarItem[] | undefined = null;\n\n private inputRef: HTMLZInputElement;\n\n /** Media query list for detecting mobile view. */\n private mql?: MediaQueryList;\n\n /** Listener for changes in the mobile view media query. */\n private onMobileViewChange?: (e: MediaQueryListEvent) => void;\n\n /** Emitted on search submit, return search string */\n @Event()\n searchSubmit: EventEmitter<string>;\n\n /** Emitted on search typing, return search string */\n @Event()\n searchTyping: EventEmitter<string>;\n\n /** Emitted on search result click, return item */\n @Event()\n searchItemClick: EventEmitter<SearchbarItem>;\n\n private emitSearchItemClick(item: SearchbarItem): void {\n this.searchItemClick.emit(item);\n this.selectedItem = item;\n this.searchString = \"\";\n }\n\n private emitSearchSubmit(): void {\n this.searchSubmit.emit(this.inputRef.value);\n }\n\n @Watch(\"resultsItems\")\n watchItems(): void {\n this.resultsItemsList = this.getResultsItemsList();\n }\n\n @Watch(\"resultsCount\")\n watchResultsCount(): void {\n this.currResultsCount = this.resultsCount;\n }\n\n @Watch(\"value\")\n watchValue(): void {\n this.searchString = this.value;\n }\n\n @Watch(\"searchString\")\n watchSearchString(): void {\n this.searchTyping.emit(this.searchString);\n if (!this.searchString) {\n this.currResultsCount = this.resultsCount;\n }\n }\n\n private getResultsItemsList(): SearchbarItem[] | undefined {\n return typeof this.resultsItems === \"string\" ? JSON.parse(this.resultsItems) : this.resultsItems;\n }\n\n private getGroupedItems(): SearchbarGroupedItem {\n const groupedItems = {};\n this.resultsItemsList.forEach((item: SearchbarItem) => {\n const key = `${item?.category}${item?.subcategory}`;\n groupedItems[key] = groupedItems[key] ?? {\n category: item?.category,\n subcategory: item?.subcategory,\n items: [],\n };\n groupedItems[key][\"items\"].push(item);\n });\n\n if (this.sortResultsItems) {\n return Object.keys(groupedItems)\n .sort()\n .reduce((obj, key) => {\n obj[key] = {\n ...groupedItems[key],\n items: groupedItems[key][\"items\"].sort((a: SearchbarItem, b: SearchbarItem) => {\n const nameA = a.label.toUpperCase();\n const nameB = b.label.toUpperCase();\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n\n return 0;\n }),\n };\n\n return obj;\n }, {});\n }\n\n return groupedItems;\n }\n\n private onListItemKeyDown(e: KeyboardEvent, item: SearchbarItem): void {\n if (e.key === KeyboardCode.ENTER) {\n e.preventDefault();\n this.emitSearchItemClick(item);\n\n return;\n }\n\n this.handleArrowsNavigation(e);\n }\n\n private onSearchHelperKeyDown(e: KeyboardEvent): void {\n if (e.key === KeyboardCode.ENTER) {\n e.preventDefault();\n this.emitSearchSubmit();\n\n return;\n }\n\n this.handleArrowsNavigation(e);\n }\n\n private handleArrowsNavigation(e: KeyboardEvent): void {\n if (![KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP].includes(e.key as KeyboardCode)) {\n return;\n }\n\n const currentElement = e.target as HTMLElement;\n const items = Array.from(this.host.shadowRoot?.querySelectorAll(\"z-list .list-item\") ?? []);\n const currentIndex = items.indexOf(currentElement);\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n e.preventDefault();\n const nextIndex = currentIndex + 1;\n if (nextIndex < items.length) {\n (items[nextIndex] as HTMLElement).focus();\n }\n }\n\n if (e.key === KeyboardCode.ARROW_UP) {\n e.preventDefault();\n const prevIndex = currentIndex - 1;\n if (prevIndex < 0) {\n this.host.shadowRoot?.querySelector(\"input\")?.focus();\n this.host.shadowRoot\n ?.querySelector(\"input\")\n ?.setSelectionRange(this.inputRef.value.length, this.inputRef.value.length);\n }\n if (prevIndex >= 0) {\n (items[prevIndex] as HTMLElement).focus();\n }\n }\n }\n\n private handleStopTyping(e: CustomEvent): void {\n e.stopPropagation();\n this.searchString = e.detail.value;\n this.selectedItem = undefined;\n }\n\n private handleSubmit(): void {\n if (this.preventSubmit) {\n return;\n }\n\n this.emitSearchSubmit();\n }\n\n @Listen(\"click\", {target: \"document\"})\n private handleOutsideClick(e: MouseEvent): void {\n const cp = e.composedPath();\n if (cp.includes(this.host)) {\n return;\n }\n\n this.showResults = false;\n }\n\n componentWillLoad(): void {\n this.resultsItemsList = this.getResultsItemsList();\n\n this.mql = matchMedia(\"(max-width: 767px)\");\n this.onMobileViewChange = (e: MediaQueryListEvent) => (this.isMobile = e.matches);\n this.mql.addEventListener(\"change\", this.onMobileViewChange);\n this.isMobile = this.mql.matches;\n }\n\n disconnectedCallback(): void {\n this.mql?.removeEventListener(\"change\", this.onMobileViewChange);\n }\n\n private renderItemLabel(label: string): string {\n if (!this.searchString) {\n return label;\n }\n\n return label.replace(\n new RegExp(this.searchString.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"), \"gmi\"),\n (found) => `<mark>${found}</mark>`\n );\n }\n\n private renderItem(item: SearchbarItem, index: number): HTMLZListElementElement {\n return (\n <z-list-element\n id={`list-item-${this.htmlid}-${index}`}\n role=\"presentation\"\n htmlTabindex={-1}\n onKeyDown={(e: KeyboardEvent) => this.onListItemKeyDown(e, item)}\n onClick={(e: MouseEvent) => {\n e.stopPropagation();\n this.emitSearchItemClick(item);\n }}\n >\n <div\n class=\"list-item ellipsis\"\n role=\"option\"\n tabindex={0}\n >\n {!!item?.icon && (\n <z-icon\n class=\"item-icon\"\n name={item.icon}\n />\n )}\n\n <div\n class=\"item-label body-3 mobile-body-4\"\n title={item.label}\n innerHTML={this.renderItemLabel(item.label)}\n />\n {!!item?.tag && <z-tag icon={item.tag.icon}>{!this.isMobile ? item.tag.text : \"\"}</z-tag>}\n </div>\n {!!item.children?.length && (\n <z-list\n class=\"sub-list\"\n role=\"group\"\n aria-label={item.label || undefined}\n >\n {item.children.map((child, index) => this.renderItem(child, index))}\n </z-list>\n )}\n </z-list-element>\n );\n }\n\n /**\n * Renders the item grouped by category and subcategory. If `resultsCount` is set, it limits the number of rendered items.\n */\n private renderItemGroups(): HTMLZListGroupElement[] | undefined {\n if (!this.resultsItemsList?.length) {\n return;\n }\n\n const groupedItems = Object.values(this.getGroupedItems()) as SearchbarGroup[];\n const listGroups: HTMLZListGroupElement[] = [];\n const hasResultsLimit = !!this.currResultsCount;\n let renderedCount = 0;\n\n for (const groupItem of groupedItems) {\n const remaining = hasResultsLimit ? this.currResultsCount - renderedCount : groupItem.items.length;\n if (remaining <= 0) {\n break;\n }\n\n const visibleItems = groupItem.items.slice(0, remaining);\n const listGroupsElements: HTMLZListElement[] = visibleItems.map((item: SearchbarItem, subindex: number) =>\n this.renderItem(item, subindex)\n );\n renderedCount += listGroupsElements.length;\n\n if (!listGroupsElements.length) {\n continue;\n }\n\n const ariaLabel = [groupItem.category, groupItem.subcategory].filter(Boolean).join(\" \");\n\n listGroups.push(\n <z-list-group aria-label={ariaLabel || undefined}>\n {groupItem.category && (\n <z-list-element\n class=\"category-heading body-3 mobile-body-4\"\n slot=\"header-title\"\n role=\"presentation\"\n htmlTabindex={-1}\n >\n <div class=\"category\">{groupItem.category}</div>\n {groupItem.subcategory && <div class=\"subcategory\">{groupItem.subcategory}</div>}\n </z-list-element>\n )}\n\n {listGroupsElements}\n </z-list-group>\n );\n }\n\n return listGroups;\n }\n\n render(): HTMLZSearchbarElement {\n return (\n <Host\n onFocus={() => (this.showResults = true)}\n onClick={(e: MouseEvent) => this.handleOutsideClick(e)}\n class={{\"has-submit\": !!this.showSearchButton, \"has-results\": !!this.autocomplete}}\n >\n <div class=\"input-container\">\n <z-input\n ref={(el) => (this.inputRef = el)}\n htmlid={`input-${this.htmlid}`}\n message={false}\n placeholder={this.placeholder}\n onStopTyping={(e: CustomEvent) => this.handleStopTyping(e)}\n onKeyUp={(e: KeyboardEvent) => {\n handleEnterKeydSubmit(e, () => this.handleSubmit());\n this.handleArrowsNavigation(e);\n }}\n onFocus={() => (this.showResults = true)}\n value={this.searchString || this.selectedItem?.label}\n size={this.size}\n label={this.label}\n aria-label={this.htmlAriaLabel || this.placeholder || undefined}\n />\n\n {!!(\n this.showResults &&\n this.autocomplete &&\n this.searchString &&\n this.searchString.length >= this.autocompleteMinChars &&\n this.resultsItemsList\n ) && (\n <div class=\"results z-scrollbar\">\n {this.preventSubmit && !this.resultsItemsList?.length ? (\n <div class=\"item-no-results body-3 mobile-body-4\">\n Non abbiamo trovato risultati per <b>{this.searchString}</b>\n <br />\n <br />\n Cosa puoi fare?\n <ul>\n <li>Verificare di aver scritto bene</li>\n <li>Provare a cercare un'altra parola</li>\n <li>Provare a cercare qualcosa di più generico</li>\n </ul>\n </div>\n ) : (\n <z-list\n role=\"listbox\"\n id={`list-${this.htmlid}`}\n aria-label={this.htmlAriaLabel || this.label || undefined}\n >\n {this.autocomplete && !this.preventSubmit && !!this.searchString && (\n <z-list-element\n role=\"presentation\"\n htmlTabindex={-1}\n id={`list-item-${this.htmlid}-search`}\n onKeyDown={(e: KeyboardEvent) => this.onSearchHelperKeyDown(e)}\n onClick={() => this.emitSearchSubmit()}\n >\n <div\n class=\"list-item item-search\"\n role=\"option\"\n tabindex={0}\n >\n <z-icon\n class=\"search-icon\"\n name=\"left-magnifying-glass\"\n />\n <div\n class=\"item-label body-3 mobile-body-4\"\n innerHTML={this.searchHelperLabel?.replace(\n \"{searchString}\",\n `<mark>${this.searchString}</mark>`\n )}\n />\n </div>\n </z-list-element>\n )}\n\n {this.renderItemGroups()}\n\n {!!(\n this.searchString &&\n this.resultsItemsList?.length &&\n this.currResultsCount &&\n this.currResultsCount < this.resultsItemsList?.length\n ) && (\n <z-list-element\n role=\"presentation\"\n htmlTabindex={-1}\n id={`list-item-${this.htmlid}-show-all`}\n >\n <div\n role=\"option\"\n class=\"item-show-all body-3 mobile-body-4\"\n tabindex={0}\n onClick={() => (this.currResultsCount = undefined)}\n >\n Vedi tutti i risultati\n </div>\n </z-list-element>\n )}\n </z-list>\n )}\n </div>\n )}\n </div>\n\n {this.showSearchButton && (\n <z-button\n icon={this.searchButtonIconOnly ? \"search\" : undefined}\n aria-label={this.searchButtonIconOnly ? this.searchButtonLabel.trim() || \"CERCA\" : undefined}\n disabled={!!this.preventSubmit}\n variant={this.variant}\n size={this.size}\n onClick={() => this.handleSubmit()}\n >\n {this.searchButtonIconOnly ? \"\" : this.searchButtonLabel.trim() || \"CERCA\"}\n </z-button>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"8fAAA,MAAMA,EAAY,IAAM,2+GCAxB,MAAMA,EAAY,IAAM,gOCAxB,MAAMA,EAAY,IAAM,s+BCAxB,MAAMC,EAAgB,IAAM,k8X,MCiCfC,EAAUC,EAAA,MAAAD,UAAAE,EAVvB,WAAAC,CAAAC,G,yMAeEC,KAAAC,OAAS,aAAaC,MAItBF,KAAAG,cAA0B,MAoB1BH,KAAAI,aAAyB,MAIzBJ,KAAAK,qBAAgC,EAQhCL,KAAAM,kBAA6B,uBAQ7BN,KAAAO,iBAA6B,MAI7BP,KAAAQ,iBAA6B,MAI7BR,KAAAS,qBAAiC,MAIjCT,KAAAU,kBAA6B,QAI7BV,KAAAW,KAAqBC,EAAYC,IAIjCb,KAAAc,QAA0BC,EAAcC,QAGxChB,KAAAiB,aAAejB,KAAKkB,MAGpBlB,KAAAmB,iBAAuCnB,KAAKoB,aAG5CpB,KAAAqB,YAAc,MAGdrB,KAAAsB,SAAW,MAKHtB,KAAAuB,iBAAgD,IAoazD,CA9YS,mBAAAC,CAAoBC,GAC1BzB,KAAK0B,gBAAgBC,KAAKF,GAC1BzB,KAAK4B,aAAeH,EACpBzB,KAAKiB,aAAe,E,CAGd,gBAAAY,GACN7B,KAAK8B,aAAaH,KAAK3B,KAAK+B,SAASb,M,CAIvC,UAAAc,GACE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yCustomElement","HTMLElement","constructor","registerHost","this","htmlid","randomId","preventSubmit","autocomplete","autocompleteMinChars","searchHelperLabel","sortResultsItems","showSearchButton","searchButtonIconOnly","searchButtonLabel","size","ControlSize","BIG","variant","ButtonVariant","PRIMARY","searchString","value","currResultsCount","resultsCount","showResults","isMobile","resultsItemsList","emitSearchItemClick","item","searchItemClick","emit","selectedItem","emitSearchSubmit","searchSubmit","inputRef","watchItems","getResultsItemsList","watchResultsCount","watchValue","watchSearchString","searchTyping","resultsItems","JSON","parse","getGroupedItems","groupedItems","forEach","key","category","subcategory","_a","items","push","Object","keys","sort","reduce","obj","assign","a","b","nameA","label","toUpperCase","nameB","onListItemKeyDown","e","KeyboardCode","ENTER","preventDefault","handleArrowsNavigation","onSearchHelperKeyDown","ARROW_DOWN","ARROW_UP","includes","currentElement","target","Array","from","_b","host","shadowRoot","querySelectorAll","currentIndex","indexOf","nextIndex","length","focus","prevIndex","_d","_c","querySelector","_f","_e","setSelectionRange","handleStopTyping","stopPropagation","detail","undefined","handleSubmit","handleOutsideClick","cp","composedPath","componentWillLoad","mql","matchMedia","onMobileViewChange","matches","addEventListener","disconnectedCallback","removeEventListener","renderItemLabel","replace","RegExp","found","renderItem","index","h","id","role","htmlTabindex","onKeyDown","onClick","class","tabindex","icon","name","title","innerHTML","tag","text","children","map","child","renderItemGroups","values","listGroups","hasResultsLimit","renderedCount","groupItem","remaining","visibleItems","slice","listGroupsElements","subindex","ariaLabel","filter","Boolean","join","slot","render","Host","onFocus","ref","el","message","placeholder","onStopTyping","onKeyUp","handleEnterKeydSubmit","htmlAriaLabel","trim","disabled"],"sources":["src/components/z-searchbar/styles.css?tag=z-searchbar&encapsulation=shadow","src/components/css-components/z-label/styles.css?tag=z-searchbar&encapsulation=shadow","src/components/css-components/z-scrollbar/styles.css?tag=z-searchbar&encapsulation=shadow","src/tokens/typography.css?tag=z-searchbar&encapsulation=shadow","src/components/z-searchbar/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-searchbar-results-height: Max height of the results container (default: 540px)\n * @prop --z-searchbar-tag-text-color: Color of tag's text (default --color-primary03);\n * @prop --z-searchbar-tag-bg: Color of tag's background (default --color-hover-primary);\n */\n --z-searchbar-tag-text-color: var(--color-primary03);\n --z-searchbar-tag-bg: var(--color-hover-primary);\n --z-searchbar-item-height: 2.75rem;\n\n z-index: 15;\n display: flex;\n align-items: flex-end;\n column-gap: calc(var(--space-unit) * 2);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host,\n*,\n::after,\n::before {\n box-sizing: border-box;\n}\n\n.input-container {\n position: relative;\n display: flex;\n width: 100%;\n flex-direction: column;\n}\n\n.input-container z-input {\n z-index: 1;\n}\n\n.results {\n --item-icon-size: 1rem;\n --z-icon-height: var(--item-icon-size);\n --z-icon-width: var(--item-icon-size);\n --item-inline-padding: calc(var(--space-unit) * 1.5);\n --item-col-gap: var(--space-unit);\n\n position: absolute;\n top: calc(100% - 1px);\n left: 0;\n overflow: auto;\n width: 100%;\n max-height: var(--z-searchbar-results-height, 540px);\n border: var(--border-size-small) solid var(--color-form-surface03);\n border-top: none;\n background: var(--color-form-background);\n}\n\n.results z-list-element {\n --background-color-list-element: var(--color-form-background);\n\n position: relative;\n display: block;\n}\n\n.results > z-list > z-list-element::part(list-item-container) {\n padding: 0 var(--item-inline-padding);\n}\n\n.results z-list-element > .list-item {\n position: relative;\n display: flex;\n align-items: center;\n padding: calc(var(--space-unit) * 1.25) calc(var(--space-unit) / 4);\n background-color: transparent;\n color: var(--color-form-default-text);\n fill: var(--color-form-default-icon);\n gap: var(--item-col-gap);\n}\n\n.results z-list-element > .list-item:hover {\n background-color: var(--gray100); /* TODO: use correct form-related token when available */\n cursor: pointer;\n}\n\n.results z-list-element > .list-item:focus-visible {\n z-index: 1;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n/* list elements separator */\n.results > z-list > z-list-element:not(:last-child) > .list-item,\n.results z-list-group:not(:last-child) > z-list-element:not(.category-heading) {\n border-bottom: 1px solid var(--color-form-surface03);\n}\n\n.results z-list-group {\n padding: 0 var(--item-inline-padding);\n}\n\n.results z-list-group > z-list-element::part(list-item-container) {\n padding: 0;\n}\n\n.results .sub-list {\n padding-left: calc(var(--item-icon-size) + var(--item-col-gap));\n}\n\n.results .sub-list z-list-element::part(list-item-container) {\n padding: 0;\n}\n\n.results .sub-list z-list-element > .list-item {\n position: relative;\n}\n\n/* tree indicators */\n.results .sub-list > z-list-element:not(:last-child)::before,\n.results .sub-list > z-list-element > .list-item::before {\n position: absolute;\n top: 0;\n left: calc(0px - var(--item-col-gap) - var(--item-icon-size) / 2 + 1px);\n border-left: 1px solid var(--color-form-surface03);\n content: \"\";\n}\n\n/* \"|\" tree indicator */\n.results .sub-list > z-list-element:not(:last-child)::before {\n top: -4px;\n height: calc(100% + 4px);\n}\n\n/* \"—\" tree indicator */\n.results .sub-list z-list-element > .list-item::before {\n width: 14px;\n height: calc(var(--z-searchbar-item-height) / 2);\n border-bottom: 1px solid var(--color-form-surface03);\n}\n\n.results .category-heading > .category {\n font-style: italic;\n}\n\n.results .category-heading > .subcategory {\n text-transform: uppercase;\n}\n\n.results z-list-element > .list-item .ellipsis {\n overflow: hidden;\n}\n\n.results .ellipsis > .item-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.results .item-label mark {\n background: var(--color-primary03);\n color: var(--color-default-text);\n}\n\n.results .list-item > z-tag {\n --z-tag-bg: var(--z-searchbar-tag-bg);\n --z-tag-text-color: var(--z-searchbar-tag-text-color);\n\n margin-left: auto;\n white-space: nowrap;\n}\n\n.results .item-show-all {\n width: 100%;\n color: var(--color-primary01);\n cursor: pointer;\n text-align: center;\n}\n\n.results .item-no-results {\n display: block;\n padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5);\n font-style: italic;\n}\n\n.results .item-no-results > ul {\n padding-left: calc(var(--space-unit) * 2);\n margin: var(--space-unit);\n}\n\n@media (min-width: 768px) {\n .results {\n --item-icon-size: 1.125rem;\n }\n}\n",".z-label {\n display: block;\n padding-bottom: var(--space-unit);\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n font-size: var(--font-size-1);\n font-weight: var(--font-sb);\n text-align: left;\n text-transform: uppercase;\n}\n","/* Webkit Scrollbar */\n.z-scrollbar::-webkit-scrollbar {\n width: 6px;\n background: linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px);\n}\n\n.z-scrollbar::-webkit-scrollbar-thumb {\n background-color: var(--color-primary01);\n}\n\n.z-scrollbar::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n:host([theme=\"dark\"]) .z-scrollbar,\n.z-scrollbar--dark {\n --z-scrollbar-track-gradient: linear-gradient(\n to right,\n transparent 0 1px,\n var(--gray600) 1px 5px,\n transparent 5px 6px\n );\n --z-scrollbar-track-color: var(--gray600);\n --z-scrollbar-thumb-color: var(--color-primary03);\n --z-scrollbar-thumb-hover-color: var(--color-hover-primary);\n --z-scrollbar-corner-color: transparent;\n}\n\n/* Firefox scrollbar */\n@supports not selector(.z-scrollbar::-webkit-scrollbar-track) {\n .z-scrollbar {\n scrollbar-color: var(--color-primary01) transparent;\n }\n\n :host([theme=\"dark\"]) .z-scrollbar,\n .z-scrollbar--dark {\n scrollbar-color: var(--z-scrollbar-thumb-color, var(--color-primary03))\n var(--z-scrollbar-track-color, var(--gray600));\n }\n}\n",":root {\n /* font-family */\n --font-family-sans: \"IBM Plex Sans\", sans-serif;\n --font-family-serif: \"IBM Plex Serif\", serif;\n\n /* font-weight */\n --font-lt: 300;\n --font-rg: 400;\n --font-sb: 600;\n --font-bd: 700;\n\n /* font-size type scale */\n --font-size-1: 0.75rem; /* 12px */\n --font-size-2: 0.875rem; /* 14px */\n --font-size-3: 1rem; /* assuming 16px */\n --font-size-4: 1.125rem; /* 18px */\n --font-size-5: 1.25rem; /* 20px */\n --font-size-6: 1.5rem; /* 24px */\n --font-size-7: 1.75rem; /* 28px */\n --font-size-8: 2rem; /* 32px */\n --font-size-9: 2.25rem; /* 36px */\n --font-size-10: 2.625rem; /* 42px */\n --font-size-11: 3rem; /* 48px */\n --font-size-12: 3.375rem; /* 54px */\n --font-size-13: 3.75rem; /* 60px */\n --font-size-14: 4.25rem; /* 68px */\n --font-size-15: 4.75rem; /* 76px */\n --font-size-16: 5.25rem; /* 84px */\n --font-size-17: 5.75rem; /* 92px */\n\n /* cssprops to use with `font` shorthand property */\n --section-title-1: var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);\n --section-title-2: var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);\n --section-title-3: var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);\n --section-title-4: var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);\n --section-title-5: var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);\n --section-title-6: var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif);\n}\n\n/* Typography classes */\n.heading-1,\n.heading-1-sb,\n.heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n}\n\n.heading-2,\n.heading-2-sb,\n.heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-3,\n.heading-3-sb,\n.heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-4,\n.heading-4-sb,\n.heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-1,\n.body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-2,\n.body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-3,\n.body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-4,\n.body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.body-5,\n.body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.interactive-1,\n.interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.interactive-2,\n.interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.interactive-3,\n.interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.helper,\n.helper-sb {\n font-size: var(--font-size-1);\n font-style: italic;\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n/* section title */\n.section-title-1 {\n font: var(--section-title-1);\n}\n\n.section-title-2 {\n font: var(--section-title-2);\n}\n\n.section-title-3 {\n font: var(--section-title-3);\n}\n\n.section-title-4 {\n font: var(--section-title-4);\n}\n\n.section-title-5 {\n font: var(--section-title-5);\n}\n\n.section-title-6 {\n font: var(--section-title-6);\n}\n\n/* heading-1/2 for desktop and wide viewports */\n@media (min-width: 1152px) {\n .heading-1,\n .heading-1-sb,\n .heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .heading-2,\n .heading-2-sb,\n .heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n}\n\n/* viewport classes */\n@media (max-width: 767px) {\n .mobile-heading-1,\n .mobile-heading-1-sb,\n .mobile-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .mobile-heading-2,\n .mobile-heading-2-sb,\n .mobile-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-3,\n .mobile-heading-3-sb,\n .mobile-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-4,\n .mobile-heading-4-sb,\n .mobile-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-1,\n .mobile-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-2,\n .mobile-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-3,\n .mobile-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-4,\n .mobile-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-body-5,\n .mobile-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-interactive-1,\n .mobile-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-interactive-2,\n .mobile-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-interactive-3,\n .mobile-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-section-title-1 {\n font: var(--section-title-1);\n }\n\n .mobile-section-title-2 {\n font: var(--section-title-2);\n }\n\n .mobile-section-title-3 {\n font: var(--section-title-3);\n }\n\n .mobile-section-title-4 {\n font: var(--section-title-4);\n }\n\n .mobile-section-title-5 {\n font: var(--section-title-5);\n }\n\n .mobile-section-title-6 {\n font: var(--section-title-6);\n }\n\n .mobile-heading-1-lt,\n .mobile-heading-2-lt,\n .mobile-heading-3-lt,\n .mobile-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .mobile-heading-1-sb,\n .mobile-heading-2-sb,\n .mobile-heading-3-sb,\n .mobile-heading-4-sb,\n .mobile-body-1-sb,\n .mobile-body-2-sb,\n .mobile-body-3-sb,\n .mobile-body-4-sb,\n .mobile-body-5-sb,\n .mobile-interactive-1-sb,\n .mobile-interactive-2-sb,\n .mobile-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 768px) and (max-width: 1151px) {\n .tablet-heading-1,\n .tablet-heading-1-sb,\n .tablet-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .tablet-heading-2,\n .tablet-heading-2-sb,\n .tablet-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-3,\n .tablet-heading-3-sb,\n .tablet-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-4,\n .tablet-heading-4-sb,\n .tablet-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-1,\n .tablet-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-2,\n .tablet-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-3,\n .tablet-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-4,\n .tablet-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-body-5,\n .tablet-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-interactive-1,\n .tablet-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-interactive-2,\n .tablet-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-interactive-3,\n .tablet-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-section-title-1 {\n font: var(--section-title-1);\n }\n\n .tablet-section-title-2 {\n font: var(--section-title-2);\n }\n\n .tablet-section-title-3 {\n font: var(--section-title-3);\n }\n\n .tablet-section-title-4 {\n font: var(--section-title-4);\n }\n\n .tablet-section-title-5 {\n font: var(--section-title-5);\n }\n\n .tablet-section-title-6 {\n font: var(--section-title-6);\n }\n\n .tablet-heading-1-lt,\n .tablet-heading-2-lt,\n .tablet-heading-3-lt,\n .tablet-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .tablet-heading-1-sb,\n .tablet-heading-2-sb,\n .tablet-heading-3-sb,\n .tablet-heading-4-sb,\n .tablet-body-1-sb,\n .tablet-body-2-sb,\n .tablet-body-3-sb,\n .tablet-body-4-sb,\n .tablet-body-5-sb,\n .tablet-interactive-1-sb,\n .tablet-interactive-2-sb,\n .tablet-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1152px) and (max-width: 1365px) {\n .desktop-heading-1,\n .desktop-heading-1-sb,\n .desktop-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .desktop-heading-2,\n .desktop-heading-2-sb,\n .desktop-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .desktop-heading-3,\n .desktop-heading-3-sb,\n .desktop-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .desktop-heading-4,\n .desktop-heading-4-sb,\n .desktop-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-1,\n .desktop-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-2,\n .desktop-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-3,\n .desktop-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-4,\n .desktop-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-body-5,\n .desktop-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-interactive-1,\n .desktop-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-interactive-2,\n .desktop-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-interactive-3,\n .desktop-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-section-title-1 {\n font: var(--section-title-1);\n }\n\n .desktop-section-title-2 {\n font: var(--section-title-2);\n }\n\n .desktop-section-title-3 {\n font: var(--section-title-3);\n }\n\n .desktop-section-title-4 {\n font: var(--section-title-4);\n }\n\n .desktop-section-title-5 {\n font: var(--section-title-5);\n }\n\n .desktop-section-title-6 {\n font: var(--section-title-6);\n }\n\n .desktop-heading-1-lt,\n .desktop-heading-2-lt,\n .desktop-heading-3-lt,\n .desktop-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .desktop-heading-1-sb,\n .desktop-heading-2-sb,\n .desktop-heading-3-sb,\n .desktop-heading-4-sb,\n .desktop-body-1-sb,\n .desktop-body-2-sb,\n .desktop-body-3-sb,\n .desktop-body-4-sb,\n .desktop-body-5-sb,\n .desktop-interactive-1-sb,\n .desktop-interactive-2-sb,\n .desktop-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1366px) {\n .wide-heading-1,\n .wide-heading-1-sb,\n .wide-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .wide-heading-2,\n .wide-heading-2-sb,\n .wide-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .wide-heading-3,\n .wide-heading-3-sb,\n .wide-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .wide-heading-4,\n .wide-heading-4-sb,\n .wide-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-1,\n .wide-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-2,\n .wide-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-3,\n .wide-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-4,\n .wide-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-body-5,\n .wide-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-interactive-1,\n .wide-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-interactive-2,\n .wide-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-interactive-3,\n .wide-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-section-title-1 {\n font: var(--section-title-1);\n }\n\n .wide-section-title-2 {\n font: var(--section-title-2);\n }\n\n .wide-section-title-3 {\n font: var(--section-title-3);\n }\n\n .wide-section-title-4 {\n font: var(--section-title-4);\n }\n\n .wide-section-title-5 {\n font: var(--section-title-5);\n }\n\n .wide-section-title-6 {\n font: var(--section-title-6);\n }\n\n .wide-heading-1-lt,\n .wide-heading-2-lt,\n .wide-heading-3-lt,\n .wide-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .wide-heading-1-sb,\n .wide-heading-2-sb,\n .wide-heading-3-sb,\n .wide-heading-4-sb,\n .wide-body-1-sb,\n .wide-body-2-sb,\n .wide-body-3-sb,\n .wide-body-4-sb,\n .wide-body-5-sb,\n .wide-interactive-1-sb,\n .wide-interactive-2-sb,\n .wide-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n/* font-weight variants */\n.heading-1-lt,\n.heading-2-lt,\n.heading-3-lt,\n.heading-4-lt {\n font-weight: var(--font-lt);\n}\n\n.heading-1-sb,\n.heading-2-sb,\n.heading-3-sb,\n.heading-4-sb,\n.body-1-sb,\n.body-2-sb,\n.body-3-sb,\n.body-4-sb,\n.body-5-sb,\n.interactive-1-sb,\n.interactive-2-sb,\n.interactive-3-sb,\n.helper-sb {\n font-weight: var(--font-sb);\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {\n ButtonVariant,\n ControlSize,\n KeyboardCode,\n SearchbarGroup,\n SearchbarGroupedItem,\n SearchbarItem,\n} from \"../../beans\";\nimport {handleEnterKeydSubmit, randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-searchbar\",\n styleUrls: [\n \"styles.css\",\n \"../css-components/z-label/styles.css\",\n \"../css-components/z-scrollbar/styles.css\",\n \"../../tokens/typography.css\",\n ],\n shadow: true,\n})\nexport class ZSearchbar implements ComponentInterface {\n @Element() host: HTMLZSearchbarElement;\n\n /** The id of the searchbar element */\n @Prop({reflect: true})\n htmlid = `searchbar-${randomId()}`;\n\n /** Prevent submit action */\n @Prop()\n preventSubmit?: boolean = false;\n\n /** The input label */\n @Prop()\n label?: string;\n\n /** The input aria-label */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Input search string */\n @Prop()\n value?: string;\n\n /** Search input placeholder */\n @Prop()\n placeholder?: string;\n\n /** Show autocomplete results */\n @Prop()\n autocomplete?: boolean = false;\n\n /** Minimun number of characters to dispatch typing event */\n @Prop()\n autocompleteMinChars?: number = 3;\n\n /** Number of results shown. Default: all */\n @Prop()\n resultsCount?: number;\n\n /** Search helper text */\n @Prop()\n searchHelperLabel?: string = \"Cerca {searchString}\";\n\n /** Autocomplete results items */\n @Prop()\n resultsItems?: SearchbarItem[] | string;\n\n /** Sort autocomplete results items */\n @Prop()\n sortResultsItems?: boolean = false;\n\n /** Show submit button */\n @Prop()\n showSearchButton?: boolean = false;\n\n /** Hide the label of the submit button, showing only the icon */\n @Prop()\n searchButtonIconOnly?: boolean = false;\n\n /** The label of the submit button */\n @Prop()\n searchButtonLabel?: string = \"CERCA\";\n\n /** Size of the `z-input` and submit `z-button` */\n @Prop()\n size?: ControlSize = ControlSize.BIG;\n\n /** Submit `z-button` variant */\n @Prop()\n variant?: ButtonVariant = ButtonVariant.PRIMARY;\n\n @State()\n searchString = this.value;\n\n @State()\n currResultsCount: number | undefined = this.resultsCount;\n\n @State()\n showResults = false;\n\n @State()\n isMobile = false;\n\n @State()\n selectedItem?: SearchbarItem;\n\n private resultsItemsList: SearchbarItem[] | undefined = null;\n\n private inputRef: HTMLZInputElement;\n\n /** Media query list for detecting mobile view. */\n private mql?: MediaQueryList;\n\n /** Listener for changes in the mobile view media query. */\n private onMobileViewChange?: (e: MediaQueryListEvent) => void;\n\n /** Emitted on search submit, return search string */\n @Event()\n searchSubmit: EventEmitter<string>;\n\n /** Emitted on search typing, return search string */\n @Event()\n searchTyping: EventEmitter<string>;\n\n /** Emitted on search result click, return item */\n @Event()\n searchItemClick: EventEmitter<SearchbarItem>;\n\n private emitSearchItemClick(item: SearchbarItem): void {\n this.searchItemClick.emit(item);\n this.selectedItem = item;\n this.searchString = \"\";\n }\n\n private emitSearchSubmit(): void {\n this.searchSubmit.emit(this.inputRef.value);\n }\n\n @Watch(\"resultsItems\")\n watchItems(): void {\n this.resultsItemsList = this.getResultsItemsList();\n }\n\n @Watch(\"resultsCount\")\n watchResultsCount(): void {\n this.currResultsCount = this.resultsCount;\n }\n\n @Watch(\"value\")\n watchValue(): void {\n this.searchString = this.value;\n }\n\n @Watch(\"searchString\")\n watchSearchString(): void {\n this.searchTyping.emit(this.searchString);\n if (!this.searchString) {\n this.currResultsCount = this.resultsCount;\n }\n }\n\n private getResultsItemsList(): SearchbarItem[] | undefined {\n return typeof this.resultsItems === \"string\" ? JSON.parse(this.resultsItems) : this.resultsItems;\n }\n\n private getGroupedItems(): SearchbarGroupedItem {\n const groupedItems = {};\n this.resultsItemsList.forEach((item: SearchbarItem) => {\n const key = `${item?.category}${item?.subcategory}`;\n groupedItems[key] = groupedItems[key] ?? {\n category: item?.category,\n subcategory: item?.subcategory,\n items: [],\n };\n groupedItems[key][\"items\"].push(item);\n });\n\n if (this.sortResultsItems) {\n return Object.keys(groupedItems)\n .sort()\n .reduce((obj, key) => {\n obj[key] = {\n ...groupedItems[key],\n items: groupedItems[key][\"items\"].sort((a: SearchbarItem, b: SearchbarItem) => {\n const nameA = a.label.toUpperCase();\n const nameB = b.label.toUpperCase();\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n\n return 0;\n }),\n };\n\n return obj;\n }, {});\n }\n\n return groupedItems;\n }\n\n private onListItemKeyDown(e: KeyboardEvent, item: SearchbarItem): void {\n if (e.key === KeyboardCode.ENTER) {\n e.preventDefault();\n this.emitSearchItemClick(item);\n\n return;\n }\n\n this.handleArrowsNavigation(e);\n }\n\n private onSearchHelperKeyDown(e: KeyboardEvent): void {\n if (e.key === KeyboardCode.ENTER) {\n e.preventDefault();\n this.emitSearchSubmit();\n\n return;\n }\n\n this.handleArrowsNavigation(e);\n }\n\n private handleArrowsNavigation(e: KeyboardEvent): void {\n if (![KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP].includes(e.key as KeyboardCode)) {\n return;\n }\n\n const currentElement = e.target as HTMLElement;\n const items = Array.from(this.host.shadowRoot?.querySelectorAll(\"z-list .list-item\") ?? []);\n const currentIndex = items.indexOf(currentElement);\n\n if (e.key === KeyboardCode.ARROW_DOWN) {\n e.preventDefault();\n const nextIndex = currentIndex + 1;\n if (nextIndex < items.length) {\n (items[nextIndex] as HTMLElement).focus();\n }\n }\n\n if (e.key === KeyboardCode.ARROW_UP) {\n e.preventDefault();\n const prevIndex = currentIndex - 1;\n if (prevIndex < 0) {\n this.host.shadowRoot?.querySelector(\"input\")?.focus();\n this.host.shadowRoot\n ?.querySelector(\"input\")\n ?.setSelectionRange(this.inputRef.value.length, this.inputRef.value.length);\n }\n if (prevIndex >= 0) {\n (items[prevIndex] as HTMLElement).focus();\n }\n }\n }\n\n private handleStopTyping(e: CustomEvent): void {\n e.stopPropagation();\n this.searchString = e.detail.value;\n this.selectedItem = undefined;\n }\n\n private handleSubmit(): void {\n if (this.preventSubmit) {\n return;\n }\n\n this.emitSearchSubmit();\n }\n\n @Listen(\"click\", {target: \"document\"})\n private handleOutsideClick(e: MouseEvent): void {\n const cp = e.composedPath();\n if (cp.includes(this.host)) {\n return;\n }\n\n this.showResults = false;\n }\n\n componentWillLoad(): void {\n this.resultsItemsList = this.getResultsItemsList();\n\n this.mql = matchMedia(\"(max-width: 767px)\");\n this.onMobileViewChange = (e: MediaQueryListEvent) => (this.isMobile = e.matches);\n this.mql.addEventListener(\"change\", this.onMobileViewChange);\n this.isMobile = this.mql.matches;\n }\n\n disconnectedCallback(): void {\n this.mql?.removeEventListener(\"change\", this.onMobileViewChange);\n }\n\n private renderItemLabel(label: string): string {\n if (!this.searchString) {\n return label;\n }\n\n return label.replace(\n new RegExp(this.searchString.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"), \"gmi\"),\n (found) => `<mark>${found}</mark>`\n );\n }\n\n private renderItem(item: SearchbarItem, index: number): HTMLZListElementElement {\n return (\n <z-list-element\n id={`list-item-${this.htmlid}-${index}`}\n role=\"presentation\"\n htmlTabindex={-1}\n onKeyDown={(e: KeyboardEvent) => this.onListItemKeyDown(e, item)}\n onClick={(e: MouseEvent) => {\n e.stopPropagation();\n this.emitSearchItemClick(item);\n }}\n >\n <div\n class=\"list-item ellipsis\"\n role=\"option\"\n tabindex={0}\n >\n {!!item?.icon && (\n <z-icon\n class=\"item-icon\"\n name={item.icon}\n />\n )}\n\n <div\n class=\"item-label body-3 mobile-body-4\"\n title={item.label}\n innerHTML={this.renderItemLabel(item.label)}\n />\n {!!item?.tag && <z-tag icon={item.tag.icon}>{!this.isMobile ? item.tag.text : \"\"}</z-tag>}\n </div>\n {!!item.children?.length && (\n <z-list\n class=\"sub-list\"\n role=\"group\"\n aria-label={item.label || undefined}\n >\n {item.children.map((child, index) => this.renderItem(child, index))}\n </z-list>\n )}\n </z-list-element>\n );\n }\n\n /**\n * Renders the item grouped by category and subcategory. If `resultsCount` is set, it limits the number of rendered items.\n */\n private renderItemGroups(): HTMLZListGroupElement[] | undefined {\n if (!this.resultsItemsList?.length) {\n return;\n }\n\n const groupedItems = Object.values(this.getGroupedItems()) as SearchbarGroup[];\n const listGroups: HTMLZListGroupElement[] = [];\n const hasResultsLimit = !!this.currResultsCount;\n let renderedCount = 0;\n\n for (const groupItem of groupedItems) {\n const remaining = hasResultsLimit ? this.currResultsCount - renderedCount : groupItem.items.length;\n if (remaining <= 0) {\n break;\n }\n\n const visibleItems = groupItem.items.slice(0, remaining);\n const listGroupsElements: HTMLZListElement[] = visibleItems.map((item: SearchbarItem, subindex: number) =>\n this.renderItem(item, subindex)\n );\n renderedCount += listGroupsElements.length;\n\n if (!listGroupsElements.length) {\n continue;\n }\n\n const ariaLabel = [groupItem.category, groupItem.subcategory].filter(Boolean).join(\" \");\n\n listGroups.push(\n <z-list-group aria-label={ariaLabel || undefined}>\n {groupItem.category && (\n <z-list-element\n class=\"category-heading body-3 mobile-body-4\"\n slot=\"header-title\"\n role=\"presentation\"\n htmlTabindex={-1}\n >\n <div class=\"category\">{groupItem.category}</div>\n {groupItem.subcategory && <div class=\"subcategory\">{groupItem.subcategory}</div>}\n </z-list-element>\n )}\n\n {listGroupsElements}\n </z-list-group>\n );\n }\n\n return listGroups;\n }\n\n render(): HTMLZSearchbarElement {\n return (\n <Host\n onFocus={() => (this.showResults = true)}\n onClick={(e: MouseEvent) => this.handleOutsideClick(e)}\n class={{\"has-submit\": !!this.showSearchButton, \"has-results\": !!this.autocomplete}}\n >\n <div class=\"input-container\">\n <z-input\n ref={(el) => (this.inputRef = el)}\n htmlid={`input-${this.htmlid}`}\n message={false}\n placeholder={this.placeholder}\n onStopTyping={(e: CustomEvent) => this.handleStopTyping(e)}\n onKeyUp={(e: KeyboardEvent) => {\n handleEnterKeydSubmit(e, () => this.handleSubmit());\n this.handleArrowsNavigation(e);\n }}\n onFocus={() => (this.showResults = true)}\n value={this.searchString || this.selectedItem?.label}\n size={this.size}\n label={this.label}\n aria-label={this.htmlAriaLabel || this.placeholder || undefined}\n />\n\n {!!(\n this.showResults &&\n this.autocomplete &&\n this.searchString &&\n this.searchString.length >= this.autocompleteMinChars &&\n this.resultsItemsList\n ) && (\n <div class=\"results z-scrollbar\">\n {this.preventSubmit && !this.resultsItemsList?.length ? (\n <div class=\"item-no-results body-3 mobile-body-4\">\n Non abbiamo trovato risultati per <b>{this.searchString}</b>\n <br />\n <br />\n Cosa puoi fare?\n <ul>\n <li>Verificare di aver scritto bene</li>\n <li>Provare a cercare un'altra parola</li>\n <li>Provare a cercare qualcosa di più generico</li>\n </ul>\n </div>\n ) : (\n <z-list\n role=\"listbox\"\n id={`list-${this.htmlid}`}\n aria-label={this.htmlAriaLabel || this.label || undefined}\n >\n {this.autocomplete && !this.preventSubmit && !!this.searchString && (\n <z-list-element\n role=\"presentation\"\n htmlTabindex={-1}\n id={`list-item-${this.htmlid}-search`}\n onKeyDown={(e: KeyboardEvent) => this.onSearchHelperKeyDown(e)}\n onClick={() => this.emitSearchSubmit()}\n >\n <div\n class=\"list-item item-search\"\n role=\"option\"\n tabindex={0}\n >\n <z-icon\n class=\"search-icon\"\n name=\"left-magnifying-glass\"\n />\n <div\n class=\"item-label body-3 mobile-body-4\"\n innerHTML={this.searchHelperLabel?.replace(\n \"{searchString}\",\n `<mark>${this.searchString}</mark>`\n )}\n />\n </div>\n </z-list-element>\n )}\n\n {this.renderItemGroups()}\n\n {!!(\n this.searchString &&\n this.resultsItemsList?.length &&\n this.currResultsCount &&\n this.currResultsCount < this.resultsItemsList?.length\n ) && (\n <z-list-element\n role=\"presentation\"\n htmlTabindex={-1}\n id={`list-item-${this.htmlid}-show-all`}\n >\n <div\n role=\"option\"\n class=\"item-show-all body-3 mobile-body-4\"\n tabindex={0}\n onClick={() => (this.currResultsCount = undefined)}\n >\n Vedi tutti i risultati\n </div>\n </z-list-element>\n )}\n </z-list>\n )}\n </div>\n )}\n </div>\n\n {this.showSearchButton && (\n <z-button\n icon={this.searchButtonIconOnly ? \"search\" : undefined}\n aria-label={this.searchButtonIconOnly ? this.searchButtonLabel.trim() || \"CERCA\" : undefined}\n disabled={!!this.preventSubmit}\n variant={this.variant}\n size={this.size}\n onClick={() => this.handleSubmit()}\n >\n {this.searchButtonIconOnly ? \"\" : this.searchButtonLabel.trim() || \"CERCA\"}\n </z-button>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"weAAA,MAAMA,EAAY,IAAM,2+GCAxB,MAAM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AAS7G,KAAKiB,2BAOvBjB,KAAKmI,sBAGJnI,KAAKiB,gBACLqE,EAAAtF,KAAKuB,oBAAgB,MAAA+D,SAAA,SAAAA,EAAEH,SACvBnF,KAAKmB,kBACLnB,KAAKmB,mBAAmBuE,EAAA1F,KAAKuB,oBAAgB,MAAAmE,SAAA,SAAAA,EAAEP,UAE/C+B,EAAA,kBACEE,KAAK,eACLC,cAAc,EACdF,GAAI,aAAanH,KAAKC,mBAEtBiH,EAAA,OACEE,KAAK,SACLI,MAAM,qCACNC,SAAU,EACVF,QAAS,IAAOvH,KAAKmB,iBAAmB4E,WAAU,8BAYjE/F,KAAKQ,kBACJ0G,EAAA,YAAAtE,IAAA,2CACE8E,KAAM1H,KAAKS,qBAAuB,SAAWsF,UAAS,aAC1C/F,KAAKS,qBAAuBT,KAAKU,kBAAkBoJ,QAAU,QAAU/D,UACnFgE,WAAY/J,KAAKG,cACjBW,QAASd,KAAKc,QACdH,KAAMX,KAAKW,KACX4G,QAAS,IAAMvH,KAAKgG,gBAEnBhG,KAAKS,qBAAuB,GAAKT,KAAKU,kBAAkBoJ,QAAU,S","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as r,H as e,h as s,d as t,t as a}from"./p-RmbDDbWd.js";const o=()=>`:host{display:inline-block;overflow:hidden;width:100%;height:100%;background:var(--color-surface02);border-radius:var(--border-radius);transform:translate3d(0, 0, 0)}:host::after{display:block;width:100%;height:100%;animation:progress 1.6s ease-in-out infinite;background-image:linear-gradient( 90deg, var(--color-surface02) 0%, var(--color-surface03) 95%, var(--color-surface02) 100% );content:"";filter:blur(6px)}@keyframes progress{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}`;const n=r(class r extends e{constructor(r){super();if(r!==false){this.__registerHost()}this.__attachShadow()}render(){return s(t,{key:"1df84453886015afcf512ae9294a598d97c37697"})}static get style(){return o()}},[1,"z-ghost-loading"]);function i(){if(typeof customElements==="undefined"){return}const r=["z-ghost-loading"];r.forEach((r=>{switch(r){case"z-ghost-loading":if(!customElements.get(a(r))){customElements.define(a(r),n)}break}}))}export{n as Z,i as d};
|
|
2
|
+
//# sourceMappingURL=p-CaSvyuw6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZGhostLoading","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key"],"sources":["src/components/z-ghost-loading/styles.css?tag=z-ghost-loading&encapsulation=shadow","src/components/z-ghost-loading/index.tsx"],"sourcesContent":[":host {\n display: inline-block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n background: var(--color-surface02);\n border-radius: var(--border-radius);\n transform: translate3d(0, 0, 0);\n}\n\n:host::after {\n display: block;\n width: 100%;\n height: 100%;\n animation: progress 1.6s ease-in-out infinite;\n background-image: linear-gradient(\n 90deg,\n var(--color-surface02) 0%,\n var(--color-surface03) 95%,\n var(--color-surface02) 100%\n );\n content: \"\";\n filter: blur(6px);\n}\n\n@keyframes progress {\n 0% {\n transform: translateX(-100%);\n }\n\n 100% {\n transform: translateX(100%);\n }\n}\n","import {Component, ComponentInterface, h, Host} from \"@stencil/core\";\n@Component({\n tag: \"z-ghost-loading\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZGhostLoading implements ComponentInterface {\n render(): HTMLZGhostLoadingElement {\n return <Host />;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZGhostLoading","__stencil_proxyCustomElement","HTMLElement","render","h","Host","key"],"sources":["src/components/z-ghost-loading/styles.css?tag=z-ghost-loading&encapsulation=shadow","src/components/z-ghost-loading/index.tsx"],"sourcesContent":[":host {\n display: inline-block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n background: var(--color-surface02);\n border-radius: var(--border-radius);\n transform: translate3d(0, 0, 0);\n}\n\n:host::after {\n display: block;\n width: 100%;\n height: 100%;\n animation: progress 1.6s ease-in-out infinite;\n background-image: linear-gradient(\n 90deg,\n var(--color-surface02) 0%,\n var(--color-surface03) 95%,\n var(--color-surface02) 100%\n );\n content: \"\";\n filter: blur(6px);\n}\n\n@keyframes progress {\n 0% {\n transform: translateX(-100%);\n }\n\n 100% {\n transform: translateX(100%);\n }\n}\n","import {Component, ComponentInterface, h, Host} from \"@stencil/core\";\n@Component({\n tag: \"z-ghost-loading\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZGhostLoading implements ComponentInterface {\n render(): HTMLZGhostLoadingElement {\n return <Host />;\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAY,IAAM,wgB,MCMXC,EAAaC,EAAA,MAAAD,UAAAE,E,iFACxB,MAAAC,GACE,OAAOC,EAACC,EAAI,CAAAC,IAAA,4C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as i,H as t,h as e,d as n,t as r}from"./p-RmbDDbWd.js";import{C as s,I as o}from"./p-D1c5gR45.js";const a=()=>`:host{display:inline;margin-right:var(--z-icon-right-margin, 0);margin-left:var(--z-icon-left-margin, 0);line-height:0;vertical-align:middle}.icon-wrapper{position:relative;z-index:0;display:inline-block}svg:not([width]){width:var(--z-icon-width, 1.125rem)}svg:not([height]){height:var(--z-icon-height, 1.125rem)}.icon-wrapper svg.color-indicator{position:absolute;z-index:-1;bottom:0;left:0}`;const d=/^(.+?)(-transparent)?(-filled|-button)?$/;const h=i(class i extends t{constructor(i){super();if(i!==false){this.__registerHost()}this.__attachShadow()}selectPathOrPolygon(i){if(i===null||i===void 0?void 0:i.startsWith("M")){return e("path",{d:i})}return e("polygon",{points:i})}get hasColorIndicator(){return s.includes(this.name)}get needsTransparentIndicator(){var i;return["transparent","#ffffff00"].includes((i=this.indicatorColor)===null||i===void 0?void 0:i.toLowerCase())}getTransparentIndicatorIconIfNeeded(){var i;const t=(i=this.name)===null||i===void 0?void 0:i.replace(d,"$1-transparent$3");if(!this.hasColorIndicator||!this.needsTransparentIndicator||!o[t]){return this.name}return t}renderColorIndicator(){return e("svg",{class:"color-indicator",fill:this.indicatorColor||"#FFFFFF00",viewBox:"0 0 1000 1000",width:this.width,height:this.height,"aria-hidden":"true"},this.selectPathOrPolygon(o["picker-color"]))}renderBaseIcon(){return e("svg",{id:this.iconid||undefined,fill:this.fill?`var(--${this.fill})`:undefined,viewBox:"0 0 1000 1000",width:this.width,height:this.height,"aria-hidden":"true"},this.selectPathOrPolygon(o[this.getTransparentIndicatorIconIfNeeded()]))}render(){return e(n,{key:"c64019d3c25828c266b030224a74aaa6c9e8df33","aria-hidden":"true"},this.hasColorIndicator&&!this.needsTransparentIndicator?e("div",{class:"icon-wrapper"},this.renderColorIndicator(),this.renderBaseIcon()):this.renderBaseIcon())}static get style(){return a()}},[1,"z-icon",{name:[1],height:[8],width:[8],iconid:[1],fill:[1],indicatorColor:[1,"indicator-color"]}]);function c(){if(typeof customElements==="undefined"){return}const i=["z-icon"];i.forEach((i=>{switch(i){case"z-icon":if(!customElements.get(r(i))){customElements.define(r(i),h)}break}}))}export{h as Z,c as d};
|
|
2
|
+
//# sourceMappingURL=p-CbXEdwLi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ICON_NAME_SUFFIX_REGEX","ZIcon","__stencil_proxyCustomElement","HTMLElement","selectPathOrPolygon","iconValue","startsWith","h","d","points","hasColorIndicator","COLOR_INDICATOR_ICONS","includes","this","name","needsTransparentIndicator","_a","indicatorColor","toLowerCase","getTransparentIndicatorIconIfNeeded","transparentIconName","replace","ICONS","renderColorIndicator","class","fill","viewBox","width","height","renderBaseIcon","id","iconid","undefined","render","Host","key"],"sources":["src/components/z-icon/styles.css?tag=z-icon&encapsulation=shadow","src/components/z-icon/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-icon-width: Width of the icon. Default is 1.125rem (18px).\n * @prop --z-icon-height: Height of the icon. Default is 1.125rem (18px).\n * @prop --z-icon-left-margin: Left margin of the icon. Default is 0.\n * @prop --z-icon-right-margin: Right margin of the icon. Default is 0.\n */\n display: inline;\n margin-right: var(--z-icon-right-margin, 0);\n margin-left: var(--z-icon-left-margin, 0);\n line-height: 0;\n vertical-align: middle;\n}\n\n.icon-wrapper {\n position: relative;\n z-index: 0;\n display: inline-block;\n}\n\nsvg:not([width]) {\n width: var(--z-icon-width, 1.125rem);\n}\n\nsvg:not([height]) {\n height: var(--z-icon-height, 1.125rem);\n}\n\n.icon-wrapper svg.color-indicator {\n position: absolute;\n z-index: -1;\n bottom: 0;\n left: 0;\n}\n","import {Component, ComponentInterface, Host, Prop, h} from \"@stencil/core\";\nimport {COLOR_INDICATOR_ICONS, ICONS} from \"../../constants/iconset\";\n\n// https://regex101.com/r/ZnoZQ5/3\nconst ICON_NAME_SUFFIX_REGEX = /^(.+?)(-transparent)?(-filled|-button)?$/;\n\n/**\n * Component to render an SVG icon from the internal icon set, selected by `name`.\n * This component automatically recognizes icons that have an indicator (e.g. `bg-color`, `font-color`, etc.), that can be filled with a custom color via the `indicatorColor` prop.\n */\n@Component({\n tag: \"z-icon\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZIcon implements ComponentInterface {\n /** Icon name */\n @Prop()\n name: string;\n\n /** Icon height (optional) */\n @Prop()\n height?: number | string;\n\n /** Icon width (optional) */\n @Prop()\n width?: number | string;\n\n /** HTML `id` attribute (optional) */\n @Prop()\n iconid?: string;\n\n /** Name of the CSS color token to use for the icon fill color (e.g. `blue500`). */\n @Prop()\n fill?: string;\n\n /**\n * Color to use to fill the icon's color indicator, if it has one.\n * Can be any valid value for the `fill` svg attribute.\n * If the icon passed through the `name` prop doesn't have a color indicator, this prop has no effect.\n */\n @Prop()\n indicatorColor?: string;\n\n /**\n * Selects either a `<path>` or `<polygon>` element based on the format of the icon data.\n * @param iconValue The SVG path data or polygon points from the ICONS set.\n */\n private selectPathOrPolygon(iconValue: string): SVGPathElement | SVGPolygonElement {\n if (iconValue?.startsWith(\"M\")) {\n return <path d={iconValue}></path>;\n }\n\n return <polygon points={iconValue}></polygon>;\n }\n\n private get hasColorIndicator(): boolean {\n return COLOR_INDICATOR_ICONS.includes(this.name);\n }\n\n private get needsTransparentIndicator(): boolean {\n return [\"transparent\", \"#ffffff00\"].includes(this.indicatorColor?.toLowerCase());\n }\n\n /**\n * For icons with a color indicator, if `indicatorColor` is set to transparent, use a specific icon version without the color indicator.\n * Using the icon without the color indicator prevents visual ambiguity between a transparent indicator and one filled with the background color.\n * @returns The name of the corresponding icon without the indicator, or the original icon name if no transparent version is needed or available.\n */\n private getTransparentIndicatorIconIfNeeded(): string {\n const transparentIconName = this.name?.replace(ICON_NAME_SUFFIX_REGEX, \"$1-transparent$3\");\n if (!this.hasColorIndicator || !this.needsTransparentIndicator || !ICONS[transparentIconName]) {\n return this.name;\n }\n\n return transparentIconName;\n }\n\n /**\n * Render the icon with the color indicator.\n * The indicator is rendered as a separate SVG element behind the main icon, filled with the `indicatorColor`.\n */\n private renderColorIndicator(): SVGElement {\n return (\n <svg\n class=\"color-indicator\"\n fill={this.indicatorColor || \"#FFFFFF00\"}\n viewBox=\"0 0 1000 1000\"\n width={this.width}\n height={this.height}\n aria-hidden=\"true\"\n >\n {this.selectPathOrPolygon(ICONS[\"picker-color\"])}\n </svg>\n );\n }\n\n private renderBaseIcon(): SVGElement {\n return (\n <svg\n id={this.iconid || undefined}\n fill={this.fill ? `var(--${this.fill})` : undefined}\n viewBox=\"0 0 1000 1000\"\n width={this.width}\n height={this.height}\n aria-hidden=\"true\"\n >\n {this.selectPathOrPolygon(ICONS[this.getTransparentIndicatorIconIfNeeded()])}\n </svg>\n );\n }\n\n render(): HTMLZIconElement {\n return (\n <Host aria-hidden=\"true\">\n {this.hasColorIndicator && !this.needsTransparentIndicator ? (\n <div class=\"icon-wrapper\">\n {this.renderColorIndicator()}\n {this.renderBaseIcon()}\n </div>\n ) : (\n this.renderBaseIcon()\n )}\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ICON_NAME_SUFFIX_REGEX","ZIcon","__stencil_proxyCustomElement","HTMLElement","selectPathOrPolygon","iconValue","startsWith","h","d","points","hasColorIndicator","COLOR_INDICATOR_ICONS","includes","this","name","needsTransparentIndicator","_a","indicatorColor","toLowerCase","getTransparentIndicatorIconIfNeeded","transparentIconName","replace","ICONS","renderColorIndicator","class","fill","viewBox","width","height","renderBaseIcon","id","iconid","undefined","render","Host","key"],"sources":["src/components/z-icon/styles.css?tag=z-icon&encapsulation=shadow","src/components/z-icon/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-icon-width: Width of the icon. Default is 1.125rem (18px).\n * @prop --z-icon-height: Height of the icon. Default is 1.125rem (18px).\n * @prop --z-icon-left-margin: Left margin of the icon. Default is 0.\n * @prop --z-icon-right-margin: Right margin of the icon. Default is 0.\n */\n display: inline;\n margin-right: var(--z-icon-right-margin, 0);\n margin-left: var(--z-icon-left-margin, 0);\n line-height: 0;\n vertical-align: middle;\n}\n\n.icon-wrapper {\n position: relative;\n z-index: 0;\n display: inline-block;\n}\n\nsvg:not([width]) {\n width: var(--z-icon-width, 1.125rem);\n}\n\nsvg:not([height]) {\n height: var(--z-icon-height, 1.125rem);\n}\n\n.icon-wrapper svg.color-indicator {\n position: absolute;\n z-index: -1;\n bottom: 0;\n left: 0;\n}\n","import {Component, ComponentInterface, Host, Prop, h} from \"@stencil/core\";\nimport {COLOR_INDICATOR_ICONS, ICONS} from \"../../constants/iconset\";\n\n// https://regex101.com/r/ZnoZQ5/3\nconst ICON_NAME_SUFFIX_REGEX = /^(.+?)(-transparent)?(-filled|-button)?$/;\n\n/**\n * Component to render an SVG icon from the internal icon set, selected by `name`.\n * This component automatically recognizes icons that have an indicator (e.g. `bg-color`, `font-color`, etc.), that can be filled with a custom color via the `indicatorColor` prop.\n */\n@Component({\n tag: \"z-icon\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZIcon implements ComponentInterface {\n /** Icon name */\n @Prop()\n name: string;\n\n /** Icon height (optional) */\n @Prop()\n height?: number | string;\n\n /** Icon width (optional) */\n @Prop()\n width?: number | string;\n\n /** HTML `id` attribute (optional) */\n @Prop()\n iconid?: string;\n\n /** Name of the CSS color token to use for the icon fill color (e.g. `blue500`). */\n @Prop()\n fill?: string;\n\n /**\n * Color to use to fill the icon's color indicator, if it has one.\n * Can be any valid value for the `fill` svg attribute.\n * If the icon passed through the `name` prop doesn't have a color indicator, this prop has no effect.\n */\n @Prop()\n indicatorColor?: string;\n\n /**\n * Selects either a `<path>` or `<polygon>` element based on the format of the icon data.\n * @param iconValue The SVG path data or polygon points from the ICONS set.\n */\n private selectPathOrPolygon(iconValue: string): SVGPathElement | SVGPolygonElement {\n if (iconValue?.startsWith(\"M\")) {\n return <path d={iconValue}></path>;\n }\n\n return <polygon points={iconValue}></polygon>;\n }\n\n private get hasColorIndicator(): boolean {\n return COLOR_INDICATOR_ICONS.includes(this.name);\n }\n\n private get needsTransparentIndicator(): boolean {\n return [\"transparent\", \"#ffffff00\"].includes(this.indicatorColor?.toLowerCase());\n }\n\n /**\n * For icons with a color indicator, if `indicatorColor` is set to transparent, use a specific icon version without the color indicator.\n * Using the icon without the color indicator prevents visual ambiguity between a transparent indicator and one filled with the background color.\n * @returns The name of the corresponding icon without the indicator, or the original icon name if no transparent version is needed or available.\n */\n private getTransparentIndicatorIconIfNeeded(): string {\n const transparentIconName = this.name?.replace(ICON_NAME_SUFFIX_REGEX, \"$1-transparent$3\");\n if (!this.hasColorIndicator || !this.needsTransparentIndicator || !ICONS[transparentIconName]) {\n return this.name;\n }\n\n return transparentIconName;\n }\n\n /**\n * Render the icon with the color indicator.\n * The indicator is rendered as a separate SVG element behind the main icon, filled with the `indicatorColor`.\n */\n private renderColorIndicator(): SVGElement {\n return (\n <svg\n class=\"color-indicator\"\n fill={this.indicatorColor || \"#FFFFFF00\"}\n viewBox=\"0 0 1000 1000\"\n width={this.width}\n height={this.height}\n aria-hidden=\"true\"\n >\n {this.selectPathOrPolygon(ICONS[\"picker-color\"])}\n </svg>\n );\n }\n\n private renderBaseIcon(): SVGElement {\n return (\n <svg\n id={this.iconid || undefined}\n fill={this.fill ? `var(--${this.fill})` : undefined}\n viewBox=\"0 0 1000 1000\"\n width={this.width}\n height={this.height}\n aria-hidden=\"true\"\n >\n {this.selectPathOrPolygon(ICONS[this.getTransparentIndicatorIconIfNeeded()])}\n </svg>\n );\n }\n\n render(): HTMLZIconElement {\n return (\n <Host aria-hidden=\"true\">\n {this.hasColorIndicator && !this.needsTransparentIndicator ? (\n <div class=\"icon-wrapper\">\n {this.renderColorIndicator()}\n {this.renderBaseIcon()}\n </div>\n ) : (\n this.renderBaseIcon()\n )}\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAY,IAAM,2YCIxB,MAAMC,EAAyB,2C,MAWlBC,EAAKC,EAAA,MAAAD,UAAAE,E,iFAiCR,mBAAAC,CAAoBC,GAC1B,GAAIA,IAAS,MAATA,SAAS,SAATA,EAAWC,WAAW,KAAM,CAC9B,OAAOC,EAAA,QAAMC,EAAGH,G,CAGlB,OAAOE,EAAA,WAASE,OAAQJ,G,CAG1B,qBAAYK,GACV,OAAOC,EAAsBC,SAASC,KAAKC,K,CAG7C,6BAAYC,G,MACV,MAAO,CAAC,cAAe,aAAaH,UAASI,EAAAH,KAAKI,kBAAc,MAAAD,SAAA,SAAAA,EAAEE,c,CAQ5D,mCAAAC,G,MACN,MAAMC,GAAsBJ,EAAAH,KAAKC,QAAI,MAAAE,SAAA,SAAAA,EAAEK,QAAQrB,EAAwB,oBACvE,IAAKa,KAAKH,oBAAsBG,KAAKE,4BAA8BO,EAAMF,GAAsB,CAC7F,OAAOP,KAAKC,I,CAGd,OAAOM,C,CAOD,oBAAAG,GACN,OACEhB,EAAA,OACEiB,MAAM,kBACNC,KAAMZ,KAAKI,gBAAkB,YAC7BS,QAAQ,gBACRC,MAAOd,KAAKc,MACZC,OAAQf,KAAKe,OAAM,cACP,QAEXf,KAAKT,oBAAoBkB,EAAM,iB,CAK9B,cAAAO,GACN,OACEtB,EAAA,OACEuB,GAAIjB,KAAKkB,QAAUC,UACnBP,KAAMZ,KAAKY,KAAO,SAASZ,KAAKY,QAAUO,UAC1CN,QAAQ,gBACRC,MAAOd,KAAKc,MACZC,OAAQf,KAAKe,OAAM,cACP,QAEXf,KAAKT,oBAAoBkB,EAAMT,KAAKM,wC,CAK3C,MAAAc,GACE,OACE1B,EAAC2B,EAAI,CAAAC,IAAA,yDAAa,QACftB,KAAKH,oBAAsBG,KAAKE,0BAC/BR,EAAA,OAAKiB,MAAM,gBACRX,KAAKU,uBACLV,KAAKgB,kBAGRhB,KAAKgB,iB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as s,H as t,h as i,d as a,t as e}from"./p-RmbDDbWd.js";import{r as c}from"./p-8C_CrFxp.js";import{d as o}from"./p-CbXEdwLi.js";const r=()=>`:host{display:flex;min-height:calc(var(--space-unit) * 2.5);align-items:start;margin-top:var(--space-unit);color:var(--color-default-text);fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host(.small),:host(.x-small){margin-top:calc(var(--space-unit) * 0.5);font-size:var(--font-size-1)}:host([status="success"]){color:var(--color-hover-success)}:host([status="error"]){color:var(--color-hover-error)}:host([status="warning"]){color:var(--color-hover-warning)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);--z-icon-right-margin:var(--space-unit);margin-top:calc(var(--space-unit) * 0.25)}:host(.small)>z-icon,:host(.x-small)>z-icon{--z-icon-width:14px;--z-icon-height:14px;--z-icon-right-margin:calc(var(--space-unit) * 0.5)}:host([disabled]){color:var(--color-disabled03);fill:var(--color-disabled03)}`;const n=s(class s extends t{constructor(s){super();if(s!==false){this.__registerHost()}this.__attachShadow();this.htmlId=`id-${c()}`;this.htmlRole="alert";this.statusIcons={success:"checkmark-circle",error:"multiply-circled",warning:"exclamation-circle"}}render(){return i(a,{key:"acc2b74cb7dfda1d8529785c601d3fd92c2884dc",role:this.htmlRole&&this.message&&this.status?this.htmlRole:undefined,id:this.htmlId},this.statusIcons[this.status]&&this.message&&i("z-icon",{key:"b9532d92b1a91d4218c30ed7bb543964c7822b03",name:this.statusIcons[this.status]}),i("span",{key:"933d1ac0a4194da9ec3f70ca715812d6cf3a7891",innerHTML:this.message}))}static get style(){return r()}},[1,"z-input-message",{message:[1],htmlId:[1,"html-id"],htmlRole:[1,"html-role"],status:[513],disabled:[516]}]);function l(){if(typeof customElements==="undefined"){return}const s=["z-input-message","z-icon"];s.forEach((s=>{switch(s){case"z-input-message":if(!customElements.get(e(s))){customElements.define(e(s),n)}break;case"z-icon":if(!customElements.get(e(s))){o()}break}}))}export{n as Z,l as d};
|
|
2
|
+
//# sourceMappingURL=p-CdBqnUF6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZInputMessage","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","htmlId","randomId","htmlRole","statusIcons","success","error","warning","render","h","Host","key","role","message","status","undefined","id","name","innerHTML"],"sources":["src/components/z-input-message/styles.css?tag=z-input-message&encapsulation=shadow","src/components/z-input-message/index.tsx"],"sourcesContent":[":host {\n display: flex;\n min-height: calc(var(--space-unit) * 2.5);\n align-items: start;\n margin-top: var(--space-unit);\n color: var(--color-default-text);\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: var(--font-size-2);\n letter-spacing: 0.16px;\n}\n\n:host(.small),\n:host(.x-small) {\n margin-top: calc(var(--space-unit) * 0.5);\n font-size: var(--font-size-1);\n}\n\n:host([status=\"success\"]) {\n color: var(--color-hover-success);\n}\n\n:host([status=\"error\"]) {\n color: var(--color-hover-error);\n}\n\n:host([status=\"warning\"]) {\n color: var(--color-hover-warning);\n}\n\n:host(:focus) {\n outline: none;\n}\n\n:host > z-icon {\n --z-icon-width: calc(var(--space-unit) * 2);\n --z-icon-height: calc(var(--space-unit) * 2);\n --z-icon-right-margin: var(--space-unit);\n\n margin-top: calc(var(--space-unit) * 0.25);\n}\n\n:host(.small) > z-icon,\n:host(.x-small) > z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n --z-icon-right-margin: calc(var(--space-unit) * 0.5);\n}\n\n:host([disabled]) {\n color: var(--color-disabled03);\n fill: var(--color-disabled03);\n}\n","import {Component, ComponentInterface, Host, Prop, h} from \"@stencil/core\";\nimport {InputStatus} from \"../../beans\";\nimport {randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-input-message\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZInputMessage implements ComponentInterface {\n /** input helper message */\n @Prop()\n message: string;\n\n /** the id of the message element (optional) */\n @Prop()\n htmlId? = `id-${randomId()}`;\n\n /** the role to set when both the message and the status are populated (optional) */\n @Prop()\n htmlRole: null | string = \"alert\";\n\n /** input status (optional) */\n @Prop({reflect: true})\n status?: InputStatus;\n\n /** input disabled status (optional) */\n @Prop({reflect: true})\n disabled?: boolean;\n\n private statusIcons = {\n success: \"checkmark-circle\",\n error: \"multiply-circled\",\n warning: \"exclamation-circle\",\n };\n\n render(): HTMLZInputMessageElement {\n return (\n <Host\n role={this.htmlRole && this.message && this.status ? this.htmlRole : undefined}\n id={this.htmlId}\n >\n {this.statusIcons[this.status] && this.message && <z-icon name={this.statusIcons[this.status]}></z-icon>}\n <span innerHTML={this.message} />\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZInputMessage","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","htmlId","randomId","htmlRole","statusIcons","success","error","warning","render","h","Host","key","role","message","status","undefined","id","name","innerHTML"],"sources":["src/components/z-input-message/styles.css?tag=z-input-message&encapsulation=shadow","src/components/z-input-message/index.tsx"],"sourcesContent":[":host {\n display: flex;\n min-height: calc(var(--space-unit) * 2.5);\n align-items: start;\n margin-top: var(--space-unit);\n color: var(--color-default-text);\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: var(--font-size-2);\n letter-spacing: 0.16px;\n}\n\n:host(.small),\n:host(.x-small) {\n margin-top: calc(var(--space-unit) * 0.5);\n font-size: var(--font-size-1);\n}\n\n:host([status=\"success\"]) {\n color: var(--color-hover-success);\n}\n\n:host([status=\"error\"]) {\n color: var(--color-hover-error);\n}\n\n:host([status=\"warning\"]) {\n color: var(--color-hover-warning);\n}\n\n:host(:focus) {\n outline: none;\n}\n\n:host > z-icon {\n --z-icon-width: calc(var(--space-unit) * 2);\n --z-icon-height: calc(var(--space-unit) * 2);\n --z-icon-right-margin: var(--space-unit);\n\n margin-top: calc(var(--space-unit) * 0.25);\n}\n\n:host(.small) > z-icon,\n:host(.x-small) > z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n --z-icon-right-margin: calc(var(--space-unit) * 0.5);\n}\n\n:host([disabled]) {\n color: var(--color-disabled03);\n fill: var(--color-disabled03);\n}\n","import {Component, ComponentInterface, Host, Prop, h} from \"@stencil/core\";\nimport {InputStatus} from \"../../beans\";\nimport {randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-input-message\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZInputMessage implements ComponentInterface {\n /** input helper message */\n @Prop()\n message: string;\n\n /** the id of the message element (optional) */\n @Prop()\n htmlId? = `id-${randomId()}`;\n\n /** the role to set when both the message and the status are populated (optional) */\n @Prop()\n htmlRole: null | string = \"alert\";\n\n /** input status (optional) */\n @Prop({reflect: true})\n status?: InputStatus;\n\n /** input disabled status (optional) */\n @Prop({reflect: true})\n disabled?: boolean;\n\n private statusIcons = {\n success: \"checkmark-circle\",\n error: \"multiply-circled\",\n warning: \"exclamation-circle\",\n };\n\n render(): HTMLZInputMessageElement {\n return (\n <Host\n role={this.htmlRole && this.message && this.status ? this.htmlRole : undefined}\n id={this.htmlId}\n >\n {this.statusIcons[this.status] && this.message && <z-icon name={this.statusIcons[this.status]}></z-icon>}\n <span innerHTML={this.message} />\n </Host>\n );\n }\n}\n"],"mappings":"wIAAA,MAAMA,EAAY,IAAM,+6B,MCSXC,EAAaC,EAAA,MAAAD,UAAAE,EAL1B,WAAAC,CAAAC,G,kEAYEC,KAAAC,OAAU,MAAMC,MAIhBF,KAAAG,SAA0B,QAUlBH,KAAAI,YAAc,CACpBC,QAAS,mBACTC,MAAO,mBACPC,QAAS,qBAcZ,CAXC,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,KAAMZ,KAAKG,UAAYH,KAAKa,SAAWb,KAAKc,OAASd,KAAKG,SAAWY,UACrEC,GAAIhB,KAAKC,QAERD,KAAKI,YAAYJ,KAAKc,SAAWd,KAAKa,SAAWJ,EAAA,UAAAE,IAAA,2CAAQM,KAAMjB,KAAKI,YAAYJ,KAAKc,UACtFL,EAAA,QAAAE,IAAA,2CAAMO,UAAWlB,KAAKa,U","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as o,c as t,h as s,t as r}from"./p-RmbDDbWd.js";import{P as p}from"./p-DdetsoIY.js";import{d as a}from"./p-D8wde41u.js";const i=()=>`:host{--z-tooltip-theme--surface:var(--color-surface01);--z-tooltip-theme--text:var(--color-default-text);--z-tooltip-shadow-filter:drop-shadow(0 1px 2px var(--shadow-color-base));--z-tooltip-padding:var(--space-unit)}z-popover{--z-popover-theme--surface:var(--z-tooltip-theme--surface);--z-popover-theme--text:var(--z-tooltip-theme--text);--z-popover-padding:var(--z-tooltip-padding);--z-popover-shadow-filter:var(--z-tooltip-shadow-filter)}:host([dark]) z-popover{--z-popover-theme--surface:var(--color-surface05);--z-popover-theme--text:var(--color-text-inverse)}`;const n=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.openChange=t(this,"openChange",7);this.position=p.AUTO;this.dark=false;this.open=false;this.closable=true}onPopoverOpenChange(){this.open=this.popoverEl.open}render(){return s("z-popover",{key:"09052c0c35b449590b0abfcd7e2816253814cc57",ref:e=>this.popoverEl=e,bindTo:this.bindTo,open:this.open,position:this.position,closable:this.closable,center:true,showArrow:true,onOpenChange:e=>this.openChange.emit(e.detail)},s("slot",{key:"1d4e6d0108724f8bc77bb6faf17b3938aa77d519"}))}static get style(){return i()}},[257,"z-tooltip",{position:[513],dark:[516],open:[1540],bindTo:[1,"bind-to"],closable:[4]},[[0,"openChange","onPopoverOpenChange"]]]);function h(){if(typeof customElements==="undefined"){return}const e=["z-tooltip","z-popover"];e.forEach((e=>{switch(e){case"z-tooltip":if(!customElements.get(r(e))){customElements.define(r(e),n)}break;case"z-popover":if(!customElements.get(r(e))){a()}break}}))}export{n as Z,h as d};
|
|
2
|
+
//# sourceMappingURL=p-Ch6o4_VN.js.map
|