@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;
@@ -15,36 +15,25 @@ export class CatToggle {
15
15
  constructor() {
16
16
  this._id = `cat-toggle-${nextUniqueId++}`;
17
17
  this.hasSlottedLabel = false;
18
- /**
19
- * Checked state of the toggle.
20
- */
18
+ this.hasSlottedHint = false;
21
19
  this.checked = false;
22
- /**
23
- * Disabled state of the toggle.
24
- */
25
20
  this.disabled = false;
26
- /**
27
- * The label of the toggle that is visible.
28
- */
21
+ this.identifier = undefined;
29
22
  this.label = '';
30
- /**
31
- * Visually hide the label, but still show it to assistive technologies like screen readers.
32
- */
33
23
  this.labelHidden = false;
34
- /**
35
- * Required state of the toggle.
36
- */
24
+ this.name = undefined;
37
25
  this.required = false;
38
- /**
39
- * Whether the label should appear to the left of the toggle.
40
- */
26
+ this.value = undefined;
27
+ this.hint = undefined;
41
28
  this.labelLeft = false;
29
+ this.nativeAttributes = undefined;
42
30
  }
43
31
  get id() {
44
32
  return this.identifier || this._id;
45
33
  }
46
34
  componentWillRender() {
47
35
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
36
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
48
37
  if (!this.label && !this.hasSlottedLabel) {
49
38
  log.warn('[A11y] Missing ARIA label on toggle', this);
50
39
  }
@@ -73,16 +62,7 @@ export class CatToggle {
73
62
  this.input.click();
74
63
  }
75
64
  render() {
76
- return (h(Host, null,
77
- h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } },
78
- h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })),
79
- h("span", { class: "toggle", part: "toggle" }),
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" }) })));
65
+ return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })), h("span", { class: "toggle", part: "toggle" }), 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
66
  }
87
67
  onInput(event) {
88
68
  this.checked = this.input.checked;
@@ -99,324 +79,337 @@ export class CatToggle {
99
79
  }
100
80
  static get is() { return "cat-toggle"; }
101
81
  static get encapsulation() { return "shadow"; }
102
- static get originalStyleUrls() { return {
103
- "$": ["cat-toggle.scss"]
104
- }; }
105
- static get styleUrls() { return {
106
- "$": ["cat-toggle.css"]
107
- }; }
108
- static get properties() { return {
109
- "checked": {
110
- "type": "boolean",
111
- "mutable": true,
112
- "complexType": {
113
- "original": "boolean",
114
- "resolved": "boolean",
115
- "references": {}
116
- },
117
- "required": false,
118
- "optional": false,
119
- "docs": {
120
- "tags": [],
121
- "text": "Checked state of the toggle."
122
- },
123
- "attribute": "checked",
124
- "reflect": false,
125
- "defaultValue": "false"
126
- },
127
- "disabled": {
128
- "type": "boolean",
129
- "mutable": false,
130
- "complexType": {
131
- "original": "boolean",
132
- "resolved": "boolean",
133
- "references": {}
134
- },
135
- "required": false,
136
- "optional": false,
137
- "docs": {
138
- "tags": [],
139
- "text": "Disabled state of the toggle."
140
- },
141
- "attribute": "disabled",
142
- "reflect": false,
143
- "defaultValue": "false"
144
- },
145
- "identifier": {
146
- "type": "string",
147
- "mutable": false,
148
- "complexType": {
149
- "original": "string",
150
- "resolved": "string | undefined",
151
- "references": {}
152
- },
153
- "required": false,
154
- "optional": true,
155
- "docs": {
156
- "tags": [],
157
- "text": "A unique identifier for the input."
158
- },
159
- "attribute": "identifier",
160
- "reflect": false
161
- },
162
- "label": {
163
- "type": "string",
164
- "mutable": false,
165
- "complexType": {
166
- "original": "string",
167
- "resolved": "string",
168
- "references": {}
169
- },
170
- "required": false,
171
- "optional": false,
172
- "docs": {
173
- "tags": [],
174
- "text": "The label of the toggle that is visible."
175
- },
176
- "attribute": "label",
177
- "reflect": false,
178
- "defaultValue": "''"
179
- },
180
- "labelHidden": {
181
- "type": "boolean",
182
- "mutable": false,
183
- "complexType": {
184
- "original": "boolean",
185
- "resolved": "boolean",
186
- "references": {}
187
- },
188
- "required": false,
189
- "optional": false,
190
- "docs": {
191
- "tags": [],
192
- "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
193
- },
194
- "attribute": "label-hidden",
195
- "reflect": false,
196
- "defaultValue": "false"
197
- },
198
- "name": {
199
- "type": "string",
200
- "mutable": false,
201
- "complexType": {
202
- "original": "string",
203
- "resolved": "string | undefined",
204
- "references": {}
205
- },
206
- "required": false,
207
- "optional": true,
208
- "docs": {
209
- "tags": [],
210
- "text": "The name of the input"
211
- },
212
- "attribute": "name",
213
- "reflect": false
214
- },
215
- "required": {
216
- "type": "boolean",
217
- "mutable": false,
218
- "complexType": {
219
- "original": "boolean",
220
- "resolved": "boolean",
221
- "references": {}
82
+ static get originalStyleUrls() {
83
+ return {
84
+ "$": ["cat-toggle.scss"]
85
+ };
86
+ }
87
+ static get styleUrls() {
88
+ return {
89
+ "$": ["cat-toggle.css"]
90
+ };
91
+ }
92
+ static get properties() {
93
+ return {
94
+ "checked": {
95
+ "type": "boolean",
96
+ "mutable": true,
97
+ "complexType": {
98
+ "original": "boolean",
99
+ "resolved": "boolean",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": "Checked state of the toggle."
107
+ },
108
+ "attribute": "checked",
109
+ "reflect": false,
110
+ "defaultValue": "false"
222
111
  },
223
- "required": false,
224
- "optional": false,
225
- "docs": {
226
- "tags": [],
227
- "text": "Required state of the toggle."
112
+ "disabled": {
113
+ "type": "boolean",
114
+ "mutable": false,
115
+ "complexType": {
116
+ "original": "boolean",
117
+ "resolved": "boolean",
118
+ "references": {}
119
+ },
120
+ "required": false,
121
+ "optional": false,
122
+ "docs": {
123
+ "tags": [],
124
+ "text": "Disabled state of the toggle."
125
+ },
126
+ "attribute": "disabled",
127
+ "reflect": false,
128
+ "defaultValue": "false"
228
129
  },
229
- "attribute": "required",
230
- "reflect": false,
231
- "defaultValue": "false"
232
- },
233
- "value": {
234
- "type": "any",
235
- "mutable": true,
236
- "complexType": {
237
- "original": "string | boolean",
238
- "resolved": "boolean | string | undefined",
239
- "references": {}
130
+ "identifier": {
131
+ "type": "string",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "string",
135
+ "resolved": "string | undefined",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": true,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": "A unique identifier for the input."
143
+ },
144
+ "attribute": "identifier",
145
+ "reflect": false
240
146
  },
241
- "required": false,
242
- "optional": true,
243
- "docs": {
244
- "tags": [],
245
- "text": "The value of the toggle"
147
+ "label": {
148
+ "type": "string",
149
+ "mutable": false,
150
+ "complexType": {
151
+ "original": "string",
152
+ "resolved": "string",
153
+ "references": {}
154
+ },
155
+ "required": false,
156
+ "optional": false,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": "The label of the toggle that is visible."
160
+ },
161
+ "attribute": "label",
162
+ "reflect": false,
163
+ "defaultValue": "''"
246
164
  },
247
- "attribute": "value",
248
- "reflect": false
249
- },
250
- "hint": {
251
- "type": "string",
252
- "mutable": false,
253
- "complexType": {
254
- "original": "string | string[]",
255
- "resolved": "string | string[] | undefined",
256
- "references": {}
165
+ "labelHidden": {
166
+ "type": "boolean",
167
+ "mutable": false,
168
+ "complexType": {
169
+ "original": "boolean",
170
+ "resolved": "boolean",
171
+ "references": {}
172
+ },
173
+ "required": false,
174
+ "optional": false,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
178
+ },
179
+ "attribute": "label-hidden",
180
+ "reflect": false,
181
+ "defaultValue": "false"
257
182
  },
258
- "required": false,
259
- "optional": true,
260
- "docs": {
261
- "tags": [],
262
- "text": "Optional hint text(s) to be displayed with the toggle."
183
+ "name": {
184
+ "type": "string",
185
+ "mutable": false,
186
+ "complexType": {
187
+ "original": "string",
188
+ "resolved": "string | undefined",
189
+ "references": {}
190
+ },
191
+ "required": false,
192
+ "optional": true,
193
+ "docs": {
194
+ "tags": [],
195
+ "text": "The name of the input"
196
+ },
197
+ "attribute": "name",
198
+ "reflect": false
263
199
  },
264
- "attribute": "hint",
265
- "reflect": false
266
- },
267
- "labelLeft": {
268
- "type": "boolean",
269
- "mutable": false,
270
- "complexType": {
271
- "original": "boolean",
272
- "resolved": "boolean",
273
- "references": {}
200
+ "required": {
201
+ "type": "boolean",
202
+ "mutable": false,
203
+ "complexType": {
204
+ "original": "boolean",
205
+ "resolved": "boolean",
206
+ "references": {}
207
+ },
208
+ "required": false,
209
+ "optional": false,
210
+ "docs": {
211
+ "tags": [],
212
+ "text": "Required state of the toggle."
213
+ },
214
+ "attribute": "required",
215
+ "reflect": false,
216
+ "defaultValue": "false"
274
217
  },
275
- "required": false,
276
- "optional": false,
277
- "docs": {
278
- "tags": [],
279
- "text": "Whether the label should appear to the left of the toggle."
218
+ "value": {
219
+ "type": "any",
220
+ "mutable": true,
221
+ "complexType": {
222
+ "original": "string | boolean",
223
+ "resolved": "boolean | string | undefined",
224
+ "references": {}
225
+ },
226
+ "required": false,
227
+ "optional": true,
228
+ "docs": {
229
+ "tags": [],
230
+ "text": "The value of the toggle"
231
+ },
232
+ "attribute": "value",
233
+ "reflect": false
280
234
  },
281
- "attribute": "label-left",
282
- "reflect": false,
283
- "defaultValue": "false"
284
- },
285
- "nativeAttributes": {
286
- "type": "unknown",
287
- "mutable": false,
288
- "complexType": {
289
- "original": "{ [key: string]: string }",
290
- "resolved": "undefined | { [key: string]: string; }",
291
- "references": {}
235
+ "hint": {
236
+ "type": "string",
237
+ "mutable": false,
238
+ "complexType": {
239
+ "original": "string | string[]",
240
+ "resolved": "string | string[] | undefined",
241
+ "references": {}
242
+ },
243
+ "required": false,
244
+ "optional": true,
245
+ "docs": {
246
+ "tags": [],
247
+ "text": "Optional hint text(s) to be displayed with the toggle."
248
+ },
249
+ "attribute": "hint",
250
+ "reflect": false
292
251
  },
293
- "required": false,
294
- "optional": true,
295
- "docs": {
296
- "tags": [],
297
- "text": "Attributes that will be added to the native HTML input element."
298
- }
299
- }
300
- }; }
301
- static get states() { return {
302
- "hasSlottedLabel": {}
303
- }; }
304
- static get events() { return [{
305
- "method": "catChange",
306
- "name": "catChange",
307
- "bubbles": true,
308
- "cancelable": true,
309
- "composed": true,
310
- "docs": {
311
- "tags": [],
312
- "text": "Emitted when the checked status of the toggle is changed."
252
+ "labelLeft": {
253
+ "type": "boolean",
254
+ "mutable": false,
255
+ "complexType": {
256
+ "original": "boolean",
257
+ "resolved": "boolean",
258
+ "references": {}
259
+ },
260
+ "required": false,
261
+ "optional": false,
262
+ "docs": {
263
+ "tags": [],
264
+ "text": "Whether the label should appear to the left of the toggle."
265
+ },
266
+ "attribute": "label-left",
267
+ "reflect": false,
268
+ "defaultValue": "false"
313
269
  },
314
- "complexType": {
315
- "original": "any",
316
- "resolved": "any",
317
- "references": {}
270
+ "nativeAttributes": {
271
+ "type": "unknown",
272
+ "mutable": false,
273
+ "complexType": {
274
+ "original": "{ [key: string]: string }",
275
+ "resolved": "undefined | { [key: string]: string; }",
276
+ "references": {}
277
+ },
278
+ "required": false,
279
+ "optional": true,
280
+ "docs": {
281
+ "tags": [],
282
+ "text": "Attributes that will be added to the native HTML input element."
283
+ }
318
284
  }
319
- }, {
320
- "method": "catFocus",
321
- "name": "catFocus",
322
- "bubbles": true,
323
- "cancelable": true,
324
- "composed": true,
325
- "docs": {
326
- "tags": [],
327
- "text": "Emitted when the toggle received focus."
328
- },
329
- "complexType": {
330
- "original": "FocusEvent",
331
- "resolved": "FocusEvent",
332
- "references": {
333
- "FocusEvent": {
334
- "location": "global"
285
+ };
286
+ }
287
+ static get states() {
288
+ return {
289
+ "hasSlottedLabel": {},
290
+ "hasSlottedHint": {}
291
+ };
292
+ }
293
+ static get events() {
294
+ return [{
295
+ "method": "catChange",
296
+ "name": "catChange",
297
+ "bubbles": true,
298
+ "cancelable": true,
299
+ "composed": true,
300
+ "docs": {
301
+ "tags": [],
302
+ "text": "Emitted when the checked status of the toggle is changed."
303
+ },
304
+ "complexType": {
305
+ "original": "any",
306
+ "resolved": "any",
307
+ "references": {}
308
+ }
309
+ }, {
310
+ "method": "catFocus",
311
+ "name": "catFocus",
312
+ "bubbles": true,
313
+ "cancelable": true,
314
+ "composed": true,
315
+ "docs": {
316
+ "tags": [],
317
+ "text": "Emitted when the toggle received focus."
318
+ },
319
+ "complexType": {
320
+ "original": "FocusEvent",
321
+ "resolved": "FocusEvent",
322
+ "references": {
323
+ "FocusEvent": {
324
+ "location": "global"
325
+ }
335
326
  }
336
327
  }
337
- }
338
- }, {
339
- "method": "catBlur",
340
- "name": "catBlur",
341
- "bubbles": true,
342
- "cancelable": true,
343
- "composed": true,
344
- "docs": {
345
- "tags": [],
346
- "text": "Emitted when the toggle loses focus."
347
- },
348
- "complexType": {
349
- "original": "FocusEvent",
350
- "resolved": "FocusEvent",
351
- "references": {
352
- "FocusEvent": {
353
- "location": "global"
328
+ }, {
329
+ "method": "catBlur",
330
+ "name": "catBlur",
331
+ "bubbles": true,
332
+ "cancelable": true,
333
+ "composed": true,
334
+ "docs": {
335
+ "tags": [],
336
+ "text": "Emitted when the toggle loses focus."
337
+ },
338
+ "complexType": {
339
+ "original": "FocusEvent",
340
+ "resolved": "FocusEvent",
341
+ "references": {
342
+ "FocusEvent": {
343
+ "location": "global"
344
+ }
354
345
  }
355
346
  }
356
- }
357
- }]; }
358
- static get methods() { return {
359
- "doFocus": {
360
- "complexType": {
361
- "signature": "(options?: FocusOptions | undefined) => Promise<void>",
362
- "parameters": [{
363
- "tags": [{
364
- "name": "param",
365
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
366
- }],
367
- "text": "An optional object providing options to control aspects of\nthe focusing process."
368
- }],
369
- "references": {
370
- "Promise": {
371
- "location": "global"
347
+ }];
348
+ }
349
+ static get methods() {
350
+ return {
351
+ "doFocus": {
352
+ "complexType": {
353
+ "signature": "(options?: FocusOptions) => Promise<void>",
354
+ "parameters": [{
355
+ "tags": [{
356
+ "name": "param",
357
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
358
+ }],
359
+ "text": "An optional object providing options to control aspects of\nthe focusing process."
360
+ }],
361
+ "references": {
362
+ "Promise": {
363
+ "location": "global"
364
+ },
365
+ "FocusOptions": {
366
+ "location": "global"
367
+ }
372
368
  },
373
- "FocusOptions": {
374
- "location": "global"
375
- }
369
+ "return": "Promise<void>"
376
370
  },
377
- "return": "Promise<void>"
371
+ "docs": {
372
+ "text": "Programmatically move focus to the toggle. Use this method instead of\n`input.focus()`.",
373
+ "tags": [{
374
+ "name": "param",
375
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
376
+ }]
377
+ }
378
378
  },
379
- "docs": {
380
- "text": "Programmatically move focus to the toggle. Use this method instead of\n`input.focus()`.",
381
- "tags": [{
382
- "name": "param",
383
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
384
- }]
385
- }
386
- },
387
- "doBlur": {
388
- "complexType": {
389
- "signature": "() => Promise<void>",
390
- "parameters": [],
391
- "references": {
392
- "Promise": {
393
- "location": "global"
394
- }
379
+ "doBlur": {
380
+ "complexType": {
381
+ "signature": "() => Promise<void>",
382
+ "parameters": [],
383
+ "references": {
384
+ "Promise": {
385
+ "location": "global"
386
+ }
387
+ },
388
+ "return": "Promise<void>"
395
389
  },
396
- "return": "Promise<void>"
390
+ "docs": {
391
+ "text": "Programmatically remove focus from the toggle. Use this method instead of\n`input.blur()`.",
392
+ "tags": []
393
+ }
397
394
  },
398
- "docs": {
399
- "text": "Programmatically remove focus from the toggle. Use this method instead of\n`input.blur()`.",
400
- "tags": []
401
- }
402
- },
403
- "doClick": {
404
- "complexType": {
405
- "signature": "() => Promise<void>",
406
- "parameters": [],
407
- "references": {
408
- "Promise": {
409
- "location": "global"
410
- }
395
+ "doClick": {
396
+ "complexType": {
397
+ "signature": "() => Promise<void>",
398
+ "parameters": [],
399
+ "references": {
400
+ "Promise": {
401
+ "location": "global"
402
+ }
403
+ },
404
+ "return": "Promise<void>"
411
405
  },
412
- "return": "Promise<void>"
413
- },
414
- "docs": {
415
- "text": "Programmatically simulate a click on the toggle.",
416
- "tags": []
406
+ "docs": {
407
+ "text": "Programmatically simulate a click on the toggle.",
408
+ "tags": []
409
+ }
417
410
  }
418
- }
419
- }; }
411
+ };
412
+ }
420
413
  static get elementRef() { return "hostElement"; }
421
414
  }
422
- //# sourceMappingURL=cat-toggle.js.map
415
+ //# sourceMappingURL=cat-toggle.js.map