@haiilo/catalyst 4.1.2 → 5.0.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 (276) hide show
  1. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  2. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  3. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  4. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  5. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  6. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  37. package/dist/catalyst/catalyst.css +6 -27
  38. package/dist/catalyst/catalyst.esm.js +1 -1
  39. package/dist/catalyst/catalyst.esm.js.map +1 -1
  40. package/dist/catalyst/index.esm.js.map +1 -1
  41. package/dist/catalyst/p-50855511.entry.js +10 -0
  42. package/dist/catalyst/p-50855511.entry.js.map +1 -0
  43. package/dist/catalyst/p-ccfebe33.js.map +1 -1
  44. package/dist/catalyst/p-d1fb9d96.js +3 -0
  45. package/dist/catalyst/p-d1fb9d96.js.map +1 -0
  46. package/dist/catalyst/scss/fonts/_fonts-mixins.scss +0 -10
  47. package/dist/cjs/cat-alert_24.cjs.entry.js +932 -1132
  48. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
  49. package/dist/cjs/catalyst.cjs.js +10 -3
  50. package/dist/cjs/catalyst.cjs.js.map +1 -1
  51. package/dist/cjs/{index-c4542095.js → index-01312a2e.js} +527 -245
  52. package/dist/cjs/index-01312a2e.js.map +1 -0
  53. package/dist/cjs/index.cjs.js.map +1 -1
  54. package/dist/cjs/loader.cjs.js +4 -3
  55. package/dist/cjs/loader.cjs.js.map +1 -1
  56. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  57. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  58. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  59. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  60. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  61. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  62. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  63. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  64. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  65. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  66. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  67. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  68. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  69. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  70. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  71. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  72. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  73. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  74. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  75. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  76. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  77. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  78. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  79. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  81. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  82. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  83. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  84. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  87. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  88. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  89. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  90. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  92. package/dist/collection/collection-manifest.json +2 -2
  93. package/dist/collection/components/cat-alert/cat-alert.js +69 -71
  94. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  95. package/dist/collection/components/cat-avatar/cat-avatar.js +172 -165
  96. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  97. package/dist/collection/components/cat-badge/cat-badge.js +102 -111
  98. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  99. package/dist/collection/components/cat-button/cat-button.js +526 -537
  100. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  101. package/dist/collection/components/cat-card/cat-card.js +12 -8
  102. package/dist/collection/components/cat-checkbox/cat-checkbox.js +336 -350
  103. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  104. package/dist/collection/components/cat-dropdown/cat-dropdown.js +137 -137
  105. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  106. package/dist/collection/components/cat-form-group/cat-form-group.js +58 -40
  107. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  108. package/dist/collection/components/cat-form-hint/cat-form-hint.js +14 -7
  109. package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
  110. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
  111. package/dist/collection/components/cat-icon/cat-icon-registry.js +1 -1
  112. package/dist/collection/components/cat-icon/cat-icon.js +85 -79
  113. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  114. package/dist/collection/components/cat-input/cat-input.css +32 -3
  115. package/dist/collection/components/cat-input/cat-input.js +662 -660
  116. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  117. package/dist/collection/components/cat-input/input-type.js +1 -1
  118. package/dist/collection/components/cat-label/cat-label.js +69 -78
  119. package/dist/collection/components/cat-label/cat-label.js.map +1 -1
  120. package/dist/collection/components/cat-notification/cat-notification.js +1 -1
  121. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  122. package/dist/collection/components/cat-pagination/cat-pagination.js +192 -226
  123. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  124. package/dist/collection/components/cat-radio/cat-radio.js +319 -327
  125. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  126. package/dist/collection/components/cat-radio-group/cat-radio-group.js +173 -165
  127. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  128. package/dist/collection/components/cat-scrollable/cat-scrollable.js +200 -208
  129. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  130. package/dist/collection/components/cat-select/cat-select.js +555 -590
  131. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  132. package/dist/collection/components/cat-select-demo/cat-select-demo.js +3 -28
  133. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  134. package/dist/collection/components/cat-skeleton/cat-skeleton.js +85 -88
  135. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  136. package/dist/collection/components/cat-spinner/cat-spinner.js +52 -50
  137. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  138. package/dist/collection/components/cat-tab/cat-tab.js +169 -168
  139. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  140. package/dist/collection/components/cat-tabs/cat-tabs.js +73 -66
  141. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  142. package/dist/collection/components/cat-textarea/cat-textarea.css +32 -1
  143. package/dist/collection/components/cat-textarea/cat-textarea.js +479 -468
  144. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  145. package/dist/collection/components/cat-toggle/cat-toggle.js +319 -326
  146. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  147. package/dist/collection/components/cat-tooltip/cat-tooltip.css +7 -1
  148. package/dist/collection/components/cat-tooltip/cat-tooltip.js +187 -198
  149. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  150. package/dist/collection/index.js +1 -1
  151. package/dist/collection/scss/fonts/_fonts-mixins.scss +0 -10
  152. package/dist/collection/utils/breakpoints.js +1 -1
  153. package/dist/collection/utils/breakpoints.js.map +1 -1
  154. package/dist/collection/utils/coerce.js +11 -0
  155. package/dist/collection/utils/coerce.js.map +1 -0
  156. package/dist/collection/utils/first-tabbable.js +1 -1
  157. package/dist/collection/utils/is-touch-screen.js +1 -1
  158. package/dist/collection/utils/load-img.js +1 -1
  159. package/dist/collection/utils/media-matcher.js +1 -1
  160. package/dist/collection/utils/platform.js +4 -4
  161. package/dist/collection/utils/setDefault.js +1 -1
  162. package/dist/components/cat-alert.js +1 -6
  163. package/dist/components/cat-alert.js.map +1 -1
  164. package/dist/components/cat-avatar2.js +6 -9
  165. package/dist/components/cat-avatar2.js.map +1 -1
  166. package/dist/components/cat-badge.js +0 -15
  167. package/dist/components/cat-badge.js.map +1 -1
  168. package/dist/components/cat-button2.js +10 -36
  169. package/dist/components/cat-button2.js.map +1 -1
  170. package/dist/components/cat-checkbox2.js +9 -26
  171. package/dist/components/cat-checkbox2.js.map +1 -1
  172. package/dist/components/cat-dropdown2.js +139 -176
  173. package/dist/components/cat-dropdown2.js.map +1 -1
  174. package/dist/components/cat-form-group.js +4 -9
  175. package/dist/components/cat-form-group.js.map +1 -1
  176. package/dist/components/cat-form-hint.js +13 -6
  177. package/dist/components/cat-form-hint.js.map +1 -1
  178. package/dist/components/cat-icon-registry.js +71 -0
  179. package/dist/components/cat-icon-registry.js.map +1 -0
  180. package/dist/components/cat-icon.js +1 -1
  181. package/dist/components/cat-icon2.js +5 -71
  182. package/dist/components/cat-icon2.js.map +1 -1
  183. package/dist/components/cat-input.js +33 -41
  184. package/dist/components/cat-input.js.map +1 -1
  185. package/dist/components/cat-label.js +1 -6
  186. package/dist/components/cat-label.js.map +1 -1
  187. package/dist/components/cat-pagination.js +0 -30
  188. package/dist/components/cat-pagination.js.map +1 -1
  189. package/dist/components/cat-radio-group.js +3 -6
  190. package/dist/components/cat-radio-group.js.map +1 -1
  191. package/dist/components/cat-radio.js +9 -23
  192. package/dist/components/cat-radio.js.map +1 -1
  193. package/dist/components/cat-scrollable2.js +1 -12
  194. package/dist/components/cat-scrollable2.js.map +1 -1
  195. package/dist/components/cat-select-demo.js +2 -12
  196. package/dist/components/cat-select-demo.js.map +1 -1
  197. package/dist/components/cat-select2.js +40 -47
  198. package/dist/components/cat-select2.js.map +1 -1
  199. package/dist/components/cat-skeleton2.js +1 -10
  200. package/dist/components/cat-skeleton2.js.map +1 -1
  201. package/dist/components/cat-spinner2.js +1 -3
  202. package/dist/components/cat-spinner2.js.map +1 -1
  203. package/dist/components/cat-tab.js +3 -12
  204. package/dist/components/cat-tab.js.map +1 -1
  205. package/dist/components/cat-tabs.js +1 -6
  206. package/dist/components/cat-tabs.js.map +1 -1
  207. package/dist/components/cat-textarea.js +28 -33
  208. package/dist/components/cat-textarea.js.map +1 -1
  209. package/dist/components/cat-toggle.js +9 -23
  210. package/dist/components/cat-toggle.js.map +1 -1
  211. package/dist/components/cat-tooltip.js +14 -34
  212. package/dist/components/cat-tooltip.js.map +1 -1
  213. package/dist/components/first-tabbable.js +51 -113
  214. package/dist/components/first-tabbable.js.map +1 -1
  215. package/dist/components/floating-ui.dom.esm.js +577 -441
  216. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  217. package/dist/components/index.d.ts +9 -27
  218. package/dist/components/index.js +2 -26
  219. package/dist/components/index.js.map +1 -1
  220. package/dist/esm/cat-alert_24.entry.js +933 -1133
  221. package/dist/esm/cat-alert_24.entry.js.map +1 -1
  222. package/dist/esm/catalyst.js +7 -3
  223. package/dist/esm/catalyst.js.map +1 -1
  224. package/dist/esm/{index-524906f7.js → index-fc2f91a4.js} +527 -246
  225. package/dist/esm/index-fc2f91a4.js.map +1 -0
  226. package/dist/esm/index.js.map +1 -1
  227. package/dist/esm/loader.js +4 -3
  228. package/dist/esm/loader.js.map +1 -1
  229. package/dist/esm/polyfills/css-shim.js +1 -1
  230. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
  231. package/dist/types/components/cat-form-group/cat-form-group.d.ts +4 -0
  232. package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +5 -0
  233. package/dist/types/components/cat-input/cat-input.d.ts +6 -1
  234. package/dist/types/components/cat-input/input-type.d.ts +1 -1
  235. package/dist/types/components/cat-radio/cat-radio.d.ts +1 -1
  236. package/dist/types/components/cat-select/cat-select.d.ts +3 -1
  237. package/dist/types/components/cat-textarea/cat-textarea.d.ts +6 -1
  238. package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
  239. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +3 -0
  240. package/dist/types/components.d.ts +353 -7
  241. package/dist/types/stencil-public-runtime.d.ts +91 -19
  242. package/dist/types/utils/breakpoints.d.ts +1 -1
  243. package/dist/types/utils/coerce.d.ts +3 -0
  244. package/dist/types/utils/first-tabbable.d.ts +2 -2
  245. package/loader/index.d.ts +9 -0
  246. package/loader/package.json +1 -0
  247. package/package.json +19 -19
  248. package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  249. package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
  250. package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  251. package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
  252. package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
  253. package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  254. package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
  255. package/dist/catalyst/p-919eea27.js +0 -3
  256. package/dist/catalyst/p-919eea27.js.map +0 -1
  257. package/dist/catalyst/p-cd8f8639.entry.js +0 -10
  258. package/dist/catalyst/p-cd8f8639.entry.js.map +0 -1
  259. package/dist/catalyst/scss/fonts/_fonts.mixins.azeret.scss +0 -14
  260. package/dist/catalyst/scss/fonts/_fonts.mixins.dm.scss +0 -53
  261. package/dist/cjs/index-c4542095.js.map +0 -1
  262. package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  263. package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
  264. package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  265. package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
  266. package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
  267. package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  268. package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
  269. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js +0 -13
  270. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js.map +0 -1
  271. package/dist/collection/scss/fonts/_fonts.mixins.azeret.scss +0 -14
  272. package/dist/collection/scss/fonts/_fonts.mixins.dm.scss +0 -53
  273. package/dist/components/cat-form-hint-utils.js +0 -17
  274. package/dist/components/cat-form-hint-utils.js.map +0 -1
  275. package/dist/esm/index-524906f7.js.map +0 -1
  276. package/dist/types/components/cat-form-hint/cat-form-hint-utils.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"cat-toggle.js","sourceRoot":"","sources":["../../../src/components/cat-toggle/cat-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;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'@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\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 * @slot hint - Optional hint element to be displayed with the toggle.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\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 get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\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({ mutable: true }) value?: string | boolean;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: 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 this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Programmatically move focus to the toggle. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the toggle. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the toggle.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value !== undefined ? String(this.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.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onInput(event: Event) {\n this.checked = this.input.checked;\n\n if (!this.value || typeof this.value === 'boolean') {\n this.value = this.checked;\n }\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 }\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, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\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 * @slot hint - Optional hint element to be displayed with the toggle.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\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 get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\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({ mutable: true }) value?: string | boolean;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: 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 this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Programmatically move focus to the toggle. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the toggle. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the toggle.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value !== undefined ? String(this.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.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {(this.hint || this.hasSlottedHint) && (\n <CatFormHint id={this.id} hint={this.hint} slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>} />\n )}\n </Host>\n );\n }\n\n private onInput(event: InputEvent) {\n this.checked = this.input.checked;\n\n if (!this.value || typeof this.value === 'boolean') {\n this.value = this.checked;\n }\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"]}
@@ -12,7 +12,13 @@
12
12
  }
13
13
 
14
14
  .tooltip {
15
+ --cat-font-color-head: cat-token("color.ui.font.tooltip", $wrap: false);
16
+ --cat-font-color-body: cat-token("color.ui.font.tooltip", $wrap: false);
15
17
  position: absolute;
18
+ width: max-content;
19
+ top: 0;
20
+ left: 0;
21
+ box-sizing: border-box;
16
22
  font-size: 0.875rem;
17
23
  line-height: 1rem;
18
24
  font-weight: 500;
@@ -24,7 +30,7 @@
24
30
  opacity: 0;
25
31
  box-shadow: rgba(0, 0, 0, 0.08) 0 1px 8px 0;
26
32
  z-index: 200;
27
- max-width: 20rem;
33
+ max-width: min(100vw - 0.5rem, 20rem);
28
34
  }
29
35
  .tooltip-hidden {
30
36
  position: absolute !important;
@@ -1,44 +1,20 @@
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';
1
+ import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';
2
+ import { h, Host } from '@stencil/core';
4
3
  import firstTabbable from '../../utils/first-tabbable';
4
+ import isTouchScreen from '../../utils/is-touch-screen';
5
5
  let nextUniqueId = 0;
6
6
  export class CatTooltip {
7
7
  constructor() {
8
8
  this.id = `cat-tooltip-${nextUniqueId++}`;
9
9
  this.hidden = false;
10
- /**
11
- * The content of the tooltip.
12
- */
10
+ this.hasSlottedContent = false;
13
11
  this.content = '';
14
- /**
15
- * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,
16
- * and invisible. Corresponds with the native HTML disabled attribute.
17
- */
18
12
  this.disabled = false;
19
- /**
20
- * The placement of the tooltip.
21
- */
22
13
  this.placement = 'top';
23
- /**
24
- * Use round tooltip edges.
25
- */
26
14
  this.round = false;
27
- /**
28
- * The size of the tooltip.
29
- */
30
15
  this.size = 'm';
31
- /**
32
- * The delay time for showing tooltip in ms.
33
- */
34
16
  this.showDelay = 250;
35
- /**
36
- * The delay time for hiding tooltip in ms.
37
- */
38
17
  this.hideDelay = 0;
39
- /**
40
- * The duration of tap to show the tooltip.
41
- */
42
18
  this.longTouchDuration = 1000;
43
19
  }
44
20
  handleKeyDown({ key }) {
@@ -66,7 +42,8 @@ export class CatTooltip {
66
42
  }
67
43
  }
68
44
  componentWillRender() {
69
- this.hidden = !this.content || this.disabled;
45
+ this.hasSlottedContent = !!this.hostElement.querySelector('[slot="content"]');
46
+ this.hidden = this.disabled || (!this.content && !this.hasSlottedContent);
70
47
  }
71
48
  disconnectedCallback() {
72
49
  var _a, _b, _c, _d, _e, _f;
@@ -83,24 +60,21 @@ export class CatTooltip {
83
60
  }
84
61
  }
85
62
  render() {
86
- return (h(Host, null,
87
- h("div", { ref: el => (this.triggerElement = el), "aria-describedby": this.id, class: "tooltip-trigger" },
88
- h("slot", null)),
89
- h("div", { ref: el => (this.tooltip = el), id: this.id, "aria-hidden": this.hidden, class: {
90
- tooltip: true,
91
- 'tooltip-hidden': this.hidden,
92
- 'tooltip-round': this.round,
93
- [`tooltip-${this.size}`]: Boolean(this.size)
94
- } }, this.content)));
63
+ return (h(Host, null, h("div", { ref: el => (this.triggerElement = el), "aria-describedby": this.id, class: "tooltip-trigger" }, h("slot", null)), h("div", { ref: el => (this.tooltip = el), id: this.id, "aria-hidden": this.hidden, class: {
64
+ tooltip: true,
65
+ 'tooltip-hidden': this.hidden,
66
+ 'tooltip-round': this.round,
67
+ [`tooltip-${this.size}`]: Boolean(this.size)
68
+ } }, this.hasSlottedContent ? h("slot", { name: "content" }) : this.content)));
95
69
  }
96
70
  get isTabbable() {
97
71
  return firstTabbable(this.trigger);
98
72
  }
99
- update() {
73
+ async update() {
100
74
  if (this.trigger && this.tooltip) {
101
- computePosition(this.trigger, this.tooltip, {
75
+ await computePosition(this.trigger, this.tooltip, {
102
76
  placement: this.placement,
103
- middleware: [offset(CatTooltip.OFFSET), flip()]
77
+ middleware: [offset(CatTooltip.OFFSET), flip(), shift({ padding: CatTooltip.SHIFT_PADDING })]
104
78
  }).then(({ x, y }) => {
105
79
  if (this.tooltip) {
106
80
  Object.assign(this.tooltip.style, {
@@ -145,170 +119,185 @@ export class CatTooltip {
145
119
  }
146
120
  static get is() { return "cat-tooltip"; }
147
121
  static get encapsulation() { return "shadow"; }
148
- static get originalStyleUrls() { return {
149
- "$": ["cat-tooltip.scss"]
150
- }; }
151
- static get styleUrls() { return {
152
- "$": ["cat-tooltip.css"]
153
- }; }
154
- static get properties() { return {
155
- "content": {
156
- "type": "string",
157
- "mutable": false,
158
- "complexType": {
159
- "original": "string",
160
- "resolved": "string",
161
- "references": {}
162
- },
163
- "required": false,
164
- "optional": false,
165
- "docs": {
166
- "tags": [],
167
- "text": "The content of the tooltip."
168
- },
169
- "attribute": "content",
170
- "reflect": false,
171
- "defaultValue": "''"
172
- },
173
- "disabled": {
174
- "type": "boolean",
175
- "mutable": false,
176
- "complexType": {
177
- "original": "boolean",
178
- "resolved": "boolean",
179
- "references": {}
122
+ static get originalStyleUrls() {
123
+ return {
124
+ "$": ["cat-tooltip.scss"]
125
+ };
126
+ }
127
+ static get styleUrls() {
128
+ return {
129
+ "$": ["cat-tooltip.css"]
130
+ };
131
+ }
132
+ static get properties() {
133
+ return {
134
+ "content": {
135
+ "type": "string",
136
+ "mutable": false,
137
+ "complexType": {
138
+ "original": "string",
139
+ "resolved": "string",
140
+ "references": {}
141
+ },
142
+ "required": false,
143
+ "optional": false,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": "The content of the tooltip."
147
+ },
148
+ "attribute": "content",
149
+ "reflect": false,
150
+ "defaultValue": "''"
180
151
  },
181
- "required": false,
182
- "optional": false,
183
- "docs": {
184
- "tags": [],
185
- "text": "Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\nand invisible. Corresponds with the native HTML disabled attribute."
152
+ "disabled": {
153
+ "type": "boolean",
154
+ "mutable": false,
155
+ "complexType": {
156
+ "original": "boolean",
157
+ "resolved": "boolean",
158
+ "references": {}
159
+ },
160
+ "required": false,
161
+ "optional": false,
162
+ "docs": {
163
+ "tags": [],
164
+ "text": "Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\nand invisible. Corresponds with the native HTML disabled attribute."
165
+ },
166
+ "attribute": "disabled",
167
+ "reflect": false,
168
+ "defaultValue": "false"
186
169
  },
187
- "attribute": "disabled",
188
- "reflect": false,
189
- "defaultValue": "false"
190
- },
191
- "placement": {
192
- "type": "string",
193
- "mutable": false,
194
- "complexType": {
195
- "original": "Placement",
196
- "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
197
- "references": {
198
- "Placement": {
199
- "location": "import",
200
- "path": "@floating-ui/dom"
170
+ "placement": {
171
+ "type": "string",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "Placement",
175
+ "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
176
+ "references": {
177
+ "Placement": {
178
+ "location": "import",
179
+ "path": "@floating-ui/dom"
180
+ }
201
181
  }
202
- }
203
- },
204
- "required": false,
205
- "optional": false,
206
- "docs": {
207
- "tags": [],
208
- "text": "The placement of the tooltip."
209
- },
210
- "attribute": "placement",
211
- "reflect": false,
212
- "defaultValue": "'top'"
213
- },
214
- "round": {
215
- "type": "boolean",
216
- "mutable": false,
217
- "complexType": {
218
- "original": "boolean",
219
- "resolved": "boolean",
220
- "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "The placement of the tooltip."
188
+ },
189
+ "attribute": "placement",
190
+ "reflect": false,
191
+ "defaultValue": "'top'"
221
192
  },
222
- "required": false,
223
- "optional": false,
224
- "docs": {
225
- "tags": [],
226
- "text": "Use round tooltip edges."
193
+ "round": {
194
+ "type": "boolean",
195
+ "mutable": false,
196
+ "complexType": {
197
+ "original": "boolean",
198
+ "resolved": "boolean",
199
+ "references": {}
200
+ },
201
+ "required": false,
202
+ "optional": false,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": "Use round tooltip edges."
206
+ },
207
+ "attribute": "round",
208
+ "reflect": false,
209
+ "defaultValue": "false"
227
210
  },
228
- "attribute": "round",
229
- "reflect": false,
230
- "defaultValue": "false"
231
- },
232
- "size": {
233
- "type": "string",
234
- "mutable": false,
235
- "complexType": {
236
- "original": "'s' | 'm' | 'l'",
237
- "resolved": "\"l\" | \"m\" | \"s\"",
238
- "references": {}
211
+ "size": {
212
+ "type": "string",
213
+ "mutable": false,
214
+ "complexType": {
215
+ "original": "'s' | 'm' | 'l'",
216
+ "resolved": "\"l\" | \"m\" | \"s\"",
217
+ "references": {}
218
+ },
219
+ "required": false,
220
+ "optional": false,
221
+ "docs": {
222
+ "tags": [],
223
+ "text": "The size of the tooltip."
224
+ },
225
+ "attribute": "size",
226
+ "reflect": false,
227
+ "defaultValue": "'m'"
239
228
  },
240
- "required": false,
241
- "optional": false,
242
- "docs": {
243
- "tags": [],
244
- "text": "The size of the tooltip."
229
+ "showDelay": {
230
+ "type": "number",
231
+ "mutable": false,
232
+ "complexType": {
233
+ "original": "number",
234
+ "resolved": "number",
235
+ "references": {}
236
+ },
237
+ "required": false,
238
+ "optional": false,
239
+ "docs": {
240
+ "tags": [],
241
+ "text": "The delay time for showing tooltip in ms."
242
+ },
243
+ "attribute": "show-delay",
244
+ "reflect": false,
245
+ "defaultValue": "250"
245
246
  },
246
- "attribute": "size",
247
- "reflect": false,
248
- "defaultValue": "'m'"
249
- },
250
- "showDelay": {
251
- "type": "number",
252
- "mutable": false,
253
- "complexType": {
254
- "original": "number",
255
- "resolved": "number",
256
- "references": {}
247
+ "hideDelay": {
248
+ "type": "number",
249
+ "mutable": false,
250
+ "complexType": {
251
+ "original": "number",
252
+ "resolved": "number",
253
+ "references": {}
254
+ },
255
+ "required": false,
256
+ "optional": false,
257
+ "docs": {
258
+ "tags": [],
259
+ "text": "The delay time for hiding tooltip in ms."
260
+ },
261
+ "attribute": "hide-delay",
262
+ "reflect": false,
263
+ "defaultValue": "0"
257
264
  },
258
- "required": false,
259
- "optional": false,
260
- "docs": {
261
- "tags": [],
262
- "text": "The delay time for showing tooltip in ms."
263
- },
264
- "attribute": "show-delay",
265
- "reflect": false,
266
- "defaultValue": "250"
267
- },
268
- "hideDelay": {
269
- "type": "number",
270
- "mutable": false,
271
- "complexType": {
272
- "original": "number",
273
- "resolved": "number",
274
- "references": {}
275
- },
276
- "required": false,
277
- "optional": false,
278
- "docs": {
279
- "tags": [],
280
- "text": "The delay time for hiding tooltip in ms."
281
- },
282
- "attribute": "hide-delay",
283
- "reflect": false,
284
- "defaultValue": "0"
285
- },
286
- "longTouchDuration": {
287
- "type": "number",
288
- "mutable": false,
289
- "complexType": {
290
- "original": "number",
291
- "resolved": "number",
292
- "references": {}
293
- },
294
- "required": false,
295
- "optional": false,
296
- "docs": {
297
- "tags": [],
298
- "text": "The duration of tap to show the tooltip."
299
- },
300
- "attribute": "long-touch-duration",
301
- "reflect": false,
302
- "defaultValue": "1000"
303
- }
304
- }; }
305
- static get listeners() { return [{
306
- "name": "keydown",
307
- "method": "handleKeyDown",
308
- "target": undefined,
309
- "capture": false,
310
- "passive": false
311
- }]; }
265
+ "longTouchDuration": {
266
+ "type": "number",
267
+ "mutable": false,
268
+ "complexType": {
269
+ "original": "number",
270
+ "resolved": "number",
271
+ "references": {}
272
+ },
273
+ "required": false,
274
+ "optional": false,
275
+ "docs": {
276
+ "tags": [],
277
+ "text": "The duration of tap to show the tooltip."
278
+ },
279
+ "attribute": "long-touch-duration",
280
+ "reflect": false,
281
+ "defaultValue": "1000"
282
+ }
283
+ };
284
+ }
285
+ static get states() {
286
+ return {
287
+ "hasSlottedContent": {}
288
+ };
289
+ }
290
+ static get elementRef() { return "hostElement"; }
291
+ static get listeners() {
292
+ return [{
293
+ "name": "keydown",
294
+ "method": "handleKeyDown",
295
+ "target": undefined,
296
+ "capture": false,
297
+ "passive": false
298
+ }];
299
+ }
312
300
  }
313
301
  CatTooltip.OFFSET = 4;
314
- //# sourceMappingURL=cat-tooltip.js.map
302
+ CatTooltip.SHIFT_PADDING = 4;
303
+ //# sourceMappingURL=cat-tooltip.js.map
@@ -1 +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;IAO9C,WAAM,GAAG,KAAK,CAAC;IAEvB;;OAEG;IACK,YAAO,GAAG,EAAE,CAAC;IAErB;;;OAGG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,cAAS,GAAc,KAAK,CAAC;IAErC;;OAEG;IACK,UAAK,GAAG,KAAK,CAAC;IAEtB;;OAEG;IACK,SAAI,GAAoB,GAAG,CAAC;IAEpC;;OAEG;IACK,cAAS,GAAG,GAAG,CAAC;IAExB;;OAEG;IACK,cAAS,GAAG,CAAC,CAAC;IAEtB;;OAEG;IACK,sBAAiB,GAAG,IAAI,CAAC;GA2HlC;EAxHC,aAAa,CAAC,EAAE,GAAG,EAAiB;IAClC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;EAC1C,CAAC;EAED,gBAAgB;;IACd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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3KuB,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 private hidden = 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')\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\n if (this.trigger && this.tooltip) {\n autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.windowTouchStartListener.bind(this));\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 componentWillRender(): void {\n this.hidden = !this.content || this.disabled;\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.windowTouchStartListener.bind(this));\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 <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n aria-hidden={this.hidden}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.hidden,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n {this.content}\n </div>\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.showTooltip();\n }, this.showDelay);\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.tooltip?.classList.remove('tooltip-show');\n }, this.hideDelay);\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n this.touchTimeout = window.setTimeout(() => {\n this.showTooltip();\n }, this.longTouchDuration);\n }\n\n private touchEndListener() {\n if (this.touchTimeout) {\n window.clearTimeout(this.touchTimeout);\n }\n }\n\n private windowTouchStartListener() {\n this.tooltip?.classList.remove('tooltip-show');\n }\n\n private showTooltip() {\n !this.hidden && this.tooltip?.classList.add('tooltip-show');\n }\n}\n"]}
1
+ {"version":3,"file":"cat-tooltip.js","sourceRoot":"","sources":["../../../src/components/cat-tooltip/cat-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjF,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,IAAI,YAAY,GAAG,CAAC,CAAC;AAOrB,MAAM,OAAO,UAAU;;IAGJ,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;IAO9C,WAAM,GAAG,KAAK,CAAC;6BAIM,KAAK;mBAKhB,EAAE;oBAMD,KAAK;qBAKO,KAAK;iBAKpB,KAAK;gBAKW,GAAG;qBAKf,GAAG;qBAKH,CAAC;6BAKO,IAAI;;EAGhC,aAAa,CAAC,EAAE,GAAG,EAAiB;IAClC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;EAC1C,CAAC;EAED,gBAAgB;;IACd,IAAI,CAAC,OAAO,GAAG,aAAa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CAAC;EACjD,CAAC;EAEO,WAAW;;IACjB,CAAC,IAAI,CAAC,MAAM,KAAI,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA,CAAC;EAC9D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAjLuB,iBAAM,GAAG,CAAC,CAAC;AACX,wBAAa,GAAG,CAAC,CAAC","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport { FocusableElement } from 'tabbable';\nimport firstTabbable from '../../utils/first-tabbable';\nimport isTouchScreen from '../../utils/is-touch-screen';\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 static readonly SHIFT_PADDING = 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 private hidden = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedContent = 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')\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\n if (this.trigger && this.tooltip) {\n autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.windowTouchStartListener.bind(this));\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 componentWillRender(): void {\n this.hasSlottedContent = !!this.hostElement.querySelector('[slot=\"content\"]');\n this.hidden = this.disabled || (!this.content && !this.hasSlottedContent);\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.windowTouchStartListener.bind(this));\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 <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n aria-hidden={this.hidden}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.hidden,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n {this.hasSlottedContent ? <slot name=\"content\" /> : this.content}\n </div>\n </Host>\n );\n }\n\n private get isTabbable() {\n return firstTabbable(this.trigger);\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n placement: this.placement,\n middleware: [offset(CatTooltip.OFFSET), flip(), shift({ padding: CatTooltip.SHIFT_PADDING })]\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.showTooltip();\n }, this.showDelay);\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.tooltip?.classList.remove('tooltip-show');\n }, this.hideDelay);\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n this.touchTimeout = window.setTimeout(() => {\n this.showTooltip();\n }, this.longTouchDuration);\n }\n\n private touchEndListener() {\n if (this.touchTimeout) {\n window.clearTimeout(this.touchTimeout);\n }\n }\n\n private windowTouchStartListener() {\n this.tooltip?.classList.remove('tooltip-show');\n }\n\n private showTooltip() {\n !this.hidden && this.tooltip?.classList.add('tooltip-show');\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export { catI18nRegistry, CatI18nRegistry } from './components/cat-i18n/cat-i18n-registry';
2
2
  export { catIconRegistry, CatIconRegistry } from './components/cat-icon/cat-icon-registry';
3
3
  export { catNotificationService, CatNotificationService } from './components/cat-notification/cat-notification';
4
- //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -1,17 +1,7 @@
1
- @use 'fonts.mixins.azeret' as *;
2
- @use 'fonts.mixins.dm' as *;
3
1
  @use 'fonts.mixins.lato' as *;
4
2
 
5
3
  @mixin cat-fonts($path) {
6
- @include cat-font-dm-sans($path, 500) {
7
- font-display: swap;
8
- }
9
-
10
4
  @include cat-font-lato($path, 300, 400, 500, 700) {
11
5
  font-display: fallback;
12
6
  }
13
-
14
- @include cat-font-azeret($path, 400) {
15
- font-display: fallback;
16
- }
17
7
  }
@@ -9,4 +9,4 @@ export const Breakpoints = {
9
9
  export function isBreakpoint(value) {
10
10
  return typeof value === 'string' && _breakpoints.includes(value);
11
11
  }
12
- //# sourceMappingURL=breakpoints.js.map
12
+ //# sourceMappingURL=breakpoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"breakpoints.js","sourceRoot":"","sources":["../../src/utils/breakpoints.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAI1D,MAAM,CAAC,MAAM,WAAW,GAA2C;EACjE,EAAE,EAAE,uBAAuB;EAC3B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,wBAAwB;EAC3B,EAAE,EAAE,wBAAwB;CAC7B,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,KAAc;EACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAmB,CAAC,CAAC;AACjF,CAAC","sourcesContent":["const _breakpoints = ['xs', 's', 'm', 'l', 'xl'] as const;\n\nexport type Breakpoint = typeof _breakpoints[number];\n\nexport const Breakpoints: { [breakpoint in Breakpoint]: string } = {\n xs: '(max-width: 539.98px)',\n s: '(max-width: 767.98px)',\n m: '(max-width: 991.98px)',\n l: '(max-width: 1199.98px)',\n xl: '(max-width: 1399.98px)'\n};\n\nexport function isBreakpoint(value: unknown): value is Breakpoint {\n return typeof value === 'string' && _breakpoints.includes(value as Breakpoint);\n}\n"]}
1
+ {"version":3,"file":"breakpoints.js","sourceRoot":"","sources":["../../src/utils/breakpoints.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAI1D,MAAM,CAAC,MAAM,WAAW,GAA2C;EACjE,EAAE,EAAE,uBAAuB;EAC3B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,wBAAwB;EAC3B,EAAE,EAAE,wBAAwB;CAC7B,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,KAAc;EACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAmB,CAAC,CAAC;AACjF,CAAC","sourcesContent":["const _breakpoints = ['xs', 's', 'm', 'l', 'xl'] as const;\n\nexport type Breakpoint = (typeof _breakpoints)[number];\n\nexport const Breakpoints: { [breakpoint in Breakpoint]: string } = {\n xs: '(max-width: 539.98px)',\n s: '(max-width: 767.98px)',\n m: '(max-width: 991.98px)',\n l: '(max-width: 1199.98px)',\n xl: '(max-width: 1399.98px)'\n};\n\nexport function isBreakpoint(value: unknown): value is Breakpoint {\n return typeof value === 'string' && _breakpoints.includes(value as Breakpoint);\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ export function coerceBoolean(value) {
3
+ return value != null && `${value}` !== 'false';
4
+ }
5
+ export function coerceNumber(value, fallbackValue = 0) {
6
+ return isNumberValue(value) ? Number(value) : fallbackValue;
7
+ }
8
+ function isNumberValue(value) {
9
+ return !isNaN(parseFloat(value)) && !isNaN(Number(value));
10
+ }
11
+ //# sourceMappingURL=coerce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce.js","sourceRoot":"","sources":["../../src/utils/coerce.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,MAAM,UAAU,aAAa,CAAC,KAAU;EACtC,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE,KAAK,OAAO,CAAC;AACjD,CAAC;AAID,MAAM,UAAU,YAAY,CAAC,KAAU,EAAE,aAAa,GAAG,CAAC;EACxD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;AAC9D,CAAC;AAED,SAAS,aAAa,CAAC,KAAU;EAC/B,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport function coerceBoolean(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n\nexport function coerceNumber(value: any): number;\nexport function coerceNumber<D>(value: any, fallback: D): number | D;\nexport function coerceNumber(value: any, fallbackValue = 0) {\n return isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\nfunction isNumberValue(value: any): boolean {\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\n}\n"]}
@@ -3,4 +3,4 @@ const firstTabbable = (container) => {
3
3
  return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
4
4
  };
5
5
  export default firstTabbable;
6
- //# sourceMappingURL=first-tabbable.js.map
6
+ //# sourceMappingURL=first-tabbable.js.map
@@ -1,3 +1,3 @@
1
1
  const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
2
2
  export default isTouchDevice;
3
- //# sourceMappingURL=is-touch-screen.js.map
3
+ //# sourceMappingURL=is-touch-screen.js.map