@warp-ds/elements 2.2.0-next.8 → 2.2.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 (330) hide show
  1. package/README.md +188 -26
  2. package/dist/.storybook/utilities.js +52 -0
  3. package/dist/api.js +1 -1
  4. package/dist/api.js.map +4 -4
  5. package/dist/custom-elements.json +1517 -2876
  6. package/dist/index.d.ts +942 -25
  7. package/dist/packages/affix/affix.react.stories.d.ts +9 -0
  8. package/dist/packages/affix/affix.react.stories.js +10 -0
  9. package/dist/packages/affix/affix.stories.js +25 -0
  10. package/dist/packages/affix/affix.test.js +9 -0
  11. package/dist/packages/affix/index.d.ts +0 -17
  12. package/dist/packages/affix/index.js +5 -5
  13. package/dist/packages/affix/index.js.map +4 -4
  14. package/dist/packages/affix/react.d.ts +1 -1
  15. package/dist/packages/affix/react.js +15 -2482
  16. package/dist/packages/affix/styles.js +2 -0
  17. package/dist/packages/alert/alert.react.stories.d.ts +13 -0
  18. package/dist/packages/alert/alert.react.stories.js +44 -0
  19. package/dist/packages/alert/alert.stories.js +68 -0
  20. package/dist/packages/alert/alert.test.js +18 -0
  21. package/dist/packages/alert/index.d.ts +1 -6
  22. package/dist/packages/alert/index.js +4 -4
  23. package/dist/packages/alert/index.js.map +4 -4
  24. package/dist/packages/alert/react.d.ts +1 -1
  25. package/dist/packages/alert/react.js +11 -2492
  26. package/dist/packages/alert/styles.js +2 -0
  27. package/dist/packages/attention/attention.react.stories.d.ts +15 -0
  28. package/dist/packages/attention/attention.react.stories.js +92 -0
  29. package/dist/packages/attention/attention.stories.d.ts +6 -0
  30. package/dist/packages/attention/attention.stories.js +180 -0
  31. package/dist/packages/attention/attention.test.js +11 -0
  32. package/dist/packages/attention/index.d.ts +24 -91
  33. package/dist/packages/attention/index.js +3585 -17
  34. package/dist/packages/attention/index.js.map +4 -4
  35. package/dist/packages/attention/layout-styles.js +905 -0
  36. package/dist/packages/attention/locales/da/messages.mjs +1 -0
  37. package/dist/packages/attention/locales/en/messages.mjs +1 -0
  38. package/dist/packages/attention/locales/fi/messages.mjs +1 -0
  39. package/dist/packages/attention/locales/nb/messages.mjs +1 -0
  40. package/dist/packages/attention/locales/sv/messages.mjs +1 -0
  41. package/dist/packages/attention/react.d.ts +15 -0
  42. package/dist/packages/attention/react.js +17 -0
  43. package/dist/packages/attention/styles.js +2 -0
  44. package/dist/packages/badge/badge.react.stories.d.ts +18 -0
  45. package/dist/packages/badge/badge.react.stories.js +60 -0
  46. package/dist/packages/badge/badge.stories.js +68 -0
  47. package/dist/packages/badge/badge.test.js +9 -0
  48. package/dist/packages/badge/index.d.ts +0 -5
  49. package/dist/packages/badge/index.js +1 -1
  50. package/dist/packages/badge/index.js.map +4 -4
  51. package/dist/packages/badge/react.d.ts +1 -1
  52. package/dist/packages/badge/react.js +11 -2465
  53. package/dist/packages/badge/styles.js +2 -0
  54. package/dist/packages/box/box.react.stories.d.ts +15 -0
  55. package/dist/packages/box/box.react.stories.js +45 -0
  56. package/dist/packages/box/box.stories.js +59 -0
  57. package/dist/packages/box/box.test.js +9 -0
  58. package/dist/packages/box/index.d.ts +0 -5
  59. package/dist/packages/box/index.js +11 -4
  60. package/dist/packages/box/index.js.map +4 -4
  61. package/dist/packages/box/react.d.ts +1 -1
  62. package/dist/packages/box/react.js +11 -2465
  63. package/dist/packages/box/slot.test.js +9 -0
  64. package/dist/packages/box/styles.js +2 -0
  65. package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +13 -0
  66. package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +40 -0
  67. package/dist/packages/breadcrumbs/breadcrumbs.stories.js +60 -0
  68. package/dist/packages/breadcrumbs/breadcrumbs.test.js +16 -0
  69. package/dist/packages/breadcrumbs/index.d.ts +0 -12
  70. package/dist/packages/breadcrumbs/index.js +6 -6
  71. package/dist/packages/breadcrumbs/index.js.map +4 -4
  72. package/dist/packages/breadcrumbs/locales/da/messages.mjs +1 -0
  73. package/dist/packages/breadcrumbs/locales/en/messages.mjs +1 -0
  74. package/dist/packages/breadcrumbs/locales/fi/messages.mjs +1 -0
  75. package/dist/packages/breadcrumbs/locales/nb/messages.mjs +1 -0
  76. package/dist/packages/breadcrumbs/locales/sv/messages.mjs +1 -0
  77. package/dist/packages/breadcrumbs/react.d.ts +1 -1
  78. package/dist/packages/breadcrumbs/react.js +11 -2475
  79. package/dist/packages/breadcrumbs/styles.js +2 -0
  80. package/dist/packages/button/button.react.stories.d.ts +22 -0
  81. package/dist/packages/button/button.react.stories.js +102 -0
  82. package/dist/packages/button/button.stories.d.ts +4 -0
  83. package/dist/packages/button/button.stories.js +151 -0
  84. package/dist/packages/button/button.test.js +25 -0
  85. package/dist/packages/button/index.d.ts +0 -66
  86. package/dist/packages/button/index.js +17 -11
  87. package/dist/packages/button/index.js.map +4 -4
  88. package/dist/packages/button/locales/da/messages.mjs +1 -0
  89. package/dist/packages/button/locales/en/messages.mjs +1 -0
  90. package/dist/packages/button/locales/fi/messages.mjs +1 -0
  91. package/dist/packages/button/locales/nb/messages.mjs +1 -0
  92. package/dist/packages/button/locales/sv/messages.mjs +1 -0
  93. package/dist/packages/button/react.d.ts +1 -1
  94. package/dist/packages/button/react.js +10 -2684
  95. package/dist/packages/button/styles.js +2 -0
  96. package/dist/packages/card/card.react.stories.d.ts +16 -0
  97. package/dist/packages/card/card.react.stories.js +63 -0
  98. package/dist/packages/card/card.stories.js +82 -0
  99. package/dist/packages/card/card.test.js +9 -0
  100. package/dist/packages/card/index.d.ts +1 -18
  101. package/dist/packages/card/index.js +4 -4
  102. package/dist/packages/card/index.js.map +4 -4
  103. package/dist/packages/card/locales/da/messages.mjs +1 -0
  104. package/dist/packages/card/locales/en/messages.mjs +1 -0
  105. package/dist/packages/card/locales/fi/messages.mjs +1 -0
  106. package/dist/packages/card/locales/nb/messages.mjs +1 -0
  107. package/dist/packages/card/locales/sv/messages.mjs +1 -0
  108. package/dist/packages/card/react.d.ts +1 -1
  109. package/dist/packages/card/react.js +11 -2487
  110. package/dist/packages/card/styles.js +2 -0
  111. package/dist/packages/expandable/expandable.react.stories.d.ts +18 -0
  112. package/dist/packages/expandable/expandable.react.stories.js +103 -0
  113. package/dist/packages/expandable/expandable.stories.js +132 -0
  114. package/dist/packages/expandable/expandable.test.js +24 -0
  115. package/dist/packages/expandable/index.d.ts +2 -33
  116. package/dist/packages/expandable/index.js +20 -11
  117. package/dist/packages/expandable/index.js.map +4 -4
  118. package/dist/packages/expandable/react.d.ts +1 -1
  119. package/dist/packages/expandable/react.js +11 -2495
  120. package/dist/packages/expandable/styles.js +2 -0
  121. package/dist/packages/i18n.js +45 -0
  122. package/dist/packages/link/index.d.ts +0 -5
  123. package/dist/packages/link/index.js +93 -2640
  124. package/dist/packages/link/styles.js +200 -0
  125. package/dist/packages/modal/index.js +24 -41
  126. package/dist/packages/modal/index.js.map +4 -4
  127. package/dist/packages/modal/locales/da/messages.mjs +1 -0
  128. package/dist/packages/modal/locales/en/messages.mjs +1 -0
  129. package/dist/packages/modal/locales/fi/messages.mjs +1 -0
  130. package/dist/packages/modal/locales/nb/messages.mjs +1 -0
  131. package/dist/packages/modal/locales/sv/messages.mjs +1 -0
  132. package/dist/packages/modal/modal-footer.d.ts +0 -5
  133. package/dist/packages/{dead-toggle/index.js → modal/modal-footer.js} +20 -47
  134. package/dist/packages/modal/modal-footer.js.map +7 -0
  135. package/dist/packages/modal/modal-header.d.ts +0 -5
  136. package/dist/packages/{steps/index.js → modal/modal-header.js} +122 -20
  137. package/dist/packages/modal/modal-header.js.map +7 -0
  138. package/dist/packages/modal/modal-main.d.ts +0 -5
  139. package/dist/packages/{dead-toggle/react.js → modal/modal-main.js} +124 -59
  140. package/dist/packages/{box/react.js.map → modal/modal-main.js.map} +4 -4
  141. package/dist/packages/modal/modal.react.stories.d.ts +14 -0
  142. package/dist/packages/modal/modal.react.stories.js +27 -0
  143. package/dist/packages/modal/modal.stories.d.ts +3 -3
  144. package/dist/packages/modal/modal.stories.js +254 -0
  145. package/dist/packages/modal/react.d.ts +11 -3
  146. package/dist/packages/modal/react.js +31 -2754
  147. package/dist/packages/modal/util.js +21 -0
  148. package/dist/packages/pill/index.d.ts +0 -17
  149. package/dist/packages/pill/index.js +5 -5
  150. package/dist/packages/pill/index.js.map +2 -2
  151. package/dist/packages/pill/locales/da/messages.mjs +1 -0
  152. package/dist/packages/pill/locales/en/messages.mjs +1 -0
  153. package/dist/packages/pill/locales/fi/messages.mjs +1 -0
  154. package/dist/packages/pill/locales/nb/messages.mjs +1 -0
  155. package/dist/packages/pill/locales/sv/messages.mjs +1 -0
  156. package/dist/packages/pill/pill.react.stories.d.ts +23 -0
  157. package/dist/packages/pill/pill.react.stories.js +22 -0
  158. package/dist/packages/pill/pill.stories.js +33 -0
  159. package/dist/packages/pill/pill.test.js +25 -0
  160. package/dist/packages/pill/react.d.ts +7 -0
  161. package/dist/packages/pill/react.js +17 -0
  162. package/dist/packages/pill/styles.js +2 -0
  163. package/dist/packages/select/index.d.ts +4 -29
  164. package/dist/packages/select/index.js +25 -18
  165. package/dist/packages/select/index.js.map +3 -3
  166. package/dist/packages/select/locales/da/messages.mjs +1 -0
  167. package/dist/packages/select/locales/en/messages.mjs +1 -0
  168. package/dist/packages/select/locales/fi/messages.mjs +1 -0
  169. package/dist/packages/select/locales/nb/messages.mjs +1 -0
  170. package/dist/packages/select/locales/sv/messages.mjs +1 -0
  171. package/dist/packages/select/react.d.ts +6 -2
  172. package/dist/packages/select/react.js +20 -2494
  173. package/dist/packages/select/select.react.stories.d.ts +18 -0
  174. package/dist/packages/select/select.react.stories.js +28 -0
  175. package/dist/packages/select/select.stories.d.ts +7 -0
  176. package/dist/packages/select/select.stories.js +100 -0
  177. package/dist/packages/select/select.test.js +31 -0
  178. package/dist/packages/select/styles.js +2 -0
  179. package/dist/packages/{switch/index.js → styles.js} +5 -18
  180. package/dist/packages/textfield/index.d.ts +12 -26
  181. package/dist/packages/textfield/index.js +86 -28
  182. package/dist/packages/textfield/index.js.map +4 -4
  183. package/dist/packages/textfield/react.d.ts +11 -2
  184. package/dist/packages/textfield/react.js +21 -2490
  185. package/dist/packages/textfield/styles/w-textfield.styles.d.ts +1 -0
  186. package/dist/packages/textfield/styles/w-textfield.styles.js +55 -0
  187. package/dist/packages/textfield/styles.js +2 -0
  188. package/dist/packages/textfield/textfield.react.stories.d.ts +37 -0
  189. package/dist/packages/textfield/textfield.react.stories.js +88 -0
  190. package/dist/packages/textfield/textfield.stories.d.ts +1 -0
  191. package/dist/packages/textfield/textfield.stories.js +105 -0
  192. package/dist/packages/textfield/textfield.test.d.ts +1 -0
  193. package/dist/packages/textfield/textfield.test.js +68 -0
  194. package/dist/packages/toast/api.d.ts +4 -45
  195. package/dist/packages/toast/api.js +41 -0
  196. package/dist/packages/toast/index.d.ts +3 -3
  197. package/dist/packages/toast/index.js +2463 -24
  198. package/dist/packages/toast/index.js.map +4 -4
  199. package/dist/packages/toast/locales/da/messages.mjs +1 -0
  200. package/dist/packages/toast/locales/en/messages.mjs +1 -0
  201. package/dist/packages/toast/locales/fi/messages.mjs +1 -0
  202. package/dist/packages/toast/locales/nb/messages.mjs +1 -0
  203. package/dist/packages/toast/locales/sv/messages.mjs +1 -0
  204. package/dist/packages/toast/styles.js +2 -0
  205. package/dist/packages/toast/toast-container.d.ts +12 -78
  206. package/dist/packages/{switch/react.js → toast/toast-container.js} +21 -38
  207. package/dist/packages/toast/toast-container.js.map +7 -0
  208. package/dist/packages/toast/toast.d.ts +16 -29
  209. package/dist/packages/{pagination/index.js → toast/toast.js} +21 -49
  210. package/dist/packages/toast/toast.js.map +7 -0
  211. package/dist/packages/toast/toast.stories.js +50 -0
  212. package/dist/packages/toast/types.d.ts +15 -0
  213. package/dist/packages/toast/types.js +1 -0
  214. package/dist/packages/utils/expand-transition.d.ts +3 -3
  215. package/dist/packages/utils/expand-transition.js +59 -0
  216. package/dist/packages/utils/index.js +37 -0
  217. package/dist/packages/utils/unstyled-heading.d.ts +2 -3
  218. package/dist/packages/utils/unstyled-heading.js +22 -0
  219. package/dist/packages/utils/window-exists.js +1 -0
  220. package/dist/setup-tests.js +1 -0
  221. package/dist/web-types.json +225 -510
  222. package/package.json +39 -32
  223. package/dist/index.css +0 -2
  224. package/dist/index.css.map +0 -7
  225. package/dist/index.js +0 -3386
  226. package/dist/index.js.map +0 -7
  227. package/dist/packages/affix/react.js.map +0 -7
  228. package/dist/packages/alert/react.js.map +0 -7
  229. package/dist/packages/badge/react.js.map +0 -7
  230. package/dist/packages/breadcrumbs/react.js.map +0 -7
  231. package/dist/packages/button/react.js.map +0 -7
  232. package/dist/packages/card/react.js.map +0 -7
  233. package/dist/packages/datepicker/DatePicker.test.d.ts +0 -1
  234. package/dist/packages/datepicker/datepicker.d.ts +0 -107
  235. package/dist/packages/datepicker/datepicker.stories.d.ts +0 -11
  236. package/dist/packages/datepicker/datepicker.test.d.ts +0 -2
  237. package/dist/packages/datepicker/index.d.ts +0 -1
  238. package/dist/packages/datepicker/index.js +0 -2785
  239. package/dist/packages/datepicker/index.js.map +0 -7
  240. package/dist/packages/datepicker/locales/da/messages.d.mts +0 -1
  241. package/dist/packages/datepicker/locales/en/messages.d.mts +0 -1
  242. package/dist/packages/datepicker/locales/fi/messages.d.mts +0 -1
  243. package/dist/packages/datepicker/locales/nb/messages.d.mts +0 -1
  244. package/dist/packages/datepicker/locales/sv/messages.d.mts +0 -1
  245. package/dist/packages/datepicker/react.d.ts +0 -2
  246. package/dist/packages/datepicker/react.js +0 -2805
  247. package/dist/packages/datepicker/react.js.map +0 -7
  248. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +0 -1
  249. package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +0 -1
  250. package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +0 -1
  251. package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +0 -1
  252. package/dist/packages/datepicker/utils.d.ts +0 -13
  253. package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +0 -10
  254. package/dist/packages/dead-toggle/index.d.ts +0 -21
  255. package/dist/packages/dead-toggle/index.js.map +0 -7
  256. package/dist/packages/dead-toggle/react.d.ts +0 -2
  257. package/dist/packages/dead-toggle/react.js.map +0 -7
  258. package/dist/packages/expandable/react.js.map +0 -7
  259. package/dist/packages/link/index.js.map +0 -7
  260. package/dist/packages/link/link.stories.d.ts +0 -20
  261. package/dist/packages/link/link.test.d.ts +0 -1
  262. package/dist/packages/link/react.d.ts +0 -2
  263. package/dist/packages/link/react.js +0 -2666
  264. package/dist/packages/link/react.js.map +0 -7
  265. package/dist/packages/modal/react.js.map +0 -7
  266. package/dist/packages/pageindicator/index.d.ts +0 -14
  267. package/dist/packages/pageindicator/index.js +0 -32
  268. package/dist/packages/pageindicator/index.js.map +0 -7
  269. package/dist/packages/pageindicator/pageindicator.stories.d.ts +0 -32
  270. package/dist/packages/pageindicator/react.d.ts +0 -2
  271. package/dist/packages/pageindicator/react.js +0 -52
  272. package/dist/packages/pageindicator/react.js.map +0 -7
  273. package/dist/packages/pagination/index.d.ts +0 -37
  274. package/dist/packages/pagination/index.js.map +0 -7
  275. package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
  276. package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
  277. package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
  278. package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
  279. package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
  280. package/dist/packages/pagination/pagination.stories.d.ts +0 -14
  281. package/dist/packages/pagination/pagination.test.d.ts +0 -1
  282. package/dist/packages/pagination/react.d.ts +0 -2
  283. package/dist/packages/pagination/react.js +0 -2514
  284. package/dist/packages/pagination/react.js.map +0 -7
  285. package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +0 -64
  286. package/dist/packages/rip-and-tear-checkbox/index.css +0 -2
  287. package/dist/packages/rip-and-tear-checkbox/index.css.map +0 -7
  288. package/dist/packages/rip-and-tear-checkbox/index.d.ts +0 -6
  289. package/dist/packages/rip-and-tear-checkbox/index.js +0 -36
  290. package/dist/packages/rip-and-tear-checkbox/index.js.map +0 -7
  291. package/dist/packages/rip-and-tear-radio/base-element.d.ts +0 -46
  292. package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +0 -6
  293. package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +0 -103
  294. package/dist/packages/rip-and-tear-radio/index.css +0 -2
  295. package/dist/packages/rip-and-tear-radio/index.css.map +0 -7
  296. package/dist/packages/rip-and-tear-radio/index.d.ts +0 -8
  297. package/dist/packages/rip-and-tear-radio/index.js +0 -34
  298. package/dist/packages/rip-and-tear-radio/index.js.map +0 -7
  299. package/dist/packages/rip-and-tear-radio/invalid.d.ts +0 -8
  300. package/dist/packages/rip-and-tear-radio/math.d.ts +0 -1
  301. package/dist/packages/rip-and-tear-radio/radio-group.d.ts +0 -72
  302. package/dist/packages/rip-and-tear-radio/radio.d.ts +0 -38
  303. package/dist/packages/rip-and-tear-radio/required-validator.d.ts +0 -11
  304. package/dist/packages/rip-and-tear-radio/slot.d.ts +0 -20
  305. package/dist/packages/rip-and-tear-radio/watch.d.ts +0 -26
  306. package/dist/packages/select/react.js.map +0 -7
  307. package/dist/packages/steps/index.d.ts +0 -43
  308. package/dist/packages/steps/index.js.map +0 -7
  309. package/dist/packages/steps/locales/da/messages.d.mts +0 -1
  310. package/dist/packages/steps/locales/en/messages.d.mts +0 -1
  311. package/dist/packages/steps/locales/fi/messages.d.mts +0 -1
  312. package/dist/packages/steps/locales/nb/messages.d.mts +0 -1
  313. package/dist/packages/steps/locales/sv/messages.d.mts +0 -1
  314. package/dist/packages/steps/react.d.ts +0 -3
  315. package/dist/packages/steps/react.js +0 -2485
  316. package/dist/packages/steps/react.js.map +0 -7
  317. package/dist/packages/steps/steps.stories.d.ts +0 -12
  318. package/dist/packages/switch/index.d.ts +0 -20
  319. package/dist/packages/switch/index.js.map +0 -7
  320. package/dist/packages/switch/react.d.ts +0 -2
  321. package/dist/packages/switch/react.js.map +0 -7
  322. package/dist/packages/switch/styles.d.ts +0 -1
  323. package/dist/packages/switch/switch.stories.d.ts +0 -9
  324. package/dist/packages/textfield/react.js.map +0 -7
  325. package/dist/vscode.css-custom-data.json +0 -6
  326. package/dist/vscode.html-custom-data.json +0 -418
  327. /package/dist/packages/{dead-toggle/dead-toggle.test.d.ts → attention/attention.test.d.ts} +0 -0
  328. /package/dist/packages/{pageindicator/style.d.ts → attention/layout-styles.d.ts} +0 -0
  329. /package/dist/packages/{pagination → attention}/styles.d.ts +0 -0
  330. /package/dist/packages/{steps → toast}/styles.d.ts +0 -0
@@ -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}.flex{display:flex}.static{position:static}.s-text{color:var(--w-s-color-text)}.s-text-link{color:var(--w-s-color-text-link)}.s-icon{color:var(--w-s-color-icon)}.space-x-8>:not([hidden])~:not([hidden]){--w-space-x-reverse:0;margin-left:calc(.8rem*calc(1 - var(--w-space-x-reverse)));margin-right:calc(.8rem*var(--w-space-x-reverse))}.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}.select-none{-webkit-user-select:none;user-select:none}`;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { StoryObj } from '@storybook/react';
3
+ import { Button } from './react';
4
+ declare const _default: {
5
+ title: string;
6
+ render(args: Omit<React.HTMLAttributes<import(".").WarpButton>, "rel" | "_classes" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "variant" | "form" | "small" | "quiet" | "href" | "target" | "fullWidth" | "buttonClass" | "name" | "type" | "loading" | "value" | "ariaValueTextLoading" | "updated" | "firstUpdated" | "_primaryClasses" | "_secondaryClasses" | "_utilityClasses" | "_negativeClasses" | "_pillClasses" | "_linkClasses" | "_handleButtonClick" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "resetFormControl" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate"> & {} & Partial<Omit<import(".").WarpButton, keyof HTMLElement>> & React.RefAttributes<import(".").WarpButton>): React.JSX.Element;
7
+ component: import("@lit/react").ReactWebComponent<import(".").WarpButton, {}>;
8
+ };
9
+ export default _default;
10
+ export type Story = StoryObj<typeof Button>;
11
+ export declare const Primary: Story;
12
+ export declare const Secondary: Story;
13
+ export declare const Negative: Story;
14
+ export declare const Utility: Story;
15
+ export declare const Link: Story;
16
+ export declare const Pill: Story;
17
+ export declare const Small: Story;
18
+ export declare const Quiet: Story;
19
+ export declare const Loading: Story;
20
+ export declare const FullWidth: Story;
21
+ export declare const AsLink: Story;
22
+ export declare const FormControl: Story;
@@ -0,0 +1,102 @@
1
+ import React from 'react';
2
+ import { Button } from './react';
3
+ export default {
4
+ title: 'Buttons/Button',
5
+ render(args) {
6
+ return React.createElement(Button, { ...args }, "Button Text");
7
+ },
8
+ component: Button,
9
+ };
10
+ export const Primary = {
11
+ args: {
12
+ variant: 'primary',
13
+ type: 'button',
14
+ },
15
+ };
16
+ export const Secondary = {
17
+ args: {
18
+ variant: 'secondary',
19
+ type: 'button',
20
+ },
21
+ };
22
+ export const Negative = {
23
+ args: {
24
+ variant: 'negative',
25
+ type: 'button',
26
+ },
27
+ };
28
+ export const Utility = {
29
+ args: {
30
+ variant: 'utility',
31
+ type: 'button',
32
+ },
33
+ };
34
+ export const Link = {
35
+ args: {
36
+ variant: 'link',
37
+ type: 'button',
38
+ href: 'https://developer.mozilla.org/en-US/docs/Web/API/Web_components',
39
+ target: '_new',
40
+ },
41
+ };
42
+ export const Pill = {
43
+ args: {
44
+ variant: 'pill',
45
+ type: 'button',
46
+ },
47
+ render(args) {
48
+ return React.createElement(Button, { ...args }, "\uD83D\uDC99");
49
+ },
50
+ };
51
+ export const Small = {
52
+ args: {
53
+ variant: 'primary',
54
+ small: true,
55
+ type: 'button',
56
+ },
57
+ };
58
+ export const Quiet = {
59
+ args: {
60
+ variant: 'secondary',
61
+ quiet: true,
62
+ type: 'button',
63
+ },
64
+ };
65
+ export const Loading = {
66
+ args: {
67
+ variant: 'primary',
68
+ loading: true,
69
+ type: 'button',
70
+ },
71
+ };
72
+ export const FullWidth = {
73
+ args: {
74
+ variant: 'primary',
75
+ fullWidth: true,
76
+ type: 'button',
77
+ },
78
+ render(args) {
79
+ return (React.createElement("div", { className: "w-full flex flex-col gap-8" },
80
+ React.createElement(Button, { ...args }, "Full width")));
81
+ },
82
+ };
83
+ export const AsLink = {
84
+ args: {
85
+ variant: 'primary',
86
+ href: 'https://example.com',
87
+ target: '_blank',
88
+ type: 'button',
89
+ },
90
+ render(args) {
91
+ return React.createElement(Button, { ...args }, "Visit Example");
92
+ },
93
+ };
94
+ export const FormControl = {
95
+ args: {},
96
+ render() {
97
+ return (React.createElement("form", { name: "form-control" },
98
+ React.createElement("input", { type: "text", defaultValue: "I am an input field", name: "demoValue", style: { border: '1px solid lime' } }),
99
+ React.createElement(Button, { type: "reset", name: "resetButton", value: "fooyoo" }, "Reset"),
100
+ React.createElement(Button, { type: "submit", name: "submuitButtton", value: "fooyoo" }, "Send thing")));
101
+ },
102
+ };
@@ -4,6 +4,10 @@ import './index.js';
4
4
  declare const args: Partial<WarpButton> & {
5
5
  [key: string]: any;
6
6
  };
7
+ import "@warp-ds/icons/elements/close-16";
8
+ import "@warp-ds/icons/elements/heart-16";
9
+ import "@warp-ds/icons/elements/chevron-right-16";
10
+ import "@warp-ds/icons/elements/chevron-left-16";
7
11
  declare const meta: Meta<typeof args>;
8
12
  export default meta;
9
13
  type Story = StoryObj<typeof args>;
@@ -0,0 +1,151 @@
1
+ import { spread } from '@open-wc/lit-helpers';
2
+ import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
3
+ import { html } from 'lit';
4
+ import { prespread } from '../../.storybook/utilities.js';
5
+ import './index.js';
6
+ const { events, args, argTypes } = getStorybookHelpers('w-button');
7
+ import "@warp-ds/icons/elements/close-16";
8
+ import "@warp-ds/icons/elements/heart-16";
9
+ import "@warp-ds/icons/elements/chevron-right-16";
10
+ import "@warp-ds/icons/elements/chevron-left-16";
11
+ const meta = {
12
+ title: 'Buttons/Button',
13
+ render(args) {
14
+ return html `<w-button ${spread(prespread(args))}>Button Text</w-button>`;
15
+ },
16
+ args,
17
+ argTypes,
18
+ parameters: {
19
+ actions: {
20
+ handles: events,
21
+ },
22
+ },
23
+ };
24
+ export default meta;
25
+ export const Primary = {
26
+ args: {
27
+ variant: 'primary',
28
+ type: 'button',
29
+ },
30
+ };
31
+ export const Secondary = {
32
+ args: {
33
+ variant: 'secondary',
34
+ type: 'button',
35
+ },
36
+ };
37
+ export const Negative = {
38
+ args: {
39
+ variant: 'negative',
40
+ type: 'button',
41
+ },
42
+ };
43
+ export const Utility = {
44
+ args: {
45
+ variant: 'utility',
46
+ type: 'button',
47
+ },
48
+ };
49
+ export const Link = {
50
+ args: {
51
+ variant: 'link',
52
+ type: 'button',
53
+ href: 'https://developer.mozilla.org/en-US/docs/Web/API/Web_components',
54
+ target: '_new',
55
+ },
56
+ };
57
+ export const Pill = {
58
+ args: {
59
+ variant: 'pill',
60
+ type: 'button',
61
+ },
62
+ render(args) {
63
+ return html `<w-button ${spread(prespread(args))}>
64
+ <w-icon-chevron-left-16 style="height: 16px;"></w-icon-chevron-left-16>
65
+ </w-button>
66
+ <w-button ${spread(prespread(args))}>
67
+ <w-icon-close-16 style="height: 16px;"></w-icon-close-16>
68
+ </w-button>
69
+ <w-button ${spread(prespread(args))}>
70
+ <w-icon-heart-16 style="height: 16px;"></w-icon-heart-16>
71
+ </w-button>
72
+ <w-button ${spread(prespread(args))}>
73
+ <w-icon-chevron-right-16
74
+ style="height: 16px;"
75
+ ></w-icon-chevron-right-16>
76
+ </w-button>
77
+ <br />
78
+ <w-button ${spread(prespread(args))} small="">
79
+ <w-icon-chevron-left-16 style="height: 16px;"></w-icon-chevron-left-16>
80
+ </w-button>
81
+ <w-button ${spread(prespread(args))} small="">
82
+ <w-icon-close-16 style="height: 16px;"></w-icon-close-16>
83
+ </w-button>
84
+ <w-button ${spread(prespread(args))} small="">
85
+ <w-icon-heart-16 style="height: 16px;"></w-icon-heart-16>
86
+ </w-button>
87
+ <w-button ${spread(prespread(args))} small="">
88
+ <w-icon-chevron-right-16
89
+ style="height: 16px;"
90
+ ></w-icon-chevron-right-16>
91
+ </w-button>`;
92
+ },
93
+ };
94
+ export const Small = {
95
+ args: {
96
+ variant: 'primary',
97
+ small: true,
98
+ type: 'button',
99
+ },
100
+ };
101
+ export const Quiet = {
102
+ args: {
103
+ variant: 'secondary',
104
+ quiet: true,
105
+ type: 'button',
106
+ },
107
+ };
108
+ export const Loading = {
109
+ args: {
110
+ variant: 'primary',
111
+ loading: true,
112
+ type: 'button',
113
+ },
114
+ };
115
+ export const FullWidth = {
116
+ args: {
117
+ variant: 'primary',
118
+ 'full-width': true,
119
+ type: 'button',
120
+ },
121
+ render(args) {
122
+ return html `
123
+ <div class="w-full flex flex-col gap-8">
124
+ <w-button ${spread(prespread(args))}>Full width</w-button>
125
+ </div>
126
+ `;
127
+ },
128
+ };
129
+ export const AsLink = {
130
+ args: {
131
+ variant: 'primary',
132
+ href: 'https://example.com',
133
+ target: '_blank',
134
+ type: 'button',
135
+ },
136
+ render(args) {
137
+ return html `<w-button ${spread(prespread(args))}>Visit Example</w-button>`;
138
+ },
139
+ };
140
+ export const FormControl = {
141
+ args: {},
142
+ render() {
143
+ return html `
144
+ <form name="form-control">
145
+ <input type="text" value="I am an input field" name="demoValue" style="border: 1px solid lime" />
146
+ <w-button type="reset" name="resetButton" value="fooyoo">Reset</w-button>
147
+ <w-button type="submit" name="submuitButtton" value="fooyoo">Send thing</w-button>
148
+ </form>
149
+ `;
150
+ },
151
+ };
@@ -0,0 +1,25 @@
1
+ import { html } from 'lit';
2
+ import { expect, test, vi } from 'vitest';
3
+ import { render } from 'vitest-browser-lit';
4
+ import './index.js';
5
+ test('renders the slotted label', async () => {
6
+ const component = html `<w-button>This is a button</w-button>`;
7
+ const page = render(component);
8
+ await expect.element(page.getByText('This is a button')).toBeVisible();
9
+ await expect.element(page.getByRole('button')).toBeVisible();
10
+ });
11
+ test('by default button type is button', async () => {
12
+ const component = html `<w-button>This is a button</w-button>`;
13
+ const page = render(component);
14
+ await expect.element(page.getByRole('button')).toHaveAttribute('type', 'button');
15
+ });
16
+ test.todo('works in a form as type submit');
17
+ test.todo('works in a form as type reset');
18
+ test('calling focus on w-button focuses the button inside the shadow root', async () => {
19
+ const component = html `<w-button>This is a button</w-button>`;
20
+ const page = render(component);
21
+ await expect.element(page.getByRole('button')).toBeVisible();
22
+ // @ts-expect-error if we import and type using WarpButton, the test fails which is nonsense so I've opted to simply ignore this error.
23
+ page.container.querySelector('w-button').focus();
24
+ await vi.waitFor(() => page.container.querySelector(':focus').tagName === 'BUTTON');
25
+ });
@@ -2,67 +2,6 @@ import { LitElement, PropertyValues } from 'lit';
2
2
  import '../link';
3
3
  type ButtonVariant = 'primary' | 'secondary' | 'negative' | 'utility' | 'pill' | 'link';
4
4
  type ButtonType = 'button' | 'submit' | 'reset';
5
- export declare const ccButton: {
6
- secondary: string;
7
- secondaryHref: string;
8
- secondaryDisabled: string;
9
- secondarySmall: string;
10
- secondarySmallDisabled: string;
11
- secondaryQuiet: string;
12
- secondaryQuietDisabled: string;
13
- secondarySmallQuiet: string;
14
- secondarySmallQuietDisabled: string;
15
- secondaryLoading: string;
16
- secondarySmallLoading: string;
17
- secondarySmallQuietLoading: string;
18
- secondaryQuietLoading: string;
19
- primary: string;
20
- primaryDisabled: string;
21
- primarySmall: string;
22
- primarySmallDisabled: string;
23
- primaryQuiet: string;
24
- primaryQuietDisabled: string;
25
- primarySmallQuiet: string;
26
- primarySmallQuietDisabled: string;
27
- primaryLoading: string;
28
- primarySmallLoading: string;
29
- primarySmallQuietLoading: string;
30
- primaryQuietLoading: string;
31
- utility: string;
32
- utilityDisabled: string;
33
- utilityQuiet: string;
34
- utilityQuietDisabled: string;
35
- utilitySmall: string;
36
- utilitySmallDisabled: string;
37
- utilitySmallQuiet: string;
38
- utilitySmallQuietDisabled: string;
39
- utilityLoading: string;
40
- utilitySmallLoading: string;
41
- utilityQuietLoading: string;
42
- utilitySmallQuietLoading: string;
43
- negative: string;
44
- negativeDisabled: string;
45
- negativeQuiet: string;
46
- negativeQuietDisabled: string;
47
- negativeSmall: string;
48
- negativeSmallDisabled: string;
49
- negativeSmallQuiet: string;
50
- negativeSmallQuietDisabled: string;
51
- negativeLoading: string;
52
- negativeSmallLoading: string;
53
- negativeQuietLoading: string;
54
- negativeSmallQuietLoading: string;
55
- pill: string;
56
- pillSmall: string;
57
- pillLoading: string;
58
- pillSmallLoading: string;
59
- link: string;
60
- linkSmall: string;
61
- linkAsButton: string;
62
- a11y: string;
63
- fullWidth: string;
64
- contentWidth: string;
65
- };
66
5
  declare const WarpButton_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
67
6
  /**
68
7
  * Buttons are used to perform actions, widh different visuals for different needs.
@@ -118,8 +57,3 @@ declare class WarpButton extends WarpButton_base {
118
57
  render(): import("lit").TemplateResult<1>;
119
58
  }
120
59
  export { WarpButton };
121
- declare global {
122
- interface HTMLElementTagNameMap {
123
- 'w-button': WarpButton;
124
- }
125
- }
@@ -1,5 +1,5 @@
1
- var Ae=Object.create;var ne=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ue=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ie=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ne(e))!Ye.call(t,a)&&a!==r&&ne(t,a,{get:()=>e[a],enumerable:!(o=he(e,a))||o.enumerable});return t};var Re=(t,e,r)=>(r=t!=null?Ae(Ue(t)):{},Ie(e||!t||!t.__esModule?ne(r,"default",{value:t,enumerable:!0}):r,t));var m=(t,e,r,o)=>{for(var a=o>1?void 0:o?he(e,r):e,b=t.length-1,c;b>=0;b--)(c=t[b])&&(a=(o?c(e,r,a):c(a))||a);return o&&a&&ne(e,r,a),a};var ve=pe(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.errorMessages=A.ErrorType=void 0;var I;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(I=A.ErrorType||(A.ErrorType={}));A.errorMessages=new Map([[I.MalformedUnicode,"malformed Unicode character escape sequence"],[I.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[I.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[I.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[I.EndOfString,"malformed escape sequence at end of string"]])});var we=pe(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.unraw=q.errorMessages=q.ErrorType=void 0;var C=ve();Object.defineProperty(q,"ErrorType",{enumerable:!0,get:function(){return C.ErrorType}});Object.defineProperty(q,"errorMessages",{enumerable:!0,get:function(){return C.errorMessages}});function He(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function J(t,e,r){let o=He(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(C.errorMessages.get(e));return o}function Xe(t){let e=J(t,C.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function me(t,e){let r=J(t,C.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=J(e,C.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function Ze(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function Be(t){if(!Ze(t))throw new SyntaxError(C.errorMessages.get(C.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=J(e,C.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(C.errorMessages.get(C.ErrorType.CodePointLimit)):o}}function Ge(t,e=!1){if(e)throw new SyntaxError(C.errorMessages.get(C.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var Je=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Ke(t){return Je.get(t)||t}var We=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function fe(t,e=!1){return t.replace(We,function(r,o,a,b,c,l,v,k,E){if(o!==void 0)return"\\";if(a!==void 0)return Xe(a);if(b!==void 0)return Be(b);if(c!==void 0)return me(c,l);if(v!==void 0)return me(v);if(k==="0")return"\0";if(k!==void 0)return Ge(k,!e);if(E!==void 0)return Ke(E);throw new SyntaxError(C.errorMessages.get(C.ErrorType.EndOfString))})}q.unraw=fe;q.default=fe});import{html as te,LitElement as xr}from"lit";var se=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?se.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var ke=Re(we(),1);var O=t=>typeof t=="string",er=t=>typeof t=="function",xe=new Map,$e="en";function ue(t){return[...Array.isArray(t)?t:[t],$e]}function be(t,e,r){let o=ue(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return K(()=>W("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(O(e)?new Date(e):e)}function rr(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return be(t,e,o)}function le(t,e,r){let o=ue(t);return K(()=>W("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function ye(t,e,r,{offset:o=0,...a}){var l,v;let b=ue(t),c=e?K(()=>W("plural-ordinal",b),()=>new Intl.PluralRules(b,{type:"ordinal"})):K(()=>W("plural-cardinal",b),()=>new Intl.PluralRules(b,{type:"cardinal"}));return(v=(l=a[r])!=null?l:a[c.select(r-o)])!=null?v:a.other}function K(t,e){let r=t(),o=xe.get(r);return o||(o=e(),xe.set(r,o)),o}function W(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var _e=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ce="%__lingui_octothorpe__%",tr=(t,e,r={})=>{let o=e||t,a=c=>typeof c=="object"?c:r[c],b=(c,l)=>{let v=Object.keys(r).length?a("number"):void 0,k=le(o,c,v);return l.replace(new RegExp(Ce,"g"),k)};return{plural:(c,l)=>{let{offset:v=0}=l,k=ye(o,!1,c,l);return b(c-v,k)},selectordinal:(c,l)=>{let{offset:v=0}=l,k=ye(o,!0,c,l);return b(c-v,k)},select:or,number:(c,l)=>le(o,c,a(l)||{style:l}),date:(c,l)=>be(o,c,a(l)||l),time:(c,l)=>rr(o,c,a(l)||l)}},or=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function ar(t,e,r){return(o={},a)=>{let b=tr(e,r,a),c=(v,k=!1)=>Array.isArray(v)?v.reduce((E,D)=>{if(D==="#"&&k)return E+Ce;if(O(D))return E+D;let[U,M,P]=D,T={};M==="plural"||M==="selectordinal"||M==="select"?Object.entries(P).forEach(([j,R])=>{T[j]=c(R,M==="plural"||M==="selectordinal")}):T=P;let z;if(M){let j=b[M];z=j(o[U],T)}else z=o[U];return z==null?E:E+z},""):v,l=c(t);return O(l)&&_e.test(l)?(0,ke.unraw)(l):O(l)?l:l?String(l):""}}var ir=Object.defineProperty,nr=(t,e,r)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sr=(t,e,r)=>(nr(t,typeof e!="symbol"?e+"":e,r),r),de=class{constructor(){sr(this,"_events",{})}on(e,r){var a;var o;return(a=(o=this._events)[e])!=null||(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},lr=Object.defineProperty,dr=(t,e,r)=>e in t?lr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N=(t,e,r)=>(dr(t,typeof e!="symbol"?e+"":e,r),r),ce=class extends de{constructor(e){var r;super(),N(this,"_locale",""),N(this,"_locales"),N(this,"_localeData",{}),N(this,"_messages",{}),N(this,"_missing"),N(this,"_messageCompiler"),N(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:$e,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o==null?void 0:o.message;e||(e=""),O(e)||(r=e.values||r,a=e.message,e=e.id);let b=this.messages[e],c=b===void 0,l=this._missing;if(l&&c)return er(l)?l(this._locale,e):l;c&&this.emit("missing",{id:e,locale:this._locale});let v=b||a||e;return O(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
1
+ var Ue=Object.create;var ne=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var pe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Xe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ye(e))!Re.call(t,a)&&a!==r&&ne(t,a,{get:()=>e[a],enumerable:!(o=he(e,a))||o.enumerable});return t};var He=(t,e,r)=>(r=t!=null?Ue(Ie(t)):{},Xe(e||!t||!t.__esModule?ne(r,"default",{value:t,enumerable:!0}):r,t));var m=(t,e,r,o)=>{for(var a=o>1?void 0:o?he(e,r):e,b=t.length-1,c;b>=0;b--)(c=t[b])&&(a=(o?c(e,r,a):c(a))||a);return o&&a&&ne(e,r,a),a};var ve=pe(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.errorMessages=A.ErrorType=void 0;var I;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(I=A.ErrorType||(A.ErrorType={}));A.errorMessages=new Map([[I.MalformedUnicode,"malformed Unicode character escape sequence"],[I.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[I.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[I.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[I.EndOfString,"malformed escape sequence at end of string"]])});var we=pe(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.unraw=F.errorMessages=F.ErrorType=void 0;var C=ve();Object.defineProperty(F,"ErrorType",{enumerable:!0,get:function(){return C.ErrorType}});Object.defineProperty(F,"errorMessages",{enumerable:!0,get:function(){return C.errorMessages}});function Ze(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function J(t,e,r){let o=Ze(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(C.errorMessages.get(e));return o}function Be(t){let e=J(t,C.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function me(t,e){let r=J(t,C.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=J(e,C.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function Ge(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function Je(t){if(!Ge(t))throw new SyntaxError(C.errorMessages.get(C.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=J(e,C.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(C.errorMessages.get(C.ErrorType.CodePointLimit)):o}}function Ke(t,e=!1){if(e)throw new SyntaxError(C.errorMessages.get(C.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var We=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function er(t){return We.get(t)||t}var rr=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function fe(t,e=!1){return t.replace(rr,function(r,o,a,b,c,l,v,k,E){if(o!==void 0)return"\\";if(a!==void 0)return Be(a);if(b!==void 0)return Je(b);if(c!==void 0)return me(c,l);if(v!==void 0)return me(v);if(k==="0")return"\0";if(k!==void 0)return Ke(k,!e);if(E!==void 0)return er(E);throw new SyntaxError(C.errorMessages.get(C.ErrorType.EndOfString))})}F.unraw=fe;F.default=fe});var se=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?se.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var ke=He(we(),1);var T=t=>typeof t=="string",tr=t=>typeof t=="function",xe=new Map,$e="en";function ue(t){return[...Array.isArray(t)?t:[t],$e]}function be(t,e,r){let o=ue(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return K(()=>W("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(T(e)?new Date(e):e)}function or(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return be(t,e,o)}function le(t,e,r){let o=ue(t);return K(()=>W("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function ye(t,e,r,{offset:o=0,...a}){var l,v;let b=ue(t),c=e?K(()=>W("plural-ordinal",b),()=>new Intl.PluralRules(b,{type:"ordinal"})):K(()=>W("plural-cardinal",b),()=>new Intl.PluralRules(b,{type:"cardinal"}));return(v=(l=a[r])!=null?l:a[c.select(r-o)])!=null?v:a.other}function K(t,e){let r=t(),o=xe.get(r);return o||(o=e(),xe.set(r,o)),o}function W(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var _e=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ce="%__lingui_octothorpe__%",ar=(t,e,r={})=>{let o=e||t,a=c=>typeof c=="object"?c:r[c],b=(c,l)=>{let v=Object.keys(r).length?a("number"):void 0,k=le(o,c,v);return l.replace(new RegExp(Ce,"g"),k)};return{plural:(c,l)=>{let{offset:v=0}=l,k=ye(o,!1,c,l);return b(c-v,k)},selectordinal:(c,l)=>{let{offset:v=0}=l,k=ye(o,!0,c,l);return b(c-v,k)},select:ir,number:(c,l)=>le(o,c,a(l)||{style:l}),date:(c,l)=>be(o,c,a(l)||l),time:(c,l)=>or(o,c,a(l)||l)}},ir=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function nr(t,e,r){return(o={},a)=>{let b=ar(e,r,a),c=(v,k=!1)=>Array.isArray(v)?v.reduce((E,D)=>{if(D==="#"&&k)return E+Ce;if(T(D))return E+D;let[U,M,P]=D,O={};M==="plural"||M==="selectordinal"||M==="select"?Object.entries(P).forEach(([j,R])=>{O[j]=c(R,M==="plural"||M==="selectordinal")}):O=P;let z;if(M){let j=b[M];z=j(o[U],O)}else z=o[U];return z==null?E:E+z},""):v,l=c(t);return T(l)&&_e.test(l)?(0,ke.unraw)(l):T(l)?l:l?String(l):""}}var sr=Object.defineProperty,lr=(t,e,r)=>e in t?sr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dr=(t,e,r)=>(lr(t,typeof e!="symbol"?e+"":e,r),r),de=class{constructor(){dr(this,"_events",{})}on(e,r){var a;var o;return(a=(o=this._events)[e])!=null||(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},cr=Object.defineProperty,ur=(t,e,r)=>e in t?cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N=(t,e,r)=>(ur(t,typeof e!="symbol"?e+"":e,r),r),ce=class extends de{constructor(e){var r;super(),N(this,"_locale",""),N(this,"_locales"),N(this,"_localeData",{}),N(this,"_messages",{}),N(this,"_missing"),N(this,"_messageCompiler"),N(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:$e,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o==null?void 0:o.message;e||(e=""),T(e)||(r=e.values||r,a=e.message,e=e.id);let b=this.messages[e],c=b===void 0,l=this._missing;if(l&&c)return tr(l)?l(this._locale,e):l;c&&this.emit("missing",{id:e,locale:this._locale});let v=b||a||e;return T(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
3
3
 
4
4
  > ${v}
5
5
 
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
7
7
  ICU features such as interpolation and plurals will not work properly for that message.
8
8
 
9
9
  Please compile your catalog first.
10
- `)),O(v)&&_e.test(v)?JSON.parse(`"${v}"`):O(v)?v:ar(v,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return be(this._locales||this._locale,e,r)}number(e,r){return le(this._locales||this._locale,e,r)}};function cr(t={}){return new ce(t)}var G=cr();var p=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},x=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function ee(t){var e,r,o,a,b,c,l,v,k,E,D,U,M,P,T,z,j,R,oe;class je extends t{constructor(...u){var h,w,$;super(...u),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),b.set(this,void 0),c.set(this,void 0),l.set(this,!0),k.set(this,""),E.set(this,()=>{x(this,a,!0,"f"),x(this,r,!0,"f"),p(this,e,"m",z).call(this)}),D.set(this,()=>{x(this,r,!1,"f"),p(this,e,"m",j).call(this,this.shouldFormValueUpdate()?p(this,k,"f"):""),!this.validity.valid&&p(this,a,"f")&&x(this,o,!0,"f");let F=p(this,e,"m",z).call(this);this.validationMessageCallback&&this.validationMessageCallback(F?this.internals.validationMessage:"")}),U.set(this,()=>{var F;p(this,l,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),x(this,l,!1,"f")),x(this,a,!0,"f"),x(this,o,!0,"f"),p(this,e,"m",z).call(this),(F=this===null||this===void 0?void 0:this.validationMessageCallback)===null||F===void 0||F.call(this,this.showError?this.internals.validationMessage:"")}),M.set(this,void 0),P.set(this,!1),T.set(this,Promise.resolve()),(h=this.addEventListener)===null||h===void 0||h.call(this,"focus",p(this,E,"f")),(w=this.addEventListener)===null||w===void 0||w.call(this,"blur",p(this,D,"f")),($=this.addEventListener)===null||$===void 0||$.call(this,"invalid",p(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let u=this.validators.map($=>$.attribute).flat(),h=super.observedAttributes||[];return[...new Set([...h,...u])]}static getValidator(u){return this.validators.find(h=>h.attribute===u)||null}static getValidators(u){return this.validators.filter(h=>{var w;if(h.attribute===u||!((w=h.attribute)===null||w===void 0)&&w.includes(u))return!0})}get form(){return this.internals.form}get showError(){return p(this,e,"m",z).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(u,h,w){var $;($=super.attributeChangedCallback)===null||$===void 0||$.call(this,u,h,w);let X=this.constructor.getValidators(u);X!=null&&X.length&&this.validationTarget&&this.setValue(p(this,k,"f"))}setValue(u){var h;x(this,o,!1,"f"),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,""),x(this,k,u,"f");let $=this.shouldFormValueUpdate()?u:null;this.internals.setFormValue($),p(this,e,"m",j).call(this,$),this.valueChangedCallback&&this.valueChangedCallback($),p(this,e,"m",z).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(u=>u(p(this,T,"f")))}formResetCallback(){var u,h;x(this,a,!1,"f"),x(this,o,!1,"f"),p(this,e,"m",z).call(this),(u=this.resetFormControl)===null||u===void 0||u.call(this),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,p(this,e,"m",z).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,b=new WeakMap,c=new WeakMap,l=new WeakMap,k=new WeakMap,E=new WeakMap,D=new WeakMap,U=new WeakMap,M=new WeakMap,P=new WeakMap,T=new WeakMap,e=new WeakSet,v=function(){let u=this.getRootNode(),h=`${this.localName}[name="${this.getAttribute("name")}"]`;return u.querySelectorAll(h)},z=function(){if(this.hasAttribute("disabled"))return!1;let u=p(this,o,"f")||p(this,a,"f")&&!this.validity.valid&&!p(this,r,"f");return u&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),u},j=function(u){let h=this.constructor,w={},$=h.validators,F=[],X=$.some(L=>L.isValid instanceof Promise);p(this,P,"f")||(x(this,T,new Promise(L=>{x(this,M,L,"f")}),"f"),x(this,P,!0,"f")),p(this,b,"f")&&(p(this,b,"f").abort(),x(this,c,p(this,b,"f"),"f"));let Z=new AbortController;x(this,b,Z,"f");let B,ge=!1;$.length&&($.forEach(L=>{let ae=L.key||"customError",Y=L.isValid(this,u,Z.signal);Y instanceof Promise?(F.push(Y),Y.then(ie=>{ie!=null&&(w[ae]=!ie,B=p(this,e,"m",oe).call(this,L,u),p(this,e,"m",R).call(this,w,B))})):(w[ae]=!Y,this.validity[ae]!==!Y&&(ge=!0),!Y&&!B&&(B=p(this,e,"m",oe).call(this,L,u)))}),Promise.allSettled(F).then(()=>{var L;Z!=null&&Z.signal.aborted||(x(this,P,!1,"f"),(L=p(this,M,"f"))===null||L===void 0||L.call(this))}),(ge||!X)&&p(this,e,"m",R).call(this,w,B))},R=function(u,h){if(this.validationTarget)this.internals.setValidity(u,h,this.validationTarget),x(this,l,!1,"f");else{if(this.internals.setValidity(u,h),this.internals.validity.valid)return;x(this,l,!0,"f")}},oe=function(u,h){if(this.validityCallback){let w=this.validityCallback(u.key||"customError");if(w)return w}return u.message instanceof Function?u.message(this,h):u.message},je}import yr from"@warp-ds/elements-core";import{property as S}from"lit/decorators.js";var ur=["en","nb","fi","da","sv"],Se="en",ze=t=>ur.find(e=>t===e||t.toLowerCase().includes(e))||Se;function br(){if(typeof window=="undefined"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return ze(t)}try{let t=document.documentElement.lang;return ze(t)}catch(t){return console.warn("could not detect locale, falling back to source locale",t),Se}}var gr=(t,e,r,o,a,b)=>t==="nb"?r:t==="fi"?o:t==="da"?a:t==="sv"?b:e,Me=(t,e,r,o,a)=>{let b=br(),c=gr(b,t,e,r,o,a);G.load(b,c),G.activate(b)};import{html as pr,LitElement as vr}from"lit";import mr from"@warp-ds/elements-core";import{property as Q}from"lit/decorators.js";import{classMap as fr}from"lit/directives/class-map.js";import{css as Le}from"lit";var re=Le`
10
+ `)),T(v)&&_e.test(v)?JSON.parse(`"${v}"`):T(v)?v:nr(v,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return be(this._locales||this._locale,e,r)}number(e,r){return le(this._locales||this._locale,e,r)}};function br(t={}){return new ce(t)}var G=br();var p=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},x=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function ee(t){var e,r,o,a,b,c,l,v,k,E,D,U,M,P,O,z,j,R,oe;class Ne extends t{constructor(...u){var h,w,$;super(...u),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),b.set(this,void 0),c.set(this,void 0),l.set(this,!0),k.set(this,""),E.set(this,()=>{x(this,a,!0,"f"),x(this,r,!0,"f"),p(this,e,"m",z).call(this)}),D.set(this,()=>{x(this,r,!1,"f"),p(this,e,"m",j).call(this,this.shouldFormValueUpdate()?p(this,k,"f"):""),!this.validity.valid&&p(this,a,"f")&&x(this,o,!0,"f");let q=p(this,e,"m",z).call(this);this.validationMessageCallback&&this.validationMessageCallback(q?this.internals.validationMessage:"")}),U.set(this,()=>{var q;p(this,l,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),x(this,l,!1,"f")),x(this,a,!0,"f"),x(this,o,!0,"f"),p(this,e,"m",z).call(this),(q=this===null||this===void 0?void 0:this.validationMessageCallback)===null||q===void 0||q.call(this,this.showError?this.internals.validationMessage:"")}),M.set(this,void 0),P.set(this,!1),O.set(this,Promise.resolve()),(h=this.addEventListener)===null||h===void 0||h.call(this,"focus",p(this,E,"f")),(w=this.addEventListener)===null||w===void 0||w.call(this,"blur",p(this,D,"f")),($=this.addEventListener)===null||$===void 0||$.call(this,"invalid",p(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let u=this.validators.map($=>$.attribute).flat(),h=super.observedAttributes||[];return[...new Set([...h,...u])]}static getValidator(u){return this.validators.find(h=>h.attribute===u)||null}static getValidators(u){return this.validators.filter(h=>{var w;if(h.attribute===u||!((w=h.attribute)===null||w===void 0)&&w.includes(u))return!0})}get form(){return this.internals.form}get showError(){return p(this,e,"m",z).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(u,h,w){var $;($=super.attributeChangedCallback)===null||$===void 0||$.call(this,u,h,w);let H=this.constructor.getValidators(u);H!=null&&H.length&&this.validationTarget&&this.setValue(p(this,k,"f"))}setValue(u){var h;x(this,o,!1,"f"),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,""),x(this,k,u,"f");let $=this.shouldFormValueUpdate()?u:null;this.internals.setFormValue($),p(this,e,"m",j).call(this,$),this.valueChangedCallback&&this.valueChangedCallback($),p(this,e,"m",z).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(u=>u(p(this,O,"f")))}formResetCallback(){var u,h;x(this,a,!1,"f"),x(this,o,!1,"f"),p(this,e,"m",z).call(this),(u=this.resetFormControl)===null||u===void 0||u.call(this),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,p(this,e,"m",z).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,b=new WeakMap,c=new WeakMap,l=new WeakMap,k=new WeakMap,E=new WeakMap,D=new WeakMap,U=new WeakMap,M=new WeakMap,P=new WeakMap,O=new WeakMap,e=new WeakSet,v=function(){let u=this.getRootNode(),h=`${this.localName}[name="${this.getAttribute("name")}"]`;return u.querySelectorAll(h)},z=function(){if(this.hasAttribute("disabled"))return!1;let u=p(this,o,"f")||p(this,a,"f")&&!this.validity.valid&&!p(this,r,"f");return u&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),u},j=function(u){let h=this.constructor,w={},$=h.validators,q=[],H=$.some(L=>L.isValid instanceof Promise);p(this,P,"f")||(x(this,O,new Promise(L=>{x(this,M,L,"f")}),"f"),x(this,P,!0,"f")),p(this,b,"f")&&(p(this,b,"f").abort(),x(this,c,p(this,b,"f"),"f"));let Z=new AbortController;x(this,b,Z,"f");let B,ge=!1;$.length&&($.forEach(L=>{let ae=L.key||"customError",Y=L.isValid(this,u,Z.signal);Y instanceof Promise?(q.push(Y),Y.then(ie=>{ie!=null&&(w[ae]=!ie,B=p(this,e,"m",oe).call(this,L,u),p(this,e,"m",R).call(this,w,B))})):(w[ae]=!Y,this.validity[ae]!==!Y&&(ge=!0),!Y&&!B&&(B=p(this,e,"m",oe).call(this,L,u)))}),Promise.allSettled(q).then(()=>{var L;Z!=null&&Z.signal.aborted||(x(this,P,!1,"f"),(L=p(this,M,"f"))===null||L===void 0||L.call(this))}),(ge||!H)&&p(this,e,"m",R).call(this,w,B))},R=function(u,h){if(this.validationTarget)this.internals.setValidity(u,h,this.validationTarget),x(this,l,!1,"f");else{if(this.internals.setValidity(u,h),this.internals.validity.valid)return;x(this,l,!0,"f")}},oe=function(u,h){if(this.validityCallback){let w=this.validityCallback(u.key||"customError");if(w)return w}return u.message instanceof Function?u.message(this,h):u.message},Ne}import{html as te,LitElement as je,css as xr}from"lit";import{property as S}from"lit/decorators.js";var gr=["en","nb","fi","da","sv"],Se="en",ze=t=>gr.find(e=>t===e||t.toLowerCase().includes(e))||Se;function hr(){if(typeof window=="undefined"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return ze(t)}try{let t=document.documentElement.lang;return ze(t)}catch(t){return console.warn("could not detect locale, falling back to source locale",t),Se}}var pr=(t,e,r,o,a,b)=>t==="nb"?r:t==="fi"?o:t==="da"?a:t==="sv"?b:e,Me=(t,e,r,o,a)=>{let b=hr(),c=pr(b,t,e,r,o,a);G.load(b,c),G.activate(b)};import{html as mr,LitElement as Qe}from"lit";import{property as Q}from"lit/decorators.js";import{classMap as fr}from"lit/directives/class-map.js";import{css as Le}from"lit";var re=Le`
11
11
  *,
12
12
  :before,
13
13
  :after {
@@ -2446,7 +2446,7 @@ Please compile your catalog first.
2446
2446
  display: none
2447
2447
  }
2448
2448
  }
2449
- `;import{css as hr}from"lit";var Ee=hr`.w-button,
2449
+ `;import{css as vr}from"lit";var Ee=vr`.w-button,
2450
2450
  .w-button--secondary {
2451
2451
  /* Local scoped variables, given the default button (the secondary variant) as a default */
2452
2452
  --_background: var(--background, var(--w-s-color-background));
@@ -2644,22 +2644,28 @@ Please compile your catalog first.
2644
2644
  100% {
2645
2645
  background-position: 60px 0;
2646
2646
  }
2647
- }`;var Qe=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","pill","link"],_=class extends ee(vr){constructor(){super(),this.variant="secondary"}connectedCallback(){if(super.connectedCallback(),!Qe.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2648
- ${Qe.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){let e={"w-button":this.variant!=="link","w-button--primary":this.variant==="primary","w-button--secondary":this.variant==="secondary","w-button--negative":this.variant==="negative","w-button--utility":this.variant==="utility","w-button--quiet":this.variant==="quiet","w-button--negative-quiet":this.variant==="negativeQuiet","w-button--utility-quiet":this.variant==="utilityQuiet","w-button--small":this.small,"w-button--full-width":this.fullWidth,"w-button--disabled":this.disabled};return pr`<a
2647
+ }`;var qe=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","pill","link"],_=class extends ee(Qe){constructor(){super(),this.variant="secondary"}connectedCallback(){if(super.connectedCallback(),!qe.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2648
+ ${qe.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){let e={"w-button":this.variant!=="link","w-button--primary":this.variant==="primary","w-button--secondary":this.variant==="secondary","w-button--negative":this.variant==="negative","w-button--utility":this.variant==="utility","w-button--quiet":this.variant==="quiet","w-button--negative-quiet":this.variant==="negativeQuiet","w-button--utility-quiet":this.variant==="utilityQuiet","w-button--small":this.small,"w-button--full-width":this.fullWidth,"w-button--disabled":this.disabled};return mr`<a
2649
2649
  href=${this.href}
2650
2650
  target=${this.target}
2651
2651
  rel=${this.target==="_blank"?this.rel||"noopener":void 0}
2652
2652
  class=${fr(e)}>
2653
2653
  <slot></slot>
2654
- </a>`}};_.shadowRootOptions={...mr.shadowRootOptions,delegatesFocus:!0},_.styles=[re,Ee],m([Q({type:Boolean,reflect:!0})],_.prototype,"autofocus",2),m([Q({reflect:!0})],_.prototype,"variant",2),m([Q({type:Boolean,reflect:!0})],_.prototype,"quiet",2),m([Q({type:Boolean,reflect:!0})],_.prototype,"small",2),m([Q({reflect:!0})],_.prototype,"href",2),m([Q({type:Boolean,reflect:!0})],_.prototype,"disabled",2),m([Q({reflect:!0})],_.prototype,"target",2),m([Q({reflect:!0})],_.prototype,"rel",2),m([Q({attribute:"full-width",type:Boolean,reflect:!0})],_.prototype,"fullWidth",2),m([Q({attribute:"button-class",reflect:!0})],_.prototype,"buttonClass",2),m([Q({reflect:!0})],_.prototype,"name",2);customElements.get("w-link")||customElements.define("w-link",_);var Fe=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var qe=JSON.parse('{"button.aria.loading":["Loading..."]}');var De=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Pe=JSON.parse('{"button.aria.loading":["Laster..."]}');var Te=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as wr}from"lit";var Oe=wr`*,: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}.text-center{text-align:center}.animate-inprogress{background-size:30px 30px;animation:3s linear infinite animate-inprogress;background-image:linear-gradient(135deg,#0000000d 25%,#0000 0 50%,#0000000d 0 75%,#0000 0,#0000)!important}@keyframes animate-inprogress{0%{background-position:0 0}to{background-position:60px 0}}.hover\\:bg-clip-padding:hover{-webkit-background-clip:padding-box;background-clip:padding-box}.bg-transparent{background-color:#0000}.bg-\\[--w-color-button-primary-background\\]{background-color:var(--w-color-button-primary-background)}.hover\\:bg-\\[--w-color-button-pill-background-hover\\]:hover{background-color:var(--w-color-button-pill-background-hover)}.hover\\:bg-\\[--w-color-button-primary-background-hover\\]:hover{background-color:var(--w-color-button-primary-background-hover)}.active\\:bg-\\[--w-color-button-pill-background-active\\]:active{background-color:var(--w-color-button-pill-background-active)}.active\\:bg-\\[--w-color-button-primary-background-active\\]:active{background-color:var(--w-color-button-primary-background-active)}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-transparent{border-color:#0000}.rounded-4{border-radius:4px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.inline-block{display:inline-block}.inline{display:inline}.inline-flex{display:inline-flex}.hover\\:underline:hover,.focus\\:underline:focus,.active\\:underline:active{text-decoration-line:underline}.hover\\:no-underline:hover,.focus\\:no-underline:focus,.active\\:no-underline:active{text-decoration:none}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-center{align-items:center}.justify-center{justify-content:center}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled{background-color:var(--w-s-color-background-disabled)}.s-bg-negative{background-color:var(--w-s-color-background-negative)}.s-bg-subtle{background-color:var(--w-s-color-background-subtle)}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-negative-hover:hover{background-color:var(--w-s-color-background-negative-hover)}.hover\\:s-bg-negative-subtle-hover:hover{background-color:var(--w-s-color-background-negative-subtle-hover)}.active\\:s-bg-active:active{background-color:var(--w-s-color-background-active)}.active\\:s-bg-negative-active:active{background-color:var(--w-s-color-background-negative-active)}.active\\:s-bg-negative-subtle-active:active{background-color:var(--w-s-color-background-negative-subtle-active)}.s-text{color:var(--w-s-color-text)}.s-text-inverted{color:var(--w-s-color-text-inverted)}.s-text-link{color:var(--w-s-color-text-link)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-icon{color:var(--w-s-color-icon)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border{border-color:var(--w-s-color-border)}.hover\\:s-border-hover:hover{border-color:var(--w-s-color-border-hover)}.active\\:s-border-active:active{border-color:var(--w-s-color-border-active)}.max-w-full{max-width:100%}.max-w-max{max-width:max-content}.min-h-32{min-height:3.2rem}.min-w-32{min-width:3.2rem}.w-full{width:100%}.min-h-\\[44px\\]{min-height:44px}.min-w-\\[44px\\]{min-width:44px}.p-0{padding:0}.p-4{padding:.4rem}.px-14{padding-left:1.4rem;padding-right:1.4rem}.px-16{padding-left:1.6rem;padding-right:1.6rem}.py-10{padding-top:1rem;padding-bottom:1rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.py-6{padding-top:.6rem;padding-bottom:.6rem}.py-8{padding-top:.8rem;padding-bottom:.8rem}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.py-\\[11px\\]{padding-top:11px;padding-bottom:11px}.py-\\[7px\\]{padding-top:7px;padding-bottom:7px}.cursor-default{cursor:default}.font-bold{font-weight:700}.pointer-events-none{pointer-events:none}.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}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-\\[24\\]{line-height:2.4rem}`;var Ve=["primary","secondary","negative","utility","pill","link"],V="font-bold focusable justify-center transition-colors ease-in-out",f={primary:"s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",secondary:"s-text-link s-border s-bg hover:s-bg-hover hover:s-border-hover active:s-bg-active",utility:"s-text s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",destructive:"s-bg-negative s-text-inverted hover:s-bg-negative-hover active:s-bg-negative-active",pill:"s-icon hover:s-icon-hover active:s-icon-active bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",disabled:"s-text-inverted s-bg-disabled",quiet:"bg-transparent s-text-link hover:s-bg-hover active:s-bg-active",utilityQuiet:"s-text bg-transparent hover:s-bg-hover active:s-bg-active",negativeQuiet:"bg-transparent s-text-negative hover:s-bg-negative-subtle-hover active:s-bg-negative-subtle-active",loading:"s-text s-bg-subtle",link:"s-text-link"},g={primary:`border-0 rounded-8 ${V}`,secondary:`border-2 rounded-8 ${V}`,utility:`border rounded-4 ${V}`,negative:`border-0 rounded-8 ${V}`,pill:`p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${V}`,link:`bg-transparent focusable ease-in-out inline active:underline hover:underline focus:underline ${f.link}`},n={xsmall:"py-6 px-16",small:"py-8 px-16",medium:"py-10 px-14",large:"py-12 px-16",utility:"py-[11px] px-[15px]",smallUtility:"py-[7px] px-[15px]",pill:"min-h-[44px] min-w-[44px]",pillSmall:"min-h-32 min-w-32",link:"p-0"},s={medium:"text-m leading-[24]",xsmall:"text-xs"},i={inProgress:`border-transparent animate-inprogress pointer-events-none ${f.loading}`,quiet:`border-0 rounded-8 ${V}`,utilityQuiet:`border-0 rounded-4 ${V}`,negativeQuiet:`border-0 rounded-8 ${V}`,isDisabled:`font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${f.disabled}`},d={secondary:`${n.medium} ${s.medium} ${g.secondary} ${f.secondary}`,secondaryHref:`${n.medium} ${s.medium} ${g.secondary} ${f.secondary}`,secondaryDisabled:`${n.medium} ${s.medium} ${g.secondary} ${i.isDisabled}`,secondarySmall:`${s.xsmall} ${n.xsmall} ${g.secondary} ${f.secondary}`,secondarySmallDisabled:`${s.xsmall} ${n.xsmall} ${g.secondary} ${i.isDisabled}`,secondaryQuiet:`${n.medium} ${s.medium} ${i.quiet} ${f.quiet}`,secondaryQuietDisabled:`${n.medium} ${s.medium} ${i.quiet} ${i.isDisabled}`,secondarySmallQuiet:`${s.xsmall} ${n.xsmall} ${i.quiet} ${f.quiet}`,secondarySmallQuietDisabled:`${s.xsmall} ${n.xsmall} ${i.quiet} ${i.isDisabled}`,secondaryLoading:`${n.medium} ${s.medium} ${g.secondary} ${i.inProgress}`,secondarySmallLoading:`${s.xsmall} ${n.xsmall} ${g.secondary} ${i.inProgress}`,secondarySmallQuietLoading:`${s.xsmall} ${n.xsmall} ${i.quiet} ${i.inProgress}`,secondaryQuietLoading:`${n.medium} ${s.medium} ${i.quiet} ${i.inProgress}`,primary:`${n.large} ${s.medium} ${g.primary} ${f.primary}`,primaryDisabled:`${n.large} ${s.medium} ${i.isDisabled} ${g.primary}`,primarySmall:`${n.small} ${s.xsmall} ${g.primary} ${f.primary}`,primarySmallDisabled:`${n.small} ${s.xsmall} ${i.isDisabled} ${g.primary} `,primaryQuiet:`${n.large} ${s.medium} ${i.quiet} ${f.quiet}`,primaryQuietDisabled:`${n.large} ${s.medium} ${i.quiet} ${i.isDisabled}`,primarySmallQuiet:`${n.small} ${s.xsmall} ${i.quiet} ${f.quiet}`,primarySmallQuietDisabled:`${n.small} ${s.xsmall} ${i.quiet} ${i.isDisabled}`,primaryLoading:`${n.large} ${s.medium} ${i.inProgress} ${g.primary}`,primarySmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${g.primary}`,primarySmallQuietLoading:`${n.small} ${s.xsmall} ${i.quiet} ${i.inProgress} ${g.primary}`,primaryQuietLoading:`${n.large} ${s.medium} ${i.quiet} ${i.inProgress}`,utility:`${n.utility} ${s.medium} ${g.utility} ${f.utility}`,utilityDisabled:`${n.utility} ${s.medium} ${g.utility} ${i.isDisabled}`,utilityQuiet:`${n.large} ${s.medium} ${i.utilityQuiet} ${f.utilityQuiet}`,utilityQuietDisabled:`${n.large} ${s.medium} ${i.utilityQuiet} ${i.isDisabled}`,utilitySmall:`${n.smallUtility} ${s.xsmall} ${g.utility} ${f.utility}`,utilitySmallDisabled:`${n.smallUtility} ${s.xsmall} ${g.utility} ${i.isDisabled}`,utilitySmallQuiet:`${n.smallUtility} ${s.xsmall} ${i.utilityQuiet} ${f.utilityQuiet}`,utilitySmallQuietDisabled:`${n.smallUtility} ${s.xsmall} ${i.utilityQuiet} ${i.isDisabled}`,utilityLoading:`${n.large} ${s.medium} ${g.utility} ${i.inProgress}`,utilitySmallLoading:`${n.smallUtility} ${s.xsmall} ${g.utility} ${i.inProgress}`,utilityQuietLoading:`${n.large} ${s.medium} ${i.inProgress} ${i.utilityQuiet}`,utilitySmallQuietLoading:`${n.smallUtility} ${s.xsmall} ${i.inProgress} ${i.utilityQuiet}`,negative:`${n.large} ${s.medium} ${g.negative} ${f.destructive}`,negativeDisabled:`${n.large} ${s.medium} ${g.negative} ${i.isDisabled}`,negativeQuiet:`${n.large} ${s.medium} ${i.negativeQuiet} ${f.negativeQuiet}`,negativeQuietDisabled:`${n.large} ${s.medium} ${i.negativeQuiet}${i.isDisabled}`,negativeSmall:`${n.small} ${s.xsmall} ${g.negative} ${f.destructive}`,negativeSmallDisabled:`${n.small} ${s.xsmall} ${g.negative} ${i.isDisabled}`,negativeSmallQuiet:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${f.negativeQuiet}`,negativeSmallQuietDisabled:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.isDisabled}`,negativeLoading:`${n.large} ${s.medium} ${g.negative} ${i.inProgress}`,negativeSmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${g.negative}`,negativeQuietLoading:`${n.large} ${s.medium} ${i.negativeQuiet} ${g.negative} ${i.inProgress}`,negativeSmallQuietLoading:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.inProgress}`,pill:`${n.pill} ${s.medium} ${g.pill} ${f.pill}`,pillSmall:`${n.pillSmall} ${s.xsmall} ${g.pill} ${f.pill}`,pillLoading:`${n.pill} ${s.medium} ${g.pill} ${i.inProgress}`,pillSmallLoading:`${n.pillSmall} ${s.xsmall} ${g.pill} ${i.inProgress}`,link:`${n.link} ${s.medium} ${g.link}`,linkSmall:`${n.link} ${s.xsmall} ${g.link}`,linkAsButton:"inline-block active:no-underline hover:no-underline focus:no-underline text-center",a11y:"sr-only",fullWidth:"w-full max-w-full",contentWidth:"max-w-max"},y=class extends ee(xr){constructor(){super();this.type="button";Me(qe,Pe,De,Fe,Te),this.variant="secondary",this.ariaValueTextLoading=G._({id:"button.aria.loading",message:"Loading...",comment:"Screen reader message for buttons that are loading"})}updated(r){r.has("value")&&this.setValue(this.value)}connectedCallback(){if(super.connectedCallback(),!Ve.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2655
- ${Ve.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}get _primaryClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.primary,this.small&&!this.quiet&&!this.loading&&d.primarySmall,this.small&&this.quiet&&!this.loading&&d.primarySmallQuiet,this.small&&this.loading&&(this.quiet?d.primarySmallQuietLoading:d.primarySmallLoading),!this.small&&this.quiet&&!this.loading&&d.primaryQuiet,!this.small&&this.loading&&(this.quiet?d.primaryQuietLoading:d.primaryLoading)]}get _secondaryClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.secondary,this.small&&!this.quiet&&!this.loading&&d.secondarySmall,this.small&&this.loading&&(this.quiet?d.secondarySmallQuietLoading:d.secondarySmallLoading),this.small&&this.quiet&&!this.loading&&d.secondarySmallQuiet,!this.small&&this.quiet&&!this.loading&&d.secondaryQuiet,!this.small&&this.loading&&(this.quiet?d.secondaryQuietLoading:d.secondaryLoading)]}get _utilityClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.utility,this.small&&!this.quiet&&!this.loading&&d.utilitySmall,this.small&&this.quiet&&!this.loading&&d.utilitySmallQuiet,this.small&&this.loading&&(this.quiet?d.utilitySmallQuietLoading:d.utilitySmallLoading),!this.small&&this.quiet&&!this.loading&&d.utilityQuiet,!this.small&&this.loading&&(this.quiet?d.utilityQuietLoading:d.utilityLoading)]}get _negativeClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.negative,this.small&&!this.quiet&&!this.loading&&d.negativeSmall,this.small&&this.quiet&&!this.loading&&d.negativeSmallQuiet,this.small&&this.loading&&(this.quiet?d.negativeSmallQuietLoading:d.negativeSmallLoading),!this.small&&this.quiet&&!this.loading&&d.negativeQuiet,!this.small&&this.loading&&(this.quiet?d.negativeQuietLoading:d.negativeLoading)]}get _pillClasses(){return[!this.loading&&(this.small?d.pillSmall:d.pill),this.loading&&(this.small?d.pillSmallLoading:d.pillLoading)]}get _linkClasses(){return[this.small?d.linkSmall:d.link]}get _classes(){return se(this.buttonClass,[this.variant==="primary"&&this._primaryClasses,this.variant==="secondary"&&this._secondaryClasses,this.variant==="utility"&&this._utilityClasses,this.variant==="negative"&&this._negativeClasses,this.variant==="pill"&&this._pillClasses,this.variant==="link"&&this._linkClasses,this.href&&d.linkAsButton,this.fullWidth?d.fullWidth:d.contentWidth])}_handleButtonClick(){this.type==="submit"?this.internals.form.requestSubmit():this.type==="reset"&&this.internals.form.reset()}render(){return te` ${this.href?te`<w-link
2654
+ </a>`}};_.shadowRootOptions={...Qe.shadowRootOptions,delegatesFocus:!0},_.styles=[re,Ee],m([Q({type:Boolean,reflect:!0})],_.prototype,"autofocus",2),m([Q({reflect:!0})],_.prototype,"variant",2),m([Q({type:Boolean,reflect:!0})],_.prototype,"quiet",2),m([Q({type:Boolean,reflect:!0})],_.prototype,"small",2),m([Q({reflect:!0})],_.prototype,"href",2),m([Q({type:Boolean,reflect:!0})],_.prototype,"disabled",2),m([Q({reflect:!0})],_.prototype,"target",2),m([Q({reflect:!0})],_.prototype,"rel",2),m([Q({attribute:"full-width",type:Boolean,reflect:!0})],_.prototype,"fullWidth",2),m([Q({attribute:"button-class",reflect:!0})],_.prototype,"buttonClass",2),m([Q({reflect:!0})],_.prototype,"name",2);customElements.get("w-link")||customElements.define("w-link",_);var Fe=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var De=JSON.parse('{"button.aria.loading":["Loading..."]}');var Pe=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Oe=JSON.parse('{"button.aria.loading":["Laster..."]}');var Te=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as wr}from"lit";var Ve=wr`*,: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}.text-center{text-align:center}.animate-inprogress{background-size:30px 30px;animation:3s linear infinite animate-inprogress;background-image:linear-gradient(135deg,#0000000d 25%,#0000 0 50%,#0000000d 0 75%,#0000 0,#0000)!important}@keyframes animate-inprogress{0%{background-position:0 0}to{background-position:60px 0}}.hover\\:bg-clip-padding:hover{-webkit-background-clip:padding-box;background-clip:padding-box}.bg-transparent{background-color:#0000}.bg-\\[--w-color-button-primary-background\\]{background-color:var(--w-color-button-primary-background)}.hover\\:bg-\\[--w-color-button-pill-background-hover\\]:hover{background-color:var(--w-color-button-pill-background-hover)}.hover\\:bg-\\[--w-color-button-primary-background-hover\\]:hover{background-color:var(--w-color-button-primary-background-hover)}.active\\:bg-\\[--w-color-button-pill-background-active\\]:active{background-color:var(--w-color-button-pill-background-active)}.active\\:bg-\\[--w-color-button-primary-background-active\\]:active{background-color:var(--w-color-button-primary-background-active)}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-transparent{border-color:#0000}.rounded-4{border-radius:4px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.inline-block{display:inline-block}.inline{display:inline}.inline-flex{display:inline-flex}.hover\\:underline:hover,.focus\\:underline:focus,.active\\:underline:active{text-decoration-line:underline}.hover\\:no-underline:hover,.focus\\:no-underline:focus,.active\\:no-underline:active{text-decoration:none}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-center{align-items:center}.justify-center{justify-content:center}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled{background-color:var(--w-s-color-background-disabled)}.s-bg-negative{background-color:var(--w-s-color-background-negative)}.s-bg-subtle{background-color:var(--w-s-color-background-subtle)}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-negative-hover:hover{background-color:var(--w-s-color-background-negative-hover)}.hover\\:s-bg-negative-subtle-hover:hover{background-color:var(--w-s-color-background-negative-subtle-hover)}.active\\:s-bg-active:active{background-color:var(--w-s-color-background-active)}.active\\:s-bg-negative-active:active{background-color:var(--w-s-color-background-negative-active)}.active\\:s-bg-negative-subtle-active:active{background-color:var(--w-s-color-background-negative-subtle-active)}.s-text{color:var(--w-s-color-text)}.s-text-inverted{color:var(--w-s-color-text-inverted)}.s-text-link{color:var(--w-s-color-text-link)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-icon{color:var(--w-s-color-icon)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border{border-color:var(--w-s-color-border)}.hover\\:s-border-hover:hover{border-color:var(--w-s-color-border-hover)}.active\\:s-border-active:active{border-color:var(--w-s-color-border-active)}.max-w-full{max-width:100%}.max-w-max{max-width:max-content}.min-h-32{min-height:3.2rem}.min-w-32{min-width:3.2rem}.w-full{width:100%}.min-h-\\[44px\\]{min-height:44px}.min-w-\\[44px\\]{min-width:44px}.p-0{padding:0}.p-4{padding:.4rem}.px-14{padding-left:1.4rem;padding-right:1.4rem}.px-16{padding-left:1.6rem;padding-right:1.6rem}.py-10{padding-top:1rem;padding-bottom:1rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.py-6{padding-top:.6rem;padding-bottom:.6rem}.py-8{padding-top:.8rem;padding-bottom:.8rem}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.py-\\[11px\\]{padding-top:11px;padding-bottom:11px}.py-\\[7px\\]{padding-top:7px;padding-bottom:7px}.cursor-default{cursor:default}.font-bold{font-weight:700}.pointer-events-none{pointer-events:none}.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}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-\\[24\\]{line-height:2.4rem}`;var Ae=["primary","secondary","negative","utility","pill","link"],V="font-bold focusable justify-center transition-colors ease-in-out",f={primary:"s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",secondary:"s-text-link s-border s-bg hover:s-bg-hover hover:s-border-hover active:s-bg-active",utility:"s-text s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",destructive:"s-bg-negative s-text-inverted hover:s-bg-negative-hover active:s-bg-negative-active",pill:"s-icon hover:s-icon-hover active:s-icon-active bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",disabled:"s-text-inverted s-bg-disabled",quiet:"bg-transparent s-text-link hover:s-bg-hover active:s-bg-active",utilityQuiet:"s-text bg-transparent hover:s-bg-hover active:s-bg-active",negativeQuiet:"bg-transparent s-text-negative hover:s-bg-negative-subtle-hover active:s-bg-negative-subtle-active",loading:"s-text s-bg-subtle",link:"s-text-link"},g={primary:`border-0 rounded-8 ${V}`,secondary:`border-2 rounded-8 ${V}`,utility:`border rounded-4 ${V}`,negative:`border-0 rounded-8 ${V}`,pill:`p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${V}`,link:`bg-transparent focusable ease-in-out inline active:underline hover:underline focus:underline ${f.link}`},n={xsmall:"py-6 px-16",small:"py-8 px-16",medium:"py-10 px-14",large:"py-12 px-16",utility:"py-[11px] px-[15px]",smallUtility:"py-[7px] px-[15px]",pill:"min-h-[44px] min-w-[44px]",pillSmall:"min-h-32 min-w-32",link:"p-0"},s={medium:"text-m leading-[24]",xsmall:"text-xs"},i={inProgress:`border-transparent animate-inprogress pointer-events-none ${f.loading}`,quiet:`border-0 rounded-8 ${V}`,utilityQuiet:`border-0 rounded-4 ${V}`,negativeQuiet:`border-0 rounded-8 ${V}`,isDisabled:`font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${f.disabled}`},d={secondary:`${n.medium} ${s.medium} ${g.secondary} ${f.secondary}`,secondaryHref:`${n.medium} ${s.medium} ${g.secondary} ${f.secondary}`,secondaryDisabled:`${n.medium} ${s.medium} ${g.secondary} ${i.isDisabled}`,secondarySmall:`${s.xsmall} ${n.xsmall} ${g.secondary} ${f.secondary}`,secondarySmallDisabled:`${s.xsmall} ${n.xsmall} ${g.secondary} ${i.isDisabled}`,secondaryQuiet:`${n.medium} ${s.medium} ${i.quiet} ${f.quiet}`,secondaryQuietDisabled:`${n.medium} ${s.medium} ${i.quiet} ${i.isDisabled}`,secondarySmallQuiet:`${s.xsmall} ${n.xsmall} ${i.quiet} ${f.quiet}`,secondarySmallQuietDisabled:`${s.xsmall} ${n.xsmall} ${i.quiet} ${i.isDisabled}`,secondaryLoading:`${n.medium} ${s.medium} ${g.secondary} ${i.inProgress}`,secondarySmallLoading:`${s.xsmall} ${n.xsmall} ${g.secondary} ${i.inProgress}`,secondarySmallQuietLoading:`${s.xsmall} ${n.xsmall} ${i.quiet} ${i.inProgress}`,secondaryQuietLoading:`${n.medium} ${s.medium} ${i.quiet} ${i.inProgress}`,primary:`${n.large} ${s.medium} ${g.primary} ${f.primary}`,primaryDisabled:`${n.large} ${s.medium} ${i.isDisabled} ${g.primary}`,primarySmall:`${n.small} ${s.xsmall} ${g.primary} ${f.primary}`,primarySmallDisabled:`${n.small} ${s.xsmall} ${i.isDisabled} ${g.primary} `,primaryQuiet:`${n.large} ${s.medium} ${i.quiet} ${f.quiet}`,primaryQuietDisabled:`${n.large} ${s.medium} ${i.quiet} ${i.isDisabled}`,primarySmallQuiet:`${n.small} ${s.xsmall} ${i.quiet} ${f.quiet}`,primarySmallQuietDisabled:`${n.small} ${s.xsmall} ${i.quiet} ${i.isDisabled}`,primaryLoading:`${n.large} ${s.medium} ${i.inProgress} ${g.primary}`,primarySmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${g.primary}`,primarySmallQuietLoading:`${n.small} ${s.xsmall} ${i.quiet} ${i.inProgress} ${g.primary}`,primaryQuietLoading:`${n.large} ${s.medium} ${i.quiet} ${i.inProgress}`,utility:`${n.utility} ${s.medium} ${g.utility} ${f.utility}`,utilityDisabled:`${n.utility} ${s.medium} ${g.utility} ${i.isDisabled}`,utilityQuiet:`${n.large} ${s.medium} ${i.utilityQuiet} ${f.utilityQuiet}`,utilityQuietDisabled:`${n.large} ${s.medium} ${i.utilityQuiet} ${i.isDisabled}`,utilitySmall:`${n.smallUtility} ${s.xsmall} ${g.utility} ${f.utility}`,utilitySmallDisabled:`${n.smallUtility} ${s.xsmall} ${g.utility} ${i.isDisabled}`,utilitySmallQuiet:`${n.smallUtility} ${s.xsmall} ${i.utilityQuiet} ${f.utilityQuiet}`,utilitySmallQuietDisabled:`${n.smallUtility} ${s.xsmall} ${i.utilityQuiet} ${i.isDisabled}`,utilityLoading:`${n.large} ${s.medium} ${g.utility} ${i.inProgress}`,utilitySmallLoading:`${n.smallUtility} ${s.xsmall} ${g.utility} ${i.inProgress}`,utilityQuietLoading:`${n.large} ${s.medium} ${i.inProgress} ${i.utilityQuiet}`,utilitySmallQuietLoading:`${n.smallUtility} ${s.xsmall} ${i.inProgress} ${i.utilityQuiet}`,negative:`${n.large} ${s.medium} ${g.negative} ${f.destructive}`,negativeDisabled:`${n.large} ${s.medium} ${g.negative} ${i.isDisabled}`,negativeQuiet:`${n.large} ${s.medium} ${i.negativeQuiet} ${f.negativeQuiet}`,negativeQuietDisabled:`${n.large} ${s.medium} ${i.negativeQuiet}${i.isDisabled}`,negativeSmall:`${n.small} ${s.xsmall} ${g.negative} ${f.destructive}`,negativeSmallDisabled:`${n.small} ${s.xsmall} ${g.negative} ${i.isDisabled}`,negativeSmallQuiet:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${f.negativeQuiet}`,negativeSmallQuietDisabled:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.isDisabled}`,negativeLoading:`${n.large} ${s.medium} ${g.negative} ${i.inProgress}`,negativeSmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${g.negative}`,negativeQuietLoading:`${n.large} ${s.medium} ${i.negativeQuiet} ${g.negative} ${i.inProgress}`,negativeSmallQuietLoading:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.inProgress}`,pill:`${n.pill} ${s.medium} ${g.pill} ${f.pill}`,pillSmall:`${n.pillSmall} ${s.xsmall} ${g.pill} ${f.pill}`,pillLoading:`${n.pill} ${s.medium} ${g.pill} ${i.inProgress}`,pillSmallLoading:`${n.pillSmall} ${s.xsmall} ${g.pill} ${i.inProgress}`,link:`${n.link} ${s.medium} ${g.link}`,linkSmall:`${n.link} ${s.xsmall} ${g.link}`,linkAsButton:"inline-block active:no-underline hover:no-underline focus:no-underline text-center",a11y:"sr-only",fullWidth:"w-full max-w-full",contentWidth:"max-w-max"},y=class extends ee(je){constructor(){super();this.type="button";Me(De,Oe,Pe,Fe,Te),this.variant="secondary",this.ariaValueTextLoading=G._({id:"button.aria.loading",message:"Loading...",comment:"Screen reader message for buttons that are loading"})}updated(r){r.has("value")&&this.setValue(this.value)}connectedCallback(){if(super.connectedCallback(),!Ae.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2655
+ ${Ae.join(", ")}.`)}firstUpdated(){this.autofocus&&!this.href&&setTimeout(()=>this.focus(),0)}get _primaryClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.primary,this.small&&!this.quiet&&!this.loading&&d.primarySmall,this.small&&this.quiet&&!this.loading&&d.primarySmallQuiet,this.small&&this.loading&&(this.quiet?d.primarySmallQuietLoading:d.primarySmallLoading),!this.small&&this.quiet&&!this.loading&&d.primaryQuiet,!this.small&&this.loading&&(this.quiet?d.primaryQuietLoading:d.primaryLoading)]}get _secondaryClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.secondary,this.small&&!this.quiet&&!this.loading&&d.secondarySmall,this.small&&this.loading&&(this.quiet?d.secondarySmallQuietLoading:d.secondarySmallLoading),this.small&&this.quiet&&!this.loading&&d.secondarySmallQuiet,!this.small&&this.quiet&&!this.loading&&d.secondaryQuiet,!this.small&&this.loading&&(this.quiet?d.secondaryQuietLoading:d.secondaryLoading)]}get _utilityClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.utility,this.small&&!this.quiet&&!this.loading&&d.utilitySmall,this.small&&this.quiet&&!this.loading&&d.utilitySmallQuiet,this.small&&this.loading&&(this.quiet?d.utilitySmallQuietLoading:d.utilitySmallLoading),!this.small&&this.quiet&&!this.loading&&d.utilityQuiet,!this.small&&this.loading&&(this.quiet?d.utilityQuietLoading:d.utilityLoading)]}get _negativeClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.negative,this.small&&!this.quiet&&!this.loading&&d.negativeSmall,this.small&&this.quiet&&!this.loading&&d.negativeSmallQuiet,this.small&&this.loading&&(this.quiet?d.negativeSmallQuietLoading:d.negativeSmallLoading),!this.small&&this.quiet&&!this.loading&&d.negativeQuiet,!this.small&&this.loading&&(this.quiet?d.negativeQuietLoading:d.negativeLoading)]}get _pillClasses(){return[!this.loading&&(this.small?d.pillSmall:d.pill),this.loading&&(this.small?d.pillSmallLoading:d.pillLoading)]}get _linkClasses(){return[this.small?d.linkSmall:d.link]}get _classes(){return se(this.buttonClass,[this.variant==="primary"&&this._primaryClasses,this.variant==="secondary"&&this._secondaryClasses,this.variant==="utility"&&this._utilityClasses,this.variant==="negative"&&this._negativeClasses,this.variant==="pill"&&this._pillClasses,this.variant==="link"&&this._linkClasses,this.href&&d.linkAsButton,this.fullWidth?d.fullWidth:d.contentWidth])}_handleButtonClick(){this.type==="submit"?this.internals.form.requestSubmit():this.type==="reset"&&this.internals.form.reset()}render(){return te` ${this.href?te`<w-link
2656
2656
  href=${this.href}
2657
2657
  target=${this.target}
2658
- rel=${this.target==="_blank"?this.rel||"noopener":void 0}
2659
- class=${this._classes}>
2658
+ variant=${this.variant}
2659
+ ?small=${this.small}
2660
+ ?quiet=${this.quiet}
2661
+ ?loading=${this.loading}
2662
+ ?autofocus=${this.autofocus}
2663
+ ?full-width=${this.fullWidth}
2664
+ class=${this.buttonClass}
2665
+ rel=${this.target==="_blank"?this.rel||"noopener":void 0}>
2660
2666
  <slot></slot>
2661
2667
  </w-link>`:te`<button type=${this.type||"button"} class=${this._classes} @click="${this._handleButtonClick}">
2662
2668
  <slot></slot>
2663
2669
  </button>`}
2664
- ${this.loading?te`<span class="sr-only" role="progressbar" aria-valuenow="{0}" aria-valuetext=${this.ariaValueTextLoading}></span>`:null}`}};y.shadowRootOptions={...yr.shadowRootOptions,delegatesFocus:!0},y.styles=[re,Oe],m([S({reflect:!0})],y.prototype,"type",2),m([S({type:Boolean,reflect:!0})],y.prototype,"autofocus",2),m([S({reflect:!0})],y.prototype,"variant",2),m([S({type:Boolean,reflect:!0})],y.prototype,"quiet",2),m([S({type:Boolean,reflect:!0})],y.prototype,"small",2),m([S({type:Boolean,reflect:!0})],y.prototype,"loading",2),m([S({reflect:!0})],y.prototype,"href",2),m([S({reflect:!0})],y.prototype,"target",2),m([S({reflect:!0})],y.prototype,"rel",2),m([S({attribute:"full-width",type:Boolean,reflect:!0})],y.prototype,"fullWidth",2),m([S({attribute:"button-class",reflect:!0})],y.prototype,"buttonClass",2),m([S({reflect:!0})],y.prototype,"name",2),m([S({reflect:!0})],y.prototype,"value",2);customElements.get("w-button")||customElements.define("w-button",y);export{y as WarpButton,d as ccButton};
2670
+ ${this.loading?te`<span class="sr-only" role="progressbar" aria-valuenow="{0}" aria-valuetext=${this.ariaValueTextLoading}></span>`:null}`}};y.shadowRootOptions={...je.shadowRootOptions,delegatesFocus:!0},y.styles=[re,Ve,xr`:host([full-width]) { width: 100%; }`],m([S({reflect:!0})],y.prototype,"type",2),m([S({type:Boolean,reflect:!0})],y.prototype,"autofocus",2),m([S({reflect:!0})],y.prototype,"variant",2),m([S({type:Boolean,reflect:!0})],y.prototype,"quiet",2),m([S({type:Boolean,reflect:!0})],y.prototype,"small",2),m([S({type:Boolean,reflect:!0})],y.prototype,"loading",2),m([S({reflect:!0})],y.prototype,"href",2),m([S({reflect:!0})],y.prototype,"target",2),m([S({reflect:!0})],y.prototype,"rel",2),m([S({attribute:"full-width",type:Boolean,reflect:!0})],y.prototype,"fullWidth",2),m([S({attribute:"button-class",reflect:!0})],y.prototype,"buttonClass",2),m([S({reflect:!0})],y.prototype,"name",2),m([S({reflect:!0})],y.prototype,"value",2);customElements.get("w-button")||customElements.define("w-button",y);export{y as WarpButton};
2665
2671
  //# sourceMappingURL=index.js.map