@haiilo/catalyst 4.1.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  2. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  3. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  4. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  5. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  6. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  37. package/dist/catalyst/catalyst.css +6 -27
  38. package/dist/catalyst/catalyst.esm.js +1 -1
  39. package/dist/catalyst/catalyst.esm.js.map +1 -1
  40. package/dist/catalyst/index.esm.js.map +1 -1
  41. package/dist/catalyst/p-50855511.entry.js +10 -0
  42. package/dist/catalyst/p-50855511.entry.js.map +1 -0
  43. package/dist/catalyst/p-ccfebe33.js.map +1 -1
  44. package/dist/catalyst/p-d1fb9d96.js +3 -0
  45. package/dist/catalyst/p-d1fb9d96.js.map +1 -0
  46. package/dist/catalyst/scss/fonts/_fonts-mixins.scss +0 -10
  47. package/dist/cjs/cat-alert_24.cjs.entry.js +932 -1132
  48. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
  49. package/dist/cjs/catalyst.cjs.js +10 -3
  50. package/dist/cjs/catalyst.cjs.js.map +1 -1
  51. package/dist/cjs/{index-c4542095.js → index-01312a2e.js} +527 -245
  52. package/dist/cjs/index-01312a2e.js.map +1 -0
  53. package/dist/cjs/index.cjs.js.map +1 -1
  54. package/dist/cjs/loader.cjs.js +4 -3
  55. package/dist/cjs/loader.cjs.js.map +1 -1
  56. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  57. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  58. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  59. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  60. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  61. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  62. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  63. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  64. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  65. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  66. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  67. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  68. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  69. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  70. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  71. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  72. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  73. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  74. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  75. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  76. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  77. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  78. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  79. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  81. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  82. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  83. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  84. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  87. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  88. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  89. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  90. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  92. package/dist/collection/collection-manifest.json +2 -2
  93. package/dist/collection/components/cat-alert/cat-alert.js +69 -71
  94. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  95. package/dist/collection/components/cat-avatar/cat-avatar.js +172 -165
  96. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  97. package/dist/collection/components/cat-badge/cat-badge.js +102 -111
  98. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  99. package/dist/collection/components/cat-button/cat-button.js +526 -537
  100. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  101. package/dist/collection/components/cat-card/cat-card.js +12 -8
  102. package/dist/collection/components/cat-checkbox/cat-checkbox.js +336 -350
  103. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  104. package/dist/collection/components/cat-dropdown/cat-dropdown.js +137 -137
  105. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  106. package/dist/collection/components/cat-form-group/cat-form-group.js +58 -40
  107. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  108. package/dist/collection/components/cat-form-hint/cat-form-hint.js +14 -7
  109. package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
  110. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
  111. package/dist/collection/components/cat-icon/cat-icon-registry.js +1 -1
  112. package/dist/collection/components/cat-icon/cat-icon.js +85 -79
  113. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  114. package/dist/collection/components/cat-input/cat-input.css +32 -3
  115. package/dist/collection/components/cat-input/cat-input.js +662 -660
  116. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  117. package/dist/collection/components/cat-input/input-type.js +1 -1
  118. package/dist/collection/components/cat-label/cat-label.js +69 -78
  119. package/dist/collection/components/cat-label/cat-label.js.map +1 -1
  120. package/dist/collection/components/cat-notification/cat-notification.js +1 -1
  121. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  122. package/dist/collection/components/cat-pagination/cat-pagination.js +192 -226
  123. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  124. package/dist/collection/components/cat-radio/cat-radio.js +319 -327
  125. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  126. package/dist/collection/components/cat-radio-group/cat-radio-group.js +173 -165
  127. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  128. package/dist/collection/components/cat-scrollable/cat-scrollable.js +200 -208
  129. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  130. package/dist/collection/components/cat-select/cat-select.js +555 -590
  131. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  132. package/dist/collection/components/cat-select-demo/cat-select-demo.js +3 -28
  133. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  134. package/dist/collection/components/cat-skeleton/cat-skeleton.js +85 -88
  135. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  136. package/dist/collection/components/cat-spinner/cat-spinner.js +52 -50
  137. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  138. package/dist/collection/components/cat-tab/cat-tab.js +169 -168
  139. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  140. package/dist/collection/components/cat-tabs/cat-tabs.js +73 -66
  141. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  142. package/dist/collection/components/cat-textarea/cat-textarea.css +32 -1
  143. package/dist/collection/components/cat-textarea/cat-textarea.js +479 -468
  144. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  145. package/dist/collection/components/cat-toggle/cat-toggle.js +319 -326
  146. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  147. package/dist/collection/components/cat-tooltip/cat-tooltip.css +7 -1
  148. package/dist/collection/components/cat-tooltip/cat-tooltip.js +187 -198
  149. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  150. package/dist/collection/index.js +1 -1
  151. package/dist/collection/scss/fonts/_fonts-mixins.scss +0 -10
  152. package/dist/collection/utils/breakpoints.js +1 -1
  153. package/dist/collection/utils/breakpoints.js.map +1 -1
  154. package/dist/collection/utils/coerce.js +11 -0
  155. package/dist/collection/utils/coerce.js.map +1 -0
  156. package/dist/collection/utils/first-tabbable.js +1 -1
  157. package/dist/collection/utils/is-touch-screen.js +1 -1
  158. package/dist/collection/utils/load-img.js +1 -1
  159. package/dist/collection/utils/media-matcher.js +1 -1
  160. package/dist/collection/utils/platform.js +4 -4
  161. package/dist/collection/utils/setDefault.js +1 -1
  162. package/dist/components/cat-alert.js +1 -6
  163. package/dist/components/cat-alert.js.map +1 -1
  164. package/dist/components/cat-avatar2.js +6 -9
  165. package/dist/components/cat-avatar2.js.map +1 -1
  166. package/dist/components/cat-badge.js +0 -15
  167. package/dist/components/cat-badge.js.map +1 -1
  168. package/dist/components/cat-button2.js +10 -36
  169. package/dist/components/cat-button2.js.map +1 -1
  170. package/dist/components/cat-checkbox2.js +9 -26
  171. package/dist/components/cat-checkbox2.js.map +1 -1
  172. package/dist/components/cat-dropdown2.js +139 -176
  173. package/dist/components/cat-dropdown2.js.map +1 -1
  174. package/dist/components/cat-form-group.js +4 -9
  175. package/dist/components/cat-form-group.js.map +1 -1
  176. package/dist/components/cat-form-hint.js +13 -6
  177. package/dist/components/cat-form-hint.js.map +1 -1
  178. package/dist/components/cat-icon-registry.js +71 -0
  179. package/dist/components/cat-icon-registry.js.map +1 -0
  180. package/dist/components/cat-icon.js +1 -1
  181. package/dist/components/cat-icon2.js +5 -71
  182. package/dist/components/cat-icon2.js.map +1 -1
  183. package/dist/components/cat-input.js +33 -41
  184. package/dist/components/cat-input.js.map +1 -1
  185. package/dist/components/cat-label.js +1 -6
  186. package/dist/components/cat-label.js.map +1 -1
  187. package/dist/components/cat-pagination.js +0 -30
  188. package/dist/components/cat-pagination.js.map +1 -1
  189. package/dist/components/cat-radio-group.js +3 -6
  190. package/dist/components/cat-radio-group.js.map +1 -1
  191. package/dist/components/cat-radio.js +9 -23
  192. package/dist/components/cat-radio.js.map +1 -1
  193. package/dist/components/cat-scrollable2.js +1 -12
  194. package/dist/components/cat-scrollable2.js.map +1 -1
  195. package/dist/components/cat-select-demo.js +2 -12
  196. package/dist/components/cat-select-demo.js.map +1 -1
  197. package/dist/components/cat-select2.js +40 -47
  198. package/dist/components/cat-select2.js.map +1 -1
  199. package/dist/components/cat-skeleton2.js +1 -10
  200. package/dist/components/cat-skeleton2.js.map +1 -1
  201. package/dist/components/cat-spinner2.js +1 -3
  202. package/dist/components/cat-spinner2.js.map +1 -1
  203. package/dist/components/cat-tab.js +3 -12
  204. package/dist/components/cat-tab.js.map +1 -1
  205. package/dist/components/cat-tabs.js +1 -6
  206. package/dist/components/cat-tabs.js.map +1 -1
  207. package/dist/components/cat-textarea.js +28 -33
  208. package/dist/components/cat-textarea.js.map +1 -1
  209. package/dist/components/cat-toggle.js +9 -23
  210. package/dist/components/cat-toggle.js.map +1 -1
  211. package/dist/components/cat-tooltip.js +14 -34
  212. package/dist/components/cat-tooltip.js.map +1 -1
  213. package/dist/components/first-tabbable.js +51 -113
  214. package/dist/components/first-tabbable.js.map +1 -1
  215. package/dist/components/floating-ui.dom.esm.js +577 -441
  216. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  217. package/dist/components/index.d.ts +9 -27
  218. package/dist/components/index.js +2 -26
  219. package/dist/components/index.js.map +1 -1
  220. package/dist/esm/cat-alert_24.entry.js +933 -1133
  221. package/dist/esm/cat-alert_24.entry.js.map +1 -1
  222. package/dist/esm/catalyst.js +7 -3
  223. package/dist/esm/catalyst.js.map +1 -1
  224. package/dist/esm/{index-524906f7.js → index-fc2f91a4.js} +527 -246
  225. package/dist/esm/index-fc2f91a4.js.map +1 -0
  226. package/dist/esm/index.js.map +1 -1
  227. package/dist/esm/loader.js +4 -3
  228. package/dist/esm/loader.js.map +1 -1
  229. package/dist/esm/polyfills/css-shim.js +1 -1
  230. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
  231. package/dist/types/components/cat-form-group/cat-form-group.d.ts +4 -0
  232. package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +5 -0
  233. package/dist/types/components/cat-input/cat-input.d.ts +6 -1
  234. package/dist/types/components/cat-input/input-type.d.ts +1 -1
  235. package/dist/types/components/cat-radio/cat-radio.d.ts +1 -1
  236. package/dist/types/components/cat-select/cat-select.d.ts +3 -1
  237. package/dist/types/components/cat-textarea/cat-textarea.d.ts +6 -1
  238. package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
  239. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +3 -0
  240. package/dist/types/components.d.ts +353 -7
  241. package/dist/types/stencil-public-runtime.d.ts +91 -19
  242. package/dist/types/utils/breakpoints.d.ts +1 -1
  243. package/dist/types/utils/coerce.d.ts +3 -0
  244. package/dist/types/utils/first-tabbable.d.ts +2 -2
  245. package/loader/index.d.ts +9 -0
  246. package/loader/package.json +1 -0
  247. package/package.json +19 -19
  248. package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  249. package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
  250. package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  251. package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
  252. package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
  253. package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  254. package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
  255. package/dist/catalyst/p-919eea27.js +0 -3
  256. package/dist/catalyst/p-919eea27.js.map +0 -1
  257. package/dist/catalyst/p-cd8f8639.entry.js +0 -10
  258. package/dist/catalyst/p-cd8f8639.entry.js.map +0 -1
  259. package/dist/catalyst/scss/fonts/_fonts.mixins.azeret.scss +0 -14
  260. package/dist/catalyst/scss/fonts/_fonts.mixins.dm.scss +0 -53
  261. package/dist/cjs/index-c4542095.js.map +0 -1
  262. package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  263. package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
  264. package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  265. package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
  266. package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
  267. package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  268. package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
  269. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js +0 -13
  270. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js.map +0 -1
  271. package/dist/collection/scss/fonts/_fonts.mixins.azeret.scss +0 -14
  272. package/dist/collection/scss/fonts/_fonts.mixins.dm.scss +0 -53
  273. package/dist/components/cat-form-hint-utils.js +0 -17
  274. package/dist/components/cat-form-hint-utils.js.map +0 -1
  275. package/dist/esm/index-524906f7.js.map +0 -1
  276. package/dist/types/components/cat-form-hint/cat-form-hint-utils.d.ts +0 -4
@@ -1,4 +1,4 @@
1
- import { Component, Element, Event, h, Host, Method, Prop, State } from '@stencil/core';
1
+ import { h, Host } from '@stencil/core';
2
2
  import log from 'loglevel';
3
3
  import { CatFormHint } from '../cat-form-hint/cat-form-hint';
4
4
  let nextUniqueId = 0;
@@ -14,36 +14,25 @@ export class CatRadio {
14
14
  constructor() {
15
15
  this._id = `cat-radio-${++nextUniqueId}`;
16
16
  this.hasSlottedLabel = false;
17
- /**
18
- * Whether this radio is checked.
19
- */
17
+ this.hasSlottedHint = false;
20
18
  this.checked = false;
21
- /**
22
- * Whether this radio is disabled.
23
- */
24
19
  this.disabled = false;
25
- /**
26
- * The label of the radio that is visible.
27
- */
20
+ this.identifier = undefined;
28
21
  this.label = '';
29
- /**
30
- * Visually hide the label, but still show it to assistive technologies like screen readers.
31
- */
32
22
  this.labelHidden = false;
33
- /**
34
- * Whether the radio is required.
35
- */
23
+ this.name = undefined;
36
24
  this.required = false;
37
- /**
38
- * Whether the label should appear to the left of the radio component.
39
- */
25
+ this.value = undefined;
26
+ this.hint = undefined;
40
27
  this.labelLeft = false;
28
+ this.nativeAttributes = undefined;
41
29
  }
42
30
  get id() {
43
31
  return this.identifier || this._id;
44
32
  }
45
33
  componentWillRender() {
46
34
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
35
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
47
36
  if (!this.label && !this.hasSlottedLabel) {
48
37
  log.warn('[A11y] Missing ARIA label on radio', this);
49
38
  }
@@ -72,17 +61,7 @@ export class CatRadio {
72
61
  this.input.click();
73
62
  }
74
63
  render() {
75
- return (h(Host, null,
76
- h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' },
77
- h("span", { class: "radio" },
78
- h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onChange.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })),
79
- h("span", { class: "circle" })),
80
- h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)),
81
- this.hintSection));
82
- }
83
- get hintSection() {
84
- const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
85
- return ((this.hint || hasSlottedHint) && (h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && h("slot", { name: "hint" }) })));
64
+ return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { class: "radio" }, h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onChange.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })), h("span", { class: "circle" })), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) }))));
86
65
  }
87
66
  onChange(event) {
88
67
  this.checked = true;
@@ -96,324 +75,337 @@ export class CatRadio {
96
75
  }
97
76
  static get is() { return "cat-radio"; }
98
77
  static get encapsulation() { return "shadow"; }
99
- static get originalStyleUrls() { return {
100
- "$": ["cat-radio.scss"]
101
- }; }
102
- static get styleUrls() { return {
103
- "$": ["cat-radio.css"]
104
- }; }
105
- static get properties() { return {
106
- "checked": {
107
- "type": "boolean",
108
- "mutable": true,
109
- "complexType": {
110
- "original": "boolean",
111
- "resolved": "boolean",
112
- "references": {}
113
- },
114
- "required": false,
115
- "optional": false,
116
- "docs": {
117
- "tags": [],
118
- "text": "Whether this radio is checked."
119
- },
120
- "attribute": "checked",
121
- "reflect": false,
122
- "defaultValue": "false"
123
- },
124
- "disabled": {
125
- "type": "boolean",
126
- "mutable": false,
127
- "complexType": {
128
- "original": "boolean",
129
- "resolved": "boolean",
130
- "references": {}
131
- },
132
- "required": false,
133
- "optional": false,
134
- "docs": {
135
- "tags": [],
136
- "text": "Whether this radio is disabled."
137
- },
138
- "attribute": "disabled",
139
- "reflect": false,
140
- "defaultValue": "false"
141
- },
142
- "identifier": {
143
- "type": "string",
144
- "mutable": false,
145
- "complexType": {
146
- "original": "string",
147
- "resolved": "string | undefined",
148
- "references": {}
149
- },
150
- "required": false,
151
- "optional": true,
152
- "docs": {
153
- "tags": [],
154
- "text": "A unique identifier for the input."
155
- },
156
- "attribute": "identifier",
157
- "reflect": false
158
- },
159
- "label": {
160
- "type": "string",
161
- "mutable": false,
162
- "complexType": {
163
- "original": "string",
164
- "resolved": "string",
165
- "references": {}
166
- },
167
- "required": false,
168
- "optional": false,
169
- "docs": {
170
- "tags": [],
171
- "text": "The label of the radio that is visible."
172
- },
173
- "attribute": "label",
174
- "reflect": false,
175
- "defaultValue": "''"
176
- },
177
- "labelHidden": {
178
- "type": "boolean",
179
- "mutable": false,
180
- "complexType": {
181
- "original": "boolean",
182
- "resolved": "boolean",
183
- "references": {}
184
- },
185
- "required": false,
186
- "optional": false,
187
- "docs": {
188
- "tags": [],
189
- "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
190
- },
191
- "attribute": "label-hidden",
192
- "reflect": false,
193
- "defaultValue": "false"
194
- },
195
- "name": {
196
- "type": "string",
197
- "mutable": false,
198
- "complexType": {
199
- "original": "string",
200
- "resolved": "string | undefined",
201
- "references": {}
202
- },
203
- "required": false,
204
- "optional": true,
205
- "docs": {
206
- "tags": [],
207
- "text": "The name of the radio component."
208
- },
209
- "attribute": "name",
210
- "reflect": false
211
- },
212
- "required": {
213
- "type": "boolean",
214
- "mutable": false,
215
- "complexType": {
216
- "original": "boolean",
217
- "resolved": "boolean",
218
- "references": {}
78
+ static get originalStyleUrls() {
79
+ return {
80
+ "$": ["cat-radio.scss"]
81
+ };
82
+ }
83
+ static get styleUrls() {
84
+ return {
85
+ "$": ["cat-radio.css"]
86
+ };
87
+ }
88
+ static get properties() {
89
+ return {
90
+ "checked": {
91
+ "type": "boolean",
92
+ "mutable": true,
93
+ "complexType": {
94
+ "original": "boolean",
95
+ "resolved": "boolean",
96
+ "references": {}
97
+ },
98
+ "required": false,
99
+ "optional": false,
100
+ "docs": {
101
+ "tags": [],
102
+ "text": "Whether this radio is checked."
103
+ },
104
+ "attribute": "checked",
105
+ "reflect": false,
106
+ "defaultValue": "false"
219
107
  },
220
- "required": false,
221
- "optional": false,
222
- "docs": {
223
- "tags": [],
224
- "text": "Whether the radio is required."
108
+ "disabled": {
109
+ "type": "boolean",
110
+ "mutable": false,
111
+ "complexType": {
112
+ "original": "boolean",
113
+ "resolved": "boolean",
114
+ "references": {}
115
+ },
116
+ "required": false,
117
+ "optional": false,
118
+ "docs": {
119
+ "tags": [],
120
+ "text": "Whether this radio is disabled."
121
+ },
122
+ "attribute": "disabled",
123
+ "reflect": false,
124
+ "defaultValue": "false"
225
125
  },
226
- "attribute": "required",
227
- "reflect": false,
228
- "defaultValue": "false"
229
- },
230
- "value": {
231
- "type": "string",
232
- "mutable": false,
233
- "complexType": {
234
- "original": "string",
235
- "resolved": "string | undefined",
236
- "references": {}
126
+ "identifier": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string | undefined",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": true,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "A unique identifier for the input."
139
+ },
140
+ "attribute": "identifier",
141
+ "reflect": false
237
142
  },
238
- "required": false,
239
- "optional": true,
240
- "docs": {
241
- "tags": [],
242
- "text": "The value of the radio component."
143
+ "label": {
144
+ "type": "string",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "string",
148
+ "resolved": "string",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": "The label of the radio that is visible."
156
+ },
157
+ "attribute": "label",
158
+ "reflect": false,
159
+ "defaultValue": "''"
243
160
  },
244
- "attribute": "value",
245
- "reflect": false
246
- },
247
- "hint": {
248
- "type": "string",
249
- "mutable": false,
250
- "complexType": {
251
- "original": "string | string[]",
252
- "resolved": "string | string[] | undefined",
253
- "references": {}
161
+ "labelHidden": {
162
+ "type": "boolean",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "boolean",
166
+ "resolved": "boolean",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
174
+ },
175
+ "attribute": "label-hidden",
176
+ "reflect": false,
177
+ "defaultValue": "false"
254
178
  },
255
- "required": false,
256
- "optional": true,
257
- "docs": {
258
- "tags": [],
259
- "text": "Optional hint text(s) to be displayed with the radio."
179
+ "name": {
180
+ "type": "string",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "string",
184
+ "resolved": "string | undefined",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": true,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": "The name of the radio component."
192
+ },
193
+ "attribute": "name",
194
+ "reflect": false
260
195
  },
261
- "attribute": "hint",
262
- "reflect": false
263
- },
264
- "labelLeft": {
265
- "type": "boolean",
266
- "mutable": false,
267
- "complexType": {
268
- "original": "boolean",
269
- "resolved": "boolean",
270
- "references": {}
196
+ "required": {
197
+ "type": "boolean",
198
+ "mutable": false,
199
+ "complexType": {
200
+ "original": "boolean",
201
+ "resolved": "boolean",
202
+ "references": {}
203
+ },
204
+ "required": false,
205
+ "optional": false,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": "Whether the radio is required."
209
+ },
210
+ "attribute": "required",
211
+ "reflect": false,
212
+ "defaultValue": "false"
271
213
  },
272
- "required": false,
273
- "optional": false,
274
- "docs": {
275
- "tags": [],
276
- "text": "Whether the label should appear to the left of the radio component."
214
+ "value": {
215
+ "type": "string",
216
+ "mutable": false,
217
+ "complexType": {
218
+ "original": "string",
219
+ "resolved": "string | undefined",
220
+ "references": {}
221
+ },
222
+ "required": false,
223
+ "optional": true,
224
+ "docs": {
225
+ "tags": [],
226
+ "text": "The value of the radio component."
227
+ },
228
+ "attribute": "value",
229
+ "reflect": false
277
230
  },
278
- "attribute": "label-left",
279
- "reflect": false,
280
- "defaultValue": "false"
281
- },
282
- "nativeAttributes": {
283
- "type": "unknown",
284
- "mutable": false,
285
- "complexType": {
286
- "original": "{ [key: string]: string }",
287
- "resolved": "undefined | { [key: string]: string; }",
288
- "references": {}
231
+ "hint": {
232
+ "type": "string",
233
+ "mutable": false,
234
+ "complexType": {
235
+ "original": "string | string[]",
236
+ "resolved": "string | string[] | undefined",
237
+ "references": {}
238
+ },
239
+ "required": false,
240
+ "optional": true,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": "Optional hint text(s) to be displayed with the radio."
244
+ },
245
+ "attribute": "hint",
246
+ "reflect": false
289
247
  },
290
- "required": false,
291
- "optional": true,
292
- "docs": {
293
- "tags": [],
294
- "text": "Attributes that will be added to the native HTML input element."
295
- }
296
- }
297
- }; }
298
- static get states() { return {
299
- "hasSlottedLabel": {}
300
- }; }
301
- static get events() { return [{
302
- "method": "catChange",
303
- "name": "catChange",
304
- "bubbles": true,
305
- "cancelable": true,
306
- "composed": true,
307
- "docs": {
308
- "tags": [],
309
- "text": "Emitted when the radio is changed."
248
+ "labelLeft": {
249
+ "type": "boolean",
250
+ "mutable": false,
251
+ "complexType": {
252
+ "original": "boolean",
253
+ "resolved": "boolean",
254
+ "references": {}
255
+ },
256
+ "required": false,
257
+ "optional": false,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Whether the label should appear to the left of the radio component."
261
+ },
262
+ "attribute": "label-left",
263
+ "reflect": false,
264
+ "defaultValue": "false"
310
265
  },
311
- "complexType": {
312
- "original": "any",
313
- "resolved": "any",
314
- "references": {}
266
+ "nativeAttributes": {
267
+ "type": "unknown",
268
+ "mutable": false,
269
+ "complexType": {
270
+ "original": "{ [key: string]: string }",
271
+ "resolved": "undefined | { [key: string]: string; }",
272
+ "references": {}
273
+ },
274
+ "required": false,
275
+ "optional": true,
276
+ "docs": {
277
+ "tags": [],
278
+ "text": "Attributes that will be added to the native HTML input element."
279
+ }
315
280
  }
316
- }, {
317
- "method": "catFocus",
318
- "name": "catFocus",
319
- "bubbles": true,
320
- "cancelable": true,
321
- "composed": true,
322
- "docs": {
323
- "tags": [],
324
- "text": "Emitted when the radio received focus."
325
- },
326
- "complexType": {
327
- "original": "FocusEvent",
328
- "resolved": "FocusEvent",
329
- "references": {
330
- "FocusEvent": {
331
- "location": "global"
281
+ };
282
+ }
283
+ static get states() {
284
+ return {
285
+ "hasSlottedLabel": {},
286
+ "hasSlottedHint": {}
287
+ };
288
+ }
289
+ static get events() {
290
+ return [{
291
+ "method": "catChange",
292
+ "name": "catChange",
293
+ "bubbles": true,
294
+ "cancelable": true,
295
+ "composed": true,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": "Emitted when the radio is changed."
299
+ },
300
+ "complexType": {
301
+ "original": "any",
302
+ "resolved": "any",
303
+ "references": {}
304
+ }
305
+ }, {
306
+ "method": "catFocus",
307
+ "name": "catFocus",
308
+ "bubbles": true,
309
+ "cancelable": true,
310
+ "composed": true,
311
+ "docs": {
312
+ "tags": [],
313
+ "text": "Emitted when the radio received focus."
314
+ },
315
+ "complexType": {
316
+ "original": "FocusEvent",
317
+ "resolved": "FocusEvent",
318
+ "references": {
319
+ "FocusEvent": {
320
+ "location": "global"
321
+ }
332
322
  }
333
323
  }
334
- }
335
- }, {
336
- "method": "catBlur",
337
- "name": "catBlur",
338
- "bubbles": true,
339
- "cancelable": true,
340
- "composed": true,
341
- "docs": {
342
- "tags": [],
343
- "text": "Emitted when the radio loses focus."
344
- },
345
- "complexType": {
346
- "original": "FocusEvent",
347
- "resolved": "FocusEvent",
348
- "references": {
349
- "FocusEvent": {
350
- "location": "global"
324
+ }, {
325
+ "method": "catBlur",
326
+ "name": "catBlur",
327
+ "bubbles": true,
328
+ "cancelable": true,
329
+ "composed": true,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": "Emitted when the radio loses focus."
333
+ },
334
+ "complexType": {
335
+ "original": "FocusEvent",
336
+ "resolved": "FocusEvent",
337
+ "references": {
338
+ "FocusEvent": {
339
+ "location": "global"
340
+ }
351
341
  }
352
342
  }
353
- }
354
- }]; }
355
- static get methods() { return {
356
- "doFocus": {
357
- "complexType": {
358
- "signature": "(options?: FocusOptions | undefined) => Promise<void>",
359
- "parameters": [{
360
- "tags": [{
361
- "name": "param",
362
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
363
- }],
364
- "text": "An optional object providing options to control aspects of\nthe focusing process."
365
- }],
366
- "references": {
367
- "Promise": {
368
- "location": "global"
343
+ }];
344
+ }
345
+ static get methods() {
346
+ return {
347
+ "doFocus": {
348
+ "complexType": {
349
+ "signature": "(options?: FocusOptions) => Promise<void>",
350
+ "parameters": [{
351
+ "tags": [{
352
+ "name": "param",
353
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
354
+ }],
355
+ "text": "An optional object providing options to control aspects of\nthe focusing process."
356
+ }],
357
+ "references": {
358
+ "Promise": {
359
+ "location": "global"
360
+ },
361
+ "FocusOptions": {
362
+ "location": "global"
363
+ }
369
364
  },
370
- "FocusOptions": {
371
- "location": "global"
372
- }
365
+ "return": "Promise<void>"
373
366
  },
374
- "return": "Promise<void>"
367
+ "docs": {
368
+ "text": "Programmatically move focus to the radio button. Use this method instead of\n`input.focus()`.",
369
+ "tags": [{
370
+ "name": "param",
371
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
372
+ }]
373
+ }
375
374
  },
376
- "docs": {
377
- "text": "Programmatically move focus to the radio button. Use this method instead of\n`input.focus()`.",
378
- "tags": [{
379
- "name": "param",
380
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
381
- }]
382
- }
383
- },
384
- "doBlur": {
385
- "complexType": {
386
- "signature": "() => Promise<void>",
387
- "parameters": [],
388
- "references": {
389
- "Promise": {
390
- "location": "global"
391
- }
375
+ "doBlur": {
376
+ "complexType": {
377
+ "signature": "() => Promise<void>",
378
+ "parameters": [],
379
+ "references": {
380
+ "Promise": {
381
+ "location": "global"
382
+ }
383
+ },
384
+ "return": "Promise<void>"
392
385
  },
393
- "return": "Promise<void>"
386
+ "docs": {
387
+ "text": "Programmatically remove focus from the radio button. Use this method\ninstead of `input.blur()`.",
388
+ "tags": []
389
+ }
394
390
  },
395
- "docs": {
396
- "text": "Programmatically remove focus from the radio button. Use this method\ninstead of `input.blur()`.",
397
- "tags": []
398
- }
399
- },
400
- "doClick": {
401
- "complexType": {
402
- "signature": "() => Promise<void>",
403
- "parameters": [],
404
- "references": {
405
- "Promise": {
406
- "location": "global"
407
- }
391
+ "doClick": {
392
+ "complexType": {
393
+ "signature": "() => Promise<void>",
394
+ "parameters": [],
395
+ "references": {
396
+ "Promise": {
397
+ "location": "global"
398
+ }
399
+ },
400
+ "return": "Promise<void>"
408
401
  },
409
- "return": "Promise<void>"
410
- },
411
- "docs": {
412
- "text": "Programmatically simulate a click on the radio button.",
413
- "tags": []
402
+ "docs": {
403
+ "text": "Programmatically simulate a click on the radio button.",
404
+ "tags": []
405
+ }
414
406
  }
415
- }
416
- }; }
407
+ };
408
+ }
417
409
  static get elementRef() { return "hostElement"; }
418
410
  }
419
- //# sourceMappingURL=cat-radio.js.map
411
+ //# sourceMappingURL=cat-radio.js.map