@warp-ds/elements 2.4.0 → 2.5.0-next.2

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 (426) hide show
  1. package/dist/api.js.map +2 -2
  2. package/dist/custom-elements.json +878 -412
  3. package/dist/index.d.ts +2204 -777
  4. package/dist/packages/affix/{index.js → affix.js} +1 -1
  5. package/dist/packages/affix/{index.js.map → affix.js.map} +1 -1
  6. package/dist/packages/affix/affix.react.stories.d.ts +1 -1
  7. package/dist/packages/affix/affix.stories.d.ts +2 -2
  8. package/dist/packages/affix/affix.stories.js +1 -1
  9. package/dist/packages/affix/affix.test.d.ts +1 -1
  10. package/dist/packages/affix/affix.test.js +1 -1
  11. package/dist/packages/affix/react.d.ts +1 -1
  12. package/dist/packages/alert/{index.js → alert.js} +1 -1
  13. package/dist/packages/alert/{index.js.map → alert.js.map} +1 -1
  14. package/dist/packages/alert/alert.react.stories.d.ts +1 -1
  15. package/dist/packages/alert/alert.stories.d.ts +2 -2
  16. package/dist/packages/alert/alert.stories.js +1 -1
  17. package/dist/packages/alert/alert.test.d.ts +1 -1
  18. package/dist/packages/alert/alert.test.js +1 -1
  19. package/dist/packages/alert/react.d.ts +1 -1
  20. package/dist/packages/alert/react.js +1 -1
  21. package/dist/packages/attention/{index.d.ts → attention.d.ts} +1 -1
  22. package/dist/packages/attention/{index.js → attention.js} +18 -18
  23. package/dist/packages/attention/attention.js.map +7 -0
  24. package/dist/packages/attention/attention.react.stories.d.ts +1 -1
  25. package/dist/packages/attention/attention.stories.d.ts +3 -3
  26. package/dist/packages/attention/attention.stories.js +2 -2
  27. package/dist/packages/attention/attention.test.d.ts +1 -1
  28. package/dist/packages/attention/attention.test.js +1 -1
  29. package/dist/packages/attention/react.d.ts +1 -1
  30. package/dist/packages/attention/react.js +1 -1
  31. package/dist/packages/badge/{index.js → badge.js} +1 -1
  32. package/dist/packages/badge/{index.js.map → badge.js.map} +1 -1
  33. package/dist/packages/badge/badge.react.stories.d.ts +3 -3
  34. package/dist/packages/badge/badge.stories.d.ts +2 -2
  35. package/dist/packages/badge/badge.stories.js +1 -1
  36. package/dist/packages/badge/badge.test.d.ts +1 -1
  37. package/dist/packages/badge/badge.test.js +1 -1
  38. package/dist/packages/badge/react.d.ts +1 -1
  39. package/dist/packages/badge/react.js +1 -1
  40. package/dist/packages/box/{index.js → box.js} +1 -1
  41. package/dist/packages/box/{index.js.map → box.js.map} +1 -1
  42. package/dist/packages/box/box.react.stories.d.ts +3 -3
  43. package/dist/packages/box/box.stories.d.ts +2 -2
  44. package/dist/packages/box/box.stories.js +1 -1
  45. package/dist/packages/box/box.test.d.ts +1 -1
  46. package/dist/packages/box/box.test.js +1 -1
  47. package/dist/packages/box/react.d.ts +1 -1
  48. package/dist/packages/box/react.js +1 -1
  49. package/dist/packages/box/slot.test.d.ts +1 -1
  50. package/dist/packages/box/slot.test.js +1 -1
  51. package/dist/packages/breadcrumbs/{index.js → breadcrumbs.js} +10 -10
  52. package/dist/packages/breadcrumbs/breadcrumbs.js.map +7 -0
  53. package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +3 -3
  54. package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +2 -2
  55. package/dist/packages/breadcrumbs/breadcrumbs.stories.js +1 -1
  56. package/dist/packages/breadcrumbs/breadcrumbs.test.d.ts +1 -1
  57. package/dist/packages/breadcrumbs/breadcrumbs.test.js +1 -1
  58. package/dist/packages/breadcrumbs/react.d.ts +1 -1
  59. package/dist/packages/breadcrumbs/react.js +1 -1
  60. package/dist/packages/button/{index.d.ts → button.d.ts} +1 -1
  61. package/dist/packages/button/{index.js → button.js} +12 -12
  62. package/dist/packages/button/button.js.map +7 -0
  63. package/dist/packages/button/button.react.stories.d.ts +3 -3
  64. package/dist/packages/button/button.stories.d.ts +2 -2
  65. package/dist/packages/button/button.stories.js +1 -1
  66. package/dist/packages/button/button.test.d.ts +1 -1
  67. package/dist/packages/button/button.test.js +1 -1
  68. package/dist/packages/button/react.d.ts +1 -1
  69. package/dist/packages/button/react.js +1 -1
  70. package/dist/packages/card/{index.js → card.js} +9 -9
  71. package/dist/packages/card/card.js.map +7 -0
  72. package/dist/packages/card/card.react.stories.d.ts +3 -3
  73. package/dist/packages/card/card.stories.d.ts +2 -2
  74. package/dist/packages/card/card.stories.js +1 -1
  75. package/dist/packages/card/card.test.d.ts +1 -1
  76. package/dist/packages/card/card.test.js +1 -1
  77. package/dist/packages/card/react.d.ts +1 -1
  78. package/dist/packages/card/react.js +1 -1
  79. package/dist/packages/combobox/{index.js → combobox.js} +14 -14
  80. package/dist/packages/combobox/{index.js.map → combobox.js.map} +4 -4
  81. package/dist/packages/combobox/combobox.react.stories.d.ts +4 -4
  82. package/dist/packages/combobox/combobox.stories.d.ts +3 -3
  83. package/dist/packages/combobox/combobox.stories.js +2 -2
  84. package/dist/packages/combobox/combobox.test.d.ts +2 -2
  85. package/dist/packages/combobox/combobox.test.js +2 -2
  86. package/dist/packages/combobox/react.d.ts +1 -1
  87. package/dist/packages/combobox/react.js +1 -1
  88. package/dist/packages/datepicker/DatePicker.test.d.ts +2 -2
  89. package/dist/packages/datepicker/DatePicker.test.js +2 -2
  90. package/dist/packages/datepicker/datepicker.js +15 -15
  91. package/dist/packages/datepicker/datepicker.js.map +3 -3
  92. package/dist/packages/datepicker/datepicker.react.stories.d.ts +2 -2
  93. package/dist/packages/datepicker/datepicker.stories.d.ts +3 -3
  94. package/dist/packages/datepicker/datepicker.stories.js +2 -2
  95. package/dist/packages/datepicker/datepicker.test.d.ts +2 -2
  96. package/dist/packages/datepicker/datepicker.test.js +2 -2
  97. package/dist/packages/datepicker/react.js +1 -1
  98. package/dist/packages/expandable/{index.js → expandable.js} +1 -1
  99. package/dist/packages/expandable/{index.js.map → expandable.js.map} +1 -1
  100. package/dist/packages/expandable/expandable.react.stories.d.ts +3 -3
  101. package/dist/packages/expandable/expandable.stories.d.ts +2 -2
  102. package/dist/packages/expandable/expandable.stories.js +1 -1
  103. package/dist/packages/expandable/expandable.test.d.ts +1 -1
  104. package/dist/packages/expandable/expandable.test.js +1 -1
  105. package/dist/packages/expandable/react.d.ts +1 -1
  106. package/dist/packages/expandable/react.js +1 -1
  107. package/dist/packages/i18n.js +6 -2
  108. package/dist/packages/icon/icon.d.ts +22 -0
  109. package/dist/packages/icon/icon.js +27 -0
  110. package/dist/packages/icon/icon.js.map +7 -0
  111. package/dist/packages/icon/icon.react.stories.d.ts +28 -0
  112. package/dist/packages/icon/icon.react.stories.js +37 -0
  113. package/dist/packages/icon/icon.stories.d.ts +39 -0
  114. package/dist/packages/icon/icon.stories.js +43 -0
  115. package/dist/packages/icon/react.d.ts +2 -0
  116. package/dist/packages/{deadtoggle → icon}/react.js +3 -3
  117. package/dist/packages/icon/style.js +27 -0
  118. package/dist/packages/link/{index.js → link.js} +3 -3
  119. package/dist/packages/link/link.js.map +7 -0
  120. package/dist/packages/link/link.react.stories.d.ts +3 -3
  121. package/dist/packages/link/link.stories.d.ts +2 -2
  122. package/dist/packages/link/link.stories.js +1 -1
  123. package/dist/packages/link/link.test.d.ts +1 -1
  124. package/dist/packages/link/link.test.js +1 -1
  125. package/dist/packages/link/react.d.ts +1 -1
  126. package/dist/packages/link/react.js +1 -1
  127. package/dist/packages/link/styles.js +2 -2
  128. package/dist/packages/modal/index.d.ts +6 -3
  129. package/dist/packages/modal/index.js +10 -2717
  130. package/dist/packages/modal/{modal-main.js → modal.js} +1 -1
  131. package/dist/packages/modal/{modal-main.js.map → modal.js.map} +1 -1
  132. package/dist/packages/modal/modal.react.stories.d.ts +1 -1
  133. package/dist/packages/modal/modal.stories.d.ts +6 -3
  134. package/dist/packages/modal/modal.stories.js +3 -1
  135. package/dist/packages/modal/react.d.ts +3 -6
  136. package/dist/packages/modal/react.js +4 -15
  137. package/dist/packages/{modal → modal-footer}/modal-footer.d.ts +2 -2
  138. package/dist/packages/{modal → modal-footer}/modal-footer.js +4 -4
  139. package/dist/packages/modal-footer/modal-footer.js.map +7 -0
  140. package/dist/packages/modal-footer/react.d.ts +2 -0
  141. package/dist/packages/{stepindicator → modal-footer}/react.js +3 -8
  142. package/dist/packages/{modal → modal-header}/modal-header.d.ts +1 -1
  143. package/dist/packages/{modal → modal-header}/modal-header.js +7 -7
  144. package/dist/packages/modal-header/modal-header.js.map +7 -0
  145. package/dist/packages/modal-header/react.d.ts +5 -0
  146. package/dist/packages/{pagination → modal-header}/react.js +5 -5
  147. package/dist/packages/page-indicator/locales/da/messages.mjs +1 -0
  148. package/dist/packages/page-indicator/locales/en/messages.mjs +1 -0
  149. package/dist/packages/page-indicator/locales/fi/messages.mjs +1 -0
  150. package/dist/packages/page-indicator/locales/nb/messages.mjs +1 -0
  151. package/dist/packages/page-indicator/locales/sv/messages.mjs +1 -0
  152. package/dist/packages/page-indicator/page-indicator.d.ts +26 -0
  153. package/dist/packages/page-indicator/page-indicator.js +41 -0
  154. package/dist/packages/page-indicator/page-indicator.js.map +7 -0
  155. package/dist/packages/{pageindicator/pageindicator.react.stories.d.ts → page-indicator/page-indicator.react.stories.d.ts} +3 -3
  156. package/dist/packages/{pageindicator/pageindicator.stories.d.ts → page-indicator/page-indicator.stories.d.ts} +1 -1
  157. package/dist/packages/page-indicator/page-indicator.stories.js +87 -0
  158. package/dist/packages/page-indicator/page-indicator.test.d.ts +1 -0
  159. package/dist/packages/page-indicator/page-indicator.test.js +118 -0
  160. package/dist/packages/{pageindicator → page-indicator}/react.d.ts +1 -1
  161. package/dist/packages/{pageindicator → page-indicator}/react.js +2 -2
  162. package/dist/packages/{pageindicator → page-indicator}/style.js +4 -4
  163. package/dist/packages/pill/{index.js → pill.js} +9 -9
  164. package/dist/packages/pill/pill.js.map +7 -0
  165. package/dist/packages/pill/pill.react.stories.d.ts +4 -4
  166. package/dist/packages/pill/pill.stories.d.ts +2 -2
  167. package/dist/packages/pill/pill.stories.js +1 -1
  168. package/dist/packages/pill/pill.test.d.ts +1 -1
  169. package/dist/packages/pill/pill.test.js +1 -1
  170. package/dist/packages/pill/react.d.ts +1 -1
  171. package/dist/packages/pill/react.js +1 -1
  172. package/dist/packages/select/react.d.ts +1 -1
  173. package/dist/packages/select/react.js +1 -1
  174. package/dist/packages/select/{index.js → select.js} +16 -16
  175. package/dist/packages/select/select.js.map +7 -0
  176. package/dist/packages/select/select.react.stories.d.ts +4 -4
  177. package/dist/packages/select/select.react.stories.js +1 -1
  178. package/dist/packages/select/select.stories.d.ts +2 -2
  179. package/dist/packages/select/select.stories.js +1 -1
  180. package/dist/packages/select/select.test.d.ts +1 -1
  181. package/dist/packages/select/select.test.js +1 -1
  182. package/dist/packages/switch/react.d.ts +1 -1
  183. package/dist/packages/switch/react.js +1 -1
  184. package/dist/packages/switch/{index.js → switch.js} +1 -1
  185. package/dist/packages/switch/{index.js.map → switch.js.map} +1 -1
  186. package/dist/packages/switch/switch.react.stories.d.ts +1 -1
  187. package/dist/packages/switch/switch.stories.d.ts +1 -1
  188. package/dist/packages/switch/switch.stories.js +1 -1
  189. package/dist/packages/switch/switch.test.d.ts +1 -1
  190. package/dist/packages/switch/switch.test.js +2 -2
  191. package/dist/packages/tab/react.d.ts +7 -0
  192. package/dist/packages/tab/react.js +17 -0
  193. package/dist/packages/{tabs → tab}/tab.d.ts +2 -5
  194. package/dist/packages/tab/tab.js +2464 -0
  195. package/dist/packages/tab/tab.js.map +7 -0
  196. package/dist/packages/tab-panel/react.d.ts +2 -0
  197. package/dist/packages/tab-panel/react.js +11 -0
  198. package/dist/packages/{tabs → tab-panel}/tab-panel.d.ts +3 -3
  199. package/dist/packages/tab-panel/tab-panel.js +2441 -0
  200. package/dist/packages/tab-panel/tab-panel.js.map +7 -0
  201. package/dist/packages/tabs/index.d.ts +2 -3
  202. package/dist/packages/tabs/index.js +3 -2
  203. package/dist/packages/tabs/react.d.ts +3 -8
  204. package/dist/packages/tabs/react.js +4 -17
  205. package/dist/packages/tabs/tabs.d.ts +2 -5
  206. package/dist/packages/tabs/tabs.js +2447 -252
  207. package/dist/packages/tabs/tabs.js.map +7 -0
  208. package/dist/packages/tabs/tabs.react.stories.d.ts +14 -1
  209. package/dist/packages/tabs/tabs.react.stories.js +55 -35
  210. package/dist/packages/tabs/tabs.stories.d.ts +5 -4
  211. package/dist/packages/tabs/tabs.stories.js +89 -65
  212. package/dist/packages/textfield/react.d.ts +1 -1
  213. package/dist/packages/textfield/react.js +1 -1
  214. package/dist/packages/textfield/{index.js → textfield.js} +1 -1
  215. package/dist/packages/textfield/{index.js.map → textfield.js.map} +1 -1
  216. package/dist/packages/textfield/textfield.react.stories.d.ts +4 -4
  217. package/dist/packages/textfield/textfield.stories.d.ts +2 -2
  218. package/dist/packages/textfield/textfield.stories.js +1 -1
  219. package/dist/packages/textfield/textfield.test.d.ts +2 -2
  220. package/dist/packages/textfield/textfield.test.js +2 -2
  221. package/dist/packages/toast/index.d.ts +5 -3
  222. package/dist/packages/toast/index.js +7 -2483
  223. package/dist/packages/toast/toast.js +8 -8
  224. package/dist/packages/toast/toast.js.map +3 -3
  225. package/dist/packages/toast/toast.stories.d.ts +4 -3
  226. package/dist/packages/toast/toast.stories.js +3 -2
  227. package/dist/packages/{toast → toast-container}/toast-container.d.ts +1 -1
  228. package/dist/packages/toast-container/toast-container.js.map +7 -0
  229. package/dist/web-types.json +175 -38
  230. package/package.json +91 -38
  231. package/dist/packages/attention/index.js.map +0 -7
  232. package/dist/packages/breadcrumbs/index.js.map +0 -7
  233. package/dist/packages/button/index.js.map +0 -7
  234. package/dist/packages/card/index.js.map +0 -7
  235. package/dist/packages/checkbox/checkbox-group.d.ts +0 -10
  236. package/dist/packages/checkbox/checkbox-group.js +0 -15
  237. package/dist/packages/checkbox/checkbox.d.ts +0 -66
  238. package/dist/packages/checkbox/checkbox.js +0 -220
  239. package/dist/packages/checkbox/checkbox.react.stories.d.ts +0 -12
  240. package/dist/packages/checkbox/checkbox.react.stories.js +0 -10
  241. package/dist/packages/checkbox/checkbox.stories.d.ts +0 -11
  242. package/dist/packages/checkbox/checkbox.stories.js +0 -25
  243. package/dist/packages/checkbox/index.d.ts +0 -2
  244. package/dist/packages/checkbox/index.js +0 -2
  245. package/dist/packages/checkbox/react.d.ts +0 -7
  246. package/dist/packages/checkbox/react.js +0 -20
  247. package/dist/packages/checkbox/styles.d.ts +0 -0
  248. package/dist/packages/checkbox/styles.js +0 -0
  249. package/dist/packages/datepicker/index.d.ts +0 -1
  250. package/dist/packages/datepicker/index.js +0 -2785
  251. package/dist/packages/datepicker/index.js.map +0 -7
  252. package/dist/packages/deadtoggle/dead-toggle.react.stories.d.ts +0 -15
  253. package/dist/packages/deadtoggle/dead-toggle.react.stories.js +0 -34
  254. package/dist/packages/deadtoggle/dead-toggle.stories.d.ts +0 -14
  255. package/dist/packages/deadtoggle/dead-toggle.stories.js +0 -45
  256. package/dist/packages/deadtoggle/dead-toggle.test.d.ts +0 -1
  257. package/dist/packages/deadtoggle/dead-toggle.test.js +0 -9
  258. package/dist/packages/deadtoggle/index.d.ts +0 -17
  259. package/dist/packages/deadtoggle/index.js +0 -51
  260. package/dist/packages/deadtoggle/react.d.ts +0 -2
  261. package/dist/packages/link/index.js.map +0 -7
  262. package/dist/packages/modal/index.js.map +0 -7
  263. package/dist/packages/modal/modal-footer.js.map +0 -7
  264. package/dist/packages/modal/modal-header.js.map +0 -7
  265. package/dist/packages/pageindicator/index.d.ts +0 -10
  266. package/dist/packages/pageindicator/index.js +0 -48
  267. package/dist/packages/pageindicator/pageindicator.stories.js +0 -71
  268. package/dist/packages/pagination/index.d.ts +0 -32
  269. package/dist/packages/pagination/index.js +0 -199
  270. package/dist/packages/pagination/locales/da/messages.mjs +0 -1
  271. package/dist/packages/pagination/locales/en/messages.mjs +0 -1
  272. package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
  273. package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
  274. package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
  275. package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
  276. package/dist/packages/pagination/pagination.react.stories.js +0 -45
  277. package/dist/packages/pagination/pagination.stories.d.ts +0 -14
  278. package/dist/packages/pagination/pagination.stories.js +0 -56
  279. package/dist/packages/pagination/pagination.test.d.ts +0 -1
  280. package/dist/packages/pagination/pagination.test.js +0 -76
  281. package/dist/packages/pagination/react.d.ts +0 -5
  282. package/dist/packages/pagination/styles.js +0 -2
  283. package/dist/packages/pill/index.js.map +0 -7
  284. package/dist/packages/radio/base-element.d.ts +0 -46
  285. package/dist/packages/radio/base-element.js +0 -100
  286. package/dist/packages/radio/custom-error-validator.d.ts +0 -6
  287. package/dist/packages/radio/custom-error-validator.js +0 -22
  288. package/dist/packages/radio/form-associated-element.d.ts +0 -103
  289. package/dist/packages/radio/form-associated-element.js +0 -282
  290. package/dist/packages/radio/host-styles.d.ts +0 -1
  291. package/dist/packages/radio/host-styles.js +0 -12
  292. package/dist/packages/radio/index.d.ts +0 -2
  293. package/dist/packages/radio/index.js +0 -2
  294. package/dist/packages/radio/invalid.d.ts +0 -8
  295. package/dist/packages/radio/invalid.js +0 -5
  296. package/dist/packages/radio/math.d.ts +0 -1
  297. package/dist/packages/radio/math.js +0 -4
  298. package/dist/packages/radio/radio-group-styles.d.ts +0 -1
  299. package/dist/packages/radio/radio-group-styles.js +0 -59
  300. package/dist/packages/radio/radio-group.d.ts +0 -72
  301. package/dist/packages/radio/radio-group.js +0 -342
  302. package/dist/packages/radio/radio-styles.d.ts +0 -0
  303. package/dist/packages/radio/radio-styles.js +0 -0
  304. package/dist/packages/radio/radio.d.ts +0 -38
  305. package/dist/packages/radio/radio.js +0 -115
  306. package/dist/packages/radio/radio.react.stories.d.ts +0 -9
  307. package/dist/packages/radio/radio.react.stories.js +0 -10
  308. package/dist/packages/radio/radio.stories.d.ts +0 -15
  309. package/dist/packages/radio/radio.stories.js +0 -61
  310. package/dist/packages/radio/react.d.ts +0 -9
  311. package/dist/packages/radio/react.js +0 -22
  312. package/dist/packages/radio/required-validator.d.ts +0 -11
  313. package/dist/packages/radio/required-validator.js +0 -34
  314. package/dist/packages/radio/slot.d.ts +0 -20
  315. package/dist/packages/radio/slot.js +0 -71
  316. package/dist/packages/radio/watch.d.ts +0 -26
  317. package/dist/packages/radio/watch.js +0 -39
  318. package/dist/packages/select/index.js.map +0 -7
  319. package/dist/packages/slider/Slider.d.ts +0 -2
  320. package/dist/packages/slider/Slider.js +0 -8
  321. package/dist/packages/slider/SliderThumb.d.ts +0 -2
  322. package/dist/packages/slider/SliderThumb.js +0 -8
  323. package/dist/packages/slider/index.d.ts +0 -2
  324. package/dist/packages/slider/index.js +0 -2
  325. package/dist/packages/slider/locales/da/messages.d.mts +0 -1
  326. package/dist/packages/slider/locales/da/messages.mjs +0 -1
  327. package/dist/packages/slider/locales/en/messages.d.mts +0 -1
  328. package/dist/packages/slider/locales/en/messages.mjs +0 -1
  329. package/dist/packages/slider/locales/fi/messages.d.mts +0 -1
  330. package/dist/packages/slider/locales/fi/messages.mjs +0 -1
  331. package/dist/packages/slider/locales/nb/messages.d.mts +0 -1
  332. package/dist/packages/slider/locales/nb/messages.mjs +0 -1
  333. package/dist/packages/slider/locales/sv/messages.d.mts +0 -1
  334. package/dist/packages/slider/locales/sv/messages.mjs +0 -1
  335. package/dist/packages/slider/oddbird-css-anchor-positioning.d.ts +0 -2
  336. package/dist/packages/slider/oddbird-css-anchor-positioning.js +0 -3
  337. package/dist/packages/slider/react.d.ts +0 -8
  338. package/dist/packages/slider/react.js +0 -20
  339. package/dist/packages/slider/slider-thumb.d.ts +0 -63
  340. package/dist/packages/slider/slider-thumb.js +0 -501
  341. package/dist/packages/slider/slider.d.ts +0 -55
  342. package/dist/packages/slider/slider.js +0 -301
  343. package/dist/packages/slider/slider.react.stories.d.ts +0 -19
  344. package/dist/packages/slider/slider.react.stories.js +0 -140
  345. package/dist/packages/slider/slider.stories.d.ts +0 -21
  346. package/dist/packages/slider/slider.stories.js +0 -404
  347. package/dist/packages/slider/slider.test.d.ts +0 -4
  348. package/dist/packages/slider/slider.test.js +0 -111
  349. package/dist/packages/slider/styles/w-slider-thumb.styles.d.ts +0 -1
  350. package/dist/packages/slider/styles/w-slider-thumb.styles.js +0 -175
  351. package/dist/packages/slider/styles/w-slider.styles.d.ts +0 -1
  352. package/dist/packages/slider/styles/w-slider.styles.js +0 -148
  353. package/dist/packages/slider/styles.d.ts +0 -1
  354. package/dist/packages/slider/styles.js +0 -2
  355. package/dist/packages/stepindicator/index.d.ts +0 -37
  356. package/dist/packages/stepindicator/index.js +0 -195
  357. package/dist/packages/stepindicator/locales/da/messages.d.mts +0 -1
  358. package/dist/packages/stepindicator/locales/da/messages.mjs +0 -1
  359. package/dist/packages/stepindicator/locales/en/messages.d.mts +0 -1
  360. package/dist/packages/stepindicator/locales/en/messages.mjs +0 -1
  361. package/dist/packages/stepindicator/locales/fi/messages.d.mts +0 -1
  362. package/dist/packages/stepindicator/locales/fi/messages.mjs +0 -1
  363. package/dist/packages/stepindicator/locales/nb/messages.d.mts +0 -1
  364. package/dist/packages/stepindicator/locales/nb/messages.mjs +0 -1
  365. package/dist/packages/stepindicator/locales/sv/messages.d.mts +0 -1
  366. package/dist/packages/stepindicator/locales/sv/messages.mjs +0 -1
  367. package/dist/packages/stepindicator/react.d.ts +0 -3
  368. package/dist/packages/stepindicator/stepindicator.react.stories.d.ts +0 -15
  369. package/dist/packages/stepindicator/stepindicator.react.stories.js +0 -112
  370. package/dist/packages/stepindicator/stepindicator.stories.d.ts +0 -12
  371. package/dist/packages/stepindicator/stepindicator.stories.js +0 -172
  372. package/dist/packages/stepindicator/styles.d.ts +0 -1
  373. package/dist/packages/stepindicator/styles.js +0 -2
  374. package/dist/packages/tabs/tab-panel.js +0 -51
  375. package/dist/packages/tabs/tab.js +0 -104
  376. package/dist/packages/textarea/index.d.ts +0 -1
  377. package/dist/packages/textarea/index.js +0 -1
  378. package/dist/packages/textarea/locales/da/messages.d.mts +0 -1
  379. package/dist/packages/textarea/locales/da/messages.mjs +0 -1
  380. package/dist/packages/textarea/locales/en/messages.d.mts +0 -1
  381. package/dist/packages/textarea/locales/en/messages.mjs +0 -1
  382. package/dist/packages/textarea/locales/fi/messages.d.mts +0 -1
  383. package/dist/packages/textarea/locales/fi/messages.mjs +0 -1
  384. package/dist/packages/textarea/locales/nb/messages.d.mts +0 -1
  385. package/dist/packages/textarea/locales/nb/messages.mjs +0 -1
  386. package/dist/packages/textarea/locales/sv/messages.d.mts +0 -1
  387. package/dist/packages/textarea/locales/sv/messages.mjs +0 -1
  388. package/dist/packages/textarea/react.d.ts +0 -11
  389. package/dist/packages/textarea/react.js +0 -21
  390. package/dist/packages/textarea/styles.d.ts +0 -1
  391. package/dist/packages/textarea/styles.js +0 -2
  392. package/dist/packages/textarea/textarea.d.ts +0 -49
  393. package/dist/packages/textarea/textarea.js +0 -220
  394. package/dist/packages/textarea/textarea.react.stories.d.ts +0 -33
  395. package/dist/packages/textarea/textarea.react.stories.js +0 -41
  396. package/dist/packages/textarea/textarea.stories.d.ts +0 -19
  397. package/dist/packages/textarea/textarea.stories.js +0 -85
  398. package/dist/packages/textarea/textarea.test.d.ts +0 -1
  399. package/dist/packages/textarea/textarea.test.js +0 -68
  400. package/dist/packages/toast/index.js.map +0 -7
  401. package/dist/packages/toast/toast-container.js.map +0 -7
  402. package/dist/packages/toggle-styles.d.ts +0 -1
  403. package/dist/packages/toggle-styles.js +0 -108
  404. /package/dist/packages/affix/{index.d.ts → affix.d.ts} +0 -0
  405. /package/dist/packages/alert/{index.d.ts → alert.d.ts} +0 -0
  406. /package/dist/packages/badge/{index.d.ts → badge.d.ts} +0 -0
  407. /package/dist/packages/box/{index.d.ts → box.d.ts} +0 -0
  408. /package/dist/packages/breadcrumbs/{index.d.ts → breadcrumbs.d.ts} +0 -0
  409. /package/dist/packages/card/{index.d.ts → card.d.ts} +0 -0
  410. /package/dist/packages/combobox/{index.d.ts → combobox.d.ts} +0 -0
  411. /package/dist/packages/expandable/{index.d.ts → expandable.d.ts} +0 -0
  412. /package/dist/packages/{pageindicator → icon}/style.d.ts +0 -0
  413. /package/dist/packages/link/{index.d.ts → link.d.ts} +0 -0
  414. /package/dist/packages/modal/{modal-main.d.ts → modal.d.ts} +0 -0
  415. /package/dist/packages/{pagination → page-indicator}/locales/da/messages.d.mts +0 -0
  416. /package/dist/packages/{pagination → page-indicator}/locales/en/messages.d.mts +0 -0
  417. /package/dist/packages/{pagination → page-indicator}/locales/fi/messages.d.mts +0 -0
  418. /package/dist/packages/{pagination → page-indicator}/locales/nb/messages.d.mts +0 -0
  419. /package/dist/packages/{pagination → page-indicator}/locales/sv/messages.d.mts +0 -0
  420. /package/dist/packages/{pageindicator/pageindicator.react.stories.js → page-indicator/page-indicator.react.stories.js} +0 -0
  421. /package/dist/packages/{pagination/styles.d.ts → page-indicator/style.d.ts} +0 -0
  422. /package/dist/packages/pill/{index.d.ts → pill.d.ts} +0 -0
  423. /package/dist/packages/select/{index.d.ts → select.d.ts} +0 -0
  424. /package/dist/packages/switch/{index.d.ts → switch.d.ts} +0 -0
  425. /package/dist/packages/textfield/{index.d.ts → textfield.d.ts} +0 -0
  426. /package/dist/packages/{toast → toast-container}/toast-container.js +0 -0
@@ -1,342 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { html } from 'lit';
8
- import { property, query, state } from 'lit/decorators.js';
9
- import { classMap } from 'lit/directives/class-map.js';
10
- import { BaseFormAssociatedElement } from './form-associated-element';
11
- import { uniqueId } from './math';
12
- import './radio';
13
- // eslint-disable-next-line
14
- // @ts-ignore
15
- import { styles } from './radio-group-styles';
16
- import { RequiredValidator } from './required-validator';
17
- import { HasSlotController } from './slot';
18
- /**
19
- * @slot label - Alternative to the `label` attribute should you need custom HTML.
20
- */
21
- export class WRadioGroup extends BaseFormAssociatedElement {
22
- static { this.css = [styles]; }
23
- static get validators() {
24
- const validators = [
25
- RequiredValidator({
26
- validationElement: Object.assign(document.createElement('input'), {
27
- required: true,
28
- type: 'radio',
29
- // we need an id that's guaranteed to be unique; users will never see this
30
- name: uniqueId('__w-radio'),
31
- }),
32
- }),
33
- ];
34
- return [...super.validators, ...validators];
35
- }
36
- get value() {
37
- if (this.valueHasChanged) {
38
- return this._value;
39
- }
40
- return this._value ?? this.defaultValue;
41
- }
42
- /** The current value of the radio group, submitted as a name/value pair with form data. */
43
- set value(val) {
44
- if (typeof val === 'number')
45
- val = String(val);
46
- this.valueHasChanged = true;
47
- this._value = val;
48
- }
49
- //
50
- // We need this because if we don't have it, FormValidation yells at us that it's "not focusable".
51
- // If we use `this.tabIndex = -1` we can't focus the radio inside.
52
- //
53
- static { this.shadowRootOptions = { ...BaseFormAssociatedElement.shadowRootOptions, delegatesFocus: true }; }
54
- constructor() {
55
- super();
56
- this.hasSlotController = new HasSlotController(this, 'hint', 'label');
57
- this.hasRadioButtons = false;
58
- /**
59
- * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot
60
- * instead.
61
- */
62
- this.label = '';
63
- /** The radio groups's hint. If you need to display HTML, use the `hint` slot instead. */
64
- this.hint = '';
65
- /** The name of the radio group, submitted as a name/value pair with form data. */
66
- this.name = null;
67
- /** Disables the radio group and all child radios. */
68
- this.disabled = false;
69
- /** The orientation in which to show radio items. */
70
- this.orientation = 'vertical';
71
- this._value = null;
72
- /** The default value of the form control. Primarily used for resetting the form control. */
73
- this.defaultValue = this.getAttribute('value') || null;
74
- /** The radio group's size. This size will be applied to all child radios and radio buttons, except when explicitly overridden. */
75
- this.size = 'medium';
76
- /** Ensures a child radio is checked before allowing the containing form to submit. */
77
- this.required = false;
78
- /**
79
- * Used for SSR. if true, will show slotted label on initial render.
80
- */
81
- this.withLabel = false;
82
- /**
83
- * Used for SSR. if true, will show slotted hint on initial render.
84
- */
85
- this.withHint = false;
86
- this.handleRadioClick = (e) => {
87
- const clickedRadio = e.target.closest('w-radio');
88
- /* eslint-disable */
89
- if (!clickedRadio || clickedRadio.disabled || clickedRadio.forceDisabled || this.disabled) {
90
- return;
91
- }
92
- const oldValue = this.value;
93
- this.value = clickedRadio.value;
94
- clickedRadio.checked = true;
95
- const radios = this.getAllRadios();
96
- for (const radio of radios) {
97
- if (clickedRadio === radio) {
98
- continue;
99
- }
100
- radio.checked = false;
101
- radio.setAttribute('tabindex', '-1');
102
- }
103
- if (this.value !== oldValue) {
104
- this.updateComplete.then(() => {
105
- this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
106
- this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
107
- });
108
- }
109
- };
110
- this.addEventListener('keydown', this.handleKeyDown);
111
- this.addEventListener('click', this.handleRadioClick);
112
- }
113
- /**
114
- * We use the first available radio as the validationTarget similar to native HTML that shows the validation popup on
115
- * the first radio element.
116
- */
117
- get validationTarget() {
118
- const radio = this.querySelector(':is(w-radio):not([disabled])');
119
- if (!radio)
120
- return undefined;
121
- return radio;
122
- }
123
- updated(changedProperties) {
124
- if (changedProperties.has('disabled') || changedProperties.has('value')) {
125
- this.syncRadioElements();
126
- }
127
- }
128
- formResetCallback(...args) {
129
- this.value = this.defaultValue;
130
- super.formResetCallback(...args);
131
- this.syncRadioElements();
132
- }
133
- getAllRadios() {
134
- return [...this.querySelectorAll('w-radio')];
135
- }
136
- handleLabelClick() {
137
- this.focus();
138
- }
139
- async syncRadioElements() {
140
- const radios = this.getAllRadios();
141
- let hasRadioButtons = false;
142
- // Add data attributes to support styling
143
- radios.forEach((radio, index) => {
144
- if (radio.appearance === 'button')
145
- hasRadioButtons = true;
146
- radio.setAttribute('size', this.size);
147
- radio.toggleAttribute('data-w-radio-horizontal', this.orientation !== 'vertical');
148
- radio.toggleAttribute('data-w-radio-vertical', this.orientation === 'vertical');
149
- radio.toggleAttribute('data-w-radio-first', index === 0);
150
- radio.toggleAttribute('data-w-radio-inner', index !== 0 && index !== radios.length - 1);
151
- radio.toggleAttribute('data-w-radio-last', index === radios.length - 1);
152
- // Set forceDisabled state based on radio group's disabled state
153
- radio.forceDisabled = this.disabled;
154
- });
155
- // If at least one radio button exists, we assume it's a radio button group
156
- this.hasRadioButtons = hasRadioButtons;
157
- await Promise.all(radios.map(async (radio) => {
158
- await radio.updateComplete;
159
- if (!radio.disabled && radio.value === this.value) {
160
- radio.checked = true;
161
- }
162
- else {
163
- radio.checked = false;
164
- }
165
- }));
166
- // Manage tabIndex based on disabled state and checked status
167
- if (this.disabled) {
168
- // If radio group is disabled, all radios should not be tabbable
169
- radios.forEach((radio) => {
170
- radio.tabIndex = -1;
171
- });
172
- }
173
- else {
174
- // Normal tabbing behavior
175
- const enabledRadios = radios.filter((radio) => !radio.disabled);
176
- const checkedRadio = enabledRadios.find((radio) => radio.checked);
177
- if (enabledRadios.length > 0) {
178
- if (checkedRadio) {
179
- // If there's a checked radio, it should be tabbable
180
- enabledRadios.forEach((radio) => {
181
- radio.tabIndex = radio.checked ? 0 : -1;
182
- });
183
- }
184
- else {
185
- // If no radio is checked, first enabled radio should be tabbable
186
- enabledRadios.forEach((radio, index) => {
187
- radio.tabIndex = index === 0 ? 0 : -1;
188
- });
189
- }
190
- }
191
- // Disabled radios should never be tabbable
192
- radios
193
- .filter((radio) => radio.disabled)
194
- .forEach((radio) => {
195
- radio.tabIndex = -1;
196
- });
197
- }
198
- }
199
- handleKeyDown(event) {
200
- if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key) || this.disabled) {
201
- return;
202
- }
203
- const radios = this.getAllRadios().filter((radio) => !radio.disabled);
204
- if (radios.length <= 0) {
205
- return;
206
- }
207
- event.preventDefault();
208
- const oldValue = this.value;
209
- const checkedRadio = radios.find((radio) => radio.checked) ?? radios[0];
210
- const incr = event.key === ' ' ? 0 : ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;
211
- let index = radios.indexOf(checkedRadio) + incr;
212
- if (!index)
213
- index = 0;
214
- if (index < 0) {
215
- index = radios.length - 1;
216
- }
217
- if (index > radios.length - 1) {
218
- index = 0;
219
- }
220
- const hasRadioButtons = radios.some((radio) => radio.tagName.toLowerCase() === 'w-radio-button');
221
- this.getAllRadios().forEach((radio) => {
222
- radio.checked = false;
223
- if (!hasRadioButtons) {
224
- radio.setAttribute('tabindex', '-1');
225
- }
226
- });
227
- this.value = radios[index].value;
228
- radios[index].checked = true;
229
- if (!hasRadioButtons) {
230
- radios[index].setAttribute('tabindex', '0');
231
- radios[index].focus();
232
- }
233
- else {
234
- radios[index].shadowRoot?.querySelector('button')?.focus();
235
- }
236
- if (this.value !== oldValue) {
237
- this.updateComplete.then(() => {
238
- this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
239
- this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
240
- });
241
- }
242
- event.preventDefault();
243
- }
244
- /** Sets focus on the radio group. */
245
- focus(options) {
246
- if (this.disabled)
247
- return;
248
- const radios = this.getAllRadios();
249
- const checked = radios.find((radio) => radio.checked);
250
- const firstEnabledRadio = radios.find((radio) => !radio.disabled);
251
- const radioToFocus = checked || firstEnabledRadio;
252
- // Call focus for the checked radio. If no radio is checked, focus the first one that isn't disabled.
253
- if (radioToFocus) {
254
- radioToFocus.focus(options);
255
- }
256
- }
257
- render() {
258
- const hasLabelSlot = this.hasUpdated ? this.hasSlotController.test('label') : this.withLabel;
259
- const hasHintSlot = this.hasUpdated ? this.hasSlotController.test('hint') : this.withHint;
260
- const hasLabel = this.label ? true : !!hasLabelSlot;
261
- const hasHint = this.hint ? true : !!hasHintSlot;
262
- return html `
263
- <fieldset
264
- part="form-control"
265
- class=${classMap({
266
- 'form-control': true,
267
- 'form-control-radio-group': true,
268
- 'form-control-has-label': hasLabel,
269
- 'has-radio-buttons': this.hasRadioButtons,
270
- })}
271
- role="radiogroup"
272
- aria-labelledby="label"
273
- aria-describedby="hint"
274
- aria-errormessage="error-message"
275
- aria-orientation=${this.orientation}>
276
- <label
277
- part="form-control-label"
278
- id="label"
279
- class="label"
280
- aria-hidden=${hasLabel ? 'false' : 'true'}
281
- @click=${this.handleLabelClick}>
282
- <slot name="label">${this.label}</slot>
283
- </label>
284
-
285
- <slot part="form-control-input" @slotchange=${this.syncRadioElements}></slot>
286
-
287
- <slot
288
- id="hint"
289
- name="hint"
290
- part="hint"
291
- class=${classMap({
292
- 'has-slotted': hasHint,
293
- })}
294
- aria-hidden=${hasHint ? 'false' : 'true'}
295
- >${this.hint}</slot
296
- >
297
- </fieldset>
298
- `;
299
- }
300
- }
301
- __decorate([
302
- state()
303
- ], WRadioGroup.prototype, "hasRadioButtons", void 0);
304
- __decorate([
305
- query('slot:not([name])')
306
- ], WRadioGroup.prototype, "defaultSlot", void 0);
307
- __decorate([
308
- property()
309
- ], WRadioGroup.prototype, "label", void 0);
310
- __decorate([
311
- property({ attribute: 'hint' })
312
- ], WRadioGroup.prototype, "hint", void 0);
313
- __decorate([
314
- property({ reflect: true })
315
- ], WRadioGroup.prototype, "name", void 0);
316
- __decorate([
317
- property({ type: Boolean, reflect: true })
318
- ], WRadioGroup.prototype, "disabled", void 0);
319
- __decorate([
320
- property({ reflect: true })
321
- ], WRadioGroup.prototype, "orientation", void 0);
322
- __decorate([
323
- state()
324
- ], WRadioGroup.prototype, "value", null);
325
- __decorate([
326
- property({ attribute: 'value', reflect: true })
327
- ], WRadioGroup.prototype, "defaultValue", void 0);
328
- __decorate([
329
- property({ reflect: true })
330
- ], WRadioGroup.prototype, "size", void 0);
331
- __decorate([
332
- property({ type: Boolean, reflect: true })
333
- ], WRadioGroup.prototype, "required", void 0);
334
- __decorate([
335
- property({ type: Boolean, attribute: 'with-label' })
336
- ], WRadioGroup.prototype, "withLabel", void 0);
337
- __decorate([
338
- property({ type: Boolean, attribute: 'with-hint' })
339
- ], WRadioGroup.prototype, "withHint", void 0);
340
- if (!customElements.get('w-radio-group')) {
341
- customElements.define('w-radio-group', WRadioGroup);
342
- }
File without changes
File without changes
@@ -1,38 +0,0 @@
1
- import type { PropertyValues } from 'lit';
2
- import { BaseFormAssociatedElement } from './form-associated-element';
3
- export declare class WRadio extends BaseFormAssociatedElement {
4
- static css: import("lit").CSSResult[];
5
- checked: boolean;
6
- /** @internal Used by radio group to force disable radios while preserving their original disabled state. */
7
- forceDisabled: boolean;
8
- /**
9
- * The string pointing to a form's id.
10
- */
11
- form: string | null;
12
- /** The radio's value. When selected, the radio group will receive this value. */
13
- value: string;
14
- /** The radio's value. When selected, the radio group will receive this value. */
15
- appearance: 'default' | 'button' | 'clickable';
16
- /**
17
- * The radio's size. When used inside a radio group, the size will be determined by the radio group's size so this
18
- * attribute can typically be omitted.
19
- */
20
- size: 'small' | 'medium' | 'large';
21
- /** Disables the radio. */
22
- disabled: boolean;
23
- constructor();
24
- connectedCallback(): void;
25
- private setInitialAttributes;
26
- updated(changedProperties: PropertyValues<this>): void;
27
- /**
28
- * @override
29
- */
30
- setValue(): void;
31
- private handleClick;
32
- render(): import("lit").TemplateResult<1>;
33
- }
34
- declare global {
35
- interface HTMLElementTagNameMap {
36
- 'w-radio': WRadio;
37
- }
38
- }
@@ -1,115 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { html } from 'lit';
8
- import { property, state } from 'lit/decorators.js';
9
- import { BaseFormAssociatedElement } from './form-associated-element';
10
- // eslint-disable-next-line
11
- // @ts-ignore
12
- import { toggleStyles } from '../toggle-styles';
13
- import { reset } from '../styles';
14
- export class WRadio extends BaseFormAssociatedElement {
15
- static { this.css = [reset, toggleStyles]; }
16
- constructor() {
17
- super();
18
- this.checked = false;
19
- /** @internal Used by radio group to force disable radios while preserving their original disabled state. */
20
- this.forceDisabled = false;
21
- /**
22
- * The string pointing to a form's id.
23
- */
24
- this.form = null;
25
- /** The radio's value. When selected, the radio group will receive this value. */
26
- this.appearance = 'default';
27
- /**
28
- * The radio's size. When used inside a radio group, the size will be determined by the radio group's size so this
29
- * attribute can typically be omitted.
30
- */
31
- this.size = 'medium';
32
- /** Disables the radio. */
33
- this.disabled = false;
34
- // Update the handleClick method (around line 75)
35
- this.handleClick = () => {
36
- if (!this.disabled && !this.forceDisabled) {
37
- this.checked = true;
38
- }
39
- };
40
- this.addEventListener('click', this.handleClick);
41
- }
42
- connectedCallback() {
43
- super.connectedCallback();
44
- this.setInitialAttributes();
45
- }
46
- setInitialAttributes() {
47
- this.setAttribute('role', 'radio');
48
- this.tabIndex = 0;
49
- this.setAttribute('aria-disabled', this.disabled || this.forceDisabled ? 'true' : 'false');
50
- }
51
- updated(changedProperties) {
52
- super.updated(changedProperties);
53
- if (changedProperties.has('checked')) {
54
- this.customStates.set('checked', this.checked);
55
- this[this.checked ? 'setAttribute' : 'removeAttribute']('checked-ui', '');
56
- this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
57
- // Only set tabIndex if not disabled
58
- if (!this.disabled && !this.forceDisabled) {
59
- this.tabIndex = this.checked ? 0 : -1;
60
- }
61
- }
62
- if (changedProperties.has('disabled') || changedProperties.has('forceDisabled')) {
63
- const effectivelyDisabled = this.disabled || this.forceDisabled;
64
- this.customStates.set('disabled', effectivelyDisabled);
65
- this[effectivelyDisabled ? 'setAttribute' : 'removeAttribute']('disabled-ui', '');
66
- this.setAttribute('aria-disabled', effectivelyDisabled ? 'true' : 'false');
67
- // Set tabIndex based on disabled state
68
- if (effectivelyDisabled) {
69
- this.tabIndex = -1;
70
- }
71
- else {
72
- // Restore proper tabIndex - this will be managed by the radio group
73
- this.tabIndex = this.checked ? 0 : -1;
74
- }
75
- }
76
- }
77
- /**
78
- * @override
79
- */
80
- setValue() {
81
- // We override `setValue` because we don't want to set form values from here. We want to do that in "RadioGroup" itself.
82
- }
83
- render() {
84
- return html `
85
- <div class="wrapper">
86
- <div part="control" class="control"></div>
87
- <slot part="label" class="label"></slot>
88
- </div>
89
- `;
90
- }
91
- }
92
- __decorate([
93
- state()
94
- ], WRadio.prototype, "checked", void 0);
95
- __decorate([
96
- state()
97
- ], WRadio.prototype, "forceDisabled", void 0);
98
- __decorate([
99
- property({ reflect: true })
100
- ], WRadio.prototype, "form", void 0);
101
- __decorate([
102
- property({ reflect: true })
103
- ], WRadio.prototype, "value", void 0);
104
- __decorate([
105
- property({ reflect: true })
106
- ], WRadio.prototype, "appearance", void 0);
107
- __decorate([
108
- property({ reflect: true })
109
- ], WRadio.prototype, "size", void 0);
110
- __decorate([
111
- property({ type: Boolean })
112
- ], WRadio.prototype, "disabled", void 0);
113
- if (!customElements.get('w-radio')) {
114
- customElements.define('w-radio', WRadio);
115
- }
@@ -1,9 +0,0 @@
1
- import { StoryObj } from '@storybook/react';
2
- import { Radio } from './react';
3
- declare const _default: {
4
- title: string;
5
- component: import("@lit/react").ReactWebComponent<import("./radio").WRadio, {}>;
6
- };
7
- export default _default;
8
- export type Story = StoryObj<typeof Radio>;
9
- export declare const Primary: Story;
@@ -1,10 +0,0 @@
1
- import { Radio } from './react';
2
- export default {
3
- title: 'Forms/Radio',
4
- component: Radio,
5
- };
6
- export const Primary = {
7
- args: {
8
- children: 'Hello',
9
- },
10
- };
@@ -1,15 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
- import type { WRadioGroup } from './radio-group.js';
3
- import './radio';
4
- import './radio-group';
5
- declare const args: Partial<WRadioGroup> & {
6
- [key: string]: any;
7
- };
8
- declare const meta: Meta<typeof args>;
9
- export default meta;
10
- type Story = StoryObj<typeof args>;
11
- export declare const Default: Story;
12
- export declare const Disabled: Story;
13
- export declare const Required: Story;
14
- export declare const DisabledGroup: Story;
15
- export declare const DisabledRadio: Story;
@@ -1,61 +0,0 @@
1
- import { spread } from '@open-wc/lit-helpers';
2
- import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
3
- import { html } from 'lit';
4
- import { prespread } from '../../.storybook/utilities.js';
5
- import './radio';
6
- import './radio-group';
7
- const { events: radioEvents, args: radioArgs, argTypes: radioArgTypes } = getStorybookHelpers('w-radio');
8
- const { events, args, argTypes } = getStorybookHelpers('w-radio-group');
9
- const meta = {
10
- title: 'Forms/Radio',
11
- render: (args) => {
12
- return html `
13
- <w-radio-group ${spread(prespread(args))}>
14
- <w-radio value="foo">foo</w-radio>
15
- <w-radio value="bar">bar</w-radio>
16
- </w-radio-group>
17
- `;
18
- },
19
- };
20
- export default meta;
21
- export const Default = {
22
- args: {
23
- label: 'Group',
24
- name: 'foobar',
25
- value: 'foo',
26
- },
27
- };
28
- export const Disabled = {
29
- args: {
30
- label: 'Disabled',
31
- disabled: true,
32
- },
33
- };
34
- export const Required = {
35
- args: {},
36
- render() {
37
- return html `
38
- <form>
39
- <w-radio-group required>
40
- <w-radio value="foo">foo</w-radio>
41
- <w-radio value="bar">bar</w-radio>
42
- </w-radio-group>
43
- <button>click me</button>
44
- </form>
45
- `;
46
- },
47
- };
48
- export const DisabledGroup = {
49
- args: { disabled: true },
50
- };
51
- export const DisabledRadio = {
52
- args: {},
53
- render() {
54
- return html `
55
- <w-radio-group>
56
- <w-radio value="foo" disabled appearance="button">disabled</w-radio>
57
- <w-radio value="bar" appearance="clickable">not disabled</w-radio>
58
- </w-radio-group>
59
- `;
60
- },
61
- };
@@ -1,9 +0,0 @@
1
- import { WRadio } from './radio.js';
2
- import { WRadioGroup } from './radio-group.js';
3
- export declare const Radio: import("@lit/react").ReactWebComponent<WRadio, {}>;
4
- export declare const RadioGroup: import("@lit/react").ReactWebComponent<WRadioGroup, {
5
- onInput: string;
6
- oninput: string;
7
- onChange: string;
8
- onchange: string;
9
- }>;
@@ -1,22 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import React from 'react';
3
- import { createComponent } from '@lit/react';
4
- // decouple from CDN by providing a dummy class
5
- class Component extends LitElement {
6
- }
7
- export const Radio = createComponent({
8
- tagName: 'w-radio',
9
- elementClass: Component,
10
- react: React,
11
- });
12
- export const RadioGroup = createComponent({
13
- tagName: 'w-radio-group',
14
- elementClass: Component,
15
- react: React,
16
- events: {
17
- onInput: 'input',
18
- oninput: 'input',
19
- onChange: 'change',
20
- onchange: 'change',
21
- },
22
- });
@@ -1,11 +0,0 @@
1
- import type { Validator } from './form-associated-element';
2
- export interface RequiredValidatorOptions {
3
- /** This is a cheap way for us to get translation strings for the user without having proper translations. */
4
- validationElement?: HTMLSelectElement | HTMLInputElement;
5
- /**
6
- * The property to check if its not null-ish. For most elements this will be "value".
7
- * For "checkbox" for example it will be "checked"
8
- */
9
- validationProperty?: string;
10
- }
11
- export declare const RequiredValidator: (options?: RequiredValidatorOptions) => Validator;
@@ -1,34 +0,0 @@
1
- export const RequiredValidator = (options = {}) => {
2
- let { validationElement, validationProperty } = options;
3
- if (!validationElement) {
4
- validationElement = Object.assign(document.createElement('input'), { required: true });
5
- }
6
- if (!validationProperty) {
7
- validationProperty = 'value';
8
- }
9
- const obj = {
10
- observedAttributes: ['required'],
11
- message: validationElement.validationMessage, // @TODO: Add a translation.
12
- checkValidity(element) {
13
- const validity = {
14
- message: '',
15
- isValid: true,
16
- invalidKeys: [],
17
- };
18
- const isRequired = element.required ?? element.hasAttribute('required');
19
- // Always true if the element isn't required.
20
- if (!isRequired) {
21
- return validity;
22
- }
23
- const value = element[validationProperty];
24
- const isEmpty = !value;
25
- if (isEmpty) {
26
- validity.message = typeof obj.message === 'function' ? obj.message(element) : obj.message || '';
27
- validity.isValid = false;
28
- validity.invalidKeys.push('valueMissing');
29
- }
30
- return validity;
31
- },
32
- };
33
- return obj;
34
- };