@ukic/web-components 2.0.1 → 2.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +2 -2
- package/dist/cjs/core.cjs.js.map +1 -1
- package/dist/cjs/{helpers-d0eeccf0.js → helpers-8bc3b6d2.js} +83 -38
- package/dist/cjs/helpers-8bc3b6d2.js.map +1 -0
- package/dist/cjs/ic-alert.cjs.entry.js +2 -2
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -2
- package/dist/cjs/ic-back-to-top.cjs.entry.js.map +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 +56 -17
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +16 -3
- 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 +5 -4
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-entity.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +2 -2
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
- 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 +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +3 -3
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +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-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.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 +2 -2
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +27 -13
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +2 -2
- package/dist/cjs/ic-select.cjs.entry.js.map +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-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +1 -9
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +2 -2
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +0 -4
- package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +1 -5
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +2 -2
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +19 -11
- package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +2 -2
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/index-3ef30d9d.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/types-3eb02246.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ic-alert/ic-alert.css +10 -4
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.css +6 -0
- package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.css +7 -1
- package/dist/collection/components/ic-button/ic-button.css +12 -1
- package/dist/collection/components/ic-card/ic-card.css +7 -2
- package/dist/collection/components/ic-card/ic-card.js +23 -2
- package/dist/collection/components/ic-card/ic-card.js.map +1 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.css +37 -0
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +4 -3
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.css +6 -0
- package/dist/collection/components/ic-data-entity/ic-data-entity.css +6 -0
- package/dist/collection/components/ic-data-row/ic-data-row.css +7 -1
- package/dist/collection/components/ic-footer/ic-footer.css +6 -0
- package/dist/collection/components/ic-footer-link/ic-footer-link.css +18 -2
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.css +2 -2
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.css +19 -0
- package/dist/collection/components/ic-link/ic-link.css +11 -2
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.css +56 -101
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js +53 -12
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js.map +1 -1
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.types.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.css +9 -2
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +6 -2
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +5 -5
- package/dist/collection/components/ic-radio-option/ic-radio-option.css +29 -10
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +26 -12
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.css +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +13 -2
- package/dist/collection/components/ic-skeleton/ic-skeleton.css +8 -0
- package/dist/collection/components/ic-status-tag/ic-status-tag.css +8 -0
- package/dist/collection/components/ic-step/ic-step.css +36 -1
- package/dist/collection/components/ic-step/ic-step.js +4 -11
- package/dist/collection/components/ic-step/ic-step.js.map +1 -1
- package/dist/collection/components/ic-switch/ic-switch.css +30 -0
- package/dist/collection/components/ic-tab/ic-tab.css +12 -2
- package/dist/collection/components/ic-tab/ic-tab.js +2 -6
- package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.css +1 -1
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -6
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.css +11 -0
- package/dist/collection/components/ic-theme/ic-theme.js +21 -11
- package/dist/collection/components/ic-theme/ic-theme.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.css +6 -0
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +4 -2
- package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +92 -79
- package/dist/collection/utils/constants.js +9 -0
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/collection/utils/helpers.js +68 -35
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers.js +78 -36
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-alert.js +1 -1
- package/dist/components/ic-alert.js.map +1 -1
- package/dist/components/ic-back-to-top.js +1 -1
- package/dist/components/ic-back-to-top.js.map +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 +2 -2
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card.js +19 -4
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +1 -1
- package/dist/components/ic-checkbox.js +5 -4
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-classification-banner.js +1 -1
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-entity.js +1 -1
- package/dist/components/ic-data-entity.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-footer-link-group.js +2 -2
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js +2 -2
- 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 +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-input-label2.js +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-link2.js +2 -2
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js +53 -14
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu2.js +1 -1
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +1 -1
- package/dist/components/ic-navigation-group.js +2 -2
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +2 -2
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-radio-group.js +1 -1
- package/dist/components/ic-radio-option.js +2 -2
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +27 -13
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-select.js +2 -2
- package/dist/components/ic-select.js.map +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-skeleton.js +1 -1
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-status-tag.js +1 -1
- package/dist/components/ic-status-tag.js.map +1 -1
- package/dist/components/ic-step.js +1 -8
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-switch.js +2 -2
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-group.js.map +1 -1
- package/dist/components/ic-tab-panel.js +0 -4
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-tab.js +1 -5
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js +2 -2
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +19 -11
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-tooltip2.js +5 -3
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +2 -2
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/types.js.map +1 -1
- package/dist/core/core.css +12 -12
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-9c1f2861.entry.js → p-0118400b.entry.js} +2 -2
- package/dist/core/p-0118400b.entry.js.map +1 -0
- package/dist/core/{p-0992a2ee.entry.js → p-02799e26.entry.js} +2 -2
- package/dist/core/p-02799e26.entry.js.map +1 -0
- package/dist/core/{p-972f4e69.entry.js → p-07cd789d.entry.js} +2 -2
- package/dist/core/{p-972f4e69.entry.js.map → p-07cd789d.entry.js.map} +1 -1
- package/dist/core/{p-48029498.entry.js → p-0b125f26.entry.js} +2 -2
- package/dist/core/{p-48029498.entry.js.map → p-0b125f26.entry.js.map} +0 -0
- package/dist/core/{p-3c6defd7.entry.js → p-10da19d2.entry.js} +2 -2
- package/dist/core/{p-3c6defd7.entry.js.map → p-10da19d2.entry.js.map} +0 -0
- package/dist/core/{p-6009c5bc.entry.js → p-1337db5e.entry.js} +2 -2
- package/dist/core/p-1337db5e.entry.js.map +1 -0
- package/dist/core/p-1721bcf3.entry.js +2 -0
- package/dist/core/p-1721bcf3.entry.js.map +1 -0
- package/dist/core/p-23831891.js +2 -0
- package/dist/core/p-23831891.js.map +1 -0
- package/dist/core/p-272c7abd.entry.js +2 -0
- package/dist/core/p-272c7abd.entry.js.map +1 -0
- package/dist/core/{p-ee3a9fd0.entry.js → p-2f114521.entry.js} +2 -2
- package/dist/core/{p-ee3a9fd0.entry.js.map → p-2f114521.entry.js.map} +0 -0
- package/dist/core/{p-54b77947.entry.js → p-31a8595f.entry.js} +2 -2
- package/dist/core/{p-54b77947.entry.js.map → p-31a8595f.entry.js.map} +0 -0
- package/dist/core/p-33a45ace.entry.js +2 -0
- package/dist/core/p-33a45ace.entry.js.map +1 -0
- package/dist/core/p-347ec49e.entry.js +2 -0
- package/dist/core/p-347ec49e.entry.js.map +1 -0
- package/dist/core/p-39ae284e.entry.js +2 -0
- package/dist/core/p-39ae284e.entry.js.map +1 -0
- package/dist/core/{p-bf4ddf33.entry.js → p-558552f8.entry.js} +2 -2
- package/dist/core/p-558552f8.entry.js.map +1 -0
- package/dist/core/p-5e261268.entry.js +2 -0
- package/dist/core/p-5e261268.entry.js.map +1 -0
- package/dist/core/p-60ffb73e.entry.js +2 -0
- package/dist/core/p-60ffb73e.entry.js.map +1 -0
- package/dist/core/p-69650186.entry.js +2 -0
- package/dist/core/p-69650186.entry.js.map +1 -0
- package/dist/core/{p-4b6a55bb.entry.js → p-6b34d98f.entry.js} +2 -2
- package/dist/core/p-6b34d98f.entry.js.map +1 -0
- package/dist/core/p-6f57b13c.js.map +1 -1
- package/dist/core/{p-a183353c.entry.js → p-6f6bd657.entry.js} +2 -2
- package/dist/core/{p-a183353c.entry.js.map → p-6f6bd657.entry.js.map} +0 -0
- package/dist/core/p-7093d214.entry.js +2 -0
- package/dist/core/p-7093d214.entry.js.map +1 -0
- package/dist/core/p-7b11e1dc.entry.js +2 -0
- package/dist/core/p-7b11e1dc.entry.js.map +1 -0
- package/dist/core/p-7b39977f.entry.js +2 -0
- package/dist/core/p-7b39977f.entry.js.map +1 -0
- package/dist/core/p-7f632414.entry.js +2 -0
- package/dist/core/p-7f632414.entry.js.map +1 -0
- package/dist/core/{p-59041cfc.entry.js → p-898607d0.entry.js} +2 -2
- package/dist/core/{p-59041cfc.entry.js.map → p-898607d0.entry.js.map} +0 -0
- package/dist/core/{p-c023c49c.entry.js → p-8ddeb574.entry.js} +2 -2
- package/dist/core/p-8ddeb574.entry.js.map +1 -0
- package/dist/core/{p-037273aa.entry.js → p-9cd04875.entry.js} +2 -2
- package/dist/core/{p-037273aa.entry.js.map → p-9cd04875.entry.js.map} +0 -0
- package/dist/core/{p-17d0d631.entry.js → p-ac43322e.entry.js} +2 -2
- package/dist/core/p-ac43322e.entry.js.map +1 -0
- package/dist/core/{p-eeff0f89.entry.js → p-ae81dffa.entry.js} +2 -2
- package/dist/core/p-ae81dffa.entry.js.map +1 -0
- package/dist/core/{p-1b619302.entry.js → p-b3dec76d.entry.js} +2 -2
- package/dist/core/{p-1b619302.entry.js.map → p-b3dec76d.entry.js.map} +0 -0
- package/dist/core/p-b5a988c0.entry.js +2 -0
- package/dist/core/p-b5a988c0.entry.js.map +1 -0
- package/dist/core/{p-0d63bfe4.entry.js → p-c4d3c18c.entry.js} +2 -2
- package/dist/core/{p-0d63bfe4.entry.js.map → p-c4d3c18c.entry.js.map} +0 -0
- package/dist/core/{p-9a3d6bca.entry.js → p-c6dd4f47.entry.js} +2 -2
- package/dist/core/p-c6dd4f47.entry.js.map +1 -0
- package/dist/core/p-cadb531f.entry.js +2 -0
- package/dist/core/p-cadb531f.entry.js.map +1 -0
- package/dist/core/p-cc83692e.entry.js +2 -0
- package/dist/core/p-cc83692e.entry.js.map +1 -0
- package/dist/core/{p-9db8edb7.entry.js → p-dd3c3e3c.entry.js} +2 -2
- package/dist/core/{p-9db8edb7.entry.js.map → p-dd3c3e3c.entry.js.map} +0 -0
- package/dist/core/p-df5caf13.entry.js +2 -0
- package/dist/core/p-df5caf13.entry.js.map +1 -0
- package/dist/core/p-e106305b.entry.js +2 -0
- package/dist/core/p-e106305b.entry.js.map +1 -0
- package/dist/core/p-e590f1d2.entry.js +2 -0
- package/dist/core/p-e590f1d2.entry.js.map +1 -0
- package/dist/core/{p-eb33ece2.entry.js → p-e93e9aa3.entry.js} +2 -2
- package/dist/core/p-e93e9aa3.entry.js.map +1 -0
- package/dist/core/p-ecfb2e6b.entry.js +2 -0
- package/dist/core/p-ecfb2e6b.entry.js.map +1 -0
- package/dist/core/p-f9370be6.js.map +1 -1
- package/dist/esm/core.js +2 -2
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/{helpers-e090fe7e.js → helpers-3d41833c.js} +79 -37
- package/dist/esm/helpers-3d41833c.js.map +1 -0
- package/dist/esm/ic-alert.entry.js +2 -2
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +2 -2
- package/dist/esm/ic-back-to-top.entry.js.map +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 +56 -17
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card.entry.js +16 -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 +5 -4
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +1 -1
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-entity.entry.js +1 -1
- package/dist/esm/ic-data-entity.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +2 -2
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +2 -2
- package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
- package/dist/esm/ic-footer-link.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +3 -3
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +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-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +2 -2
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +2 -2
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +2 -2
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +27 -13
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-select.entry.js +2 -2
- package/dist/esm/ic-select.entry.js.map +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-skeleton.entry.js +1 -1
- package/dist/esm/ic-skeleton.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +1 -9
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +2 -2
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +2 -2
- package/dist/esm/ic-tab-group.entry.js.map +1 -1
- package/dist/esm/ic-tab-panel.entry.js +0 -4
- package/dist/esm/ic-tab-panel.entry.js.map +1 -1
- package/dist/esm/ic-tab.entry.js +1 -5
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-text-field.entry.js +2 -2
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +19 -11
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +2 -2
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/index-1500de1f.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/types-dd515332.js.map +1 -1
- package/dist/types/components/ic-card/ic-card.d.ts +4 -0
- package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +1 -1
- package/dist/types/components/ic-loading-indicator/ic-loading-indicator.d.ts +8 -1
- package/dist/types/components/ic-loading-indicator/ic-loading-indicator.types.d.ts +5 -0
- package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +2 -0
- package/dist/types/components/ic-step/ic-step.d.ts +2 -3
- package/dist/types/components/ic-tab/ic-tab.d.ts +1 -2
- package/dist/types/components/ic-tab-panel/ic-tab-panel.d.ts +1 -2
- package/dist/types/components/ic-theme/ic-theme.d.ts +2 -1
- package/dist/types/components.d.ts +6 -6
- package/dist/types/utils/constants.d.ts +2 -0
- package/dist/types/utils/helpers.d.ts +15 -3
- package/dist/types/utils/types.d.ts +3 -0
- package/hydrate/index.d.ts +1 -1
- package/hydrate/index.js +234 -126
- package/package.json +8 -5
- package/dist/cjs/helpers-d0eeccf0.js.map +0 -1
- package/dist/core/p-0992a2ee.entry.js.map +0 -1
- package/dist/core/p-0e1ae2a3.entry.js +0 -2
- package/dist/core/p-0e1ae2a3.entry.js.map +0 -1
- package/dist/core/p-155114db.entry.js +0 -2
- package/dist/core/p-155114db.entry.js.map +0 -1
- package/dist/core/p-16ab85c2.entry.js +0 -2
- package/dist/core/p-16ab85c2.entry.js.map +0 -1
- package/dist/core/p-17d0d631.entry.js.map +0 -1
- package/dist/core/p-2f29e74d.entry.js +0 -2
- package/dist/core/p-2f29e74d.entry.js.map +0 -1
- package/dist/core/p-4b6a55bb.entry.js.map +0 -1
- package/dist/core/p-6009c5bc.entry.js.map +0 -1
- package/dist/core/p-7612cfb0.entry.js +0 -2
- package/dist/core/p-7612cfb0.entry.js.map +0 -1
- package/dist/core/p-7dbb637f.entry.js +0 -2
- package/dist/core/p-7dbb637f.entry.js.map +0 -1
- package/dist/core/p-89d46b9b.entry.js +0 -2
- package/dist/core/p-89d46b9b.entry.js.map +0 -1
- package/dist/core/p-9a3d6bca.entry.js.map +0 -1
- package/dist/core/p-9c1f2861.entry.js.map +0 -1
- package/dist/core/p-a23e9d8a.entry.js +0 -2
- package/dist/core/p-a23e9d8a.entry.js.map +0 -1
- package/dist/core/p-aad5da60.entry.js +0 -2
- package/dist/core/p-aad5da60.entry.js.map +0 -1
- package/dist/core/p-aad76be7.entry.js +0 -2
- package/dist/core/p-aad76be7.entry.js.map +0 -1
- package/dist/core/p-ac76594c.entry.js +0 -2
- package/dist/core/p-ac76594c.entry.js.map +0 -1
- package/dist/core/p-b596f73d.entry.js +0 -2
- package/dist/core/p-b596f73d.entry.js.map +0 -1
- package/dist/core/p-b875ec01.entry.js +0 -2
- package/dist/core/p-b875ec01.entry.js.map +0 -1
- package/dist/core/p-bf4ddf33.entry.js.map +0 -1
- package/dist/core/p-c023c49c.entry.js.map +0 -1
- package/dist/core/p-d4a1734e.entry.js +0 -2
- package/dist/core/p-d4a1734e.entry.js.map +0 -1
- package/dist/core/p-d61c2983.entry.js +0 -2
- package/dist/core/p-d61c2983.entry.js.map +0 -1
- package/dist/core/p-dd36d23a.entry.js +0 -2
- package/dist/core/p-dd36d23a.entry.js.map +0 -1
- package/dist/core/p-eb0f09f4.entry.js +0 -2
- package/dist/core/p-eb0f09f4.entry.js.map +0 -1
- package/dist/core/p-eb33ece2.entry.js.map +0 -1
- package/dist/core/p-eeff0f89.entry.js.map +0 -1
- package/dist/core/p-f228c232.js +0 -2
- package/dist/core/p-f228c232.js.map +0 -1
- package/dist/core/p-f7e7d4f5.entry.js +0 -2
- package/dist/core/p-f7e7d4f5.entry.js.map +0 -1
- package/dist/core/p-ffc4cae2.entry.js +0 -2
- package/dist/core/p-ffc4cae2.entry.js.map +0 -1
- package/dist/esm/helpers-e090fe7e.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ic-tab.js","sourceRoot":"","sources":["../../../src/components/ic-tab/ic-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,CAAC,GACF,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ic-tab.js","sourceR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ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\n/**\n * @slot icon - Content will be rendered next to the tab label.\n */\n@Component({\n tag: \"ic-tab\",\n styleUrl: \"ic-tab.css\",\n shadow: true,\n})\nexport class Tab {\n @Element() host: HTMLIcTabElement;\n\n /** @internal Provide a unique context if using multiple tabs inside one another i.e. rendering another tabs inside a tab panel. */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * Disables the tab.\n */\n @Prop() disabled?: boolean = false;\n\n /** @internal Will display a selected indicator and set tabIndex. */\n @Prop({ reflect: true }) selected?: boolean = false;\n\n /** @internal The shared ID between panel and tab. */\n @Prop({ reflect: true }) tabId?: string;\n\n /** @internal The position of the tab inside the tabs array in context. */\n @Prop() tabPosition?: number;\n\n /** @internal Determines whether the light or dark variant of the tabs should be displayed. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n /**\n * Called when a tab is selected.\n */\n @Event() tabClick: EventEmitter<IcTabClickEventDetail>;\n\n /**\n * @internal Called when a tab is focussed.\n */\n @Event() tabFocus: EventEmitter<IcTabClickEventDetail>;\n\n private isInitialRender: boolean = true;\n private focusFromClick: boolean = false;\n\n private handleClick = () => {\n this.tabClick.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n if (this.focusFromClick) {\n this.tabFocus.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n this.focusFromClick = false;\n }\n };\n\n private handleFocus = () => {\n if (!this.focusFromClick) {\n this.tabFocus.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n }\n };\n\n private handleMouseDown = () => {\n //set flag so that focus gets handled after click\n //there is a timing issue where a long click only causes focus to happen & not the click\n //the focus does need to be a seperate event though to handle focus from keyboard\n this.focusFromClick = true;\n };\n\n componentDidUpdate(): void {\n this.isInitialRender = false;\n }\n\n render() {\n const { disabled, selected, appearance } = this;\n return (\n <Host\n class={{\n [\"with-transition\"]: !this.isInitialRender,\n [\"ic-tab-light\"]: appearance === IcThemeForegroundEnum.Light,\n }}\n role=\"tab\"\n aria-selected={selected ? \"true\" : \"false\"}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onMouseDown={this.handleMouseDown}\n aria-disabled={disabled ? \"true\" : \"false\"}\n tabindex={this.selected ? 0 : -1}\n >\n {this.host.querySelector('[slot=\"icon\"]') && <slot name=\"icon\"></slot>}\n <ic-typography class=\"ic-tab-label\" variant=\"label\">\n <span>\n <slot></slot>\n </span>\n </ic-typography>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { onComponentRequiredPropUndefined } from "../../utils/helpers";
|
|
3
2
|
import { IcThemeForegroundEnum, } from "../../utils/types";
|
|
4
3
|
export class TabPanel {
|
|
5
4
|
constructor() {
|
|
@@ -9,9 +8,6 @@ export class TabPanel {
|
|
|
9
8
|
this.selectedTab = undefined;
|
|
10
9
|
this.appearance = "dark";
|
|
11
10
|
}
|
|
12
|
-
componentDidLoad() {
|
|
13
|
-
onComponentRequiredPropUndefined([{ prop: this.tabPosition, propName: "tab-position" }], "Tab Panel");
|
|
14
|
-
}
|
|
15
11
|
render() {
|
|
16
12
|
const { panelId, selectedTab, appearance } = this;
|
|
17
13
|
return (h(Host, { class: {
|
|
@@ -60,8 +56,8 @@ export class TabPanel {
|
|
|
60
56
|
"resolved": "number",
|
|
61
57
|
"references": {}
|
|
62
58
|
},
|
|
63
|
-
"required":
|
|
64
|
-
"optional":
|
|
59
|
+
"required": false,
|
|
60
|
+
"optional": true,
|
|
65
61
|
"docs": {
|
|
66
62
|
"tags": [{
|
|
67
63
|
"name": "internal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ic-tab-panel.js","sourceRoot":"","sources":["../../../src/components/ic-tab-panel/ic-tab-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"ic-tab-panel.js","sourceRoot":"","sources":["../../../src/components/ic-tab-panel/ic-tab-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EACL,qBAAqB,GAEtB,MAAM,mBAAmB,CAAC;AAO3B,MAAM,OAAO,QAAQ;;qBAM2B,SAAS;;;;sBAYL,MAAM;;EAExD,MAAM;IACJ,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClD,OAAO,CACL,EAAC,IAAI,IACH,KAAK,EAAE;QACL,CAAC,oBAAoB,CAAC,EAAE,UAAU,KAAK,qBAAqB,CAAC,KAAK;OACnE,EACD,IAAI,EAAC,UAAU,EACf,MAAM,EACJ,OAAO,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS;QAChD,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,WAAW,CAAC;QAC5B,CAAC,CAAC,IAAI;MAGV;QACE,eAAa,CACT,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, h } from \"@stencil/core\";\nimport {\n IcThemeForegroundEnum,\n IcThemeForegroundNoDefault,\n} from \"../../utils/types\";\n\n@Component({\n tag: \"ic-tab-panel\",\n styleUrl: \"ic-tab-panel.css\",\n shadow: true,\n})\nexport class TabPanel {\n @Element() host: HTMLIcTabPanelElement;\n\n /**\n * Provide a unique context if using multiple tabs inside one another i.e. rendering another tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /** @internal The position of the tab panel inside the tabs array in context. */\n @Prop({ reflect: true }) tabPosition?: number;\n\n /** @internal The shared ID that links the panel and tab. */\n @Prop({ reflect: true }) panelId?: string;\n\n /** @internal The shared ID of the currently selected tab. */\n @Prop() selectedTab?: string;\n\n /** @internal Determines whether the light or dark variant of the tabs should be displayed. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n render() {\n const { panelId, selectedTab, appearance } = this;\n return (\n <Host\n class={{\n [\"ic-tab-panel-light\"]: appearance === IcThemeForegroundEnum.Light,\n }}\n role=\"tabpanel\"\n hidden={\n panelId !== undefined && selectedTab !== undefined\n ? !(panelId === selectedTab)\n : true\n }\n >\n <div>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -554,3 +554,14 @@ input[type="search"].truncate-value {
|
|
|
554
554
|
white-space: nowrap;
|
|
555
555
|
text-overflow: ellipsis;
|
|
556
556
|
}
|
|
557
|
+
|
|
558
|
+
@media (forced-colors: active) {
|
|
559
|
+
input.readonly,
|
|
560
|
+
textarea.readonly {
|
|
561
|
+
color: canvastext;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.has-value ::slotted([slot="icon"]) {
|
|
565
|
+
fill: currentcolor;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
@@ -1,28 +1,38 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
|
-
import { getThemeForegroundColor,
|
|
2
|
+
import { getThemeForegroundColor, hexToRgba, rgbaStrToObj, } from "../../utils/helpers";
|
|
3
|
+
import { getThemeColorBrightness } from "../../utils/helpers";
|
|
4
|
+
import { BLACK_MIN_COLOR_BRIGHTNESS, WHITE_MAX_COLOR_BRIGHTNESS, } from "../../utils/constants";
|
|
3
5
|
export class Theme {
|
|
4
6
|
constructor() {
|
|
7
|
+
this.checkThemeColorContrast = () => {
|
|
8
|
+
if (getThemeColorBrightness() < BLACK_MIN_COLOR_BRIGHTNESS &&
|
|
9
|
+
getThemeColorBrightness() > WHITE_MAX_COLOR_BRIGHTNESS) {
|
|
10
|
+
console.warn(`The theme colour does not provide enough contrast with either of the ICDS black or white foreground colours. Consider choosing a colour with a different brightness to achieve sufficient colour contrast for good visibility. See https://www.w3.org/TR/AERT/#color-contrast for more information about colour contrast.`);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
5
13
|
this.setThemeColor = () => {
|
|
6
14
|
if (this.color !== null) {
|
|
7
|
-
let
|
|
15
|
+
let colorRGBA = null;
|
|
8
16
|
const firstChar = this.color.slice(0, 1);
|
|
9
17
|
if (firstChar === "#") {
|
|
10
|
-
|
|
18
|
+
colorRGBA = hexToRgba(this.color);
|
|
11
19
|
}
|
|
12
20
|
else if (firstChar.toLowerCase() === "r") {
|
|
13
|
-
|
|
21
|
+
colorRGBA = rgbaStrToObj(this.color);
|
|
14
22
|
}
|
|
15
|
-
this.
|
|
23
|
+
this.setThemeRGBA(colorRGBA);
|
|
16
24
|
}
|
|
17
25
|
};
|
|
18
|
-
this.
|
|
19
|
-
if (
|
|
26
|
+
this.setThemeRGBA = (colorRGBA) => {
|
|
27
|
+
if (colorRGBA !== null) {
|
|
20
28
|
const root = document.documentElement;
|
|
21
|
-
root.style.setProperty("--ic-theme-primary-r",
|
|
22
|
-
root.style.setProperty("--ic-theme-primary-g",
|
|
23
|
-
root.style.setProperty("--ic-theme-primary-b",
|
|
29
|
+
root.style.setProperty("--ic-theme-primary-r", colorRGBA.r.toString());
|
|
30
|
+
root.style.setProperty("--ic-theme-primary-g", colorRGBA.g.toString());
|
|
31
|
+
root.style.setProperty("--ic-theme-primary-b", colorRGBA.b.toString());
|
|
32
|
+
root.style.setProperty("--ic-theme-primary-a", colorRGBA.a.toString());
|
|
33
|
+
this.checkThemeColorContrast();
|
|
24
34
|
const foregroundColor = getThemeForegroundColor();
|
|
25
|
-
this.icThemeChange.emit({ mode: foregroundColor, color:
|
|
35
|
+
this.icThemeChange.emit({ mode: foregroundColor, color: colorRGBA });
|
|
26
36
|
}
|
|
27
37
|
};
|
|
28
38
|
this.color = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ic-theme.js","sourceRoot":"","sources":["../../../src/components/ic-theme/ic-theme.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EAEL,CAAC,EACD,KAAK,EACL,IAAI,GACL,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"ic-theme.js","sourceRoot":"","sources":["../../../src/components/ic-theme/ic-theme.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EAEL,CAAC,EACD,KAAK,EACL,IAAI,GACL,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAM/B,MAAM,OAAO,KAAK;;IAgBR,4BAAuB,GAAG,GAAS,EAAE;MAC3C,IACE,uBAAuB,EAAE,GAAG,0BAA0B;QACtD,uBAAuB,EAAE,GAAG,0BAA0B,EACtD;QACA,OAAO,CAAC,IAAI,CACV,2TAA2T,CAC5T,CAAC;OACH;IACH,CAAC,CAAC;IAEM,kBAAa,GAAG,GAAG,EAAE;MAC3B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE;QACvB,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACzC,IAAI,SAAS,KAAK,GAAG,EAAE;UACrB,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,C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;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Event,\n EventEmitter,\n h,\n Watch,\n Prop,\n} from \"@stencil/core\";\n\nimport { IcColorRGBA, IcTheme } from \"../../utils/types\";\nimport {\n getThemeForegroundColor,\n hexToRgba,\n rgbaStrToObj,\n} from \"../../utils/helpers\";\nimport { getThemeColorBrightness } from \"../../utils/helpers\";\nimport {\n BLACK_MIN_COLOR_BRIGHTNESS,\n WHITE_MAX_COLOR_BRIGHTNESS,\n} from \"../../utils/constants\";\n\n@Component({\n tag: \"ic-theme\",\n shadow: true,\n})\nexport class Theme {\n /**\n * The theme colour. Can be a hex value eg \"#ff0000\" or RGB eg \"rgb(255, 0, 0)\"\n */\n @Prop() color?: string = null;\n\n @Watch(\"color\")\n watchColorPropHandler(): void {\n this.setThemeColor();\n }\n\n /**\n * Emitted when the theme is changed.\n */\n @Event() icThemeChange: EventEmitter<IcTheme>;\n\n private checkThemeColorContrast = (): void => {\n if (\n getThemeColorBrightness() < BLACK_MIN_COLOR_BRIGHTNESS &&\n getThemeColorBrightness() > WHITE_MAX_COLOR_BRIGHTNESS\n ) {\n console.warn(\n `The theme colour does not provide enough contrast with either of the ICDS black or white foreground colours. Consider choosing a colour with a different brightness to achieve sufficient colour contrast for good visibility. See https://www.w3.org/TR/AERT/#color-contrast for more information about colour contrast.`\n );\n }\n };\n\n private setThemeColor = () => {\n if (this.color !== null) {\n let colorRGBA = null;\n const firstChar = this.color.slice(0, 1);\n if (firstChar === \"#\") {\n colorRGBA = hexToRgba(this.color);\n } else if (firstChar.toLowerCase() === \"r\") {\n colorRGBA = rgbaStrToObj(this.color);\n }\n this.setThemeRGBA(colorRGBA);\n }\n };\n\n private setThemeRGBA = (colorRGBA: IcColorRGBA) => {\n if (colorRGBA !== null) {\n const root = document.documentElement;\n root.style.setProperty(\"--ic-theme-primary-r\", colorRGBA.r.toString());\n root.style.setProperty(\"--ic-theme-primary-g\", colorRGBA.g.toString());\n root.style.setProperty(\"--ic-theme-primary-b\", colorRGBA.b.toString());\n root.style.setProperty(\"--ic-theme-primary-a\", colorRGBA.a.toString());\n\n this.checkThemeColorContrast();\n\n const foregroundColor = getThemeForegroundColor();\n this.icThemeChange.emit({ mode: foregroundColor, color: colorRGBA });\n }\n };\n\n componentWillLoad(): void {\n this.setThemeColor();\n }\n\n render() {\n return <Host></Host>;\n }\n}\n"]}
|
|
@@ -543,3 +543,9 @@ video {
|
|
|
543
543
|
:host([target="ic-button-with-tooltip-clear-button"]) .ic-tooltip-container {
|
|
544
544
|
z-index: calc(var(--ic-z-index-popup-menu) + 1);
|
|
545
545
|
}
|
|
546
|
+
|
|
547
|
+
@media (forced-colors: active) {
|
|
548
|
+
:host(.ic-tooltip) .ic-tooltip-container {
|
|
549
|
+
border: var(--ic-hc-border);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
@@ -70,7 +70,9 @@ export class Tooltip {
|
|
|
70
70
|
}
|
|
71
71
|
updateLabel(newValue) {
|
|
72
72
|
const describedBySpan = this.el.previousElementSibling;
|
|
73
|
-
describedBySpan
|
|
73
|
+
if (describedBySpan !== null) {
|
|
74
|
+
describedBySpan.innerText = newValue;
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
componentDidLoad() {
|
|
76
78
|
this.popperInstance = createPopper(this.el, this.toolTip, {
|
|
@@ -137,7 +139,7 @@ export class Tooltip {
|
|
|
137
139
|
"text": "The ID of the element the tooltip is describing - for when aria-labelledby or aria-describedby is used."
|
|
138
140
|
},
|
|
139
141
|
"attribute": "target",
|
|
140
|
-
"reflect":
|
|
142
|
+
"reflect": true
|
|
141
143
|
},
|
|
142
144
|
"placement": {
|
|
143
145
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ic-tooltip.js","sourceRoot":"","sources":["../../../src/components/ic-tooltip/ic-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,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GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,EAAoB,CAAC,EAClD,IAAI,EAAC,SAAS,EACd,KAAK,EAAC,sBAAsB;QAE5B,qBAAe,OAAO,EAAC,SAAS,IAAE,KAAK,CAAiB;QACxD,WACE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,EAAoB,CAAC,EAChD,KAAK,EAAC,kBAAkB,8BAEnB,CACH;MACN,eAAa,CACR,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, h, Watch } from \"@stencil/core\";\nimport { Instance, createPopper } from \"@popperjs/core\";\nimport { IcTooltipPlacements } from \"./ic-tooltip.types\";\nimport { onComponentRequiredPropUndefined } from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-tooltip\",\n styleUrl: \"ic-tooltip.css\",\n shadow: true,\n})\nexport class Tooltip {\n @Element() el: HTMLIcTooltipElement;\n\n /**\n * The ID of the element the tooltip is describing - for when aria-labelledby or aria-describedby is used.\n */\n @Prop({ reflect: true }) target?: string;\n\n /**\n * The position of the tool-tip in relation to the parent element.\n */\n @Prop() placement?: IcTooltipPlacements = \"bottom\";\n\n /**\n * The text to display on the tooltip.\n */\n @Prop() label!: string;\n\n @Watch(\"label\")\n updateLabel(newValue: string): void {\n const describedBySpan = this.el.previousElementSibling as HTMLElement;\n if (describedBySpan !== null) {\n describedBySpan.innerText = newValue;\n }\n }\n\n private toolTip: HTMLDivElement;\n private arrow: HTMLDivElement;\n private mouseOverTool: boolean = false;\n private showEvents = [\"mouseenter\", \"focusin\"];\n private instantHideEvents = [\"focusout\"];\n private delayedHideEvents = [\"mouseleave\"];\n private popperInstance: Instance;\n\n private show = (popper: Instance) => {\n this.toolTip.setAttribute(\"data-show\", \"\");\n popper.setOptions((options) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: \"eventListeners\", enabled: true },\n ],\n }));\n popper.update();\n };\n\n private hide = (popper: Instance) => {\n this.toolTip.removeAttribute(\"data-show\");\n popper.setOptions((options) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: \"eventListeners\", enabled: false },\n ],\n }));\n };\n\n private checkCloseTooltip = (popper: Instance) => {\n setTimeout(() => {\n if (!this.mouseOverTool) {\n this.hide(popper);\n }\n }, 100);\n };\n\n private mouseEnterTooltip = () => {\n this.mouseOverTool = true;\n };\n\n private mouseLeaveTooltip = (popper: Instance) => {\n this.mouseOverTool = false;\n this.checkCloseTooltip(popper);\n };\n\n private handleKeyDown = (key: string) => {\n if (key === \"Escape\") {\n this.hide(this.popperInstance);\n }\n };\n\n private manageEventListeners = (action: \"add\" | \"remove\") => {\n const method =\n action === \"add\" ? \"addEventListener\" : \"removeEventListener\";\n\n this.showEvents.forEach((event) => {\n this.el[method](event, () => this.show(this.popperInstance));\n this.toolTip[method](event, () => this.mouseEnterTooltip());\n });\n\n this.instantHideEvents.forEach((event) => {\n this.el[method](event, () => this.hide(this.popperInstance));\n });\n\n this.delayedHideEvents.forEach((event) => {\n this.el[method](event, () => this.checkCloseTooltip(this.popperInstance));\n this.toolTip[method](event, () =>\n this.mouseLeaveTooltip(this.popperInstance)\n );\n });\n\n document[method](\"keydown\", (event: KeyboardEvent) =>\n this.handleKeyDown(event.key)\n );\n };\n\n private screenReaderOnlyStyles = {\n position: \"absolute\",\n left: \"-10000px\",\n top: \"auto\",\n width: \"1px\",\n height: \"1px\",\n overflow: \"hidden\",\n };\n\n componentDidLoad(): void {\n this.popperInstance = createPopper(this.el, this.toolTip, {\n placement: this.placement,\n modifiers: [\n {\n name: \"offset\",\n options: {\n offset: [0, 10],\n },\n },\n {\n name: \"arrow\",\n options: {\n element: this.arrow,\n },\n },\n ],\n });\n\n this.manageEventListeners(\"add\");\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tooltip\"\n );\n\n if (this.target !== undefined) {\n const ariaDescribedBy = document.createElement(\"span\");\n ariaDescribedBy.id = `ic-tooltip-${this.target}`;\n ariaDescribedBy.innerText = this.label;\n ariaDescribedBy.classList.add(\"ic-tooltip-label\");\n Object.assign(ariaDescribedBy.style, this.screenReaderOnlyStyles);\n\n this.el.insertAdjacentElement(\"beforebegin\", ariaDescribedBy);\n }\n }\n\n disconnectedCallback(): void {\n this.manageEventListeners(\"remove\");\n }\n\n render() {\n const { label } = this;\n return (\n <Host class={{ \"ic-tooltip\": true }}>\n <div\n ref={(el) => (this.toolTip = el as HTMLDivElement)}\n role=\"tooltip\"\n class=\"ic-tooltip-container\"\n >\n <ic-typography variant=\"caption\">{label}</ic-typography>\n <div\n ref={(el) => (this.arrow = el as HTMLDivElement)}\n class=\"ic-tooltip-arrow\"\n data-popper-arrow\n ></div>\n </div>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -488,7 +488,7 @@ video {
|
|
|
488
488
|
:host .title-link:focus {
|
|
489
489
|
border-radius: var(--ic-border-radius);
|
|
490
490
|
box-shadow: var(--ic-border-focus);
|
|
491
|
-
outline:
|
|
491
|
+
outline: var(--ic-hc-focus-outline);
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
:host .title-link ic-typography {
|
|
@@ -631,6 +631,11 @@ slot[name="toggle-icon"] svg {
|
|
|
631
631
|
justify-content: flex-end;
|
|
632
632
|
}
|
|
633
633
|
|
|
634
|
+
:host ic-section-container{
|
|
635
|
+
padding-bottom: 0 !important;
|
|
636
|
+
padding-top: 0 !important;
|
|
637
|
+
}
|
|
638
|
+
|
|
634
639
|
@media screen and (min-width: 993px) {
|
|
635
640
|
.app-details-container {
|
|
636
641
|
margin-right: var(--ic-space-lg);
|
|
@@ -651,86 +656,94 @@ slot[name="toggle-icon"] svg {
|
|
|
651
656
|
:host .nav-panel-container {
|
|
652
657
|
padding-left: var(--ic-space-md);
|
|
653
658
|
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/* medium */
|
|
662
|
+
@media screen and (max-width: 992px) {
|
|
663
|
+
:host .nav-panel-container,
|
|
664
|
+
:host .app-status,
|
|
665
|
+
:host .app-version {
|
|
666
|
+
display: none;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
:host .title-link {
|
|
670
|
+
margin-right: var(--ic-space-xs);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.search-menu-container {
|
|
674
|
+
max-width: 160px;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.search-bar-container {
|
|
678
|
+
display: flex;
|
|
679
|
+
justify-content: center;
|
|
680
|
+
align-items: center;
|
|
681
|
+
border-top: var(--ic-keyline-darken);
|
|
682
|
+
height: 64px;
|
|
683
|
+
padding-left: var(--ic-space-md);
|
|
684
|
+
padding-right: var(--ic-space-md);
|
|
685
|
+
margin-left: calc(-1 * var(--section-container-margin));
|
|
686
|
+
margin-right: calc(-1 * var(--section-container-margin));
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
:host([content-aligned="left"]) .app-details-container,
|
|
690
|
+
:host([content-aligned="left"]) .search-menu-container,
|
|
691
|
+
:host([content-aligned="center"]) .search-menu-container,
|
|
692
|
+
:host([content-aligned="center"]) .app-details-container {
|
|
693
|
+
justify-content: flex-start;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/* x small */
|
|
698
|
+
@media screen and (max-width: 576px) {
|
|
699
|
+
:host .title-link {
|
|
700
|
+
margin-right: var(--ic-space-xxxs);
|
|
701
|
+
word-break: break-word;
|
|
702
|
+
-webkit-hyphens: none;
|
|
703
|
+
hyphens: none;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.top-panel-container {
|
|
707
|
+
min-height: 40px;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.searchbox-inline {
|
|
711
|
+
display: none;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.search-bar-container {
|
|
715
|
+
margin-top: 0;
|
|
716
|
+
height: 56px;
|
|
717
|
+
padding-left: var(--ic-space-xs);
|
|
718
|
+
padding-right: var(--ic-space-xs);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.menu-button-container {
|
|
722
|
+
margin-left: var(--ic-space-sm);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
slot[name="app-icon"]::slotted(svg) {
|
|
726
|
+
width: 1.5em;
|
|
727
|
+
height: 1.5em;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
slot[name="toggle-icon"] svg {
|
|
731
|
+
width: 1.5em;
|
|
732
|
+
height: 1.5em;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
@media (forced-colors: active) {
|
|
737
|
+
:host .top-navigation {
|
|
738
|
+
border-bottom: var(--ic-hc-border);
|
|
739
|
+
}
|
|
654
740
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
:
|
|
658
|
-
:host .app-status,
|
|
659
|
-
:host .app-version {
|
|
660
|
-
display: none;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
:host .title-link {
|
|
664
|
-
margin-right: var(--ic-space-xs);
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
.search-menu-container {
|
|
668
|
-
max-width: 160px;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
.search-bar-container {
|
|
672
|
-
display: flex;
|
|
673
|
-
justify-content: center;
|
|
674
|
-
align-items: center;
|
|
675
|
-
border-top: var(--ic-keyline-darken);
|
|
676
|
-
height: 64px;
|
|
677
|
-
padding-left: var(--ic-space-md);
|
|
678
|
-
padding-right: var(--ic-space-md);
|
|
679
|
-
margin-left: calc(-1 * var(--section-container-margin));
|
|
680
|
-
margin-right: calc(-1 * var(--section-container-margin));
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
:host([content-aligned="left"]) .app-details-container,
|
|
684
|
-
:host([content-aligned="left"]) .search-menu-container,
|
|
685
|
-
:host([content-aligned="center"]) .search-menu-container,
|
|
686
|
-
:host([content-aligned="center"]) .app-details-container {
|
|
687
|
-
justify-content: flex-start;
|
|
688
|
-
}
|
|
741
|
+
.app-status,
|
|
742
|
+
.app-version {
|
|
743
|
+
border: var(--ic-hc-border);
|
|
689
744
|
}
|
|
690
745
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
:host .title-link {
|
|
694
|
-
margin-right: var(--ic-space-xxxs);
|
|
695
|
-
word-break: break-word;
|
|
696
|
-
-webkit-hyphens: auto;
|
|
697
|
-
hyphens: auto;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
.top-panel-container {
|
|
701
|
-
min-height: 40px;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
.searchbox-inline {
|
|
705
|
-
display: none;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
.search-bar-container {
|
|
709
|
-
margin-top: 0;
|
|
710
|
-
height: 56px;
|
|
711
|
-
padding-left: var(--ic-space-xs);
|
|
712
|
-
padding-right: var(--ic-space-xs);
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
.menu-button-container {
|
|
716
|
-
margin-left: var(--ic-space-sm);
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
slot[name="app-icon"]::slotted(svg) {
|
|
720
|
-
width: 1.5em;
|
|
721
|
-
height: 1.5em;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
slot[name="toggle-icon"] svg {
|
|
725
|
-
width: 1.5em;
|
|
726
|
-
height: 1.5em;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
:host([content-aligned="left"]) .app-details-container,
|
|
730
|
-
:host([content-aligned="left"]) .search-menu-container,
|
|
731
|
-
:host([content-aligned="center"]) .app-details-container,
|
|
732
|
-
:host([content-aligned="center"]) .search-menu-container {
|
|
733
|
-
justify-content: flex-start;
|
|
734
|
-
}
|
|
746
|
+
slot[name="app-icon"]::slotted(svg) {
|
|
747
|
+
fill: currentcolor;
|
|
735
748
|
}
|
|
736
749
|
}
|
|
@@ -41,4 +41,13 @@ export const IC_FIXED_COLOR_COMPONENTS = ["ic-alert"];
|
|
|
41
41
|
export const IC_BLOCK_COLOR_EXCEPTIONS = {
|
|
42
42
|
"ic-alert": ["ic-link"],
|
|
43
43
|
};
|
|
44
|
+
/* Range within which the chosen theme colour would not have a sufficient brightness difference with either of the black or white foreground colours
|
|
45
|
+
* The brightness difference must be greater than 125 to provide good colour visibility
|
|
46
|
+
* Calculated by:
|
|
47
|
+
* - Using the brightness formula for both colours: https://www.w3.org/TR/AERT/#color-contrast
|
|
48
|
+
* - Adding 125 to the brightness of the black foreground colour - RGB(11, 12, 12)
|
|
49
|
+
* - Subtracting 125 from the brightness of the white foreground colour - RGB(255, 255, 255)
|
|
50
|
+
*/
|
|
51
|
+
export const BLACK_MIN_COLOR_BRIGHTNESS = 136.701;
|
|
52
|
+
export const WHITE_MAX_COLOR_BRIGHTNESS = 130;
|
|
44
53
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG;EAC/B,aAAa;EACb,WAAW;EACX,eAAe;EACf,cAAc;EACd,kBAAkB;EAClB,kBAAkB;EAClB,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,aAAa;EACb,cAAc;EACd,eAAe;EACf,aAAa;EACb,cAAc;EACd,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,WAAW;EACX,eAAe;EACf,sBAAsB;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;EAC7B,EAAE,EAAE,GAAG;EACP,CAAC,EAAE,GAAG;EACN,CAAC,EAAE,GAAG;EACN,CAAC,EAAE,IAAI;EACP,EAAE,EAAE,KAAK;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;EACvC,SAAS;EACT,mBAAmB;EACnB,WAAW;EACX,oBAAoB;EACpB,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,UAAU,CAAC,CAAC;AAMtD,MAAM,CAAC,MAAM,yBAAyB,GAAsB;EAC1D,UAAU,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC","sourcesContent":["// Global ARIA attributes\nexport const IC_INHERITED_ARIA = [\n \"aria-atomic\",\n \"aria-busy\",\n \"aria-controls\",\n \"aria-current\",\n \"aria-describedby\",\n \"aria-description\",\n \"aria-details\",\n \"aria-disabled\",\n \"aria-dropeffect\",\n \"aria-errormessage\",\n \"aria-flowto\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-keyshortcuts\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-live\",\n \"aria-owns\",\n \"aria-relevant\",\n \"aria-roledescription\",\n];\n\nexport const IC_DEVICE_SIZES = {\n XS: 576,\n S: 768,\n M: 992,\n L: 1200,\n XL: 99999,\n};\n\nexport const IC_BLOCK_COLOR_COMPONENTS = [\n \"ic-hero\",\n \"ic-top-navigation\",\n \"ic-footer\",\n \"ic-side-navigation\",\n \"ic-alert\",\n];\n\nexport const IC_FIXED_COLOR_COMPONENTS = [\"ic-alert\"];\n\nexport interface IcColorExceptions {\n [details: string]: string[];\n}\n\nexport const IC_BLOCK_COLOR_EXCEPTIONS: IcColorExceptions = {\n \"ic-alert\": [\"ic-link\"],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG;EAC/B,aAAa;EACb,WAAW;EACX,eAAe;EACf,cAAc;EACd,kBAAkB;EAClB,kBAAkB;EAClB,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,aAAa;EACb,cAAc;EACd,eAAe;EACf,aAAa;EACb,cAAc;EACd,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,WAAW;EACX,eAAe;EACf,sBAAsB;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;EAC7B,EAAE,EAAE,GAAG;EACP,CAAC,EAAE,GAAG;EACN,CAAC,EAAE,GAAG;EACN,CAAC,EAAE,IAAI;EACP,EAAE,EAAE,KAAK;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;EACvC,SAAS;EACT,mBAAmB;EACnB,WAAW;EACX,oBAAoB;EACpB,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,UAAU,CAAC,CAAC;AAMtD,MAAM,CAAC,MAAM,yBAAyB,GAAsB;EAC1D,UAAU,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAClD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC","sourcesContent":["// Global ARIA attributes\nexport const IC_INHERITED_ARIA = [\n \"aria-atomic\",\n \"aria-busy\",\n \"aria-controls\",\n \"aria-current\",\n \"aria-describedby\",\n \"aria-description\",\n \"aria-details\",\n \"aria-disabled\",\n \"aria-dropeffect\",\n \"aria-errormessage\",\n \"aria-flowto\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-keyshortcuts\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-live\",\n \"aria-owns\",\n \"aria-relevant\",\n \"aria-roledescription\",\n];\n\nexport const IC_DEVICE_SIZES = {\n XS: 576,\n S: 768,\n M: 992,\n L: 1200,\n XL: 99999,\n};\n\nexport const IC_BLOCK_COLOR_COMPONENTS = [\n \"ic-hero\",\n \"ic-top-navigation\",\n \"ic-footer\",\n \"ic-side-navigation\",\n \"ic-alert\",\n];\n\nexport const IC_FIXED_COLOR_COMPONENTS = [\"ic-alert\"];\n\nexport interface IcColorExceptions {\n [details: string]: string[];\n}\n\nexport const IC_BLOCK_COLOR_EXCEPTIONS: IcColorExceptions = {\n \"ic-alert\": [\"ic-link\"],\n};\n\n/* Range within which the chosen theme colour would not have a sufficient brightness difference with either of the black or white foreground colours\n * The brightness difference must be greater than 125 to provide good colour visibility\n * Calculated by:\n * - Using the brightness formula for both colours: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding 125 to the brightness of the black foreground colour - RGB(11, 12, 12)\n * - Subtracting 125 from the brightness of the white foreground colour - RGB(255, 255, 255)\n */\nexport const BLACK_MIN_COLOR_BRIGHTNESS = 136.701;\nexport const WHITE_MAX_COLOR_BRIGHTNESS = 130;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IcThemeForegroundEnum, } from "../utils/types";
|
|
2
2
|
import { IC_BLOCK_COLOR_COMPONENTS, IC_BLOCK_COLOR_EXCEPTIONS, IC_FIXED_COLOR_COMPONENTS, } from "./constants";
|
|
3
|
-
const DARK_MODE_THRESHOLD =
|
|
3
|
+
const DARK_MODE_THRESHOLD = 133.3505;
|
|
4
4
|
/**
|
|
5
5
|
* Used to inherit global attributes set on the host. Called in componentWillLoad and assigned
|
|
6
6
|
* to a variable that is later used in the render function.
|
|
@@ -49,21 +49,29 @@ export const debounce = (func, wait = 0) => {
|
|
|
49
49
|
* @param disabled If true, the input is disabled
|
|
50
50
|
*/
|
|
51
51
|
export const renderHiddenInput = (always, container, name, value, disabled) => {
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
input
|
|
58
|
-
|
|
52
|
+
if (name !== undefined) {
|
|
53
|
+
if (always || hasShadowDom(container)) {
|
|
54
|
+
const inputs = container.querySelectorAll("input.ic-input");
|
|
55
|
+
const inputEls = Array.from(inputs);
|
|
56
|
+
const filtered = inputEls.filter((el) => container === el.parentElement);
|
|
57
|
+
let input = filtered[0];
|
|
58
|
+
if (input === null || input === undefined) {
|
|
59
|
+
input = container.ownerDocument.createElement("input");
|
|
60
|
+
input.type = "hidden";
|
|
61
|
+
input.classList.add("ic-input");
|
|
62
|
+
container.appendChild(input);
|
|
63
|
+
}
|
|
64
|
+
input.disabled = disabled;
|
|
65
|
+
input.name = name;
|
|
66
|
+
input.value = value || "";
|
|
59
67
|
}
|
|
60
|
-
input.disabled = disabled;
|
|
61
|
-
input.name = name;
|
|
62
|
-
input.value = value || "";
|
|
63
68
|
}
|
|
64
69
|
};
|
|
65
70
|
export const removeHiddenInput = (container) => {
|
|
66
|
-
const
|
|
71
|
+
const inputs = container.querySelectorAll("input.ic-input");
|
|
72
|
+
const inputEls = Array.from(inputs);
|
|
73
|
+
const filtered = inputEls.filter((el) => container === el.parentElement);
|
|
74
|
+
const input = filtered[0];
|
|
67
75
|
input === null || input === void 0 ? void 0 : input.remove();
|
|
68
76
|
};
|
|
69
77
|
export const hasShadowDom = (el) => {
|
|
@@ -92,7 +100,8 @@ export const getInputDescribedByText = (inputId, helperText, validationText) =>
|
|
|
92
100
|
*/
|
|
93
101
|
export const getThemeFromContext = (el, themeFromEvent = null) => {
|
|
94
102
|
var _a;
|
|
95
|
-
const
|
|
103
|
+
const parentElement = el.parentElement || el.getRootNode().host.parentElement;
|
|
104
|
+
const blockColorParent = parentElement.closest(IC_BLOCK_COLOR_COMPONENTS.join(","));
|
|
96
105
|
// If within a block color component
|
|
97
106
|
if (blockColorParent !== null) {
|
|
98
107
|
const parentTag = blockColorParent.tagName.toLowerCase();
|
|
@@ -214,22 +223,29 @@ export const getCurrentDeviceSize = () => {
|
|
|
214
223
|
export const getCssProperty = (cssVar) => {
|
|
215
224
|
return getComputedStyle(document.documentElement).getPropertyValue(cssVar);
|
|
216
225
|
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Returns the brightness of the theme colour, calculated by using the theme RGB CSS values by:
|
|
228
|
+
* - Multiplying each RGB value by a set number: https://www.w3.org/TR/AERT/#color-contrast
|
|
229
|
+
* - Adding them together and dividing by 1000
|
|
230
|
+
* This is a similar calculation to its CSS counterpart: "--ic-theme-text"
|
|
231
|
+
* @returns number representing the brightness of the theme colour
|
|
232
|
+
*/
|
|
233
|
+
export const getThemeColorBrightness = () => {
|
|
225
234
|
const themeRed = getCssProperty("--ic-theme-primary-r");
|
|
226
235
|
const themeGreen = getCssProperty("--ic-theme-primary-g");
|
|
227
236
|
const themeBlue = getCssProperty("--ic-theme-primary-b");
|
|
228
|
-
const
|
|
237
|
+
const themeColorBrightness = (parseInt(themeRed) * 299 +
|
|
229
238
|
parseInt(themeGreen) * 587 +
|
|
230
239
|
parseInt(themeBlue) * 114) /
|
|
231
|
-
1000
|
|
232
|
-
return
|
|
240
|
+
1000;
|
|
241
|
+
return themeColorBrightness;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Returns if dark or light foreground colors should be used for color contrast reasons
|
|
245
|
+
* @returns "dark" or "light"
|
|
246
|
+
*/
|
|
247
|
+
export const getThemeForegroundColor = () => {
|
|
248
|
+
return getThemeColorBrightness() > DARK_MODE_THRESHOLD
|
|
233
249
|
? IcThemeForegroundEnum.Dark
|
|
234
250
|
: IcThemeForegroundEnum.Light;
|
|
235
251
|
};
|
|
@@ -327,7 +343,7 @@ export const checkResizeObserver = (callbackFn) => {
|
|
|
327
343
|
const hex2dec = function (v) {
|
|
328
344
|
return parseInt(v, 16);
|
|
329
345
|
};
|
|
330
|
-
export const
|
|
346
|
+
export const hexToRgba = (hex) => {
|
|
331
347
|
let c;
|
|
332
348
|
if (hex.length === 4) {
|
|
333
349
|
c = hex.replace("#", "").split("");
|
|
@@ -335,6 +351,7 @@ export const hexToRgb = (hex) => {
|
|
|
335
351
|
r: hex2dec(c[0] + c[0]),
|
|
336
352
|
g: hex2dec(c[1] + c[1]),
|
|
337
353
|
b: hex2dec(c[2] + c[2]),
|
|
354
|
+
a: 1,
|
|
338
355
|
};
|
|
339
356
|
}
|
|
340
357
|
else {
|
|
@@ -342,19 +359,35 @@ export const hexToRgb = (hex) => {
|
|
|
342
359
|
r: hex2dec(hex.slice(1, 3)),
|
|
343
360
|
g: hex2dec(hex.slice(3, 5)),
|
|
344
361
|
b: hex2dec(hex.slice(5)),
|
|
362
|
+
a: 1,
|
|
345
363
|
};
|
|
346
364
|
}
|
|
347
365
|
};
|
|
348
|
-
export const
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
366
|
+
export const rgbaStrToObj = (rgbaStr) => {
|
|
367
|
+
const fourthChar = rgbaStr.slice(3, 4);
|
|
368
|
+
let colorRGBA;
|
|
369
|
+
if (fourthChar.toLowerCase() === "a") {
|
|
370
|
+
colorRGBA = { r: null, g: null, b: null, a: null };
|
|
371
|
+
const rgba = rgbaStr
|
|
372
|
+
.substring(5, rgbaStr.length - 1)
|
|
373
|
+
.replace(/ /g, "")
|
|
374
|
+
.split(",");
|
|
375
|
+
colorRGBA.r = Number(rgba[0]);
|
|
376
|
+
colorRGBA.g = Number(rgba[1]);
|
|
377
|
+
colorRGBA.b = Number(rgba[2]);
|
|
378
|
+
colorRGBA.a = Number(rgba[3]);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
colorRGBA = { r: null, g: null, b: null, a: 1 };
|
|
382
|
+
const rgb = rgbaStr
|
|
383
|
+
.substring(4, rgbaStr.length - 1)
|
|
384
|
+
.replace(/ /g, "")
|
|
385
|
+
.split(",");
|
|
386
|
+
colorRGBA.r = Number(rgb[0]);
|
|
387
|
+
colorRGBA.g = Number(rgb[1]);
|
|
388
|
+
colorRGBA.b = Number(rgb[2]);
|
|
389
|
+
}
|
|
390
|
+
return colorRGBA;
|
|
358
391
|
};
|
|
359
392
|
export const elementOverflowsX = (element) => {
|
|
360
393
|
return element.scrollWidth > element.clientWidth;
|