@haiilo/catalyst 6.0.3 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) 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/p-2a094d64.entry.js +10 -0
  6. package/dist/catalyst/p-2a094d64.entry.js.map +1 -0
  7. package/dist/catalyst/{p-d7dc291a.js → p-48621e71.js} +1 -1
  8. package/dist/catalyst/p-48621e71.js.map +1 -0
  9. package/dist/catalyst/p-6904eb66.js +3 -0
  10. package/dist/catalyst/p-6904eb66.js.map +1 -0
  11. package/dist/cjs/cat-alert_25.cjs.entry.js +21 -9
  12. package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -1
  13. package/dist/cjs/{cat-icon-registry-6161e2ee.js → cat-icon-registry-5647cf1f.js} +1 -1
  14. package/dist/cjs/cat-icon-registry-5647cf1f.js.map +1 -0
  15. package/dist/cjs/catalyst.cjs.js +3 -6
  16. package/dist/cjs/catalyst.cjs.js.map +1 -1
  17. package/dist/cjs/{index-4258b31e.js → index-e06682a8.js} +89 -32
  18. package/dist/cjs/index-e06682a8.js.map +1 -0
  19. package/dist/cjs/index.cjs.js +1 -1
  20. package/dist/cjs/index.cjs.js.map +1 -1
  21. package/dist/cjs/loader.cjs.js +2 -11
  22. package/dist/cjs/loader.cjs.js.map +1 -1
  23. package/dist/collection/collection-manifest.json +27 -27
  24. package/dist/collection/components/cat-alert/cat-alert.e2e.js +11 -0
  25. package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +1 -0
  26. package/dist/collection/components/cat-alert/cat-alert.js +2 -2
  27. package/dist/collection/components/cat-alert/cat-alert.spec.js +21 -0
  28. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -0
  29. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +10 -0
  30. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +1 -0
  31. package/dist/collection/components/cat-avatar/cat-avatar.js +3 -3
  32. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +18 -0
  33. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -0
  34. package/dist/collection/components/cat-badge/cat-badge.e2e.js +10 -0
  35. package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +1 -0
  36. package/dist/collection/components/cat-badge/cat-badge.js +1 -1
  37. package/dist/collection/components/cat-badge/cat-badge.spec.js +18 -0
  38. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -0
  39. package/dist/collection/components/cat-button/cat-button.e2e.js +10 -0
  40. package/dist/collection/components/cat-button/cat-button.e2e.js.map +1 -0
  41. package/dist/collection/components/cat-button/cat-button.js +20 -12
  42. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  43. package/dist/collection/components/cat-button/cat-button.spec.js +18 -0
  44. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -0
  45. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +10 -0
  46. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +1 -0
  47. package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
  48. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +18 -0
  49. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -0
  50. package/dist/collection/components/cat-card/cat-card.e2e.js +10 -0
  51. package/dist/collection/components/cat-card/cat-card.e2e.js.map +1 -0
  52. package/dist/collection/components/cat-card/cat-card.js +1 -1
  53. package/dist/collection/components/cat-card/cat-card.spec.js +18 -0
  54. package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -0
  55. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +10 -0
  56. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +1 -0
  57. package/dist/collection/components/cat-checkbox/cat-checkbox.js +51 -31
  58. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  59. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +29 -0
  60. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -0
  61. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +11 -0
  62. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +1 -0
  63. package/dist/collection/components/cat-datepicker/cat-datepicker.js +18 -12
  64. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  65. package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +1 -1
  66. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +19 -0
  67. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -0
  68. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +10 -0
  69. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +1 -0
  70. package/dist/collection/components/cat-dropdown/cat-dropdown.js +17 -11
  71. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  72. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +26 -0
  73. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -0
  74. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +10 -0
  75. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +1 -0
  76. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  77. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +18 -0
  78. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -0
  79. package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -2
  80. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +15 -0
  81. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -0
  82. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
  83. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +7 -0
  84. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +1 -0
  85. package/dist/collection/components/cat-icon/cat-icon-registry.js +13 -13
  86. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +7 -0
  87. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +1 -0
  88. package/dist/collection/components/cat-icon/cat-icon.e2e.js +11 -0
  89. package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +1 -0
  90. package/dist/collection/components/cat-icon/cat-icon.js +2 -2
  91. package/dist/collection/components/cat-icon/cat-icon.spec.js +15 -0
  92. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -0
  93. package/dist/collection/components/cat-input/cat-input.e2e.js +11 -0
  94. package/dist/collection/components/cat-input/cat-input.e2e.js.map +1 -0
  95. package/dist/collection/components/cat-input/cat-input.js +21 -13
  96. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  97. package/dist/collection/components/cat-input/cat-input.spec.js +36 -0
  98. package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -0
  99. package/dist/collection/components/cat-notification/cat-notification.js +4 -3
  100. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  101. package/dist/collection/components/cat-notification/cat-notification.spec.js +7 -0
  102. package/dist/collection/components/cat-notification/cat-notification.spec.js.map +1 -0
  103. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +14 -0
  104. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +1 -0
  105. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  106. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +31 -0
  107. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -0
  108. package/dist/collection/components/cat-radio/cat-radio.e2e.js +10 -0
  109. package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +1 -0
  110. package/dist/collection/components/cat-radio/cat-radio.js +13 -8
  111. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  112. package/dist/collection/components/cat-radio/cat-radio.spec.js +24 -0
  113. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -0
  114. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +10 -0
  115. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +1 -0
  116. package/dist/collection/components/cat-radio-group/cat-radio-group.js +5 -3
  117. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  118. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +20 -0
  119. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -0
  120. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +10 -0
  121. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +1 -0
  122. package/dist/collection/components/cat-scrollable/cat-scrollable.js +6 -4
  123. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  124. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +25 -0
  125. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -0
  126. package/dist/collection/components/cat-select/cat-select.e2e.js +14 -0
  127. package/dist/collection/components/cat-select/cat-select.e2e.js.map +1 -0
  128. package/dist/collection/components/cat-select/cat-select.js +39 -23
  129. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  130. package/dist/collection/components/cat-select/cat-select.spec.js +41 -0
  131. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -0
  132. package/dist/collection/components/cat-select-demo/cat-select-demo.js +2 -2
  133. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +10 -0
  134. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +1 -0
  135. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  136. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +18 -0
  137. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -0
  138. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +10 -0
  139. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +1 -0
  140. package/dist/collection/components/cat-spinner/cat-spinner.js +1 -1
  141. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +18 -0
  142. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -0
  143. package/dist/collection/components/cat-tab/cat-tab.e2e.js +10 -0
  144. package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +1 -0
  145. package/dist/collection/components/cat-tab/cat-tab.js +5 -3
  146. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  147. package/dist/collection/components/cat-tab/cat-tab.spec.js +17 -0
  148. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -0
  149. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +10 -0
  150. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +1 -0
  151. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  152. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +17 -0
  153. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -0
  154. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +11 -0
  155. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +1 -0
  156. package/dist/collection/components/cat-textarea/cat-textarea.js +20 -13
  157. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  158. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +34 -0
  159. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -0
  160. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +10 -0
  161. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +1 -0
  162. package/dist/collection/components/cat-toggle/cat-toggle.js +13 -8
  163. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  164. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +22 -0
  165. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -0
  166. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +10 -0
  167. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +1 -0
  168. package/dist/collection/components/cat-tooltip/cat-tooltip.js +8 -5
  169. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  170. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +24 -0
  171. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -0
  172. package/dist/collection/utils/first-tabbable.js +1 -1
  173. package/dist/collection/utils/media-matcher.js +2 -2
  174. package/dist/collection/utils/media-matcher.spec.js +39 -0
  175. package/dist/collection/utils/media-matcher.spec.js.map +1 -0
  176. package/dist/components/cat-alert.js +1 -1
  177. package/dist/components/cat-alert.js.map +1 -1
  178. package/dist/components/cat-avatar2.js +1 -1
  179. package/dist/components/cat-avatar2.js.map +1 -1
  180. package/dist/components/cat-badge.js +1 -1
  181. package/dist/components/cat-badge.js.map +1 -1
  182. package/dist/components/cat-button-group.js +1 -1
  183. package/dist/components/cat-button-group.js.map +1 -1
  184. package/dist/components/cat-button2.js +1 -1
  185. package/dist/components/cat-button2.js.map +1 -1
  186. package/dist/components/cat-card.js +1 -1
  187. package/dist/components/cat-card.js.map +1 -1
  188. package/dist/components/cat-checkbox2.js +17 -7
  189. package/dist/components/cat-checkbox2.js.map +1 -1
  190. package/dist/components/cat-datepicker.js +1 -1
  191. package/dist/components/cat-datepicker.js.map +1 -1
  192. package/dist/components/cat-dropdown2.js +1 -1
  193. package/dist/components/cat-dropdown2.js.map +1 -1
  194. package/dist/components/cat-form-group.js +1 -1
  195. package/dist/components/cat-form-group.js.map +1 -1
  196. package/dist/components/cat-form-hint.js.map +1 -1
  197. package/dist/components/cat-i18n-registry.js.map +1 -1
  198. package/dist/components/cat-icon-registry.js.map +1 -1
  199. package/dist/components/cat-icon2.js +1 -1
  200. package/dist/components/cat-icon2.js.map +1 -1
  201. package/dist/components/cat-input2.js +1 -1
  202. package/dist/components/cat-input2.js.map +1 -1
  203. package/dist/components/cat-pagination.js +1 -1
  204. package/dist/components/cat-pagination.js.map +1 -1
  205. package/dist/components/cat-radio-group.js +1 -1
  206. package/dist/components/cat-radio-group.js.map +1 -1
  207. package/dist/components/cat-radio.js +1 -1
  208. package/dist/components/cat-radio.js.map +1 -1
  209. package/dist/components/cat-scrollable2.js +1 -1
  210. package/dist/components/cat-scrollable2.js.map +1 -1
  211. package/dist/components/cat-select-demo.js +1 -1
  212. package/dist/components/cat-select-demo.js.map +1 -1
  213. package/dist/components/cat-select2.js +5 -3
  214. package/dist/components/cat-select2.js.map +1 -1
  215. package/dist/components/cat-skeleton2.js +1 -1
  216. package/dist/components/cat-skeleton2.js.map +1 -1
  217. package/dist/components/cat-spinner2.js +1 -1
  218. package/dist/components/cat-spinner2.js.map +1 -1
  219. package/dist/components/cat-tab.js +1 -1
  220. package/dist/components/cat-tab.js.map +1 -1
  221. package/dist/components/cat-tabs.js +1 -1
  222. package/dist/components/cat-tabs.js.map +1 -1
  223. package/dist/components/cat-textarea.js +1 -1
  224. package/dist/components/cat-textarea.js.map +1 -1
  225. package/dist/components/cat-toggle.js +1 -1
  226. package/dist/components/cat-toggle.js.map +1 -1
  227. package/dist/components/cat-tooltip.js +2 -2
  228. package/dist/components/cat-tooltip.js.map +1 -1
  229. package/dist/components/coerce.js.map +1 -1
  230. package/dist/components/index.js.map +1 -1
  231. package/dist/esm/cat-alert_25.entry.js +21 -9
  232. package/dist/esm/cat-alert_25.entry.js.map +1 -1
  233. package/dist/esm/{cat-icon-registry-f15b29d9.js → cat-icon-registry-fc49b06c.js} +1 -1
  234. package/dist/esm/cat-icon-registry-fc49b06c.js.map +1 -0
  235. package/dist/esm/catalyst.js +4 -7
  236. package/dist/esm/catalyst.js.map +1 -1
  237. package/dist/esm/{index-636ce8d6.js → index-bac79c60.js} +89 -32
  238. package/dist/esm/index-bac79c60.js.map +1 -0
  239. package/dist/esm/index.js +2 -2
  240. package/dist/esm/index.js.map +1 -1
  241. package/dist/esm/loader.js +3 -12
  242. package/dist/esm/loader.js.map +1 -1
  243. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +6 -4
  244. package/dist/types/stencil-public-runtime.d.ts +3 -0
  245. package/loader/index.d.ts +1 -1
  246. package/package.json +10 -10
  247. package/dist/catalyst/p-b218a2b0.entry.js +0 -10
  248. package/dist/catalyst/p-b218a2b0.entry.js.map +0 -1
  249. package/dist/catalyst/p-ce6a1db2.js +0 -3
  250. package/dist/catalyst/p-ce6a1db2.js.map +0 -1
  251. package/dist/catalyst/p-d7dc291a.js.map +0 -1
  252. package/dist/cjs/cat-icon-registry-6161e2ee.js.map +0 -1
  253. package/dist/cjs/index-4258b31e.js.map +0 -1
  254. package/dist/esm/cat-icon-registry-f15b29d9.js.map +0 -1
  255. package/dist/esm/index-636ce8d6.js.map +0 -1
  256. package/dist/esm/polyfills/css-shim.js +0 -1
@@ -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,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;;qBAMC,IAAI;mBAKyB,UAAU;iBAKgB,WAAW;kBAKtE,KAAK;gBAKwB,GAAG;;;oBAoB9B,KAAK;mBAON,KAAK;kBAKN,KAAK;sBAKD,KAAK;iBAKV,KAAK;;;;oBAoBoB,KAAK;qBAK1B,KAAK;;;;;;;EAgCzB,iBAAiB,CAAC,KAA2B;IAC3C,WAAW;IACX,oEAAoE;IACpE,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAmB,CAAC,CAAC;IAC7E,IAAI,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\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: true\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 @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = '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 * 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 if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\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 if (this.url) {\n return (\n <a\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-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 }}\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 );\n } else {\n return (\n <button\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-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-group-button-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition),\n 'cat-group-button': 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 );\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\">\n <slot></slot>\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,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;;qBAMC,IAAI;mBAKyB,UAAU;iBAKgB,WAAW;kBAKtE,KAAK;gBAKwB,GAAG;;;oBAoB9B,KAAK;mBAON,KAAK;kBAKN,KAAK;sBAKD,KAAK;iBAKV,KAAK;;;;oBAoBoB,KAAK;qBAK1B,KAAK;;;;;;;EAgCzB,iBAAiB,CAAC,KAA2B;I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\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: true\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 @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = '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 * 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 if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\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 if (this.url) {\n return (\n <a\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-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 }}\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 );\n } else {\n return (\n <button\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-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-group-button-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition),\n 'cat-group-button': 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 );\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\">\n <slot></slot>\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"]}
@@ -0,0 +1,18 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { CatButton } from "./cat-button";
3
+ describe('cat-button', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [CatButton],
7
+ html: `<cat-button></cat-button>`
8
+ });
9
+ expect(page.root?.shadowRoot).toEqualHtml(`
10
+ <button class="cat-button cat-button-ellipsed cat-button-outlined cat-button-m cat-button-secondary" part="button" type="button">
11
+ <span class="cat-button-content" part="content">
12
+ <slot></slot>
13
+ </span>
14
+ </button>
15
+ `);
16
+ });
17
+ });
18
+ //# sourceMappingURL=cat-button.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-button.spec.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,2BAA2B;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,WAAW,CAAC;;;;;;KAMzC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatButton } from './cat-button';\n\ndescribe('cat-button', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatButton],\n html: `<cat-button></cat-button>`\n });\n expect(page.root?.shadowRoot).toEqualHtml(`\n <button class=\"cat-button cat-button-ellipsed cat-button-outlined cat-button-m cat-button-secondary\" part=\"button\" type=\"button\">\n <span class=\"cat-button-content\" part=\"content\">\n <slot></slot>\n </span>\n </button>\n `);\n });\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-button-group', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<cat-button-group></cat-button-group>');
6
+ const element = await page.find('cat-button-group');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
10
+ //# sourceMappingURL=cat-button-group.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-button-group.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-button-group/cat-button-group.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EAChC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-button-group', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-button-group></cat-button-group>');\n\n const element = await page.find('cat-button-group');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,4 +1,4 @@
1
- import { h, Host } from '@stencil/core';
1
+ import { h, Host } from "@stencil/core";
2
2
  export class CatButtonGroup {
3
3
  constructor() {
4
4
  this.formElements = [];
@@ -0,0 +1,18 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { CatButtonGroup } from "./cat-button-group";
3
+ describe('cat-button-group', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [CatButtonGroup],
7
+ html: `<cat-button-group></cat-button-group>`
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <cat-button-group role="group">
11
+ <mock:shadow-root>
12
+ <slot></slot>
13
+ </mock:shadow-root>
14
+ </cat-button-group>
15
+ `);
16
+ });
17
+ });
18
+ //# sourceMappingURL=cat-button-group.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-button-group.spec.js","sourceRoot":"","sources":["../../../src/components/cat-button-group/cat-button-group.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EAChC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,cAAc,CAAC;MAC5B,IAAI,EAAE,uCAAuC;KAC9C,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatButtonGroup } from './cat-button-group';\n\ndescribe('cat-button-group', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatButtonGroup],\n html: `<cat-button-group></cat-button-group>`\n });\n expect(page.root).toEqualHtml(`\n <cat-button-group role=\"group\">\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cat-button-group>\n `);\n });\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-card', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<cat-card></cat-card>');
6
+ const element = await page.find('cat-card');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
10
+ //# sourceMappingURL=cat-card.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-card.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-card/cat-card.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-card', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-card></cat-card>');\n\n const element = await page.find('cat-card');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,4 +1,4 @@
1
- import { h } from '@stencil/core';
1
+ import { h } from "@stencil/core";
2
2
  /**
3
3
  * Cards are surfaces that display content and actions on a single topic. They
4
4
  * should be easy to scan for relevant and actionable information.
@@ -0,0 +1,18 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { CatCard } from "./cat-card";
3
+ describe('cat-card', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [CatCard],
7
+ html: `<cat-card></cat-card>`
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <cat-card>
11
+ <mock:shadow-root>
12
+ <slot></slot>
13
+ </mock:shadow-root>
14
+ </cat-card>
15
+ `);
16
+ });
17
+ });
18
+ //# sourceMappingURL=cat-card.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-card.spec.js","sourceRoot":"","sources":["../../../src/components/cat-card/cat-card.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,OAAO,CAAC;MACrB,IAAI,EAAE,uBAAuB;KAC9B,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatCard } from './cat-card';\n\ndescribe('cat-card', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatCard],\n html: `<cat-card></cat-card>`\n });\n expect(page.root).toEqualHtml(`\n <cat-card>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cat-card>\n `);\n });\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-checkbox', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<cat-checkbox label="Label"></cat-checkbox>');
6
+ const element = await page.find('cat-checkbox');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
10
+ //# sourceMappingURL=cat-checkbox.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-checkbox.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC5B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,6CAA6C,CAAC,CAAC;IAErE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-checkbox', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-checkbox label=\"Label\"></cat-checkbox>');\n\n const element = await page.find('cat-checkbox');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,6 +1,6 @@
1
- import { h, Host } from '@stencil/core';
2
- import log from 'loglevel';
3
- import { CatFormHint } from '../cat-form-hint/cat-form-hint';
1
+ import { h, Host } from "@stencil/core";
2
+ import log from "loglevel";
3
+ import { CatFormHint } from "../cat-form-hint/cat-form-hint";
4
4
  let nextUniqueId = 0;
5
5
  /**
6
6
  * Checkboxes are used to let a user choose one or more options from a limited
@@ -17,9 +17,9 @@ export class CatCheckbox {
17
17
  this.hasSlottedLabel = false;
18
18
  this.hasSlottedHint = false;
19
19
  this.checked = false;
20
+ this.indeterminate = false;
20
21
  this.disabled = false;
21
22
  this.identifier = undefined;
22
- this.indeterminate = false;
23
23
  this.label = '';
24
24
  this.labelHidden = false;
25
25
  this.name = undefined;
@@ -33,13 +33,18 @@ export class CatCheckbox {
33
33
  get id() {
34
34
  return this.identifier || this._id;
35
35
  }
36
+ onCheckedChange(checked) {
37
+ this.indeterminate && (this.indeterminate = !checked);
38
+ }
39
+ onIndeterminateChange(indeterminate) {
40
+ this.checked && (this.checked = !indeterminate);
41
+ }
36
42
  componentWillLoad() {
37
43
  this.updateResolved();
38
44
  }
39
45
  componentDidLoad() {
40
- if (this.input && this.indeterminate) {
41
- this.input.indeterminate = true;
42
- }
46
+ this.onCheckedChange(this.checked);
47
+ this.onIndeterminateChange(this.indeterminate);
43
48
  }
44
49
  componentWillRender() {
45
50
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
@@ -66,10 +71,11 @@ export class CatCheckbox {
66
71
  this.input.blur();
67
72
  }
68
73
  render() {
69
- return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, h("svg", { class: "check", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), h("svg", { class: "dash", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 5 10.5 5" }))), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "box-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
74
+ return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, indeterminate: this.indeterminate, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, h("svg", { class: "check", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), h("svg", { class: "dash", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 5 10.5 5" }))), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "box-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
70
75
  }
71
76
  onInput() {
72
77
  this.checked = this.input.checked;
78
+ this.indeterminate = this.input.indeterminate;
73
79
  this.updateResolved();
74
80
  this.catChange.emit(this.resolvedValue);
75
81
  }
@@ -114,6 +120,24 @@ export class CatCheckbox {
114
120
  "reflect": false,
115
121
  "defaultValue": "false"
116
122
  },
123
+ "indeterminate": {
124
+ "type": "boolean",
125
+ "mutable": true,
126
+ "complexType": {
127
+ "original": "boolean",
128
+ "resolved": "boolean",
129
+ "references": {}
130
+ },
131
+ "required": false,
132
+ "optional": false,
133
+ "docs": {
134
+ "tags": [],
135
+ "text": "Indeterminate state of the checkbox"
136
+ },
137
+ "attribute": "indeterminate",
138
+ "reflect": false,
139
+ "defaultValue": "false"
140
+ },
117
141
  "disabled": {
118
142
  "type": "boolean",
119
143
  "mutable": false,
@@ -149,24 +173,6 @@ export class CatCheckbox {
149
173
  "attribute": "identifier",
150
174
  "reflect": false
151
175
  },
152
- "indeterminate": {
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": "Indeterminate state of the checkbox"
165
- },
166
- "attribute": "indeterminate",
167
- "reflect": false,
168
- "defaultValue": "false"
169
- },
170
176
  "label": {
171
177
  "type": "string",
172
178
  "mutable": false,
@@ -362,7 +368,8 @@ export class CatCheckbox {
362
368
  "resolved": "FocusEvent",
363
369
  "references": {
364
370
  "FocusEvent": {
365
- "location": "global"
371
+ "location": "global",
372
+ "id": "global::FocusEvent"
366
373
  }
367
374
  }
368
375
  }
@@ -381,7 +388,8 @@ export class CatCheckbox {
381
388
  "resolved": "FocusEvent",
382
389
  "references": {
383
390
  "FocusEvent": {
384
- "location": "global"
391
+ "location": "global",
392
+ "id": "global::FocusEvent"
385
393
  }
386
394
  }
387
395
  }
@@ -401,10 +409,12 @@ export class CatCheckbox {
401
409
  }],
402
410
  "references": {
403
411
  "Promise": {
404
- "location": "global"
412
+ "location": "global",
413
+ "id": "global::Promise"
405
414
  },
406
415
  "FocusOptions": {
407
- "location": "global"
416
+ "location": "global",
417
+ "id": "global::FocusOptions"
408
418
  }
409
419
  },
410
420
  "return": "Promise<void>"
@@ -423,7 +433,8 @@ export class CatCheckbox {
423
433
  "parameters": [],
424
434
  "references": {
425
435
  "Promise": {
426
- "location": "global"
436
+ "location": "global",
437
+ "id": "global::Promise"
427
438
  }
428
439
  },
429
440
  "return": "Promise<void>"
@@ -436,5 +447,14 @@ export class CatCheckbox {
436
447
  };
437
448
  }
438
449
  static get elementRef() { return "hostElement"; }
450
+ static get watchers() {
451
+ return [{
452
+ "propName": "checked",
453
+ "methodName": "onCheckedChange"
454
+ }, {
455
+ "propName": "indeterminate",
456
+ "methodName": "onIndeterminateChange"
457
+ }];
458
+ }
439
459
  }
440
460
  //# sourceMappingURL=cat-checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.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;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;;IACL,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;2BAS7B,KAAK;0BACN,KAAK;mBAKI,KAAK;oBAKrB,KAAK;;yBAUA,KAAK;iBAKb,EAAE;uBAKI,KAAK;;oBAUR,KAAK;;yBAU0C,IAAI;;qBAUlD,KAAK;;;EArEzB,IAAY,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC;EACrC,CAAC;EAyFD,iBAAiB;IACf,IAAI,CAAC,cAAc,EAAE,CAAC;EACxB,CAAC;EAED,gBAA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AAS,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;EAC1C,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;EAEO,cAAc;IACpB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;EAC5F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, 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 * 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 checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\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 @State() hasSlottedHint = false;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = 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 * Indeterminate state of the checkbox\n */\n @Prop() indeterminate = false;\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 checkbox.\n */\n @Prop() value?: string;\n\n /**\n * The resolved value of the checkbox, based on the checked state and value.\n */\n @Prop({ mutable: true }) resolvedValue: string | boolean | null = 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 * 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 checkbox is changed.\n */\n @Event() catChange!: EventEmitter<boolean | string | null>;\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 componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\n }\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 checkbox', this);\n }\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={{ '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}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\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\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {(this.hint || this.hasSlottedHint) && (\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 onInput() {\n this.checked = this.input.checked;\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.value == null ? this.checked : this.checked ? this.value : null;\n }\n}\n"]}
1
+ {"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;;IACL,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;2BAS7B,KAAK;0BACN,KAAK;mBAKI,KAAK;yBAUC,KAAK;oBAU3B,KAAK;;iBAUR,EAAE;uBAKI,KAAK;;oBAUR,KAAK;;yBAU0C,IAAI;;qBAUlD,KAAK;;;EA/EzB,IAAY,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC;EACrC,CAAC;EAeD,eAAe,CAAC,OAAgB;IAC9B,IAAI,CAAC,aAAa,KAAlB,IAAI,CAAC,aAAa,GAAK,CAAC,OAAO,EAAC;EAClC,CAAC;EAQD,qBAAqB,CAAC,aAAsB;IAC1C,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,CAAC,aAAa,EAAC;EAClC,CAAC;EAwED,iBAAiB;IACf,IAAI,CAAC,cAAc,EAAE,CAAC;EACxB,CAAC;EAED,gBAAgB;IACd,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,C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AI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;EAC1C,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;EAEO,cAAc;IACpB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;EAC5F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\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 checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\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 @State() hasSlottedHint = false;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = false;\n\n @Watch('checked')\n onCheckedChange(checked: boolean) {\n this.indeterminate &&= !checked;\n }\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop({ mutable: true }) indeterminate = false;\n\n @Watch('indeterminate')\n onIndeterminateChange(indeterminate: boolean) {\n this.checked &&= !indeterminate;\n }\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 checkbox.\n */\n @Prop() value?: string;\n\n /**\n * The resolved value of the checkbox, based on the checked state and value.\n */\n @Prop({ mutable: true }) resolvedValue: string | boolean | null = 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 * 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 checkbox is changed.\n */\n @Event() catChange!: EventEmitter<boolean | string | null>;\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 componentDidLoad() {\n this.onCheckedChange(this.checked);\n this.onIndeterminateChange(this.indeterminate);\n }\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 checkbox', this);\n }\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={{ '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}\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 />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\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\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {(this.hint || this.hasSlottedHint) && (\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 onInput() {\n this.checked = this.input.checked;\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.value == null ? this.checked : this.checked ? this.value : null;\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { CatCheckbox } from "./cat-checkbox";
3
+ describe('cat-checkbox', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [CatCheckbox],
7
+ html: `<cat-checkbox label="Label"></cat-checkbox>`
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <cat-checkbox label="Label">
11
+ <mock:shadow-root>
12
+ <label htmlfor="cat-checkbox-0">
13
+ <input id="cat-checkbox-0" type="checkbox">
14
+ <span aria-hidden="true" class="box" part="checkbox">
15
+ <svg class="check" viewBox="0 0 12 10">
16
+ <polyline points="1.5 6 4.5 9 10.5 1"></polyline>
17
+ </svg>
18
+ <svg class="dash" viewBox="0 0 12 10">
19
+ <polyline points="1.5 5 10.5 5"></polyline>
20
+ </svg>
21
+ </span>
22
+ <span class="label" part="label">Label</span>
23
+ </label>
24
+ </mock:shadow-root>
25
+ </cat-checkbox>
26
+ `);
27
+ });
28
+ });
29
+ //# sourceMappingURL=cat-checkbox.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-checkbox.spec.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC5B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;MACzB,IAAI,EAAE,6CAA6C;KACpD,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;KAiB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatCheckbox } from './cat-checkbox';\n\ndescribe('cat-checkbox', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatCheckbox],\n html: `<cat-checkbox label=\"Label\"></cat-checkbox>`\n });\n expect(page.root).toEqualHtml(`\n <cat-checkbox label=\"Label\">\n <mock:shadow-root>\n <label htmlfor=\"cat-checkbox-0\">\n <input id=\"cat-checkbox-0\" type=\"checkbox\">\n <span aria-hidden=\"true\" class=\"box\" part=\"checkbox\">\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\" part=\"label\">Label</span>\n </label>\n </mock:shadow-root>\n </cat-checkbox>\n `);\n });\n});\n"]}
@@ -0,0 +1,11 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-datepicker', () => {
3
+ beforeAll(() => (console.error = jest.fn()));
4
+ it('renders', async () => {
5
+ const page = await newE2EPage();
6
+ await page.setContent('<cat-datepicker label="Label"></cat-datepicker>');
7
+ const element = await page.find('cat-datepicker');
8
+ expect(element).toHaveClass('hydrated');
9
+ });
10
+ });
11
+ //# sourceMappingURL=cat-datepicker.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-datepicker.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;EAE7C,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,iDAAiD,CAAC,CAAC;IAEzE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-datepicker', () => {\n beforeAll(() => (console.error = jest.fn()));\n\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-datepicker label=\"Label\"></cat-datepicker>');\n\n const element = await page.find('cat-datepicker');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,9 +1,9 @@
1
- import { h } from '@stencil/core';
2
- import flatpickr from 'flatpickr';
3
- import weekSelectPlugin from 'flatpickr/dist/plugins/weekSelect/weekSelect';
4
- import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';
5
- import { getFormat } from './cat-datepicker.config';
6
- import { getLocale } from './cat-datepicker.locale';
1
+ import { h } from "@stencil/core";
2
+ import flatpickr from "flatpickr";
3
+ import weekSelectPlugin from "flatpickr/dist/plugins/weekSelect/weekSelect";
4
+ import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
5
+ import { getFormat } from "./cat-datepicker.config";
6
+ import { getLocale } from "./cat-datepicker.locale";
7
7
  export class CatDatepickerFlat {
8
8
  constructor() {
9
9
  this.requiredMarker = 'optional';
@@ -522,7 +522,8 @@ export class CatDatepickerFlat {
522
522
  "references": {
523
523
  "ErrorMap": {
524
524
  "location": "import",
525
- "path": "../cat-form-hint/cat-form-hint"
525
+ "path": "../cat-form-hint/cat-form-hint",
526
+ "id": "src/components/cat-form-hint/cat-form-hint.tsx::ErrorMap"
526
527
  }
527
528
  }
528
529
  },
@@ -601,7 +602,8 @@ export class CatDatepickerFlat {
601
602
  "resolved": "FocusEvent",
602
603
  "references": {
603
604
  "FocusEvent": {
604
- "location": "global"
605
+ "location": "global",
606
+ "id": "global::FocusEvent"
605
607
  }
606
608
  }
607
609
  }
@@ -620,7 +622,8 @@ export class CatDatepickerFlat {
620
622
  "resolved": "FocusEvent",
621
623
  "references": {
622
624
  "FocusEvent": {
623
- "location": "global"
625
+ "location": "global",
626
+ "id": "global::FocusEvent"
624
627
  }
625
628
  }
626
629
  }
@@ -640,10 +643,12 @@ export class CatDatepickerFlat {
640
643
  }],
641
644
  "references": {
642
645
  "Promise": {
643
- "location": "global"
646
+ "location": "global",
647
+ "id": "global::Promise"
644
648
  },
645
649
  "FocusOptions": {
646
- "location": "global"
650
+ "location": "global",
651
+ "id": "global::FocusOptions"
647
652
  }
648
653
  },
649
654
  "return": "Promise<void>"
@@ -662,7 +667,8 @@ export class CatDatepickerFlat {
662
667
  "parameters": [],
663
668
  "references": {
664
669
  "Promise": {
665
- "location": "global"
670
+ "location": "global",
671
+ "id": "global::Promise"
666
672
  }
667
673
  },
668
674
  "return": "Promise<void>"