@ukic/web-components 2.24.0 → 2.25.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-80016ff7.js → helpers-4af10d35.js} +4 -2
- package/dist/cjs/helpers-4af10d35.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +3 -3
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +17 -1
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +8 -2
- package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/ic-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +24 -2
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +26 -2
- package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +12 -3
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +20 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -1
- 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 +3 -3
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +17 -1
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +2 -2
- 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-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +4 -4
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +2 -2
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +3 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +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 +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +3 -4
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +3 -3
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +2 -2
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-accordion/ic-accordion.css +7 -2
- package/dist/collection/components/ic-accordion/ic-accordion.js +1 -1
- package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -1
- package/dist/collection/components/ic-accordion/test/basic/ic-accordion.spec.js +2 -2
- package/dist/collection/components/ic-accordion/test/basic/ic-accordion.spec.js.map +1 -1
- package/dist/collection/components/ic-accordion-group/ic-accordion-group.css +2 -2
- package/dist/collection/components/ic-alert/ic-alert.js +18 -2
- package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
- package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js +15 -0
- package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js.map +1 -1
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.js +7 -1
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.js.map +1 -1
- package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.css +1 -1
- package/dist/collection/components/ic-button/ic-button.js +14 -1
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-button/test/basic/ic-button.spec.js +19 -0
- package/dist/collection/components/ic-button/test/basic/ic-button.spec.js.map +1 -1
- package/dist/collection/components/ic-card/ic-card.css +7 -2
- package/dist/collection/components/ic-card/ic-card.js +26 -2
- package/dist/collection/components/ic-card/ic-card.js.map +1 -1
- package/dist/collection/components/ic-card/test/basic/ic-card.spec.js +21 -0
- package/dist/collection/components/ic-card/test/basic/ic-card.spec.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +12 -3
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/test/basic/ic-classification-banner.spec.js +48 -0
- package/dist/collection/components/ic-classification-banner/test/basic/ic-classification-banner.spec.js.map +1 -1
- package/dist/collection/components/ic-empty-state/ic-empty-state.js +21 -2
- package/dist/collection/components/ic-empty-state/ic-empty-state.js.map +1 -1
- package/dist/collection/components/ic-footer/ic-footer.js +1 -1
- package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
- package/dist/collection/components/ic-footer-link/ic-footer-link.css +1 -1
- package/dist/collection/components/ic-footer-link/ic-footer-link.js +1 -1
- package/dist/collection/components/ic-footer-link/ic-footer-link.js.map +1 -1
- package/dist/collection/components/ic-footer-link/test/basic/ic-footer-link.spec.js +2 -18
- package/dist/collection/components/ic-footer-link/test/basic/ic-footer-link.spec.js.map +1 -1
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.js +2 -2
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.js.map +1 -1
- package/dist/collection/components/ic-footer-link-group/test/basic/ic-footer-link-group.spec.js +2 -34
- package/dist/collection/components/ic-footer-link-group/test/basic/ic-footer-link-group.spec.js.map +1 -1
- package/dist/collection/components/ic-hero/ic-hero.js +18 -2
- package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
- package/dist/collection/components/ic-hero/test/basic/ic-hero.spec.js +15 -0
- package/dist/collection/components/ic-hero/test/basic/ic-hero.spec.js.map +1 -1
- package/dist/collection/components/ic-link/ic-link.css +1 -1
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js +2 -2
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-menu-item/test/basic/ic-menu-item.spec.js +2 -2
- package/dist/collection/components/ic-menu-item/test/basic/ic-menu-item.spec.js.map +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.js +3 -3
- package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
- package/dist/collection/components/ic-page-header/test/basic/ic-page-header.spec.js +7 -0
- package/dist/collection/components/ic-page-header/test/basic/ic-page-header.spec.js.map +1 -1
- package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.e2e.js +2 -2
- package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.e2e.js.map +1 -1
- package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.spec.js +2 -2
- package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.spec.js.map +1 -1
- package/dist/collection/components/ic-select/test/basic/ic-select.spec.js +1 -1
- 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.js +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-status-tag/ic-status-tag.css +10 -0
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +5 -4
- package/dist/collection/components/ic-status-tag/ic-status-tag.js.map +1 -1
- package/dist/collection/components/ic-status-tag/test/basic/ic-status-tag.spec.js +2 -2
- package/dist/collection/components/ic-status-tag/test/basic/ic-status-tag.spec.js.map +1 -1
- package/dist/collection/components/ic-stepper/ic-stepper.js +1 -1
- package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
- package/dist/collection/components/ic-tab/ic-tab.js +1 -1
- package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +2 -2
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.js +4 -5
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js +2 -2
- package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js.map +1 -1
- package/dist/collection/components/ic-text-field/test/basic/ic-text-field.textarea.spec.js +4 -4
- package/dist/collection/components/ic-text-field/test/basic/ic-text-field.textarea.spec.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +29 -0
- package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +2 -2
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-typography/ic-typography.css +1 -1
- package/dist/collection/components/ic-typography/test/basic/ic-typography.e2e.js +1 -1
- package/dist/collection/components/ic-typography/test/basic/ic-typography.e2e.js.map +1 -1
- package/dist/collection/components/ic-typography/test/basic/ic-typography.spec.js +1 -1
- package/dist/collection/components/ic-typography/test/basic/ic-typography.spec.js.map +1 -1
- package/dist/collection/utils/helpers.js +3 -1
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/components/helpers.js +4 -2
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-accordion-group.js +1 -1
- package/dist/components/ic-accordion-group.js.map +1 -1
- package/dist/components/ic-accordion.js +2 -2
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-alert2.js +18 -2
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-back-to-top.js +8 -2
- package/dist/components/ic-back-to-top.js.map +1 -1
- package/dist/components/ic-badge.js +1 -1
- package/dist/components/ic-breadcrumb-group.js +1 -1
- package/dist/components/ic-breadcrumb2.js +1 -1
- package/dist/components/ic-breadcrumb2.js.map +1 -1
- package/dist/components/ic-button2.js +14 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card.js +27 -3
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +1 -1
- package/dist/components/ic-checkbox.js +1 -1
- package/dist/components/ic-chip.js +1 -1
- package/dist/components/ic-classification-banner.js +12 -3
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-empty-state.js +21 -2
- package/dist/components/ic-empty-state.js.map +1 -1
- package/dist/components/ic-footer-link-group.js +3 -3
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js +3 -3
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +2 -2
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +18 -2
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-label2.js +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-link2.js +1 -1
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +1 -1
- package/dist/components/ic-navigation-group.js +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-page-header.js +4 -4
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-popover-menu.js +1 -1
- package/dist/components/ic-radio-group.js +1 -1
- package/dist/components/ic-radio-option.js +1 -1
- package/dist/components/ic-search-bar.js +1 -1
- package/dist/components/ic-select.js +1 -1
- package/dist/components/ic-side-navigation.js +2 -2
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-status-tag.js +2 -1
- package/dist/components/ic-status-tag.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-tab-context.js +2 -2
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab.js +1 -1
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js +3 -4
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-tooltip2.js +11 -1
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +3 -3
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-typography2.js +1 -1
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-910ab8e5.entry.js → p-014342a2.entry.js} +2 -2
- package/dist/core/p-03434b02.entry.js +2 -0
- package/dist/core/p-03434b02.entry.js.map +1 -0
- package/dist/core/{p-072a5366.entry.js → p-038a2ea1.entry.js} +2 -2
- package/dist/core/{p-e3675a83.entry.js → p-08781606.entry.js} +2 -2
- package/dist/core/p-08781606.entry.js.map +1 -0
- package/dist/core/{p-e4f0fc68.entry.js → p-0a2cdf34.entry.js} +2 -2
- package/dist/core/{p-bf70fe93.entry.js → p-13f2c9dc.entry.js} +2 -2
- package/dist/core/{p-bf70fe93.entry.js.map → p-13f2c9dc.entry.js.map} +1 -1
- package/dist/core/p-14c47aed.entry.js +2 -0
- package/dist/core/p-14c47aed.entry.js.map +1 -0
- package/dist/core/{p-96f92fdc.entry.js → p-15138df1.entry.js} +2 -2
- package/dist/core/p-15138df1.entry.js.map +1 -0
- package/dist/core/{p-af439ab9.entry.js → p-191d2571.entry.js} +2 -2
- package/dist/core/{p-cc3f2353.entry.js → p-1d9fceb1.entry.js} +2 -2
- package/dist/core/{p-4c5eafd6.entry.js → p-1e33ac04.entry.js} +2 -2
- package/dist/core/p-1e33ac04.entry.js.map +1 -0
- package/dist/core/p-1eb6fc19.entry.js +2 -0
- package/dist/core/p-1eb6fc19.entry.js.map +1 -0
- package/dist/core/p-1ef00a47.entry.js +2 -0
- package/dist/core/p-1ef00a47.entry.js.map +1 -0
- package/dist/core/{p-de8d16f8.entry.js → p-1f4698e7.entry.js} +2 -2
- package/dist/core/{p-81d3b43b.entry.js → p-24e6c926.entry.js} +2 -2
- package/dist/core/p-261debaf.entry.js +2 -0
- package/dist/core/p-261debaf.entry.js.map +1 -0
- package/dist/core/{p-8df60639.entry.js → p-277c3199.entry.js} +2 -2
- package/dist/core/{p-65ddd1b0.entry.js → p-2bc8a51d.entry.js} +2 -2
- package/dist/core/p-2bc8a51d.entry.js.map +1 -0
- package/dist/core/{p-a5dd7065.js → p-36cd5d32.js} +2 -2
- package/dist/core/p-36cd5d32.js.map +1 -0
- package/dist/core/{p-d79a1565.entry.js → p-37d152b9.entry.js} +2 -2
- package/dist/core/p-37d152b9.entry.js.map +1 -0
- package/dist/core/{p-4661ee3b.entry.js → p-3b41756e.entry.js} +2 -2
- package/dist/core/{p-4c97f1e6.entry.js → p-41b93fc2.entry.js} +2 -2
- package/dist/core/p-4a64ec92.entry.js +2 -0
- package/dist/core/p-4a64ec92.entry.js.map +1 -0
- package/dist/core/{p-6167880d.entry.js → p-4a9eecd7.entry.js} +2 -2
- package/dist/core/p-4a9eecd7.entry.js.map +1 -0
- package/dist/core/{p-7ce6fb3b.entry.js → p-4ad38ad7.entry.js} +2 -2
- package/dist/core/{p-d4e6c64e.entry.js → p-4ecf210f.entry.js} +2 -2
- package/dist/core/p-4ecf210f.entry.js.map +1 -0
- package/dist/core/{p-b85c5581.entry.js → p-5128fc04.entry.js} +2 -2
- package/dist/core/{p-6fdc8bef.entry.js → p-59732bc5.entry.js} +2 -2
- package/dist/core/{p-deebcbe3.entry.js → p-5bba7e31.entry.js} +2 -2
- package/dist/core/p-6a4a0752.entry.js +2 -0
- package/dist/core/p-6a4a0752.entry.js.map +1 -0
- package/dist/core/{p-a0e94ddd.entry.js → p-6e36ff34.entry.js} +2 -2
- package/dist/core/{p-3cc52cbc.entry.js → p-6fae7e1f.entry.js} +2 -2
- package/dist/core/{p-3cc52cbc.entry.js.map → p-6fae7e1f.entry.js.map} +1 -1
- package/dist/core/{p-a399de54.entry.js → p-70a7cfa5.entry.js} +2 -2
- package/dist/core/{p-1c654ddd.entry.js → p-7e5936a3.entry.js} +2 -2
- package/dist/core/{p-a340a923.entry.js → p-80b87940.entry.js} +2 -2
- package/dist/core/p-80b87940.entry.js.map +1 -0
- package/dist/core/{p-74176f4c.entry.js → p-85f6a2ef.entry.js} +2 -2
- package/dist/core/{p-c623e1b0.entry.js → p-8ce2dfd4.entry.js} +2 -2
- package/dist/core/{p-8619c625.entry.js → p-92b9b56a.entry.js} +2 -2
- package/dist/core/{p-21885256.entry.js → p-967d5546.entry.js} +2 -2
- package/dist/core/{p-a3fa8e25.entry.js → p-98708868.entry.js} +2 -2
- package/dist/core/p-98708868.entry.js.map +1 -0
- package/dist/core/{p-09a2f6ff.entry.js → p-a332f7d8.entry.js} +2 -2
- package/dist/core/{p-c9efaee1.entry.js → p-a646c117.entry.js} +2 -2
- package/dist/core/{p-c9efaee1.entry.js.map → p-a646c117.entry.js.map} +1 -1
- package/dist/core/{p-5443b79a.entry.js → p-a8aea311.entry.js} +2 -2
- package/dist/core/{p-8d98835c.entry.js → p-a9a2987c.entry.js} +2 -2
- package/dist/core/{p-984e07a2.entry.js → p-bb2f2048.entry.js} +2 -2
- package/dist/core/{p-984e07a2.entry.js.map → p-bb2f2048.entry.js.map} +1 -1
- package/dist/core/p-c1db024d.entry.js +2 -0
- package/dist/core/p-c1db024d.entry.js.map +1 -0
- package/dist/core/{p-cbb92eb0.entry.js → p-cf3a721c.entry.js} +2 -2
- package/dist/core/{p-9419b840.entry.js → p-d19d50b6.entry.js} +2 -2
- package/dist/core/{p-2e8aaf89.entry.js → p-d69f353b.entry.js} +2 -2
- package/dist/core/p-e735d773.entry.js +2 -0
- package/dist/core/p-e735d773.entry.js.map +1 -0
- package/dist/core/{p-f807e600.entry.js → p-e928928a.entry.js} +2 -2
- package/dist/core/{p-b3178032.entry.js → p-ea61b524.entry.js} +2 -2
- package/dist/core/{p-4e6c5e80.entry.js → p-eb1d00a7.entry.js} +2 -2
- package/dist/core/{p-9128a8e0.entry.js → p-f13195ab.entry.js} +2 -2
- package/dist/core/{p-9128a8e0.entry.js.map → p-f13195ab.entry.js.map} +1 -1
- package/dist/core/{p-de7c0f2c.entry.js → p-f861a72a.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-988ce06b.js → helpers-354dbb8d.js} +5 -3
- package/dist/esm/helpers-354dbb8d.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +2 -2
- package/dist/esm/ic-accordion-group.entry.js.map +1 -1
- package/dist/esm/ic-accordion.entry.js +3 -3
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +18 -2
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +8 -2
- package/dist/esm/ic-back-to-top.entry.js.map +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +2 -2
- package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js +24 -2
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card.entry.js +27 -3
- package/dist/esm/ic-card.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +1 -1
- package/dist/esm/ic-chip.entry.js +1 -1
- package/dist/esm/ic-classification-banner.entry.js +12 -3
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +21 -2
- package/dist/esm/ic-empty-state.entry.js.map +1 -1
- 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 +3 -3
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +2 -2
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +18 -2
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +1 -1
- package/dist/esm/ic-input-label_2.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +2 -2
- 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-item.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +4 -4
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination.entry.js +1 -1
- package/dist/esm/ic-popover-menu.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-select.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js +2 -2
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +3 -2
- package/dist/esm/ic-status-tag.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +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 +1 -1
- package/dist/esm/ic-tab-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +2 -2
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-text-field.entry.js +3 -4
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js +3 -3
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +2 -2
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-alert/ic-alert.d.ts +3 -0
- package/dist/types/components/ic-back-to-top/ic-back-to-top.d.ts +1 -0
- package/dist/types/components/ic-button/ic-button.d.ts +2 -0
- package/dist/types/components/ic-card/ic-card.d.ts +2 -0
- package/dist/types/components/ic-empty-state/ic-empty-state.d.ts +3 -0
- package/dist/types/components/ic-hero/ic-hero.d.ts +3 -0
- package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +1 -1
- package/dist/types/components/ic-status-tag/ic-status-tag.d.ts +2 -2
- package/dist/types/components/ic-stepper/ic-stepper.d.ts +1 -1
- package/dist/types/components/ic-tab-context/ic-tab-context.d.ts +1 -1
- package/dist/types/components/ic-text-field/ic-text-field.d.ts +2 -2
- package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +4 -0
- package/dist/types/components.d.ts +9 -8
- package/dist/types/utils/helpers.d.ts +1 -1
- package/hydrate/index.js +139 -32
- package/package.json +2 -2
- package/vscode-data.json +6 -3
- package/dist/cjs/helpers-80016ff7.js.map +0 -1
- package/dist/collection/components/ic-navigation-menu/test/basic/ic-navigation-menu.e2e.js +0 -29
- package/dist/collection/components/ic-navigation-menu/test/basic/ic-navigation-menu.e2e.js.map +0 -1
- package/dist/core/p-04f98d04.entry.js +0 -2
- package/dist/core/p-04f98d04.entry.js.map +0 -1
- package/dist/core/p-2eb95212.entry.js +0 -2
- package/dist/core/p-2eb95212.entry.js.map +0 -1
- package/dist/core/p-4c5eafd6.entry.js.map +0 -1
- package/dist/core/p-4d1490ce.entry.js +0 -2
- package/dist/core/p-4d1490ce.entry.js.map +0 -1
- package/dist/core/p-6167880d.entry.js.map +0 -1
- package/dist/core/p-65ddd1b0.entry.js.map +0 -1
- package/dist/core/p-7e801198.entry.js +0 -2
- package/dist/core/p-7e801198.entry.js.map +0 -1
- package/dist/core/p-905e4232.entry.js +0 -2
- package/dist/core/p-905e4232.entry.js.map +0 -1
- package/dist/core/p-96f92fdc.entry.js.map +0 -1
- package/dist/core/p-a2704b98.entry.js +0 -2
- package/dist/core/p-a2704b98.entry.js.map +0 -1
- package/dist/core/p-a340a923.entry.js.map +0 -1
- package/dist/core/p-a3fa8e25.entry.js.map +0 -1
- package/dist/core/p-a5dd7065.js.map +0 -1
- package/dist/core/p-c532b8bd.entry.js +0 -2
- package/dist/core/p-c532b8bd.entry.js.map +0 -1
- package/dist/core/p-d4e6c64e.entry.js.map +0 -1
- package/dist/core/p-d79a1565.entry.js.map +0 -1
- package/dist/core/p-defa21f5.entry.js +0 -2
- package/dist/core/p-defa21f5.entry.js.map +0 -1
- package/dist/core/p-e3675a83.entry.js.map +0 -1
- package/dist/core/p-e5a6218b.entry.js +0 -2
- package/dist/core/p-e5a6218b.entry.js.map +0 -1
- package/dist/esm/helpers-988ce06b.js.map +0 -1
- /package/dist/core/{p-910ab8e5.entry.js.map → p-014342a2.entry.js.map} +0 -0
- /package/dist/core/{p-072a5366.entry.js.map → p-038a2ea1.entry.js.map} +0 -0
- /package/dist/core/{p-e4f0fc68.entry.js.map → p-0a2cdf34.entry.js.map} +0 -0
- /package/dist/core/{p-af439ab9.entry.js.map → p-191d2571.entry.js.map} +0 -0
- /package/dist/core/{p-cc3f2353.entry.js.map → p-1d9fceb1.entry.js.map} +0 -0
- /package/dist/core/{p-de8d16f8.entry.js.map → p-1f4698e7.entry.js.map} +0 -0
- /package/dist/core/{p-81d3b43b.entry.js.map → p-24e6c926.entry.js.map} +0 -0
- /package/dist/core/{p-8df60639.entry.js.map → p-277c3199.entry.js.map} +0 -0
- /package/dist/core/{p-4661ee3b.entry.js.map → p-3b41756e.entry.js.map} +0 -0
- /package/dist/core/{p-4c97f1e6.entry.js.map → p-41b93fc2.entry.js.map} +0 -0
- /package/dist/core/{p-7ce6fb3b.entry.js.map → p-4ad38ad7.entry.js.map} +0 -0
- /package/dist/core/{p-b85c5581.entry.js.map → p-5128fc04.entry.js.map} +0 -0
- /package/dist/core/{p-6fdc8bef.entry.js.map → p-59732bc5.entry.js.map} +0 -0
- /package/dist/core/{p-deebcbe3.entry.js.map → p-5bba7e31.entry.js.map} +0 -0
- /package/dist/core/{p-a0e94ddd.entry.js.map → p-6e36ff34.entry.js.map} +0 -0
- /package/dist/core/{p-a399de54.entry.js.map → p-70a7cfa5.entry.js.map} +0 -0
- /package/dist/core/{p-1c654ddd.entry.js.map → p-7e5936a3.entry.js.map} +0 -0
- /package/dist/core/{p-74176f4c.entry.js.map → p-85f6a2ef.entry.js.map} +0 -0
- /package/dist/core/{p-c623e1b0.entry.js.map → p-8ce2dfd4.entry.js.map} +0 -0
- /package/dist/core/{p-8619c625.entry.js.map → p-92b9b56a.entry.js.map} +0 -0
- /package/dist/core/{p-21885256.entry.js.map → p-967d5546.entry.js.map} +0 -0
- /package/dist/core/{p-09a2f6ff.entry.js.map → p-a332f7d8.entry.js.map} +0 -0
- /package/dist/core/{p-5443b79a.entry.js.map → p-a8aea311.entry.js.map} +0 -0
- /package/dist/core/{p-8d98835c.entry.js.map → p-a9a2987c.entry.js.map} +0 -0
- /package/dist/core/{p-cbb92eb0.entry.js.map → p-cf3a721c.entry.js.map} +0 -0
- /package/dist/core/{p-9419b840.entry.js.map → p-d19d50b6.entry.js.map} +0 -0
- /package/dist/core/{p-2e8aaf89.entry.js.map → p-d69f353b.entry.js.map} +0 -0
- /package/dist/core/{p-f807e600.entry.js.map → p-e928928a.entry.js.map} +0 -0
- /package/dist/core/{p-b3178032.entry.js.map → p-ea61b524.entry.js.map} +0 -0
- /package/dist/core/{p-4e6c5e80.entry.js.map → p-eb1d00a7.entry.js.map} +0 -0
- /package/dist/core/{p-de7c0f2c.entry.js.map → p-f861a72a.entry.js.map} +0 -0
@@ -267,7 +267,7 @@ describe("ic-accordion snapshots", () => {
|
|
267
267
|
page.rootInstance.expandedContentEl = accordionExpanded;
|
268
268
|
page.rootInstance.expandedContentEl.clientHeight = 0;
|
269
269
|
await page.rootInstance.hideExpandedContent(transitionEvent, page.rootInstance.expandedContentEl);
|
270
|
-
expect(page.rootInstance.expandedContentEl.style.getPropertyValue("--ic-expanded-content-
|
270
|
+
expect(page.rootInstance.expandedContentEl.style.getPropertyValue("--ic-expanded-content-visibility")).toBe("hidden");
|
271
271
|
});
|
272
272
|
it("should set visibility to undefined if client height is greater than 0", async () => {
|
273
273
|
const transitionEvent = {
|
@@ -286,7 +286,7 @@ describe("ic-accordion snapshots", () => {
|
|
286
286
|
page.rootInstance.expandedContentEl = accordionExpanded;
|
287
287
|
page.rootInstance.expandedContentEl.clientHeight = 50;
|
288
288
|
await page.rootInstance.hideExpandedContent(transitionEvent, page.rootInstance.expandedContentEl);
|
289
|
-
expect(page.rootInstance.expandedContentEl.style.getPropertyValue("--ic-expanded-content-
|
289
|
+
expect(page.rootInstance.expandedContentEl.style.getPropertyValue("--ic-expanded-content-visibility")).toBe("");
|
290
290
|
});
|
291
291
|
it("should call 'setFocus' when accordion can be focused", async () => {
|
292
292
|
const page = await newSpecPage({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-accordion.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-accordion/test/basic/ic-accordion.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAA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Y,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAEzD,MAAM,CAAC,sBAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Accordion } from \"../../ic-accordion\";\n\ndescribe(\"ic-accordion snapshots\", () => {\n it(\"should match default snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n `,\n });\n expect(page.root).toMatchSnapshot(\"renders as default\");\n });\n\n it(\"should match light snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders as light\");\n });\n\n it(\"should match with icon snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <svg\n slot=\"icon\"\n width=\"20\"\n height=\"1em\"\n viewBox=\"0 0 512 512\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z\"\n />\n </svg>\n <ic-typography variant=\"body\">\n This is an example of the main body text\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders with icon\");\n });\n\n it(\"should render with slot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" size=\"small\">\n <slot>This is an example of the main body text.</slot>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders small accordion\");\n });\n\n it(\"should match small snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" size=\"small\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders small accordion\");\n });\n\n it(\"should match large snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion size=\"large\" heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders large accordion\");\n });\n\n it(\"should render with a heading slot when supplied\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: ` \n <ic-accordion>\n <slot name=\"heading\"/></slot>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders with heading slot\");\n });\n\n it(\"should render in a disabled state\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" disabled>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"disabled\");\n });\n\n describe(\"ic-accordion component\", () => {\n it(\"it should test the toggleExpanded function\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n expect(page.root.expanded).toBe(false);\n await page.rootInstance.toggleExpanded();\n await page.waitForChanges();\n expect(page.root.expanded).toBe(true);\n });\n\n it(\"should test id number is added to accordion\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n const eventSpy = jest.fn();\n\n const accordionId = page.root.id;\n page.root.addEventListener(\"accordionClicked\", eventSpy);\n await page.waitForChanges();\n await page.rootInstance.toggleExpanded();\n await page.waitForChanges();\n\n expect(eventSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n detail: expect.objectContaining({\n id: accordionId,\n }),\n })\n );\n });\n\n it(\"it should test the disabled function\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" disabled>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root.disabled).toBe(true);\n });\n\n it(\"it should add transition styling to the element\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" disabled>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n const div = document.createElement(\"div\");\n page.rootInstance.setAccordionAnimation(div, \"300\", \"height\", \"ease-out\");\n expect(div.style.transitionDuration).toBe(\"300ms\");\n expect(div.style.transitionProperty).toBe(\"height\");\n expect(div.style.transitionDelay).toBe(\"ease-out\");\n });\n\n it(\"it should call setAccordionAnimation if scroll height > 0 and expanded = true\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" expanded>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const spySetAccordionAnimation = jest.spyOn(\n page.rootInstance,\n \"setAccordionAnimation\"\n );\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n Object.defineProperty(\n page.rootInstance.expandedContentEl,\n \"scrollHeight\",\n { configurable: true, value: 500 }\n );\n page.rootInstance.animateExpandedContent();\n\n expect(spySetAccordionAnimation).toHaveBeenCalled();\n });\n\n it(\"it should call setAccordionAnimation if scroll height = '500' and expanded = 'false'\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n const spySetAccordionAnimation = jest.spyOn(\n page.rootInstance,\n \"setAccordionAnimation\"\n );\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n\n Object.defineProperty(\n page.rootInstance.expandedContentEl,\n \"scrollHeight\",\n { configurable: true, value: 500 }\n );\n page.rootInstance.animateExpandedContent();\n expect(spySetAccordionAnimation).toHaveBeenCalled();\n });\n\n it(\"should set height and .expanded-content-opened on expanded content\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 50;\n\n await page.rootInstance.setExpandedContentStyle(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n page.rootInstance.expandedContentEl.className.split(\" \")\n ).toContain(\"expanded-content-opened\");\n expect(page.rootInstance.expandedContentEl.style.height).toBe(\"auto\");\n });\n\n it(\"should not set height and .expanded-content-opened on expanded content\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 0;\n\n await page.rootInstance.setExpandedContentStyle(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n page.rootInstance.expandedContentEl.className.split(\" \")\n ).not.toContain(\"expanded-content-opened\");\n expect(page.rootInstance.expandedContentEl.style.height).toBe(\"\");\n\n await page.rootInstance.disconnectedCallback();\n });\n\n it(\"should set visibility on expanded content to hidden\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 0;\n\n await page.rootInstance.hideExpandedContent(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n (\n page.rootInstance.expandedContentEl as HTMLDivElement\n ).style.getPropertyValue(\"--ic-expanded-content-visiblity\")\n ).toBe(\"hidden\");\n });\n\n it(\"should set visibility to undefined if client height is greater than 0\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 50;\n\n await page.rootInstance.hideExpandedContent(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n (\n page.rootInstance.expandedContentEl as HTMLDivElement\n ).style.getPropertyValue(\"--ic-expanded-content-visiblity\")\n ).toBe(\"\");\n });\n\n it(\"should call 'setFocus' when accordion can be focused\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\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 call setExpandedContentStyle when transitionend in animateExpandedContent and expanded is true\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const setExpandedContentStyleSpy = jest.spyOn(\n page.rootInstance,\n \"setExpandedContentStyle\"\n );\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.scrollHeight = 50;\n page.rootInstance.expanded = true;\n\n await page.rootInstance.animateExpandedContent();\n\n const event = new Event(\"transitionend\");\n page.rootInstance.expandedContentEl.dispatchEvent(event);\n\n expect(setExpandedContentStyleSpy).toHaveBeenCalled();\n });\n\n it(\"should call hideExpandedContent when transitionend in animateExpandedContent and expanded is false\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const hideExpandedContentSpy = jest.spyOn(\n page.rootInstance,\n \"hideExpandedContent\"\n );\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.scrollHeight = 50;\n page.rootInstance.expanded = false;\n\n await page.rootInstance.animateExpandedContent();\n\n const event = new Event(\"transitionend\");\n page.rootInstance.expandedContentEl.dispatchEvent(event);\n\n expect(hideExpandedContentSpy).toHaveBeenCalled();\n });\n });\n});\n"]}
|
1
|
+
{"version":3,"file":"ic-accordion.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-accordion/test/basic/ic-accordion.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE;;;;;;OAML;SACF,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE;;;;;sBAKU;SACjB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE;;;;;;;;;;;;;;;;;sBAiBU;SACjB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7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AAC;YAEnC,MAAM,IAAI,CAAC,YAAY,CAAC,sBAAsB,EAAE,CAAC;YAEjD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACzC,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAEzD,MAAM,CAAC,sBAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Accordion } from \"../../ic-accordion\";\n\ndescribe(\"ic-accordion snapshots\", () => {\n it(\"should match default snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>\n `,\n });\n expect(page.root).toMatchSnapshot(\"renders as default\");\n });\n\n it(\"should match light snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders as light\");\n });\n\n it(\"should match with icon snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <svg\n slot=\"icon\"\n width=\"20\"\n height=\"1em\"\n viewBox=\"0 0 512 512\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z\"\n />\n </svg>\n <ic-typography variant=\"body\">\n This is an example of the main body text\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders with icon\");\n });\n\n it(\"should render with slot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" size=\"small\">\n <slot>This is an example of the main body text.</slot>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders small accordion\");\n });\n\n it(\"should match small snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" size=\"small\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders small accordion\");\n });\n\n it(\"should match large snapshot\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion size=\"large\" heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders large accordion\");\n });\n\n it(\"should render with a heading slot when supplied\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: ` \n <ic-accordion>\n <slot name=\"heading\"/></slot>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"renders with heading slot\");\n });\n\n it(\"should render in a disabled state\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" disabled>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root).toMatchSnapshot(\"disabled\");\n });\n\n describe(\"ic-accordion component\", () => {\n it(\"it should test the toggleExpanded function\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n expect(page.root.expanded).toBe(false);\n await page.rootInstance.toggleExpanded();\n await page.waitForChanges();\n expect(page.root.expanded).toBe(true);\n });\n\n it(\"should test id number is added to accordion\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\">\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n const eventSpy = jest.fn();\n\n const accordionId = page.root.id;\n page.root.addEventListener(\"accordionClicked\", eventSpy);\n await page.waitForChanges();\n await page.rootInstance.toggleExpanded();\n await page.waitForChanges();\n\n expect(eventSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n detail: expect.objectContaining({\n id: accordionId,\n }),\n })\n );\n });\n\n it(\"it should test the disabled function\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" disabled>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n expect(page.root.disabled).toBe(true);\n });\n\n it(\"it should add transition styling to the element\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" disabled>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n const div = document.createElement(\"div\");\n page.rootInstance.setAccordionAnimation(div, \"300\", \"height\", \"ease-out\");\n expect(div.style.transitionDuration).toBe(\"300ms\");\n expect(div.style.transitionProperty).toBe(\"height\");\n expect(div.style.transitionDelay).toBe(\"ease-out\");\n });\n\n it(\"it should call setAccordionAnimation if scroll height > 0 and expanded = true\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" expanded>\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const spySetAccordionAnimation = jest.spyOn(\n page.rootInstance,\n \"setAccordionAnimation\"\n );\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n Object.defineProperty(\n page.rootInstance.expandedContentEl,\n \"scrollHeight\",\n { configurable: true, value: 500 }\n );\n page.rootInstance.animateExpandedContent();\n\n expect(spySetAccordionAnimation).toHaveBeenCalled();\n });\n\n it(\"it should call setAccordionAnimation if scroll height = '500' and expanded = 'false'\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n const spySetAccordionAnimation = jest.spyOn(\n page.rootInstance,\n \"setAccordionAnimation\"\n );\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n\n Object.defineProperty(\n page.rootInstance.expandedContentEl,\n \"scrollHeight\",\n { configurable: true, value: 500 }\n );\n page.rootInstance.animateExpandedContent();\n expect(spySetAccordionAnimation).toHaveBeenCalled();\n });\n\n it(\"should set height and .expanded-content-opened on expanded content\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 50;\n\n await page.rootInstance.setExpandedContentStyle(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n page.rootInstance.expandedContentEl.className.split(\" \")\n ).toContain(\"expanded-content-opened\");\n expect(page.rootInstance.expandedContentEl.style.height).toBe(\"auto\");\n });\n\n it(\"should not set height and .expanded-content-opened on expanded content\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 0;\n\n await page.rootInstance.setExpandedContentStyle(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n page.rootInstance.expandedContentEl.className.split(\" \")\n ).not.toContain(\"expanded-content-opened\");\n expect(page.rootInstance.expandedContentEl.style.height).toBe(\"\");\n\n await page.rootInstance.disconnectedCallback();\n });\n\n it(\"should set visibility on expanded content to hidden\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 0;\n\n await page.rootInstance.hideExpandedContent(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n (\n page.rootInstance.expandedContentEl as HTMLDivElement\n ).style.getPropertyValue(\"--ic-expanded-content-visibility\")\n ).toBe(\"hidden\");\n });\n\n it(\"should set visibility to undefined if client height is greater than 0\", async () => {\n const transitionEvent = {\n propertyName: \"height\",\n } as TransitionEvent;\n\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.clientHeight = 50;\n\n await page.rootInstance.hideExpandedContent(\n transitionEvent,\n page.rootInstance.expandedContentEl\n );\n\n expect(\n (\n page.rootInstance.expandedContentEl as HTMLDivElement\n ).style.getPropertyValue(\"--ic-expanded-content-visibility\")\n ).toBe(\"\");\n });\n\n it(\"should call 'setFocus' when accordion can be focused\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\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 call setExpandedContentStyle when transitionend in animateExpandedContent and expanded is true\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const setExpandedContentStyleSpy = jest.spyOn(\n page.rootInstance,\n \"setExpandedContentStyle\"\n );\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.scrollHeight = 50;\n page.rootInstance.expanded = true;\n\n await page.rootInstance.animateExpandedContent();\n\n const event = new Event(\"transitionend\");\n page.rootInstance.expandedContentEl.dispatchEvent(event);\n\n expect(setExpandedContentStyleSpy).toHaveBeenCalled();\n });\n\n it(\"should call hideExpandedContent when transitionend in animateExpandedContent and expanded is false\", async () => {\n const page = await newSpecPage({\n components: [Accordion],\n html: `\n <ic-accordion heading=\"Accordion 1\" >\n <ic-typography variant=\"body\">\n This is an example of the main body text.\n </ic-typography>\n </ic-accordion>`,\n });\n\n const hideExpandedContentSpy = jest.spyOn(\n page.rootInstance,\n \"hideExpandedContent\"\n );\n\n const accordionExpanded =\n page.root.shadowRoot.querySelector(\".expanded-content\");\n page.rootInstance.expandedContentEl = accordionExpanded;\n page.rootInstance.expandedContentEl.scrollHeight = 50;\n page.rootInstance.expanded = false;\n\n await page.rootInstance.animateExpandedContent();\n\n const event = new Event(\"transitionend\");\n page.rootInstance.expandedContentEl.dispatchEvent(event);\n\n expect(hideExpandedContentSpy).toHaveBeenCalled();\n });\n });\n});\n"]}
|
@@ -457,9 +457,9 @@ video {
|
|
457
457
|
}
|
458
458
|
|
459
459
|
:host(.light) {
|
460
|
-
color: var(--ic-
|
460
|
+
color: var(--ic-color-white-text);
|
461
461
|
}
|
462
462
|
|
463
463
|
:host(.accordion-group.dark) ::slotted(ic-accordion) {
|
464
|
-
color: var(--ic-
|
464
|
+
color: var(--ic-color-white-text);
|
465
465
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Host, h, } from "@stencil/core";
|
1
|
+
import { Host, h, forceUpdate, } from "@stencil/core";
|
2
2
|
import closeIcon from "../../assets/close-icon.svg";
|
3
|
-
import { isSlotUsed } from "../../utils/helpers";
|
3
|
+
import { isSlotUsed, checkSlotInChildMutations } from "../../utils/helpers";
|
4
4
|
import { IcThemeForegroundEnum } from "../../utils/types";
|
5
5
|
import { VARIANT_ICONS } from "../../utils/constants";
|
6
6
|
/**
|
@@ -9,10 +9,18 @@ import { VARIANT_ICONS } from "../../utils/constants";
|
|
9
9
|
*/
|
10
10
|
export class Alert {
|
11
11
|
constructor() {
|
12
|
+
this.hostMutationObserver = null;
|
12
13
|
this.dismissAction = () => {
|
13
14
|
this.dismiss.emit();
|
14
15
|
this.icDismiss.emit();
|
15
16
|
};
|
17
|
+
this.hostMutationCallback = (mutationList) => {
|
18
|
+
if (mutationList.some(({ type, addedNodes, removedNodes }) => type === "childList"
|
19
|
+
? checkSlotInChildMutations(addedNodes, removedNodes, "action")
|
20
|
+
: false)) {
|
21
|
+
forceUpdate(this);
|
22
|
+
}
|
23
|
+
};
|
16
24
|
this.alertTitleWrap = false;
|
17
25
|
this.visible = true;
|
18
26
|
this.announced = true;
|
@@ -22,8 +30,16 @@ export class Alert {
|
|
22
30
|
this.titleAbove = false;
|
23
31
|
this.variant = "neutral";
|
24
32
|
}
|
33
|
+
disconnectedCallback() {
|
34
|
+
var _a;
|
35
|
+
(_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
36
|
+
}
|
25
37
|
componentDidLoad() {
|
26
38
|
this.alertTitleShouldWrap();
|
39
|
+
this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
|
40
|
+
this.hostMutationObserver.observe(this.el, {
|
41
|
+
childList: true,
|
42
|
+
});
|
27
43
|
}
|
28
44
|
handleClick() {
|
29
45
|
this.visible = !this.visible;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-alert.js","sourceRoot":"","sources":["../../../src/components/ic-alert/ic-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,CAAC,
|
1
|
+
{"version":3,"file":"ic-alert.js","sourceRoot":"","sources":["../../../src/components/ic-alert/ic-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,CAAC,EACD,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAoB,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;GAGG;AAMH,MAAM,OAAO,KAAK;;QACR,yBAAoB,GAAqB,IAAI,CAAC;QAiE9C,kBAAa,GAAG,GAAS,EAAE;YACjC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC;QAQ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EAAC,QAAQ,GAAG,CAClB,CACP,CACG;gBACN,WAAK,KAAK,EAAC,wBAAwB,IAChC,WAAW,IAAI,CACd,iBACE,KAAK,EAAE;wBACL,CAAC,eAAe,CAAC,EAAE,IAAI;wBACvB,CAAC,cAAc,CAAC,EAAE,IAAI;qBACvB,EACD,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,OAAO,EAAC,MAAM,EACd,UAAU,EAAE,qBAAqB,CAAC,IAAI,EACtC,KAAK,EAAC,SAAS,GACJ,CACd,CACG,CACF,CACD,CACR,CACF,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n State,\n Listen,\n Prop,\n h,\n forceUpdate,\n} from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport { isSlotUsed, checkSlotInChildMutations } from \"../../utils/helpers\";\nimport { IcThemeForegroundEnum, IcStatusVariants } from \"../../utils/types\";\nimport { VARIANT_ICONS } from \"../../utils/constants\";\n\n/**\n * @slot message - Content is placed to the right of the title.\n * @slot action - Content is placed to the right of the message.\n */\n@Component({\n tag: \"ic-alert\",\n styleUrl: \"ic-alert.css\",\n shadow: true,\n})\nexport class Alert {\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcAlertElement;\n\n @State() alertTitleWrap: boolean = false;\n @State() visible: boolean = true;\n\n /**\n * If `true`, the alert will have the 'alert' ARIA role and will be announced to screen readers.\n */\n @Prop() announced?: boolean = true;\n\n /**\n * If `true`, the alert will have a close icon at the end to dismiss it.\n */\n @Prop() dismissible?: boolean = false;\n\n /**\n * The optional title to display at the start of the alert.\n */\n @Prop() heading?: string = \"\";\n\n /**\n * The main body message of the alert.\n */\n @Prop() message?: string;\n\n /**\n * If `true`, the title and message will appear above and below instead of inline.\n */\n @Prop() titleAbove?: boolean = false;\n\n /**\n * The variant of the alert which will be rendered.\n */\n @Prop() variant?: IcStatusVariants = \"neutral\";\n\n /**\n * @deprecated This event should not be used anymore. Use icDismiss instead.\n */\n @Event() dismiss: EventEmitter<void>;\n\n /**\n * Is emitted when the user dismisses the alert.\n */\n @Event() icDismiss: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n componentDidLoad(): void {\n this.alertTitleShouldWrap();\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n @Listen(\"icDismiss\", { capture: true })\n handleClick(): void {\n this.visible = !this.visible;\n }\n\n private dismissAction = (): void => {\n this.dismiss.emit();\n this.icDismiss.emit();\n };\n\n private alertTitleShouldWrap() {\n const titleHeight =\n this.el.shadowRoot.querySelector(\".alert-title\")?.clientHeight;\n if (titleHeight > 24) this.alertTitleWrap = true;\n }\n\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n if (\n mutationList.some(({ type, addedNodes, removedNodes }) =>\n type === \"childList\"\n ? checkSlotInChildMutations(addedNodes, removedNodes, \"action\")\n : false\n )\n ) {\n forceUpdate(this);\n }\n };\n\n render() {\n const {\n variant,\n heading,\n message,\n titleAbove,\n dismissible,\n announced,\n visible,\n } = this;\n\n return (\n visible && (\n <Host\n role={announced ? \"alert\" : null}\n class={{\n [IcThemeForegroundEnum.Dark]: true,\n }}\n >\n <div\n class={{\n [\"container\"]: true,\n [`container-${variant}`]: true,\n }}\n >\n <div class=\"alert-icon-container\">\n <div\n class={{\n [\"divider\"]: true,\n [`divider-${variant}`]: true,\n }}\n ></div>\n <span\n class={{\n [\"alert-icon\"]: true,\n [\"svg-container\"]: true,\n [`icon-${variant}`]: true,\n }}\n innerHTML={VARIANT_ICONS[variant].icon}\n ></span>\n </div>\n <div class=\"alert-content\">\n <div\n class={{\n [\"alert-message\"]: true,\n [\"alert-message-title-above\"]:\n titleAbove || this.alertTitleWrap,\n }}\n >\n {heading && (\n <ic-typography\n class={{\n [\"alert-title\"]: true,\n [\"alert-title-above\"]: titleAbove || this.alertTitleWrap,\n }}\n variant=\"subtitle-large\"\n >\n <p>{heading}</p>\n </ic-typography>\n )}\n <slot name=\"message\">\n <ic-typography variant=\"body\">{message}</ic-typography>\n </slot>\n </div>\n {isSlotUsed(this.el, \"action\") && (\n <div class=\"alert-action-container\">\n <slot name=\"action\" />\n </div>\n )}\n </div>\n <div class=\"dismiss-icon-container\">\n {dismissible && (\n <ic-button\n class={{\n [\"svg-container\"]: true,\n [\"dismiss-icon\"]: true,\n }}\n innerHTML={closeIcon}\n onClick={this.dismissAction}\n variant=\"icon\"\n appearance={IcThemeForegroundEnum.Dark}\n title=\"dismiss\"\n ></ic-button>\n )}\n </div>\n </div>\n </Host>\n )\n );\n }\n}\n"]}
|
@@ -178,5 +178,20 @@ describe("ic-alert component", () => {
|
|
178
178
|
alert = await page.root.shadowRoot.querySelector("div.container-neutral");
|
179
179
|
expect(alert).toBeNull();
|
180
180
|
});
|
181
|
+
it("should test rendering an action after initial render", async () => {
|
182
|
+
const page = await newSpecPage({
|
183
|
+
components: [Alert],
|
184
|
+
html: `<ic-alert heading="Test heading"></ic-alert>`,
|
185
|
+
});
|
186
|
+
const action = document.createElement("button");
|
187
|
+
action.setAttribute("slot", "action");
|
188
|
+
page.rootInstance.hostMutationCallback([
|
189
|
+
{
|
190
|
+
type: "childList",
|
191
|
+
addedNodes: [action],
|
192
|
+
removedNodes: [],
|
193
|
+
},
|
194
|
+
]);
|
195
|
+
});
|
181
196
|
});
|
182
197
|
//# sourceMappingURL=ic-alert.spec.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-alert.spec.js","sourceRoot":"","sources":["../../../../../src/components/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AAC,QAAQ,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Alert } from \"../../ic-alert\";\n\ndescribe(\"ic-alert component\", () => {\n it(\"should render with a heading when supplied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert heading=\"Test heading\"></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" heading=\"Test heading\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <ic-typography class=\"alert-title\" variant=\"subtitle-large\">\n <p>\n Test heading\n </p>\n </ic-typography>\n <slot name=\"message\">\n <ic-typography variant=\"body\"></ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n </div>\n </div>\n </mock:shadow-root>\n </ic-alert>`);\n });\n\n it(\"should render with a message when supplied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"Test message\"></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" message=\"Test message\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <slot name=\"message\">\n <ic-typography variant=\"body\">\n Test message\n </ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n </div>\n </div>\n </mock:shadow-root>\n </ic-alert>`);\n });\n\n it(\"should render an action in the correct position when supplied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"This has an action\"><button slot=\"action\"></button></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" message=\"This has an action\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <slot name=\"message\">\n <ic-typography variant=\"body\">\n This has an action\n </ic-typography>\n </slot>\n </div>\n <div class=\"alert-action-container\">\n <slot name=\"action\"></slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n </div>\n </div>\n </mock:shadow-root>\n <button slot=\"action\"></button>\n </ic-alert>`);\n });\n\n it(\"should render with a dismiss icon when the prop is applied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"This is dismissible\" dismissible=true></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" message=\"This is dismissible\" dismissible=true role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <slot name=\"message\">\n <ic-typography variant=\"body\">\n This is dismissible\n </ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n <ic-button appearance=\"dark\" class=\"dismiss-icon svg-container\" title=\"dismiss\" variant=\"icon\">\n svg\n </ic-button>\n </div>\n </div>\n </mock:shadow-root>\n </ic-alert>`);\n });\n\n it(\"should render an element in the message slot\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert heading=\"Using custom message\"><ic-typography variant=\"h1\" slot=\"message\">Custom h1 message</ic-typography></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" heading=\"Using custom message\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <ic-typography class=\"alert-title\" variant=\"subtitle-large\">\n <p>\n Using custom message\n </p>\n </ic-typography>\n <slot name=\"message\">\n <ic-typography variant=\"body\"></ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\"></div>\n </div>\n </mock:shadow-root>\n <ic-typography variant=\"h1\" slot=\"message\">Custom h1 message</ic-typography>\n </ic-alert>`);\n });\n\n it(\"should close on dismiss icon click\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"This is dismissible\" dismissible=true></ic-alert>`,\n });\n\n let alert = await page.root.shadowRoot.querySelector(\n \"div.container-neutral\"\n );\n const dismissButton = await page.root.shadowRoot.querySelector(\"ic-button\");\n\n expect(alert).not.toBeNull();\n expect(dismissButton).not.toBeNull();\n\n await dismissButton.click();\n\n await page.waitForChanges();\n alert = await page.root.shadowRoot.querySelector(\"div.container-neutral\");\n\n expect(alert).toBeNull();\n });\n});\n"]}
|
1
|
+
{"version":3,"file":"ic-alert.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-alert/test/basic/ic-alert.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,8CAA8C;SACrD,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;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AAC,MAAM,CAAC;gBACpB,YAAY,EAAE,EAAE;aACjB;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Alert } from \"../../ic-alert\";\n\ndescribe(\"ic-alert component\", () => {\n it(\"should render with a heading when supplied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert heading=\"Test heading\"></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" heading=\"Test heading\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <ic-typography class=\"alert-title\" variant=\"subtitle-large\">\n <p>\n Test heading\n </p>\n </ic-typography>\n <slot name=\"message\">\n <ic-typography variant=\"body\"></ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n </div>\n </div>\n </mock:shadow-root>\n </ic-alert>`);\n });\n\n it(\"should render with a message when supplied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"Test message\"></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" message=\"Test message\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <slot name=\"message\">\n <ic-typography variant=\"body\">\n Test message\n </ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n </div>\n </div>\n </mock:shadow-root>\n </ic-alert>`);\n });\n\n it(\"should render an action in the correct position when supplied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"This has an action\"><button slot=\"action\"></button></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" message=\"This has an action\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <slot name=\"message\">\n <ic-typography variant=\"body\">\n This has an action\n </ic-typography>\n </slot>\n </div>\n <div class=\"alert-action-container\">\n <slot name=\"action\"></slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n </div>\n </div>\n </mock:shadow-root>\n <button slot=\"action\"></button>\n </ic-alert>`);\n });\n\n it(\"should render with a dismiss icon when the prop is applied\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"This is dismissible\" dismissible=true></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" message=\"This is dismissible\" dismissible=true role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <slot name=\"message\">\n <ic-typography variant=\"body\">\n This is dismissible\n </ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\">\n <ic-button appearance=\"dark\" class=\"dismiss-icon svg-container\" title=\"dismiss\" variant=\"icon\">\n svg\n </ic-button>\n </div>\n </div>\n </mock:shadow-root>\n </ic-alert>`);\n });\n\n it(\"should render an element in the message slot\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert heading=\"Using custom message\"><ic-typography variant=\"h1\" slot=\"message\">Custom h1 message</ic-typography></ic-alert>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-alert class=\"dark\" heading=\"Using custom message\" role=\"alert\">\n <mock:shadow-root>\n <div class=\"container container-neutral\">\n <div class=\"alert-icon-container\">\n <div class=\"divider divider-neutral\"></div>\n <span class=\"alert-icon icon-neutral svg-container\">\n svg\n </span>\n </div>\n <div class=\"alert-content\">\n <div class=\"alert-message\">\n <ic-typography class=\"alert-title\" variant=\"subtitle-large\">\n <p>\n Using custom message\n </p>\n </ic-typography>\n <slot name=\"message\">\n <ic-typography variant=\"body\"></ic-typography>\n </slot>\n </div>\n </div>\n <div class=\"dismiss-icon-container\"></div>\n </div>\n </mock:shadow-root>\n <ic-typography variant=\"h1\" slot=\"message\">Custom h1 message</ic-typography>\n </ic-alert>`);\n });\n\n it(\"should close on dismiss icon click\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert message=\"This is dismissible\" dismissible=true></ic-alert>`,\n });\n\n let alert = await page.root.shadowRoot.querySelector(\n \"div.container-neutral\"\n );\n const dismissButton = await page.root.shadowRoot.querySelector(\"ic-button\");\n\n expect(alert).not.toBeNull();\n expect(dismissButton).not.toBeNull();\n\n await dismissButton.click();\n\n await page.waitForChanges();\n alert = await page.root.shadowRoot.querySelector(\"div.container-neutral\");\n\n expect(alert).toBeNull();\n });\n\n it(\"should test rendering an action after initial render\", async () => {\n const page = await newSpecPage({\n components: [Alert],\n html: `<ic-alert heading=\"Test heading\"></ic-alert>`,\n });\n\n const action = document.createElement(\"button\");\n action.setAttribute(\"slot\", \"action\");\n\n page.rootInstance.hostMutationCallback([\n {\n type: \"childList\",\n addedNodes: [action],\n removedNodes: [],\n },\n ]);\n });\n});\n"]}
|
@@ -5,6 +5,9 @@ const backToTopLabel = "Back to top";
|
|
5
5
|
export class BackToTop {
|
6
6
|
constructor() {
|
7
7
|
this.topObserver = null;
|
8
|
+
this.getObservedEl = () => {
|
9
|
+
return document.querySelector("#ic-back-to-top-target");
|
10
|
+
};
|
8
11
|
this.setTargetElVisible = (visible) => {
|
9
12
|
this.targetElVisible = visible;
|
10
13
|
};
|
@@ -37,7 +40,7 @@ export class BackToTop {
|
|
37
40
|
let objParent;
|
38
41
|
//remove old element & observer
|
39
42
|
if (this.topObserver !== null) {
|
40
|
-
const observedEl =
|
43
|
+
const observedEl = this.getObservedEl();
|
41
44
|
if (observedEl !== null) {
|
42
45
|
this.topObserver.unobserve(observedEl);
|
43
46
|
observedEl.remove();
|
@@ -55,6 +58,7 @@ export class BackToTop {
|
|
55
58
|
//insert a new 0px height element before specified target that can be used to determine when page is scrolled
|
56
59
|
const objBackToTopTargetEl = document.createElement("div");
|
57
60
|
objBackToTopTargetEl.setAttribute("id", "ic-back-to-top-target");
|
61
|
+
objBackToTopTargetEl.setAttribute("tabindex", "-1"); // Needed for virtual cursor behaviour to work
|
58
62
|
objParent.insertBefore(objBackToTopTargetEl, this.targetEl);
|
59
63
|
// resize observer needs to factor in any top margin on the target el
|
60
64
|
const marginTop = getComputedStyle(this.targetEl).marginTop;
|
@@ -71,6 +75,8 @@ export class BackToTop {
|
|
71
75
|
else {
|
72
76
|
this.targetEl.scrollIntoView();
|
73
77
|
}
|
78
|
+
// Get virtual cursor to move
|
79
|
+
this.getObservedEl().focus();
|
74
80
|
};
|
75
81
|
this.checkForClassificationBanner = () => {
|
76
82
|
//adjust position for classification banner at bottom
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-back-to-top.js","sourceRoot":"","sources":["../../../src/components/ic-back-to-top/ic-back-to-top.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EACL,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAG7B,MAAM,cAAc,GAAG,aAAa,CAAC;AASrC,MAAM,OAAO,SAAS;;QAGZ,gBAAW,GAAyB,IAAI,CAAC;QAwDzC,uBAAkB,GAAG,CAA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O,KAAK,MAAM,CAAC,CAAC,CAAC,CAC1B,kBAAY,KAAK,EAAE,cAAc,EAAE,SAAS,EAAC,KAAK,EAAC,KAAK,EAAC,aAAa,IACnE,WAAW,EAAE,CACH,CACd,CAAC,CAAC,CAAC,CACF,WAAW,EAAE,CACd,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Element, Prop, State, Watch } from \"@stencil/core\";\nimport ArrowUpward from \"./assets/ArrowUpward.svg\";\nimport {\n onComponentPropUndefinedChange,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcBackToTopVariants } from \"./ic-back-to-top.types\";\n\nconst backToTopLabel = \"Back to top\";\n\n@Component({\n tag: \"ic-back-to-top\",\n styleUrl: \"ic-back-to-top.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BackToTop {\n private isTargetElNull: boolean;\n private targetEl: Element;\n private topObserver: IntersectionObserver = null;\n\n @Element() el: HTMLIcBackToTopElement;\n\n @State() bannerOffset: boolean = false;\n @State() footerVisible: boolean = false;\n @State() targetElVisible: boolean = true;\n\n /**\n * The ID of the element to jump back to when the link is clicked.\n */\n @Prop() target!: string;\n\n /**\n * The variant of the button to render\n */\n @Prop() variant: IcBackToTopVariants = \"default\";\n\n @Watch(\"target\")\n watchPropHandler(newValue: string, oldValue: string): void {\n //added for gatsby rehydration issue where prop is initially undefined but then changes to actual value\n onComponentPropUndefinedChange(oldValue, newValue, () => {\n this.createTopObserver(newValue);\n });\n }\n\n componentWillLoad(): void {\n this.createTopObserver(this.target);\n this.checkForClassificationBanner();\n\n //observer for when footer scrolls into view\n let footers = document.querySelectorAll(\n \"ic-footer\"\n ) as NodeListOf<HTMLElement>;\n if (footers.length === 0) {\n footers = document.querySelectorAll(\"footer\");\n }\n\n if (footers.length) {\n const footerEl = footers[footers.length - 1];\n const threshold = this.bannerOffset ? 0.15 : 0;\n const footerObserver = new IntersectionObserver(\n this.footerObserverCallback,\n { threshold: [threshold] }\n );\n footerObserver.observe(footerEl);\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.target, propName: \"target\" }],\n \"Back to Top\"\n );\n }\n\n private setTargetElVisible = (visible: boolean) => {\n this.targetElVisible = visible;\n };\n\n private setFooterVisible = (visible: boolean) => {\n this.checkForClassificationBanner();\n this.footerVisible =\n typeof window !== \"undefined\" && window.scrollY === 0 ? false : visible;\n };\n\n private targetElObserverCallback = (entries: IntersectionObserverEntry[]) => {\n this.setTargetElVisible(entries[0].isIntersecting);\n };\n\n private footerObserverCallback = (entries: IntersectionObserverEntry[]) => {\n this.setFooterVisible(entries[0].isIntersecting);\n };\n\n private findTargetEl = (target: string): Element => {\n let targetElement: Element = null;\n if (target === null || target === undefined) {\n console.log(\n \"Error: No target ID specified for back to top component - defaulting to top of page\"\n );\n } else {\n targetElement = document.querySelector(\n `${target.startsWith(\"#\") ? \"\" : \"#\"}${target}`\n );\n if (targetElement === null) {\n console.log(\n `Error: Back to top target element '${target}' not found - defaulting to top of page`\n );\n }\n }\n return targetElement;\n };\n\n private createTopObserver = (target: string) => {\n this.targetEl = this.findTargetEl(target);\n let objParent: HTMLElement;\n\n //remove old element & observer\n if (this.topObserver !== null) {\n const observedEl = document.querySelector(\"#ic-back-to-top-target\");\n if (observedEl !== null) {\n this.topObserver.unobserve(observedEl);\n observedEl.remove();\n }\n }\n\n if (this.targetEl === null) {\n objParent = document.body;\n this.targetEl = objParent.firstElementChild;\n this.isTargetElNull = true;\n } else {\n objParent = this.targetEl.parentNode as HTMLElement;\n this.isTargetElNull = false;\n }\n\n //insert a new 0px height element before specified target that can be used to determine when page is scrolled\n const objBackToTopTargetEl = document.createElement(\"div\");\n objBackToTopTargetEl.setAttribute(\"id\", \"ic-back-to-top-target\");\n objParent.insertBefore(objBackToTopTargetEl, this.targetEl);\n\n // resize observer needs to factor in any top margin on the target el\n const marginTop = getComputedStyle(this.targetEl).marginTop;\n this.topObserver = new IntersectionObserver(this.targetElObserverCallback, {\n threshold: [0],\n rootMargin: `${marginTop} 0px 0px 0px`,\n });\n this.topObserver.observe(objBackToTopTargetEl);\n };\n\n private handleClick = () => {\n if (this.isTargetElNull) {\n window.scrollTo(0, 0);\n } else {\n this.targetEl.scrollIntoView();\n }\n };\n\n private checkForClassificationBanner = () => {\n //adjust position for classification banner at bottom\n const banners = document.querySelectorAll(\n \"ic-classification-banner:not([inline='true'])\"\n );\n this.bannerOffset = banners.length > 0;\n };\n\n private buildButton = () => {\n const { bannerOffset, targetElVisible, footerVisible, variant } = this;\n\n return (\n <button\n class={{\n [\"ic-back-to-top-link\"]: true,\n [\"offset-banner\"]: bannerOffset,\n [\"show\"]: !targetElVisible,\n [\"by-footer\"]: footerVisible,\n [\"positioning\"]: variant !== \"icon\",\n [\"icon-only\"]: variant === \"icon\",\n }}\n aria-label={backToTopLabel}\n onClick={this.handleClick}\n >\n <span class=\"ic-back-to-top-icon\" innerHTML={ArrowUpward} />\n\n {this.variant !== \"icon\" && (\n <ic-typography variant=\"subtitle-small\">\n <span>{backToTopLabel}</span>\n </ic-typography>\n )}\n </button>\n );\n };\n\n render() {\n const { variant, buildButton } = this;\n\n return variant === \"icon\" ? (\n <ic-tooltip label={backToTopLabel} placement=\"top\" class=\"positioning\">\n {buildButton()}\n </ic-tooltip>\n ) : (\n buildButton()\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-back-to-top.js","sourceRoot":"","sources":["../../../src/components/ic-back-to-top/ic-back-to-top.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EACL,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAG7B,MAAM,cAAc,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C,SAAS,CAAC,EAAE,CAC3B,CAAC;YACF,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,gCAAgC,CAC9B,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAC3C,aAAa,CACd,CAAC;IACJ,CAAC;IA6HD,MAAM;QACJ,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAEtC,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAC1B,kBAAY,KAAK,EAAE,cAAc,EAAE,SAAS,EAAC,KAAK,EAAC,KAAK,EAAC,aAAa,IACnE,WAAW,EAAE,CACH,CACd,CAAC,CAAC,CAAC,CACF,WAAW,EAAE,CACd,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Element, Prop, State, Watch } from \"@stencil/core\";\nimport ArrowUpward from \"./assets/ArrowUpward.svg\";\nimport {\n onComponentPropUndefinedChange,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcBackToTopVariants } from \"./ic-back-to-top.types\";\n\nconst backToTopLabel = \"Back to top\";\n\n@Component({\n tag: \"ic-back-to-top\",\n styleUrl: \"ic-back-to-top.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BackToTop {\n private isTargetElNull: boolean;\n private targetEl: Element;\n private topObserver: IntersectionObserver = null;\n\n @Element() el: HTMLIcBackToTopElement;\n\n @State() bannerOffset: boolean = false;\n @State() footerVisible: boolean = false;\n @State() targetElVisible: boolean = true;\n\n /**\n * The ID of the element to jump back to when the link is clicked.\n */\n @Prop() target!: string;\n\n /**\n * The variant of the button to render\n */\n @Prop() variant: IcBackToTopVariants = \"default\";\n\n @Watch(\"target\")\n watchPropHandler(newValue: string, oldValue: string): void {\n //added for gatsby rehydration issue where prop is initially undefined but then changes to actual value\n onComponentPropUndefinedChange(oldValue, newValue, () => {\n this.createTopObserver(newValue);\n });\n }\n\n componentWillLoad(): void {\n this.createTopObserver(this.target);\n this.checkForClassificationBanner();\n\n //observer for when footer scrolls into view\n let footers = document.querySelectorAll(\n \"ic-footer\"\n ) as NodeListOf<HTMLElement>;\n if (footers.length === 0) {\n footers = document.querySelectorAll(\"footer\");\n }\n\n if (footers.length) {\n const footerEl = footers[footers.length - 1];\n const threshold = this.bannerOffset ? 0.15 : 0;\n const footerObserver = new IntersectionObserver(\n this.footerObserverCallback,\n { threshold: [threshold] }\n );\n footerObserver.observe(footerEl);\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.target, propName: \"target\" }],\n \"Back to Top\"\n );\n }\n\n private getObservedEl = () => {\n return document.querySelector(\"#ic-back-to-top-target\");\n };\n\n private setTargetElVisible = (visible: boolean) => {\n this.targetElVisible = visible;\n };\n\n private setFooterVisible = (visible: boolean) => {\n this.checkForClassificationBanner();\n this.footerVisible =\n typeof window !== \"undefined\" && window.scrollY === 0 ? false : visible;\n };\n\n private targetElObserverCallback = (entries: IntersectionObserverEntry[]) => {\n this.setTargetElVisible(entries[0].isIntersecting);\n };\n\n private footerObserverCallback = (entries: IntersectionObserverEntry[]) => {\n this.setFooterVisible(entries[0].isIntersecting);\n };\n\n private findTargetEl = (target: string): Element => {\n let targetElement: Element = null;\n if (target === null || target === undefined) {\n console.log(\n \"Error: No target ID specified for back to top component - defaulting to top of page\"\n );\n } else {\n targetElement = document.querySelector(\n `${target.startsWith(\"#\") ? \"\" : \"#\"}${target}`\n );\n if (targetElement === null) {\n console.log(\n `Error: Back to top target element '${target}' not found - defaulting to top of page`\n );\n }\n }\n return targetElement;\n };\n\n private createTopObserver = (target: string) => {\n this.targetEl = this.findTargetEl(target);\n let objParent: HTMLElement;\n\n //remove old element & observer\n if (this.topObserver !== null) {\n const observedEl = this.getObservedEl();\n if (observedEl !== null) {\n this.topObserver.unobserve(observedEl);\n observedEl.remove();\n }\n }\n\n if (this.targetEl === null) {\n objParent = document.body;\n this.targetEl = objParent.firstElementChild;\n this.isTargetElNull = true;\n } else {\n objParent = this.targetEl.parentNode as HTMLElement;\n this.isTargetElNull = false;\n }\n\n //insert a new 0px height element before specified target that can be used to determine when page is scrolled\n const objBackToTopTargetEl = document.createElement(\"div\");\n objBackToTopTargetEl.setAttribute(\"id\", \"ic-back-to-top-target\");\n objBackToTopTargetEl.setAttribute(\"tabindex\", \"-1\"); // Needed for virtual cursor behaviour to work\n objParent.insertBefore(objBackToTopTargetEl, this.targetEl);\n\n // resize observer needs to factor in any top margin on the target el\n const marginTop = getComputedStyle(this.targetEl).marginTop;\n this.topObserver = new IntersectionObserver(this.targetElObserverCallback, {\n threshold: [0],\n rootMargin: `${marginTop} 0px 0px 0px`,\n });\n this.topObserver.observe(objBackToTopTargetEl);\n };\n\n private handleClick = () => {\n if (this.isTargetElNull) {\n window.scrollTo(0, 0);\n } else {\n this.targetEl.scrollIntoView();\n }\n // Get virtual cursor to move\n (this.getObservedEl() as HTMLElement).focus();\n };\n\n private checkForClassificationBanner = () => {\n //adjust position for classification banner at bottom\n const banners = document.querySelectorAll(\n \"ic-classification-banner:not([inline='true'])\"\n );\n this.bannerOffset = banners.length > 0;\n };\n\n private buildButton = () => {\n const { bannerOffset, targetElVisible, footerVisible, variant } = this;\n\n return (\n <button\n class={{\n [\"ic-back-to-top-link\"]: true,\n [\"offset-banner\"]: bannerOffset,\n [\"show\"]: !targetElVisible,\n [\"by-footer\"]: footerVisible,\n [\"positioning\"]: variant !== \"icon\",\n [\"icon-only\"]: variant === \"icon\",\n }}\n aria-label={backToTopLabel}\n onClick={this.handleClick}\n >\n <span class=\"ic-back-to-top-icon\" innerHTML={ArrowUpward} />\n\n {this.variant !== \"icon\" && (\n <ic-typography variant=\"subtitle-small\">\n <span>{backToTopLabel}</span>\n </ic-typography>\n )}\n </button>\n );\n };\n\n render() {\n const { variant, buildButton } = this;\n\n return variant === \"icon\" ? (\n <ic-tooltip label={backToTopLabel} placement=\"top\" class=\"positioning\">\n {buildButton()}\n </ic-tooltip>\n ) : (\n buildButton()\n );\n }\n}\n"]}
|
@@ -45,6 +45,11 @@ export class Button {
|
|
45
45
|
hiddenFormButton.remove();
|
46
46
|
}
|
47
47
|
};
|
48
|
+
this.handleKeyDown = (ev) => {
|
49
|
+
if (ev.key === "Escape" && this.hasTooltip) {
|
50
|
+
this.closeButtonTooltip(ev);
|
51
|
+
}
|
52
|
+
};
|
48
53
|
this.onFocus = () => {
|
49
54
|
this.icFocus.emit();
|
50
55
|
};
|
@@ -199,6 +204,14 @@ export class Button {
|
|
199
204
|
var _a;
|
200
205
|
(_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.focus();
|
201
206
|
}
|
207
|
+
async closeButtonTooltip(ev) {
|
208
|
+
const tooltip = this.el.shadowRoot.querySelector("ic-tooltip");
|
209
|
+
if (await tooltip.isTooltipVisible()) {
|
210
|
+
tooltip.displayTooltip(false);
|
211
|
+
ev.preventDefault();
|
212
|
+
ev.stopImmediatePropagation();
|
213
|
+
}
|
214
|
+
}
|
202
215
|
hasIconSlot(position) {
|
203
216
|
const selectorPrefix = position ? `${position}-` : "";
|
204
217
|
return this.el.querySelector(`[slot="${selectorPrefix}icon"]`) !== null;
|
@@ -286,7 +299,7 @@ export class Button {
|
|
286
299
|
["white-background"]: this.variant === "secondary" &&
|
287
300
|
!this.transparentBackground &&
|
288
301
|
this.appearance !== "light",
|
289
|
-
}, onClick: this.handleClick, "aria-owns": this.ariaOwnsId, "aria-controls": this.ariaControlsId, "aria-expanded": this.dropdown && `${this.dropdownExpanded}` }, this.hasTooltip && (h("ic-tooltip", { id: describedby, label: title || ariaLabel, target: buttonId, placement: this.tooltipPlacement, silent: this.variant === "icon" && !!ariaLabel }, this.hasRouterSlot() ? (h("slot", { name: "router-item" })) : (h(ButtonContent, null)))), isSlotUsed(this.el, "badge") && h("slot", { name: "badge" }), !this.hasTooltip &&
|
302
|
+
}, onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-owns": this.ariaOwnsId, "aria-controls": this.ariaControlsId, "aria-expanded": this.dropdown && `${this.dropdownExpanded}` }, this.hasTooltip && (h("ic-tooltip", { id: describedby, label: title || ariaLabel, target: buttonId, placement: this.tooltipPlacement, silent: this.variant === "icon" && !!ariaLabel }, this.hasRouterSlot() ? (h("slot", { name: "router-item" })) : (h(ButtonContent, null)))), isSlotUsed(this.el, "badge") && h("slot", { name: "badge" }), !this.hasTooltip &&
|
290
303
|
(this.hasRouterSlot() ? (h("slot", { name: "router-item" })) : (h(ButtonContent, null))), this.describedByContent && (h("span", { id: describedby, class: "ic-button-describedby" }, this.describedByContent))));
|
291
304
|
}
|
292
305
|
static get is() { return "ic-button"; }
|