@haiilo/catalyst 0.5.6 → 0.5.7

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 (296) hide show
  1. package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  2. package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
  3. package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
  5. package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
  6. package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  38. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  39. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  40. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  41. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  42. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  43. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  44. package/dist/catalyst/catalyst.css +1 -0
  45. package/dist/catalyst/catalyst.esm.js +2 -0
  46. package/dist/catalyst/catalyst.esm.js.map +1 -0
  47. package/dist/catalyst/index.cdn.js +21 -0
  48. package/dist/catalyst/index.esm.js +2 -0
  49. package/dist/catalyst/index.esm.js.map +1 -0
  50. package/dist/catalyst/p-9a3c2375.js +2 -0
  51. package/dist/catalyst/p-9a3c2375.js.map +1 -0
  52. package/dist/catalyst/p-a6b8ebe9.entry.js +10 -0
  53. package/dist/catalyst/p-a6b8ebe9.entry.js.map +1 -0
  54. package/dist/catalyst/p-bfc656ca.js +2 -0
  55. package/dist/catalyst/p-bfc656ca.js.map +1 -0
  56. package/dist/catalyst/p-e82b63e9.js +2 -0
  57. package/dist/catalyst/p-e82b63e9.js.map +1 -0
  58. package/dist/cjs/app-globals-2a30d681.js +256 -0
  59. package/dist/cjs/app-globals-2a30d681.js.map +1 -0
  60. package/dist/cjs/cat-alert_15.cjs.entry.js +4651 -0
  61. package/dist/cjs/cat-alert_15.cjs.entry.js.map +1 -0
  62. package/dist/cjs/cat-icon-registry-b3a95a6b.js +442 -0
  63. package/dist/cjs/cat-icon-registry-b3a95a6b.js.map +1 -0
  64. package/dist/cjs/catalyst.cjs.js +24 -0
  65. package/dist/cjs/catalyst.cjs.js.map +1 -0
  66. package/dist/cjs/index-5d72f0e4.js +1347 -0
  67. package/dist/cjs/index-5d72f0e4.js.map +1 -0
  68. package/dist/cjs/index.cjs.js +12 -0
  69. package/dist/cjs/index.cjs.js.map +1 -0
  70. package/dist/cjs/loader.cjs.js +26 -0
  71. package/dist/cjs/loader.cjs.js.map +1 -0
  72. package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  73. package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
  74. package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  75. package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
  76. package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
  77. package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  78. package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
  79. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  80. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  81. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  82. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  83. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  84. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  85. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  86. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  87. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  88. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  89. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  90. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  91. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  92. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  93. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  94. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  95. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  96. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  97. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  98. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  99. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  100. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  101. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  102. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  103. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  104. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  105. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  106. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  107. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  108. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  109. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  110. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  111. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  112. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  113. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  114. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  115. package/dist/collection/collection-manifest.json +27 -0
  116. package/dist/collection/components/cat-alert/cat-alert.css +61 -0
  117. package/dist/collection/components/cat-alert/cat-alert.js +61 -0
  118. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -0
  119. package/dist/collection/components/cat-badge/cat-badge.css +154 -0
  120. package/dist/collection/components/cat-badge/cat-badge.js +143 -0
  121. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -0
  122. package/dist/collection/components/cat-button/cat-button.css +333 -0
  123. package/dist/collection/components/cat-button/cat-button.js +615 -0
  124. package/dist/collection/components/cat-button/cat-button.js.map +1 -0
  125. package/dist/collection/components/cat-card/cat-card.css +24 -0
  126. package/dist/collection/components/cat-card/cat-card.js +20 -0
  127. package/dist/collection/components/cat-card/cat-card.js.map +1 -0
  128. package/dist/collection/components/cat-checkbox/cat-checkbox.css +105 -0
  129. package/dist/collection/components/cat-checkbox/cat-checkbox.js +314 -0
  130. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -0
  131. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +70 -0
  132. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -0
  133. package/dist/collection/components/cat-icon/cat-icon-registry.js +55 -0
  134. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -0
  135. package/dist/collection/components/cat-icon/cat-icon.css +50 -0
  136. package/dist/collection/components/cat-icon/cat-icon.js +91 -0
  137. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -0
  138. package/dist/collection/components/cat-input/cat-input.css +131 -0
  139. package/dist/collection/components/cat-input/cat-input.js +606 -0
  140. package/dist/collection/components/cat-input/cat-input.js.map +1 -0
  141. package/dist/collection/components/cat-menu/cat-menu.css +34 -0
  142. package/dist/collection/components/cat-menu/cat-menu.js +184 -0
  143. package/dist/collection/components/cat-menu/cat-menu.js.map +1 -0
  144. package/dist/collection/components/cat-radio/cat-radio.css +84 -0
  145. package/dist/collection/components/cat-radio/cat-radio.js +283 -0
  146. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -0
  147. package/dist/collection/components/cat-scrollable/cat-scrollable.css +69 -0
  148. package/dist/collection/components/cat-scrollable/cat-scrollable.js +311 -0
  149. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -0
  150. package/dist/collection/components/cat-skeleton/cat-skeleton.css +177 -0
  151. package/dist/collection/components/cat-skeleton/cat-skeleton.js +131 -0
  152. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -0
  153. package/dist/collection/components/cat-spinner/cat-spinner.css +63 -0
  154. package/dist/collection/components/cat-spinner/cat-spinner.js +65 -0
  155. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -0
  156. package/dist/collection/components/cat-textarea/cat-textarea.css +72 -0
  157. package/dist/collection/components/cat-textarea/cat-textarea.js +393 -0
  158. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -0
  159. package/dist/collection/components/cat-toggle/cat-toggle.css +93 -0
  160. package/dist/collection/components/cat-toggle/cat-toggle.js +283 -0
  161. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -0
  162. package/dist/collection/components/cat-tooltip/cat-tooltip.css +41 -0
  163. package/dist/collection/components/cat-tooltip/cat-tooltip.js +254 -0
  164. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -0
  165. package/dist/collection/index.cdn.js +21 -0
  166. package/dist/collection/index.js +3 -0
  167. package/dist/collection/index.js.map +1 -0
  168. package/dist/collection/init.js +17 -0
  169. package/dist/collection/init.js.map +1 -0
  170. package/dist/collection/utils/breakpoints.js +12 -0
  171. package/dist/collection/utils/breakpoints.js.map +1 -0
  172. package/dist/collection/utils/first-tabbable.js +6 -0
  173. package/dist/collection/utils/first-tabbable.js.map +1 -0
  174. package/dist/collection/utils/is-touch-screen.js +3 -0
  175. package/dist/collection/utils/is-touch-screen.js.map +1 -0
  176. package/dist/collection/utils/media-matcher.js +55 -0
  177. package/dist/collection/utils/media-matcher.js.map +1 -0
  178. package/dist/collection/utils/platform.js +50 -0
  179. package/dist/collection/utils/platform.js.map +1 -0
  180. package/dist/components/cat-alert.d.ts +11 -0
  181. package/dist/components/cat-alert.js +53 -0
  182. package/dist/components/cat-alert.js.map +1 -0
  183. package/dist/components/cat-badge.d.ts +11 -0
  184. package/dist/components/cat-badge.js +68 -0
  185. package/dist/components/cat-badge.js.map +1 -0
  186. package/dist/components/cat-button.d.ts +11 -0
  187. package/dist/components/cat-button.js +8 -0
  188. package/dist/components/cat-button.js.map +1 -0
  189. package/dist/components/cat-button2.js +346 -0
  190. package/dist/components/cat-button2.js.map +1 -0
  191. package/dist/components/cat-card.d.ts +11 -0
  192. package/dist/components/cat-card.js +35 -0
  193. package/dist/components/cat-card.js.map +1 -0
  194. package/dist/components/cat-checkbox.d.ts +11 -0
  195. package/dist/components/cat-checkbox.js +103 -0
  196. package/dist/components/cat-checkbox.js.map +1 -0
  197. package/dist/components/cat-i18n-registry.js +74 -0
  198. package/dist/components/cat-i18n-registry.js.map +1 -0
  199. package/dist/components/cat-icon-registry.js +59 -0
  200. package/dist/components/cat-icon-registry.js.map +1 -0
  201. package/dist/components/cat-icon.d.ts +11 -0
  202. package/dist/components/cat-icon.js +8 -0
  203. package/dist/components/cat-icon.js.map +1 -0
  204. package/dist/components/cat-icon2.js +49 -0
  205. package/dist/components/cat-icon2.js.map +1 -0
  206. package/dist/components/cat-input.d.ts +11 -0
  207. package/dist/components/cat-input.js +172 -0
  208. package/dist/components/cat-input.js.map +1 -0
  209. package/dist/components/cat-menu.d.ts +11 -0
  210. package/dist/components/cat-menu.js +870 -0
  211. package/dist/components/cat-menu.js.map +1 -0
  212. package/dist/components/cat-radio.d.ts +11 -0
  213. package/dist/components/cat-radio.js +93 -0
  214. package/dist/components/cat-radio.js.map +1 -0
  215. package/dist/components/cat-scrollable.d.ts +11 -0
  216. package/dist/components/cat-scrollable.js +1362 -0
  217. package/dist/components/cat-scrollable.js.map +1 -0
  218. package/dist/components/cat-skeleton.d.ts +11 -0
  219. package/dist/components/cat-skeleton.js +78 -0
  220. package/dist/components/cat-skeleton.js.map +1 -0
  221. package/dist/components/cat-spinner.d.ts +11 -0
  222. package/dist/components/cat-spinner.js +8 -0
  223. package/dist/components/cat-spinner.js.map +1 -0
  224. package/dist/components/cat-spinner2.js +41 -0
  225. package/dist/components/cat-spinner2.js.map +1 -0
  226. package/dist/components/cat-textarea.d.ts +11 -0
  227. package/dist/components/cat-textarea.js +119 -0
  228. package/dist/components/cat-textarea.js.map +1 -0
  229. package/dist/components/cat-toggle.d.ts +11 -0
  230. package/dist/components/cat-toggle.js +93 -0
  231. package/dist/components/cat-toggle.js.map +1 -0
  232. package/dist/components/cat-tooltip.d.ts +11 -0
  233. package/dist/components/cat-tooltip.js +154 -0
  234. package/dist/components/cat-tooltip.js.map +1 -0
  235. package/dist/components/first-tabbable.js +1495 -0
  236. package/dist/components/first-tabbable.js.map +1 -0
  237. package/dist/components/index.d.ts +26 -0
  238. package/dist/components/index.js +258 -0
  239. package/dist/components/index.js.map +1 -0
  240. package/dist/components/loglevel.js +315 -0
  241. package/dist/components/loglevel.js.map +1 -0
  242. package/dist/esm/app-globals-77cd8c8e.js +254 -0
  243. package/dist/esm/app-globals-77cd8c8e.js.map +1 -0
  244. package/dist/esm/cat-alert_15.entry.js +4633 -0
  245. package/dist/esm/cat-alert_15.entry.js.map +1 -0
  246. package/dist/esm/cat-icon-registry-a7acd6f7.js +438 -0
  247. package/dist/esm/cat-icon-registry-a7acd6f7.js.map +1 -0
  248. package/dist/esm/catalyst.js +22 -0
  249. package/dist/esm/catalyst.js.map +1 -0
  250. package/dist/esm/index-fd12be19.js +1320 -0
  251. package/dist/esm/index-fd12be19.js.map +1 -0
  252. package/dist/esm/index.js +3 -0
  253. package/dist/esm/index.js.map +1 -0
  254. package/dist/esm/loader.js +22 -0
  255. package/dist/esm/loader.js.map +1 -0
  256. package/dist/esm/polyfills/core-js.js +11 -0
  257. package/dist/esm/polyfills/css-shim.js +1 -0
  258. package/dist/esm/polyfills/dom.js +79 -0
  259. package/dist/esm/polyfills/es5-html-element.js +1 -0
  260. package/dist/esm/polyfills/index.js +34 -0
  261. package/dist/esm/polyfills/system.js +6 -0
  262. package/dist/index.cjs.js +1 -0
  263. package/dist/index.js +1 -0
  264. package/dist/types/components/cat-alert/cat-alert.d.ts +14 -0
  265. package/dist/types/components/cat-badge/cat-badge.d.ts +29 -0
  266. package/dist/types/components/cat-button/cat-button.d.ts +134 -0
  267. package/dist/types/components/cat-card/cat-card.d.ts +7 -0
  268. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +69 -0
  269. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +18 -0
  270. package/dist/types/components/cat-icon/cat-icon-registry.d.ts +15 -0
  271. package/dist/types/components/cat-icon/cat-icon.d.ts +23 -0
  272. package/dist/types/components/cat-input/cat-input.d.ts +130 -0
  273. package/dist/types/components/cat-menu/cat-menu.d.ts +31 -0
  274. package/dist/types/components/cat-radio/cat-radio.d.ts +63 -0
  275. package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +52 -0
  276. package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +28 -0
  277. package/dist/types/components/cat-spinner/cat-spinner.d.ts +15 -0
  278. package/dist/types/components/cat-textarea/cat-textarea.d.ts +85 -0
  279. package/dist/types/components/cat-toggle/cat-toggle.d.ts +64 -0
  280. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +46 -0
  281. package/dist/types/components.d.ts +1167 -0
  282. package/dist/types/index.d.ts +3 -0
  283. package/dist/types/init.d.ts +1 -0
  284. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  285. package/dist/types/utils/breakpoints.d.ts +7 -0
  286. package/dist/types/utils/first-tabbable.d.ts +4 -0
  287. package/dist/types/utils/is-touch-screen.d.ts +2 -0
  288. package/dist/types/utils/media-matcher.d.ts +13 -0
  289. package/dist/types/utils/platform.d.ts +18 -0
  290. package/loader/cdn.js +3 -0
  291. package/loader/index.cjs.js +3 -0
  292. package/loader/index.d.ts +12 -0
  293. package/loader/index.es2017.js +3 -0
  294. package/loader/index.js +4 -0
  295. package/loader/package.json +10 -0
  296. package/package.json +2 -2
@@ -0,0 +1,346 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { l as loglevel } from './loglevel.js';
3
+ import { d as defineCustomElement$2 } from './cat-icon2.js';
4
+ import { d as defineCustomElement$1 } from './cat-spinner2.js';
5
+
6
+ const _breakpoints = ['xs', 's', 'm', 'l', 'xl'];
7
+ const Breakpoints = {
8
+ xs: '(max-width: 539.98px)',
9
+ s: '(max-width: 767.98px)',
10
+ m: '(max-width: 991.98px)',
11
+ l: '(max-width: 1199.98px)',
12
+ xl: '(max-width: 1399.98px)'
13
+ };
14
+ function isBreakpoint(value) {
15
+ return typeof value === 'string' && _breakpoints.includes(value);
16
+ }
17
+
18
+ // https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts
19
+ // Whether the current platform supports the V8 Break Iterator. The V8 check
20
+ // is necessary to detect all Blink based browsers.
21
+ let hasV8BreakIterator;
22
+ // We need a try/catch around the reference to `Intl`, because accessing it in some cases can
23
+ // cause IE to throw. These cases are tied to particular versions of Windows and can happen if
24
+ // the consumer is providing a polyfilled `Map`. See:
25
+ // https://github.com/Microsoft/ChakraCore/issues/3189
26
+ // https://github.com/angular/components/issues/15687
27
+ try {
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator;
30
+ }
31
+ catch (_a) {
32
+ hasV8BreakIterator = false;
33
+ }
34
+ class Platform {
35
+ constructor() {
36
+ /** Whether the current browser is Microsoft Edge. */
37
+ this.EDGE = /(edge)/i.test(navigator.userAgent);
38
+ /** Whether the current rendering engine is Microsoft Trident. */
39
+ this.TRIDENT = /(msie|trident)/i.test(navigator.userAgent);
40
+ // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
41
+ /** Whether the current rendering engine is Blink. */
42
+ this.BLINK =
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;
45
+ // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
46
+ // ensure that Webkit runs standalone and is not used as another engine's base.
47
+ /** Whether the current rendering engine is WebKit. */
48
+ this.WEBKIT = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
49
+ /** Whether the current platform is Apple iOS. */
50
+ this.IOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
51
+ // It's difficult to detect the plain Gecko engine, because most of the browsers identify
52
+ // them self as Gecko-like browsers and modify the userAgent's according to that.
53
+ // Since we only cover one explicit Firefox case, we can simply check for Firefox
54
+ // instead of having an unstable check for Gecko.
55
+ /** Whether the current browser is Firefox. */
56
+ this.FIREFOX = /(firefox|minefield)/i.test(navigator.userAgent);
57
+ /** Whether the current platform is Android. */
58
+ // Trident on mobile adds the android platform to the userAgent to trick detections.
59
+ this.ANDROID = /android/i.test(navigator.userAgent) && !this.TRIDENT;
60
+ // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
61
+ // this and just place the Safari keyword in the userAgent. To be more safe about Safari every
62
+ // Safari browser should also use Webkit as its layout engine.
63
+ /** Whether the current browser is Safari. */
64
+ this.SAFARI = /safari/i.test(navigator.userAgent) && this.WEBKIT;
65
+ }
66
+ }
67
+
68
+ // https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts
69
+ /** Global registry for all dynamically-created, injected media queries. */
70
+ const mediaQueriesForWebkitCompatibility = new Set();
71
+ /** Style tag that holds all of the dynamically-created media queries. */
72
+ let mediaQueryStyleNode;
73
+ /** A utility for calling matchMedia queries. */
74
+ class MediaMatcher {
75
+ constructor() {
76
+ this._platform = new Platform();
77
+ this._matchMedia = window.matchMedia.bind(window);
78
+ }
79
+ /**
80
+ * Evaluates the given media query and returns the native MediaQueryList from which results
81
+ * can be retrieved.
82
+ * Confirms the layout engine will trigger for the selector query provided and returns the
83
+ * MediaQueryList for the query provided.
84
+ */
85
+ matchMedia(query) {
86
+ if (this._platform.WEBKIT || this._platform.BLINK) {
87
+ createEmptyStyleRule(query);
88
+ }
89
+ return this._matchMedia(query);
90
+ }
91
+ }
92
+ /**
93
+ * Creates an empty stylesheet that is used to work around browser inconsistencies related to
94
+ * `matchMedia`. At the time of writing, it handles the following cases:
95
+ * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`
96
+ * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.
97
+ * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules
98
+ * inside the `@media` match existing elements on the page. We work around it by having one rule
99
+ * targeting the `body`. See https://github.com/angular/components/issues/23546.
100
+ */
101
+ function createEmptyStyleRule(query) {
102
+ if (mediaQueriesForWebkitCompatibility.has(query)) {
103
+ return;
104
+ }
105
+ try {
106
+ if (!mediaQueryStyleNode) {
107
+ mediaQueryStyleNode = document.createElement('style');
108
+ mediaQueryStyleNode.setAttribute('type', 'text/css');
109
+ document.head.appendChild(mediaQueryStyleNode);
110
+ }
111
+ if (mediaQueryStyleNode.sheet) {
112
+ mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
113
+ mediaQueriesForWebkitCompatibility.add(query);
114
+ }
115
+ }
116
+ catch (e) {
117
+ loglevel.error(e);
118
+ }
119
+ }
120
+
121
+ const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:0.25rem;text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:underline}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1rem;padding-right:1rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1rem;padding-right:1rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1rem;padding-right:1rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1rem;padding-right:1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1rem;padding-right:1rem}.cat-button-active::before{content:\"\";display:block;position:absolute;top:0;left:0;width:0.25rem;height:100%;background:rgb(var(--base))}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
122
+
123
+ const CatButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
124
+ constructor() {
125
+ super();
126
+ this.__registerHost();
127
+ this.__attachShadow();
128
+ this.catClick = createEvent(this, "catClick", 7);
129
+ this.catFocus = createEvent(this, "catFocus", 7);
130
+ this.catBlur = createEvent(this, "catBlur", 7);
131
+ this._iconOnly = true;
132
+ /**
133
+ * The rendering style of the button.
134
+ */
135
+ this.variant = 'outlined';
136
+ /**
137
+ * The color palette of the button.
138
+ */
139
+ this.color = 'secondary';
140
+ /**
141
+ * Show an active status indicator on the left side of the button.
142
+ */
143
+ this.active = false;
144
+ /**
145
+ * The size of the button.
146
+ */
147
+ this.size = 'm';
148
+ /**
149
+ * Specifies that the button should be disabled. A disabled button is unusable
150
+ * and un-clickable. Corresponds with the native HTML disabled attribute.
151
+ */
152
+ this.disabled = false;
153
+ /**
154
+ * Displays the button in a loading state with a spinner. Just like a disabled
155
+ * button, an inactive button is unusable and un-clickable. However, it
156
+ * retains the current focus state.
157
+ */
158
+ this.loading = false;
159
+ /**
160
+ * Allows the button to submit a form.
161
+ */
162
+ this.submit = false;
163
+ /**
164
+ * Ellipse overflowing button content.
165
+ */
166
+ this.ellipsed = true;
167
+ /**
168
+ * Use round button edges.
169
+ */
170
+ this.round = false;
171
+ /**
172
+ * Hide the actual button content and only display the icon.
173
+ */
174
+ this.iconOnly = false;
175
+ /**
176
+ * Display the icon on the right.
177
+ */
178
+ this.iconRight = false;
179
+ }
180
+ onIconOnlyChanged(value) {
181
+ var _a, _b;
182
+ // teardown
183
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
184
+ (_a = this.mediaQueryList) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.mediaQueryListener);
185
+ this.mediaQueryList = undefined;
186
+ this.mediaQueryListener = undefined;
187
+ // setup
188
+ if (isBreakpoint(value)) {
189
+ (_b = this.mediaMatcher) !== null && _b !== void 0 ? _b : (this.mediaMatcher = new MediaMatcher());
190
+ this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);
191
+ this.mediaQueryListener = (event) => (this._iconOnly = event.matches);
192
+ this.mediaQueryList.addEventListener('change', this.mediaQueryListener);
193
+ this._iconOnly = this.mediaQueryList.matches;
194
+ }
195
+ else {
196
+ this._iconOnly = value;
197
+ }
198
+ }
199
+ componentWillLoad() {
200
+ this.onIconOnlyChanged(this.iconOnly);
201
+ }
202
+ componentWillRender() {
203
+ if (this.isIconButton && !this.a11yLabel) {
204
+ loglevel.warn('[A11y] Missing ARIA label on icon button', this);
205
+ }
206
+ }
207
+ haltDisabledEvents(event) {
208
+ if (this.disabled || this.loading) {
209
+ event.preventDefault();
210
+ event.stopImmediatePropagation();
211
+ }
212
+ }
213
+ /**
214
+ * Sets focus on the button. Use this method instead of `button.focus()`.
215
+ *
216
+ * @param options An optional object providing options to control aspects of
217
+ * the focusing process.
218
+ */
219
+ async setFocus(options) {
220
+ this.button.focus(options);
221
+ }
222
+ render() {
223
+ var _a;
224
+ if (this.url) {
225
+ return (h("a", { ref: el => (this.button = el), href: this.disabled ? undefined : this.url, target: this.urlTarget, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
226
+ 'cat-button': true,
227
+ 'cat-button-icon': this.isIconButton,
228
+ 'cat-button-round': this.round,
229
+ 'cat-button-loading': this.loading,
230
+ 'cat-button-disabled': this.disabled,
231
+ 'cat-button-ellipsed': this.ellipsed && !this.isIconButton,
232
+ [`cat-button-${this.variant}`]: Boolean(this.variant),
233
+ [`cat-button-${this.color}`]: Boolean(this.color),
234
+ [`cat-button-${this.size}`]: Boolean(this.size)
235
+ }, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
236
+ }
237
+ else {
238
+ return (h("button", { ref: el => (this.button = el), type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
239
+ 'cat-button': true,
240
+ 'cat-button-active': this.active,
241
+ 'cat-button-icon': this.isIconButton,
242
+ 'cat-button-round': (_a = this.round) !== null && _a !== void 0 ? _a : this.isIconButton,
243
+ 'cat-button-loading': this.loading,
244
+ 'cat-button-disabled': this.disabled,
245
+ 'cat-button-ellipsed': this.ellipsed && !this.isIconButton,
246
+ [`cat-button-${this.variant}`]: Boolean(this.variant),
247
+ [`cat-button-${this.color}`]: Boolean(this.color),
248
+ [`cat-button-${this.size}`]: Boolean(this.size)
249
+ }, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
250
+ }
251
+ }
252
+ get iconSize() {
253
+ switch (this.size) {
254
+ case 'xs':
255
+ return 's';
256
+ default:
257
+ return 'l';
258
+ }
259
+ }
260
+ get spinnerSize() {
261
+ switch (this.size) {
262
+ case 'xs':
263
+ return 'xs';
264
+ default:
265
+ return 'm';
266
+ }
267
+ }
268
+ get isIconButton() {
269
+ return Boolean(this.icon) && this._iconOnly;
270
+ }
271
+ get hasPrefixIcon() {
272
+ return Boolean(this.icon) && !this._iconOnly && !this.iconRight;
273
+ }
274
+ get hasSuffixIcon() {
275
+ return Boolean(this.icon) && !this._iconOnly && this.iconRight;
276
+ }
277
+ get content() {
278
+ return [
279
+ this.hasPrefixIcon ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-prefix", part: "prefix" })) : null,
280
+ this.isIconButton ? (h("cat-icon", { icon: this.icon, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" }, h("slot", null))),
281
+ this.hasSuffixIcon ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-suffix", part: "suffix" })) : null,
282
+ this.loading ? h("cat-spinner", { size: this.spinnerSize }) : null
283
+ ];
284
+ }
285
+ onClick(event) {
286
+ this.catClick.emit(event);
287
+ }
288
+ onFocus(event) {
289
+ this.catFocus.emit(event);
290
+ }
291
+ onBlur(event) {
292
+ this.catBlur.emit(event);
293
+ }
294
+ static get watchers() { return {
295
+ "iconOnly": ["onIconOnlyChanged"]
296
+ }; }
297
+ static get style() { return catButtonCss; }
298
+ }, [1, "cat-button", {
299
+ "variant": [1],
300
+ "color": [1],
301
+ "active": [4],
302
+ "size": [1],
303
+ "name": [1],
304
+ "value": [1],
305
+ "disabled": [4],
306
+ "loading": [4],
307
+ "submit": [4],
308
+ "ellipsed": [4],
309
+ "round": [4],
310
+ "url": [1],
311
+ "urlTarget": [1, "url-target"],
312
+ "icon": [1],
313
+ "iconOnly": [8, "icon-only"],
314
+ "iconRight": [4, "icon-right"],
315
+ "buttonId": [1, "button-id"],
316
+ "a11yLabel": [1, "a11y-label"],
317
+ "_iconOnly": [32],
318
+ "setFocus": [64]
319
+ }, [[0, "click", "haltDisabledEvents"]]]);
320
+ function defineCustomElement() {
321
+ if (typeof customElements === "undefined") {
322
+ return;
323
+ }
324
+ const components = ["cat-button", "cat-icon", "cat-spinner"];
325
+ components.forEach(tagName => { switch (tagName) {
326
+ case "cat-button":
327
+ if (!customElements.get(tagName)) {
328
+ customElements.define(tagName, CatButton);
329
+ }
330
+ break;
331
+ case "cat-icon":
332
+ if (!customElements.get(tagName)) {
333
+ defineCustomElement$2();
334
+ }
335
+ break;
336
+ case "cat-spinner":
337
+ if (!customElements.get(tagName)) {
338
+ defineCustomElement$1();
339
+ }
340
+ break;
341
+ } });
342
+ }
343
+
344
+ export { CatButton as C, defineCustomElement as d };
345
+
346
+ //# sourceMappingURL=cat-button2.js.map
@@ -0,0 +1 @@
1
+ {"file":"cat-button2.js","mappings":";;;;;AAAA,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAInD,MAAM,WAAW,GAA2C;EACjE,EAAE,EAAE,uBAAuB;EAC3B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,wBAAwB;EAC3B,EAAE,EAAE,wBAAwB;CAC7B,CAAC;SAEc,YAAY,CAAC,KAAc;EACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAmB,CAAC,CAAC;AACjF;;ACdA;AAEA;AACA;AACA,IAAI,kBAA2B,CAAC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AI,CAAC,aAAa,IAChB,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAC,QAAQ,GAAY,IACjG,IAAI;MACR,IAAI,CAAC,OAAO,GAAG,mBAAa,IAAI,EAAE,IAAI,CAAC,WAAW,GAAgB,GAAG,IAAI;KAC1E,CAAC;GACH;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC3B;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC3B;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["log"],"sources":["./src/utils/breakpoints.ts","./src/utils/platform.ts","./src/utils/media-matcher.ts","./src/components/cat-button/cat-button.scss?tag=cat-button&encapsulation=shadow","./src/components/cat-button/cat-button.tsx"],"sourcesContent":["const _breakpoints = ['xs', 's', 'm', 'l', 'xl'] as const;\n\nexport type Breakpoint = typeof _breakpoints[number];\n\nexport const Breakpoints: { [breakpoint in Breakpoint]: string } = {\n xs: '(max-width: 539.98px)',\n s: '(max-width: 767.98px)',\n m: '(max-width: 991.98px)',\n l: '(max-width: 1199.98px)',\n xl: '(max-width: 1399.98px)'\n};\n\nexport function isBreakpoint(value: unknown): value is Breakpoint {\n return typeof value === 'string' && _breakpoints.includes(value as Breakpoint);\n}\n","// https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n hasV8BreakIterator = typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator;\n} catch {\n hasV8BreakIterator = false;\n}\n\nexport class Platform {\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n !!((window as any).chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = /safari/i.test(navigator.userAgent) && this.WEBKIT;\n}\n","import log from 'loglevel';\nimport { Platform } from './platform';\n\n// https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\nexport class MediaMatcher {\n private _platform;\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor() {\n this._platform = new Platform();\n this._matchMedia = window.matchMedia.bind(window);\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head.appendChild(mediaQueryStyleNode);\n }\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n log.error(e);\n }\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: inline-block;\n max-width: 100%;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.cat-button {\n position: relative;\n font: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: cat-border-radius('m');\n text-decoration: none;\n width: 100%;\n box-sizing: border-box;\n cursor: pointer;\n transition: color cat-token('time.transition.s') linear, border-color cat-token('time.transition.s') linear,\n background-color cat-token('time.transition.s') linear, box-shadow cat-token('time.transition.s') linear;\n\n &:focus-visible {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n// ----- content\n\n.cat-button-content {\n // flex: 1 1 auto;\n // text-align: center;\n\n .cat-button-ellipsed & {\n @include cat-ellipsis;\n }\n}\n\n// ----- disabled\n\n.cat-button-disabled {\n @include cat-disabled;\n}\n\n// ----- round\n\n.cat-button-round {\n border-radius: 10rem;\n}\n\n// ----- loading\n\n.cat-button-loading {\n cursor: default;\n\n cat-spinner {\n position: absolute;\n }\n\n > *:not(cat-spinner) {\n visibility: hidden;\n }\n}\n\n// ----- theme\n\n.cat-button-filled {\n background-color: cat-token-wrap(var(--bg));\n color: cat-token-wrap(var(--fill));\n font-weight: 600;\n @include cat-font-smooth;\n}\n\n.cat-button-outlined {\n background-color: cat-token('color.ui.background.body');\n box-shadow: inset 0 0 0 1px cat-token-wrap(var(--base), $alpha: 0.2);\n color: cat-token-wrap(var(--text));\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n background-color: cat-token-wrap(var(--base), $alpha: 0.05);\n }\n\n &:active:not(.cat-button-disabled):not(.cat-button-loading) {\n background-color: cat-token-wrap(var(--base), $alpha: 0.1);\n }\n}\n\n.cat-button-text {\n background-color: transparent;\n color: cat-token-wrap(var(--text));\n text-decoration: $cat-link-text-decoration;\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n text-decoration: $cat-link-text-decoration-hover;\n }\n}\n\n@mixin theme($theme) {\n .cat-button-#{$theme} {\n --bg: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fill', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n @if $theme == 'secondary' {\n --base: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n } @else {\n --base: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n }\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n --bg: #{cat-token('color.theme.#{$theme}.bgHover', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fillHover', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.textHover', $wrap: false)};\n }\n\n &:active:not(.cat-button-disabled):not(.cat-button-loading) {\n --bg: #{cat-token('color.theme.#{$theme}.bgActive', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fillActive', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.textActive', $wrap: false)};\n }\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n\n// ----- size\n\n@mixin size($size, $fontSize, $padding) {\n $-line-height: cat-body-line-height($fontSize);\n $-total-height: cat-size($size);\n\n .cat-button-#{$size} {\n min-width: cat-size($size);\n padding: ($-total-height - $-line-height) * 0.5 $padding;\n @include cat-body($fontSize);\n\n .cat-button-prefix {\n margin-right: 0.25rem;\n }\n\n .cat-button-suffix {\n margin-left: 0.25rem;\n }\n\n // normalize icon size for line height\n @if $fontSize == 'm' {\n cat-icon {\n margin-top: -0.125rem;\n margin-bottom: -0.125rem;\n }\n }\n\n &.cat-button-icon {\n width: $-total-height;\n padding-left: 0;\n padding-right: 0;\n }\n\n :host-context(nav) & {\n padding-left: $cat-nav-padding-horizontal;\n padding-right: $cat-nav-padding-horizontal;\n }\n }\n}\n\n@include size('xs', 's', 0.25rem);\n@include size('s', 'm', 0.5rem);\n@include size('m', 'm', 0.75rem);\n@include size('l', 'm', 1rem);\n@include size('xl', 'l', 1.25rem);\n\n// -- active state\n\n.cat-button-active::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 0.25rem;\n height: 100%;\n background: cat-token-wrap(var(--base));\n}\n\n// ----- context\n\n:host-context(nav) {\n width: 100%;\n\n .cat-button {\n box-shadow: none;\n border-radius: 0;\n justify-content: left;\n\n &:focus-visible {\n outline-offset: -2px;\n }\n }\n}\n\n:host(.cat-text-left) .cat-button {\n justify-content: left;\n}\n\n:host(.cat-text-right) .cat-button {\n justify-content: right;\n}\n","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 * Show an active status indicator on the left side of the button.\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 * Ellipse overflowing button content.\n */\n @Prop() ellipsed = true;\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 @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 * Sets focus on the button. Use this method instead of `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\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 id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\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.ellipsed && !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 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 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.ellipsed && !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 </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 ? (\n <cat-icon icon={this.icon} size={this.iconSize} class=\"cat-button-prefix\" part=\"prefix\"></cat-icon>\n ) : 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 ? (\n <cat-icon icon={this.icon} size={this.iconSize} class=\"cat-button-suffix\" part=\"suffix\"></cat-icon>\n ) : 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"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CatCard extends Components.CatCard, HTMLElement {}
4
+ export const CatCard: {
5
+ prototype: CatCard;
6
+ new (): CatCard;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,35 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const catCardCss = ":host{display:block;margin-bottom:1rem;border-radius:0.5rem;background-color:white;padding:1.5rem}:host([hidden]){display:none}::slotted(nav){margin:-1rem -1.5rem !important}::slotted(:last-child){margin-bottom:0}";
4
+
5
+ const CatCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ }
11
+ render() {
12
+ return (h(Host, null, h("slot", null)));
13
+ }
14
+ static get style() { return catCardCss; }
15
+ }, [1, "cat-card"]);
16
+ function defineCustomElement$1() {
17
+ if (typeof customElements === "undefined") {
18
+ return;
19
+ }
20
+ const components = ["cat-card"];
21
+ components.forEach(tagName => { switch (tagName) {
22
+ case "cat-card":
23
+ if (!customElements.get(tagName)) {
24
+ customElements.define(tagName, CatCard$1);
25
+ }
26
+ break;
27
+ } });
28
+ }
29
+
30
+ const CatCard = CatCard$1;
31
+ const defineCustomElement = defineCustomElement$1;
32
+
33
+ export { CatCard, defineCustomElement };
34
+
35
+ //# sourceMappingURL=cat-card.js.map
@@ -0,0 +1 @@
1
+ {"file":"cat-card.js","mappings":";;AAAA,MAAM,UAAU,GAAG,uNAAuN;;MCW7NA,SAAO;;;;;;EAClB,MAAM;IACJ,QACE,EAAC,IAAI,QACH,eAAa,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;","names":["CatCard"],"sources":["./src/components/cat-card/cat-card.scss?tag=cat-card&encapsulation=shadow","./src/components/cat-card/cat-card.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n$-padding: 1.5rem;\n\n:host {\n display: block;\n margin-bottom: $cat-body-margin-bottom;\n border-radius: cat-border-radius('l');\n background-color: cat-token('color.ui.background.body');\n padding: $-padding;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n::slotted(nav) {\n margin: #{$cat-body-margin-bottom * 0.5 - $-padding} #{-$-padding} !important;\n}\n\n::slotted(:last-child) {\n margin-bottom: 0;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * Cards are surfaces that display content and actions on a single topic. They\n * should be easy to scan for relevant and actionable information.\n */\n@Component({\n tag: 'cat-card',\n styleUrl: 'cat-card.scss',\n shadow: true\n})\nexport class CatCard {\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CatCheckbox extends Components.CatCheckbox, HTMLElement {}
4
+ export const CatCheckbox: {
5
+ prototype: CatCheckbox;
6
+ new (): CatCheckbox;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,103 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { l as loglevel } from './loglevel.js';
3
+
4
+ const catCheckboxCss = ":host{display:flex;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}input{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid #d7dbe0;border-radius:0.125rem;transition:background-color 0.13s ease, border-color 0.13s ease}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 0.13s ease;width:70%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-color:rgb(var(--cat-primary-bg, 32, 127, 138));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-color:rgb(var(--cat-primary-bg, 32, 127, 138));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
5
+
6
+ let nextUniqueId = 0;
7
+ const CatCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.__attachShadow();
12
+ this.catChange = createEvent(this, "catChange", 7);
13
+ this.catFocus = createEvent(this, "catFocus", 7);
14
+ this.catBlur = createEvent(this, "catBlur", 7);
15
+ this.id = `cat-checkbox-${nextUniqueId++}`;
16
+ /**
17
+ * Checked state of the checkbox
18
+ */
19
+ this.checked = false;
20
+ /**
21
+ * Disabled state of the checkbox
22
+ */
23
+ this.disabled = false;
24
+ /**
25
+ * Indeterminate state of the checkbox
26
+ */
27
+ this.indeterminate = false;
28
+ /**
29
+ * Label of the checkbox which is presented in the UI
30
+ */
31
+ this.label = '';
32
+ /**
33
+ * Visually hide the label, but still show it to assistive technologies like screen readers.
34
+ */
35
+ this.labelHidden = false;
36
+ /**
37
+ * Required state of the checkbox
38
+ */
39
+ this.required = false;
40
+ }
41
+ componentDidLoad() {
42
+ if (this.input && this.indeterminate) {
43
+ this.input.indeterminate = true;
44
+ }
45
+ }
46
+ componentWillRender() {
47
+ if (!this.label) {
48
+ loglevel.error('[A11y] Missing ARIA label on checkbox', this);
49
+ }
50
+ }
51
+ /**
52
+ * Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.
53
+ *
54
+ * @param options An optional object providing options to control aspects of
55
+ * the focusing process.
56
+ */
57
+ async setFocus(options) {
58
+ this.input.focus(options);
59
+ }
60
+ render() {
61
+ return (h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled } }, h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, 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.label)));
62
+ }
63
+ onInput(event) {
64
+ this.catChange.emit(event);
65
+ }
66
+ onFocus(event) {
67
+ this.catFocus.emit(event);
68
+ }
69
+ onBlur(event) {
70
+ this.catBlur.emit(event);
71
+ }
72
+ static get style() { return catCheckboxCss; }
73
+ }, [1, "cat-checkbox", {
74
+ "checked": [4],
75
+ "disabled": [4],
76
+ "indeterminate": [4],
77
+ "label": [1],
78
+ "labelHidden": [4, "label-hidden"],
79
+ "name": [1],
80
+ "required": [4],
81
+ "value": [1],
82
+ "setFocus": [64]
83
+ }]);
84
+ function defineCustomElement$1() {
85
+ if (typeof customElements === "undefined") {
86
+ return;
87
+ }
88
+ const components = ["cat-checkbox"];
89
+ components.forEach(tagName => { switch (tagName) {
90
+ case "cat-checkbox":
91
+ if (!customElements.get(tagName)) {
92
+ customElements.define(tagName, CatCheckbox$1);
93
+ }
94
+ break;
95
+ } });
96
+ }
97
+
98
+ const CatCheckbox = CatCheckbox$1;
99
+ const defineCustomElement = defineCustomElement$1;
100
+
101
+ export { CatCheckbox, defineCustomElement };
102
+
103
+ //# sourceMappingURL=cat-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"file":"cat-checkbox.js","mappings":";;;AAAA,MAAM,cAAc,GAAG,yxDAAyxD;;ACGhzD,IAAI,YAAY,GAAG,CAAC,CAAC;MAcRA,aAAW;EALxB;;;;;;;IAMmB,OAAE,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;;;;IAM/C,YAAO,GAAG,KAAK,CAAC;;;;IAKhB,aAAQ,GAAG,KAAK,CAAC;;;;IAKjB,kBAAa,GAAG,KAAK,CAAC;;;;IAKtB,UAAK,GAAG,EAAE,CAAC;;;;IAKX,gBAAW,GAAG,KAAK,CAAC;;;;IAUpB,aAAQ,GAAG,KAAK,CAAC;GAuF1B;EAjEC,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,EAAE;MACpC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;KACjC;GACF;EAED,mBAAmB;IACjB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;MACfC,QAAG,CAAC,KAAK,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;KAC1D;GACF;;;;;;;EASD,MAAM,QAAQ,CAAC,OAAsB;IACnC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;GAC3B;EAED,MAAM;IACJ,QACE,aAAO,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,IAC7F,aACE,GAAG,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kbox.scss?tag=cat-checkbox&encapsulation=shadow","./src/components/cat-checkbox/cat-checkbox.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: flex;\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n flex: 0 1 auto;\n display: flex;\n gap: 0.5rem;\n @include cat-body('m');\n @include cat-select(none);\n cursor: pointer;\n}\n\ninput {\n @include cat-visually-hidden;\n}\n\n.box {\n flex: 0 0 auto;\n display: flex;\n position: relative;\n height: 1.25rem;\n width: 1.25rem;\n background-color: cat-token('color.ui.background.input');\n border: 1px solid cat-token('color.ui.border.input');\n border-radius: cat-border-radius(s);\n transition: background-color cat-token('time.transition.s') ease, border-color cat-token('time.transition.s') ease;\n\n svg {\n fill: none;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 16px;\n stroke-dashoffset: 16px;\n transition: all cat-token('time.transition.s') ease;\n width: 70%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.99);\n }\n\n :checked + & {\n background-color: cat-token('color.theme.primary.bg');\n border-color: cat-token('color.theme.primary.bg');\n stroke: cat-token('color.theme.primary.fill');\n\n .check {\n stroke-dashoffset: 0;\n }\n }\n\n :indeterminate + & {\n background-color: cat-token('color.theme.primary.bg');\n border-color: cat-token('color.theme.primary.bg');\n stroke: cat-token('color.theme.primary.fill');\n\n .dash {\n stroke-dashoffset: 0;\n }\n }\n\n :focus-visible + & {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n.label {\n flex: 1 1 auto;\n\n .is-hidden & {\n @include cat-visually-hidden;\n }\n}\n\n.is-disabled {\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n}\n","import { Component, Event, EventEmitter, h, Method, Prop } from '@stencil/core';\nimport log from 'loglevel';\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 * @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 input!: HTMLInputElement;\n\n /**\n * Checked state of the checkbox\n */\n @Prop() checked = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\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 * Emitted when the checked status of the checkbox is changed.\n */\n @Event() catChange!: EventEmitter;\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 componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\n }\n\n componentWillRender(): void {\n if (!this.label) {\n log.error('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <label htmlFor={this.id} class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled }}>\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n 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.label}\n </span>\n </label>\n );\n }\n\n private onInput(event: Event) {\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"],"version":3}