@mortenbrudvik/waveui 0.7.0 → 0.9.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 (439) hide show
  1. package/README.md +564 -155
  2. package/dist/components/button/Button.cjs +1 -1
  3. package/dist/components/button/Button.cjs.map +1 -1
  4. package/dist/components/button/Button.mjs +36 -35
  5. package/dist/components/button/Button.mjs.map +1 -1
  6. package/dist/components/button/Button.slots.cjs +1 -1
  7. package/dist/components/button/Button.slots.cjs.map +1 -1
  8. package/dist/components/button/Button.slots.mjs +31 -21
  9. package/dist/components/button/Button.slots.mjs.map +1 -1
  10. package/dist/components/button/CompoundButton.cjs +1 -1
  11. package/dist/components/button/CompoundButton.cjs.map +1 -1
  12. package/dist/components/button/CompoundButton.mjs +31 -29
  13. package/dist/components/button/CompoundButton.mjs.map +1 -1
  14. package/dist/components/button/Link.cjs +1 -1
  15. package/dist/components/button/Link.cjs.map +1 -1
  16. package/dist/components/button/Link.mjs +24 -23
  17. package/dist/components/button/Link.mjs.map +1 -1
  18. package/dist/components/button/MenuButton.cjs +1 -1
  19. package/dist/components/button/MenuButton.cjs.map +1 -1
  20. package/dist/components/button/MenuButton.mjs +29 -28
  21. package/dist/components/button/MenuButton.mjs.map +1 -1
  22. package/dist/components/button/SplitButton.cjs +1 -1
  23. package/dist/components/button/SplitButton.cjs.map +1 -1
  24. package/dist/components/button/SplitButton.mjs +46 -45
  25. package/dist/components/button/SplitButton.mjs.map +1 -1
  26. package/dist/components/button/ToggleButton.cjs +1 -1
  27. package/dist/components/button/ToggleButton.cjs.map +1 -1
  28. package/dist/components/button/ToggleButton.mjs +38 -35
  29. package/dist/components/button/ToggleButton.mjs.map +1 -1
  30. package/dist/components/button/Toolbar.cjs +1 -1
  31. package/dist/components/button/Toolbar.cjs.map +1 -1
  32. package/dist/components/button/Toolbar.mjs +43 -42
  33. package/dist/components/button/Toolbar.mjs.map +1 -1
  34. package/dist/components/button/Toolbar.parts.cjs +1 -1
  35. package/dist/components/button/Toolbar.parts.cjs.map +1 -1
  36. package/dist/components/button/Toolbar.parts.mjs +76 -81
  37. package/dist/components/button/Toolbar.parts.mjs.map +1 -1
  38. package/dist/components/data-display/Avatar.cjs +1 -1
  39. package/dist/components/data-display/Avatar.cjs.map +1 -1
  40. package/dist/components/data-display/Avatar.mjs +72 -67
  41. package/dist/components/data-display/Avatar.mjs.map +1 -1
  42. package/dist/components/data-display/AvatarGroup.cjs +1 -1
  43. package/dist/components/data-display/AvatarGroup.cjs.map +1 -1
  44. package/dist/components/data-display/AvatarGroup.mjs +89 -88
  45. package/dist/components/data-display/AvatarGroup.mjs.map +1 -1
  46. package/dist/components/data-display/Badge.cjs +1 -1
  47. package/dist/components/data-display/Badge.cjs.map +1 -1
  48. package/dist/components/data-display/Badge.mjs +17 -16
  49. package/dist/components/data-display/Badge.mjs.map +1 -1
  50. package/dist/components/data-display/CounterBadge.cjs +1 -1
  51. package/dist/components/data-display/CounterBadge.cjs.map +1 -1
  52. package/dist/components/data-display/CounterBadge.mjs +18 -17
  53. package/dist/components/data-display/CounterBadge.mjs.map +1 -1
  54. package/dist/components/data-display/Divider.cjs +1 -1
  55. package/dist/components/data-display/Divider.cjs.map +1 -1
  56. package/dist/components/data-display/Divider.mjs +31 -30
  57. package/dist/components/data-display/Divider.mjs.map +1 -1
  58. package/dist/components/data-display/Image.cjs +1 -1
  59. package/dist/components/data-display/Image.cjs.map +1 -1
  60. package/dist/components/data-display/Image.mjs +16 -15
  61. package/dist/components/data-display/Image.mjs.map +1 -1
  62. package/dist/components/data-display/InfoButton.cjs +2 -0
  63. package/dist/components/data-display/InfoButton.cjs.map +1 -0
  64. package/dist/components/data-display/InfoButton.mjs +173 -0
  65. package/dist/components/data-display/InfoButton.mjs.map +1 -0
  66. package/dist/components/data-display/InfoLabel.cjs +1 -1
  67. package/dist/components/data-display/InfoLabel.cjs.map +1 -1
  68. package/dist/components/data-display/InfoLabel.mjs +36 -92
  69. package/dist/components/data-display/InfoLabel.mjs.map +1 -1
  70. package/dist/components/data-display/List.cjs +1 -1
  71. package/dist/components/data-display/List.cjs.map +1 -1
  72. package/dist/components/data-display/List.mjs +175 -174
  73. package/dist/components/data-display/List.mjs.map +1 -1
  74. package/dist/components/data-display/Persona.cjs +1 -1
  75. package/dist/components/data-display/Persona.cjs.map +1 -1
  76. package/dist/components/data-display/Persona.mjs +31 -29
  77. package/dist/components/data-display/Persona.mjs.map +1 -1
  78. package/dist/components/data-display/PresenceBadge.cjs +1 -1
  79. package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
  80. package/dist/components/data-display/PresenceBadge.mjs +25 -24
  81. package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
  82. package/dist/components/data-display/Tag.cjs +1 -1
  83. package/dist/components/data-display/Tag.cjs.map +1 -1
  84. package/dist/components/data-display/Tag.mjs +87 -82
  85. package/dist/components/data-display/Tag.mjs.map +1 -1
  86. package/dist/components/feedback/MessageBar.cjs +1 -1
  87. package/dist/components/feedback/MessageBar.cjs.map +1 -1
  88. package/dist/components/feedback/MessageBar.mjs +129 -71
  89. package/dist/components/feedback/MessageBar.mjs.map +1 -1
  90. package/dist/components/feedback/MessageBar.parts.cjs +2 -0
  91. package/dist/components/feedback/MessageBar.parts.cjs.map +1 -0
  92. package/dist/components/feedback/MessageBar.parts.mjs +84 -0
  93. package/dist/components/feedback/MessageBar.parts.mjs.map +1 -0
  94. package/dist/components/feedback/MessageBar.reflow.cjs +2 -0
  95. package/dist/components/feedback/MessageBar.reflow.cjs.map +1 -0
  96. package/dist/components/feedback/MessageBar.reflow.mjs +74 -0
  97. package/dist/components/feedback/MessageBar.reflow.mjs.map +1 -0
  98. package/dist/components/feedback/MessageBar.status.cjs +1 -1
  99. package/dist/components/feedback/MessageBar.status.cjs.map +1 -1
  100. package/dist/components/feedback/MessageBar.status.mjs +2 -1
  101. package/dist/components/feedback/MessageBar.status.mjs.map +1 -1
  102. package/dist/components/feedback/ProgressBar.cjs +1 -1
  103. package/dist/components/feedback/ProgressBar.cjs.map +1 -1
  104. package/dist/components/feedback/ProgressBar.mjs +44 -43
  105. package/dist/components/feedback/ProgressBar.mjs.map +1 -1
  106. package/dist/components/feedback/Skeleton.cjs +1 -1
  107. package/dist/components/feedback/Skeleton.cjs.map +1 -1
  108. package/dist/components/feedback/Skeleton.mjs +26 -24
  109. package/dist/components/feedback/Skeleton.mjs.map +1 -1
  110. package/dist/components/feedback/Spinner.cjs +1 -1
  111. package/dist/components/feedback/Spinner.cjs.map +1 -1
  112. package/dist/components/feedback/Spinner.mjs +32 -31
  113. package/dist/components/feedback/Spinner.mjs.map +1 -1
  114. package/dist/components/feedback/Toast.cjs +1 -1
  115. package/dist/components/feedback/Toast.cjs.map +1 -1
  116. package/dist/components/feedback/Toast.context.cjs +2 -0
  117. package/dist/components/feedback/Toast.context.cjs.map +1 -0
  118. package/dist/components/feedback/Toast.context.mjs +23 -0
  119. package/dist/components/feedback/Toast.context.mjs.map +1 -0
  120. package/dist/components/feedback/Toast.mjs +10 -342
  121. package/dist/components/feedback/Toast.mjs.map +1 -1
  122. package/dist/components/feedback/Toast.parts.cjs +2 -0
  123. package/dist/components/feedback/Toast.parts.cjs.map +1 -0
  124. package/dist/components/feedback/Toast.parts.mjs +98 -0
  125. package/dist/components/feedback/Toast.parts.mjs.map +1 -0
  126. package/dist/components/feedback/Toast.root.cjs +2 -0
  127. package/dist/components/feedback/Toast.root.cjs.map +1 -0
  128. package/dist/components/feedback/Toast.root.mjs +109 -0
  129. package/dist/components/feedback/Toast.root.mjs.map +1 -0
  130. package/dist/components/feedback/Toaster.cjs +2 -0
  131. package/dist/components/feedback/Toaster.cjs.map +1 -0
  132. package/dist/components/feedback/Toaster.mjs +564 -0
  133. package/dist/components/feedback/Toaster.mjs.map +1 -0
  134. package/dist/components/input/AlphaSlider.cjs +2 -0
  135. package/dist/components/input/AlphaSlider.cjs.map +1 -0
  136. package/dist/components/input/AlphaSlider.mjs +115 -0
  137. package/dist/components/input/AlphaSlider.mjs.map +1 -0
  138. package/dist/components/input/Checkbox.cjs +1 -1
  139. package/dist/components/input/Checkbox.cjs.map +1 -1
  140. package/dist/components/input/Checkbox.mjs +87 -70
  141. package/dist/components/input/Checkbox.mjs.map +1 -1
  142. package/dist/components/input/ColorArea.cjs +2 -0
  143. package/dist/components/input/ColorArea.cjs.map +1 -0
  144. package/dist/components/input/ColorArea.mjs +204 -0
  145. package/dist/components/input/ColorArea.mjs.map +1 -0
  146. package/dist/components/input/ColorPicker.cjs +5 -5
  147. package/dist/components/input/ColorPicker.cjs.map +1 -1
  148. package/dist/components/input/ColorPicker.mjs +142 -165
  149. package/dist/components/input/ColorPicker.mjs.map +1 -1
  150. package/dist/components/input/ColorPicker.parts.cjs +2 -0
  151. package/dist/components/input/ColorPicker.parts.cjs.map +1 -0
  152. package/dist/components/input/ColorPicker.parts.mjs +192 -0
  153. package/dist/components/input/ColorPicker.parts.mjs.map +1 -0
  154. package/dist/components/input/ColorSlider.cjs +2 -0
  155. package/dist/components/input/ColorSlider.cjs.map +1 -0
  156. package/dist/components/input/ColorSlider.mjs +138 -0
  157. package/dist/components/input/ColorSlider.mjs.map +1 -0
  158. package/dist/components/input/Combobox.cjs +1 -1
  159. package/dist/components/input/Combobox.cjs.map +1 -1
  160. package/dist/components/input/Combobox.expand.cjs +1 -1
  161. package/dist/components/input/Combobox.expand.cjs.map +1 -1
  162. package/dist/components/input/Combobox.expand.mjs +22 -22
  163. package/dist/components/input/Combobox.expand.mjs.map +1 -1
  164. package/dist/components/input/Combobox.mjs +151 -141
  165. package/dist/components/input/Combobox.mjs.map +1 -1
  166. package/dist/components/input/DatePicker.cjs +1 -1
  167. package/dist/components/input/DatePicker.cjs.map +1 -1
  168. package/dist/components/input/DatePicker.mjs +239 -234
  169. package/dist/components/input/DatePicker.mjs.map +1 -1
  170. package/dist/components/input/Dropdown.cjs +1 -1
  171. package/dist/components/input/Dropdown.cjs.map +1 -1
  172. package/dist/components/input/Dropdown.mjs +109 -100
  173. package/dist/components/input/Dropdown.mjs.map +1 -1
  174. package/dist/components/input/Field.cjs +1 -1
  175. package/dist/components/input/Field.cjs.map +1 -1
  176. package/dist/components/input/Field.mjs +139 -105
  177. package/dist/components/input/Field.mjs.map +1 -1
  178. package/dist/components/input/Input.cjs +1 -1
  179. package/dist/components/input/Input.cjs.map +1 -1
  180. package/dist/components/input/Input.mjs +80 -55
  181. package/dist/components/input/Input.mjs.map +1 -1
  182. package/dist/components/input/Label.cjs +1 -1
  183. package/dist/components/input/Label.cjs.map +1 -1
  184. package/dist/components/input/Label.mjs +19 -12
  185. package/dist/components/input/Label.mjs.map +1 -1
  186. package/dist/components/input/Option.cjs +1 -1
  187. package/dist/components/input/Option.cjs.map +1 -1
  188. package/dist/components/input/Option.mjs +100 -98
  189. package/dist/components/input/Option.mjs.map +1 -1
  190. package/dist/components/input/RadioGroup.cjs +1 -1
  191. package/dist/components/input/RadioGroup.cjs.map +1 -1
  192. package/dist/components/input/RadioGroup.mjs +89 -88
  193. package/dist/components/input/RadioGroup.mjs.map +1 -1
  194. package/dist/components/input/Rating.cjs +1 -1
  195. package/dist/components/input/Rating.cjs.map +1 -1
  196. package/dist/components/input/Rating.item.cjs +2 -0
  197. package/dist/components/input/Rating.item.cjs.map +1 -0
  198. package/dist/components/input/Rating.item.mjs +255 -0
  199. package/dist/components/input/Rating.item.mjs.map +1 -0
  200. package/dist/components/input/Rating.mjs +152 -152
  201. package/dist/components/input/Rating.mjs.map +1 -1
  202. package/dist/components/input/SearchBox.cjs +1 -1
  203. package/dist/components/input/SearchBox.cjs.map +1 -1
  204. package/dist/components/input/SearchBox.mjs +162 -132
  205. package/dist/components/input/SearchBox.mjs.map +1 -1
  206. package/dist/components/input/Select.cjs +1 -1
  207. package/dist/components/input/Select.cjs.map +1 -1
  208. package/dist/components/input/Select.mjs +34 -24
  209. package/dist/components/input/Select.mjs.map +1 -1
  210. package/dist/components/input/Slider.cjs +1 -1
  211. package/dist/components/input/Slider.cjs.map +1 -1
  212. package/dist/components/input/Slider.mjs +78 -54
  213. package/dist/components/input/Slider.mjs.map +1 -1
  214. package/dist/components/input/SpinButton.cjs +1 -1
  215. package/dist/components/input/SpinButton.cjs.map +1 -1
  216. package/dist/components/input/SpinButton.mjs +202 -99
  217. package/dist/components/input/SpinButton.mjs.map +1 -1
  218. package/dist/components/input/SwatchPicker.cjs +1 -1
  219. package/dist/components/input/SwatchPicker.cjs.map +1 -1
  220. package/dist/components/input/SwatchPicker.mjs +38 -37
  221. package/dist/components/input/SwatchPicker.mjs.map +1 -1
  222. package/dist/components/input/Switch.cjs +1 -1
  223. package/dist/components/input/Switch.cjs.map +1 -1
  224. package/dist/components/input/Switch.mjs +75 -58
  225. package/dist/components/input/Switch.mjs.map +1 -1
  226. package/dist/components/input/TagPicker.cjs +1 -1
  227. package/dist/components/input/TagPicker.cjs.map +1 -1
  228. package/dist/components/input/TagPicker.mjs +199 -169
  229. package/dist/components/input/TagPicker.mjs.map +1 -1
  230. package/dist/components/input/Textarea.cjs +1 -1
  231. package/dist/components/input/Textarea.cjs.map +1 -1
  232. package/dist/components/input/Textarea.mjs +31 -23
  233. package/dist/components/input/Textarea.mjs.map +1 -1
  234. package/dist/components/input/TimePicker.cjs +1 -1
  235. package/dist/components/input/TimePicker.cjs.map +1 -1
  236. package/dist/components/input/TimePicker.mjs +185 -177
  237. package/dist/components/input/TimePicker.mjs.map +1 -1
  238. package/dist/components/input/colorName.cjs +2 -0
  239. package/dist/components/input/colorName.cjs.map +1 -0
  240. package/dist/components/input/colorName.mjs +30 -0
  241. package/dist/components/input/colorName.mjs.map +1 -0
  242. package/dist/components/input/colorUtils.cjs +1 -1
  243. package/dist/components/input/colorUtils.cjs.map +1 -1
  244. package/dist/components/input/colorUtils.mjs +154 -56
  245. package/dist/components/input/colorUtils.mjs.map +1 -1
  246. package/dist/components/input/fieldLabel.cjs +2 -0
  247. package/dist/components/input/fieldLabel.cjs.map +1 -0
  248. package/dist/components/input/fieldLabel.mjs +17 -0
  249. package/dist/components/input/fieldLabel.mjs.map +1 -0
  250. package/dist/components/input/inputLook.cjs +2 -0
  251. package/dist/components/input/inputLook.cjs.map +1 -0
  252. package/dist/components/input/inputLook.mjs +28 -0
  253. package/dist/components/input/inputLook.mjs.map +1 -0
  254. package/dist/components/input/pickerStyles.cjs +1 -1
  255. package/dist/components/input/pickerStyles.cjs.map +1 -1
  256. package/dist/components/input/pickerStyles.mjs +42 -4
  257. package/dist/components/input/pickerStyles.mjs.map +1 -1
  258. package/dist/components/layout/Accordion.cjs +1 -1
  259. package/dist/components/layout/Accordion.cjs.map +1 -1
  260. package/dist/components/layout/Accordion.mjs +130 -129
  261. package/dist/components/layout/Accordion.mjs.map +1 -1
  262. package/dist/components/layout/Card.cjs +1 -1
  263. package/dist/components/layout/Card.cjs.map +1 -1
  264. package/dist/components/layout/Card.mjs +78 -77
  265. package/dist/components/layout/Card.mjs.map +1 -1
  266. package/dist/components/layout/Carousel.cjs +1 -1
  267. package/dist/components/layout/Carousel.cjs.map +1 -1
  268. package/dist/components/layout/Carousel.mjs +111 -110
  269. package/dist/components/layout/Carousel.mjs.map +1 -1
  270. package/dist/components/layout/Flex.cjs +1 -1
  271. package/dist/components/layout/Flex.cjs.map +1 -1
  272. package/dist/components/layout/Flex.mjs +22 -21
  273. package/dist/components/layout/Flex.mjs.map +1 -1
  274. package/dist/components/layout/Grid.cjs +1 -1
  275. package/dist/components/layout/Grid.cjs.map +1 -1
  276. package/dist/components/layout/Grid.mjs +19 -18
  277. package/dist/components/layout/Grid.mjs.map +1 -1
  278. package/dist/components/layout/Overflow.cjs +1 -1
  279. package/dist/components/layout/Overflow.cjs.map +1 -1
  280. package/dist/components/layout/Overflow.mjs +92 -91
  281. package/dist/components/layout/Overflow.mjs.map +1 -1
  282. package/dist/components/layout/Stack.cjs +1 -1
  283. package/dist/components/layout/Stack.cjs.map +1 -1
  284. package/dist/components/layout/Stack.mjs +14 -13
  285. package/dist/components/layout/Stack.mjs.map +1 -1
  286. package/dist/components/layout/TabList.cjs +1 -1
  287. package/dist/components/layout/TabList.cjs.map +1 -1
  288. package/dist/components/layout/TabList.mjs +118 -117
  289. package/dist/components/layout/TabList.mjs.map +1 -1
  290. package/dist/components/layout/Tree.cjs +1 -1
  291. package/dist/components/layout/Tree.cjs.map +1 -1
  292. package/dist/components/layout/Tree.context.cjs +2 -0
  293. package/dist/components/layout/Tree.context.cjs.map +1 -0
  294. package/dist/components/layout/Tree.context.mjs +33 -0
  295. package/dist/components/layout/Tree.context.mjs.map +1 -0
  296. package/dist/components/layout/Tree.core.cjs +2 -0
  297. package/dist/components/layout/Tree.core.cjs.map +1 -0
  298. package/dist/components/layout/Tree.core.mjs +416 -0
  299. package/dist/components/layout/Tree.core.mjs.map +1 -0
  300. package/dist/components/layout/Tree.itemPersonaLayout.cjs +2 -0
  301. package/dist/components/layout/Tree.itemPersonaLayout.cjs.map +1 -0
  302. package/dist/components/layout/Tree.itemPersonaLayout.mjs +46 -0
  303. package/dist/components/layout/Tree.itemPersonaLayout.mjs.map +1 -0
  304. package/dist/components/layout/Tree.mjs +7 -215
  305. package/dist/components/layout/Tree.mjs.map +1 -1
  306. package/dist/components/layout/Tree.selection.cjs +2 -0
  307. package/dist/components/layout/Tree.selection.cjs.map +1 -0
  308. package/dist/components/layout/Tree.selection.mjs +73 -0
  309. package/dist/components/layout/Tree.selection.mjs.map +1 -0
  310. package/dist/components/navigation/Breadcrumb.cjs +1 -1
  311. package/dist/components/navigation/Breadcrumb.cjs.map +1 -1
  312. package/dist/components/navigation/Breadcrumb.mjs +76 -75
  313. package/dist/components/navigation/Breadcrumb.mjs.map +1 -1
  314. package/dist/components/navigation/Menu.group.cjs +1 -1
  315. package/dist/components/navigation/Menu.group.cjs.map +1 -1
  316. package/dist/components/navigation/Menu.group.mjs +39 -37
  317. package/dist/components/navigation/Menu.group.mjs.map +1 -1
  318. package/dist/components/navigation/Menu.items.cjs +1 -1
  319. package/dist/components/navigation/Menu.items.cjs.map +1 -1
  320. package/dist/components/navigation/Menu.items.mjs +67 -61
  321. package/dist/components/navigation/Menu.items.mjs.map +1 -1
  322. package/dist/components/navigation/Menu.link.cjs +1 -1
  323. package/dist/components/navigation/Menu.link.cjs.map +1 -1
  324. package/dist/components/navigation/Menu.link.mjs +34 -28
  325. package/dist/components/navigation/Menu.link.mjs.map +1 -1
  326. package/dist/components/navigation/Menu.popover.cjs +1 -1
  327. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  328. package/dist/components/navigation/Menu.popover.mjs +114 -113
  329. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  330. package/dist/components/navigation/Menu.root.cjs +1 -1
  331. package/dist/components/navigation/Menu.root.cjs.map +1 -1
  332. package/dist/components/navigation/Menu.root.mjs +171 -170
  333. package/dist/components/navigation/Menu.root.mjs.map +1 -1
  334. package/dist/components/navigation/Menu.selectable.cjs +1 -1
  335. package/dist/components/navigation/Menu.selectable.cjs.map +1 -1
  336. package/dist/components/navigation/Menu.selectable.mjs +85 -63
  337. package/dist/components/navigation/Menu.selectable.mjs.map +1 -1
  338. package/dist/components/navigation/Menu.splitGroup.cjs +1 -1
  339. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -1
  340. package/dist/components/navigation/Menu.splitGroup.mjs +27 -26
  341. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -1
  342. package/dist/components/navigation/Menu.trigger.cjs +1 -1
  343. package/dist/components/navigation/Menu.trigger.cjs.map +1 -1
  344. package/dist/components/navigation/Menu.trigger.mjs +6 -6
  345. package/dist/components/navigation/Nav.cjs +1 -1
  346. package/dist/components/navigation/Nav.cjs.map +1 -1
  347. package/dist/components/navigation/Nav.mjs +170 -155
  348. package/dist/components/navigation/Nav.mjs.map +1 -1
  349. package/dist/components/navigation/Pagination.cjs +1 -1
  350. package/dist/components/navigation/Pagination.cjs.map +1 -1
  351. package/dist/components/navigation/Pagination.mjs +73 -65
  352. package/dist/components/navigation/Pagination.mjs.map +1 -1
  353. package/dist/components/navigation/Stepper.cjs +1 -1
  354. package/dist/components/navigation/Stepper.cjs.map +1 -1
  355. package/dist/components/navigation/Stepper.mjs +110 -109
  356. package/dist/components/navigation/Stepper.mjs.map +1 -1
  357. package/dist/components/overlays/Dialog.cjs +1 -1
  358. package/dist/components/overlays/Dialog.cjs.map +1 -1
  359. package/dist/components/overlays/Dialog.mjs +109 -108
  360. package/dist/components/overlays/Dialog.mjs.map +1 -1
  361. package/dist/components/overlays/Drawer.cjs +1 -1
  362. package/dist/components/overlays/Drawer.cjs.map +1 -1
  363. package/dist/components/overlays/Drawer.mjs +110 -109
  364. package/dist/components/overlays/Drawer.mjs.map +1 -1
  365. package/dist/components/overlays/Popover.cjs +1 -1
  366. package/dist/components/overlays/Popover.cjs.map +1 -1
  367. package/dist/components/overlays/Popover.mjs +148 -151
  368. package/dist/components/overlays/Popover.mjs.map +1 -1
  369. package/dist/components/overlays/Popover.shared.cjs +1 -1
  370. package/dist/components/overlays/Popover.shared.cjs.map +1 -1
  371. package/dist/components/overlays/Popover.shared.mjs +82 -77
  372. package/dist/components/overlays/Popover.shared.mjs.map +1 -1
  373. package/dist/components/overlays/TeachingPopover.cjs +1 -1
  374. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  375. package/dist/components/overlays/TeachingPopover.mjs +41 -37
  376. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  377. package/dist/components/overlays/Tooltip.cjs +1 -1
  378. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  379. package/dist/components/overlays/Tooltip.mjs +87 -86
  380. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  381. package/dist/components/portal/Portal.cjs +1 -1
  382. package/dist/components/portal/Portal.cjs.map +1 -1
  383. package/dist/components/portal/Portal.mjs +33 -32
  384. package/dist/components/portal/Portal.mjs.map +1 -1
  385. package/dist/components/provider/WaveProvider.cjs +1 -1
  386. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  387. package/dist/components/provider/WaveProvider.mjs +36 -29
  388. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  389. package/dist/components/table/DataGrid.cjs +1 -1
  390. package/dist/components/table/DataGrid.cjs.map +1 -1
  391. package/dist/components/table/DataGrid.mjs +228 -227
  392. package/dist/components/table/DataGrid.mjs.map +1 -1
  393. package/dist/components/table/Table.cjs +1 -1
  394. package/dist/components/table/Table.cjs.map +1 -1
  395. package/dist/components/table/Table.mjs +60 -59
  396. package/dist/components/table/Table.mjs.map +1 -1
  397. package/dist/components/typography/Text.cjs +1 -1
  398. package/dist/components/typography/Text.cjs.map +1 -1
  399. package/dist/components/typography/Text.mjs +12 -11
  400. package/dist/components/typography/Text.mjs.map +1 -1
  401. package/dist/hooks/useFieldControl.cjs.map +1 -1
  402. package/dist/hooks/useFieldControl.mjs.map +1 -1
  403. package/dist/hooks/useMediaQuery.cjs +2 -0
  404. package/dist/hooks/useMediaQuery.cjs.map +1 -0
  405. package/dist/hooks/useMediaQuery.mjs +20 -0
  406. package/dist/hooks/useMediaQuery.mjs.map +1 -0
  407. package/dist/hooks/usePrefersReducedMotion.cjs +1 -1
  408. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -1
  409. package/dist/hooks/usePrefersReducedMotion.mjs +4 -18
  410. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -1
  411. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  412. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  413. package/dist/hooks/useRovingTabIndex.mjs +3 -3
  414. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  415. package/dist/index.cjs +1 -1
  416. package/dist/index.d.cts +2890 -197
  417. package/dist/index.d.ts +2890 -197
  418. package/dist/index.mjs +101 -87
  419. package/dist/lib/classNames.cjs +2 -0
  420. package/dist/lib/classNames.cjs.map +1 -0
  421. package/dist/lib/classNames.mjs +423 -0
  422. package/dist/lib/classNames.mjs.map +1 -0
  423. package/dist/lib/color.cjs +2 -0
  424. package/dist/lib/color.cjs.map +1 -0
  425. package/dist/lib/color.mjs +86 -0
  426. package/dist/lib/color.mjs.map +1 -0
  427. package/dist/lib/globalRegistry.cjs.map +1 -1
  428. package/dist/lib/globalRegistry.mjs.map +1 -1
  429. package/dist/lib/styles.cjs +1 -1
  430. package/dist/lib/styles.cjs.map +1 -1
  431. package/dist/lib/styles.mjs +21 -4
  432. package/dist/lib/styles.mjs.map +1 -1
  433. package/dist/lib/toaster.cjs +2 -0
  434. package/dist/lib/toaster.cjs.map +1 -0
  435. package/dist/lib/toaster.mjs +77 -0
  436. package/dist/lib/toaster.mjs.map +1 -0
  437. package/dist/styles.css +1 -1
  438. package/package.json +1 -1
  439. package/src/styles/tokens.css +13 -0
@@ -0,0 +1,86 @@
1
+ //#region src/lib/color.ts
2
+ var e = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
3
+ function t(t) {
4
+ let n = e.exec(t.trim());
5
+ if (!n) return null;
6
+ let r = n[1], i = r.length <= 4 ? r.split("").map((e) => e + e).join("") : r, a = (e) => parseInt(i.slice(e, e + 2), 16), o = i.length === 8;
7
+ return {
8
+ r: a(0),
9
+ g: a(2),
10
+ b: a(4),
11
+ alpha: o ? a(6) : 255,
12
+ hasAlpha: o
13
+ };
14
+ }
15
+ function n(e) {
16
+ return Number.isFinite(e) ? (e % 360 + 360) % 360 : 0;
17
+ }
18
+ function r(e, t) {
19
+ return e === void 0 || Number.isNaN(e) ? t : Math.min(1, Math.max(0, e));
20
+ }
21
+ function i(e) {
22
+ let t = n(e.h) / 60, i = r(e.s, 0), a = r(e.v, 0), o = a * i, s = o * (1 - Math.abs(t % 2 - 1)), c = a - o, l;
23
+ return l = t < 1 ? [
24
+ o,
25
+ s,
26
+ 0
27
+ ] : t < 2 ? [
28
+ s,
29
+ o,
30
+ 0
31
+ ] : t < 3 ? [
32
+ 0,
33
+ o,
34
+ s
35
+ ] : t < 4 ? [
36
+ 0,
37
+ s,
38
+ o
39
+ ] : t < 5 ? [
40
+ s,
41
+ 0,
42
+ o
43
+ ] : [
44
+ o,
45
+ 0,
46
+ s
47
+ ], {
48
+ r: (l[0] + c) * 255,
49
+ g: (l[1] + c) * 255,
50
+ b: (l[2] + c) * 255
51
+ };
52
+ }
53
+ function a(e, t, n) {
54
+ let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = o - Math.min(r, i, a), c = 0;
55
+ return s !== 0 && (c = o === r ? (i - a) / s % 6 : o === i ? (a - r) / s + 2 : (r - i) / s + 4, c *= 60, c < 0 && (c += 360)), {
56
+ h: c,
57
+ s: o === 0 ? 0 : s / o,
58
+ v: o
59
+ };
60
+ }
61
+ function o(e) {
62
+ return Math.round(e).toString(16).padStart(2, "0");
63
+ }
64
+ function s(e) {
65
+ let { r: t, g: n, b: a } = i(e), s = Math.round(r(e.a, 1) * 255), c = `#${o(t)}${o(n)}${o(a)}`;
66
+ return s === 255 ? c : c + o(s);
67
+ }
68
+ function c(e) {
69
+ let n = t(e);
70
+ if (!n) return null;
71
+ let { h: r, s: i, v: o } = a(n.r, n.g, n.b);
72
+ return n.hasAlpha ? {
73
+ h: r,
74
+ s: i,
75
+ v: o,
76
+ a: n.alpha / 255
77
+ } : {
78
+ h: r,
79
+ s: i,
80
+ v: o
81
+ };
82
+ }
83
+ //#endregion
84
+ export { r as clampUnit, c as hexToHsv, s as hsvToHex, i as hsvToRgb, t as parseHexBytes, a as rgbToHsv, n as wrapHue };
85
+
86
+ //# sourceMappingURL=color.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.mjs","names":["HEX_COLOR","parseHexBytes","match","value","digits","long","d","byte","index","hasAlpha","wrapHue","h","clampUnit","fallback","hsvToRgb","color","s","v","c","x","m","rgb","rgbToHsv","red","r","green","g","blue","b","max","delta","toHexByte","hsvToHex","alpha","hex","hexToHsv","bytes"],"sources":["../../src/lib/color.ts"],"sourcesContent":["/**\n * Conversions between HSV colors and hex strings (spec P3-05, D18). Server-safe: no React and no\n * DOM, so the helpers run in a Server Component and during server rendering.\n *\n * Public: `hsvToHex` and `hexToHsv`, exported from the package entry. The other exports are\n * internal helpers of the color components (not exported from the package).\n */\nimport type { HsvColor } from './types';\n\nconst HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\n\n/** @internal The channels of a hex color as bytes (0–255). */\nexport interface HexBytes {\n r: number;\n g: number;\n b: number;\n /** The alpha byte; 255 when the input has no alpha digits. */\n alpha: number;\n /** Whether the input has alpha digits (`#rgba`, `#rrggbbaa`). */\n hasAlpha: boolean;\n}\n\n/**\n * @internal Parses `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa` (surrounding whitespace ignored, any\n * case), else `null`. The one hex grammar of the library: `colorUtils.parseHexColor` reads it too.\n */\nexport function parseHexBytes(value: string): HexBytes | null {\n const match = HEX_COLOR.exec(value.trim());\n if (!match) return null;\n const digits = match[1];\n const long =\n digits.length <= 4\n ? digits\n .split('')\n .map((d) => d + d)\n .join('')\n : digits;\n const byte = (index: number) => parseInt(long.slice(index, index + 2), 16);\n const hasAlpha = long.length === 8;\n return { r: byte(0), g: byte(2), b: byte(4), alpha: hasAlpha ? byte(6) : 255, hasAlpha };\n}\n\n/** @internal `h` wrapped into [0, 360); a hue that is not finite reads as 0. */\nexport function wrapHue(h: number): number {\n return Number.isFinite(h) ? ((h % 360) + 360) % 360 : 0;\n}\n\n/** @internal `value` clamped to [0, 1]; `NaN` or `undefined` reads as `fallback`. */\nexport function clampUnit(value: number | undefined, fallback: number): number {\n if (value === undefined || Number.isNaN(value)) return fallback;\n return Math.min(1, Math.max(0, value));\n}\n\n/** @internal An HSV color, normalized first, as sRGB channels from 0 to 255 (unrounded). */\nexport function hsvToRgb(color: HsvColor): { r: number; g: number; b: number } {\n const h = wrapHue(color.h) / 60;\n const s = clampUnit(color.s, 0);\n const v = clampUnit(color.v, 0);\n const c = v * s;\n const x = c * (1 - Math.abs((h % 2) - 1));\n const m = v - c;\n let rgb: [number, number, number];\n if (h < 1) rgb = [c, x, 0];\n else if (h < 2) rgb = [x, c, 0];\n else if (h < 3) rgb = [0, c, x];\n else if (h < 4) rgb = [0, x, c];\n else if (h < 5) rgb = [x, 0, c];\n else rgb = [c, 0, x];\n return { r: (rgb[0] + m) * 255, g: (rgb[1] + m) * 255, b: (rgb[2] + m) * 255 };\n}\n\n/** @internal sRGB channels (0–255) as a hue in degrees and saturation and brightness from 0 to 1. */\nexport function rgbToHsv(r: number, g: number, b: number): { h: number; s: number; v: number } {\n const red = r / 255;\n const green = g / 255;\n const blue = b / 255;\n const max = Math.max(red, green, blue);\n const delta = max - Math.min(red, green, blue);\n let h = 0;\n if (delta !== 0) {\n if (max === red) h = ((green - blue) / delta) % 6;\n else if (max === green) h = (blue - red) / delta + 2;\n else h = (red - green) / delta + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n return { h, s: max === 0 ? 0 : delta / max, v: max };\n}\n\nfunction toHexByte(value: number): string {\n return Math.round(value).toString(16).padStart(2, '0');\n}\n\n/**\n * The hex string of an HSV color: lowercase `#rrggbb`, or `#rrggbbaa` when `a` is below 1\n * (ColorPicker's value format). The hue wraps into [0, 360); saturation, brightness and alpha are\n * clamped to [0, 1]; a channel that is not a number reads as 0 (alpha: as left out, so opaque).\n *\n * @example hsvToHex({ h: 208, s: 0.92, v: 0.74 }) // '#0f6cbd'\n */\nexport function hsvToHex(color: HsvColor): string {\n const { r, g, b } = hsvToRgb(color);\n const alpha = Math.round(clampUnit(color.a, 1) * 255);\n const hex = `#${toHexByte(r)}${toHexByte(g)}${toHexByte(b)}`;\n return alpha === 255 ? hex : hex + toHexByte(alpha);\n}\n\n/**\n * The HSV color of a hex string: `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa` (surrounding whitespace\n * ignored, any case). `a` is set only when the input has alpha digits. Returns `null` for anything\n * else (named colors, `rgb()`, a missing `#`). `hsvToHex(hexToHsv(x))` gives `x` back in\n * ColorPicker's normal form.\n *\n * @example hexToHsv('#ff000080') // { h: 0, s: 1, v: 1, a: 0.50196… }\n */\nexport function hexToHsv(hex: string): HsvColor | null {\n const bytes = parseHexBytes(hex);\n if (!bytes) return null;\n const { h, s, v } = rgbToHsv(bytes.r, bytes.g, bytes.b);\n return bytes.hasAlpha ? { h, s, v, a: bytes.alpha / 255 } : { h, s, v };\n}\n"],"mappings":";AASA,IAAMA,IAAY;AAiBlB,SAAgBC,EAAc,GAAgC;CAC5D,IAAMC,IAAQF,EAAU,KAAKG,EAAM,KAAK,CAAC;CACzC,IAAI,CAACD,GAAO,OAAO;CACnB,IAAME,IAASF,EAAM,IACfG,IACJD,EAAO,UAAU,IACbA,EACG,MAAM,EAAE,CAAC,CACT,KAAK,MAAME,IAAIA,CAAC,CAAC,CACjB,KAAK,EAAE,IACVF,GACAG,KAAQ,MAAkB,SAASF,EAAK,MAAMG,GAAOA,IAAQ,CAAC,GAAG,EAAE,GACnEC,IAAWJ,EAAK,WAAW;CACjC,OAAO;EAAE,GAAGE,EAAK,CAAC;EAAG,GAAGA,EAAK,CAAC;EAAG,GAAGA,EAAK,CAAC;EAAG,OAAOE,IAAWF,EAAK,CAAC,IAAI;EAAK;CAAS;AACzF;AAGA,SAAgBG,EAAQ,GAAmB;CACzC,OAAO,OAAO,SAASC,CAAC,KAAMA,IAAI,MAAO,OAAO,MAAM;AACxD;AAGA,SAAgBC,EAAU,GAA2B,GAA0B;CAE7E,OADIT,MAAU,KAAA,KAAa,OAAO,MAAMA,CAAK,IAAUU,IAChD,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGV,CAAK,CAAC;AACvC;AAGA,SAAgBW,EAAS,GAAsD;CAC7E,IAAMH,IAAID,EAAQK,EAAM,CAAC,IAAI,IACvBC,IAAIJ,EAAUG,EAAM,GAAG,CAAC,GACxBE,IAAIL,EAAUG,EAAM,GAAG,CAAC,GACxBG,IAAID,IAAID,GACRG,IAAID,KAAK,IAAI,KAAK,IAAKP,IAAI,IAAK,CAAC,IACjCS,IAAIH,IAAIC,GACVG;CAOJ,OANA,AAKKA,IALDV,IAAI,IAAS;EAACO;EAAGC;EAAG;CAAC,IAChBR,IAAI,IAAS;EAACQ;EAAGD;EAAG;CAAC,IACrBP,IAAI,IAAS;EAAC;EAAGO;EAAGC;CAAC,IACrBR,IAAI,IAAS;EAAC;EAAGQ;EAAGD;CAAC,IACrBP,IAAI,IAAS;EAACQ;EAAG;EAAGD;CAAC,IACnB;EAACA;EAAG;EAAGC;CAAC,GACZ;EAAE,IAAIE,EAAI,KAAKD,KAAK;EAAK,IAAIC,EAAI,KAAKD,KAAK;EAAK,IAAIC,EAAI,KAAKD,KAAK;CAAI;AAC/E;AAGA,SAAgBE,EAAS,GAAW,GAAW,GAAgD;CAC7F,IAAMC,IAAMC,IAAI,KACVC,IAAQC,IAAI,KACZC,IAAOC,IAAI,KACXC,IAAM,KAAK,IAAIN,GAAKE,GAAOE,CAAI,GAC/BG,IAAQD,IAAM,KAAK,IAAIN,GAAKE,GAAOE,CAAI,GACzChB,IAAI;CAQR,OAPImB,MAAU,MACZ,AAEKnB,IAFDkB,MAAQN,KAAWE,IAAQE,KAAQG,IAAS,IACvCD,MAAQJ,KAAYE,IAAOJ,KAAOO,IAAQ,KACzCP,IAAME,KAASK,IAAQ,GACjC,KAAK,IACDnB,IAAI,MAAG,KAAK,OAEX;EAAE;EAAG,GAAGkB,MAAQ,IAAI,IAAIC,IAAQD;EAAK,GAAGA;CAAI;AACrD;AAEA,SAASE,EAAU,GAAuB;CACxC,OAAO,KAAK,MAAM5B,CAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AACvD;AASA,SAAgB6B,EAAS,GAAyB;CAChD,IAAM,EAAE,MAAG,MAAG,SAAMlB,EAASC,CAAK,GAC5BkB,IAAQ,KAAK,MAAMrB,EAAUG,EAAM,GAAG,CAAC,IAAI,GAAG,GAC9CmB,IAAM,IAAIH,EAAUP,CAAC,IAAIO,EAAUL,CAAC,IAAIK,EAAUH,CAAC;CACzD,OAAOK,MAAU,MAAMC,IAAMA,IAAMH,EAAUE,CAAK;AACpD;AAUA,SAAgBE,EAAS,GAA8B;CACrD,IAAMC,IAAQnC,EAAciC,CAAG;CAC/B,IAAI,CAACE,GAAO,OAAO;CACnB,IAAM,EAAE,MAAG,MAAG,SAAMd,EAASc,EAAM,GAAGA,EAAM,GAAGA,EAAM,CAAC;CACtD,OAAOA,EAAM,WAAW;EAAE;EAAG;EAAG;EAAG,GAAGA,EAAM,QAAQ;CAAI,IAAI;EAAE;EAAG;EAAG;CAAE;AACxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"globalRegistry.cjs","names":["getGlobalRegistry","symbol","key","store","create"],"sources":["../../src/lib/globalRegistry.ts"],"sourcesContent":["const NAMESPACE = '@mortenbrudvik/waveui/';\n\ntype GlobalStore = Record<symbol, unknown>;\n\n/**\n * Returns the module singleton registered under `key`, creating it with `create` on first use.\n *\n * The value is stored on `globalThis[Symbol.for('@mortenbrudvik/waveui/' + key)]` (non-enumerable),\n * so an app that evaluates the library twice — the ESM and the CJS build side by side (Next.js\n * server CJS + client ESM, or a dependency that `require`s the package) — still shares one state\n * per key. A change to the value shape stored under a key must stay compatible with the other copy.\n *\n * Keys and their users:\n * - `'layers'` — the dismiss-layer stack (`layers.ts`);\n * - `'traps'` — the focus-trap stack (`useFocusTrap`);\n * - `'scrollLock'` — the scroll-lock counter (`useScrollLock`);\n * - `'inert'` — the elements made inert behind a modal (`useModalIsolation`);\n * - `'restoreFocusTracker'` — the pointer/focus tracker of `useRestoreFocus`;\n * - `'announcer'` — the live-region announcer (`useAnnounce`);\n * - `'orderedSurfaces'` — the open surfaces whose keyboard order `usePopoverTabOrder` manages\n * (`Popover.shared.tsx`);\n * - `'warnings'` and `'missing-context'` — the warn-once keys and the logged missing-context\n * texts (`dev.ts`).\n *\n * @param key Registry name, e.g. `'warnings'` or `'layers'`.\n * @param create Factory for the initial value; called at most once per realm.\n */\nexport function getGlobalRegistry<T>(key: string, create: () => T): T {\n const symbol = Symbol.for(NAMESPACE + key);\n const store = globalThis as unknown as GlobalStore;\n if (!Object.prototype.hasOwnProperty.call(store, symbol)) {\n Object.defineProperty(store, symbol, {\n value: create(),\n configurable: true,\n enumerable: false,\n writable: true,\n });\n }\n return store[symbol] as T;\n}\n"],"mappings":"AA2BA,SAAgBA,EAAqB,EAAa,EAAoB,CACpE,IAAMC,EAAS,OAAO,IAAI,yBAAYC,CAAG,EACnCC,EAAQ,WASd,OARK,OAAO,UAAU,eAAe,KAAKA,EAAOF,CAAM,GACrD,OAAO,eAAeE,EAAOF,EAAQ,CACnC,MAAOG,EAAO,EACd,aAAc,GACd,WAAY,GACZ,SAAU,EACZ,CAAC,EAEID,EAAMF,EACf"}
1
+ {"version":3,"file":"globalRegistry.cjs","names":["getGlobalRegistry","symbol","key","store","create"],"sources":["../../src/lib/globalRegistry.ts"],"sourcesContent":["const NAMESPACE = '@mortenbrudvik/waveui/';\n\ntype GlobalStore = Record<symbol, unknown>;\n\n/**\n * Returns the module singleton registered under `key`, creating it with `create` on first use.\n *\n * The value is stored on `globalThis[Symbol.for('@mortenbrudvik/waveui/' + key)]` (non-enumerable),\n * so an app that evaluates the library twice — the ESM and the CJS build side by side (Next.js\n * server CJS + client ESM, or a dependency that `require`s the package) — still shares one state\n * per key. A change to the value shape stored under a key must stay compatible with the other copy.\n *\n * Keys and their users:\n * - `'layers'` — the dismiss-layer stack (`layers.ts`);\n * - `'traps'` — the focus-trap stack (`useFocusTrap`);\n * - `'scrollLock'` — the scroll-lock counter (`useScrollLock`);\n * - `'inert'` — the elements made inert behind a modal (`useModalIsolation`);\n * - `'restoreFocusTracker'` — the pointer/focus tracker of `useRestoreFocus`;\n * - `'announcer'` — the live-region announcer (`useAnnounce`);\n * - `'orderedSurfaces'` — the open surfaces whose keyboard order `usePopoverTabOrder` manages\n * (`Popover.shared.tsx`);\n * - `'toasterHandles'` — the state of every `createToaster()` handle (`toaster.ts`);\n * - `'warnings'` and `'missing-context'` — the warn-once keys and the logged missing-context\n * texts (`dev.ts`).\n *\n * @param key Registry name, e.g. `'warnings'` or `'layers'`.\n * @param create Factory for the initial value; called at most once per realm.\n */\nexport function getGlobalRegistry<T>(key: string, create: () => T): T {\n const symbol = Symbol.for(NAMESPACE + key);\n const store = globalThis as unknown as GlobalStore;\n if (!Object.prototype.hasOwnProperty.call(store, symbol)) {\n Object.defineProperty(store, symbol, {\n value: create(),\n configurable: true,\n enumerable: false,\n writable: true,\n });\n }\n return store[symbol] as T;\n}\n"],"mappings":"AA4BA,SAAgBA,EAAqB,EAAa,EAAoB,CACpE,IAAMC,EAAS,OAAO,IAAI,yBAAYC,CAAG,EACnCC,EAAQ,WASd,OARK,OAAO,UAAU,eAAe,KAAKA,EAAOF,CAAM,GACrD,OAAO,eAAeE,EAAOF,EAAQ,CACnC,MAAOG,EAAO,EACd,aAAc,GACd,WAAY,GACZ,SAAU,EACZ,CAAC,EAEID,EAAMF,EACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"globalRegistry.mjs","names":["getGlobalRegistry","symbol","key","store","create"],"sources":["../../src/lib/globalRegistry.ts"],"sourcesContent":["const NAMESPACE = '@mortenbrudvik/waveui/';\n\ntype GlobalStore = Record<symbol, unknown>;\n\n/**\n * Returns the module singleton registered under `key`, creating it with `create` on first use.\n *\n * The value is stored on `globalThis[Symbol.for('@mortenbrudvik/waveui/' + key)]` (non-enumerable),\n * so an app that evaluates the library twice — the ESM and the CJS build side by side (Next.js\n * server CJS + client ESM, or a dependency that `require`s the package) — still shares one state\n * per key. A change to the value shape stored under a key must stay compatible with the other copy.\n *\n * Keys and their users:\n * - `'layers'` — the dismiss-layer stack (`layers.ts`);\n * - `'traps'` — the focus-trap stack (`useFocusTrap`);\n * - `'scrollLock'` — the scroll-lock counter (`useScrollLock`);\n * - `'inert'` — the elements made inert behind a modal (`useModalIsolation`);\n * - `'restoreFocusTracker'` — the pointer/focus tracker of `useRestoreFocus`;\n * - `'announcer'` — the live-region announcer (`useAnnounce`);\n * - `'orderedSurfaces'` — the open surfaces whose keyboard order `usePopoverTabOrder` manages\n * (`Popover.shared.tsx`);\n * - `'warnings'` and `'missing-context'` — the warn-once keys and the logged missing-context\n * texts (`dev.ts`).\n *\n * @param key Registry name, e.g. `'warnings'` or `'layers'`.\n * @param create Factory for the initial value; called at most once per realm.\n */\nexport function getGlobalRegistry<T>(key: string, create: () => T): T {\n const symbol = Symbol.for(NAMESPACE + key);\n const store = globalThis as unknown as GlobalStore;\n if (!Object.prototype.hasOwnProperty.call(store, symbol)) {\n Object.defineProperty(store, symbol, {\n value: create(),\n configurable: true,\n enumerable: false,\n writable: true,\n });\n }\n return store[symbol] as T;\n}\n"],"mappings":"AA2BA,SAAgBA,EAAqB,GAAa,GAAoB;CACpE,IAAMC,IAAS,OAAO,IAAI,2BAAYC,CAAG,GACnCC,IAAQ;CASd,OARK,OAAO,UAAU,eAAe,KAAKA,GAAOF,CAAM,KACrD,OAAO,eAAeE,GAAOF,GAAQ;EACnC,OAAOG,EAAO;EACd,cAAc;EACd,YAAY;EACZ,UAAU;CACZ,CAAC,GAEID,EAAMF;AACf"}
1
+ {"version":3,"file":"globalRegistry.mjs","names":["getGlobalRegistry","symbol","key","store","create"],"sources":["../../src/lib/globalRegistry.ts"],"sourcesContent":["const NAMESPACE = '@mortenbrudvik/waveui/';\n\ntype GlobalStore = Record<symbol, unknown>;\n\n/**\n * Returns the module singleton registered under `key`, creating it with `create` on first use.\n *\n * The value is stored on `globalThis[Symbol.for('@mortenbrudvik/waveui/' + key)]` (non-enumerable),\n * so an app that evaluates the library twice — the ESM and the CJS build side by side (Next.js\n * server CJS + client ESM, or a dependency that `require`s the package) — still shares one state\n * per key. A change to the value shape stored under a key must stay compatible with the other copy.\n *\n * Keys and their users:\n * - `'layers'` — the dismiss-layer stack (`layers.ts`);\n * - `'traps'` — the focus-trap stack (`useFocusTrap`);\n * - `'scrollLock'` — the scroll-lock counter (`useScrollLock`);\n * - `'inert'` — the elements made inert behind a modal (`useModalIsolation`);\n * - `'restoreFocusTracker'` — the pointer/focus tracker of `useRestoreFocus`;\n * - `'announcer'` — the live-region announcer (`useAnnounce`);\n * - `'orderedSurfaces'` — the open surfaces whose keyboard order `usePopoverTabOrder` manages\n * (`Popover.shared.tsx`);\n * - `'toasterHandles'` — the state of every `createToaster()` handle (`toaster.ts`);\n * - `'warnings'` and `'missing-context'` — the warn-once keys and the logged missing-context\n * texts (`dev.ts`).\n *\n * @param key Registry name, e.g. `'warnings'` or `'layers'`.\n * @param create Factory for the initial value; called at most once per realm.\n */\nexport function getGlobalRegistry<T>(key: string, create: () => T): T {\n const symbol = Symbol.for(NAMESPACE + key);\n const store = globalThis as unknown as GlobalStore;\n if (!Object.prototype.hasOwnProperty.call(store, symbol)) {\n Object.defineProperty(store, symbol, {\n value: create(),\n configurable: true,\n enumerable: false,\n writable: true,\n });\n }\n return store[symbol] as T;\n}\n"],"mappings":"AA4BA,SAAgBA,EAAqB,GAAa,GAAoB;CACpE,IAAMC,IAAS,OAAO,IAAI,2BAAYC,CAAG,GACnCC,IAAQ;CASd,OARK,OAAO,UAAU,eAAe,KAAKA,GAAOF,CAAM,KACrD,OAAO,eAAeE,GAAOF,GAAQ;EACnC,OAAOG,EAAO;EACd,cAAc;EACd,YAAY;EACZ,UAAU;CACZ,CAAC,GAEID,EAAMF;AACf"}
@@ -1,2 +1,2 @@
1
- var e=`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,t=`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,n=`h-8 w-full rounded border border-input bg-background px-3 text-body-1 text-foreground placeholder:text-muted-foreground`,r=`focus:outline-hidden focus:border-b-2 focus:border-b-primary`,i=`focus-within:border-b-2 focus-within:border-b-primary`,a=`border-destructive focus:border-b-destructive`,o=`border-destructive focus-within:border-b-destructive`,s=`disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100`,c=`transition motion-reduce:transition-none`,l=`forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none`,u={selectedLeaf:l,selectedContainer:`forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2`,control:`forced-colors:border-[ButtonText]`,border:`forced-colors:border-[CanvasText]`,fill:`forced-colors:bg-[Highlight] forced-colors:forced-color-adjust-none`,rangeInput:`forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]`,ringArc:`forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]`,disabled:`forced-colors:text-[GrayText] forced-colors:border-[GrayText]`,selected:l};exports.disabledStyles=s,exports.focusRing=e,exports.focusRingInset=t,exports.forcedColors=u,exports.inputBase=n,exports.inputFocus=r,exports.inputFocusWithin=i,exports.inputInvalid=a,exports.inputInvalidWithin=o,exports.motionSafeTransition=c;
1
+ var e=`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,t=`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,n={small:`h-6`,medium:`h-8`,large:`h-10`},r={small:`text-caption-1`,medium:`text-body-1`,large:`text-body-2`},i={small:`px-2`,medium:`px-3`,large:`px-4`},a={outline:`rounded border border-input border-b-stroke-accessible bg-background`,underline:`rounded-none border-0 border-b border-b-stroke-accessible bg-transparent forced-colors:border-[ButtonText]`,"filled-darker":`rounded border border-input-filled-stroke bg-input-filled-darker forced-colors:border-[ButtonText]`,"filled-lighter":`rounded border border-input-filled-stroke bg-input-filled-lighter forced-colors:border-[ButtonText]`},o=`before:absolute before:-inset-0.5`,s=`focus:outline-hidden focus:border-b-2 focus:border-b-primary`,c=`focus-within:border-b-2 focus-within:border-b-primary`,l=`border-destructive`,u=`border-destructive`,d=`disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100`,f=`transition motion-reduce:transition-none`,p=`forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none`,m={selectedLeaf:p,selectedContainer:`forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2`,control:`forced-colors:border-[ButtonText]`,border:`forced-colors:border-[CanvasText]`,fill:`forced-colors:bg-[Highlight] forced-colors:forced-color-adjust-none`,rangeInput:`forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]`,ringArc:`forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]`,disabled:`forced-colors:text-[GrayText] forced-colors:border-[GrayText]`,selected:p};exports.disabledStyles=d,exports.focusRing=e,exports.focusRingInset=t,exports.forcedColors=m,exports.hitAreaLayer=o,exports.inputAppearanceClasses=a,exports.inputFocus=s,exports.inputFocusWithin=c,exports.inputHeightClasses=n,exports.inputInvalid=l,exports.inputInvalidWithin=u,exports.inputPaddingClasses=i,exports.inputTextClasses=r,exports.motionSafeTransition=f;
2
2
  //# sourceMappingURL=styles.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.cjs","names":["focusRing","focusRingInset","inputBase","inputFocus","inputFocusWithin","inputInvalid","inputInvalidWithin","disabledStyles","motionSafeTransition","selectedLeaf","forcedColors"],"sources":["../../src/lib/styles.ts"],"sourcesContent":["/**\n * Shared class-string recipes. They are plain literals so Tailwind's scanner (`@source ../lib`)\n * generates every utility; compose them with `cn()` before the consumer's `className`.\n */\n\n/** Focus-visible ring for focusable controls (C-FOCUS). */\nexport const focusRing =\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring';\n\n/** Focus-visible ring drawn inside the element: cells, rows, list and menu items. */\nexport const focusRingInset =\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring';\n\n/** Ring on a container while any descendant has focus. */\nexport const focusWithinRing =\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring';\n\n/** Base look of text-entry controls (Input, Textarea, Select, picker inputs). */\nexport const inputBase =\n 'h-8 w-full rounded border border-input bg-background px-3 text-body-1 text-foreground placeholder:text-muted-foreground';\n\n/**\n * Focus indicator of text-entry controls: a 2px primary bottom border. `focus:outline-hidden`\n * removes the outline while focused but — unlike `outline-none` — keeps a visible outline in\n * forced-colors mode, where the border colour change is not perceivable. (Scoped to `:focus` so\n * unfocused inputs do not show that outline in forced colors.)\n */\nexport const inputFocus = 'focus:outline-hidden focus:border-b-2 focus:border-b-primary';\n\n/**\n * Wrapper form of {@link inputFocus} for inputs rendered inside a styled wrapper (slots,\n * SearchBox, TagPicker). Put `focus:outline-hidden` on the inner control.\n */\nexport const inputFocusWithin = 'focus-within:border-b-2 focus-within:border-b-primary';\n\n/**\n * Invalid look of a text-entry control (Input, Select, Textarea, SearchBox, SpinButton, Combobox,\n * Dropdown, the picker inputs): the destructive border, kept on the bottom stroke while focused.\n * Apply it when the control's resolved `aria-invalid` is `true` (its own error state, the\n * consumer's `aria-invalid` or the surrounding Field's), after {@link inputBase} and\n * {@link inputFocus} in `cn()` so it replaces their border colours.\n */\nexport const inputInvalid = 'border-destructive focus:border-b-destructive';\n\n/**\n * Wrapper form of {@link inputInvalid} for a control drawn by a styled wrapper around the\n * focusable input (Input with slots, SpinButton), placed after {@link inputFocusWithin}.\n */\nexport const inputInvalidWithin = 'border-destructive focus-within:border-b-destructive';\n\n/**\n * Disabled look for native `disabled` and `aria-disabled` (C-DISABLED) controls. An\n * `aria-disabled` control that keeps keyboard focus (a self-disabling Pagination or Carousel\n * button) goes back to full opacity while it shows its focus ring, which `opacity` would dim below\n * 3:1, as a `disabledFocusable` button does.\n */\nexport const disabledStyles =\n 'disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100';\n\n/** Colour-transition recipe that is switched off for reduced motion (C-MOTION). */\nexport const motionSafeTransition = 'transition motion-reduce:transition-none';\n\nconst selectedLeaf =\n 'forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none';\n\n/**\n * Forced-colors (Windows High Contrast) recipes, built from system colours.\n */\nexport const forcedColors = {\n /**\n * Selected/checked state of a **leaf indicator** — Switch thumb, check glyph, radio dot,\n * progress fill, selected day cell. Opts the element out of forced colours so the Highlight\n * fill shows. Never use it on containers: `forced-color-adjust` is inherited and would opt\n * every descendant (text, icons) of a row/option/card out of forced colours too.\n */\n selectedLeaf,\n /**\n * Selected state of a **container** — options, rows, cards, tabs. A Highlight outline as the\n * non-colour indicator; the browser keeps system colours for the content.\n */\n selectedContainer:\n 'forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2',\n /** Border of a control (Switch track, Checkbox box, Radio circle). */\n control: 'forced-colors:border-[ButtonText]',\n /** Border of a non-interactive surface (tracks, separators). */\n border: 'forced-colors:border-[CanvasText]',\n /**\n * Fill of a **leaf indicator drawn with its own background** that must stay visible in forced\n * colors, where author backgrounds become Canvas: a step dot or connector, a pager dot, a\n * progress segment. Paints `Highlight` and opts the element out of forced colors\n * (`forced-color-adjust` is inherited: leaf elements only, as with `selectedLeaf`).\n *\n * It only colors the element's own background, so it cannot reach an indicator drawn by a\n * pseudo-element or a border: use `rangeInput` for a native range input (Slider) and `ringArc`\n * for a border-drawn ring (Spinner).\n */\n fill: 'forced-colors:bg-[Highlight] forced-colors:forced-color-adjust-none',\n /**\n * A native `<input type=\"range\">` drawn through its track and thumb pseudo-elements (Slider):\n * put it on the input, after the normal-mode classes. It opts the input out of forced colors\n * and, because the pseudo-elements inherit that opt-out, gives every part the input paints a\n * system color: the rail `CanvasText`, the thumb `Highlight` with a `Canvas` edge, rail and\n * thumb `GrayText` while disabled, and the focus-visible outline `Highlight` (the opt-out would\n * otherwise keep the author ring color). Covers the Blink/WebKit (`::-webkit-slider-*`) and\n * Firefox (`::-moz-range-*`) parts.\n */\n rangeInput:\n 'forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]',\n /**\n * Arc of a **ring drawn with borders** whose top side is the arc (Spinner): put it on the ring,\n * after its border classes. Forced colors would give all four sides the same system color, so\n * the arc would disappear into the track. It opts the ring out of forced colors, hides the\n * track in `Canvas` and draws the arc in `Highlight`. Leaf elements only, as with `fill`.\n */\n ringArc:\n 'forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]',\n /** Disabled text and borders. */\n disabled: 'forced-colors:text-[GrayText] forced-colors:border-[GrayText]',\n /**\n * @deprecated Ambiguous: use `selectedLeaf` for leaf indicators or `selectedContainer` for\n * containers. Kept as an alias of `selectedLeaf`.\n */\n selected: selectedLeaf,\n} as const;\n"],"mappings":"AAMA,IAAaA,EACX,oFAGWC,EACX,qFAOWC,EACX,0HAQWC,EAAa,+DAMbC,EAAmB,wDASnBC,EAAe,gDAMfC,EAAqB,uDAQrBC,EACX,oJAGWC,EAAuB,2CAE9BC,EACJ,yGAKWC,EAAe,CAO1B,eAKA,kBACE,4FAEF,QAAS,oCAET,OAAQ,oCAWR,KAAM,sEAUN,WACE,iqBAOF,QACE,0GAEF,SAAU,gEAKV,SAAUD,CACZ"}
1
+ {"version":3,"file":"styles.cjs","names":["focusRing","focusRingInset","inputHeightClasses","inputTextClasses","inputPaddingClasses","inputAppearanceClasses","hitAreaLayer","inputFocus","inputFocusWithin","inputInvalid","inputInvalidWithin","disabledStyles","motionSafeTransition","selectedLeaf","forcedColors"],"sources":["../../src/lib/styles.ts"],"sourcesContent":["/**\n * Shared class-string recipes. They are plain literals so Tailwind's scanner (`@source ../lib`)\n * generates every utility; compose them with `cn()` before the consumer's `className`.\n */\nimport type { CoreSize, InputAppearance } from './types';\n\n/** Focus-visible ring for focusable controls (C-FOCUS). */\nexport const focusRing =\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring';\n\n/** Focus-visible ring drawn inside the element: cells, rows, list and menu items. */\nexport const focusRingInset =\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring';\n\n/** Ring on a container while any descendant has focus. */\nexport const focusWithinRing =\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring';\n\n/**\n * Base look of text-entry controls (Input, Textarea, Select, picker inputs).\n * @deprecated Compose inputHeightClasses, inputTextClasses, inputPaddingClasses and\n * inputAppearanceClasses.\n */\nexport const inputBase =\n 'h-8 w-full rounded border border-input bg-background px-3 text-body-1 text-foreground placeholder:text-muted-foreground';\n\n/** Height of a text control or picker per size: 24, 32 or 40px. */\nexport const inputHeightClasses: Readonly<Record<CoreSize, string>> = {\n small: 'h-6',\n medium: 'h-8',\n large: 'h-10',\n};\n\n/** Type ramp of a text control or picker per size. */\nexport const inputTextClasses: Readonly<Record<CoreSize, string>> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\n/** Horizontal padding of a text control drawn on its own element, per size: 8, 12 or 16px. */\nexport const inputPaddingClasses: Readonly<Record<CoreSize, string>> = {\n small: 'px-2',\n medium: 'px-3',\n large: 'px-4',\n};\n\n/**\n * Fill, strokes and corners of each appearance, for a field drawn on its own element or on a\n * wrapper. Compose the focus and invalid recipes after it: they recolor the borders the appearance\n * draws. The filled appearances have a transparent stroke (a visible one in the high-contrast\n * theme). In forced colors, the filled appearances and the one with only a bottom stroke draw their\n * border in the system's button text color, so every appearance keeps a visible boundary.\n */\nexport const inputAppearanceClasses: Readonly<Record<InputAppearance, string>> = {\n outline: 'rounded border border-input border-b-stroke-accessible bg-background',\n underline:\n 'rounded-none border-0 border-b border-b-stroke-accessible bg-transparent forced-colors:border-[ButtonText]',\n 'filled-darker':\n 'rounded border border-input-filled-stroke bg-input-filled-darker forced-colors:border-[ButtonText]',\n 'filled-lighter':\n 'rounded border border-input-filled-stroke bg-input-filled-lighter forced-colors:border-[ButtonText]',\n};\n\n/**\n * Extends a 20px control's pointer target to 24px (WCAG 2.5.8): a transparent layer 2px beyond\n * each edge. The element must be positioned: the picker buttons already are, and any other element\n * sets its own position (the recipe sets none, because cn() would then replace the position of a\n * picker button).\n */\nexport const hitAreaLayer = 'before:absolute before:-inset-0.5';\n\n/**\n * Focus indicator of text-entry controls: a 2px primary bottom border. `focus:outline-hidden`\n * removes the outline while focused but — unlike `outline-none` — keeps a visible outline in\n * forced-colors mode, where the border colour change is not perceivable. (Scoped to `:focus` so\n * unfocused inputs do not show that outline in forced colors.)\n */\nexport const inputFocus = 'focus:outline-hidden focus:border-b-2 focus:border-b-primary';\n\n/**\n * Wrapper form of {@link inputFocus} for inputs rendered inside a styled wrapper (slots,\n * SearchBox, TagPicker). Put `focus:outline-hidden` on the inner control.\n */\nexport const inputFocusWithin = 'focus-within:border-b-2 focus-within:border-b-primary';\n\n/**\n * Invalid look of a text-entry control (Input, Select, Textarea, SearchBox, SpinButton, Combobox,\n * Dropdown, the picker inputs), for every appearance: the destructive color on every border the\n * appearance draws. Apply it when the control's resolved `aria-invalid` is `true`, after the\n * appearance and {@link inputFocus} in `cn()`: while the control is focused, the focus recipe\n * colors the 2px bottom border and the other borders stay destructive.\n */\nexport const inputInvalid = 'border-destructive';\n\n/**\n * Wrapper form of {@link inputInvalid} for a control drawn by a styled wrapper around the\n * focusable input (Input with slots, SearchBox, SpinButton, TagPicker), placed after\n * {@link inputFocusWithin}.\n */\nexport const inputInvalidWithin = 'border-destructive';\n\n/**\n * Disabled look for native `disabled` and `aria-disabled` (C-DISABLED) controls. An\n * `aria-disabled` control that keeps keyboard focus (a self-disabling Pagination or Carousel\n * button) goes back to full opacity while it shows its focus ring, which `opacity` would dim below\n * 3:1, as a `disabledFocusable` button does.\n */\nexport const disabledStyles =\n 'disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100';\n\n/** Colour-transition recipe that is switched off for reduced motion (C-MOTION). */\nexport const motionSafeTransition = 'transition motion-reduce:transition-none';\n\nconst selectedLeaf =\n 'forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none';\n\n/**\n * Forced-colors (Windows High Contrast) recipes, built from system colours.\n */\nexport const forcedColors = {\n /**\n * Selected/checked state of a **leaf indicator** — Switch thumb, check glyph, radio dot,\n * progress fill, selected day cell. Opts the element out of forced colours so the Highlight\n * fill shows. Never use it on containers: `forced-color-adjust` is inherited and would opt\n * every descendant (text, icons) of a row/option/card out of forced colours too.\n */\n selectedLeaf,\n /**\n * Selected state of a **container** — options, rows, cards, tabs. A Highlight outline as the\n * non-colour indicator; the browser keeps system colours for the content.\n */\n selectedContainer:\n 'forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2',\n /** Border of a control (Switch track, Checkbox box, Radio circle). */\n control: 'forced-colors:border-[ButtonText]',\n /** Border of a non-interactive surface (tracks, separators). */\n border: 'forced-colors:border-[CanvasText]',\n /**\n * Fill of a **leaf indicator drawn with its own background** that must stay visible in forced\n * colors, where author backgrounds become Canvas: a step dot or connector, a pager dot, a\n * progress segment. Paints `Highlight` and opts the element out of forced colors\n * (`forced-color-adjust` is inherited: leaf elements only, as with `selectedLeaf`).\n *\n * It only colors the element's own background, so it cannot reach an indicator drawn by a\n * pseudo-element or a border: use `rangeInput` for a native range input (Slider) and `ringArc`\n * for a border-drawn ring (Spinner).\n */\n fill: 'forced-colors:bg-[Highlight] forced-colors:forced-color-adjust-none',\n /**\n * A native `<input type=\"range\">` drawn through its track and thumb pseudo-elements (Slider):\n * put it on the input, after the normal-mode classes. It opts the input out of forced colors\n * and, because the pseudo-elements inherit that opt-out, gives every part the input paints a\n * system color: the rail `CanvasText`, the thumb `Highlight` with a `Canvas` edge, rail and\n * thumb `GrayText` while disabled, and the focus-visible outline `Highlight` (the opt-out would\n * otherwise keep the author ring color). Covers the Blink/WebKit (`::-webkit-slider-*`) and\n * Firefox (`::-moz-range-*`) parts.\n */\n rangeInput:\n 'forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]',\n /**\n * Arc of a **ring drawn with borders** whose top side is the arc (Spinner): put it on the ring,\n * after its border classes. Forced colors would give all four sides the same system color, so\n * the arc would disappear into the track. It opts the ring out of forced colors, hides the\n * track in `Canvas` and draws the arc in `Highlight`. Leaf elements only, as with `fill`.\n */\n ringArc:\n 'forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]',\n /** Disabled text and borders. */\n disabled: 'forced-colors:text-[GrayText] forced-colors:border-[GrayText]',\n /**\n * @deprecated Ambiguous: use `selectedLeaf` for leaf indicators or `selectedContainer` for\n * containers. Kept as an alias of `selectedLeaf`.\n */\n selected: selectedLeaf,\n} as const;\n"],"mappings":"AAOA,IAAaA,EACX,oFAGWC,EACX,qFAeWC,EAAyD,CACpE,MAAO,MACP,OAAQ,MACR,MAAO,MACT,EAGaC,EAAuD,CAClE,MAAO,iBACP,OAAQ,cACR,MAAO,aACT,EAGaC,EAA0D,CACrE,MAAO,OACP,OAAQ,OACR,MAAO,MACT,EASaC,EAAoE,CAC/E,QAAS,uEACT,UACE,6GACF,gBACE,qGACF,iBACE,qGACJ,EAQaC,EAAe,oCAQfC,EAAa,+DAMbC,EAAmB,wDASnBC,EAAe,qBAOfC,EAAqB,qBAQrBC,EACX,oJAGWC,EAAuB,2CAE9BC,EACJ,yGAKWC,EAAe,CAO1B,eAKA,kBACE,4FAEF,QAAS,oCAET,OAAQ,oCAWR,KAAM,sEAUN,WACE,iqBAOF,QACE,0GAEF,SAAU,gEAKV,SAAUD,CACZ"}
@@ -1,6 +1,23 @@
1
1
  //#region src/lib/styles.ts
2
- var e = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", t = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring", n = "h-8 w-full rounded border border-input bg-background px-3 text-body-1 text-foreground placeholder:text-muted-foreground", r = "focus:outline-hidden focus:border-b-2 focus:border-b-primary", i = "focus-within:border-b-2 focus-within:border-b-primary", a = "border-destructive focus:border-b-destructive", o = "border-destructive focus-within:border-b-destructive", s = "disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100", c = "transition motion-reduce:transition-none", l = "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none", u = {
3
- selectedLeaf: l,
2
+ var e = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", t = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring", n = {
3
+ small: "h-6",
4
+ medium: "h-8",
5
+ large: "h-10"
6
+ }, r = {
7
+ small: "text-caption-1",
8
+ medium: "text-body-1",
9
+ large: "text-body-2"
10
+ }, i = {
11
+ small: "px-2",
12
+ medium: "px-3",
13
+ large: "px-4"
14
+ }, a = {
15
+ outline: "rounded border border-input border-b-stroke-accessible bg-background",
16
+ underline: "rounded-none border-0 border-b border-b-stroke-accessible bg-transparent forced-colors:border-[ButtonText]",
17
+ "filled-darker": "rounded border border-input-filled-stroke bg-input-filled-darker forced-colors:border-[ButtonText]",
18
+ "filled-lighter": "rounded border border-input-filled-stroke bg-input-filled-lighter forced-colors:border-[ButtonText]"
19
+ }, o = "before:absolute before:-inset-0.5", s = "focus:outline-hidden focus:border-b-2 focus:border-b-primary", c = "focus-within:border-b-2 focus-within:border-b-primary", l = "border-destructive", u = "border-destructive", d = "disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100", f = "transition motion-reduce:transition-none", p = "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none", m = {
20
+ selectedLeaf: p,
4
21
  selectedContainer: "forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2",
5
22
  control: "forced-colors:border-[ButtonText]",
6
23
  border: "forced-colors:border-[CanvasText]",
@@ -8,9 +25,9 @@ var e = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:ou
8
25
  rangeInput: "forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]",
9
26
  ringArc: "forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]",
10
27
  disabled: "forced-colors:text-[GrayText] forced-colors:border-[GrayText]",
11
- selected: l
28
+ selected: p
12
29
  };
13
30
  //#endregion
14
- export { s as disabledStyles, e as focusRing, t as focusRingInset, u as forcedColors, n as inputBase, r as inputFocus, i as inputFocusWithin, a as inputInvalid, o as inputInvalidWithin, c as motionSafeTransition };
31
+ export { d as disabledStyles, e as focusRing, t as focusRingInset, m as forcedColors, o as hitAreaLayer, a as inputAppearanceClasses, s as inputFocus, c as inputFocusWithin, n as inputHeightClasses, l as inputInvalid, u as inputInvalidWithin, i as inputPaddingClasses, r as inputTextClasses, f as motionSafeTransition };
15
32
 
16
33
  //# sourceMappingURL=styles.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.mjs","names":["focusRing","focusRingInset","inputBase","inputFocus","inputFocusWithin","inputInvalid","inputInvalidWithin","disabledStyles","motionSafeTransition","selectedLeaf","forcedColors"],"sources":["../../src/lib/styles.ts"],"sourcesContent":["/**\n * Shared class-string recipes. They are plain literals so Tailwind's scanner (`@source ../lib`)\n * generates every utility; compose them with `cn()` before the consumer's `className`.\n */\n\n/** Focus-visible ring for focusable controls (C-FOCUS). */\nexport const focusRing =\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring';\n\n/** Focus-visible ring drawn inside the element: cells, rows, list and menu items. */\nexport const focusRingInset =\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring';\n\n/** Ring on a container while any descendant has focus. */\nexport const focusWithinRing =\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring';\n\n/** Base look of text-entry controls (Input, Textarea, Select, picker inputs). */\nexport const inputBase =\n 'h-8 w-full rounded border border-input bg-background px-3 text-body-1 text-foreground placeholder:text-muted-foreground';\n\n/**\n * Focus indicator of text-entry controls: a 2px primary bottom border. `focus:outline-hidden`\n * removes the outline while focused but — unlike `outline-none` — keeps a visible outline in\n * forced-colors mode, where the border colour change is not perceivable. (Scoped to `:focus` so\n * unfocused inputs do not show that outline in forced colors.)\n */\nexport const inputFocus = 'focus:outline-hidden focus:border-b-2 focus:border-b-primary';\n\n/**\n * Wrapper form of {@link inputFocus} for inputs rendered inside a styled wrapper (slots,\n * SearchBox, TagPicker). Put `focus:outline-hidden` on the inner control.\n */\nexport const inputFocusWithin = 'focus-within:border-b-2 focus-within:border-b-primary';\n\n/**\n * Invalid look of a text-entry control (Input, Select, Textarea, SearchBox, SpinButton, Combobox,\n * Dropdown, the picker inputs): the destructive border, kept on the bottom stroke while focused.\n * Apply it when the control's resolved `aria-invalid` is `true` (its own error state, the\n * consumer's `aria-invalid` or the surrounding Field's), after {@link inputBase} and\n * {@link inputFocus} in `cn()` so it replaces their border colours.\n */\nexport const inputInvalid = 'border-destructive focus:border-b-destructive';\n\n/**\n * Wrapper form of {@link inputInvalid} for a control drawn by a styled wrapper around the\n * focusable input (Input with slots, SpinButton), placed after {@link inputFocusWithin}.\n */\nexport const inputInvalidWithin = 'border-destructive focus-within:border-b-destructive';\n\n/**\n * Disabled look for native `disabled` and `aria-disabled` (C-DISABLED) controls. An\n * `aria-disabled` control that keeps keyboard focus (a self-disabling Pagination or Carousel\n * button) goes back to full opacity while it shows its focus ring, which `opacity` would dim below\n * 3:1, as a `disabledFocusable` button does.\n */\nexport const disabledStyles =\n 'disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100';\n\n/** Colour-transition recipe that is switched off for reduced motion (C-MOTION). */\nexport const motionSafeTransition = 'transition motion-reduce:transition-none';\n\nconst selectedLeaf =\n 'forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none';\n\n/**\n * Forced-colors (Windows High Contrast) recipes, built from system colours.\n */\nexport const forcedColors = {\n /**\n * Selected/checked state of a **leaf indicator** — Switch thumb, check glyph, radio dot,\n * progress fill, selected day cell. Opts the element out of forced colours so the Highlight\n * fill shows. Never use it on containers: `forced-color-adjust` is inherited and would opt\n * every descendant (text, icons) of a row/option/card out of forced colours too.\n */\n selectedLeaf,\n /**\n * Selected state of a **container** — options, rows, cards, tabs. A Highlight outline as the\n * non-colour indicator; the browser keeps system colours for the content.\n */\n selectedContainer:\n 'forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2',\n /** Border of a control (Switch track, Checkbox box, Radio circle). */\n control: 'forced-colors:border-[ButtonText]',\n /** Border of a non-interactive surface (tracks, separators). */\n border: 'forced-colors:border-[CanvasText]',\n /**\n * Fill of a **leaf indicator drawn with its own background** that must stay visible in forced\n * colors, where author backgrounds become Canvas: a step dot or connector, a pager dot, a\n * progress segment. Paints `Highlight` and opts the element out of forced colors\n * (`forced-color-adjust` is inherited: leaf elements only, as with `selectedLeaf`).\n *\n * It only colors the element's own background, so it cannot reach an indicator drawn by a\n * pseudo-element or a border: use `rangeInput` for a native range input (Slider) and `ringArc`\n * for a border-drawn ring (Spinner).\n */\n fill: 'forced-colors:bg-[Highlight] forced-colors:forced-color-adjust-none',\n /**\n * A native `<input type=\"range\">` drawn through its track and thumb pseudo-elements (Slider):\n * put it on the input, after the normal-mode classes. It opts the input out of forced colors\n * and, because the pseudo-elements inherit that opt-out, gives every part the input paints a\n * system color: the rail `CanvasText`, the thumb `Highlight` with a `Canvas` edge, rail and\n * thumb `GrayText` while disabled, and the focus-visible outline `Highlight` (the opt-out would\n * otherwise keep the author ring color). Covers the Blink/WebKit (`::-webkit-slider-*`) and\n * Firefox (`::-moz-range-*`) parts.\n */\n rangeInput:\n 'forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]',\n /**\n * Arc of a **ring drawn with borders** whose top side is the arc (Spinner): put it on the ring,\n * after its border classes. Forced colors would give all four sides the same system color, so\n * the arc would disappear into the track. It opts the ring out of forced colors, hides the\n * track in `Canvas` and draws the arc in `Highlight`. Leaf elements only, as with `fill`.\n */\n ringArc:\n 'forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]',\n /** Disabled text and borders. */\n disabled: 'forced-colors:text-[GrayText] forced-colors:border-[GrayText]',\n /**\n * @deprecated Ambiguous: use `selectedLeaf` for leaf indicators or `selectedContainer` for\n * containers. Kept as an alias of `selectedLeaf`.\n */\n selected: selectedLeaf,\n} as const;\n"],"mappings":";AAMA,IAAaA,IACX,qFAGWC,IACX,sFAOWC,IACX,2HAQWC,IAAa,gEAMbC,IAAmB,yDASnBC,IAAe,iDAMfC,IAAqB,wDAQrBC,IACX,qJAGWC,IAAuB,4CAE9BC,IACJ,0GAKWC,IAAe;CAO1B;CAKA,mBACE;CAEF,SAAS;CAET,QAAQ;CAWR,MAAM;CAUN,YACE;CAOF,SACE;CAEF,UAAU;CAKV,UAAUD;AACZ"}
1
+ {"version":3,"file":"styles.mjs","names":["focusRing","focusRingInset","inputHeightClasses","inputTextClasses","inputPaddingClasses","inputAppearanceClasses","hitAreaLayer","inputFocus","inputFocusWithin","inputInvalid","inputInvalidWithin","disabledStyles","motionSafeTransition","selectedLeaf","forcedColors"],"sources":["../../src/lib/styles.ts"],"sourcesContent":["/**\n * Shared class-string recipes. They are plain literals so Tailwind's scanner (`@source ../lib`)\n * generates every utility; compose them with `cn()` before the consumer's `className`.\n */\nimport type { CoreSize, InputAppearance } from './types';\n\n/** Focus-visible ring for focusable controls (C-FOCUS). */\nexport const focusRing =\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring';\n\n/** Focus-visible ring drawn inside the element: cells, rows, list and menu items. */\nexport const focusRingInset =\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring';\n\n/** Ring on a container while any descendant has focus. */\nexport const focusWithinRing =\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring';\n\n/**\n * Base look of text-entry controls (Input, Textarea, Select, picker inputs).\n * @deprecated Compose inputHeightClasses, inputTextClasses, inputPaddingClasses and\n * inputAppearanceClasses.\n */\nexport const inputBase =\n 'h-8 w-full rounded border border-input bg-background px-3 text-body-1 text-foreground placeholder:text-muted-foreground';\n\n/** Height of a text control or picker per size: 24, 32 or 40px. */\nexport const inputHeightClasses: Readonly<Record<CoreSize, string>> = {\n small: 'h-6',\n medium: 'h-8',\n large: 'h-10',\n};\n\n/** Type ramp of a text control or picker per size. */\nexport const inputTextClasses: Readonly<Record<CoreSize, string>> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\n/** Horizontal padding of a text control drawn on its own element, per size: 8, 12 or 16px. */\nexport const inputPaddingClasses: Readonly<Record<CoreSize, string>> = {\n small: 'px-2',\n medium: 'px-3',\n large: 'px-4',\n};\n\n/**\n * Fill, strokes and corners of each appearance, for a field drawn on its own element or on a\n * wrapper. Compose the focus and invalid recipes after it: they recolor the borders the appearance\n * draws. The filled appearances have a transparent stroke (a visible one in the high-contrast\n * theme). In forced colors, the filled appearances and the one with only a bottom stroke draw their\n * border in the system's button text color, so every appearance keeps a visible boundary.\n */\nexport const inputAppearanceClasses: Readonly<Record<InputAppearance, string>> = {\n outline: 'rounded border border-input border-b-stroke-accessible bg-background',\n underline:\n 'rounded-none border-0 border-b border-b-stroke-accessible bg-transparent forced-colors:border-[ButtonText]',\n 'filled-darker':\n 'rounded border border-input-filled-stroke bg-input-filled-darker forced-colors:border-[ButtonText]',\n 'filled-lighter':\n 'rounded border border-input-filled-stroke bg-input-filled-lighter forced-colors:border-[ButtonText]',\n};\n\n/**\n * Extends a 20px control's pointer target to 24px (WCAG 2.5.8): a transparent layer 2px beyond\n * each edge. The element must be positioned: the picker buttons already are, and any other element\n * sets its own position (the recipe sets none, because cn() would then replace the position of a\n * picker button).\n */\nexport const hitAreaLayer = 'before:absolute before:-inset-0.5';\n\n/**\n * Focus indicator of text-entry controls: a 2px primary bottom border. `focus:outline-hidden`\n * removes the outline while focused but — unlike `outline-none` — keeps a visible outline in\n * forced-colors mode, where the border colour change is not perceivable. (Scoped to `:focus` so\n * unfocused inputs do not show that outline in forced colors.)\n */\nexport const inputFocus = 'focus:outline-hidden focus:border-b-2 focus:border-b-primary';\n\n/**\n * Wrapper form of {@link inputFocus} for inputs rendered inside a styled wrapper (slots,\n * SearchBox, TagPicker). Put `focus:outline-hidden` on the inner control.\n */\nexport const inputFocusWithin = 'focus-within:border-b-2 focus-within:border-b-primary';\n\n/**\n * Invalid look of a text-entry control (Input, Select, Textarea, SearchBox, SpinButton, Combobox,\n * Dropdown, the picker inputs), for every appearance: the destructive color on every border the\n * appearance draws. Apply it when the control's resolved `aria-invalid` is `true`, after the\n * appearance and {@link inputFocus} in `cn()`: while the control is focused, the focus recipe\n * colors the 2px bottom border and the other borders stay destructive.\n */\nexport const inputInvalid = 'border-destructive';\n\n/**\n * Wrapper form of {@link inputInvalid} for a control drawn by a styled wrapper around the\n * focusable input (Input with slots, SearchBox, SpinButton, TagPicker), placed after\n * {@link inputFocusWithin}.\n */\nexport const inputInvalidWithin = 'border-destructive';\n\n/**\n * Disabled look for native `disabled` and `aria-disabled` (C-DISABLED) controls. An\n * `aria-disabled` control that keeps keyboard focus (a self-disabling Pagination or Carousel\n * button) goes back to full opacity while it shows its focus ring, which `opacity` would dim below\n * 3:1, as a `disabledFocusable` button does.\n */\nexport const disabledStyles =\n 'disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100';\n\n/** Colour-transition recipe that is switched off for reduced motion (C-MOTION). */\nexport const motionSafeTransition = 'transition motion-reduce:transition-none';\n\nconst selectedLeaf =\n 'forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none';\n\n/**\n * Forced-colors (Windows High Contrast) recipes, built from system colours.\n */\nexport const forcedColors = {\n /**\n * Selected/checked state of a **leaf indicator** — Switch thumb, check glyph, radio dot,\n * progress fill, selected day cell. Opts the element out of forced colours so the Highlight\n * fill shows. Never use it on containers: `forced-color-adjust` is inherited and would opt\n * every descendant (text, icons) of a row/option/card out of forced colours too.\n */\n selectedLeaf,\n /**\n * Selected state of a **container** — options, rows, cards, tabs. A Highlight outline as the\n * non-colour indicator; the browser keeps system colours for the content.\n */\n selectedContainer:\n 'forced-colors:outline-2 forced-colors:outline-[Highlight] forced-colors:-outline-offset-2',\n /** Border of a control (Switch track, Checkbox box, Radio circle). */\n control: 'forced-colors:border-[ButtonText]',\n /** Border of a non-interactive surface (tracks, separators). */\n border: 'forced-colors:border-[CanvasText]',\n /**\n * Fill of a **leaf indicator drawn with its own background** that must stay visible in forced\n * colors, where author backgrounds become Canvas: a step dot or connector, a pager dot, a\n * progress segment. Paints `Highlight` and opts the element out of forced colors\n * (`forced-color-adjust` is inherited: leaf elements only, as with `selectedLeaf`).\n *\n * It only colors the element's own background, so it cannot reach an indicator drawn by a\n * pseudo-element or a border: use `rangeInput` for a native range input (Slider) and `ringArc`\n * for a border-drawn ring (Spinner).\n */\n fill: 'forced-colors:bg-[Highlight] forced-colors:forced-color-adjust-none',\n /**\n * A native `<input type=\"range\">` drawn through its track and thumb pseudo-elements (Slider):\n * put it on the input, after the normal-mode classes. It opts the input out of forced colors\n * and, because the pseudo-elements inherit that opt-out, gives every part the input paints a\n * system color: the rail `CanvasText`, the thumb `Highlight` with a `Canvas` edge, rail and\n * thumb `GrayText` while disabled, and the focus-visible outline `Highlight` (the opt-out would\n * otherwise keep the author ring color). Covers the Blink/WebKit (`::-webkit-slider-*`) and\n * Firefox (`::-moz-range-*`) parts.\n */\n rangeInput:\n 'forced-colors:forced-color-adjust-none forced-colors:[&::-webkit-slider-runnable-track]:bg-[CanvasText] forced-colors:[&::-moz-range-track]:bg-[CanvasText] forced-colors:[&::-webkit-slider-thumb]:bg-[Highlight] forced-colors:[&::-webkit-slider-thumb]:border-[Canvas] forced-colors:[&::-moz-range-thumb]:bg-[Highlight] forced-colors:[&::-moz-range-thumb]:border-[Canvas] forced-colors:disabled:[&::-webkit-slider-runnable-track]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-track]:bg-[GrayText] forced-colors:disabled:[&::-webkit-slider-thumb]:bg-[GrayText] forced-colors:disabled:[&::-moz-range-thumb]:bg-[GrayText] forced-colors:focus-visible:outline-[Highlight]',\n /**\n * Arc of a **ring drawn with borders** whose top side is the arc (Spinner): put it on the ring,\n * after its border classes. Forced colors would give all four sides the same system color, so\n * the arc would disappear into the track. It opts the ring out of forced colors, hides the\n * track in `Canvas` and draws the arc in `Highlight`. Leaf elements only, as with `fill`.\n */\n ringArc:\n 'forced-colors:forced-color-adjust-none forced-colors:border-[Canvas] forced-colors:border-t-[Highlight]',\n /** Disabled text and borders. */\n disabled: 'forced-colors:text-[GrayText] forced-colors:border-[GrayText]',\n /**\n * @deprecated Ambiguous: use `selectedLeaf` for leaf indicators or `selectedContainer` for\n * containers. Kept as an alias of `selectedLeaf`.\n */\n selected: selectedLeaf,\n} as const;\n"],"mappings":";AAOA,IAAaA,IACX,qFAGWC,IACX,sFAeWC,IAAyD;CACpE,OAAO;CACP,QAAQ;CACR,OAAO;AACT,GAGaC,IAAuD;CAClE,OAAO;CACP,QAAQ;CACR,OAAO;AACT,GAGaC,IAA0D;CACrE,OAAO;CACP,QAAQ;CACR,OAAO;AACT,GASaC,IAAoE;CAC/E,SAAS;CACT,WACE;CACF,iBACE;CACF,kBACE;AACJ,GAQaC,IAAe,qCAQfC,IAAa,gEAMbC,IAAmB,yDASnBC,IAAe,sBAOfC,IAAqB,sBAQrBC,IACX,qJAGWC,IAAuB,4CAE9BC,IACJ,0GAKWC,IAAe;CAO1B;CAKA,mBACE;CAEF,SAAS;CAET,QAAQ;CAWR,MAAM;CAUN,YACE;CAOF,SACE;CAEF,UAAU;CAKV,UAAUD;AACZ"}
@@ -0,0 +1,2 @@
1
+ const e=require("./globalRegistry.cjs");function t(e){if(typeof e!=`object`||!e||`$$typeof`in e||Symbol.iterator in e||typeof e.then==`function`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}var n=e.getGlobalRegistry(`toasterHandles`,()=>({states:new WeakMap,count:0}));function r(){n.count+=1;let e=`wave-toaster-h${n.count}`,r=0,i={controller:null,owner:null,queue:[]},a=()=>(r+=1,`${e}-${r}`),o=(e,t)=>{if(typeof window>`u`)return e;if(i.controller)return t(i.controller),e;let n=i.queue.findIndex(t=>t.id===e);return n===-1?i.queue.push({id:e,run:t}):i.queue[n]={id:e,run:t},e};function s(e,n){if(t(e)){let t=e.toastId??a(),n={...e,toastId:t};return o(t,e=>{e.dispatchToast(n)})}let r=n?.toastId??a(),i={...n,toastId:r};return o(r,t=>{t.dispatchToast(e,i)})}let c={dispatchToast:s,dismissToast(e){i.controller?i.controller.dismissToast(e):i.queue=i.queue.filter(t=>t.id!==e)},dismissAllToasts(){i.controller?i.controller.dismissAllToasts():i.queue=[]}};return n.states.set(c,i),c}function i(e,t,r){let i=n.states.get(e);if(!i)return{status:`unknown`};if(i.owner!==null&&i.owner!==t)return{status:`taken`};i.owner=t,i.controller=r;let a=i.queue;i.queue=[];for(let e of a)e.run(r);return{status:`bound`,unbind:()=>{i.owner===t&&(i.owner=null,i.controller=null)}}}exports.bindToasterHandle=i,exports.createToaster=r,exports.isToastOptions=t;
2
+ //# sourceMappingURL=toaster.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toaster.cjs","names":["getGlobalRegistry","require_globalRegistry","isToastOptions","value","proto","handleRegistry","createToaster","prefix","dispatchCount","state","nextId","send","id","run","index","call","dispatchToast","first","options","controller","second","handle","bindToasterHandle","owner","queued"],"sources":["../../src/lib/toaster.ts"],"sourcesContent":["/**\n * The toaster module (P3-01, P3-08): the options recogniser and the toaster handle. Server-safe:\n * it imports only types (and the dependency-free global registry) and touches no DOM, so a Server\n * Component may import it.\n */\nimport type * as React from 'react';\nimport { getGlobalRegistry } from './globalRegistry';\nimport type {\n ToastController,\n ToastDispatchOptions,\n ToastOptions,\n} from '../components/feedback/Toaster';\n\n/**\n * Whether a `dispatchToast` argument is the options form (0.5): a plain object (prototype\n * `Object.prototype` or `null`, from any realm) that is no React node — no `$$typeof`, not\n * iterable, not a thenable (the slot-object rule of `src/lib/slot.ts`). Anything else is content:\n * an element, a portal, a string, a number, an array or another iterable, a thenable, `null`.\n */\nexport function isToastOptions(value: unknown): value is ToastOptions {\n if (typeof value !== 'object' || value === null) return false;\n if ('$$typeof' in value || Symbol.iterator in value) return false;\n if (typeof (value as { then?: unknown }).then === 'function') return false;\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;\n}\n\n/**\n * A toast controller that code outside React components can call (a query-cache callback, a\n * server-event handler, a shared helper). Bind it to one Toaster with `<Toaster toaster={handle}>`;\n * toasts dispatched through it render there. One handle per Toaster is also how an app runs\n * several Toasters (Fluent's `toasterId`).\n */\nexport type ToasterHandle = ToastController;\n\n/** A dispatch waiting for a Toaster to bind the handle. */\ninterface QueuedDispatch {\n id: string;\n run: (controller: ToastController) => void;\n}\n\n/** The internal state of a handle, never reachable from the handle itself. */\ninterface HandleState {\n controller: ToastController | null;\n /** The Toaster the handle is bound to (an identity token), or `null`. */\n owner: object | null;\n queue: QueuedDispatch[];\n}\n\n/** Shared by the ESM and CJS copies of the library, so either copy's Toaster binds either's handle. */\nconst handleRegistry = getGlobalRegistry('toasterHandles', () => ({\n states: new WeakMap<object, HandleState>(),\n count: 0,\n}));\n\n/**\n * Creates a handle. It touches no DOM, so a module-scope handle is safe during server rendering;\n * a dispatch on the server does nothing (it returns the id), so no toast is carried from one\n * request to the next.\n *\n * - `dispatchToast` returns the id at once: `toastId`, or one the handle generates.\n * - Before a Toaster binds the handle, dispatches wait in its queue, in dispatch order (a dispatch\n * with the id of a waiting one replaces it in place); `dismissToast` removes a waiting toast and\n * `dismissAllToasts` empties the queue. The Toaster that binds takes the queue.\n *\n * @example\n * export const appToaster = createToaster();\n * // <Toaster toaster={appToaster}><App /></Toaster>\n * queryClient.getMutationCache().config.onError = () => {\n * appToaster.dispatchToast({ status: 'error', title: 'Could not save' });\n * };\n */\nexport function createToaster(): ToasterHandle {\n handleRegistry.count += 1;\n const prefix = `wave-toaster-h${handleRegistry.count}`;\n let dispatchCount = 0;\n const state: HandleState = { controller: null, owner: null, queue: [] };\n const nextId = () => {\n dispatchCount += 1;\n return `${prefix}-${dispatchCount}`;\n };\n const send = (id: string, run: (controller: ToastController) => void): string => {\n if (typeof window === 'undefined') return id;\n if (state.controller) {\n run(state.controller);\n return id;\n }\n const index = state.queue.findIndex((call) => call.id === id);\n if (index === -1) state.queue.push({ id, run });\n else state.queue[index] = { id, run };\n return id;\n };\n\n function dispatchToast(content: React.ReactNode, options?: ToastDispatchOptions): string;\n function dispatchToast(options: ToastOptions): string;\n function dispatchToast(\n first: React.ReactNode | ToastOptions,\n second?: ToastDispatchOptions,\n ): string {\n if (isToastOptions(first)) {\n const id = first.toastId ?? nextId();\n const options: ToastOptions = { ...first, toastId: id };\n return send(id, (controller) => {\n controller.dispatchToast(options);\n });\n }\n const id = second?.toastId ?? nextId();\n const options: ToastDispatchOptions = { ...second, toastId: id };\n return send(id, (controller) => {\n controller.dispatchToast(first, options);\n });\n }\n\n const handle: ToasterHandle = {\n dispatchToast,\n dismissToast(id) {\n if (state.controller) state.controller.dismissToast(id);\n else state.queue = state.queue.filter((call) => call.id !== id);\n },\n dismissAllToasts() {\n if (state.controller) state.controller.dismissAllToasts();\n else state.queue = [];\n },\n };\n handleRegistry.states.set(handle, state);\n return handle;\n}\n\n/** The result of {@link bindToasterHandle}. */\nexport type ToasterHandleBinding =\n { status: 'bound'; unbind: () => void } | { status: 'taken' } | { status: 'unknown' };\n\n/**\n * Internal (the Toaster's layout effect; not exported from the package): binds `handle` to the\n * controller of the Toaster identified by `owner` and replays the queue in dispatch order. A handle\n * bound to another mounted Toaster is `taken`; an object that `createToaster()` did not make is\n * `unknown`. The same owner binding again (StrictMode's remount) finds the queue already taken.\n */\nexport function bindToasterHandle(\n handle: ToastController,\n owner: object,\n controller: ToastController,\n): ToasterHandleBinding {\n const state = handleRegistry.states.get(handle);\n if (!state) return { status: 'unknown' };\n if (state.owner !== null && state.owner !== owner) return { status: 'taken' };\n state.owner = owner;\n state.controller = controller;\n const queued = state.queue;\n state.queue = [];\n for (const call of queued) call.run(controller);\n return {\n status: 'bound',\n unbind: () => {\n if (state.owner !== owner) return;\n state.owner = null;\n state.controller = null;\n },\n };\n}\n"],"mappings":"wCAmBA,SAAgBE,EAAe,EAAuC,CAGpE,GAFI,OAAOC,GAAU,WAAYA,GAC7B,aAAcA,GAAS,OAAO,YAAYA,GAC1C,OAAQA,EAA6B,MAAS,WAAY,MAAO,GACrE,IAAMC,EAAiB,OAAO,eAAeD,CAAK,EAClD,OAAOC,IAAU,MAAQA,IAAU,OAAO,WAAa,OAAO,eAAeA,CAAK,IAAM,IAC1F,CAyBA,IAAMC,EAAiBL,EAAAA,kBAAkB,sBAAyB,CAChE,OAAQ,IAAI,QACZ,MAAO,CACT,EAAE,EAmBF,SAAgBM,GAA+B,CAC7C,EAAe,OAAS,EACxB,IAAMC,EAAS,iBAAiBF,EAAe,QAC3CG,EAAgB,EACdC,EAAqB,CAAE,WAAY,KAAM,MAAO,KAAM,MAAO,CAAC,CAAE,EAChEC,OACJ,GAAiB,EACV,GAAGH,EAAO,GAAGC,KAEhBG,GAAQ,EAAY,IAAuD,CAC/E,GAAI,OAAO,OAAW,IAAa,OAAOC,EAC1C,GAAIH,EAAM,WAER,OADAI,EAAIJ,EAAM,UAAU,EACbG,EAET,IAAME,EAAQL,EAAM,MAAM,UAAW,GAASM,EAAK,KAAOH,CAAE,EAG5D,OAFIE,IAAU,GAAIL,EAAM,MAAM,KAAK,CAAE,KAAI,KAAI,CAAC,EACzC,EAAM,MAAMK,GAAS,CAAE,KAAI,KAAI,EAC7BF,CACT,EAIA,SAASI,EACP,EACA,EACQ,CACR,GAAId,EAAee,CAAK,EAAG,CACzB,IAAML,EAAKK,EAAM,SAAWP,EAAO,EAC7BQ,EAAwB,CAAE,GAAGD,EAAO,QAASL,CAAG,EACtD,OAAOD,EAAKC,EAAK,GAAe,CAC9BO,EAAW,cAAcD,CAAO,CAClC,CAAC,CACH,CACA,IAAMN,EAAKQ,GAAQ,SAAWV,EAAO,EAC/BQ,EAAgC,CAAE,GAAGE,EAAQ,QAASR,CAAG,EAC/D,OAAOD,EAAKC,EAAK,GAAe,CAC9BO,EAAW,cAAcF,EAAOC,CAAO,CACzC,CAAC,CACH,CAEA,IAAMG,EAAwB,CAC5B,gBACA,aAAa,EAAI,CACXZ,EAAM,WAAYA,EAAM,WAAW,aAAaG,CAAE,EACjD,EAAM,MAAQH,EAAM,MAAM,OAAQ,GAASM,EAAK,KAAOH,CAAE,CAChE,EACA,kBAAmB,CACbH,EAAM,WAAYA,EAAM,WAAW,iBAAiB,EACnD,EAAM,MAAQ,CAAC,CACtB,CACF,EAEA,OADAJ,EAAe,OAAO,IAAIgB,EAAQZ,CAAK,EAChCY,CACT,CAYA,SAAgBC,EACd,EACA,EACA,EACsB,CACtB,IAAMb,EAAQJ,EAAe,OAAO,IAAIgB,CAAM,EAC9C,GAAI,CAACZ,EAAO,MAAO,CAAE,OAAQ,SAAU,EACvC,GAAIA,EAAM,QAAU,MAAQA,EAAM,QAAUc,EAAO,MAAO,CAAE,OAAQ,OAAQ,EAC5E,EAAM,MAAQA,EACd,EAAM,WAAaJ,EACnB,IAAMK,EAASf,EAAM,MACrB,EAAM,MAAQ,CAAC,EACf,IAAK,IAAMM,KAAQS,EAAQT,EAAK,IAAII,CAAU,EAC9C,MAAO,CACL,OAAQ,QACR,WAAc,CACRV,EAAM,QAAUc,IACpB,EAAM,MAAQ,KACd,EAAM,WAAa,KACrB,CACF,CACF"}
@@ -0,0 +1,77 @@
1
+ import { getGlobalRegistry as e } from "./globalRegistry.mjs";
2
+ //#region src/lib/toaster.ts
3
+ function t(e) {
4
+ if (typeof e != "object" || !e || "$$typeof" in e || Symbol.iterator in e || typeof e.then == "function") return !1;
5
+ let t = Object.getPrototypeOf(e);
6
+ return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null;
7
+ }
8
+ var n = e("toasterHandles", () => ({
9
+ states: /* @__PURE__ */ new WeakMap(),
10
+ count: 0
11
+ }));
12
+ function r() {
13
+ n.count += 1;
14
+ let e = `wave-toaster-h${n.count}`, r = 0, i = {
15
+ controller: null,
16
+ owner: null,
17
+ queue: []
18
+ }, a = () => (r += 1, `${e}-${r}`), o = (e, t) => {
19
+ if (typeof window > "u") return e;
20
+ if (i.controller) return t(i.controller), e;
21
+ let n = i.queue.findIndex((t) => t.id === e);
22
+ return n === -1 ? i.queue.push({
23
+ id: e,
24
+ run: t
25
+ }) : i.queue[n] = {
26
+ id: e,
27
+ run: t
28
+ }, e;
29
+ };
30
+ function s(e, n) {
31
+ if (t(e)) {
32
+ let t = e.toastId ?? a(), n = {
33
+ ...e,
34
+ toastId: t
35
+ };
36
+ return o(t, (e) => {
37
+ e.dispatchToast(n);
38
+ });
39
+ }
40
+ let r = n?.toastId ?? a(), i = {
41
+ ...n,
42
+ toastId: r
43
+ };
44
+ return o(r, (t) => {
45
+ t.dispatchToast(e, i);
46
+ });
47
+ }
48
+ let c = {
49
+ dispatchToast: s,
50
+ dismissToast(e) {
51
+ i.controller ? i.controller.dismissToast(e) : i.queue = i.queue.filter((t) => t.id !== e);
52
+ },
53
+ dismissAllToasts() {
54
+ i.controller ? i.controller.dismissAllToasts() : i.queue = [];
55
+ }
56
+ };
57
+ return n.states.set(c, i), c;
58
+ }
59
+ function i(e, t, r) {
60
+ let i = n.states.get(e);
61
+ if (!i) return { status: "unknown" };
62
+ if (i.owner !== null && i.owner !== t) return { status: "taken" };
63
+ i.owner = t, i.controller = r;
64
+ let a = i.queue;
65
+ i.queue = [];
66
+ for (let e of a) e.run(r);
67
+ return {
68
+ status: "bound",
69
+ unbind: () => {
70
+ i.owner === t && (i.owner = null, i.controller = null);
71
+ }
72
+ };
73
+ }
74
+ //#endregion
75
+ export { i as bindToasterHandle, r as createToaster, t as isToastOptions };
76
+
77
+ //# sourceMappingURL=toaster.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toaster.mjs","names":["isToastOptions","value","proto","handleRegistry","getGlobalRegistry","createToaster","prefix","dispatchCount","state","nextId","send","id","run","index","call","dispatchToast","first","options","second","handle","bindToasterHandle","owner","controller","queued"],"sources":["../../src/lib/toaster.ts"],"sourcesContent":["/**\n * The toaster module (P3-01, P3-08): the options recogniser and the toaster handle. Server-safe:\n * it imports only types (and the dependency-free global registry) and touches no DOM, so a Server\n * Component may import it.\n */\nimport type * as React from 'react';\nimport { getGlobalRegistry } from './globalRegistry';\nimport type {\n ToastController,\n ToastDispatchOptions,\n ToastOptions,\n} from '../components/feedback/Toaster';\n\n/**\n * Whether a `dispatchToast` argument is the options form (0.5): a plain object (prototype\n * `Object.prototype` or `null`, from any realm) that is no React node — no `$$typeof`, not\n * iterable, not a thenable (the slot-object rule of `src/lib/slot.ts`). Anything else is content:\n * an element, a portal, a string, a number, an array or another iterable, a thenable, `null`.\n */\nexport function isToastOptions(value: unknown): value is ToastOptions {\n if (typeof value !== 'object' || value === null) return false;\n if ('$$typeof' in value || Symbol.iterator in value) return false;\n if (typeof (value as { then?: unknown }).then === 'function') return false;\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;\n}\n\n/**\n * A toast controller that code outside React components can call (a query-cache callback, a\n * server-event handler, a shared helper). Bind it to one Toaster with `<Toaster toaster={handle}>`;\n * toasts dispatched through it render there. One handle per Toaster is also how an app runs\n * several Toasters (Fluent's `toasterId`).\n */\nexport type ToasterHandle = ToastController;\n\n/** A dispatch waiting for a Toaster to bind the handle. */\ninterface QueuedDispatch {\n id: string;\n run: (controller: ToastController) => void;\n}\n\n/** The internal state of a handle, never reachable from the handle itself. */\ninterface HandleState {\n controller: ToastController | null;\n /** The Toaster the handle is bound to (an identity token), or `null`. */\n owner: object | null;\n queue: QueuedDispatch[];\n}\n\n/** Shared by the ESM and CJS copies of the library, so either copy's Toaster binds either's handle. */\nconst handleRegistry = getGlobalRegistry('toasterHandles', () => ({\n states: new WeakMap<object, HandleState>(),\n count: 0,\n}));\n\n/**\n * Creates a handle. It touches no DOM, so a module-scope handle is safe during server rendering;\n * a dispatch on the server does nothing (it returns the id), so no toast is carried from one\n * request to the next.\n *\n * - `dispatchToast` returns the id at once: `toastId`, or one the handle generates.\n * - Before a Toaster binds the handle, dispatches wait in its queue, in dispatch order (a dispatch\n * with the id of a waiting one replaces it in place); `dismissToast` removes a waiting toast and\n * `dismissAllToasts` empties the queue. The Toaster that binds takes the queue.\n *\n * @example\n * export const appToaster = createToaster();\n * // <Toaster toaster={appToaster}><App /></Toaster>\n * queryClient.getMutationCache().config.onError = () => {\n * appToaster.dispatchToast({ status: 'error', title: 'Could not save' });\n * };\n */\nexport function createToaster(): ToasterHandle {\n handleRegistry.count += 1;\n const prefix = `wave-toaster-h${handleRegistry.count}`;\n let dispatchCount = 0;\n const state: HandleState = { controller: null, owner: null, queue: [] };\n const nextId = () => {\n dispatchCount += 1;\n return `${prefix}-${dispatchCount}`;\n };\n const send = (id: string, run: (controller: ToastController) => void): string => {\n if (typeof window === 'undefined') return id;\n if (state.controller) {\n run(state.controller);\n return id;\n }\n const index = state.queue.findIndex((call) => call.id === id);\n if (index === -1) state.queue.push({ id, run });\n else state.queue[index] = { id, run };\n return id;\n };\n\n function dispatchToast(content: React.ReactNode, options?: ToastDispatchOptions): string;\n function dispatchToast(options: ToastOptions): string;\n function dispatchToast(\n first: React.ReactNode | ToastOptions,\n second?: ToastDispatchOptions,\n ): string {\n if (isToastOptions(first)) {\n const id = first.toastId ?? nextId();\n const options: ToastOptions = { ...first, toastId: id };\n return send(id, (controller) => {\n controller.dispatchToast(options);\n });\n }\n const id = second?.toastId ?? nextId();\n const options: ToastDispatchOptions = { ...second, toastId: id };\n return send(id, (controller) => {\n controller.dispatchToast(first, options);\n });\n }\n\n const handle: ToasterHandle = {\n dispatchToast,\n dismissToast(id) {\n if (state.controller) state.controller.dismissToast(id);\n else state.queue = state.queue.filter((call) => call.id !== id);\n },\n dismissAllToasts() {\n if (state.controller) state.controller.dismissAllToasts();\n else state.queue = [];\n },\n };\n handleRegistry.states.set(handle, state);\n return handle;\n}\n\n/** The result of {@link bindToasterHandle}. */\nexport type ToasterHandleBinding =\n { status: 'bound'; unbind: () => void } | { status: 'taken' } | { status: 'unknown' };\n\n/**\n * Internal (the Toaster's layout effect; not exported from the package): binds `handle` to the\n * controller of the Toaster identified by `owner` and replays the queue in dispatch order. A handle\n * bound to another mounted Toaster is `taken`; an object that `createToaster()` did not make is\n * `unknown`. The same owner binding again (StrictMode's remount) finds the queue already taken.\n */\nexport function bindToasterHandle(\n handle: ToastController,\n owner: object,\n controller: ToastController,\n): ToasterHandleBinding {\n const state = handleRegistry.states.get(handle);\n if (!state) return { status: 'unknown' };\n if (state.owner !== null && state.owner !== owner) return { status: 'taken' };\n state.owner = owner;\n state.controller = controller;\n const queued = state.queue;\n state.queue = [];\n for (const call of queued) call.run(controller);\n return {\n status: 'bound',\n unbind: () => {\n if (state.owner !== owner) return;\n state.owner = null;\n state.controller = null;\n },\n };\n}\n"],"mappings":";;AAmBA,SAAgBA,EAAe,GAAuC;CAGpE,IAFI,OAAOC,KAAU,aAAYA,KAC7B,cAAcA,KAAS,OAAO,YAAYA,KAC1C,OAAQA,EAA6B,QAAS,YAAY,OAAO;CACrE,IAAMC,IAAiB,OAAO,eAAeD,CAAK;CAClD,OAAOC,MAAU,QAAQA,MAAU,OAAO,aAAa,OAAO,eAAeA,CAAK,MAAM;AAC1F;AAyBA,IAAMC,IAAiBC,EAAkB,yBAAyB;CAChE,wBAAQ,IAAI,QAA6B;CACzC,OAAO;AACT,EAAE;AAmBF,SAAgBC,IAA+B;CAC7C,EAAe,SAAS;CACxB,IAAMC,IAAS,iBAAiBH,EAAe,SAC3CI,IAAgB,GACdC,IAAqB;EAAE,YAAY;EAAM,OAAO;EAAM,OAAO,CAAC;CAAE,GAChEC,WACJ,KAAiB,GACV,GAAGH,EAAO,GAAGC,MAEhBG,KAAQ,GAAY,MAAuD;EAC/E,IAAI,OAAO,SAAW,KAAa,OAAOC;EAC1C,IAAIH,EAAM,YAER,OADAI,EAAIJ,EAAM,UAAU,GACbG;EAET,IAAME,IAAQL,EAAM,MAAM,WAAW,MAASM,EAAK,OAAOH,CAAE;EAG5D,OAFIE,MAAU,KAAIL,EAAM,MAAM,KAAK;GAAE;GAAI;EAAI,CAAC,IACzC,EAAM,MAAMK,KAAS;GAAE;GAAI;EAAI,GAC7BF;CACT;CAIA,SAASI,EACP,GACA,GACQ;EACR,IAAIf,EAAegB,CAAK,GAAG;GACzB,IAAML,IAAKK,EAAM,WAAWP,EAAO,GAC7BQ,IAAwB;IAAE,GAAGD;IAAO,SAASL;GAAG;GACtD,OAAOD,EAAKC,IAAK,MAAe;IAC9B,EAAW,cAAcM,CAAO;GAClC,CAAC;EACH;EACA,IAAMN,IAAKO,GAAQ,WAAWT,EAAO,GAC/BQ,IAAgC;GAAE,GAAGC;GAAQ,SAASP;EAAG;EAC/D,OAAOD,EAAKC,IAAK,MAAe;GAC9B,EAAW,cAAcK,GAAOC,CAAO;EACzC,CAAC;CACH;CAEA,IAAME,IAAwB;EAC5B;EACA,aAAa,GAAI;GACf,AAAIX,EAAM,aAAYA,EAAM,WAAW,aAAaG,CAAE,IACjD,EAAM,QAAQH,EAAM,MAAM,QAAQ,MAASM,EAAK,OAAOH,CAAE;EAChE;EACA,mBAAmB;GACjB,AAAIH,EAAM,aAAYA,EAAM,WAAW,iBAAiB,IACnD,EAAM,QAAQ,CAAC;EACtB;CACF;CAEA,OADAL,EAAe,OAAO,IAAIgB,GAAQX,CAAK,GAChCW;AACT;AAYA,SAAgBC,EACd,GACA,GACA,GACsB;CACtB,IAAMZ,IAAQL,EAAe,OAAO,IAAIgB,CAAM;CAC9C,IAAI,CAACX,GAAO,OAAO,EAAE,QAAQ,UAAU;CACvC,IAAIA,EAAM,UAAU,QAAQA,EAAM,UAAUa,GAAO,OAAO,EAAE,QAAQ,QAAQ;CAE5E,AADA,EAAM,QAAQA,GACd,EAAM,aAAaC;CACnB,IAAMC,IAASf,EAAM;CACrB,EAAM,QAAQ,CAAC;CACf,KAAK,IAAMM,KAAQS,GAAQ,EAAK,IAAID,CAAU;CAC9C,OAAO;EACL,QAAQ;EACR,cAAc;GACZ,AAAId,EAAM,UAAUa,MACpB,EAAM,QAAQ,MACd,EAAM,aAAa;EACrB;CACF;AACF"}