@haiilo/catalyst 11.0.0 → 12.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 (350) 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/index.esm.js +2 -2
  4. package/dist/catalyst/index.esm.js.map +1 -1
  5. package/dist/catalyst/loader.esm.js.map +1 -0
  6. package/dist/catalyst/p-6a54965a.entry.js +10 -0
  7. package/dist/catalyst/p-6a54965a.entry.js.map +1 -0
  8. package/dist/catalyst/p-B-m4GNf1.js +3 -0
  9. package/dist/catalyst/p-B-m4GNf1.js.map +1 -0
  10. package/dist/catalyst/p-DQuL1Twl.js +2 -0
  11. package/dist/catalyst/p-DQuL1Twl.js.map +1 -0
  12. package/dist/catalyst/p-LJZzaWFR.js +2 -0
  13. package/dist/catalyst/p-LJZzaWFR.js.map +1 -0
  14. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  15. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  16. package/dist/cjs/cat-alert_30.cjs.entry.js +1467 -1833
  17. package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
  18. package/dist/cjs/catalyst.cjs.js +8 -7
  19. package/dist/cjs/catalyst.cjs.js.map +1 -1
  20. package/dist/cjs/index-DNLT6JC9.js +10178 -0
  21. package/dist/cjs/index-DNLT6JC9.js.map +1 -0
  22. package/dist/cjs/{index-1094f0fc.js → index-jGQAsDy6.js} +528 -358
  23. package/dist/cjs/index-jGQAsDy6.js.map +1 -0
  24. package/dist/cjs/index.cjs.js +461 -453
  25. package/dist/cjs/index.cjs.js.map +1 -1
  26. package/dist/cjs/loader.cjs.js +4 -5
  27. package/dist/cjs/loader.cjs.js.map +1 -1
  28. package/dist/collection/collection-manifest.json +2 -2
  29. package/dist/collection/components/cat-alert/cat-alert.js +15 -4
  30. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  31. package/dist/collection/components/cat-avatar/cat-avatar.js +33 -14
  32. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  33. package/dist/collection/components/cat-badge/cat-badge.js +45 -9
  34. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  35. package/dist/collection/components/cat-button/cat-button.css +4 -2
  36. package/dist/collection/components/cat-button/cat-button.js +107 -35
  37. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  38. package/dist/collection/components/cat-button-group/cat-button-group.js +3 -2
  39. package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
  40. package/dist/collection/components/cat-checkbox/cat-checkbox.js +83 -24
  41. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  42. package/dist/collection/components/cat-date/cat-date.js +114 -39
  43. package/dist/collection/components/cat-date/cat-date.js.map +1 -1
  44. package/dist/collection/components/cat-date-inline/cat-date-inline.js +69 -19
  45. package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
  46. package/dist/collection/components/cat-datepicker/cat-datepicker.js +130 -42
  47. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  48. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +37 -12
  49. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
  50. package/dist/collection/components/cat-dropdown/cat-dropdown.js +129 -17
  51. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  52. package/dist/collection/components/cat-form-group/cat-form-group.js +19 -4
  53. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  54. package/dist/collection/components/cat-icon/cat-icon.js +15 -7
  55. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  56. package/dist/collection/components/cat-input/cat-input.js +143 -51
  57. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  58. package/dist/collection/components/cat-pagination/cat-pagination.js +60 -10
  59. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  60. package/dist/collection/components/cat-radio/cat-radio.js +65 -18
  61. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  62. package/dist/collection/components/cat-radio-group/cat-radio-group.js +21 -8
  63. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  64. package/dist/collection/components/cat-scrollable/cat-scrollable.js +32 -7
  65. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  66. package/dist/collection/components/cat-select/cat-select.js +105 -34
  67. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  68. package/dist/collection/components/cat-skeleton/cat-skeleton.js +22 -5
  69. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  70. package/dist/collection/components/cat-spinner/cat-spinner.js +15 -4
  71. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  72. package/dist/collection/components/cat-tab/cat-tab.js +84 -17
  73. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  74. package/dist/collection/components/cat-tabs/cat-tabs.css +29 -12
  75. package/dist/collection/components/cat-tabs/cat-tabs.js +189 -8
  76. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  77. package/dist/collection/components/cat-tag/cat-tag.js +84 -25
  78. package/dist/collection/components/cat-tag/cat-tag.js.map +1 -1
  79. package/dist/collection/components/cat-textarea/cat-textarea.js +90 -32
  80. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  81. package/dist/collection/components/cat-time/cat-time.js +120 -39
  82. package/dist/collection/components/cat-time/cat-time.js.map +1 -1
  83. package/dist/collection/components/cat-toggle/cat-toggle.js +71 -22
  84. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  85. package/dist/collection/components/cat-tooltip/cat-tooltip.js +49 -8
  86. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  87. package/dist/components/cat-alert.js +8 -3
  88. package/dist/components/cat-alert.js.map +1 -1
  89. package/dist/components/cat-avatar.js +1 -0
  90. package/dist/components/cat-avatar2.js +11 -8
  91. package/dist/components/cat-avatar2.js.map +1 -1
  92. package/dist/components/cat-badge.js +23 -3
  93. package/dist/components/cat-badge.js.map +1 -1
  94. package/dist/components/cat-button-group.js +2 -3
  95. package/dist/components/cat-button-group.js.map +1 -1
  96. package/dist/components/cat-button.js +1 -0
  97. package/dist/components/cat-button2.js +41 -17
  98. package/dist/components/cat-button2.js.map +1 -1
  99. package/dist/components/cat-card.js +2 -2
  100. package/dist/components/cat-card.js.map +1 -1
  101. package/dist/components/cat-checkbox.js +1 -0
  102. package/dist/components/cat-checkbox2.js +34 -10
  103. package/dist/components/cat-checkbox2.js.map +1 -1
  104. package/dist/components/cat-date-inline.js +1 -0
  105. package/dist/components/cat-date-inline2.js +29 -7
  106. package/dist/components/cat-date-inline2.js.map +1 -1
  107. package/dist/components/cat-date.js +41 -17
  108. package/dist/components/cat-date.js.map +1 -1
  109. package/dist/components/cat-datepicker-inline.js +16 -8
  110. package/dist/components/cat-datepicker-inline.js.map +1 -1
  111. package/dist/components/cat-datepicker.js +50 -20
  112. package/dist/components/cat-datepicker.js.map +1 -1
  113. package/dist/components/cat-datepicker.locale.js +110 -99
  114. package/dist/components/cat-datepicker.locale.js.map +1 -1
  115. package/dist/components/cat-dropdown.js +1 -0
  116. package/dist/components/cat-dropdown2.js +70 -13
  117. package/dist/components/cat-dropdown2.js.map +1 -1
  118. package/dist/components/cat-form-group.js +12 -3
  119. package/dist/components/cat-form-group.js.map +1 -1
  120. package/dist/components/cat-form-hint.js +1 -0
  121. package/dist/components/cat-form-hint.js.map +1 -1
  122. package/dist/components/cat-i18n-registry.js +1 -0
  123. package/dist/components/cat-i18n-registry.js.map +1 -1
  124. package/dist/components/cat-icon-registry.js +22 -21
  125. package/dist/components/cat-icon-registry.js.map +1 -1
  126. package/dist/components/cat-icon.js +1 -0
  127. package/dist/components/cat-icon2.js +5 -5
  128. package/dist/components/cat-icon2.js.map +1 -1
  129. package/dist/components/cat-input.js +1 -0
  130. package/dist/components/cat-input2.js +50 -25
  131. package/dist/components/cat-input2.js.map +1 -1
  132. package/dist/components/cat-pagination.js +32 -2
  133. package/dist/components/cat-pagination.js.map +1 -1
  134. package/dist/components/cat-radio-group.js +8 -5
  135. package/dist/components/cat-radio-group.js.map +1 -1
  136. package/dist/components/cat-radio.js +28 -8
  137. package/dist/components/cat-radio.js.map +1 -1
  138. package/dist/components/cat-scrollable.js +1 -0
  139. package/dist/components/cat-scrollable2.js +322 -542
  140. package/dist/components/cat-scrollable2.js.map +1 -1
  141. package/dist/components/cat-select-demo.js +27 -49
  142. package/dist/components/cat-select-demo.js.map +1 -1
  143. package/dist/components/cat-select.js +1 -0
  144. package/dist/components/cat-select2.js +135 -316
  145. package/dist/components/cat-select2.js.map +1 -1
  146. package/dist/components/cat-skeleton.js +1 -0
  147. package/dist/components/cat-skeleton2.js +12 -3
  148. package/dist/components/cat-skeleton2.js.map +1 -1
  149. package/dist/components/cat-spinner.js +1 -0
  150. package/dist/components/cat-spinner2.js +8 -3
  151. package/dist/components/cat-spinner2.js.map +1 -1
  152. package/dist/components/cat-tab.js +34 -9
  153. package/dist/components/cat-tab.js.map +1 -1
  154. package/dist/components/cat-tabs.js +140 -11
  155. package/dist/components/cat-tabs.js.map +1 -1
  156. package/dist/components/cat-tag.js +35 -13
  157. package/dist/components/cat-tag.js.map +1 -1
  158. package/dist/components/cat-textarea.js +33 -16
  159. package/dist/components/cat-textarea.js.map +1 -1
  160. package/dist/components/cat-time.js +44 -16
  161. package/dist/components/cat-time.js.map +1 -1
  162. package/dist/components/cat-toggle.js +28 -10
  163. package/dist/components/cat-toggle.js.map +1 -1
  164. package/dist/components/cat-tooltip.js +28 -3
  165. package/dist/components/cat-tooltip.js.map +1 -1
  166. package/dist/components/coerce.js +1 -0
  167. package/dist/components/coerce.js.map +1 -1
  168. package/dist/components/first-tabbable.js +1 -0
  169. package/dist/components/first-tabbable.js.map +1 -1
  170. package/dist/components/{floating-ui.dom.esm.js → floating-ui.dom.js} +3 -492
  171. package/dist/components/floating-ui.dom.js.map +1 -0
  172. package/dist/components/index.js +460 -450
  173. package/dist/components/index.js.map +1 -1
  174. package/dist/components/index2.js +9456 -0
  175. package/dist/components/index2.js.map +1 -0
  176. package/dist/components/loglevel.js +368 -356
  177. package/dist/components/loglevel.js.map +1 -1
  178. package/dist/components/media-matcher.js +1 -0
  179. package/dist/components/media-matcher.js.map +1 -1
  180. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  181. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  182. package/dist/esm/cat-alert_30.entry.js +1428 -1792
  183. package/dist/esm/cat-alert_30.entry.js.map +1 -1
  184. package/dist/esm/catalyst.js +7 -5
  185. package/dist/esm/catalyst.js.map +1 -1
  186. package/dist/esm/{index-e8c0ddf2.js → index-B-m4GNf1.js} +528 -338
  187. package/dist/esm/index-B-m4GNf1.js.map +1 -0
  188. package/dist/esm/index-LJZzaWFR.js +10057 -0
  189. package/dist/esm/index-LJZzaWFR.js.map +1 -0
  190. package/dist/esm/index.js +458 -448
  191. package/dist/esm/index.js.map +1 -1
  192. package/dist/esm/loader.js +5 -4
  193. package/dist/esm/loader.js.map +1 -1
  194. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +11 -1
  195. package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
  196. package/dist/types/components/cat-tabs/cat-tabs.d.ts +18 -0
  197. package/dist/types/components.d.ts +46 -0
  198. package/dist/types/stencil-public-runtime.d.ts +28 -2
  199. package/loader/index.d.ts +3 -0
  200. package/package.json +3 -3
  201. package/dist/catalyst/p-59e2ada2.entry.js +0 -10
  202. package/dist/catalyst/p-59e2ada2.entry.js.map +0 -1
  203. package/dist/catalyst/p-7f3bcfb9.js +0 -3
  204. package/dist/catalyst/p-7f3bcfb9.js.map +0 -1
  205. package/dist/catalyst/p-9500d6fb.js +0 -2
  206. package/dist/catalyst/p-9500d6fb.js.map +0 -1
  207. package/dist/catalyst/p-e1255160.js +0 -2
  208. package/dist/catalyst/p-e1255160.js.map +0 -1
  209. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  210. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  211. package/dist/cjs/index-1094f0fc.js.map +0 -1
  212. package/dist/cjs/of-958251e4.js +0 -1549
  213. package/dist/cjs/of-958251e4.js.map +0 -1
  214. package/dist/collection/components/cat-alert/cat-alert.e2e.js +0 -11
  215. package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +0 -1
  216. package/dist/collection/components/cat-alert/cat-alert.spec.js +0 -14
  217. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +0 -1
  218. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +0 -10
  219. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +0 -1
  220. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +0 -14
  221. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +0 -1
  222. package/dist/collection/components/cat-badge/cat-badge.e2e.js +0 -10
  223. package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +0 -1
  224. package/dist/collection/components/cat-badge/cat-badge.spec.js +0 -14
  225. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +0 -1
  226. package/dist/collection/components/cat-button/cat-button.e2e.js +0 -10
  227. package/dist/collection/components/cat-button/cat-button.e2e.js.map +0 -1
  228. package/dist/collection/components/cat-button/cat-button.spec.js +0 -20
  229. package/dist/collection/components/cat-button/cat-button.spec.js.map +0 -1
  230. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +0 -10
  231. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +0 -1
  232. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +0 -14
  233. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +0 -1
  234. package/dist/collection/components/cat-card/cat-card.e2e.js +0 -10
  235. package/dist/collection/components/cat-card/cat-card.e2e.js.map +0 -1
  236. package/dist/collection/components/cat-card/cat-card.spec.js +0 -14
  237. package/dist/collection/components/cat-card/cat-card.spec.js.map +0 -1
  238. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +0 -10
  239. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +0 -1
  240. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +0 -14
  241. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +0 -1
  242. package/dist/collection/components/cat-date/cat-date.e2e.js +0 -11
  243. package/dist/collection/components/cat-date/cat-date.e2e.js.map +0 -1
  244. package/dist/collection/components/cat-date/cat-date.spec.js +0 -17
  245. package/dist/collection/components/cat-date/cat-date.spec.js.map +0 -1
  246. package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js +0 -11
  247. package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js.map +0 -1
  248. package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js +0 -16
  249. package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js.map +0 -1
  250. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +0 -11
  251. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +0 -1
  252. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +0 -15
  253. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +0 -1
  254. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +0 -11
  255. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +0 -1
  256. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +0 -15
  257. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +0 -1
  258. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +0 -10
  259. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +0 -1
  260. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +0 -21
  261. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +0 -1
  262. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +0 -10
  263. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +0 -1
  264. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +0 -14
  265. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +0 -1
  266. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +0 -15
  267. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +0 -1
  268. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +0 -7
  269. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +0 -1
  270. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +0 -7
  271. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +0 -1
  272. package/dist/collection/components/cat-icon/cat-icon.e2e.js +0 -11
  273. package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +0 -1
  274. package/dist/collection/components/cat-icon/cat-icon.spec.js +0 -15
  275. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +0 -1
  276. package/dist/collection/components/cat-input/cat-input.e2e.js +0 -11
  277. package/dist/collection/components/cat-input/cat-input.e2e.js.map +0 -1
  278. package/dist/collection/components/cat-input/cat-input.spec.js +0 -15
  279. package/dist/collection/components/cat-input/cat-input.spec.js.map +0 -1
  280. package/dist/collection/components/cat-notification/cat-notification.spec.js +0 -7
  281. package/dist/collection/components/cat-notification/cat-notification.spec.js.map +0 -1
  282. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +0 -14
  283. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +0 -1
  284. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +0 -15
  285. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +0 -1
  286. package/dist/collection/components/cat-radio/cat-radio.e2e.js +0 -10
  287. package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +0 -1
  288. package/dist/collection/components/cat-radio/cat-radio.spec.js +0 -14
  289. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +0 -1
  290. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +0 -10
  291. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +0 -1
  292. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +0 -14
  293. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +0 -1
  294. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +0 -10
  295. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +0 -1
  296. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +0 -14
  297. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +0 -1
  298. package/dist/collection/components/cat-select/cat-select.e2e.js +0 -14
  299. package/dist/collection/components/cat-select/cat-select.e2e.js.map +0 -1
  300. package/dist/collection/components/cat-select/cat-select.spec.js +0 -15
  301. package/dist/collection/components/cat-select/cat-select.spec.js.map +0 -1
  302. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +0 -10
  303. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +0 -1
  304. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +0 -14
  305. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +0 -1
  306. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +0 -10
  307. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +0 -1
  308. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +0 -18
  309. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +0 -1
  310. package/dist/collection/components/cat-tab/cat-tab.e2e.js +0 -10
  311. package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +0 -1
  312. package/dist/collection/components/cat-tab/cat-tab.spec.js +0 -14
  313. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +0 -1
  314. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +0 -10
  315. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +0 -1
  316. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +0 -14
  317. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +0 -1
  318. package/dist/collection/components/cat-tag/cat-tag.e2e.js +0 -14
  319. package/dist/collection/components/cat-tag/cat-tag.e2e.js.map +0 -1
  320. package/dist/collection/components/cat-tag/cat-tag.spec.js +0 -23
  321. package/dist/collection/components/cat-tag/cat-tag.spec.js.map +0 -1
  322. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +0 -11
  323. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +0 -1
  324. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +0 -15
  325. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +0 -1
  326. package/dist/collection/components/cat-time/cat-time.e2e.js +0 -11
  327. package/dist/collection/components/cat-time/cat-time.e2e.js.map +0 -1
  328. package/dist/collection/components/cat-time/cat-time.spec.js +0 -16
  329. package/dist/collection/components/cat-time/cat-time.spec.js.map +0 -1
  330. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +0 -10
  331. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +0 -1
  332. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +0 -14
  333. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +0 -1
  334. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +0 -10
  335. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +0 -1
  336. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +0 -20
  337. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +0 -1
  338. package/dist/collection/utils/media-matcher.spec.js +0 -39
  339. package/dist/collection/utils/media-matcher.spec.js.map +0 -1
  340. package/dist/components/floating-ui.dom.esm.js.map +0 -1
  341. package/dist/components/from.js +0 -928
  342. package/dist/components/from.js.map +0 -1
  343. package/dist/components/of.js +0 -10
  344. package/dist/components/of.js.map +0 -1
  345. package/dist/esm/app-globals-0f993ce5.js +0 -5
  346. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  347. package/dist/esm/index-e8c0ddf2.js.map +0 -1
  348. package/dist/esm/of-e4ec2eb4.js +0 -1523
  349. package/dist/esm/of-e4ec2eb4.js.map +0 -1
  350. package/loader/package.json +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;;;GAQG;AAQH,MAAM,OAAO,SAAS;;yBAQC,IAAI;iCAEI,KAAK;uBAKyB,UAAU;qBAKgB,WAAW;sBAK/E,KAAK;oBAKwB,GAAG;;;wBAoB9B,KAAK;uBAON,KAAK;sBAKN,KAAK;0BAKD,KAAK;qBAKV,KAAK;;;;wBAoBoB,KAAK;yBAK1B,KAAK;;;;;;;;;IA4CzB,iBAAiB,CAAC,KAA2B;QAC3C,WAAW;QACX,oEAAoE;QACpE,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAmB,CAAC,CAAC;QAC7E,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,QAAQ;QACR,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,KAAjB,IAAI,CAAC,YAAY,GAAK,IAAI,YAAY,EAAE,EAAC;YACzC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAA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AAC,CAAC,CAAC,IAAI;SAC1E,CAAC;IACJ,CAAC;IAEO,OAAO,CAAC,KAAiB;QAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEO,OAAO,CAAC,KAAiB;QAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,KAAiB;QAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\nimport { findClosest } from '../../utils/find-closest';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @Element() hostElement!: HTMLElement;\n\n @State() _iconOnly = true;\n\n @State() hasSlottedContent = false;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' | 'link' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' = 'secondary';\n\n /**\n * Set the button into an active state.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: string;\n\n /**\n * Attributes that will be added to the native HTML button element\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Attributes that will be added to the native HTML button content element\n */\n @Prop() nativeContentAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * The index of a button that is used inside a cat-button-group component\n */\n @Prop() buttonGroupPosition?: 'first' | 'last' | 'middle';\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n this.hasSlottedContent = this.hostElement.hasChildNodes();\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n } else if (this.submit) {\n const form = findClosest('form', this.hostElement);\n if (form && form instanceof HTMLFormElement) {\n // we can't provide a submitter as it is hidden in the shadow DOM\n form.requestSubmit();\n }\n }\n }\n\n /**\n * Programmatically move focus to the button. Use this method instead of\n * `button.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.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n if (this.url) {\n return (\n <Host data-button-group={this.buttonGroupPosition}>\n <a\n data-test={this.testId}\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-empty': !this.hasSlottedContent,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size),\n [`cat-button-group-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n </Host>\n );\n } else {\n return (\n <Host data-button-group={this.buttonGroupPosition}>\n <button\n data-test={this.testId}\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-empty': !this.hasSlottedContent,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size),\n [`cat-button-group-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n </Host>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return Boolean(this.icon) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return Boolean(this.icon) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return Boolean(this.icon) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"prefix\"></cat-icon> : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\" {...this.nativeContentAttributes}>\n <span class=\"cat-button-content-inner\">\n <slot></slot>\n </span>\n </span>\n ),\n this.hasSuffixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"suffix\"></cat-icon> : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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"]}
1
+ {"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;;;GAQG;AAQH,MAAM,OAAO,SAAS;IAPtB;QAeW,cAAS,GAAG,IAAI,CAAC;QAEjB,sBAAiB,GAAG,KAAK,CAAC;QAEnC;;WAEG;QACK,YAAO,GAA4C,UAAU,CAAC;QAEtE;;WAEG;QACK,UAAK,GAAwE,WA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\nimport { findClosest } from '../../utils/find-closest';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @Element() hostElement!: HTMLElement;\n\n @State() _iconOnly = true;\n\n @State() hasSlottedContent = false;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' | 'link' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' = 'secondary';\n\n /**\n * Set the button into an active state.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: string;\n\n /**\n * Attributes that will be added to the native HTML button element\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Attributes that will be added to the native HTML button content element\n */\n @Prop() nativeContentAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * The index of a button that is used inside a cat-button-group component\n */\n @Prop() buttonGroupPosition?: 'first' | 'last' | 'middle';\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n this.hasSlottedContent = this.hostElement.hasChildNodes();\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n } else if (this.submit) {\n const form = findClosest('form', this.hostElement);\n if (form && form instanceof HTMLFormElement) {\n // we can't provide a submitter as it is hidden in the shadow DOM\n form.requestSubmit();\n }\n }\n }\n\n /**\n * Programmatically move focus to the button. Use this method instead of\n * `button.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.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n if (this.url) {\n return (\n <Host data-button-group={this.buttonGroupPosition}>\n <a\n data-test={this.testId}\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-empty': !this.hasSlottedContent,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size),\n [`cat-button-group-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n </Host>\n );\n } else {\n return (\n <Host data-button-group={this.buttonGroupPosition}>\n <button\n data-test={this.testId}\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-empty': !this.hasSlottedContent,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size),\n [`cat-button-group-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n </Host>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return Boolean(this.icon) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return Boolean(this.icon) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return Boolean(this.icon) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"prefix\"></cat-icon> : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\" {...this.nativeContentAttributes}>\n <span class=\"cat-button-content-inner\">\n <slot></slot>\n </span>\n </span>\n ),\n this.hasSuffixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"suffix\"></cat-icon> : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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"]}
@@ -6,7 +6,6 @@ import { h, Host } from "@stencil/core";
6
6
  export class CatButtonGroup {
7
7
  constructor() {
8
8
  this.buttonElements = [];
9
- this.a11yLabel = undefined;
10
9
  }
11
10
  render() {
12
11
  return (h(Host, { key: '3d43547333f73560d31ca96bdba2d2b8b9976dbd', role: "group", "aria-label": this.a11yLabel }, h("slot", { key: 'd329ea90250b161862361e907427920e8866445a', onSlotchange: this.onSlotChange.bind(this) })));
@@ -34,6 +33,7 @@ export class CatButtonGroup {
34
33
  return {
35
34
  "a11yLabel": {
36
35
  "type": "string",
36
+ "attribute": "a11y-label",
37
37
  "mutable": false,
38
38
  "complexType": {
39
39
  "original": "string",
@@ -46,7 +46,8 @@ export class CatButtonGroup {
46
46
  "tags": [],
47
47
  "text": "Adds an accessible label for the button group that\nit is only shown in assistive technologies, like screen readers."
48
48
  },
49
- "attribute": "a11y-label",
49
+ "getter": false,
50
+ "setter": false,
50
51
  "reflect": false
51
52
  }
52
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cat-button-group.js","sourceRoot":"","sources":["../../../src/components/cat-button-group/cat-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElE;;;GAGG;AAMH,MAAM,OAAO,cAAc;;QACjB,mBAAc,GAA2B,EAAE,CAAC;;;IAUpD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,OAAO,gBAAa,IAAI,CAAC,SAAS;YAC3C,6DAAM,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACpD,CACR,CAAC;IACJ,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,IAAI,CAC9B,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAC/B,0GAA0G,CAC3G,CACF,CAAC;QACF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC7C,OAAO,CAAC,mBAAmB;gBACzB,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QACzF,CAAC,CAAC,CAAC;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n/**\n * Button groups are designed to bring together button controls that are of a\n * similar nature. For example text formatting controls.\n */\n@Component({\n tag: 'cat-button-group',\n styleUrl: 'cat-button-group.scss',\n shadow: true\n})\nexport class CatButtonGroup {\n private buttonElements: HTMLCatButtonElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Adds an accessible label for the button group that\n * it is only shown in assistive technologies, like screen readers.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <Host role=\"group\" aria-label={this.a11yLabel}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.buttonElements = Array.from(\n this.hostElement.querySelectorAll(\n ':scope > cat-button, :scope > cat-tooltip > cat-button, :scope > cat-dropdown cat-button[slot=\"trigger\"]'\n )\n );\n this.buttonElements.forEach((element, index) => {\n element.buttonGroupPosition =\n index === 0 ? 'first' : index === this.buttonElements.length - 1 ? 'last' : 'middle';\n });\n }\n}\n"]}
1
+ {"version":3,"file":"cat-button-group.js","sourceRoot":"","sources":["../../../src/components/cat-button-group/cat-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElE;;;GAGG;AAMH,MAAM,OAAO,cAAc;IAL3B;QAMU,mBAAc,GAA2B,EAAE,CAAC;KA6BrD;IAnBC,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,OAAO,gBAAa,IAAI,CAAC,SAAS;YAC3C,6DAAM,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACpD,CACR,CAAC;IACJ,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,IAAI,CAC9B,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAC/B,0GAA0G,CAC3G,CACF,CAAC;QACF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC7C,OAAO,CAAC,mBAAmB;gBACzB,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QACzF,CAAC,CAAC,CAAC;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n/**\n * Button groups are designed to bring together button controls that are of a\n * similar nature. For example text formatting controls.\n */\n@Component({\n tag: 'cat-button-group',\n styleUrl: 'cat-button-group.scss',\n shadow: true\n})\nexport class CatButtonGroup {\n private buttonElements: HTMLCatButtonElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Adds an accessible label for the button group that\n * it is only shown in assistive technologies, like screen readers.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <Host role=\"group\" aria-label={this.a11yLabel}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.buttonElements = Array.from(\n this.hostElement.querySelectorAll(\n ':scope > cat-button, :scope > cat-tooltip > cat-button, :scope > cat-dropdown cat-button[slot=\"trigger\"]'\n )\n );\n this.buttonElements.forEach((element, index) => {\n element.buttonGroupPosition =\n index === 0 ? 'first' : index === this.buttonElements.length - 1 ? 'last' : 'middle';\n });\n }\n}\n"]}
@@ -16,22 +16,46 @@ export class CatCheckbox {
16
16
  this._id = `cat-checkbox-${nextUniqueId++}`;
17
17
  this.hasSlottedLabel = false;
18
18
  this.hasSlottedHint = false;
19
+ /**
20
+ * Checked state of the checkbox
21
+ */
19
22
  this.checked = false;
23
+ /**
24
+ * Indeterminate state of the checkbox
25
+ */
20
26
  this.indeterminate = false;
27
+ /**
28
+ * Disabled state of the checkbox
29
+ */
21
30
  this.disabled = false;
22
- this.identifier = undefined;
31
+ /**
32
+ * Label of the checkbox which is presented in the UI
33
+ */
23
34
  this.label = '';
35
+ /**
36
+ * Visually hide the label, but still show it to assistive technologies like screen readers.
37
+ */
24
38
  this.labelHidden = false;
25
- this.name = undefined;
39
+ /**
40
+ * Required state of the checkbox.
41
+ */
26
42
  this.required = false;
27
- this.value = undefined;
28
- this.noValue = undefined;
43
+ /**
44
+ * The resolved value of the checkbox, based on the checked state and value.
45
+ */
46
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
47
  this.resolvedValue = null;
30
- this.hint = undefined;
48
+ /**
49
+ * Whether the label should appear to the left of the checkbox.
50
+ */
31
51
  this.labelLeft = false;
52
+ /**
53
+ * The alignment of the checkbox.
54
+ */
32
55
  this.alignment = 'top';
33
- this.nativeAttributes = undefined;
34
- this.testId = undefined;
56
+ /**
57
+ * Whether the label need a marker to shown if the input is required or optional.
58
+ */
35
59
  this.requiredMarker = 'none';
36
60
  }
37
61
  get id() {
@@ -107,6 +131,7 @@ export class CatCheckbox {
107
131
  return {
108
132
  "checked": {
109
133
  "type": "boolean",
134
+ "attribute": "checked",
110
135
  "mutable": true,
111
136
  "complexType": {
112
137
  "original": "boolean",
@@ -119,12 +144,14 @@ export class CatCheckbox {
119
144
  "tags": [],
120
145
  "text": "Checked state of the checkbox"
121
146
  },
122
- "attribute": "checked",
147
+ "getter": false,
148
+ "setter": false,
123
149
  "reflect": false,
124
150
  "defaultValue": "false"
125
151
  },
126
152
  "indeterminate": {
127
153
  "type": "boolean",
154
+ "attribute": "indeterminate",
128
155
  "mutable": true,
129
156
  "complexType": {
130
157
  "original": "boolean",
@@ -137,12 +164,14 @@ export class CatCheckbox {
137
164
  "tags": [],
138
165
  "text": "Indeterminate state of the checkbox"
139
166
  },
140
- "attribute": "indeterminate",
167
+ "getter": false,
168
+ "setter": false,
141
169
  "reflect": false,
142
170
  "defaultValue": "false"
143
171
  },
144
172
  "disabled": {
145
173
  "type": "boolean",
174
+ "attribute": "disabled",
146
175
  "mutable": false,
147
176
  "complexType": {
148
177
  "original": "boolean",
@@ -155,12 +184,14 @@ export class CatCheckbox {
155
184
  "tags": [],
156
185
  "text": "Disabled state of the checkbox"
157
186
  },
158
- "attribute": "disabled",
187
+ "getter": false,
188
+ "setter": false,
159
189
  "reflect": false,
160
190
  "defaultValue": "false"
161
191
  },
162
192
  "identifier": {
163
193
  "type": "string",
194
+ "attribute": "identifier",
164
195
  "mutable": false,
165
196
  "complexType": {
166
197
  "original": "string",
@@ -173,11 +204,13 @@ export class CatCheckbox {
173
204
  "tags": [],
174
205
  "text": "A unique identifier for the input."
175
206
  },
176
- "attribute": "identifier",
207
+ "getter": false,
208
+ "setter": false,
177
209
  "reflect": false
178
210
  },
179
211
  "label": {
180
212
  "type": "string",
213
+ "attribute": "label",
181
214
  "mutable": false,
182
215
  "complexType": {
183
216
  "original": "string",
@@ -190,12 +223,14 @@ export class CatCheckbox {
190
223
  "tags": [],
191
224
  "text": "Label of the checkbox which is presented in the UI"
192
225
  },
193
- "attribute": "label",
226
+ "getter": false,
227
+ "setter": false,
194
228
  "reflect": false,
195
229
  "defaultValue": "''"
196
230
  },
197
231
  "labelHidden": {
198
232
  "type": "boolean",
233
+ "attribute": "label-hidden",
199
234
  "mutable": false,
200
235
  "complexType": {
201
236
  "original": "boolean",
@@ -208,12 +243,14 @@ export class CatCheckbox {
208
243
  "tags": [],
209
244
  "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
210
245
  },
211
- "attribute": "label-hidden",
246
+ "getter": false,
247
+ "setter": false,
212
248
  "reflect": false,
213
249
  "defaultValue": "false"
214
250
  },
215
251
  "name": {
216
252
  "type": "string",
253
+ "attribute": "name",
217
254
  "mutable": false,
218
255
  "complexType": {
219
256
  "original": "string",
@@ -226,11 +263,13 @@ export class CatCheckbox {
226
263
  "tags": [],
227
264
  "text": "The name of the input."
228
265
  },
229
- "attribute": "name",
266
+ "getter": false,
267
+ "setter": false,
230
268
  "reflect": false
231
269
  },
232
270
  "required": {
233
271
  "type": "boolean",
272
+ "attribute": "required",
234
273
  "mutable": false,
235
274
  "complexType": {
236
275
  "original": "boolean",
@@ -243,12 +282,14 @@ export class CatCheckbox {
243
282
  "tags": [],
244
283
  "text": "Required state of the checkbox."
245
284
  },
246
- "attribute": "required",
285
+ "getter": false,
286
+ "setter": false,
247
287
  "reflect": false,
248
288
  "defaultValue": "false"
249
289
  },
250
290
  "value": {
251
291
  "type": "any",
292
+ "attribute": "value",
252
293
  "mutable": false,
253
294
  "complexType": {
254
295
  "original": "any",
@@ -261,11 +302,13 @@ export class CatCheckbox {
261
302
  "tags": [],
262
303
  "text": "The value of the checked checkbox."
263
304
  },
264
- "attribute": "value",
305
+ "getter": false,
306
+ "setter": false,
265
307
  "reflect": false
266
308
  },
267
309
  "noValue": {
268
310
  "type": "any",
311
+ "attribute": "no-value",
269
312
  "mutable": false,
270
313
  "complexType": {
271
314
  "original": "any",
@@ -278,11 +321,13 @@ export class CatCheckbox {
278
321
  "tags": [],
279
322
  "text": "The value of the unchecked checkbox."
280
323
  },
281
- "attribute": "no-value",
324
+ "getter": false,
325
+ "setter": false,
282
326
  "reflect": false
283
327
  },
284
328
  "resolvedValue": {
285
329
  "type": "any",
330
+ "attribute": "resolved-value",
286
331
  "mutable": true,
287
332
  "complexType": {
288
333
  "original": "any",
@@ -295,12 +340,14 @@ export class CatCheckbox {
295
340
  "tags": [],
296
341
  "text": "The resolved value of the checkbox, based on the checked state and value."
297
342
  },
298
- "attribute": "resolved-value",
343
+ "getter": false,
344
+ "setter": false,
299
345
  "reflect": false,
300
346
  "defaultValue": "null"
301
347
  },
302
348
  "hint": {
303
349
  "type": "string",
350
+ "attribute": "hint",
304
351
  "mutable": false,
305
352
  "complexType": {
306
353
  "original": "string | string[]",
@@ -313,11 +360,13 @@ export class CatCheckbox {
313
360
  "tags": [],
314
361
  "text": "Optional hint text(s) to be displayed with the checkbox."
315
362
  },
316
- "attribute": "hint",
363
+ "getter": false,
364
+ "setter": false,
317
365
  "reflect": false
318
366
  },
319
367
  "labelLeft": {
320
368
  "type": "boolean",
369
+ "attribute": "label-left",
321
370
  "mutable": false,
322
371
  "complexType": {
323
372
  "original": "boolean",
@@ -330,12 +379,14 @@ export class CatCheckbox {
330
379
  "tags": [],
331
380
  "text": "Whether the label should appear to the left of the checkbox."
332
381
  },
333
- "attribute": "label-left",
382
+ "getter": false,
383
+ "setter": false,
334
384
  "reflect": false,
335
385
  "defaultValue": "false"
336
386
  },
337
387
  "alignment": {
338
388
  "type": "string",
389
+ "attribute": "alignment",
339
390
  "mutable": false,
340
391
  "complexType": {
341
392
  "original": "'center' | 'top' | 'bottom'",
@@ -348,12 +399,14 @@ export class CatCheckbox {
348
399
  "tags": [],
349
400
  "text": "The alignment of the checkbox."
350
401
  },
351
- "attribute": "alignment",
402
+ "getter": false,
403
+ "setter": false,
352
404
  "reflect": false,
353
405
  "defaultValue": "'top'"
354
406
  },
355
407
  "nativeAttributes": {
356
408
  "type": "unknown",
409
+ "attribute": "native-attributes",
357
410
  "mutable": false,
358
411
  "complexType": {
359
412
  "original": "{ [key: string]: string }",
@@ -365,10 +418,13 @@ export class CatCheckbox {
365
418
  "docs": {
366
419
  "tags": [],
367
420
  "text": "Attributes that will be added to the native HTML input element."
368
- }
421
+ },
422
+ "getter": false,
423
+ "setter": false
369
424
  },
370
425
  "testId": {
371
426
  "type": "string",
427
+ "attribute": "test-id",
372
428
  "mutable": false,
373
429
  "complexType": {
374
430
  "original": "string",
@@ -381,11 +437,13 @@ export class CatCheckbox {
381
437
  "tags": [],
382
438
  "text": "A unique identifier for the underlying native element that is used for\ntesting purposes. The attribute is added as `data-test` attribute and acts\nas a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`."
383
439
  },
384
- "attribute": "test-id",
440
+ "getter": false,
441
+ "setter": false,
385
442
  "reflect": false
386
443
  },
387
444
  "requiredMarker": {
388
445
  "type": "string",
446
+ "attribute": "required-marker",
389
447
  "mutable": false,
390
448
  "complexType": {
391
449
  "original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
@@ -398,7 +456,8 @@ export class CatCheckbox {
398
456
  "tags": [],
399
457
  "text": "Whether the label need a marker to shown if the input is required or optional."
400
458
  },
401
- "attribute": "required-marker",
459
+ "getter": false,
460
+ "setter": false,
402
461
  "reflect": false,
403
462
  "defaultValue": "'none'"
404
463
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nlet nextUniqueId = 0;\n\n/**\n * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @slot hint - Optional hint element to be displayed with the checkbox.\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 label - The label content.\n * @part input - The native input element.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n formAssociated: true,\n shadow: true\n})\nexport class CatCheckbox {\n private readonly _id = `cat-checkbox-${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 @AttachInternals() internals!: ElementInternals;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop({ mutable: true }) indeterminate = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * Label of the checkbox which is presented in the UI\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 checkbox.\n */\n @Prop() required = false;\n\n /**\n * The value of the checked checkbox.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() value?: any;\n\n /**\n * The value of the unchecked checkbox.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() noValue?: any;\n\n /**\n * The resolved value of the checkbox, based on the checked state and value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop({ mutable: true }) resolvedValue: any = null;\n\n /**\n * Optional hint text(s) to be displayed with the checkbox.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the checkbox.\n */\n @Prop() labelLeft = false;\n\n /**\n * The alignment of the checkbox.\n */\n @Prop() alignment: 'center' | 'top' | 'bottom' = 'top';\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'none';\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Event() catChange!: EventEmitter<any>;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.updateResolved();\n }\n\n componentWillRender(): void {\n this.internals.setFormValue(this.checked ? (this.value ?? 'on') : (this.noValue ?? null));\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n /**\n * Programmatically move focus to the checkbox. 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 checkbox. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{\n 'is-hidden': this.labelHidden,\n 'is-disabled': this.disabled,\n 'label-left': this.labelLeft,\n 'align-center': this.alignment === 'center',\n 'align-end': this.alignment === 'bottom'\n }}\n >\n <input\n data-test={this.testId}\n {...this.nativeAttributes}\n part=\"input\"\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n indeterminate={this.indeterminate}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n />\n <span class=\"box\" aria-hidden=\"true\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\n </span>\n <span class={{ label: true, 'label-wrapper': !this.hasSlottedLabel }} part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <span class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n </span>\n </span>\n </label>\n {this.hasHint && (\n <div class={{ 'hint-wrapper': true, 'label-left': this.labelLeft }}>\n <div class=\"box-placeholder\"></div>\n <CatFormHint id={this.id} hint={this.hint} slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>} />\n </div>\n )}\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint;\n }\n\n private onInput() {\n this.checked = this.input.checked;\n this.internals.setFormValue(this.input.checked ? (this.value ?? 'on') : (this.noValue ?? null));\n this.indeterminate = this.input.indeterminate;\n this.updateResolved();\n this.catChange.emit(this.resolvedValue);\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 private updateResolved() {\n this.resolvedValue = this.checked ? (this.value ?? true) : (this.noValue ?? false);\n }\n}\n"]}
1
+ {"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAExE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAOH,MAAM,OAAO,WAAW;IANxB;QAOmB,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;QAS/C,oBAAe,GAAG,KAAK,CAAC;QAExB,mBAAc,GAAG,KAAK,CAAC;QAIhC;;WAEG;QACsB,YAAO,GAAG,KAAK,CAAC;QAEzC;;WAEG;QACsB,kBAAa,GAAG,KAAK,CAAC;QAE/C;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAOzB;;WAEG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;QAO5B;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAczB;;WAEG;QACH,8DAA8D;QACrC,kBAAa,GAAQ,IAAI,CAAC;QAOnD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int } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nlet nextUniqueId = 0;\n\n/**\n * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @slot hint - Optional hint element to be displayed with the checkbox.\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 label - The label content.\n * @part input - The native input element.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n formAssociated: true,\n shadow: true\n})\nexport class CatCheckbox {\n private readonly _id = `cat-checkbox-${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 @AttachInternals() internals!: ElementInternals;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop({ mutable: true }) indeterminate = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * Label of the checkbox which is presented in the UI\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 checkbox.\n */\n @Prop() required = false;\n\n /**\n * The value of the checked checkbox.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() value?: any;\n\n /**\n * The value of the unchecked checkbox.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() noValue?: any;\n\n /**\n * The resolved value of the checkbox, based on the checked state and value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop({ mutable: true }) resolvedValue: any = null;\n\n /**\n * Optional hint text(s) to be displayed with the checkbox.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the checkbox.\n */\n @Prop() labelLeft = false;\n\n /**\n * The alignment of the checkbox.\n */\n @Prop() alignment: 'center' | 'top' | 'bottom' = 'top';\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'none';\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Event() catChange!: EventEmitter<any>;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.updateResolved();\n }\n\n componentWillRender(): void {\n this.internals.setFormValue(this.checked ? (this.value ?? 'on') : (this.noValue ?? null));\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n /**\n * Programmatically move focus to the checkbox. 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 checkbox. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{\n 'is-hidden': this.labelHidden,\n 'is-disabled': this.disabled,\n 'label-left': this.labelLeft,\n 'align-center': this.alignment === 'center',\n 'align-end': this.alignment === 'bottom'\n }}\n >\n <input\n data-test={this.testId}\n {...this.nativeAttributes}\n part=\"input\"\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n indeterminate={this.indeterminate}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n />\n <span class=\"box\" aria-hidden=\"true\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\n </span>\n <span class={{ label: true, 'label-wrapper': !this.hasSlottedLabel }} part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <span class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n </span>\n </span>\n </label>\n {this.hasHint && (\n <div class={{ 'hint-wrapper': true, 'label-left': this.labelLeft }}>\n <div class=\"box-placeholder\"></div>\n <CatFormHint id={this.id} hint={this.hint} slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>} />\n </div>\n )}\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint;\n }\n\n private onInput() {\n this.checked = this.input.checked;\n this.internals.setFormValue(this.input.checked ? (this.value ?? 'on') : (this.noValue ?? null));\n this.indeterminate = this.input.indeterminate;\n this.updateResolved();\n this.catChange.emit(this.resolvedValue);\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 private updateResolved() {\n this.resolvedValue = this.checked ? (this.value ?? true) : (this.noValue ?? false);\n }\n}\n"]}