@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
@@ -7,10 +7,14 @@
7
7
  *
8
8
  * import '@webtides/element-library/themes/sketchy.css';
9
9
  *
10
- * The sketch feel is achieved purely with design tokens — no canvas/SVG
11
- * rendering — so it stays a single CSS import like the other themes. The
12
- * tell vs. real rough.js is that the border "wobble" is identical on every
13
- * element (a fixed irregular border-radius) rather than randomized per box.
10
+ * The sketch feel is achieved with design tokens — no canvas/SVG rendering.
11
+ * The tell vs. real rough.js is that the border "wobble" is identical on
12
+ * every element (a fixed irregular border-radius) rather than randomized per
13
+ * box. Import styles/native.css as well to decorate the controls of the
14
+ * library's fields with the tokens (see default.css).
15
+ *
16
+ * Beside the tokens this theme has two things that no token can carry: the
17
+ * handwriting face, and a few rules for single components at the end.
14
18
  *
15
19
  * The handwriting face (Patrick Hand) is embedded below via @font-face with an
16
20
  * absolute URL on purpose: themes are loaded into a constructable stylesheet
@@ -23,6 +27,8 @@
23
27
  * color-scheme like default.css does.
24
28
  */
25
29
 
30
+ @layer el-tokens, el-utilities;
31
+
26
32
  /* Patrick Hand — latin + latin-ext (gstatic, content-versioned woff2) */
27
33
  @font-face {
28
34
  font-family: 'Patrick Hand';
@@ -45,149 +51,100 @@
45
51
  U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
46
52
  }
47
53
 
48
- :root {
49
- color-scheme: light dark;
50
-
51
- /* Color — surfaces & text (ink on white / chalk on a board) */
52
- --el-color-fg: light-dark(#2b2b2b, #ece4d4);
53
- --el-color-fg-muted: light-dark(#5f5b53, #b0a890);
54
- --el-color-bg: light-dark(#ffffff, #232020);
55
- --el-color-bg-muted: light-dark(#f4f4f4, #2e2a28);
56
- --el-color-border: light-dark(#2b2b2b, #ece4d4);
57
-
58
- /* Color — interactive & semantic (felt-tip marker palette) */
59
- --el-color-accent: light-dark(#2f6fed, #8fb0ff);
60
- --el-color-success: light-dark(#2f9e44, #69db7c);
61
- --el-color-danger: light-dark(#e03131, #ff8787);
62
- --el-color-focus-ring: var(--el-color-accent);
63
-
64
- /* Spacing — same 4px base scale as the other themes */
65
- --el-space-1: 0.25rem;
66
- --el-space-2: 0.5rem;
67
- --el-space-3: 0.75rem;
68
- --el-space-4: 1rem;
69
- --el-space-5: 1.5rem;
70
-
71
- /*
72
- * Radius — the hand-drawn corner trick. An asymmetric 8-value border-radius
73
- * (horizontal radii / vertical radii) makes each corner round by a slightly
74
- * different amount, faking a pencil stroke. Values are kept modest so short,
75
- * wide controls (inputs/buttons) wobble instead of turning into pills.
76
- */
77
- --el-radius-sm: 6px 10px 7px 9px / 9px 6px 10px 7px;
78
- --el-radius-md: 16px 9px 18px 11px / 11px 17px 9px 16px;
79
- --el-radius-lg: 26px 15px 30px 17px / 17px 28px 15px 26px;
80
-
81
- /* Border — pen line */
82
- --el-border-width: 2px;
83
-
84
- /* Typography — handwriting face, with casual fallbacks before generic cursive */
85
- --el-font-family: 'Patrick Hand', 'Comic Sans MS', 'Segoe Print', 'Bradley Hand', 'Marker Felt', cursive;
86
- --el-font-size-sm: 0.9375rem;
87
- --el-font-size-md: 1.0625rem;
88
- --el-line-height: 1.55;
89
-
90
- /* Shadow — hard offset "cutout"/sticker shadow, no blur, in the ink color */
91
- --el-shadow-md: 2px 2px 0 light-dark(rgba(43, 43, 43, 0.2), rgba(0, 0, 0, 0.55));
92
- --el-shadow-lg: 4px 5px 0 light-dark(rgba(43, 43, 43, 0.24), rgba(0, 0, 0, 0.6));
93
-
94
- /* Motion — a little springy overshoot for a playful feel */
95
- --el-duration-md: 200ms;
96
- --el-ease: cubic-bezier(0.34, 1.3, 0.64, 1);
97
-
98
- /* Focus ring — slightly larger gap so the ring reads as a separate scribble */
99
- --el-focus-ring-width: 2px;
100
- --el-focus-ring-offset: 3px;
101
-
102
- /* Sizing */
103
- --el-control-height: 2.5rem;
104
- --el-touch-target: 2.75rem;
105
-
106
- /* Dialog — an ink-wash scrim in the page's ink color */
107
- --el-dialog-width: 31rem;
108
- --el-dialog-overlay-background: light-dark(rgba(43, 43, 43, 0.45), rgba(0, 0, 0, 0.6));
109
- }
110
-
111
- /*
112
- * Native form controls (input / textarea / select) live in light DOM, so the
113
- * theme decorates them directly. Mirrors the rule set in default.css.
114
- */
115
- el-input-field input,
116
- el-password-field input,
117
- el-textarea-field textarea,
118
- el-select-field select {
119
- box-sizing: border-box;
120
- width: 100%;
121
- border: var(--el-border-width) solid var(--el-color-border);
122
- border-radius: var(--el-radius-md);
123
- padding: var(--el-space-2) var(--el-space-3);
124
- background: var(--el-color-bg);
125
- color: var(--el-color-fg);
126
- font-family: var(--el-font-family);
127
- font-size: var(--el-font-size-md);
128
- line-height: var(--el-line-height);
129
- transition:
130
- border-color var(--el-duration-md) var(--el-ease),
131
- box-shadow var(--el-duration-md) var(--el-ease);
132
- }
133
-
134
- el-input-field input,
135
- el-password-field input,
136
- el-select-field select {
137
- min-height: var(--el-control-height);
138
- }
139
-
140
- el-input-field input:focus,
141
- el-password-field input:focus,
142
- el-textarea-field textarea:focus,
143
- el-select-field select:focus {
144
- outline: none;
145
- border-color: var(--el-color-focus-ring);
146
- box-shadow:
147
- 0 0 0 var(--el-focus-ring-offset) var(--el-color-bg),
148
- 0 0 0 calc(var(--el-focus-ring-offset) + var(--el-focus-ring-width)) var(--el-color-focus-ring);
149
- }
150
-
151
- el-input-field:state(invalid) input,
152
- el-password-field:state(invalid) input,
153
- el-textarea-field:state(invalid) textarea,
154
- el-select-field:state(invalid) select {
155
- border-color: var(--el-color-danger);
156
- }
54
+ @layer el-tokens {
55
+ :root {
56
+ color-scheme: light dark;
57
+
58
+ /* Color — surfaces & text (ink on white / chalk on a board) */
59
+ --el-color-fg: light-dark(#2b2b2b, #ece4d4);
60
+ --el-color-fg-muted: light-dark(#5f5b53, #b0a890);
61
+ --el-color-bg: light-dark(#ffffff, #232020);
62
+ --el-color-bg-muted: light-dark(#f4f4f4, #2e2a28);
63
+ --el-color-border: light-dark(#2b2b2b, #ece4d4);
64
+
65
+ /* Color — interactive & semantic (felt-tip marker palette) */
66
+ /* The light ones of the accent, the success and the danger colour are dark enough to be text
67
+ on both backgrounds and to carry the text of a fill (4.5 : 1). */
68
+ --el-color-accent: light-dark(#2065ec, #8fb0ff);
69
+ --el-color-success: light-dark(#257e36, #69db7c);
70
+ /* One value for both schemes: a warning fill carries dark text, so the colour stays light. */
71
+ --el-color-warning: #f59e0b;
72
+ --el-color-danger: light-dark(#d72020, #ff8787);
73
+ --el-color-focus-ring: var(--el-color-accent);
74
+
75
+ /* Spacing — same 4px base scale as the other themes */
76
+ --el-space-1: 0.25rem;
77
+ --el-space-2: 0.5rem;
78
+ --el-space-3: 0.75rem;
79
+ --el-space-4: 1rem;
80
+ --el-space-5: 1.5rem;
81
+
82
+ /*
83
+ * Radius — the hand-drawn corner trick. An asymmetric 8-value border-radius
84
+ * (horizontal radii / vertical radii) makes each corner round by a slightly
85
+ * different amount, faking a pencil stroke. Values are kept modest so short,
86
+ * wide controls (inputs/buttons) wobble instead of turning into pills.
87
+ */
88
+ --el-radius-sm: 6px 10px 7px 9px / 9px 6px 10px 7px;
89
+ --el-radius-md: 16px 9px 18px 11px / 11px 17px 9px 16px;
90
+ --el-radius-lg: 26px 15px 30px 17px / 17px 28px 15px 26px;
91
+
92
+ /* Border — pen line */
93
+ --el-border-width: 2px;
94
+
95
+ /* Typography — handwriting face, with casual fallbacks before generic cursive */
96
+ --el-font-family: 'Patrick Hand', 'Comic Sans MS', 'Segoe Print', 'Bradley Hand', 'Marker Felt', cursive;
97
+ --el-font-size-sm: 0.9375rem;
98
+ --el-font-size-md: 1.0625rem;
99
+ --el-line-height: 1.55;
100
+
101
+ /* Shadow — hard offset "cutout"/sticker shadow, no blur, in the ink color */
102
+ --el-shadow-md: 2px 2px 0 light-dark(rgba(43, 43, 43, 0.2), rgba(0, 0, 0, 0.55));
103
+ --el-shadow-lg: 4px 5px 0 light-dark(rgba(43, 43, 43, 0.24), rgba(0, 0, 0, 0.6));
104
+
105
+ /* Motion — a little springy overshoot for a playful feel */
106
+ --el-duration-md: 200ms;
107
+ --el-ease: cubic-bezier(0.34, 1.3, 0.64, 1);
108
+
109
+ /* Focus ring — slightly larger gap so the ring reads as a separate scribble */
110
+ --el-focus-ring-width: 2px;
111
+ --el-focus-ring-offset: 3px;
112
+
113
+ /* Sizing */
114
+ --el-control-height: 2.5rem;
115
+ --el-touch-target: 2.75rem;
116
+
117
+ /* Dialog — an ink-wash scrim in the page's ink color */
118
+ --el-dialog-width: 31rem;
119
+ --el-dialog-overlay-background: light-dark(rgba(43, 43, 43, 0.45), rgba(0, 0, 0, 0.6));
120
+ }
157
121
 
158
- /* select-field chevron — see default.css for rationale */
159
- el-select-field .field {
160
- position: relative;
161
- }
122
+ /* Respect user motion + contrast preferences (mirrors default.css) */
162
123
 
163
- el-select-field select {
164
- appearance: none;
165
- -webkit-appearance: none;
166
- padding-right: calc(var(--el-space-3) * 2 + var(--el-space-2));
167
- }
124
+ @media (prefers-reduced-motion: reduce) {
125
+ :root {
126
+ --el-duration-md: 0s;
127
+ /* drop the overshoot too, so any non-tokenized easing stays calm */
128
+ --el-ease: cubic-bezier(0.2, 0, 0, 1);
129
+ }
130
+ }
168
131
 
169
- el-select-field .dropdown-indicator {
170
- display: flex;
171
- align-items: center;
172
- pointer-events: none;
173
- position: absolute;
174
- right: var(--el-space-3);
175
- top: 50%;
176
- transform: translateY(-50%);
177
- color: var(--el-color-fg-muted);
132
+ @media (prefers-contrast: more) {
133
+ :root {
134
+ --el-color-fg: light-dark(#000000, #ffffff);
135
+ --el-color-border: light-dark(#000000, #ffffff);
136
+ --el-border-width: 3px;
137
+ --el-focus-ring-width: 3px;
138
+ }
139
+ }
178
140
  }
179
141
 
180
142
  /* ---------------------------------------------------------------------------
181
143
  * Component flourishes
182
144
  *
183
- * The accordion, tab and slider components now read the design tokens (so every
184
- * theme can decorate them). The extras below are sketch-only: a soft cutout
145
+ * The accordion, tab, slider and carousel components read the design tokens (so
146
+ * every theme can decorate them). The extras below are sketch-only: a soft cutout
185
147
  * shadow and spacing that wouldn't suit the other themes.
186
- *
187
- * Carousel is different — it inlines Glide's own hardcoded theme (white arrows
188
- * meant to sit over images) and reads no tokens, so it's re-skinned here,
189
- * sketchy-only, via ::part() with !important to beat Glide's class selectors.
190
- * ::part() pierces the shadow boundary from this document-level sheet.
191
148
  * ------------------------------------------------------------------------- */
192
149
 
193
150
  /* Accordion — lift each hand-drawn card off the page */
@@ -199,40 +156,3 @@ el-accordion {
199
156
  el-tab-link {
200
157
  margin-right: var(--el-space-1);
201
158
  }
202
-
203
- /* Carousel — re-skin Glide's hardcoded arrows + bullets as sketch controls */
204
- el-carousel::part(arrow) {
205
- background: var(--el-color-bg) !important;
206
- color: var(--el-color-fg) !important;
207
- border: var(--el-border-width) solid var(--el-color-border) !important;
208
- border-radius: var(--el-radius-md) !important;
209
- box-shadow: var(--el-shadow-md) !important;
210
- text-shadow: none !important;
211
- }
212
- el-carousel::part(dot) {
213
- background: var(--el-color-bg) !important;
214
- border: 2px solid var(--el-color-border) !important;
215
- box-shadow: none !important;
216
- }
217
- el-carousel::part(selected-dot) {
218
- background: var(--el-color-accent) !important;
219
- }
220
-
221
- /* Respect user motion + contrast preferences (mirrors default.css) */
222
-
223
- @media (prefers-reduced-motion: reduce) {
224
- :root {
225
- --el-duration-md: 0s;
226
- /* drop the overshoot too, so any non-tokenized easing stays calm */
227
- --el-ease: cubic-bezier(0.2, 0, 0, 1);
228
- }
229
- }
230
-
231
- @media (prefers-contrast: more) {
232
- :root {
233
- --el-color-fg: light-dark(#000000, #ffffff);
234
- --el-color-border: light-dark(#000000, #ffffff);
235
- --el-border-width: 3px;
236
- --el-focus-ring-width: 3px;
237
- }
238
- }
@@ -0,0 +1,71 @@
1
+ import { arrow, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';
2
+
3
+ /** How close to the edge of the viewport a floating element may come, and its arrow to one of its corners. */
4
+ const EDGE_PADDING = 8;
5
+
6
+ /**
7
+ * Places a floating element at its anchor: at the side that `placement` names, on the opposite side
8
+ * when it has no room there, and pushed back along the edge of the viewport when it would leave it.
9
+ *
10
+ * The floating element is positioned `fixed`. It gets `left` and `top` in the coordinates of the
11
+ * viewport and `data-placement` with the side it ended up at, which is not the one asked for when
12
+ * it had no room there. The stylesheet puts the arrow on the edge that faces the anchor by that
13
+ * attribute (see the `arrow` style module); its place along the edge is set here.
14
+ * @param {Element} anchor - The element to place at.
15
+ * @param {HTMLElement} floating - The element to place.
16
+ * @param {object} options
17
+ * @param {string} options.placement - `top`, `bottom`, `left` or `right`, each also with `-start`
18
+ * or `-end`.
19
+ * @param {number} [options.distance] - The gap between the anchor and the floating element, or the
20
+ * tip of its arrow, in pixels.
21
+ * @param {HTMLElement} [options.arrowElement] - The arrow of the floating element, if it has one.
22
+ * @returns {Promise<{ placement: string, gap: number }>} The side the element ended up at, and the
23
+ * gap between it and its anchor in pixels, the arrow included.
24
+ */
25
+ export async function placeAtAnchor(anchor, floating, { placement, distance = 0, arrowElement }) {
26
+ // The arrow is a square turned by 45 degrees with its middle on the edge of the floating
27
+ // element, so half of its diagonal sticks out.
28
+ const arrowLength = arrowElement ? arrowElement.offsetWidth * Math.SQRT1_2 : 0;
29
+ const gap = (Number(distance) || 0) + arrowLength;
30
+
31
+ const {
32
+ x,
33
+ y,
34
+ placement: placed,
35
+ middlewareData,
36
+ } = await computePosition(anchor, floating, {
37
+ placement,
38
+ strategy: 'fixed',
39
+ middleware: [
40
+ offset(gap),
41
+ flip(),
42
+ shift({ padding: EDGE_PADDING }),
43
+ ...(arrowElement ? [arrow({ element: arrowElement, padding: EDGE_PADDING })] : []),
44
+ ],
45
+ });
46
+
47
+ Object.assign(floating.style, { left: `${x}px`, top: `${y}px` });
48
+ if (floating.dataset.placement !== placed) floating.dataset.placement = placed;
49
+
50
+ if (arrowElement) {
51
+ const { x: arrowX, y: arrowY } = middlewareData.arrow ?? {};
52
+ Object.assign(arrowElement.style, {
53
+ left: arrowX != null ? `${arrowX}px` : '',
54
+ top: arrowY != null ? `${arrowY}px` : '',
55
+ });
56
+ }
57
+
58
+ return { placement: placed, gap };
59
+ }
60
+
61
+ /**
62
+ * Calls `update` now, and again whenever a floating element has to be placed anew: on scroll, on
63
+ * resize, when the anchor or the floating element changes its size.
64
+ * @param {Element} anchor
65
+ * @param {HTMLElement} floating
66
+ * @param {() => void} update - Places the floating element, with `placeAtAnchor()` as a rule.
67
+ * @returns {() => void} Stops it.
68
+ */
69
+ export function followAnchor(anchor, floating, update) {
70
+ return autoUpdate(anchor, floating, update);
71
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Whether the focus has left a group of controls, asked when one of them loses it (`blur`).
3
+ *
4
+ * The focus is still in the group while it moves from one control to the next, with Tab or the
5
+ * arrow keys: the event names the control that gets it. It is also on its way to another control
6
+ * of the group while a pointer is pressed inside: the control that had the focus loses it when the
7
+ * pointer goes down, and a click on a label gives it to the control of that label only when the
8
+ * pointer goes up.
9
+ *
10
+ * A group takes itself as touched once the user has left it. Asked on every `blur`, it would show
11
+ * "choose one" while the user is choosing.
12
+ * @param {Element} group - The element around the controls.
13
+ * @param {FocusEvent} event - The `blur` of one of the controls.
14
+ * @returns {boolean}
15
+ */
16
+ export function focusLeft(group, event) {
17
+ return !(group.contains(event.relatedTarget) || group.matches(':active'));
18
+ }
@@ -0,0 +1,25 @@
1
+ /** What `max` is without a value that can be used. */
2
+ const MAX = 100;
3
+
4
+ /**
5
+ * The progress a component shows, from a `value` and a `max` that may hold anything:
6
+ * `progressOf(this.value, this.max)`. The progress bar and the progress ring ask this in their
7
+ * templates, so both read the two properties the same way.
8
+ *
9
+ * - `max` is a number above zero, or 100 where it is none.
10
+ * - `value` is a number from 0 to `max`. A value outside of that range is the nearest one inside,
11
+ * a value that is no number is 0.
12
+ * - `percent` is the share `value` is of `max`, from 0 to 100, in hundredths: a third of the way
13
+ * is 33.33, not 33.
14
+ * @param {*} value
15
+ * @param {*} max
16
+ * @returns {{ value: number, max: number, percent: number }}
17
+ */
18
+ export function progressOf(value, max) {
19
+ const top = Number(max);
20
+ const safeMax = Number.isFinite(top) && top > 0 ? top : MAX;
21
+ const number = Number(value);
22
+ const safeValue = Number.isFinite(number) ? Math.min(Math.max(number, 0), safeMax) : 0;
23
+
24
+ return { value: safeValue, max: safeMax, percent: Math.round((safeValue / safeMax) * 10000) / 100 };
25
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Whether an element is slotted into a named slot of a component: `hasSlotted(this, 'header')`.
3
+ * A component that leaves a region out while its slot is empty asks this in its template.
4
+ *
5
+ * The children of the host are asked, not the slot. A template is rendered on a server too, where
6
+ * there are no slots to ask, and the markup rendered there has to leave the same regions out as
7
+ * the browser does, or the page moves when the element takes over.
8
+ *
9
+ * A template element of element-js does not render again when its children change. The component
10
+ * listens for `slotchange` and asks for an update: the event tells of a child that comes, goes or
11
+ * changes its `slot` attribute.
12
+ *
13
+ * A `<slot>` of another component that is passed on (`<slot name="title" slot="header">`) counts,
14
+ * also while nothing is slotted into it.
15
+ * @param {Element} host - The component.
16
+ * @param {string} name - The name of the slot.
17
+ * @returns {boolean}
18
+ */
19
+ export function hasSlotted(host, name) {
20
+ return [...host.children].some((child) => child.getAttribute('slot') === name);
21
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The attributes a phone keyboard, a password manager and the browser's text assistance read from a
3
+ * text control. A field that renders its own `<input>` or `<textarea>` takes them as properties and
4
+ * passes them on to that control:
5
+ *
6
+ * - `properties()` lists each name with the default `null`, which means not set. They are written
7
+ * out there like every other property, so the API of a field can be read in one place.
8
+ * - the constructor calls `shadowNativeTextEntryProperties(this)`
9
+ * - the template writes `${spreadAttributes(textEntryAttributes(this))}` on the control
10
+ */
11
+ const TEXT_ENTRY_ATTRIBUTES = [
12
+ 'autocomplete',
13
+ 'inputmode',
14
+ 'enterkeyhint',
15
+ 'autocapitalize',
16
+ 'autocorrect',
17
+ 'spellcheck',
18
+ ];
19
+
20
+ /**
21
+ * Some of the names already exist as properties on every HTMLElement and have a value there without
22
+ * being set (`spellcheck` is `true`). element-js takes a value it finds on the element as the
23
+ * initial value of a property, so an attribute that was never set would look set. An own, empty
24
+ * property on the instance hides the native one until element-js defines the property.
25
+ *
26
+ * A property the instance already owns is left alone: it holds a value that was set before the
27
+ * element was defined.
28
+ * @param {HTMLElement} element
29
+ */
30
+ export function shadowNativeTextEntryProperties(element) {
31
+ for (const name of TEXT_ENTRY_ATTRIBUTES) {
32
+ if (name in element && !Object.hasOwn(element, name)) {
33
+ Object.defineProperty(element, name, {
34
+ value: undefined,
35
+ writable: true,
36
+ configurable: true,
37
+ enumerable: true,
38
+ });
39
+ }
40
+ }
41
+ }
42
+
43
+ /**
44
+ * The attributes for the control, to be handed to `spreadAttributes()`, which leaves out the ones
45
+ * that are `null`.
46
+ * @param {HTMLElement} element
47
+ * @returns {Record<string, unknown>}
48
+ */
49
+ export function textEntryAttributes(element) {
50
+ return Object.fromEntries(TEXT_ENTRY_ATTRIBUTES.map((name) => [name, element[name] ?? null]));
51
+ }
package/types/all.d.ts CHANGED
@@ -1 +1,54 @@
1
- export {};
1
+ import './src/components/accordion/accordion.define.js';
2
+ import './src/components/accordion-group/accordion-group.define.js';
3
+ import './src/components/amount-field/amount-field.define.js';
4
+ import './src/components/avatar/avatar.define.js';
5
+ import './src/components/badge/badge.define.js';
6
+ import './src/components/breadcrumb/breadcrumb.define.js';
7
+ import './src/components/breadcrumb-item/breadcrumb-item.define.js';
8
+ import './src/components/button/button.define.js';
9
+ import './src/components/button-group/button-group.define.js';
10
+ import './src/components/card/card.define.js';
11
+ import './src/components/carousel/carousel.define.js';
12
+ import './src/components/checkbox-field/checkbox-field.define.js';
13
+ import './src/components/checkbox-group-field/checkbox-group-field.define.js';
14
+ import './src/components/color-field/color-field.define.js';
15
+ import './src/components/combobox-field/combobox-field.define.js';
16
+ import './src/components/copy-button/copy-button.define.js';
17
+ import './src/components/date-field/date-field.define.js';
18
+ import './src/components/dialog/dialog.define.js';
19
+ import './src/components/divider/divider.define.js';
20
+ import './src/components/drawer/drawer.define.js';
21
+ import './src/components/dropdown/dropdown.define.js';
22
+ import './src/components/empty-state/empty-state.define.js';
23
+ import './src/components/file-field/file-field.define.js';
24
+ import './src/components/form-field/form-field.define.js';
25
+ import './src/components/input-field/input-field.define.js';
26
+ import './src/components/lazy-src/lazy-src.define.js';
27
+ import './src/components/notification/notification.define.js';
28
+ import './src/components/otp-field/otp-field.define.js';
29
+ import './src/components/pagination/pagination.define.js';
30
+ import './src/components/password-field/password-field.define.js';
31
+ import './src/components/popover/popover.define.js';
32
+ import './src/components/progress-bar/progress-bar.define.js';
33
+ import './src/components/progress-ring/progress-ring.define.js';
34
+ import './src/components/radio-field/radio-field.define.js';
35
+ import './src/components/range-field/range-field.define.js';
36
+ import './src/components/rating-field/rating-field.define.js';
37
+ import './src/components/scroll-to/scroll-to.define.js';
38
+ import './src/components/scroll-to-top/scroll-to-top.define.js';
39
+ import './src/components/select-field/select-field.define.js';
40
+ import './src/components/skeleton/skeleton.define.js';
41
+ import './src/components/slider/slider.define.js';
42
+ import './src/components/spinner/spinner.define.js';
43
+ import './src/components/sticky/sticky.define.js';
44
+ import './src/components/svg-use/svg-use.define.js';
45
+ import './src/components/switch-field/switch-field.define.js';
46
+ import './src/components/tab-group/tab-group.define.js';
47
+ import './src/components/tab-link/tab-link.define.js';
48
+ import './src/components/tab-panel/tab-panel.define.js';
49
+ import './src/components/tag/tag.define.js';
50
+ import './src/components/tag-field/tag-field.define.js';
51
+ import './src/components/textarea-field/textarea-field.define.js';
52
+ import './src/components/toast/toast.define.js';
53
+ import './src/components/tooltip/tooltip.define.js';
54
+ import './src/components/transition-classes/transition-classes.define.js';
package/types/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ import { BaseElement, StyledElement, TemplateElement, defineElement, html, toString } from '@webtides/element-js';
1
2
  export { BaseElement, StyledElement, TemplateElement, html, toString, defineElement };
@@ -1,4 +1,5 @@
1
- export function define(): void;
1
+ import { TemplateElement, html, defineElement } from '@webtides/element-js';
2
+ import Events from './accordion.events.js';
2
3
  /**
3
4
  * A collapsible content component that expands and collapses content sections with smooth
4
5
  * animations. Features customizable header and content slots, automatic toggle functionality,
@@ -23,7 +24,9 @@ export function define(): void;
23
24
  * @property {boolean} open - Controls whether the accordion is expanded (`true`) or collapsed
24
25
  * (`false`). Reflected to the `open` attribute.
25
26
  */
26
- export default class Accordion {
27
+ export default class Accordion extends TemplateElement {
28
+ open: any;
29
+ constructor();
27
30
  connected(): void;
28
31
  properties(): {
29
32
  open: boolean;
@@ -41,7 +44,6 @@ export default class Accordion {
41
44
  * @returns {void}
42
45
  */
43
46
  toggle(): void;
44
- open: any;
45
47
  /**
46
48
  * Closes the accordion with animation.
47
49
  * @returns {void}
@@ -56,5 +58,5 @@ export default class Accordion {
56
58
  /** @private */
57
59
  private iconsTemplate;
58
60
  }
59
- import Events from './accordion.events.js';
61
+ export declare function define(): void;
60
62
  export { html, defineElement, Events };
@@ -1,4 +1,4 @@
1
- declare namespace _default {
2
- let TOGGLE: string;
3
- }
1
+ declare const _default: {
2
+ TOGGLE: string;
3
+ };
4
4
  export default _default;
@@ -1,4 +1,5 @@
1
- export function define(): void;
1
+ import { BaseElement } from '@webtides/element-js';
2
+ import Events from '../accordion/accordion.events.js';
2
3
  /**
3
4
  * Container that manages multiple `<el-accordion>` children. When `showMultiple` is
4
5
  * `false`, only one accordion can be open at a time; opening a new accordion closes the
@@ -12,7 +13,7 @@ export function define(): void;
12
13
  * time; opening a new accordion closes the previously open one. When `true`, multiple
13
14
  * accordions can be open simultaneously.
14
15
  */
15
- export default class AccordionGroup {
16
+ export default class AccordionGroup extends BaseElement {
16
17
  /** @private */
17
18
  private currentOpenElement;
18
19
  properties(): {
@@ -25,4 +26,4 @@ export default class AccordionGroup {
25
26
  };
26
27
  };
27
28
  }
28
- import Events from '../accordion/accordion.events.js';
29
+ export declare function define(): void;