@mortenbrudvik/waveui 0.7.0 → 0.8.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 (408) hide show
  1. package/README.md +395 -132
  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/InfoLabel.cjs +1 -1
  63. package/dist/components/data-display/InfoLabel.cjs.map +1 -1
  64. package/dist/components/data-display/InfoLabel.mjs +74 -73
  65. package/dist/components/data-display/InfoLabel.mjs.map +1 -1
  66. package/dist/components/data-display/List.cjs +1 -1
  67. package/dist/components/data-display/List.cjs.map +1 -1
  68. package/dist/components/data-display/List.mjs +175 -174
  69. package/dist/components/data-display/List.mjs.map +1 -1
  70. package/dist/components/data-display/Persona.cjs +1 -1
  71. package/dist/components/data-display/Persona.cjs.map +1 -1
  72. package/dist/components/data-display/Persona.mjs +31 -29
  73. package/dist/components/data-display/Persona.mjs.map +1 -1
  74. package/dist/components/data-display/PresenceBadge.cjs +1 -1
  75. package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
  76. package/dist/components/data-display/PresenceBadge.mjs +25 -24
  77. package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
  78. package/dist/components/data-display/Tag.cjs +1 -1
  79. package/dist/components/data-display/Tag.cjs.map +1 -1
  80. package/dist/components/data-display/Tag.mjs +87 -82
  81. package/dist/components/data-display/Tag.mjs.map +1 -1
  82. package/dist/components/feedback/MessageBar.cjs +1 -1
  83. package/dist/components/feedback/MessageBar.cjs.map +1 -1
  84. package/dist/components/feedback/MessageBar.mjs +129 -71
  85. package/dist/components/feedback/MessageBar.mjs.map +1 -1
  86. package/dist/components/feedback/MessageBar.parts.cjs +2 -0
  87. package/dist/components/feedback/MessageBar.parts.cjs.map +1 -0
  88. package/dist/components/feedback/MessageBar.parts.mjs +84 -0
  89. package/dist/components/feedback/MessageBar.parts.mjs.map +1 -0
  90. package/dist/components/feedback/MessageBar.reflow.cjs +2 -0
  91. package/dist/components/feedback/MessageBar.reflow.cjs.map +1 -0
  92. package/dist/components/feedback/MessageBar.reflow.mjs +74 -0
  93. package/dist/components/feedback/MessageBar.reflow.mjs.map +1 -0
  94. package/dist/components/feedback/MessageBar.status.cjs +1 -1
  95. package/dist/components/feedback/MessageBar.status.cjs.map +1 -1
  96. package/dist/components/feedback/MessageBar.status.mjs +2 -1
  97. package/dist/components/feedback/MessageBar.status.mjs.map +1 -1
  98. package/dist/components/feedback/ProgressBar.cjs +1 -1
  99. package/dist/components/feedback/ProgressBar.cjs.map +1 -1
  100. package/dist/components/feedback/ProgressBar.mjs +44 -43
  101. package/dist/components/feedback/ProgressBar.mjs.map +1 -1
  102. package/dist/components/feedback/Skeleton.cjs +1 -1
  103. package/dist/components/feedback/Skeleton.cjs.map +1 -1
  104. package/dist/components/feedback/Skeleton.mjs +26 -24
  105. package/dist/components/feedback/Skeleton.mjs.map +1 -1
  106. package/dist/components/feedback/Spinner.cjs +1 -1
  107. package/dist/components/feedback/Spinner.cjs.map +1 -1
  108. package/dist/components/feedback/Spinner.mjs +32 -31
  109. package/dist/components/feedback/Spinner.mjs.map +1 -1
  110. package/dist/components/feedback/Toast.cjs +1 -1
  111. package/dist/components/feedback/Toast.cjs.map +1 -1
  112. package/dist/components/feedback/Toast.context.cjs +2 -0
  113. package/dist/components/feedback/Toast.context.cjs.map +1 -0
  114. package/dist/components/feedback/Toast.context.mjs +23 -0
  115. package/dist/components/feedback/Toast.context.mjs.map +1 -0
  116. package/dist/components/feedback/Toast.mjs +10 -342
  117. package/dist/components/feedback/Toast.mjs.map +1 -1
  118. package/dist/components/feedback/Toast.parts.cjs +2 -0
  119. package/dist/components/feedback/Toast.parts.cjs.map +1 -0
  120. package/dist/components/feedback/Toast.parts.mjs +98 -0
  121. package/dist/components/feedback/Toast.parts.mjs.map +1 -0
  122. package/dist/components/feedback/Toast.root.cjs +2 -0
  123. package/dist/components/feedback/Toast.root.cjs.map +1 -0
  124. package/dist/components/feedback/Toast.root.mjs +109 -0
  125. package/dist/components/feedback/Toast.root.mjs.map +1 -0
  126. package/dist/components/feedback/Toaster.cjs +2 -0
  127. package/dist/components/feedback/Toaster.cjs.map +1 -0
  128. package/dist/components/feedback/Toaster.mjs +564 -0
  129. package/dist/components/feedback/Toaster.mjs.map +1 -0
  130. package/dist/components/input/AlphaSlider.cjs +2 -0
  131. package/dist/components/input/AlphaSlider.cjs.map +1 -0
  132. package/dist/components/input/AlphaSlider.mjs +115 -0
  133. package/dist/components/input/AlphaSlider.mjs.map +1 -0
  134. package/dist/components/input/Checkbox.cjs +1 -1
  135. package/dist/components/input/Checkbox.cjs.map +1 -1
  136. package/dist/components/input/Checkbox.mjs +47 -46
  137. package/dist/components/input/Checkbox.mjs.map +1 -1
  138. package/dist/components/input/ColorArea.cjs +2 -0
  139. package/dist/components/input/ColorArea.cjs.map +1 -0
  140. package/dist/components/input/ColorArea.mjs +204 -0
  141. package/dist/components/input/ColorArea.mjs.map +1 -0
  142. package/dist/components/input/ColorPicker.cjs +5 -5
  143. package/dist/components/input/ColorPicker.cjs.map +1 -1
  144. package/dist/components/input/ColorPicker.mjs +142 -165
  145. package/dist/components/input/ColorPicker.mjs.map +1 -1
  146. package/dist/components/input/ColorPicker.parts.cjs +2 -0
  147. package/dist/components/input/ColorPicker.parts.cjs.map +1 -0
  148. package/dist/components/input/ColorPicker.parts.mjs +192 -0
  149. package/dist/components/input/ColorPicker.parts.mjs.map +1 -0
  150. package/dist/components/input/ColorSlider.cjs +2 -0
  151. package/dist/components/input/ColorSlider.cjs.map +1 -0
  152. package/dist/components/input/ColorSlider.mjs +138 -0
  153. package/dist/components/input/ColorSlider.mjs.map +1 -0
  154. package/dist/components/input/Combobox.cjs +1 -1
  155. package/dist/components/input/Combobox.cjs.map +1 -1
  156. package/dist/components/input/Combobox.expand.cjs +1 -1
  157. package/dist/components/input/Combobox.expand.cjs.map +1 -1
  158. package/dist/components/input/Combobox.expand.mjs +9 -9
  159. package/dist/components/input/Combobox.expand.mjs.map +1 -1
  160. package/dist/components/input/Combobox.mjs +90 -85
  161. package/dist/components/input/Combobox.mjs.map +1 -1
  162. package/dist/components/input/DatePicker.cjs +1 -1
  163. package/dist/components/input/DatePicker.cjs.map +1 -1
  164. package/dist/components/input/DatePicker.mjs +186 -185
  165. package/dist/components/input/DatePicker.mjs.map +1 -1
  166. package/dist/components/input/Dropdown.cjs +1 -1
  167. package/dist/components/input/Dropdown.cjs.map +1 -1
  168. package/dist/components/input/Dropdown.mjs +71 -68
  169. package/dist/components/input/Dropdown.mjs.map +1 -1
  170. package/dist/components/input/Field.cjs +1 -1
  171. package/dist/components/input/Field.cjs.map +1 -1
  172. package/dist/components/input/Field.mjs +113 -112
  173. package/dist/components/input/Field.mjs.map +1 -1
  174. package/dist/components/input/Input.cjs +1 -1
  175. package/dist/components/input/Input.cjs.map +1 -1
  176. package/dist/components/input/Input.mjs +55 -54
  177. package/dist/components/input/Input.mjs.map +1 -1
  178. package/dist/components/input/Label.cjs +1 -1
  179. package/dist/components/input/Label.cjs.map +1 -1
  180. package/dist/components/input/Label.mjs +12 -11
  181. package/dist/components/input/Label.mjs.map +1 -1
  182. package/dist/components/input/Option.cjs +1 -1
  183. package/dist/components/input/Option.cjs.map +1 -1
  184. package/dist/components/input/Option.mjs +100 -98
  185. package/dist/components/input/Option.mjs.map +1 -1
  186. package/dist/components/input/RadioGroup.cjs +1 -1
  187. package/dist/components/input/RadioGroup.cjs.map +1 -1
  188. package/dist/components/input/RadioGroup.mjs +89 -88
  189. package/dist/components/input/RadioGroup.mjs.map +1 -1
  190. package/dist/components/input/Rating.cjs +1 -1
  191. package/dist/components/input/Rating.cjs.map +1 -1
  192. package/dist/components/input/Rating.mjs +110 -109
  193. package/dist/components/input/Rating.mjs.map +1 -1
  194. package/dist/components/input/SearchBox.cjs +1 -1
  195. package/dist/components/input/SearchBox.cjs.map +1 -1
  196. package/dist/components/input/SearchBox.mjs +118 -119
  197. package/dist/components/input/SearchBox.mjs.map +1 -1
  198. package/dist/components/input/Select.cjs +1 -1
  199. package/dist/components/input/Select.cjs.map +1 -1
  200. package/dist/components/input/Select.mjs +25 -24
  201. package/dist/components/input/Select.mjs.map +1 -1
  202. package/dist/components/input/Slider.cjs +1 -1
  203. package/dist/components/input/Slider.cjs.map +1 -1
  204. package/dist/components/input/Slider.mjs +47 -46
  205. package/dist/components/input/Slider.mjs.map +1 -1
  206. package/dist/components/input/SpinButton.cjs +1 -1
  207. package/dist/components/input/SpinButton.cjs.map +1 -1
  208. package/dist/components/input/SpinButton.mjs +76 -75
  209. package/dist/components/input/SpinButton.mjs.map +1 -1
  210. package/dist/components/input/SwatchPicker.cjs +1 -1
  211. package/dist/components/input/SwatchPicker.cjs.map +1 -1
  212. package/dist/components/input/SwatchPicker.mjs +38 -37
  213. package/dist/components/input/SwatchPicker.mjs.map +1 -1
  214. package/dist/components/input/Switch.cjs +1 -1
  215. package/dist/components/input/Switch.cjs.map +1 -1
  216. package/dist/components/input/Switch.mjs +65 -64
  217. package/dist/components/input/Switch.mjs.map +1 -1
  218. package/dist/components/input/TagPicker.cjs +1 -1
  219. package/dist/components/input/TagPicker.cjs.map +1 -1
  220. package/dist/components/input/TagPicker.mjs +161 -157
  221. package/dist/components/input/TagPicker.mjs.map +1 -1
  222. package/dist/components/input/Textarea.cjs +1 -1
  223. package/dist/components/input/Textarea.cjs.map +1 -1
  224. package/dist/components/input/Textarea.mjs +24 -23
  225. package/dist/components/input/Textarea.mjs.map +1 -1
  226. package/dist/components/input/TimePicker.cjs +1 -1
  227. package/dist/components/input/TimePicker.cjs.map +1 -1
  228. package/dist/components/input/TimePicker.mjs +202 -199
  229. package/dist/components/input/TimePicker.mjs.map +1 -1
  230. package/dist/components/input/colorName.cjs +2 -0
  231. package/dist/components/input/colorName.cjs.map +1 -0
  232. package/dist/components/input/colorName.mjs +30 -0
  233. package/dist/components/input/colorName.mjs.map +1 -0
  234. package/dist/components/input/colorUtils.cjs +1 -1
  235. package/dist/components/input/colorUtils.cjs.map +1 -1
  236. package/dist/components/input/colorUtils.mjs +154 -56
  237. package/dist/components/input/colorUtils.mjs.map +1 -1
  238. package/dist/components/layout/Accordion.cjs +1 -1
  239. package/dist/components/layout/Accordion.cjs.map +1 -1
  240. package/dist/components/layout/Accordion.mjs +130 -129
  241. package/dist/components/layout/Accordion.mjs.map +1 -1
  242. package/dist/components/layout/Card.cjs +1 -1
  243. package/dist/components/layout/Card.cjs.map +1 -1
  244. package/dist/components/layout/Card.mjs +78 -77
  245. package/dist/components/layout/Card.mjs.map +1 -1
  246. package/dist/components/layout/Carousel.cjs +1 -1
  247. package/dist/components/layout/Carousel.cjs.map +1 -1
  248. package/dist/components/layout/Carousel.mjs +111 -110
  249. package/dist/components/layout/Carousel.mjs.map +1 -1
  250. package/dist/components/layout/Flex.cjs +1 -1
  251. package/dist/components/layout/Flex.cjs.map +1 -1
  252. package/dist/components/layout/Flex.mjs +22 -21
  253. package/dist/components/layout/Flex.mjs.map +1 -1
  254. package/dist/components/layout/Grid.cjs +1 -1
  255. package/dist/components/layout/Grid.cjs.map +1 -1
  256. package/dist/components/layout/Grid.mjs +19 -18
  257. package/dist/components/layout/Grid.mjs.map +1 -1
  258. package/dist/components/layout/Overflow.cjs +1 -1
  259. package/dist/components/layout/Overflow.cjs.map +1 -1
  260. package/dist/components/layout/Overflow.mjs +92 -91
  261. package/dist/components/layout/Overflow.mjs.map +1 -1
  262. package/dist/components/layout/Stack.cjs +1 -1
  263. package/dist/components/layout/Stack.cjs.map +1 -1
  264. package/dist/components/layout/Stack.mjs +14 -13
  265. package/dist/components/layout/Stack.mjs.map +1 -1
  266. package/dist/components/layout/TabList.cjs +1 -1
  267. package/dist/components/layout/TabList.cjs.map +1 -1
  268. package/dist/components/layout/TabList.mjs +118 -117
  269. package/dist/components/layout/TabList.mjs.map +1 -1
  270. package/dist/components/layout/Tree.cjs +1 -1
  271. package/dist/components/layout/Tree.cjs.map +1 -1
  272. package/dist/components/layout/Tree.context.cjs +2 -0
  273. package/dist/components/layout/Tree.context.cjs.map +1 -0
  274. package/dist/components/layout/Tree.context.mjs +33 -0
  275. package/dist/components/layout/Tree.context.mjs.map +1 -0
  276. package/dist/components/layout/Tree.core.cjs +2 -0
  277. package/dist/components/layout/Tree.core.cjs.map +1 -0
  278. package/dist/components/layout/Tree.core.mjs +416 -0
  279. package/dist/components/layout/Tree.core.mjs.map +1 -0
  280. package/dist/components/layout/Tree.itemPersonaLayout.cjs +2 -0
  281. package/dist/components/layout/Tree.itemPersonaLayout.cjs.map +1 -0
  282. package/dist/components/layout/Tree.itemPersonaLayout.mjs +46 -0
  283. package/dist/components/layout/Tree.itemPersonaLayout.mjs.map +1 -0
  284. package/dist/components/layout/Tree.mjs +7 -215
  285. package/dist/components/layout/Tree.mjs.map +1 -1
  286. package/dist/components/layout/Tree.selection.cjs +2 -0
  287. package/dist/components/layout/Tree.selection.cjs.map +1 -0
  288. package/dist/components/layout/Tree.selection.mjs +73 -0
  289. package/dist/components/layout/Tree.selection.mjs.map +1 -0
  290. package/dist/components/navigation/Breadcrumb.cjs +1 -1
  291. package/dist/components/navigation/Breadcrumb.cjs.map +1 -1
  292. package/dist/components/navigation/Breadcrumb.mjs +76 -75
  293. package/dist/components/navigation/Breadcrumb.mjs.map +1 -1
  294. package/dist/components/navigation/Menu.group.cjs +1 -1
  295. package/dist/components/navigation/Menu.group.cjs.map +1 -1
  296. package/dist/components/navigation/Menu.group.mjs +39 -37
  297. package/dist/components/navigation/Menu.group.mjs.map +1 -1
  298. package/dist/components/navigation/Menu.items.cjs +1 -1
  299. package/dist/components/navigation/Menu.items.cjs.map +1 -1
  300. package/dist/components/navigation/Menu.items.mjs +67 -61
  301. package/dist/components/navigation/Menu.items.mjs.map +1 -1
  302. package/dist/components/navigation/Menu.link.cjs +1 -1
  303. package/dist/components/navigation/Menu.link.cjs.map +1 -1
  304. package/dist/components/navigation/Menu.link.mjs +34 -28
  305. package/dist/components/navigation/Menu.link.mjs.map +1 -1
  306. package/dist/components/navigation/Menu.popover.cjs +1 -1
  307. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  308. package/dist/components/navigation/Menu.popover.mjs +110 -109
  309. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  310. package/dist/components/navigation/Menu.root.cjs +1 -1
  311. package/dist/components/navigation/Menu.root.cjs.map +1 -1
  312. package/dist/components/navigation/Menu.root.mjs +171 -170
  313. package/dist/components/navigation/Menu.root.mjs.map +1 -1
  314. package/dist/components/navigation/Menu.selectable.cjs +1 -1
  315. package/dist/components/navigation/Menu.selectable.cjs.map +1 -1
  316. package/dist/components/navigation/Menu.selectable.mjs +85 -63
  317. package/dist/components/navigation/Menu.selectable.mjs.map +1 -1
  318. package/dist/components/navigation/Menu.splitGroup.cjs +1 -1
  319. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -1
  320. package/dist/components/navigation/Menu.splitGroup.mjs +27 -26
  321. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -1
  322. package/dist/components/navigation/Menu.trigger.cjs +1 -1
  323. package/dist/components/navigation/Menu.trigger.cjs.map +1 -1
  324. package/dist/components/navigation/Menu.trigger.mjs +6 -6
  325. package/dist/components/navigation/Nav.cjs +1 -1
  326. package/dist/components/navigation/Nav.cjs.map +1 -1
  327. package/dist/components/navigation/Nav.mjs +170 -155
  328. package/dist/components/navigation/Nav.mjs.map +1 -1
  329. package/dist/components/navigation/Pagination.cjs +1 -1
  330. package/dist/components/navigation/Pagination.cjs.map +1 -1
  331. package/dist/components/navigation/Pagination.mjs +73 -65
  332. package/dist/components/navigation/Pagination.mjs.map +1 -1
  333. package/dist/components/navigation/Stepper.cjs +1 -1
  334. package/dist/components/navigation/Stepper.cjs.map +1 -1
  335. package/dist/components/navigation/Stepper.mjs +110 -109
  336. package/dist/components/navigation/Stepper.mjs.map +1 -1
  337. package/dist/components/overlays/Dialog.cjs +1 -1
  338. package/dist/components/overlays/Dialog.cjs.map +1 -1
  339. package/dist/components/overlays/Dialog.mjs +109 -108
  340. package/dist/components/overlays/Dialog.mjs.map +1 -1
  341. package/dist/components/overlays/Drawer.cjs +1 -1
  342. package/dist/components/overlays/Drawer.cjs.map +1 -1
  343. package/dist/components/overlays/Drawer.mjs +110 -109
  344. package/dist/components/overlays/Drawer.mjs.map +1 -1
  345. package/dist/components/overlays/Popover.cjs +1 -1
  346. package/dist/components/overlays/Popover.cjs.map +1 -1
  347. package/dist/components/overlays/Popover.mjs +229 -227
  348. package/dist/components/overlays/Popover.mjs.map +1 -1
  349. package/dist/components/overlays/TeachingPopover.cjs +1 -1
  350. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  351. package/dist/components/overlays/TeachingPopover.mjs +41 -37
  352. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  353. package/dist/components/overlays/Tooltip.cjs +1 -1
  354. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  355. package/dist/components/overlays/Tooltip.mjs +87 -86
  356. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  357. package/dist/components/portal/Portal.cjs +1 -1
  358. package/dist/components/portal/Portal.cjs.map +1 -1
  359. package/dist/components/portal/Portal.mjs +33 -32
  360. package/dist/components/portal/Portal.mjs.map +1 -1
  361. package/dist/components/provider/WaveProvider.cjs +1 -1
  362. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  363. package/dist/components/provider/WaveProvider.mjs +31 -30
  364. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  365. package/dist/components/table/DataGrid.cjs +1 -1
  366. package/dist/components/table/DataGrid.cjs.map +1 -1
  367. package/dist/components/table/DataGrid.mjs +228 -227
  368. package/dist/components/table/DataGrid.mjs.map +1 -1
  369. package/dist/components/table/Table.cjs +1 -1
  370. package/dist/components/table/Table.cjs.map +1 -1
  371. package/dist/components/table/Table.mjs +60 -59
  372. package/dist/components/table/Table.mjs.map +1 -1
  373. package/dist/components/typography/Text.cjs +1 -1
  374. package/dist/components/typography/Text.cjs.map +1 -1
  375. package/dist/components/typography/Text.mjs +12 -11
  376. package/dist/components/typography/Text.mjs.map +1 -1
  377. package/dist/hooks/useMediaQuery.cjs +2 -0
  378. package/dist/hooks/useMediaQuery.cjs.map +1 -0
  379. package/dist/hooks/useMediaQuery.mjs +20 -0
  380. package/dist/hooks/useMediaQuery.mjs.map +1 -0
  381. package/dist/hooks/usePrefersReducedMotion.cjs +1 -1
  382. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -1
  383. package/dist/hooks/usePrefersReducedMotion.mjs +4 -18
  384. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -1
  385. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  386. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  387. package/dist/hooks/useRovingTabIndex.mjs +3 -3
  388. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  389. package/dist/index.cjs +1 -1
  390. package/dist/index.d.cts +2089 -102
  391. package/dist/index.d.ts +2089 -102
  392. package/dist/index.mjs +99 -87
  393. package/dist/lib/classNames.cjs +2 -0
  394. package/dist/lib/classNames.cjs.map +1 -0
  395. package/dist/lib/classNames.mjs +415 -0
  396. package/dist/lib/classNames.mjs.map +1 -0
  397. package/dist/lib/color.cjs +2 -0
  398. package/dist/lib/color.cjs.map +1 -0
  399. package/dist/lib/color.mjs +86 -0
  400. package/dist/lib/color.mjs.map +1 -0
  401. package/dist/lib/globalRegistry.cjs.map +1 -1
  402. package/dist/lib/globalRegistry.mjs.map +1 -1
  403. package/dist/lib/toaster.cjs +2 -0
  404. package/dist/lib/toaster.cjs.map +1 -0
  405. package/dist/lib/toaster.mjs +77 -0
  406. package/dist/lib/toaster.mjs.map +1 -0
  407. package/dist/styles.css +1 -1
  408. package/package.json +1 -1
@@ -1,81 +1,82 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/cn.mjs";
3
3
  import { renderSlot as t, slotRendersContent as n } from "../../lib/slot.mjs";
4
- import { useId as r } from "../../hooks/useId.mjs";
5
- import { joinIds as i } from "../../lib/aria.mjs";
6
- import { useFieldContext as a, useFieldControl as o } from "../../hooks/useFieldControl.mjs";
7
- import { inputFocus as s, inputFocusWithin as c } from "../../lib/styles.mjs";
4
+ import { inputClassNames as r } from "../../lib/classNames.mjs";
5
+ import { useId as i } from "../../hooks/useId.mjs";
6
+ import { joinIds as a } from "../../lib/aria.mjs";
7
+ import { useFieldContext as o, useFieldControl as s } from "../../hooks/useFieldControl.mjs";
8
+ import { inputFocus as c, inputFocusWithin as l } from "../../lib/styles.mjs";
8
9
  import "react";
9
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
10
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
11
  //#region src/components/input/Input.tsx
11
- function f(e) {
12
+ function p(e) {
12
13
  return e === !1 || e === "false";
13
14
  }
14
- function p(t, n, i) {
15
- let o = a(), s = r("error"), c = !f(i) && (t === !0 || typeof t == "string" && t !== "");
16
- if (!c || typeof t != "string" || o?.hasErrorMessage) return {
17
- invalid: c,
15
+ function m(t, n, r, a) {
16
+ let s = o(), c = i("error"), l = !p(r) && (t === !0 || typeof t == "string" && t !== "");
17
+ if (!l || typeof t != "string" || s?.hasErrorMessage) return {
18
+ invalid: l,
18
19
  messageId: void 0,
19
20
  message: null
20
21
  };
21
- let { id: l, className: d, ...p } = n ?? {}, m = l ?? s;
22
+ let { id: u, className: f, ...m } = n ?? {}, h = u ?? c;
22
23
  return {
23
- invalid: c,
24
- messageId: m,
25
- message: /* @__PURE__ */ u("span", {
24
+ invalid: l,
25
+ messageId: h,
26
+ message: /* @__PURE__ */ d("span", {
26
27
  role: "alert",
27
- ...p,
28
- id: m,
29
- className: e("mt-1 block text-caption-1 text-error", d),
28
+ ...m,
29
+ id: h,
30
+ className: e(a, "mt-1 block text-caption-1 text-error", f),
30
31
  children: t
31
32
  })
32
33
  };
33
34
  }
34
- function m(e, t) {
35
- return f(t) ? !1 : e || t === !0 || t === "true";
35
+ function h(e, t) {
36
+ return p(t) ? !1 : e || t === !0 || t === "true";
36
37
  }
37
- var h = ({ error: r, errorMessageProps: a, contentBefore: f, contentAfter: h, onChange: g, onValueChange: _, className: v, ref: y, id: b, "aria-label": x, "aria-labelledby": S, "aria-describedby": C, "aria-invalid": w, "aria-required": T, "aria-errormessage": E, required: D, ...O }) => {
38
- let { invalid: k, messageId: A, message: j } = p(r, a, w), M = o({
39
- id: b,
40
- "aria-label": x,
41
- "aria-labelledby": S,
42
- "aria-describedby": i(C, A),
43
- "aria-invalid": w ?? (k || void 0),
44
- "aria-required": T,
45
- required: D
46
- }, { nativeRequired: !0 }), N = m(k, M["aria-invalid"]), P = g || _ ? (e) => {
47
- g?.(e), _?.(e.currentTarget.value);
48
- } : void 0, F = {
49
- ...O,
50
- ...M,
51
- "aria-errormessage": i(E, A),
52
- onChange: P
53
- }, I = n(f), L = n(h), R;
54
- if (I || L) {
55
- let { style: n, hidden: r, ...i } = F;
56
- R = /* @__PURE__ */ d("span", {
57
- hidden: r,
38
+ var g = ({ error: i, errorMessageProps: o, contentBefore: p, contentAfter: g, onChange: _, onValueChange: v, className: y, ref: b, id: x, "aria-label": S, "aria-labelledby": C, "aria-describedby": w, "aria-invalid": T, "aria-required": E, "aria-errormessage": D, required: O, ...k }) => {
39
+ let { invalid: A, messageId: j, message: M } = m(i, o, T, r.errorMessage), N = s({
40
+ id: x,
41
+ "aria-label": S,
42
+ "aria-labelledby": C,
43
+ "aria-describedby": a(w, j),
44
+ "aria-invalid": T ?? (A || void 0),
45
+ "aria-required": E,
46
+ required: O
47
+ }, { nativeRequired: !0 }), P = h(A, N["aria-invalid"]), F = _ || v ? (e) => {
48
+ _?.(e), v?.(e.currentTarget.value);
49
+ } : void 0, I = {
50
+ ...k,
51
+ ...N,
52
+ "aria-errormessage": a(D, j),
53
+ onChange: F
54
+ }, L = n(p), R = n(g), z;
55
+ if (L || R) {
56
+ let { style: n, hidden: i, ...a } = I;
57
+ z = /* @__PURE__ */ f("span", {
58
+ hidden: i,
58
59
  style: n,
59
- className: e("inline-flex h-8 w-full items-center rounded border border-input border-b-stroke-accessible bg-background text-body-1 text-foreground", c, N && "border-destructive focus-within:border-b-destructive", O.disabled && "cursor-not-allowed opacity-50 has-focus-visible:opacity-100", v),
60
+ className: e(r.root, "inline-flex h-8 w-full items-center rounded border border-input border-b-stroke-accessible bg-background text-body-1 text-foreground", l, P && "border-destructive focus-within:border-b-destructive", k.disabled && "cursor-not-allowed opacity-50 has-focus-visible:opacity-100", y),
60
61
  children: [
61
- I && t(f, "span", "shrink-0 ps-2"),
62
- /* @__PURE__ */ u("input", {
63
- ref: y,
64
- className: e("h-full w-full min-w-0 bg-transparent px-2 text-body-1 text-foreground", "placeholder:text-muted-foreground", "focus:outline-hidden", "disabled:cursor-not-allowed"),
65
- ...i
62
+ L && t(p, "span", e(r.contentBefore, "shrink-0 ps-2")),
63
+ /* @__PURE__ */ d("input", {
64
+ ref: b,
65
+ className: e(r.input, "h-full w-full min-w-0 bg-transparent px-2 text-body-1 text-foreground", "placeholder:text-muted-foreground", "focus:outline-hidden", "disabled:cursor-not-allowed"),
66
+ ...a
66
67
  }),
67
- L && t(h, "span", "shrink-0 pe-2")
68
+ R && t(g, "span", e(r.contentAfter, "shrink-0 pe-2"))
68
69
  ]
69
70
  });
70
- } else R = /* @__PURE__ */ u("input", {
71
- ref: y,
72
- className: e("h-8 w-full rounded border border-input border-b-stroke-accessible bg-background px-3 text-body-1 text-foreground", "placeholder:text-muted-foreground", s, "disabled:cursor-not-allowed disabled:opacity-50", N && "border-destructive focus:border-b-destructive", v),
73
- ...F
71
+ } else z = /* @__PURE__ */ d("input", {
72
+ ref: b,
73
+ className: e(r.root, r.input, "h-8 w-full rounded border border-input border-b-stroke-accessible bg-background px-3 text-body-1 text-foreground", "placeholder:text-muted-foreground", c, "disabled:cursor-not-allowed disabled:opacity-50", P && "border-destructive focus:border-b-destructive", y),
74
+ ...I
74
75
  });
75
- return j ? /* @__PURE__ */ d(l, { children: [R, j] }) : R;
76
+ return M ? /* @__PURE__ */ f(u, { children: [z, M] }) : z;
76
77
  };
77
- h.displayName = "Input";
78
+ g.displayName = "Input";
78
79
  //#endregion
79
- export { h as Input, m as isInvalidLook, p as useControlErrorMessage };
80
+ export { g as Input, h as isInvalidLook, m as useControlErrorMessage };
80
81
 
81
82
  //# sourceMappingURL=Input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.mjs","names":["useId","_jsx","_Fragment","useId$1","isAriaValid","ariaInvalid","useControlErrorMessage","field","useFieldContext","generatedId","invalid","consumerAriaInvalid","error","ownId","messageClassName","messageRest","errorMessageProps","messageId","cn","isInvalidLook","ownError","Input","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaRequired","ariaErrorMessage","props","fieldProps","useFieldControl","joinIds","invalidLook","handleChange","onChange","onValueChange","event","controlProps","hasBefore","slotRendersContent","contentBefore","hasAfter","contentAfter","control","inputProps","inputFocusWithin","className","renderSlot","inputFocus","message","Fragment"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { joinIds } from '../../lib/aria';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { inputFocus, inputFocusWithin, inputInvalid, inputInvalidWithin } from '../../lib/styles';\nimport type { Slot } from '../../lib/types';\nimport { useId } from '../../hooks/useId';\nimport { useFieldContext, useFieldControl } from '../../hooks/useFieldControl';\n\n/**\n * Props of the error message element that {@link Input}, `Select` and `Textarea` render after the\n * control for a string `error` (`id`, `className`, `role`, data attributes, …).\n */\nexport interface InputErrorMessageProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Ref to the message `<span>`. */\n ref?: React.Ref<HTMLSpanElement>;\n /** Any `data-*` attribute. */\n [dataAttribute: `data-${string}`]: unknown;\n}\n\n/**\n * Result of {@link useControlErrorMessage}.\n *\n * @internal Not exported from the package.\n */\nexport interface ControlErrorMessage {\n /**\n * Whether `error` marks the control invalid (a non-empty string or `true`), unless the consumer\n * set `aria-invalid` to `false`/`\"false\"`.\n */\n invalid: boolean;\n /** The id of the rendered message, joined into `aria-describedby`/`aria-errormessage`. */\n messageId: string | undefined;\n /** The message element to render after the control, or `null`. */\n message: React.ReactElement | null;\n}\n\n/** Whether an `aria-invalid` value explicitly reports the control as valid. */\nfunction isAriaValid(ariaInvalid: React.AriaAttributes['aria-invalid']): boolean {\n return ariaInvalid === false || ariaInvalid === 'false';\n}\n\n/**\n * Shared by Input, Select and Textarea (internal): a non-empty string `error` renders a sibling\n * `<span role=\"alert\">` message, unless the surrounding `Field` already renders its own error\n * (`FieldContext.hasErrorMessage`); `true` only marks the control invalid. The consumer's\n * `aria-invalid` of `false`/`\"false\"` wins over `error`: the control is valid, so nothing is\n * marked invalid and no message is rendered or referenced (ARIA: an error message of a valid\n * control is hidden).\n *\n * @internal Not exported from the package.\n */\nexport function useControlErrorMessage(\n error: string | boolean | undefined,\n errorMessageProps: InputErrorMessageProps | undefined,\n consumerAriaInvalid?: React.AriaAttributes['aria-invalid'],\n): ControlErrorMessage {\n const field = useFieldContext();\n const generatedId = useId('error');\n const invalid =\n !isAriaValid(consumerAriaInvalid) &&\n (error === true || (typeof error === 'string' && error !== ''));\n const showMessage = invalid && typeof error === 'string' && !field?.hasErrorMessage;\n if (!showMessage) return { invalid, messageId: undefined, message: null };\n\n const { id: ownId, className: messageClassName, ...messageRest } = errorMessageProps ?? {};\n const messageId = ownId ?? generatedId;\n const message = (\n <span\n role=\"alert\"\n {...messageRest}\n id={messageId}\n className={cn('mt-1 block text-caption-1 text-error', messageClassName)}\n >\n {error}\n </span>\n );\n return { invalid, messageId, message };\n}\n\n/**\n * Whether a text control shows the invalid look (error border), shared by Input, Select, Textarea\n * and SearchBox (internal): its own `error`, or a resolved `aria-invalid` of `true`/`\"true\"` —\n * from the consumer or from the surrounding `Field` (`useFieldControl`) — so the look always\n * matches the state assistive technology reports. A resolved `false`/`\"false\"` (the consumer's\n * override) never shows it, even with an own `error`. `\"grammar\"`/`\"spelling\"` alone do not\n * count; with an own `error` they keep the look (the control is reported invalid).\n *\n * @internal Not exported from the package.\n */\nexport function isInvalidLook(\n ownError: boolean,\n ariaInvalid: React.AriaAttributes['aria-invalid'],\n): boolean {\n if (isAriaValid(ariaInvalid)) return false;\n return ownError || ariaInvalid === true || ariaInvalid === 'true';\n}\n\n/** Properties for the Input component. */\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * Validation error.\n * - A non-empty string renders the message in a `role=\"alert\"` element **after** the field (a\n * sibling, so it does not change which element receives `ref`, `className` or `style`) and\n * links it through `aria-describedby` and `aria-errormessage`. Inside a `Field` that renders\n * its own `error`, the message is not repeated.\n * - `true` only marks the input invalid (`aria-invalid` and the error border), as in 0.4.\n *\n * The error border also shows whenever the input ends up `aria-invalid=\"true\"` without this\n * prop (an `error` on the surrounding `Field`, or your own `aria-invalid`).\n * Your own `aria-invalid={false}` (or `\"false\"`) wins over this prop: the input is reported\n * valid and shows neither the error border nor the message.\n * Use `Field` (`label`, `hint`, `error`) for a complete field layout.\n */\n error?: string | boolean;\n /** Props of the error message element (`id`, `className`, …) rendered for a string `error`. */\n errorMessageProps?: InputErrorMessageProps;\n /**\n * Slot rendered before the input text (e.g., an icon). With content in either slot, a bordered\n * `<span>` around the input draws the field: it receives `className`, `style` and `hidden`,\n * while `ref`, `id`, `aria-*`, `data-*`, handlers and native attributes stay on the `<input>`.\n * A value that renders nothing (`false`, `''`, `[]`) is no slot.\n */\n contentBefore?: Slot<'span'>;\n /** Slot rendered after the input text (e.g., a suffix). Same wrapper as `contentBefore`. */\n contentAfter?: Slot<'span'>;\n /**\n * Called with the new string value on every change, next to the native `onChange` event\n * handler (`onValueChange={setName}` instead of `onChange={(e) => setName(e.target.value)}`).\n */\n onValueChange?: (value: string) => void;\n /** Ref to the `<input>` element (also with `contentBefore`/`contentAfter`). */\n ref?: React.Ref<HTMLInputElement>;\n}\n\n/**\n * A single-line text input with Fluent styling: a 1px border with an accessible bottom stroke, a\n * primary bottom border while focused, optional `contentBefore`/`contentAfter` slots and an\n * optional error message. Inside a `Field` it picks up the label, hint, error, `required` (native\n * attribute) and invalid state automatically.\n *\n * Every prop reaches the `<input>`, except with slot content: then a bordered `<span>` wrapper\n * draws the field and receives `className`, `style` and `hidden` (`ref` stays on the input).\n *\n * @example\n * <Field label=\"Email\" hint=\"We never share it\" required>\n * <Input type=\"email\" value={email} onValueChange={setEmail} />\n * </Field>\n */\nexport const Input = ({\n error,\n errorMessageProps,\n contentBefore,\n contentAfter,\n onChange,\n onValueChange,\n className,\n ref,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n 'aria-errormessage': ariaErrorMessage,\n required,\n ...props\n}: InputProps) => {\n const { invalid, messageId, message } = useControlErrorMessage(\n error,\n errorMessageProps,\n ariaInvalid,\n );\n const fieldProps = useFieldControl(\n {\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': joinIds(ariaDescribedBy, messageId),\n 'aria-invalid': ariaInvalid ?? (invalid || undefined),\n 'aria-required': ariaRequired,\n required,\n },\n { nativeRequired: true },\n );\n const invalidLook = isInvalidLook(invalid, fieldProps['aria-invalid']);\n\n const handleChange =\n onChange || onValueChange\n ? (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }\n : undefined;\n\n const controlProps = {\n ...props,\n ...fieldProps,\n 'aria-errormessage': joinIds(ariaErrorMessage, messageId),\n onChange: handleChange,\n };\n\n const hasBefore = slotRendersContent(contentBefore);\n const hasAfter = slotRendersContent(contentAfter);\n\n let control: React.ReactElement;\n if (hasBefore || hasAfter) {\n // The bordered wrapper is the visible field: `className`, `style` and `hidden` size, style and\n // hide it; `ref`, `id`, `aria-*`, `data-*`, handlers and native attributes go to the input.\n const { style, hidden, ...inputProps } = controlProps;\n control = (\n <span\n hidden={hidden}\n style={style}\n className={cn(\n 'inline-flex h-8 w-full items-center rounded border border-input border-b-stroke-accessible bg-background text-body-1 text-foreground',\n inputFocusWithin,\n invalidLook && inputInvalidWithin,\n // The dimmed look lifts while a focus ring shows inside the wrapper (focusable slot\n // content; the disabled input never takes focus): opacity would dim the ring below 3:1.\n props.disabled && 'cursor-not-allowed opacity-50 has-focus-visible:opacity-100',\n className,\n )}\n >\n {hasBefore && renderSlot(contentBefore, 'span', 'shrink-0 ps-2')}\n <input\n ref={ref}\n className={cn(\n 'h-full w-full min-w-0 bg-transparent px-2 text-body-1 text-foreground',\n 'placeholder:text-muted-foreground',\n 'focus:outline-hidden',\n 'disabled:cursor-not-allowed',\n )}\n {...inputProps}\n />\n {hasAfter && renderSlot(contentAfter, 'span', 'shrink-0 pe-2')}\n </span>\n );\n } else {\n control = (\n <input\n ref={ref}\n className={cn(\n 'h-8 w-full rounded border border-input border-b-stroke-accessible bg-background px-3 text-body-1 text-foreground',\n 'placeholder:text-muted-foreground',\n inputFocus,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n invalidLook && inputInvalid,\n className,\n )}\n {...controlProps}\n />\n );\n }\n\n if (!message) return control;\n return (\n <>\n {control}\n {message}\n </>\n );\n};\n\nInput.displayName = 'Input';\n"],"mappings":";;;;;;;;;;AAsCA,SAASI,EAAY,GAA4D;CAC/E,OAAOC,MAAgB,MAASA,MAAgB;AAClD;AAYA,SAAgBC,EACd,GACA,GACA,GACqB;CACrB,IAAMC,IAAQC,EAAgB,GACxBC,IAAcT,EAAM,OAAO,GAC3BU,IACJ,CAACN,EAAYO,CAAmB,MAC/BC,MAAU,MAAS,OAAOA,KAAU,YAAYA,MAAU;CAE7D,IADoB,MAAW,OAAOA,KAAU,YAAaL,GAAO,iBAClD,OAAO;EAAE;EAAS,WAAW,KAAA;EAAW,SAAS;CAAK;CAExE,IAAM,EAAE,IAAIM,GAAO,WAAWC,GAAkB,GAAGC,MAAgBC,KAAqB,CAAC,GACnFC,IAAYJ,KAASJ;CAW3B,OAAO;EAAE;EAAS;EAAW,SAT3BR,kBAAC,QAAD;GACE,MAAK;GACL,GAAIc;GACJ,IAAIE;GACJ,WAAWC,EAAG,wCAAwCJ,CAAgB;GAErE,UAAAF;EACG,CAEqB;CAAQ;AACvC;AAYA,SAAgBO,EACd,GACA,GACS;CAET,OADIf,EAAYC,CAAW,IAAU,KAC9Be,KAAYf,MAAgB,MAAQA,MAAgB;AAC7D;AAqDA,IAAagB,KAAS,EACpB,UACA,sBACA,kBACA,iBACA,aACA,kBACA,cACA,QACA,OACA,cAAcC,GACd,mBAAmBC,GACnB,oBAAoBC,GACpB,gBAAgBnB,GAChB,iBAAiBoB,GACjB,qBAAqBC,GACrB,aACA,GAAGC,QACa;CAChB,IAAM,EAAE,YAAS,cAAW,eAAYrB,EACtCM,GACAI,GACAX,CACF,GACMuB,IAAaC,EACjB;EACE;EACA,cAAcP;EACd,mBAAmBC;EACnB,oBAAoBO,EAAQN,GAAiBP,CAAS;EACtD,gBAAgBZ,MAAgBK,KAAW,KAAA;EAC3C,iBAAiBe;EACjB;CACF,GACA,EAAE,gBAAgB,GAAK,CACzB,GACMM,IAAcZ,EAAcT,GAASkB,EAAW,eAAe,GAE/DI,IACJC,KAAYC,KACP,MAA+C;EAE9C,AADAD,IAAWE,CAAK,GAChBD,IAAgBC,EAAM,cAAc,KAAK;CAC3C,IACA,KAAA,GAEAC,IAAe;EACnB,GAAGT;EACH,GAAGC;EACH,qBAAqBE,EAAQJ,GAAkBT,CAAS;EACxD,UAAUe;CACZ,GAEMK,IAAYC,EAAmBC,CAAa,GAC5CC,IAAWF,EAAmBG,CAAY,GAE5CC;CACJ,IAAIL,KAAaG,GAAU;EAGzB,IAAM,EAAE,UAAO,WAAQ,GAAGG,MAAeP;EACzC,IACE,kBAAC,QAAD;GACU;GACD;GACP,WAAWlB,EACT,wIACA0B,GACAb,KAAA,wDAGAJ,EAAM,YAAY,+DAClBkB,CACF;GAXF,UAAA;IAaGR,KAAaS,EAAWP,GAAe,QAAQ,eAAe;IAC/D,kBAAC,SAAD;KACO;KACL,WAAWrB,EACT,yEACA,qCACA,wBACA,6BACF;KACA,GAAIyB;IACL,CAAA;IACAH,KAAYM,EAAWL,GAAc,QAAQ,eAAe;GACzD;;CAEV,OACE,IACE,kBAAC,SAAD;EACO;EACL,WAAWvB,EACT,oHACA,qCACA6B,GACA,mDACAhB,KAAA,iDACAc,CACF;EACA,GAAIT;CACL,CAAA;CAKL,OADKY,IAEH,kBAAA9C,GAAA,EAAA,UAAA,CACGwC,GACAM,CACD,EAAA,CAAA,IALiBN;AAOvB;AAEA,EAAM,cAAc"}
1
+ {"version":3,"file":"Input.mjs","names":["useId","_jsx","_Fragment","useId$1","isAriaValid","ariaInvalid","useControlErrorMessage","field","useFieldContext","generatedId","invalid","consumerAriaInvalid","error","ownId","messageClassName","messageRest","errorMessageProps","messageId","cn","partClassName","isInvalidLook","ownError","Input","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaRequired","ariaErrorMessage","props","inputClassNames","fieldProps","useFieldControl","joinIds","invalidLook","handleChange","onChange","onValueChange","event","controlProps","hasBefore","slotRendersContent","contentBefore","hasAfter","contentAfter","control","inputProps","inputFocusWithin","className","renderSlot","inputFocus","message","Fragment"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { joinIds } from '../../lib/aria';\nimport { inputClassNames } from '../../lib/classNames';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { inputFocus, inputFocusWithin, inputInvalid, inputInvalidWithin } from '../../lib/styles';\nimport type { Slot } from '../../lib/types';\nimport { useId } from '../../hooks/useId';\nimport { useFieldContext, useFieldControl } from '../../hooks/useFieldControl';\n\n/**\n * Props of the error message element that {@link Input}, `Select` and `Textarea` render after the\n * control for a string `error` (`id`, `className`, `role`, data attributes, …).\n */\nexport interface InputErrorMessageProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Ref to the message `<span>`. */\n ref?: React.Ref<HTMLSpanElement>;\n /** Any `data-*` attribute. */\n [dataAttribute: `data-${string}`]: unknown;\n}\n\n/**\n * Result of {@link useControlErrorMessage}.\n *\n * @internal Not exported from the package.\n */\nexport interface ControlErrorMessage {\n /**\n * Whether `error` marks the control invalid (a non-empty string or `true`), unless the consumer\n * set `aria-invalid` to `false`/`\"false\"`.\n */\n invalid: boolean;\n /** The id of the rendered message, joined into `aria-describedby`/`aria-errormessage`. */\n messageId: string | undefined;\n /** The message element to render after the control, or `null`. */\n message: React.ReactElement | null;\n}\n\n/** Whether an `aria-invalid` value explicitly reports the control as valid. */\nfunction isAriaValid(ariaInvalid: React.AriaAttributes['aria-invalid']): boolean {\n return ariaInvalid === false || ariaInvalid === 'false';\n}\n\n/**\n * Shared by Input, Select and Textarea (internal): a non-empty string `error` renders a sibling\n * `<span role=\"alert\">` message, unless the surrounding `Field` already renders its own error\n * (`FieldContext.hasErrorMessage`); `true` only marks the control invalid. The consumer's\n * `aria-invalid` of `false`/`\"false\"` wins over `error`: the control is valid, so nothing is\n * marked invalid and no message is rendered or referenced (ARIA: an error message of a valid\n * control is hidden).\n *\n * `partClassName` is the host's stable `errorMessage` class, first in the message's classes\n * (Input, Select and Textarea each pass their own).\n *\n * @internal Not exported from the package.\n */\nexport function useControlErrorMessage(\n error: string | boolean | undefined,\n errorMessageProps: InputErrorMessageProps | undefined,\n consumerAriaInvalid?: React.AriaAttributes['aria-invalid'],\n partClassName?: string,\n): ControlErrorMessage {\n const field = useFieldContext();\n const generatedId = useId('error');\n const invalid =\n !isAriaValid(consumerAriaInvalid) &&\n (error === true || (typeof error === 'string' && error !== ''));\n const showMessage = invalid && typeof error === 'string' && !field?.hasErrorMessage;\n if (!showMessage) return { invalid, messageId: undefined, message: null };\n\n const { id: ownId, className: messageClassName, ...messageRest } = errorMessageProps ?? {};\n const messageId = ownId ?? generatedId;\n const message = (\n <span\n role=\"alert\"\n {...messageRest}\n id={messageId}\n className={cn(partClassName, 'mt-1 block text-caption-1 text-error', messageClassName)}\n >\n {error}\n </span>\n );\n return { invalid, messageId, message };\n}\n\n/**\n * Whether a text control shows the invalid look (error border), shared by Input, Select, Textarea\n * and SearchBox (internal): its own `error`, or a resolved `aria-invalid` of `true`/`\"true\"` —\n * from the consumer or from the surrounding `Field` (`useFieldControl`) — so the look always\n * matches the state assistive technology reports. A resolved `false`/`\"false\"` (the consumer's\n * override) never shows it, even with an own `error`. `\"grammar\"`/`\"spelling\"` alone do not\n * count; with an own `error` they keep the look (the control is reported invalid).\n *\n * @internal Not exported from the package.\n */\nexport function isInvalidLook(\n ownError: boolean,\n ariaInvalid: React.AriaAttributes['aria-invalid'],\n): boolean {\n if (isAriaValid(ariaInvalid)) return false;\n return ownError || ariaInvalid === true || ariaInvalid === 'true';\n}\n\n/** Properties for the Input component. */\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * Validation error.\n * - A non-empty string renders the message in a `role=\"alert\"` element **after** the field (a\n * sibling, so it does not change which element receives `ref`, `className` or `style`) and\n * links it through `aria-describedby` and `aria-errormessage`. Inside a `Field` that renders\n * its own `error`, the message is not repeated.\n * - `true` only marks the input invalid (`aria-invalid` and the error border), as in 0.4.\n *\n * The error border also shows whenever the input ends up `aria-invalid=\"true\"` without this\n * prop (an `error` on the surrounding `Field`, or your own `aria-invalid`).\n * Your own `aria-invalid={false}` (or `\"false\"`) wins over this prop: the input is reported\n * valid and shows neither the error border nor the message.\n * Use `Field` (`label`, `hint`, `error`) for a complete field layout.\n */\n error?: string | boolean;\n /** Props of the error message element (`id`, `className`, …) rendered for a string `error`. */\n errorMessageProps?: InputErrorMessageProps;\n /**\n * Slot rendered before the input text (e.g., an icon). With content in either slot, a bordered\n * `<span>` around the input draws the field: it receives `className`, `style` and `hidden`,\n * while `ref`, `id`, `aria-*`, `data-*`, handlers and native attributes stay on the `<input>`.\n * A value that renders nothing (`false`, `''`, `[]`) is no slot.\n */\n contentBefore?: Slot<'span'>;\n /** Slot rendered after the input text (e.g., a suffix). Same wrapper as `contentBefore`. */\n contentAfter?: Slot<'span'>;\n /**\n * Called with the new string value on every change, next to the native `onChange` event\n * handler (`onValueChange={setName}` instead of `onChange={(e) => setName(e.target.value)}`).\n */\n onValueChange?: (value: string) => void;\n /** Ref to the `<input>` element (also with `contentBefore`/`contentAfter`). */\n ref?: React.Ref<HTMLInputElement>;\n}\n\n/**\n * A single-line text input with Fluent styling: a 1px border with an accessible bottom stroke, a\n * primary bottom border while focused, optional `contentBefore`/`contentAfter` slots and an\n * optional error message. Inside a `Field` it picks up the label, hint, error, `required` (native\n * attribute) and invalid state automatically.\n *\n * Every prop reaches the `<input>`, except with slot content: then a bordered `<span>` wrapper\n * draws the field and receives `className`, `style` and `hidden` (`ref` stays on the input).\n *\n * @example\n * <Field label=\"Email\" hint=\"We never share it\" required>\n * <Input type=\"email\" value={email} onValueChange={setEmail} />\n * </Field>\n */\nexport const Input = ({\n error,\n errorMessageProps,\n contentBefore,\n contentAfter,\n onChange,\n onValueChange,\n className,\n ref,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n 'aria-errormessage': ariaErrorMessage,\n required,\n ...props\n}: InputProps) => {\n const { invalid, messageId, message } = useControlErrorMessage(\n error,\n errorMessageProps,\n ariaInvalid,\n inputClassNames.errorMessage,\n );\n const fieldProps = useFieldControl(\n {\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': joinIds(ariaDescribedBy, messageId),\n 'aria-invalid': ariaInvalid ?? (invalid || undefined),\n 'aria-required': ariaRequired,\n required,\n },\n { nativeRequired: true },\n );\n const invalidLook = isInvalidLook(invalid, fieldProps['aria-invalid']);\n\n const handleChange =\n onChange || onValueChange\n ? (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }\n : undefined;\n\n const controlProps = {\n ...props,\n ...fieldProps,\n 'aria-errormessage': joinIds(ariaErrorMessage, messageId),\n onChange: handleChange,\n };\n\n const hasBefore = slotRendersContent(contentBefore);\n const hasAfter = slotRendersContent(contentAfter);\n\n let control: React.ReactElement;\n if (hasBefore || hasAfter) {\n // The bordered wrapper is the visible field: `className`, `style` and `hidden` size, style and\n // hide it; `ref`, `id`, `aria-*`, `data-*`, handlers and native attributes go to the input.\n const { style, hidden, ...inputProps } = controlProps;\n control = (\n <span\n hidden={hidden}\n style={style}\n className={cn(\n inputClassNames.root,\n 'inline-flex h-8 w-full items-center rounded border border-input border-b-stroke-accessible bg-background text-body-1 text-foreground',\n inputFocusWithin,\n invalidLook && inputInvalidWithin,\n // The dimmed look lifts while a focus ring shows inside the wrapper (focusable slot\n // content; the disabled input never takes focus): opacity would dim the ring below 3:1.\n props.disabled && 'cursor-not-allowed opacity-50 has-focus-visible:opacity-100',\n className,\n )}\n >\n {hasBefore &&\n renderSlot(contentBefore, 'span', cn(inputClassNames.contentBefore, 'shrink-0 ps-2'))}\n <input\n ref={ref}\n className={cn(\n inputClassNames.input,\n 'h-full w-full min-w-0 bg-transparent px-2 text-body-1 text-foreground',\n 'placeholder:text-muted-foreground',\n 'focus:outline-hidden',\n 'disabled:cursor-not-allowed',\n )}\n {...inputProps}\n />\n {hasAfter &&\n renderSlot(contentAfter, 'span', cn(inputClassNames.contentAfter, 'shrink-0 pe-2'))}\n </span>\n );\n } else {\n control = (\n <input\n ref={ref}\n className={cn(\n inputClassNames.root,\n inputClassNames.input,\n 'h-8 w-full rounded border border-input border-b-stroke-accessible bg-background px-3 text-body-1 text-foreground',\n 'placeholder:text-muted-foreground',\n inputFocus,\n 'disabled:cursor-not-allowed disabled:opacity-50',\n invalidLook && inputInvalid,\n className,\n )}\n {...controlProps}\n />\n );\n }\n\n if (!message) return control;\n return (\n <>\n {control}\n {message}\n </>\n );\n};\n\nInput.displayName = 'Input';\n"],"mappings":";;;;;;;;;;;AAuCA,SAASI,EAAY,GAA4D;CAC/E,OAAOC,MAAgB,MAASA,MAAgB;AAClD;AAeA,SAAgBC,EACd,GACA,GACA,GACA,GACqB;CACrB,IAAMC,IAAQC,EAAgB,GACxBC,IAAcT,EAAM,OAAO,GAC3BU,IACJ,CAACN,EAAYO,CAAmB,MAC/BC,MAAU,MAAS,OAAOA,KAAU,YAAYA,MAAU;CAE7D,IADoB,MAAW,OAAOA,KAAU,YAAaL,GAAO,iBAClD,OAAO;EAAE;EAAS,WAAW,KAAA;EAAW,SAAS;CAAK;CAExE,IAAM,EAAE,IAAIM,GAAO,WAAWC,GAAkB,GAAGC,MAAgBC,KAAqB,CAAC,GACnFC,IAAYJ,KAASJ;CAW3B,OAAO;EAAE;EAAS;EAAW,SAT3BR,kBAAC,QAAD;GACE,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GW,EAAgB,eAAe,eAAe,CAAC;IACtF,kBAAC,SAAD;KACO;KACL,WAAWX,EACTW,EAAgB,OAChB,yEACA,qCACA,wBACA,6BACF;KACA,GAAIgB;IACL,CAAA;IACAH,KACCM,EAAWL,GAAc,QAAQzB,EAAGW,EAAgB,cAAc,eAAe,CAAC;GAChF;;CAEV,OACE,IACE,kBAAC,SAAD;EACO;EACL,WAAWX,EACTW,EAAgB,MAChBA,EAAgB,OAChB,oHACA,qCACAoB,GACA,mDACAhB,KAAA,iDACAc,CACF;EACA,GAAIT;CACL,CAAA;CAKL,OADKY,IAEH,kBAAAhD,GAAA,EAAA,UAAA,CACG0C,GACAM,CACD,EAAA,CAAA,IALiBN;AAOvB;AAEA,EAAM,cAAc"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={small:`text-caption-1`,medium:`text-body-1`,large:`text-body-2`},a={regular:void 0,semibold:`font-semibold`,bold:`font-bold`},o=({required:e=!1,disabled:n=!1,size:o=`medium`,weight:s=`regular`,className:c,children:l,ref:u,...d})=>(0,r.jsxs)(`label`,{ref:u,className:t.cn(n?`text-muted-foreground`:`text-foreground`,i[o],a[s],c),...d,children:[l,e&&(0,r.jsx)(`span`,{className:`ms-1 text-error`,"aria-hidden":`true`,children:`*`})]});o.displayName=`Label`,exports.Label=o;
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/classNames.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={small:`text-caption-1`,medium:`text-body-1`,large:`text-body-2`},o={regular:void 0,semibold:`font-semibold`,bold:`font-bold`},s=({required:e=!1,disabled:r=!1,size:s=`medium`,weight:c=`regular`,className:l,children:u,ref:d,...f})=>(0,i.jsxs)(`label`,{ref:d,className:t.cn(n.labelClassNames.root,r?`text-muted-foreground`:`text-foreground`,a[s],o[c],l),...f,children:[u,e&&(0,i.jsx)(`span`,{className:t.cn(n.labelClassNames.required,`ms-1 text-error`),"aria-hidden":`true`,children:`*`})]});s.displayName=`Label`,exports.Label=s;
2
2
  //# sourceMappingURL=Label.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.cjs","names":["cn","require_runtime","require_cn","react","react_jsx_runtime","sizeMap","weightMap","Label","rest","disabled","size","weight","className","children","required"],"sources":["../../../src/components/input/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { Size, TextWeight } from '../../lib/types';\n\n/** Properties for the Label component. */\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n /** Whether to show a required indicator asterisk (hidden from assistive technology; mark the\n * control itself `required`).\n * @default false\n */\n required?: boolean;\n /** Whether the label is visually dimmed.\n * @default false\n */\n disabled?: boolean;\n /** Text size of the label: `small` = caption-1, `medium` = body-1, `large` = body-2.\n * @default 'medium'\n */\n size?: Extract<Size, 'small' | 'medium' | 'large'>;\n /** Font weight of the label (the shared `TextWeight` vocabulary).\n * @default 'regular'\n */\n weight?: TextWeight;\n /** Ref to the `<label>` element. */\n ref?: React.Ref<HTMLLabelElement>;\n}\n\nconst sizeMap: Record<'small' | 'medium' | 'large', string> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\nconst weightMap: Record<TextWeight, string | undefined> = {\n regular: undefined,\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\n/**\n * A text label for a form control (`htmlFor`), on the Fluent type ramp. The optional required\n * asterisk is decorative (`aria-hidden`). `Field` renders its own label; use `Label` for custom\n * layouts.\n *\n * @example\n * <Label htmlFor=\"email\" required>Email</Label>\n * <Input id=\"email\" required />\n */\nexport const Label = ({\n required = false,\n disabled = false,\n size = 'medium',\n weight = 'regular',\n className,\n children,\n ref,\n ...rest\n}: LabelProps) => {\n return (\n <label\n ref={ref}\n className={cn(\n disabled ? 'text-muted-foreground' : 'text-foreground',\n sizeMap[size],\n weightMap[weight],\n className,\n )}\n {...rest}\n >\n {children}\n {required && (\n <span className=\"ms-1 text-error\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n );\n};\n\nLabel.displayName = 'Label';\n"],"mappings":"8KA2BA,IAAMK,EAAwD,CAC5D,MAAO,iBACP,OAAQ,cACR,MAAO,aACT,EAEMC,EAAoD,CACxD,QAAS,IAAA,GACT,SAAU,gBACV,KAAM,WACR,EAWaC,GAAS,CACpB,WAAW,GACX,WAAW,GACX,OAAO,SACP,SAAS,UACT,YACA,WACA,MACA,GAAGC,MAGD,EAAAJ,EAAA,KAAA,CAAC,QAAD,CACO,MACL,UAAWJ,EAAAA,GACTS,EAAW,wBAA0B,kBACrCJ,EAAQK,GACRJ,EAAUK,GACVC,CACF,EACA,GAAIJ,EARN,SAAA,CAUGK,EACAC,IACC,EAAAV,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,kBAAkB,cAAY,OAAO,SAAA,GAE/C,CAAA,CAEH,IAIX,EAAM,YAAc"}
1
+ {"version":3,"file":"Label.cjs","names":["cn","labelClassNames","require_runtime","require_cn","require_classNames","react","react_jsx_runtime","sizeMap","weightMap","Label","rest","disabled","size","weight","className","children","required"],"sources":["../../../src/components/input/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { labelClassNames } from '../../lib/classNames';\nimport type { Size, TextWeight } from '../../lib/types';\n\n/** Properties for the Label component. */\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n /** Whether to show a required indicator asterisk (hidden from assistive technology; mark the\n * control itself `required`).\n * @default false\n */\n required?: boolean;\n /** Whether the label is visually dimmed.\n * @default false\n */\n disabled?: boolean;\n /** Text size of the label: `small` = caption-1, `medium` = body-1, `large` = body-2.\n * @default 'medium'\n */\n size?: Extract<Size, 'small' | 'medium' | 'large'>;\n /** Font weight of the label (the shared `TextWeight` vocabulary).\n * @default 'regular'\n */\n weight?: TextWeight;\n /** Ref to the `<label>` element. */\n ref?: React.Ref<HTMLLabelElement>;\n}\n\nconst sizeMap: Record<'small' | 'medium' | 'large', string> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\nconst weightMap: Record<TextWeight, string | undefined> = {\n regular: undefined,\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\n/**\n * A text label for a form control (`htmlFor`), on the Fluent type ramp. The optional required\n * asterisk is decorative (`aria-hidden`). `Field` renders its own label; use `Label` for custom\n * layouts.\n *\n * @example\n * <Label htmlFor=\"email\" required>Email</Label>\n * <Input id=\"email\" required />\n */\nexport const Label = ({\n required = false,\n disabled = false,\n size = 'medium',\n weight = 'regular',\n className,\n children,\n ref,\n ...rest\n}: LabelProps) => {\n return (\n <label\n ref={ref}\n className={cn(\n labelClassNames.root,\n disabled ? 'text-muted-foreground' : 'text-foreground',\n sizeMap[size],\n weightMap[weight],\n className,\n )}\n {...rest}\n >\n {children}\n {required && (\n <span className={cn(labelClassNames.required, 'ms-1 text-error')} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n );\n};\n\nLabel.displayName = 'Label';\n"],"mappings":"oNA4BA,IAAMO,EAAwD,CAC5D,MAAO,iBACP,OAAQ,cACR,MAAO,aACT,EAEMC,EAAoD,CACxD,QAAS,IAAA,GACT,SAAU,gBACV,KAAM,WACR,EAWaC,GAAS,CACpB,WAAW,GACX,WAAW,GACX,OAAO,SACP,SAAS,UACT,YACA,WACA,MACA,GAAGC,MAGD,EAAAJ,EAAA,KAAA,CAAC,QAAD,CACO,MACL,UAAWN,EAAAA,GACTC,EAAAA,gBAAgB,KAChBU,EAAW,wBAA0B,kBACrCJ,EAAQK,GACRJ,EAAUK,GACVC,CACF,EACA,GAAIJ,EATN,SAAA,CAWGK,EACAC,IACC,EAAAV,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWN,EAAAA,GAAGC,EAAAA,gBAAgB,SAAU,iBAAiB,EAAG,cAAY,OAAO,SAAA,GAE/E,CAAA,CAEH,IAIX,EAAM,YAAc"}
@@ -1,28 +1,29 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/cn.mjs";
3
+ import { labelClassNames as t } from "../../lib/classNames.mjs";
3
4
  import "react";
4
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
6
  //#region src/components/input/Label.tsx
6
- var r = {
7
+ var i = {
7
8
  small: "text-caption-1",
8
9
  medium: "text-body-1",
9
10
  large: "text-body-2"
10
- }, i = {
11
+ }, a = {
11
12
  regular: void 0,
12
13
  semibold: "font-semibold",
13
14
  bold: "font-bold"
14
- }, a = ({ required: a = !1, disabled: o = !1, size: s = "medium", weight: c = "regular", className: l, children: u, ref: d, ...f }) => /* @__PURE__ */ n("label", {
15
- ref: d,
16
- className: e(o ? "text-muted-foreground" : "text-foreground", r[s], i[c], l),
17
- ...f,
18
- children: [u, a && /* @__PURE__ */ t("span", {
19
- className: "ms-1 text-error",
15
+ }, o = ({ required: o = !1, disabled: s = !1, size: c = "medium", weight: l = "regular", className: u, children: d, ref: f, ...p }) => /* @__PURE__ */ r("label", {
16
+ ref: f,
17
+ className: e(t.root, s ? "text-muted-foreground" : "text-foreground", i[c], a[l], u),
18
+ ...p,
19
+ children: [d, o && /* @__PURE__ */ n("span", {
20
+ className: e(t.required, "ms-1 text-error"),
20
21
  "aria-hidden": "true",
21
22
  children: "*"
22
23
  })]
23
24
  });
24
- a.displayName = "Label";
25
+ o.displayName = "Label";
25
26
  //#endregion
26
- export { a as Label };
27
+ export { o as Label };
27
28
 
28
29
  //# sourceMappingURL=Label.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.mjs","names":["sizeMap","weightMap","Label","rest","cn","disabled","size","weight","className","children","required"],"sources":["../../../src/components/input/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { Size, TextWeight } from '../../lib/types';\n\n/** Properties for the Label component. */\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n /** Whether to show a required indicator asterisk (hidden from assistive technology; mark the\n * control itself `required`).\n * @default false\n */\n required?: boolean;\n /** Whether the label is visually dimmed.\n * @default false\n */\n disabled?: boolean;\n /** Text size of the label: `small` = caption-1, `medium` = body-1, `large` = body-2.\n * @default 'medium'\n */\n size?: Extract<Size, 'small' | 'medium' | 'large'>;\n /** Font weight of the label (the shared `TextWeight` vocabulary).\n * @default 'regular'\n */\n weight?: TextWeight;\n /** Ref to the `<label>` element. */\n ref?: React.Ref<HTMLLabelElement>;\n}\n\nconst sizeMap: Record<'small' | 'medium' | 'large', string> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\nconst weightMap: Record<TextWeight, string | undefined> = {\n regular: undefined,\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\n/**\n * A text label for a form control (`htmlFor`), on the Fluent type ramp. The optional required\n * asterisk is decorative (`aria-hidden`). `Field` renders its own label; use `Label` for custom\n * layouts.\n *\n * @example\n * <Label htmlFor=\"email\" required>Email</Label>\n * <Input id=\"email\" required />\n */\nexport const Label = ({\n required = false,\n disabled = false,\n size = 'medium',\n weight = 'regular',\n className,\n children,\n ref,\n ...rest\n}: LabelProps) => {\n return (\n <label\n ref={ref}\n className={cn(\n disabled ? 'text-muted-foreground' : 'text-foreground',\n sizeMap[size],\n weightMap[weight],\n className,\n )}\n {...rest}\n >\n {children}\n {required && (\n <span className=\"ms-1 text-error\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n );\n};\n\nLabel.displayName = 'Label';\n"],"mappings":";;;;;AA2BA,IAAMA,IAAwD;CAC5D,OAAO;CACP,QAAQ;CACR,OAAO;AACT,GAEMC,IAAoD;CACxD,SAAS,KAAA;CACT,UAAU;CACV,MAAM;AACR,GAWaC,KAAS,EACpB,cAAW,IACX,cAAW,IACX,UAAO,UACP,YAAS,WACT,cACA,aACA,QACA,GAAGC,QAGD,kBAAC,SAAD;CACO;CACL,WAAWC,EACTC,IAAW,0BAA0B,mBACrCL,EAAQM,IACRL,EAAUM,IACVC,CACF;CACA,GAAIL;CARN,UAAA,CAUGM,GACAC,KACC,kBAAC,QAAD;EAAM,WAAU;EAAkB,eAAY;EAAO,UAAA;CAE/C,CAAA,CAEH;;AAIX,EAAM,cAAc"}
1
+ {"version":3,"file":"Label.mjs","names":["sizeMap","weightMap","Label","rest","cn","labelClassNames","disabled","size","weight","className","children","required"],"sources":["../../../src/components/input/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { labelClassNames } from '../../lib/classNames';\nimport type { Size, TextWeight } from '../../lib/types';\n\n/** Properties for the Label component. */\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n /** Whether to show a required indicator asterisk (hidden from assistive technology; mark the\n * control itself `required`).\n * @default false\n */\n required?: boolean;\n /** Whether the label is visually dimmed.\n * @default false\n */\n disabled?: boolean;\n /** Text size of the label: `small` = caption-1, `medium` = body-1, `large` = body-2.\n * @default 'medium'\n */\n size?: Extract<Size, 'small' | 'medium' | 'large'>;\n /** Font weight of the label (the shared `TextWeight` vocabulary).\n * @default 'regular'\n */\n weight?: TextWeight;\n /** Ref to the `<label>` element. */\n ref?: React.Ref<HTMLLabelElement>;\n}\n\nconst sizeMap: Record<'small' | 'medium' | 'large', string> = {\n small: 'text-caption-1',\n medium: 'text-body-1',\n large: 'text-body-2',\n};\n\nconst weightMap: Record<TextWeight, string | undefined> = {\n regular: undefined,\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\n/**\n * A text label for a form control (`htmlFor`), on the Fluent type ramp. The optional required\n * asterisk is decorative (`aria-hidden`). `Field` renders its own label; use `Label` for custom\n * layouts.\n *\n * @example\n * <Label htmlFor=\"email\" required>Email</Label>\n * <Input id=\"email\" required />\n */\nexport const Label = ({\n required = false,\n disabled = false,\n size = 'medium',\n weight = 'regular',\n className,\n children,\n ref,\n ...rest\n}: LabelProps) => {\n return (\n <label\n ref={ref}\n className={cn(\n labelClassNames.root,\n disabled ? 'text-muted-foreground' : 'text-foreground',\n sizeMap[size],\n weightMap[weight],\n className,\n )}\n {...rest}\n >\n {children}\n {required && (\n <span className={cn(labelClassNames.required, 'ms-1 text-error')} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n );\n};\n\nLabel.displayName = 'Label';\n"],"mappings":";;;;;;AA4BA,IAAMA,IAAwD;CAC5D,OAAO;CACP,QAAQ;CACR,OAAO;AACT,GAEMC,IAAoD;CACxD,SAAS,KAAA;CACT,UAAU;CACV,MAAM;AACR,GAWaC,KAAS,EACpB,cAAW,IACX,cAAW,IACX,UAAO,UACP,YAAS,WACT,cACA,aACA,QACA,GAAGC,QAGD,kBAAC,SAAD;CACO;CACL,WAAWC,EACTC,EAAgB,MAChBC,IAAW,0BAA0B,mBACrCN,EAAQO,IACRN,EAAUO,IACVC,CACF;CACA,GAAIN;CATN,UAAA,CAWGO,GACAC,KACC,kBAAC,QAAD;EAAM,WAAWP,EAAGC,EAAgB,UAAU,iBAAiB;EAAG,eAAY;EAAO,UAAA;CAE/E,CAAA,CAEH;;AAIX,EAAM,cAAc"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/composeEventHandlers.cjs"),r=require("../../hooks/useId.cjs"),i=require("../../hooks/useMergedRefs.cjs"),a=require("../../hooks/useDismiss.cjs"),o=require("../portal/Portal.cjs"),s=require("../../lib/styles.cjs"),c=require("../../lib/icons.cjs"),l=require("../../hooks/useListbox.cjs"),u=require("../../hooks/usePopupPosition.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p=d.createContext(!0);p.displayName=`OptionCheckContext`;var m=t.cn(`flex cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-body-1 text-foreground`,`bg-(--option-bg) [--option-bg:transparent]`,`not-disabled:not-aria-disabled:hover:[--option-bg:var(--wave-subtle-hover)]`,`data-[selected]:[--option-bg:var(--wave-subtle-selected)]`,`data-[active]:[--option-bg:var(--wave-subtle-hover)]`,`data-[active]:outline-2 data-[active]:-outline-offset-2 data-[active]:outline-ring`,`aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground`),h=class{counts=new Map;listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});add(e){return this.counts.set(e,(this.counts.get(e)??0)+1),this.notify(),()=>{let t=(this.counts.get(e)??1)-1;t>0?this.counts.set(e,t):this.counts.delete(e),this.notify()}}allHidden(e){if(e===void 0||this.counts.size===0)return!1;for(let t of this.counts.keys())if(!e.isHidden(t))return!1;return!0}notify(){for(let e of[...this.listeners])e()}},g=d.createContext([]);g.displayName=`OptionGroupContext`;var _=d.createContext(!1);_.displayName=`OptionGroupHiddenContext`;function v(e){let t=d.useContext(g);d.useLayoutEffect(()=>{if(t.length===0)return;let n=t.map(t=>t.add(e));return()=>{for(let e of n)e()}},[t,e])}function y(e){let{value:r,label:i,textValue:a,disabled:o=!1,hidden:u=!1,className:h,children:g,onClick:y,onPointerMove:b,ref:x,...S}=e,C=d.useContext(p),w=d.useContext(_),{selected:T,optionProps:E}=l.useListboxOption({value:r,label:i,textValue:a,disabled:o,hidden:u||w},x);v(r);let{ref:D,onClick:O,onPointerMove:k,...A}=E;return(0,f.jsxs)(`li`,{"data-value":r,...S,...A,ref:D,onClick:n.composeEventHandlers(y,O),onPointerMove:n.composeEventHandlers(b,k),className:t.cn(m,T&&s.forcedColors.selectedContainer,h),children:[C&&(0,f.jsx)(c.CheckIcon,{className:t.cn(`shrink-0`,!T&&`invisible`)}),(0,f.jsx)(`span`,{className:`min-w-0 flex-1`,children:g??r})]})}y.displayName=`Option`;var b=d.memo(y);b.displayName=`Option`;var x=l.markListboxElement(b,`option`);function S({label:e,className:t,children:n,hidden:i,ref:a,...o}){let s=r.useId(`option-group`),c=d.useContext(l.ListboxContext)?.store,u=d.useContext(g),p=d.useContext(_)||!!i,[m]=d.useState(()=>new h),v=d.useMemo(()=>[...u,m],[u,m]),y=d.useCallback(e=>{let t=m.subscribe(e),n=c?.subscribe(e);return()=>{t(),n?.()}},[m,c]),b=d.useSyncExternalStore(y,()=>m.allHidden(c),()=>!1);return(0,f.jsxs)(`li`,{...o,ref:a,role:`presentation`,hidden:i||b||void 0,className:t,children:[(0,f.jsx)(`div`,{id:s,role:`presentation`,className:`px-3 py-1 text-caption-1 font-semibold text-muted-foreground`,children:e}),(0,f.jsx)(`ul`,{role:`group`,"aria-labelledby":s,children:(0,f.jsx)(_.Provider,{value:p,children:(0,f.jsx)(g.Provider,{value:v,children:n})})})]})}S.displayName=`OptionGroup`;var C=l.markListboxElement(S,`group`);function w(e){let{open:t,surfaceOpen:n,onDismiss:r,rootRef:o,anchorRef:s}=e,c=d.useRef(null),{setReference:l,setFloating:f,floatingProps:p}=u.usePopupPosition({open:n,side:`bottom`,align:`start`,matchReferenceWidth:!0,fitViewport:!0}),{layerId:m}=a.useDismiss({open:t,onDismiss:e=>r(e),refs:[o,c],anchorRef:s,kind:`listbox`,escape:n,focusOutside:!0});return{layerId:m,setReference:l,surfaceRef:i.useMergedRefs(c,f),floatingProps:p}}function T(e){e.preventDefault()}function E(e){let{listbox:t,layerId:n,surfaceRef:r,floatingProps:i,open:a,expanded:s,emptyContent:c,"aria-label":u,"aria-labelledby":d,showCheck:m=!0,children:h}=e,g=(0,f.jsx)(p.Provider,{value:m,children:(0,f.jsx)(l.ListboxContext.Provider,{value:t.context,children:(0,f.jsx)(`ul`,{...t.getListboxProps(),"aria-label":u,"aria-labelledby":d,hidden:!s||void 0,className:`min-h-0 max-h-60 overflow-auto`,children:h})})});return!s&&(!a||s||c==null)?g:(0,f.jsxs)(f.Fragment,{children:[!s&&g,(0,f.jsx)(o.Portal,{layerId:n,children:(0,f.jsx)(`div`,{ref:r,...i,"data-wave-listbox-surface":``,onMouseDown:T,className:`flex flex-col overflow-hidden rounded border border-border bg-background py-1 text-foreground shadow-4`,children:s?g:c})})]})}E.displayName=`ListboxSurface`,exports.ListboxSurface=E,exports.Option=x,exports.OptionGroup=C,exports.useListboxPopup=w;
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/composeEventHandlers.cjs"),r=require("../../lib/classNames.cjs"),i=require("../../hooks/useId.cjs"),a=require("../../hooks/useMergedRefs.cjs"),o=require("../../hooks/useDismiss.cjs"),s=require("../portal/Portal.cjs"),c=require("../../lib/styles.cjs"),l=require("../../lib/icons.cjs"),u=require("../../hooks/useListbox.cjs"),d=require("../../hooks/usePopupPosition.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var m=f.createContext(!0);m.displayName=`OptionCheckContext`;var h=t.cn(`flex cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-body-1 text-foreground`,`bg-(--option-bg) [--option-bg:transparent]`,`not-disabled:not-aria-disabled:hover:[--option-bg:var(--wave-subtle-hover)]`,`data-[selected]:[--option-bg:var(--wave-subtle-selected)]`,`data-[active]:[--option-bg:var(--wave-subtle-hover)]`,`data-[active]:outline-2 data-[active]:-outline-offset-2 data-[active]:outline-ring`,`aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground`),g=class{counts=new Map;listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});add(e){return this.counts.set(e,(this.counts.get(e)??0)+1),this.notify(),()=>{let t=(this.counts.get(e)??1)-1;t>0?this.counts.set(e,t):this.counts.delete(e),this.notify()}}allHidden(e){if(e===void 0||this.counts.size===0)return!1;for(let t of this.counts.keys())if(!e.isHidden(t))return!1;return!0}notify(){for(let e of[...this.listeners])e()}},_=f.createContext([]);_.displayName=`OptionGroupContext`;var v=f.createContext(!1);v.displayName=`OptionGroupHiddenContext`;function y(e){let t=f.useContext(_);f.useLayoutEffect(()=>{if(t.length===0)return;let n=t.map(t=>t.add(e));return()=>{for(let e of n)e()}},[t,e])}function b(e){let{value:i,label:a,textValue:o,disabled:s=!1,hidden:d=!1,className:g,children:_,onClick:b,onPointerMove:x,ref:S,...C}=e,w=f.useContext(m),T=f.useContext(v),{selected:E,optionProps:D}=u.useListboxOption({value:i,label:a,textValue:o,disabled:s,hidden:d||T},S);y(i);let{ref:O,onClick:k,onPointerMove:A,...j}=D;return(0,p.jsxs)(`li`,{"data-value":i,...C,...j,ref:O,onClick:n.composeEventHandlers(b,k),onPointerMove:n.composeEventHandlers(x,A),className:t.cn(r.optionClassNames.root,h,E&&c.forcedColors.selectedContainer,g),children:[w&&(0,p.jsx)(l.CheckIcon,{className:t.cn(r.optionClassNames.checkIcon,`shrink-0`,!E&&`invisible`)}),(0,p.jsx)(`span`,{className:t.cn(r.optionClassNames.content,`min-w-0 flex-1`),children:_??i})]})}b.displayName=`Option`;var x=f.memo(b);x.displayName=`Option`;var S=u.markListboxElement(x,`option`);function C({label:e,className:n,children:a,hidden:o,ref:s,...c}){let l=i.useId(`option-group`),d=f.useContext(u.ListboxContext)?.store,m=f.useContext(_),h=f.useContext(v)||!!o,[y]=f.useState(()=>new g),b=f.useMemo(()=>[...m,y],[m,y]),x=f.useCallback(e=>{let t=y.subscribe(e),n=d?.subscribe(e);return()=>{t(),n?.()}},[y,d]),S=f.useSyncExternalStore(x,()=>y.allHidden(d),()=>!1);return(0,p.jsxs)(`li`,{...c,ref:s,role:`presentation`,hidden:o||S||void 0,className:t.cn(r.optionGroupClassNames.root,n),children:[(0,p.jsx)(`div`,{id:l,role:`presentation`,className:t.cn(r.optionGroupClassNames.label,`px-3 py-1 text-caption-1 font-semibold text-muted-foreground`),children:e}),(0,p.jsx)(`ul`,{role:`group`,"aria-labelledby":l,className:r.optionGroupClassNames.list,children:(0,p.jsx)(v.Provider,{value:h,children:(0,p.jsx)(_.Provider,{value:b,children:a})})})]})}C.displayName=`OptionGroup`;var w=u.markListboxElement(C,`group`);function T(e){let{open:t,surfaceOpen:n,onDismiss:r,rootRef:i,anchorRef:s}=e,c=f.useRef(null),{setReference:l,setFloating:u,floatingProps:p}=d.usePopupPosition({open:n,side:`bottom`,align:`start`,matchReferenceWidth:!0,fitViewport:!0}),{layerId:m}=o.useDismiss({open:t,onDismiss:e=>r(e),refs:[i,c],anchorRef:s,kind:`listbox`,escape:n,focusOutside:!0});return{layerId:m,setReference:l,surfaceRef:a.useMergedRefs(c,u),floatingProps:p}}function E(e){e.preventDefault()}function D(e){let{listbox:n,layerId:r,surfaceRef:i,floatingProps:a,open:o,expanded:c,emptyContent:l,"aria-label":d,"aria-labelledby":f,showCheck:h=!0,listboxClassName:g,surfaceClassName:_,children:v}=e,y=(0,p.jsx)(m.Provider,{value:h,children:(0,p.jsx)(u.ListboxContext.Provider,{value:n.context,children:(0,p.jsx)(`ul`,{...n.getListboxProps(),"aria-label":d,"aria-labelledby":f,hidden:!c||void 0,className:t.cn(g,`min-h-0 max-h-60 overflow-auto`),children:v})})});return!c&&(!o||c||l==null)?y:(0,p.jsxs)(p.Fragment,{children:[!c&&y,(0,p.jsx)(s.Portal,{layerId:r,children:(0,p.jsx)(`div`,{ref:i,...a,"data-wave-listbox-surface":``,onMouseDown:E,className:t.cn(_,`flex flex-col overflow-hidden rounded border border-border bg-background py-1 text-foreground shadow-4`),children:c?y:l})})]})}D.displayName=`ListboxSurface`,exports.ListboxSurface=D,exports.Option=S,exports.OptionGroup=w,exports.useListboxPopup=T;
2
2
  //# sourceMappingURL=Option.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Option.cjs","names":["React","cn","useListboxOption","composeEventHandlers","forcedColors","CheckIcon","useId","ListboxContext","usePopupPosition","useDismiss","useMergedRefs","_Fragment","Portal","require_runtime","require_cn","require_composeEventHandlers","require_useId","require_useMergedRefs","require_useDismiss","require_Portal","require_styles","require_icons","require_useListbox","require_usePopupPosition","react","react_jsx_runtime","OptionCheckContext","OPTION_CLASSES","OptionGroupMembers","listener","value","count","store","OptionGroupContext","OptionGroupHiddenContext","useOptionGroupMembership","groups","removes","group","remove","OptionImpl","rest","props","showCheck","groupHidden","hidden","ref","optionRef","selectOption","highlightOption","optionAttributes","optionProps","onClick","onPointerMove","selected","className","children","MemoOption","Option","OptionGroupImpl","labelId","parentGroups","hiddenByConsumer","members","subscribe","unsubscribeMembers","unsubscribeStore","empty","label","OptionGroup","useListboxPopup","options","surfaceElementRef","surfaceOpen","onDismiss","reason","rootRef","setFloating","preventMouseDown","event","ListboxSurface","ariaLabel","ariaLabelledBy","list","listbox","expanded","emptyContent","surfaceRef","floatingProps"],"sources":["../../../src/components/input/Option.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { CheckIcon } from '../../lib/icons';\nimport { forcedColors } from '../../lib/styles';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport type { DismissReason } from '../../hooks/useDismiss';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport {\n ListboxContext,\n markListboxElement,\n useListboxOption,\n type ListboxStore,\n type UseListboxResult,\n} from '../../hooks/useListbox';\nimport { Portal } from '../portal/Portal';\n\n/* ------------------------------------------------------------------ */\n/* Option */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the Option component used within Combobox and Dropdown. */\nexport interface OptionProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'value'> {\n /** Value associated with this option. Unique within its listbox. */\n value: string;\n /**\n * Text shown in the combobox (Combobox input, Dropdown trigger) when this option is selected.\n * Defaults to `textValue`, then the option's text content, then `value`. Pass it when the\n * children are not plain text (icons, custom components).\n */\n label?: string;\n /** Text matched by typeahead and filtering instead of the label. */\n textValue?: string;\n /**\n * Whether the option is disabled: it stays visible but is skipped by keyboard navigation and\n * cannot be selected.\n * @default false\n */\n disabled?: boolean;\n /**\n * Hides the option, like a native `<option hidden>`: it is not shown, keyboard navigation and\n * typeahead skip it, and it never becomes the active option. Its label stays known, so a\n * selected hidden option (a placeholder) still shows in the combobox. The options of a hidden\n * `OptionGroup` are hidden the same way.\n * @default false\n */\n hidden?: boolean;\n /** Ref to the option `<li>` element. */\n ref?: React.Ref<HTMLLIElement>;\n}\n\n/** Whether options draw the selected check mark (P05-internal; TagPicker lists no selected options). */\nconst OptionCheckContext = React.createContext(true);\nOptionCheckContext.displayName = 'OptionCheckContext';\n\n/*\n * State is exposed as data attributes (C-CLASS): `data-active` (keyboard/pointer highlight),\n * `data-selected`, `data-disabled`. State classes come before the consumer's `className` in `cn()`.\n *\n * Backgrounds (input-pickers#20): one unconditional `bg-(--option-bg)` paints the option, and the\n * hover/selected/active variants only set `--option-bg`. A variant that set `background-color`\n * itself (class + attribute or pseudo-class) would out-specify a consumer's plain `bg-*` class in\n * the cascade even though `cn()` keeps it; instead tailwind-merge replaces `bg-(--option-bg)` with\n * the consumer's class, which is then the only background declaration on the option. A consumer\n * `data-[active]:bg-…` / `data-[selected]:bg-…` restyles a single state (it out-specifies the\n * unconditional reader). The active outline is the focus indicator and stays a state variant.\n *\n * A filtered-out option carries the `hidden` attribute; base.css's scoped `[hidden]` rule hides\n * it over `flex` and over a consumer's display class.\n */\nconst OPTION_CLASSES = cn(\n 'flex cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-body-1 text-foreground',\n 'bg-(--option-bg) [--option-bg:transparent]',\n 'not-disabled:not-aria-disabled:hover:[--option-bg:var(--wave-subtle-hover)]',\n 'data-[selected]:[--option-bg:var(--wave-subtle-selected)]',\n 'data-[active]:[--option-bg:var(--wave-subtle-hover)]',\n 'data-[active]:outline-2 data-[active]:-outline-offset-2 data-[active]:outline-ring',\n 'aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground',\n);\n\n/**\n * The values of the options rendered inside an `OptionGroup`, whatever wraps them (custom\n * components, Fragments, nested groups): each option adds its value from a layout effect.\n */\nclass OptionGroupMembers {\n private readonly counts = new Map<string, number>();\n private readonly listeners = new Set<() => void>();\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n add(value: string): () => void {\n this.counts.set(value, (this.counts.get(value) ?? 0) + 1);\n this.notify();\n return () => {\n const count = (this.counts.get(value) ?? 1) - 1;\n if (count > 0) this.counts.set(value, count);\n else this.counts.delete(value);\n this.notify();\n };\n }\n\n /** At least one option, and every one of them is hidden (filtered out, or by the consumer). */\n allHidden(store: ListboxStore | undefined): boolean {\n if (store === undefined || this.counts.size === 0) return false;\n for (const value of this.counts.keys()) if (!store.isHidden(value)) return false;\n return true;\n }\n\n private notify(): void {\n for (const listener of [...this.listeners]) listener();\n }\n}\n\n/** The groups around an option, outermost first (P05-internal). */\nconst OptionGroupContext = React.createContext<readonly OptionGroupMembers[]>([]);\nOptionGroupContext.displayName = 'OptionGroupContext';\n\n/** A group around the option has the consumer's `hidden` attribute (P05-internal). */\nconst OptionGroupHiddenContext = React.createContext(false);\nOptionGroupHiddenContext.displayName = 'OptionGroupHiddenContext';\n\n/** Adds an option's value to every group around it while the option is mounted. */\nfunction useOptionGroupMembership(value: string): void {\n const groups = React.useContext(OptionGroupContext);\n React.useLayoutEffect(() => {\n if (groups.length === 0) return;\n const removes = groups.map((group) => group.add(value));\n return () => {\n for (const remove of removes) remove();\n };\n }, [groups, value]);\n}\n\nfunction OptionImpl(props: OptionProps) {\n const {\n value,\n label,\n textValue,\n disabled = false,\n hidden = false,\n className,\n children,\n onClick,\n onPointerMove,\n ref,\n ...rest\n } = props;\n const showCheck = React.useContext(OptionCheckContext);\n const groupHidden = React.useContext(OptionGroupHiddenContext);\n // A consumer-hidden option is not navigable; optionProps renders `hidden`.\n const { selected, optionProps } = useListboxOption<HTMLLIElement>(\n { value, label, textValue, disabled, hidden: hidden || groupHidden },\n ref,\n );\n useOptionGroupMembership(value);\n const {\n ref: optionRef,\n onClick: selectOption,\n onPointerMove: highlightOption,\n ...optionAttributes\n } = optionProps;\n\n return (\n <li\n data-value={value}\n {...rest}\n {...optionAttributes}\n ref={optionRef}\n onClick={composeEventHandlers(onClick, selectOption)}\n onPointerMove={composeEventHandlers(onPointerMove, highlightOption)}\n className={cn(OPTION_CLASSES, selected && forcedColors.selectedContainer, className)}\n >\n {showCheck && <CheckIcon className={cn('shrink-0', !selected && 'invisible')} />}\n <span className=\"min-w-0 flex-1\">{children ?? value}</span>\n </li>\n );\n}\nOptionImpl.displayName = 'Option';\n\nconst MemoOption = /* @__PURE__ */ React.memo(OptionImpl);\nMemoOption.displayName = 'Option';\n\n/**\n * An option of a `Combobox`, `Dropdown` (and `TagPicker`'s generated list). Renders\n * `<li role=\"option\">` with a stable id (`aria-activedescendant` target), `aria-selected`, a check\n * mark while selected and `data-active`/`data-selected`/`data-disabled` attributes for styling.\n *\n * Options register with the surrounding listbox (in DOM order, groups included), so they can be\n * wrapped, grouped or rendered conditionally. The option is memoized: moving the highlight\n * re-renders only the previously and the newly active option.\n *\n * Styling: `className` comes last. A plain background class (`className=\"bg-primary\"`) replaces\n * the built-in hover, selected and active backgrounds in every state. To restyle one state only,\n * use its data variant (`data-[active]:bg-…`, `data-[selected]:bg-…`). The active option keeps\n * its focus outline.\n *\n * Use it inside a `Combobox` or `Dropdown` only; it throws in development elsewhere.\n */\nexport const Option: React.NamedExoticComponent<OptionProps> = /* @__PURE__ */ markListboxElement(\n MemoOption,\n 'option',\n);\n\n/* ------------------------------------------------------------------ */\n/* OptionGroup */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the OptionGroup component used to group options. */\nexport interface OptionGroupProps extends React.LiHTMLAttributes<HTMLLIElement> {\n /** Heading label for the option group (names the group). */\n label: string;\n /**\n * Hides the group and every option in it (see `Option`'s `hidden`): keyboard navigation and\n * typeahead skip its options.\n * @default false\n */\n hidden?: boolean;\n /** Ref to the group's `<li role=\"presentation\">` element. */\n ref?: React.Ref<HTMLLIElement>;\n}\n\nfunction OptionGroupImpl({ label, className, children, hidden, ref, ...rest }: OptionGroupProps) {\n const labelId = useId('option-group');\n const store = React.useContext(ListboxContext)?.store;\n const parentGroups = React.useContext(OptionGroupContext);\n const hiddenByConsumer = React.useContext(OptionGroupHiddenContext) || !!hidden;\n const [members] = React.useState(() => new OptionGroupMembers());\n const groups = React.useMemo(() => [...parentGroups, members], [parentGroups, members]);\n const subscribe = React.useCallback(\n (listener: () => void) => {\n const unsubscribeMembers = members.subscribe(listener);\n const unsubscribeStore = store?.subscribe(listener);\n return () => {\n unsubscribeMembers();\n unsubscribeStore?.();\n };\n },\n [members, store],\n );\n // Hidden while every option inside it is filtered out or hidden, also options wrapped in a\n // component (the options register with the group; re-read when they do and when the listbox\n // state changes).\n // The server render and the first client render show the group: no option has registered yet.\n const empty = React.useSyncExternalStore(\n subscribe,\n () => members.allHidden(store),\n () => false,\n );\n\n return (\n <li\n {...rest}\n ref={ref}\n role=\"presentation\"\n hidden={hidden || empty || undefined}\n className={className}\n >\n <div\n id={labelId}\n role=\"presentation\"\n className=\"px-3 py-1 text-caption-1 font-semibold text-muted-foreground\"\n >\n {label}\n </div>\n <ul role=\"group\" aria-labelledby={labelId}>\n <OptionGroupHiddenContext.Provider value={hiddenByConsumer}>\n <OptionGroupContext.Provider value={groups}>{children}</OptionGroupContext.Provider>\n </OptionGroupHiddenContext.Provider>\n </ul>\n </li>\n );\n}\nOptionGroupImpl.displayName = 'OptionGroup';\n\n/**\n * Groups options under a heading: `<li role=\"presentation\">` with the heading and a\n * `<ul role=\"group\" aria-labelledby>` of the options. Hidden while a filter (or their own `hidden`)\n * hides all its options, also options wrapped in a component or in nested groups.\n */\nexport const OptionGroup: React.FC<OptionGroupProps> = /* @__PURE__ */ markListboxElement(\n OptionGroupImpl,\n 'group',\n);\n\n/* ------------------------------------------------------------------ */\n/* Listbox popup (P05-internal, shared by Combobox, Dropdown, TagPicker) */\n/* ------------------------------------------------------------------ */\n\n/** Options of {@link useListboxPopup}. */\nexport interface UseListboxPopupOptions {\n /** The listbox is open (dismiss layer registered: outside press, focus outside). */\n open: boolean;\n /**\n * The portaled surface is shown: positioning runs and the layer takes Escape. While the listbox\n * is open with nothing shown (no options), Escape is left to an enclosing layer (overlays#1).\n */\n surfaceOpen: boolean;\n /** Close the listbox. */\n onDismiss: (reason: DismissReason) => void;\n /** The component root: presses and focus inside it are not \"outside\". */\n rootRef: React.RefObject<HTMLElement | null>;\n /** The combobox element (the layer's anchor). */\n anchorRef: React.RefObject<HTMLElement | null>;\n}\n\n/** Result of {@link useListboxPopup}. Destructure it (react-hooks/refs). */\nexport interface ListboxPopup {\n /** The dismiss layer id (pass to {@link ListboxSurface}). */\n layerId: string;\n /** Ref callback for the element the surface is positioned against. */\n setReference: (el: HTMLElement | null) => void;\n /** Ref callback for the surface. */\n surfaceRef: React.RefCallback<HTMLElement>;\n /** `data-side`, `data-align` and the position style for the surface. */\n floatingProps: { 'data-side': string; 'data-align': string; style: React.CSSProperties };\n}\n\n/**\n * Dismissal and positioning of a listbox surface (C-POPUPS, spec §5.4): `useDismiss` (Escape,\n * outside press, focus outside; `kind: 'listbox'`) and `usePopupPosition` (bottom-start, flip,\n * shift, the anchor's width, limited to the available space).\n */\nexport function useListboxPopup(options: UseListboxPopupOptions): ListboxPopup {\n const { open, surfaceOpen, onDismiss, rootRef, anchorRef } = options;\n const surfaceElementRef = React.useRef<HTMLElement | null>(null);\n const { setReference, setFloating, floatingProps } = usePopupPosition({\n open: surfaceOpen,\n side: 'bottom',\n align: 'start',\n matchReferenceWidth: true,\n fitViewport: true,\n });\n const { layerId } = useDismiss({\n open,\n onDismiss: (reason) => onDismiss(reason),\n refs: [rootRef, surfaceElementRef],\n anchorRef,\n kind: 'listbox',\n escape: surfaceOpen,\n focusOutside: true,\n });\n const surfaceRef = useMergedRefs<HTMLElement>(surfaceElementRef, setFloating);\n return { layerId, setReference, surfaceRef, floatingProps };\n}\n\n/** Props of {@link ListboxSurface}. */\nexport interface ListboxSurfaceProps {\n /** The listbox (from `useListbox`). */\n listbox: UseListboxResult;\n /** From {@link useListboxPopup}. */\n layerId: string;\n surfaceRef: React.RefCallback<HTMLElement>;\n floatingProps: ListboxPopup['floatingProps'];\n /** The listbox is open: `emptyContent` is shown only while it is (input-pickers#21). */\n open: boolean;\n /** The listbox is displayed: the list renders in the portaled surface. */\n expanded: boolean;\n /** While open but not expanded, show the surface with this content (e.g. \"No matches\"). */\n emptyContent?: React.ReactNode;\n /** Accessible name of the listbox. */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** Options draw a check mark while selected. @default true */\n showCheck?: boolean;\n children?: React.ReactNode;\n}\n\nfunction preventMouseDown(event: React.MouseEvent) {\n event.preventDefault();\n}\n\n/**\n * Renders the option list in a single container at a time (spec §2.5, §5.5): inline and `hidden`\n * inside the component root while closed (registration and ids exist from the first client\n * commit), and in a `Portal` surface while expanded — never both.\n */\nexport function ListboxSurface(props: ListboxSurfaceProps) {\n const {\n listbox,\n layerId,\n surfaceRef,\n floatingProps,\n open,\n expanded,\n emptyContent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n showCheck = true,\n children,\n } = props;\n\n const list = (\n <OptionCheckContext.Provider value={showCheck}>\n <ListboxContext.Provider value={listbox.context}>\n <ul\n {...listbox.getListboxProps()}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n hidden={!expanded || undefined}\n className=\"min-h-0 max-h-60 overflow-auto\"\n >\n {children}\n </ul>\n </ListboxContext.Provider>\n </OptionCheckContext.Provider>\n );\n\n // A closed listbox never leaves a surface behind: the text typed before closing survives it.\n const showEmpty = open && !expanded && emptyContent !== undefined && emptyContent !== null;\n if (!expanded && !showEmpty) return list;\n\n return (\n <>\n {!expanded && list}\n <Portal layerId={layerId}>\n <div\n ref={surfaceRef}\n {...floatingProps}\n data-wave-listbox-surface=\"\"\n onMouseDown={preventMouseDown}\n className=\"flex flex-col overflow-hidden rounded border border-border bg-background py-1 text-foreground shadow-4\"\n >\n {expanded ? list : emptyContent}\n </div>\n </Portal>\n </>\n );\n}\nListboxSurface.displayName = 'ListboxSurface';\n"],"mappings":"+gBAsDA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names":["React","cn","useListboxOption","composeEventHandlers","optionClassNames","forcedColors","CheckIcon","useId","ListboxContext","optionGroupClassNames","usePopupPosition","useDismiss","useMergedRefs","_Fragment","Portal","require_runtime","require_cn","require_composeEventHandlers","require_classNames","require_useId","require_useMergedRefs","require_useDismiss","require_Portal","require_styles","require_icons","require_useListbox","require_usePopupPosition","react","react_jsx_runtime","OptionCheckContext","OPTION_CLASSES","OptionGroupMembers","listener","value","count","store","OptionGroupContext","OptionGroupHiddenContext","useOptionGroupMembership","groups","removes","group","remove","OptionImpl","rest","props","showCheck","groupHidden","hidden","ref","optionRef","selectOption","highlightOption","optionAttributes","optionProps","onClick","onPointerMove","selected","className","children","MemoOption","Option","OptionGroupImpl","labelId","parentGroups","hiddenByConsumer","members","subscribe","unsubscribeMembers","unsubscribeStore","empty","label","OptionGroup","useListboxPopup","options","surfaceElementRef","surfaceOpen","onDismiss","reason","rootRef","setFloating","preventMouseDown","event","ListboxSurface","ariaLabel","ariaLabelledBy","list","listbox","expanded","listboxClassName","emptyContent","surfaceRef","floatingProps","surfaceClassName"],"sources":["../../../src/components/input/Option.tsx"],"sourcesContent":["import * as React from 'react';\nimport { optionClassNames, optionGroupClassNames } from '../../lib/classNames';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { CheckIcon } from '../../lib/icons';\nimport { forcedColors } from '../../lib/styles';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport type { DismissReason } from '../../hooks/useDismiss';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport {\n ListboxContext,\n markListboxElement,\n useListboxOption,\n type ListboxStore,\n type UseListboxResult,\n} from '../../hooks/useListbox';\nimport { Portal } from '../portal/Portal';\n\n/* ------------------------------------------------------------------ */\n/* Option */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the Option component used within Combobox and Dropdown. */\nexport interface OptionProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'value'> {\n /** Value associated with this option. Unique within its listbox. */\n value: string;\n /**\n * Text shown in the combobox (Combobox input, Dropdown trigger) when this option is selected.\n * Defaults to `textValue`, then the option's text content, then `value`. Pass it when the\n * children are not plain text (icons, custom components).\n */\n label?: string;\n /** Text matched by typeahead and filtering instead of the label. */\n textValue?: string;\n /**\n * Whether the option is disabled: it stays visible but is skipped by keyboard navigation and\n * cannot be selected.\n * @default false\n */\n disabled?: boolean;\n /**\n * Hides the option, like a native `<option hidden>`: it is not shown, keyboard navigation and\n * typeahead skip it, and it never becomes the active option. Its label stays known, so a\n * selected hidden option (a placeholder) still shows in the combobox. The options of a hidden\n * `OptionGroup` are hidden the same way.\n * @default false\n */\n hidden?: boolean;\n /** Ref to the option `<li>` element. */\n ref?: React.Ref<HTMLLIElement>;\n}\n\n/** Whether options draw the selected check mark (P05-internal; TagPicker lists no selected options). */\nconst OptionCheckContext = React.createContext(true);\nOptionCheckContext.displayName = 'OptionCheckContext';\n\n/*\n * State is exposed as data attributes (C-CLASS): `data-active` (keyboard/pointer highlight),\n * `data-selected`, `data-disabled`. State classes come before the consumer's `className` in `cn()`.\n *\n * Backgrounds (input-pickers#20): one unconditional `bg-(--option-bg)` paints the option, and the\n * hover/selected/active variants only set `--option-bg`. A variant that set `background-color`\n * itself (class + attribute or pseudo-class) would out-specify a consumer's plain `bg-*` class in\n * the cascade even though `cn()` keeps it; instead tailwind-merge replaces `bg-(--option-bg)` with\n * the consumer's class, which is then the only background declaration on the option. A consumer\n * `data-[active]:bg-…` / `data-[selected]:bg-…` restyles a single state (it out-specifies the\n * unconditional reader). The active outline is the focus indicator and stays a state variant.\n *\n * A filtered-out option carries the `hidden` attribute; base.css's scoped `[hidden]` rule hides\n * it over `flex` and over a consumer's display class.\n */\nconst OPTION_CLASSES = cn(\n 'flex cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-body-1 text-foreground',\n 'bg-(--option-bg) [--option-bg:transparent]',\n 'not-disabled:not-aria-disabled:hover:[--option-bg:var(--wave-subtle-hover)]',\n 'data-[selected]:[--option-bg:var(--wave-subtle-selected)]',\n 'data-[active]:[--option-bg:var(--wave-subtle-hover)]',\n 'data-[active]:outline-2 data-[active]:-outline-offset-2 data-[active]:outline-ring',\n 'aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground',\n);\n\n/**\n * The values of the options rendered inside an `OptionGroup`, whatever wraps them (custom\n * components, Fragments, nested groups): each option adds its value from a layout effect.\n */\nclass OptionGroupMembers {\n private readonly counts = new Map<string, number>();\n private readonly listeners = new Set<() => void>();\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n add(value: string): () => void {\n this.counts.set(value, (this.counts.get(value) ?? 0) + 1);\n this.notify();\n return () => {\n const count = (this.counts.get(value) ?? 1) - 1;\n if (count > 0) this.counts.set(value, count);\n else this.counts.delete(value);\n this.notify();\n };\n }\n\n /** At least one option, and every one of them is hidden (filtered out, or by the consumer). */\n allHidden(store: ListboxStore | undefined): boolean {\n if (store === undefined || this.counts.size === 0) return false;\n for (const value of this.counts.keys()) if (!store.isHidden(value)) return false;\n return true;\n }\n\n private notify(): void {\n for (const listener of [...this.listeners]) listener();\n }\n}\n\n/** The groups around an option, outermost first (P05-internal). */\nconst OptionGroupContext = React.createContext<readonly OptionGroupMembers[]>([]);\nOptionGroupContext.displayName = 'OptionGroupContext';\n\n/** A group around the option has the consumer's `hidden` attribute (P05-internal). */\nconst OptionGroupHiddenContext = React.createContext(false);\nOptionGroupHiddenContext.displayName = 'OptionGroupHiddenContext';\n\n/** Adds an option's value to every group around it while the option is mounted. */\nfunction useOptionGroupMembership(value: string): void {\n const groups = React.useContext(OptionGroupContext);\n React.useLayoutEffect(() => {\n if (groups.length === 0) return;\n const removes = groups.map((group) => group.add(value));\n return () => {\n for (const remove of removes) remove();\n };\n }, [groups, value]);\n}\n\nfunction OptionImpl(props: OptionProps) {\n const {\n value,\n label,\n textValue,\n disabled = false,\n hidden = false,\n className,\n children,\n onClick,\n onPointerMove,\n ref,\n ...rest\n } = props;\n const showCheck = React.useContext(OptionCheckContext);\n const groupHidden = React.useContext(OptionGroupHiddenContext);\n // A consumer-hidden option is not navigable; optionProps renders `hidden`.\n const { selected, optionProps } = useListboxOption<HTMLLIElement>(\n { value, label, textValue, disabled, hidden: hidden || groupHidden },\n ref,\n );\n useOptionGroupMembership(value);\n const {\n ref: optionRef,\n onClick: selectOption,\n onPointerMove: highlightOption,\n ...optionAttributes\n } = optionProps;\n\n return (\n <li\n data-value={value}\n {...rest}\n {...optionAttributes}\n ref={optionRef}\n onClick={composeEventHandlers(onClick, selectOption)}\n onPointerMove={composeEventHandlers(onPointerMove, highlightOption)}\n className={cn(\n optionClassNames.root,\n OPTION_CLASSES,\n selected && forcedColors.selectedContainer,\n className,\n )}\n >\n {showCheck && (\n <CheckIcon\n className={cn(optionClassNames.checkIcon, 'shrink-0', !selected && 'invisible')}\n />\n )}\n <span className={cn(optionClassNames.content, 'min-w-0 flex-1')}>{children ?? value}</span>\n </li>\n );\n}\nOptionImpl.displayName = 'Option';\n\nconst MemoOption = /* @__PURE__ */ React.memo(OptionImpl);\nMemoOption.displayName = 'Option';\n\n/**\n * An option of a `Combobox`, `Dropdown` (and `TagPicker`'s generated list). Renders\n * `<li role=\"option\">` with a stable id (`aria-activedescendant` target), `aria-selected`, a check\n * mark while selected and `data-active`/`data-selected`/`data-disabled` attributes for styling.\n *\n * Options register with the surrounding listbox (in DOM order, groups included), so they can be\n * wrapped, grouped or rendered conditionally. The option is memoized: moving the highlight\n * re-renders only the previously and the newly active option.\n *\n * Styling: `className` comes last. A plain background class (`className=\"bg-primary\"`) replaces\n * the built-in hover, selected and active backgrounds in every state. To restyle one state only,\n * use its data variant (`data-[active]:bg-…`, `data-[selected]:bg-…`). The active option keeps\n * its focus outline.\n *\n * Use it inside a `Combobox` or `Dropdown` only; it throws in development elsewhere.\n */\nexport const Option: React.NamedExoticComponent<OptionProps> = /* @__PURE__ */ markListboxElement(\n MemoOption,\n 'option',\n);\n\n/* ------------------------------------------------------------------ */\n/* OptionGroup */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the OptionGroup component used to group options. */\nexport interface OptionGroupProps extends React.LiHTMLAttributes<HTMLLIElement> {\n /** Heading label for the option group (names the group). */\n label: string;\n /**\n * Hides the group and every option in it (see `Option`'s `hidden`): keyboard navigation and\n * typeahead skip its options.\n * @default false\n */\n hidden?: boolean;\n /** Ref to the group's `<li role=\"presentation\">` element. */\n ref?: React.Ref<HTMLLIElement>;\n}\n\nfunction OptionGroupImpl({ label, className, children, hidden, ref, ...rest }: OptionGroupProps) {\n const labelId = useId('option-group');\n const store = React.useContext(ListboxContext)?.store;\n const parentGroups = React.useContext(OptionGroupContext);\n const hiddenByConsumer = React.useContext(OptionGroupHiddenContext) || !!hidden;\n const [members] = React.useState(() => new OptionGroupMembers());\n const groups = React.useMemo(() => [...parentGroups, members], [parentGroups, members]);\n const subscribe = React.useCallback(\n (listener: () => void) => {\n const unsubscribeMembers = members.subscribe(listener);\n const unsubscribeStore = store?.subscribe(listener);\n return () => {\n unsubscribeMembers();\n unsubscribeStore?.();\n };\n },\n [members, store],\n );\n // Hidden while every option inside it is filtered out or hidden, also options wrapped in a\n // component (the options register with the group; re-read when they do and when the listbox\n // state changes).\n // The server render and the first client render show the group: no option has registered yet.\n const empty = React.useSyncExternalStore(\n subscribe,\n () => members.allHidden(store),\n () => false,\n );\n\n return (\n <li\n {...rest}\n ref={ref}\n role=\"presentation\"\n hidden={hidden || empty || undefined}\n className={cn(optionGroupClassNames.root, className)}\n >\n <div\n id={labelId}\n role=\"presentation\"\n className={cn(\n optionGroupClassNames.label,\n 'px-3 py-1 text-caption-1 font-semibold text-muted-foreground',\n )}\n >\n {label}\n </div>\n <ul role=\"group\" aria-labelledby={labelId} className={optionGroupClassNames.list}>\n <OptionGroupHiddenContext.Provider value={hiddenByConsumer}>\n <OptionGroupContext.Provider value={groups}>{children}</OptionGroupContext.Provider>\n </OptionGroupHiddenContext.Provider>\n </ul>\n </li>\n );\n}\nOptionGroupImpl.displayName = 'OptionGroup';\n\n/**\n * Groups options under a heading: `<li role=\"presentation\">` with the heading and a\n * `<ul role=\"group\" aria-labelledby>` of the options. Hidden while a filter (or their own `hidden`)\n * hides all its options, also options wrapped in a component or in nested groups.\n */\nexport const OptionGroup: React.FC<OptionGroupProps> = /* @__PURE__ */ markListboxElement(\n OptionGroupImpl,\n 'group',\n);\n\n/* ------------------------------------------------------------------ */\n/* Listbox popup (P05-internal, shared by Combobox, Dropdown, TagPicker) */\n/* ------------------------------------------------------------------ */\n\n/** Options of {@link useListboxPopup}. */\nexport interface UseListboxPopupOptions {\n /** The listbox is open (dismiss layer registered: outside press, focus outside). */\n open: boolean;\n /**\n * The portaled surface is shown: positioning runs and the layer takes Escape. While the listbox\n * is open with nothing shown (no options), Escape is left to an enclosing layer (overlays#1).\n */\n surfaceOpen: boolean;\n /** Close the listbox. */\n onDismiss: (reason: DismissReason) => void;\n /** The component root: presses and focus inside it are not \"outside\". */\n rootRef: React.RefObject<HTMLElement | null>;\n /** The combobox element (the layer's anchor). */\n anchorRef: React.RefObject<HTMLElement | null>;\n}\n\n/** Result of {@link useListboxPopup}. Destructure it (react-hooks/refs). */\nexport interface ListboxPopup {\n /** The dismiss layer id (pass to {@link ListboxSurface}). */\n layerId: string;\n /** Ref callback for the element the surface is positioned against. */\n setReference: (el: HTMLElement | null) => void;\n /** Ref callback for the surface. */\n surfaceRef: React.RefCallback<HTMLElement>;\n /** `data-side`, `data-align` and the position style for the surface. */\n floatingProps: { 'data-side': string; 'data-align': string; style: React.CSSProperties };\n}\n\n/**\n * Dismissal and positioning of a listbox surface (C-POPUPS, spec §5.4): `useDismiss` (Escape,\n * outside press, focus outside; `kind: 'listbox'`) and `usePopupPosition` (bottom-start, flip,\n * shift, the anchor's width, limited to the available space).\n */\nexport function useListboxPopup(options: UseListboxPopupOptions): ListboxPopup {\n const { open, surfaceOpen, onDismiss, rootRef, anchorRef } = options;\n const surfaceElementRef = React.useRef<HTMLElement | null>(null);\n const { setReference, setFloating, floatingProps } = usePopupPosition({\n open: surfaceOpen,\n side: 'bottom',\n align: 'start',\n matchReferenceWidth: true,\n fitViewport: true,\n });\n const { layerId } = useDismiss({\n open,\n onDismiss: (reason) => onDismiss(reason),\n refs: [rootRef, surfaceElementRef],\n anchorRef,\n kind: 'listbox',\n escape: surfaceOpen,\n focusOutside: true,\n });\n const surfaceRef = useMergedRefs<HTMLElement>(surfaceElementRef, setFloating);\n return { layerId, setReference, surfaceRef, floatingProps };\n}\n\n/** Props of {@link ListboxSurface}. */\nexport interface ListboxSurfaceProps {\n /** The listbox (from `useListbox`). */\n listbox: UseListboxResult;\n /** From {@link useListboxPopup}. */\n layerId: string;\n surfaceRef: React.RefCallback<HTMLElement>;\n floatingProps: ListboxPopup['floatingProps'];\n /** The listbox is open: `emptyContent` is shown only while it is (input-pickers#21). */\n open: boolean;\n /** The listbox is displayed: the list renders in the portaled surface. */\n expanded: boolean;\n /** While open but not expanded, show the surface with this content (e.g. \"No matches\"). */\n emptyContent?: React.ReactNode;\n /** Accessible name of the listbox. */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** Options draw a check mark while selected. @default true */\n showCheck?: boolean;\n /** The host's stable class for the listbox element (its `listbox` part). */\n listboxClassName?: string;\n /** The host's stable class for the portaled surface (its `surface` part). */\n surfaceClassName?: string;\n children?: React.ReactNode;\n}\n\nfunction preventMouseDown(event: React.MouseEvent) {\n event.preventDefault();\n}\n\n/**\n * Renders the option list in a single container at a time (spec §2.5, §5.5): inline and `hidden`\n * inside the component root while closed (registration and ids exist from the first client\n * commit), and in a `Portal` surface while expanded — never both.\n */\nexport function ListboxSurface(props: ListboxSurfaceProps) {\n const {\n listbox,\n layerId,\n surfaceRef,\n floatingProps,\n open,\n expanded,\n emptyContent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n showCheck = true,\n listboxClassName,\n surfaceClassName,\n children,\n } = props;\n\n const list = (\n <OptionCheckContext.Provider value={showCheck}>\n <ListboxContext.Provider value={listbox.context}>\n <ul\n {...listbox.getListboxProps()}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n hidden={!expanded || undefined}\n className={cn(listboxClassName, 'min-h-0 max-h-60 overflow-auto')}\n >\n {children}\n </ul>\n </ListboxContext.Provider>\n </OptionCheckContext.Provider>\n );\n\n // A closed listbox never leaves a surface behind: the text typed before closing survives it.\n const showEmpty = open && !expanded && emptyContent !== undefined && emptyContent !== null;\n if (!expanded && !showEmpty) return list;\n\n return (\n <>\n {!expanded && list}\n <Portal layerId={layerId}>\n <div\n ref={surfaceRef}\n {...floatingProps}\n data-wave-listbox-surface=\"\"\n onMouseDown={preventMouseDown}\n className={cn(\n surfaceClassName,\n 'flex flex-col overflow-hidden rounded border border-border bg-background py-1 text-foreground shadow-4',\n )}\n >\n {expanded ? list : emptyContent}\n </div>\n </Portal>\n </>\n );\n}\nListboxSurface.displayName = 'ListboxSurface';\n"],"mappings":"qjBAuDA,IAAM6B,EAAqB7B,EAAM,cAAc,EAAI,EACnD,EAAmB,YAAc,qBAiBjC,IAAM8B,EAAiB7B,EAAAA,GACrB,6FACA,6CACA,8EACA,4DACA,uDACA,qFACA,sEACF,EAMM8B,EAAN,KAAyB,CACvB,OAA0B,IAAI,IAC9B,UAA6B,IAAI,IAEjC,UAAa,IACX,KAAK,UAAU,IAAIC,CAAQ,MACd,CACX,KAAK,UAAU,OAAOA,CAAQ,CAChC,GAGF,IAAI,EAA2B,CAG7B,OAFA,KAAK,OAAO,IAAIC,GAAQ,KAAK,OAAO,IAAIA,CAAK,GAAK,GAAK,CAAC,EACxD,KAAK,OAAO,MACC,CACX,IAAMC,GAAS,KAAK,OAAO,IAAID,CAAK,GAAK,GAAK,EAC1CC,EAAQ,EAAG,KAAK,OAAO,IAAID,EAAOC,CAAK,EACtC,KAAK,OAAO,OAAOD,CAAK,EA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