@lmvz-ds/components 0.35.2 → 0.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/assets/icons/calendar.svg +7 -0
  3. package/cjs/{aria-validation-controller-BC0Eaiv4.js → aria-validation-controller-Do0uEK4t.js} +1 -1
  4. package/cjs/aria.constants-DPK5mQEL.js +65 -0
  5. package/cjs/{directional-focus-controller-DBat-oF7.js → directional-focus-controller-8Xd_7MHT.js} +3 -1
  6. package/cjs/{element-activation-controller-BHqCUgQv.js → element-activation-controller-DzTUocEO.js} +1 -1
  7. package/cjs/{element.util-CRS_YJ59.js → element.util-BlhcwmfR.js} +8 -54
  8. package/cjs/{index-TGsVZNDP.js → index-BgvZ4y-3.js} +12 -0
  9. package/cjs/lmvz-action-list.cjs.entry.js +5 -4
  10. package/cjs/lmvz-action.cjs.entry.js +1 -1
  11. package/cjs/lmvz-button-group.cjs.entry.js +3 -2
  12. package/cjs/lmvz-button_2.cjs.entry.js +6 -5
  13. package/cjs/lmvz-card.cjs.entry.js +1 -1
  14. package/cjs/lmvz-checkbox.cjs.entry.js +40 -6
  15. package/cjs/lmvz-chip.cjs.entry.js +2 -2
  16. package/cjs/lmvz-components.cjs.js +2 -2
  17. package/cjs/lmvz-datepicker.cjs.entry.js +2771 -0
  18. package/cjs/lmvz-header_2.cjs.entry.js +7 -6
  19. package/cjs/lmvz-input.cjs.entry.js +71 -15
  20. package/cjs/lmvz-link.cjs.entry.js +2 -2
  21. package/cjs/lmvz-menuitem.cjs.entry.js +6 -5
  22. package/cjs/lmvz-message.cjs.entry.js +2 -2
  23. package/cjs/lmvz-modal.cjs.entry.js +5 -4
  24. package/cjs/lmvz-popover.cjs.entry.js +25 -10
  25. package/cjs/lmvz-radio.cjs.entry.js +63 -5
  26. package/cjs/lmvz-select.cjs.entry.js +425 -18
  27. package/cjs/lmvz-snackbar.cjs.entry.js +2 -2
  28. package/cjs/lmvz-spinner.cjs.entry.js +2 -2
  29. package/cjs/lmvz-tab.cjs.entry.js +2 -2
  30. package/cjs/lmvz-tabs.cjs.entry.js +5 -4
  31. package/cjs/lmvz-toggle.cjs.entry.js +7 -4
  32. package/cjs/loader.cjs.js +2 -2
  33. package/collection/assets/icons/calendar.svg +7 -0
  34. package/collection/collection-manifest.json +1 -0
  35. package/collection/components/lmvz-checkbox/lmvz-checkbox.css +4 -2
  36. package/collection/components/lmvz-checkbox/lmvz-checkbox.js +68 -8
  37. package/collection/components/lmvz-datepicker/lmvz-datepicker.css +161 -0
  38. package/collection/components/lmvz-datepicker/lmvz-datepicker.js +1002 -0
  39. package/collection/components/lmvz-datepicker/lmvz-datepicker.utils.js +189 -0
  40. package/collection/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.js +300 -0
  41. package/collection/components/lmvz-header/lmvz-header.js +1 -1
  42. package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
  43. package/collection/components/lmvz-input/lmvz-input.css +1 -1
  44. package/collection/components/lmvz-input/lmvz-input.js +85 -12
  45. package/collection/components/lmvz-link/lmvz-link.js +1 -1
  46. package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
  47. package/collection/components/lmvz-message/lmvz-message.js +1 -1
  48. package/collection/components/lmvz-modal/lmvz-modal.js +1 -1
  49. package/collection/components/lmvz-popover/lmvz-popover.css +1 -1
  50. package/collection/components/lmvz-popover/lmvz-popover.js +50 -6
  51. package/collection/components/lmvz-radio/lmvz-radio.js +77 -9
  52. package/collection/components/lmvz-select/lmvz-select.css +96 -34
  53. package/collection/components/lmvz-select/lmvz-select.js +412 -21
  54. package/collection/components/lmvz-snackbar/lmvz-snackbar.js +1 -1
  55. package/collection/components/lmvz-spinner/lmvz-spinner.js +1 -1
  56. package/collection/components/lmvz-tab/lmvz-tab.js +1 -1
  57. package/collection/components/lmvz-tabs/lmvz-tabs.js +1 -1
  58. package/collection/components/lmvz-toggle/lmvz-toggle.js +21 -1
  59. package/collection/integration/header-integration/header-integration.js +1 -1
  60. package/collection/styles/fragments/_focus-within.css +2 -2
  61. package/collection/utils/aria/aria.constants.js +7 -0
  62. package/collection/utils/aria/directional-focus-controller.js +3 -1
  63. package/collection/utils/aria/listbox-controller.js +154 -0
  64. package/collection/utils/element/element.util.js +5 -0
  65. package/collection/utils/radio/radio-group-controller.js +17 -0
  66. package/components/index.d.ts +2 -0
  67. package/components/index.d.ts.bak +2 -0
  68. package/components/index.js +1 -1
  69. package/components/lmvz-action-list.js +1 -1
  70. package/components/lmvz-action.js +1 -1
  71. package/components/lmvz-button-group.js +1 -1
  72. package/components/lmvz-button.js +1 -1
  73. package/components/lmvz-card.js +1 -1
  74. package/components/lmvz-checkbox.js +1 -1
  75. package/components/lmvz-chip.js +1 -1
  76. package/components/lmvz-datepicker.d.ts +11 -0
  77. package/components/lmvz-datepicker.d.ts.bak +11 -0
  78. package/components/lmvz-datepicker.js +1 -0
  79. package/components/lmvz-header.js +1 -1
  80. package/components/lmvz-icon.js +1 -1
  81. package/components/lmvz-input.js +1 -1
  82. package/components/lmvz-link.js +1 -1
  83. package/components/lmvz-menuitem.js +1 -1
  84. package/components/lmvz-message.js +1 -1
  85. package/components/lmvz-modal.js +1 -1
  86. package/components/lmvz-popover.js +1 -1
  87. package/components/lmvz-radio.js +1 -1
  88. package/components/lmvz-select.js +1 -1
  89. package/components/lmvz-snackbar.js +1 -1
  90. package/components/lmvz-spinner.js +1 -1
  91. package/components/lmvz-tab.js +1 -1
  92. package/components/lmvz-tabs.js +1 -1
  93. package/components/lmvz-toggle.js +1 -1
  94. package/components/{p-Chj7BuUZ.js → p--FDdvoIg.js} +1 -1
  95. package/components/{p-CFTmV4XZ.js → p-BAj4FkUt.js} +1 -1
  96. package/components/p-BApwCp0R.js +1 -0
  97. package/components/{p-CxLd309t.js → p-BLMXiDE0.js} +1 -1
  98. package/components/{p-DGg7OzDl.js → p-BPYBmylI.js} +1 -1
  99. package/components/p-BhALzK62.js +1 -0
  100. package/components/{p-B_rnXUwq.js → p-Bnri3fEI.js} +1 -1
  101. package/components/p-C-pRMuMh.js +1 -0
  102. package/components/p-C5gRiLRR.js +1 -0
  103. package/components/{p-D5FL8n1q.js → p-CrQCHVKL.js} +1 -1
  104. package/components/p-DqdrUt_G.js +1 -0
  105. package/components/{p-CgK6-SEe.js → p-diOze8wI.js} +1 -1
  106. package/esm/{aria-validation-controller-BvOU1BO8.js → aria-validation-controller-Cp6pofER.js} +1 -1
  107. package/esm/aria.constants-DIyiticz.js +62 -0
  108. package/esm/{directional-focus-controller-DgAdCZrG.js → directional-focus-controller-QukTTWBE.js} +3 -1
  109. package/esm/{element-activation-controller-7PNSl6io.js → element-activation-controller-dxJZKMag.js} +1 -1
  110. package/esm/{element.util-BFcYfHYq.js → element.util-3ydVsxUW.js} +7 -54
  111. package/esm/{index-BPeerEwm.js → index-BOXP1Vx0.js} +12 -1
  112. package/esm/lmvz-action-list.entry.js +5 -4
  113. package/esm/lmvz-action.entry.js +1 -1
  114. package/esm/lmvz-button-group.entry.js +3 -2
  115. package/esm/lmvz-button_2.entry.js +6 -5
  116. package/esm/lmvz-card.entry.js +1 -1
  117. package/esm/lmvz-checkbox.entry.js +40 -6
  118. package/esm/lmvz-chip.entry.js +2 -2
  119. package/esm/lmvz-components.js +3 -3
  120. package/esm/lmvz-datepicker.entry.js +2769 -0
  121. package/esm/lmvz-header_2.entry.js +7 -6
  122. package/esm/lmvz-input.entry.js +71 -15
  123. package/esm/lmvz-link.entry.js +2 -2
  124. package/esm/lmvz-menuitem.entry.js +6 -5
  125. package/esm/lmvz-message.entry.js +2 -2
  126. package/esm/lmvz-modal.entry.js +5 -4
  127. package/esm/lmvz-popover.entry.js +25 -10
  128. package/esm/lmvz-radio.entry.js +63 -5
  129. package/esm/lmvz-select.entry.js +425 -18
  130. package/esm/lmvz-snackbar.entry.js +2 -2
  131. package/esm/lmvz-spinner.entry.js +2 -2
  132. package/esm/lmvz-tab.entry.js +2 -2
  133. package/esm/lmvz-tabs.entry.js +5 -4
  134. package/esm/lmvz-toggle.entry.js +7 -4
  135. package/esm/loader.js +3 -3
  136. package/hydrate/index.js +3474 -75
  137. package/hydrate/index.mjs +3474 -75
  138. package/lmvz-components/lmvz-components.esm.js +1 -1
  139. package/lmvz-components/{p-eb62d4af.entry.js → p-0af0211a.entry.js} +1 -1
  140. package/lmvz-components/{p-5bbbcfc0.entry.js → p-0f65d001.entry.js} +1 -1
  141. package/lmvz-components/p-137b1fe1.entry.js +1 -0
  142. package/lmvz-components/p-26dd9684.entry.js +1 -0
  143. package/lmvz-components/p-36f44108.entry.js +1 -0
  144. package/lmvz-components/p-398b5cf4.entry.js +1 -0
  145. package/lmvz-components/p-3a396fc8.entry.js +1 -0
  146. package/lmvz-components/{p-0c05f24b.entry.js → p-3d5867df.entry.js} +1 -1
  147. package/lmvz-components/p-40716828.entry.js +1 -0
  148. package/lmvz-components/{p-a887018d.entry.js → p-492adf21.entry.js} +1 -1
  149. package/lmvz-components/{p-24d13be6.entry.js → p-4fa6e72f.entry.js} +1 -1
  150. package/lmvz-components/p-70f1e31a.entry.js +1 -0
  151. package/lmvz-components/p-71d06d1d.entry.js +1 -0
  152. package/lmvz-components/{p-d45164a8.entry.js → p-7a7aa922.entry.js} +1 -1
  153. package/lmvz-components/p-88661c50.entry.js +1 -0
  154. package/lmvz-components/p-91eb71bb.entry.js +1 -0
  155. package/lmvz-components/p-BA3wizqg.js +1 -0
  156. package/lmvz-components/{p-BPeerEwm.js → p-BOXP1Vx0.js} +2 -2
  157. package/lmvz-components/{p-D9PQIBzA.js → p-BeY96W7m.js} +1 -1
  158. package/lmvz-components/p-CHxiS3ja.js +1 -0
  159. package/lmvz-components/{p-wlMjNjuv.js → p-CPSyM_e-.js} +1 -1
  160. package/lmvz-components/p-DIyiticz.js +1 -0
  161. package/lmvz-components/p-a680a7b2.entry.js +1 -0
  162. package/lmvz-components/{p-c2544495.entry.js → p-a6fe9b61.entry.js} +1 -1
  163. package/lmvz-components/{p-ecbd9e93.entry.js → p-a99acb02.entry.js} +1 -1
  164. package/lmvz-components/p-f16a19fc.entry.js +1 -0
  165. package/lmvz-components/p-f3f0ed49.entry.js +1 -0
  166. package/lmvz-components/p-f516a949.entry.js +1 -0
  167. package/manifest.json +1305 -188
  168. package/package.json +5 -1
  169. package/types/api/ds.constants.d.ts +0 -1
  170. package/types/api/ds.types.d.ts +9 -0
  171. package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
  172. package/types/components/lmvz-action-list/lmvz-action-list.d.ts +0 -1
  173. package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
  174. package/types/components/lmvz-button-group/lmvz-button-group.d.ts +0 -1
  175. package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
  176. package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +9 -2
  177. package/types/components/lmvz-chip/lmvz-chip.d.ts +0 -1
  178. package/types/components/lmvz-datepicker/lmvz-datepicker.d.ts +77 -0
  179. package/types/components/lmvz-datepicker/lmvz-datepicker.utils.d.ts +22 -0
  180. package/types/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.d.ts +1 -0
  181. package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
  182. package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
  183. package/types/components/lmvz-input/lmvz-input.d.ts +8 -1
  184. package/types/components/lmvz-link/lmvz-link.d.ts +0 -1
  185. package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
  186. package/types/components/lmvz-message/lmvz-message.d.ts +0 -1
  187. package/types/components/lmvz-message/public.d.ts +0 -1
  188. package/types/components/lmvz-modal/lmvz-modal.d.ts +0 -1
  189. package/types/components/lmvz-modal/test/testing.d.ts +0 -1
  190. package/types/components/lmvz-popover/lmvz-popover.d.ts +2 -1
  191. package/types/components/lmvz-radio/lmvz-radio.d.ts +12 -3
  192. package/types/components/lmvz-select/lmvz-select.d.ts +53 -5
  193. package/types/components/lmvz-snackbar/lmvz-snackbar.d.ts +0 -1
  194. package/types/components/lmvz-snackbar/public.d.ts +0 -1
  195. package/types/components/lmvz-snackbar/snackbar-controller.d.ts +0 -1
  196. package/types/components/lmvz-spinner/lmvz-spinner.d.ts +0 -1
  197. package/types/components/lmvz-tab/lmvz-tab.d.ts +0 -1
  198. package/types/components/lmvz-tabs/lmvz-tabs.d.ts +0 -1
  199. package/types/components/lmvz-toggle/lmvz-toggle.d.ts +1 -1
  200. package/types/components.d.ts +312 -12
  201. package/types/index.d.ts +0 -1
  202. package/types/utils/aria/aria-validation-controller.d.ts +0 -1
  203. package/types/utils/aria/aria.constants.d.ts +1 -1
  204. package/types/utils/aria/directional-focus-controller.d.ts +0 -1
  205. package/types/utils/aria/element-activation-controller.d.ts +0 -1
  206. package/types/utils/aria/listbox-controller.d.ts +42 -0
  207. package/types/utils/async/async.util.d.ts +1 -2
  208. package/types/utils/data/event.util.d.ts +0 -1
  209. package/types/utils/data/number.util.d.ts +0 -1
  210. package/types/utils/data/object.util.d.ts +0 -1
  211. package/types/utils/data/time.util.d.ts +0 -1
  212. package/types/utils/element/element.util.d.ts +1 -1
  213. package/types/utils/environment.d.ts +0 -1
  214. package/types/utils/icons/icons-registry.d.ts +0 -1
  215. package/types/utils/icons/icons.d.ts +0 -1
  216. package/types/utils/icons/icons.unit.d.ts +0 -1
  217. package/types/utils/icons/public.d.ts +0 -1
  218. package/types/utils/public.d.ts +0 -1
  219. package/types/utils/radio/radio-group-controller.d.ts +3 -1
  220. package/types/utils/stencil/assets.d.ts +0 -1
  221. package/types/utils/stencil/reactive-controller-host.d.ts +0 -1
  222. package/types/utils/stencil/stencil.util.d.ts +0 -1
  223. package/components/p-DLUsBYJH.js +0 -1
  224. package/components/p-zMWemcoB.js +0 -1
  225. package/lmvz-components/p-194a3af5.entry.js +0 -1
  226. package/lmvz-components/p-46edf36f.entry.js +0 -1
  227. package/lmvz-components/p-5ff55ba9.entry.js +0 -1
  228. package/lmvz-components/p-888e04d7.entry.js +0 -1
  229. package/lmvz-components/p-9dc420e2.entry.js +0 -1
  230. package/lmvz-components/p-BFcYfHYq.js +0 -1
  231. package/lmvz-components/p-BuEA0MWd.js +0 -1
  232. package/lmvz-components/p-aaa7691c.entry.js +0 -1
  233. package/lmvz-components/p-b6dd045b.entry.js +0 -1
  234. package/lmvz-components/p-c3e62aba.entry.js +0 -1
  235. package/lmvz-components/p-d4154a65.entry.js +0 -1
  236. package/lmvz-components/p-e4ce63b3.entry.js +0 -1
  237. package/lmvz-components/p-eb4c5a6f.entry.js +0 -1
  238. package/lmvz-components/p-f42b16e6.entry.js +0 -1
  239. package/lmvz-components/p-fbf066d9.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-TGsVZNDP.js');
4
- var ariaValidationController = require('./aria-validation-controller-BC0Eaiv4.js');
3
+ var index = require('./index-BgvZ4y-3.js');
4
+ var ariaValidationController = require('./aria-validation-controller-Do0uEK4t.js');
5
5
  var reactiveControllerHost = require('./reactive-controller-host-Bc6B_T45.js');
6
6
  require('./aria-loader-DWUVcapD.js');
7
7
 
@@ -36,6 +36,7 @@ class RadioGroup {
36
36
  if (wasEmpty) {
37
37
  document.addEventListener('focusin', this._focusinHandler, true);
38
38
  }
39
+ this.refreshValidity();
39
40
  }
40
41
  }
41
42
  unregister(host) {
@@ -46,10 +47,19 @@ class RadioGroup {
46
47
  if (this.hosts.length === 0) {
47
48
  document.removeEventListener('focusin', this._focusinHandler, true);
48
49
  }
50
+ this.refreshValidity();
49
51
  }
50
52
  get sortedEnabled() {
51
53
  return this.hosts.filter((h) => !h.disabled);
52
54
  }
55
+ isAnyChecked() {
56
+ return this.hosts.some((host) => host.checked);
57
+ }
58
+ refreshValidity() {
59
+ for (const host of this.hosts) {
60
+ host.updateValidity();
61
+ }
62
+ }
53
63
  setFocused(host) {
54
64
  this._focusedHost = host;
55
65
  this.updateTabindex();
@@ -65,6 +75,7 @@ class RadioGroup {
65
75
  host.checked = host === selectedHost;
66
76
  }
67
77
  this.updateTabindex();
78
+ this.refreshValidity();
68
79
  }
69
80
  updateTabindex() {
70
81
  const enabled = this.sortedEnabled;
@@ -126,6 +137,12 @@ class RadioGroupController {
126
137
  select(selectedHost) {
127
138
  this.group?.select(selectedHost);
128
139
  }
140
+ isAnyChecked() {
141
+ return this.group?.isAnyChecked() ?? false;
142
+ }
143
+ refreshValidity() {
144
+ this.group?.refreshValidity();
145
+ }
129
146
  setFocused(host) {
130
147
  this.group?.setFocused(host);
131
148
  }
@@ -168,7 +185,7 @@ class RadioGroupController {
168
185
 
169
186
  const lmvzRadioCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-radio-h { display: inline-block; --radio-circle-size: var(--lmvz-global-s18, 18px); --radio-dot-size: 0.5rem; --radio-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --radio-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --radio-border-color-hover: var(--lmvz-semantic-color-border-hover, #a1a1a1); --radio-border-color-checked: var(--lmvz-semantic-color-border-active, #0f8acc); --radio-border-color-error: var(--lmvz-semantic-color-status-on-danger, #a31419); --radio-dot-color: var(--lmvz-semantic-color-border-active, #0f8acc); --radio-wrapper-bg-hover: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --radio-wrapper-bg-active: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); --radio-label-color: var(--lmvz-semantic-color-on-surface-primary, #000000); --radio-label-color-checked: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --radio-helper-color: var(--lmvz-semantic-color-on-surface-secondary, #545454); --radio-easing: var(--lmvz-global-easing-default, ease); --radio-duration: 0.2s; display: flex; align-items: center; gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); padding-block: var(--lmvz-dimension-8-2, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem)); padding-inline: var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); overflow: clip; cursor: pointer; background-color: transparent; position: relative; transition: background-color var(--radio-duration) var(--radio-easing); } input.sc-lmvz-radio { position: absolute; inset-block-start: var(--lmvz-dimension-8-2, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem)); inset-inline-start: var(--lmvz-dimension-10-4, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); opacity: 0; width: var(--radio-circle-size); height: var(--radio-circle-size); margin: 0; cursor: pointer; z-index: 1; } .circle.sc-lmvz-radio { width: var(--radio-circle-size); height: var(--radio-circle-size); border-radius: 50%; border: var(--lmvz-semantic-border-width-default, 1px) solid var(--radio-border-color); background-color: var(--radio-bg); pointer-events: none; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; transition: border-color var(--radio-duration) var(--radio-easing); } .dot.sc-lmvz-radio { width: var(--radio-dot-size); height: var(--radio-dot-size); border-radius: 50%; background-color: var(--radio-dot-color); } .content.sc-lmvz-radio { display: flex; flex-direction: column; overflow-wrap: break-word; min-width: 0; } label.sc-lmvz-radio { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); color: var(--radio-label-color); cursor: pointer; transition: color var(--radio-duration) var(--radio-easing); } .helper-text.sc-lmvz-radio { display: block; font: var(--lmvz-typography-body-sm, 400 clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem) / 1.5 Router); color: var(--radio-helper-color); margin-block-start: 2px; } .helper-text.sc-lmvz-radio:empty { display: none; } @media (hover: hover) { .sc-lmvz-radio-h:hover .circle.sc-lmvz-radio { border-color: var(--radio-border-color-hover); } .sc-lmvz-radio-h:hover { background-color: var(--radio-wrapper-bg-hover); } } .sc-lmvz-radio-h:active { background-color: var(--radio-wrapper-bg-active); } [checked].sc-lmvz-radio-h .circle.sc-lmvz-radio { border-color: var(--radio-border-color-checked); } [checked].sc-lmvz-radio-h label.sc-lmvz-radio { color: var(--radio-label-color-checked); } [error].sc-lmvz-radio-h .circle.sc-lmvz-radio { border-color: var(--radio-border-color-error); } [error].sc-lmvz-radio-h .helper-text.sc-lmvz-radio { color: var(--lmvz-semantic-color-status-on-danger, #a31419); } [disabled].sc-lmvz-radio-h { opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; cursor: not-allowed; } @media (forced-colors: active) { .circle.sc-lmvz-radio { forced-color-adjust: auto; border-color: ButtonText; background-color: Field; } [checked].sc-lmvz-radio-h .circle.sc-lmvz-radio { border-color: Highlight; } .dot.sc-lmvz-radio { background-color: ButtonText; } [checked].sc-lmvz-radio-h .dot.sc-lmvz-radio { background-color: HighlightText; } }`;
170
187
 
171
- const focusWithinCss = () => `.sc-lmvz-radio-h:focus-within{outline:var(--lmvz-ds-outline, 1px solid #0e7ab4);outline-offset:var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem))}@media (forced-colors: active){.sc-lmvz-radio-h:focus-within{outline-color:Highlight;box-shadow:none}}`;
188
+ const focusWithinCss = () => `.sc-lmvz-radio-h:has(:focus-visible){outline:var(--lmvz-ds-outline, 1px solid #0e7ab4);outline-offset:var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem))}@media (forced-colors: active){.sc-lmvz-radio-h:has(:focus-visible){outline-color:Highlight;box-shadow:none}}`;
172
189
 
173
190
  let radioIdCounter = 0;
174
191
  const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
@@ -190,7 +207,14 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
190
207
  name;
191
208
  disabled = false;
192
209
  required = false;
193
- error = false;
210
+ nativeError = false;
211
+ errorFromProp = false;
212
+ get error() {
213
+ return this.errorFromProp || this.nativeError;
214
+ }
215
+ set error(value) {
216
+ this.errorFromProp = value;
217
+ }
194
218
  helperText;
195
219
  form;
196
220
  autofocus = false;
@@ -198,6 +222,7 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
198
222
  _handlingFormReset = false;
199
223
  handleCheckedChange(newVal, oldVal) {
200
224
  this.internals.setFormValue?.(newVal ? this.value : null);
225
+ this.updateValidity();
201
226
  if (!newVal && oldVal && !this._handlingNativeChange && !this._handlingFormReset) {
202
227
  this.lmvzChange.emit(false);
203
228
  }
@@ -205,6 +230,9 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
205
230
  this.lmvzChange.emit(true);
206
231
  }
207
232
  }
233
+ handleRequiredChange() {
234
+ this.updateValidity();
235
+ }
208
236
  handleValueChange(newVal) {
209
237
  if (this.checked) {
210
238
  this.internals.setFormValue?.(newVal);
@@ -226,6 +254,9 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
226
254
  async reportValidity() {
227
255
  return this.internals?.reportValidity() ?? true;
228
256
  }
257
+ async getValidationMessage() {
258
+ return this.internals?.validationMessage ?? '';
259
+ }
229
260
  constructor(hostRef) {
230
261
  super();
231
262
  index.registerInstance(this, hostRef);
@@ -247,8 +278,13 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
247
278
  componentWillLoad() {
248
279
  this.initialChecked = this.checked;
249
280
  this.internals.setFormValue?.(this.checked ? this.value : null);
281
+ this.updateValidity();
250
282
  super.componentWillLoad();
251
283
  }
284
+ componentDidLoad() {
285
+ this.updateValidity();
286
+ super.componentDidLoad();
287
+ }
252
288
  formAssociatedCallback() {
253
289
  this.internals.setFormValue?.(this.checked ? this.value : null);
254
290
  }
@@ -260,6 +296,8 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
260
296
  finally {
261
297
  this._handlingFormReset = false;
262
298
  }
299
+ this.updateValidity();
300
+ this.radioGroupController.refreshValidity();
263
301
  }
264
302
  formStateRestoreCallback(state) {
265
303
  if (typeof state !== 'string')
@@ -272,6 +310,20 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
272
310
  this._handlingFormReset = false;
273
311
  }
274
312
  }
313
+ isAnyInGroupChecked() {
314
+ return this.radioGroupController.isAnyChecked();
315
+ }
316
+ updateValidity() {
317
+ if (this.required && !this.isAnyInGroupChecked()) {
318
+ this.internals.setValidity?.({ valueMissing: true }, 'Please select an option.', this.nativeInput);
319
+ return;
320
+ }
321
+ this.internals.setValidity?.({});
322
+ this.nativeError = false;
323
+ }
324
+ handleInvalid() {
325
+ this.nativeError = true;
326
+ }
275
327
  handleChange = (event) => {
276
328
  this._handlingNativeChange = true;
277
329
  try {
@@ -314,14 +366,20 @@ const LmvzRadio = class extends reactiveControllerHost.ReactiveControllerHost {
314
366
  return;
315
367
  this.radioGroupController.setFocused(target);
316
368
  }
369
+ retargetInnerClicks() {
370
+ this.nativeInput?.click();
371
+ }
317
372
  render() {
318
- return (index.h(index.Host, { key: 'c233b8f8e67016dd9a8622359bd91d3193735438' }, index.h("input", { key: '6a0a028f4ae346b60f86109d33058f7a04f0f2f8', type: "radio", id: this.radioId, name: this.name ?? undefined, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, autoFocus: this.autofocus, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.helperId, ref: (el) => (this.nativeInput = el), onChange: this.handleChange }), index.h("span", { key: 'f86096dd776236e07292dab77a37aeedffb8d8d4', class: "circle", "aria-hidden": "true" }, this.checked && index.h("span", { key: '8e93beefee742af62775d4d5945df8d13adb739f', class: "dot" })), index.h("span", { key: '19df96e6d015d0f74c96781ae49191a542a4f41d', class: "content" }, index.h("label", { key: 'b678b54ca139191ff78d5f503b73ea407eeb0708', htmlFor: this.radioId }, this.label), index.h("span", { key: '4a1e8a60594e959cb5549dd20b3d35a715ce1d99', "aria-live": "polite", class: "helper-text", id: this.helperId }, this.helperText))));
373
+ return (index.h(index.Host, { key: 'f1fdc1167c4e59c2524e1e545c3382ca32853788' }, index.h("input", { key: 'c1b711444475ed401766cc5827eeaec0c46b62cf', type: "radio", id: this.radioId, value: this.value, checked: this.checked, disabled: this.disabled, autoFocus: this.autofocus, "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.helperId, ref: (el) => (this.nativeInput = el), onChange: this.handleChange }), index.h("span", { key: 'b25e623269df05bdf8159e72da4df2e0bfb5d7bc', class: "circle", "aria-hidden": "true" }, this.checked && index.h("span", { key: '93d12890c7ba0abe203c63953ea1115aee37d7a0', class: "dot" })), index.h("span", { key: '44dcfdc4e7ee3820624b0d02a438139f45bb8733', class: "content" }, index.h("label", { key: 'd0547cd5e79642b298da155c9937715224b52cae', htmlFor: this.radioId }, this.label), index.h("span", { key: 'a9df5dd8a775a2f7422d5bac296869f88553e33f', onClick: this.retargetInnerClicks.bind(this), "aria-live": "polite", class: "helper-text", id: this.helperId }, this.helperText))));
319
374
  }
320
375
  static get formAssociated() { return true; }
321
376
  static get watchers() { return {
322
377
  "checked": [{
323
378
  "handleCheckedChange": 0
324
379
  }],
380
+ "required": [{
381
+ "handleRequiredChange": 0
382
+ }],
325
383
  "value": [{
326
384
  "handleValueChange": 0
327
385
  }],