@ukic/web-components 3.0.0-alpha.13 → 3.0.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-1608a8a5.js +54 -0
- package/dist/cjs/app-globals-1608a8a5.js.map +1 -0
- package/dist/cjs/core.cjs.js +3 -3
- package/dist/cjs/{helpers-08a9ec1c.js → helpers-7a599012.js} +2 -2
- package/dist/cjs/{helpers-08a9ec1c.js.map → helpers-7a599012.js.map} +1 -1
- package/dist/cjs/ic-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ic-alert.cjs.entry.js +2 -2
- package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -2
- package/dist/cjs/ic-badge.cjs.entry.js +3 -3
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/ic-button_3.cjs.entry.js +61 -3
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +3 -3
- package/dist/cjs/ic-card-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +7 -7
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +3 -3
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +3 -3
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +2 -2
- package/dist/cjs/ic-dialog.cjs.entry.js +38 -47
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +2 -2
- package/dist/cjs/ic-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer.cjs.entry.js +2 -2
- package/dist/cjs/ic-hero.cjs.entry.js +2 -2
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +2 -2
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +3 -3
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +2 -2
- package/dist/cjs/ic-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-group.cjs.entry.js +23 -17
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +38 -24
- package/dist/cjs/ic-navigation-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +12 -11
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +4 -4
- package/dist/cjs/ic-pagination-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +7 -7
- package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +7 -6
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +7 -7
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +2 -2
- package/dist/cjs/ic-search-bar.cjs.entry.js +3 -3
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +3 -3
- package/dist/cjs/ic-select.cjs.entry.js +15 -12
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +10 -7
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/ic-skip-link.cjs.entry.js +11 -10
- package/dist/cjs/ic-skip-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +5 -5
- package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +17 -16
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +4 -4
- package/dist/cjs/ic-switch.cjs.entry.js +6 -6
- package/dist/cjs/ic-tab-context.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/ic-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +33 -15
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +3 -3
- package/dist/cjs/ic-toast-region.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast.cjs.entry.js +6 -6
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +4 -4
- package/dist/cjs/ic-toggle-button.cjs.entry.js +5 -5
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +5 -9
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +2 -2
- package/dist/cjs/{index-d337cd8a.js → index-0236cc4b.js} +3 -1
- package/dist/cjs/index-0236cc4b.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/components/ic-badge/ic-badge.css +4 -0
- package/dist/collection/components/ic-button/ic-button.css +29 -13
- package/dist/collection/components/ic-button/ic-button.js +58 -0
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.stories.js +184 -5
- package/dist/collection/components/ic-card-vertical/ic-card-vertical.css +1 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.css +5 -0
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.css +4 -0
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +5 -5
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.css +2 -2
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.css +4 -0
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.js +57 -66
- package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.stories.js +3 -2
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.css +2 -1
- package/dist/collection/components/ic-menu-item/ic-menu-item.css +1 -0
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +47 -49
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +47 -17
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.types.js.map +1 -1
- package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js +36 -22
- package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js.map +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js +10 -9
- package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
- package/dist/collection/components/ic-pagination/ic-pagination.css +10 -2
- package/dist/collection/components/ic-pagination/ic-pagination.js +4 -4
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.css +19 -3
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.js +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +5 -4
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +70 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +6 -6
- package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.css +6 -13
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
- package/dist/collection/components/ic-select/ic-select.css +11 -1
- package/dist/collection/components/ic-select/ic-select.js +12 -9
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +10 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +7 -4
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.stories.js +57 -36
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.css +22 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.js +13 -12
- package/dist/collection/components/ic-skip-link/ic-skip-link.js.map +1 -1
- package/dist/collection/components/ic-skip-link/ic-skip-link.stories.js +375 -31
- package/dist/collection/components/ic-status-tag/ic-status-tag.css +2 -1
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
- package/dist/collection/components/ic-step/ic-step.css +8 -31
- package/dist/collection/components/ic-step/ic-step.js +14 -13
- package/dist/collection/components/ic-step/ic-step.js.map +1 -1
- package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
- package/dist/collection/components/ic-stepper/ic-stepper.stories.js +5 -1
- package/dist/collection/components/ic-switch/ic-switch.js +4 -4
- package/dist/collection/components/ic-tab/ic-tab.css +13 -3
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
- package/dist/collection/components/ic-text-field/ic-text-field.css +1 -0
- package/dist/collection/components/ic-text-field/ic-text-field.js +111 -13
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.stories.js +195 -9
- package/dist/collection/components/ic-theme/ic-theme.js +1 -1
- package/dist/collection/components/ic-toast/ic-toast.css +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +3 -3
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.css +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +2 -2
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +2 -2
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +5 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +2 -6
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +12 -19
- package/dist/components/helpers.js +1 -1
- package/dist/components/ic-badge.js +1 -1
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-button2.js +59 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card-vertical.js +1 -1
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +5 -5
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +1 -1
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js +1 -1
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js +2 -2
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-dialog.js +38 -47
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-menu-item2.js +1 -1
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-navigation-group.js +22 -15
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js +37 -23
- package/dist/components/ic-navigation-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js +10 -9
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +2 -2
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination.js +5 -5
- package/dist/components/ic-pagination.js.map +1 -1
- package/dist/components/ic-popover-menu.js +5 -4
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +5 -5
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-search-bar.js +1 -1
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-select.js +13 -10
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-side-navigation.js +8 -5
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-skip-link.js +10 -9
- package/dist/components/ic-skip-link.js.map +1 -1
- package/dist/components/ic-status-tag.js +3 -3
- package/dist/components/ic-status-tag.js.map +1 -1
- package/dist/components/ic-step.js +15 -14
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +2 -2
- package/dist/components/ic-switch.js +4 -4
- package/dist/components/ic-tab-context.js +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-tab.js +1 -1
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field.js +35 -13
- package/dist/components/ic-text-field.js.map +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast.js +5 -5
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +2 -2
- package/dist/components/ic-toggle-button.js +3 -3
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/components/ic-top-navigation.js +4 -8
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/index.js +50 -0
- package/dist/components/index.js.map +1 -1
- package/dist/core/core.css +353 -245
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-03248270.entry.js +2 -0
- package/dist/core/p-03248270.entry.js.map +1 -0
- package/dist/core/p-0e5e9a11.entry.js +2 -0
- package/dist/core/p-0e5e9a11.entry.js.map +1 -0
- package/dist/core/{p-0f34465d.entry.js → p-115a684f.entry.js} +2 -2
- package/dist/core/p-1446973e.js +2 -0
- package/dist/core/p-1446973e.js.map +1 -0
- package/dist/core/p-167834c7.entry.js +2 -0
- package/dist/core/p-167834c7.entry.js.map +1 -0
- package/dist/core/{p-4e4014cd.entry.js → p-2180f2d1.entry.js} +2 -2
- package/dist/core/{p-8856dff4.entry.js → p-22eed13e.entry.js} +2 -2
- package/dist/core/p-26c50065.entry.js +2 -0
- package/dist/core/p-26c50065.entry.js.map +1 -0
- package/dist/core/{p-e25feba1.entry.js → p-2af04ace.entry.js} +2 -2
- package/dist/core/{p-e25feba1.entry.js.map → p-2af04ace.entry.js.map} +1 -1
- package/dist/core/{p-196e3d33.entry.js → p-2dd6e5bb.entry.js} +2 -2
- package/dist/core/p-2dd6e5bb.entry.js.map +1 -0
- package/dist/core/{p-fbce5f9a.entry.js → p-2f30c66a.entry.js} +2 -2
- package/dist/core/p-30b56108.entry.js +2 -0
- package/dist/core/p-30b56108.entry.js.map +1 -0
- package/dist/core/p-3373b7c4.entry.js +2 -0
- package/dist/core/p-3373b7c4.entry.js.map +1 -0
- package/dist/core/{p-de7542fa.entry.js → p-33c4851a.entry.js} +2 -2
- package/dist/core/p-33c4851a.entry.js.map +1 -0
- package/dist/core/p-38dfe702.entry.js +2 -0
- package/dist/core/p-38dfe702.entry.js.map +1 -0
- package/dist/core/{p-c19cdc86.entry.js → p-44594b52.entry.js} +2 -2
- package/dist/core/{p-72140621.entry.js → p-4681ab85.entry.js} +2 -2
- package/dist/core/{p-78c3ca49.entry.js → p-51aa5330.entry.js} +2 -2
- package/dist/core/p-54100d6b.entry.js +2 -0
- package/dist/core/p-54100d6b.entry.js.map +1 -0
- package/dist/core/p-54f6ad93.entry.js +2 -0
- package/dist/core/p-54f6ad93.entry.js.map +1 -0
- package/dist/core/p-5537abe7.entry.js +2 -0
- package/dist/core/p-5537abe7.entry.js.map +1 -0
- package/dist/core/{p-1fccec19.entry.js → p-56eb4f02.entry.js} +2 -2
- package/dist/core/p-5af75c16.entry.js +2 -0
- package/dist/core/p-5af75c16.entry.js.map +1 -0
- package/dist/core/p-5d944741.entry.js +2 -0
- package/dist/core/p-5d944741.entry.js.map +1 -0
- package/dist/core/p-5ee41fb7.entry.js +2 -0
- package/dist/core/p-5ee41fb7.entry.js.map +1 -0
- package/dist/core/{p-c3785d57.entry.js → p-5f9a9490.entry.js} +2 -2
- package/dist/core/{p-2cb55e86.entry.js → p-62a3ddd1.entry.js} +2 -2
- package/dist/core/{p-df56bc50.entry.js → p-6ab9a62b.entry.js} +2 -2
- package/dist/core/{p-9206379d.entry.js → p-702166d2.entry.js} +2 -2
- package/dist/core/{p-27de359f.entry.js → p-79e9381d.entry.js} +2 -2
- package/dist/core/p-79fef925.js +3 -0
- package/dist/core/p-79fef925.js.map +1 -0
- package/dist/core/p-7acf9ff5.entry.js +2 -0
- package/dist/core/p-7acf9ff5.entry.js.map +1 -0
- package/dist/core/{p-5fa5ba50.entry.js → p-7b1869e9.entry.js} +2 -2
- package/dist/core/{p-9ee2fe04.entry.js → p-7e243134.entry.js} +2 -2
- package/dist/core/{p-111b3186.entry.js → p-8db464d3.entry.js} +2 -2
- package/dist/core/{p-55eb89cc.entry.js → p-8faa9411.entry.js} +2 -2
- package/dist/core/p-8faa9411.entry.js.map +1 -0
- package/dist/core/{p-8870d5d8.entry.js → p-8fbcf586.entry.js} +2 -2
- package/dist/core/{p-bfee1e84.entry.js → p-9b3be8b9.entry.js} +2 -2
- package/dist/core/{p-5b7d8ee9.entry.js → p-9f6cfe53.entry.js} +2 -2
- package/dist/core/{p-98f906ba.entry.js → p-a3607521.entry.js} +2 -2
- package/dist/core/{p-59fc58e1.entry.js → p-a509a2ac.entry.js} +2 -2
- package/dist/core/p-b34dffde.entry.js +2 -0
- package/dist/core/p-b34dffde.entry.js.map +1 -0
- package/dist/core/{p-1d6638c8.entry.js → p-b504da19.entry.js} +2 -2
- package/dist/core/p-b504da19.entry.js.map +1 -0
- package/dist/core/{p-a56ec6d8.entry.js → p-b8b0146c.entry.js} +2 -2
- package/dist/core/{p-f486d4f4.entry.js → p-b8d90c6d.entry.js} +2 -2
- package/dist/core/p-b9827aa1.entry.js +2 -0
- package/dist/core/p-b9827aa1.entry.js.map +1 -0
- package/dist/core/{p-180ea8ac.entry.js → p-c23d8e7f.entry.js} +2 -2
- package/dist/core/{p-ce0fb53a.entry.js → p-c7321a55.entry.js} +2 -2
- package/dist/core/{p-94748b96.entry.js → p-cb0b0d39.entry.js} +2 -2
- package/dist/core/{p-bd802c2f.entry.js → p-cccf78f3.entry.js} +2 -2
- package/dist/core/{p-144a31ec.entry.js → p-d15aa9a1.entry.js} +2 -2
- package/dist/core/{p-90de3f5d.entry.js → p-d5054edb.entry.js} +2 -2
- package/dist/core/p-d5054edb.entry.js.map +1 -0
- package/dist/core/{p-269f841d.js → p-db4c581c.js} +2 -2
- package/dist/core/p-e3314b15.entry.js +2 -0
- package/dist/core/p-e3314b15.entry.js.map +1 -0
- package/dist/core/{p-47b46637.entry.js → p-e4f34246.entry.js} +2 -2
- package/dist/core/{p-30a262d2.entry.js → p-e54842c7.entry.js} +2 -2
- package/dist/core/p-e54842c7.entry.js.map +1 -0
- package/dist/core/{p-40bc1f3e.entry.js → p-e758962b.entry.js} +2 -2
- package/dist/core/p-e758962b.entry.js.map +1 -0
- package/dist/core/p-e97d282e.entry.js +2 -0
- package/dist/core/p-e97d282e.entry.js.map +1 -0
- package/dist/core/p-ecf68c88.entry.js +2 -0
- package/dist/core/p-ecf68c88.entry.js.map +1 -0
- package/dist/core/{p-999102ee.entry.js → p-f27ae8e6.entry.js} +2 -2
- package/dist/core/{p-78c51cba.entry.js → p-f482f6d9.entry.js} +2 -2
- package/dist/core/{p-4a5ab31e.entry.js → p-f6e19998.entry.js} +2 -2
- package/dist/core/p-f6e19998.entry.js.map +1 -0
- package/dist/core/{p-e30c6d79.entry.js → p-ff6f7f3e.entry.js} +2 -2
- package/dist/core/p-ff6f7f3e.entry.js.map +1 -0
- package/dist/esm/app-globals-85eb2251.js +52 -0
- package/dist/esm/app-globals-85eb2251.js.map +1 -0
- package/dist/esm/core.js +4 -4
- package/dist/esm/{helpers-de6293bf.js → helpers-0bd0d9f3.js} +2 -2
- package/dist/esm/{helpers-de6293bf.js.map → helpers-0bd0d9f3.js.map} +1 -1
- package/dist/esm/ic-accordion-group.entry.js +2 -2
- package/dist/esm/ic-accordion.entry.js +2 -2
- package/dist/esm/ic-alert.entry.js +2 -2
- package/dist/esm/ic-back-to-top.entry.js +2 -2
- package/dist/esm/ic-badge.entry.js +3 -3
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +2 -2
- package/dist/esm/ic-breadcrumb.entry.js +2 -2
- package/dist/esm/ic-button_3.entry.js +61 -3
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-vertical.entry.js +3 -3
- package/dist/esm/ic-card-vertical.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +7 -7
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +3 -3
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +3 -3
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +3 -3
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-list.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js +2 -2
- package/dist/esm/ic-dialog.entry.js +38 -47
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +2 -2
- package/dist/esm/ic-empty-state.entry.js +2 -2
- package/dist/esm/ic-footer-link-group.entry.js +2 -2
- package/dist/esm/ic-footer-link.entry.js +2 -2
- package/dist/esm/ic-footer.entry.js +2 -2
- package/dist/esm/ic-hero.entry.js +2 -2
- package/dist/esm/ic-horizontal-scroll.entry.js +2 -2
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +3 -3
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +2 -2
- package/dist/esm/ic-link.entry.js +2 -2
- package/dist/esm/ic-menu-group.entry.js +2 -2
- package/dist/esm/ic-menu-item.entry.js +3 -3
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +2 -2
- package/dist/esm/ic-navigation-group.entry.js +23 -17
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +2 -2
- package/dist/esm/ic-navigation-menu.entry.js +38 -24
- package/dist/esm/ic-navigation-menu.entry.js.map +1 -1
- package/dist/esm/ic-page-header.entry.js +12 -11
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-pagination-item.entry.js +4 -4
- package/dist/esm/ic-pagination-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination.entry.js +7 -7
- package/dist/esm/ic-pagination.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +7 -6
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +7 -7
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +2 -2
- package/dist/esm/ic-search-bar.entry.js +3 -3
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +3 -3
- package/dist/esm/ic-select.entry.js +15 -12
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +10 -7
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +3 -3
- package/dist/esm/ic-skip-link.entry.js +11 -10
- package/dist/esm/ic-skip-link.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +5 -5
- package/dist/esm/ic-status-tag.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +17 -16
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +4 -4
- package/dist/esm/ic-switch.entry.js +6 -6
- package/dist/esm/ic-tab-context.entry.js +2 -2
- package/dist/esm/ic-tab-group.entry.js +4 -4
- package/dist/esm/ic-tab-panel.entry.js +3 -3
- package/dist/esm/ic-tab.entry.js +3 -3
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-text-field.entry.js +33 -15
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +3 -3
- package/dist/esm/ic-toast-region.entry.js +2 -2
- package/dist/esm/ic-toast.entry.js +6 -6
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +4 -4
- package/dist/esm/ic-toggle-button.entry.js +5 -5
- package/dist/esm/ic-toggle-button.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +5 -9
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +2 -2
- package/dist/esm/{index-a7a720e7.js → index-0eefab7d.js} +3 -2
- package/dist/esm/index-0eefab7d.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/types/components/ic-button/ic-button.d.ts +1 -0
- package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +1 -1
- package/dist/types/components/ic-dialog/ic-dialog.d.ts +4 -4
- package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +9 -4
- package/dist/types/components/ic-navigation-group/ic-navigation-group.types.d.ts +3 -0
- package/dist/types/components/ic-navigation-menu/ic-navigation-menu.d.ts +2 -0
- package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +1 -1
- package/dist/types/components/ic-skip-link/ic-skip-link.d.ts +4 -4
- package/dist/types/components/ic-text-field/ic-text-field.d.ts +17 -1
- package/dist/types/components.d.ts +59 -26
- package/hydrate/index.js +358 -211
- package/hydrate/index.mjs +358 -211
- package/package.json +2 -2
- package/vscode-data.json +28 -12
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-d337cd8a.js.map +0 -1
- package/dist/core/p-052d1ff0.entry.js +0 -2
- package/dist/core/p-052d1ff0.entry.js.map +0 -1
- package/dist/core/p-08fbea60.entry.js +0 -2
- package/dist/core/p-08fbea60.entry.js.map +0 -1
- package/dist/core/p-0b757d78.entry.js +0 -2
- package/dist/core/p-0b757d78.entry.js.map +0 -1
- package/dist/core/p-196e3d33.entry.js.map +0 -1
- package/dist/core/p-1d6638c8.entry.js.map +0 -1
- package/dist/core/p-1d9a929b.entry.js +0 -2
- package/dist/core/p-1d9a929b.entry.js.map +0 -1
- package/dist/core/p-30a262d2.entry.js.map +0 -1
- package/dist/core/p-40bc1f3e.entry.js.map +0 -1
- package/dist/core/p-4a5ab31e.entry.js.map +0 -1
- package/dist/core/p-55eb89cc.entry.js.map +0 -1
- package/dist/core/p-59287779.entry.js +0 -2
- package/dist/core/p-59287779.entry.js.map +0 -1
- package/dist/core/p-6c8e72b4.entry.js +0 -2
- package/dist/core/p-6c8e72b4.entry.js.map +0 -1
- package/dist/core/p-6fdb8a79.entry.js +0 -2
- package/dist/core/p-6fdb8a79.entry.js.map +0 -1
- package/dist/core/p-76bdbc98.entry.js +0 -2
- package/dist/core/p-76bdbc98.entry.js.map +0 -1
- package/dist/core/p-7ea79205.entry.js +0 -2
- package/dist/core/p-7ea79205.entry.js.map +0 -1
- package/dist/core/p-8577de91.entry.js +0 -2
- package/dist/core/p-8577de91.entry.js.map +0 -1
- package/dist/core/p-8b928cc9.entry.js +0 -2
- package/dist/core/p-8b928cc9.entry.js.map +0 -1
- package/dist/core/p-8d1bee7a.entry.js +0 -2
- package/dist/core/p-8d1bee7a.entry.js.map +0 -1
- package/dist/core/p-8e4e97b4.js +0 -3
- package/dist/core/p-8e4e97b4.js.map +0 -1
- package/dist/core/p-8f319e1e.entry.js +0 -2
- package/dist/core/p-8f319e1e.entry.js.map +0 -1
- package/dist/core/p-90de3f5d.entry.js.map +0 -1
- package/dist/core/p-912c8594.entry.js +0 -2
- package/dist/core/p-912c8594.entry.js.map +0 -1
- package/dist/core/p-9b741f96.entry.js +0 -2
- package/dist/core/p-9b741f96.entry.js.map +0 -1
- package/dist/core/p-9bcd2c77.entry.js +0 -2
- package/dist/core/p-9bcd2c77.entry.js.map +0 -1
- package/dist/core/p-abf767e3.entry.js +0 -2
- package/dist/core/p-abf767e3.entry.js.map +0 -1
- package/dist/core/p-b594bf26.entry.js +0 -2
- package/dist/core/p-b594bf26.entry.js.map +0 -1
- package/dist/core/p-caa46d81.entry.js +0 -2
- package/dist/core/p-caa46d81.entry.js.map +0 -1
- package/dist/core/p-de7542fa.entry.js.map +0 -1
- package/dist/core/p-e1255160.js +0 -2
- package/dist/core/p-e1255160.js.map +0 -1
- package/dist/core/p-e30c6d79.entry.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-a7a720e7.js.map +0 -1
- /package/dist/core/{p-0f34465d.entry.js.map → p-115a684f.entry.js.map} +0 -0
- /package/dist/core/{p-4e4014cd.entry.js.map → p-2180f2d1.entry.js.map} +0 -0
- /package/dist/core/{p-8856dff4.entry.js.map → p-22eed13e.entry.js.map} +0 -0
- /package/dist/core/{p-fbce5f9a.entry.js.map → p-2f30c66a.entry.js.map} +0 -0
- /package/dist/core/{p-c19cdc86.entry.js.map → p-44594b52.entry.js.map} +0 -0
- /package/dist/core/{p-72140621.entry.js.map → p-4681ab85.entry.js.map} +0 -0
- /package/dist/core/{p-78c3ca49.entry.js.map → p-51aa5330.entry.js.map} +0 -0
- /package/dist/core/{p-1fccec19.entry.js.map → p-56eb4f02.entry.js.map} +0 -0
- /package/dist/core/{p-c3785d57.entry.js.map → p-5f9a9490.entry.js.map} +0 -0
- /package/dist/core/{p-2cb55e86.entry.js.map → p-62a3ddd1.entry.js.map} +0 -0
- /package/dist/core/{p-df56bc50.entry.js.map → p-6ab9a62b.entry.js.map} +0 -0
- /package/dist/core/{p-9206379d.entry.js.map → p-702166d2.entry.js.map} +0 -0
- /package/dist/core/{p-27de359f.entry.js.map → p-79e9381d.entry.js.map} +0 -0
- /package/dist/core/{p-5fa5ba50.entry.js.map → p-7b1869e9.entry.js.map} +0 -0
- /package/dist/core/{p-9ee2fe04.entry.js.map → p-7e243134.entry.js.map} +0 -0
- /package/dist/core/{p-111b3186.entry.js.map → p-8db464d3.entry.js.map} +0 -0
- /package/dist/core/{p-8870d5d8.entry.js.map → p-8fbcf586.entry.js.map} +0 -0
- /package/dist/core/{p-bfee1e84.entry.js.map → p-9b3be8b9.entry.js.map} +0 -0
- /package/dist/core/{p-5b7d8ee9.entry.js.map → p-9f6cfe53.entry.js.map} +0 -0
- /package/dist/core/{p-98f906ba.entry.js.map → p-a3607521.entry.js.map} +0 -0
- /package/dist/core/{p-59fc58e1.entry.js.map → p-a509a2ac.entry.js.map} +0 -0
- /package/dist/core/{p-a56ec6d8.entry.js.map → p-b8b0146c.entry.js.map} +0 -0
- /package/dist/core/{p-f486d4f4.entry.js.map → p-b8d90c6d.entry.js.map} +0 -0
- /package/dist/core/{p-180ea8ac.entry.js.map → p-c23d8e7f.entry.js.map} +0 -0
- /package/dist/core/{p-ce0fb53a.entry.js.map → p-c7321a55.entry.js.map} +0 -0
- /package/dist/core/{p-94748b96.entry.js.map → p-cb0b0d39.entry.js.map} +0 -0
- /package/dist/core/{p-bd802c2f.entry.js.map → p-cccf78f3.entry.js.map} +0 -0
- /package/dist/core/{p-144a31ec.entry.js.map → p-d15aa9a1.entry.js.map} +0 -0
- /package/dist/core/{p-269f841d.js.map → p-db4c581c.js.map} +0 -0
- /package/dist/core/{p-47b46637.entry.js.map → p-e4f34246.entry.js.map} +0 -0
- /package/dist/core/{p-999102ee.entry.js.map → p-f27ae8e6.entry.js.map} +0 -0
- /package/dist/core/{p-78c51cba.entry.js.map → p-f482f6d9.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-classification-banner.js","mappings":";;;AAAA,MAAM,yBAAyB,GAAG
|
1
|
+
{"file":"ic-classification-banner.js","mappings":";;;AAAA,MAAM,yBAAyB,GAAG,ijHAAijH,CAAC;AACplH,qCAAe,yBAAyB;;ACExC,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE,4BAA4B;IACrC,QAAQ,EAAE,UAAU;IACpB,oBAAoB,EAAE,oBAAoB;IAC1C,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,YAAY;CAC3B,CAAC;MAOW,oBAAoB;IALjC;;;;;;;QASU,wBAAmB,GAAY,EAAE,CAAC;;;;QAIlC,mBAAc,GAA0B,SAAS,CAAC;;;;QAIlD,YAAO,GAAY,IAAI,CAAC;;;;QAIxB,WAAM,GAAa,KAAK,CAAC;;;;QAIzB,SAAI,GAAa,KAAK,CAAC;KAyChC;IAvCC,MAAM;QACJ,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;;QAG9B,IAAI,EAAE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;QAC5D,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,mBAAmB;YAAE,mBAAmB,GAAG,EAAE,CAAC;QACnD,IACE,CAAC,cAAc;aACd,cAAc,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;YAEvD,cAAc,GAAG,SAAS,CAAC;QAE7B,QACE,EAAC,IAAI,qDAAC,KAAK,EAAE,EAAE,CAAC,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,IAC5D,6EACa,oBAAoB,EAC/B,KAAK,EAAE;gBACL,CAAC,uBAAuB,GAAG,IAAI;gBAC/B,CAAC,GAAG,cAAc,EAAE,GAAG,cAAc;aACtC,IAEA,cAAc,KAAK,SAAS,IAC3B,YAAM,KAAK,EAAC,WAAW,+CACmB,GAAG,CACtC,IACL,IAAI,EACR,sEAAe,OAAO,EAAC,mBAAmB,IACvC,cAAc,KAAK,SAAS;cACzB,kBAAkB,CAAC,cAAc,CAAC;cAClC,GAAG,IAAI,GAAG,OAAO,GAAG,EAAE;iBACrB,OAAO;iBACP,kBAAkB,CAAC,cAAc,CAAC;iBAClC,mBAAmB,EAAE,CACZ,CACT,CACJ,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-classification-banner/ic-classification-banner.css?tag=ic-classification-banner&encapsulation=shadow","src/components/ic-classification-banner/ic-classification-banner.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-classification-banner: z-index of classification banner\n */\n\n:host {\n position: fixed;\n left: 0;\n bottom: 0;\n width: 100%;\n height: var(--ic-space-lg);\n z-index: var(--ic-z-index-classification-banner);\n\n --ic-typography-color: currentcolor;\n}\n\n:host(.ic-classification-banner-inline) {\n position: static;\n left: auto;\n bottom: auto;\n}\n\n.classification-banner {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: var(--ic-space-xxxs) var(--ic-space-md);\n}\n\n.default {\n background-color: var(--ic-classification-banner-not-set);\n color: var(--ic-classification-banner-text-inverted);\n}\n\n.official {\n background-color: var(--ic-classification-banner-official);\n color: var(--ic-classification-banner-text-inverted);\n}\n\n.official-sensitive {\n background-color: var(--ic-classification-banner-official-sensitive);\n color: var(--ic-classification-banner-text-inverted);\n}\n\n.secret {\n background-color: var(--ic-classification-banner-secret);\n color: var(--ic-classification-banner-text);\n}\n\n.top-secret {\n background-color: var(--ic-classification-banner-top-secret);\n color: var(--ic-classification-banner-text-inverted);\n}\n\n.offscreen {\n position: absolute;\n left: -9999px;\n background-color: #fff;\n color: #000;\n text-transform: none;\n}\n\n.offscreen:dir(rtl) {\n right: -9999px;\n}\n\n@media (forced-colors: active) {\n .classification-banner {\n border: var(--ic-border-hc);\n }\n}\n","import { Component, Prop, h, Host } from \"@stencil/core\";\nimport { IcProtectiveMarkings } from \"./ic-classification-banner.types\";\n\nconst classificationText = {\n default: \"protective marking not set\",\n official: \"official\",\n \"official-sensitive\": \"official-sensitive\",\n secret: \"secret\",\n \"top-secret\": \"top secret\",\n};\n\n@Component({\n tag: \"ic-classification-banner\",\n styleUrl: \"ic-classification-banner.css\",\n shadow: true,\n})\nexport class ClassificationBanner {\n /**\n * The additional information that will be displayed after the classification.\n */\n @Prop() additionalSelectors?: string = \"\";\n /**\n * The classification level to be displayed - also determines the banner and text colour.\n */\n @Prop() classification?: IcProtectiveMarkings = \"default\";\n /**\n * The optional text that will be displayed before classification to specify relevant country/countries.\n */\n @Prop() country?: string = \"uk\";\n /**\n * If `true`, the banner will appear inline with the page, instead of sticking to the bottom of the page.\n */\n @Prop() inline?: boolean = false;\n /**\n * If `true`, \"Up to\" will be displayed before the classification and country.\n */\n @Prop() upTo?: boolean = false;\n\n render() {\n const { inline, upTo } = this;\n\n // In case of unrecognized props, fallback to default\n let { country, additionalSelectors, classification } = this;\n if (!country) country = \"\";\n if (!additionalSelectors) additionalSelectors = \"\";\n if (\n !classification ||\n (classification && !classificationText[classification])\n )\n classification = \"default\";\n\n return (\n <Host class={{ [\"ic-classification-banner-inline\"]: !!inline }}>\n <banner\n aria-label=\"Protective marking\"\n class={{\n [\"classification-banner\"]: true,\n [`${classification}`]: classification,\n }}\n >\n {classification !== \"default\" ? (\n <span class=\"offscreen\">\n The protective marking of this page is:{\" \"}\n </span>\n ) : null}\n <ic-typography variant=\"caption-uppercase\">\n {classification === \"default\"\n ? classificationText[classification]\n : `${upTo ? \"up to\" : \"\"} \n ${country} \n ${classificationText[classification]} \n ${additionalSelectors}`}\n </ic-typography>\n </banner>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
2
|
import { c as closeIcon } from './close-icon.js';
|
3
3
|
import { c as checkResizeObserver, m as getSlotElements, i as isSlotUsed, o as onComponentRequiredPropUndefined } from './helpers.js';
|
4
4
|
import { d as defineCustomElement$5 } from './ic-button2.js';
|
@@ -31,10 +31,6 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
31
31
|
this.resizeObserver = null;
|
32
32
|
this.dialogRendered = false;
|
33
33
|
this.fadeIn = false;
|
34
|
-
/**
|
35
|
-
* If set to `false`, default buttons will not be shown, but slotted dialog controls will still be displayed.
|
36
|
-
*/
|
37
|
-
this.buttons = true;
|
38
34
|
/**
|
39
35
|
* If set to `false`, the dialog will not close when the backdrop is clicked.
|
40
36
|
*/
|
@@ -60,6 +56,10 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
60
56
|
* If `true`, the close button will not be displayed.
|
61
57
|
*/
|
62
58
|
this.hideCloseButton = false;
|
59
|
+
/**
|
60
|
+
* If set to `true`, default button controls will not be shown, but slotted dialog controls will still be displayed.
|
61
|
+
*/
|
62
|
+
this.hideDefaultControls = false;
|
63
63
|
/**
|
64
64
|
* If `true`, the dialog will be displayed.
|
65
65
|
*/
|
@@ -201,19 +201,11 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
201
201
|
element.hasAttribute("disabled") ||
|
202
202
|
(element.tagName === this.IC_ACCORDION_GROUP &&
|
203
203
|
element.hasAttribute("single-expansion"));
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
if (element.getAttribute("type") === "radio") {
|
210
|
-
const radioEl = element.closest("ic-radio-option");
|
211
|
-
if (radioEl && !radioEl.hasAttribute("selected")) {
|
212
|
-
shouldSkipElement = true;
|
213
|
-
}
|
214
|
-
}
|
215
|
-
}
|
216
|
-
return shouldSkipElement;
|
204
|
+
const radioEl = element.closest("ic-radio-option");
|
205
|
+
return (isHidden ||
|
206
|
+
(element.getAttribute("type") === "radio" &&
|
207
|
+
!!radioEl &&
|
208
|
+
!radioEl.hasAttribute("selected")));
|
217
209
|
};
|
218
210
|
this.focusElement = (element, shiftKey = false) => {
|
219
211
|
let nextFocusEl = element;
|
@@ -238,18 +230,18 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
238
230
|
}
|
239
231
|
};
|
240
232
|
this.renderDialog = () => {
|
241
|
-
const {
|
233
|
+
const { hideDefaultControls, size, heading, label, destructive, dismissLabel, hideCloseButton, disableHeightConstraint, disableWidthConstraint, closeIconClick, DIALOG_CONTROLS, } = this;
|
234
|
+
const controlsSlotUsed = isSlotUsed(this.el, DIALOG_CONTROLS);
|
242
235
|
return (h("dialog", { class: {
|
243
|
-
|
236
|
+
dialog: true,
|
244
237
|
[`${size}`]: true,
|
245
|
-
|
246
|
-
|
247
|
-
}, "aria-labelledby": "dialog-label dialog-heading", "aria-describedby": "dialog-alert dialog-content", ref: (el) => (this.dialogEl = el) }, h("div", { class: "heading-area" }, h("div", { class: "heading-content" }, h("div", { class: "label" }, h("slot", { name: "label" }, h("ic-typography", { variant: "label", id: "dialog-label" }, label))), h("div", { class: "heading" }, h("slot", { name: "heading" }, h("ic-typography", { variant: "h4", id: "dialog-heading" }, heading)))), !hideCloseButton && (h("ic-button", { class: "close-icon", variant: "icon", innerHTML: closeIcon, "aria-label": dismissLabel, onClick:
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
} }, h("ic-button", { variant: "tertiary", onClick: () => this.cancelDialog(), class: "dialog-control-button", "data-gets-focus": null }, "Cancel"), h("ic-button", { variant: this.destructive ? "destructive" : "primary", onClick: () => this.confirmDialog(), class: "dialog-control-button", "data-gets-focus": "" }, "Confirm"))))));
|
238
|
+
"disable-height-constraint": !!disableHeightConstraint,
|
239
|
+
"disable-width-constraint": !!disableWidthConstraint,
|
240
|
+
}, "aria-labelledby": "dialog-label dialog-heading", "aria-describedby": "dialog-alert dialog-content", ref: (el) => (this.dialogEl = el) }, h("div", { class: "heading-area" }, h("div", { class: "heading-content" }, h("div", { class: "label" }, h("slot", { name: "label" }, h("ic-typography", { variant: "label", id: "dialog-label" }, label))), h("div", { class: "heading" }, h("slot", { name: "heading" }, h("ic-typography", { variant: "h4", id: "dialog-heading" }, heading)))), !hideCloseButton && (h("ic-button", { class: "close-icon", variant: "icon", innerHTML: closeIcon, "aria-label": dismissLabel, onClick: closeIconClick, "data-gets-focus": destructive || (hideDefaultControls && !controlsSlotUsed)
|
241
|
+
? ""
|
242
|
+
: null }))), h("div", { class: "content-area" }, isSlotUsed(this.el, "alert") && h("slot", { name: "alert" }), h("div", { id: "dialog-content" }, h("slot", null))), (controlsSlotUsed || !hideDefaultControls) && (h("div", { class: {
|
243
|
+
[DIALOG_CONTROLS]: true,
|
244
|
+
} }, controlsSlotUsed ? (h("slot", { name: DIALOG_CONTROLS })) : (h(Fragment, null, h("ic-button", { variant: "tertiary", onClick: () => this.cancelDialog(), class: "dialog-control-button", "data-gets-focus": null }, "Cancel"), h("ic-button", { variant: destructive ? "destructive" : "primary", onClick: () => this.confirmDialog(), class: "dialog-control-button", "data-gets-focus": "" }, "Confirm")))))));
|
253
245
|
};
|
254
246
|
}
|
255
247
|
watchOpenHandler() {
|
@@ -284,13 +276,11 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
284
276
|
onComponentRequiredPropUndefined([{ prop: this.heading, propName: "heading" }], "Dialog");
|
285
277
|
}
|
286
278
|
componentDidRender() {
|
287
|
-
|
288
|
-
this.
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
document.body.style.overflow = "auto";
|
293
|
-
}
|
279
|
+
document.body.style.overflow =
|
280
|
+
getComputedStyle(this.el).display !== "none" &&
|
281
|
+
this.disableHeightConstraint
|
282
|
+
? "hidden"
|
283
|
+
: "auto";
|
294
284
|
}
|
295
285
|
handleKeyboard(ev) {
|
296
286
|
if (this.dialogRendered) {
|
@@ -313,11 +303,11 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
313
303
|
if (this.dialogEl &&
|
314
304
|
this.closeOnBackdropClick &&
|
315
305
|
ev.composedPath().indexOf(this.dialogEl) <= 0) {
|
316
|
-
const
|
317
|
-
const isInDialog =
|
318
|
-
ev.clientY <=
|
319
|
-
|
320
|
-
ev.clientX <=
|
306
|
+
const { top, height, left, width } = this.dialogEl.getBoundingClientRect();
|
307
|
+
const isInDialog = top <= ev.clientY &&
|
308
|
+
ev.clientY <= top + height &&
|
309
|
+
left <= ev.clientX &&
|
310
|
+
ev.clientX <= left + width;
|
321
311
|
if (!isInDialog) {
|
322
312
|
this.open = false;
|
323
313
|
}
|
@@ -352,12 +342,13 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
352
342
|
}
|
353
343
|
}
|
354
344
|
render() {
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
345
|
+
const { dialogRendered, disableHeightConstraint, fadeIn, theme } = this;
|
346
|
+
return (h(Host, { key: '2920aac3b3891cae0e6575c735e507c4c76752f9', class: {
|
347
|
+
"ic-dialog-hidden": !dialogRendered,
|
348
|
+
"ic-dialog-fade-in": fadeIn,
|
349
|
+
"disable-height-constraint": !!disableHeightConstraint,
|
350
|
+
[`ic-theme-${theme}`]: theme !== "inherit",
|
351
|
+
} }, disableHeightConstraint ? (h("div", { class: "backdrop", ref: (el) => (this.backdropEl = el) }, this.renderDialog())) : (this.renderDialog())));
|
361
352
|
}
|
362
353
|
get el() { return this; }
|
363
354
|
static get watchers() { return {
|
@@ -365,13 +356,13 @@ const Dialog = /*@__PURE__*/ proxyCustomElement(class Dialog extends HTMLElement
|
|
365
356
|
}; }
|
366
357
|
static get style() { return IcDialogStyle0; }
|
367
358
|
}, [1, "ic-dialog", {
|
368
|
-
"buttons": [4],
|
369
359
|
"closeOnBackdropClick": [4, "close-on-backdrop-click"],
|
370
360
|
"destructive": [4],
|
371
361
|
"dismissLabel": [1, "dismiss-label"],
|
372
362
|
"disableHeightConstraint": [4, "disable-height-constraint"],
|
373
363
|
"disableWidthConstraint": [4, "disable-width-constraint"],
|
374
364
|
"hideCloseButton": [4, "hide-close-button"],
|
365
|
+
"hideDefaultControls": [4, "hide-default-controls"],
|
375
366
|
"heading": [1],
|
376
367
|
"label": [1],
|
377
368
|
"open": [1540],
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-dialog.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,yhKAAyhK,CAAC;AAC9iK,uBAAe,WAAW;;MCgCb,MAAM;IALnB;;;;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AC,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC;YACnE,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;aAC1B,IAAI,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE;YACrC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC,CAAC;SACnE;KACF;IAEO,4BAA4B,CAAC,QAAiB;QACpD,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,mBAAmB,IAAI,CAAC,CAAC;SAC/B;aAAM;YACL,IAAI,CAAC,mBAAmB,IAAI,CAAC,CAAC;SAC/B;KACF;IAgGD,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,CAAC,kBAAkB,GAAG,CAAC,IAAI,CAAC,cAAc;gBAC1C,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM;gBAClC,CAAC,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB;gBAC7D,CAAC,YAAY,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS;aACrD,IAEA,IAAI,CAAC,uBAAuB,IAC3B,WAAK,KAAK,EAAC,UAAU,EAAC,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,IACtD,IAAI,CAAC,YAAY,EAAE,CAChB,KAEN,IAAI,CAAC,YAAY,EAAE,CACpB,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-dialog/ic-dialog.css?tag=ic-dialog&encapsulation=shadow","src/components/ic-dialog/ic-dialog.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-dialog: z-index of dialog \n */\n\n:host {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100% !important;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n opacity: 0;\n}\n\n:host(.ic-dialog-fade-in) {\n opacity: 1;\n}\n\n:host(.disable-height-constraint) {\n background: none;\n justify-content: unset;\n align-items: unset;\n}\n\n.dialog.disable-height-constraint {\n max-height: none;\n position: relative;\n}\n\n.dialog.disable-height-constraint .content-area {\n overflow-y: visible;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n :host {\n transition: opacity var(--ic-easing-transition-slow);\n }\n\n .dialog {\n transform: translateY(-3rem);\n transition: transform 1000s;\n }\n\n :host(.ic-dialog-fade-in) .dialog {\n transform: translateY(0);\n transition: transform var(--ic-easing-transition-slow);\n }\n}\n\n:host(.ic-dialog-hidden) {\n display: none;\n}\n\n.dialog {\n background-color: var(--ic-dialog-background);\n color: var(--ic-dialog-text-primary);\n --ic-typography-color: var(--ic-dialog-text-primary);\n border: var(--ic-space-1px) solid var(--ic-dialog-border);\n border-radius: var(--ic-border-radius);\n padding: var(--ic-space-xs) 0 var(--ic-space-md);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: visible;\n}\n\n.small {\n width: 50%;\n max-width: 25rem;\n min-height: 11rem;\n max-height: 70vh;\n}\n\n.medium {\n width: 70vw;\n max-width: 44rem;\n min-height: 12.5rem;\n max-height: 70vh;\n}\n\n.large {\n width: 90vw;\n max-width: 62.5rem;\n min-height: 12.5rem;\n max-height: 90vh;\n}\n\n.heading-area {\n display: flex;\n margin-bottom: var(--ic-space-xs);\n padding: 0 var(--ic-space-md);\n}\n\n.heading {\n overflow-wrap: break-word;\n}\n\n.close-icon {\n margin-left: auto;\n}\n\n.close-icon > svg {\n color: var(--ic-dialog-clear-button);\n}\n\n.content-area {\n padding: 0 var(--ic-space-md);\n margin: 0;\n overflow-y: auto;\n}\n\n#dialog-content {\n margin-bottom: var(--ic-space-sm);\n}\n\n#dialog-content ::slotted(ic-typography) {\n overflow-wrap: break-word;\n}\n\n#dialog-content ::slotted(*) {\n position: relative;\n}\n\n.dialog-controls {\n margin-top: auto;\n padding: var(--ic-space-xs) var(--ic-space-md) 0;\n display: flex;\n justify-content: flex-end;\n gap: var(--ic-space-md);\n}\n\n.dialog-control-button {\n width: fit-content;\n}\n\n.backdrop {\n overflow-y: auto;\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n padding-top: 16px;\n padding-bottom: 16px;\n}\n\n.heading ic-typography {\n --ic-typography-color: var(--ic-dialog-text-primary);\n}\n\n.label ic-typography {\n --ic-typography-color: var(--ic-dialog-label);\n}\n\n@media (min-width: 800px) {\n :host([size=\"large\"]) .dialog:not(.disable-width-constraint) > .content-area {\n width: 75%;\n }\n}\n\n@media (max-width: 576px) {\n .dialog {\n width: 100vw;\n height: 100vh;\n transform: translateY(-5rem);\n max-width: none;\n max-height: none;\n box-sizing: border-box;\n }\n\n .backdrop {\n padding: 0;\n }\n\n .dialog.disable-height-constraint {\n height: auto;\n min-height: 100vh;\n }\n}\n\n@media (max-width: 364px) {\n .dialog-control-button {\n width: unset;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n Method,\n Listen,\n Watch,\n h,\n} from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport {\n isSlotUsed,\n checkResizeObserver,\n onComponentRequiredPropUndefined,\n getSlotElements,\n} from \"../../utils/helpers\";\nimport { IcFocusableComponents, IcThemeMode } from \"../../utils/types\";\n\n/**\n * @slot dialog-controls - Content will be place at the bottom of the dialog.\n * @slot heading - Content will be placed at the top of the dialog.\n * @slot label - Content will be placed above the dialog heading.\n * @slot alert - Content will be placed at the top of the content area of the dialog.\n */\n@Component({\n tag: \"ic-dialog\",\n styleUrl: \"ic-dialog.css\",\n shadow: true,\n})\nexport class Dialog {\n private backdropEl?: HTMLDivElement;\n private contentArea: HTMLSlotElement | null;\n private contentAreaMutationObserver: MutationObserver | null = null;\n private DATA_GETS_FOCUS: string = \"data-gets-focus\";\n private DIALOG_CONTROLS: string = \"dialog-controls\";\n private dialogEl?: HTMLDialogElement;\n private dialogHeight: number = 0;\n private focusedElementIndex = 0;\n private IC_TEXT_FIELD: string = \"IC-TEXT-FIELD\";\n private IC_ACCORDION: string = \"IC-ACCORDION\";\n private IC_ACCORDION_GROUP: string = \"IC-ACCORDION-GROUP\";\n private IC_CHECKBOX = \"IC-CHECKBOX\";\n private IC_SEARCH_BAR: string = \"IC-SEARCH-BAR\";\n private interactiveElementList: HTMLElement[];\n private resizeObserver: ResizeObserver | null = null;\n private resizeTimeout: number;\n private sourceElement: HTMLElement;\n\n @Element() el: HTMLIcDialogElement;\n\n @State() dialogRendered: boolean = false;\n @State() fadeIn: boolean = false;\n\n /**\n * If set to `false`, default buttons will not be shown, but slotted dialog controls will still be displayed.\n */\n @Prop() buttons?: boolean = true;\n\n /**\n * If set to `false`, the dialog will not close when the backdrop is clicked.\n */\n @Prop() closeOnBackdropClick?: boolean = true;\n\n /**\n * If 'true', sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button.\n */\n @Prop() destructive?: boolean = false;\n\n /**\n * Sets the dismiss label tooltip and aria label.\n */\n @Prop() dismissLabel?: string = \"Dismiss\";\n\n /**\n * If set to `true`, the content area max height and overflow properties are removed allowing the dialog to stretch below the fold.\n * This prop also prevents popover elements from being cut off within the content area.\n */\n @Prop() disableHeightConstraint?: boolean = false;\n\n /**\n * If set to `true`, the content area width property is removed, allowing content to take the full width of the dialog when using the large variant.\n */\n @Prop() disableWidthConstraint?: boolean = false;\n\n /**\n * If `true`, the close button will not be displayed.\n */\n @Prop() hideCloseButton?: boolean = false;\n\n /**\n * Sets the heading for the dialog.\n */\n @Prop() heading?: string;\n\n /**\n * Sets the optional label for the dialog which appears above the heading.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the dialog will be displayed.\n */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n @Watch(\"open\")\n watchOpenHandler(): void {\n if (this.open) {\n this.dialogOpened();\n } else {\n this.fadeIn = false;\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n setTimeout(() => {\n this.dialogRendered = false;\n this.dialogEl?.close();\n this.sourceElement?.focus();\n this.dialogHeight = 0;\n this.icDialogClosed.emit();\n }, 80);\n }\n }\n\n /**\n * Sets the maximum and minimum height and width for the dialog.\n */\n @Prop() size?: \"small\" | \"medium\" | \"large\" = \"small\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * Cancelation event emitted when default 'Cancel' button clicked or 'cancelDialog' method is called.\n */\n @Event() icDialogCancelled: EventEmitter<void>;\n\n /**\n * Emitted when dialog has closed.\n */\n @Event() icDialogClosed: EventEmitter<void>;\n\n /**\n * Confirmation event emitted when default 'Confirm' primary button clicked or 'confirmDialog' method is called.\n */\n @Event() icDialogConfirmed: EventEmitter<void>;\n\n /**\n * Emitted when dialog has opened.\n */\n @Event() icDialogOpened: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.removeSlotChangeListener();\n }\n\n componentDidLoad(): void {\n this.getInteractiveElements();\n\n this.refreshInteractiveElementsOnSlotChange();\n\n if (this.open) {\n this.dialogOpened();\n }\n\n !isSlotUsed(this.el, \"heading\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Dialog\"\n );\n }\n\n componentDidRender(): void {\n if (\n getComputedStyle(this.el).display !== \"none\" &&\n this.disableHeightConstraint\n ) {\n document.body.style.overflow = \"hidden\";\n } else {\n document.body.style.overflow = \"auto\";\n }\n }\n\n @Listen(\"keydown\", { target: \"document\" })\n handleKeyboard(ev: KeyboardEvent): void {\n if (this.dialogRendered) {\n switch (ev.key) {\n case \"Tab\":\n if (this.onTabKeyPress(ev.shiftKey)) {\n ev.preventDefault();\n }\n break;\n case \"Escape\":\n if (!ev.repeat) {\n this.open = false;\n }\n ev.stopImmediatePropagation();\n break;\n }\n }\n }\n\n @Listen(\"click\", {})\n handleClick(ev: MouseEvent): void {\n if (\n this.dialogEl &&\n this.closeOnBackdropClick &&\n ev.composedPath().indexOf(this.dialogEl) <= 0\n ) {\n const rect = this.dialogEl.getBoundingClientRect();\n const isInDialog =\n rect.top <= ev.clientY &&\n ev.clientY <= rect.top + rect.height &&\n rect.left <= ev.clientX &&\n ev.clientX <= rect.left + rect.width;\n if (!isInDialog) {\n this.open = false;\n }\n }\n }\n\n /**\n * Cancels the dialog. Used by the default 'Cancel' button or can be called manually to trigger cancelling of dialog.\n */\n @Method()\n async cancelDialog(): Promise<void> {\n this.icDialogCancelled.emit();\n this.open = false;\n }\n\n /**\n * Confirms the dialog. Used by the default 'Confirm' button or can be called manually to trigger confirming of dialog.\n */\n @Method()\n async confirmDialog(): Promise<void> {\n this.icDialogConfirmed.emit();\n }\n\n private dialogOpened = () => {\n this.dialogRendered = true;\n\n if (this.disableHeightConstraint) {\n this.dialogEl?.show();\n } else {\n this.dialogEl?.showModal();\n }\n\n setTimeout(() => {\n this.fadeIn = true;\n\n /**\n * This is required to set scroll back to top if:\n * - dialog content goes below the fold\n * - is closed using cancel or confirm and reopened.\n *\n * Without this, the scroll bar will start from the dialog's last scroll-x coordinate.\n */\n if (\n this.backdropEl &&\n this.disableHeightConstraint &&\n this.backdropEl.scrollTop !== 0\n ) {\n this.backdropEl.scrollTop = 0;\n }\n }, 10);\n\n setTimeout(() => {\n this.setInitialFocus();\n checkResizeObserver(this.runResizeObserver);\n }, 75);\n\n setTimeout(() => {\n this.icDialogOpened.emit();\n }, 80);\n };\n\n private runResizeObserver = () => {\n if (this.dialogEl) {\n this.resizeObserver = new ResizeObserver(() => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = window.setTimeout(this.resizeObserverCallback, 80);\n });\n this.resizeObserver.observe(this.dialogEl);\n }\n };\n\n private resizeObserverCallback = () => {\n if (this.dialogEl && this.dialogEl.clientHeight !== this.dialogHeight) {\n this.dialogHeight = this.dialogEl.clientHeight;\n }\n };\n\n private refreshInteractiveElementsOnSlotChange = () => {\n const contentWrapper = this.el.shadowRoot?.querySelector(\"#dialog-content\");\n\n if (contentWrapper) {\n this.contentArea = contentWrapper.querySelector(\"slot\");\n\n // Detect changes to slotted elements\n this.contentArea?.addEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver = new MutationObserver(() => {\n this.getInteractiveElements();\n });\n\n // Detect changes to children of slotted elements\n getSlotElements(contentWrapper)?.forEach((el) => {\n this.contentAreaMutationObserver?.observe(el, {\n childList: true,\n subtree: true,\n });\n });\n }\n };\n\n private removeSlotChangeListener = () => {\n if (this.contentArea) {\n this.contentArea.removeEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver?.disconnect();\n }\n };\n\n private setInitialFocus = () => {\n this.sourceElement = document.activeElement as HTMLElement;\n this.focusedElementIndex = this.interactiveElementList\n ? this.interactiveElementList.findIndex((element) =>\n element.hasAttribute(this.DATA_GETS_FOCUS)\n )\n : 0;\n this.focusElement(this.interactiveElementList[this.focusedElementIndex]);\n };\n\n private getFocusedElementIndex = () => {\n for (let i = 0; i < this.interactiveElementList.length; i++) {\n if (\n (this.interactiveElementList[i] as HTMLElement) ===\n (this.el.shadowRoot?.activeElement || document.activeElement)\n ) {\n this.focusedElementIndex = i;\n }\n }\n };\n\n private closeIconClick = () => {\n this.open = false;\n };\n\n private getInteractiveElements = () => {\n this.interactiveElementList = Array.from(\n this.el.shadowRoot?.querySelectorAll(\"ic-button\") || []\n );\n const slottedInteractiveElements = Array.from(\n this.el.querySelectorAll(\n `a[href], button, input:not(.ic-input), textarea, select, details, [tabindex]:not([tabindex=\"-1\"]),\n ic-button, ic-checkbox, ic-select, ic-search-bar, ic-tab-group, \n ic-back-to-top, ic-breadcrumb, ic-chip[dismissible=\"true\"], ic-footer-link, ic-link, ic-navigation-button,\n ic-navigation-item, ic-switch, ic-text-field, ic-accordion-group, ic-accordion, ic-date-input, ic-date-picker`\n )\n );\n if (slottedInteractiveElements.length > 0) {\n if (slottedInteractiveElements[0].slot !== this.DIALOG_CONTROLS) {\n slottedInteractiveElements[0].setAttribute(this.DATA_GETS_FOCUS, \"\");\n } else if (!this.destructive) {\n slottedInteractiveElements[\n slottedInteractiveElements.length - 1\n ].setAttribute(this.DATA_GETS_FOCUS, \"\");\n }\n }\n for (let i = 0; i < slottedInteractiveElements.length; i++) {\n this.interactiveElementList.splice(\n 1 + i,\n 0,\n slottedInteractiveElements[i] as HTMLElement\n );\n }\n };\n\n private getNextFocusEl = (focusedElementIndex: number) =>\n this.interactiveElementList[focusedElementIndex];\n\n private onTabKeyPress = (shiftKey: boolean): boolean => {\n this.getFocusedElementIndex();\n\n if (\n this.interactiveElementList[this.focusedElementIndex].tagName ===\n this.IC_SEARCH_BAR\n ) {\n return false;\n }\n\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n this.focusElement(this.getNextFocusEl(this.focusedElementIndex), shiftKey);\n return true;\n };\n\n private shouldSkipElement = (element: HTMLElement): boolean => {\n const isHidden =\n getComputedStyle(element).visibility === \"hidden\" ||\n element.offsetHeight === 0 ||\n element.hasAttribute(\"disabled\") ||\n (element.tagName === this.IC_ACCORDION_GROUP &&\n element.hasAttribute(\"single-expansion\"));\n\n let shouldSkipElement = false;\n\n if (isHidden) {\n shouldSkipElement = true;\n } else {\n if (element.getAttribute(\"type\") === \"radio\") {\n const radioEl = element.closest(\"ic-radio-option\");\n if (radioEl && !radioEl.hasAttribute(\"selected\")) {\n shouldSkipElement = true;\n }\n }\n }\n\n return shouldSkipElement;\n };\n\n private focusElement = (element: HTMLElement, shiftKey = false) => {\n let nextFocusEl = element;\n\n if (this.shouldSkipElement(element)) {\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n nextFocusEl = this.getNextFocusEl(this.focusedElementIndex);\n this.focusElement(nextFocusEl, shiftKey);\n } else {\n switch (element.tagName) {\n case this.IC_ACCORDION_GROUP:\n case this.IC_ACCORDION:\n case this.IC_SEARCH_BAR:\n case this.IC_TEXT_FIELD:\n case this.IC_CHECKBOX:\n (element as IcFocusableComponents).setFocus();\n break;\n default:\n (element as HTMLElement).focus();\n }\n }\n };\n\n private loopNextFocusIndexIfLastElement() {\n if (this.focusedElementIndex > this.interactiveElementList.length - 1)\n this.focusedElementIndex = 0;\n else if (this.focusedElementIndex < 0) {\n this.focusedElementIndex = this.interactiveElementList.length - 1;\n }\n }\n\n private setFocusIndexBasedOnShiftKey(shiftKey: boolean) {\n if (shiftKey) {\n this.focusedElementIndex -= 1;\n } else {\n this.focusedElementIndex += 1;\n }\n }\n\n private renderDialog = () => {\n const {\n buttons,\n size,\n heading,\n label,\n destructive,\n dismissLabel,\n hideCloseButton,\n } = this;\n\n return (\n <dialog\n class={{\n [\"dialog\"]: true,\n [`${size}`]: true,\n [\"disable-height-constraint\"]: !!this.disableHeightConstraint,\n [\"disable-width-constraint\"]: !!this.disableWidthConstraint,\n }}\n aria-labelledby=\"dialog-label dialog-heading\"\n aria-describedby=\"dialog-alert dialog-content\"\n ref={(el) => (this.dialogEl = el)}\n >\n <div class=\"heading-area\">\n <div class=\"heading-content\">\n <div class=\"label\">\n <slot name=\"label\">\n <ic-typography variant=\"label\" id=\"dialog-label\">\n {label}\n </ic-typography>\n </slot>\n </div>\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\" id=\"dialog-heading\">\n {heading}\n </ic-typography>\n </slot>\n </div>\n </div>\n {!hideCloseButton && (\n <ic-button\n class=\"close-icon\"\n variant=\"icon\"\n innerHTML={closeIcon}\n aria-label={dismissLabel}\n onClick={this.closeIconClick}\n data-gets-focus={destructive || !buttons ? \"\" : null}\n ></ic-button>\n )}\n </div>\n <div class=\"content-area\">\n {isSlotUsed(this.el, \"alert\") && <slot name=\"alert\"></slot>}\n <div id=\"dialog-content\">\n <slot></slot>\n </div>\n </div>\n {buttons &&\n (isSlotUsed(this.el, this.DIALOG_CONTROLS) ? (\n <div\n class={{\n [this.DIALOG_CONTROLS]: true,\n }}\n >\n <slot name={this.DIALOG_CONTROLS}></slot>\n </div>\n ) : (\n <div\n class={{\n [this.DIALOG_CONTROLS]: true,\n }}\n >\n <ic-button\n variant=\"tertiary\"\n onClick={() => this.cancelDialog()}\n class=\"dialog-control-button\"\n data-gets-focus={null}\n >\n Cancel\n </ic-button>\n <ic-button\n variant={this.destructive ? \"destructive\" : \"primary\"}\n onClick={() => this.confirmDialog()}\n class=\"dialog-control-button\"\n data-gets-focus=\"\"\n >\n Confirm\n </ic-button>\n </div>\n ))}\n </dialog>\n );\n };\n\n render() {\n return (\n <Host\n class={{\n [\"ic-dialog-hidden\"]: !this.dialogRendered,\n [\"ic-dialog-fade-in\"]: this.fadeIn,\n [\"disable-height-constraint\"]: !!this.disableHeightConstraint,\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n }}\n >\n {this.disableHeightConstraint ? (\n <div class=\"backdrop\" ref={(el) => (this.backdropEl = el)}>\n {this.renderDialog()}\n </div>\n ) : (\n this.renderDialog()\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-dialog.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,yhKAAyhK,CAAC;AAC9iK,uBAAe,WAAW;;MCiCb,MAAM;IALnB;;;;;;;;QAQU,gCAA2B,GAA4B,IAAI,CAAC;QAC5D,oBAAe,GAAW,iBAAiB,CAAC;QAC5C,oBAAe,GAAW,iBAAiB,CAAC;QAE5C,iBAAY,GAAW,CAAC,CAAC;QACzB,wBAAmB,GAAG,CAAC,CAAC;QACxB,kBAAa,GAAW,eAAe,CAAC;QACxC,iBAAY,GAAW,cAAc,CAAC;QACtC,uBAAkB,GAAW,oBAAoB,CAAC;QAClD,gBAAW,GAAG,aAAa,CAAC;Q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;gBACnC,mBAAmB,EAAE,MAAM;gBAC3B,2BAA2B,EAAE,CAAC,CAAC,uBAAuB;gBACtD,CAAC,YAAY,KAAK,EAAE,GAAG,KAAK,KAAK,SAAS;aAC3C,IAEA,uBAAuB,IACtB,WAAK,KAAK,EAAC,UAAU,EAAC,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,IACtD,IAAI,CAAC,YAAY,EAAE,CAChB,KAEN,IAAI,CAAC,YAAY,EAAE,CACpB,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-dialog/ic-dialog.css?tag=ic-dialog&encapsulation=shadow","src/components/ic-dialog/ic-dialog.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-dialog: z-index of dialog \n */\n\n:host {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100% !important;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n opacity: 0;\n}\n\n:host(.ic-dialog-fade-in) {\n opacity: 1;\n}\n\n:host(.disable-height-constraint) {\n background: none;\n justify-content: unset;\n align-items: unset;\n}\n\n.dialog.disable-height-constraint {\n max-height: none;\n position: relative;\n}\n\n.dialog.disable-height-constraint .content-area {\n overflow-y: visible;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n :host {\n transition: opacity var(--ic-easing-transition-slow);\n }\n\n .dialog {\n transform: translateY(-3rem);\n transition: transform 1000s;\n }\n\n :host(.ic-dialog-fade-in) .dialog {\n transform: translateY(0);\n transition: transform var(--ic-easing-transition-slow);\n }\n}\n\n:host(.ic-dialog-hidden) {\n display: none;\n}\n\n.dialog {\n background-color: var(--ic-dialog-background);\n color: var(--ic-dialog-text-primary);\n --ic-typography-color: var(--ic-dialog-text-primary);\n border: var(--ic-space-1px) solid var(--ic-dialog-border);\n border-radius: var(--ic-border-radius);\n padding: var(--ic-space-xs) 0 var(--ic-space-md);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: visible;\n}\n\n.small {\n width: 50%;\n max-width: 25rem;\n min-height: 11rem;\n max-height: 70vh;\n}\n\n.medium {\n width: 70vw;\n max-width: 44rem;\n min-height: 12.5rem;\n max-height: 70vh;\n}\n\n.large {\n width: 90vw;\n max-width: 62.5rem;\n min-height: 12.5rem;\n max-height: 90vh;\n}\n\n.heading-area {\n display: flex;\n margin-bottom: var(--ic-space-xs);\n padding: 0 var(--ic-space-md);\n}\n\n.heading {\n overflow-wrap: break-word;\n}\n\n.close-icon {\n margin-left: auto;\n}\n\n.close-icon > svg {\n color: var(--ic-dialog-clear-button);\n}\n\n.content-area {\n padding: 0 var(--ic-space-md);\n margin: 0;\n overflow-y: auto;\n}\n\n#dialog-content {\n margin-bottom: var(--ic-space-sm);\n}\n\n#dialog-content ::slotted(ic-typography) {\n overflow-wrap: break-word;\n}\n\n#dialog-content ::slotted(*) {\n position: relative;\n}\n\n.dialog-controls {\n margin-top: auto;\n padding: var(--ic-space-xs) var(--ic-space-md) 0;\n display: flex;\n justify-content: flex-end;\n gap: var(--ic-space-md);\n}\n\n.dialog-control-button {\n width: fit-content;\n}\n\n.backdrop {\n overflow-y: auto;\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n padding-top: 16px;\n padding-bottom: 16px;\n}\n\n.heading ic-typography {\n --ic-typography-color: var(--ic-dialog-text-primary);\n}\n\n.label ic-typography {\n --ic-typography-color: var(--ic-dialog-label);\n}\n\n@media (min-width: 800px) {\n :host([size=\"large\"]) .dialog:not(.disable-width-constraint) > .content-area {\n width: 75%;\n }\n}\n\n@media (max-width: 576px) {\n .dialog {\n width: 100vw;\n height: 100vh;\n transform: translateY(-5rem);\n max-width: none;\n max-height: none;\n box-sizing: border-box;\n }\n\n .backdrop {\n padding: 0;\n }\n\n .dialog.disable-height-constraint {\n height: auto;\n min-height: 100vh;\n }\n}\n\n@media (max-width: 364px) {\n .dialog-control-button {\n width: unset;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n Method,\n Listen,\n Watch,\n h,\n Fragment,\n} from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport {\n isSlotUsed,\n checkResizeObserver,\n onComponentRequiredPropUndefined,\n getSlotElements,\n} from \"../../utils/helpers\";\nimport { IcFocusableComponents, IcThemeMode } from \"../../utils/types\";\n\n/**\n * @slot dialog-controls - Content will be place at the bottom of the dialog.\n * @slot heading - Content will be placed at the top of the dialog.\n * @slot label - Content will be placed above the dialog heading.\n * @slot alert - Content will be placed at the top of the content area of the dialog.\n */\n@Component({\n tag: \"ic-dialog\",\n styleUrl: \"ic-dialog.css\",\n shadow: true,\n})\nexport class Dialog {\n private backdropEl?: HTMLDivElement;\n private contentArea: HTMLSlotElement | null;\n private contentAreaMutationObserver: MutationObserver | null = null;\n private DATA_GETS_FOCUS: string = \"data-gets-focus\";\n private DIALOG_CONTROLS: string = \"dialog-controls\";\n private dialogEl?: HTMLDialogElement;\n private dialogHeight: number = 0;\n private focusedElementIndex = 0;\n private IC_TEXT_FIELD: string = \"IC-TEXT-FIELD\";\n private IC_ACCORDION: string = \"IC-ACCORDION\";\n private IC_ACCORDION_GROUP: string = \"IC-ACCORDION-GROUP\";\n private IC_CHECKBOX = \"IC-CHECKBOX\";\n private IC_SEARCH_BAR: string = \"IC-SEARCH-BAR\";\n private interactiveElementList: HTMLElement[];\n private resizeObserver: ResizeObserver | null = null;\n private resizeTimeout: number;\n private sourceElement: HTMLElement;\n\n @Element() el: HTMLIcDialogElement;\n\n @State() dialogRendered: boolean = false;\n @State() fadeIn: boolean = false;\n\n /**\n * If set to `false`, the dialog will not close when the backdrop is clicked.\n */\n @Prop() closeOnBackdropClick?: boolean = true;\n\n /**\n * If 'true', sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button.\n */\n @Prop() destructive?: boolean = false;\n\n /**\n * Sets the dismiss label tooltip and aria label.\n */\n @Prop() dismissLabel?: string = \"Dismiss\";\n\n /**\n * If set to `true`, the content area max height and overflow properties are removed allowing the dialog to stretch below the fold.\n * This prop also prevents popover elements from being cut off within the content area.\n */\n @Prop() disableHeightConstraint?: boolean = false;\n\n /**\n * If set to `true`, the content area width property is removed, allowing content to take the full width of the dialog when using the large variant.\n */\n @Prop() disableWidthConstraint?: boolean = false;\n\n /**\n * If `true`, the close button will not be displayed.\n */\n @Prop() hideCloseButton?: boolean = false;\n\n /**\n * If set to `true`, default button controls will not be shown, but slotted dialog controls will still be displayed.\n */\n @Prop() hideDefaultControls: boolean = false;\n\n /**\n * Sets the heading for the dialog.\n */\n @Prop() heading?: string;\n\n /**\n * Sets the optional label for the dialog which appears above the heading.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the dialog will be displayed.\n */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n @Watch(\"open\")\n watchOpenHandler(): void {\n if (this.open) {\n this.dialogOpened();\n } else {\n this.fadeIn = false;\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n setTimeout(() => {\n this.dialogRendered = false;\n this.dialogEl?.close();\n this.sourceElement?.focus();\n this.dialogHeight = 0;\n this.icDialogClosed.emit();\n }, 80);\n }\n }\n\n /**\n * Sets the maximum and minimum height and width for the dialog.\n */\n @Prop() size?: \"small\" | \"medium\" | \"large\" = \"small\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * Cancelation event emitted when default 'Cancel' button clicked or 'cancelDialog' method is called.\n */\n @Event() icDialogCancelled: EventEmitter<void>;\n\n /**\n * Emitted when dialog has closed.\n */\n @Event() icDialogClosed: EventEmitter<void>;\n\n /**\n * Confirmation event emitted when default 'Confirm' primary button clicked or 'confirmDialog' method is called.\n */\n @Event() icDialogConfirmed: EventEmitter<void>;\n\n /**\n * Emitted when dialog has opened.\n */\n @Event() icDialogOpened: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.removeSlotChangeListener();\n }\n\n componentDidLoad(): void {\n this.getInteractiveElements();\n\n this.refreshInteractiveElementsOnSlotChange();\n\n if (this.open) {\n this.dialogOpened();\n }\n\n !isSlotUsed(this.el, \"heading\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Dialog\"\n );\n }\n\n componentDidRender(): void {\n document.body.style.overflow =\n getComputedStyle(this.el).display !== \"none\" &&\n this.disableHeightConstraint\n ? \"hidden\"\n : \"auto\";\n }\n\n @Listen(\"keydown\", { target: \"document\" })\n handleKeyboard(ev: KeyboardEvent): void {\n if (this.dialogRendered) {\n switch (ev.key) {\n case \"Tab\":\n if (this.onTabKeyPress(ev.shiftKey)) {\n ev.preventDefault();\n }\n break;\n case \"Escape\":\n if (!ev.repeat) {\n this.open = false;\n }\n ev.stopImmediatePropagation();\n break;\n }\n }\n }\n\n @Listen(\"click\", {})\n handleClick(ev: MouseEvent): void {\n if (\n this.dialogEl &&\n this.closeOnBackdropClick &&\n ev.composedPath().indexOf(this.dialogEl) <= 0\n ) {\n const { top, height, left, width } =\n this.dialogEl.getBoundingClientRect();\n const isInDialog =\n top <= ev.clientY &&\n ev.clientY <= top + height &&\n left <= ev.clientX &&\n ev.clientX <= left + width;\n if (!isInDialog) {\n this.open = false;\n }\n }\n }\n\n /**\n * Cancels the dialog. Used by the default 'Cancel' button or can be called manually to trigger cancelling of dialog.\n */\n @Method()\n async cancelDialog(): Promise<void> {\n this.icDialogCancelled.emit();\n this.open = false;\n }\n\n /**\n * Confirms the dialog. Used by the default 'Confirm' button or can be called manually to trigger confirming of dialog.\n */\n @Method()\n async confirmDialog(): Promise<void> {\n this.icDialogConfirmed.emit();\n }\n\n private dialogOpened = () => {\n this.dialogRendered = true;\n\n if (this.disableHeightConstraint) {\n this.dialogEl?.show();\n } else {\n this.dialogEl?.showModal();\n }\n\n setTimeout(() => {\n this.fadeIn = true;\n\n /**\n * This is required to set scroll back to top if:\n * - dialog content goes below the fold\n * - is closed using cancel or confirm and reopened.\n *\n * Without this, the scroll bar will start from the dialog's last scroll-x coordinate.\n */\n if (\n this.backdropEl &&\n this.disableHeightConstraint &&\n this.backdropEl.scrollTop !== 0\n ) {\n this.backdropEl.scrollTop = 0;\n }\n }, 10);\n\n setTimeout(() => {\n this.setInitialFocus();\n checkResizeObserver(this.runResizeObserver);\n }, 75);\n\n setTimeout(() => {\n this.icDialogOpened.emit();\n }, 80);\n };\n\n private runResizeObserver = () => {\n if (this.dialogEl) {\n this.resizeObserver = new ResizeObserver(() => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = window.setTimeout(this.resizeObserverCallback, 80);\n });\n this.resizeObserver.observe(this.dialogEl);\n }\n };\n\n private resizeObserverCallback = () => {\n if (this.dialogEl && this.dialogEl.clientHeight !== this.dialogHeight) {\n this.dialogHeight = this.dialogEl.clientHeight;\n }\n };\n\n private refreshInteractiveElementsOnSlotChange = () => {\n const contentWrapper = this.el.shadowRoot?.querySelector(\"#dialog-content\");\n\n if (contentWrapper) {\n this.contentArea = contentWrapper.querySelector(\"slot\");\n\n // Detect changes to slotted elements\n this.contentArea?.addEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver = new MutationObserver(() => {\n this.getInteractiveElements();\n });\n\n // Detect changes to children of slotted elements\n getSlotElements(contentWrapper)?.forEach((el) => {\n this.contentAreaMutationObserver?.observe(el, {\n childList: true,\n subtree: true,\n });\n });\n }\n };\n\n private removeSlotChangeListener = () => {\n if (this.contentArea) {\n this.contentArea.removeEventListener(\n \"slotchange\",\n this.getInteractiveElements\n );\n\n this.contentAreaMutationObserver?.disconnect();\n }\n };\n\n private setInitialFocus = () => {\n this.sourceElement = document.activeElement as HTMLElement;\n this.focusedElementIndex = this.interactiveElementList\n ? this.interactiveElementList.findIndex((element) =>\n element.hasAttribute(this.DATA_GETS_FOCUS)\n )\n : 0;\n this.focusElement(this.interactiveElementList[this.focusedElementIndex]);\n };\n\n private getFocusedElementIndex = () => {\n for (let i = 0; i < this.interactiveElementList.length; i++) {\n if (\n (this.interactiveElementList[i] as HTMLElement) ===\n (this.el.shadowRoot?.activeElement || document.activeElement)\n ) {\n this.focusedElementIndex = i;\n }\n }\n };\n\n private closeIconClick = () => {\n this.open = false;\n };\n\n private getInteractiveElements = () => {\n this.interactiveElementList = Array.from(\n this.el.shadowRoot?.querySelectorAll(\"ic-button\") || []\n );\n const slottedInteractiveElements = Array.from(\n this.el.querySelectorAll(\n `a[href], button, input:not(.ic-input), textarea, select, details, [tabindex]:not([tabindex=\"-1\"]),\n ic-button, ic-checkbox, ic-select, ic-search-bar, ic-tab-group, \n ic-back-to-top, ic-breadcrumb, ic-chip[dismissible=\"true\"], ic-footer-link, ic-link, ic-navigation-button,\n ic-navigation-item, ic-switch, ic-text-field, ic-accordion-group, ic-accordion, ic-date-input, ic-date-picker`\n )\n );\n if (slottedInteractiveElements.length > 0) {\n if (slottedInteractiveElements[0].slot !== this.DIALOG_CONTROLS) {\n slottedInteractiveElements[0].setAttribute(this.DATA_GETS_FOCUS, \"\");\n } else if (!this.destructive) {\n slottedInteractiveElements[\n slottedInteractiveElements.length - 1\n ].setAttribute(this.DATA_GETS_FOCUS, \"\");\n }\n }\n for (let i = 0; i < slottedInteractiveElements.length; i++) {\n this.interactiveElementList.splice(\n 1 + i,\n 0,\n slottedInteractiveElements[i] as HTMLElement\n );\n }\n };\n\n private getNextFocusEl = (focusedElementIndex: number) =>\n this.interactiveElementList[focusedElementIndex];\n\n private onTabKeyPress = (shiftKey: boolean): boolean => {\n this.getFocusedElementIndex();\n\n if (\n this.interactiveElementList[this.focusedElementIndex].tagName ===\n this.IC_SEARCH_BAR\n ) {\n return false;\n }\n\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n this.focusElement(this.getNextFocusEl(this.focusedElementIndex), shiftKey);\n return true;\n };\n\n private shouldSkipElement = (element: HTMLElement): boolean => {\n const isHidden =\n getComputedStyle(element).visibility === \"hidden\" ||\n element.offsetHeight === 0 ||\n element.hasAttribute(\"disabled\") ||\n (element.tagName === this.IC_ACCORDION_GROUP &&\n element.hasAttribute(\"single-expansion\"));\n\n const radioEl = element.closest(\"ic-radio-option\");\n\n return (\n isHidden ||\n (element.getAttribute(\"type\") === \"radio\" &&\n !!radioEl &&\n !radioEl.hasAttribute(\"selected\"))\n );\n };\n\n private focusElement = (element: HTMLElement, shiftKey = false) => {\n let nextFocusEl = element;\n\n if (this.shouldSkipElement(element)) {\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n\n nextFocusEl = this.getNextFocusEl(this.focusedElementIndex);\n this.focusElement(nextFocusEl, shiftKey);\n } else {\n switch (element.tagName) {\n case this.IC_ACCORDION_GROUP:\n case this.IC_ACCORDION:\n case this.IC_SEARCH_BAR:\n case this.IC_TEXT_FIELD:\n case this.IC_CHECKBOX:\n (element as IcFocusableComponents).setFocus();\n break;\n default:\n (element as HTMLElement).focus();\n }\n }\n };\n\n private loopNextFocusIndexIfLastElement() {\n if (this.focusedElementIndex > this.interactiveElementList.length - 1)\n this.focusedElementIndex = 0;\n else if (this.focusedElementIndex < 0) {\n this.focusedElementIndex = this.interactiveElementList.length - 1;\n }\n }\n\n private setFocusIndexBasedOnShiftKey(shiftKey: boolean) {\n if (shiftKey) {\n this.focusedElementIndex -= 1;\n } else {\n this.focusedElementIndex += 1;\n }\n }\n\n private renderDialog = () => {\n const {\n hideDefaultControls,\n size,\n heading,\n label,\n destructive,\n dismissLabel,\n hideCloseButton,\n disableHeightConstraint,\n disableWidthConstraint,\n closeIconClick,\n DIALOG_CONTROLS,\n } = this;\n\n const controlsSlotUsed = isSlotUsed(this.el, DIALOG_CONTROLS);\n\n return (\n <dialog\n class={{\n dialog: true,\n [`${size}`]: true,\n \"disable-height-constraint\": !!disableHeightConstraint,\n \"disable-width-constraint\": !!disableWidthConstraint,\n }}\n aria-labelledby=\"dialog-label dialog-heading\"\n aria-describedby=\"dialog-alert dialog-content\"\n ref={(el) => (this.dialogEl = el)}\n >\n <div class=\"heading-area\">\n <div class=\"heading-content\">\n <div class=\"label\">\n <slot name=\"label\">\n <ic-typography variant=\"label\" id=\"dialog-label\">\n {label}\n </ic-typography>\n </slot>\n </div>\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\" id=\"dialog-heading\">\n {heading}\n </ic-typography>\n </slot>\n </div>\n </div>\n {!hideCloseButton && (\n <ic-button\n class=\"close-icon\"\n variant=\"icon\"\n innerHTML={closeIcon}\n aria-label={dismissLabel}\n onClick={closeIconClick}\n data-gets-focus={\n destructive || (hideDefaultControls && !controlsSlotUsed)\n ? \"\"\n : null\n }\n ></ic-button>\n )}\n </div>\n <div class=\"content-area\">\n {isSlotUsed(this.el, \"alert\") && <slot name=\"alert\" />}\n <div id=\"dialog-content\">\n <slot />\n </div>\n </div>\n {(controlsSlotUsed || !hideDefaultControls) && (\n <div\n class={{\n [DIALOG_CONTROLS]: true,\n }}\n >\n {controlsSlotUsed ? (\n <slot name={DIALOG_CONTROLS} />\n ) : (\n <Fragment>\n <ic-button\n variant=\"tertiary\"\n onClick={() => this.cancelDialog()}\n class=\"dialog-control-button\"\n data-gets-focus={null}\n >\n Cancel\n </ic-button>\n <ic-button\n variant={destructive ? \"destructive\" : \"primary\"}\n onClick={() => this.confirmDialog()}\n class=\"dialog-control-button\"\n data-gets-focus=\"\"\n >\n Confirm\n </ic-button>\n </Fragment>\n )}\n </div>\n )}\n </dialog>\n );\n };\n\n render() {\n const { dialogRendered, disableHeightConstraint, fadeIn, theme } = this;\n\n return (\n <Host\n class={{\n \"ic-dialog-hidden\": !dialogRendered,\n \"ic-dialog-fade-in\": fadeIn,\n \"disable-height-constraint\": !!disableHeightConstraint,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n {disableHeightConstraint ? (\n <div class=\"backdrop\" ref={(el) => (this.backdropEl = el)}>\n {this.renderDialog()}\n </div>\n ) : (\n this.renderDialog()\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
2
2
|
import { r as removeDisabledFalse, f as renderDynamicChildSlots, C as slotHasContent, y as IcInformationStatus, B as successIcon } from './helpers.js';
|
3
3
|
|
4
|
-
const icInputComponentContainerCss = "ic-input-component-container{display:flex;border:var(--ic-border-width) solid\n var(--border-color, var(--ic-architectural-400));border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-slow);height:2.5rem;min-height:2.5rem;width:var(--input-width, 20rem);padding:var(--ic-space-1px);background-color:var(--input-bg-color, var(--ic-color-background-primary));box-sizing:border-box;fill:var(--ic-architectural-400);outline:none}ic-input-component-container.ic-input-component-container-full-width{width:100%}ic-input-component-container.ic-input-component-container-disabled,ic-input-component-container.ic-input-component-container-disabled:hover{border:var(--ic-border-width) dashed\n var(--border-color-disabled, var(--ic-color-border-neutral-disabled))}ic-input-component-container.ic-input-component-container-readonly,ic-input-component-container.ic-input-component-container-small.ic-input-component-container-readonly,ic-input-component-container.ic-input-component-container-large.ic-input-component-container-readonly{height:auto}ic-input-component-container.ic-input-component-container-readonly,ic-input-component-container.ic-input-component-container-readonly:hover{border:none;padding:0}ic-input-component-container.ic-input-component-container-error{border:var(--ic-space-xxxs) solid\n var(--border-color-error, var(--ic-color-border-error));padding:0}ic-input-component-container.ic-input-component-container-error:hover{border:var(--ic-space-xxxs) solid\n var(--border-color-error-hover, var(--ic-color-border-error-hover))}ic-input-component-container.ic-input-component-container-error:focus-within{border:var(--ic-space-xxxs) solid\n var(--border-color-error-pressed, var(--ic-color-border-error-pressed))}ic-input-component-container.ic-input-component-container-warning{border:var(--ic-space-xxxs) solid\n var(--border-color-warning, var(--ic-color-border-warning));padding:0}ic-input-component-container.ic-input-component-container-warning:hover{border:var(--ic-space-xxxs) solid\n var(--border-color-warning-hover, var(--ic-color-border-warning-hover))}ic-input-component-container.ic-input-component-container-warning:focus-within{border:var(--ic-space-xxxs) solid\n var(--border-color-warning-pressed, var(--ic-color-border-warning-pressed))}ic-input-component-container.ic-input-component-container-success{border:var(--ic-space-xxxs) solid\n var(--border-color-success, var(--ic-color-border-success));padding:0}ic-input-component-container.ic-input-component-container-success:hover{border:var(--ic-space-xxxs) solid\n var(--border-color-success-hover, var(--ic-color-border-success-hover))}ic-input-component-container.ic-input-component-container-success:focus-within{border:var(--ic-space-xxxs) solid\n var(--border-color-success-pressed, var(--ic-color-border-success-pressed))}ic-input-component-container.ic-input-component-container-small{height:var(--ic-space-xl);min-height:var(--ic-space-xl)}ic-input-component-container.ic-input-component-container-large{height:var(--ic-space-xxl);min-height:var(--ic-space-xxl)}ic-input-component-container.ic-input-component-container-multiline{height:auto}ic-input-component-container .icon-container{margin-top:var(--ic-space-xxs);margin-left:0.438rem;display:flex;align-items:center}ic-input-component-container.ic-input-component-container-multiline .icon-container,ic-input-component-container.ic-input-component-container-multiline.ic-input-component-container-small .icon-container{margin-top:0.375rem;display:block}ic-input-component-container.ic-input-component-container-readonly .icon-container{margin-left:-0.313rem}ic-input-component-container.ic-input-component-container-disabled ::-moz-placeholder{display:none}ic-input-component-container.ic-input-component-container-disabled ::placeholder{display:none}ic-input-component-container .inline-success{margin:var(--ic-space-xs) 0.375rem;display:flex;align-items:center}ic-input-component-container .inline-success>svg{fill:var(--ic-input-component-container-success-icon-inline-color);height:1.25rem;width:1.25rem}ic-input-component-container:hover{border:var(--ic-input-component-container-hover-border);border-color:var(--border-color-hover, var(--ic-color-border-neutral-hover));color:var(--ic-action-
|
4
|
+
const icInputComponentContainerCss = "ic-input-component-container{display:flex;border:var(--ic-border-width) solid\n var(--border-color, var(--ic-architectural-400));border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-slow);height:2.5rem;min-height:2.5rem;width:var(--input-width, 20rem);padding:var(--ic-space-1px);background-color:var(--input-bg-color, var(--ic-color-background-primary));box-sizing:border-box;fill:var(--ic-architectural-400);outline:none}ic-input-component-container.ic-input-component-container-full-width{width:100%}ic-input-component-container.ic-input-component-container-disabled,ic-input-component-container.ic-input-component-container-disabled:hover{border:var(--ic-border-width) dashed\n var(--border-color-disabled, var(--ic-color-border-neutral-disabled))}ic-input-component-container.ic-input-component-container-readonly,ic-input-component-container.ic-input-component-container-small.ic-input-component-container-readonly,ic-input-component-container.ic-input-component-container-large.ic-input-component-container-readonly{height:auto;background:transparent}ic-input-component-container.ic-input-component-container-readonly,ic-input-component-container.ic-input-component-container-readonly:hover{border:none;padding:0}ic-input-component-container.ic-input-component-container-error{border:var(--ic-space-xxxs) solid\n var(--border-color-error, var(--ic-color-border-error));padding:0}ic-input-component-container.ic-input-component-container-error:hover{border:var(--ic-space-xxxs) solid\n var(--border-color-error-hover, var(--ic-color-border-error-hover))}ic-input-component-container.ic-input-component-container-error:focus-within{border:var(--ic-space-xxxs) solid\n var(--border-color-error-pressed, var(--ic-color-border-error-pressed))}ic-input-component-container.ic-input-component-container-warning{border:var(--ic-space-xxxs) solid\n var(--border-color-warning, var(--ic-color-border-warning));padding:0}ic-input-component-container.ic-input-component-container-warning:hover{border:var(--ic-space-xxxs) solid\n var(--border-color-warning-hover, var(--ic-color-border-warning-hover))}ic-input-component-container.ic-input-component-container-warning:focus-within{border:var(--ic-space-xxxs) solid\n var(--border-color-warning-pressed, var(--ic-color-border-warning-pressed))}ic-input-component-container.ic-input-component-container-success{border:var(--ic-space-xxxs) solid\n var(--border-color-success, var(--ic-color-border-success));padding:0}ic-input-component-container.ic-input-component-container-success:hover{border:var(--ic-space-xxxs) solid\n var(--border-color-success-hover, var(--ic-color-border-success-hover))}ic-input-component-container.ic-input-component-container-success:focus-within{border:var(--ic-space-xxxs) solid\n var(--border-color-success-pressed, var(--ic-color-border-success-pressed))}ic-input-component-container.ic-input-component-container-small{height:var(--ic-space-xl);min-height:var(--ic-space-xl)}ic-input-component-container.ic-input-component-container-large{height:var(--ic-space-xxl);min-height:var(--ic-space-xxl)}ic-input-component-container.ic-input-component-container-multiline{height:auto}ic-input-component-container .icon-container{margin-top:var(--ic-space-xxs);margin-left:0.438rem;display:flex;align-items:center}ic-input-component-container.ic-input-component-container-multiline .icon-container,ic-input-component-container.ic-input-component-container-multiline.ic-input-component-container-small .icon-container{margin-top:0.375rem;display:block}ic-input-component-container.ic-input-component-container-readonly .icon-container{margin-left:-0.313rem}ic-input-component-container.ic-input-component-container-disabled ::-moz-placeholder{display:none}ic-input-component-container.ic-input-component-container-disabled ::placeholder{display:none}ic-input-component-container .inline-success{margin:var(--ic-space-xs) 0.375rem;display:flex;align-items:center}ic-input-component-container .inline-success>svg{fill:var(--ic-input-component-container-success-icon-inline-color);height:1.25rem;width:1.25rem}ic-input-component-container:hover{border:var(--ic-input-component-container-hover-border);border-color:var(--border-color-hover, var(--ic-color-border-neutral-hover));color:var(--ic-action-monochrome-hover-dark)}ic-input-component-container:focus{border:var(--ic-border-pressed);border-color:var(\n --border-color-pressed,\n var(--ic-color-border-neutral-pressed)\n )}.focus-indicator{display:flex;width:100%;margin:-0.125rem;padding:0.125rem;border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast)}.focus-indicator:focus-within,.focus-indicator-enabled{box-shadow:var(--ic-border-focus)}.focus-indicator.ic-input-component-container-dark:focus-within{box-shadow:var(--ic-border-focus)}@media (forced-colors: active){ic-input-component-container,.focus-indicator{transition:none}ic-input-component-container:focus-within{border:var(--ic-border-width) solid Highlight;outline:0.125rem solid Highlight}ic-input-component-container.ic-input-component-container-disabled,ic-input-component-container.ic-input-component-container-disabled:hover{border:var(--ic-border-width) dashed GrayText}}";
|
5
5
|
const IcInputComponentContainerStyle0 = icInputComponentContainerCss;
|
6
6
|
|
7
7
|
const InputComponentContainer = /*@__PURE__*/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CAAuC,EAAE,CAAC,CAAC,QAAQ;gBACnD,uCAAuC,EAAE,CAAC,CAAC,QAAQ;gBACnD,wCAAwC,EAAE,CAAC,CAAC,SAAS;gBACrD,yCAAyC,EAAE,CAAC,CAAC,SAAS;aACvD,mBACc,QAAQ,GAAG,MAAM,GAAG,IAAI,IAEvC,4DAAK,KAAK,EAAC,iBAAiB,IACzB,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,KACnC,4DAAK,KAAK,EAAC,gBAAgB,IACzB,6DAAM,IAAI,EAAC,WAAW,GAAG,CACrB,CACP,EACD,8DAAa,EAEZ,gBAAgB;YACf,gBAAgB,KAAK,mBAAmB,CAAC,OAAO,KAC9C,6DAAM,KAAK,EAAC,gBAAgB,EAAC,SAAS,EAAE,WAAW,GAAI,CACxD,CACC,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-input-component-container/ic-input-component-container.css?tag=ic-input-component-container","src/components/ic-input-component-container/ic-input-component-container.tsx"],"sourcesContent":["ic-input-component-container {\n /**\n * @prop --border-color: Border colour of the input component container\n * @prop --border-color-hover: Border colour of the input component container on hover\n * @prop --border-color-pressed: Border colour of the input component container when pressed\n * @prop --border-color-disabled: Border colour of the input component container when disabled\n * @prop --border-color-error: Border colour of the error variant for input component container\n * @prop --border-color-error-hover: Border colour of the error hover variant for input component container\n * @prop --border-color-error-pressed: Border colour of the error pressed variant for input component container\n * @prop --border-color-warning: Border colour of the warning variant for input component container\n * @prop --border-color-warning-hover: Border colour of the warning hover variant for input component container\n * @prop --border-color-warning-pressed: Border colour of the warning pressed variant for input component container\n * @prop --border-color-success: Border colour of the success variant for input component container\n * @prop --border-color-success-hover: Border colour of the success hover variant for input component container\n * @prop --border-color-success-pressed: Border colour of the success pressed variant for input component container\n */\n\n display: flex;\n border: var(--ic-border-width) solid\n var(--border-color, var(--ic-architectural-400));\n border-radius: var(--ic-border-radius);\n transition: var(--ic-easing-transition-slow);\n height: 2.5rem;\n min-height: 2.5rem;\n width: var(--input-width, 20rem);\n padding: var(--ic-space-1px);\n background-color: var(--input-bg-color, var(--ic-color-background-primary));\n box-sizing: border-box;\n fill: var(--ic-architectural-400);\n outline: none;\n}\n\nic-input-component-container.ic-input-component-container-full-width {\n width: 100%;\n}\n\nic-input-component-container.ic-input-component-container-disabled,\nic-input-component-container.ic-input-component-container-disabled:hover {\n border: var(--ic-border-width) dashed\n var(--border-color-disabled, var(--ic-color-border-neutral-disabled));\n}\n\nic-input-component-container.ic-input-component-container-readonly,\nic-input-component-container.ic-input-component-container-small.ic-input-component-container-readonly,\nic-input-component-container.ic-input-component-container-large.ic-input-component-container-readonly {\n height: auto;\n}\n\nic-input-component-container.ic-input-component-container-readonly,\nic-input-component-container.ic-input-component-container-readonly:hover {\n border: none;\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-error {\n border: var(--ic-space-xxxs) solid\n var(--border-color-error, var(--ic-color-border-error));\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-error:hover {\n border: var(--ic-space-xxxs) solid\n var(--border-color-error-hover, var(--ic-color-border-error-hover));\n}\n\nic-input-component-container.ic-input-component-container-error:focus-within {\n border: var(--ic-space-xxxs) solid\n var(--border-color-error-pressed, var(--ic-color-border-error-pressed));\n}\n\nic-input-component-container.ic-input-component-container-warning {\n border: var(--ic-space-xxxs) solid\n var(--border-color-warning, var(--ic-color-border-warning));\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-warning:hover {\n border: var(--ic-space-xxxs) solid\n var(--border-color-warning-hover, var(--ic-color-border-warning-hover));\n}\n\nic-input-component-container.ic-input-component-container-warning:focus-within {\n border: var(--ic-space-xxxs) solid\n var(--border-color-warning-pressed, var(--ic-color-border-warning-pressed));\n}\n\nic-input-component-container.ic-input-component-container-success {\n border: var(--ic-space-xxxs) solid\n var(--border-color-success, var(--ic-color-border-success));\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-success:hover {\n border: var(--ic-space-xxxs) solid\n var(--border-color-success-hover, var(--ic-color-border-success-hover));\n}\n\nic-input-component-container.ic-input-component-container-success:focus-within {\n border: var(--ic-space-xxxs) solid\n var(--border-color-success-pressed, var(--ic-color-border-success-pressed));\n}\n\nic-input-component-container.ic-input-component-container-small {\n height: var(--ic-space-xl);\n min-height: var(--ic-space-xl);\n}\n\nic-input-component-container.ic-input-component-container-large {\n height: var(--ic-space-xxl);\n min-height: var(--ic-space-xxl);\n}\n\nic-input-component-container.ic-input-component-container-multiline {\n height: auto;\n}\n\nic-input-component-container .icon-container {\n margin-top: var(--ic-space-xxs);\n margin-left: 0.438rem;\n display: flex;\n align-items: center;\n}\n\nic-input-component-container.ic-input-component-container-multiline\n .icon-container,\nic-input-component-container.ic-input-component-container-multiline.ic-input-component-container-small\n .icon-container {\n margin-top: 0.375rem;\n display: block;\n}\n\nic-input-component-container.ic-input-component-container-readonly\n .icon-container {\n margin-left: -0.313rem;\n}\n\nic-input-component-container.ic-input-component-container-disabled\n ::placeholder {\n display: none;\n}\n\nic-input-component-container .inline-success {\n margin: var(--ic-space-xs) 0.375rem;\n display: flex;\n align-items: center;\n}\n\nic-input-component-container .inline-success > svg {\n fill: var(--ic-input-component-container-success-icon-inline-color);\n height: 1.25rem;\n width: 1.25rem;\n}\n\nic-input-component-container:hover {\n border: var(--ic-input-component-container-hover-border);\n border-color: var(--border-color-hover, var(--ic-color-border-neutral-hover));\n color: var(--ic-action-dark-hover);\n}\n\nic-input-component-container:focus {\n border: var(--ic-border-pressed);\n border-color: var(\n --border-color-pressed,\n var(--ic-color-border-neutral-pressed)\n );\n}\n\n.focus-indicator {\n display: flex;\n width: 100%;\n margin: -0.125rem;\n padding: 0.125rem;\n border-radius: var(--ic-border-radius);\n transition: var(--ic-easing-transition-fast);\n}\n\n.focus-indicator:focus-within,\n.focus-indicator-enabled {\n box-shadow: var(--ic-border-focus);\n}\n\n.focus-indicator.ic-input-component-container-dark:focus-within {\n box-shadow: var(--ic-border-focus);\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n ic-input-component-container,\n .focus-indicator {\n transition: none;\n }\n\n ic-input-component-container:focus-within {\n border: var(--ic-border-width) solid Highlight;\n outline: 0.125rem solid Highlight;\n }\n\n ic-input-component-container.ic-input-component-container-disabled,\n ic-input-component-container.ic-input-component-container-disabled:hover {\n border: var(--ic-border-width) dashed GrayText;\n }\n}\n","import { Component, Element, Host, Prop, Watch, h } from \"@stencil/core\";\n\nimport {\n IcInformationStatus,\n IcInformationStatusOrEmpty,\n IcSizes,\n} from \"../../utils/types\";\nimport successIcon from \"../../assets/success-icon.svg\";\nimport {\n removeDisabledFalse,\n renderDynamicChildSlots,\n slotHasContent,\n} from \"../../utils/helpers\";\n\n/**\n * @slot left-icon - Content will be placed to the left of the input.\n */\n@Component({\n tag: \"ic-input-component-container\",\n styleUrl: \"ic-input-component-container.css\",\n})\nexport class InputComponentContainer {\n private hostMutationObserver: MutationObserver;\n @Element() el: HTMLIcInputComponentContainerElement;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the input component container will fill the width of the container it is in.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * If `true`, the input component container will allow for multiple lines.\n */\n @Prop() multiLine?: boolean = false;\n\n /**\n * If `true`, the readonly state will be set.\n */\n @Prop() readonly?: boolean = false;\n\n /**\n * The size of the input component container component.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * If `true`, the validation will display inline.\n */\n @Prop() validationInline?: boolean = false;\n\n /**\n * The validation status of the input component container - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus?: IcInformationStatusOrEmpty = \"\";\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n this.hostMutationObserver = new MutationObserver((mutationList) =>\n renderDynamicChildSlots(mutationList, \"left-icon\", this)\n );\n this.hostMutationObserver.observe(this.el, { childList: true });\n }\n\n render() {\n const {\n size,\n validationStatus,\n disabled,\n readonly,\n multiLine,\n fullWidth,\n validationInline,\n } = this;\n\n return (\n <Host\n class={{\n [`ic-input-component-container-${size}`]: true,\n [`ic-input-component-container-${validationStatus}`]:\n validationStatus !== \"\" && !disabled && !readonly,\n \"ic-input-component-container-disabled\": !!disabled,\n \"ic-input-component-container-readonly\": !!readonly,\n \"ic-input-component-container-multiline\": !!multiLine,\n \"ic-input-component-container-full-width\": !!fullWidth,\n }}\n aria-disabled={disabled ? \"true\" : null}\n >\n <div class=\"focus-indicator\">\n {slotHasContent(this.el, \"left-icon\") && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n <slot></slot>\n\n {validationInline &&\n validationStatus === IcInformationStatus.Success && (\n <span class=\"inline-success\" innerHTML={successIcon} />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-input-component-container2.js","mappings":";;;AAAA,MAAM,4BAA4B,GAAG,qoKAAqoK,CAAC;AAC3qK,wCAAe,4BAA4B;;MCoB9B,uBAAuB;IAJpC;;;;;;QAWU,aAAQ,GAAa,KAAK,CAAC;;;;QAS3B,cAAS,GAAa,KAAK,CAAC;;;;QAK5B,cAAS,GAAa,KAAK,CAAC;;;;QAK5B,aAAQ,GAAa,KAAK,CAAC;;;;QAK3B,SAAI,GAAa,QAAQ,CAAC;;;;QAK1B,qBAAgB,GAAa,KAAK,CAAC;;;;QAKnC,qBAAgB,GAAgC,EAAE,CAAC;KAqD5D;IArFC,oBAAoB;QAClB,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;KAC7C;IAgCD,iBAAiB;QACf,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;KAC7C;IAED,gBAAgB;QACd,IAAI,CAAC,oBAAoB,GAAG,IAAI,gBAAgB,CAAC,CAAC,YAAY,KAC5D,uBAAuB,CAAC,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,CACzD,CAAC;QACF,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACjE;IAED,MAAM;QACJ,MAAM,EACJ,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,gBAAgB,GACjB,GAAG,IAAI,CAAC;QAET,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,CAAC,gCAAgC,IAAI,EAAE,GAAG,IAAI;gBAC9C,CAAC,gCAAgC,gBAAgB,EAAE,GACjD,gBAAgB,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;gBACnD,uCAAuC,EAAE,CAAC,CAAC,QAAQ;gBACnD,uCAAuC,EAAE,CAAC,CAAC,QAAQ;gBACnD,wCAAwC,EAAE,CAAC,CAAC,SAAS;gBACrD,yCAAyC,EAAE,CAAC,CAAC,SAAS;aACvD,mBACc,QAAQ,GAAG,MAAM,GAAG,IAAI,IAEvC,4DAAK,KAAK,EAAC,iBAAiB,IACzB,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,KACnC,4DAAK,KAAK,EAAC,gBAAgB,IACzB,6DAAM,IAAI,EAAC,WAAW,GAAG,CACrB,CACP,EACD,8DAAa,EAEZ,gBAAgB;YACf,gBAAgB,KAAK,mBAAmB,CAAC,OAAO,KAC9C,6DAAM,KAAK,EAAC,gBAAgB,EAAC,SAAS,EAAE,WAAW,GAAI,CACxD,CACC,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-input-component-container/ic-input-component-container.css?tag=ic-input-component-container","src/components/ic-input-component-container/ic-input-component-container.tsx"],"sourcesContent":["ic-input-component-container {\n /**\n * @prop --border-color: Border colour of the input component container\n * @prop --border-color-hover: Border colour of the input component container on hover\n * @prop --border-color-pressed: Border colour of the input component container when pressed\n * @prop --border-color-disabled: Border colour of the input component container when disabled\n * @prop --border-color-error: Border colour of the error variant for input component container\n * @prop --border-color-error-hover: Border colour of the error hover variant for input component container\n * @prop --border-color-error-pressed: Border colour of the error pressed variant for input component container\n * @prop --border-color-warning: Border colour of the warning variant for input component container\n * @prop --border-color-warning-hover: Border colour of the warning hover variant for input component container\n * @prop --border-color-warning-pressed: Border colour of the warning pressed variant for input component container\n * @prop --border-color-success: Border colour of the success variant for input component container\n * @prop --border-color-success-hover: Border colour of the success hover variant for input component container\n * @prop --border-color-success-pressed: Border colour of the success pressed variant for input component container\n */\n\n display: flex;\n border: var(--ic-border-width) solid\n var(--border-color, var(--ic-architectural-400));\n border-radius: var(--ic-border-radius);\n transition: var(--ic-easing-transition-slow);\n height: 2.5rem;\n min-height: 2.5rem;\n width: var(--input-width, 20rem);\n padding: var(--ic-space-1px);\n background-color: var(--input-bg-color, var(--ic-color-background-primary));\n box-sizing: border-box;\n fill: var(--ic-architectural-400);\n outline: none;\n}\n\nic-input-component-container.ic-input-component-container-full-width {\n width: 100%;\n}\n\nic-input-component-container.ic-input-component-container-disabled,\nic-input-component-container.ic-input-component-container-disabled:hover {\n border: var(--ic-border-width) dashed\n var(--border-color-disabled, var(--ic-color-border-neutral-disabled));\n}\n\nic-input-component-container.ic-input-component-container-readonly,\nic-input-component-container.ic-input-component-container-small.ic-input-component-container-readonly,\nic-input-component-container.ic-input-component-container-large.ic-input-component-container-readonly {\n height: auto;\n background: transparent;\n}\n\nic-input-component-container.ic-input-component-container-readonly,\nic-input-component-container.ic-input-component-container-readonly:hover {\n border: none;\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-error {\n border: var(--ic-space-xxxs) solid\n var(--border-color-error, var(--ic-color-border-error));\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-error:hover {\n border: var(--ic-space-xxxs) solid\n var(--border-color-error-hover, var(--ic-color-border-error-hover));\n}\n\nic-input-component-container.ic-input-component-container-error:focus-within {\n border: var(--ic-space-xxxs) solid\n var(--border-color-error-pressed, var(--ic-color-border-error-pressed));\n}\n\nic-input-component-container.ic-input-component-container-warning {\n border: var(--ic-space-xxxs) solid\n var(--border-color-warning, var(--ic-color-border-warning));\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-warning:hover {\n border: var(--ic-space-xxxs) solid\n var(--border-color-warning-hover, var(--ic-color-border-warning-hover));\n}\n\nic-input-component-container.ic-input-component-container-warning:focus-within {\n border: var(--ic-space-xxxs) solid\n var(--border-color-warning-pressed, var(--ic-color-border-warning-pressed));\n}\n\nic-input-component-container.ic-input-component-container-success {\n border: var(--ic-space-xxxs) solid\n var(--border-color-success, var(--ic-color-border-success));\n padding: 0;\n}\n\nic-input-component-container.ic-input-component-container-success:hover {\n border: var(--ic-space-xxxs) solid\n var(--border-color-success-hover, var(--ic-color-border-success-hover));\n}\n\nic-input-component-container.ic-input-component-container-success:focus-within {\n border: var(--ic-space-xxxs) solid\n var(--border-color-success-pressed, var(--ic-color-border-success-pressed));\n}\n\nic-input-component-container.ic-input-component-container-small {\n height: var(--ic-space-xl);\n min-height: var(--ic-space-xl);\n}\n\nic-input-component-container.ic-input-component-container-large {\n height: var(--ic-space-xxl);\n min-height: var(--ic-space-xxl);\n}\n\nic-input-component-container.ic-input-component-container-multiline {\n height: auto;\n}\n\nic-input-component-container .icon-container {\n margin-top: var(--ic-space-xxs);\n margin-left: 0.438rem;\n display: flex;\n align-items: center;\n}\n\nic-input-component-container.ic-input-component-container-multiline\n .icon-container,\nic-input-component-container.ic-input-component-container-multiline.ic-input-component-container-small\n .icon-container {\n margin-top: 0.375rem;\n display: block;\n}\n\nic-input-component-container.ic-input-component-container-readonly\n .icon-container {\n margin-left: -0.313rem;\n}\n\nic-input-component-container.ic-input-component-container-disabled\n ::placeholder {\n display: none;\n}\n\nic-input-component-container .inline-success {\n margin: var(--ic-space-xs) 0.375rem;\n display: flex;\n align-items: center;\n}\n\nic-input-component-container .inline-success > svg {\n fill: var(--ic-input-component-container-success-icon-inline-color);\n height: 1.25rem;\n width: 1.25rem;\n}\n\nic-input-component-container:hover {\n border: var(--ic-input-component-container-hover-border);\n border-color: var(--border-color-hover, var(--ic-color-border-neutral-hover));\n color: var(--ic-action-monochrome-hover-dark);\n}\n\nic-input-component-container:focus {\n border: var(--ic-border-pressed);\n border-color: var(\n --border-color-pressed,\n var(--ic-color-border-neutral-pressed)\n );\n}\n\n.focus-indicator {\n display: flex;\n width: 100%;\n margin: -0.125rem;\n padding: 0.125rem;\n border-radius: var(--ic-border-radius);\n transition: var(--ic-easing-transition-fast);\n}\n\n.focus-indicator:focus-within,\n.focus-indicator-enabled {\n box-shadow: var(--ic-border-focus);\n}\n\n.focus-indicator.ic-input-component-container-dark:focus-within {\n box-shadow: var(--ic-border-focus);\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n ic-input-component-container,\n .focus-indicator {\n transition: none;\n }\n\n ic-input-component-container:focus-within {\n border: var(--ic-border-width) solid Highlight;\n outline: 0.125rem solid Highlight;\n }\n\n ic-input-component-container.ic-input-component-container-disabled,\n ic-input-component-container.ic-input-component-container-disabled:hover {\n border: var(--ic-border-width) dashed GrayText;\n }\n}\n","import { Component, Element, Host, Prop, Watch, h } from \"@stencil/core\";\n\nimport {\n IcInformationStatus,\n IcInformationStatusOrEmpty,\n IcSizes,\n} from \"../../utils/types\";\nimport successIcon from \"../../assets/success-icon.svg\";\nimport {\n removeDisabledFalse,\n renderDynamicChildSlots,\n slotHasContent,\n} from \"../../utils/helpers\";\n\n/**\n * @slot left-icon - Content will be placed to the left of the input.\n */\n@Component({\n tag: \"ic-input-component-container\",\n styleUrl: \"ic-input-component-container.css\",\n})\nexport class InputComponentContainer {\n private hostMutationObserver: MutationObserver;\n @Element() el: HTMLIcInputComponentContainerElement;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the input component container will fill the width of the container it is in.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * If `true`, the input component container will allow for multiple lines.\n */\n @Prop() multiLine?: boolean = false;\n\n /**\n * If `true`, the readonly state will be set.\n */\n @Prop() readonly?: boolean = false;\n\n /**\n * The size of the input component container component.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * If `true`, the validation will display inline.\n */\n @Prop() validationInline?: boolean = false;\n\n /**\n * The validation status of the input component container - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus?: IcInformationStatusOrEmpty = \"\";\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n this.hostMutationObserver = new MutationObserver((mutationList) =>\n renderDynamicChildSlots(mutationList, \"left-icon\", this)\n );\n this.hostMutationObserver.observe(this.el, { childList: true });\n }\n\n render() {\n const {\n size,\n validationStatus,\n disabled,\n readonly,\n multiLine,\n fullWidth,\n validationInline,\n } = this;\n\n return (\n <Host\n class={{\n [`ic-input-component-container-${size}`]: true,\n [`ic-input-component-container-${validationStatus}`]:\n validationStatus !== \"\" && !disabled && !readonly,\n \"ic-input-component-container-disabled\": !!disabled,\n \"ic-input-component-container-readonly\": !!readonly,\n \"ic-input-component-container-multiline\": !!multiLine,\n \"ic-input-component-container-full-width\": !!fullWidth,\n }}\n aria-disabled={disabled ? \"true\" : null}\n >\n <div class=\"focus-indicator\">\n {slotHasContent(this.el, \"left-icon\") && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n <slot></slot>\n\n {validationInline &&\n validationStatus === IcInformationStatus.Success && (\n <span class=\"inline-success\" innerHTML={successIcon} />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -7,7 +7,7 @@ import { d as defineCustomElement$3 } from './ic-loading-indicator2.js';
|
|
7
7
|
import { d as defineCustomElement$2 } from './ic-tooltip2.js';
|
8
8
|
import { d as defineCustomElement$1 } from './ic-typography2.js';
|
9
9
|
|
10
|
-
const icMenuItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}li{list-style:none;padding:0}:host ::part(button){color:var(--ic-popover-menu-item-check);padding:calc(var(--ic-space-xxxs) / 2);display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:0;min-height:2.5rem;height:auto}.focus-border{display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:var(--ic-border-radius);margin:calc(var(--ic-space-xxxs) / 2);padding:var(--ic-space-xxs);border:var(--ic-space-xxxs) dashed transparent;--icon-height:auto}:host(.ic-menu-item-disabled) ::part(button){color:var(--ic-popover-menu-item-check-disabled) !important;--ic-typography-color:var(--ic-popover-menu-item-check-disabled) !important;pointer-events:none}:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host([variant=\"destructive\"]) ::part(button){color:var(--ic-popover-menu-destructive-item-icon);--ic-typography-color:var(--ic-popover-menu-destructive-item-label)}:host ::part(button):hover{background-color:var(--ic-popover-background-hover)}:host ::part(button):focus-visible,:host ::part(button):focus{color:var(--ic-popover-menu-item-icon-focused);--ic-typography-color:purple;background-color:var(--ic-popover-background-focus);box-shadow:none}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{color:var(--ic-popover-menu-item-icon-disabled) !important;--ic-typography-color:orange !important}:host([variant=\"destructive\"]) ::part(button):focus-visible,:host([variant=\"destructive\"]) ::part(button):focus{background-color:var(--ic-popover-destructive-background-focus)}ic-button:focus-within .menu-item-label,ic-button:focus-within .shortcut,ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-focused)}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:var(--ic-popover-menu-border)}:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-item-label) !important;--ic-typography-color:var(--ic-popover-menu-item-label) !important}:host([variant=\"destructive\"]) ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-destructive-item-label) !important;--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.menu-item-info{display:flex;flex-direction:column;flex:1;align-items:baseline;white-space:pre-line;text-align:left}.menu-labels{display:flex;align-items:baseline;gap:var(--ic-space-xs)}.menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}.shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut);display:flex;flex:min-content}:host([variant=\"destructive\"]) .menu-item-label{text-transform:uppercase;font-weight:600;letter-spacing:0.025em}ic-button:active .menu-item-label{--ic-typography-color:var(--ic-popover-menu-item-label)}ic-button:active .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}ic-button:active .shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut)}:host([variant=\"destructive\"]) ic-button:active .menu-item-label{--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.icon,.check-icon,.submenu-icon,.icon ::slotted(svg),.check-icon svg,.submenu-icon svg{width:var(--ic-space-lg);height:var(--ic-space-lg)}.check-icon.hide{visibility:hidden}@media (forced-colors: active){:host ::part(button){border:canvas}:host ::part(button):focus-visible{outline:var(--ic-space-xxxs) solid transparent}.focus-border{border-color:canvas}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:GrayText}:host(.ic-menu-item-disabled) .menu-item-info,:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:GrayText !important}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{outline-color:GrayText !important}}";
|
10
|
+
const icMenuItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}li{list-style:none;padding:0}:host ::part(button){color:var(--ic-popover-menu-item-check);--ic-typography-color:var(--ic-popover-menu-item-check);padding:calc(var(--ic-space-xxxs) / 2);display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:0;min-height:2.5rem;height:auto}.focus-border{display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:var(--ic-border-radius);margin:calc(var(--ic-space-xxxs) / 2);padding:var(--ic-space-xxs);border:var(--ic-space-xxxs) dashed transparent;--icon-height:auto}:host(.ic-menu-item-disabled) ::part(button){color:var(--ic-popover-menu-item-check-disabled) !important;--ic-typography-color:var(--ic-popover-menu-item-check-disabled) !important;pointer-events:none}:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host([variant=\"destructive\"]) ::part(button){color:var(--ic-popover-menu-destructive-item-icon);--ic-typography-color:var(--ic-popover-menu-destructive-item-label)}:host ::part(button):hover{background-color:var(--ic-popover-background-hover)}:host ::part(button):focus-visible,:host ::part(button):focus{color:var(--ic-popover-menu-item-icon-focused);--ic-typography-color:purple;background-color:var(--ic-popover-background-focus);box-shadow:none}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{color:var(--ic-popover-menu-item-icon-disabled) !important;--ic-typography-color:orange !important}:host([variant=\"destructive\"]) ::part(button):focus-visible,:host([variant=\"destructive\"]) ::part(button):focus{background-color:var(--ic-popover-destructive-background-focus)}ic-button:focus-within .menu-item-label,ic-button:focus-within .shortcut,ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-focused)}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:var(--ic-popover-menu-border)}:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-item-label) !important;--ic-typography-color:var(--ic-popover-menu-item-label) !important}:host([variant=\"destructive\"]) ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-destructive-item-label) !important;--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.menu-item-info{display:flex;flex-direction:column;flex:1;align-items:baseline;white-space:pre-line;text-align:left}.menu-labels{display:flex;align-items:baseline;gap:var(--ic-space-xs)}.menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}.shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut);display:flex;flex:min-content}:host([variant=\"destructive\"]) .menu-item-label{text-transform:uppercase;font-weight:600;letter-spacing:0.025em}ic-button:active .menu-item-label{--ic-typography-color:var(--ic-popover-menu-item-label)}ic-button:active .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}ic-button:active .shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut)}:host([variant=\"destructive\"]) ic-button:active .menu-item-label{--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.icon,.check-icon,.submenu-icon,.icon ::slotted(svg),.check-icon svg,.submenu-icon svg{width:var(--ic-space-lg);height:var(--ic-space-lg)}.check-icon.hide{visibility:hidden}@media (forced-colors: active){:host ::part(button){border:canvas}:host ::part(button):focus-visible{outline:var(--ic-space-xxxs) solid transparent}.focus-border{border-color:canvas}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:GrayText}:host(.ic-menu-item-disabled) .menu-item-info,:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:GrayText !important}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{outline-color:GrayText !important}}";
|
11
11
|
const IcMenuItemStyle0 = icMenuItemCss;
|
12
12
|
|
13
13
|
const MenuItem = /*@__PURE__*/ proxyCustomElement(class MenuItem extends HTMLElement {
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-menu-item2.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,ojOAAojO,CAAC;AAC3kO,yBAAe,aAAa;;MC+Bf,QAAQ;IAPrB;;;;;;;;;;;QAa0C,YAAO,GAAa,KAAK,CAAC;;;;QAU1D,aAAQ,GAAa,KAAK,CAAC;;;;QAiDK,YAAO,GAC7C,SAAS,CAAC;QA8CJ,gBAAW,GAAG,CAAC,CAAQ;YAC7B,IAAI,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE;gBACzC,IAAI,CAAC,0BAA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B,MAAM,EAClB,SAAS,EAAEC,WAAO,GAClB,CACH,CACG,CACI,CACT,CACA,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["Check","Chevron"],"sources":["src/components/ic-menu-item/ic-menu-item.css?tag=ic-menu-item&encapsulation=shadow","src/components/ic-menu-item/ic-menu-item.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\nli {\n list-style: none;\n padding: 0;\n}\n\n:host ::part(button) {\n color: var(--ic-popover-menu-item-check);\n padding: calc(var(--ic-space-xxxs) / 2);\n display: flex;\n align-items: flex-start;\n gap: var(--ic-space-xs);\n border-radius: 0;\n min-height: 2.5rem;\n height: auto;\n}\n\n.focus-border {\n display: flex;\n align-items: flex-start;\n gap: var(--ic-space-xs);\n border-radius: var(--ic-border-radius);\n margin: calc(var(--ic-space-xxxs) / 2);\n padding: var(--ic-space-xxs);\n border: var(--ic-space-xxxs) dashed transparent;\n\n --icon-height: auto;\n}\n\n:host(.ic-menu-item-disabled) ::part(button) {\n color: var(--ic-popover-menu-item-check-disabled) !important;\n\n --ic-typography-color: var(--ic-popover-menu-item-check-disabled) !important;\n\n pointer-events: none;\n}\n\n:host(.ic-menu-item-disabled) .menu-item-label,\n:host(.ic-menu-item-disabled) .shortcut,\n:host(.ic-menu-item-disabled) .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;\n}\n\n:host([variant=\"destructive\"]) ::part(button) {\n color: var(--ic-popover-menu-destructive-item-icon);\n\n --ic-typography-color: var(--ic-popover-menu-destructive-item-label);\n}\n\n:host ::part(button):hover {\n background-color: var(--ic-popover-background-hover);\n}\n\n:host ::part(button):focus-visible,\n:host ::part(button):focus {\n color: var(--ic-popover-menu-item-icon-focused);\n\n --ic-typography-color: purple;\n\n background-color: var(--ic-popover-background-focus);\n box-shadow: none;\n}\n\n:host(.ic-menu-item-disabled) ::part(button):focus-visible,\n:host(.ic-menu-item-disabled) ::part(button):focus {\n color: var(--ic-popover-menu-item-icon-disabled) !important;\n\n --ic-typography-color: orange !important;\n}\n\n:host([variant=\"destructive\"]) ::part(button):focus-visible,\n:host([variant=\"destructive\"]) ::part(button):focus {\n background-color: var(--ic-popover-destructive-background-focus);\n}\n\nic-button:focus-within .menu-item-label,\nic-button:focus-within .shortcut,\nic-button:focus-within .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-focused);\n}\n\n:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border {\n border-color: var(--ic-popover-menu-border);\n}\n\n:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,\n:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,\n:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;\n}\n\n:host ::part(button):active {\n background-color: var(--ic-popover-background-pressed);\n color: var(--ic-popover-menu-item-label) !important;\n\n --ic-typography-color: var(--ic-popover-menu-item-label) !important;\n}\n\n:host([variant=\"destructive\"]) ::part(button):active {\n background-color: var(--ic-popover-background-pressed);\n color: var(--ic-popover-menu-destructive-item-label) !important;\n\n --ic-typography-color: var(\n --ic-popover-menu-destructive-item-label\n ) !important;\n}\n\n.menu-item-info {\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: baseline;\n white-space: pre-line;\n text-align: left;\n}\n\n.menu-labels {\n display: flex;\n align-items: baseline;\n gap: var(--ic-space-xs);\n}\n\n.menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-description);\n}\n\n.shortcut {\n --ic-typography-color: var(--ic-popover-menu-item-shortcut);\n\n display: flex;\n flex: min-content;\n}\n\n:host([variant=\"destructive\"]) .menu-item-label {\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.025em;\n}\n\nic-button:active .menu-item-label {\n --ic-typography-color: var(--ic-popover-menu-item-label);\n}\n\nic-button:active .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-description);\n}\n\nic-button:active .shortcut {\n --ic-typography-color: var(--ic-popover-menu-item-shortcut);\n}\n\n:host([variant=\"destructive\"]) ic-button:active .menu-item-label {\n --ic-typography-color: var(\n --ic-popover-menu-destructive-item-label\n ) !important;\n}\n\n.icon,\n.check-icon,\n.submenu-icon,\n.icon ::slotted(svg),\n.check-icon svg,\n.submenu-icon svg {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.check-icon.hide {\n visibility: hidden;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n :host ::part(button) {\n border: canvas;\n }\n\n :host ::part(button):focus-visible {\n outline: var(--ic-space-xxxs) solid transparent;\n }\n\n .focus-border {\n border-color: canvas;\n }\n\n :host(.ic-menu-item-disabled) ic-button:focus-within .focus-border {\n border-color: GrayText;\n }\n\n :host(.ic-menu-item-disabled) .menu-item-info,\n :host(.ic-menu-item-disabled) .menu-item-label,\n :host(.ic-menu-item-disabled) .shortcut,\n :host(.ic-menu-item-disabled) .menu-item-description,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,\n :host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description {\n --ic-typography-color: GrayText !important;\n }\n\n :host(.ic-menu-item-disabled) ::part(button):focus-visible,\n :host(.ic-menu-item-disabled) ::part(button):focus {\n outline-color: GrayText !important;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Event,\n EventEmitter,\n Listen,\n Watch,\n} from \"@stencil/core\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n isPropDefined,\n} from \"../../utils/helpers\";\nimport { IcMenuItemVariants } from \"./ic-menu-item.types\";\nimport Check from \"../../assets/check-icon.svg\";\nimport Chevron from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot icon - Content will be placed to the left of the menu item label.\n */\n\n@Component({\n tag: \"ic-menu-item\",\n styleUrl: \"ic-menu-item.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class MenuItem {\n @Element() el: HTMLIcMenuItemElement;\n\n /**\n * If `true`, the menu item will be in a checked state. This is only applicable when variant is set to `toggle`.\n */\n @Prop({ mutable: true, reflect: true }) checked?: boolean = false;\n\n /**\n * The description displayed in the menu item, below the label.\n */\n @Prop() description?: string;\n\n /**\n * If `true`, the menu item will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The URL that the link points to. This will render the menu item as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label describing the keyboard shortcut for a menu item's action.\n */\n @Prop() keyboardShortcutLabel?: string;\n\n /**\n * The label to display in the menu item.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * This references the popover menu instance that the menu item is a trigger for. If this prop is set, then the variant will always be default.\n */\n @Prop() submenuTriggerFor?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The variant of the menu item.\n */\n @Prop({ mutable: true, reflect: true }) variant?: IcMenuItemVariants =\n \"default\";\n\n /**\n * @internal Emitted when item loses focus.\n */\n @Event() childBlur: EventEmitter<void>;\n\n /**\n * @internal Emitted when the user clicks a menu item.\n */\n @Event() handleMenuItemClick: EventEmitter<HTMLIcMenuItemElement>;\n\n /**\n * Emitted when the user clicks a menu item that is set to the toggle variant.\n */\n @Event() icToggleChecked: EventEmitter<{\n checked: boolean;\n }>;\n\n /**\n * @internal Emitted when the user clicks a menu item that triggers a popover menu instance.\n */\n @Event() triggerPopoverMenuInstance: EventEmitter<void>;\n\n componentWillLoad(): void {\n // This ensures that trigger menu items are always set to the default variant\n if (isPropDefined(this.submenuTriggerFor) && this.variant !== \"default\") {\n this.variant = \"default\";\n }\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Menu Item\"\n );\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(e: Event): void {\n if (this.disabled) {\n e.stopImmediatePropagation();\n }\n }\n\n private handleClick = (e: Event): void => {\n if (isPropDefined(this.submenuTriggerFor)) {\n this.triggerPopoverMenuInstance.emit();\n } else if (this.variant === \"toggle\") {\n e.preventDefault();\n this.checked = !this.checked;\n this.icToggleChecked.emit({\n checked: this.checked,\n });\n }\n this.handleMenuItemClick.emit(this.el);\n };\n\n private getMenuItemAriaLabel = (): string => {\n let ariaLabel = this.label;\n\n if (isPropDefined(this.description)) {\n ariaLabel = `${ariaLabel}, ${this.description}`;\n }\n\n if (isPropDefined(this.keyboardShortcutLabel)) {\n ariaLabel = `${ariaLabel}, ${this.keyboardShortcutLabel}`;\n }\n\n if (this.variant === \"destructive\") {\n ariaLabel = `${ariaLabel}, destructive`;\n }\n\n if (isPropDefined(this.submenuTriggerFor)) {\n ariaLabel = `${ariaLabel}, triggers submenu`;\n }\n\n if (this.el.classList.contains(\"ic-popover-submenu-back-button\")) {\n ariaLabel = \"Go back to parent menu\";\n }\n const parentEl = this.el.parentElement;\n\n if (\n parentEl &&\n parentEl.tagName === \"IC-MENU-GROUP\" &&\n (parentEl as HTMLIcMenuGroupElement).label\n ) {\n return `${ariaLabel}, ${\n (parentEl as HTMLIcMenuGroupElement).label\n } menu group`;\n } else {\n return ariaLabel;\n }\n };\n\n render() {\n // A sub-component to layout the menu information correctly in ic-button\n const MenuItemInformation = () => {\n return (\n <div class=\"menu-item-info\">\n <div class=\"menu-labels\">\n <ic-typography class=\"menu-item-label\">{this.label}</ic-typography>\n {this.keyboardShortcutLabel && (\n <ic-typography variant=\"caption\" class=\"shortcut\">\n {this.keyboardShortcutLabel}\n </ic-typography>\n )}\n </div>\n {this.description && (\n <ic-typography class=\"menu-item-description\" variant=\"caption\">\n {this.description}\n </ic-typography>\n )}\n </div>\n );\n };\n\n return (\n <Host\n class={{\n [\"ic-menu-item-disabled\"]: !!this.disabled,\n }}\n >\n <li\n role={this.variant === \"toggle\" ? \"menuitemcheckbox\" : \"menuitem\"}\n aria-disabled={`${this.disabled}`}\n aria-checked={\n this.variant === \"toggle\"\n ? this.checked\n ? \"true\"\n : \"false\"\n : undefined\n }\n >\n <ic-button\n fullWidth\n variant=\"tertiary\"\n onClick={this.handleClick}\n href={isPropDefined(this.href)}\n hreflang={isPropDefined(this.hreflang)}\n target={isPropDefined(this.target)}\n rel={isPropDefined(this.rel)}\n referrerpolicy={this.referrerpolicy}\n aria-disabled={`${this.disabled}`}\n aria-label={this.getMenuItemAriaLabel()}\n aria-haspopup={\n isPropDefined(this.submenuTriggerFor) ||\n this.el.classList.contains(\"ic-popover-submenu-back-button\")\n ? \"menu\"\n : false\n }\n >\n <div class=\"focus-border\">\n {isSlotUsed(this.el, \"icon\") && (\n <span class=\"icon\">\n <slot name=\"icon\"></slot>\n </span>\n )}\n <MenuItemInformation />\n {this.variant === \"toggle\" && (\n <span\n class={{\n [\"check-icon\"]: true,\n [\"hide\"]: !this.checked,\n }}\n aria-hidden=\"true\"\n innerHTML={Check}\n />\n )}\n {isPropDefined(this.submenuTriggerFor) && (\n <span\n class={{ [\"submenu-icon\"]: true }}\n aria-hidden=\"true\"\n innerHTML={Chevron}\n />\n )}\n </div>\n </ic-button>\n </li>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-menu-item2.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,4mOAA4mO,CAAC;AACnoO,yBAAe,aAAa;;MC+Bf,QAAQ;IAPrB;;;;;;;;;;;QAa0C,YAAO,GAAa,KAAK,CAAC;;;;QAU1D,aAAQ,GAAa,KAAK,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xB,iBACW,MAAM,EAClB,SAAS,EAAEA,SAAK,GAChB,CACH,EACA,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,KACpC,YACE,KAAK,EAAE,EAAE,CAAC,cAAc,GAAG,IAAI,EAAE,iBACrB,MAAM,EAClB,SAAS,EAAEC,WAAO,GAClB,CACH,CACG,CACI,CACT,CACA,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["Check","Chevron"],"sources":["src/components/ic-menu-item/ic-menu-item.css?tag=ic-menu-item&encapsulation=shadow","src/components/ic-menu-item/ic-menu-item.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\nli {\n list-style: none;\n padding: 0;\n}\n\n:host ::part(button) {\n color: var(--ic-popover-menu-item-check);\n --ic-typography-color: var(--ic-popover-menu-item-check);\n padding: calc(var(--ic-space-xxxs) / 2);\n display: flex;\n align-items: flex-start;\n gap: var(--ic-space-xs);\n border-radius: 0;\n min-height: 2.5rem;\n height: auto;\n}\n\n.focus-border {\n display: flex;\n align-items: flex-start;\n gap: var(--ic-space-xs);\n border-radius: var(--ic-border-radius);\n margin: calc(var(--ic-space-xxxs) / 2);\n padding: var(--ic-space-xxs);\n border: var(--ic-space-xxxs) dashed transparent;\n\n --icon-height: auto;\n}\n\n:host(.ic-menu-item-disabled) ::part(button) {\n color: var(--ic-popover-menu-item-check-disabled) !important;\n\n --ic-typography-color: var(--ic-popover-menu-item-check-disabled) !important;\n\n pointer-events: none;\n}\n\n:host(.ic-menu-item-disabled) .menu-item-label,\n:host(.ic-menu-item-disabled) .shortcut,\n:host(.ic-menu-item-disabled) .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;\n}\n\n:host([variant=\"destructive\"]) ::part(button) {\n color: var(--ic-popover-menu-destructive-item-icon);\n\n --ic-typography-color: var(--ic-popover-menu-destructive-item-label);\n}\n\n:host ::part(button):hover {\n background-color: var(--ic-popover-background-hover);\n}\n\n:host ::part(button):focus-visible,\n:host ::part(button):focus {\n color: var(--ic-popover-menu-item-icon-focused);\n\n --ic-typography-color: purple;\n\n background-color: var(--ic-popover-background-focus);\n box-shadow: none;\n}\n\n:host(.ic-menu-item-disabled) ::part(button):focus-visible,\n:host(.ic-menu-item-disabled) ::part(button):focus {\n color: var(--ic-popover-menu-item-icon-disabled) !important;\n\n --ic-typography-color: orange !important;\n}\n\n:host([variant=\"destructive\"]) ::part(button):focus-visible,\n:host([variant=\"destructive\"]) ::part(button):focus {\n background-color: var(--ic-popover-destructive-background-focus);\n}\n\nic-button:focus-within .menu-item-label,\nic-button:focus-within .shortcut,\nic-button:focus-within .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-focused);\n}\n\n:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border {\n border-color: var(--ic-popover-menu-border);\n}\n\n:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,\n:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,\n:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;\n}\n\n:host ::part(button):active {\n background-color: var(--ic-popover-background-pressed);\n color: var(--ic-popover-menu-item-label) !important;\n\n --ic-typography-color: var(--ic-popover-menu-item-label) !important;\n}\n\n:host([variant=\"destructive\"]) ::part(button):active {\n background-color: var(--ic-popover-background-pressed);\n color: var(--ic-popover-menu-destructive-item-label) !important;\n\n --ic-typography-color: var(\n --ic-popover-menu-destructive-item-label\n ) !important;\n}\n\n.menu-item-info {\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: baseline;\n white-space: pre-line;\n text-align: left;\n}\n\n.menu-labels {\n display: flex;\n align-items: baseline;\n gap: var(--ic-space-xs);\n}\n\n.menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-description);\n}\n\n.shortcut {\n --ic-typography-color: var(--ic-popover-menu-item-shortcut);\n\n display: flex;\n flex: min-content;\n}\n\n:host([variant=\"destructive\"]) .menu-item-label {\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.025em;\n}\n\nic-button:active .menu-item-label {\n --ic-typography-color: var(--ic-popover-menu-item-label);\n}\n\nic-button:active .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-description);\n}\n\nic-button:active .shortcut {\n --ic-typography-color: var(--ic-popover-menu-item-shortcut);\n}\n\n:host([variant=\"destructive\"]) ic-button:active .menu-item-label {\n --ic-typography-color: var(\n --ic-popover-menu-destructive-item-label\n ) !important;\n}\n\n.icon,\n.check-icon,\n.submenu-icon,\n.icon ::slotted(svg),\n.check-icon svg,\n.submenu-icon svg {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.check-icon.hide {\n visibility: hidden;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n :host ::part(button) {\n border: canvas;\n }\n\n :host ::part(button):focus-visible {\n outline: var(--ic-space-xxxs) solid transparent;\n }\n\n .focus-border {\n border-color: canvas;\n }\n\n :host(.ic-menu-item-disabled) ic-button:focus-within .focus-border {\n border-color: GrayText;\n }\n\n :host(.ic-menu-item-disabled) .menu-item-info,\n :host(.ic-menu-item-disabled) .menu-item-label,\n :host(.ic-menu-item-disabled) .shortcut,\n :host(.ic-menu-item-disabled) .menu-item-description,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,\n :host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description {\n --ic-typography-color: GrayText !important;\n }\n\n :host(.ic-menu-item-disabled) ::part(button):focus-visible,\n :host(.ic-menu-item-disabled) ::part(button):focus {\n outline-color: GrayText !important;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Event,\n EventEmitter,\n Listen,\n Watch,\n} from \"@stencil/core\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n isPropDefined,\n} from \"../../utils/helpers\";\nimport { IcMenuItemVariants } from \"./ic-menu-item.types\";\nimport Check from \"../../assets/check-icon.svg\";\nimport Chevron from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot icon - Content will be placed to the left of the menu item label.\n */\n\n@Component({\n tag: \"ic-menu-item\",\n styleUrl: \"ic-menu-item.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class MenuItem {\n @Element() el: HTMLIcMenuItemElement;\n\n /**\n * If `true`, the menu item will be in a checked state. This is only applicable when variant is set to `toggle`.\n */\n @Prop({ mutable: true, reflect: true }) checked?: boolean = false;\n\n /**\n * The description displayed in the menu item, below the label.\n */\n @Prop() description?: string;\n\n /**\n * If `true`, the menu item will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The URL that the link points to. This will render the menu item as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label describing the keyboard shortcut for a menu item's action.\n */\n @Prop() keyboardShortcutLabel?: string;\n\n /**\n * The label to display in the menu item.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * This references the popover menu instance that the menu item is a trigger for. If this prop is set, then the variant will always be default.\n */\n @Prop() submenuTriggerFor?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The variant of the menu item.\n */\n @Prop({ mutable: true, reflect: true }) variant?: IcMenuItemVariants =\n \"default\";\n\n /**\n * @internal Emitted when item loses focus.\n */\n @Event() childBlur: EventEmitter<void>;\n\n /**\n * @internal Emitted when the user clicks a menu item.\n */\n @Event() handleMenuItemClick: EventEmitter<HTMLIcMenuItemElement>;\n\n /**\n * Emitted when the user clicks a menu item that is set to the toggle variant.\n */\n @Event() icToggleChecked: EventEmitter<{\n checked: boolean;\n }>;\n\n /**\n * @internal Emitted when the user clicks a menu item that triggers a popover menu instance.\n */\n @Event() triggerPopoverMenuInstance: EventEmitter<void>;\n\n componentWillLoad(): void {\n // This ensures that trigger menu items are always set to the default variant\n if (isPropDefined(this.submenuTriggerFor) && this.variant !== \"default\") {\n this.variant = \"default\";\n }\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Menu Item\"\n );\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(e: Event): void {\n if (this.disabled) {\n e.stopImmediatePropagation();\n }\n }\n\n private handleClick = (e: Event): void => {\n if (isPropDefined(this.submenuTriggerFor)) {\n this.triggerPopoverMenuInstance.emit();\n } else if (this.variant === \"toggle\") {\n e.preventDefault();\n this.checked = !this.checked;\n this.icToggleChecked.emit({\n checked: this.checked,\n });\n }\n this.handleMenuItemClick.emit(this.el);\n };\n\n private getMenuItemAriaLabel = (): string => {\n let ariaLabel = this.label;\n\n if (isPropDefined(this.description)) {\n ariaLabel = `${ariaLabel}, ${this.description}`;\n }\n\n if (isPropDefined(this.keyboardShortcutLabel)) {\n ariaLabel = `${ariaLabel}, ${this.keyboardShortcutLabel}`;\n }\n\n if (this.variant === \"destructive\") {\n ariaLabel = `${ariaLabel}, destructive`;\n }\n\n if (isPropDefined(this.submenuTriggerFor)) {\n ariaLabel = `${ariaLabel}, triggers submenu`;\n }\n\n if (this.el.classList.contains(\"ic-popover-submenu-back-button\")) {\n ariaLabel = \"Go back to parent menu\";\n }\n const parentEl = this.el.parentElement;\n\n if (\n parentEl &&\n parentEl.tagName === \"IC-MENU-GROUP\" &&\n (parentEl as HTMLIcMenuGroupElement).label\n ) {\n return `${ariaLabel}, ${\n (parentEl as HTMLIcMenuGroupElement).label\n } menu group`;\n } else {\n return ariaLabel;\n }\n };\n\n render() {\n // A sub-component to layout the menu information correctly in ic-button\n const MenuItemInformation = () => {\n return (\n <div class=\"menu-item-info\">\n <div class=\"menu-labels\">\n <ic-typography class=\"menu-item-label\">{this.label}</ic-typography>\n {this.keyboardShortcutLabel && (\n <ic-typography variant=\"caption\" class=\"shortcut\">\n {this.keyboardShortcutLabel}\n </ic-typography>\n )}\n </div>\n {this.description && (\n <ic-typography class=\"menu-item-description\" variant=\"caption\">\n {this.description}\n </ic-typography>\n )}\n </div>\n );\n };\n\n return (\n <Host\n class={{\n [\"ic-menu-item-disabled\"]: !!this.disabled,\n }}\n >\n <li\n role={this.variant === \"toggle\" ? \"menuitemcheckbox\" : \"menuitem\"}\n aria-disabled={`${this.disabled}`}\n aria-checked={\n this.variant === \"toggle\"\n ? this.checked\n ? \"true\"\n : \"false\"\n : undefined\n }\n >\n <ic-button\n fullWidth\n variant=\"tertiary\"\n onClick={this.handleClick}\n href={isPropDefined(this.href)}\n hreflang={isPropDefined(this.hreflang)}\n target={isPropDefined(this.target)}\n rel={isPropDefined(this.rel)}\n referrerpolicy={this.referrerpolicy}\n aria-disabled={`${this.disabled}`}\n aria-label={this.getMenuItemAriaLabel()}\n aria-haspopup={\n isPropDefined(this.submenuTriggerFor) ||\n this.el.classList.contains(\"ic-popover-submenu-back-button\")\n ? \"menu\"\n : false\n }\n >\n <div class=\"focus-border\">\n {isSlotUsed(this.el, \"icon\") && (\n <span class=\"icon\">\n <slot name=\"icon\"></slot>\n </span>\n )}\n <MenuItemInformation />\n {this.variant === \"toggle\" && (\n <span\n class={{\n [\"check-icon\"]: true,\n [\"hide\"]: !this.checked,\n }}\n aria-hidden=\"true\"\n innerHTML={Check}\n />\n )}\n {isPropDefined(this.submenuTriggerFor) && (\n <span\n class={{ [\"submenu-icon\"]: true }}\n aria-hidden=\"true\"\n innerHTML={Chevron}\n />\n )}\n </div>\n </ic-button>\n </li>\n </Host>\n );\n }\n}\n"],"version":3}
|