@warp-ds/elements 2.2.0-next.2 → 2.2.0-next.21

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 (516) hide show
  1. package/README.md +228 -28
  2. package/dist/.storybook/utilities.d.ts +28 -0
  3. package/dist/.storybook/utilities.js +52 -0
  4. package/dist/api.js +1 -49
  5. package/dist/api.js.map +4 -4
  6. package/dist/custom-elements.json +7146 -0
  7. package/dist/index.d.ts +1847 -18
  8. package/dist/packages/affix/affix.react.stories.d.ts +9 -0
  9. package/dist/packages/affix/affix.react.stories.js +10 -0
  10. package/dist/packages/affix/affix.stories.d.ts +10 -0
  11. package/dist/packages/affix/affix.stories.js +25 -0
  12. package/dist/packages/affix/affix.test.d.ts +1 -0
  13. package/dist/packages/affix/affix.test.js +9 -0
  14. package/dist/packages/affix/index.d.ts +47 -24
  15. package/dist/packages/affix/index.js +2448 -2240
  16. package/dist/packages/affix/index.js.map +4 -4
  17. package/dist/packages/affix/react.d.ts +2 -0
  18. package/dist/packages/affix/react.js +15 -0
  19. package/dist/packages/affix/styles.d.ts +1 -0
  20. package/dist/packages/affix/styles.js +2 -0
  21. package/dist/packages/alert/alert.react.stories.d.ts +13 -0
  22. package/dist/packages/alert/alert.react.stories.js +44 -0
  23. package/dist/packages/alert/alert.stories.d.ts +15 -0
  24. package/dist/packages/alert/alert.stories.js +68 -0
  25. package/dist/packages/alert/alert.test.d.ts +1 -0
  26. package/dist/packages/alert/alert.test.js +18 -0
  27. package/dist/packages/alert/index.d.ts +21 -16
  28. package/dist/packages/alert/index.js +2452 -2446
  29. package/dist/packages/alert/index.js.map +4 -4
  30. package/dist/packages/alert/react.d.ts +2 -0
  31. package/dist/packages/alert/react.js +11 -0
  32. package/dist/packages/alert/styles.d.ts +1 -0
  33. package/dist/packages/alert/styles.js +2 -0
  34. package/dist/packages/attention/attention.react.stories.d.ts +15 -0
  35. package/dist/packages/attention/attention.react.stories.js +92 -0
  36. package/dist/packages/attention/attention.stories.d.ts +15 -0
  37. package/dist/packages/attention/attention.stories.js +173 -0
  38. package/dist/packages/attention/attention.test.d.ts +1 -0
  39. package/dist/packages/attention/attention.test.js +11 -0
  40. package/dist/packages/attention/index.d.ts +62 -89
  41. package/dist/packages/attention/index.js +3521 -3924
  42. package/dist/packages/attention/index.js.map +4 -4
  43. package/dist/packages/attention/layout-styles.d.ts +1 -0
  44. package/dist/packages/attention/layout-styles.js +905 -0
  45. package/dist/packages/attention/locales/da/messages.mjs +1 -0
  46. package/dist/packages/attention/locales/en/messages.mjs +1 -0
  47. package/dist/packages/attention/locales/fi/messages.mjs +1 -0
  48. package/dist/packages/attention/locales/nb/messages.mjs +1 -0
  49. package/dist/packages/attention/locales/sv/messages.mjs +1 -0
  50. package/dist/packages/attention/react.d.ts +15 -0
  51. package/dist/packages/attention/react.js +17 -0
  52. package/dist/packages/attention/styles.d.ts +1 -0
  53. package/dist/packages/attention/styles.js +2 -0
  54. package/dist/packages/badge/badge.react.stories.d.ts +18 -0
  55. package/dist/packages/badge/badge.react.stories.js +60 -0
  56. package/dist/packages/badge/badge.stories.d.ts +17 -0
  57. package/dist/packages/badge/badge.stories.js +68 -0
  58. package/dist/packages/badge/badge.test.d.ts +1 -0
  59. package/dist/packages/badge/badge.test.js +9 -0
  60. package/dist/packages/badge/index.d.ts +12 -11
  61. package/dist/packages/badge/index.js +2441 -300
  62. package/dist/packages/badge/index.js.map +4 -4
  63. package/dist/packages/badge/react.d.ts +2 -0
  64. package/dist/packages/badge/react.js +11 -0
  65. package/dist/packages/badge/styles.d.ts +1 -0
  66. package/dist/packages/badge/styles.js +2 -0
  67. package/dist/packages/box/box.react.stories.d.ts +15 -0
  68. package/dist/packages/box/box.react.stories.js +45 -0
  69. package/dist/packages/box/box.stories.d.ts +14 -0
  70. package/dist/packages/box/box.stories.js +59 -0
  71. package/dist/packages/box/box.test.d.ts +1 -0
  72. package/dist/packages/box/box.test.js +9 -0
  73. package/dist/packages/box/index.d.ts +17 -20
  74. package/dist/packages/box/index.js +2443 -299
  75. package/dist/packages/box/index.js.map +4 -4
  76. package/dist/packages/box/react.d.ts +2 -0
  77. package/dist/packages/box/react.js +11 -0
  78. package/dist/packages/box/slot.test.d.ts +1 -0
  79. package/dist/packages/box/slot.test.js +9 -0
  80. package/dist/packages/box/styles.d.ts +1 -0
  81. package/dist/packages/box/styles.js +2 -0
  82. package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +13 -0
  83. package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +40 -0
  84. package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +12 -0
  85. package/dist/packages/breadcrumbs/breadcrumbs.stories.js +60 -0
  86. package/dist/packages/breadcrumbs/breadcrumbs.test.d.ts +1 -0
  87. package/dist/packages/breadcrumbs/breadcrumbs.test.js +16 -0
  88. package/dist/packages/breadcrumbs/index.d.ts +19 -16
  89. package/dist/packages/breadcrumbs/index.js +2402 -2051
  90. package/dist/packages/breadcrumbs/index.js.map +4 -4
  91. package/dist/packages/breadcrumbs/locales/da/messages.mjs +1 -0
  92. package/dist/packages/breadcrumbs/locales/en/messages.mjs +1 -0
  93. package/dist/packages/breadcrumbs/locales/fi/messages.mjs +1 -0
  94. package/dist/packages/breadcrumbs/locales/nb/messages.mjs +1 -0
  95. package/dist/packages/breadcrumbs/locales/sv/messages.mjs +1 -0
  96. package/dist/packages/breadcrumbs/react.d.ts +2 -0
  97. package/dist/packages/breadcrumbs/react.js +11 -0
  98. package/dist/packages/breadcrumbs/styles.d.ts +1 -0
  99. package/dist/packages/breadcrumbs/styles.js +2 -0
  100. package/dist/packages/button/button.react.stories.d.ts +22 -0
  101. package/dist/packages/button/button.react.stories.js +102 -0
  102. package/dist/packages/button/button.stories.d.ts +21 -0
  103. package/dist/packages/button/button.stories.js +119 -0
  104. package/dist/packages/button/button.test.d.ts +1 -0
  105. package/dist/packages/button/button.test.js +25 -0
  106. package/dist/packages/button/index.d.ts +106 -56
  107. package/dist/packages/button/index.js +2618 -2130
  108. package/dist/packages/button/index.js.map +4 -4
  109. package/dist/packages/button/locales/da/messages.mjs +1 -0
  110. package/dist/packages/button/locales/en/messages.mjs +1 -0
  111. package/dist/packages/button/locales/fi/messages.mjs +1 -0
  112. package/dist/packages/button/locales/nb/messages.mjs +1 -0
  113. package/dist/packages/button/locales/sv/messages.mjs +1 -0
  114. package/dist/packages/button/react.d.ts +2 -0
  115. package/dist/packages/button/react.js +11 -0
  116. package/dist/packages/button/styles.d.ts +1 -0
  117. package/dist/packages/button/styles.js +2 -0
  118. package/dist/packages/card/card.react.stories.d.ts +16 -0
  119. package/dist/packages/card/card.react.stories.js +63 -0
  120. package/dist/packages/card/card.stories.d.ts +15 -0
  121. package/dist/packages/card/card.stories.js +82 -0
  122. package/dist/packages/card/card.test.d.ts +1 -0
  123. package/dist/packages/card/card.test.js +9 -0
  124. package/dist/packages/card/index.d.ts +27 -15
  125. package/dist/packages/card/index.js +2403 -2067
  126. package/dist/packages/card/index.js.map +4 -4
  127. package/dist/packages/card/locales/da/messages.mjs +1 -0
  128. package/dist/packages/card/locales/en/messages.mjs +1 -0
  129. package/dist/packages/card/locales/fi/messages.mjs +1 -0
  130. package/dist/packages/card/locales/nb/messages.mjs +1 -0
  131. package/dist/packages/card/locales/sv/messages.mjs +1 -0
  132. package/dist/packages/card/react.d.ts +2 -0
  133. package/dist/packages/card/react.js +11 -0
  134. package/dist/packages/card/styles.d.ts +1 -0
  135. package/dist/packages/card/styles.js +2 -0
  136. package/dist/packages/combobox/combobox.react.stories.d.ts +28 -0
  137. package/dist/packages/combobox/combobox.react.stories.js +90 -0
  138. package/dist/packages/combobox/combobox.stories.d.ts +18 -0
  139. package/dist/packages/combobox/combobox.stories.js +117 -0
  140. package/dist/packages/combobox/index.d.ts +95 -0
  141. package/dist/packages/combobox/index.js +2492 -0
  142. package/dist/packages/combobox/index.js.map +7 -0
  143. package/dist/packages/combobox/locales/da/messages.d.mts +1 -0
  144. package/dist/packages/combobox/locales/da/messages.mjs +1 -0
  145. package/dist/packages/combobox/locales/en/messages.d.mts +1 -0
  146. package/dist/packages/combobox/locales/en/messages.mjs +1 -0
  147. package/dist/packages/combobox/locales/fi/messages.d.mts +1 -0
  148. package/dist/packages/combobox/locales/fi/messages.mjs +1 -0
  149. package/dist/packages/combobox/locales/nb/messages.d.mts +1 -0
  150. package/dist/packages/combobox/locales/nb/messages.mjs +1 -0
  151. package/dist/packages/combobox/locales/sv/messages.d.mts +1 -0
  152. package/dist/packages/combobox/locales/sv/messages.mjs +1 -0
  153. package/dist/packages/combobox/react.d.ts +7 -0
  154. package/dist/packages/combobox/react.js +17 -0
  155. package/dist/packages/combobox/styles.d.ts +1 -0
  156. package/dist/packages/combobox/styles.js +2 -0
  157. package/dist/packages/datepicker/DatePicker.test.d.ts +2 -0
  158. package/dist/packages/datepicker/DatePicker.test.js +69 -0
  159. package/dist/packages/datepicker/datepicker.d.ts +102 -0
  160. package/dist/packages/datepicker/datepicker.js +2785 -0
  161. package/dist/packages/datepicker/datepicker.js.map +7 -0
  162. package/dist/packages/datepicker/datepicker.react.stories.d.ts +18 -0
  163. package/dist/packages/datepicker/datepicker.react.stories.js +26 -0
  164. package/dist/packages/datepicker/datepicker.stories.d.ts +12 -0
  165. package/dist/packages/datepicker/datepicker.stories.js +51 -0
  166. package/dist/packages/datepicker/datepicker.test.d.ts +2 -0
  167. package/dist/packages/datepicker/datepicker.test.js +62 -0
  168. package/dist/packages/datepicker/index.d.ts +1 -0
  169. package/dist/packages/datepicker/index.js +2785 -0
  170. package/dist/packages/datepicker/index.js.map +7 -0
  171. package/dist/packages/datepicker/locales/da/messages.d.mts +1 -0
  172. package/dist/packages/datepicker/locales/da/messages.mjs +1 -0
  173. package/dist/packages/datepicker/locales/en/messages.d.mts +1 -0
  174. package/dist/packages/datepicker/locales/en/messages.mjs +1 -0
  175. package/dist/packages/datepicker/locales/fi/messages.d.mts +1 -0
  176. package/dist/packages/datepicker/locales/fi/messages.mjs +1 -0
  177. package/dist/packages/datepicker/locales/nb/messages.d.mts +1 -0
  178. package/dist/packages/datepicker/locales/nb/messages.mjs +1 -0
  179. package/dist/packages/datepicker/locales/sv/messages.d.mts +1 -0
  180. package/dist/packages/datepicker/locales/sv/messages.mjs +1 -0
  181. package/dist/packages/datepicker/react.d.ts +5 -0
  182. package/dist/packages/datepicker/react.js +15 -0
  183. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +1 -0
  184. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.js +15 -0
  185. package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +1 -0
  186. package/dist/packages/datepicker/styles/w-datepicker-day.styles.js +64 -0
  187. package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +1 -0
  188. package/dist/packages/datepicker/styles/w-datepicker-month.styles.js +72 -0
  189. package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +1 -0
  190. package/dist/packages/datepicker/styles/w-datepicker.styles.js +101 -0
  191. package/dist/packages/datepicker/utils.d.ts +13 -0
  192. package/dist/packages/datepicker/utils.js +28 -0
  193. package/dist/packages/dead-toggle/dead-toggle.react.stories.d.ts +15 -0
  194. package/dist/packages/dead-toggle/dead-toggle.react.stories.js +34 -0
  195. package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +14 -0
  196. package/dist/packages/dead-toggle/dead-toggle.stories.js +45 -0
  197. package/dist/packages/dead-toggle/dead-toggle.test.d.ts +1 -0
  198. package/dist/packages/dead-toggle/dead-toggle.test.js +9 -0
  199. package/dist/packages/dead-toggle/index.d.ts +16 -0
  200. package/dist/packages/dead-toggle/index.js +2487 -0
  201. package/dist/packages/dead-toggle/index.js.map +7 -0
  202. package/dist/packages/dead-toggle/react.d.ts +2 -0
  203. package/dist/packages/dead-toggle/react.js +11 -0
  204. package/dist/packages/expandable/expandable.react.stories.d.ts +18 -0
  205. package/dist/packages/expandable/expandable.react.stories.js +103 -0
  206. package/dist/packages/expandable/expandable.stories.d.ts +19 -0
  207. package/dist/packages/expandable/expandable.stories.js +133 -0
  208. package/dist/packages/expandable/expandable.test.d.ts +1 -0
  209. package/dist/packages/expandable/expandable.test.js +24 -0
  210. package/dist/packages/expandable/index.d.ts +52 -50
  211. package/dist/packages/expandable/index.js +2424 -2286
  212. package/dist/packages/expandable/index.js.map +4 -4
  213. package/dist/packages/expandable/react.d.ts +2 -0
  214. package/dist/packages/expandable/react.js +11 -0
  215. package/dist/packages/expandable/styles.d.ts +1 -0
  216. package/dist/packages/expandable/styles.js +2 -0
  217. package/dist/packages/i18n.js +45 -0
  218. package/dist/packages/link/index.d.ts +34 -0
  219. package/dist/packages/link/index.js +2646 -0
  220. package/dist/packages/link/index.js.map +7 -0
  221. package/dist/packages/link/link.react.stories.d.ts +21 -0
  222. package/dist/packages/link/link.react.stories.js +96 -0
  223. package/dist/packages/link/link.stories.d.ts +20 -0
  224. package/dist/packages/link/link.stories.js +110 -0
  225. package/dist/packages/link/link.test.d.ts +1 -0
  226. package/dist/packages/link/link.test.js +9 -0
  227. package/dist/packages/link/react.d.ts +2 -0
  228. package/dist/packages/link/react.js +11 -0
  229. package/dist/packages/link/styles.d.ts +1 -0
  230. package/dist/packages/link/styles.js +200 -0
  231. package/dist/packages/modal/index.d.ts +4 -5
  232. package/dist/packages/modal/index.js +2649 -2575
  233. package/dist/packages/modal/index.js.map +4 -4
  234. package/dist/packages/modal/locales/da/messages.mjs +1 -0
  235. package/dist/packages/modal/locales/en/messages.mjs +1 -0
  236. package/dist/packages/modal/locales/fi/messages.mjs +1 -0
  237. package/dist/packages/modal/locales/nb/messages.mjs +1 -0
  238. package/dist/packages/modal/locales/sv/messages.mjs +1 -0
  239. package/dist/packages/modal/modal-footer.d.ts +13 -11
  240. package/dist/packages/modal/modal-footer.js +2460 -0
  241. package/dist/packages/modal/modal-footer.js.map +7 -0
  242. package/dist/packages/modal/modal-header.d.ts +25 -31
  243. package/dist/packages/modal/modal-header.js +2584 -0
  244. package/dist/packages/modal/modal-header.js.map +7 -0
  245. package/dist/packages/modal/modal-main.d.ts +27 -31
  246. package/dist/packages/modal/modal-main.js +2572 -0
  247. package/dist/packages/modal/modal-main.js.map +7 -0
  248. package/dist/packages/modal/modal.react.stories.d.ts +14 -0
  249. package/dist/packages/modal/modal.react.stories.js +27 -0
  250. package/dist/packages/modal/modal.stories.d.ts +19 -0
  251. package/dist/packages/modal/modal.stories.js +160 -0
  252. package/dist/packages/modal/react.d.ts +12 -0
  253. package/dist/packages/modal/react.js +31 -0
  254. package/dist/packages/modal/util.d.ts +7 -17
  255. package/dist/packages/modal/util.js +21 -0
  256. package/dist/packages/pageindicator/index.d.ts +10 -0
  257. package/dist/packages/pageindicator/index.js +32 -0
  258. package/dist/packages/pageindicator/index.js.map +7 -0
  259. package/dist/packages/pageindicator/pageindicator.react.stories.d.ts +19 -0
  260. package/dist/packages/pageindicator/pageindicator.react.stories.js +20 -0
  261. package/dist/packages/pageindicator/pageindicator.stories.d.ts +32 -0
  262. package/dist/packages/pageindicator/pageindicator.stories.js +71 -0
  263. package/dist/packages/pageindicator/react.d.ts +2 -0
  264. package/dist/packages/pageindicator/react.js +11 -0
  265. package/dist/packages/pageindicator/style.d.ts +1 -0
  266. package/dist/packages/pageindicator/style.js +26 -0
  267. package/dist/packages/pagination/index.d.ts +32 -0
  268. package/dist/packages/pagination/index.js +2500 -0
  269. package/dist/packages/pagination/index.js.map +7 -0
  270. package/dist/packages/pagination/locales/da/messages.d.mts +1 -0
  271. package/dist/packages/pagination/locales/da/messages.mjs +1 -0
  272. package/dist/packages/pagination/locales/en/messages.d.mts +1 -0
  273. package/dist/packages/pagination/locales/en/messages.mjs +1 -0
  274. package/dist/packages/pagination/locales/fi/messages.d.mts +1 -0
  275. package/dist/packages/pagination/locales/fi/messages.mjs +1 -0
  276. package/dist/packages/pagination/locales/nb/messages.d.mts +1 -0
  277. package/dist/packages/pagination/locales/nb/messages.mjs +1 -0
  278. package/dist/packages/pagination/locales/sv/messages.d.mts +1 -0
  279. package/dist/packages/pagination/locales/sv/messages.mjs +1 -0
  280. package/dist/packages/pagination/pagination.react.stories.d.ts +21 -0
  281. package/dist/packages/pagination/pagination.react.stories.js +45 -0
  282. package/dist/packages/pagination/pagination.stories.d.ts +14 -0
  283. package/dist/packages/pagination/pagination.stories.js +56 -0
  284. package/dist/packages/pagination/pagination.test.d.ts +1 -0
  285. package/dist/packages/pagination/pagination.test.js +76 -0
  286. package/dist/packages/pagination/react.d.ts +5 -0
  287. package/dist/packages/pagination/react.js +15 -0
  288. package/dist/packages/pagination/styles.d.ts +1 -0
  289. package/dist/packages/pagination/styles.js +2 -0
  290. package/dist/packages/pill/index.d.ts +39 -23
  291. package/dist/packages/pill/index.js +2408 -2175
  292. package/dist/packages/pill/index.js.map +4 -4
  293. package/dist/packages/pill/locales/da/messages.mjs +1 -0
  294. package/dist/packages/pill/locales/en/messages.mjs +1 -0
  295. package/dist/packages/pill/locales/fi/messages.mjs +1 -0
  296. package/dist/packages/pill/locales/nb/messages.mjs +1 -0
  297. package/dist/packages/pill/locales/sv/messages.mjs +1 -0
  298. package/dist/packages/pill/pill.react.stories.d.ts +23 -0
  299. package/dist/packages/pill/pill.react.stories.js +22 -0
  300. package/dist/packages/pill/pill.stories.d.ts +12 -0
  301. package/dist/packages/pill/pill.stories.js +33 -0
  302. package/dist/packages/pill/pill.test.d.ts +1 -0
  303. package/dist/packages/pill/pill.test.js +25 -0
  304. package/dist/packages/pill/react.d.ts +7 -0
  305. package/dist/packages/pill/react.js +17 -0
  306. package/dist/packages/pill/styles.d.ts +1 -0
  307. package/dist/packages/pill/styles.js +2 -0
  308. package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +64 -0
  309. package/dist/packages/rip-and-tear-checkbox/checkbox.js +160 -0
  310. package/dist/packages/rip-and-tear-checkbox/checkbox.js.map +7 -0
  311. package/dist/packages/rip-and-tear-checkbox/checkbox.stories.d.ts +8 -0
  312. package/dist/packages/rip-and-tear-checkbox/checkbox.stories.js +11 -0
  313. package/dist/packages/rip-and-tear-checkbox/index.d.ts +1 -0
  314. package/dist/packages/rip-and-tear-checkbox/index.js +160 -0
  315. package/dist/packages/rip-and-tear-checkbox/index.js.map +7 -0
  316. package/dist/packages/rip-and-tear-checkbox/react.d.ts +5 -0
  317. package/dist/packages/rip-and-tear-checkbox/react.js +15 -0
  318. package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.d.ts +12 -0
  319. package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.js +10 -0
  320. package/dist/packages/rip-and-tear-checkbox/styles.d.ts +1 -0
  321. package/dist/packages/rip-and-tear-checkbox/styles.js +116 -0
  322. package/dist/packages/rip-and-tear-radio/base-element.d.ts +46 -0
  323. package/dist/packages/rip-and-tear-radio/base-element.js +100 -0
  324. package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +6 -0
  325. package/dist/packages/rip-and-tear-radio/custom-error-validator.js +22 -0
  326. package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +103 -0
  327. package/dist/packages/rip-and-tear-radio/form-associated-element.js +282 -0
  328. package/dist/packages/rip-and-tear-radio/host-styles.d.ts +1 -0
  329. package/dist/packages/rip-and-tear-radio/host-styles.js +12 -0
  330. package/dist/packages/rip-and-tear-radio/index.d.ts +1 -0
  331. package/dist/packages/rip-and-tear-radio/index.js +270 -0
  332. package/dist/packages/rip-and-tear-radio/index.js.map +7 -0
  333. package/dist/packages/rip-and-tear-radio/invalid.d.ts +8 -0
  334. package/dist/packages/rip-and-tear-radio/invalid.js +5 -0
  335. package/dist/packages/rip-and-tear-radio/math.d.ts +1 -0
  336. package/dist/packages/rip-and-tear-radio/math.js +4 -0
  337. package/dist/packages/rip-and-tear-radio/radio-group-styles.d.ts +1 -0
  338. package/dist/packages/rip-and-tear-radio/radio-group-styles.js +60 -0
  339. package/dist/packages/rip-and-tear-radio/radio-group-styles.js.map +7 -0
  340. package/dist/packages/rip-and-tear-radio/radio-group.d.ts +72 -0
  341. package/dist/packages/rip-and-tear-radio/radio-group.js +270 -0
  342. package/dist/packages/rip-and-tear-radio/radio-group.js.map +7 -0
  343. package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +1 -0
  344. package/dist/packages/rip-and-tear-radio/radio-styles.js +170 -0
  345. package/dist/packages/rip-and-tear-radio/radio-styles.js.map +7 -0
  346. package/dist/packages/rip-and-tear-radio/radio.d.ts +38 -0
  347. package/dist/packages/rip-and-tear-radio/radio.js +183 -0
  348. package/dist/packages/rip-and-tear-radio/radio.js.map +7 -0
  349. package/dist/packages/rip-and-tear-radio/radio.stories.d.ts +8 -0
  350. package/dist/packages/rip-and-tear-radio/radio.stories.js +275 -0
  351. package/dist/packages/rip-and-tear-radio/radio.stories.js.map +7 -0
  352. package/dist/packages/rip-and-tear-radio/react.d.ts +9 -0
  353. package/dist/packages/rip-and-tear-radio/react.js +22 -0
  354. package/dist/packages/rip-and-tear-radio/required-validator.d.ts +11 -0
  355. package/dist/packages/rip-and-tear-radio/required-validator.js +34 -0
  356. package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.d.ts +9 -0
  357. package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.js +10 -0
  358. package/dist/packages/rip-and-tear-radio/slot.d.ts +20 -0
  359. package/dist/packages/rip-and-tear-radio/slot.js +71 -0
  360. package/dist/packages/rip-and-tear-radio/watch.d.ts +26 -0
  361. package/dist/packages/rip-and-tear-radio/watch.js +39 -0
  362. package/dist/packages/select/index.d.ts +56 -50
  363. package/dist/packages/select/index.js +2421 -2236
  364. package/dist/packages/select/index.js.map +4 -4
  365. package/dist/packages/select/locales/da/messages.mjs +1 -0
  366. package/dist/packages/select/locales/en/messages.mjs +1 -0
  367. package/dist/packages/select/locales/fi/messages.mjs +1 -0
  368. package/dist/packages/select/locales/nb/messages.mjs +1 -0
  369. package/dist/packages/select/locales/sv/messages.mjs +1 -0
  370. package/dist/packages/select/react.d.ts +6 -0
  371. package/dist/packages/select/react.js +20 -0
  372. package/dist/packages/select/select.react.stories.d.ts +18 -0
  373. package/dist/packages/select/select.react.stories.js +28 -0
  374. package/dist/packages/select/select.stories.d.ts +10 -0
  375. package/dist/packages/select/select.stories.js +31 -0
  376. package/dist/packages/select/select.test.d.ts +1 -0
  377. package/dist/packages/select/select.test.js +31 -0
  378. package/dist/packages/select/styles.d.ts +1 -0
  379. package/dist/packages/select/styles.js +2 -0
  380. package/dist/packages/slider/Slider.d.ts +2 -0
  381. package/dist/packages/slider/Slider.js +8 -0
  382. package/dist/packages/slider/SliderThumb.d.ts +2 -0
  383. package/dist/packages/slider/SliderThumb.js +8 -0
  384. package/dist/packages/slider/index.d.ts +2 -0
  385. package/dist/packages/slider/index.js +2791 -0
  386. package/dist/packages/slider/index.js.map +7 -0
  387. package/dist/packages/slider/oddbird-css-anchor-positioning.d.ts +2 -0
  388. package/dist/packages/slider/oddbird-css-anchor-positioning.js +3 -0
  389. package/dist/packages/slider/react.d.ts +8 -0
  390. package/dist/packages/slider/react.js +20 -0
  391. package/dist/packages/slider/slider-thumb.d.ts +57 -0
  392. package/dist/packages/slider/slider-thumb.js +2663 -0
  393. package/dist/packages/slider/slider-thumb.js.map +7 -0
  394. package/dist/packages/slider/slider.d.ts +46 -0
  395. package/dist/packages/slider/slider.js +2569 -0
  396. package/dist/packages/slider/slider.js.map +7 -0
  397. package/dist/packages/slider/slider.react.stories.d.ts +18 -0
  398. package/dist/packages/slider/slider.react.stories.js +119 -0
  399. package/dist/packages/slider/slider.stories.d.ts +17 -0
  400. package/dist/packages/slider/slider.stories.js +203 -0
  401. package/dist/packages/slider/slider.test.d.ts +4 -0
  402. package/dist/packages/slider/slider.test.js +83 -0
  403. package/dist/packages/slider/styles/w-slider-thumb.styles.d.ts +1 -0
  404. package/dist/packages/slider/styles/w-slider-thumb.styles.js +132 -0
  405. package/dist/packages/slider/styles/w-slider.styles.d.ts +1 -0
  406. package/dist/packages/slider/styles/w-slider.styles.js +118 -0
  407. package/dist/packages/slider/styles.d.ts +1 -0
  408. package/dist/packages/slider/styles.js +2 -0
  409. package/dist/packages/steps/index.d.ts +36 -0
  410. package/dist/packages/steps/index.js +2465 -0
  411. package/dist/packages/steps/index.js.map +7 -0
  412. package/dist/packages/steps/locales/da/messages.d.mts +1 -0
  413. package/dist/packages/steps/locales/da/messages.mjs +1 -0
  414. package/dist/packages/steps/locales/en/messages.d.mts +1 -0
  415. package/dist/packages/steps/locales/en/messages.mjs +1 -0
  416. package/dist/packages/steps/locales/fi/messages.d.mts +1 -0
  417. package/dist/packages/steps/locales/fi/messages.mjs +1 -0
  418. package/dist/packages/steps/locales/nb/messages.d.mts +1 -0
  419. package/dist/packages/steps/locales/nb/messages.mjs +1 -0
  420. package/dist/packages/steps/locales/sv/messages.d.mts +1 -0
  421. package/dist/packages/steps/locales/sv/messages.mjs +1 -0
  422. package/dist/packages/steps/react.d.ts +3 -0
  423. package/dist/packages/steps/react.js +16 -0
  424. package/dist/packages/steps/steps.react.stories.d.ts +15 -0
  425. package/dist/packages/steps/steps.react.stories.js +112 -0
  426. package/dist/packages/steps/steps.stories.d.ts +12 -0
  427. package/dist/packages/steps/steps.stories.js +172 -0
  428. package/dist/packages/steps/styles.d.ts +1 -0
  429. package/dist/packages/steps/styles.js +2 -0
  430. package/dist/packages/styles.d.ts +2 -0
  431. package/dist/packages/styles.js +2442 -0
  432. package/dist/packages/switch/index.d.ts +15 -0
  433. package/dist/packages/switch/index.js +2455 -0
  434. package/dist/packages/switch/index.js.map +7 -0
  435. package/dist/packages/switch/react.d.ts +5 -0
  436. package/dist/packages/switch/react.js +15 -0
  437. package/dist/packages/switch/styles.d.ts +1 -0
  438. package/dist/packages/switch/styles.js +2 -0
  439. package/dist/packages/switch/switch.react.stories.d.ts +15 -0
  440. package/dist/packages/switch/switch.react.stories.js +29 -0
  441. package/dist/packages/switch/switch.stories.d.ts +9 -0
  442. package/dist/packages/switch/switch.stories.js +34 -0
  443. package/dist/packages/tabs/index.d.ts +4 -0
  444. package/dist/packages/tabs/index.js +2470 -0
  445. package/dist/packages/tabs/index.js.map +7 -0
  446. package/dist/packages/tabs/react.d.ts +12 -0
  447. package/dist/packages/tabs/react.js +31 -0
  448. package/dist/packages/tabs/styles.d.ts +1 -0
  449. package/dist/packages/tabs/styles.js +2 -0
  450. package/dist/packages/tabs/tab-panel.d.ts +20 -0
  451. package/dist/packages/tabs/tab-panel.js +2441 -0
  452. package/dist/packages/tabs/tab-panel.js.map +7 -0
  453. package/dist/packages/tabs/tab.d.ts +18 -0
  454. package/dist/packages/tabs/tab.js +2463 -0
  455. package/dist/packages/tabs/tab.js.map +7 -0
  456. package/dist/packages/tabs/tabs.d.ts +40 -0
  457. package/dist/packages/tabs/tabs.js +2448 -0
  458. package/dist/packages/tabs/tabs.js.map +7 -0
  459. package/dist/packages/tabs/tabs.react.stories.d.ts +15 -0
  460. package/dist/packages/tabs/tabs.react.stories.js +51 -0
  461. package/dist/packages/tabs/tabs.stories.d.ts +8 -0
  462. package/dist/packages/tabs/tabs.stories.js +2545 -0
  463. package/dist/packages/tabs/tabs.stories.js.map +7 -0
  464. package/dist/packages/textfield/index.d.ts +78 -74
  465. package/dist/packages/textfield/index.js +2514 -422
  466. package/dist/packages/textfield/index.js.map +4 -4
  467. package/dist/packages/textfield/react.d.ts +11 -0
  468. package/dist/packages/textfield/react.js +21 -0
  469. package/dist/packages/textfield/styles/w-textfield.styles.d.ts +1 -0
  470. package/dist/packages/textfield/styles/w-textfield.styles.js +46 -0
  471. package/dist/packages/textfield/styles.d.ts +1 -0
  472. package/dist/packages/textfield/styles.js +2 -0
  473. package/dist/packages/textfield/textfield.react.stories.d.ts +37 -0
  474. package/dist/packages/textfield/textfield.react.stories.js +88 -0
  475. package/dist/packages/textfield/textfield.stories.d.ts +18 -0
  476. package/dist/packages/textfield/textfield.stories.js +105 -0
  477. package/dist/packages/textfield/textfield.test.d.ts +2 -0
  478. package/dist/packages/textfield/textfield.test.js +68 -0
  479. package/dist/packages/toast/api.d.ts +4 -45
  480. package/dist/packages/toast/api.js +41 -0
  481. package/dist/packages/toast/index.d.ts +3 -0
  482. package/dist/packages/toast/index.js +2466 -2787
  483. package/dist/packages/toast/index.js.map +4 -4
  484. package/dist/packages/toast/locales/da/messages.mjs +1 -0
  485. package/dist/packages/toast/locales/en/messages.mjs +1 -0
  486. package/dist/packages/toast/locales/fi/messages.mjs +1 -0
  487. package/dist/packages/toast/locales/nb/messages.mjs +1 -0
  488. package/dist/packages/toast/locales/sv/messages.mjs +1 -0
  489. package/dist/packages/toast/styles.d.ts +1 -0
  490. package/dist/packages/toast/styles.js +2 -0
  491. package/dist/packages/toast/toast-container.d.ts +12 -63
  492. package/dist/packages/toast/toast-container.js +2458 -0
  493. package/dist/packages/toast/toast-container.js.map +7 -0
  494. package/dist/packages/toast/toast.d.ts +34 -29
  495. package/dist/packages/toast/toast.js +2466 -0
  496. package/dist/packages/toast/toast.js.map +7 -0
  497. package/dist/packages/toast/toast.stories.d.ts +12 -0
  498. package/dist/packages/toast/toast.stories.js +50 -0
  499. package/dist/packages/toast/types.d.ts +15 -0
  500. package/dist/packages/toast/types.js +1 -0
  501. package/dist/packages/utils/expand-transition.d.ts +3 -2
  502. package/dist/packages/utils/expand-transition.js +59 -0
  503. package/dist/packages/utils/index.d.ts +1 -1
  504. package/dist/packages/utils/index.js +2 -0
  505. package/dist/packages/utils/index.js.map +7 -0
  506. package/dist/packages/utils/unstyled-heading.d.ts +3 -3
  507. package/dist/packages/utils/unstyled-heading.js +22 -0
  508. package/dist/packages/utils/window-exists.js +1 -0
  509. package/dist/setup-tests.d.ts +1 -0
  510. package/dist/setup-tests.js +1 -0
  511. package/dist/vscode.css-custom-data.json +6 -0
  512. package/dist/vscode.html-custom-data.json +738 -0
  513. package/dist/web-types.json +1693 -0
  514. package/package.json +93 -37
  515. package/dist/index.js +0 -6838
  516. package/dist/index.js.map +0 -7
@@ -0,0 +1,203 @@
1
+ import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
2
+ import { html } from 'lit';
3
+ import '../affix/index.js';
4
+ import '../textfield/index.js';
5
+ import './index.js';
6
+ const { events: sliderEvents, args: sliderArgs, argTypes: sliderArgTypes, } = getStorybookHelpers('w-slider');
7
+ const meta = {
8
+ title: 'Forms/Slider and Range Slider',
9
+ args: sliderArgs,
10
+ argTypes: sliderArgTypes,
11
+ parameters: {
12
+ actions: {
13
+ handles: sliderEvents,
14
+ },
15
+ },
16
+ };
17
+ export default meta;
18
+ export const Single = {
19
+ render() {
20
+ return html `
21
+ <w-slider label="Single" min="0" max="100">
22
+ <w-slider-thumb name="value"></w-slider-thumb>
23
+ </w-slider>
24
+ `;
25
+ },
26
+ };
27
+ export const Range = {
28
+ render() {
29
+ return html `
30
+ <w-slider label="Range" min="0" max="100">
31
+ <w-slider-thumb slot="from" aria-label="From value" name="from"></w-slider-thumb>
32
+ <w-slider-thumb slot="to" aria-label="To value" name="to"></w-slider-thumb>
33
+ </w-slider>
34
+ `;
35
+ },
36
+ };
37
+ // Take a suffix attribute on `<w-slider>` I think, have `<w-slider-thumb>` get from that.
38
+ export const SuffixSquareMeters = {
39
+ args: {
40
+ locale: 'nb',
41
+ suffix: 'm²',
42
+ },
43
+ render({ locale, suffix }) {
44
+ return html `
45
+ <w-slider label="Apartment size" min="0" max="250" suffix="${suffix}" data-testid="sqm">
46
+ <w-slider-thumb slot="from" aria-label="From size" name="from"></w-slider-thumb>
47
+ <w-slider-thumb slot="to" aria-label="To size" name="to"></w-slider-thumb>
48
+ </w-slider>
49
+ <script type="module">
50
+ const sqmSlider = document.querySelector('w-slider[data-testid="sqm"]');
51
+ sqmSlider.formatter = window.getNumberFormatter('${locale}').format;
52
+ </script>
53
+ `;
54
+ },
55
+ };
56
+ export const SuffixCurrency = {
57
+ args: {
58
+ locale: 'nb',
59
+ suffix: 'kr',
60
+ },
61
+ render({ locale, suffix }) {
62
+ return html `
63
+ <w-slider label="Price" min="0" max="250000" suffix="${suffix}" data-testid="currency">
64
+ <w-slider-thumb slot="from" aria-label="From price" name="from"></w-slider-thumb>
65
+ <w-slider-thumb slot="to" aria-label="To price" name="to"></w-slider-thumb>
66
+ </w-slider>
67
+ <script type="module">
68
+ const currencySlider = document.querySelector('w-slider[data-testid="currency"]');
69
+ currencySlider.formatter = window.getNumberFormatter('${locale}').format;
70
+ </script>
71
+ `;
72
+ },
73
+ };
74
+ export const SuffixKilometers = {
75
+ args: {
76
+ locale: 'nb',
77
+ suffix: 'km',
78
+ },
79
+ render({ locale, suffix }) {
80
+ return html `
81
+ <w-slider label="Distance" min="0" max="250000" suffix="${suffix}" data-testid="km">
82
+ <w-slider-thumb slot="from" aria-label="From distance" name="from"></w-slider-thumb>
83
+ <w-slider-thumb slot="to" aria-label="To distance" name="to"></w-slider-thumb>
84
+ </w-slider>
85
+ <script type="module">
86
+ const kmSlider = document.querySelector('w-slider[data-testid="km"]');
87
+ kmSlider.formatter = window.getNumberFormatter('${locale}').format;
88
+ </script>
89
+ `;
90
+ },
91
+ };
92
+ export const Marks = {
93
+ args: {
94
+ locale: 'nb',
95
+ suffix: 'km',
96
+ step: '25000',
97
+ markers: '25000',
98
+ },
99
+ render({ locale, suffix, markers, step }) {
100
+ return html `
101
+ <w-slider label="Distance" markers="${markers}" step="${step}" min="0" max="250000" suffix="${suffix}" data-testid="markers">
102
+ <w-slider-thumb slot="from" aria-label="From distance" name="from"></w-slider-thumb>
103
+ <w-slider-thumb slot="to" aria-label="To distance" name="to"></w-slider-thumb>
104
+ </w-slider>
105
+
106
+ <script type="module">
107
+ const markersSlider = document.querySelector('w-slider[data-testid="markers"]');
108
+ markersSlider.formatter = window.getNumberFormatter('${locale}').format;
109
+ </script>
110
+ `;
111
+ },
112
+ };
113
+ export const Step = {
114
+ args: {
115
+ step: 5,
116
+ },
117
+ render({ step }) {
118
+ return html `
119
+ <w-slider label="Single" step="${step}" min="0" max="100">
120
+ <w-slider-thumb name="value"></w-slider-thumb>
121
+ </w-slider>
122
+ `;
123
+ },
124
+ };
125
+ export const OverUnder = {
126
+ args: {},
127
+ render() {
128
+ return html `
129
+ <form id="overunder" style="margin-bottom: 16px" lang="nb">
130
+ <w-slider label="Produksjonsår" min="1950" max="2025" data-testid="overunder">
131
+ <w-slider-thumb
132
+ slot="from"
133
+ aria-label="Fra år"
134
+ aria-description="1950 inkluderer kjøretøy produsert fram til 1950"
135
+ name="from"></w-slider-thumb>
136
+ <w-slider-thumb
137
+ slot="to"
138
+ aria-label="Til år"
139
+ aria-description="2025 inkluderer kjøretøy produsert etter 2025"
140
+ name="to"></w-slider-thumb>
141
+ </w-slider>
142
+ </form>
143
+ <p>Drag the slider to show the value below. See the Code tab for how to format the labels.</p>
144
+ <output>
145
+ <dl>
146
+ <dt>From:</dt>
147
+ <dd id="overunder-from"></dd>
148
+ <dt>To:</dt>
149
+ <dd id="overunder-to"></dd>
150
+ </dl>
151
+ </output>
152
+ <script>
153
+ /** Here is how you can show labels to indicate min and max values are "up to and including" and "this value and above". */
154
+ const overunderSlider = document.querySelector('w-slider[data-testid="overunder"]');
155
+ overunderSlider.formatter = function (value) {
156
+ if (value === '1950') {
157
+ return 'Før 1950';
158
+ }
159
+ if (value === '2025') {
160
+ return 'Etter 2025';
161
+ }
162
+ return value;
163
+ };
164
+
165
+ /** Code to show the form values in output */
166
+ document.forms['overunder'].addEventListener('input', function () {
167
+ const formData = new FormData(this);
168
+ const from = formData.get('from');
169
+ const to = formData.get('to');
170
+ document.getElementById('overunder-from').innerText = from;
171
+ document.getElementById('overunder-to').innerText = to;
172
+ });
173
+ </script>
174
+ `;
175
+ },
176
+ };
177
+ export const SingleError = {
178
+ args: {
179
+ locale: 'nb',
180
+ },
181
+ render() {
182
+ return html `
183
+ <w-slider label="Single" min="0" max="100">
184
+ <p slot="description">Try typing a value over 100</p>
185
+ <w-slider-thumb></w-slider-thumb>
186
+ </w-slider>
187
+ `;
188
+ },
189
+ };
190
+ export const RangeError = {
191
+ args: {
192
+ locale: 'nb',
193
+ },
194
+ render() {
195
+ return html `
196
+ <w-slider label="Production year" min="1950" max="2025" over under>
197
+ <p slot="description">Try typing a from value higher than a to value</p>
198
+ <w-slider-thumb slot="from" name="from"></w-slider-thumb>
199
+ <w-slider-thumb slot="to" name="to"></w-slider-thumb>
200
+ </w-slider>
201
+ `;
202
+ },
203
+ };
@@ -0,0 +1,4 @@
1
+ import '../attention/index.js';
2
+ import '../affix/index.js';
3
+ import '../textfield/index.js';
4
+ import './index.js';
@@ -0,0 +1,83 @@
1
+ import { userEvent } from '@vitest/browser/context';
2
+ import { html } from 'lit';
3
+ import { expect, test } from 'vitest';
4
+ import { render } from 'vitest-browser-lit';
5
+ import '../attention/index.js';
6
+ import '../affix/index.js';
7
+ import '../textfield/index.js';
8
+ import './index.js';
9
+ test('single slider starts with a default value equal to max', async () => {
10
+ const component = html `
11
+ <form data-testid="form">
12
+ <w-slider label="Single" min="0" max="100">
13
+ <w-slider-thumb name="value"></w-slider-thumb>
14
+ </w-slider>
15
+ </form>
16
+ `;
17
+ const page = render(component);
18
+ await expect.element(page.getByLabelText('Single').first()).toHaveValue('100');
19
+ });
20
+ test('range slider starts with a default from value equal to min, and to value equal to max', async () => {
21
+ const component = html `
22
+ <form data-testid="form">
23
+ <w-slider label="Range" min="0" max="100">
24
+ <w-slider-thumb aria-label="From" name="rangefrom" slot="from"></w-slider-thumb>
25
+ <w-slider-thumb aria-label="To" name="rangeto" slot="to"></w-slider-thumb>
26
+ </w-slider>
27
+ </form>
28
+ `;
29
+ const page = render(component);
30
+ await expect.element(page.getByLabelText('From').first()).toHaveValue('0');
31
+ await expect.element(page.getByLabelText('To').first()).toHaveValue('100');
32
+ });
33
+ test('can set slider value via the range input', async () => {
34
+ const component = html `
35
+ <form data-testid="form">
36
+ <w-slider label="Single" min="0" max="100">
37
+ <w-slider-thumb name="value"></w-slider-thumb>
38
+ </w-slider>
39
+ </form>
40
+ `;
41
+ const page = render(component);
42
+ await userEvent.type(page.getByLabelText('Single').first(), '{ArrowLeft}{ArrowLeft}{ArrowLeft}');
43
+ await expect.element(page.getByLabelText('Single').first()).toHaveValue('97');
44
+ await expect.element(page.getByRole('spinbutton')).toHaveValue(97); // keeps value in sync between inputs
45
+ const formData = new FormData(page.getByTestId('form').element());
46
+ expect(formData.get('value')).toBe('97');
47
+ });
48
+ test('can set slider value via the number input', async () => {
49
+ const component = html `
50
+ <form data-testid="form">
51
+ <w-slider label="Single" min="0" max="100">
52
+ <w-slider-thumb name="value"></w-slider-thumb>
53
+ </w-slider>
54
+ </form>
55
+ `;
56
+ const page = render(component);
57
+ await page.getByRole('spinbutton').fill('50');
58
+ await expect.element(page.getByRole('spinbutton')).toHaveValue(50);
59
+ await expect.element(page.getByLabelText('Single').first()).toHaveValue('50'); // keeps value in sync between inputs
60
+ const formData = new FormData(page.getByTestId('form').element());
61
+ expect(formData.get('value')).toBe('50');
62
+ });
63
+ test('deleting from number input works as expected', async () => {
64
+ const component = html `
65
+ <form data-testid="form">
66
+ <w-slider label="Production year" min="1950" max="2025" over under>
67
+ <p slot="description">Try typing a from value higher than a to value</p>
68
+ <w-slider-thumb slot="from" name="from"></w-slider-thumb>
69
+ <w-slider-thumb slot="to" name="to"></w-slider-thumb>
70
+ </w-slider>
71
+ </form>
72
+ `;
73
+ const page = render(component);
74
+ await expect.element(page.getByRole('spinbutton').last()).toHaveValue(2025);
75
+ await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
76
+ await expect.element(page.getByRole('spinbutton').last()).toHaveValue(202);
77
+ await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
78
+ await expect.element(page.getByRole('spinbutton').last()).toHaveValue(20);
79
+ await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
80
+ await expect.element(page.getByRole('spinbutton').last()).toHaveValue(2);
81
+ await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
82
+ await expect.element(page.getByRole('spinbutton').last()).not.toHaveValue();
83
+ });
@@ -0,0 +1 @@
1
+ export declare const wSliderThumbStyles: import("lit").CSSResult;
@@ -0,0 +1,132 @@
1
+ import { css } from 'lit';
2
+ /* For some reason the pseudoselectors for webkit and moz must be separate blocks :shrug: */
3
+ export const wSliderThumbStyles = css `
4
+ .w-slider-thumb {
5
+ position: relative;
6
+ display: grid;
7
+ pointer-events: none; /* For range inputs we position two of these on top of each other. Let clicks go through the top one. */
8
+ grid-template-areas:
9
+ 'slider slider slider'
10
+ 'frommarker . tomarker'
11
+ 'fromtextfield . totextfield';
12
+ grid-template-columns: 1fr 24px 1fr;
13
+ }
14
+
15
+ .w-slider-thumb__range {
16
+ appearance: none;
17
+ background-color: transparent;
18
+ grid-area: slider;
19
+ height: 44px; /* touch target */
20
+ pointer-events: none; /* let clicks pass through for range slider where we place two inputs over each other */
21
+ }
22
+
23
+ .w-slider-thumb__range::-webkit-slider-runnable-track {
24
+ box-shadow: none;
25
+ color: var(--w-s-color-text);
26
+ height: var(--w-slider-track-height);
27
+ }
28
+
29
+ .w-slider-thumb__range:hover::-webkit-slider-thumb {
30
+ background: var(--w-s-color-background-primary-hover);
31
+ }
32
+
33
+ .w-slider-thumb__range:hover::-moz-range-thumb {
34
+ background: var(--w-s-color-background-primary-hover);
35
+ }
36
+
37
+ /*
38
+ Use anchor positioning to place the tooltip target in relation to the slider thumb.
39
+ We use a polyfill to bring support to older Safari, Firefox at time of writing.
40
+ */
41
+ .w-slider-thumb__range::-webkit-slider-thumb {
42
+ anchor-name: --thumb;
43
+
44
+ appearance: none;
45
+ background: var(--w-s-color-background-primary);
46
+ border-radius: 50%;
47
+ height: var(--w-slider-thumb-size);
48
+ margin-top: calc(-1 * calc(var(--w-slider-thumb-offset) - calc(var(--w-slider-track-height) / 2)));
49
+ pointer-events: auto;
50
+ width: var(--w-slider-thumb-size);
51
+ z-index: 1;
52
+ }
53
+
54
+ .w-slider-thumb__range::-moz-range-thumb {
55
+ anchor-name: --thumb;
56
+
57
+ appearance: none;
58
+ background: var(--w-s-color-background-primary);
59
+ border-radius: 50%;
60
+ border-color: transparent;
61
+ height: var(--w-slider-thumb-size);
62
+ margin-top: calc(-1 * calc(var(--w-slider-thumb-offset) - calc(var(--w-slider-track-height) / 2)));
63
+ pointer-events: initial;
64
+ width: var(--w-slider-thumb-size);
65
+ z-index: 1;
66
+ }
67
+
68
+ .w-slider-thumb__tooltip {
69
+ display: none;
70
+ position: absolute;
71
+
72
+ background-color: var(--w-s-color-background-inverted);
73
+ color: var(--w-s-color-text-inverted-static);
74
+ border-color: var(--w-s-color-background-inverted);
75
+
76
+ padding: 4px 8px;
77
+ border-radius: 4px;
78
+ font-size: 12px;
79
+ white-space: nowrap;
80
+ z-index: 1;
81
+
82
+ position-anchor: --thumb;
83
+
84
+ bottom: calc(anchor(top) + 5px);
85
+ justify-self: anchor-center;
86
+ }
87
+
88
+ .w-slider-thumb__tooltip--visible {
89
+ display: block;
90
+ }
91
+
92
+ .w-slider-thumb__from-marker,
93
+ .w-slider-thumb__to-marker {
94
+ margin-inline: 2px; /* visual alignment with input border, slider thumb */
95
+ color: var(--w-s-color-text-subtle);
96
+ font-size: var(--w-font-size-s);
97
+ line-height: var(--w-line-height-s);
98
+ }
99
+
100
+ .w-slider-thumb__from-marker {
101
+ grid-area: frommarker;
102
+ }
103
+
104
+ .w-slider-thumb__to-marker {
105
+ grid-area: tomarker;
106
+ text-align: right;
107
+ }
108
+
109
+ .w-slider-thumb__textfield {
110
+ margin-top: 10px;
111
+ pointer-events: auto;
112
+ grid-row: 3 / 4;
113
+ grid-column: 1 / 3; /* Single sliders should have the text field use the fromtextfield _and_ gap portion of the CSS grid. */
114
+ }
115
+
116
+ :host([name='from']) .w-slider-thumb__textfield {
117
+ grid-column: 1 / 2; /* Range sliders should leave the gap empty. */
118
+ }
119
+
120
+ :host([name='from']) .w-slider-thumb__range::-webkit-slider-thumb {
121
+ margin-left: calc(-1px * var(--thumb-offset) / 2);
122
+ }
123
+
124
+ :host([name='to']) .w-slider-thumb__textfield {
125
+ grid-row: 3 / 4;
126
+ grid-column: 3 / 4;
127
+ }
128
+
129
+ :host([name='to']) .w-slider-thumb__range::-webkit-slider-thumb {
130
+ margin-left: calc(1px * var(--thumb-offset) / 2);
131
+ }
132
+ `;
@@ -0,0 +1 @@
1
+ export declare const wSliderStyles: import("lit").CSSResult;
@@ -0,0 +1,118 @@
1
+ import { css } from 'lit';
2
+ export const wSliderStyles = css `
3
+ .w-slider {
4
+ position: relative;
5
+ border: none;
6
+ padding: 0;
7
+ margin: 0;
8
+ display: grid;
9
+ width: 100%;
10
+ grid-template-areas:
11
+ 'label'
12
+ 'description'
13
+ 'slider';
14
+ grid-template-columns: 1fr;
15
+
16
+ --w-slider-track-background: var(--w-s-color-background-disabled-subtle);
17
+ --w-slider-track-active-background: var(--w-s-color-background-primary);
18
+ --w-slider-track-height: 4px;
19
+ --w-slider-track-active-height: 6px;
20
+ --w-slider-thumb-background: var(--w-s-color-background-primary);
21
+ --w-slider-thumb-background-hover: var(--w-s-color-background-primary-hover);
22
+ --w-slider-thumb-size: 28px;
23
+ --w-slider-thumb-offset: calc(var(--w-slider-thumb-size) / 2);
24
+ --w-slider-marker-color: var(--w-s-color-border);
25
+
26
+ /* Math corner to calculate the fill of the slider and placement of markers. */
27
+
28
+ /* The --min value can be non-zero, f. ex. choosing a year from 1950 to 2025. Normalize the values so we start at 0 and run to max - min. */
29
+ --_value-range: calc(var(--max) - var(--min));
30
+ --_from-in-range: max(calc(var(--from) - var(--min)), 0);
31
+
32
+ /* limit to maximum value in range so typing a value larger than max doesn't explode layouts */
33
+ --_to-in-range: min(calc(var(--to) - var(--min)), var(--_value-range));
34
+
35
+ /* Position the starting point of the fill in the case of a non-zero --from value in a range slider.
36
+ * In other words, given a width of 100% how many percent should be left unfilled/blank
37
+ * at the beginning of the range slider (dashes in this ASCII-range-slider: |---O******O|) */
38
+ --_from-as-percent-of-max: calc(var(--_from-in-range) / var(--_value-range) * 100);
39
+ --_blank-values-before: var(--_from-as-percent-of-max);
40
+
41
+ /* Set the width of the fill as a percentage.
42
+ * In other words, given a width of 100% how many percent should be left unfilled/blank
43
+ * at the end of the slider (dashes in this ASCII-slider: |******O---|) */
44
+ --_to-as-percent-of-max: calc(var(--_to-in-range) / var(--_value-range) * 100);
45
+ --_filled-values: calc(var(--_to-as-percent-of-max) - var(--_blank-values-before));
46
+
47
+ /* Vertical position of range and markers */
48
+ --_range-top: calc(
49
+ var(--w-slider-thumb-size) / 2 + calc(var(--w-slider-track-active-height) - calc(var(--w-slider-track-height) / 2) + 1px)
50
+ );
51
+ }
52
+
53
+ .w-slider__label {
54
+ grid-area: label;
55
+ font-size: var(--w-font-size-s);
56
+ line-height: var(--w-line-height-s);
57
+ font-weight: bold;
58
+ padding-bottom: 8px;
59
+ color: var(--w-s-color-text);
60
+ }
61
+
62
+ .w-slider__description {
63
+ grid-area: description;
64
+ }
65
+
66
+ .w-slider__active-range {
67
+ align-self: center;
68
+ background: var(--w-slider-track-background);
69
+ border-radius: 4px;
70
+ position: absolute;
71
+ top: var(--_range-top);
72
+ left: 0;
73
+ right: 0;
74
+ grid-area: slider;
75
+ }
76
+
77
+ .w-slider__markers {
78
+ --_marker-height: 7px;
79
+ --_marker-width: 1px;
80
+
81
+ align-self: center;
82
+
83
+ /* Creates a linear gradient with --_marker-width wide markers
84
+ followed by enough transparent that we can repeat the gradient
85
+ along the X axis and have markers visible where we want them. */
86
+ background: linear-gradient(to right, var(--w-slider-marker-color) var(--_marker-width), rgba(0, 0, 0, 0) 1px) repeat-x;
87
+ --_step-width-as-percent: calc(var(--markers) / var(--_value-range) * 100);
88
+ background-size: calc(var(--_step-width-as-percent) * 1% - 0.1%) var(--_marker-height);
89
+
90
+ background-position: bottom 0 left 8px right 8px;
91
+ position: absolute;
92
+ top: calc(var(--_range-top) + 2px);
93
+ left: 1px;
94
+ right: 1px;
95
+ grid-area: slider;
96
+ height: var(--_marker-height);
97
+ }
98
+
99
+ .w-slider__active-range::before {
100
+ background: var(--w-slider-track-active-background);
101
+ border-radius: 4px;
102
+ content: '';
103
+ display: block;
104
+ height: var(--w-slider-track-active-height);
105
+
106
+ margin-left: calc(var(--_blank-values-before) * 1%);
107
+ width: calc(var(--_filled-values) * 1%);
108
+ }
109
+
110
+ slot::slotted(w-slider-thumb) {
111
+ position: static;
112
+ top: 0;
113
+ left: 0;
114
+ right: 0;
115
+ bottom: 0;
116
+ grid-area: slider;
117
+ }
118
+ `;
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,2 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;
@@ -0,0 +1,36 @@
1
+ import { LitElement } from 'lit';
2
+ import '@warp-ds/icons/elements/check-16';
3
+ /**
4
+ * Steps are used to show progress through a process or to guide users through a multi-step task.
5
+ *
6
+ * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/components-steps--docs)
7
+ */
8
+ declare class WarpSteps extends LitElement {
9
+ horizontal: boolean;
10
+ right: boolean;
11
+ static styles: import("lit").CSSResult[];
12
+ constructor();
13
+ updated(): void;
14
+ updateStepsContext(): void;
15
+ render(): import("lit").TemplateResult<1>;
16
+ }
17
+ interface StepsContext {
18
+ horizontal?: boolean;
19
+ right?: boolean;
20
+ isLast?: boolean;
21
+ isFirst?: boolean;
22
+ }
23
+ /**
24
+ * Individual step component that shows a single step in a process
25
+ */
26
+ declare class WarpStep extends LitElement {
27
+ active: boolean;
28
+ completed: boolean;
29
+ private _context;
30
+ static styles: import("lit").CSSResult[];
31
+ constructor();
32
+ setContext(context: StepsContext): void;
33
+ getAriaLabel(): string;
34
+ render(): import("lit").TemplateResult<1>;
35
+ }
36
+ export { WarpSteps, WarpStep };