@haiilo/catalyst 0.5.4 → 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 (297) hide show
  1. package/README.md +1 -1
  2. package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  3. package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  5. package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
  6. package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  8. package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  38. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  39. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  40. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  41. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  42. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  43. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  44. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  45. package/dist/catalyst/catalyst.css +1 -0
  46. package/dist/catalyst/catalyst.esm.js +2 -0
  47. package/dist/catalyst/catalyst.esm.js.map +1 -0
  48. package/dist/catalyst/index.cdn.js +21 -0
  49. package/dist/catalyst/index.esm.js +2 -0
  50. package/dist/catalyst/index.esm.js.map +1 -0
  51. package/dist/catalyst/p-9a3c2375.js +2 -0
  52. package/dist/catalyst/p-9a3c2375.js.map +1 -0
  53. package/dist/catalyst/p-a6b8ebe9.entry.js +10 -0
  54. package/dist/catalyst/p-a6b8ebe9.entry.js.map +1 -0
  55. package/dist/catalyst/p-bfc656ca.js +2 -0
  56. package/dist/catalyst/p-bfc656ca.js.map +1 -0
  57. package/dist/catalyst/p-e82b63e9.js +2 -0
  58. package/dist/catalyst/p-e82b63e9.js.map +1 -0
  59. package/dist/cjs/app-globals-2a30d681.js +256 -0
  60. package/dist/cjs/app-globals-2a30d681.js.map +1 -0
  61. package/dist/cjs/cat-alert_15.cjs.entry.js +4651 -0
  62. package/dist/cjs/cat-alert_15.cjs.entry.js.map +1 -0
  63. package/dist/cjs/cat-icon-registry-b3a95a6b.js +442 -0
  64. package/dist/cjs/cat-icon-registry-b3a95a6b.js.map +1 -0
  65. package/dist/cjs/catalyst.cjs.js +24 -0
  66. package/dist/cjs/catalyst.cjs.js.map +1 -0
  67. package/dist/cjs/index-5d72f0e4.js +1347 -0
  68. package/dist/cjs/index-5d72f0e4.js.map +1 -0
  69. package/dist/cjs/index.cjs.js +12 -0
  70. package/dist/cjs/index.cjs.js.map +1 -0
  71. package/dist/cjs/loader.cjs.js +26 -0
  72. package/dist/cjs/loader.cjs.js.map +1 -0
  73. package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  74. package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
  75. package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  76. package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
  77. package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
  78. package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  79. package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  81. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  82. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  83. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  84. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  87. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  88. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  89. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  90. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  92. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  93. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  94. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  95. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  96. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  97. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  98. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  99. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  100. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  101. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  102. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  103. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  104. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  105. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  106. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  107. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  108. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  109. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  110. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  111. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  112. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  113. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  114. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  115. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  116. package/dist/collection/collection-manifest.json +27 -0
  117. package/dist/collection/components/cat-alert/cat-alert.css +61 -0
  118. package/dist/collection/components/cat-alert/cat-alert.js +61 -0
  119. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -0
  120. package/dist/collection/components/cat-badge/cat-badge.css +154 -0
  121. package/dist/collection/components/cat-badge/cat-badge.js +143 -0
  122. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -0
  123. package/dist/collection/components/cat-button/cat-button.css +333 -0
  124. package/dist/collection/components/cat-button/cat-button.js +615 -0
  125. package/dist/collection/components/cat-button/cat-button.js.map +1 -0
  126. package/dist/collection/components/cat-card/cat-card.css +24 -0
  127. package/dist/collection/components/cat-card/cat-card.js +20 -0
  128. package/dist/collection/components/cat-card/cat-card.js.map +1 -0
  129. package/dist/collection/components/cat-checkbox/cat-checkbox.css +105 -0
  130. package/dist/collection/components/cat-checkbox/cat-checkbox.js +314 -0
  131. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -0
  132. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +70 -0
  133. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -0
  134. package/dist/collection/components/cat-icon/cat-icon-registry.js +55 -0
  135. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -0
  136. package/dist/collection/components/cat-icon/cat-icon.css +50 -0
  137. package/dist/collection/components/cat-icon/cat-icon.js +91 -0
  138. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -0
  139. package/dist/collection/components/cat-input/cat-input.css +131 -0
  140. package/dist/collection/components/cat-input/cat-input.js +606 -0
  141. package/dist/collection/components/cat-input/cat-input.js.map +1 -0
  142. package/dist/collection/components/cat-menu/cat-menu.css +34 -0
  143. package/dist/collection/components/cat-menu/cat-menu.js +184 -0
  144. package/dist/collection/components/cat-menu/cat-menu.js.map +1 -0
  145. package/dist/collection/components/cat-radio/cat-radio.css +84 -0
  146. package/dist/collection/components/cat-radio/cat-radio.js +283 -0
  147. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -0
  148. package/dist/collection/components/cat-scrollable/cat-scrollable.css +69 -0
  149. package/dist/collection/components/cat-scrollable/cat-scrollable.js +311 -0
  150. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -0
  151. package/dist/collection/components/cat-skeleton/cat-skeleton.css +177 -0
  152. package/dist/collection/components/cat-skeleton/cat-skeleton.js +131 -0
  153. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -0
  154. package/dist/collection/components/cat-spinner/cat-spinner.css +63 -0
  155. package/dist/collection/components/cat-spinner/cat-spinner.js +65 -0
  156. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -0
  157. package/dist/collection/components/cat-textarea/cat-textarea.css +72 -0
  158. package/dist/collection/components/cat-textarea/cat-textarea.js +393 -0
  159. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -0
  160. package/dist/collection/components/cat-toggle/cat-toggle.css +93 -0
  161. package/dist/collection/components/cat-toggle/cat-toggle.js +283 -0
  162. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -0
  163. package/dist/collection/components/cat-tooltip/cat-tooltip.css +41 -0
  164. package/dist/collection/components/cat-tooltip/cat-tooltip.js +254 -0
  165. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -0
  166. package/dist/collection/index.cdn.js +21 -0
  167. package/dist/collection/index.js +3 -0
  168. package/dist/collection/index.js.map +1 -0
  169. package/dist/collection/init.js +17 -0
  170. package/dist/collection/init.js.map +1 -0
  171. package/dist/collection/utils/breakpoints.js +12 -0
  172. package/dist/collection/utils/breakpoints.js.map +1 -0
  173. package/dist/collection/utils/first-tabbable.js +6 -0
  174. package/dist/collection/utils/first-tabbable.js.map +1 -0
  175. package/dist/collection/utils/is-touch-screen.js +3 -0
  176. package/dist/collection/utils/is-touch-screen.js.map +1 -0
  177. package/dist/collection/utils/media-matcher.js +55 -0
  178. package/dist/collection/utils/media-matcher.js.map +1 -0
  179. package/dist/collection/utils/platform.js +50 -0
  180. package/dist/collection/utils/platform.js.map +1 -0
  181. package/dist/components/cat-alert.d.ts +11 -0
  182. package/dist/components/cat-alert.js +53 -0
  183. package/dist/components/cat-alert.js.map +1 -0
  184. package/dist/components/cat-badge.d.ts +11 -0
  185. package/dist/components/cat-badge.js +68 -0
  186. package/dist/components/cat-badge.js.map +1 -0
  187. package/dist/components/cat-button.d.ts +11 -0
  188. package/dist/components/cat-button.js +8 -0
  189. package/dist/components/cat-button.js.map +1 -0
  190. package/dist/components/cat-button2.js +346 -0
  191. package/dist/components/cat-button2.js.map +1 -0
  192. package/dist/components/cat-card.d.ts +11 -0
  193. package/dist/components/cat-card.js +35 -0
  194. package/dist/components/cat-card.js.map +1 -0
  195. package/dist/components/cat-checkbox.d.ts +11 -0
  196. package/dist/components/cat-checkbox.js +103 -0
  197. package/dist/components/cat-checkbox.js.map +1 -0
  198. package/dist/components/cat-i18n-registry.js +74 -0
  199. package/dist/components/cat-i18n-registry.js.map +1 -0
  200. package/dist/components/cat-icon-registry.js +59 -0
  201. package/dist/components/cat-icon-registry.js.map +1 -0
  202. package/dist/components/cat-icon.d.ts +11 -0
  203. package/dist/components/cat-icon.js +8 -0
  204. package/dist/components/cat-icon.js.map +1 -0
  205. package/dist/components/cat-icon2.js +49 -0
  206. package/dist/components/cat-icon2.js.map +1 -0
  207. package/dist/components/cat-input.d.ts +11 -0
  208. package/dist/components/cat-input.js +172 -0
  209. package/dist/components/cat-input.js.map +1 -0
  210. package/dist/components/cat-menu.d.ts +11 -0
  211. package/dist/components/cat-menu.js +870 -0
  212. package/dist/components/cat-menu.js.map +1 -0
  213. package/dist/components/cat-radio.d.ts +11 -0
  214. package/dist/components/cat-radio.js +93 -0
  215. package/dist/components/cat-radio.js.map +1 -0
  216. package/dist/components/cat-scrollable.d.ts +11 -0
  217. package/dist/components/cat-scrollable.js +1362 -0
  218. package/dist/components/cat-scrollable.js.map +1 -0
  219. package/dist/components/cat-skeleton.d.ts +11 -0
  220. package/dist/components/cat-skeleton.js +78 -0
  221. package/dist/components/cat-skeleton.js.map +1 -0
  222. package/dist/components/cat-spinner.d.ts +11 -0
  223. package/dist/components/cat-spinner.js +8 -0
  224. package/dist/components/cat-spinner.js.map +1 -0
  225. package/dist/components/cat-spinner2.js +41 -0
  226. package/dist/components/cat-spinner2.js.map +1 -0
  227. package/dist/components/cat-textarea.d.ts +11 -0
  228. package/dist/components/cat-textarea.js +119 -0
  229. package/dist/components/cat-textarea.js.map +1 -0
  230. package/dist/components/cat-toggle.d.ts +11 -0
  231. package/dist/components/cat-toggle.js +93 -0
  232. package/dist/components/cat-toggle.js.map +1 -0
  233. package/dist/components/cat-tooltip.d.ts +11 -0
  234. package/dist/components/cat-tooltip.js +154 -0
  235. package/dist/components/cat-tooltip.js.map +1 -0
  236. package/dist/components/first-tabbable.js +1495 -0
  237. package/dist/components/first-tabbable.js.map +1 -0
  238. package/dist/components/index.d.ts +26 -0
  239. package/dist/components/index.js +258 -0
  240. package/dist/components/index.js.map +1 -0
  241. package/dist/components/loglevel.js +315 -0
  242. package/dist/components/loglevel.js.map +1 -0
  243. package/dist/esm/app-globals-77cd8c8e.js +254 -0
  244. package/dist/esm/app-globals-77cd8c8e.js.map +1 -0
  245. package/dist/esm/cat-alert_15.entry.js +4633 -0
  246. package/dist/esm/cat-alert_15.entry.js.map +1 -0
  247. package/dist/esm/cat-icon-registry-a7acd6f7.js +438 -0
  248. package/dist/esm/cat-icon-registry-a7acd6f7.js.map +1 -0
  249. package/dist/esm/catalyst.js +22 -0
  250. package/dist/esm/catalyst.js.map +1 -0
  251. package/dist/esm/index-fd12be19.js +1320 -0
  252. package/dist/esm/index-fd12be19.js.map +1 -0
  253. package/dist/esm/index.js +3 -0
  254. package/dist/esm/index.js.map +1 -0
  255. package/dist/esm/loader.js +22 -0
  256. package/dist/esm/loader.js.map +1 -0
  257. package/dist/esm/polyfills/core-js.js +11 -0
  258. package/dist/esm/polyfills/css-shim.js +1 -0
  259. package/dist/esm/polyfills/dom.js +79 -0
  260. package/dist/esm/polyfills/es5-html-element.js +1 -0
  261. package/dist/esm/polyfills/index.js +34 -0
  262. package/dist/esm/polyfills/system.js +6 -0
  263. package/dist/index.cjs.js +1 -0
  264. package/dist/index.js +1 -0
  265. package/dist/types/components/cat-alert/cat-alert.d.ts +14 -0
  266. package/dist/types/components/cat-badge/cat-badge.d.ts +29 -0
  267. package/dist/types/components/cat-button/cat-button.d.ts +134 -0
  268. package/dist/types/components/cat-card/cat-card.d.ts +7 -0
  269. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +69 -0
  270. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +18 -0
  271. package/dist/types/components/cat-icon/cat-icon-registry.d.ts +15 -0
  272. package/dist/types/components/cat-icon/cat-icon.d.ts +23 -0
  273. package/dist/types/components/cat-input/cat-input.d.ts +130 -0
  274. package/dist/types/components/cat-menu/cat-menu.d.ts +31 -0
  275. package/dist/types/components/cat-radio/cat-radio.d.ts +63 -0
  276. package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +52 -0
  277. package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +28 -0
  278. package/dist/types/components/cat-spinner/cat-spinner.d.ts +15 -0
  279. package/dist/types/components/cat-textarea/cat-textarea.d.ts +85 -0
  280. package/dist/types/components/cat-toggle/cat-toggle.d.ts +64 -0
  281. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +46 -0
  282. package/dist/types/components.d.ts +1167 -0
  283. package/dist/types/index.d.ts +3 -0
  284. package/dist/types/init.d.ts +1 -0
  285. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  286. package/dist/types/utils/breakpoints.d.ts +7 -0
  287. package/dist/types/utils/first-tabbable.d.ts +4 -0
  288. package/dist/types/utils/is-touch-screen.d.ts +2 -0
  289. package/dist/types/utils/media-matcher.d.ts +13 -0
  290. package/dist/types/utils/platform.d.ts +18 -0
  291. package/loader/cdn.js +3 -0
  292. package/loader/index.cjs.js +3 -0
  293. package/loader/index.d.ts +12 -0
  294. package/loader/index.es2017.js +3 -0
  295. package/loader/index.js +4 -0
  296. package/loader/package.json +10 -0
  297. package/package.json +2 -2
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Auto-generated file. Do not edit directly.
3
+ */
4
+ /* stylelint-disable value-keyword-case */
5
+ /* stylelint-enable value-keyword-case */
6
+ :host {
7
+ display: inline-flex;
8
+ vertical-align: middle;
9
+ /* stylelint-disable property-no-vendor-prefix */
10
+ -webkit-user-select: none;
11
+ -ms-user-select: none;
12
+ user-select: none;
13
+ /* stylelint-enable property-no-vendor-prefix */
14
+ }
15
+ :host[hidden] {
16
+ display: none;
17
+ }
18
+
19
+ span {
20
+ display: inline-flex;
21
+ }
22
+
23
+ svg {
24
+ fill: none;
25
+ stroke: currentColor;
26
+ stroke-dasharray: 135px;
27
+ stroke-dashoffset: 95px;
28
+ stroke-linecap: round;
29
+ stroke-width: 5px;
30
+ transform-origin: center center;
31
+ animation: spin 0.75s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;
32
+ width: 1em;
33
+ height: 1em;
34
+ }
35
+
36
+ .spinner-xs svg {
37
+ font-size: 0.75rem;
38
+ }
39
+
40
+ .spinner-s svg {
41
+ font-size: 1rem;
42
+ }
43
+
44
+ .spinner-m svg {
45
+ font-size: 1.25rem;
46
+ }
47
+
48
+ .spinner-l svg {
49
+ font-size: 1.5rem;
50
+ }
51
+
52
+ .spinner-xl svg {
53
+ font-size: 1.75rem;
54
+ }
55
+
56
+ @keyframes spin {
57
+ from {
58
+ transform: rotate(0deg);
59
+ }
60
+ to {
61
+ transform: rotate(360deg);
62
+ }
63
+ }
@@ -0,0 +1,65 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ /**
3
+ * Spinners are used to indicate users that their action is being processed.
4
+ */
5
+ export class CatSpinner {
6
+ constructor() {
7
+ /**
8
+ * The size of the spinner.
9
+ */
10
+ this.size = 'm';
11
+ }
12
+ render() {
13
+ return (h("span", { "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
14
+ [`spinner-${this.size}`]: this.size !== 'inline'
15
+ } },
16
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" },
17
+ h("circle", { cx: "24", cy: "24", r: "21.5" }))));
18
+ }
19
+ static get is() { return "cat-spinner"; }
20
+ static get encapsulation() { return "shadow"; }
21
+ static get originalStyleUrls() { return {
22
+ "$": ["cat-spinner.scss"]
23
+ }; }
24
+ static get styleUrls() { return {
25
+ "$": ["cat-spinner.css"]
26
+ }; }
27
+ static get properties() { return {
28
+ "size": {
29
+ "type": "string",
30
+ "mutable": false,
31
+ "complexType": {
32
+ "original": "'xs' | 's' | 'm' | 'l' | 'xl' | 'inline'",
33
+ "resolved": "\"inline\" | \"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
34
+ "references": {}
35
+ },
36
+ "required": false,
37
+ "optional": false,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": "The size of the spinner."
41
+ },
42
+ "attribute": "size",
43
+ "reflect": false,
44
+ "defaultValue": "'m'"
45
+ },
46
+ "a11yLabel": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string | undefined",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": true,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": "Adds accessible label for the spinner that is only shown for screen\nreaders. The `aria-hidden` attribute will be set if no label is present."
59
+ },
60
+ "attribute": "a11y-label",
61
+ "reflect": false
62
+ }
63
+ }; }
64
+ }
65
+ //# sourceMappingURL=cat-spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-spinner.js","sourceRoot":"","sources":["../../../src/components/cat-spinner/cat-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AAMH,MAAM,OAAO,UAAU;EALvB;IAME;;OAEG;IACK,SAAI,GAA6C,GAAG,CAAC;GAuB9D;EAfC,MAAM;IACJ,OAAO,CACL,0BACc,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAC3C,KAAK,EAAE;QACL,CAAC,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;OACjD;MAED,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW;QACzD,cAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,MAAM,GAAU,CACtC,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\n/**\n * Spinners are used to indicate users that their action is being processed.\n */\n@Component({\n tag: 'cat-spinner',\n styleUrl: 'cat-spinner.scss',\n shadow: true\n})\nexport class CatSpinner {\n /**\n * The size of the spinner.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the spinner that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n class={{\n [`spinner-${this.size}`]: this.size !== 'inline'\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\">\n <circle cx=\"24\" cy=\"24\" r=\"21.5\"></circle>\n </svg>\n </span>\n );\n }\n}\n"]}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Auto-generated file. Do not edit directly.
3
+ */
4
+ /* stylelint-disable value-keyword-case */
5
+ /* stylelint-enable value-keyword-case */
6
+ :host {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 0.5rem;
10
+ font-size: 0.9375rem;
11
+ line-height: 1.25rem;
12
+ margin-bottom: 1rem;
13
+ }
14
+
15
+ :host([hidden]) {
16
+ display: none;
17
+ }
18
+
19
+ label {
20
+ align-self: flex-start;
21
+ }
22
+ label.hidden {
23
+ position: absolute !important;
24
+ width: 1px !important;
25
+ height: 1px !important;
26
+ padding: 0 !important;
27
+ margin: -1px !important;
28
+ overflow: hidden !important;
29
+ clip: rect(0, 0, 0, 0) !important;
30
+ white-space: nowrap !important;
31
+ border: 0 !important;
32
+ }
33
+
34
+ .input-optional {
35
+ margin-left: 0.25rem;
36
+ font-size: 0.75rem;
37
+ line-height: 1rem;
38
+ color: rgb(var(--cat-font-color-muted, 105, 118, 135));
39
+ }
40
+
41
+ textarea {
42
+ margin: 0;
43
+ padding: 0.625rem 0.75rem;
44
+ min-height: 2.5rem;
45
+ font: inherit;
46
+ background: white;
47
+ border-radius: 0.25rem;
48
+ border: none;
49
+ box-shadow: 0 0 0 1px #d7dbe0;
50
+ transition: box-shadow 0.13s linear;
51
+ }
52
+ textarea:disabled {
53
+ background: #f8f8fb;
54
+ cursor: not-allowed;
55
+ color: rgb(var(--cat-font-color-muted, 105, 118, 135));
56
+ resize: none;
57
+ }
58
+ textarea:hover:not(:disabled) {
59
+ box-shadow: 0 0 0 2px #d7dbe0;
60
+ }
61
+ textarea:focus {
62
+ outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
63
+ }
64
+ textarea::placeholder {
65
+ color: rgb(var(--cat-font-color-muted, 105, 118, 135));
66
+ }
67
+
68
+ .input-hint {
69
+ font-size: 0.875rem;
70
+ line-height: 1rem;
71
+ margin: 0;
72
+ }
@@ -0,0 +1,393 @@
1
+ import { Component, Event, h, Host, Method, Prop } from '@stencil/core';
2
+ import log from 'loglevel';
3
+ import autosize from 'autosize';
4
+ let nextUniqueId = 0;
5
+ /**
6
+ * Textarea specifies a control that allows user to write text over multiple
7
+ * rows. Used when the expected user input is long. For shorter input, use the
8
+ * input component.
9
+ *
10
+ * @part label - The label content.
11
+ */
12
+ export class CatTextarea {
13
+ constructor() {
14
+ this.id = `cat-textarea-${nextUniqueId++}`;
15
+ /**
16
+ * Whether the textarea is disabled.
17
+ */
18
+ this.disabled = false;
19
+ /**
20
+ * The label for the textarea.
21
+ */
22
+ this.label = '';
23
+ /**
24
+ * Visually hide the label, but still show it to assistive technologies like screen readers.
25
+ */
26
+ this.labelHidden = false;
27
+ /**
28
+ * The name of the form control. Submitted with the form as part of a name/value pair.
29
+ */
30
+ this.name = '';
31
+ /**
32
+ * The value is not editable.
33
+ */
34
+ this.readonly = false;
35
+ /**
36
+ * A value is required or must be check for the form to be submittable.
37
+ */
38
+ this.required = false;
39
+ /**
40
+ * Specifies the initial number of lines in the textarea.
41
+ */
42
+ this.rows = 3;
43
+ }
44
+ componentWillRender() {
45
+ if (!this.label) {
46
+ log.error('[A11y] Missing ARIA label on textarea', this);
47
+ }
48
+ }
49
+ componentDidLoad() {
50
+ autosize(this.textarea);
51
+ }
52
+ /**
53
+ * Sets focus on the textarea. Use this method instead of `textarea.focus()`.
54
+ *
55
+ * @param options An optional object providing options to control aspects of
56
+ * the focusing process.
57
+ */
58
+ async setFocus(options) {
59
+ this.textarea.focus(options);
60
+ }
61
+ // /**
62
+ // * Clear the input.
63
+ // */
64
+ // @Method()
65
+ // async clear(): Promise<void> {
66
+ // this.inputValue = '';
67
+ // }
68
+ render() {
69
+ return (h(Host, null,
70
+ this.label && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } },
71
+ h("span", { part: "label" },
72
+ this.label,
73
+ !this.required && (h("span", { class: "input-optional", "aria-hidden": "true" }, "(Optional)"))))),
74
+ h("textarea", { ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }),
75
+ this.hint && h("p", { class: "input-hint" }, this.hint)));
76
+ }
77
+ onInput(event) {
78
+ // this.inputValue = πthis.input.value;
79
+ this.catChange.emit(event);
80
+ }
81
+ onFocus(event) {
82
+ this.catFocus.emit(event);
83
+ }
84
+ onBlur(event) {
85
+ this.catBlur.emit(event);
86
+ }
87
+ static get is() { return "cat-textarea"; }
88
+ static get encapsulation() { return "shadow"; }
89
+ static get originalStyleUrls() { return {
90
+ "$": ["cat-textarea.scss"]
91
+ }; }
92
+ static get styleUrls() { return {
93
+ "$": ["cat-textarea.css"]
94
+ }; }
95
+ static get properties() { return {
96
+ "disabled": {
97
+ "type": "boolean",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "boolean",
101
+ "resolved": "boolean",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": false,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": "Whether the textarea is disabled."
109
+ },
110
+ "attribute": "disabled",
111
+ "reflect": false,
112
+ "defaultValue": "false"
113
+ },
114
+ "hint": {
115
+ "type": "string",
116
+ "mutable": false,
117
+ "complexType": {
118
+ "original": "string",
119
+ "resolved": "string | undefined",
120
+ "references": {}
121
+ },
122
+ "required": false,
123
+ "optional": true,
124
+ "docs": {
125
+ "tags": [],
126
+ "text": "Optional hint text to be displayed with the textarea."
127
+ },
128
+ "attribute": "hint",
129
+ "reflect": false
130
+ },
131
+ "label": {
132
+ "type": "string",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "string",
136
+ "resolved": "string",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": "The label for the textarea."
144
+ },
145
+ "attribute": "label",
146
+ "reflect": false,
147
+ "defaultValue": "''"
148
+ },
149
+ "labelHidden": {
150
+ "type": "boolean",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "boolean",
154
+ "resolved": "boolean",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
162
+ },
163
+ "attribute": "label-hidden",
164
+ "reflect": false,
165
+ "defaultValue": "false"
166
+ },
167
+ "maxLength": {
168
+ "type": "number",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "number",
172
+ "resolved": "number | undefined",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": true,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "A maximum length (number of characters) for textual values."
180
+ },
181
+ "attribute": "max-length",
182
+ "reflect": false
183
+ },
184
+ "minLength": {
185
+ "type": "number",
186
+ "mutable": false,
187
+ "complexType": {
188
+ "original": "number",
189
+ "resolved": "number | undefined",
190
+ "references": {}
191
+ },
192
+ "required": false,
193
+ "optional": true,
194
+ "docs": {
195
+ "tags": [],
196
+ "text": "A minimum length (number of characters) for textual values."
197
+ },
198
+ "attribute": "min-length",
199
+ "reflect": false
200
+ },
201
+ "name": {
202
+ "type": "string",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "string",
206
+ "resolved": "string",
207
+ "references": {}
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": "The name of the form control. Submitted with the form as part of a name/value pair."
214
+ },
215
+ "attribute": "name",
216
+ "reflect": false,
217
+ "defaultValue": "''"
218
+ },
219
+ "placeholder": {
220
+ "type": "string",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "string",
224
+ "resolved": "string | undefined",
225
+ "references": {}
226
+ },
227
+ "required": false,
228
+ "optional": true,
229
+ "docs": {
230
+ "tags": [],
231
+ "text": "The placeholder text to display within the input."
232
+ },
233
+ "attribute": "placeholder",
234
+ "reflect": false
235
+ },
236
+ "readonly": {
237
+ "type": "boolean",
238
+ "mutable": false,
239
+ "complexType": {
240
+ "original": "boolean",
241
+ "resolved": "boolean",
242
+ "references": {}
243
+ },
244
+ "required": false,
245
+ "optional": false,
246
+ "docs": {
247
+ "tags": [],
248
+ "text": "The value is not editable."
249
+ },
250
+ "attribute": "readonly",
251
+ "reflect": false,
252
+ "defaultValue": "false"
253
+ },
254
+ "required": {
255
+ "type": "boolean",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "boolean",
259
+ "resolved": "boolean",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": "A value is required or must be check for the form to be submittable."
267
+ },
268
+ "attribute": "required",
269
+ "reflect": false,
270
+ "defaultValue": "false"
271
+ },
272
+ "rows": {
273
+ "type": "number",
274
+ "mutable": false,
275
+ "complexType": {
276
+ "original": "number",
277
+ "resolved": "number",
278
+ "references": {}
279
+ },
280
+ "required": false,
281
+ "optional": false,
282
+ "docs": {
283
+ "tags": [],
284
+ "text": "Specifies the initial number of lines in the textarea."
285
+ },
286
+ "attribute": "rows",
287
+ "reflect": false,
288
+ "defaultValue": "3"
289
+ },
290
+ "value": {
291
+ "type": "any",
292
+ "mutable": false,
293
+ "complexType": {
294
+ "original": "string | number",
295
+ "resolved": "number | string | undefined",
296
+ "references": {}
297
+ },
298
+ "required": false,
299
+ "optional": true,
300
+ "docs": {
301
+ "tags": [],
302
+ "text": "The initial value of the control."
303
+ },
304
+ "attribute": "value",
305
+ "reflect": false
306
+ }
307
+ }; }
308
+ static get events() { return [{
309
+ "method": "catChange",
310
+ "name": "catChange",
311
+ "bubbles": true,
312
+ "cancelable": true,
313
+ "composed": true,
314
+ "docs": {
315
+ "tags": [],
316
+ "text": "Emitted when the value is changed."
317
+ },
318
+ "complexType": {
319
+ "original": "any",
320
+ "resolved": "any",
321
+ "references": {}
322
+ }
323
+ }, {
324
+ "method": "catFocus",
325
+ "name": "catFocus",
326
+ "bubbles": true,
327
+ "cancelable": true,
328
+ "composed": true,
329
+ "docs": {
330
+ "tags": [],
331
+ "text": "Emitted when the textarea received focus."
332
+ },
333
+ "complexType": {
334
+ "original": "FocusEvent",
335
+ "resolved": "FocusEvent",
336
+ "references": {
337
+ "FocusEvent": {
338
+ "location": "global"
339
+ }
340
+ }
341
+ }
342
+ }, {
343
+ "method": "catBlur",
344
+ "name": "catBlur",
345
+ "bubbles": true,
346
+ "cancelable": true,
347
+ "composed": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "Emitted when the textarea loses focus."
351
+ },
352
+ "complexType": {
353
+ "original": "FocusEvent",
354
+ "resolved": "FocusEvent",
355
+ "references": {
356
+ "FocusEvent": {
357
+ "location": "global"
358
+ }
359
+ }
360
+ }
361
+ }]; }
362
+ static get methods() { return {
363
+ "setFocus": {
364
+ "complexType": {
365
+ "signature": "(options?: FocusOptions | undefined) => Promise<void>",
366
+ "parameters": [{
367
+ "tags": [{
368
+ "name": "param",
369
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
370
+ }],
371
+ "text": "An optional object providing options to control aspects of\nthe focusing process."
372
+ }],
373
+ "references": {
374
+ "Promise": {
375
+ "location": "global"
376
+ },
377
+ "FocusOptions": {
378
+ "location": "global"
379
+ }
380
+ },
381
+ "return": "Promise<void>"
382
+ },
383
+ "docs": {
384
+ "text": "Sets focus on the textarea. Use this method instead of `textarea.focus()`.",
385
+ "tags": [{
386
+ "name": "param",
387
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
388
+ }]
389
+ }
390
+ }
391
+ }; }
392
+ }
393
+ //# sourceMappingURL=cat-textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-textarea.js","sourceRoot":"","sources":["../../../src/components/cat-textarea/cat-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;GAMG;AAMH,MAAM,OAAO,WAAW;EALxB;IAMmB,OAAE,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAGvD;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAOzB;;OAEG;IACK,UAAK,GAAG,EAAE,CAAC;IAEnB;;OAEG;IACK,gBAAW,GAAG,KAAK,CAAC;IAY5B;;OAEG;IACK,SAAI,GAAG,EAAE,CAAC;IAOlB;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,SAAI,GAAG,CAAC,CAAC;GAmGlB;EA7EC,mBAAmB;IACjB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;MACf,GAAG,CAAC,KAAK,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;KAC1D;EACH,CAAC;EAED,gBAAgB;IACd,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;EAC1B,CAAC;EAED;;;;;KAKG;EAEH,KAAK,CAAC,QAAQ,CAAC,OAAsB;IACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;EAC/B,CAAC;EAED,MAAM;EACN,sBAAsB;EACtB,MAAM;EACN,YAAY;EACZ,iCAAiC;EACjC,0BAA0B;EAC1B,IAAI;EAEJ,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACF,IAAI,CAAC,KAAK,IAAI,CACb,aAAO,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE;QAC1D,YAAM,IAAI,EAAC,OAAO;UACf,IAAI,CAAC,KAAK;UACV,CAAC,IAAI,CAAC,QAAQ,IAAI,CACjB,YAAM,KAAK,EAAC,gBAAgB,iBAAa,MAAM,iBAExC,CACR,CACI,CACD,CACT;MACD,gBACE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAyB,CAAC,EACtD,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAChC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAChC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GACpB;MACX,IAAI,CAAC,IAAI,IAAI,SAAG,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,IAAI,CAAK,CAC9C,CACR,CAAC;EACJ,CAAC;EAEO,OAAO,CAAC,KAAY;IAC1B,uCAAuC;IACvC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC7B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core';\nimport log from 'loglevel';\nimport autosize from 'autosize';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n shadow: true\n})\nexport class CatTextarea {\n private readonly id = `cat-textarea-${nextUniqueId++}`;\n private textarea!: HTMLTextAreaElement;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text to be displayed with the textarea.\n */\n @Prop() hint?: string;\n\n /**\n * The label for the textarea.\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 * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name = '';\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial value of the control.\n */\n @Prop() value?: string | number;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n if (!this.label) {\n log.error('[A11y] Missing ARIA label on textarea', this);\n }\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Sets focus on the textarea. Use this method instead of `textarea.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.textarea.focus(options);\n }\n\n // /**\n // * Clear the input.\n // */\n // @Method()\n // async clear(): Promise<void> {\n // this.inputValue = '';\n // }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span part=\"label\">\n {this.label}\n {!this.required && (\n <span class=\"input-optional\" aria-hidden=\"true\">\n (Optional)\n </span>\n )}\n </span>\n </label>\n )}\n <textarea\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n ></textarea>\n {this.hint && <p class=\"input-hint\">{this.hint}</p>}\n </Host>\n );\n }\n\n private onInput(event: Event) {\n // this.inputValue = πthis.input.value;\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"]}