@haiilo/catalyst 10.17.1 → 10.19.0

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.
Files changed (82) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/{p-b1cd12bb.entry.js → p-b130db4e.entry.js} +4 -4
  4. package/dist/catalyst/p-b130db4e.entry.js.map +1 -0
  5. package/dist/cjs/cat-alert_29.cjs.entry.js +72 -61
  6. package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -1
  7. package/dist/cjs/catalyst.cjs.js +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/collection-manifest.json +2 -2
  10. package/dist/collection/components/cat-alert/cat-alert.js +1 -1
  11. package/dist/collection/components/cat-badge/cat-badge.js +1 -1
  12. package/dist/collection/components/cat-button/cat-button.css +3 -0
  13. package/dist/collection/components/cat-button/cat-button.js +14 -1
  14. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  15. package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
  16. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  17. package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
  18. package/dist/collection/components/cat-card/cat-card.js +1 -1
  19. package/dist/collection/components/cat-checkbox/cat-checkbox.js +2 -2
  20. package/dist/collection/components/cat-date/cat-date.js +2 -2
  21. package/dist/collection/components/cat-date-inline/cat-date-inline.js +4 -4
  22. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
  23. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  24. package/dist/collection/components/cat-dropdown/cat-dropdown.js +1 -1
  25. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  26. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  27. package/dist/collection/components/cat-input/cat-input.js +4 -4
  28. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  29. package/dist/collection/components/cat-radio/cat-radio.js +2 -2
  30. package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
  31. package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
  32. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  33. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  34. package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
  35. package/dist/collection/components/cat-tab/cat-tab.js +1 -1
  36. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  37. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  38. package/dist/collection/components/cat-time/cat-time.js +2 -2
  39. package/dist/collection/components/cat-toggle/cat-toggle.js +2 -2
  40. package/dist/collection/components/cat-tooltip/cat-tooltip.js +7 -7
  41. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  42. package/dist/collection/index.js.map +1 -1
  43. package/dist/components/cat-alert.js +1 -1
  44. package/dist/components/cat-badge.js +1 -1
  45. package/dist/components/cat-button-group.js +1 -1
  46. package/dist/components/cat-button2.js +27 -2
  47. package/dist/components/cat-button2.js.map +1 -1
  48. package/dist/components/cat-card.js +1 -1
  49. package/dist/components/cat-checkbox2.js +2 -2
  50. package/dist/components/cat-date-inline2.js +4 -4
  51. package/dist/components/cat-date.js +2 -2
  52. package/dist/components/cat-datepicker-inline.js +2 -2
  53. package/dist/components/cat-datepicker.js +4 -17
  54. package/dist/components/cat-datepicker.js.map +1 -1
  55. package/dist/components/cat-dropdown2.js +1 -1
  56. package/dist/components/cat-form-group.js +1 -1
  57. package/dist/components/cat-icon2.js +1 -1
  58. package/dist/components/cat-input2.js +4 -4
  59. package/dist/components/cat-pagination.js +2 -2
  60. package/dist/components/cat-radio-group.js +1 -1
  61. package/dist/components/cat-radio.js +2 -2
  62. package/dist/components/cat-scrollable2.js +3 -3
  63. package/dist/components/cat-select-demo.js +1 -1
  64. package/dist/components/cat-skeleton2.js +1 -1
  65. package/dist/components/cat-spinner2.js +2 -2
  66. package/dist/components/cat-tab.js +1 -1
  67. package/dist/components/cat-tabs.js +1 -1
  68. package/dist/components/cat-textarea.js +3 -3
  69. package/dist/components/cat-time.js +2 -2
  70. package/dist/components/cat-toggle.js +2 -2
  71. package/dist/components/cat-tooltip.js +2 -2
  72. package/dist/components/cat-tooltip.js.map +1 -1
  73. package/dist/esm/cat-alert_29.entry.js +72 -61
  74. package/dist/esm/cat-alert_29.entry.js.map +1 -1
  75. package/dist/esm/catalyst.js +1 -1
  76. package/dist/esm/loader.js +1 -1
  77. package/dist/types/components/cat-button/cat-button.d.ts +3 -0
  78. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +2 -1
  79. package/dist/types/components.d.ts +4 -2
  80. package/dist/types/index.d.ts +1 -0
  81. package/package.json +2 -2
  82. package/dist/catalyst/p-b1cd12bb.entry.js.map +0 -1
@@ -25,9 +25,9 @@ const CatPagination$1 = /*@__PURE__*/ proxyCustomElement(class CatPagination ext
25
25
  this.iconNext = '$cat:pagination-right';
26
26
  }
27
27
  render() {
28
- return (h("nav", { key: 'e0afa5efde129998d5899191374849c2538d5656', role: "navigation" }, h("ol", { key: '3b6d1838f508a3323d0ff11b95318eee5cfe5c89', class: {
28
+ return (h("nav", { key: '817cbf68d26fef6f6603a2455e7586fefea63b77', role: "navigation" }, h("ol", { key: '8cc898b619508d2ef2c05fed178d0976fb0c5abf', class: {
29
29
  [`cat-pagination-${this.size}`]: Boolean(this.size)
30
- } }, h("li", { key: 'fffae2ea8d502b03c01841f2cdf281150d6b62b5' }, h("cat-button", { key: '8f320c285b322ca8ae618143b70fdf85b227c232', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '77d3aa0acb4a27cd8c65d7396dab318dcce7825c' }, h("cat-button", { key: 'fe70cf4c908cbc7ac2bd2167f778f42fa3b49025', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
30
+ } }, h("li", { key: 'b4df49303de82b5bca6eb32e1b984f3204675baa' }, h("cat-button", { key: 'b73cd4eadf9811bfbc681d77d9339738227c5e24', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '119fbe96e02ab847e1a70dd2a7778f31488eb42e' }, h("cat-button", { key: '903151fcd987ef8a106715a37dcadc294c14567f', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
31
31
  }
32
32
  get isFirst() {
33
33
  return this.page === 0;
@@ -74,7 +74,7 @@ const CatRadioGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatRadioGroup ext
74
74
  }
75
75
  }
76
76
  render() {
77
- return (h("div", { key: '597881a52c2314f3cc6e159473d8dc83e5944900', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'ca1d499d74100334a86bf75362bd61f3674d31fa' })));
77
+ return (h("div", { key: '3ca0cc9f011a75bbe5fbe78f3ccc34f2b89cfa0d', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'ab891802eba920792de0dbbd645df119cbbfd35a' })));
78
78
  }
79
79
  init() {
80
80
  this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
@@ -54,13 +54,13 @@ const CatRadio$1 = /*@__PURE__*/ proxyCustomElement(class CatRadio extends HTMLE
54
54
  this.input.blur();
55
55
  }
56
56
  render() {
57
- return (h(Host, { key: 'a5c45b93c04dd890962afea152680fa2da41d26b' }, h("label", { key: 'f11eb0392f18af07b34240bc2fa05c92ddbca62b', htmlFor: this.id, class: {
57
+ return (h(Host, { key: 'e49a46a798bf9e1763c3bb7d393d017bc717b867' }, h("label", { key: '2c54e7ce7635e828d08c57a6dec3dac6f9655ea7', htmlFor: this.id, class: {
58
58
  'is-hidden': this.labelHidden,
59
59
  'is-disabled': this.disabled,
60
60
  'label-left': this.labelLeft,
61
61
  'align-center': this.alignment === 'center',
62
62
  'align-end': this.alignment === 'bottom'
63
- }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '95152536359c135a0dffe9b9e8f5dd0275da7521', class: "radio" }, h("input", { key: '2dec9b790dcfb178459d5c6a58b9468350ba2797', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: 'a3053e1a599f78d46093d26f36367f52d27959c0', class: "circle" })), h("span", { key: '70a5495aa595fffebf21adc9da5ca2d6d9cace22', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '71a6e06c7e1d97635c3cdd692a31e3edc436ede7', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '770e78a9dafb75fed3c94cf86f36d7de01b9f743', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '2398ef4f89bd6b6a7fa4a694786868c710924222', class: "circle-placeholder" }), h(CatFormHint, { key: 'f127cb78608b03b3c54f3f0e4d69c33892c268ff', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
63
+ }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '750a09db89be9e14bd0b830f6ab9d667b5154faa', class: "radio" }, h("input", { key: 'd34a558d03b1af53eb8afe65f33cdf400a38dd8a', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '4da4710794e6a1939e947461986798f952a43c28', class: "circle" })), h("span", { key: '812920e2ce41d6415fb39306a3c5c90c547292ed', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '141e716d778a2838dc5da2f36342483a07a887e0', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '84e7ed4970ff487801c96dfdd16fbc5bf5fa7ee0', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '7067ca10bf24d84beaf5f89a8e2e65a22766784c', class: "circle-placeholder" }), h(CatFormHint, { key: 'a6a006b626516a1fa3f86d25eb6ae5da93ff9d66', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
64
64
  }
65
65
  get hasHint() {
66
66
  return !!this.hint || !!this.hasSlottedHint;
@@ -605,13 +605,13 @@ const CatScrollable = /*@__PURE__*/ proxyCustomElement(class CatScrollable exten
605
605
  }
606
606
  render() {
607
607
  return [
608
- h("div", { key: '3fa7e90419b11118694def5d300036b1062fb685', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { key: '3f7a3b2aa4a8b434ab66fc676e02771e056dfc95', class: "shadow-top" }), !this.noShadowX && h("div", { key: '450547a0b1a08a15903e605f2bd12c1eb2637089', class: "shadow-left" }), !this.noShadowX && h("div", { key: '69fe8dc3f0282d9d8bf1ccd65add30c0046789c4', class: "shadow-right" }), !this.noShadowY && h("div", { key: 'b2f1df225d3653cd778b28f2f94724ff1f7a7729', class: "shadow-bottom" })),
609
- h("div", { key: '56833efe4ee21f847c2321e89e0b3e2fa9a7240b', ref: el => (this.scrollElement = el), class: {
608
+ h("div", { key: '1639675c47648368c53430e764a8add07e9452ae', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { key: '1ee0d5c5bfc7b726addac6474b098237ff447c3c', class: "shadow-top" }), !this.noShadowX && h("div", { key: '266026a4369bdcd9464deb4aa44d1e438a05e191', class: "shadow-left" }), !this.noShadowX && h("div", { key: 'd4ec793e68cde3ca8aa14e4eec57995112722d9b', class: "shadow-right" }), !this.noShadowY && h("div", { key: 'c30408dc0b5e10a9dceece389ce0729d46fdcbe2', class: "shadow-bottom" })),
609
+ h("div", { key: '8e17123e46a59b561122d07a2124ab20bf0cc58f', ref: el => (this.scrollElement = el), class: {
610
610
  'scrollable-content': true,
611
611
  'scroll-x': !this.noOverflowX,
612
612
  'scroll-y': !this.noOverflowY,
613
613
  'no-overscroll': this.noOverscroll
614
- } }, h("slot", { key: 'c959b7cbbd06a0233ad773738ef925b05bd76be3' }))
614
+ } }, h("slot", { key: '026b0d81a1de88cbd4b401bde7fb98caaabfe811' }))
615
615
  ];
616
616
  }
617
617
  attachEmitter(from, emitter) {
@@ -176,7 +176,7 @@ const CatSelectTest = /*@__PURE__*/ proxyCustomElement(class CatSelectTest exten
176
176
  setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
177
177
  }
178
178
  render() {
179
- return (h(Host, { key: '745d55bbd0e1c38377f5f7ed138dc78213b47960', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: '7c201ebc18e36a8551899b7e5276a63ded6bb6c8', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'a0c9f9514070e2101c84839292bbc749a7969eab', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: 'b648ecf10f825cb33a11da79b6528caf78b7b07c', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '23e6ab45009463f2d703d8913b232ade2f1abfa3', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '18f247000136a32e7ec202c7be7f01e625a4a40d', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '445e29437d8af225222a9af1e2cd87e730d23b8f', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: '781b635fbe75a7cc9f8bfb840b0614b65f53b7f6', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: '2078bf8f1778a21c1b6a4180292b244a8b11eb62', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '42a8847c8e88d349f4919794ca93e067a25ecf36', overflow: true }, h("cat-button", { key: '55f407b6d3316311faa138169f1eb8725757f588', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: 'c68ad1b486b5985bb550d026ba2969a786995c48', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '2a32550e0f87e8aa3f90abbe819c7ceab0d9c773', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
179
+ return (h(Host, { key: '4d1262f7c176a3699eec1b24dcfd24eb73e4794d', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: '50af5fabe85cf9d5cabc22e8eaac0fd79ca37ef6', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'd0b3ff47fa0ae1fcaca58fa1c978d160bd90ec25', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '8b279857cb7bc615049315d3347ad2167f79f515', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '8133ad06671dda0dec6847558cc5f2298ffd0910', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'fe7e7c01ed578dbccea9dedb77722ccc873aa882', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'f632770bcf0100328294b4722bf788619d381ba9', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: 'b38796d22f1f88bead1e97820d48214b7ba3f649', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: '24bff1c9438de8a2bce7801b161c6e0ed40a0f53', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '263cf8e741c9f16f2602150cb2bc054b11deff3b', overflow: true }, h("cat-button", { key: '7bc7b524dfb08bb1691e3ebb391e44229345a98b', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: '81565908aa8e60a82727269b3af83f9d9cc00e89', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '530b39c7402fd04af9a92a8860994babbb26ca16', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
180
180
  }
181
181
  get countryConnector() {
182
182
  return {
@@ -14,7 +14,7 @@ const CatSkeleton = /*@__PURE__*/ proxyCustomElement(class CatSkeleton extends H
14
14
  this.lines = undefined;
15
15
  }
16
16
  render() {
17
- return (h(Host, { key: 'aac4684f2816b1be2367866041d15e9fac0de7ac' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
17
+ return (h(Host, { key: 'aed2e7fe276bc83e749cddeba379a495040850ea' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
18
18
  skeleton: true,
19
19
  [`skeleton-${this.effect}`]: Boolean(this.effect),
20
20
  [`skeleton-${this.variant}`]: Boolean(this.variant),
@@ -12,9 +12,9 @@ const CatSpinner = /*@__PURE__*/ proxyCustomElement(class CatSpinner extends HTM
12
12
  this.a11yLabel = undefined;
13
13
  }
14
14
  render() {
15
- return (h("span", { key: '6e6fe85607e6f6b00fd095c176604aecc05ea75a', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
15
+ return (h("span", { key: '1cbc0ce9b663ba8edec261bc23822da72bca0e09', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
16
16
  [`spinner-${this.size}`]: this.size !== 'inline'
17
- } }, h("svg", { key: '9c5823b8f4ab7796a34342901e1d1278a3c34537', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '386e29a6dd880ae337f20ba1c4074edb7484c8f6', cx: "24", cy: "24", r: "21.5" }))));
17
+ } }, h("svg", { key: '8f282cdab11de5ae0ce0d5c33e8261d28642e8b3', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '1b283f2cca79367c1bbb284954f4c62b422d18ae', cx: "24", cy: "24", r: "21.5" }))));
18
18
  }
19
19
  static get style() { return CatSpinnerStyle0; }
20
20
  }, [1, "cat-spinner", {
@@ -29,7 +29,7 @@ const CatTab$1 = /*@__PURE__*/ proxyCustomElement(class CatTab extends HTMLEleme
29
29
  this.catClick.emit(event);
30
30
  }
31
31
  render() {
32
- return h(Host, { key: '423a9d58be83b8acccdbe72ffb0f75733dc91cc7' });
32
+ return h(Host, { key: '3a0763022fe3c66e8405914f3212ba1d19fe1549' });
33
33
  }
34
34
  get hostElement() { return this; }
35
35
  static get style() { return CatTabStyle0; }
@@ -63,7 +63,7 @@ const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLEle
63
63
  this.activate(this.tabs[index]);
64
64
  }
65
65
  render() {
66
- return (h(Host, { key: 'b3119423d8f6cae90991af25bd6d7d6ef94b5609' }, this.tabs.map((tab) => {
66
+ return (h(Host, { key: '16cb1359d4242593e1caf1b2475c0fe24b91a69b' }, this.tabs.map((tab) => {
67
67
  return (h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
68
68
  'cat-tab': true,
69
69
  'cat-tab-active': tab.id === this.activeTab,
@@ -90,15 +90,15 @@ const CatTextarea$1 = /*@__PURE__*/ proxyCustomElement(class CatTextarea extends
90
90
  }
91
91
  }
92
92
  render() {
93
- return (h(Host, { key: '75665cdb53070b131971482ec39853e07d2f4ca9' }, h("div", { key: 'a2439d68f9e7314a9f970ff10f900c4c04e23e4a', class: {
93
+ return (h(Host, { key: 'fda117cd95fc6e41b9cd939b65ab22f977dde6ef' }, h("div", { key: '1f96b31c31880e8a75c8ad67c4057fb3010b1c9e', class: {
94
94
  'textarea-field': true,
95
95
  'textarea-horizontal': this.horizontal
96
- } }, h("div", { key: 'fc3556d42d3b02cf31d83cccf03b0226d53c9517', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '1e7a169e766a4a349a080fab967aa6c678b27ede', htmlFor: this.id, part: "label" }, h("span", { key: '3658d2fc258162a3c1c635fa1b5148005d1e1bac', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '2ce32b2a5984547d09aa8921f9ee33b918e1aab2', name: "label" })) || this.label, h("div", { key: '36ef608cdee7550adc0be30270db64f3dcd4ea2e', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '4a7480181592a16d39db92273dd9a32fe338388a', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'de54a7e25c78c6cdc1f8683c8e5c1773714323ce', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { key: '05a49aeae9c47c22c5ee0c95a5d4d1708f8aeff1', class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: 'b2a6bc4d2f61b4a5683fd7fdf39123c8c0c4c39e', class: "textarea-container" }, h("div", { key: '79a4291af19da695a14b80539cfc6d6e9313ccaf', class: {
96
+ } }, h("div", { key: '524ec0321e709ad45216275d0c554b7efde80f19', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '3aa9116de299d6eadf551159788cd0e244b5e919', htmlFor: this.id, part: "label" }, h("span", { key: 'ae397abd1be97bbb5c58fa35f4b560506cbbd5d1', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '81bb3f8151354ae9c6539f6816d963700beb861b', name: "label" })) || this.label, h("div", { key: '96000f760849536cb97eedd704e8a1bec14c15fa', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '1ab3077d0d7a94c2459a2d5b6717cc4a3857b122', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '73944c3f9366064342fca115ae50612b9c75489e', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { key: 'fe11e06174bcbf8e1957771be702fc052a4e5114', class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: '94a9992673d408933040f359335f642fcc053182', class: "textarea-container" }, h("div", { key: 'df53a47f398d48cec2b50dff469eb9a91c59bc72', class: {
97
97
  'textarea-wrapper': true,
98
98
  'textarea-readonly': this.readonly,
99
99
  'textarea-disabled': this.disabled,
100
100
  'textarea-invalid': this.invalid
101
- } }, h("textarea", { key: '3e06a6c68119338adf15b93d717da4a3dbc4e8cb', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (h("cat-icon", { key: '3845c0f84764b5f382b8e36ff90571548c057087', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { key: '564729eaa387e7b08c35415dd9ac16ad6e2c806a', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
101
+ } }, h("textarea", { key: 'd7d7f168763ea7194b97ddb505b4741b4ba0d91a', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (h("cat-icon", { key: 'f9d4fc754bf0da656ee08f2b5b68fedba99c727c', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { key: '3112b8a801c9b5e51129df6349f89c097beb6f0d', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
102
102
  }
103
103
  get hasHint() {
104
104
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -179,14 +179,14 @@ const CatTime$1 = /*@__PURE__*/ proxyCustomElement(class CatTime extends HTMLEle
179
179
  this.input?.clear();
180
180
  }
181
181
  render() {
182
- return (h(Host, { key: '4f78a1c5d3dd09a6f7476a4fed55ba1241305b4b' }, h("cat-input", { key: 'e783cd952c5a9bfc1b205eabf62b4b7e42684695', class: "cat-time-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: '945c465de003a32f67c6cab827afe8667c3d8436', slot: "label" }, this.hasSlottedLabel && h("slot", { key: '801d55325c6ec485c8519586a1fe03751b7ea4a2', name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '0dacef4090d789d0a600b5db2881bd9598e38a18', class: "label-aria" }, " (HH:mm)")), h("div", { key: '209dfdb875dbb40a0865dde72fd4aaa217a2592f', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { key: 'd3b901214820efebe32769996a8aa188d3a1e3e2', class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: 'b25d55512fc792bcb159e016ea71547032856aca', slot: "addon", placement: this.placement }, h("cat-button", { key: '5b6d1cf64a4c561b7d56ddbbaecf4e035e1ec3d4', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), h("nav", { key: 'b24b73a4374c5304b600c07c8c5f6c01e478f990', slot: "content", class: "cat-nav" }, h("ul", { key: '386fda017f42a0152b0095f3a107f892c425f844' }, this.timeArray().map(time => {
182
+ return (h(Host, { key: 'e9bfaeee8aa39aa58ac287afeaed1a2fc39d7b83' }, h("cat-input", { key: '1e200e6041b06a0859e392cfc6b6b03668b3eb35', class: "cat-time-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: 'e91e3e12272c24858a71b485e00e54cf00d7386f', slot: "label" }, this.hasSlottedLabel && h("slot", { key: '2449ea042497293868bcc767b1626070b3a1dcec', name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '3bab583a7629d01350fbd9e54d3fe1f113e0b372', class: "label-aria" }, " (HH:mm)")), h("div", { key: '8340d31e70e30ebe1d020f456b3a7bc5bed6b998', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { key: 'e6bb50abe2c3296cee7c3d5c02a6cef7c69f8678', class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: 'e79b7f58ffdc4d356e94f3e96afb6727d3e9be26', slot: "addon", placement: this.placement }, h("cat-button", { key: 'd6bd905d7760e0ae7e9ab8c23e87f7c926769aa9', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), h("nav", { key: 'c2ae49020a1e8cafedd27b8a7e061e63dbb4c6d2', slot: "content", class: "cat-nav" }, h("ul", { key: 'b918672be1b65ca3a1c2daa239a196d4117b52f7' }, this.timeArray().map(time => {
183
183
  const isoTime = formatIso(time);
184
184
  const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
185
185
  return (h("li", null, h("cat-button", { class: {
186
186
  'cat-nav-item': true,
187
187
  'time-disabled': disabled
188
188
  }, disabled: disabled, active: isoTime === this.value, color: isoTime === this.value ? 'primary' : 'secondary', variant: isoTime === this.value ? 'filled' : 'outlined', onCatClick: () => this.select(time), "data-time": isoTime }, this.format(time))));
189
- }))))), this.hasSlottedHint && (h("span", { key: 'e563a161e00cc919f39ecf663cc93065ca078f9a', slot: "hint" }, h("slot", { key: 'c302e5d24d005b43fe035865488318d03389d7cb', name: "hint" }))))));
189
+ }))))), this.hasSlottedHint && (h("span", { key: '817f2b58417911affc39ce6977160998c39ebf71', slot: "hint" }, h("slot", { key: 'a1ffdd541103064abf49311801088fe15d5ed88d', name: "hint" }))))));
190
190
  }
191
191
  timeArray() {
192
192
  const result = [];
@@ -59,13 +59,13 @@ const CatToggle$1 = /*@__PURE__*/ proxyCustomElement(class CatToggle extends HTM
59
59
  this.input.blur();
60
60
  }
61
61
  render() {
62
- return (h(Host, { key: 'bb91d759083937e929c68198caa5c201174c929a' }, h("label", { key: '2e506a58f0db88b7bfef12ebb3c70331b34a572a', htmlFor: this.id, class: {
62
+ return (h(Host, { key: '021e20f2f3e8a37d085a11966df3980758fd4662' }, h("label", { key: '8454945f873a5cef9b0ab52fd533289059d5d77c', htmlFor: this.id, class: {
63
63
  'is-hidden': this.labelHidden,
64
64
  'is-disabled': this.disabled,
65
65
  'label-left': this.labelLeft,
66
66
  'align-center': this.alignment === 'center',
67
67
  'align-end': this.alignment === 'bottom'
68
- } }, h("input", { key: '24347bf7bf6faece089c1566f1a2e6ec73f55f51', ...this.nativeAttributes, part: "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), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: 'f677b6651be206bd19d5f1f615dd013ebdc4d0cf', class: "toggle" }), h("span", { key: 'a4769d262bae63c908fa52d76f619e401b6fd7c4', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: 'b298a55112a909a8eab9d7f09e7a4af1751c54f0', name: "label" })) || this.label)), this.hasHint && (h("div", { key: 'b2df03f3bd345b02bd179804eee49a6cd6c6ae9a', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'e24ed4717befcc9ecd11a8d1138637280f94fcc7', class: "toggle-placeholder" }), h(CatFormHint, { key: 'd41d9070b15cf1e06afb972642606c4b4c67e631', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
68
+ } }, h("input", { key: '7eb1ab9de417cf27856caf257422be3221c17d94', ...this.nativeAttributes, part: "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), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: 'eb6c4b072ca903fd7df8a30e570be54c6df4133e', class: "toggle" }), h("span", { key: 'b07bb543bb4ac09fecd8ce1c0f0c1276846aa1e1', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '199cc06d3b54bb910c15449185b63d04f91163fd', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '43145cb96e769390309ed4003e94b04c1bea1a53', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'f0cbb265cec353a7f68432e369f0f2c7d042c3c7', class: "toggle-placeholder" }), h(CatFormHint, { key: '06692bcf33bf7a3202cc8977238003b96b9e4b8c', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
69
69
  }
70
70
  get hasHint() {
71
71
  return !!this.hint || !!this.hasSlottedHint;
@@ -67,12 +67,12 @@ const CatTooltip$1 = /*@__PURE__*/ proxyCustomElement(class CatTooltip extends H
67
67
  }
68
68
  }
69
69
  render() {
70
- return (h(Host, { key: '22e95841f5029e24e0ae9b08e0843fd8b8d360df' }, h("slot", { key: 'b9fc1e2472dc4610fe61ffc16274fa7b49510ecf' }), h("div", { key: 'e2971ec2746574a27b066ae9b3cece3236aa1bd9', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
70
+ return (h(Host, { key: '7d72ac4a2ccb057d7bca7290d6fc4e06c02c644c' }, h("slot", { key: '260fb1edf80d86a93892eed9df3ce4622cc441a3' }), h("div", { key: 'f7a7dc3f3333be42ed1a795dad64f74e9194201a', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
71
71
  tooltip: true,
72
72
  'tooltip-hidden': this.inactive,
73
73
  'tooltip-round': this.round,
74
74
  [`tooltip-${this.size}`]: Boolean(this.size)
75
- } }, h("slot", { key: 'afbcad951679fb8d139c8415a7305f498072276c', name: "content" }, h("p", { key: '6e10ef094c479288a02f8b874d48206158dece38' }, this.content)))));
75
+ } }, h("slot", { key: 'ebed88ce3b9481d6046cf5a70245c26a3dbc0a03', name: "content" }, h("p", { key: '455f894145ba5d1b8a8c001a6a4017d8aac81771' }, this.content)))));
76
76
  }
77
77
  async update() {
78
78
  if (this.trigger && this.tooltip) {
@@ -1 +1 @@
1
- {"file":"cat-tooltip.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC;;ACA9E,MAAM,aAAa,GAAG,yuCAAyuC,CAAC;AAChwC,yBAAe,aAAa;;ACG5B,IAAI,YAAY,GAAG,CAAC,CAAC;MAYRA,YAAU;IAkBrB;;;;QAfiB,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;QAM9C,aAAQ,GAAG,KAAK,CAAC;oBAmBT,KAAK;uBAKH,EAAE;wBAMD,KAAK;yBAKO,KAAK;qBAKpB,KAAK;oBAKW,GAAG;yBAKf,GAAG;yBAKH,CAAC;iCAKO,IAAI;QAlD9B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9E,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,kBAAkB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AG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;SAC7C;KACF;IAEO,WAAW;QACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAI,CAAC,iBAAiB,IAAI,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;KACpC;;;;;;;;;;;;;;AAvNuBD,mBAAM,GAAG,CAAH,CAAK;AACXA,0BAAa,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;","names":["CatTooltip","isTouchScreen"],"sources":["src/utils/is-touch-screen.ts","src/components/cat-tooltip/cat-tooltip.scss?tag=cat-tooltip&encapsulation=shadow","src/components/cat-tooltip/cat-tooltip.tsx"],"sourcesContent":["const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\nexport default isTouchDevice;\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n$-max-width: 20rem;\n$-box-shadow: rgb(0 0 0 / 8%) 0 1px 8px 0;\n$-shift-padding: 0.25rem; // padding given to the shift() middleware\n\n:host {\n display: contents;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.tooltip {\n --cat-font-color-head: #{cat-token('color.ui.font.tooltip', $wrap: false)};\n --cat-font-color-body: #{cat-token('color.ui.font.tooltip', $wrap: false)};\n position: fixed;\n width: max-content;\n top: 0;\n left: 0;\n box-sizing: border-box;\n @include cat-body('s', 500);\n background-color: cat-token('color.ui.background.tooltip');\n border-radius: cat-border-radius('m');\n color: cat-token('color.ui.font.tooltip');\n transition:\n opacity cat-token('time.transition.m') linear,\n visibility cat-token('time.transition.m') linear;\n visibility: hidden;\n opacity: 0;\n box-shadow: $-box-shadow;\n z-index: cat-z-index('tooltip');\n max-width: min(calc(100vw - 2 * $-shift-padding), $-max-width);\n\n &-hidden {\n @include cat-visually-hidden;\n }\n\n &-show {\n opacity: 1;\n visibility: visible;\n }\n\n p {\n margin: 0;\n }\n}\n\n// ----- round\n\n.tooltip-round {\n border-radius: 10rem;\n}\n\n// ----- size\n\n.tooltip-s {\n padding: 0.375rem 0.5rem;\n\n &.tooltip-round {\n padding: 0.375rem 0.75rem;\n }\n}\n\n.tooltip-m {\n padding: 0.75rem;\n\n &.tooltip-round {\n padding: 0.75rem 1rem;\n }\n}\n\n.tooltip-l {\n padding: 1rem;\n\n &.tooltip-round {\n padding: 1rem 1.5rem;\n }\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport isTouchScreen from '../../utils/is-touch-screen';\n\nlet nextUniqueId = 0;\n\n/**\n * Tooltips display additional information when the user hovers over or\n * interacts with a trigger element. The tooltip can be customized with\n * different placements, sizes, and styles.\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 static readonly SHIFT_PADDING = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private trigger?: Element;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n private inactive = false;\n private cleanupFloatingUi?: () => void;\n\n private readonly boundShowListener: () => void;\n private readonly boundHideListener: () => void;\n private readonly boundWindowTouchStartListener: () => void;\n private readonly boundTouchStartListener: (event: Event) => void;\n private readonly boundTouchEndListener: () => void;\n\n constructor() {\n this.boundShowListener = this.showListener.bind(this);\n this.boundHideListener = this.hideListener.bind(this);\n this.boundWindowTouchStartListener = this.windowTouchStartListener.bind(this);\n this.boundTouchStartListener = this.touchStartListener.bind(this);\n this.boundTouchEndListener = this.touchEndListener.bind(this);\n }\n\n @Element() hostElement!: HTMLElement;\n\n @State() open = false;\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 * Use round tooltip edges.\n */\n @Prop() round = false;\n\n /**\n * The size of the tooltip.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 250;\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', { target: 'window' })\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideTooltip();\n }\n\n componentDidLoad(): void {\n const slot = this.hostElement.shadowRoot?.querySelector('slot');\n this.trigger = slot?.assignedElements?.()?.[0];\n if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {\n this.trigger.setAttribute('aria-describedby', this.id);\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.addEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.addEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.addEventListener('focusin', this.boundShowListener);\n this.trigger?.addEventListener('focusout', this.boundHideListener);\n this.trigger?.addEventListener('mouseenter', this.boundShowListener);\n this.trigger?.addEventListener('mouseleave', this.boundHideListener);\n }\n }\n\n componentWillRender(): void {\n this.inactive = this.disabled || (!this.content && !this.hostElement.querySelector('[slot=\"content\"]'));\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.removeEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.removeEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.removeEventListener('mouseenter', this.boundShowListener);\n this.trigger?.removeEventListener('mouseleave', this.boundHideListener);\n this.trigger?.removeEventListener('focusin', this.boundShowListener);\n this.trigger?.removeEventListener('focusout', this.boundHideListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot />\n <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n role=\"tooltip\"\n aria-hidden={!this.open}\n aria-live={this.open ? 'polite' : 'off'}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.inactive,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n <slot name=\"content\">\n {/* The paragraph is needed here to make aria-live work properly. */}\n <p>{this.content}</p>\n </slot>\n </div>\n </Host>\n );\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [\n offset(CatTooltip.OFFSET),\n flip({ fallbackAxisSideDirection: 'start' }),\n shift({ padding: CatTooltip.SHIFT_PADDING })\n ]\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.hideTimeout = undefined;\n if (!this.showTimeout) {\n this.showTimeout = window.setTimeout(() => {\n this.showTimeout = undefined;\n this.showTooltip();\n }, this.showDelay);\n }\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n if (!this.hideTimeout) {\n this.hideTimeout = window.setTimeout(() => {\n this.hideTimeout = undefined;\n this.hideTooltip();\n }, this.hideDelay);\n }\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n if (!this.touchTimeout) {\n this.touchTimeout = window.setTimeout(() => {\n this.touchTimeout = undefined;\n this.showTooltip();\n }, this.longTouchDuration);\n }\n }\n\n private touchEndListener() {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = undefined;\n this.hideTooltip();\n }\n\n private windowTouchStartListener() {\n this.hideTooltip();\n }\n\n private showTooltip() {\n if (this.trigger && this.tooltip) {\n this.cleanupFloatingUi = autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n if (!this.inactive) {\n this.open = true;\n this.tooltip?.classList.add('tooltip-show');\n }\n }\n\n private hideTooltip() {\n this.open = false;\n this.tooltip?.classList.remove('tooltip-show');\n this.cleanupFloatingUi?.();\n this.cleanupFloatingUi = undefined;\n }\n}\n"],"version":3}
1
+ {"file":"cat-tooltip.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC;;ACA9E,MAAM,aAAa,GAAG,yuCAAyuC,CAAC;AAChwC,yBAAe,aAAa;;ACG5B,IAAI,YAAY,GAAG,CAAC,CAAC;MAcRA,YAAU;IAkBrB;;;;QAfiB,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;QAM9C,aAAQ,GAAG,KAAK,CAAC;oBAmBT,KAAK;uBAKH,EAAE;wBAMD,KAAK;yBAKc,KAAK;qBAK3B,KAAK;oBAKW,GAAG;yBAKf,GAAG;yBAKH,CAAC;iCAKO,IAAI;QAlD9B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9E,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC/D;IAgDD,aAAa,CAAC,EAAE,GAAG,EAAiB;QAClC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;KACxC;IAED,gBAAgB;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,IAAI,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;KACpC;;;;;;;;;;;;;;AAvNuBD,mBAAM,GAAG,CAAH,CAAK;AACXA,0BAAa,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;","names":["CatTooltip","isTouchScreen"],"sources":["src/utils/is-touch-screen.ts","src/components/cat-tooltip/cat-tooltip.scss?tag=cat-tooltip&encapsulation=shadow","src/components/cat-tooltip/cat-tooltip.tsx"],"sourcesContent":["const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\nexport default isTouchDevice;\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n$-max-width: 20rem;\n$-box-shadow: rgb(0 0 0 / 8%) 0 1px 8px 0;\n$-shift-padding: 0.25rem; // padding given to the shift() middleware\n\n:host {\n display: contents;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.tooltip {\n --cat-font-color-head: #{cat-token('color.ui.font.tooltip', $wrap: false)};\n --cat-font-color-body: #{cat-token('color.ui.font.tooltip', $wrap: false)};\n position: fixed;\n width: max-content;\n top: 0;\n left: 0;\n box-sizing: border-box;\n @include cat-body('s', 500);\n background-color: cat-token('color.ui.background.tooltip');\n border-radius: cat-border-radius('m');\n color: cat-token('color.ui.font.tooltip');\n transition:\n opacity cat-token('time.transition.m') linear,\n visibility cat-token('time.transition.m') linear;\n visibility: hidden;\n opacity: 0;\n box-shadow: $-box-shadow;\n z-index: cat-z-index('tooltip');\n max-width: min(calc(100vw - 2 * $-shift-padding), $-max-width);\n\n &-hidden {\n @include cat-visually-hidden;\n }\n\n &-show {\n opacity: 1;\n visibility: visible;\n }\n\n p {\n margin: 0;\n }\n}\n\n// ----- round\n\n.tooltip-round {\n border-radius: 10rem;\n}\n\n// ----- size\n\n.tooltip-s {\n padding: 0.375rem 0.5rem;\n\n &.tooltip-round {\n padding: 0.375rem 0.75rem;\n }\n}\n\n.tooltip-m {\n padding: 0.75rem;\n\n &.tooltip-round {\n padding: 0.75rem 1rem;\n }\n}\n\n.tooltip-l {\n padding: 1rem;\n\n &.tooltip-round {\n padding: 1rem 1.5rem;\n }\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport isTouchScreen from '../../utils/is-touch-screen';\n\nlet nextUniqueId = 0;\n\nexport type TooltipPlacement = Placement;\n\n/**\n * Tooltips display additional information when the user hovers over or\n * interacts with a trigger element. The tooltip can be customized with\n * different placements, sizes, and styles.\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 static readonly SHIFT_PADDING = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private trigger?: Element;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n private inactive = false;\n private cleanupFloatingUi?: () => void;\n\n private readonly boundShowListener: () => void;\n private readonly boundHideListener: () => void;\n private readonly boundWindowTouchStartListener: () => void;\n private readonly boundTouchStartListener: (event: Event) => void;\n private readonly boundTouchEndListener: () => void;\n\n constructor() {\n this.boundShowListener = this.showListener.bind(this);\n this.boundHideListener = this.hideListener.bind(this);\n this.boundWindowTouchStartListener = this.windowTouchStartListener.bind(this);\n this.boundTouchStartListener = this.touchStartListener.bind(this);\n this.boundTouchEndListener = this.touchEndListener.bind(this);\n }\n\n @Element() hostElement!: HTMLElement;\n\n @State() open = false;\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: TooltipPlacement = 'top';\n\n /**\n * Use round tooltip edges.\n */\n @Prop() round = false;\n\n /**\n * The size of the tooltip.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 250;\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', { target: 'window' })\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideTooltip();\n }\n\n componentDidLoad(): void {\n const slot = this.hostElement.shadowRoot?.querySelector('slot');\n this.trigger = slot?.assignedElements?.()?.[0];\n if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {\n this.trigger.setAttribute('aria-describedby', this.id);\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.addEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.addEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.addEventListener('focusin', this.boundShowListener);\n this.trigger?.addEventListener('focusout', this.boundHideListener);\n this.trigger?.addEventListener('mouseenter', this.boundShowListener);\n this.trigger?.addEventListener('mouseleave', this.boundHideListener);\n }\n }\n\n componentWillRender(): void {\n this.inactive = this.disabled || (!this.content && !this.hostElement.querySelector('[slot=\"content\"]'));\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.boundWindowTouchStartListener);\n this.trigger?.removeEventListener('touchstart', this.boundTouchStartListener);\n this.trigger?.removeEventListener('touchend', this.boundTouchEndListener);\n } else {\n this.trigger?.removeEventListener('mouseenter', this.boundShowListener);\n this.trigger?.removeEventListener('mouseleave', this.boundHideListener);\n this.trigger?.removeEventListener('focusin', this.boundShowListener);\n this.trigger?.removeEventListener('focusout', this.boundHideListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot />\n <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n role=\"tooltip\"\n aria-hidden={!this.open}\n aria-live={this.open ? 'polite' : 'off'}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.inactive,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n <slot name=\"content\">\n {/* The paragraph is needed here to make aria-live work properly. */}\n <p>{this.content}</p>\n </slot>\n </div>\n </Host>\n );\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [\n offset(CatTooltip.OFFSET),\n flip({ fallbackAxisSideDirection: 'start' }),\n shift({ padding: CatTooltip.SHIFT_PADDING })\n ]\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.hideTimeout = undefined;\n if (!this.showTimeout) {\n this.showTimeout = window.setTimeout(() => {\n this.showTimeout = undefined;\n this.showTooltip();\n }, this.showDelay);\n }\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n if (!this.hideTimeout) {\n this.hideTimeout = window.setTimeout(() => {\n this.hideTimeout = undefined;\n this.hideTooltip();\n }, this.hideDelay);\n }\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n if (!this.touchTimeout) {\n this.touchTimeout = window.setTimeout(() => {\n this.touchTimeout = undefined;\n this.showTooltip();\n }, this.longTouchDuration);\n }\n }\n\n private touchEndListener() {\n window.clearTimeout(this.touchTimeout);\n this.touchTimeout = undefined;\n this.hideTooltip();\n }\n\n private windowTouchStartListener() {\n this.hideTooltip();\n }\n\n private showTooltip() {\n if (this.trigger && this.tooltip) {\n this.cleanupFloatingUi = autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n if (!this.inactive) {\n this.open = true;\n this.tooltip?.classList.add('tooltip-show');\n }\n }\n\n private hideTooltip() {\n this.open = false;\n this.tooltip?.classList.remove('tooltip-show');\n this.cleanupFloatingUi?.();\n this.cleanupFloatingUi = undefined;\n }\n}\n"],"version":3}