@haiilo/catalyst 0.3.2 → 0.5.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/app-globals-23d8c4a8.js +948 -0
- package/dist/catalyst/app-globals-23d8c4a8.js.map +1 -0
- package/dist/catalyst/app-globals-3dd6a26b.js +948 -0
- package/dist/catalyst/app-globals-3dd6a26b.js.map +1 -0
- package/dist/catalyst/app-globals-42ce39cc.js +948 -0
- package/dist/catalyst/app-globals-42ce39cc.js.map +1 -0
- package/dist/catalyst/app-globals-5cf43b57.js +949 -0
- package/dist/catalyst/app-globals-5cf43b57.js.map +1 -0
- package/dist/catalyst/app-globals-8598c768.js +948 -0
- package/dist/catalyst/app-globals-8598c768.js.map +1 -0
- package/dist/catalyst/app-globals-a41af143.js +948 -0
- package/dist/catalyst/app-globals-a41af143.js.map +1 -0
- package/dist/catalyst/app-globals-c6a8b994.js +949 -0
- package/dist/catalyst/app-globals-c6a8b994.js.map +1 -0
- package/dist/catalyst/cat-alert.entry.js +33 -0
- package/dist/catalyst/cat-alert.entry.js.map +1 -0
- package/dist/catalyst/cat-badge.entry.js +44 -0
- package/dist/catalyst/cat-badge.entry.js.map +1 -0
- package/dist/catalyst/cat-button.entry.js +298 -0
- package/dist/catalyst/cat-button.entry.js.map +1 -0
- package/dist/catalyst/cat-card.entry.js +17 -0
- package/dist/catalyst/cat-card.entry.js.map +1 -0
- package/dist/catalyst/cat-checkbox.entry.js +75 -0
- package/dist/catalyst/cat-checkbox.entry.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js +75 -0
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-330db605.js +74 -0
- package/dist/catalyst/cat-i18n-registry-330db605.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-83d20604.js +74 -0
- package/dist/catalyst/cat-i18n-registry-83d20604.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-dd55821d.js +73 -0
- package/dist/catalyst/cat-i18n-registry-dd55821d.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-f6560651.js +75 -0
- package/dist/catalyst/cat-i18n-registry-f6560651.js.map +1 -0
- package/dist/{esm/cat-icon-registry-59da2e37.js → catalyst/cat-icon-registry-2dcfc9fb.js} +16 -2
- package/dist/catalyst/cat-icon-registry-2dcfc9fb.js.map +1 -0
- package/dist/catalyst/cat-icon.entry.js +31 -0
- package/dist/catalyst/cat-icon.entry.js.map +1 -0
- package/dist/catalyst/cat-input.entry.js +111 -0
- package/dist/catalyst/cat-input.entry.js.map +1 -0
- package/dist/catalyst/cat-menu.entry.js +850 -0
- package/dist/catalyst/cat-menu.entry.js.map +1 -0
- package/dist/catalyst/cat-radio.entry.js +66 -0
- package/dist/catalyst/cat-radio.entry.js.map +1 -0
- package/dist/catalyst/cat-scrollable.entry.js +4522 -0
- package/dist/catalyst/cat-scrollable.entry.js.map +1 -0
- package/dist/catalyst/cat-skeleton.entry.js +55 -0
- package/dist/catalyst/cat-skeleton.entry.js.map +1 -0
- package/dist/catalyst/cat-spinner.entry.js +23 -0
- package/dist/catalyst/cat-spinner.entry.js.map +1 -0
- package/dist/catalyst/cat-textarea.entry.js +87 -0
- package/dist/catalyst/cat-textarea.entry.js.map +1 -0
- package/dist/catalyst/cat-toggle.entry.js +66 -0
- package/dist/catalyst/cat-toggle.entry.js.map +1 -0
- package/dist/catalyst/cat-tooltip.entry.js +129 -0
- package/dist/catalyst/cat-tooltip.entry.js.map +1 -0
- package/dist/catalyst/catalyst.css +2033 -1
- package/dist/catalyst/catalyst.esm.js +133 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/css-shim-e6dd2538.js +6 -0
- package/dist/catalyst/css-shim-e6dd2538.js.map +1 -0
- package/dist/catalyst/dom-7fc649b0.js +75 -0
- package/dist/catalyst/dom-7fc649b0.js.map +1 -0
- package/dist/catalyst/first-tabbable-2d9f9e9a.js +2123 -0
- package/dist/catalyst/first-tabbable-2d9f9e9a.js.map +1 -0
- package/dist/catalyst/index-471d4e05.js +3059 -0
- package/dist/catalyst/index-471d4e05.js.map +1 -0
- package/dist/catalyst/index-bbb694f5.js +3059 -0
- package/dist/catalyst/index-bbb694f5.js.map +1 -0
- package/dist/catalyst/index.esm.js +4 -1
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/loglevel-7f0f71af.js +346 -0
- package/dist/catalyst/loglevel-7f0f71af.js.map +1 -0
- package/dist/catalyst/shadow-css-4d56fa31.js +390 -0
- package/dist/catalyst/shadow-css-4d56fa31.js.map +1 -0
- package/dist/cjs/app-globals-aaefc070.js +950 -0
- package/dist/cjs/app-globals-aaefc070.js.map +1 -0
- package/dist/cjs/cat-alert.cjs.entry.js +37 -0
- package/dist/cjs/cat-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-badge.cjs.entry.js +48 -0
- package/dist/cjs/cat-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-button.cjs.entry.js +302 -0
- package/dist/cjs/cat-button.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-card.cjs.entry.js +21 -0
- package/dist/cjs/cat-card.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-checkbox.cjs.entry.js +79 -0
- package/dist/cjs/cat-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-i18n-registry-a1379d1e.js +76 -0
- package/dist/cjs/cat-i18n-registry-a1379d1e.js.map +1 -0
- package/dist/cjs/{cat-icon-registry-850c538c.js → cat-icon-registry-74247389.js} +16 -2
- package/dist/cjs/cat-icon-registry-74247389.js.map +1 -0
- package/dist/cjs/cat-icon.cjs.entry.js +35 -0
- package/dist/cjs/cat-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-input.cjs.entry.js +115 -0
- package/dist/cjs/cat-input.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-menu.cjs.entry.js +854 -0
- package/dist/cjs/cat-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-radio.cjs.entry.js +70 -0
- package/dist/cjs/cat-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-scrollable.cjs.entry.js +4526 -0
- package/dist/cjs/cat-scrollable.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-skeleton.cjs.entry.js +59 -0
- package/dist/cjs/cat-skeleton.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-spinner.cjs.entry.js +27 -0
- package/dist/cjs/cat-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-textarea.cjs.entry.js +91 -0
- package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-toggle.cjs.entry.js +70 -0
- package/dist/cjs/cat-toggle.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-tooltip.cjs.entry.js +133 -0
- package/dist/cjs/cat-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +118 -6
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/css-shim-6ca600c2.js +8 -0
- package/dist/cjs/css-shim-6ca600c2.js.map +1 -0
- package/dist/cjs/dom-8d415461.js +77 -0
- package/dist/cjs/dom-8d415461.js.map +1 -0
- package/dist/cjs/first-tabbable-2068dcc6.js +2133 -0
- package/dist/cjs/first-tabbable-2068dcc6.js.map +1 -0
- package/dist/cjs/index-abcb3941.js +3094 -0
- package/dist/cjs/index-abcb3941.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +20 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/loglevel-24040e9d.js +348 -0
- package/dist/cjs/loglevel-24040e9d.js.map +1 -0
- package/dist/cjs/shadow-css-78860e39.js +392 -0
- package/dist/cjs/shadow-css-78860e39.js.map +1 -0
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/cat-alert/cat-alert.css +11 -6
- package/dist/collection/components/cat-alert/cat-alert.js +19 -8
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.css +17 -17
- package/dist/collection/components/cat-badge/cat-badge.js +9 -8
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +18 -8
- package/dist/collection/components/cat-button/cat-button.js +32 -8
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.css +25 -0
- package/dist/collection/components/cat-card/cat-card.js +20 -0
- package/dist/collection/components/cat-card/cat-card.js.map +1 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +105 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +314 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +70 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -0
- package/dist/collection/components/cat-icon/cat-icon-registry.js +14 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.css +5 -5
- package/dist/collection/components/cat-icon/cat-icon.js +3 -2
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +131 -0
- package/dist/collection/components/cat-input/cat-input.js +606 -0
- package/dist/collection/components/cat-input/cat-input.js.map +1 -0
- package/dist/collection/components/cat-menu/cat-menu.css +2 -1
- package/dist/collection/components/cat-menu/cat-menu.js +3 -5
- package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.css +84 -0
- package/dist/collection/components/cat-radio/cat-radio.js +283 -0
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +4 -2
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +30 -30
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +4 -4
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.css +7 -7
- package/dist/collection/components/cat-spinner/cat-spinner.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +74 -0
- package/dist/collection/components/cat-textarea/cat-textarea.js +393 -0
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -0
- package/dist/collection/components/cat-toggle/cat-toggle.css +93 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js +283 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +41 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +254 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/init.js +9 -1
- package/dist/collection/init.js.map +1 -1
- package/dist/collection/utils/first-tabbable.js +6 -0
- package/dist/collection/utils/first-tabbable.js.map +1 -0
- package/dist/collection/utils/is-touch-screen.js +3 -0
- package/dist/collection/utils/is-touch-screen.js.map +1 -0
- package/dist/components/cat-alert.js +15 -6
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-badge.js +7 -7
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button.js +1 -647
- package/dist/components/cat-button.js.map +1 -1
- package/dist/components/cat-button2.js +346 -0
- package/dist/components/cat-button2.js.map +1 -0
- package/dist/components/cat-card.d.ts +11 -0
- package/dist/components/cat-card.js +35 -0
- package/dist/components/cat-card.js.map +1 -0
- package/dist/components/cat-checkbox.d.ts +11 -0
- package/dist/components/cat-checkbox.js +103 -0
- package/dist/components/cat-checkbox.js.map +1 -0
- package/dist/components/cat-i18n-registry.js +74 -0
- package/dist/components/cat-i18n-registry.js.map +1 -0
- package/dist/components/cat-icon-registry.js +15 -1
- 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-input.d.ts +11 -0
- package/dist/components/cat-input.js +172 -0
- package/dist/components/cat-input.js.map +1 -0
- package/dist/components/cat-menu.js +12 -1520
- package/dist/components/cat-menu.js.map +1 -1
- package/dist/components/cat-radio.d.ts +11 -0
- package/dist/components/cat-radio.js +93 -0
- package/dist/components/cat-radio.js.map +1 -0
- package/dist/components/cat-scrollable.js +3210 -25
- package/dist/components/cat-scrollable.js.map +1 -1
- package/dist/components/cat-skeleton.js +5 -5
- package/dist/components/cat-skeleton.js.map +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-textarea.d.ts +11 -0
- package/dist/components/cat-textarea.js +119 -0
- package/dist/components/cat-textarea.js.map +1 -0
- package/dist/components/cat-toggle.d.ts +11 -0
- package/dist/components/cat-toggle.js +93 -0
- package/dist/components/cat-toggle.js.map +1 -0
- package/dist/components/cat-tooltip.d.ts +11 -0
- package/dist/components/cat-tooltip.js +154 -0
- package/dist/components/cat-tooltip.js.map +1 -0
- package/dist/components/first-tabbable.js +2123 -0
- package/dist/components/first-tabbable.js.map +1 -0
- package/dist/components/index.js +778 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/loglevel.js +346 -0
- package/dist/components/loglevel.js.map +1 -0
- package/dist/esm/app-globals-3dd6a26b.js +948 -0
- package/dist/esm/app-globals-3dd6a26b.js.map +1 -0
- package/dist/esm/cat-alert.entry.js +33 -0
- package/dist/esm/cat-alert.entry.js.map +1 -0
- package/dist/esm/cat-badge.entry.js +44 -0
- package/dist/esm/cat-badge.entry.js.map +1 -0
- package/dist/esm/cat-button.entry.js +298 -0
- package/dist/esm/cat-button.entry.js.map +1 -0
- package/dist/esm/cat-card.entry.js +17 -0
- package/dist/esm/cat-card.entry.js.map +1 -0
- package/dist/esm/cat-checkbox.entry.js +75 -0
- package/dist/esm/cat-checkbox.entry.js.map +1 -0
- package/dist/esm/cat-i18n-registry-83d20604.js +74 -0
- package/dist/esm/cat-i18n-registry-83d20604.js.map +1 -0
- package/dist/esm/cat-icon-registry-2dcfc9fb.js +59 -0
- package/dist/esm/cat-icon-registry-2dcfc9fb.js.map +1 -0
- package/dist/esm/cat-icon.entry.js +31 -0
- package/dist/esm/cat-icon.entry.js.map +1 -0
- package/dist/esm/cat-input.entry.js +111 -0
- package/dist/esm/cat-input.entry.js.map +1 -0
- package/dist/esm/cat-menu.entry.js +850 -0
- package/dist/esm/cat-menu.entry.js.map +1 -0
- package/dist/esm/cat-radio.entry.js +66 -0
- package/dist/esm/cat-radio.entry.js.map +1 -0
- package/dist/esm/cat-scrollable.entry.js +4522 -0
- package/dist/esm/cat-scrollable.entry.js.map +1 -0
- package/dist/esm/cat-skeleton.entry.js +55 -0
- package/dist/esm/cat-skeleton.entry.js.map +1 -0
- package/dist/esm/cat-spinner.entry.js +23 -0
- package/dist/esm/cat-spinner.entry.js.map +1 -0
- package/dist/esm/cat-textarea.entry.js +87 -0
- package/dist/esm/cat-textarea.entry.js.map +1 -0
- package/dist/esm/cat-toggle.entry.js +66 -0
- package/dist/esm/cat-toggle.entry.js.map +1 -0
- package/dist/esm/cat-tooltip.entry.js +129 -0
- package/dist/esm/cat-tooltip.entry.js.map +1 -0
- package/dist/esm/catalyst.js +118 -6
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/css-shim-e6dd2538.js +6 -0
- package/dist/esm/css-shim-e6dd2538.js.map +1 -0
- package/dist/esm/dom-7fc649b0.js +75 -0
- package/dist/esm/dom-7fc649b0.js.map +1 -0
- package/dist/esm/first-tabbable-2d9f9e9a.js +2123 -0
- package/dist/esm/first-tabbable-2d9f9e9a.js.map +1 -0
- package/dist/esm/index-471d4e05.js +3059 -0
- package/dist/esm/index-471d4e05.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +20 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/loglevel-7f0f71af.js +346 -0
- package/dist/esm/loglevel-7f0f71af.js.map +1 -0
- package/dist/esm/shadow-css-4d56fa31.js +390 -0
- package/dist/esm/shadow-css-4d56fa31.js.map +1 -0
- package/dist/types/components/cat-alert/cat-alert.d.ts +4 -2
- package/dist/types/components/cat-alert/cat-alert.e2e.d.ts +1 -0
- package/dist/types/components/cat-alert/cat-alert.spec.d.ts +1 -0
- package/dist/types/components/cat-badge/cat-badge.d.ts +3 -2
- package/dist/types/components/cat-badge/cat-badge.e2e.d.ts +1 -0
- package/dist/types/components/cat-badge/cat-badge.spec.d.ts +1 -0
- package/dist/types/components/cat-button/cat-button.d.ts +8 -3
- package/dist/types/components/cat-button/cat-button.e2e.d.ts +1 -0
- package/dist/types/components/cat-button/cat-button.spec.d.ts +1 -0
- package/dist/types/components/cat-card/cat-card.d.ts +7 -0
- package/dist/types/components/cat-card/cat-card.e2e.d.ts +1 -0
- package/dist/types/components/cat-card/cat-card.spec.d.ts +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +69 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.e2e.d.ts +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.spec.d.ts +1 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +18 -0
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +4 -4
- package/dist/types/components/cat-icon/cat-icon.d.ts +1 -1
- package/dist/types/components/cat-icon/cat-icon.e2e.d.ts +1 -0
- package/dist/types/components/cat-icon/cat-icon.spec.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.d.ts +130 -0
- package/dist/types/components/cat-input/cat-input.e2e.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.spec.d.ts +1 -0
- package/dist/types/components/cat-menu/cat-menu.d.ts +0 -1
- package/dist/types/components/cat-menu/cat-menu.e2e.d.ts +1 -0
- package/dist/types/components/cat-menu/cat-menu.spec.d.ts +1 -0
- package/dist/types/components/cat-radio/cat-radio.d.ts +63 -0
- package/dist/types/components/cat-radio/cat-radio.e2e.d.ts +1 -0
- package/dist/types/components/cat-radio/cat-radio.spec.d.ts +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +3 -1
- package/dist/types/components/cat-scrollable/cat-scrollable.e2e.d.ts +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.spec.d.ts +1 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.e2e.d.ts +1 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.spec.d.ts +1 -0
- package/dist/types/components/cat-spinner/cat-spinner.e2e.d.ts +1 -0
- package/dist/types/components/cat-spinner/cat-spinner.spec.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +85 -0
- package/dist/types/components/cat-textarea/cat-textarea.e2e.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.spec.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +64 -0
- package/dist/types/components/cat-toggle/cat-toggle.e2e.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.spec.d.ts +1 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +46 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.e2e.d.ts +1 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.spec.d.ts +1 -0
- package/dist/types/components.d.ts +680 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/first-tabbable.d.ts +4 -0
- package/dist/types/utils/is-touch-screen.d.ts +2 -0
- package/dist/types/utils/media-matcher.spec.d.ts +1 -0
- package/package.json +9 -7
- package/dist/catalyst/p-31b500c7.entry.js +0 -10
- package/dist/catalyst/p-31b500c7.entry.js.map +0 -1
- package/dist/catalyst/p-ed826597.js +0 -2
- package/dist/catalyst/p-ed826597.js.map +0 -1
- package/dist/catalyst/p-ef0a8ae9.js +0 -2
- package/dist/catalyst/p-ef0a8ae9.js.map +0 -1
- package/dist/catalyst/p-f151cb13.js +0 -2
- package/dist/catalyst/p-f151cb13.js.map +0 -1
- package/dist/cjs/app-globals-7f2b1f8e.js +0 -173
- package/dist/cjs/app-globals-7f2b1f8e.js.map +0 -1
- package/dist/cjs/cat-alert_8.cjs.entry.js +0 -4450
- package/dist/cjs/cat-alert_8.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-850c538c.js.map +0 -1
- package/dist/cjs/index-c0881ae0.js +0 -1348
- package/dist/cjs/index-c0881ae0.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/esm/app-globals-8af9b2cf.js +0 -171
- package/dist/esm/app-globals-8af9b2cf.js.map +0 -1
- package/dist/esm/cat-alert_8.entry.js +0 -4439
- package/dist/esm/cat-alert_8.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-59da2e37.js.map +0 -1
- package/dist/esm/index-0ff35bca.js +0 -1320
- package/dist/esm/index-0ff35bca.js.map +0 -1
- package/dist/types/utils/utils.d.ts +0 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Component, Event, h, Prop, Method } from '@stencil/core';
|
|
2
|
+
import log from 'loglevel';
|
|
3
|
+
let nextUniqueId = 0;
|
|
4
|
+
/**
|
|
5
|
+
* Toggles are graphical interface switches that give user control over a
|
|
6
|
+
* feature or option that can be turned on or off.
|
|
7
|
+
*
|
|
8
|
+
* @part toggle - The toggle element.
|
|
9
|
+
* @part label - The label content.
|
|
10
|
+
*/
|
|
11
|
+
export class CatToggle {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.id = `cat-toggle-${nextUniqueId++}`;
|
|
14
|
+
/**
|
|
15
|
+
* Checked state of the toggle.
|
|
16
|
+
*/
|
|
17
|
+
this.checked = false;
|
|
18
|
+
/**
|
|
19
|
+
* Disabled state of the toggle.
|
|
20
|
+
*/
|
|
21
|
+
this.disabled = false;
|
|
22
|
+
/**
|
|
23
|
+
* The label of the toggle that is visible.
|
|
24
|
+
*/
|
|
25
|
+
this.label = '';
|
|
26
|
+
/**
|
|
27
|
+
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
28
|
+
*/
|
|
29
|
+
this.labelHidden = false;
|
|
30
|
+
/**
|
|
31
|
+
* Required state of the toggle
|
|
32
|
+
*/
|
|
33
|
+
this.required = false;
|
|
34
|
+
}
|
|
35
|
+
componentWillRender() {
|
|
36
|
+
if (!this.label) {
|
|
37
|
+
log.error('[A11y] Missing ARIA label on toggle', this);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Sets focus on the toggle. Use this method instead of `toggle.focus()`.
|
|
42
|
+
*
|
|
43
|
+
* @param options An optional object providing options to control aspects of
|
|
44
|
+
* the focusing process.
|
|
45
|
+
*/
|
|
46
|
+
async setFocus(options) {
|
|
47
|
+
this.input.focus(options);
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return (h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled } },
|
|
51
|
+
h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }),
|
|
52
|
+
h("span", { class: "toggle", part: "toggle" }),
|
|
53
|
+
h("span", { class: "label", part: "label" }, this.label)));
|
|
54
|
+
}
|
|
55
|
+
onInput(event) {
|
|
56
|
+
this.catChange.emit(event);
|
|
57
|
+
}
|
|
58
|
+
onFocus(event) {
|
|
59
|
+
this.catFocus.emit(event);
|
|
60
|
+
}
|
|
61
|
+
onBlur(event) {
|
|
62
|
+
this.catBlur.emit(event);
|
|
63
|
+
}
|
|
64
|
+
static get is() { return "cat-toggle"; }
|
|
65
|
+
static get encapsulation() { return "shadow"; }
|
|
66
|
+
static get originalStyleUrls() { return {
|
|
67
|
+
"$": ["cat-toggle.scss"]
|
|
68
|
+
}; }
|
|
69
|
+
static get styleUrls() { return {
|
|
70
|
+
"$": ["cat-toggle.css"]
|
|
71
|
+
}; }
|
|
72
|
+
static get properties() { return {
|
|
73
|
+
"checked": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "boolean",
|
|
78
|
+
"resolved": "boolean",
|
|
79
|
+
"references": {}
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"optional": false,
|
|
83
|
+
"docs": {
|
|
84
|
+
"tags": [],
|
|
85
|
+
"text": "Checked state of the toggle."
|
|
86
|
+
},
|
|
87
|
+
"attribute": "checked",
|
|
88
|
+
"reflect": false,
|
|
89
|
+
"defaultValue": "false"
|
|
90
|
+
},
|
|
91
|
+
"disabled": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "boolean",
|
|
96
|
+
"resolved": "boolean",
|
|
97
|
+
"references": {}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": false,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": "Disabled state of the toggle."
|
|
104
|
+
},
|
|
105
|
+
"attribute": "disabled",
|
|
106
|
+
"reflect": false,
|
|
107
|
+
"defaultValue": "false"
|
|
108
|
+
},
|
|
109
|
+
"label": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"mutable": false,
|
|
112
|
+
"complexType": {
|
|
113
|
+
"original": "string",
|
|
114
|
+
"resolved": "string",
|
|
115
|
+
"references": {}
|
|
116
|
+
},
|
|
117
|
+
"required": false,
|
|
118
|
+
"optional": false,
|
|
119
|
+
"docs": {
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": "The label of the toggle that is visible."
|
|
122
|
+
},
|
|
123
|
+
"attribute": "label",
|
|
124
|
+
"reflect": false,
|
|
125
|
+
"defaultValue": "''"
|
|
126
|
+
},
|
|
127
|
+
"labelHidden": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "boolean",
|
|
132
|
+
"resolved": "boolean",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
140
|
+
},
|
|
141
|
+
"attribute": "label-hidden",
|
|
142
|
+
"reflect": false,
|
|
143
|
+
"defaultValue": "false"
|
|
144
|
+
},
|
|
145
|
+
"name": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "string",
|
|
150
|
+
"resolved": "string | undefined",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": true,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "The name of the input"
|
|
158
|
+
},
|
|
159
|
+
"attribute": "name",
|
|
160
|
+
"reflect": false
|
|
161
|
+
},
|
|
162
|
+
"required": {
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "boolean",
|
|
167
|
+
"resolved": "boolean",
|
|
168
|
+
"references": {}
|
|
169
|
+
},
|
|
170
|
+
"required": false,
|
|
171
|
+
"optional": false,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": "Required state of the toggle"
|
|
175
|
+
},
|
|
176
|
+
"attribute": "required",
|
|
177
|
+
"reflect": false,
|
|
178
|
+
"defaultValue": "false"
|
|
179
|
+
},
|
|
180
|
+
"value": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"mutable": false,
|
|
183
|
+
"complexType": {
|
|
184
|
+
"original": "string",
|
|
185
|
+
"resolved": "string | undefined",
|
|
186
|
+
"references": {}
|
|
187
|
+
},
|
|
188
|
+
"required": false,
|
|
189
|
+
"optional": true,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "The value of the toggle"
|
|
193
|
+
},
|
|
194
|
+
"attribute": "value",
|
|
195
|
+
"reflect": false
|
|
196
|
+
}
|
|
197
|
+
}; }
|
|
198
|
+
static get events() { return [{
|
|
199
|
+
"method": "catChange",
|
|
200
|
+
"name": "catChange",
|
|
201
|
+
"bubbles": true,
|
|
202
|
+
"cancelable": true,
|
|
203
|
+
"composed": true,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [],
|
|
206
|
+
"text": "Emitted when the checked status of the toggle is changed."
|
|
207
|
+
},
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "any",
|
|
210
|
+
"resolved": "any",
|
|
211
|
+
"references": {}
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
"method": "catFocus",
|
|
215
|
+
"name": "catFocus",
|
|
216
|
+
"bubbles": true,
|
|
217
|
+
"cancelable": true,
|
|
218
|
+
"composed": true,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": "Emitted when the toggle received focus."
|
|
222
|
+
},
|
|
223
|
+
"complexType": {
|
|
224
|
+
"original": "FocusEvent",
|
|
225
|
+
"resolved": "FocusEvent",
|
|
226
|
+
"references": {
|
|
227
|
+
"FocusEvent": {
|
|
228
|
+
"location": "global"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
"method": "catBlur",
|
|
234
|
+
"name": "catBlur",
|
|
235
|
+
"bubbles": true,
|
|
236
|
+
"cancelable": true,
|
|
237
|
+
"composed": true,
|
|
238
|
+
"docs": {
|
|
239
|
+
"tags": [],
|
|
240
|
+
"text": "Emitted when the toggle loses focus."
|
|
241
|
+
},
|
|
242
|
+
"complexType": {
|
|
243
|
+
"original": "FocusEvent",
|
|
244
|
+
"resolved": "FocusEvent",
|
|
245
|
+
"references": {
|
|
246
|
+
"FocusEvent": {
|
|
247
|
+
"location": "global"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}]; }
|
|
252
|
+
static get methods() { return {
|
|
253
|
+
"setFocus": {
|
|
254
|
+
"complexType": {
|
|
255
|
+
"signature": "(options?: FocusOptions | undefined) => Promise<void>",
|
|
256
|
+
"parameters": [{
|
|
257
|
+
"tags": [{
|
|
258
|
+
"name": "param",
|
|
259
|
+
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
260
|
+
}],
|
|
261
|
+
"text": "An optional object providing options to control aspects of\nthe focusing process."
|
|
262
|
+
}],
|
|
263
|
+
"references": {
|
|
264
|
+
"Promise": {
|
|
265
|
+
"location": "global"
|
|
266
|
+
},
|
|
267
|
+
"FocusOptions": {
|
|
268
|
+
"location": "global"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"return": "Promise<void>"
|
|
272
|
+
},
|
|
273
|
+
"docs": {
|
|
274
|
+
"text": "Sets focus on the toggle. Use this method instead of `toggle.focus()`.",
|
|
275
|
+
"tags": [{
|
|
276
|
+
"name": "param",
|
|
277
|
+
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
278
|
+
}]
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}; }
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=cat-toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cat-toggle.js","sourceRoot":"","sources":["../../../src/components/cat-toggle/cat-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,IAAI,YAAY,GAAG,CAAC,C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C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAChC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAC9B;MACF,YAAM,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,GAAQ;MAC1C,YAAM,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,IAC7B,IAAI,CAAC,KAAK,CACN,CACD,CACT,CAAC;EACJ,CAAC;EAEO,OAAO,CAAC,KAAY;IAC1B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC7B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Prop, Method } from '@stencil/core';\nimport log from 'loglevel';\n\nlet nextUniqueId = 0;\n\n/**\n * Toggles are graphical interface switches that give user control over a\n * feature or option that can be turned on or off.\n *\n * @part toggle - The toggle element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-toggle',\n styleUrls: ['cat-toggle.scss'],\n shadow: true\n})\nexport class CatToggle {\n private readonly id = `cat-toggle-${nextUniqueId++}`;\n private input!: HTMLInputElement;\n\n /**\n * Checked state of the toggle.\n */\n @Prop() checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * The label of the toggle that is visible.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input\n */\n @Prop() name?: string;\n\n /**\n * Required state of the toggle\n */\n @Prop() required = false;\n\n /**\n * The value of the toggle\n */\n @Prop() value?: string;\n\n /**\n * Emitted when the checked status of the toggle is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the toggle received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n if (!this.label) {\n log.error('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Sets focus on the toggle. Use this method instead of `toggle.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <label htmlFor={this.id} class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled }}>\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n class=\"form-check-input\"\n role=\"switch\"\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"toggle\" part=\"toggle\"></span>\n <span class=\"label\" part=\"label\">\n {this.label}\n </span>\n </label>\n );\n }\n\n private onInput(event: Event) {\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated file. Do not edit directly.
|
|
3
|
+
*/
|
|
4
|
+
/* stylelint-disable value-keyword-case */
|
|
5
|
+
/* stylelint-enable value-keyword-case */
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([hidden]) {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tooltip {
|
|
15
|
+
position: absolute;
|
|
16
|
+
font-size: 0.875rem;
|
|
17
|
+
line-height: 1rem;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
padding: 0.5rem 0.75rem;
|
|
20
|
+
background-color: white;
|
|
21
|
+
border-radius: 0.25rem;
|
|
22
|
+
color: black;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
transition: all 0.25s linear 0s;
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
box-shadow: rgba(0, 0, 0, 0.08) 0 1px 8px 0;
|
|
28
|
+
border: 1px solid #ebecf0;
|
|
29
|
+
z-index: 200;
|
|
30
|
+
}
|
|
31
|
+
.tooltip-show {
|
|
32
|
+
opacity: 1;
|
|
33
|
+
visibility: visible;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tooltip-trigger {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
}
|
|
39
|
+
.tooltip-trigger:focus {
|
|
40
|
+
outline: none;
|
|
41
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { Component, h, Host, Listen, Prop } from '@stencil/core';
|
|
2
|
+
import { autoUpdate, computePosition, flip, offset } from '@floating-ui/dom';
|
|
3
|
+
import isTouchScreen from '../../utils/is-touch-screen';
|
|
4
|
+
import firstTabbable from '../../utils/first-tabbable';
|
|
5
|
+
let nextUniqueId = 0;
|
|
6
|
+
export class CatTooltip {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.id = `cat-tooltip-${nextUniqueId++}`;
|
|
9
|
+
/**
|
|
10
|
+
* The content of the tooltip.
|
|
11
|
+
*/
|
|
12
|
+
this.content = '';
|
|
13
|
+
/**
|
|
14
|
+
* Specifies that the tooltip should be disabled. A disabled tooltip is unusable,
|
|
15
|
+
* and invisible. Corresponds with the native HTML disabled attribute.
|
|
16
|
+
*/
|
|
17
|
+
this.disabled = false;
|
|
18
|
+
/**
|
|
19
|
+
* The placement of the tooltip.
|
|
20
|
+
*/
|
|
21
|
+
this.placement = 'top';
|
|
22
|
+
/**
|
|
23
|
+
* The delay time for showing tooltip in ms.
|
|
24
|
+
*/
|
|
25
|
+
this.showDelay = 500;
|
|
26
|
+
/**
|
|
27
|
+
* The delay time for hiding tooltip in ms.
|
|
28
|
+
*/
|
|
29
|
+
this.hideDelay = 0;
|
|
30
|
+
/**
|
|
31
|
+
* The duration of tap to show the tooltip.
|
|
32
|
+
*/
|
|
33
|
+
this.longTouchDuration = 1000;
|
|
34
|
+
}
|
|
35
|
+
handleKeyDown({ key }) {
|
|
36
|
+
key === 'Escape' && this.hideListener();
|
|
37
|
+
}
|
|
38
|
+
componentDidLoad() {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
40
|
+
this.trigger = firstTabbable(this.triggerElement) || this.triggerElement;
|
|
41
|
+
if (!this.isTabbable) {
|
|
42
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('tabindex', '0');
|
|
43
|
+
}
|
|
44
|
+
if (this.trigger && this.tooltip) {
|
|
45
|
+
autoUpdate(this.trigger, this.tooltip, () => this.update());
|
|
46
|
+
}
|
|
47
|
+
if (isTouchScreen) {
|
|
48
|
+
(_b = this.trigger) === null || _b === void 0 ? void 0 : _b.addEventListener('touchstart', this.touchStartListener.bind(this));
|
|
49
|
+
(_c = this.trigger) === null || _c === void 0 ? void 0 : _c.addEventListener('touchend', this.touchEndListener.bind(this));
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
(_d = this.trigger) === null || _d === void 0 ? void 0 : _d.addEventListener('focusin', this.showListener.bind(this));
|
|
53
|
+
(_e = this.trigger) === null || _e === void 0 ? void 0 : _e.addEventListener('focusout', this.hideListener.bind(this));
|
|
54
|
+
(_f = this.trigger) === null || _f === void 0 ? void 0 : _f.addEventListener('mouseenter', this.showListener.bind(this));
|
|
55
|
+
(_g = this.trigger) === null || _g === void 0 ? void 0 : _g.addEventListener('mouseleave', this.hideListener.bind(this));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60
|
+
if (isTouchScreen) {
|
|
61
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.removeEventListener('touchstart', this.touchStartListener.bind(this));
|
|
62
|
+
(_b = this.trigger) === null || _b === void 0 ? void 0 : _b.removeEventListener('touchend', this.touchEndListener.bind(this));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
(_c = this.trigger) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseenter', this.showListener.bind(this));
|
|
66
|
+
(_d = this.trigger) === null || _d === void 0 ? void 0 : _d.removeEventListener('mouseleave', this.hideListener.bind(this));
|
|
67
|
+
(_e = this.trigger) === null || _e === void 0 ? void 0 : _e.removeEventListener('focusin', this.showListener.bind(this));
|
|
68
|
+
(_f = this.trigger) === null || _f === void 0 ? void 0 : _f.removeEventListener('focusout', this.hideListener.bind(this));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
return (h(Host, null,
|
|
73
|
+
h("div", { ref: el => (this.triggerElement = el), "aria-describedby": this.id, class: "tooltip-trigger" },
|
|
74
|
+
h("slot", null)),
|
|
75
|
+
this.content && !this.disabled && (h("div", { ref: el => (this.tooltip = el), id: this.id, class: "tooltip" }, this.content))));
|
|
76
|
+
}
|
|
77
|
+
get isTabbable() {
|
|
78
|
+
return firstTabbable(this.trigger);
|
|
79
|
+
}
|
|
80
|
+
update() {
|
|
81
|
+
if (this.trigger && this.tooltip) {
|
|
82
|
+
computePosition(this.trigger, this.tooltip, {
|
|
83
|
+
placement: this.placement,
|
|
84
|
+
middleware: [offset(CatTooltip.OFFSET), flip()]
|
|
85
|
+
}).then(({ x, y }) => {
|
|
86
|
+
if (this.tooltip) {
|
|
87
|
+
Object.assign(this.tooltip.style, {
|
|
88
|
+
left: `${Math.max(0, x)}px`,
|
|
89
|
+
top: `${y}px`
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
showListener() {
|
|
96
|
+
window.clearTimeout(this.hideTimeout);
|
|
97
|
+
this.showTimeout = window.setTimeout(() => {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.focus();
|
|
100
|
+
(_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.classList.add('tooltip-show');
|
|
101
|
+
}, this.showDelay);
|
|
102
|
+
}
|
|
103
|
+
hideListener() {
|
|
104
|
+
window.clearTimeout(this.showTimeout);
|
|
105
|
+
this.hideTimeout = window.setTimeout(() => {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.blur();
|
|
108
|
+
(_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.classList.remove('tooltip-show');
|
|
109
|
+
}, this.hideDelay);
|
|
110
|
+
}
|
|
111
|
+
touchStartListener() {
|
|
112
|
+
this.touchTimeout = window.setTimeout(() => {
|
|
113
|
+
var _a;
|
|
114
|
+
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.classList.add('tooltip-show');
|
|
115
|
+
}, this.longTouchDuration);
|
|
116
|
+
}
|
|
117
|
+
touchEndListener() {
|
|
118
|
+
var _a;
|
|
119
|
+
window.clearTimeout(this.touchTimeout);
|
|
120
|
+
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.classList.remove('tooltip-show');
|
|
121
|
+
}
|
|
122
|
+
static get is() { return "cat-tooltip"; }
|
|
123
|
+
static get encapsulation() { return "shadow"; }
|
|
124
|
+
static get originalStyleUrls() { return {
|
|
125
|
+
"$": ["cat-tooltip.scss"]
|
|
126
|
+
}; }
|
|
127
|
+
static get styleUrls() { return {
|
|
128
|
+
"$": ["cat-tooltip.css"]
|
|
129
|
+
}; }
|
|
130
|
+
static get properties() { return {
|
|
131
|
+
"content": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "The content of the tooltip."
|
|
144
|
+
},
|
|
145
|
+
"attribute": "content",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "''"
|
|
148
|
+
},
|
|
149
|
+
"disabled": {
|
|
150
|
+
"type": "boolean",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "boolean",
|
|
154
|
+
"resolved": "boolean",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": "Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\nand invisible. Corresponds with the native HTML disabled attribute."
|
|
162
|
+
},
|
|
163
|
+
"attribute": "disabled",
|
|
164
|
+
"reflect": false,
|
|
165
|
+
"defaultValue": "false"
|
|
166
|
+
},
|
|
167
|
+
"placement": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "Placement",
|
|
172
|
+
"resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
173
|
+
"references": {
|
|
174
|
+
"Placement": {
|
|
175
|
+
"location": "import",
|
|
176
|
+
"path": "@floating-ui/dom"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": "The placement of the tooltip."
|
|
185
|
+
},
|
|
186
|
+
"attribute": "placement",
|
|
187
|
+
"reflect": false,
|
|
188
|
+
"defaultValue": "'top'"
|
|
189
|
+
},
|
|
190
|
+
"showDelay": {
|
|
191
|
+
"type": "number",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "number",
|
|
195
|
+
"resolved": "number",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "The delay time for showing tooltip in ms."
|
|
203
|
+
},
|
|
204
|
+
"attribute": "show-delay",
|
|
205
|
+
"reflect": false,
|
|
206
|
+
"defaultValue": "500"
|
|
207
|
+
},
|
|
208
|
+
"hideDelay": {
|
|
209
|
+
"type": "number",
|
|
210
|
+
"mutable": false,
|
|
211
|
+
"complexType": {
|
|
212
|
+
"original": "number",
|
|
213
|
+
"resolved": "number",
|
|
214
|
+
"references": {}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": "The delay time for hiding tooltip in ms."
|
|
221
|
+
},
|
|
222
|
+
"attribute": "hide-delay",
|
|
223
|
+
"reflect": false,
|
|
224
|
+
"defaultValue": "0"
|
|
225
|
+
},
|
|
226
|
+
"longTouchDuration": {
|
|
227
|
+
"type": "number",
|
|
228
|
+
"mutable": false,
|
|
229
|
+
"complexType": {
|
|
230
|
+
"original": "number",
|
|
231
|
+
"resolved": "number",
|
|
232
|
+
"references": {}
|
|
233
|
+
},
|
|
234
|
+
"required": false,
|
|
235
|
+
"optional": false,
|
|
236
|
+
"docs": {
|
|
237
|
+
"tags": [],
|
|
238
|
+
"text": "The duration of tap to show the tooltip."
|
|
239
|
+
},
|
|
240
|
+
"attribute": "long-touch-duration",
|
|
241
|
+
"reflect": false,
|
|
242
|
+
"defaultValue": "1000"
|
|
243
|
+
}
|
|
244
|
+
}; }
|
|
245
|
+
static get listeners() { return [{
|
|
246
|
+
"name": "keydown",
|
|
247
|
+
"method": "handleKeyDown",
|
|
248
|
+
"target": undefined,
|
|
249
|
+
"capture": false,
|
|
250
|
+
"passive": false
|
|
251
|
+
}]; }
|
|
252
|
+
}
|
|
253
|
+
CatTooltip.OFFSET = 4;
|
|
254
|
+
//# sourceMappingURL=cat-tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cat-tooltip.js","sourceRoot":"","sources":["../../../src/components/cat-tooltip/cat-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AACxF,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAGvD,IAAI,YAAY,GAAG,CAAC,CAAC;AAOrB,MAAM,OAAO,UAAU;EALvB;IAOmB,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;IAQtD;;OAEG;IACK,YAAO,GAAG,EAAE,CAAC;IAErB;;;OAGG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,cAAS,GAAc,KAAK,CAAC;IAErC;;OAEG;IACK,cAAS,GAAG,GAAG,CAAC;IAExB;;OAEG;IACK,cAAS,GAAG,CAAC,CAAC;IAEtB;;OAEG;IACK,sBAAiB,GAAG,IAAI,CAAC;GA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MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;;MACxC,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,EAAE,CAAC;MACrB,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;EACrB,CAAC;EAEO,kBAAkB;IACxB,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;;MACzC,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;EAC7B,CAAC;EAEO,gBAAgB;;IACtB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;EACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAzIuB,iBAAM,GAAG,CAAE,CAAA","sourcesContent":["import { Component, h, Host, Listen, Prop } from '@stencil/core';\nimport { autoUpdate, computePosition, flip, offset, Placement } from '@floating-ui/dom';\nimport isTouchScreen from '../../utils/is-touch-screen';\nimport firstTabbable from '../../utils/first-tabbable';\nimport { FocusableElement } from 'tabbable';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-tooltip',\n styleUrl: 'cat-tooltip.scss',\n shadow: true\n})\nexport class CatTooltip {\n private static readonly OFFSET = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private triggerElement?: HTMLElement;\n private trigger?: FocusableElement;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n\n /**\n * The content of the tooltip.\n */\n @Prop() content = '';\n\n /**\n * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\n * and invisible. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * The placement of the tooltip.\n */\n @Prop() placement: Placement = 'top';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 500;\n\n /**\n * The delay time for hiding tooltip in ms.\n */\n @Prop() hideDelay = 0;\n\n /**\n * The duration of tap to show the tooltip.\n */\n @Prop() longTouchDuration = 1000;\n\n @Listen('keydown')\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideListener();\n }\n\n componentDidLoad(): void {\n this.trigger = firstTabbable(this.triggerElement) || this.triggerElement;\n if (!this.isTabbable) {\n this.trigger?.setAttribute('tabindex', '0');\n }\n if (this.trigger && this.tooltip) {\n autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n\n if (isTouchScreen) {\n this.trigger?.addEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.addEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.addEventListener('focusin', this.showListener.bind(this));\n this.trigger?.addEventListener('focusout', this.hideListener.bind(this));\n this.trigger?.addEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.addEventListener('mouseleave', this.hideListener.bind(this));\n }\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n this.trigger?.removeEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.removeEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.removeEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.removeEventListener('mouseleave', this.hideListener.bind(this));\n this.trigger?.removeEventListener('focusin', this.showListener.bind(this));\n this.trigger?.removeEventListener('focusout', this.hideListener.bind(this));\n }\n }\n\n render() {\n return (\n <Host>\n <div ref={el => (this.triggerElement = el)} aria-describedby={this.id} class=\"tooltip-trigger\">\n <slot />\n </div>\n {this.content && !this.disabled && (\n <div ref={el => (this.tooltip = el)} id={this.id} class=\"tooltip\">\n {this.content}\n </div>\n )}\n </Host>\n );\n }\n\n private get isTabbable() {\n return firstTabbable(this.trigger);\n }\n\n private update() {\n if (this.trigger && this.tooltip) {\n computePosition(this.trigger, this.tooltip, {\n placement: this.placement,\n middleware: [offset(CatTooltip.OFFSET), flip()]\n }).then(({ x, y }) => {\n if (this.tooltip) {\n Object.assign(this.tooltip.style, {\n left: `${Math.max(0, x)}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private showListener() {\n window.clearTimeout(this.hideTimeout);\n this.showTimeout = window.setTimeout(() => {\n this.trigger?.focus();\n this.tooltip?.classList.add('tooltip-show');\n }, this.showDelay);\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.trigger?.blur();\n this.tooltip?.classList.remove('tooltip-show');\n }, this.hideDelay);\n }\n\n private touchStartListener() {\n this.touchTimeout = window.setTimeout(() => {\n this.tooltip?.classList.add('tooltip-show');\n }, this.longTouchDuration);\n }\n\n private touchEndListener() {\n window.clearTimeout(this.touchTimeout);\n this.tooltip?.classList.remove('tooltip-show');\n }\n}\n"]}
|
package/dist/collection/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\n"]}
|
package/dist/collection/init.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { CatIconRegistry } from './components/cat-icon/cat-icon-registry';
|
|
2
1
|
import { ci } from '@haiilo/catalyst-icons';
|
|
2
|
+
import { CatI18nRegistry } from './components/cat-i18n/cat-i18n-registry';
|
|
3
|
+
import { CatIconRegistry } from './components/cat-icon/cat-icon-registry';
|
|
3
4
|
function registerIcons() {
|
|
4
5
|
CatIconRegistry.getInstance().addIcons(ci);
|
|
5
6
|
}
|
|
7
|
+
function registerTranslations() {
|
|
8
|
+
CatI18nRegistry.getInstance().addMessages('en', {
|
|
9
|
+
'input.clear': 'Clear',
|
|
10
|
+
'input.optional': 'Optional'
|
|
11
|
+
});
|
|
12
|
+
}
|
|
6
13
|
export default function () {
|
|
7
14
|
registerIcons();
|
|
15
|
+
registerTranslations();
|
|
8
16
|
}
|
|
9
17
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,SAAS,aAAa;EACpB,eAAe,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,oBAAoB;EAC3B,eAAe,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE;IAC9C,aAAa,EAAE,OAAO;IACtB,gBAAgB,EAAE,UAAU;GAC7B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,OAAO;EACZ,aAAa,EAAE,CAAC;EAChB,oBAAoB,EAAE,CAAC;AACzB,CAAC","sourcesContent":["import { ci } from '@haiilo/catalyst-icons';\nimport { CatI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nimport { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\n\nfunction registerIcons() {\n CatIconRegistry.getInstance().addIcons(ci);\n}\n\nfunction registerTranslations() {\n CatI18nRegistry.getInstance().addMessages('en', {\n 'input.clear': 'Clear',\n 'input.optional': 'Optional'\n });\n}\n\nexport default function () {\n registerIcons();\n registerTranslations();\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-tabbable.js","sourceRoot":"","sources":["../../src/utils/first-tabbable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAItD,MAAM,aAAa,GAAG,CAAC,SAAqB,EAAgC,EAAE;EAC5E,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;AACzG,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FocusableElement, tabbable } from 'tabbable';\n\ntype Container = Element | FocusableElement | null;\n\nconst firstTabbable = (container?: Container): FocusableElement | undefined => {\n return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();\n};\n\nexport default firstTabbable;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-touch-screen.js","sourceRoot":"","sources":["../../src/utils/is-touch-screen.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;AAE/E,eAAe,aAAa,CAAC","sourcesContent":["const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\nexport default isTouchDevice;\n"]}
|