@webtides/element-library 0.2.0 → 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 +384 -3
  2. package/README.md +61 -41
  3. package/all.js +28 -0
  4. package/catalog.d.ts +14 -0
  5. package/catalog.js +55 -27
  6. package/custom-elements.json +16604 -3420
  7. package/package.json +35 -28
  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,96 @@
1
+ import FormField from '../form-field/form-field.js';
2
+ /**
3
+ * A rating as a number from 1 to `max`, drawn as a row of stars: the stars up to the chosen one
4
+ * are filled. Renders a native `<fieldset>`/`<legend>` wrapping one `<input type="radio">` per
5
+ * step, so the grouping, the arrow keys and the form submission are native. Extends `FormField`
6
+ * and inherits its help / error / required / touched-state surface; the `label` becomes the
7
+ * `<legend>` of the group.
8
+ *
9
+ * @element el-rating-field
10
+ *
11
+ * @fires {CustomEvent<string>} input-change - Fired when the rating changes. `detail` is the
12
+ * chosen step. Bubbles.
13
+ *
14
+ * @cssstate touched - Set once the user has left the group, or the browser has refused a submit
15
+ * because of it. Inherits `valid` and `invalid` from `FormField`.
16
+ *
17
+ * @cssproperty --el-rating-color - The colour of a filled star. Unset, it is the accent colour of
18
+ * the theme.
19
+ * @cssproperty --el-rating-size - The width and the height of a star. Unset, it is `--el-space-5`,
20
+ * and `1.5em` without a theme.
21
+ *
22
+ * @property {string | null} value - The chosen step, as the text the form submits (`'3'`), or
23
+ * `null` while nothing is chosen.
24
+ * @property {number} max - The number of stars. Default `5`.
25
+ */
26
+ export default class RatingField extends FormField {
27
+ constructor(options: any);
28
+ properties(): {
29
+ name: string;
30
+ value: any;
31
+ required: boolean;
32
+ disabled: boolean;
33
+ label: string;
34
+ labelScreenReaderOnly: boolean;
35
+ errorMessage: string;
36
+ helpMessage: string;
37
+ valid: boolean;
38
+ touched: boolean;
39
+ max: number;
40
+ };
41
+ connected(): void;
42
+ afterUpdate(): void;
43
+ events(): {
44
+ 'input[type="radio"]': {
45
+ change: (event: any) => void;
46
+ focus: () => void;
47
+ blur: (event: any) => void;
48
+ invalid: (event: any) => void;
49
+ };
50
+ };
51
+ /**
52
+ * The steps of the scale: 1 to `max`. A `max` that is no number of stars gives the five of
53
+ * the default.
54
+ * @private
55
+ * @returns {number[]}
56
+ */
57
+ private _steps;
58
+ /**
59
+ * The chosen step as a number, or 0 while nothing is chosen. A value that is no step of the
60
+ * scale chooses nothing: no radio has it, and nothing would be submitted for it.
61
+ * @private
62
+ * @returns {number}
63
+ */
64
+ private _chosen;
65
+ /**
66
+ * Whether the group currently passes validation: required means a chosen step.
67
+ * @private
68
+ */
69
+ private _computeValid;
70
+ /**
71
+ * Makes the radios say what the field says, after every render. The `checked` attribute the
72
+ * template writes is only the default of a radio: once the user has chosen, the browser no
73
+ * longer follows the attribute, so a value from outside is written to the radios as well.
74
+ * @private
75
+ */
76
+ private _syncControls;
77
+ onFocus(): void;
78
+ onBlur(): void;
79
+ /**
80
+ * The label is rendered as the group's `<legend>` (see `template`), so the base FormField
81
+ * `<label>` is suppressed.
82
+ * @returns {null}
83
+ */
84
+ labelTemplate(): null;
85
+ template(): any;
86
+ /** @private */
87
+ private legendTemplate;
88
+ /**
89
+ * One radio per step, each in a label that shows a star. A radio is named by its number, which
90
+ * needs no translation. The star is hidden from assistive technology: the radio says whether it
91
+ * is chosen. The stars up to the chosen one carry `is-on`, which fills them.
92
+ * @private
93
+ */
94
+ private fieldTemplate;
95
+ }
96
+ export declare function define(): void;
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -1,4 +1,4 @@
1
- export function define(): void;
1
+ import { BaseElement } from '@webtides/element-js';
2
2
  /**
3
3
  * Wraps any click-emitting child (`<a>`, `<button>`, …) and scrolls to the element
4
4
  * matched by `selector` when the child is clicked.
@@ -11,7 +11,7 @@ export function define(): void;
11
11
  * @property {boolean} preventDefault - When `true`, the captured click's default action is
12
12
  * suppressed (e.g. an `<a href>`'s navigation).
13
13
  */
14
- export default class ScrollTo {
14
+ export default class ScrollTo extends BaseElement {
15
15
  properties(): {
16
16
  selector: string;
17
17
  preventDefault: boolean;
@@ -22,3 +22,4 @@ export default class ScrollTo {
22
22
  };
23
23
  };
24
24
  }
25
+ export declare function define(): void;
@@ -1,4 +1,4 @@
1
- export function define(): void;
1
+ import { StyledElement } from '@webtides/element-js';
2
2
  /**
3
3
  * Wraps any click-emitting child (`<a>`, `<button>`, …) and smoothly scrolls the window
4
4
  * to the top when the child is clicked.
@@ -13,7 +13,8 @@ export function define(): void;
13
13
  * @property {boolean} preventDefault - When `true`, the captured click's default action is
14
14
  * suppressed.
15
15
  */
16
- export default class ScrollToTop {
16
+ export default class ScrollToTop extends StyledElement {
17
+ constructor();
17
18
  properties(): {
18
19
  duration: number;
19
20
  preventDefault: boolean;
@@ -30,3 +31,4 @@ export default class ScrollToTop {
30
31
  */
31
32
  scrollToTop(): void;
32
33
  }
34
+ export declare function define(): void;
@@ -1,4 +1,4 @@
1
- export function define(): void;
1
+ import FormField from '../form-field/form-field.js';
2
2
  /**
3
3
  * Native `<select>` wrapper with label, help text, validation feedback and a custom
4
4
  * dropdown indicator. Extends `FormField` and inherits its label / help / error /
@@ -9,17 +9,26 @@ export function define(): void;
9
9
  * @fires {CustomEvent<string>} input-change - Fired when the selected value changes.
10
10
  * `detail` is the new value. Bubbles.
11
11
  *
12
+ * @property {string | null} value - The value of the selected option. Setting it selects the
13
+ * option with that value, when the field is rendered and later. Without a value the field takes
14
+ * over what the select shows: the option marked `selected` in `options`, or else the first one.
15
+ * It stays `null` while the placeholder is shown. An empty value that none of `options` has
16
+ * counts as no value.
12
17
  * @property {string} placeholder - Placeholder text rendered as the first disabled `<option>`
13
18
  * when no selection has been made.
14
19
  * @property {Array<string | { value: string, label?: string, selected?: boolean }>} options -
15
20
  * Options to render. Accepts plain strings (`['Apple', 'Pear']`) or option objects
16
- * (`[{ value, label, selected? }]`). Strings are used as both value and label.
21
+ * (`[{ value, label, selected? }]`). Strings are used as both value and label. `selected` is the
22
+ * choice of a field without a `value`; a `value` wins over it.
17
23
  */
18
24
  export default class SelectField extends FormField {
25
+ /**
26
+ * The value the field last took over from the select, see `_syncSelection()`.
27
+ * @private
28
+ */
29
+ private _adoptedValue;
19
30
  constructor();
20
31
  properties(): {
21
- placeholder: string;
22
- options: any[];
23
32
  name: string;
24
33
  value: any;
25
34
  required: boolean;
@@ -30,10 +39,51 @@ export default class SelectField extends FormField {
30
39
  helpMessage: string;
31
40
  valid: boolean;
32
41
  touched: boolean;
42
+ placeholder: string;
43
+ options: any[];
44
+ };
45
+ watch(): {
46
+ valid: () => void;
47
+ touched: () => void;
48
+ value: (value: any, oldValue: any) => void;
33
49
  };
50
+ afterUpdate(): void;
51
+ /**
52
+ * Makes the select and `value` say the same, after every render.
53
+ *
54
+ * The template marks the option of the value as `selected`, which is all that server-rendered
55
+ * markup and a fresh select need. That attribute is only the default of an option: once the user
56
+ * has chosen, the browser no longer follows it. So the option is selected here as well.
57
+ *
58
+ * Without a value, or without an option for it, the select has its default: the option the
59
+ * markup marks, the last one if there are several, or else the first one that is not disabled.
60
+ * That is what the browser selects in fresh markup. A field without a value then takes over
61
+ * what the select shows, so that `value` says what the form submits. The placeholder has no
62
+ * value, the field keeps its own for it. A value without an option is left alone: its option
63
+ * can still arrive with `options`.
64
+ * @private
65
+ */
66
+ private _syncSelection;
67
+ /**
68
+ * Whether the field has a value that decides which option is selected. `null` is none. An empty
69
+ * value is none either, unless one of `options` has it: element-js writes a `null` back as an
70
+ * empty attribute where the value came from an attribute, and a page that renders
71
+ * `value=""` for "nothing chosen yet" means the same.
72
+ * @private
73
+ * @returns {boolean}
74
+ */
75
+ private _hasValue;
76
+ /**
77
+ * Whether an option carries `selected` in the markup: the option of the value, or, for a field
78
+ * without a value, the one that `options` marks.
79
+ * @private
80
+ * @param {string | { value: string, selected?: boolean }} option
81
+ * @returns {boolean}
82
+ */
83
+ private _marksSelected;
34
84
  /** @private */
35
85
  private fieldTemplate;
36
86
  /** @private */
37
87
  private dropdownIndicatorTemplate;
38
88
  }
39
- import FormField from '../form-field/form-field.js';
89
+ export declare function define(): void;
@@ -0,0 +1,29 @@
1
+ import { TemplateElement } from '@webtides/element-js';
2
+ /**
3
+ * A skeleton: a quiet shape in the place of content that is still loading, a line of text, an
4
+ * image, an avatar. By default it is a line: as wide as its container and as high as the text. A
5
+ * width, a height and a radius make it any other shape. It says nothing to assistive technology;
6
+ * the region that loads does, with `aria-busy`.
7
+ *
8
+ * @element el-skeleton
9
+ *
10
+ * @csspart base - The shape.
11
+ *
12
+ * @cssproperty --el-skeleton-color - The colour of the shape. Unset, it is an eighth of the text
13
+ * colour (`--el-color-fg`, and the text colour of the page without a theme).
14
+ * @cssproperty --el-skeleton-sheen-color - The colour of the band that passes over the shape with
15
+ * `effect="sheen"`. Unset, it is a third of the colour of the shape.
16
+ * @cssproperty --el-skeleton-radius - The radius of the shape. Unset, it is `--el-radius-md`.
17
+ *
18
+ * @property {'none'|'sheen'|'pulse'} effect - How the shape moves while it waits: not at all, with
19
+ * a band that passes over it, or by fading. Default `'none'`. Reflected to the `effect`
20
+ * attribute.
21
+ */
22
+ export default class Skeleton extends TemplateElement {
23
+ constructor();
24
+ properties(): {
25
+ effect: string;
26
+ };
27
+ template(): any;
28
+ }
29
+ export declare function define(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -1,4 +1,5 @@
1
- export function define(): void;
1
+ import { TemplateElement, defineElement, html } from '@webtides/element-js';
2
+ import SliderEvents from './slider.events.js';
2
3
  /**
3
4
  * CSS-scroll-snap based carousel. Direct children matched by `itemSelector` are arranged
4
5
  * horizontally and navigated via the rendered dot pager and arrow buttons, by setting
@@ -12,8 +13,10 @@ export function define(): void;
12
13
  * the slider re-aligns to the current index. `detail` is the current index.
13
14
  *
14
15
  * @slot - Default slot. Place item nodes here; each must match `itemSelector`.
15
- * @slot arrow-left - Content of the "previous" navigation button (defaults to `⟨`).
16
- * @slot arrow-right - Content of the "next" navigation button (defaults to `⟩`).
16
+ * @slot arrow-left - Content of the "previous" navigation button; it names the button. Left
17
+ * empty, the button shows an arrow head and is named "Previous item" for screen readers.
18
+ * @slot arrow-right - Content of the "next" navigation button; it names the button. Left empty,
19
+ * the button shows an arrow head and is named "Next item" for screen readers.
17
20
  *
18
21
  * @csspart scroller - The horizontally scrolling track.
19
22
  * @csspart controls - Applied to both the dots wrapper and the arrows wrapper.
@@ -38,18 +41,22 @@ export function define(): void;
38
41
  * @property {boolean} autoSelect - When `true`, navigation skips items that are already fully
39
42
  * visible.
40
43
  * @property {boolean} dots - Whether to render the dot pager.
44
+ * @property {string} dotLabel - Accessible label of a pager dot, followed by the number of its item
45
+ * (`'Go to item 2'`). Default `'Go to item'`.
41
46
  * @property {boolean} arrows - Whether to render the previous/next arrow buttons.
42
47
  * @property {boolean} setIndexAfterResize - When `true`, the slider re-aligns to
43
48
  * `selectedIndex` after the host resizes.
44
49
  * @property {number} manualScrollEndDelay - Debounce window (ms) used to detect the end of a
45
50
  * manual scroll.
46
51
  */
47
- export default class Slider {
48
- constructor(options: any);
52
+ export default class Slider extends TemplateElement {
53
+ #private;
54
+ selectedIndex: any;
49
55
  /** @private */
50
56
  private itemsCount;
51
57
  /** @private */
52
58
  private items;
59
+ constructor(options: any);
53
60
  properties(): {
54
61
  itemSelector: string;
55
62
  itemsToShow: number;
@@ -58,6 +65,7 @@ export default class Slider {
58
65
  selectedIndex: number;
59
66
  autoSelect: boolean;
60
67
  dots: boolean;
68
+ dotLabel: string;
61
69
  arrows: boolean;
62
70
  setIndexAfterResize: boolean;
63
71
  manualScrollEndDelay: number;
@@ -88,7 +96,6 @@ export default class Slider {
88
96
  click: () => void;
89
97
  };
90
98
  };
91
- selectedIndex: any;
92
99
  watch(): {
93
100
  selectedIndex: () => void;
94
101
  };
@@ -123,7 +130,6 @@ export default class Slider {
123
130
  private dotsTemplate;
124
131
  /** @private */
125
132
  private arrowsTemplate;
126
- #private;
127
133
  }
128
- import SliderEvents from './slider.events.js';
134
+ export declare function define(): void;
129
135
  export { html, defineElement, SliderEvents };
@@ -1,5 +1,5 @@
1
- declare namespace _default {
2
- let SLIDER_RUN: string;
3
- let SLIDER_RESIZE: string;
4
- }
1
+ declare const _default: {
2
+ SLIDER_RUN: string;
3
+ SLIDER_RESIZE: string;
4
+ };
5
5
  export default _default;
@@ -0,0 +1,28 @@
1
+ import { TemplateElement } from '@webtides/element-js';
2
+ /**
3
+ * A spinner for a wait of unknown length: a ring with a quarter that turns. It is as large as the
4
+ * text it stands in (`1em`), so the font size is what sizes it; `size` steps it down or up from
5
+ * there.
6
+ *
7
+ * @element el-spinner
8
+ *
9
+ * @csspart base - The ring. It carries `role="progressbar"` and the label.
10
+ *
11
+ * @cssproperty --el-spinner-indicator-color - The quarter of the ring that turns. Unset, it is
12
+ * `--el-color-accent`, and the text colour without a theme.
13
+ * @cssproperty --el-spinner-track-color - The ring it turns on. Unset, it is a fifth of the text
14
+ * colour.
15
+ *
16
+ * @property {'small'|'medium'|'large'} size - `small` is 0.8 times, `large` 1.25 times the font
17
+ * size. Default `'medium'`. Reflected to the `size` attribute.
18
+ * @property {string} label - The accessible name of the spinner. Default `'Loading'`.
19
+ */
20
+ export default class Spinner extends TemplateElement {
21
+ constructor();
22
+ properties(): {
23
+ size: string;
24
+ label: string;
25
+ };
26
+ template(): any;
27
+ }
28
+ export declare function define(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -1,4 +1,4 @@
1
- export function define(): void;
1
+ import { StyledElement } from '@webtides/element-js';
2
2
  /**
3
3
  * Sticky positioning helper. Toggles `sticky`, `up` and `down` custom states on the host
4
4
  * element based on the page's scroll position and direction so consumers can drive styling
@@ -19,13 +19,14 @@ export function define(): void;
19
19
  * @property {boolean} forceDown - When `true`, the element always shows the `down` state
20
20
  * regardless of scroll direction. Useful for navigation that should remain visible.
21
21
  */
22
- export default class Sticky {
22
+ export default class Sticky extends StyledElement {
23
23
  /** @private */
24
24
  private height;
25
25
  /** @private */
26
26
  private lastScrollTop;
27
27
  /** @private */
28
28
  private resizeObserver;
29
+ constructor();
29
30
  properties(): {
30
31
  forceDown: boolean;
31
32
  };
@@ -45,3 +46,4 @@ export default class Sticky {
45
46
  /** @private */
46
47
  private hasScrolled;
47
48
  }
49
+ export declare function define(): void;
@@ -1,4 +1,4 @@
1
- export function define(): void;
1
+ import { TemplateElement } from '@webtides/element-js';
2
2
  /**
3
3
  * Thin wrapper around `<svg><use href>` that references a symbol from an SVG sprite
4
4
  * (either external via `spritePath` or embedded in the parent document).
@@ -9,10 +9,12 @@ export function define(): void;
9
9
  * @property {string} spritePath - Path to an external SVG sprite. When empty, the symbol is
10
10
  * assumed to be embedded in the parent document.
11
11
  */
12
- export default class SvgUse {
12
+ export default class SvgUse extends TemplateElement {
13
+ constructor();
13
14
  properties(): {
14
15
  name: string;
15
16
  spritePath: string;
16
17
  };
17
18
  template(): string;
18
19
  }
20
+ export declare function define(): void;
@@ -1,4 +1,4 @@
1
- export function define(): void;
1
+ import FormField from '../form-field/form-field.js';
2
2
  /**
3
3
  * An on/off toggle switch. Renders a native `<input type="checkbox">` with `role="switch"` (so it
4
4
  * is announced as a switch and submits with forms) behind a custom track/thumb. Extends
@@ -16,10 +16,9 @@ export function define(): void;
16
16
  * @property {boolean} checked - Whether the switch is on. Reflected to the `checked` attribute.
17
17
  */
18
18
  export default class SwitchField extends FormField {
19
- /** @private */
20
- private uuid;
19
+ checked: any;
20
+ constructor(options: any);
21
21
  properties(): {
22
- checked: boolean;
23
22
  name: string;
24
23
  value: any;
25
24
  required: boolean;
@@ -30,22 +29,24 @@ export default class SwitchField extends FormField {
30
29
  helpMessage: string;
31
30
  valid: boolean;
32
31
  touched: boolean;
32
+ checked: boolean;
33
33
  };
34
+ connected(): void;
35
+ /** @private */
36
+ private _stateForReset;
34
37
  watch(): {
35
- checked: (checked: any) => void;
36
- value: (value: any) => void;
37
38
  valid: () => void;
38
39
  touched: () => void;
40
+ value: () => void;
41
+ checked: (checked: any) => void;
39
42
  };
40
43
  events(): {
41
- input: {
42
- change: () => void;
43
- };
44
44
  '[ref=input]': {
45
45
  focus: () => void;
46
46
  blur: () => void;
47
47
  keyup: (event: any) => void;
48
48
  change: () => void;
49
+ invalid: (event: any) => void;
49
50
  };
50
51
  '.is-invalid': {
51
52
  focus: () => void;
@@ -54,14 +55,15 @@ export default class SwitchField extends FormField {
54
55
  click: () => void;
55
56
  touchstart: () => void;
56
57
  };
58
+ input: {
59
+ change: () => void;
60
+ };
57
61
  };
58
- checked: any;
59
62
  /**
60
- * The switch renders its label inline next to the track (see `fieldTemplate`), so the base
61
- * FormField label is suppressed.
62
- * @returns {null}
63
+ * The switch has its label next to the track, in the row of the control (see `fieldTemplate`),
64
+ * and none in front of it. The help message explains that label, so it comes after the row.
63
65
  */
64
- labelTemplate(): null;
66
+ template(): any;
65
67
  fieldTemplate(): any;
66
68
  }
67
- import FormField from '../form-field/form-field.js';
69
+ export declare function define(): void;
@@ -1,38 +1,64 @@
1
- export function define(): void;
1
+ import { StyledElement } from '@webtides/element-js';
2
2
  /**
3
3
  * Container that pairs `<el-tab-link>` children with `<el-tab-panel>` children and shows
4
4
  * one panel at a time. Listens for `tab-select` events bubbled from `<el-tab-link>` and
5
5
  * mirrors the active selection onto the `selected` attribute (reflected).
6
6
  *
7
+ * The group wires the tabs for assistive technology and the keyboard: the selected link has
8
+ * `aria-selected="true"` and is the only one in the tab order, every panel is labelled by its
9
+ * link, and the arrow keys, Home and End move between the links that are not disabled and select
10
+ * the one they land on. The element around the links becomes the `tablist`, so put the links
11
+ * into an element of their own.
12
+ *
13
+ * The links and panels need not be defined, or be there, when the group connects: it marks the
14
+ * selection with attributes and styles, and takes in parts that are added later.
15
+ *
7
16
  * @element el-tab-group
8
17
  *
9
18
  * @slot - Default slot containing `<el-tab-link>` and `<el-tab-panel>` children.
10
19
  *
11
20
  * @property {string | undefined} selected - Name of the currently selected tab. Matches a
12
21
  * `<el-tab-panel>`'s `name`. Reflected to the `selected` attribute.
22
+ * @property {'horizontal' | 'vertical'} orientation - Direction of the links: the left and right
23
+ * arrow keys move between them, or the up and down keys when `'vertical'`. Default
24
+ * `'horizontal'`.
13
25
  * @property {string} linkSelector - Selector used to find tab link children.
14
26
  * @property {string} panelSelector - Selector used to find tab panel children.
15
27
  */
16
- export default class TabGroup {
28
+ export default class TabGroup extends StyledElement {
29
+ selected: any;
17
30
  /** @private */
18
31
  private tabLinks;
19
32
  /** @private */
20
33
  private tabPanels;
34
+ /** @private */
35
+ private _tabsObserver;
36
+ constructor();
21
37
  properties(): {
22
38
  selected: any;
39
+ orientation: string;
23
40
  linkSelector: string;
24
41
  panelSelector: string;
25
42
  };
26
43
  watch(): {
27
44
  selected: () => void;
45
+ orientation: () => void;
28
46
  };
29
47
  connected(): void;
48
+ disconnected(): void;
49
+ /**
50
+ * Finds the links and panels and brings them in line with the selection. Everything the group
51
+ * tells them is an attribute or a style, so it reaches a link or a panel whose tag is not
52
+ * defined yet as well.
53
+ * @private
54
+ */
55
+ private _syncTabs;
30
56
  events(): {
31
57
  this: {
32
58
  'tab-select': (event: any) => void;
59
+ keydown: (event: any) => void;
33
60
  };
34
61
  };
35
- selected: any;
36
62
  /**
37
63
  * Programmatically activate the panel with the given name.
38
64
  * @param {string} name - The `name` of the target `<el-tab-panel>`.
@@ -41,8 +67,23 @@ export default class TabGroup {
41
67
  selectTab(name: string): void;
42
68
  /** @private */
43
69
  private updateSelection;
70
+ /**
71
+ * Makes the element around the links the `tablist` and tells it the orientation. Links that
72
+ * are direct children of the group have no such element: the group cannot be the list itself,
73
+ * because it holds the panels as well.
74
+ * @private
75
+ */
76
+ private _syncTabList;
77
+ /**
78
+ * The arrow keys of the orientation, Home and End move the focus to another link and select
79
+ * it. Disabled links are skipped, and the arrow keys wrap around.
80
+ * @private
81
+ * @param {KeyboardEvent} event
82
+ */
83
+ private _onKeydown;
44
84
  /** @private */
45
85
  private queryTabLinks;
46
86
  /** @private */
47
87
  private queryTabPanels;
48
88
  }
89
+ export declare function define(): void;
@@ -1,30 +1,53 @@
1
- export function define(): void;
1
+ import { StyledElement } from '@webtides/element-js';
2
2
  /**
3
- * Clickable label for a `<el-tab-panel>`. Dispatches a bubbling `tab-select` event with
4
- * `detail.selected` set to its `for` attribute when clicked (unless `disabled`). Used
5
- * inside `<el-tab-group>`.
3
+ * The tab of a `<el-tab-panel>` (`role="tab"`). Dispatches a bubbling `tab-select` event with
4
+ * `detail.selected` set to its `for` attribute when it is clicked or when Enter or Space is
5
+ * pressed on it (unless `disabled`). Used inside `<el-tab-group>`, which marks the selected
6
+ * link (`aria-selected`), keeps it in the tab order and moves between the links with the arrow keys.
6
7
  *
7
8
  * @element el-tab-link
8
9
  *
9
- * @fires {CustomEvent<{ selected: string }>} tab-select - Fired on click. `detail.selected`
10
- * is the `for` value, used by `<el-tab-group>` to activate the matching panel. Bubbles
11
- * and crosses shadow boundaries.
10
+ * @fires {CustomEvent<{ selected: string }>} tab-select - Fired on click and on Enter or Space.
11
+ * `detail.selected` is the `for` value, used by `<el-tab-group>` to activate the matching
12
+ * panel. Bubbles and crosses shadow boundaries.
12
13
  *
13
14
  * @slot - Default slot for the tab label content.
14
15
  *
15
- * @cssstate active - Set by the parent `<el-tab-group>` while this link's panel is the
16
- * selected one. Style with `el-tab-link:state(active) { … }`.
16
+ * @cssstate active - Set while the link is selected (`aria-selected="true"`), which the parent
17
+ * `<el-tab-group>` keeps up to date. Style with `el-tab-link:state(active) { … }`.
17
18
  *
18
19
  * @property {string | undefined} for - Name of the panel this link activates (matches a
19
20
  * `<el-tab-panel>`'s `name`).
21
+ * @attribute {boolean} disabled - When present, the link does not dispatch `tab-select` on click
22
+ * and is exposed as disabled (`aria-disabled="true"`).
23
+ * @attribute {'true'|'false'} aria-selected - Whether the link is the selected one. The parent
24
+ * `<el-tab-group>` writes it, and the `active` state follows it.
20
25
  */
21
- export default class TabLink {
26
+ export default class TabLink extends StyledElement {
27
+ static observedAttributes: string[];
28
+ constructor();
29
+ attributeChangedCallback(): void;
30
+ connected(): void;
31
+ /**
32
+ * Tells assistive technology what the `disabled` attribute says.
33
+ * @private
34
+ */
35
+ private _syncDisabled;
36
+ /**
37
+ * The `active` state follows `aria-selected`. The group only writes the attribute, which it
38
+ * can do before this element is defined: the browser reports the attributes that are already
39
+ * there when it upgrades the element.
40
+ * @private
41
+ */
42
+ private _syncActive;
22
43
  properties(): {
23
44
  for: any;
24
45
  };
25
46
  events(): {
26
47
  this: {
27
48
  click: (event: any) => void;
49
+ keydown: (event: any) => void;
28
50
  };
29
51
  };
30
52
  }
53
+ export declare function define(): void;