@ukic/web-components 2.2.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{OpenInNew-f9958725.js → OpenInNew-d5d30e77.js} +1 -1
- package/dist/cjs/OpenInNew-d5d30e77.js.map +1 -0
- package/dist/cjs/{check-icon-b2f60716.js → check-icon-7225d79b.js} +1 -1
- package/dist/cjs/check-icon-7225d79b.js.map +1 -0
- package/dist/cjs/{chevron-icon-2bb3a907.js → chevron-icon-3bf07531.js} +1 -1
- package/dist/cjs/chevron-icon-3bf07531.js.map +1 -0
- package/dist/cjs/{close-icon-8ccb0163.js → close-icon-7f6ef8e4.js} +2 -2
- package/dist/cjs/close-icon-7f6ef8e4.js.map +1 -0
- package/dist/cjs/core.cjs.js +3 -6
- package/dist/cjs/core.cjs.js.map +1 -1
- package/dist/cjs/{helpers-eb53c416.js → helpers-d166f875.js} +43 -21
- package/dist/cjs/helpers-d166f875.js.map +1 -0
- package/dist/cjs/ic-alert.cjs.entry.js +5 -5
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +3 -3
- package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/ic-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +131 -41
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +4 -4
- package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +5 -4
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +11 -5
- 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 +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-entity.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +3 -3
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +5 -5
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +3 -3
- package/dist/cjs/ic-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +37 -0
- package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +4 -4
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +7 -4
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +3 -3
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +3 -3
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +43 -37
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +4 -4
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +4 -4
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +5 -5
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +5 -5
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +33 -15
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +8 -9
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +3 -3
- package/dist/cjs/ic-navigation-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +3 -3
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +3 -3
- package/dist/cjs/ic-pagination-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +3 -3
- package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +68 -16
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +3 -3
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +38 -21
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +71 -17
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +18 -9
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +4 -4
- package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +2 -2
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +3 -3
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +4 -4
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
- 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 +3 -3
- 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-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +5 -5
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +4 -4
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +13 -5
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-2a0c6769.js → index-54d2bed9.js} +102 -26
- package/dist/cjs/index-54d2bed9.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -12
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{popper-d7adcfc6.js → popper-31badbf8.js} +1 -1
- package/dist/cjs/popper-31badbf8.js.map +1 -0
- package/dist/cjs/{types-3eb02246.js → types-7d67439f.js} +1 -1
- package/dist/cjs/types-7d67439f.js.map +1 -0
- package/dist/collection/assets/close-icon.svg +1 -1
- package/dist/collection/assets/error-icon.svg +3 -2
- package/dist/collection/assets/hamburger-menu-icon.svg +1 -1
- package/dist/collection/assets/info-icon.svg +3 -2
- package/dist/collection/assets/neutral-icon.svg +4 -3
- package/dist/collection/assets/success-icon.svg +3 -2
- package/dist/collection/assets/warning-icon.svg +3 -2
- package/dist/collection/collection-manifest.json +61 -60
- package/dist/collection/components/ic-alert/ic-alert.css +9 -9
- package/dist/collection/components/ic-alert/ic-alert.js +3 -2
- package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
- package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js +5 -1
- package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.css +19 -3
- package/dist/collection/components/ic-button/ic-button.js +40 -15
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.types.js.map +1 -1
- package/dist/collection/components/ic-button/test/basic/ic-button.spec.js +17 -2
- package/dist/collection/components/ic-button/test/basic/ic-button.spec.js.map +1 -1
- package/dist/collection/components/ic-card/ic-card.js +4 -2
- package/dist/collection/components/ic-card/ic-card.js.map +1 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.css +34 -0
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +41 -6
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +35 -5
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js +28 -0
- package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.js +8 -5
- package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.types.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +2 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.js +14 -5
- package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
- package/dist/collection/components/ic-empty-state/ic-empty-state.css +49 -0
- package/dist/collection/components/ic-empty-state/ic-empty-state.js +160 -0
- package/dist/collection/components/ic-empty-state/ic-empty-state.js.map +1 -0
- package/dist/collection/components/ic-empty-state/ic-empty-state.types.js +2 -0
- package/dist/collection/components/ic-empty-state/ic-empty-state.types.js.map +1 -0
- package/dist/collection/components/ic-empty-state/test/a11y/ic-empty-state.test.a11y.js +38 -0
- package/dist/collection/components/ic-empty-state/test/a11y/ic-empty-state.test.a11y.js.map +1 -0
- package/dist/collection/components/ic-empty-state/test/basic/ic-empty-state.spec.js +86 -0
- package/dist/collection/components/ic-empty-state/test/basic/ic-empty-state.spec.js.map +1 -0
- package/dist/collection/components/ic-footer/ic-footer.js +8 -3
- package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
- package/dist/collection/components/ic-footer-link/ic-footer-link.js +2 -1
- package/dist/collection/components/ic-footer-link/ic-footer-link.js.map +1 -1
- package/dist/collection/components/ic-hero/ic-hero.js +4 -2
- package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
- package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js +4 -2
- package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js.map +1 -1
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +2 -1
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map +1 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.css +1 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.js +4 -2
- package/dist/collection/components/ic-input-validation/ic-input-validation.js.map +1 -1
- package/dist/collection/components/ic-link/ic-link.js +6 -3
- package/dist/collection/components/ic-link/ic-link.js.map +1 -1
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js +6 -3
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.css +17 -0
- package/dist/collection/components/ic-menu/ic-menu.js +107 -48
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js +13 -2
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-menu-item/ic-menu-item.js +4 -2
- package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.css +1 -0
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +5 -3
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
- package/dist/collection/components/ic-navigation-button/test/basic/ic-navigation-button.spec.js +1 -1
- package/dist/collection/components/ic-navigation-button/test/basic/ic-navigation-button.spec.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +6 -2
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +30 -11
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/test/basic/ic-navigation-group.spec.js +3 -3
- package/dist/collection/components/ic-navigation-group/test/basic/ic-navigation-group.spec.js.map +1 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +4 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +6 -5
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js +2 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
- package/dist/collection/components/ic-pagination/ic-pagination.js +8 -4
- package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.js +4 -2
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.css +12 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +69 -14
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/test/basic/ic-popover-menu.spec.js +14 -0
- package/dist/collection/components/ic-popover-menu/test/basic/ic-popover-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +6 -3
- package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
- package/dist/collection/components/ic-radio-option/ic-radio-option.js +8 -4
- package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +103 -34
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.e2e.js +19 -0
- package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.e2e.js.map +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.js +85 -22
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/test/basic/ic-select.e2e.js +30 -0
- package/dist/collection/components/ic-select/test/basic/ic-select.e2e.js.map +1 -1
- package/dist/collection/components/ic-select/test/basic/ic-select.spec.js +51 -3
- package/dist/collection/components/ic-select/test/basic/ic-select.spec.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +4 -0
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +30 -3
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.e2e.js +20 -0
- package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.e2e.js.map +1 -1
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -1
- package/dist/collection/components/ic-skeleton/ic-skeleton.js.map +1 -1
- package/dist/collection/components/ic-status-tag/ic-status-tag.css +4 -4
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +4 -2
- package/dist/collection/components/ic-status-tag/ic-status-tag.js.map +1 -1
- package/dist/collection/components/ic-step/ic-step.js +8 -4
- package/dist/collection/components/ic-step/ic-step.js.map +1 -1
- package/dist/collection/components/ic-stepper/ic-stepper.js +4 -2
- package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
- package/dist/collection/components/ic-switch/ic-switch.css +1 -1
- package/dist/collection/components/ic-switch/ic-switch.js +4 -2
- package/dist/collection/components/ic-switch/ic-switch.js.map +1 -1
- package/dist/collection/components/ic-tab/ic-tab.js +10 -5
- package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +10 -5
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js.map +1 -1
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +4 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.js +26 -13
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-theme/ic-theme.js +2 -1
- package/dist/collection/components/ic-theme/ic-theme.js.map +1 -1
- package/dist/collection/components/ic-toast/ic-toast.css +2 -2
- package/dist/collection/components/ic-toast/ic-toast.js +8 -4
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +4 -2
- package/dist/collection/components/ic-toast-region/ic-toast-region.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.css +9 -0
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +112 -35
- package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
- package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js +2 -0
- package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js.map +1 -1
- package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.spec.js +160 -1
- package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.spec.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +3 -2
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-typography/ic-typography.css +21 -1
- package/dist/collection/components/ic-typography/ic-typography.js +83 -2
- package/dist/collection/components/ic-typography/ic-typography.js.map +1 -1
- package/dist/collection/components/ic-typography/test/basic/ic-typography.spec.js +28 -0
- package/dist/collection/components/ic-typography/test/basic/ic-typography.spec.js.map +1 -1
- package/dist/collection/utils/helpers.js +25 -8
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/close-icon.js +1 -1
- package/dist/components/helpers.js +41 -19
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-alert2.js +1 -1
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-back-to-top.js.map +1 -1
- package/dist/components/ic-breadcrumb-group.js.map +1 -1
- package/dist/components/ic-breadcrumb2.js.map +1 -1
- package/dist/components/ic-button2.js +20 -5
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +3 -1
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +9 -2
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-entity.js.map +1 -1
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-dialog.js +1 -1
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-divider2.js.map +1 -1
- package/dist/components/ic-empty-state.d.ts +11 -0
- package/dist/components/ic-empty-state.js +63 -0
- package/dist/components/ic-empty-state.js.map +1 -0
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +4 -1
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js.map +1 -1
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-input-container2.js.map +1 -1
- package/dist/components/ic-input-label2.js.map +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-input-validation2.js.map +1 -1
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu-group.js.map +1 -1
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +40 -32
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +2 -2
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +29 -11
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +3 -4
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination.js.map +1 -1
- package/dist/components/ic-popover-menu.js +64 -12
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +37 -18
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js.map +1 -1
- package/dist/components/ic-select.js +69 -14
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-side-navigation.js +15 -5
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-status-tag.js +1 -1
- package/dist/components/ic-status-tag.js.map +1 -1
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-switch.js +1 -1
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-group.js.map +1 -1
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-toast-region.js.map +1 -1
- package/dist/components/ic-toast.js +1 -1
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-tooltip2.js +109 -34
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-typography2.js +14 -2
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/types.js.map +1 -1
- package/dist/core/core.css +26 -26
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-7ae091ef.entry.js → p-0dcc76b1.entry.js} +2 -2
- package/dist/core/p-0dcc76b1.entry.js.map +1 -0
- package/dist/core/p-101bce17.entry.js +2 -0
- package/dist/core/p-101bce17.entry.js.map +1 -0
- package/dist/core/p-16e8bb5a.entry.js +2 -0
- package/dist/core/p-16e8bb5a.entry.js.map +1 -0
- package/dist/core/p-18068237.js +3 -0
- package/dist/core/p-18068237.js.map +1 -0
- package/dist/core/p-1c54269e.entry.js +2 -0
- package/dist/core/p-1c54269e.entry.js.map +1 -0
- package/dist/core/{p-8991f656.entry.js → p-27897d29.entry.js} +2 -2
- package/dist/core/p-27897d29.entry.js.map +1 -0
- package/dist/core/{p-27d42378.entry.js → p-27bf4783.entry.js} +2 -2
- package/dist/core/p-27bf4783.entry.js.map +1 -0
- package/dist/core/{p-7536dd31.entry.js → p-3297713b.entry.js} +2 -2
- package/dist/core/p-3297713b.entry.js.map +1 -0
- package/dist/core/{p-06321d19.js → p-3b185c32.js} +1 -1
- package/dist/core/{p-429e4d24.entry.js → p-3fc638fc.entry.js} +2 -2
- package/dist/core/p-3fc638fc.entry.js.map +1 -0
- package/dist/core/p-414ff132.entry.js +2 -0
- package/dist/core/p-414ff132.entry.js.map +1 -0
- package/dist/core/{p-8d4f7027.js → p-426ec638.js} +1 -1
- package/dist/core/{p-1b9b8355.entry.js → p-433cfd47.entry.js} +2 -2
- package/dist/core/p-433cfd47.entry.js.map +1 -0
- package/dist/core/{p-90d3a41b.entry.js → p-455bfed1.entry.js} +2 -2
- package/dist/core/p-455bfed1.entry.js.map +1 -0
- package/dist/core/{p-5c9c940f.entry.js → p-4c4261e7.entry.js} +2 -2
- package/dist/core/p-4c4261e7.entry.js.map +1 -0
- package/dist/core/{p-8c45ab61.entry.js → p-4f7c20b3.entry.js} +2 -2
- package/dist/core/p-4f7c20b3.entry.js.map +1 -0
- package/dist/core/p-521c8f40.entry.js +2 -0
- package/dist/core/p-521c8f40.entry.js.map +1 -0
- package/dist/core/{p-041604fc.entry.js → p-5b8be53f.entry.js} +2 -2
- package/dist/core/p-5b8be53f.entry.js.map +1 -0
- package/dist/core/{p-f923d11b.entry.js → p-5fcbcc3f.entry.js} +2 -2
- package/dist/core/p-5fcbcc3f.entry.js.map +1 -0
- package/dist/core/{p-3adb1167.entry.js → p-607e7bf2.entry.js} +2 -2
- package/dist/core/p-607e7bf2.entry.js.map +1 -0
- package/dist/core/{p-6f57b13c.js → p-613aa265.js} +1 -1
- package/dist/core/p-613aa265.js.map +1 -0
- package/dist/core/p-62499150.entry.js +2 -0
- package/dist/core/p-62499150.entry.js.map +1 -0
- package/dist/core/{p-cef93d12.entry.js → p-630ae754.entry.js} +2 -2
- package/dist/core/p-630ae754.entry.js.map +1 -0
- package/dist/core/{p-5c846d0a.entry.js → p-65df7222.entry.js} +2 -2
- package/dist/core/p-65df7222.entry.js.map +1 -0
- package/dist/core/{p-8ca80000.entry.js → p-6781620e.entry.js} +2 -2
- package/dist/core/p-6781620e.entry.js.map +1 -0
- package/dist/core/p-67c18f72.entry.js +2 -0
- package/dist/core/p-67c18f72.entry.js.map +1 -0
- package/dist/core/{p-7c0dcd00.js → p-68a5aaff.js} +1 -1
- package/dist/core/p-68a5aaff.js.map +1 -0
- package/dist/core/{p-95992c98.entry.js → p-68fda79a.entry.js} +2 -2
- package/dist/core/p-68fda79a.entry.js.map +1 -0
- package/dist/core/{p-892d9d9f.entry.js → p-7194c255.entry.js} +2 -2
- package/dist/core/p-7194c255.entry.js.map +1 -0
- package/dist/core/p-77266738.entry.js +2 -0
- package/dist/core/p-77266738.entry.js.map +1 -0
- package/dist/core/{p-d2215b72.entry.js → p-7be2b1fd.entry.js} +2 -2
- package/dist/core/p-7be2b1fd.entry.js.map +1 -0
- package/dist/core/p-831b0f3f.entry.js +2 -0
- package/dist/core/p-831b0f3f.entry.js.map +1 -0
- package/dist/core/{p-2ae7687a.entry.js → p-83e535de.entry.js} +2 -2
- package/dist/core/p-83e535de.entry.js.map +1 -0
- package/dist/core/{p-441e7d98.entry.js → p-85dd5e5b.entry.js} +2 -2
- package/dist/core/p-85dd5e5b.entry.js.map +1 -0
- package/dist/core/{p-ce791694.entry.js → p-87149cbd.entry.js} +2 -2
- package/dist/core/p-87149cbd.entry.js.map +1 -0
- package/dist/core/{p-9e551fe9.entry.js → p-8e6169e0.entry.js} +2 -2
- package/dist/core/p-8e6169e0.entry.js.map +1 -0
- package/dist/core/{p-ca6d834e.entry.js → p-9248228e.entry.js} +2 -2
- package/dist/core/p-9248228e.entry.js.map +1 -0
- package/dist/core/{p-f665242d.entry.js → p-932a67ca.entry.js} +2 -2
- package/dist/core/p-932a67ca.entry.js.map +1 -0
- package/dist/core/p-937ecd5b.entry.js +2 -0
- package/dist/core/p-937ecd5b.entry.js.map +1 -0
- package/dist/core/{p-5144e840.entry.js → p-94903a21.entry.js} +2 -2
- package/dist/core/p-94903a21.entry.js.map +1 -0
- package/dist/core/p-96022913.entry.js +2 -0
- package/dist/core/p-96022913.entry.js.map +1 -0
- package/dist/core/{p-65750560.entry.js → p-9650e00e.entry.js} +2 -2
- package/dist/core/p-9650e00e.entry.js.map +1 -0
- package/dist/core/{p-a8b94619.entry.js → p-99741b0f.entry.js} +2 -2
- package/dist/core/p-99741b0f.entry.js.map +1 -0
- package/dist/core/{p-1959ec8d.entry.js → p-a0a02a13.entry.js} +2 -2
- package/dist/core/p-a0a02a13.entry.js.map +1 -0
- package/dist/core/{p-cbbf4b05.entry.js → p-a421d3a1.entry.js} +2 -2
- package/dist/core/p-a421d3a1.entry.js.map +1 -0
- package/dist/core/{p-c012b867.entry.js → p-b0b1de0e.entry.js} +2 -2
- package/dist/core/p-b0b1de0e.entry.js.map +1 -0
- package/dist/core/p-b82776d0.entry.js +2 -0
- package/dist/core/p-b82776d0.entry.js.map +1 -0
- package/dist/core/{p-6840589f.entry.js → p-c1859843.entry.js} +2 -2
- package/dist/core/p-c1859843.entry.js.map +1 -0
- package/dist/core/{p-8c7f4343.js → p-c2e091d7.js} +1 -1
- package/dist/core/{p-332690f0.entry.js → p-c31e6dbb.entry.js} +2 -2
- package/dist/core/p-c31e6dbb.entry.js.map +1 -0
- package/dist/core/{p-96bcd466.entry.js → p-c390fbad.entry.js} +2 -2
- package/dist/core/p-c390fbad.entry.js.map +1 -0
- package/dist/core/p-cb2c18de.entry.js +2 -0
- package/dist/core/p-cb2c18de.entry.js.map +1 -0
- package/dist/core/{p-6bad30aa.entry.js → p-d16100e8.entry.js} +2 -2
- package/dist/core/p-d16100e8.entry.js.map +1 -0
- package/dist/core/{p-b698b8ad.entry.js → p-d20917ae.entry.js} +2 -2
- package/dist/core/p-d20917ae.entry.js.map +1 -0
- package/dist/core/{p-a29fe0c6.entry.js → p-d65ace31.entry.js} +2 -2
- package/dist/core/p-d65ace31.entry.js.map +1 -0
- package/dist/core/p-d78c90fe.entry.js +2 -0
- package/dist/core/p-d78c90fe.entry.js.map +1 -0
- package/dist/core/{p-adceb0cf.entry.js → p-e2d0039d.entry.js} +2 -2
- package/dist/core/p-e2d0039d.entry.js.map +1 -0
- package/dist/core/{p-a588886f.entry.js → p-e3923b67.entry.js} +2 -2
- package/dist/core/p-e3923b67.entry.js.map +1 -0
- package/dist/core/{p-f7695299.entry.js → p-ebd60291.entry.js} +2 -2
- package/dist/core/p-ebd60291.entry.js.map +1 -0
- package/dist/core/p-ebe76390.js +2 -0
- package/dist/core/p-ebe76390.js.map +1 -0
- package/dist/core/p-f074ef5b.js +2 -0
- package/dist/core/{p-ee11e185.entry.js → p-fedcfea3.entry.js} +2 -2
- package/dist/core/p-fedcfea3.entry.js.map +1 -0
- package/dist/esm/{OpenInNew-67a881e0.js → OpenInNew-cdeed5ce.js} +1 -1
- package/dist/esm/OpenInNew-cdeed5ce.js.map +1 -0
- package/dist/esm/{check-icon-abb210ec.js → check-icon-4a9f8371.js} +1 -1
- package/dist/esm/check-icon-4a9f8371.js.map +1 -0
- package/dist/esm/{chevron-icon-7927f709.js → chevron-icon-589e3b46.js} +1 -1
- package/dist/esm/chevron-icon-589e3b46.js.map +1 -0
- package/dist/esm/{close-icon-2f02b42a.js → close-icon-539ec8d1.js} +2 -2
- package/dist/esm/close-icon-539ec8d1.js.map +1 -0
- package/dist/esm/core.js +4 -7
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/{helpers-85903813.js → helpers-b0e80358.js} +44 -22
- package/dist/esm/helpers-b0e80358.js.map +1 -0
- package/dist/esm/ic-alert.entry.js +5 -5
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +3 -3
- package/dist/esm/ic-back-to-top.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +3 -3
- package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +4 -4
- package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js +131 -41
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card.entry.js +4 -4
- package/dist/esm/ic-card.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +5 -4
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +11 -5
- 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 +1 -1
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-entity.entry.js +1 -1
- package/dist/esm/ic-data-entity.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +3 -3
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +5 -5
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +3 -3
- package/dist/esm/ic-divider.entry.js.map +1 -1
- package/dist/esm/ic-empty-state.entry.js +33 -0
- package/dist/esm/ic-empty-state.entry.js.map +1 -0
- package/dist/esm/ic-footer-link-group.entry.js +3 -3
- package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
- package/dist/esm/ic-footer-link.entry.js +4 -4
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +7 -4
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +3 -3
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +3 -3
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +43 -37
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +4 -4
- package/dist/esm/ic-input-label_2.entry.js.map +1 -1
- package/dist/esm/ic-link.entry.js +4 -4
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js.map +1 -1
- package/dist/esm/ic-menu-item.entry.js +5 -5
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +5 -5
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +33 -15
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +8 -9
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +3 -3
- package/dist/esm/ic-navigation-menu.entry.js.map +1 -1
- package/dist/esm/ic-page-header.entry.js +3 -3
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-pagination-item.entry.js +3 -3
- package/dist/esm/ic-pagination-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination.entry.js +3 -3
- package/dist/esm/ic-pagination.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +68 -16
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +3 -3
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +3 -3
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +38 -21
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-select.entry.js +71 -17
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +18 -9
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +1 -1
- package/dist/esm/ic-skeleton.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +4 -4
- package/dist/esm/ic-status-tag.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +2 -2
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +3 -3
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +4 -4
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +2 -2
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +3 -3
- package/dist/esm/ic-tab-group.entry.js.map +1 -1
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-tab-panel.entry.js.map +1 -1
- 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 +3 -3
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +3 -3
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast-region.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +5 -5
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +4 -4
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +13 -5
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/{index-fd30b77e.js → index-14c9f375.js} +102 -26
- package/dist/esm/index-14c9f375.js.map +1 -0
- package/dist/esm/loader.js +4 -13
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{popper-15e448b4.js → popper-0fbeff6d.js} +1 -1
- package/dist/esm/popper-0fbeff6d.js.map +1 -0
- package/dist/esm/{types-dd515332.js → types-b2398b37.js} +1 -1
- package/dist/esm/types-b2398b37.js.map +1 -0
- package/dist/types/components/ic-alert/ic-alert.d.ts +1 -1
- package/dist/types/components/ic-breadcrumb/ic-breadcrumb.d.ts +3 -3
- package/dist/types/components/ic-button/ic-button.d.ts +8 -4
- package/dist/types/components/ic-button/ic-button.types.d.ts +0 -1
- package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +6 -2
- package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +6 -2
- package/dist/types/components/ic-chip/ic-chip.d.ts +3 -2
- package/dist/types/components/ic-chip/ic-chip.types.d.ts +0 -1
- package/dist/types/components/ic-dialog/ic-dialog.d.ts +5 -5
- package/dist/types/components/ic-empty-state/ic-empty-state.d.ts +35 -0
- package/dist/types/components/ic-empty-state/ic-empty-state.types.d.ts +1 -0
- package/dist/types/components/ic-empty-state/test/a11y/ic-empty-state.test.a11y.d.ts +1 -0
- package/dist/types/components/ic-menu/ic-menu.d.ts +8 -0
- package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +4 -0
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +3 -0
- package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +8 -0
- package/dist/types/components/ic-select/ic-select.d.ts +14 -0
- package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +5 -0
- package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +5 -0
- package/dist/types/components/ic-typography/ic-typography.d.ts +17 -0
- package/dist/types/components.d.ts +167 -16
- package/dist/types/stencil-public-runtime.d.ts +17 -5
- package/dist/types/utils/helpers.d.ts +2 -2
- package/dist/types/utils/types.d.ts +12 -2
- package/hydrate/index.d.ts +6 -6
- package/hydrate/index.js +626 -263
- package/loader/index.d.ts +1 -1
- package/package.json +5 -6
- package/dist/cjs/OpenInNew-f9958725.js.map +0 -1
- package/dist/cjs/check-icon-b2f60716.js.map +0 -1
- package/dist/cjs/chevron-icon-2bb3a907.js.map +0 -1
- package/dist/cjs/close-icon-8ccb0163.js.map +0 -1
- package/dist/cjs/helpers-eb53c416.js.map +0 -1
- package/dist/cjs/index-2a0c6769.js.map +0 -1
- package/dist/cjs/popper-d7adcfc6.js.map +0 -1
- package/dist/cjs/types-3eb02246.js.map +0 -1
- package/dist/core/p-0330cb21.entry.js +0 -2
- package/dist/core/p-0330cb21.entry.js.map +0 -1
- package/dist/core/p-03d1a4a1.entry.js +0 -2
- package/dist/core/p-03d1a4a1.entry.js.map +0 -1
- package/dist/core/p-041604fc.entry.js.map +0 -1
- package/dist/core/p-1959ec8d.entry.js.map +0 -1
- package/dist/core/p-1b9b8355.entry.js.map +0 -1
- package/dist/core/p-26d5fd0f.entry.js +0 -2
- package/dist/core/p-26d5fd0f.entry.js.map +0 -1
- package/dist/core/p-27d42378.entry.js.map +0 -1
- package/dist/core/p-2ae7687a.entry.js.map +0 -1
- package/dist/core/p-332690f0.entry.js.map +0 -1
- package/dist/core/p-39adc795.entry.js +0 -2
- package/dist/core/p-39adc795.entry.js.map +0 -1
- package/dist/core/p-3adb1167.entry.js.map +0 -1
- package/dist/core/p-429e4d24.entry.js.map +0 -1
- package/dist/core/p-441e7d98.entry.js.map +0 -1
- package/dist/core/p-44512ebe.js +0 -2
- package/dist/core/p-48301eff.entry.js +0 -2
- package/dist/core/p-48301eff.entry.js.map +0 -1
- package/dist/core/p-5144e840.entry.js.map +0 -1
- package/dist/core/p-5c846d0a.entry.js.map +0 -1
- package/dist/core/p-5c9c940f.entry.js.map +0 -1
- package/dist/core/p-5dd0b02e.js +0 -2
- package/dist/core/p-5dd0b02e.js.map +0 -1
- package/dist/core/p-65750560.entry.js.map +0 -1
- package/dist/core/p-6840589f.entry.js.map +0 -1
- package/dist/core/p-69920d86.js +0 -3
- package/dist/core/p-69920d86.js.map +0 -1
- package/dist/core/p-6bad30aa.entry.js.map +0 -1
- package/dist/core/p-6f57b13c.js.map +0 -1
- package/dist/core/p-7536dd31.entry.js.map +0 -1
- package/dist/core/p-7ae091ef.entry.js.map +0 -1
- package/dist/core/p-7c0dcd00.js.map +0 -1
- package/dist/core/p-7c46caf2.entry.js +0 -2
- package/dist/core/p-7c46caf2.entry.js.map +0 -1
- package/dist/core/p-83d5bcae.entry.js +0 -2
- package/dist/core/p-83d5bcae.entry.js.map +0 -1
- package/dist/core/p-892d9d9f.entry.js.map +0 -1
- package/dist/core/p-8991f656.entry.js.map +0 -1
- package/dist/core/p-8c45ab61.entry.js.map +0 -1
- package/dist/core/p-8ca80000.entry.js.map +0 -1
- package/dist/core/p-90d3a41b.entry.js.map +0 -1
- package/dist/core/p-95992c98.entry.js.map +0 -1
- package/dist/core/p-96b71172.entry.js +0 -2
- package/dist/core/p-96b71172.entry.js.map +0 -1
- package/dist/core/p-96bcd466.entry.js.map +0 -1
- package/dist/core/p-9e551fe9.entry.js.map +0 -1
- package/dist/core/p-a29fe0c6.entry.js.map +0 -1
- package/dist/core/p-a588886f.entry.js.map +0 -1
- package/dist/core/p-a8b94619.entry.js.map +0 -1
- package/dist/core/p-adceb0cf.entry.js.map +0 -1
- package/dist/core/p-b698b8ad.entry.js.map +0 -1
- package/dist/core/p-b6c538ea.entry.js +0 -2
- package/dist/core/p-b6c538ea.entry.js.map +0 -1
- package/dist/core/p-c012b867.entry.js.map +0 -1
- package/dist/core/p-c5716cbc.entry.js +0 -2
- package/dist/core/p-c5716cbc.entry.js.map +0 -1
- package/dist/core/p-ca6d834e.entry.js.map +0 -1
- package/dist/core/p-cbbf4b05.entry.js.map +0 -1
- package/dist/core/p-ce791694.entry.js.map +0 -1
- package/dist/core/p-cef93d12.entry.js.map +0 -1
- package/dist/core/p-d2215b72.entry.js.map +0 -1
- package/dist/core/p-e0ee714a.entry.js +0 -2
- package/dist/core/p-e0ee714a.entry.js.map +0 -1
- package/dist/core/p-e6370b7e.entry.js +0 -2
- package/dist/core/p-e6370b7e.entry.js.map +0 -1
- package/dist/core/p-ee11e185.entry.js.map +0 -1
- package/dist/core/p-f24814b8.entry.js +0 -2
- package/dist/core/p-f24814b8.entry.js.map +0 -1
- package/dist/core/p-f665242d.entry.js.map +0 -1
- package/dist/core/p-f7695299.entry.js.map +0 -1
- package/dist/core/p-f923d11b.entry.js.map +0 -1
- package/dist/esm/OpenInNew-67a881e0.js.map +0 -1
- package/dist/esm/check-icon-abb210ec.js.map +0 -1
- package/dist/esm/chevron-icon-7927f709.js.map +0 -1
- package/dist/esm/close-icon-2f02b42a.js.map +0 -1
- package/dist/esm/helpers-85903813.js.map +0 -1
- package/dist/esm/index-fd30b77e.js.map +0 -1
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/popper-15e448b4.js.map +0 -1
- package/dist/esm/types-dd515332.js.map +0 -1
- /package/dist/core/{p-06321d19.js.map → p-3b185c32.js.map} +0 -0
- /package/dist/core/{p-44512ebe.js.map → p-426ec638.js.map} +0 -0
- /package/dist/core/{p-8c7f4343.js.map → p-c2e091d7.js.map} +0 -0
- /package/dist/core/{p-8d4f7027.js.map → p-f074ef5b.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-button.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D,OAAO,EAGL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB;;GAEG;AAQH,MAAM,OAAO,MAAM;;IAET,gBAAW,GAAG,SAAS,EAAE,CAAC;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I,CAAC,cAAc,EAAE,EACpD,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,EAClC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,IAAI,CAAC,gBAAgB;QAEhC,EAAC,aAAa,OAAG,CACN,CACd;MAEA,CAAC,IAAI,CAAC,UAAU,IAAI,EAAC,aAAa,OAAG;MACrC,IAAI,CAAC,kBAAkB,IAAI,CAC1B,YAAM,EAAE,EAAE,WAAW,EAAE,KAAK,EAAC,uBAAuB,IACjD,IAAI,CAAC,kBAAkB,CACnB,CACR,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from \"@stencil/core\";\n\nimport {\n getThemeFromContext,\n inheritAttributes,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonSizes,\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n private buttonEl: HTMLElement;\n private buttonIdNum = buttonIds++;\n private hasTooltip: boolean = false;\n private id: string;\n private inheritedAttributes: { [k: string]: unknown } = {};\n private tooltipEl: HTMLIcTooltipElement;\n private describedByEl: HTMLElement = null;\n private describedById: string = null;\n private mutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcButtonElement;\n\n @State() describedByContent: string = null;\n\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download?: string | boolean = false;\n\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The URL that the link points to. This will render the button 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 * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\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 * The size of the button to be displayed.\n */\n @Prop() size?: IcButtonSizes = \"default\";\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 position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.mutationObserver !== null && this.mutationObserver !== undefined) {\n this.mutationObserver.disconnect();\n }\n }\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"aria-expanded\",\n \"title\",\n ]);\n\n removeDisabledFalse(this.disabled, this.el);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.hasTooltip = this.variant === \"icon\" && this.disableTooltip === false;\n\n if (!this.hasTooltip) {\n const describedById = this.inheritedAttributes[\n \"aria-describedby\"\n ] as string;\n if (describedById !== undefined) {\n this.describedById = describedById;\n const el = this.el.parentElement.querySelector(\n `#${describedById}`\n ) as HTMLElement;\n this.describedByContent = el.innerText;\n this.describedByEl = el;\n }\n }\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n\n if (this.describedById) {\n this.mutationObserver = new MutationObserver(this.mutationCallback);\n this.mutationObserver.observe(this.describedByEl, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n /**\n * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.\n */\n @Method()\n async updateAriaLabel(newValue: string): Promise<void> {\n if (this.hasTooltip) {\n this.tooltipEl.label = newValue;\n this.buttonEl.setAttribute(\"aria-label\", newValue);\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n return iconEl !== null;\n }\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n // triggered when text content of sibling element in light DOM changes\n private mutationCallback = (): void => {\n this.describedByContent = this.describedByEl.innerText;\n };\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = this.inheritedAttributes;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n const newTitle = title && (title as string);\n const titleAttr = this.hasTooltip ? {} : { title: newTitle };\n let tooltipText = \"\";\n if (this.hasTooltip) {\n if (newTitle !== undefined) {\n tooltipText = newTitle;\n } else if (ariaLabel !== null) {\n tooltipText = ariaLabel as string;\n }\n }\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n } else {\n describedBy = this.describedById;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...restInheritedAttributes}\n {...titleAttr}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n id={buttonId}\n aria-describedby={describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"loading-with-icon\"]: this.loading && this.hasIconSlot(),\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n }}\n onClick={this.handleClick}\n >\n {this.hasTooltip && (\n <ic-tooltip\n class={{ [\"tooltip-disabled\"]: this.disableTooltip }}\n ref={(el) => (this.tooltipEl = el)}\n label={tooltipText}\n target={buttonId}\n placement={this.tooltipPlacement}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n\n {!this.hasTooltip && <ButtonContent />}\n {this.describedByContent && (\n <span id={describedBy} class=\"ic-button-describedby\">\n {this.describedByContent}\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-button.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAGL,qBAAqB,GAEtB,MAAM,mBAAmB,CAAC;AAE3B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB;;;;GAIG;AAQH,MAAM,OAAO,MAAM;;IAET,gBAAW,GAAG,SAAS,EAAE,CAAC;IAC1B,eAAU,GAAY,KAAK,CAAC;IAE5B,wBAAmB,GAA6B,EAAE,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AkB,CACnB,CACR,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from \"@stencil/core\";\n\nimport {\n getThemeFromContext,\n inheritAttributes,\n isSlotUsed,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n IcSizes,\n} from \"../../utils/types\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Deprecated. This slot should not be used anymore. Use left-icon or right-icon slot instead.\n * @slot left-icon - Content will be placed to the left of the button label.\n * @slot right-icon - Content will be placed to the right of the button label.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n private buttonEl: HTMLElement;\n private buttonIdNum = buttonIds++;\n private hasTooltip: boolean = false;\n private id: string;\n private inheritedAttributes: { [k: string]: unknown } = {};\n private tooltipEl: HTMLIcTooltipElement;\n private describedByEl: HTMLElement = null;\n private describedById: string = null;\n private mutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcButtonElement;\n\n @State() describedByContent: string = null;\n\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download?: string | boolean = false;\n\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The URL that the link points to. This will render the button 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 * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\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 * The size of the button to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\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 position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.mutationObserver !== null && this.mutationObserver !== undefined) {\n this.mutationObserver.disconnect();\n }\n }\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"aria-expanded\",\n \"title\",\n ]);\n\n removeDisabledFalse(this.disabled, this.el);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.hasTooltip = this.variant === \"icon\" && this.disableTooltip === false;\n\n if (!this.hasTooltip) {\n const describedById = this.inheritedAttributes[\n \"aria-describedby\"\n ] as string;\n if (describedById !== undefined) {\n this.describedById = describedById;\n const el = this.el.parentElement.querySelector(\n `#${describedById}`\n ) as HTMLElement;\n this.describedByContent = el.innerText;\n this.describedByEl = el;\n }\n }\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n\n if (this.describedById) {\n this.mutationObserver = new MutationObserver(this.mutationCallback);\n this.mutationObserver.observe(this.describedByEl, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n /**\n * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.\n */\n @Method()\n async updateAriaLabel(newValue: string): Promise<void> {\n if (this.hasTooltip) {\n this.tooltipEl.label = newValue;\n this.buttonEl.setAttribute(\"aria-label\", null);\n } else {\n this.buttonEl.setAttribute(\"aria-label\", newValue);\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n return iconEl !== null;\n }\n\n private hasLeftIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n return iconEl !== null;\n }\n\n private hasRightIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n return iconEl !== null;\n }\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n // triggered when text content of sibling element in light DOM changes\n private mutationCallback = (): void => {\n this.describedByContent = this.describedByEl.innerText;\n };\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = this.inheritedAttributes;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n const newTitle = title && (title as string);\n const titleAttr = this.hasTooltip ? {} : { title: newTitle };\n let tooltipText = \"\";\n if (this.hasTooltip) {\n if (newTitle !== undefined) {\n tooltipText = newTitle;\n } else if (ariaLabel !== null) {\n tooltipText = ariaLabel as string;\n }\n }\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n } else {\n describedBy = this.describedById;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...restInheritedAttributes}\n {...titleAttr}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n id={buttonId}\n aria-describedby={this.hasTooltip && ariaLabel ? null : describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.hasLeftIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n {this.hasRightIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"right-icon\" />\n </div>\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"loading-with-icon\"]:\n this.loading &&\n (this.hasIconSlot() ||\n this.hasLeftIconSlot() ||\n this.hasRightIconSlot()),\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n [\"with-badge\"]: isSlotUsed(this.el, \"badge\"),\n }}\n onClick={this.handleClick}\n >\n {this.hasTooltip && (\n <ic-tooltip\n class={{ [\"tooltip-disabled\"]: this.disableTooltip }}\n ref={(el) => (this.tooltipEl = el)}\n label={tooltipText}\n target={buttonId}\n placement={this.tooltipPlacement}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n\n {!this.hasTooltip && <ButtonContent />}\n {this.describedByContent && (\n <span id={describedBy} class=\"ic-button-describedby\">\n {this.describedByContent}\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-button.types.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.types.ts"],"names":[],"mappings":"","sourcesContent":["export type IcButtonTypes = \"reset\" | \"submit\" | \"button\";\n\nexport type IcButtonVariants =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"icon\"\n | \"destructive\";\n\nexport type
|
1
|
+
{"version":3,"file":"ic-button.types.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.types.ts"],"names":[],"mappings":"","sourcesContent":["export type IcButtonTypes = \"reset\" | \"submit\" | \"button\";\n\nexport type IcButtonVariants =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"icon\"\n | \"destructive\";\n\nexport type IcButtonTooltipPlacement = \"top\" | \"right\" | \"bottom\" | \"left\";\n"]}
|
@@ -50,12 +50,27 @@ describe("button component", () => {
|
|
50
50
|
});
|
51
51
|
expect(page.root).toMatchSnapshot();
|
52
52
|
});
|
53
|
-
it("should render correct HTML with
|
53
|
+
it("should render correct HTML with left icon", async () => {
|
54
54
|
const page = await newSpecPage({
|
55
55
|
components: [Button],
|
56
56
|
html: `
|
57
57
|
<ic-button>
|
58
|
-
<svg slot='icon' xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
|
58
|
+
<svg slot='left-icon' xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
|
59
|
+
<path d="M0 0h24v24H0V0z" fill="none"/>
|
60
|
+
<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/>
|
61
|
+
</svg>
|
62
|
+
Button
|
63
|
+
</ic-button>
|
64
|
+
`,
|
65
|
+
});
|
66
|
+
expect(page.root).toMatchSnapshot();
|
67
|
+
});
|
68
|
+
it("should render correct HTML with right icon", async () => {
|
69
|
+
const page = await newSpecPage({
|
70
|
+
components: [Button],
|
71
|
+
html: `
|
72
|
+
<ic-button>
|
73
|
+
<svg slot='right-icon' xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
|
59
74
|
<path d="M0 0h24v24H0V0z" fill="none"/>
|
60
75
|
<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/>
|
61
76
|
</svg>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-button.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-button/test/basic/ic-button.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,O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newSpecPage } from \"@stencil/core/testing\";\nimport * as helpers from \"../../../../utils/helpers\";\n\nbeforeAll(() => {\n jest.spyOn(console, \"warn\").mockImplementation(jest.fn());\n});\n\n//mocked as getThemeFromContext is always default when run in test context\nconst mockGetThemeFromContext = () => {\n const func = jest.fn(() => {\n return \"light\";\n });\n\n Object.defineProperty(helpers, \"getThemeFromContext\", {\n value: func,\n });\n};\n\ndescribe(\"button component\", () => {\n it(\"should correctly render with text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Button</ic-button>\",\n supportsShadowDom: true,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should correctly render with custom text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Click Me</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for secondary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='secondary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for tertiary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='tertiary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for destructive variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='destructive'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with Icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - secondary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"secondary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - tertiary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"tertiary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - destructive\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"destructive\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - appearance light\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading appearance=\"light\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"render with correct button type when defined\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button type='reset'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with \"a\" tag when href is passed', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with defined \"a\" tag props', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#' download rel=\"nofollow\" target=\"_blank\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on title\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' title='Tooltip text'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on aria-label\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' aria-label='Tooltip text' tooltip-placement='top'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should disable tooltip when prop set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button' disable-tooltip>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should update when method called\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button'>Button</ic-button>\",\n });\n\n expect(page.root).toMatchSnapshot();\n\n await page.root.updateAriaLabel(\"New tooltip text\");\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should stop immediate propagation of a click event when disabled\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='test-button' disabled=true onclick='alert('test')'>Button</ic-button>\",\n });\n\n jest.spyOn(window, \"alert\").mockImplementation();\n\n const element = document.getElementById(\"test-button\");\n\n element.click();\n\n await page.waitForChanges();\n\n expect(window.alert).not.toHaveBeenCalled;\n });\n\n it(\"should call 'setFocus' when button is focussed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='ic-button'>Button</ic-button>\",\n });\n\n //Can't expect anything in this test - this is to increase code coverage only\n await page.rootInstance.setFocus().toHaveBeenCalled;\n });\n\n it(\"should test theme change\", async () => {\n mockGetThemeFromContext();\n\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n await page.rootInstance.themeChangeHandler({\n detail: { mode: \"light\" },\n });\n await page.waitForChanges();\n\n expect(page.rootInstance.appearance).toEqual(\"light\");\n });\n\n it(\"should test button as submit button on form\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<form id=\"new-form\"><form><ic-button id='ic-button' type=\"submit\" form=\"new-form\">Button</ic-button>`,\n });\n\n const btn = document.getElementById(\"ic-button\");\n btn.click();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is updated\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n (document.querySelector(\"#button-description\") as HTMLElement).innerText =\n \"This is the new description\";\n page.rootInstance.mutationCallback();\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test blur handler\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n const eventSpy = jest.fn();\n page.win.addEventListener(\"icBlur\", eventSpy);\n\n await page.rootInstance.onBlur();\n await page.waitForChanges();\n expect(eventSpy).toHaveBeenCalled();\n });\n});\n"]}
|
1
|
+
{"version":3,"file":"ic-button.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-button/test/basic/ic-button.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAErD,SAAS,CAAC,GAAG,EAAE;EACb,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,GAAG,EAAE;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ic-button\";\nimport { newSpecPage } from \"@stencil/core/testing\";\nimport * as helpers from \"../../../../utils/helpers\";\n\nbeforeAll(() => {\n jest.spyOn(console, \"warn\").mockImplementation(jest.fn());\n});\n\n//mocked as getThemeFromContext is always default when run in test context\nconst mockGetThemeFromContext = () => {\n const func = jest.fn(() => {\n return \"light\";\n });\n\n Object.defineProperty(helpers, \"getThemeFromContext\", {\n value: func,\n });\n};\n\ndescribe(\"button component\", () => {\n it(\"should correctly render with text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Button</ic-button>\",\n supportsShadowDom: true,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should correctly render with custom text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Click Me</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for secondary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='secondary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for tertiary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='tertiary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for destructive variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='destructive'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with left icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='left-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with right icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='right-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - secondary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"secondary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - tertiary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"tertiary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - destructive\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"destructive\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - appearance light\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading appearance=\"light\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"render with correct button type when defined\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button type='reset'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with \"a\" tag when href is passed', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with defined \"a\" tag props', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#' download rel=\"nofollow\" target=\"_blank\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on title\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' title='Tooltip text'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on aria-label\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' aria-label='Tooltip text' tooltip-placement='top'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should disable tooltip when prop set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button' disable-tooltip>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should update when method called\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button'>Button</ic-button>\",\n });\n\n expect(page.root).toMatchSnapshot();\n\n await page.root.updateAriaLabel(\"New tooltip text\");\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should stop immediate propagation of a click event when disabled\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='test-button' disabled=true onclick='alert('test')'>Button</ic-button>\",\n });\n\n jest.spyOn(window, \"alert\").mockImplementation();\n\n const element = document.getElementById(\"test-button\");\n\n element.click();\n\n await page.waitForChanges();\n\n expect(window.alert).not.toHaveBeenCalled;\n });\n\n it(\"should call 'setFocus' when button is focussed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='ic-button'>Button</ic-button>\",\n });\n\n //Can't expect anything in this test - this is to increase code coverage only\n await page.rootInstance.setFocus().toHaveBeenCalled;\n });\n\n it(\"should test theme change\", async () => {\n mockGetThemeFromContext();\n\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n await page.rootInstance.themeChangeHandler({\n detail: { mode: \"light\" },\n });\n await page.waitForChanges();\n\n expect(page.rootInstance.appearance).toEqual(\"light\");\n });\n\n it(\"should test button as submit button on form\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<form id=\"new-form\"><form><ic-button id='ic-button' type=\"submit\" form=\"new-form\">Button</ic-button>`,\n });\n\n const btn = document.getElementById(\"ic-button\");\n btn.click();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is updated\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n (document.querySelector(\"#button-description\") as HTMLElement).innerText =\n \"This is the new description\";\n page.rootInstance.mutationCallback();\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test blur handler\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n const eventSpy = jest.fn();\n page.win.addEventListener(\"icBlur\", eventSpy);\n\n await page.rootInstance.onBlur();\n await page.waitForChanges();\n expect(eventSpy).toHaveBeenCalled();\n });\n});\n"]}
|
@@ -285,7 +285,8 @@ export class Card {
|
|
285
285
|
"resolved": "\"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\"",
|
286
286
|
"references": {
|
287
287
|
"ReferrerPolicy": {
|
288
|
-
"location": "global"
|
288
|
+
"location": "global",
|
289
|
+
"id": "global::ReferrerPolicy"
|
289
290
|
}
|
290
291
|
}
|
291
292
|
},
|
@@ -368,7 +369,8 @@ export class Card {
|
|
368
369
|
"parameters": [],
|
369
370
|
"references": {
|
370
371
|
"Promise": {
|
371
|
-
"location": "global"
|
372
|
+
"location": "global",
|
373
|
+
"id": "global::Promise"
|
372
374
|
}
|
373
375
|
},
|
374
376
|
"return": "Promise<void>"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-card.js","sourceRoot":"","sources":["../../../src/components/ic-card/ic-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,EACD,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gCAAgC,EAChC,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAExD;;;;;;;;;;;GAWG;AAMH,MAAM,OAAO,IAAI;;IA0HP,mBAAc,GAAG,GAAS,EAAE;MAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC,CAAC;IAEM,kBAAa,GAAG,GAAS,EAAE;MACjC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC,CAAC;IAUM,mBAAc,GAAG,GAAS,EAAE;MAClC,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;IACzC,CAAC,CAAC;sBAzIwC,SAAS;wBAClB,KAAK;sBACP,KAAK;oBACI,IAAI;6BACN,KAAK;qBAKI,KAAK;oBAKvB,KAAK;sBAKH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,IAAI,EAAC,OAAO,EACZ,cAAc,sBACH,wBAAwB,mBACpB,IAAI,CAAC,YAAY,mBAClB,uBAAuB,EACrC,OAAO,EAAE,IAAI,CAAC,cAAc,EAC5B,SAAS,EAAE,WAAW,GACX,CACd,CACG,CACP;MACA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,CAAC,IAAI,IAAI,CAAC,YAAY,IAAI,CAC/D,WAAK,KAAK,EAAC,kBAAkB,EAAC,EAAE,EAAC,uBAAuB;QACtD,YAAM,IAAI,EAAC,kBAAkB,GAAQ,CACjC,CACP,CACS,CACb,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Listen,\n Prop,\n State,\n h,\n Method,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n getThemeFromContext,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot heading - Content will be placed at the top of the card to the right of the icon.\n * @slot message - Content will be placed in the main body of the card.\n * @slot subheading - Content will be placed below the card heading.\n * @slot adornment - Content will be placed below the card subheading.\n * @slot image-top - Content will be placed at the top of the card above all other content.\n * @slot image-mid - Content will be placed below the card heading section.\n * @slot icon - Content will be placed to the left of the card heading.\n * @slot interaction-button - Content will be placed in the top right corner of the heading section.\n * @slot interaction-controls - Content will be placed below the card message.\n * @slot expanded-content - Content will be placed below the interaction controls but will not initially be rendered.\n */\n@Component({\n tag: \"ic-card\",\n styleUrl: \"ic-card.css\",\n shadow: true,\n})\nexport class Card {\n @Element() el: HTMLIcCardElement;\n\n @State() appearance?: IcThemeForeground = \"default\";\n @State() areaExpanded: boolean = false;\n @State() isFocussed: boolean = false;\n @State() parentEl: HTMLElement | null = null;\n @State() parentIsAnchorTag: boolean = false;\n\n /**\n * If `true`, the card will be a clickable variant, instead of static.\n */\n @Prop({ mutable: true }) clickable?: boolean = false;\n\n /**\n * If `true`, the card will be disabled if it is clickable.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the card will have an expandable area and expansion toggle button.\n */\n @Prop() expandable?: boolean = false;\n\n /**\n * If `true`, the card will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The heading for the card.\n */\n @Prop() heading!: string;\n\n /**\n * The URL that the clickable card link points to. If set, the clickable card will render as an \"a\" tag, otherwise it will render as a button.\n */\n @Prop() href?: string | undefined;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string = \"\";\n\n /**\n * The main body message of the card.\n */\n @Prop() message?: 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 * The subheading for the card.\n */\n @Prop() subheading?: 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 disconnectedCallback(): void {\n if (this.parentIsAnchorTag) {\n this.parentEl.removeEventListener(\"focus\", this.parentFocussed);\n this.parentEl.removeEventListener(\"blur\", this.parentBlurred);\n }\n }\n\n componentWillLoad(): void {\n this.parentEl = this.el.parentElement;\n\n if (this.parentEl.tagName === \"A\") {\n this.clickable = true;\n this.parentIsAnchorTag = true;\n this.parentEl.classList.add(\"ic-card-wrapper-link\");\n this.parentEl.addEventListener(\"focus\", this.parentFocussed);\n this.parentEl.addEventListener(\"blur\", this.parentBlurred);\n }\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Card\"\n );\n this.updateTheme();\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the card.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.el.shadowRoot.querySelector(\"a\")) {\n this.el.shadowRoot.querySelector(\"a\").focus();\n } else if (this.el.shadowRoot.querySelector(\"button\")) {\n this.el.shadowRoot.querySelector(\"button\").focus();\n }\n }\n\n private parentFocussed = (): void => {\n this.isFocussed = true;\n };\n\n private parentBlurred = (): void => {\n this.isFocussed = false;\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private toggleExpanded = (): void => {\n this.areaExpanded = !this.areaExpanded;\n };\n\n render() {\n const {\n clickable,\n disabled,\n expandable,\n heading,\n message,\n href,\n hreflang,\n referrerpolicy,\n rel,\n subheading,\n target,\n fullWidth,\n parentIsAnchorTag,\n isFocussed,\n } = this;\n\n const Component = parentIsAnchorTag\n ? \"div\"\n : clickable\n ? this.href === undefined\n ? \"button\"\n : \"a\"\n : \"div\";\n\n const attrs = Component == \"a\" && {\n href: href,\n hrefLang: hreflang,\n referrerPolicy: referrerpolicy,\n rel: rel,\n target: target,\n };\n\n return (\n <Component\n class={{\n [\"card\"]: true,\n [\"clickable\"]: clickable && !disabled,\n [\"disabled\"]: disabled,\n [\"fullwidth\"]: fullWidth,\n [\"focussed\"]: isFocussed,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n }}\n tabindex={clickable && !parentIsAnchorTag ? 0 : null}\n aria-disabled={disabled ? \"true\" : null}\n disabled={disabled ? true : null}\n {...attrs}\n >\n {isSlotUsed(this.el, \"image-top\") && (\n <div class=\"image-top\">\n <slot name=\"image-top\"></slot>\n </div>\n )}\n <div class=\"card-header\">\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <div class=\"card-title\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\">\n <p>{heading}</p>\n </ic-typography>\n </slot>\n </div>\n {isSlotUsed(this.el, \"interaction-button\") && (\n <div class=\"interaction-button\">\n <slot name=\"interaction-button\"></slot>\n </div>\n )}\n </div>\n {(subheading || isSlotUsed(this.el, \"subheading\")) && (\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"subtitle-small\">\n {subheading}\n </ic-typography>\n </slot>\n </div>\n )}\n {isSlotUsed(this.el, \"adornment\") && (\n <div class=\"adornment\">\n <slot name=\"adornment\"></slot>\n </div>\n )}\n {isSlotUsed(this.el, \"image-mid\") && (\n <div class=\"image-mid\">\n <slot name=\"image-mid\"></slot>\n </div>\n )}\n {(message || isSlotUsed(this.el, \"message\")) && (\n <div\n class={{\n [\"card-message\"]: true,\n }}\n >\n {message && <ic-typography variant=\"body\">{message}</ic-typography>}\n {isSlotUsed(this.el, \"message\") && <slot name=\"message\"></slot>}\n </div>\n )}\n {(isSlotUsed(this.el, \"interaction-controls\") || expandable) && (\n <div class=\"interaction-area\">\n <div class=\"interaction-controls\">\n <slot name=\"interaction-controls\"></slot>\n </div>\n {expandable && (\n <ic-button\n class={{\n [\"toggle-button\"]: true,\n [\"toggle-button-closed\"]: !this.areaExpanded,\n [\"toggle-button-expanded\"]: this.areaExpanded,\n }}\n variant=\"icon\"\n size=\"large\"\n disableTooltip\n aria-label=\"Toggle expandable area\"\n aria-expanded={this.areaExpanded}\n aria-controls=\"expanded-content-area\"\n onClick={this.toggleExpanded}\n innerHTML={chevronIcon}\n ></ic-button>\n )}\n </div>\n )}\n {isSlotUsed(this.el, \"expanded-content\") && this.areaExpanded && (\n <div class=\"expanded-content\" id=\"expanded-content-area\">\n <slot name=\"expanded-content\"></slot>\n </div>\n )}\n </Component>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-card.js","sourceRoot":"","sources":["../../../src/components/ic-card/ic-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,EACD,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gCAAgC,EAChC,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAExD;;;;;;;;;;;GAWG;AAMH,MAAM,OAAO,IAAI;;IA0HP,mBAAc,GAAG,GAAS,EAAE;MAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC,CAAC;IAEM,kBAAa,GAAG,GAAS,EAAE;MACjC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC,CAAC;IAUM,mBAAc,GAAG,GAAS,EAAE;MAClC,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;IACzC,CAAC,CAAC;sBAzIwC,SAAS;wBAClB,KAAK;sBACP,KAAK;oBACI,IAAI;6BACN,KAAK;qBAKI,KAAK;oBAKvB,KAAK;sBAKH,KAAK;qBAKN,KAAK;;;oBAeP,EAAE;mBAKH,EAAE;;;;;;EAsB7B,oBAAoB;IAClB,IAAI,IAAI,CAAC,iBAAiB,EAAE;MAC1B,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EA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;MACA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,CAAC,IAAI,IAAI,CAAC,YAAY,IAAI,CAC/D,WAAK,KAAK,EAAC,kBAAkB,EAAC,EAAE,EAAC,uBAAuB;QACtD,YAAM,IAAI,EAAC,kBAAkB,GAAQ,CACjC,CACP,CACS,CACb,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Listen,\n Prop,\n State,\n h,\n Method,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n getThemeFromContext,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot heading - Content will be placed at the top of the card to the right of the icon.\n * @slot message - Content will be placed in the main body of the card.\n * @slot subheading - Content will be placed below the card heading.\n * @slot adornment - Content will be placed below the card subheading.\n * @slot image-top - Content will be placed at the top of the card above all other content.\n * @slot image-mid - Content will be placed below the card heading section.\n * @slot icon - Content will be placed to the left of the card heading.\n * @slot interaction-button - Content will be placed in the top right corner of the heading section.\n * @slot interaction-controls - Content will be placed below the card message.\n * @slot expanded-content - Content will be placed below the interaction controls but will not initially be rendered.\n */\n@Component({\n tag: \"ic-card\",\n styleUrl: \"ic-card.css\",\n shadow: true,\n})\nexport class Card {\n @Element() el: HTMLIcCardElement;\n\n @State() appearance?: IcThemeForeground = \"default\";\n @State() areaExpanded: boolean = false;\n @State() isFocussed: boolean = false;\n @State() parentEl: HTMLElement | null = null;\n @State() parentIsAnchorTag: boolean = false;\n\n /**\n * If `true`, the card will be a clickable variant, instead of static.\n */\n @Prop({ mutable: true }) clickable?: boolean = false;\n\n /**\n * If `true`, the card will be disabled if it is clickable.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the card will have an expandable area and expansion toggle button.\n */\n @Prop() expandable?: boolean = false;\n\n /**\n * If `true`, the card will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The heading for the card.\n */\n @Prop() heading!: string;\n\n /**\n * The URL that the clickable card link points to. If set, the clickable card will render as an \"a\" tag, otherwise it will render as a button.\n */\n @Prop() href?: string | undefined;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string = \"\";\n\n /**\n * The main body message of the card.\n */\n @Prop() message?: 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 * The subheading for the card.\n */\n @Prop() subheading?: 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 disconnectedCallback(): void {\n if (this.parentIsAnchorTag) {\n this.parentEl.removeEventListener(\"focus\", this.parentFocussed);\n this.parentEl.removeEventListener(\"blur\", this.parentBlurred);\n }\n }\n\n componentWillLoad(): void {\n this.parentEl = this.el.parentElement;\n\n if (this.parentEl.tagName === \"A\") {\n this.clickable = true;\n this.parentIsAnchorTag = true;\n this.parentEl.classList.add(\"ic-card-wrapper-link\");\n this.parentEl.addEventListener(\"focus\", this.parentFocussed);\n this.parentEl.addEventListener(\"blur\", this.parentBlurred);\n }\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Card\"\n );\n this.updateTheme();\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the card.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.el.shadowRoot.querySelector(\"a\")) {\n this.el.shadowRoot.querySelector(\"a\").focus();\n } else if (this.el.shadowRoot.querySelector(\"button\")) {\n this.el.shadowRoot.querySelector(\"button\").focus();\n }\n }\n\n private parentFocussed = (): void => {\n this.isFocussed = true;\n };\n\n private parentBlurred = (): void => {\n this.isFocussed = false;\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private toggleExpanded = (): void => {\n this.areaExpanded = !this.areaExpanded;\n };\n\n render() {\n const {\n clickable,\n disabled,\n expandable,\n heading,\n message,\n href,\n hreflang,\n referrerpolicy,\n rel,\n subheading,\n target,\n fullWidth,\n parentIsAnchorTag,\n isFocussed,\n } = this;\n\n const Component = parentIsAnchorTag\n ? \"div\"\n : clickable\n ? this.href === undefined\n ? \"button\"\n : \"a\"\n : \"div\";\n\n const attrs = Component == \"a\" && {\n href: href,\n hrefLang: hreflang,\n referrerPolicy: referrerpolicy,\n rel: rel,\n target: target,\n };\n\n return (\n <Component\n class={{\n [\"card\"]: true,\n [\"clickable\"]: clickable && !disabled,\n [\"disabled\"]: disabled,\n [\"fullwidth\"]: fullWidth,\n [\"focussed\"]: isFocussed,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n }}\n tabindex={clickable && !parentIsAnchorTag ? 0 : null}\n aria-disabled={disabled ? \"true\" : null}\n disabled={disabled ? true : null}\n {...attrs}\n >\n {isSlotUsed(this.el, \"image-top\") && (\n <div class=\"image-top\">\n <slot name=\"image-top\"></slot>\n </div>\n )}\n <div class=\"card-header\">\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <div class=\"card-title\">\n <slot name=\"heading\">\n <ic-typography variant=\"h4\">\n <p>{heading}</p>\n </ic-typography>\n </slot>\n </div>\n {isSlotUsed(this.el, \"interaction-button\") && (\n <div class=\"interaction-button\">\n <slot name=\"interaction-button\"></slot>\n </div>\n )}\n </div>\n {(subheading || isSlotUsed(this.el, \"subheading\")) && (\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"subtitle-small\">\n {subheading}\n </ic-typography>\n </slot>\n </div>\n )}\n {isSlotUsed(this.el, \"adornment\") && (\n <div class=\"adornment\">\n <slot name=\"adornment\"></slot>\n </div>\n )}\n {isSlotUsed(this.el, \"image-mid\") && (\n <div class=\"image-mid\">\n <slot name=\"image-mid\"></slot>\n </div>\n )}\n {(message || isSlotUsed(this.el, \"message\")) && (\n <div\n class={{\n [\"card-message\"]: true,\n }}\n >\n {message && <ic-typography variant=\"body\">{message}</ic-typography>}\n {isSlotUsed(this.el, \"message\") && <slot name=\"message\"></slot>}\n </div>\n )}\n {(isSlotUsed(this.el, \"interaction-controls\") || expandable) && (\n <div class=\"interaction-area\">\n <div class=\"interaction-controls\">\n <slot name=\"interaction-controls\"></slot>\n </div>\n {expandable && (\n <ic-button\n class={{\n [\"toggle-button\"]: true,\n [\"toggle-button-closed\"]: !this.areaExpanded,\n [\"toggle-button-expanded\"]: this.areaExpanded,\n }}\n variant=\"icon\"\n size=\"large\"\n disableTooltip\n aria-label=\"Toggle expandable area\"\n aria-expanded={this.areaExpanded}\n aria-controls=\"expanded-content-area\"\n onClick={this.toggleExpanded}\n innerHTML={chevronIcon}\n ></ic-button>\n )}\n </div>\n )}\n {isSlotUsed(this.el, \"expanded-content\") && this.areaExpanded && (\n <div class=\"expanded-content\" id=\"expanded-content-area\">\n <slot name=\"expanded-content\"></slot>\n </div>\n )}\n </Component>\n );\n }\n}\n"]}
|
@@ -478,6 +478,18 @@ video {
|
|
478
478
|
flex-shrink: 0;
|
479
479
|
}
|
480
480
|
|
481
|
+
:host(.small) .checkbox,
|
482
|
+
:host(.small) .container svg {
|
483
|
+
width: var(--ic-space-md);
|
484
|
+
height: var(--ic-space-md);
|
485
|
+
}
|
486
|
+
|
487
|
+
:host(.large) .checkbox,
|
488
|
+
:host(.large) .container svg {
|
489
|
+
width: var(--ic-space-xl);
|
490
|
+
height: var(--ic-space-xl);
|
491
|
+
}
|
492
|
+
|
481
493
|
.checkbox:checked {
|
482
494
|
background-color: var(--ic-action-default);
|
483
495
|
border: var(--ic-space-1px) solid var(--ic-action-default);
|
@@ -553,6 +565,16 @@ video {
|
|
553
565
|
flex-shrink: 0;
|
554
566
|
}
|
555
567
|
|
568
|
+
:host(.small) .checkmark {
|
569
|
+
margin-left: calc(-1 * var(--ic-space-md));
|
570
|
+
right: calc(-1 * var(--ic-space-md));
|
571
|
+
}
|
572
|
+
|
573
|
+
:host(.large) .checkmark {
|
574
|
+
margin-left: calc(-1 * var(--ic-space-xl));
|
575
|
+
right: calc(-1 * var(--ic-space-xl));
|
576
|
+
}
|
577
|
+
|
556
578
|
.indeterminate-symbol {
|
557
579
|
position: relative;
|
558
580
|
width: 0.875rem;
|
@@ -565,6 +587,18 @@ video {
|
|
565
587
|
flex-shrink: 0;
|
566
588
|
}
|
567
589
|
|
590
|
+
:host(.small) .indeterminate-symbol {
|
591
|
+
width: 0.6rem;
|
592
|
+
right: -0.8rem;
|
593
|
+
margin-left: -0.6rem;
|
594
|
+
}
|
595
|
+
|
596
|
+
:host(.large) .indeterminate-symbol {
|
597
|
+
width: 1.25rem;
|
598
|
+
right: -1.625rem;
|
599
|
+
margin-left: -1.25rem;
|
600
|
+
}
|
601
|
+
|
568
602
|
.container:hover .indeterminate-symbol {
|
569
603
|
background-color: var(--ic-action-default-hover);
|
570
604
|
}
|
@@ -24,6 +24,7 @@ export class Checkbox {
|
|
24
24
|
this.indeterminate = false;
|
25
25
|
this.label = undefined;
|
26
26
|
this.name = undefined;
|
27
|
+
this.size = undefined;
|
27
28
|
this.small = false;
|
28
29
|
this.value = undefined;
|
29
30
|
}
|
@@ -77,10 +78,15 @@ export class Checkbox {
|
|
77
78
|
render() {
|
78
79
|
let id = `ic-checkbox-${this.label !== undefined ? this.label : this.value}-${this.groupLabel}`;
|
79
80
|
id = id.replace(/ /g, "-");
|
81
|
+
const parentElementSize = this.host.parentElement.size;
|
80
82
|
this.checked
|
81
83
|
? renderHiddenInput(true, this.host, this.name, this.checked && this.value, this.disabled)
|
82
84
|
: removeHiddenInput(this.host);
|
83
|
-
return (h(Host, { class: {
|
85
|
+
return (h(Host, { class: {
|
86
|
+
["disabled"]: this.disabled,
|
87
|
+
["small"]: this.small,
|
88
|
+
[`${this.size || parentElementSize}`]: true,
|
89
|
+
} }, h("div", { class: "container" }, this.checked && !this.indeterminate && (h("svg", { class: "checkmark", width: "1.5rem", height: "1.5rem", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd" }, h("title", null, "checkmark icon"), h("path", { d: "M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z" }))), this.checked && this.indeterminate && (h("div", { class: "indeterminate-symbol" })), h("input", { role: "checkbox", class: {
|
84
90
|
["checkbox"]: true,
|
85
91
|
["checked"]: this.checked,
|
86
92
|
["indeterminate"]: this.indeterminate,
|
@@ -112,7 +118,8 @@ export class Checkbox {
|
|
112
118
|
"references": {
|
113
119
|
"IcAdditionalFieldTypes": {
|
114
120
|
"location": "import",
|
115
|
-
"path": "../../utils/types"
|
121
|
+
"path": "../../utils/types",
|
122
|
+
"id": "src/utils/types.ts::IcAdditionalFieldTypes"
|
116
123
|
}
|
117
124
|
}
|
118
125
|
},
|
@@ -249,6 +256,29 @@ export class Checkbox {
|
|
249
256
|
"attribute": "name",
|
250
257
|
"reflect": false
|
251
258
|
},
|
259
|
+
"size": {
|
260
|
+
"type": "string",
|
261
|
+
"mutable": false,
|
262
|
+
"complexType": {
|
263
|
+
"original": "IcSizes",
|
264
|
+
"resolved": "\"default\" | \"large\" | \"small\"",
|
265
|
+
"references": {
|
266
|
+
"IcSizes": {
|
267
|
+
"location": "import",
|
268
|
+
"path": "../../utils/types",
|
269
|
+
"id": "src/utils/types.ts::IcSizes"
|
270
|
+
}
|
271
|
+
}
|
272
|
+
},
|
273
|
+
"required": false,
|
274
|
+
"optional": true,
|
275
|
+
"docs": {
|
276
|
+
"tags": [],
|
277
|
+
"text": "The size of the checkbox to be displayed. This does not affect the font size of the label. If a checkbox is contained in a checkbox group, this will override the size set on checkbox group."
|
278
|
+
},
|
279
|
+
"attribute": "size",
|
280
|
+
"reflect": false
|
281
|
+
},
|
252
282
|
"small": {
|
253
283
|
"type": "boolean",
|
254
284
|
"mutable": false,
|
@@ -260,8 +290,11 @@ export class Checkbox {
|
|
260
290
|
"required": false,
|
261
291
|
"optional": true,
|
262
292
|
"docs": {
|
263
|
-
"tags": [
|
264
|
-
|
293
|
+
"tags": [{
|
294
|
+
"name": "deprecated",
|
295
|
+
"text": "This prop should not be used anymore. Set prop `size` to \"small\" instead."
|
296
|
+
}],
|
297
|
+
"text": ""
|
265
298
|
},
|
266
299
|
"attribute": "small",
|
267
300
|
"reflect": false,
|
@@ -335,10 +368,12 @@ export class Checkbox {
|
|
335
368
|
"parameters": [],
|
336
369
|
"references": {
|
337
370
|
"Promise": {
|
338
|
-
"location": "global"
|
371
|
+
"location": "global",
|
372
|
+
"id": "global::Promise"
|
339
373
|
},
|
340
374
|
"HTMLElement": {
|
341
|
-
"location": "global"
|
375
|
+
"location": "global",
|
376
|
+
"id": "global::HTMLElement"
|
342
377
|
}
|
343
378
|
},
|
344
379
|
"return": "Promise<void>"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n Method,\n} from \"@stencil/core\";\nimport { IcAdditionalFieldTypes } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n removeHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-checkbox\",\n styleUrl: \"ic-checkbox.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class Checkbox {\n private additionalFieldContainer: HTMLDivElement;\n private IC_TEXT_FIELD: string = \"ic-text-field\";\n\n @Element() host: HTMLIcCheckboxElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the checkbox will be set to the checked state.\n */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n @State() initiallyChecked = this.checked;\n\n /**\n * If `true`, the checkbox will be set to the disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * The text to be displayed when dynamic.\n */\n @Prop() dynamicText: string = \"This selection requires additional answers\";\n\n /**\n * The group label for the checkbox.\n */\n @Prop() groupLabel: string;\n\n /**\n * If `true`, the indeterminate state will be displayed when checked.\n */\n @Prop() indeterminate: boolean = false;\n\n /**\n * The label for the checkbox.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\n */\n @Prop() name: string;\n\n /**\n * If true, the small styling will be applied to the checkbox.\n */\n @Prop() small?: boolean = false;\n\n /**\n * The value for the checkbox.\n */\n @Prop() value!: string;\n\n /**\n * @deprecated This event should not be used anymore. Use icCheck instead.\n */\n @Event() checkboxChecked: EventEmitter<void>;\n\n /**\n * Emitted when a checkbox has been checked.\n */\n @Event() icCheck: EventEmitter<void>;\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.host);\n\n addFormResetListener(this.host, this.handleFormReset);\n this.host\n .querySelector(this.IC_TEXT_FIELD)\n ?.addEventListener(\"icChange\", this.eventHandler);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.value, propName: \"value\" },\n ],\n \"Checkbox\"\n );\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const textfield = this.host.querySelector(this.IC_TEXT_FIELD);\n if (!this.checked) {\n textfield && textfield.setAttribute(\"disabled\", \"\");\n } else {\n textfield && textfield.removeAttribute(\"disabled\");\n }\n } else {\n if (!this.checked) {\n this.additionalFieldContainer.style.display = \"none\";\n } else {\n this.additionalFieldContainer.style.display = \"flex\";\n }\n }\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.host, this.handleFormReset);\n this.host\n .querySelector(this.IC_TEXT_FIELD)\n ?.removeEventListener(\"icChange\", this.eventHandler);\n }\n\n /**\n * Sets focus on the checkbox.\n */\n @Method()\n async setFocus(): Promise<void> {\n const checkboxEl: HTMLElement =\n this.host.shadowRoot.querySelector(\".checkbox\");\n if (checkboxEl) {\n checkboxEl.focus();\n }\n }\n\n private eventHandler = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n };\n\n private handleClick = () => {\n this.checked = !this.checked;\n this.icCheck.emit();\n this.checkboxChecked.emit();\n };\n\n private handleFormReset = (): void => {\n this.checked = this.initiallyChecked;\n };\n\n render() {\n let id = `ic-checkbox-${\n this.label !== undefined ? this.label : this.value\n }-${this.groupLabel}`;\n\n id = id.replace(/ /g, \"-\");\n\n this.checked\n ? renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checked && this.value,\n this.disabled\n )\n : removeHiddenInput(this.host);\n\n return (\n <Host class={{ [\"disabled\"]: this.disabled, [\"small\"]: this.small }}>\n <div class=\"container\">\n {this.checked && !this.indeterminate && (\n <svg\n class=\"checkmark\"\n width=\"1.5rem\"\n height=\"1.5rem\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n >\n <title>checkmark icon</title>\n <path d=\"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" />\n </svg>\n )}\n {this.checked && this.indeterminate && (\n <div class=\"indeterminate-symbol\" />\n )}\n <input\n role=\"checkbox\"\n class={{\n [\"checkbox\"]: true,\n [\"checked\"]: this.checked,\n [\"indeterminate\"]: this.indeterminate,\n }}\n type=\"checkbox\"\n name={this.name}\n id={id}\n value={this.value}\n disabled={this.disabled ? true : null}\n checked={this.checked}\n indeterminate={this.indeterminate}\n onClick={this.handleClick}\n ></input>\n <ic-typography class=\"checkbox-label\" variant=\"body\">\n <label htmlFor={id}>{this.label}</label>\n </ic-typography>\n </div>\n {isSlotUsed(this.host, \"additional-field\") && (\n <div\n class=\"dynamic-container\"\n ref={(el) => (this.additionalFieldContainer = el)}\n >\n {this.additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {this.additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\">\n <p class=\"dynamic-text\" aria-live=\"polite\">\n {this.dynamicText}\n </p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n this.additionalFieldDisplay === \"static\",\n }}\n >\n <slot name=\"additional-field\"></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-checkbox.js","sourceRoot":"","sources":["../../../src/components/ic-checkbox/ic-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n Method,\n} from \"@stencil/core\";\nimport { IcAdditionalFieldTypes, IcSizes } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n removeHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-checkbox\",\n styleUrl: \"ic-checkbox.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class Checkbox {\n private additionalFieldContainer: HTMLDivElement;\n private IC_TEXT_FIELD: string = \"ic-text-field\";\n\n @Element() host: HTMLIcCheckboxElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the checkbox will be set to the checked state.\n */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n @State() initiallyChecked = this.checked;\n\n /**\n * If `true`, the checkbox will be set to the disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * The text to be displayed when dynamic.\n */\n @Prop() dynamicText: string = \"This selection requires additional answers\";\n\n /**\n * The group label for the checkbox.\n */\n @Prop() groupLabel: string;\n\n /**\n * If `true`, the indeterminate state will be displayed when checked.\n */\n @Prop() indeterminate: boolean = false;\n\n /**\n * The label for the checkbox.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\n */\n @Prop() name: string;\n\n /**\n * The size of the checkbox to be displayed. This does not affect the font size of the label. If a checkbox is contained in a checkbox group, this will override the size set on checkbox group.\n */\n @Prop() size?: IcSizes;\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\n\n /**\n * The value for the checkbox.\n */\n @Prop() value!: string;\n\n /**\n * @deprecated This event should not be used anymore. Use icCheck instead.\n */\n @Event() checkboxChecked: EventEmitter<void>;\n\n /**\n * Emitted when a checkbox has been checked.\n */\n @Event() icCheck: EventEmitter<void>;\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.host);\n\n addFormResetListener(this.host, this.handleFormReset);\n this.host\n .querySelector(this.IC_TEXT_FIELD)\n ?.addEventListener(\"icChange\", this.eventHandler);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.value, propName: \"value\" },\n ],\n \"Checkbox\"\n );\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const textfield = this.host.querySelector(this.IC_TEXT_FIELD);\n if (!this.checked) {\n textfield && textfield.setAttribute(\"disabled\", \"\");\n } else {\n textfield && textfield.removeAttribute(\"disabled\");\n }\n } else {\n if (!this.checked) {\n this.additionalFieldContainer.style.display = \"none\";\n } else {\n this.additionalFieldContainer.style.display = \"flex\";\n }\n }\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.host, this.handleFormReset);\n this.host\n .querySelector(this.IC_TEXT_FIELD)\n ?.removeEventListener(\"icChange\", this.eventHandler);\n }\n\n /**\n * Sets focus on the checkbox.\n */\n @Method()\n async setFocus(): Promise<void> {\n const checkboxEl: HTMLElement =\n this.host.shadowRoot.querySelector(\".checkbox\");\n if (checkboxEl) {\n checkboxEl.focus();\n }\n }\n\n private eventHandler = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n };\n\n private handleClick = () => {\n this.checked = !this.checked;\n this.icCheck.emit();\n this.checkboxChecked.emit();\n };\n\n private handleFormReset = (): void => {\n this.checked = this.initiallyChecked;\n };\n\n render() {\n let id = `ic-checkbox-${\n this.label !== undefined ? this.label : this.value\n }-${this.groupLabel}`;\n\n id = id.replace(/ /g, \"-\");\n\n const parentElementSize = (\n this.host.parentElement as HTMLIcCheckboxGroupElement\n ).size;\n\n this.checked\n ? renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checked && this.value,\n this.disabled\n )\n : removeHiddenInput(this.host);\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled,\n [\"small\"]: this.small,\n [`${this.size || parentElementSize}`]: true,\n }}\n >\n <div class=\"container\">\n {this.checked && !this.indeterminate && (\n <svg\n class=\"checkmark\"\n width=\"1.5rem\"\n height=\"1.5rem\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n >\n <title>checkmark icon</title>\n <path d=\"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" />\n </svg>\n )}\n {this.checked && this.indeterminate && (\n <div class=\"indeterminate-symbol\" />\n )}\n <input\n role=\"checkbox\"\n class={{\n [\"checkbox\"]: true,\n [\"checked\"]: this.checked,\n [\"indeterminate\"]: this.indeterminate,\n }}\n type=\"checkbox\"\n name={this.name}\n id={id}\n value={this.value}\n disabled={this.disabled ? true : null}\n checked={this.checked}\n indeterminate={this.indeterminate}\n onClick={this.handleClick}\n ></input>\n <ic-typography class=\"checkbox-label\" variant=\"body\">\n <label htmlFor={id}>{this.label}</label>\n </ic-typography>\n </div>\n {isSlotUsed(this.host, \"additional-field\") && (\n <div\n class=\"dynamic-container\"\n ref={(el) => (this.additionalFieldContainer = el)}\n >\n {this.additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {this.additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\">\n <p class=\"dynamic-text\" aria-live=\"polite\">\n {this.dynamicText}\n </p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n this.additionalFieldDisplay === \"static\",\n }}\n >\n <slot name=\"additional-field\"></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|