@webtides/element-library 0.1.2 → 0.3.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 (398) hide show
  1. package/CHANGELOG.md +390 -3
  2. package/README.md +61 -41
  3. package/all.js +28 -0
  4. package/catalog.d.ts +14 -0
  5. package/catalog.js +63 -0
  6. package/custom-elements.json +16604 -3420
  7. package/package.json +37 -25
  8. package/src/components/accordion/accordion.changelog.md +10 -0
  9. package/src/components/accordion/accordion.js +10 -7
  10. package/src/components/accordion/accordion.readme.md +2 -0
  11. package/src/components/accordion/accordion.style.js +8 -0
  12. package/src/components/amount-field/amount-field.changelog.md +23 -3
  13. package/src/components/amount-field/amount-field.js +53 -26
  14. package/src/components/amount-field/amount-field.readme.md +82 -20
  15. package/src/components/amount-field/amount-field.style.js +111 -47
  16. package/src/components/avatar/avatar.changelog.md +23 -0
  17. package/src/components/avatar/avatar.define.js +3 -0
  18. package/src/components/avatar/avatar.js +115 -0
  19. package/src/components/avatar/avatar.readme.md +132 -0
  20. package/src/components/avatar/avatar.style.js +67 -0
  21. package/src/components/badge/badge.changelog.md +23 -0
  22. package/src/components/badge/badge.define.js +3 -0
  23. package/src/components/badge/badge.js +59 -0
  24. package/src/components/badge/badge.readme.md +109 -0
  25. package/src/components/badge/badge.style.js +63 -0
  26. package/src/components/breadcrumb/breadcrumb.changelog.md +22 -0
  27. package/src/components/breadcrumb/breadcrumb.define.js +3 -0
  28. package/src/components/breadcrumb/breadcrumb.js +47 -0
  29. package/src/components/breadcrumb/breadcrumb.readme.md +108 -0
  30. package/src/components/breadcrumb/breadcrumb.style.js +20 -0
  31. package/src/components/breadcrumb-item/breadcrumb-item.changelog.md +23 -0
  32. package/src/components/breadcrumb-item/breadcrumb-item.define.js +3 -0
  33. package/src/components/breadcrumb-item/breadcrumb-item.js +82 -0
  34. package/src/components/breadcrumb-item/breadcrumb-item.readme.md +106 -0
  35. package/src/components/breadcrumb-item/breadcrumb-item.style.js +92 -0
  36. package/src/components/button/button.changelog.md +34 -1
  37. package/src/components/button/button.js +285 -29
  38. package/src/components/button/button.readme.md +130 -10
  39. package/src/components/button/button.style.js +99 -120
  40. package/src/components/button-group/button-group.changelog.md +24 -0
  41. package/src/components/button-group/button-group.define.js +3 -0
  42. package/src/components/button-group/button-group.js +53 -0
  43. package/src/components/button-group/button-group.readme.md +114 -0
  44. package/src/components/button-group/button-group.style.js +41 -0
  45. package/src/components/card/card.changelog.md +23 -0
  46. package/src/components/card/card.define.js +3 -0
  47. package/src/components/card/card.js +73 -0
  48. package/src/components/card/card.readme.md +136 -0
  49. package/src/components/card/card.style.js +99 -0
  50. package/src/components/carousel/carousel.changelog.md +20 -0
  51. package/src/components/carousel/carousel.js +89 -40
  52. package/src/components/carousel/carousel.readme.md +39 -6
  53. package/src/components/carousel/carousel.style.js +21 -77
  54. package/src/components/carousel/glide/components/ShadowAnchors.js +3 -1
  55. package/src/components/carousel/glide/components/ShadowClones.js +21 -24
  56. package/src/components/carousel/glide/components/ShadowGaps.js +2 -2
  57. package/src/components/carousel/glide/components/ShadowHtml.js +22 -3
  58. package/src/components/checkbox-field/checkbox-field.changelog.md +19 -0
  59. package/src/components/checkbox-field/checkbox-field.js +25 -10
  60. package/src/components/checkbox-field/checkbox-field.readme.md +17 -4
  61. package/src/components/checkbox-field/checkbox-field.style.js +15 -3
  62. package/src/components/checkbox-group-field/checkbox-group-field.changelog.md +25 -0
  63. package/src/components/checkbox-group-field/checkbox-group-field.define.js +3 -0
  64. package/src/components/checkbox-group-field/checkbox-group-field.js +217 -0
  65. package/src/components/checkbox-group-field/checkbox-group-field.readme.md +95 -0
  66. package/src/components/checkbox-group-field/checkbox-group-field.style.js +62 -0
  67. package/src/components/color-field/color-field.changelog.md +24 -0
  68. package/src/components/color-field/color-field.define.js +3 -0
  69. package/src/components/color-field/color-field.js +184 -0
  70. package/src/components/color-field/color-field.readme.md +95 -0
  71. package/src/components/color-field/color-field.style.js +39 -0
  72. package/src/components/combobox-field/combobox-field.changelog.md +23 -0
  73. package/src/components/combobox-field/combobox-field.define.js +3 -0
  74. package/src/components/combobox-field/combobox-field.js +97 -0
  75. package/src/components/combobox-field/combobox-field.readme.md +93 -0
  76. package/src/components/combobox-field/combobox-field.style.js +56 -0
  77. package/src/components/copy-button/copy-button.changelog.md +24 -0
  78. package/src/components/copy-button/copy-button.define.js +3 -0
  79. package/src/components/copy-button/copy-button.events.js +4 -0
  80. package/src/components/copy-button/copy-button.js +237 -0
  81. package/src/components/copy-button/copy-button.readme.md +134 -0
  82. package/src/components/copy-button/copy-button.style.js +109 -0
  83. package/src/components/date-field/date-field.changelog.md +24 -0
  84. package/src/components/date-field/date-field.define.js +3 -0
  85. package/src/components/date-field/date-field.js +119 -0
  86. package/src/components/date-field/date-field.readme.md +110 -0
  87. package/src/components/date-field/date-field.style.js +53 -0
  88. package/src/components/dialog/dialog.changelog.md +16 -1
  89. package/src/components/dialog/dialog.js +252 -57
  90. package/src/components/dialog/dialog.readme.md +36 -4
  91. package/src/components/dialog/dialog.style.js +9 -109
  92. package/src/components/divider/divider.changelog.md +23 -0
  93. package/src/components/divider/divider.define.js +3 -0
  94. package/src/components/divider/divider.js +48 -0
  95. package/src/components/divider/divider.readme.md +101 -0
  96. package/src/components/divider/divider.style.js +50 -0
  97. package/src/components/drawer/drawer.changelog.md +25 -0
  98. package/src/components/drawer/drawer.define.js +3 -0
  99. package/src/components/drawer/drawer.events.js +8 -0
  100. package/src/components/drawer/drawer.js +80 -0
  101. package/src/components/drawer/drawer.readme.md +194 -0
  102. package/src/components/drawer/drawer.style.js +83 -0
  103. package/src/components/dropdown/dropdown.js +9 -7
  104. package/src/components/empty-state/empty-state.changelog.md +22 -0
  105. package/src/components/empty-state/empty-state.define.js +3 -0
  106. package/src/components/empty-state/empty-state.js +55 -0
  107. package/src/components/empty-state/empty-state.readme.md +114 -0
  108. package/src/components/empty-state/empty-state.style.js +60 -0
  109. package/src/components/file-field/file-field.changelog.md +24 -0
  110. package/src/components/file-field/file-field.define.js +3 -0
  111. package/src/components/file-field/file-field.js +205 -0
  112. package/src/components/file-field/file-field.readme.md +103 -0
  113. package/src/components/file-field/file-field.style.js +28 -0
  114. package/src/components/form-field/form-field.changelog.md +25 -0
  115. package/src/components/form-field/form-field.js +212 -15
  116. package/src/components/form-field/form-field.readme.md +82 -18
  117. package/src/components/form-field/form-field.style.js +6 -24
  118. package/src/components/input-field/input-field.changelog.md +24 -0
  119. package/src/components/input-field/input-field.js +82 -6
  120. package/src/components/input-field/input-field.readme.md +34 -5
  121. package/src/components/input-field/input-field.style.js +32 -13
  122. package/src/components/notification/notification.changelog.md +21 -1
  123. package/src/components/notification/notification.js +80 -74
  124. package/src/components/notification/notification.readme.md +54 -13
  125. package/src/components/notification/notification.style.js +37 -22
  126. package/src/components/otp-field/otp-field.changelog.md +23 -0
  127. package/src/components/otp-field/otp-field.define.js +3 -0
  128. package/src/components/otp-field/otp-field.events.js +3 -0
  129. package/src/components/otp-field/otp-field.js +172 -0
  130. package/src/components/otp-field/otp-field.readme.md +111 -0
  131. package/src/components/otp-field/otp-field.style.js +53 -0
  132. package/src/components/pagination/pagination.changelog.md +30 -0
  133. package/src/components/pagination/pagination.define.js +3 -0
  134. package/src/components/pagination/pagination.events.js +3 -0
  135. package/src/components/pagination/pagination.js +282 -0
  136. package/src/components/pagination/pagination.readme.md +167 -0
  137. package/src/components/pagination/pagination.style.js +162 -0
  138. package/src/components/password-field/password-field.changelog.md +24 -0
  139. package/src/components/password-field/password-field.js +7 -1
  140. package/src/components/password-field/password-field.readme.md +15 -6
  141. package/src/components/password-field/password-field.style.js +36 -13
  142. package/src/components/popover/popover.changelog.md +24 -0
  143. package/src/components/popover/popover.define.js +3 -0
  144. package/src/components/popover/popover.events.js +4 -0
  145. package/src/components/popover/popover.js +255 -0
  146. package/src/components/popover/popover.readme.md +132 -0
  147. package/src/components/popover/popover.style.js +41 -0
  148. package/src/components/progress-bar/progress-bar.changelog.md +23 -0
  149. package/src/components/progress-bar/progress-bar.define.js +3 -0
  150. package/src/components/progress-bar/progress-bar.js +80 -0
  151. package/src/components/progress-bar/progress-bar.readme.md +110 -0
  152. package/src/components/progress-bar/progress-bar.style.js +93 -0
  153. package/src/components/progress-ring/progress-ring.changelog.md +23 -0
  154. package/src/components/progress-ring/progress-ring.define.js +3 -0
  155. package/src/components/progress-ring/progress-ring.js +83 -0
  156. package/src/components/progress-ring/progress-ring.readme.md +115 -0
  157. package/src/components/progress-ring/progress-ring.style.js +85 -0
  158. package/src/components/radio-field/radio-field.changelog.md +16 -0
  159. package/src/components/radio-field/radio-field.js +34 -11
  160. package/src/components/radio-field/radio-field.readme.md +13 -8
  161. package/src/components/radio-field/radio-field.style.js +17 -65
  162. package/src/components/range-field/range-field.changelog.md +24 -0
  163. package/src/components/range-field/range-field.define.js +3 -0
  164. package/src/components/range-field/range-field.js +167 -0
  165. package/src/components/range-field/range-field.readme.md +87 -0
  166. package/src/components/range-field/range-field.style.js +41 -0
  167. package/src/components/rating-field/rating-field.changelog.md +24 -0
  168. package/src/components/rating-field/rating-field.define.js +3 -0
  169. package/src/components/rating-field/rating-field.js +195 -0
  170. package/src/components/rating-field/rating-field.readme.md +82 -0
  171. package/src/components/rating-field/rating-field.style.js +79 -0
  172. package/src/components/select-field/select-field.changelog.md +17 -0
  173. package/src/components/select-field/select-field.js +100 -8
  174. package/src/components/select-field/select-field.readme.md +32 -6
  175. package/src/components/select-field/select-field.style.js +19 -9
  176. package/src/components/skeleton/skeleton.changelog.md +22 -0
  177. package/src/components/skeleton/skeleton.define.js +3 -0
  178. package/src/components/skeleton/skeleton.js +49 -0
  179. package/src/components/skeleton/skeleton.readme.md +115 -0
  180. package/src/components/skeleton/skeleton.style.js +79 -0
  181. package/src/components/slider/slider.changelog.md +15 -0
  182. package/src/components/slider/slider.js +37 -5
  183. package/src/components/slider/slider.readme.md +28 -6
  184. package/src/components/slider/slider.style.js +7 -71
  185. package/src/components/spinner/spinner.changelog.md +22 -0
  186. package/src/components/spinner/spinner.define.js +3 -0
  187. package/src/components/spinner/spinner.js +48 -0
  188. package/src/components/spinner/spinner.readme.md +98 -0
  189. package/src/components/spinner/spinner.style.js +44 -0
  190. package/src/components/switch-field/switch-field.changelog.md +16 -0
  191. package/src/components/switch-field/switch-field.js +17 -9
  192. package/src/components/switch-field/switch-field.readme.md +11 -4
  193. package/src/components/switch-field/switch-field.style.js +13 -13
  194. package/src/components/tab-group/tab-group.changelog.md +19 -0
  195. package/src/components/tab-group/tab-group.js +122 -10
  196. package/src/components/tab-group/tab-group.readme.md +25 -4
  197. package/src/components/tab-link/tab-link.changelog.md +16 -0
  198. package/src/components/tab-link/tab-link.js +51 -8
  199. package/src/components/tab-link/tab-link.readme.md +14 -8
  200. package/src/components/tab-link/tab-link.style.js +13 -0
  201. package/src/components/tab-panel/tab-panel.changelog.md +8 -2
  202. package/src/components/tab-panel/tab-panel.js +7 -3
  203. package/src/components/tab-panel/tab-panel.readme.md +7 -5
  204. package/src/components/tag/tag.changelog.md +24 -0
  205. package/src/components/tag/tag.define.js +3 -0
  206. package/src/components/tag/tag.events.js +3 -0
  207. package/src/components/tag/tag.js +116 -0
  208. package/src/components/tag/tag.readme.md +119 -0
  209. package/src/components/tag/tag.style.js +101 -0
  210. package/src/components/tag-field/tag-field.changelog.md +25 -0
  211. package/src/components/tag-field/tag-field.define.js +3 -0
  212. package/src/components/tag-field/tag-field.js +359 -0
  213. package/src/components/tag-field/tag-field.readme.md +113 -0
  214. package/src/components/tag-field/tag-field.style.js +62 -0
  215. package/src/components/textarea-field/textarea-field.changelog.md +28 -4
  216. package/src/components/textarea-field/textarea-field.js +68 -14
  217. package/src/components/textarea-field/textarea-field.readme.md +45 -9
  218. package/src/components/textarea-field/textarea-field.style.js +45 -2
  219. package/src/components/toast/toast.changelog.md +24 -0
  220. package/src/components/toast/toast.define.js +3 -0
  221. package/src/components/toast/toast.js +193 -0
  222. package/src/components/toast/toast.readme.md +189 -0
  223. package/src/components/toast/toast.style.js +74 -0
  224. package/src/components/tooltip/tooltip.changelog.md +24 -0
  225. package/src/components/tooltip/tooltip.define.js +3 -0
  226. package/src/components/tooltip/tooltip.events.js +4 -0
  227. package/src/components/tooltip/tooltip.js +377 -0
  228. package/src/components/tooltip/tooltip.readme.md +172 -0
  229. package/src/components/tooltip/tooltip.style.js +107 -0
  230. package/src/components/transition-classes/transition-classes.js +6 -6
  231. package/src/styles/appearance.style.js +42 -0
  232. package/src/styles/arrow.style.js +65 -0
  233. package/src/styles/choice-group.style.js +94 -0
  234. package/src/styles/form-control.style.js +79 -0
  235. package/src/styles/host.style.js +55 -0
  236. package/src/styles/layers.css +31 -0
  237. package/src/styles/modal.style.js +146 -0
  238. package/src/styles/native.css +275 -0
  239. package/src/styles/size.style.js +48 -0
  240. package/src/styles/slide-controls.style.js +225 -0
  241. package/src/styles/utilities.css +30 -0
  242. package/src/styles/variants.style.js +78 -0
  243. package/src/themes/default.css +86 -142
  244. package/src/themes/high-contrast.css +72 -129
  245. package/src/themes/sketchy.css +95 -175
  246. package/src/utils/floating.js +71 -0
  247. package/src/utils/focus.js +18 -0
  248. package/src/utils/progress.js +25 -0
  249. package/src/utils/slots.js +21 -0
  250. package/src/utils/text-entry-attributes.js +51 -0
  251. package/types/all.d.ts +54 -1
  252. package/types/index.d.ts +1 -0
  253. package/types/src/components/accordion/accordion.d.ts +6 -4
  254. package/types/src/components/accordion/accordion.events.d.ts +3 -3
  255. package/types/src/components/accordion-group/accordion-group.d.ts +4 -3
  256. package/types/src/components/amount-field/amount-field.d.ts +30 -16
  257. package/types/src/components/avatar/avatar.d.ts +57 -0
  258. package/types/src/components/avatar/avatar.define.d.ts +1 -0
  259. package/types/src/components/avatar/avatar.style.d.ts +2 -0
  260. package/types/src/components/badge/badge.d.ts +32 -0
  261. package/types/src/components/badge/badge.define.d.ts +1 -0
  262. package/types/src/components/badge/badge.style.d.ts +2 -0
  263. package/types/src/components/breadcrumb/breadcrumb.d.ts +27 -0
  264. package/types/src/components/breadcrumb/breadcrumb.define.d.ts +1 -0
  265. package/types/src/components/breadcrumb/breadcrumb.style.d.ts +2 -0
  266. package/types/src/components/breadcrumb-item/breadcrumb-item.d.ts +38 -0
  267. package/types/src/components/breadcrumb-item/breadcrumb-item.define.d.ts +1 -0
  268. package/types/src/components/breadcrumb-item/breadcrumb-item.style.d.ts +2 -0
  269. package/types/src/components/button/button.d.ts +129 -14
  270. package/types/src/components/button-group/button-group.d.ts +28 -0
  271. package/types/src/components/button-group/button-group.define.d.ts +1 -0
  272. package/types/src/components/button-group/button-group.style.d.ts +2 -0
  273. package/types/src/components/card/card.d.ts +40 -0
  274. package/types/src/components/card/card.define.d.ts +1 -0
  275. package/types/src/components/card/card.style.d.ts +2 -0
  276. package/types/src/components/carousel/carousel.d.ts +22 -8
  277. package/types/src/components/carousel/carousel.events.d.ts +3 -3
  278. package/types/src/components/carousel/glide/components/ShadowAnchors.d.ts +1 -1
  279. package/types/src/components/carousel/glide/components/ShadowClones.d.ts +8 -1
  280. package/types/src/components/carousel/glide/components/ShadowGaps.d.ts +1 -1
  281. package/types/src/components/carousel/glide/components/ShadowHtml.d.ts +1 -1
  282. package/types/src/components/carousel/glide/components/glide-html.d.ts +1 -1
  283. package/types/src/components/checkbox-field/checkbox-field.d.ts +22 -15
  284. package/types/src/components/checkbox-group-field/checkbox-group-field.d.ts +100 -0
  285. package/types/src/components/checkbox-group-field/checkbox-group-field.define.d.ts +1 -0
  286. package/types/src/components/checkbox-group-field/checkbox-group-field.style.d.ts +2 -0
  287. package/types/src/components/color-field/color-field.d.ts +102 -0
  288. package/types/src/components/color-field/color-field.define.d.ts +1 -0
  289. package/types/src/components/color-field/color-field.style.d.ts +2 -0
  290. package/types/src/components/combobox-field/combobox-field.d.ts +84 -0
  291. package/types/src/components/combobox-field/combobox-field.define.d.ts +1 -0
  292. package/types/src/components/combobox-field/combobox-field.style.d.ts +2 -0
  293. package/types/src/components/copy-button/copy-button.d.ts +93 -0
  294. package/types/src/components/copy-button/copy-button.define.d.ts +1 -0
  295. package/types/src/components/copy-button/copy-button.events.d.ts +5 -0
  296. package/types/src/components/copy-button/copy-button.style.d.ts +2 -0
  297. package/types/src/components/date-field/date-field.d.ts +102 -0
  298. package/types/src/components/date-field/date-field.define.d.ts +1 -0
  299. package/types/src/components/date-field/date-field.style.d.ts +2 -0
  300. package/types/src/components/dialog/dialog.d.ts +101 -19
  301. package/types/src/components/dialog/dialog.events.d.ts +8 -8
  302. package/types/src/components/divider/divider.d.ts +27 -0
  303. package/types/src/components/divider/divider.define.d.ts +1 -0
  304. package/types/src/components/divider/divider.style.d.ts +2 -0
  305. package/types/src/components/drawer/drawer.d.ts +70 -0
  306. package/types/src/components/drawer/drawer.define.d.ts +1 -0
  307. package/types/src/components/drawer/drawer.events.d.ts +9 -0
  308. package/types/src/components/drawer/drawer.style.d.ts +2 -0
  309. package/types/src/components/dropdown/dropdown.d.ts +5 -3
  310. package/types/src/components/empty-state/empty-state.d.ts +29 -0
  311. package/types/src/components/empty-state/empty-state.define.d.ts +1 -0
  312. package/types/src/components/empty-state/empty-state.style.d.ts +2 -0
  313. package/types/src/components/file-field/file-field.d.ts +115 -0
  314. package/types/src/components/file-field/file-field.define.d.ts +1 -0
  315. package/types/src/components/file-field/file-field.style.d.ts +2 -0
  316. package/types/src/components/form-field/form-field.d.ts +129 -14
  317. package/types/src/components/form-field/form-field.events.d.ts +4 -4
  318. package/types/src/components/input-field/input-field.d.ts +52 -5
  319. package/types/src/components/lazy-src/lazy-src.d.ts +7 -5
  320. package/types/src/components/lazy-src/lazy-src.events.d.ts +5 -5
  321. package/types/src/components/notification/notification.d.ts +18 -18
  322. package/types/src/components/notification/notification.events.d.ts +6 -6
  323. package/types/src/components/otp-field/otp-field.d.ts +130 -0
  324. package/types/src/components/otp-field/otp-field.define.d.ts +1 -0
  325. package/types/src/components/otp-field/otp-field.events.d.ts +4 -0
  326. package/types/src/components/otp-field/otp-field.style.d.ts +2 -0
  327. package/types/src/components/pagination/pagination.d.ts +117 -0
  328. package/types/src/components/pagination/pagination.define.d.ts +1 -0
  329. package/types/src/components/pagination/pagination.events.d.ts +4 -0
  330. package/types/src/components/pagination/pagination.style.d.ts +2 -0
  331. package/types/src/components/password-field/password-field.d.ts +29 -12
  332. package/types/src/components/popover/popover.d.ts +123 -0
  333. package/types/src/components/popover/popover.define.d.ts +1 -0
  334. package/types/src/components/popover/popover.events.d.ts +5 -0
  335. package/types/src/components/popover/popover.style.d.ts +2 -0
  336. package/types/src/components/progress-bar/progress-bar.d.ts +35 -0
  337. package/types/src/components/progress-bar/progress-bar.define.d.ts +1 -0
  338. package/types/src/components/progress-bar/progress-bar.style.d.ts +2 -0
  339. package/types/src/components/progress-ring/progress-ring.d.ts +40 -0
  340. package/types/src/components/progress-ring/progress-ring.define.d.ts +1 -0
  341. package/types/src/components/progress-ring/progress-ring.style.d.ts +2 -0
  342. package/types/src/components/radio-field/radio-field.d.ts +21 -9
  343. package/types/src/components/range-field/range-field.d.ts +94 -0
  344. package/types/src/components/range-field/range-field.define.d.ts +1 -0
  345. package/types/src/components/range-field/range-field.style.d.ts +2 -0
  346. package/types/src/components/rating-field/rating-field.d.ts +96 -0
  347. package/types/src/components/rating-field/rating-field.define.d.ts +1 -0
  348. package/types/src/components/rating-field/rating-field.style.d.ts +2 -0
  349. package/types/src/components/scroll-to/scroll-to.d.ts +3 -2
  350. package/types/src/components/scroll-to-top/scroll-to-top.d.ts +4 -2
  351. package/types/src/components/select-field/select-field.d.ts +55 -5
  352. package/types/src/components/skeleton/skeleton.d.ts +29 -0
  353. package/types/src/components/skeleton/skeleton.define.d.ts +1 -0
  354. package/types/src/components/skeleton/skeleton.style.d.ts +2 -0
  355. package/types/src/components/slider/slider.d.ts +14 -8
  356. package/types/src/components/slider/slider.events.d.ts +4 -4
  357. package/types/src/components/spinner/spinner.d.ts +28 -0
  358. package/types/src/components/spinner/spinner.define.d.ts +1 -0
  359. package/types/src/components/spinner/spinner.style.d.ts +2 -0
  360. package/types/src/components/sticky/sticky.d.ts +4 -2
  361. package/types/src/components/svg-use/svg-use.d.ts +4 -2
  362. package/types/src/components/switch-field/switch-field.d.ts +17 -15
  363. package/types/src/components/tab-group/tab-group.d.ts +44 -3
  364. package/types/src/components/tab-link/tab-link.d.ts +33 -10
  365. package/types/src/components/tab-panel/tab-panel.d.ts +8 -5
  366. package/types/src/components/tag/tag.d.ts +53 -0
  367. package/types/src/components/tag/tag.define.d.ts +1 -0
  368. package/types/src/components/tag/tag.events.d.ts +4 -0
  369. package/types/src/components/tag/tag.style.d.ts +2 -0
  370. package/types/src/components/tag-field/tag-field.d.ts +178 -0
  371. package/types/src/components/tag-field/tag-field.define.d.ts +1 -0
  372. package/types/src/components/tag-field/tag-field.style.d.ts +2 -0
  373. package/types/src/components/textarea-field/textarea-field.d.ts +44 -4
  374. package/types/src/components/toast/toast.d.ts +110 -0
  375. package/types/src/components/toast/toast.define.d.ts +1 -0
  376. package/types/src/components/toast/toast.style.d.ts +2 -0
  377. package/types/src/components/tooltip/tooltip.d.ts +161 -0
  378. package/types/src/components/tooltip/tooltip.define.d.ts +1 -0
  379. package/types/src/components/tooltip/tooltip.events.d.ts +5 -0
  380. package/types/src/components/tooltip/tooltip.style.d.ts +2 -0
  381. package/types/src/components/transition-classes/transition-classes.d.ts +9 -8
  382. package/types/src/styles/appearance.style.d.ts +18 -0
  383. package/types/src/styles/arrow.style.d.ts +15 -0
  384. package/types/src/styles/choice-group.style.d.ts +23 -0
  385. package/types/src/styles/form-control.style.d.ts +26 -0
  386. package/types/src/styles/host.style.d.ts +24 -0
  387. package/types/src/styles/modal.style.d.ts +20 -0
  388. package/types/src/styles/size.style.d.ts +20 -0
  389. package/types/src/styles/slide-controls.style.d.ts +20 -0
  390. package/types/src/styles/variants.style.d.ts +32 -0
  391. package/types/src/utils/body-scroll.d.ts +12 -2
  392. package/types/src/utils/floating.d.ts +36 -0
  393. package/types/src/utils/focus.d.ts +16 -0
  394. package/types/src/utils/progress.d.ts +19 -0
  395. package/types/src/utils/slots.d.ts +19 -0
  396. package/types/src/utils/text-entry-attributes.d.ts +18 -0
  397. package/types/src/utils/transitions.d.ts +2 -2
  398. package/web-types.json +6590 -1584
@@ -0,0 +1,79 @@
1
+ import hostStyle from '../../styles/host.style.js';
2
+
3
+ const css = String.raw;
4
+
5
+ const style = css`
6
+ :host {
7
+ /* A line of text by default: as wide as its container, as high as the text. A width and a
8
+ height on the element make it a block or a circle. */
9
+ display: block;
10
+ height: 1em;
11
+ }
12
+
13
+ .skeleton {
14
+ /* The shape fills the host by itself. It does not count on the display of the host, which
15
+ a rule from outside can change: the media region of a card makes what is slotted into it
16
+ a block. */
17
+ display: block;
18
+ width: 100%;
19
+ height: 100%;
20
+
21
+ /* A share of the text colour, not a grey of its own: that shows on the background of the
22
+ page and on a muted fill, in a light scheme and in a dark one, and without a theme. */
23
+ --_el-skeleton-color: var(
24
+ --el-skeleton-color,
25
+ color-mix(in srgb, var(--el-color-fg, currentColor) 12%, transparent)
26
+ );
27
+ --_el-skeleton-sheen-color: var(
28
+ --el-skeleton-sheen-color,
29
+ color-mix(in srgb, var(--el-color-fg, currentColor) 4%, transparent)
30
+ );
31
+
32
+ background: var(--_el-skeleton-color);
33
+ border-radius: var(--el-skeleton-radius, var(--el-radius-md, 4px));
34
+ }
35
+
36
+ /* ── Effects ──────────────────────────────────────────────────────────── */
37
+
38
+ /* A lighter band passes over the shape, from the start to the end. The gradient is three times
39
+ as wide as the shape and has the band in its middle, so both ends of the way show the plain
40
+ colour and the loop has no jump. */
41
+ :host([effect='sheen']) .skeleton {
42
+ background: linear-gradient(
43
+ 90deg,
44
+ var(--_el-skeleton-color) 40%,
45
+ var(--_el-skeleton-sheen-color) 50%,
46
+ var(--_el-skeleton-color) 60%
47
+ );
48
+ background-size: 300% 100%;
49
+ animation: el-skeleton-sheen 2s linear infinite;
50
+ }
51
+
52
+ :host([effect='pulse']) .skeleton {
53
+ animation: el-skeleton-pulse 2s ease-in-out infinite;
54
+ }
55
+
56
+ @keyframes el-skeleton-sheen {
57
+ from {
58
+ background-position: 100% 0;
59
+ }
60
+ to {
61
+ background-position: 0 0;
62
+ }
63
+ }
64
+
65
+ @keyframes el-skeleton-pulse {
66
+ 50% {
67
+ opacity: 0.4;
68
+ }
69
+ }
70
+
71
+ /* The effect says no more than the shape does: that something is on its way. */
72
+ @media (prefers-reduced-motion: reduce) {
73
+ :host([effect]) .skeleton {
74
+ animation: none;
75
+ }
76
+ }
77
+ `;
78
+
79
+ export default [hostStyle(), style].join('\n');
@@ -12,6 +12,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
12
12
 
13
13
  ## Unreleased
14
14
 
15
+ ## [0.3.0] - 2026-11-17
16
+
17
+ ### Added
18
+
19
+ - `dot-label` (`dotLabel`): the accessible label of a pager dot, followed by the number of its item. Default `'Go to item'`, which names the dots "Go to item 1", "Go to item 2" and so on. ([#94](https://github.com/webtides/element-library/issues/94))
20
+
21
+ ### Changed
22
+
23
+ - BREAKING: the arrows and the dots have a look and a place they share with `el-carousel`. A dot is drawn and no longer a character: a ring of 10 px in `--el-color-fg-muted`, and the one of the selected item a disc in `--el-color-accent` (they were `○` and `●` at 22 px, in `--el-color-fg` and the accent colour). A click counts in a square of 24 px around a dot, and the row of dots is 24 px high (was 33 px with the default theme). An arrow is a square of `--el-control-height` (was 41 × 40 px by its padding), `--el-space-2` in from the sides (was at the sides), in the middle of the height of the scroller (was in the middle of the slider with its dots). Left empty, an arrow shows an arrow head and is named "Previous item" or "Next item" for screen readers (it showed `⟨` or `⟩`, and that character was its name). The keyboard focus shows as a ring inside of an arrow and around a dot, from the tokens of the focus ring (it was the outline of the browser). The arrow that leads nowhere keeps its surface and its sign fades (it looked like the other one). Without a theme an arrow has the surface and the text colour of the browser for the colour scheme (it was a character without a surface). The host is a grid (`display: grid`, was `block`). The parts keep their names. A rule of the page for `::part(dot)` now meets another look: a dot is drawn with its border, so `border-color` colours it and `color` does not. ([#162](https://github.com/webtides/element-library/issues/162))
24
+ - On a touch screen (`@media (any-pointer: coarse)`) the arrows are at least `--el-touch-target` wide and high (41 × 40 px with the default theme before). The dots keep their size: each gets a hit area of `--el-touch-target` around it (the dots were 29 × 34 px), and the dots move apart by as much. The row of dots wraps when it gets wider than the slider. Unchanged on a fine pointer and without the token.
25
+
26
+ ### Fixed
27
+
28
+ - The pager dots have an accessible name (see `dot-label`); they were buttons without one (axe `button-name`). The scroller can be reached with the keyboard (`tabindex="0"`), where the arrow keys scroll it (axe `scrollable-region-focusable`). ([#94](https://github.com/webtides/element-library/issues/94))
29
+
15
30
  ## [0.1.0] - 2026-06-03
16
31
 
17
32
  ### Changed
@@ -15,8 +15,10 @@ import style from './slider.style.js';
15
15
  * the slider re-aligns to the current index. `detail` is the current index.
16
16
  *
17
17
  * @slot - Default slot. Place item nodes here; each must match `itemSelector`.
18
- * @slot arrow-left - Content of the "previous" navigation button (defaults to `⟨`).
19
- * @slot arrow-right - Content of the "next" navigation button (defaults to `⟩`).
18
+ * @slot arrow-left - Content of the "previous" navigation button; it names the button. Left
19
+ * empty, the button shows an arrow head and is named "Previous item" for screen readers.
20
+ * @slot arrow-right - Content of the "next" navigation button; it names the button. Left empty,
21
+ * the button shows an arrow head and is named "Next item" for screen readers.
20
22
  *
21
23
  * @csspart scroller - The horizontally scrolling track.
22
24
  * @csspart controls - Applied to both the dots wrapper and the arrows wrapper.
@@ -41,6 +43,8 @@ import style from './slider.style.js';
41
43
  * @property {boolean} autoSelect - When `true`, navigation skips items that are already fully
42
44
  * visible.
43
45
  * @property {boolean} dots - Whether to render the dot pager.
46
+ * @property {string} dotLabel - Accessible label of a pager dot, followed by the number of its item
47
+ * (`'Go to item 2'`). Default `'Go to item'`.
44
48
  * @property {boolean} arrows - Whether to render the previous/next arrow buttons.
45
49
  * @property {boolean} setIndexAfterResize - When `true`, the slider re-aligns to
46
50
  * `selectedIndex` after the host resizes.
@@ -70,6 +74,7 @@ export default class Slider extends TemplateElement {
70
74
  selectedIndex: 0,
71
75
  autoSelect: false,
72
76
  dots: true,
77
+ dotLabel: 'Go to item',
73
78
  arrows: true,
74
79
  setIndexAfterResize: true,
75
80
  manualScrollEndDelay: 200,
@@ -286,7 +291,7 @@ export default class Slider extends TemplateElement {
286
291
 
287
292
  template() {
288
293
  return html`
289
- <div ref="scroller" part="scroller" class="scroller">
294
+ <div ref="scroller" part="scroller" class="scroller" tabindex="0">
290
295
  <slot></slot>
291
296
  </div>
292
297
  ${this.dots ? html` <div part="controls dots">${this.dotsTemplate()}</div> ` : null}
@@ -301,6 +306,7 @@ export default class Slider extends TemplateElement {
301
306
  <button
302
307
  part="dot ${this.selectedIndex === index ? 'selected-dot' : ''}"
303
308
  class="dot"
309
+ aria-label="${this.dotLabel} ${index + 1}"
304
310
  aria-pressed="${this.selectedIndex === index ? 'true' : 'false'}"
305
311
  ></button>
306
312
  `;
@@ -318,14 +324,40 @@ export default class Slider extends TemplateElement {
318
324
  class="arrow-left"
319
325
  ?disabled=${disabledLeft}
320
326
  >
321
- <slot name="arrow-left">&lang;</slot>
327
+ <slot name="arrow-left">
328
+ <svg
329
+ viewBox="0 0 24 24"
330
+ fill="none"
331
+ stroke="currentColor"
332
+ stroke-width="2"
333
+ stroke-linecap="round"
334
+ stroke-linejoin="round"
335
+ aria-hidden="true"
336
+ >
337
+ <polyline points="15 18 9 12 15 6"></polyline>
338
+ </svg>
339
+ <span class="visually-hidden">Previous item</span>
340
+ </slot>
322
341
  </button>
323
342
  <button
324
343
  part="arrow arrow-right ${disabledRight ? 'arrow-disabled' : ''}"
325
344
  class="arrow-right"
326
345
  ?disabled=${disabledRight}
327
346
  >
328
- <slot name="arrow-right">&rang;</slot>
347
+ <slot name="arrow-right">
348
+ <svg
349
+ viewBox="0 0 24 24"
350
+ fill="none"
351
+ stroke="currentColor"
352
+ stroke-width="2"
353
+ stroke-linecap="round"
354
+ stroke-linejoin="round"
355
+ aria-hidden="true"
356
+ >
357
+ <polyline points="9 18 15 12 9 6"></polyline>
358
+ </svg>
359
+ <span class="visually-hidden">Next item</span>
360
+ </slot>
329
361
  </button>
330
362
  `;
331
363
  }
@@ -37,6 +37,7 @@ import '@webtides/element-library/slider/define';
37
37
  | `selectedIndex` | `number` | `0` | Currently focused item index. |
38
38
  | `autoSelect` | `boolean` | `false` | When `true`, navigation skips items that are already fully visible. |
39
39
  | `dots` | `boolean` | `true` | Whether to render the dot pager. |
40
+ | `dotLabel` | `string` | `'Go to item'` | Accessible label of a pager dot, followed by the number of its item (`'Go to item 2'`). Set it as `dot-label`. |
40
41
  | `arrows` | `boolean` | `true` | Whether to render the previous/next arrow buttons. |
41
42
  | `setIndexAfterResize` | `boolean` | `true` | When `true`, the slider re-aligns to `selectedIndex` after the host resizes. |
42
43
  | `manualScrollEndDelay` | `number` | `200` | Debounce window (ms) used to detect the end of a manual scroll. |
@@ -61,11 +62,11 @@ import '@webtides/element-library/slider/define';
61
62
 
62
63
  #### Slots
63
64
 
64
- | Name | Description |
65
- | ------------- | -------------------------------------------------------------- |
66
- | _(default)_ | Place item nodes here; each must match `itemSelector`. |
67
- | `arrow-left` | Content of the "previous" navigation button (defaults to `⟨`). |
68
- | `arrow-right` | Content of the "next" navigation button (defaults to `⟩`). |
65
+ | Name | Description |
66
+ | --- | --- |
67
+ | _(default)_ | Place item nodes here; each must match `itemSelector`. |
68
+ | `arrow-left` | Content of the "previous" navigation button; it names the button. Left empty, the button shows an arrow head and is named "Previous item" for screen readers. |
69
+ | `arrow-right` | Content of the "next" navigation button; it names the button. Left empty, the button shows an arrow head and is named "Next item" for screen readers. |
69
70
 
70
71
  #### CSS Parts
71
72
 
@@ -84,4 +85,25 @@ import '@webtides/element-library/slider/define';
84
85
 
85
86
  #### CSS Custom Properties
86
87
 
87
- This component is headless by default and reads the library's `--el-*` design tokens (e.g. `--el-color-accent`, `--el-color-border`, `--el-radius-md`). Skin it by setting these via a theme — see the Storybook _Docs / Theming_ page.
88
+ The arrows and the dots have the look and the place of the shared style of the library, the same as in `el-carousel`, and read the `--el-*` design tokens:
89
+
90
+ - **Arrows**: buttons on the scroller, in the middle of its height, `--el-space-2` in from its two sides. A square of `--el-control-height` with the surface `--el-color-bg`, the text colour `--el-color-fg`, a border of `--el-border-width` in `--el-color-border` and the radius `--el-radius-md`. Without a theme the surface and the text colour are the ones of the browser for the colour scheme (`Canvas`, `CanvasText`). The keyboard focus shows as a ring inside of the arrow (`--el-focus-ring-width`, `--el-color-focus-ring`, the text colour of the arrow without that token): around it, the ring would lie on the item. An arrow that leads nowhere keeps its surface, and its sign fades.
91
+ - **Dots**: a row under the scroller, in the middle, so that no dot lies on a item. A dot is a ring of 10 px in `--el-color-fg-muted`, the one of the item that shows a disc in `--el-color-accent`; without a theme both have the text colour of the page. A click counts in a square of 24 px around a dot, and the dots are that far apart. The keyboard focus of a dot shows as a ring around it.
92
+
93
+ On a touch screen (`@media (any-pointer: coarse)`) the arrows are at least `--el-touch-target` wide and high. The dots keep their size: each gets a hit area of `--el-touch-target` around it, the dots move apart by as much, and their row wraps when it gets wider than the slider. Without that token, and on a fine pointer, the sizes stay as they are.
94
+
95
+ A page reaches every one of them with `::part()`. Dots that lie on the items, over pictures for example, take one rule. Their colours are then for the page to choose, which knows what its items show:
96
+
97
+ ```css
98
+ el-slider::part(dots) {
99
+ grid-area: 1 / 1;
100
+ align-self: end;
101
+ z-index: 1;
102
+ }
103
+ ```
104
+
105
+ ## Accessibility
106
+
107
+ - The scroller can be focused with the keyboard, where the arrow keys scroll it.
108
+ - Each pager dot is a button named by `dot-label` and the number of its item; `aria-pressed` marks the dot of the selected item.
109
+ - The arrows are buttons named "Previous item" and "Next item", or by what is in their slots. The arrow that leads nowhere is disabled.
@@ -1,8 +1,11 @@
1
+ import slideControlsStyle from '../../styles/slide-controls.style.js';
2
+
1
3
  const css = String.raw;
2
4
 
3
- export default css`
5
+ // The arrows and the dots have the look and the place of the shared module, as the ones of the
6
+ // carousel. The module lays the host out: the scroller with the arrows on it, and the dots under it.
7
+ const style = css`
4
8
  :host {
5
- display: block;
6
9
  position: relative;
7
10
  }
8
11
 
@@ -35,73 +38,6 @@ export default css`
35
38
  scroll-snap-align: var(--snap-align, center);
36
39
  width: var(--item-width, 100%);
37
40
  }
38
-
39
- [part~='dots'] {
40
- display: flex;
41
- position: relative;
42
- justify-content: center;
43
-
44
- [part~='dot'] {
45
- cursor: pointer;
46
- background: none;
47
- border: none;
48
- color: var(--el-color-fg, currentColor);
49
- padding: var(--el-space-1, 4px);
50
- font-size: 22px;
51
- }
52
-
53
- [part~='dot']::after {
54
- content: '○';
55
- padding: var(--el-space-1, 4px);
56
- }
57
-
58
- [part~='dot']:hover {
59
- color: var(--el-color-accent, #666);
60
- }
61
-
62
- [part~='dot']:active {
63
- color: var(--el-color-accent, #999);
64
- }
65
-
66
- [part~='dot'][aria-pressed='true'] {
67
- color: var(--el-color-accent, currentColor);
68
- }
69
-
70
- [part~='dot'][aria-pressed='true']::after {
71
- content: '●';
72
- }
73
- }
74
-
75
- [part~='arrows'] {
76
- position: absolute;
77
- left: 0;
78
- top: 0;
79
- right: 0;
80
- bottom: 0;
81
- display: flex;
82
- justify-content: space-between;
83
- align-items: center;
84
- pointer-events: none;
85
-
86
- /* The arrow <button> *is* the part element (it wraps a <slot>), so style
87
- it directly — a nested "button" selector would match nothing. */
88
- [part~='arrow'] {
89
- pointer-events: all;
90
- cursor: pointer;
91
- font-size: 18px;
92
- background: var(--el-color-bg, transparent);
93
- color: var(--el-color-fg, inherit);
94
- border-radius: var(--el-radius-md, 0);
95
- border: var(--el-border-width, 0) solid var(--el-color-border, transparent);
96
- padding: var(--el-space-2, 8px) var(--el-space-4, 16px);
97
- }
98
-
99
- [part~='arrow-left'] {
100
- left: 0;
101
- }
102
-
103
- [part~='arrow-right'] {
104
- right: 0;
105
- }
106
- }
107
41
  `;
42
+
43
+ export default [slideControlsStyle(':host', '.scroller'), style].join('\n');
@@ -0,0 +1,22 @@
1
+ # Change Log
2
+
3
+ All notable changes to this component live here. Versions refer to the parent `@webtides/element-library` release (see root [`CHANGELOG.md`](../../../CHANGELOG.md)); components no longer version independently.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
+
7
+ <!--
8
+ When your PR touches this component, add an entry under Unreleased and
9
+ mirror it (prefixed with the component name) in root CHANGELOG.md.
10
+ Uncomment headings as needed.
11
+ -->
12
+
13
+ ## Unreleased
14
+
15
+ ## [0.3.0] - 2026-11-17
16
+
17
+ ### Added
18
+
19
+ - Initial `el-spinner`: a spinner for a wait of unknown length, on its own, for a section or a page that is loading. A ring with a quarter that turns, exposed as a progress bar without a value (`role="progressbar"`) and named by `label`, "Loading" by default. ([#78](https://github.com/webtides/element-library/issues/78), [#82](https://github.com/webtides/element-library/issues/82))
20
+ - It is as large as the text it stands in (`1em`), so the font size sizes it. `size` (`small`, `medium`, `large`) steps from there by the factors of the shared size module: 0.8, 1 and 1.25. Reflected to the `size` attribute.
21
+ - The quarter that turns has the accent colour of the theme, and the text colour without a theme; the ring is a fifth of the text colour. `--el-spinner-indicator-color` and `--el-spinner-track-color` set the two.
22
+ - For a user who prefers reduced motion it turns at half the speed.
@@ -0,0 +1,3 @@
1
+ import { define } from './spinner.js';
2
+
3
+ define();
@@ -0,0 +1,48 @@
1
+ import { TemplateElement, defineElement, html } from '@webtides/element-js';
2
+ import style from './spinner.style.js';
3
+
4
+ /**
5
+ * A spinner for a wait of unknown length: a ring with a quarter that turns. It is as large as the
6
+ * text it stands in (`1em`), so the font size is what sizes it; `size` steps it down or up from
7
+ * there.
8
+ *
9
+ * @element el-spinner
10
+ *
11
+ * @csspart base - The ring. It carries `role="progressbar"` and the label.
12
+ *
13
+ * @cssproperty --el-spinner-indicator-color - The quarter of the ring that turns. Unset, it is
14
+ * `--el-color-accent`, and the text colour without a theme.
15
+ * @cssproperty --el-spinner-track-color - The ring it turns on. Unset, it is a fifth of the text
16
+ * colour.
17
+ *
18
+ * @property {'small'|'medium'|'large'} size - `small` is 0.8 times, `large` 1.25 times the font
19
+ * size. Default `'medium'`. Reflected to the `size` attribute.
20
+ * @property {string} label - The accessible name of the spinner. Default `'Loading'`.
21
+ */
22
+ export default class Spinner extends TemplateElement {
23
+ constructor() {
24
+ super({
25
+ styles: [style],
26
+ shadowRender: true,
27
+ // The size module selects the host by this attribute.
28
+ propertyOptions: {
29
+ size: { reflect: true },
30
+ },
31
+ });
32
+ }
33
+
34
+ properties() {
35
+ return {
36
+ size: 'medium',
37
+ label: 'Loading',
38
+ };
39
+ }
40
+
41
+ template() {
42
+ return html`<span part="base" class="spinner" role="progressbar" aria-label="${this.label}"></span>`;
43
+ }
44
+ }
45
+
46
+ export function define() {
47
+ defineElement('el-spinner', Spinner);
48
+ }
@@ -0,0 +1,98 @@
1
+ # Spinner
2
+
3
+ `spinner` shows that something is going on whose end is not known: a ring with a quarter that turns. It stands on its own, for a section or a page that is loading; the loading state of `el-button` has a spinner of its own.
4
+
5
+ Without a theme imported the spinner takes both of its colours from the text colour, so it shows on any background. With a theme the quarter that turns has the accent colour.
6
+
7
+ ## How to use
8
+
9
+ #### Install
10
+
11
+ ```sh
12
+ npm i --save @webtides/element-library
13
+ ```
14
+
15
+ #### Use
16
+
17
+ ```js
18
+ import '@webtides/element-library/spinner/define';
19
+ ```
20
+
21
+ ```html
22
+ <el-spinner></el-spinner>
23
+
24
+ <!-- Named in the language of the page -->
25
+ <el-spinner label="Wird geladen"></el-spinner>
26
+
27
+ <!-- Larger: the spinner is as large as the text -->
28
+ <el-spinner style="font-size: 3rem"></el-spinner>
29
+ ```
30
+
31
+ ## API
32
+
33
+ #### Properties/Attributes
34
+
35
+ | Name | Type | Default | Description |
36
+ | ------- | -------- | ----------- | ---------------------------------------------------------------------------- |
37
+ | `size` | `string` | `'medium'` | `small`, `medium` or `large`: 0.8, 1 or 1.25 times the font size. Reflected. |
38
+ | `label` | `string` | `'Loading'` | The accessible name of the spinner. |
39
+
40
+ #### Methods
41
+
42
+ _None._
43
+
44
+ #### Events
45
+
46
+ _None._
47
+
48
+ #### Slots
49
+
50
+ _None._
51
+
52
+ #### CSS Parts
53
+
54
+ | Name | Description |
55
+ | ------ | -------------------------------------------------------- |
56
+ | `base` | The ring. It carries `role="progressbar"` and the label. |
57
+
58
+ #### CSS Custom Properties
59
+
60
+ | Name | Default | Description |
61
+ | --- | --- | --- |
62
+ | `--el-spinner-indicator-color` | `--el-color-accent`, the text colour without a theme | The quarter of the ring that turns. |
63
+ | `--el-spinner-track-color` | a fifth of the text colour | The ring it turns on. |
64
+
65
+ ## Size
66
+
67
+ A spinner is `1em` wide and high: as large as the text it stands in. The font size is what sizes it, on the spinner itself (`font-size: 3rem`) or on any element around it. In a heading it is as large as the heading.
68
+
69
+ `size` steps from there: `small` is 0.8 times, `large` 1.25 times the font size. These are the factors the sizes of `el-button` have. `size` is reflected: the element writes it onto itself as an attribute, the default included (`<el-spinner size="medium">`), so that it can be selected from a stylesheet.
70
+
71
+ The thickness of the ring is an eighth of its size. Change it on the part: `el-spinner::part(base) { border-width: 2px; }`.
72
+
73
+ ## Colours
74
+
75
+ The quarter that turns reads `--el-spinner-indicator-color`, then `--el-color-accent`, then the text colour. The ring reads `--el-spinner-track-color`; unset, it is the text colour at a fifth of its strength.
76
+
77
+ On a coloured surface the accent colour may not show. Let the indicator follow the text there:
78
+
79
+ ```css
80
+ .banner el-spinner {
81
+ --el-spinner-indicator-color: currentColor;
82
+ }
83
+ ```
84
+
85
+ There is no `variant`. A variant carries a meaning (`success`, `danger`), and a wait has none.
86
+
87
+ The `hidden` attribute hides the spinner.
88
+
89
+ ## Accessibility
90
+
91
+ - The ring is a progress bar without a value (`role="progressbar"`, no `aria-valuenow`), which is how an indeterminate progress is exposed. Its name is the `label`, "Loading" by default. Set `label` to translate it, or to say what is loading.
92
+ - Next to a visible text that already says what is going on, the spinner is decoration. Put `aria-hidden="true"` on it, so that a screen reader does not announce both.
93
+ - A spinner does not announce itself when it appears. To tell a screen reader user that a region is loading, set `aria-busy="true"` on that region, or write the message into a live region of the page.
94
+ - For a user who prefers reduced motion (`prefers-reduced-motion: reduce`) the ring turns at half the speed. It does not stand still: a ring that does not move looks like a wait that got stuck.
95
+
96
+ ## Server-side rendering
97
+
98
+ The ring, its role and its name are part of the server-rendered markup (Declarative Shadow DOM), so the spinner turns before its JavaScript has loaded, and without JavaScript.
@@ -0,0 +1,44 @@
1
+ import hostStyle from '../../styles/host.style.js';
2
+ import sizeStyle from '../../styles/size.style.js';
3
+
4
+ const css = String.raw;
5
+
6
+ const style = css`
7
+ :host {
8
+ display: inline-block;
9
+ /* As large as the text around it. The size module only brings the factor for small and
10
+ large: the font size stays the one of the surrounding text. */
11
+ width: calc(1em * var(--_el-size-scale));
12
+ height: calc(1em * var(--_el-size-scale));
13
+ vertical-align: middle;
14
+ }
15
+
16
+ .spinner {
17
+ display: block;
18
+ width: 100%;
19
+ height: 100%;
20
+ /* Without a theme both colours come from the text colour, so the spinner shows on any
21
+ background. The track is a share of it, not the border token: in a theme with a border
22
+ as dark as the text the indicator would not stand out. */
23
+ border: calc(0.125em * var(--_el-size-scale)) solid
24
+ var(--el-spinner-track-color, color-mix(in srgb, currentColor 20%, transparent));
25
+ border-top-color: var(--el-spinner-indicator-color, var(--el-color-accent, currentColor));
26
+ border-radius: 50%;
27
+ animation: el-spinner-spin 0.8s linear infinite;
28
+ }
29
+
30
+ @keyframes el-spinner-spin {
31
+ to {
32
+ transform: rotate(360deg);
33
+ }
34
+ }
35
+
36
+ /* Slower, not still: a ring that does not move looks like a wait that got stuck. */
37
+ @media (prefers-reduced-motion: reduce) {
38
+ .spinner {
39
+ animation-duration: 1.6s;
40
+ }
41
+ }
42
+ `;
43
+
44
+ export default [hostStyle(), sizeStyle(), style].join('\n');
@@ -12,6 +12,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
12
12
 
13
13
  ## Unreleased
14
14
 
15
+ ## [0.3.0] - 2026-11-17
16
+
17
+ ### Changed
18
+
19
+ - On a touch screen (`@media (any-pointer: coarse)`) the label, which is the hit area of the switch, is at least `--el-touch-target` wide and high. Before, it was as high as the switch. Unchanged on a fine pointer and without the token.
20
+ - The help message, the switch with its label and the error message stack in a column with a gap of `--el-space-1` (4 px without a theme; they had no gap), and the messages are set in `--el-font-size-sm` (14 px without a theme; they had the size of the text), as in every field now. A help message without a text takes no room. ([#130](https://github.com/webtides/element-library/issues/130))
21
+ - The help message stands below the switch and its label, and the error message below the help message. It was the first thing of the field, above the label it explains. What a screen reader reads is unchanged: the switch names both messages in `aria-describedby`. ([#132](https://github.com/webtides/element-library/issues/132))
22
+
23
+ ### Fixed
24
+
25
+ - The error message is announced by screen readers: it is an alert (`role="alert"`), and the switch names it in `aria-describedby` while it is shown. Before, nothing connected the message with the switch. ([#94](https://github.com/webtides/element-library/issues/94))
26
+ - The `hidden` attribute hides the field. The field sets a `display` of its own, which won over the attribute. ([#130](https://github.com/webtides/element-library/issues/130))
27
+ - The switch says whether the field is valid (`aria-invalid`). Before, the error message reached a screen reader and the state of the control did not, while the control of `el-input-field` and of `el-select-field` has said it all along. ([#134](https://github.com/webtides/element-library/issues/134))
28
+ - A second field with the same `name` on the page is described by its own messages. Their ids are made per field, not from the name (BREAKING for a page that names `<name>-help-message` itself). See `form-field`. ([#133](https://github.com/webtides/element-library/issues/133))
29
+ - A click is reported once. `input-change` was fired three times for the first click on a switch without a `value`, and twice for every other click: by the handler of the form field, by the watcher of `value`, which took over the value of the control, and by the watcher of `checked`. The watcher of `checked` alone reports now, once for every change of the on/off state, by the user or by a script, with the value of the control as before. A `value` that a script sets is no change of the on/off state and is no longer reported. ([#148](https://github.com/webtides/element-library/issues/148))
30
+
15
31
  ## [0.1.0] - 2026-06-03
16
32
 
17
33
  ### Added
@@ -19,9 +19,6 @@ import style from './switch-field.style.js';
19
19
  * @property {boolean} checked - Whether the switch is on. Reflected to the `checked` attribute.
20
20
  */
21
21
  export default class SwitchField extends FormField {
22
- /** @private */
23
- uuid = Math.random().toString(36).substr(2, 5);
24
-
25
22
  constructor(options) {
26
23
  super({ shadowRender: false, styles: [style], ...options });
27
24
  }
@@ -39,9 +36,17 @@ export default class SwitchField extends FormField {
39
36
  this.syncValidationStates();
40
37
  }
41
38
 
39
+ /** @private */
40
+ _stateForReset() {
41
+ return { ...super._stateForReset(), checked: this.checked };
42
+ }
43
+
42
44
  watch() {
43
45
  return {
44
46
  ...super.watch(),
47
+ // The value of a switch is what the form submits while it is checked. What the user
48
+ // changes is `checked`, and its watcher reports that: once for every change.
49
+ value: () => {},
45
50
  checked: (checked) => {
46
51
  this.setAttribute('checked', checked ? 'true' : 'false');
47
52
  if (checked) this._internals.states.add('checked');
@@ -63,12 +68,14 @@ export default class SwitchField extends FormField {
63
68
  }
64
69
 
65
70
  /**
66
- * The switch renders its label inline next to the track (see `fieldTemplate`), so the base
67
- * FormField label is suppressed.
68
- * @returns {null}
71
+ * The switch has its label next to the track, in the row of the control (see `fieldTemplate`),
72
+ * and none in front of it. The help message explains that label, so it comes after the row.
69
73
  */
70
- labelTemplate() {
71
- return null;
74
+ template() {
75
+ return html`
76
+ <div class="field ${this.classes().field}">${this.fieldTemplate()}</div>
77
+ ${this.helpTemplate()} ${this.errorTemplate()}
78
+ `;
72
79
  }
73
80
 
74
81
  fieldTemplate() {
@@ -80,7 +87,8 @@ export default class SwitchField extends FormField {
80
87
  type="checkbox"
81
88
  role="switch"
82
89
  id="switch-${this.uuid}"
83
- aria-describedby="${this.name}-help-message"
90
+ aria-describedby="${this._describedBy()}"
91
+ aria-invalid="${this.valid ? 'false' : 'true'}"
84
92
  value="${this.value}"
85
93
  name="${this.name}"
86
94
  ?disabled="${this.disabled}"