@haiilo/catalyst 10.1.1 → 10.3.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/catalyst/assets/fonts/Lato-Black.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/catalyst/catalyst.css +23 -14
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +2 -3
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-20919029.js +3 -0
- package/dist/catalyst/p-20919029.js.map +1 -0
- package/dist/catalyst/p-81800b65.js +2 -0
- package/dist/catalyst/p-81800b65.js.map +1 -0
- package/dist/catalyst/p-8a1d505d.entry.js +10 -0
- package/dist/catalyst/p-8a1d505d.entry.js.map +1 -0
- package/dist/catalyst/p-e1255160.js +2 -0
- package/dist/catalyst/p-e1255160.js.map +1 -0
- package/dist/catalyst/scss/core/_form.scss +12 -3
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/{cat-alert_26.cjs.entry.js → cat-alert_28.cjs.entry.js} +2435 -189
- package/dist/cjs/cat-alert_28.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +6 -4
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-eb056d5e.js → index-13aff0b4.js} +93 -38
- package/dist/cjs/index-13aff0b4.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{of-30c47b72.js → of-45281229.js} +164 -84
- package/dist/cjs/of-45281229.js.map +1 -0
- package/dist/collection/assets/fonts/Lato-Black.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Light.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/cat-alert/cat-alert.css +5 -5
- package/dist/collection/components/cat-alert/cat-alert.js +1 -1
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-alert/cat-alert.spec.js +2 -9
- package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js +3 -7
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.css +3 -3
- package/dist/collection/components/cat-badge/cat-badge.js +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.spec.js +2 -6
- package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +39 -10
- package/dist/collection/components/cat-button/cat-button.js +3 -5
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
- package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js +2 -6
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.js +1 -1
- package/dist/collection/components/cat-card/cat-card.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.spec.js +2 -6
- package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +4 -6
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +2 -17
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date-locale.js +54 -0
- package/dist/collection/components/cat-date/cat-date-locale.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date-math.js +28 -0
- package/dist/collection/components/cat-date/cat-date-math.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date.css +122 -0
- package/dist/collection/components/cat-date/cat-date.e2e.js +11 -0
- package/dist/collection/components/cat-date/cat-date.e2e.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date.js +923 -0
- package/dist/collection/components/cat-date/cat-date.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date.spec.js +16 -0
- package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +7 -9
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +3 -8
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +2 -8
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +101 -31
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +2 -8
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js +2 -6
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +27 -15
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.spec.js +1 -1
- package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +28 -13
- package/dist/collection/components/cat-input/cat-input.js +47 -11
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.spec.js +2 -23
- package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js +2 -18
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +4 -6
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.spec.js +3 -13
- package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +2 -8
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +2 -13
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.css +13 -13
- package/dist/collection/components/cat-select/cat-select.js +15 -19
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.spec.js +2 -28
- package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +2 -6
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.spec.js +2 -5
- package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +7 -11
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js +2 -5
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +13 -13
- package/dist/collection/components/cat-textarea/cat-textarea.js +6 -8
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js +2 -21
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
- package/dist/collection/components/cat-time/cat-time-locale.js +15 -0
- package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time-math.js +28 -0
- package/dist/collection/components/cat-time/cat-time-math.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time.css +41 -0
- package/dist/collection/components/cat-time/cat-time.e2e.js +11 -0
- package/dist/collection/components/cat-time/cat-time.e2e.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time.js +801 -0
- package/dist/collection/components/cat-time/cat-time.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time.spec.js +16 -0
- package/dist/collection/components/cat-time/cat-time.spec.js.map +1 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js +4 -6
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js +2 -10
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +3 -3
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +1 -9
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
- package/dist/collection/scss/core/_form.scss +12 -3
- package/dist/collection/utils/find-closest.js.map +1 -1
- package/dist/collection/utils/media-matcher.js.map +1 -1
- package/dist/collection/utils/platform.js.map +1 -1
- package/dist/collection/utils/setDefault.js.map +1 -1
- package/dist/components/cat-alert.js +4 -3
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar2.js +4 -3
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +4 -3
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button-group.js +3 -2
- package/dist/components/cat-button-group.js.map +1 -1
- package/dist/components/cat-button2.js +6 -5
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +3 -2
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-checkbox2.js +5 -4
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-date.d.ts +11 -0
- package/dist/components/cat-date.js +469 -0
- package/dist/components/cat-date.js.map +1 -0
- package/dist/components/cat-datepicker-inline.js +4 -3
- package/dist/components/cat-datepicker-inline.js.map +1 -1
- package/dist/components/cat-datepicker.js +4 -3
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-datepicker.locale.js +8 -4
- package/dist/components/cat-datepicker.locale.js.map +1 -1
- package/dist/components/cat-dropdown2.js +37 -31
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +3 -2
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +7 -7
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +37 -22
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon2.js +3 -2
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-input2.js +1576 -9
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js +4 -3
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +3 -2
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +5 -4
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +5 -4
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +10 -9
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +3 -2
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-spinner2.js +4 -3
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-tab.js +3 -2
- package/dist/components/cat-tab.js.map +1 -1
- package/dist/components/cat-tabs.js +3 -2
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +8 -7
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-time.d.ts +11 -0
- package/dist/components/cat-time.js +303 -0
- package/dist/components/cat-time.js.map +1 -0
- package/dist/components/cat-toggle.js +5 -4
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +5 -4
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +97 -45
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/from.js +16 -1
- package/dist/components/from.js.map +1 -1
- package/dist/components/index.js +9 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/loglevel.js +106 -55
- package/dist/components/loglevel.js.map +1 -1
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/{cat-alert_26.entry.js → cat-alert_28.entry.js} +2435 -191
- package/dist/esm/cat-alert_28.entry.js.map +1 -0
- package/dist/esm/catalyst.js +7 -5
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-acddba36.js → index-ecb4a974.js} +93 -38
- package/dist/esm/index-ecb4a974.js.map +1 -0
- package/dist/esm/index.js +10 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +6 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{of-4b71dda1.js → of-19888f3b.js} +164 -83
- package/dist/esm/of-19888f3b.js.map +1 -0
- package/dist/types/components/cat-date/cat-date-locale.d.ts +24 -0
- package/dist/types/components/cat-date/cat-date-math.d.ts +7 -0
- package/dist/types/components/cat-date/cat-date.d.ts +180 -0
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -3
- package/dist/types/components/cat-input/cat-input.d.ts +9 -2
- package/dist/types/components/cat-time/cat-time-locale.d.ts +6 -0
- package/dist/types/components/cat-time/cat-time-math.d.ts +3 -0
- package/dist/types/components/cat-time/cat-time.d.ts +168 -0
- package/dist/types/components.d.ts +551 -8
- package/package.json +20 -18
- package/dist/catalyst/p-2a5b4714.entry.js +0 -10
- package/dist/catalyst/p-2a5b4714.entry.js.map +0 -1
- package/dist/catalyst/p-6cd4fa1e.js +0 -3
- package/dist/catalyst/p-6cd4fa1e.js.map +0 -1
- package/dist/catalyst/p-f5febe1f.js +0 -2
- package/dist/catalyst/p-f5febe1f.js.map +0 -1
- package/dist/cjs/cat-alert_26.cjs.entry.js.map +0 -1
- package/dist/cjs/index-eb056d5e.js.map +0 -1
- package/dist/cjs/of-30c47b72.js.map +0 -1
- package/dist/esm/cat-alert_26.entry.js.map +0 -1
- package/dist/esm/index-acddba36.js.map +0 -1
- package/dist/esm/of-4b71dda1.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const catFormGroupCss = ":host{display:block}";
|
|
4
|
+
const CatFormGroupStyle0 = catFormGroupCss;
|
|
4
5
|
|
|
5
6
|
const CatFormGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatFormGroup extends HTMLElement {
|
|
6
7
|
constructor() {
|
|
@@ -22,7 +23,7 @@ const CatFormGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatFormGroup exten
|
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
render() {
|
|
25
|
-
return (h(Host, { style: { '--label-size': this.labelSize } }, h("slot", { onSlotchange: this.onSlotChange.bind(this) })));
|
|
26
|
+
return (h(Host, { key: 'd9805ae9997123327fa6259d9e849dff68576b31', style: { '--label-size': this.labelSize } }, h("slot", { key: 'e7e254cf202b8ee8a219ec077e659fde18db3530', onSlotchange: this.onSlotChange.bind(this) })));
|
|
26
27
|
}
|
|
27
28
|
onSlotChange() {
|
|
28
29
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
|
|
@@ -39,7 +40,7 @@ const CatFormGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatFormGroup exten
|
|
|
39
40
|
"requiredMarker": ["onRequiredMarkerChanged"],
|
|
40
41
|
"horizontal": ["onHorizontalChanged"]
|
|
41
42
|
}; }
|
|
42
|
-
static get style() { return
|
|
43
|
+
static get style() { return CatFormGroupStyle0; }
|
|
43
44
|
}, [1, "cat-form-group", {
|
|
44
45
|
"requiredMarker": [1, "required-marker"],
|
|
45
46
|
"horizontal": [4],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-form-group.js","mappings":";;AAAA,MAAM,eAAe,GAAG,sBAAsB;;
|
|
1
|
+
{"file":"cat-form-group.js","mappings":";;AAAA,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAC/C,2BAAe,eAAe;;MCYjBA,cAAY;;;;;QACf,iBAAY,GAA8B,EAAE,CAAC;8BAWe,MAAM;0BAKrD,KAAK;;;IAQ1B,uBAAuB,CAAC,iBAA4D;QAClF,MAAM,YAAY,GAAG,iBAAiB,KAAK,MA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-form-group/cat-form-group.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\ntype HTMLCatFormFieldElement =\n | HTMLCatInputElement\n | HTMLCatTextareaElement\n | HTMLCatSelectElement\n | HTMLCatDatepickerElement;\n\n@Component({\n tag: 'cat-form-group',\n styleUrl: 'cat-form-group.scss',\n shadow: true\n})\nexport class CatFormGroup {\n private formElements: HTMLCatFormFieldElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />\n * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />\n * - If there are more required, the optional will be marked.<br />\n * - If there are less required, it will mark the required.<br /><br />\n * If a form field had \"!\", the requiredMarked of the field would not change.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'auto' = 'auto';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * The space allocated to the input label\n */\n @Prop() labelSize?: string;\n\n @Watch('requiredMarker')\n onRequiredMarkerChanged(newRequiredMarker: 'none' | 'required' | 'optional' | 'auto') {\n const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;\n this.formElements.forEach(\n element => !element.requiredMarker?.endsWith('!') && (element.requiredMarker = updateMarker)\n );\n }\n\n @Watch('horizontal')\n onHorizontalChanged(newHorizontal: boolean) {\n this.formElements.forEach(element => {\n element.horizontal = newHorizontal;\n });\n }\n\n render() {\n return (\n <Host style={{ '--label-size': this.labelSize }}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(\n this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker')\n ) as HTMLCatFormFieldElement[];\n this.onRequiredMarkerChanged(this.requiredMarker);\n this.onHorizontalChanged(this.horizontal);\n }\n\n private calculate(elements: HTMLCatFormFieldElement[]): 'optional' | 'required' {\n const optionalFields = elements.filter(value => !value.required).length;\n const requiredFields = elements.length - optionalFields;\n return requiredFields >= optionalFields ? 'optional' : 'required';\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as
|
|
1
|
+
import { l as log } from './loglevel.js';
|
|
2
2
|
|
|
3
3
|
class CatI18nRegistry {
|
|
4
4
|
constructor() {
|
|
@@ -43,35 +43,35 @@ class CatI18nRegistry {
|
|
|
43
43
|
setLocale(locale, silent = false) {
|
|
44
44
|
try {
|
|
45
45
|
this._locale = Intl.getCanonicalLocales(locale)[0];
|
|
46
|
-
|
|
46
|
+
log.info(`[CatI18nRegistry::${this.id}] Set locale: ${this._locale}`);
|
|
47
47
|
!silent && window.dispatchEvent(this.buildEvent('cat-i18n-setLocale', { locale, id: this.id }));
|
|
48
48
|
}
|
|
49
49
|
catch (err) {
|
|
50
|
-
|
|
50
|
+
log.error(`[CatI18nRegistry::${this.id}] Invalid locale: ${locale}`);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
set(i18n, silent = false) {
|
|
54
54
|
if (typeof i18n === 'function') {
|
|
55
55
|
this._translator = i18n;
|
|
56
|
-
|
|
56
|
+
log.info(`[CatI18nRegistry::${this.id}] Registered translator`);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
const i18nEntries = Object.entries(i18n);
|
|
60
60
|
i18nEntries.forEach(([key, message]) => this.i18n.set(key, message));
|
|
61
|
-
|
|
61
|
+
log.info(`[CatI18nRegistry::${this.id}] Registered ${i18nEntries.length !== 1 ? 'messages' : 'message'}`);
|
|
62
62
|
}
|
|
63
63
|
!silent && window.dispatchEvent(this.buildEvent('cat-i18n-set', { i18n, id: this.id }));
|
|
64
64
|
}
|
|
65
65
|
clear(silent = false) {
|
|
66
66
|
this.i18n.clear();
|
|
67
|
-
|
|
67
|
+
log.info(`[CatI18nRegistry::${this.id}] Cleared messages`);
|
|
68
68
|
!silent && window.dispatchEvent(this.buildEvent('cat-i18n-clear'));
|
|
69
69
|
}
|
|
70
70
|
t(key, params) {
|
|
71
71
|
const message = this._translator?.(key, params) ??
|
|
72
72
|
this.i18n.get(key)?.replace(/{{\s*([-a-zA-Z._]+)\s*}}/g, (_match, key) => `${params?.[key] ?? ''}`);
|
|
73
73
|
if (message === undefined) {
|
|
74
|
-
|
|
74
|
+
log.error(`[CatI18nRegistry::${this.id}] Unknown message key: ${key}`);
|
|
75
75
|
return key;
|
|
76
76
|
}
|
|
77
77
|
return message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-i18n-registry.js","mappings":";;MAIa,eAAe;IAS1B;;QANiB,OAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACnD,SAAI,GAAwB,IAAI,GAAG,EAAE,CAAC;;;;;;;;QAerD,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,KAAK;YACjD,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI,EAAE,CAAC;YAChD,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;gBACnC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACrC;SACF,CAAC,CAAC;QACH,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,KAAK;YAC3C,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI,EAAE,CAAC;YAChD,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;gBACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;aAC7B;SACF,CAAC,CAAC;QACH,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK;YAC7C,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI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M,GAAG,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtG,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,GAAG,CAAC,KAAK,CAAC,qBAAqB,IAAI,CAAC,EAAE,0BAA0B,GAAG,EAAE,CAAC,CAAC;YACvE,OAAO,GAAG,CAAC;SACZ;QACD,OAAO,OAAO,CAAC;KAChB;IAEO,UAAU,CAAI,IAAY,EAAE,MAAU;QAC5C,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM;SACP,CAAC,CAAC;KACJ;CACF;MAEY,eAAe,GAAG,eAAe,CAAC,WAAW;;;;","names":[],"sources":["src/components/cat-i18n/cat-i18n-registry.ts"],"sourcesContent":["import log from 'loglevel';\n\nexport type CatI18nTranslationFn = (key: string, params?: unknown) => string;\n\nexport class CatI18nRegistry {\n private static instance: CatI18nRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly i18n: Map<string, string> = new Map();\n\n private _locale?: string;\n private _translator?: CatI18nTranslationFn;\n\n private constructor() {\n // hide constructor\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when messages are added or removed in other\n // applications and add or remove messages if the event was not dispatched\n // by this registry.\n window.addEventListener('cat-i18n-setLocale', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.setLocale(detail.locale, true);\n }\n });\n window.addEventListener('cat-i18n-set', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.set(detail.i18n, true);\n }\n });\n window.addEventListener('cat-i18n-clear', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.clear(true);\n }\n });\n }\n\n static getInstance(): CatI18nRegistry {\n if (!CatI18nRegistry.instance) {\n CatI18nRegistry.instance = new CatI18nRegistry();\n }\n return CatI18nRegistry.instance;\n }\n\n getLocale(): string {\n return this._locale ?? window?.navigator?.language ?? 'en';\n }\n\n setLocale(locale: string, silent = false): void {\n try {\n this._locale = Intl.getCanonicalLocales(locale)[0];\n log.info(`[CatI18nRegistry::${this.id}] Set locale: ${this._locale}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-setLocale', { locale, id: this.id }));\n } catch (err) {\n log.error(`[CatI18nRegistry::${this.id}] Invalid locale: ${locale}`);\n }\n }\n\n set(i18n: { [key: string]: string } | CatI18nTranslationFn, silent = false): void {\n if (typeof i18n === 'function') {\n this._translator = i18n;\n log.info(`[CatI18nRegistry::${this.id}] Registered translator`);\n } else {\n const i18nEntries = Object.entries(i18n);\n i18nEntries.forEach(([key, message]) => this.i18n.set(key, message));\n log.info(`[CatI18nRegistry::${this.id}] Registered ${i18nEntries.length !== 1 ? 'messages' : 'message'}`);\n }\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-set', { i18n, id: this.id }));\n }\n\n clear(silent = false): void {\n this.i18n.clear();\n log.info(`[CatI18nRegistry::${this.id}] Cleared messages`);\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-clear'));\n }\n\n t(key: string, params?: { [key: string]: unknown }): string {\n const message =\n this._translator?.(key, params) ??\n this.i18n.get(key)?.replace(/{{\\s*([-a-zA-Z._]+)\\s*}}/g, (_match, key) => `${params?.[key] ?? ''}`);\n if (message === undefined) {\n log.error(`[CatI18nRegistry::${this.id}] Unknown message key: ${key}`);\n return key;\n }\n return message;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catI18nRegistry = CatI18nRegistry.getInstance();\n"],"version":3}
|
|
@@ -1,37 +1,46 @@
|
|
|
1
|
-
import { l as
|
|
1
|
+
import { l as log } from './loglevel.js';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const chevronDoubleLeft16 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M7.53 4.53a.75.75 0 0 0-1.06-1.06l-4 4a.75.75 0 0 0 0 1.06l4 4a.75.75 0 0 0 1.06-1.06L4.06 8l3.47-3.47Z"/><path d="M12.53 4.53a.75.75 0 0 0-1.06-1.06l-4 4a.75.75 0 0 0 0 1.06l4 4a.75.75 0 1 0 1.06-1.06L9.06 8l3.47-3.47Z"/></svg>`;
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
`;
|
|
5
|
+
const chevronDoubleRight16 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4.53 3.47a.75.75 0 0 0-1.06 1.06L6.94 8l-3.47 3.47a.75.75 0 1 0 1.06 1.06l4-4a.75.75 0 0 0 0-1.06l-4-4Z"/><path d="M9.53 3.47a.75.75 0 0 0-1.06 1.06L11.94 8l-3.47 3.47a.75.75 0 1 0 1.06 1.06l4-4a.75.75 0 0 0 0-1.06l-4-4Z"/></svg>`;
|
|
7
6
|
|
|
8
|
-
const
|
|
7
|
+
const chevronLeft16 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 1 0 1.06L7.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd"/></svg>`;
|
|
9
8
|
|
|
10
|
-
const
|
|
9
|
+
const chevronRight16 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"/></svg>`;
|
|
11
10
|
|
|
12
|
-
const
|
|
11
|
+
const cross16 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4.53 3.47a.75.75 0 0 0-1.06 1.06L6.94 8l-3.47 3.47a.75.75 0 1 0 1.06 1.06L8 9.06l3.47 3.47a.75.75 0 1 0 1.06-1.06L9.06 8l3.47-3.47a.75.75 0 0 0-1.06-1.06L8 6.94 4.53 3.47Z"/></svg>`;
|
|
13
12
|
|
|
14
|
-
const
|
|
13
|
+
const alertCircleOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 16a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.25-8a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 1.5 0V8Z"/><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Z" clip-rule="evenodd"/></svg>`;
|
|
15
14
|
|
|
16
|
-
const
|
|
15
|
+
const calendarOutlined = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M17 2.25a.75.75 0 0 1 .75.75v.25H18A2.75 2.75 0 0 1 20.75 6v12A2.75 2.75 0 0 1 18 20.75H6A2.75 2.75 0 0 1 3.25 18V6A2.75 2.75 0 0 1 6 3.25h.25V3a.75.75 0 0 1 1.5 0v.25h8.5V3a.75.75 0 0 1 .75-.75ZM6 4.75c-.69 0-1.25.56-1.25 1.25v2.25h14.5V6c0-.69-.56-1.25-1.25-1.25H6Zm-1.25 5V18c0 .69.56 1.25 1.25 1.25h12c.69 0 1.25-.56 1.25-1.25V9.75H4.75Z" clip-rule="evenodd"/></svg>`;
|
|
17
16
|
|
|
18
|
-
const
|
|
17
|
+
const checkCircleFilled = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.768-12.36a1 1 0 1 0-1.536-1.28l-4.3 5.159-2.225-2.226a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.475-.067l5-6Z" clip-rule="evenodd"/></svg>`;
|
|
19
18
|
|
|
20
|
-
const
|
|
19
|
+
const chevronDownOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M6.47 9.47a.75.75 0 0 1 1.06 0L12 13.94l4.47-4.47a.75.75 0 1 1 1.06 1.06l-5 5a.75.75 0 0 1-1.06 0l-5-5a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"/></svg>`;
|
|
21
20
|
|
|
22
|
-
const
|
|
21
|
+
const chevronLeftOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M14.53 6.47a.75.75 0 0 1 0 1.06L10.06 12l4.47 4.47a.75.75 0 1 1-1.06 1.06l-5-5a.75.75 0 0 1 0-1.06l5-5a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd"/></svg>`;
|
|
23
22
|
|
|
24
|
-
const
|
|
23
|
+
const chevronRightOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M9.47 6.47a.75.75 0 0 1 1.06 0l5 5a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 1 1-1.06-1.06L13.94 12 9.47 7.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"/></svg>`;
|
|
25
24
|
|
|
26
|
-
const
|
|
25
|
+
const clockFilled = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1-15a1 1 0 1 0-2 0v5a1 1 0 0 0 1 1h5a1 1 0 1 0 0-2h-4V7Z" clip-rule="evenodd"/></svg>`;
|
|
27
26
|
|
|
28
|
-
const
|
|
29
|
-
`;
|
|
27
|
+
const clockOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.75 7a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h5a.75.75 0 0 0 0-1.5h-4.25V7Z"/><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0Z" clip-rule="evenodd"/></svg>`;
|
|
30
28
|
|
|
31
|
-
const
|
|
32
|
-
`;
|
|
29
|
+
const crossCircleFilled = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>`;
|
|
33
30
|
|
|
34
|
-
const
|
|
31
|
+
const crossCircleOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.47 8.47a.75.75 0 0 1 1.06 0L12 10.94l2.47-2.47a.75.75 0 1 1 1.06 1.06L13.06 12l2.47 2.47a.75.75 0 1 1-1.06 1.06L12 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L10.94 12 8.47 9.53a.75.75 0 0 1 0-1.06Z"/><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0Z" clip-rule="evenodd"/></svg>`;
|
|
32
|
+
|
|
33
|
+
const crossOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.53 6.47a.75.75 0 0 0-1.06 1.06L10.94 12l-4.47 4.47a.75.75 0 1 0 1.06 1.06L12 13.06l4.47 4.47a.75.75 0 1 0 1.06-1.06L13.06 12l4.47-4.47a.75.75 0 0 0-1.06-1.06L12 10.94 7.53 6.47Z"/></svg>`;
|
|
34
|
+
|
|
35
|
+
const dangerFilled = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 3.25c-.429 0-.85.113-1.22.328a2.5 2.5 0 0 0-.899.891L2.577 16.981a2.554 2.554 0 0 0-.007 2.491c.212.381.519.7.891.926a2.44 2.44 0 0 0 1.234.352h14.61a2.44 2.44 0 0 0 1.233-.352 2.5 2.5 0 0 0 .892-.926 2.553 2.553 0 0 0-.007-2.491L14.119 4.469a2.494 2.494 0 0 0-.899-.891A2.439 2.439 0 0 0 12 3.25ZM12 8a1 1 0 0 1 1 1v3.5a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" clip-rule="evenodd"/></svg>`;
|
|
36
|
+
|
|
37
|
+
const eyeClosedOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.608 7.948a.75.75 0 1 0-1.234.853 12.396 12.396 0 0 0 2.255 2.438l-2.574 2.574a.75.75 0 0 0 1.061 1.06l2.738-2.737c1.283.824 2.777 1.433 4.396 1.58V17a.75.75 0 0 0 1.5 0v-3.284c1.618-.148 3.11-.76 4.392-1.584l2.742 2.742a.75.75 0 0 0 1.06-1.06l-2.579-2.58a12.5 12.5 0 0 0 2.251-2.432.75.75 0 0 0-1.232-.855C17.965 9.99 15.144 12.25 12 12.25c-3.153 0-5.978-2.255-7.392-4.302Z"/></svg>`;
|
|
38
|
+
|
|
39
|
+
const eyeOpenOutlined = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 8.25a3.75 3.75 0 1 0 0 7.5 3.75 3.75 0 0 0 0-7.5ZM9.75 12a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12 4.25c-2.735 0-5.158 1.37-6.872 2.948-.862.794-1.567 1.66-2.062 2.475-.479.79-.816 1.62-.816 2.327 0 .707.337 1.538.816 2.327.495.815 1.2 1.68 2.062 2.475C6.842 18.38 9.265 19.75 12 19.75c2.737 0 5.16-1.379 6.873-2.96.861-.795 1.566-1.662 2.06-2.475.479-.786.817-1.614.817-2.315 0-.7-.338-1.529-.817-2.315-.494-.813-1.199-1.68-2.06-2.475C17.16 5.629 14.737 4.25 12 4.25ZM3.75 12c0-.293.167-.837.598-1.548.416-.685 1.03-1.444 1.796-2.15C7.688 6.88 9.764 5.75 12 5.75c2.234 0 4.31 1.136 5.855 2.562.767.708 1.38 1.468 1.797 2.153.433.71.598 1.25.598 1.535 0 .285-.165.824-.598 1.535-.416.685-1.03 1.445-1.797 2.153-1.544 1.426-3.621 2.562-5.855 2.562-2.235 0-4.312-1.13-5.856-2.552-.767-.706-1.38-1.465-1.796-2.15-.431-.71-.598-1.255-.598-1.548Z" clip-rule="evenodd"/></svg>`;
|
|
40
|
+
|
|
41
|
+
const infoCircleFilled = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM13 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 3.5a1 1 0 1 0-2 0V16a1 1 0 1 0 2 0v-4.5Z" clip-rule="evenodd"/></svg>`;
|
|
42
|
+
|
|
43
|
+
const starCircleFilled = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-7.82-3.001L12 5 9.82 8.999l-4.477.838 3.129 3.31-.587 4.516L12 15.71l4.114 1.953-.586-4.517 3.13-3.31L14.18 9Z" clip-rule="evenodd"/></svg>`;
|
|
35
44
|
|
|
36
45
|
class CatIconRegistry {
|
|
37
46
|
constructor() {
|
|
@@ -46,6 +55,12 @@ class CatIconRegistry {
|
|
|
46
55
|
'alert-success': checkCircleFilled,
|
|
47
56
|
'alert-warning': dangerFilled,
|
|
48
57
|
'alert-danger': crossCircleFilled,
|
|
58
|
+
'datepicker-month-prev': chevronLeft16,
|
|
59
|
+
'datepicker-month-next': chevronRight16,
|
|
60
|
+
'datepicker-year-prev': chevronDoubleLeft16,
|
|
61
|
+
'datepicker-year-next': chevronDoubleRight16,
|
|
62
|
+
'datepicker-calendar': calendarOutlined,
|
|
63
|
+
'timepicker-clock': clockOutlined,
|
|
49
64
|
'dialog-close': crossOutlined,
|
|
50
65
|
'input-close': crossCircleOutlined,
|
|
51
66
|
'input-error': alertCircleOutlined,
|
|
@@ -86,7 +101,7 @@ class CatIconRegistry {
|
|
|
86
101
|
getIcon(name, setName) {
|
|
87
102
|
const icon = this.icons.get(this.buildName(name, setName));
|
|
88
103
|
if (!icon) {
|
|
89
|
-
|
|
104
|
+
log.error(`[CatIconRegistry::${this.id}] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);
|
|
90
105
|
}
|
|
91
106
|
return icon;
|
|
92
107
|
}
|
|
@@ -94,14 +109,14 @@ class CatIconRegistry {
|
|
|
94
109
|
const iconEntries = Object.entries(icons);
|
|
95
110
|
const iconSize = iconEntries.length;
|
|
96
111
|
iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));
|
|
97
|
-
|
|
112
|
+
log.info(`[CatIconRegistry::${this.id}] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`);
|
|
98
113
|
!silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));
|
|
99
114
|
return this;
|
|
100
115
|
}
|
|
101
116
|
removeIcons(names, setName, silent = false) {
|
|
102
117
|
const iconSize = names.length;
|
|
103
118
|
names.forEach(name => this.icons.delete(this.buildName(name, setName)));
|
|
104
|
-
|
|
119
|
+
log.info(`[CatIconRegistry::${this.id}] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` from set ${setName}` : ''}`);
|
|
105
120
|
!silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));
|
|
106
121
|
return this;
|
|
107
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-icon-registry.js","mappings":"
|
|
1
|
+
{"file":"cat-icon-registry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuBa,eAAe;IAM1B;;QAHiB,OAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACnD,UAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;;QAMtD,IAAI,CAAC,QAAQ,CACX;YACE,eAAe,EAAE,gBAAgB;YACjC,iBAAiB,EAAE,WAAW;YAC9B,YAAY,EAAE,gBAAgB;YAC9B,eAAe,EAAE,iBAAiB;YAClC,eAAe,EAAE,YAAY;YAC7B,cAAc,EAAE,iBAAiB;YACjC,uBAAuB,EAAE,aAAa;YACtC,uBAAuB,EAAE,cAAc;YACvC,sBAAsB,EAAE,mBAAmB;YAC3C,sBAAsB,EAAE,oBAAoB;YAC5C,qBAAqB,EAAE,gBAAgB;YACvC,kBAAkB,EAAE,aAAa;YACjC,cAAc,EAAE,aAAa;YAC7B,aAAa,EAAE,mBAAmB;YAClC,aAAa,EAAE,mBAAmB;YAClC,qBAAqB,EAAE,eAAe;YAC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AAG,aAAa,OAAO,EAAE,GAAG,EACrC,EAAE,CACH,CAAC;QACF,CAAC,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACvG,OAAO,IAAI,CAAC;KACb;IAEO,SAAS,CAAC,IAAY,EAAE,OAAgB;QAC9C,OAAO,OAAO,GAAG,GAAG,OAAO,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC;KAC9C;IAEO,UAAU,CAAI,IAAY,EAAE,MAAU;QAC5C,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM;SACP,CAAC,CAAC;KACJ;CACF;MAEY,eAAe,GAAG,eAAe,CAAC,WAAW;;;;","names":[],"sources":["src/components/cat-icon/cat-icon-registry.ts"],"sourcesContent":["import chevronDoubleLeft16 from '@haiilo/catalyst-icons/src/16-chevron-double-left.svg';\nimport chevronDoubleRight16 from '@haiilo/catalyst-icons/src/16-chevron-double-right.svg';\nimport chevronLeft16 from '@haiilo/catalyst-icons/src/16-chevron-left.svg';\nimport chevronRight16 from '@haiilo/catalyst-icons/src/16-chevron-right.svg';\nimport cross16 from '@haiilo/catalyst-icons/src/16-cross.svg';\nimport alertCircleOutlined from '@haiilo/catalyst-icons/src/alert-circle-outlined.svg';\nimport calendarOutlined from '@haiilo/catalyst-icons/src/calendar-outlined.svg';\nimport checkCircleFilled from '@haiilo/catalyst-icons/src/check-circle-filled.svg';\nimport chevronDownOutlined from '@haiilo/catalyst-icons/src/chevron-down-outlined.svg';\nimport chevronLeftOutlined from '@haiilo/catalyst-icons/src/chevron-left-outlined.svg';\nimport chevronRightOutlined from '@haiilo/catalyst-icons/src/chevron-right-outlined.svg';\nimport clockFilled from '@haiilo/catalyst-icons/src/clock-filled.svg';\nimport clockOutlined from '@haiilo/catalyst-icons/src/clock-outlined.svg';\nimport crossCircleFilled from '@haiilo/catalyst-icons/src/cross-circle-filled.svg';\nimport crossCircleOutlined from '@haiilo/catalyst-icons/src/cross-circle-outlined.svg';\nimport crossOutlined from '@haiilo/catalyst-icons/src/cross-outlined.svg';\nimport dangerFilled from '@haiilo/catalyst-icons/src/danger-filled.svg';\nimport eyeClosedOutlined from '@haiilo/catalyst-icons/src/eye-closed-outlined.svg';\nimport eyeOpenOutlined from '@haiilo/catalyst-icons/src/eye-open-outlined.svg';\nimport infoCircleFilled from '@haiilo/catalyst-icons/src/info-circle-filled.svg';\nimport starCircleFilled from '@haiilo/catalyst-icons/src/star-circle-filled.svg';\nimport log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // register default icons that are used in the framework by other components\n this.addIcons(\n {\n 'alert-primary': starCircleFilled,\n 'alert-secondary': clockFilled,\n 'alert-info': infoCircleFilled,\n 'alert-success': checkCircleFilled,\n 'alert-warning': dangerFilled,\n 'alert-danger': crossCircleFilled,\n 'datepicker-month-prev': chevronLeft16,\n 'datepicker-month-next': chevronRight16,\n 'datepicker-year-prev': chevronDoubleLeft16,\n 'datepicker-year-next': chevronDoubleRight16,\n 'datepicker-calendar': calendarOutlined,\n 'timepicker-clock': clockOutlined,\n 'dialog-close': crossOutlined,\n 'input-close': crossCircleOutlined,\n 'input-error': alertCircleOutlined,\n 'input-password-show': eyeOpenOutlined,\n 'input-password-hide': eyeClosedOutlined,\n 'notification-close': crossCircleOutlined,\n 'pagination-left': chevronLeftOutlined,\n 'pagination-right': chevronRightOutlined,\n 'select-clear': cross16,\n 'select-open': chevronDownOutlined\n },\n '$cat',\n true\n );\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when icons are added or removed in other\n // applications and add or remove icons if the event was not dispatched by\n // this registry.\n window.addEventListener('cat-icons-added', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.addIcons(detail.icons, detail.setName, true);\n }\n });\n window.addEventListener('cat-icons-removed', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.removeIcons(detail.names, detail.setName, true);\n }\n });\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry::${this.id}] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string, silent = false): CatIconRegistry {\n const iconEntries = Object.entries(icons);\n const iconSize = iconEntries.length;\n iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(\n `[CatIconRegistry::${this.id}] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`\n );\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string, silent = false): CatIconRegistry {\n const iconSize = names.length;\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(\n `[CatIconRegistry::${this.id}] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${\n setName ? ` from set ${setName}` : ''\n }`\n );\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:${name}` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n"],"version":3}
|
|
@@ -2,6 +2,7 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
|
|
|
2
2
|
import { c as catIconRegistry } from './cat-icon-registry.js';
|
|
3
3
|
|
|
4
4
|
const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}span{display:inline-flex}svg{fill:currentColor;stroke:none;transform-origin:center center;height:1em;width:calc(var(--cat-icon-ratio, 1) * 1em)}.icon-xs svg{font-size:0.75rem}.icon-s svg{font-size:1rem}.icon-m svg{font-size:1.25rem}.icon-l svg{font-size:1.5rem}.icon-xl svg{font-size:1.75rem}";
|
|
5
|
+
const CatIconStyle0 = catIconCss;
|
|
5
6
|
|
|
6
7
|
const CatIcon = /*@__PURE__*/ proxyCustomElement(class CatIcon extends HTMLElement {
|
|
7
8
|
constructor() {
|
|
@@ -14,12 +15,12 @@ const CatIcon = /*@__PURE__*/ proxyCustomElement(class CatIcon extends HTMLEleme
|
|
|
14
15
|
this.a11yLabel = undefined;
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
|
-
return (h("span", { innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
18
|
+
return (h("span", { key: 'ace2ec39a623d9c8168269a5b4c46c4efef2fbc7', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
18
19
|
icon: true,
|
|
19
20
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
20
21
|
} }));
|
|
21
22
|
}
|
|
22
|
-
static get style() { return
|
|
23
|
+
static get style() { return CatIconStyle0; }
|
|
23
24
|
}, [1, "cat-icon", {
|
|
24
25
|
"icon": [1],
|
|
25
26
|
"iconSrc": [1, "icon-src"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-icon2.js","mappings":";;;AAAA,MAAM,UAAU,GAAG,mbAAmb;;
|
|
1
|
+
{"file":"cat-icon2.js","mappings":";;;AAAA,MAAM,UAAU,GAAG,mbAAmb,CAAC;AACvc,sBAAe,UAAU;;MCaZ,OAAO;;;;;;;oBAcuC,GAAG;;;IAQ5D,MAAM;QACJ,QACE,6DACE,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,GAAGA,eAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,gBAC1D,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,MAAM,EAC3C,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI;gBACV,CAAC,QAAQ,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,KAAK,QAAQ;aAC9C,GACK,EACR;KACH;;;;;;;;;;;;;;;;;;;;;;;;","names":["icons"],"sources":["src/components/cat-icon/cat-icon.scss?tag=cat-icon&encapsulation=shadow","src/components/cat-icon/cat-icon.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n$icon-sizes: (\n 'xl': 1.75rem,\n 'l': 1.5rem,\n 'm': 1.25rem,\n 's': 1rem,\n 'xs': 0.75rem\n);\n\n:host {\n /**\n * @prop --cat-icon-ratio: The aspect ratio of the avatar.\n */\n display: inline-flex;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\nspan {\n display: inline-flex;\n}\n\nsvg {\n fill: currentColor;\n stroke: none;\n transform-origin: center center;\n height: 1em;\n width: calc(var(--cat-icon-ratio, 1) * 1em);\n}\n\n// ----- size\n\n@mixin size($size) {\n .icon-#{$size} svg {\n font-size: map.get($icon-sizes, $size);\n }\n}\n\n@include size('xs');\n@include size('s');\n@include size('m');\n@include size('l');\n@include size('xl');\n","import { Component, h, Prop } from '@stencil/core';\nimport { catIconRegistry as icons } from './cat-icon-registry';\n\n/**\n * Icons are used to provide additional meaning or in places where text label\n * doesn't fit.\n *\n * @part icon - The span element wrapping the SVG icon.\n */\n@Component({\n tag: 'cat-icon',\n styleUrl: 'cat-icon.scss',\n shadow: true\n})\nexport class CatIcon {\n /**\n * The name of the icon.\n */\n @Prop() icon?: string;\n\n /**\n * The SVG source of the icon. This takes precenedence over the `icon` name.\n */\n @Prop() iconSrc?: string;\n\n /**\n * The size of the icon.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the icon that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n innerHTML={this.iconSrc || (this.icon ? icons.getIcon(this.icon) : '')}\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n part=\"icon\"\n class={{\n icon: true,\n [`icon-${this.size}`]: this.size !== 'inline'\n }}\n ></span>\n );\n }\n}\n"],"version":3}
|