@mortenbrudvik/waveui 0.4.0 → 0.7.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 (574) hide show
  1. package/README.md +1221 -173
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/dist/components/button/Button.cjs +2 -0
  4. package/dist/components/button/Button.cjs.map +1 -0
  5. package/dist/components/button/Button.mjs +50 -0
  6. package/dist/components/button/Button.mjs.map +1 -0
  7. package/dist/components/button/Button.semantics.cjs +2 -0
  8. package/dist/components/button/Button.semantics.cjs.map +1 -0
  9. package/dist/components/button/Button.semantics.mjs +61 -0
  10. package/dist/components/button/Button.semantics.mjs.map +1 -0
  11. package/dist/components/button/Button.slots.cjs +2 -0
  12. package/dist/components/button/Button.slots.cjs.map +1 -0
  13. package/dist/components/button/Button.slots.mjs +47 -0
  14. package/dist/components/button/Button.slots.mjs.map +1 -0
  15. package/dist/components/button/CompoundButton.cjs +2 -0
  16. package/dist/components/button/CompoundButton.cjs.map +1 -0
  17. package/dist/components/button/CompoundButton.mjs +53 -0
  18. package/dist/components/button/CompoundButton.mjs.map +1 -0
  19. package/dist/components/button/Link.cjs +2 -0
  20. package/dist/components/button/Link.cjs.map +1 -0
  21. package/dist/components/button/Link.mjs +37 -0
  22. package/dist/components/button/Link.mjs.map +1 -0
  23. package/dist/components/button/MenuButton.cjs +2 -0
  24. package/dist/components/button/MenuButton.cjs.map +1 -0
  25. package/dist/components/button/MenuButton.mjs +45 -0
  26. package/dist/components/button/MenuButton.mjs.map +1 -0
  27. package/dist/components/button/SplitButton.cjs +2 -0
  28. package/dist/components/button/SplitButton.cjs.map +1 -0
  29. package/dist/components/button/SplitButton.mjs +66 -0
  30. package/dist/components/button/SplitButton.mjs.map +1 -0
  31. package/dist/components/button/ToggleButton.cjs +2 -0
  32. package/dist/components/button/ToggleButton.cjs.map +1 -0
  33. package/dist/components/button/ToggleButton.mjs +65 -0
  34. package/dist/components/button/ToggleButton.mjs.map +1 -0
  35. package/dist/components/button/Toolbar.cjs +2 -0
  36. package/dist/components/button/Toolbar.cjs.map +1 -0
  37. package/dist/components/button/Toolbar.context.cjs +2 -0
  38. package/dist/components/button/Toolbar.context.cjs.map +1 -0
  39. package/dist/components/button/Toolbar.context.mjs +31 -0
  40. package/dist/components/button/Toolbar.context.mjs.map +1 -0
  41. package/dist/components/button/Toolbar.mjs +63 -0
  42. package/dist/components/button/Toolbar.mjs.map +1 -0
  43. package/dist/components/button/Toolbar.parts.cjs +2 -0
  44. package/dist/components/button/Toolbar.parts.cjs.map +1 -0
  45. package/dist/components/button/Toolbar.parts.mjs +131 -0
  46. package/dist/components/button/Toolbar.parts.mjs.map +1 -0
  47. package/dist/components/button/buttonStyles.cjs +2 -0
  48. package/dist/components/button/buttonStyles.cjs.map +1 -0
  49. package/dist/components/button/buttonStyles.mjs +39 -0
  50. package/dist/components/button/buttonStyles.mjs.map +1 -0
  51. package/dist/components/data-display/Avatar.cjs +2 -0
  52. package/dist/components/data-display/Avatar.cjs.map +1 -0
  53. package/dist/components/data-display/Avatar.mjs +157 -0
  54. package/dist/components/data-display/Avatar.mjs.map +1 -0
  55. package/dist/components/data-display/AvatarGroup.cjs +2 -0
  56. package/dist/components/data-display/AvatarGroup.cjs.map +1 -0
  57. package/dist/components/data-display/AvatarGroup.mjs +134 -0
  58. package/dist/components/data-display/AvatarGroup.mjs.map +1 -0
  59. package/dist/components/data-display/Badge.cjs +2 -0
  60. package/dist/components/data-display/Badge.cjs.map +1 -0
  61. package/dist/components/data-display/Badge.colors.cjs +2 -0
  62. package/dist/components/data-display/Badge.colors.cjs.map +1 -0
  63. package/dist/components/data-display/Badge.colors.mjs +58 -0
  64. package/dist/components/data-display/Badge.colors.mjs.map +1 -0
  65. package/dist/components/data-display/Badge.mjs +32 -0
  66. package/dist/components/data-display/Badge.mjs.map +1 -0
  67. package/dist/components/data-display/CounterBadge.cjs +2 -0
  68. package/dist/components/data-display/CounterBadge.cjs.map +1 -0
  69. package/dist/components/data-display/CounterBadge.mjs +28 -0
  70. package/dist/components/data-display/CounterBadge.mjs.map +1 -0
  71. package/dist/components/data-display/Divider.cjs +2 -0
  72. package/dist/components/data-display/Divider.cjs.map +1 -0
  73. package/dist/components/data-display/Divider.mjs +52 -0
  74. package/dist/components/data-display/Divider.mjs.map +1 -0
  75. package/dist/components/data-display/Image.cjs +2 -0
  76. package/dist/components/data-display/Image.cjs.map +1 -0
  77. package/dist/components/data-display/Image.mjs +32 -0
  78. package/dist/components/data-display/Image.mjs.map +1 -0
  79. package/dist/components/data-display/InfoLabel.cjs +2 -0
  80. package/dist/components/data-display/InfoLabel.cjs.map +1 -0
  81. package/dist/components/data-display/InfoLabel.mjs +104 -0
  82. package/dist/components/data-display/InfoLabel.mjs.map +1 -0
  83. package/dist/components/data-display/List.cjs +2 -0
  84. package/dist/components/data-display/List.cjs.map +1 -0
  85. package/dist/components/data-display/List.mjs +381 -0
  86. package/dist/components/data-display/List.mjs.map +1 -0
  87. package/dist/components/data-display/List.registry.cjs +2 -0
  88. package/dist/components/data-display/List.registry.cjs.map +1 -0
  89. package/dist/components/data-display/List.registry.mjs +101 -0
  90. package/dist/components/data-display/List.registry.mjs.map +1 -0
  91. package/dist/components/data-display/Persona.cjs +2 -0
  92. package/dist/components/data-display/Persona.cjs.map +1 -0
  93. package/dist/components/data-display/Persona.mjs +48 -0
  94. package/dist/components/data-display/Persona.mjs.map +1 -0
  95. package/dist/components/data-display/PresenceBadge.cjs +2 -0
  96. package/dist/components/data-display/PresenceBadge.cjs.map +1 -0
  97. package/dist/components/data-display/PresenceBadge.mjs +71 -0
  98. package/dist/components/data-display/PresenceBadge.mjs.map +1 -0
  99. package/dist/components/data-display/Tag.cjs +2 -0
  100. package/dist/components/data-display/Tag.cjs.map +1 -0
  101. package/dist/components/data-display/Tag.mjs +147 -0
  102. package/dist/components/data-display/Tag.mjs.map +1 -0
  103. package/dist/components/feedback/MessageBar.cjs +2 -0
  104. package/dist/components/feedback/MessageBar.cjs.map +1 -0
  105. package/dist/components/feedback/MessageBar.mjs +144 -0
  106. package/dist/components/feedback/MessageBar.mjs.map +1 -0
  107. package/dist/components/feedback/MessageBar.status.cjs +2 -0
  108. package/dist/components/feedback/MessageBar.status.cjs.map +1 -0
  109. package/dist/components/feedback/MessageBar.status.mjs +45 -0
  110. package/dist/components/feedback/MessageBar.status.mjs.map +1 -0
  111. package/dist/components/feedback/ProgressBar.cjs +2 -0
  112. package/dist/components/feedback/ProgressBar.cjs.map +1 -0
  113. package/dist/components/feedback/ProgressBar.mjs +72 -0
  114. package/dist/components/feedback/ProgressBar.mjs.map +1 -0
  115. package/dist/components/feedback/Skeleton.cjs +2 -0
  116. package/dist/components/feedback/Skeleton.cjs.map +1 -0
  117. package/dist/components/feedback/Skeleton.mjs +47 -0
  118. package/dist/components/feedback/Skeleton.mjs.map +1 -0
  119. package/dist/components/feedback/Spinner.cjs +2 -0
  120. package/dist/components/feedback/Spinner.cjs.map +1 -0
  121. package/dist/components/feedback/Spinner.mjs +60 -0
  122. package/dist/components/feedback/Spinner.mjs.map +1 -0
  123. package/dist/components/feedback/Toast.cjs +2 -0
  124. package/dist/components/feedback/Toast.cjs.map +1 -0
  125. package/dist/components/feedback/Toast.mjs +347 -0
  126. package/dist/components/feedback/Toast.mjs.map +1 -0
  127. package/dist/components/input/Checkbox.cjs +2 -0
  128. package/dist/components/input/Checkbox.cjs.map +1 -0
  129. package/dist/components/input/Checkbox.mjs +96 -0
  130. package/dist/components/input/Checkbox.mjs.map +1 -0
  131. package/dist/components/input/ColorPicker.cjs +6 -0
  132. package/dist/components/input/ColorPicker.cjs.map +1 -0
  133. package/dist/components/input/ColorPicker.mjs +236 -0
  134. package/dist/components/input/ColorPicker.mjs.map +1 -0
  135. package/dist/components/input/Combobox.cjs +2 -0
  136. package/dist/components/input/Combobox.cjs.map +1 -0
  137. package/dist/components/input/Combobox.expand.cjs +2 -0
  138. package/dist/components/input/Combobox.expand.cjs.map +1 -0
  139. package/dist/components/input/Combobox.expand.mjs +38 -0
  140. package/dist/components/input/Combobox.expand.mjs.map +1 -0
  141. package/dist/components/input/Combobox.mjs +187 -0
  142. package/dist/components/input/Combobox.mjs.map +1 -0
  143. package/dist/components/input/DatePicker.cjs +2 -0
  144. package/dist/components/input/DatePicker.cjs.map +1 -0
  145. package/dist/components/input/DatePicker.mjs +340 -0
  146. package/dist/components/input/DatePicker.mjs.map +1 -0
  147. package/dist/components/input/Dropdown.cjs +2 -0
  148. package/dist/components/input/Dropdown.cjs.map +1 -0
  149. package/dist/components/input/Dropdown.mjs +128 -0
  150. package/dist/components/input/Dropdown.mjs.map +1 -0
  151. package/dist/components/input/Field.cjs +2 -0
  152. package/dist/components/input/Field.cjs.map +1 -0
  153. package/dist/components/input/Field.mjs +200 -0
  154. package/dist/components/input/Field.mjs.map +1 -0
  155. package/dist/components/input/Input.cjs +2 -0
  156. package/dist/components/input/Input.cjs.map +1 -0
  157. package/dist/components/input/Input.mjs +81 -0
  158. package/dist/components/input/Input.mjs.map +1 -0
  159. package/dist/components/input/Label.cjs +2 -0
  160. package/dist/components/input/Label.cjs.map +1 -0
  161. package/dist/components/input/Label.mjs +28 -0
  162. package/dist/components/input/Label.mjs.map +1 -0
  163. package/dist/components/input/Option.cjs +2 -0
  164. package/dist/components/input/Option.cjs.map +1 -0
  165. package/dist/components/input/Option.mjs +169 -0
  166. package/dist/components/input/Option.mjs.map +1 -0
  167. package/dist/components/input/RadioGroup.cjs +2 -0
  168. package/dist/components/input/RadioGroup.cjs.map +1 -0
  169. package/dist/components/input/RadioGroup.mjs +139 -0
  170. package/dist/components/input/RadioGroup.mjs.map +1 -0
  171. package/dist/components/input/Rating.cjs +2 -0
  172. package/dist/components/input/Rating.cjs.map +1 -0
  173. package/dist/components/input/Rating.mjs +196 -0
  174. package/dist/components/input/Rating.mjs.map +1 -0
  175. package/dist/components/input/SearchBox.cjs +2 -0
  176. package/dist/components/input/SearchBox.cjs.map +1 -0
  177. package/dist/components/input/SearchBox.mjs +205 -0
  178. package/dist/components/input/SearchBox.mjs.map +1 -0
  179. package/dist/components/input/Select.cjs +2 -0
  180. package/dist/components/input/Select.cjs.map +1 -0
  181. package/dist/components/input/Select.mjs +33 -0
  182. package/dist/components/input/Select.mjs.map +1 -0
  183. package/dist/components/input/Slider.cjs +2 -0
  184. package/dist/components/input/Slider.cjs.map +1 -0
  185. package/dist/components/input/Slider.mjs +79 -0
  186. package/dist/components/input/Slider.mjs.map +1 -0
  187. package/dist/components/input/SpinButton.cjs +2 -0
  188. package/dist/components/input/SpinButton.cjs.map +1 -0
  189. package/dist/components/input/SpinButton.mjs +157 -0
  190. package/dist/components/input/SpinButton.mjs.map +1 -0
  191. package/dist/components/input/SwatchPicker.cjs +2 -0
  192. package/dist/components/input/SwatchPicker.cjs.map +1 -0
  193. package/dist/components/input/SwatchPicker.mjs +113 -0
  194. package/dist/components/input/SwatchPicker.mjs.map +1 -0
  195. package/dist/components/input/Switch.cjs +2 -0
  196. package/dist/components/input/Switch.cjs.map +1 -0
  197. package/dist/components/input/Switch.mjs +92 -0
  198. package/dist/components/input/Switch.mjs.map +1 -0
  199. package/dist/components/input/TagPicker.cjs +2 -0
  200. package/dist/components/input/TagPicker.cjs.map +1 -0
  201. package/dist/components/input/TagPicker.mjs +249 -0
  202. package/dist/components/input/TagPicker.mjs.map +1 -0
  203. package/dist/components/input/Textarea.cjs +2 -0
  204. package/dist/components/input/Textarea.cjs.map +1 -0
  205. package/dist/components/input/Textarea.mjs +32 -0
  206. package/dist/components/input/Textarea.mjs.map +1 -0
  207. package/dist/components/input/TimePicker.cjs +2 -0
  208. package/dist/components/input/TimePicker.cjs.map +1 -0
  209. package/dist/components/input/TimePicker.mjs +292 -0
  210. package/dist/components/input/TimePicker.mjs.map +1 -0
  211. package/dist/components/input/colorUtils.cjs +2 -0
  212. package/dist/components/input/colorUtils.cjs.map +1 -0
  213. package/dist/components/input/colorUtils.mjs +96 -0
  214. package/dist/components/input/colorUtils.mjs.map +1 -0
  215. package/dist/components/input/dateUtils.cjs +2 -0
  216. package/dist/components/input/dateUtils.cjs.map +1 -0
  217. package/dist/components/input/dateUtils.mjs +250 -0
  218. package/dist/components/input/dateUtils.mjs.map +1 -0
  219. package/dist/components/input/pickerStyles.cjs +2 -0
  220. package/dist/components/input/pickerStyles.cjs.map +1 -0
  221. package/dist/components/input/pickerStyles.mjs +10 -0
  222. package/dist/components/input/pickerStyles.mjs.map +1 -0
  223. package/dist/components/internal/HiddenInput.cjs +2 -0
  224. package/dist/components/internal/HiddenInput.cjs.map +1 -0
  225. package/dist/components/internal/HiddenInput.mjs +88 -0
  226. package/dist/components/internal/HiddenInput.mjs.map +1 -0
  227. package/dist/components/layout/Accordion.cjs +2 -0
  228. package/dist/components/layout/Accordion.cjs.map +1 -0
  229. package/dist/components/layout/Accordion.mjs +236 -0
  230. package/dist/components/layout/Accordion.mjs.map +1 -0
  231. package/dist/components/layout/Card.cjs +2 -0
  232. package/dist/components/layout/Card.cjs.map +1 -0
  233. package/dist/components/layout/Card.mjs +121 -0
  234. package/dist/components/layout/Card.mjs.map +1 -0
  235. package/dist/components/layout/Carousel.cjs +2 -0
  236. package/dist/components/layout/Carousel.cjs.map +1 -0
  237. package/dist/components/layout/Carousel.mjs +205 -0
  238. package/dist/components/layout/Carousel.mjs.map +1 -0
  239. package/dist/components/layout/Flex.cjs +2 -0
  240. package/dist/components/layout/Flex.cjs.map +1 -0
  241. package/dist/components/layout/Flex.mjs +54 -0
  242. package/dist/components/layout/Flex.mjs.map +1 -0
  243. package/dist/components/layout/Grid.cjs +2 -0
  244. package/dist/components/layout/Grid.cjs.map +1 -0
  245. package/dist/components/layout/Grid.mjs +62 -0
  246. package/dist/components/layout/Grid.mjs.map +1 -0
  247. package/dist/components/layout/Overflow.cjs +2 -0
  248. package/dist/components/layout/Overflow.cjs.map +1 -0
  249. package/dist/components/layout/Overflow.mjs +269 -0
  250. package/dist/components/layout/Overflow.mjs.map +1 -0
  251. package/dist/components/layout/Stack.cjs +2 -0
  252. package/dist/components/layout/Stack.cjs.map +1 -0
  253. package/dist/components/layout/Stack.mjs +39 -0
  254. package/dist/components/layout/Stack.mjs.map +1 -0
  255. package/dist/components/layout/TabList.cjs +2 -0
  256. package/dist/components/layout/TabList.cjs.map +1 -0
  257. package/dist/components/layout/TabList.mjs +238 -0
  258. package/dist/components/layout/TabList.mjs.map +1 -0
  259. package/dist/components/layout/Tree.cjs +2 -0
  260. package/dist/components/layout/Tree.cjs.map +1 -0
  261. package/dist/components/layout/Tree.mjs +220 -0
  262. package/dist/components/layout/Tree.mjs.map +1 -0
  263. package/dist/components/layout/disclosureIds.cjs +2 -0
  264. package/dist/components/layout/disclosureIds.cjs.map +1 -0
  265. package/dist/components/layout/disclosureIds.mjs +12 -0
  266. package/dist/components/layout/disclosureIds.mjs.map +1 -0
  267. package/dist/components/motion/Presence.cjs +2 -0
  268. package/dist/components/motion/Presence.cjs.map +1 -0
  269. package/dist/components/motion/Presence.mjs +35 -0
  270. package/dist/components/motion/Presence.mjs.map +1 -0
  271. package/dist/components/navigation/Breadcrumb.cjs +2 -0
  272. package/dist/components/navigation/Breadcrumb.cjs.map +1 -0
  273. package/dist/components/navigation/Breadcrumb.mjs +144 -0
  274. package/dist/components/navigation/Breadcrumb.mjs.map +1 -0
  275. package/dist/components/navigation/Menu.cjs +2 -0
  276. package/dist/components/navigation/Menu.cjs.map +1 -0
  277. package/dist/components/navigation/Menu.context.cjs +2 -0
  278. package/dist/components/navigation/Menu.context.cjs.map +1 -0
  279. package/dist/components/navigation/Menu.context.mjs +82 -0
  280. package/dist/components/navigation/Menu.context.mjs.map +1 -0
  281. package/dist/components/navigation/Menu.group.cjs +2 -0
  282. package/dist/components/navigation/Menu.group.cjs.map +1 -0
  283. package/dist/components/navigation/Menu.group.mjs +58 -0
  284. package/dist/components/navigation/Menu.group.mjs.map +1 -0
  285. package/dist/components/navigation/Menu.items.cjs +2 -0
  286. package/dist/components/navigation/Menu.items.cjs.map +1 -0
  287. package/dist/components/navigation/Menu.items.mjs +127 -0
  288. package/dist/components/navigation/Menu.items.mjs.map +1 -0
  289. package/dist/components/navigation/Menu.link.cjs +2 -0
  290. package/dist/components/navigation/Menu.link.cjs.map +1 -0
  291. package/dist/components/navigation/Menu.link.mjs +41 -0
  292. package/dist/components/navigation/Menu.link.mjs.map +1 -0
  293. package/dist/components/navigation/Menu.mjs +27 -0
  294. package/dist/components/navigation/Menu.mjs.map +1 -0
  295. package/dist/components/navigation/Menu.popover.cjs +2 -0
  296. package/dist/components/navigation/Menu.popover.cjs.map +1 -0
  297. package/dist/components/navigation/Menu.popover.mjs +231 -0
  298. package/dist/components/navigation/Menu.popover.mjs.map +1 -0
  299. package/dist/components/navigation/Menu.root.cjs +2 -0
  300. package/dist/components/navigation/Menu.root.cjs.map +1 -0
  301. package/dist/components/navigation/Menu.root.mjs +308 -0
  302. package/dist/components/navigation/Menu.root.mjs.map +1 -0
  303. package/dist/components/navigation/Menu.selectable.cjs +2 -0
  304. package/dist/components/navigation/Menu.selectable.cjs.map +1 -0
  305. package/dist/components/navigation/Menu.selectable.mjs +89 -0
  306. package/dist/components/navigation/Menu.selectable.mjs.map +1 -0
  307. package/dist/components/navigation/Menu.shared.cjs +2 -0
  308. package/dist/components/navigation/Menu.shared.cjs.map +1 -0
  309. package/dist/components/navigation/Menu.shared.mjs +23 -0
  310. package/dist/components/navigation/Menu.shared.mjs.map +1 -0
  311. package/dist/components/navigation/Menu.splitGroup.cjs +2 -0
  312. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -0
  313. package/dist/components/navigation/Menu.splitGroup.mjs +51 -0
  314. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -0
  315. package/dist/components/navigation/Menu.trigger.cjs +2 -0
  316. package/dist/components/navigation/Menu.trigger.cjs.map +1 -0
  317. package/dist/components/navigation/Menu.trigger.mjs +79 -0
  318. package/dist/components/navigation/Menu.trigger.mjs.map +1 -0
  319. package/dist/components/navigation/Nav.cjs +2 -0
  320. package/dist/components/navigation/Nav.cjs.map +1 -0
  321. package/dist/components/navigation/Nav.mjs +276 -0
  322. package/dist/components/navigation/Nav.mjs.map +1 -0
  323. package/dist/components/navigation/Pagination.cjs +2 -0
  324. package/dist/components/navigation/Pagination.cjs.map +1 -0
  325. package/dist/components/navigation/Pagination.mjs +110 -0
  326. package/dist/components/navigation/Pagination.mjs.map +1 -0
  327. package/dist/components/navigation/Stepper.cjs +2 -0
  328. package/dist/components/navigation/Stepper.cjs.map +1 -0
  329. package/dist/components/navigation/Stepper.mjs +204 -0
  330. package/dist/components/navigation/Stepper.mjs.map +1 -0
  331. package/dist/components/overlays/Dialog.cjs +2 -0
  332. package/dist/components/overlays/Dialog.cjs.map +1 -0
  333. package/dist/components/overlays/Dialog.mjs +180 -0
  334. package/dist/components/overlays/Dialog.mjs.map +1 -0
  335. package/dist/components/overlays/Dialog.shared.cjs +2 -0
  336. package/dist/components/overlays/Dialog.shared.cjs.map +1 -0
  337. package/dist/components/overlays/Dialog.shared.mjs +227 -0
  338. package/dist/components/overlays/Dialog.shared.mjs.map +1 -0
  339. package/dist/components/overlays/Drawer.cjs +2 -0
  340. package/dist/components/overlays/Drawer.cjs.map +1 -0
  341. package/dist/components/overlays/Drawer.mjs +192 -0
  342. package/dist/components/overlays/Drawer.mjs.map +1 -0
  343. package/dist/components/overlays/Popover.cjs +2 -0
  344. package/dist/components/overlays/Popover.cjs.map +1 -0
  345. package/dist/components/overlays/Popover.mjs +365 -0
  346. package/dist/components/overlays/Popover.mjs.map +1 -0
  347. package/dist/components/overlays/Popover.shared.cjs +2 -0
  348. package/dist/components/overlays/Popover.shared.cjs.map +1 -0
  349. package/dist/components/overlays/Popover.shared.mjs +182 -0
  350. package/dist/components/overlays/Popover.shared.mjs.map +1 -0
  351. package/dist/components/overlays/TeachingPopover.cjs +2 -0
  352. package/dist/components/overlays/TeachingPopover.cjs.map +1 -0
  353. package/dist/components/overlays/TeachingPopover.mjs +181 -0
  354. package/dist/components/overlays/TeachingPopover.mjs.map +1 -0
  355. package/dist/components/overlays/Tooltip.cjs +2 -0
  356. package/dist/components/overlays/Tooltip.cjs.map +1 -0
  357. package/dist/components/overlays/Tooltip.mjs +160 -0
  358. package/dist/components/overlays/Tooltip.mjs.map +1 -0
  359. package/dist/components/portal/Portal.cjs +2 -0
  360. package/dist/components/portal/Portal.cjs.map +1 -0
  361. package/dist/components/portal/Portal.mjs +45 -0
  362. package/dist/components/portal/Portal.mjs.map +1 -0
  363. package/dist/components/provider/WaveProvider.cjs +2 -0
  364. package/dist/components/provider/WaveProvider.cjs.map +1 -0
  365. package/dist/components/provider/WaveProvider.mjs +51 -0
  366. package/dist/components/provider/WaveProvider.mjs.map +1 -0
  367. package/dist/components/table/DataGrid.cjs +2 -0
  368. package/dist/components/table/DataGrid.cjs.map +1 -0
  369. package/dist/components/table/DataGrid.mjs +489 -0
  370. package/dist/components/table/DataGrid.mjs.map +1 -0
  371. package/dist/components/table/Table.cjs +2 -0
  372. package/dist/components/table/Table.cjs.map +1 -0
  373. package/dist/components/table/Table.mjs +99 -0
  374. package/dist/components/table/Table.mjs.map +1 -0
  375. package/dist/components/table/useGridNavigation.cjs +2 -0
  376. package/dist/components/table/useGridNavigation.cjs.map +1 -0
  377. package/dist/components/table/useGridNavigation.mjs +336 -0
  378. package/dist/components/table/useGridNavigation.mjs.map +1 -0
  379. package/dist/components/typography/Text.cjs +2 -0
  380. package/dist/components/typography/Text.cjs.map +1 -0
  381. package/dist/components/typography/Text.mjs +38 -0
  382. package/dist/components/typography/Text.mjs.map +1 -0
  383. package/dist/hooks/useAnnounce.cjs +2 -0
  384. package/dist/hooks/useAnnounce.cjs.map +1 -0
  385. package/dist/hooks/useAnnounce.mjs +88 -0
  386. package/dist/hooks/useAnnounce.mjs.map +1 -0
  387. package/dist/hooks/useCheckedValues.cjs +2 -0
  388. package/dist/hooks/useCheckedValues.cjs.map +1 -0
  389. package/dist/hooks/useCheckedValues.mjs +102 -0
  390. package/dist/hooks/useCheckedValues.mjs.map +1 -0
  391. package/dist/hooks/useContextMenuAnchor.cjs +2 -0
  392. package/dist/hooks/useContextMenuAnchor.cjs.map +1 -0
  393. package/dist/hooks/useContextMenuAnchor.mjs +132 -0
  394. package/dist/hooks/useContextMenuAnchor.mjs.map +1 -0
  395. package/dist/hooks/useControllable.cjs +2 -0
  396. package/dist/hooks/useControllable.cjs.map +1 -0
  397. package/dist/hooks/useControllable.mjs +37 -0
  398. package/dist/hooks/useControllable.mjs.map +1 -0
  399. package/dist/hooks/useDirection.cjs +2 -0
  400. package/dist/hooks/useDirection.cjs.map +1 -0
  401. package/dist/hooks/useDirection.mjs +57 -0
  402. package/dist/hooks/useDirection.mjs.map +1 -0
  403. package/dist/hooks/useDismiss.cjs +2 -0
  404. package/dist/hooks/useDismiss.cjs.map +1 -0
  405. package/dist/hooks/useDismiss.mjs +57 -0
  406. package/dist/hooks/useDismiss.mjs.map +1 -0
  407. package/dist/hooks/useEventCallback.cjs +2 -0
  408. package/dist/hooks/useEventCallback.cjs.map +1 -0
  409. package/dist/hooks/useEventCallback.mjs +16 -0
  410. package/dist/hooks/useEventCallback.mjs.map +1 -0
  411. package/dist/hooks/useFieldControl.cjs +2 -0
  412. package/dist/hooks/useFieldControl.cjs.map +1 -0
  413. package/dist/hooks/useFieldControl.mjs +62 -0
  414. package/dist/hooks/useFieldControl.mjs.map +1 -0
  415. package/dist/hooks/useFocusTrap.cjs +2 -0
  416. package/dist/hooks/useFocusTrap.cjs.map +1 -0
  417. package/dist/hooks/useFocusTrap.mjs +266 -0
  418. package/dist/hooks/useFocusTrap.mjs.map +1 -0
  419. package/dist/hooks/useFormReset.cjs +2 -0
  420. package/dist/hooks/useFormReset.cjs.map +1 -0
  421. package/dist/hooks/useFormReset.mjs +33 -0
  422. package/dist/hooks/useFormReset.mjs.map +1 -0
  423. package/dist/hooks/useHoverIntent.cjs +2 -0
  424. package/dist/hooks/useHoverIntent.cjs.map +1 -0
  425. package/dist/hooks/useHoverIntent.mjs +201 -0
  426. package/dist/hooks/useHoverIntent.mjs.map +1 -0
  427. package/dist/hooks/useId.cjs +2 -0
  428. package/dist/hooks/useId.cjs.map +1 -0
  429. package/dist/hooks/useId.mjs +11 -0
  430. package/dist/hooks/useId.mjs.map +1 -0
  431. package/dist/hooks/useIsClient.cjs +2 -0
  432. package/dist/hooks/useIsClient.cjs.map +1 -0
  433. package/dist/hooks/useIsClient.mjs +19 -0
  434. package/dist/hooks/useIsClient.mjs.map +1 -0
  435. package/dist/hooks/useListbox.cjs +2 -0
  436. package/dist/hooks/useListbox.cjs.map +1 -0
  437. package/dist/hooks/useListbox.mjs +492 -0
  438. package/dist/hooks/useListbox.mjs.map +1 -0
  439. package/dist/hooks/useMergedRefs.cjs +2 -0
  440. package/dist/hooks/useMergedRefs.cjs.map +1 -0
  441. package/dist/hooks/useMergedRefs.mjs +57 -0
  442. package/dist/hooks/useMergedRefs.mjs.map +1 -0
  443. package/dist/hooks/useModalIsolation.cjs +2 -0
  444. package/dist/hooks/useModalIsolation.cjs.map +1 -0
  445. package/dist/hooks/useModalIsolation.mjs +87 -0
  446. package/dist/hooks/useModalIsolation.mjs.map +1 -0
  447. package/dist/hooks/useModalLayer.cjs +2 -0
  448. package/dist/hooks/useModalLayer.cjs.map +1 -0
  449. package/dist/hooks/useModalLayer.mjs +30 -0
  450. package/dist/hooks/useModalLayer.mjs.map +1 -0
  451. package/dist/hooks/usePopupPosition.cjs +2 -0
  452. package/dist/hooks/usePopupPosition.cjs.map +1 -0
  453. package/dist/hooks/usePopupPosition.mjs +117 -0
  454. package/dist/hooks/usePopupPosition.mjs.map +1 -0
  455. package/dist/hooks/usePrefersReducedMotion.cjs +2 -0
  456. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -0
  457. package/dist/hooks/usePrefersReducedMotion.mjs +24 -0
  458. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -0
  459. package/dist/hooks/usePresence.cjs +2 -0
  460. package/dist/hooks/usePresence.cjs.map +1 -0
  461. package/dist/hooks/usePresence.mjs +136 -0
  462. package/dist/hooks/usePresence.mjs.map +1 -0
  463. package/dist/hooks/usePreserveFocus.cjs +2 -0
  464. package/dist/hooks/usePreserveFocus.cjs.map +1 -0
  465. package/dist/hooks/usePreserveFocus.mjs +50 -0
  466. package/dist/hooks/usePreserveFocus.mjs.map +1 -0
  467. package/dist/hooks/useRestoreFocus.cjs +2 -0
  468. package/dist/hooks/useRestoreFocus.cjs.map +1 -0
  469. package/dist/hooks/useRestoreFocus.mjs +271 -0
  470. package/dist/hooks/useRestoreFocus.mjs.map +1 -0
  471. package/dist/hooks/useRovingTabIndex.cjs +2 -0
  472. package/dist/hooks/useRovingTabIndex.cjs.map +1 -0
  473. package/dist/hooks/useRovingTabIndex.mjs +389 -0
  474. package/dist/hooks/useRovingTabIndex.mjs.map +1 -0
  475. package/dist/hooks/useScrollLock.cjs +2 -0
  476. package/dist/hooks/useScrollLock.cjs.map +1 -0
  477. package/dist/hooks/useScrollLock.mjs +71 -0
  478. package/dist/hooks/useScrollLock.mjs.map +1 -0
  479. package/dist/hooks/useTriggerElement.cjs +2 -0
  480. package/dist/hooks/useTriggerElement.cjs.map +1 -0
  481. package/dist/hooks/useTriggerElement.mjs +126 -0
  482. package/dist/hooks/useTriggerElement.mjs.map +1 -0
  483. package/dist/hooks/useTypeahead.cjs +2 -0
  484. package/dist/hooks/useTypeahead.cjs.map +1 -0
  485. package/dist/hooks/useTypeahead.mjs +38 -0
  486. package/dist/hooks/useTypeahead.mjs.map +1 -0
  487. package/dist/index.cjs +1 -1
  488. package/dist/index.d.cts +9099 -0
  489. package/dist/index.d.ts +7688 -1027
  490. package/dist/index.mjs +91 -5695
  491. package/dist/lib/aria.cjs +2 -0
  492. package/dist/lib/aria.cjs.map +1 -0
  493. package/dist/lib/aria.mjs +29 -0
  494. package/dist/lib/aria.mjs.map +1 -0
  495. package/dist/lib/children.cjs +2 -0
  496. package/dist/lib/children.cjs.map +1 -0
  497. package/dist/lib/children.mjs +37 -0
  498. package/dist/lib/children.mjs.map +1 -0
  499. package/dist/lib/cn.cjs +2 -0
  500. package/dist/lib/cn.cjs.map +1 -0
  501. package/dist/lib/cn.mjs +64 -0
  502. package/dist/lib/cn.mjs.map +1 -0
  503. package/dist/lib/composeEventHandlers.cjs +2 -0
  504. package/dist/lib/composeEventHandlers.cjs.map +1 -0
  505. package/dist/lib/composeEventHandlers.mjs +11 -0
  506. package/dist/lib/composeEventHandlers.mjs.map +1 -0
  507. package/dist/lib/dev.cjs +2 -0
  508. package/dist/lib/dev.cjs.map +1 -0
  509. package/dist/lib/dev.mjs +42 -0
  510. package/dist/lib/dev.mjs.map +1 -0
  511. package/dist/lib/direction.cjs +2 -0
  512. package/dist/lib/direction.cjs.map +1 -0
  513. package/dist/lib/direction.mjs +35 -0
  514. package/dist/lib/direction.mjs.map +1 -0
  515. package/dist/lib/events.cjs +2 -0
  516. package/dist/lib/events.cjs.map +1 -0
  517. package/dist/lib/events.mjs +31 -0
  518. package/dist/lib/events.mjs.map +1 -0
  519. package/dist/lib/focus.cjs +2 -0
  520. package/dist/lib/focus.cjs.map +1 -0
  521. package/dist/lib/focus.mjs +119 -0
  522. package/dist/lib/focus.mjs.map +1 -0
  523. package/dist/lib/globalRegistry.cjs +2 -0
  524. package/dist/lib/globalRegistry.cjs.map +1 -0
  525. package/dist/lib/globalRegistry.mjs +13 -0
  526. package/dist/lib/globalRegistry.mjs.map +1 -0
  527. package/dist/lib/icons.cjs +2 -0
  528. package/dist/lib/icons.cjs.map +1 -0
  529. package/dist/lib/icons.mjs +254 -0
  530. package/dist/lib/icons.mjs.map +1 -0
  531. package/dist/lib/labelInName.cjs +2 -0
  532. package/dist/lib/labelInName.cjs.map +1 -0
  533. package/dist/lib/labelInName.mjs +54 -0
  534. package/dist/lib/labelInName.mjs.map +1 -0
  535. package/dist/lib/layers.cjs +2 -0
  536. package/dist/lib/layers.cjs.map +1 -0
  537. package/dist/lib/layers.mjs +224 -0
  538. package/dist/lib/layers.mjs.map +1 -0
  539. package/dist/lib/mergeProps.cjs +2 -0
  540. package/dist/lib/mergeProps.cjs.map +1 -0
  541. package/dist/lib/mergeProps.mjs +21 -0
  542. package/dist/lib/mergeProps.mjs.map +1 -0
  543. package/dist/lib/mergeRefs.cjs +2 -0
  544. package/dist/lib/mergeRefs.cjs.map +1 -0
  545. package/dist/lib/mergeRefs.mjs +29 -0
  546. package/dist/lib/mergeRefs.mjs.map +1 -0
  547. package/dist/lib/renderTrigger.cjs +2 -0
  548. package/dist/lib/renderTrigger.cjs.map +1 -0
  549. package/dist/lib/renderTrigger.mjs +29 -0
  550. package/dist/lib/renderTrigger.mjs.map +1 -0
  551. package/dist/lib/slot.cjs +2 -0
  552. package/dist/lib/slot.cjs.map +1 -0
  553. package/dist/lib/slot.mjs +122 -0
  554. package/dist/lib/slot.mjs.map +1 -0
  555. package/dist/lib/styles.cjs +2 -0
  556. package/dist/lib/styles.cjs.map +1 -0
  557. package/dist/lib/styles.mjs +16 -0
  558. package/dist/lib/styles.mjs.map +1 -0
  559. package/dist/lib/theme.cjs +2 -0
  560. package/dist/lib/theme.cjs.map +1 -0
  561. package/dist/lib/theme.mjs +16 -0
  562. package/dist/lib/theme.mjs.map +1 -0
  563. package/dist/preflight.css +2 -0
  564. package/dist/styles.css +2 -0
  565. package/package.json +149 -100
  566. package/src/styles/animations.css +7 -39
  567. package/src/styles/base.css +103 -0
  568. package/src/styles/globals.css +10 -22
  569. package/src/styles/legacy-tokens.css +184 -0
  570. package/src/styles/preflight.css +7 -0
  571. package/src/styles/styles.css +32 -0
  572. package/src/styles/tailwind.css +17 -0
  573. package/src/styles/tokens.css +561 -221
  574. package/src/styles/variants.css +29 -0
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
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 "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ //#region src/components/data-display/Divider.tsx
9
+ var s = "shrink-0 text-caption-1 text-muted-foreground", c = (c) => {
10
+ let { as: l, orientation: u = "horizontal", className: d, children: f, ref: p, "aria-labelledby": m, ...h } = c, g = r("divider-label"), _ = u === "vertical";
11
+ if (n(f)) {
12
+ let n = l ?? "div", r = h["aria-label"] ? m : i(m, g), c = _ ? "w-0 min-h-2 flex-1 border-s border-border" : "h-0 min-w-2 flex-1 border-t border-border";
13
+ return /* @__PURE__ */ o(n, {
14
+ ref: p,
15
+ role: "separator",
16
+ "aria-orientation": _ ? "vertical" : void 0,
17
+ className: e(_ ? "inline-flex min-h-12 flex-col items-center gap-1 self-stretch" : "flex items-center gap-3", d),
18
+ ...h,
19
+ "aria-labelledby": r,
20
+ children: [
21
+ /* @__PURE__ */ a("div", {
22
+ "aria-hidden": "true",
23
+ className: c
24
+ }),
25
+ t(f, "span", s, { id: g }),
26
+ /* @__PURE__ */ a("div", {
27
+ "aria-hidden": "true",
28
+ className: c
29
+ })
30
+ ]
31
+ });
32
+ }
33
+ return _ ? /* @__PURE__ */ a(l ?? "div", {
34
+ ref: p,
35
+ role: "separator",
36
+ "aria-orientation": "vertical",
37
+ "aria-labelledby": m,
38
+ className: e("inline-block h-6 border-s border-border", d),
39
+ ...h
40
+ }) : /* @__PURE__ */ a(l ?? "hr", {
41
+ ref: p,
42
+ role: "separator",
43
+ "aria-labelledby": m,
44
+ className: e("m-0 h-0 w-full border-0 border-t border-solid border-border", d),
45
+ ...h
46
+ });
47
+ };
48
+ c.displayName = "Divider";
49
+ //#endregion
50
+ export { c as Divider };
51
+
52
+ //# sourceMappingURL=Divider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.mjs","names":["useId","useId$1","labelClassName","Divider","ariaLabelledBy","rest","props","labelId","vertical","orientation","slotRendersContent","children","Wrapper","as","labelledBy","joinIds","lineClassName","cn","className","renderSlot"],"sources":["../../../src/components/data-display/Divider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { joinIds } from '../../lib/aria';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { useId } from '../../hooks/useId';\nimport type { Orientation } from '../../lib/types';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\n\n/**\n * The Divider's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props\n * only). Every other prop comes from the rendered element (`as`).\n */\nexport interface DividerOwnProps {\n /** Orientation of the divider line.\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /**\n * Ref to the rendered element. Typed `HTMLElement` for every `as`, because the default element\n * depends on the props: an `<hr>` for a plain horizontal divider, a `<div>` otherwise.\n */\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * Props of {@link Divider} rendered as `C` (default `'hr'`). `DividerProps` without a type argument\n * is the 0.4 name.\n */\nexport type DividerProps<C extends React.ElementType = 'hr'> = PolymorphicProps<C, DividerOwnProps>;\n\n/** The props the implementation reads, for any `as` (the public typing is `PolymorphicComponent`). */\ntype DividerImplProps = DividerOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n };\n\nconst labelClassName = 'shrink-0 text-caption-1 text-muted-foreground';\n\n/**\n * A line that separates content, horizontally or vertically, optionally with a label in the middle.\n *\n * - A plain horizontal divider renders an `<hr>`; a vertical or labelled divider renders a\n * `<div role=\"separator\">` (`as` replaces the element in every case). `children` that render\n * nothing (`''`, or an array, `Set` or generator of only empty items, such as an empty `.map()`\n * result) are no label; `0` is one.\n * - A labelled divider is **one** separator named by its label (`aria-labelledby`); the two line\n * segments around the label are presentational (`aria-hidden`). A consumer `aria-label` names it\n * instead, and a consumer `aria-labelledby` is joined with the label.\n * - Vertical dividers set `aria-orientation=\"vertical\"` and use logical borders (RTL-safe).\n *\n * @example\n * <Divider />\n * <Divider>OR</Divider>\n * <Divider orientation=\"vertical\" />\n */\nexport const Divider: PolymorphicComponent<'hr', DividerOwnProps> = (props) => {\n const {\n as,\n orientation = 'horizontal',\n className,\n children,\n ref,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = props as DividerImplProps;\n const labelId = useId('divider-label');\n const vertical = orientation === 'vertical';\n\n // The library's \"renders nothing\" rule: `0` is a label, while `''` or an array, Set or generator\n // of only empty items (an empty `.map()` result) is none.\n if (slotRendersContent(children)) {\n const Wrapper: React.ElementType = as ?? 'div';\n // A consumer aria-label names the separator; aria-labelledby would take precedence over it.\n const labelledBy = rest['aria-label'] ? ariaLabelledBy : joinIds(ariaLabelledBy, labelId);\n const lineClassName = vertical\n ? 'w-0 min-h-2 flex-1 border-s border-border'\n : 'h-0 min-w-2 flex-1 border-t border-border';\n return (\n <Wrapper\n ref={ref}\n role=\"separator\"\n aria-orientation={vertical ? 'vertical' : undefined}\n className={cn(\n vertical\n ? 'inline-flex min-h-12 flex-col items-center gap-1 self-stretch'\n : 'flex items-center gap-3',\n className,\n )}\n {...rest}\n aria-labelledby={labelledBy}\n >\n <div aria-hidden=\"true\" className={lineClassName} />\n {/* Rendered as a slot: a generator checked above was read once, and renderSlot renders\n the items read then. */}\n {renderSlot(children, 'span', labelClassName, { id: labelId })}\n <div aria-hidden=\"true\" className={lineClassName} />\n </Wrapper>\n );\n }\n\n if (vertical) {\n const Line: React.ElementType = as ?? 'div';\n return (\n <Line\n ref={ref}\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-labelledby={ariaLabelledBy}\n className={cn('inline-block h-6 border-s border-border', className)}\n {...rest}\n />\n );\n }\n\n const Rule: React.ElementType = as ?? 'hr';\n return (\n <Rule\n ref={ref}\n role=\"separator\"\n aria-labelledby={ariaLabelledBy}\n className={cn('m-0 h-0 w-full border-0 border-t border-solid border-border', className)}\n {...rest}\n />\n );\n};\n\nDivider.displayName = 'Divider';\n"],"mappings":";;;;;;;;AAoCA,IAAME,IAAiB,iDAmBVC,KAAwD,MAAU;CAC7E,IAAM,EACJ,OACA,iBAAc,cACd,cACA,aACA,QACA,mBAAmBC,GACnB,GAAGC,MACDC,GACEC,IAAUP,EAAM,eAAe,GAC/BQ,IAAWC,MAAgB;CAIjC,IAAIC,EAAmBC,CAAQ,GAAG;EAChC,IAAMC,IAA6BC,KAAM,OAEnCC,IAAaT,EAAK,gBAAgBD,IAAiBW,EAAQX,GAAgBG,CAAO,GAClFS,IAAgBR,IAClB,8CACA;EACJ,OACE,kBAACI,GAAD;GACO;GACL,MAAK;GACL,oBAAkBJ,IAAW,aAAa,KAAA;GAC1C,WAAWS,EACTT,IACI,kEACA,2BACJU,CACF;GACA,GAAIb;GACJ,mBAAiBS;GAXnB,UAAA;IAaE,kBAAC,OAAD;KAAK,eAAY;KAAO,WAAWE;IAAgB,CAAA;IAGlDG,EAAWR,GAAU,QAAQT,GAAgB,EAAE,IAAIK,EAAQ,CAAC;IAC7D,kBAAC,OAAD;KAAK,eAAY;KAAO,WAAWS;IAAgB,CAAA;GAC5C;;CAEb;CAiBA,OAfIR,IAGA,kBAF8BK,KAAM,OAEpC;EACO;EACL,MAAK;EACL,oBAAiB;EACjB,mBAAiBT;EACjB,WAAWa,EAAG,2CAA2CC,CAAS;EAClE,GAAIb;CACL,CAAA,IAMH,kBAF8BQ,KAAM,MAEpC;EACO;EACL,MAAK;EACL,mBAAiBT;EACjB,WAAWa,EAAG,+DAA+DC,CAAS;EACtF,GAAIb;CACL,CAAA;AAEL;AAEA,EAAQ,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={none:`object-none object-left-top`,center:`object-none object-center`,contain:`object-contain`,cover:`object-cover`,default:``},o={circular:`rounded-full`,rounded:`rounded`,square:`rounded-none`},s=({fit:e=`default`,shape:s=`square`,shadow:c=!1,block:l=!1,bordered:u=!1,className:d,alt:f,ref:p,...m})=>{let h=f===void 0;return r.useEffect(()=>{h&&n.warnOnce(`Image:alt`,'Image: `alt` is missing. Describe the image, or pass alt="" when it is decorative.')},[h]),(0,i.jsx)(`img`,{ref:p,alt:f,className:t.cn(a[e],o[s],l?`block w-full`:`inline-block max-w-full`,e==="default"&&`h-auto`,c&&`shadow-4`,u&&`border border-border`,d),...m})};s.displayName=`Image`,exports.Image=s;
2
+ //# sourceMappingURL=Image.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.cjs","names":["cn","require_runtime","require_cn","require_dev","react","react_jsx_runtime","fitMap","shapeMap","Image","rest","missingAlt","alt","fit","shape","block","shadow","bordered","className"],"sources":["../../../src/components/data-display/Image.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { warnOnce } from '../../lib/dev';\nimport type { Shape } from '../../lib/types';\n\n/**\n * How an image fits its box (the `width`/`height` attributes, or a size set with `className`):\n *\n * - `'default'`: the image fills the box. Its height follows its width, so the aspect ratio is\n * kept (the attributes only give the ratio before the image loads); a height set with\n * `className` fixes the box, and the image then stretches to it.\n * - `'none'`: not scaled; the image's top-left corner stays in view and the rest is cropped.\n * - `'center'`: not scaled; the middle of the image stays in view and the edges are cropped.\n * - `'contain'`: scaled to fit inside the box, keeping its aspect ratio (the box may show empty\n * bands).\n * - `'cover'`: scaled to fill the box, keeping its aspect ratio (the edges are cropped).\n */\nexport type ImageFit = 'none' | 'center' | 'contain' | 'cover' | 'default';\n/** Shape of the image corners (the shared {@link Shape} vocabulary). */\nexport type ImageShape = Shape;\n\n/** Properties for the Image component. */\nexport interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n /**\n * Text alternative of the image. Describe what the image shows, or pass `alt=\"\"` when it is\n * decorative (it then is hidden from assistive technology). Leaving it out logs a development\n * warning; use {@link StrictImageProps} to require it at compile time (required in 1.0).\n */\n alt?: string;\n /**\n * How the image fits its box: `'default'` (fills it, keeping the aspect ratio through an\n * automatic height), `'none'` (not scaled, top-left corner in view), `'center'` (not scaled,\n * middle in view), `'contain'` or `'cover'`. See {@link ImageFit}.\n * @default 'default'\n */\n fit?: ImageFit;\n /** Shape of the image border radius.\n * @default 'square'\n */\n shape?: ImageShape;\n /** Whether to apply a shadow to the image.\n * @default false\n */\n shadow?: boolean;\n /**\n * Whether the image is displayed as a block element filling the width of its parent. Otherwise\n * it is inline and never wider than its parent. With the default `fit` the height follows the\n * width (the aspect ratio is kept); with another `fit` the box keeps its `height`.\n * @default false\n */\n block?: boolean;\n /** Whether to show a border around the image.\n * @default false\n */\n bordered?: boolean;\n /** Ref to the `<img>` element. */\n ref?: React.Ref<HTMLImageElement>;\n}\n\n/**\n * {@link ImageProps} with a required `alt`: the compile-time check that every image has a text\n * alternative (`alt=\"\"` for decorative images). `ImageProps.alt` becomes required in 1.0.\n *\n * @example\n * const Photo = (props: StrictImageProps) => <Image {...props} />;\n */\nexport interface StrictImageProps extends Omit<ImageProps, 'alt'> {\n /** Text alternative of the image; `''` for a decorative image. */\n alt: string;\n}\n\nconst fitMap: Record<ImageFit, string> = {\n // wave-allow-physical: the anchor is the image's own corner; image pixels never mirror in RTL.\n none: 'object-none object-left-top',\n center: 'object-none object-center',\n contain: 'object-contain',\n cover: 'object-cover',\n default: '',\n};\n\nconst shapeMap: Record<ImageShape, string> = {\n circular: 'rounded-full',\n rounded: 'rounded',\n square: 'rounded-none',\n};\n\n/**\n * An `<img>` with Wave fit, shape, shadow and border options.\n *\n * Always pass `alt`: a description of the image, or `alt=\"\"` for a decorative image. Without it\n * screen readers may announce the file name; a development warning points this out.\n *\n * @example\n * <Image src=\"/team.jpg\" alt=\"The team at the 2026 offsite\" shape=\"rounded\" />\n */\nexport const Image = ({\n fit = 'default',\n shape = 'square',\n shadow = false,\n block = false,\n bordered = false,\n className,\n alt,\n ref,\n ...rest\n}: ImageProps) => {\n const missingAlt = alt === undefined;\n React.useEffect(() => {\n if (missingAlt) {\n warnOnce(\n 'Image:alt',\n 'Image: `alt` is missing. Describe the image, or pass alt=\"\" when it is decorative.',\n );\n }\n }, [missingAlt]);\n\n return (\n <img\n ref={ref}\n alt={alt}\n className={cn(\n fitMap[fit],\n shapeMap[shape],\n // Set here, not left to Preflight (C-NATIVE). The default fit fills the box, so an\n // automatic height keeps the aspect ratio; the other fits fit the image into the box.\n block ? 'block w-full' : 'inline-block max-w-full',\n fit === 'default' && 'h-auto',\n shadow && 'shadow-4',\n bordered && 'border border-border',\n className,\n )}\n {...rest}\n />\n );\n};\n\nImage.displayName = 'Image';\n"],"mappings":"6MAuEA,IAAMM,EAAmC,CAEvC,KAAM,8BACN,OAAQ,4BACR,QAAS,iBACT,MAAO,eACP,QAAS,EACX,EAEMC,EAAuC,CAC3C,SAAU,eACV,QAAS,UACT,OAAQ,cACV,EAWaC,GAAS,CACpB,MAAM,UACN,QAAQ,SACR,SAAS,GACT,QAAQ,GACR,WAAW,GACX,YACA,MACA,MACA,GAAGC,KACa,CAChB,IAAMC,EAAaC,IAAQ,IAAA,GAU3B,OATAP,EAAM,cAAgB,CAChBM,GACFP,EAAA,SACE,YACA,oFACF,CAEJ,EAAG,CAACO,CAAU,CAAC,GAGb,EAAAL,EAAA,IAAA,CAAC,MAAD,CACO,MACA,MACL,UAAWL,EAAAA,GACTM,EAAOM,GACPL,EAASM,GAGTC,EAAQ,eAAiB,0BACzBF,IAAQ,WAAa,SACrBG,GAAU,WACVC,GAAY,uBACZC,CACF,EACA,GAAIR,CACL,CAAA,CAEL,EAEA,EAAM,YAAc"}
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { warnOnce as t } from "../../lib/dev.mjs";
4
+ import * as n from "react";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ //#region src/components/data-display/Image.tsx
7
+ var i = {
8
+ none: "object-none object-left-top",
9
+ center: "object-none object-center",
10
+ contain: "object-contain",
11
+ cover: "object-cover",
12
+ default: ""
13
+ }, a = {
14
+ circular: "rounded-full",
15
+ rounded: "rounded",
16
+ square: "rounded-none"
17
+ }, o = ({ fit: o = "default", shape: s = "square", shadow: c = !1, block: l = !1, bordered: u = !1, className: d, alt: f, ref: p, ...m }) => {
18
+ let h = f === void 0;
19
+ return n.useEffect(() => {
20
+ h && t("Image:alt", "Image: `alt` is missing. Describe the image, or pass alt=\"\" when it is decorative.");
21
+ }, [h]), /* @__PURE__ */ r("img", {
22
+ ref: p,
23
+ alt: f,
24
+ className: e(i[o], a[s], l ? "block w-full" : "inline-block max-w-full", o === "default" && "h-auto", c && "shadow-4", u && "border border-border", d),
25
+ ...m
26
+ });
27
+ };
28
+ o.displayName = "Image";
29
+ //#endregion
30
+ export { o as Image };
31
+
32
+ //# sourceMappingURL=Image.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.mjs","names":["React","fitMap","shapeMap","Image","rest","missingAlt","alt","warnOnce","cn","fit","shape","block","shadow","bordered","className"],"sources":["../../../src/components/data-display/Image.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { warnOnce } from '../../lib/dev';\nimport type { Shape } from '../../lib/types';\n\n/**\n * How an image fits its box (the `width`/`height` attributes, or a size set with `className`):\n *\n * - `'default'`: the image fills the box. Its height follows its width, so the aspect ratio is\n * kept (the attributes only give the ratio before the image loads); a height set with\n * `className` fixes the box, and the image then stretches to it.\n * - `'none'`: not scaled; the image's top-left corner stays in view and the rest is cropped.\n * - `'center'`: not scaled; the middle of the image stays in view and the edges are cropped.\n * - `'contain'`: scaled to fit inside the box, keeping its aspect ratio (the box may show empty\n * bands).\n * - `'cover'`: scaled to fill the box, keeping its aspect ratio (the edges are cropped).\n */\nexport type ImageFit = 'none' | 'center' | 'contain' | 'cover' | 'default';\n/** Shape of the image corners (the shared {@link Shape} vocabulary). */\nexport type ImageShape = Shape;\n\n/** Properties for the Image component. */\nexport interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n /**\n * Text alternative of the image. Describe what the image shows, or pass `alt=\"\"` when it is\n * decorative (it then is hidden from assistive technology). Leaving it out logs a development\n * warning; use {@link StrictImageProps} to require it at compile time (required in 1.0).\n */\n alt?: string;\n /**\n * How the image fits its box: `'default'` (fills it, keeping the aspect ratio through an\n * automatic height), `'none'` (not scaled, top-left corner in view), `'center'` (not scaled,\n * middle in view), `'contain'` or `'cover'`. See {@link ImageFit}.\n * @default 'default'\n */\n fit?: ImageFit;\n /** Shape of the image border radius.\n * @default 'square'\n */\n shape?: ImageShape;\n /** Whether to apply a shadow to the image.\n * @default false\n */\n shadow?: boolean;\n /**\n * Whether the image is displayed as a block element filling the width of its parent. Otherwise\n * it is inline and never wider than its parent. With the default `fit` the height follows the\n * width (the aspect ratio is kept); with another `fit` the box keeps its `height`.\n * @default false\n */\n block?: boolean;\n /** Whether to show a border around the image.\n * @default false\n */\n bordered?: boolean;\n /** Ref to the `<img>` element. */\n ref?: React.Ref<HTMLImageElement>;\n}\n\n/**\n * {@link ImageProps} with a required `alt`: the compile-time check that every image has a text\n * alternative (`alt=\"\"` for decorative images). `ImageProps.alt` becomes required in 1.0.\n *\n * @example\n * const Photo = (props: StrictImageProps) => <Image {...props} />;\n */\nexport interface StrictImageProps extends Omit<ImageProps, 'alt'> {\n /** Text alternative of the image; `''` for a decorative image. */\n alt: string;\n}\n\nconst fitMap: Record<ImageFit, string> = {\n // wave-allow-physical: the anchor is the image's own corner; image pixels never mirror in RTL.\n none: 'object-none object-left-top',\n center: 'object-none object-center',\n contain: 'object-contain',\n cover: 'object-cover',\n default: '',\n};\n\nconst shapeMap: Record<ImageShape, string> = {\n circular: 'rounded-full',\n rounded: 'rounded',\n square: 'rounded-none',\n};\n\n/**\n * An `<img>` with Wave fit, shape, shadow and border options.\n *\n * Always pass `alt`: a description of the image, or `alt=\"\"` for a decorative image. Without it\n * screen readers may announce the file name; a development warning points this out.\n *\n * @example\n * <Image src=\"/team.jpg\" alt=\"The team at the 2026 offsite\" shape=\"rounded\" />\n */\nexport const Image = ({\n fit = 'default',\n shape = 'square',\n shadow = false,\n block = false,\n bordered = false,\n className,\n alt,\n ref,\n ...rest\n}: ImageProps) => {\n const missingAlt = alt === undefined;\n React.useEffect(() => {\n if (missingAlt) {\n warnOnce(\n 'Image:alt',\n 'Image: `alt` is missing. Describe the image, or pass alt=\"\" when it is decorative.',\n );\n }\n }, [missingAlt]);\n\n return (\n <img\n ref={ref}\n alt={alt}\n className={cn(\n fitMap[fit],\n shapeMap[shape],\n // Set here, not left to Preflight (C-NATIVE). The default fit fills the box, so an\n // automatic height keeps the aspect ratio; the other fits fit the image into the box.\n block ? 'block w-full' : 'inline-block max-w-full',\n fit === 'default' && 'h-auto',\n shadow && 'shadow-4',\n bordered && 'border border-border',\n className,\n )}\n {...rest}\n />\n );\n};\n\nImage.displayName = 'Image';\n"],"mappings":";;;;;;AAuEA,IAAMC,IAAmC;CAEvC,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,SAAS;AACX,GAEMC,IAAuC;CAC3C,UAAU;CACV,SAAS;CACT,QAAQ;AACV,GAWaC,KAAS,EACpB,SAAM,WACN,WAAQ,UACR,YAAS,IACT,WAAQ,IACR,cAAW,IACX,cACA,QACA,QACA,GAAGC,QACa;CAChB,IAAMC,IAAaC,MAAQ,KAAA;CAU3B,OATAN,EAAM,gBAAgB;EACpB,AAAIK,KACFE,EACE,aACA,sFACF;CAEJ,GAAG,CAACF,CAAU,CAAC,GAGb,kBAAC,OAAD;EACO;EACA;EACL,WAAWG,EACTP,EAAOQ,IACPP,EAASQ,IAGTC,IAAQ,iBAAiB,2BACzBF,MAAQ,aAAa,UACrBG,KAAU,YACVC,KAAY,wBACZC,CACF;EACA,GAAIV;CACL,CAAA;AAEL;AAEA,EAAM,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../hooks/useId.cjs"),r=require("../../hooks/useMergedRefs.cjs"),i=require("../../hooks/useDismiss.cjs"),a=require("../portal/Portal.cjs"),o=require("../../lib/styles.cjs"),s=require("../../lib/icons.cjs"),c=require("../../hooks/usePopupPosition.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=250,f=250,p=({label:e,info:p,infoButtonLabel:m=`Information`,className:h,ref:g,..._})=>{let v=n.useId(`info-label-description`),[y,b]=l.useState(null),x=y!==null,S=l.useRef(null),C=l.useRef(null),w=l.useRef(!1),T=l.useRef(null),E=l.useRef(null),D=l.useRef(null),O=()=>{E.current!==null&&clearTimeout(E.current),E.current=null},k=()=>{D.current!==null&&clearTimeout(D.current),D.current=null};l.useEffect(()=>()=>{T.current!==null&&clearTimeout(T.current),E.current!==null&&clearTimeout(E.current),D.current!==null&&clearTimeout(D.current)},[]);let A=()=>{O(),k(),b(null)},{setReference:j,setFloating:M,floatingProps:N}=c.usePopupPosition({open:x,side:`top`,align:`center`,offset:8}),{layerId:P}=i.useDismiss({open:x,onDismiss:A,refs:[S,C],anchorRef:S,focusOutside:!0}),F=r.useMergedRefs(S,j),I=r.useMergedRefs(C,M),L=()=>{O(),k(),D.current=setTimeout(()=>{D.current=null,b(e=>e===`hover`?null:e)},f)},R=e=>{e.pointerType!==`touch`&&(k(),!(x||E.current!==null)&&(E.current=setTimeout(()=>{E.current=null,b(e=>e??`hover`)},d)))},z=e=>{e.pointerType!==`touch`&&L()},B=()=>{w.current=!0,T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{T.current=null,w.current=!1},0)},V=()=>{w.current||b(e=>e===`click`?e:`focus`)},H=()=>{b(e=>e===`focus`?null:e)},U=()=>{O(),k(),b(e=>e===`click`?null:`click`)};return(0,u.jsxs)(`span`,{ref:g,className:t.cn(`inline-flex items-center gap-1 text-body-1`,h),..._,children:[e,(0,u.jsx)(`button`,{ref:F,type:`button`,"aria-label":m,"aria-expanded":x,"aria-describedby":v,className:t.cn(`inline-flex size-4 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-muted-foreground`,`not-disabled:not-aria-disabled:hover:text-foreground`,o.focusRing),onPointerDown:B,onMouseDown:B,onPointerEnter:R,onPointerLeave:z,onFocus:V,onBlur:H,onClick:U,children:(0,u.jsx)(s.InfoIcon,{size:16})}),(0,u.jsx)(`span`,{id:v,hidden:!0,children:p}),x&&(0,u.jsx)(a.Portal,{layerId:P,children:(0,u.jsx)(`div`,{ref:I,"aria-hidden":`true`,"data-wave-infolabel-surface":``,"data-state":`open`,...N,className:`w-max max-w-xs rounded-md border border-border bg-background px-3 py-2 text-caption-1 text-foreground shadow-16`,onPointerEnter:R,onPointerLeave:z,children:p})})]})};p.displayName=`InfoLabel`,exports.InfoLabel=p;
2
+ //# sourceMappingURL=InfoLabel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoLabel.cjs","names":["useId","React","usePopupPosition","useDismiss","useMergedRefs","cn","focusRing","InfoIcon","Portal","require_runtime","require_cn","require_useId","require_useMergedRefs","require_useDismiss","require_Portal","require_styles","require_icons","require_usePopupPosition","react","react_jsx_runtime","SHOW_DELAY","HIDE_DELAY","InfoLabel","props","descriptionId","openReason","setOpenReason","open","triggerRef","surfaceRef","pointerPressRef","pressTimerRef","showTimerRef","hideTimerRef","clearShowTimer","clearHideTimer","close","triggerRefs","setReference","surfaceRefs","setFloating","scheduleHide","reason","handlePointerEnter","event","handlePointerLeave","handlePointerDown","handleFocus","handleBlur","handleClick","className","label","infoButtonLabel","info","floatingProps"],"sources":["../../../src/components/data-display/InfoLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { focusRing } from '../../lib/styles';\nimport { InfoIcon } from '../../lib/icons';\nimport { useId } from '../../hooks/useId';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport { Portal } from '../portal/Portal';\n\n/** Properties for the InfoLabel component. */\nexport interface InfoLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Primary label text to display. */\n label: string;\n /**\n * Additional information about the label. It describes the info button\n * (`aria-describedby`, available from the first render) and is shown in a popup on hover,\n * keyboard focus or click.\n */\n info: string;\n /**\n * Accessible name of the info button. Localise it here.\n * @default 'Information'\n */\n infoButtonLabel?: string;\n /** Ref to the root `<span>`. */\n ref?: React.Ref<HTMLSpanElement>;\n}\n\n/** Why the popup is open: a click pins it; hover and keyboard focus open it transiently. */\ntype OpenReason = 'hover' | 'focus' | 'click';\n\n/** Hover delay before the popup opens, and before it closes after the pointer leaves (ms). */\nconst SHOW_DELAY = 250;\nconst HIDE_DELAY = 250;\n\ntype Timer = ReturnType<typeof setTimeout>;\n\n/**\n * A label with an info button that reveals additional information (a \"toggletip\").\n *\n * - The info button is a `<button type=\"button\">` named `infoButtonLabel` (\"Information\"). The\n * info text is rendered inline in a `hidden` element and linked with `aria-describedby`, so it is\n * announced from the first render (also after server rendering), whether the popup is open or not.\n * - The visual popup is portaled only while open. It is `aria-hidden` because it duplicates the\n * description, and it holds no focusable content, so focus stays on the button.\n * - Opens on keyboard focus (not on focus that comes from a pointer press), on hover after a\n * short delay (the popup itself can be hovered) and on click. A click pins it: a click while it is\n * open because of hover or focus keeps it open, a click on a pinned popup closes it.\n * - Closes on Escape, on a press outside, when focus moves elsewhere and — unless pinned — when\n * the pointer leaves or the button loses focus (WCAG 1.4.13). A popup opened by hover that then\n * receives keyboard focus stays open while the button keeps focus, even after the pointer leaves.\n *\n * @example\n * <InfoLabel label=\"Password\" info=\"Use at least 8 characters.\" />\n */\nexport const InfoLabel = ({\n label,\n info,\n infoButtonLabel = 'Information',\n className,\n ref,\n ...props\n}: InfoLabelProps) => {\n const descriptionId = useId('info-label-description');\n const [openReason, setOpenReason] = React.useState<OpenReason | null>(null);\n const open = openReason !== null;\n\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const surfaceRef = React.useRef<HTMLDivElement | null>(null);\n /**\n * Set by a pointer press on the button, so the focus that follows does not open the popup. It\n * lasts only for the event turn of the press (see `handlePointerDown`).\n */\n const pointerPressRef = React.useRef(false);\n const pressTimerRef = React.useRef<Timer | null>(null);\n const showTimerRef = React.useRef<Timer | null>(null);\n const hideTimerRef = React.useRef<Timer | null>(null);\n\n const clearShowTimer = () => {\n if (showTimerRef.current !== null) clearTimeout(showTimerRef.current);\n showTimerRef.current = null;\n };\n const clearHideTimer = () => {\n if (hideTimerRef.current !== null) clearTimeout(hideTimerRef.current);\n hideTimerRef.current = null;\n };\n\n React.useEffect(\n () => () => {\n if (pressTimerRef.current !== null) clearTimeout(pressTimerRef.current);\n if (showTimerRef.current !== null) clearTimeout(showTimerRef.current);\n if (hideTimerRef.current !== null) clearTimeout(hideTimerRef.current);\n },\n [],\n );\n\n const close = () => {\n clearShowTimer();\n clearHideTimer();\n setOpenReason(null);\n };\n\n const { setReference, setFloating, floatingProps } = usePopupPosition({\n open,\n side: 'top',\n align: 'center',\n offset: 8,\n });\n const { layerId } = useDismiss({\n open,\n onDismiss: close,\n refs: [triggerRef, surfaceRef],\n anchorRef: triggerRef,\n focusOutside: true,\n });\n const triggerRefs = useMergedRefs<HTMLButtonElement>(triggerRef, setReference);\n const surfaceRefs = useMergedRefs<HTMLDivElement>(surfaceRef, setFloating);\n\n /** Pointer left the button or the popup: a hover-opened popup closes after a delay. */\n const scheduleHide = () => {\n clearShowTimer();\n clearHideTimer();\n hideTimerRef.current = setTimeout(() => {\n hideTimerRef.current = null;\n setOpenReason((reason) => (reason === 'hover' ? null : reason));\n }, HIDE_DELAY);\n };\n\n const handlePointerEnter = (event: React.PointerEvent) => {\n if (event.pointerType === 'touch') return;\n clearHideTimer();\n if (open || showTimerRef.current !== null) return;\n showTimerRef.current = setTimeout(() => {\n showTimerRef.current = null;\n setOpenReason((reason) => reason ?? 'hover');\n }, SHOW_DELAY);\n };\n\n const handlePointerLeave = (event: React.PointerEvent) => {\n if (event.pointerType === 'touch') return;\n scheduleHide();\n };\n\n const handlePointerDown = () => {\n pointerPressRef.current = true;\n // A press focuses the button (where it does) as the default action of `mousedown`, in the same\n // event turn. Forget the press after that turn: a press that does not focus the button (Safari\n // and Firefox on macOS, iOS) and ends without a click (dragged off, or a touch that becomes a\n // scroll) must not turn a later keyboard focus into pointer focus. A touch tap dispatches its\n // compatibility `mousedown` (and the focus) after the touch ends; that `mousedown` sets the\n // flag again.\n if (pressTimerRef.current !== null) clearTimeout(pressTimerRef.current);\n pressTimerRef.current = setTimeout(() => {\n pressTimerRef.current = null;\n pointerPressRef.current = false;\n }, 0);\n };\n\n const handleFocus = () => {\n // Keyboard focus opens; focus that comes from a pointer press waits for the click.\n if (pointerPressRef.current) return;\n // A popup opened by hover becomes focus-owned, so it stays while the button has focus even\n // after the pointer leaves (WCAG 1.4.13 persistent). A pinned popup stays pinned.\n setOpenReason((reason) => (reason === 'click' ? reason : 'focus'));\n };\n\n const handleBlur = () => {\n setOpenReason((reason) => (reason === 'focus' ? null : reason));\n };\n\n const handleClick = () => {\n clearShowTimer();\n clearHideTimer();\n // Closed → pinned; open because of hover or focus → pinned; pinned → closed.\n setOpenReason((reason) => (reason === 'click' ? null : 'click'));\n };\n\n return (\n <span\n ref={ref}\n className={cn('inline-flex items-center gap-1 text-body-1', className)}\n {...props}\n >\n {label}\n <button\n ref={triggerRefs}\n type=\"button\"\n aria-label={infoButtonLabel}\n aria-expanded={open}\n aria-describedby={descriptionId}\n className={cn(\n 'inline-flex size-4 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-muted-foreground',\n 'not-disabled:not-aria-disabled:hover:text-foreground',\n focusRing,\n )}\n onPointerDown={handlePointerDown}\n onMouseDown={handlePointerDown}\n onPointerEnter={handlePointerEnter}\n onPointerLeave={handlePointerLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onClick={handleClick}\n >\n <InfoIcon size={16} />\n </button>\n <span id={descriptionId} hidden>\n {info}\n </span>\n {open && (\n <Portal layerId={layerId}>\n <div\n ref={surfaceRefs}\n aria-hidden=\"true\"\n data-wave-infolabel-surface=\"\"\n data-state=\"open\"\n {...floatingProps}\n className=\"w-max max-w-xs rounded-md border border-border bg-background px-3 py-2 text-caption-1 text-foreground shadow-16\"\n onPointerEnter={handlePointerEnter}\n onPointerLeave={handlePointerLeave}\n >\n {info}\n </div>\n </Portal>\n )}\n </span>\n );\n};\n\nInfoLabel.displayName = 'InfoLabel';\n"],"mappings":"ubAiCA,IAAMoB,EAAa,IACbC,EAAa,IAsBNC,GAAa,CACxB,QACA,OACA,kBAAkB,cAClB,YACA,MACA,GAAGC,KACiB,CACpB,IAAMC,EAAgBxB,EAAAA,MAAM,wBAAwB,EAC9C,CAACyB,EAAYC,GAAiBzB,EAAM,SAA4B,IAAI,EACpE0B,EAAOF,IAAe,KAEtBG,EAAa3B,EAAM,OAAiC,IAAI,EACxD4B,EAAa5B,EAAM,OAA8B,IAAI,EAKrD6B,EAAkB7B,EAAM,OAAO,EAAK,EACpC8B,EAAgB9B,EAAM,OAAqB,IAAI,EAC/C+B,EAAe/B,EAAM,OAAqB,IAAI,EAC9CgC,EAAehC,EAAM,OAAqB,IAAI,EAE9CiC,MAAuB,CACvBF,EAAa,UAAY,MAAM,aAAaA,EAAa,OAAO,EACpE,EAAa,QAAU,IACzB,EACMG,MAAuB,CACvBF,EAAa,UAAY,MAAM,aAAaA,EAAa,OAAO,EACpE,EAAa,QAAU,IACzB,EAEAf,EAAM,kBACQ,CACNa,EAAc,UAAY,MAAM,aAAaA,EAAc,OAAO,EAClEC,EAAa,UAAY,MAAM,aAAaA,EAAa,OAAO,EAChEC,EAAa,UAAY,MAAM,aAAaA,EAAa,OAAO,CACtE,EACA,CAAC,CACH,EAEA,IAAMG,MAAc,CAClBF,EAAe,EACfC,EAAe,EACfT,EAAc,IAAI,CACpB,EAEM,CAAE,eAAc,cAAa,iBAAkBxB,EAAAA,iBAAiB,CACpE,OACA,KAAM,MACN,MAAO,SACP,OAAQ,CACV,CAAC,EACK,CAAE,WAAYC,EAAAA,WAAW,CAC7B,OACA,UAAWiC,EACX,KAAM,CAACR,EAAYC,CAAU,EAC7B,UAAWD,EACX,aAAc,EAChB,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,EAChB,eAAgBE,EAChB,QAASE,EACT,OAAQC,EACR,QAASC,EAET,UAAA,EAAA9B,EAAA,IAAA,CAACZ,EAAAA,SAAD,CAAU,KAAM,EAAK,CAAA,CACf,CAAA,GACR,EAAAY,EAAA,IAAA,CAAC,OAAD,CAAM,GAAIK,EAAe,OAAA,GACtB,SAAA6B,CACG,CAAA,EACL1B,IACC,EAAAR,EAAA,IAAA,CAACX,EAAAA,OAAD,CAAiB,UACf,UAAA,EAAAW,EAAA,IAAA,CAAC,MAAD,CACE,IAAKoB,EACL,cAAY,OACZ,8BAA4B,GAC5B,aAAW,OACX,GAAIe,EACJ,UAAU,kHACV,eAAgBX,EAChB,eAAgBE,EAEf,SAAAQ,CACE,CAAA,CACC,CAAA,CAEN,GAEV,EAEA,EAAU,YAAc"}
@@ -0,0 +1,104 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { useId as t } from "../../hooks/useId.mjs";
4
+ import { useMergedRefs as n } from "../../hooks/useMergedRefs.mjs";
5
+ import { useDismiss as r } from "../../hooks/useDismiss.mjs";
6
+ import { Portal as i } from "../portal/Portal.mjs";
7
+ import { focusRing as a } from "../../lib/styles.mjs";
8
+ import { InfoIcon as o } from "../../lib/icons.mjs";
9
+ import { usePopupPosition as s } from "../../hooks/usePopupPosition.mjs";
10
+ import * as c from "react";
11
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
12
+ //#region src/components/data-display/InfoLabel.tsx
13
+ var d = 250, f = 250, p = ({ label: p, info: m, infoButtonLabel: h = "Information", className: g, ref: _, ...v }) => {
14
+ let y = t("info-label-description"), [b, x] = c.useState(null), S = b !== null, C = c.useRef(null), w = c.useRef(null), T = c.useRef(!1), E = c.useRef(null), D = c.useRef(null), O = c.useRef(null), k = () => {
15
+ D.current !== null && clearTimeout(D.current), D.current = null;
16
+ }, A = () => {
17
+ O.current !== null && clearTimeout(O.current), O.current = null;
18
+ };
19
+ c.useEffect(() => () => {
20
+ E.current !== null && clearTimeout(E.current), D.current !== null && clearTimeout(D.current), O.current !== null && clearTimeout(O.current);
21
+ }, []);
22
+ let j = () => {
23
+ k(), A(), x(null);
24
+ }, { setReference: M, setFloating: N, floatingProps: P } = s({
25
+ open: S,
26
+ side: "top",
27
+ align: "center",
28
+ offset: 8
29
+ }), { layerId: F } = r({
30
+ open: S,
31
+ onDismiss: j,
32
+ refs: [C, w],
33
+ anchorRef: C,
34
+ focusOutside: !0
35
+ }), I = n(C, M), L = n(w, N), R = () => {
36
+ k(), A(), O.current = setTimeout(() => {
37
+ O.current = null, x((e) => e === "hover" ? null : e);
38
+ }, f);
39
+ }, z = (e) => {
40
+ e.pointerType !== "touch" && (A(), !(S || D.current !== null) && (D.current = setTimeout(() => {
41
+ D.current = null, x((e) => e ?? "hover");
42
+ }, d)));
43
+ }, B = (e) => {
44
+ e.pointerType !== "touch" && R();
45
+ }, V = () => {
46
+ T.current = !0, E.current !== null && clearTimeout(E.current), E.current = setTimeout(() => {
47
+ E.current = null, T.current = !1;
48
+ }, 0);
49
+ }, H = () => {
50
+ T.current || x((e) => e === "click" ? e : "focus");
51
+ }, U = () => {
52
+ x((e) => e === "focus" ? null : e);
53
+ }, W = () => {
54
+ k(), A(), x((e) => e === "click" ? null : "click");
55
+ };
56
+ return /* @__PURE__ */ u("span", {
57
+ ref: _,
58
+ className: e("inline-flex items-center gap-1 text-body-1", g),
59
+ ...v,
60
+ children: [
61
+ p,
62
+ /* @__PURE__ */ l("button", {
63
+ ref: I,
64
+ type: "button",
65
+ "aria-label": h,
66
+ "aria-expanded": S,
67
+ "aria-describedby": y,
68
+ className: e("inline-flex size-4 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-muted-foreground", "not-disabled:not-aria-disabled:hover:text-foreground", a),
69
+ onPointerDown: V,
70
+ onMouseDown: V,
71
+ onPointerEnter: z,
72
+ onPointerLeave: B,
73
+ onFocus: H,
74
+ onBlur: U,
75
+ onClick: W,
76
+ children: /* @__PURE__ */ l(o, { size: 16 })
77
+ }),
78
+ /* @__PURE__ */ l("span", {
79
+ id: y,
80
+ hidden: !0,
81
+ children: m
82
+ }),
83
+ S && /* @__PURE__ */ l(i, {
84
+ layerId: F,
85
+ children: /* @__PURE__ */ l("div", {
86
+ ref: L,
87
+ "aria-hidden": "true",
88
+ "data-wave-infolabel-surface": "",
89
+ "data-state": "open",
90
+ ...P,
91
+ className: "w-max max-w-xs rounded-md border border-border bg-background px-3 py-2 text-caption-1 text-foreground shadow-16",
92
+ onPointerEnter: z,
93
+ onPointerLeave: B,
94
+ children: m
95
+ })
96
+ })
97
+ ]
98
+ });
99
+ };
100
+ p.displayName = "InfoLabel";
101
+ //#endregion
102
+ export { p as InfoLabel };
103
+
104
+ //# sourceMappingURL=InfoLabel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoLabel.mjs","names":["useId","useId$1","React","SHOW_DELAY","HIDE_DELAY","InfoLabel","props","descriptionId","openReason","setOpenReason","open","triggerRef","surfaceRef","pointerPressRef","pressTimerRef","showTimerRef","hideTimerRef","clearShowTimer","clearHideTimer","close","usePopupPosition","useDismiss","triggerRefs","useMergedRefs","setReference","surfaceRefs","setFloating","scheduleHide","reason","handlePointerEnter","event","handlePointerLeave","handlePointerDown","handleFocus","handleBlur","handleClick","cn","className","label","infoButtonLabel","focusRing","InfoIcon","info","Portal","floatingProps"],"sources":["../../../src/components/data-display/InfoLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { focusRing } from '../../lib/styles';\nimport { InfoIcon } from '../../lib/icons';\nimport { useId } from '../../hooks/useId';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport { Portal } from '../portal/Portal';\n\n/** Properties for the InfoLabel component. */\nexport interface InfoLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Primary label text to display. */\n label: string;\n /**\n * Additional information about the label. It describes the info button\n * (`aria-describedby`, available from the first render) and is shown in a popup on hover,\n * keyboard focus or click.\n */\n info: string;\n /**\n * Accessible name of the info button. Localise it here.\n * @default 'Information'\n */\n infoButtonLabel?: string;\n /** Ref to the root `<span>`. */\n ref?: React.Ref<HTMLSpanElement>;\n}\n\n/** Why the popup is open: a click pins it; hover and keyboard focus open it transiently. */\ntype OpenReason = 'hover' | 'focus' | 'click';\n\n/** Hover delay before the popup opens, and before it closes after the pointer leaves (ms). */\nconst SHOW_DELAY = 250;\nconst HIDE_DELAY = 250;\n\ntype Timer = ReturnType<typeof setTimeout>;\n\n/**\n * A label with an info button that reveals additional information (a \"toggletip\").\n *\n * - The info button is a `<button type=\"button\">` named `infoButtonLabel` (\"Information\"). The\n * info text is rendered inline in a `hidden` element and linked with `aria-describedby`, so it is\n * announced from the first render (also after server rendering), whether the popup is open or not.\n * - The visual popup is portaled only while open. It is `aria-hidden` because it duplicates the\n * description, and it holds no focusable content, so focus stays on the button.\n * - Opens on keyboard focus (not on focus that comes from a pointer press), on hover after a\n * short delay (the popup itself can be hovered) and on click. A click pins it: a click while it is\n * open because of hover or focus keeps it open, a click on a pinned popup closes it.\n * - Closes on Escape, on a press outside, when focus moves elsewhere and — unless pinned — when\n * the pointer leaves or the button loses focus (WCAG 1.4.13). A popup opened by hover that then\n * receives keyboard focus stays open while the button keeps focus, even after the pointer leaves.\n *\n * @example\n * <InfoLabel label=\"Password\" info=\"Use at least 8 characters.\" />\n */\nexport const InfoLabel = ({\n label,\n info,\n infoButtonLabel = 'Information',\n className,\n ref,\n ...props\n}: InfoLabelProps) => {\n const descriptionId = useId('info-label-description');\n const [openReason, setOpenReason] = React.useState<OpenReason | null>(null);\n const open = openReason !== null;\n\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const surfaceRef = React.useRef<HTMLDivElement | null>(null);\n /**\n * Set by a pointer press on the button, so the focus that follows does not open the popup. It\n * lasts only for the event turn of the press (see `handlePointerDown`).\n */\n const pointerPressRef = React.useRef(false);\n const pressTimerRef = React.useRef<Timer | null>(null);\n const showTimerRef = React.useRef<Timer | null>(null);\n const hideTimerRef = React.useRef<Timer | null>(null);\n\n const clearShowTimer = () => {\n if (showTimerRef.current !== null) clearTimeout(showTimerRef.current);\n showTimerRef.current = null;\n };\n const clearHideTimer = () => {\n if (hideTimerRef.current !== null) clearTimeout(hideTimerRef.current);\n hideTimerRef.current = null;\n };\n\n React.useEffect(\n () => () => {\n if (pressTimerRef.current !== null) clearTimeout(pressTimerRef.current);\n if (showTimerRef.current !== null) clearTimeout(showTimerRef.current);\n if (hideTimerRef.current !== null) clearTimeout(hideTimerRef.current);\n },\n [],\n );\n\n const close = () => {\n clearShowTimer();\n clearHideTimer();\n setOpenReason(null);\n };\n\n const { setReference, setFloating, floatingProps } = usePopupPosition({\n open,\n side: 'top',\n align: 'center',\n offset: 8,\n });\n const { layerId } = useDismiss({\n open,\n onDismiss: close,\n refs: [triggerRef, surfaceRef],\n anchorRef: triggerRef,\n focusOutside: true,\n });\n const triggerRefs = useMergedRefs<HTMLButtonElement>(triggerRef, setReference);\n const surfaceRefs = useMergedRefs<HTMLDivElement>(surfaceRef, setFloating);\n\n /** Pointer left the button or the popup: a hover-opened popup closes after a delay. */\n const scheduleHide = () => {\n clearShowTimer();\n clearHideTimer();\n hideTimerRef.current = setTimeout(() => {\n hideTimerRef.current = null;\n setOpenReason((reason) => (reason === 'hover' ? null : reason));\n }, HIDE_DELAY);\n };\n\n const handlePointerEnter = (event: React.PointerEvent) => {\n if (event.pointerType === 'touch') return;\n clearHideTimer();\n if (open || showTimerRef.current !== null) return;\n showTimerRef.current = setTimeout(() => {\n showTimerRef.current = null;\n setOpenReason((reason) => reason ?? 'hover');\n }, SHOW_DELAY);\n };\n\n const handlePointerLeave = (event: React.PointerEvent) => {\n if (event.pointerType === 'touch') return;\n scheduleHide();\n };\n\n const handlePointerDown = () => {\n pointerPressRef.current = true;\n // A press focuses the button (where it does) as the default action of `mousedown`, in the same\n // event turn. Forget the press after that turn: a press that does not focus the button (Safari\n // and Firefox on macOS, iOS) and ends without a click (dragged off, or a touch that becomes a\n // scroll) must not turn a later keyboard focus into pointer focus. A touch tap dispatches its\n // compatibility `mousedown` (and the focus) after the touch ends; that `mousedown` sets the\n // flag again.\n if (pressTimerRef.current !== null) clearTimeout(pressTimerRef.current);\n pressTimerRef.current = setTimeout(() => {\n pressTimerRef.current = null;\n pointerPressRef.current = false;\n }, 0);\n };\n\n const handleFocus = () => {\n // Keyboard focus opens; focus that comes from a pointer press waits for the click.\n if (pointerPressRef.current) return;\n // A popup opened by hover becomes focus-owned, so it stays while the button has focus even\n // after the pointer leaves (WCAG 1.4.13 persistent). A pinned popup stays pinned.\n setOpenReason((reason) => (reason === 'click' ? reason : 'focus'));\n };\n\n const handleBlur = () => {\n setOpenReason((reason) => (reason === 'focus' ? null : reason));\n };\n\n const handleClick = () => {\n clearShowTimer();\n clearHideTimer();\n // Closed → pinned; open because of hover or focus → pinned; pinned → closed.\n setOpenReason((reason) => (reason === 'click' ? null : 'click'));\n };\n\n return (\n <span\n ref={ref}\n className={cn('inline-flex items-center gap-1 text-body-1', className)}\n {...props}\n >\n {label}\n <button\n ref={triggerRefs}\n type=\"button\"\n aria-label={infoButtonLabel}\n aria-expanded={open}\n aria-describedby={descriptionId}\n className={cn(\n 'inline-flex size-4 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-muted-foreground',\n 'not-disabled:not-aria-disabled:hover:text-foreground',\n focusRing,\n )}\n onPointerDown={handlePointerDown}\n onMouseDown={handlePointerDown}\n onPointerEnter={handlePointerEnter}\n onPointerLeave={handlePointerLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onClick={handleClick}\n >\n <InfoIcon size={16} />\n </button>\n <span id={descriptionId} hidden>\n {info}\n </span>\n {open && (\n <Portal layerId={layerId}>\n <div\n ref={surfaceRefs}\n aria-hidden=\"true\"\n data-wave-infolabel-surface=\"\"\n data-state=\"open\"\n {...floatingProps}\n className=\"w-max max-w-xs rounded-md border border-border bg-background px-3 py-2 text-caption-1 text-foreground shadow-16\"\n onPointerEnter={handlePointerEnter}\n onPointerLeave={handlePointerLeave}\n >\n {info}\n </div>\n </Portal>\n )}\n </span>\n );\n};\n\nInfoLabel.displayName = 'InfoLabel';\n"],"mappings":";;;;;;;;;;;;AAiCA,IAAMG,IAAa,KACbC,IAAa,KAsBNC,KAAa,EACxB,UACA,SACA,qBAAkB,eAClB,cACA,QACA,GAAGC,QACiB;CACpB,IAAMC,IAAgBP,EAAM,wBAAwB,GAC9C,CAACQ,GAAYC,KAAiBP,EAAM,SAA4B,IAAI,GACpEQ,IAAOF,MAAe,MAEtBG,IAAaT,EAAM,OAAiC,IAAI,GACxDU,IAAaV,EAAM,OAA8B,IAAI,GAKrDW,IAAkBX,EAAM,OAAO,EAAK,GACpCY,IAAgBZ,EAAM,OAAqB,IAAI,GAC/Ca,IAAeb,EAAM,OAAqB,IAAI,GAC9Cc,IAAed,EAAM,OAAqB,IAAI,GAE9Ce,UAAuB;EAE3B,AADIF,EAAa,YAAY,QAAM,aAAaA,EAAa,OAAO,GACpE,EAAa,UAAU;CACzB,GACMG,UAAuB;EAE3B,AADIF,EAAa,YAAY,QAAM,aAAaA,EAAa,OAAO,GACpE,EAAa,UAAU;CACzB;CAEA,EAAM,sBACQ;EAGV,AAFIF,EAAc,YAAY,QAAM,aAAaA,EAAc,OAAO,GAClEC,EAAa,YAAY,QAAM,aAAaA,EAAa,OAAO,GAChEC,EAAa,YAAY,QAAM,aAAaA,EAAa,OAAO;CACtE,GACA,CAAC,CACH;CAEA,IAAMG,UAAc;EAGlB,AAFAF,EAAe,GACfC,EAAe,GACfT,EAAc,IAAI;CACpB,GAEM,EAAE,iBAAc,gBAAa,qBAAkBW,EAAiB;EACpE;EACA,MAAM;EACN,OAAO;EACP,QAAQ;CACV,CAAC,GACK,EAAE,eAAYC,EAAW;EAC7B;EACA,WAAWF;EACX,MAAM,CAACR,GAAYC,CAAU;EAC7B,WAAWD;EACX,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ChB,gBAAgBE;IAChB,SAASE;IACT,QAAQC;IACR,SAASC;IAET,UAAA,kBAACM,GAAD,EAAU,MAAM,GAAK,CAAA;GACf,CAAA;GACR,kBAAC,QAAD;IAAM,IAAIlC;IAAe,QAAA;IACtB,UAAAmC;GACG,CAAA;GACLhC,KACC,kBAACiC,GAAD;IAAiB;IACf,UAAA,kBAAC,OAAD;KACE,KAAKlB;KACL,eAAY;KACZ,+BAA4B;KAC5B,cAAW;KACX,GAAImB;KACJ,WAAU;KACV,gBAAgBf;KAChB,gBAAgBE;KAEf,UAAAW;IACE,CAAA;GACC,CAAA;EAEN;;AAEV;AAEA,EAAU,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../lib/slot.cjs"),a=require("../../lib/composeEventHandlers.cjs"),o=require("../../hooks/useEventCallback.cjs"),s=require("../../hooks/useControllable.cjs"),c=require("../../hooks/useId.cjs"),l=require("../../lib/direction.cjs"),u=require("../../lib/focus.cjs"),d=require("../../hooks/useRovingTabIndex.cjs"),f=require("../../hooks/useMergedRefs.cjs"),p=require("../../lib/styles.cjs"),m=require("./List.registry.cjs");let h=require("react");h=e.__toESM(h,1);let g=require("react/jsx-runtime");var _=h.createContext(null);_.displayName=`ListContext`;var v=null;function y(){return v??={mode:`list`,selectedValues:new Set,toggleItem:()=>{},getTabIndex:()=>-1,registry:new m.ListRegistry},v}function b(e){return h.useContext(_)||(r.reportMissingContext(e,`a List`),y())}var x=[];function S(e){r.warnOnce(`List:duplicate:${e}`,`List: several items share the value "${e}". Item values must be unique within a List; items with the same value are selected (and tab stops) together.`)}function C(e){return n.flattenChildren(e).some(({node:e})=>n.isElementOfType(e,I)&&i.slotRendersContent(e.props.action))}var w=[u.FOCUSABLE_SELECTOR,`[data-list-action]`,`label`,`[role="button"]`,`[role="link"]`,`[role="checkbox"]`,`[role="switch"]`,`[role="radio"]`,`[role="menuitem"]`,`[role="textbox"]`,`[role="combobox"]`,`[role="slider"]`,`[role="spinbutton"]`].join(`, `);function T(e){let t=e.currentTarget,n=e.target;if(!n||typeof n.nodeType!=`number`||!t.contains(n))return!0;let r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement??null;for(;r&&r!==t;r=r.parentElement)if(r.matches(w))return!0;return!1}function E(e){return e.ctrlKey||e.altKey||e.metaKey?!1:e.key===`Enter`||e.key===` `}var D=new Set([`textbox`,`searchbox`,`combobox`,`spinbutton`,`slider`]),O=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`reset`,`submit`]);function k(e){let t=e.getAttribute(`role`);if(t!==null&&D.has(t))return!0;let n=e.localName;return n===`textarea`||n===`select`?!0:n===`input`?!O.has(e.type):e.matches(`[contenteditable]:not([contenteditable="false"])`)}function A(e){return Array.from(e.querySelectorAll(u.FOCUSABLE_SELECTOR)).filter(e=>u.isFocusable(e))}function j(e){if(!e.parentElement)return-1;let t=0;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)t++;return t}function M(e,t){let n=null,r=null,i=null,a=0;for(let o=e.firstElementChild;o;o=o.nextElementSibling,a++){if(t.value!==void 0&&o.getAttribute(`data-roving-value`)===t.value){n=o;break}a===t.index&&(r=o),i=o}let o=n??r??(t.index>=0?i:null);return o?o.hasAttribute(`tabindex`)?o:A(o)[0]??null:null}function N(e){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(t.hasAttribute(`data-list-action`))return t;return null}function P(e){let t=[];for(let n of A(e)){let r=k(n)?e:n;t.includes(r)||t.push(r)}return t}var F=e=>{let{selectable:n=!1,selectionMode:i,selectedItems:o,defaultSelectedItems:c,onSelectionChange:l,selectedItem:u,defaultSelectedItem:p,onSelectedItemChange:v,className:y,children:b,ref:w,onKeyDown:T,onKeyDownCapture:E,onFocus:D,...O}=e;i===`multi`&&r.warnDeprecated(`List`,`selectionMode="multi"`,`selectionMode="multiple"`);let k=i===`multiple`||i===`multi`,A=h.useMemo(()=>!k&&u!==void 0?u===null?x:[u]:o,[k,u,o]),j=h.useMemo(()=>!k&&p!=null?[p]:c??x,[k,p,c]),[N,P]=s.useControllable(A,j,e=>{let t=[...e];l?.(t),k||v?.(t[0]??null)}),[F]=h.useState(()=>new m.ListRegistry);h.useLayoutEffect(()=>{F.setActive(n)},[F,n]);let I=h.useSyncExternalStore(F.subscribe,F.getSnapshot,F.getServerSnapshot),L=h.useMemo(()=>I?N.filter(e=>I.valueSet.has(e)):N,[I,N]),R=h.useMemo(()=>new Set(L),[L]),z=n&&(I?I.hasActions:C(b)),B=n?z?`grid`:`listbox`:`list`,V=I?I.values.find(e=>R.has(e))??null:L[0]??null,{containerProps:H,getTabIndex:U}=d.useRovingTabIndex({activeValue:V,orientation:`vertical`,typeahead:(I?.count??0)>7,tabStop:`active`,itemSelector:`:scope > [data-roving-value]`}),{ref:W,onKeyDown:G,onKeyDownCapture:K,onFocus:q}=H,J=h.useRef(null),Y=f.useMergedRefs(w,n?W:null,J);h.useLayoutEffect(()=>{let e=F.takeFocusLoss(),t=J.current;if(!e||!t)return;let n=t.ownerDocument,r=n.activeElement;r&&r!==n.body&&r.isConnected||M(t,e)?.focus()},[B,F]),h.useLayoutEffect(()=>{F.syncOrder(J.current)});let X=h.useCallback(e=>{P(t=>{let n=F.prune(t),r=n.includes(e);return k?r?n.filter(t=>t!==e):[...n,e]:r?[]:[e]})},[k,F,P]),Z=I?.duplicates??x;h.useEffect(()=>{for(let e of Z)S(e)},[Z]);let Q=L.length;h.useEffect(()=>{n&&!k&&Q>1&&r.warnOnce(`List:single-several-selected`,`List: a single-selection list (selectionMode "single") received ${Q} selected items. Pass one value with \`selectedItem\`, or use selectionMode="multiple".`)},[n,k,Q]);let $=h.useMemo(()=>({mode:B,selectedValues:R,toggleItem:X,getTabIndex:U,registry:F}),[B,R,X,U,F]),ee=B===`grid`?`div`:`ul`,te=B===`grid`?`grid`:B===`listbox`?`listbox`:`list`;return(0,g.jsx)(_.Provider,{value:$,children:(0,g.jsx)(ee,{role:te,"aria-multiselectable":n&&k?!0:void 0,className:t.cn(`m-0 list-none p-0`,y),...O,ref:Y,"data-roving-container":n?``:void 0,onKeyDown:n?a.composeEventHandlers(T,G):T,onKeyDownCapture:n?a.composeEventHandlers(E,K):E,onFocus:n?a.composeEventHandlers(D,q,{checkDefaultPrevented:!1}):D,children:b})})};F.displayName=`List`;var I=({value:e,action:n,className:r,children:s,onClick:u,onKeyDown:d,ref:m,..._})=>{let{mode:v,selectedValues:y,toggleItem:x,getTabIndex:S,registry:C}=b(`ListItem`),w=c.useId(`list-item`),D=e||void 0,O=D??w,M=i.slotRendersContent(n),[F]=h.useState(()=>({})),I=h.useRef(null),L=f.useMergedRefs(m,I);h.useLayoutEffect(()=>{C.set(F,{value:D,hasAction:M,element:I})},[C,F,D,M]),h.useLayoutEffect(()=>()=>C.delete(F),[C,F]);let R=o.useEventCallback(e=>{let t=e.parentElement;C.recordFocusLoss({value:D,index:t?j(t):-1})});h.useLayoutEffect(()=>{let e=I.current;return()=>{if(!e)return;let t=e.ownerDocument.activeElement;t&&e.contains(t)&&C.recordFocusLoss({value:D,index:j(e)})}},[C,D]);let z=D!==void 0&&y.has(D),V=v!==`list`,H=()=>{D!==void 0&&x(D)},U=e=>{T(e)||H()},W=e=>{T(e)||E(e)&&(e.preventDefault(),H())},G=e=>{let t=e.currentTarget,n=e.target,r=N(t);if(!r||!r.contains(n)){if(n!==t)return;if(E(e)){e.preventDefault(),H();return}let i=l.getArrowIntent(e.key,{orientation:`horizontal`,dir:l.getDirection(t)})===`next`&&r?P(r)[0]:void 0;i&&(e.preventDefault(),i.focus());return}if(n!==r&&k(n)){e.key===`Escape`&&(e.preventDefault(),r.focus());return}if(n===r&&(e.key===`Enter`||e.key===`F2`)){let t=A(r).find(e=>k(e));t&&(e.preventDefault(),t.focus());return}let i=l.getArrowIntent(e.key,{orientation:`horizontal`,dir:l.getDirection(t)});if(!i)return;e.preventDefault();let a=P(r),o=a.indexOf(n);i===`next`?a[o+1]?.focus():o>0?a[o-1].focus():t.focus()},K=v===`grid`?`div`:`li`,q=v===`grid`?`div`:`span`,J=v===`grid`?`row`:v===`listbox`?`option`:`listitem`,Y=V?{"aria-selected":z,tabIndex:S(O),"data-roving-value":O,"data-selected":z?``:void 0,onClick:a.composeEventHandlers(u,U),onKeyDown:a.composeEventHandlers(d,v===`grid`?G:W)}:{onClick:u,onKeyDown:d};return(0,g.jsxs)(K,{role:J,className:t.cn(`flex items-center border-b border-border px-4 py-2 text-body-1`,V&&[`relative cursor-pointer`,`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`],V&&(z?[`bg-subtle-selected before:absolute before:inset-y-2 before:start-0 before:w-0.5 before:rounded-full before:bg-primary`,p.forcedColors.selectedContainer]:`hover:bg-subtle-hover`),r),..._,ref:L,...Y,children:[(0,g.jsx)(q,{role:v===`grid`?`gridcell`:void 0,className:`min-w-0 flex-1`,children:s}),M&&(0,g.jsx)(B,{grid:v===`grid`,onRemovedWithFocus:R,children:i.materialiseSlotContent(n)})]})};I.displayName=`ListItem`;var L=[`[data-roving-container]`,...[`toolbar`,`radiogroup`,`listbox`,`grid`,`treegrid`,`tablist`,`menu`,`menubar`,`tree`].map(e=>`[role="${e}"]`)].join(`, `),R=[`tabindex`,`href`,`contenteditable`,`controls`];function z(e){let t=new Map,n=new WeakSet,r=()=>{for(let n of t.keys())e.contains(n)||t.delete(n);for(let r of e.querySelectorAll(u.FOCUSABLE_SELECTOR)){let i=r.getAttribute(`tabindex`);if(i===`-1`||n.has(r))continue;let a=r.closest(L);a&&e.contains(a)||(t.set(r,i),r.setAttribute(`tabindex`,`-1`))}};if(r(),typeof MutationObserver>`u`)return()=>{};let i=new MutationObserver(e=>{let a=new Set;for(let n of e){let e=n.target;n.attributeName===`tabindex`&&t.has(e)&&a.add(e)}for(let e of a){let r=e.getAttribute(`tabindex`);r!==`-1`&&r===t.get(e)?(t.delete(e),n.add(e)):t.set(e,r)}r(),i.takeRecords()});return i.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:R}),()=>{i.disconnect();for(let[e,n]of t)n===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,n);t.clear()}}function B({grid:e,onRemovedWithFocus:n,children:r}){let i=h.useRef(null);return h.useLayoutEffect(()=>{let e=i.current;return()=>{if(!e)return;let t=e.ownerDocument.activeElement;t&&e.contains(t)&&n(e)}},[n,e]),h.useLayoutEffect(()=>{let t=i.current;return e&&t?z(t):void 0},[e]),(0,g.jsx)(e?`div`:`span`,{ref:i,role:e?`gridcell`:void 0,tabIndex:e?-1:void 0,"data-list-action":``,className:t.cn(`ms-2 shrink-0`,e&&`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`),children:r})}B.displayName=`ListActionCell`;var V=Object.assign(F,{Item:I});exports.List=V,exports.ListItem=I;
2
+ //# sourceMappingURL=List.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.cjs","names":["React","ListRegistry","flattenChildren","isElementOfType","slotRendersContent","FOCUSABLE_SELECTOR","isFocusable","useControllable","useRovingTabIndex","useMergedRefs","cn","composeEventHandlers","useId","useEventCallback","getArrowIntent","getDirection","forcedColors","materialiseSlotContent","require_runtime","require_cn","require_children","require_dev","require_slot","require_composeEventHandlers","require_useEventCallback","require_useControllable","require_useId","require_direction","require_focus","require_useRovingTabIndex","require_useMergedRefs","require_styles","require_List_registry","react","react_jsx_runtime","ListContext","inertContext","getInertContext","useListContext","componentName","EMPTY","warnDuplicateValue","value","childrenHaveAction","children","node","ListItem","INTERACTIVE_SELECTOR","isForeignEvent","item","event","target","isActivationKey","TEXT_ENTRY_ROLES","NON_TEXT_INPUT_TYPES","isTextEntry","role","el","tag","getFocusables","cell","getItemIndex","index","getFocusRestoreTarget","byValue","atIndex","last","root","loss","getActionCell","child","getActionStops","stops","stop","ListRoot","rest","props","selectionMode","multiple","controlledSelection","selectedItem","selectedItems","defaultSelection","defaultSelectedItem","defaultSelectedItems","selected","setSelected","selection","next","onSelectionChange","onSelectedItemChange","registry","selectable","registered","effective","selectedValues","hasActions","mode","tabStopValue","rovingRef","rovingKeyDown","rovingKeyDownCapture","rovingFocus","containerProps","rootElementRef","rootRef","ref","doc","active","toggleItem","current","previous","isSelected","duplicates","selectedCount","contextValue","getTabIndex","Root","className","onKeyDown","onKeyDownCapture","onFocus","autoValue","selectableValue","rovingValue","hasAction","action","token","itemRef","itemRefs","recordActionFocusLoss","activate","handleClick","handleOptionKeyDown","handleRowKeyDown","rowElement","first","entry","intent","Element","ContentCell","interactiveProps","onClick","ListActionCell","COMPOSITE_SELECTOR","STAMP_OBSERVED_ATTRIBUTES","stampActionCell","stamped","yielded","stamp","tabIndex","composite","observer","changed","record","records","original","cellRef","onRemovedWithFocus","grid","List"],"sources":["../../../src/components/data-display/List.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { reportMissingContext, warnDeprecated, warnOnce } from '../../lib/dev';\nimport { getArrowIntent, getDirection } from '../../lib/direction';\nimport { FOCUSABLE_SELECTOR, isFocusable } from '../../lib/focus';\nimport { materialiseSlotContent, slotRendersContent } from '../../lib/slot';\nimport { focusRingInset, forcedColors } from '../../lib/styles';\nimport type { SelectionMode } from '../../lib/types';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport { ListRegistry, type ListFocusLoss } from './List.registry';\n\n/** Selection modes of {@link List}: the shared `SelectionMode` plus the deprecated `'multi'`. */\nexport type ListSelectionMode = SelectionMode | 'multi';\n\n/**\n * Properties for the List component.\n *\n * The type parameter `M` is the `selectionMode` literal. It makes the single-selection props\n * (`selectedItem`, `defaultSelectedItem`, `onSelectedItemChange`) type errors when\n * `selectionMode=\"multiple\"` is passed; `ListProps` without a type argument accepts every mode\n * (the 0.4 shape, extendable by interfaces).\n */\nexport interface ListProps<\n M extends ListSelectionMode = ListSelectionMode,\n> extends React.HTMLAttributes<HTMLUListElement> {\n /** Whether list items can be selected.\n * @default false\n */\n selectable?: boolean;\n /**\n * Selection behavior when `selectable` is true. `'multi'` is a deprecated alias of `'multiple'`.\n * @default 'single'\n */\n selectionMode?: M;\n /**\n * Controlled array of selected item values (both modes). In single mode prefer `selectedItem`;\n * a single-selection list that receives several values warns in development.\n */\n selectedItems?: readonly string[];\n /** Default selected items for uncontrolled usage.\n * @default []\n */\n defaultSelectedItems?: readonly string[];\n /** Called with the next array of selected values when the selection changes (both modes). */\n onSelectionChange?: (selected: string[]) => void;\n /** Single mode: the controlled selected value (`null`: nothing selected). */\n selectedItem?: M extends 'single' ? string | null : never;\n /** Single mode: the initially selected value for uncontrolled usage. */\n defaultSelectedItem?: M extends 'single' ? string | null : never;\n /** Single mode: called with the newly selected value, or `null` when it was deselected. */\n onSelectedItemChange?: M extends 'single' ? (item: string | null) => void : never;\n /**\n * Ref to the root element: a `<ul>`, or a `<div role=\"grid\">` for a selectable list whose items\n * have actions.\n */\n ref?: React.Ref<HTMLUListElement | HTMLDivElement>;\n}\n\n/** Properties for the ListItem component. */\nexport interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {\n /**\n * Unique value identifying this item for selection tracking. An item without a value cannot be\n * selected (its `onClick` still runs). Items of a selectable list that share a value are\n * selected together (a development warning names the value).\n */\n value?: string;\n /**\n * Action element rendered at the end of the list item (e.g. a Delete button). Clicks and keys\n * that start inside it, or inside a popup it opens, never toggle the item's selection. An\n * action that renders nothing (`[]`, `null`, `false`, `''`, `<></>`) is no action. In a\n * selectable list, items with actions switch the list to grid semantics: the actions are reached\n * with the arrow keys, and their focusable elements (also ones added later) get\n * `tabindex=\"-1\"`, except inside a nested composite widget such as a Toolbar, which keeps its own\n * Tab stop. When the first action appears or the last one disappears, the items remount (see\n * {@link List}).\n */\n action?: React.ReactNode;\n /** Ref to the item element: an `<li>`, or a `<div role=\"row\">` in grid mode. */\n ref?: React.Ref<HTMLLIElement | HTMLDivElement>;\n}\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\n/** `list`: plain list; `listbox`: selectable; `grid`: selectable with item actions. */\ntype ListMode = 'list' | 'listbox' | 'grid';\n\ninterface ListContextValue {\n mode: ListMode;\n selectedValues: ReadonlySet<string>;\n toggleItem: (value: string) => void;\n getTabIndex: (value: string) => 0 | -1;\n registry: ListRegistry;\n}\n\nconst ListContext = React.createContext<ListContextValue | null>(null);\nListContext.displayName = 'ListContext';\n\nlet inertContext: ListContextValue | null = null;\n\nfunction getInertContext(): ListContextValue {\n inertContext ??= {\n mode: 'list',\n selectedValues: new Set<string>(),\n toggleItem: () => {},\n getTabIndex: () => -1,\n registry: new ListRegistry(),\n };\n return inertContext;\n}\n\nfunction useListContext(componentName: string): ListContextValue {\n const context = React.useContext(ListContext);\n if (context) return context;\n reportMissingContext(componentName, 'a List');\n return getInertContext();\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nconst EMPTY: readonly string[] = [];\n\n/** Items that share a value are selected together and share their roving value. */\nfunction warnDuplicateValue(value: string): void {\n warnOnce(\n `List:duplicate:${value}`,\n `List: several items share the value \"${value}\". Item values must be unique within a ` +\n 'List; items with the same value are selected (and tab stops) together.',\n );\n}\n\n/**\n * Static look-ahead for the server and the first render: a direct `List.Item` (Fragments\n * flattened, also an item written in a Server Component) whose action renders content.\n */\nfunction childrenHaveAction(children: React.ReactNode): boolean {\n return flattenChildren(children).some(\n ({ node }) =>\n isElementOfType<ListItemProps>(node, ListItem) && slotRendersContent(node.props.action),\n );\n}\n\n/** Elements whose events belong to themselves, not to the item that contains them. */\nconst INTERACTIVE_SELECTOR = [\n FOCUSABLE_SELECTOR,\n '[data-list-action]',\n 'label',\n '[role=\"button\"]',\n '[role=\"link\"]',\n '[role=\"checkbox\"]',\n '[role=\"switch\"]',\n '[role=\"radio\"]',\n '[role=\"menuitem\"]',\n '[role=\"textbox\"]',\n '[role=\"combobox\"]',\n '[role=\"slider\"]',\n '[role=\"spinbutton\"]',\n].join(', ');\n\n/**\n * Whether an item must leave `event` alone (no selection toggle): it started inside the action\n * container or a nested interactive element, or outside the item's DOM. React bubbles the events\n * of a popup portaled from an action (a Popover, Menu or Dialog) through the item's handlers\n * although their target lives elsewhere in the document; those never toggle the item (as in\n * Card).\n */\nfunction isForeignEvent(event: React.SyntheticEvent<HTMLElement>): boolean {\n const item = event.currentTarget;\n const target = event.target as Partial<Node> | null;\n if (!target || typeof target.nodeType !== 'number' || !item.contains(target as Node)) {\n return true;\n }\n let node: Element | null =\n target.nodeType === Node.ELEMENT_NODE ? (target as Element) : (target.parentElement ?? null);\n for (; node && node !== item; node = node.parentElement) {\n if (node.matches(INTERACTIVE_SELECTOR)) return true;\n }\n return false;\n}\n\n/**\n * Enter or Space without Ctrl, Alt or Meta: the keys that toggle an item. With a modifier (Ctrl+Alt\n * with Space included) the key is a shortcut, left to the page.\n */\nfunction isActivationKey(event: React.KeyboardEvent): boolean {\n if (event.ctrlKey || event.altKey || event.metaKey) return false;\n return event.key === 'Enter' || event.key === ' ';\n}\n\nconst TEXT_ENTRY_ROLES: ReadonlySet<string> = new Set([\n 'textbox',\n 'searchbox',\n 'combobox',\n 'spinbutton',\n 'slider',\n]);\n\nconst NON_TEXT_INPUT_TYPES: ReadonlySet<string> = new Set([\n 'button',\n 'checkbox',\n 'color',\n 'file',\n 'hidden',\n 'image',\n 'radio',\n 'reset',\n 'submit',\n]);\n\n/** Text-entry widgets keep the arrow keys (caret movement) and are entered with Enter/F2. */\nfunction isTextEntry(el: Element): boolean {\n const role = el.getAttribute('role');\n if (role !== null && TEXT_ENTRY_ROLES.has(role)) return true;\n const tag = el.localName;\n if (tag === 'textarea' || tag === 'select') return true;\n if (tag === 'input') return !NON_TEXT_INPUT_TYPES.has((el as HTMLInputElement).type);\n return el.matches('[contenteditable]:not([contenteditable=\"false\"])');\n}\n\nfunction getFocusables(cell: HTMLElement): HTMLElement[] {\n return Array.from(cell.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter((el) =>\n isFocusable(el),\n );\n}\n\n/*\n * The helpers below walk element children with `firstElementChild`/`nextElementSibling`, never\n * through a `children` collection: jsdom before 30.1 does not cache indexed `HTMLCollection`\n * access, so `Array.from(root.children)` or an indexed loop over a large list is O(n²) in the test\n * suites of consumers on those versions (table-core#22).\n */\n\n/** Position of an item element among its list's items (the root's element children). */\nfunction getItemIndex(item: HTMLElement): number {\n if (!item.parentElement) return -1;\n let index = 0;\n for (let el = item.previousElementSibling; el; el = el.previousElementSibling) index++;\n return index;\n}\n\n/**\n * Where focus goes after the items remounted: the item with the same explicit value, else the item\n * now at the same position (the next one when the focused item itself was removed), else the last.\n * An item that cannot take focus itself (a plain list item) passes it to its first focusable\n * descendant.\n */\nfunction getFocusRestoreTarget(root: HTMLElement, loss: ListFocusLoss): HTMLElement | null {\n let byValue: Element | null = null;\n let atIndex: Element | null = null;\n let last: Element | null = null;\n let index = 0;\n for (let el = root.firstElementChild; el; el = el.nextElementSibling, index++) {\n if (loss.value !== undefined && el.getAttribute('data-roving-value') === loss.value) {\n byValue = el;\n break;\n }\n if (index === loss.index) atIndex = el;\n last = el;\n }\n const item = (byValue ?? atIndex ?? (loss.index >= 0 ? last : null)) as HTMLElement | null;\n if (!item) return null;\n return item.hasAttribute('tabindex') ? item : (getFocusables(item)[0] ?? null);\n}\n\n/** The action cell of an item element (its direct `[data-list-action]` child), read at event time. */\nfunction getActionCell(item: HTMLElement): HTMLElement | null {\n for (let child = item.firstElementChild; child; child = child.nextElementSibling) {\n if (child.hasAttribute('data-list-action')) return child as HTMLElement;\n }\n return null;\n}\n\n/**\n * The arrow-key stops inside an action cell, in DOM order. A text-entry widget is represented by\n * the cell itself (the cell takes focus; Enter/F2 enter the widget, Escape returns to the cell).\n */\nfunction getActionStops(cell: HTMLElement): HTMLElement[] {\n const stops: HTMLElement[] = [];\n for (const el of getFocusables(cell)) {\n const stop = isTextEntry(el) ? cell : el;\n if (!stops.includes(stop)) stops.push(stop);\n }\n return stops;\n}\n\n/* ------------------------------------------------------------------ */\n/* List */\n/* ------------------------------------------------------------------ */\n\n// The List root, documented on the exported `List` const.\nconst ListRoot = <M extends ListSelectionMode = 'single'>(props: ListProps<M>): React.ReactNode => {\n const {\n selectable = false,\n selectionMode,\n selectedItems,\n defaultSelectedItems,\n onSelectionChange,\n selectedItem,\n defaultSelectedItem,\n onSelectedItemChange,\n className,\n children,\n ref,\n onKeyDown,\n onKeyDownCapture,\n onFocus,\n ...rest\n } = props as ListProps;\n\n if (selectionMode === 'multi') {\n warnDeprecated('List', 'selectionMode=\"multi\"', 'selectionMode=\"multiple\"');\n }\n const multiple = selectionMode === 'multiple' || selectionMode === 'multi';\n\n const controlledSelection = React.useMemo<readonly string[] | undefined>(() => {\n if (!multiple && selectedItem !== undefined) {\n return selectedItem === null ? EMPTY : [selectedItem];\n }\n return selectedItems;\n }, [multiple, selectedItem, selectedItems]);\n const defaultSelection = React.useMemo<readonly string[]>(() => {\n if (!multiple && defaultSelectedItem !== undefined && defaultSelectedItem !== null) {\n return [defaultSelectedItem];\n }\n return defaultSelectedItems ?? EMPTY;\n }, [multiple, defaultSelectedItem, defaultSelectedItems]);\n\n const [selected, setSelected] = useControllable<readonly string[]>(\n controlledSelection,\n defaultSelection,\n (next) => {\n // The callbacks receive their own mutable copy (the props accept readonly arrays).\n const selection = [...next];\n onSelectionChange?.(selection);\n if (!multiple) onSelectedItemChange?.(selection[0] ?? null);\n },\n );\n\n const [registry] = React.useState(() => new ListRegistry());\n React.useLayoutEffect(() => {\n registry.setActive(selectable);\n }, [registry, selectable]);\n const registered = React.useSyncExternalStore(\n registry.subscribe,\n registry.getSnapshot,\n registry.getServerSnapshot,\n );\n\n // Effective selection: selected ∩ registered item values, derived during render (table-core#22).\n const effective = React.useMemo(\n () => (registered ? selected.filter((value) => registered.valueSet.has(value)) : selected),\n [registered, selected],\n );\n const selectedValues = React.useMemo<ReadonlySet<string>>(() => new Set(effective), [effective]);\n\n const hasActions =\n selectable && (registered ? registered.hasActions : childrenHaveAction(children));\n const mode: ListMode = !selectable ? 'list' : hasActions ? 'grid' : 'listbox';\n\n // The first selected item in DOM order (the registry keeps its values in DOM order).\n const tabStopValue = registered\n ? (registered.values.find((value) => selectedValues.has(value)) ?? null)\n : (effective[0] ?? null);\n\n const { containerProps, getTabIndex } = useRovingTabIndex({\n activeValue: tabStopValue,\n orientation: 'vertical',\n typeahead: (registered?.count ?? 0) > 7,\n tabStop: 'active',\n // The items are the root's children. A composite in an item action (a Toolbar, a radio group)\n // is part of its row, not an item: arrows and typeahead never move into it.\n itemSelector: ':scope > [data-roving-value]',\n });\n const {\n ref: rovingRef,\n onKeyDown: rovingKeyDown,\n onKeyDownCapture: rovingKeyDownCapture,\n onFocus: rovingFocus,\n } = containerProps;\n const rootElementRef = React.useRef<HTMLUListElement | HTMLDivElement | null>(null);\n const rootRef = useMergedRefs<HTMLUListElement | HTMLDivElement>(\n ref,\n selectable ? rovingRef : null,\n rootElementRef,\n );\n\n // Switching between list and grid semantics changes the root and item elements (`ul`/`li` ↔\n // `div`), so React remounts the items and the focused one is removed. Items record, while they\n // are still in the document, that they held focus (see ListItem); after the new items mounted,\n // focus moves to the same item (C-DISABLED: focus is never dropped to <body>).\n React.useLayoutEffect(() => {\n const loss = registry.takeFocusLoss();\n const root = rootElementRef.current;\n if (!loss || !root) return;\n const doc = root.ownerDocument;\n const active = doc.activeElement;\n // Focus placed elsewhere in this commit (an autoFocus, a restore-focus hook) wins.\n if (active && active !== doc.body && active.isConnected) return;\n getFocusRestoreTarget(root, loss)?.focus();\n }, [mode, registry]);\n\n // After every commit (the items' layout effects ran first): keep the registered values in DOM\n // order, so `tabStopValue` is the first selected item in the DOM even after items were inserted\n // between others or reordered by key (table-core#22). O(n); re-renders only when the order changed.\n React.useLayoutEffect(() => {\n registry.syncOrder(rootElementRef.current);\n });\n\n const toggleItem = React.useCallback(\n (value: string) => {\n setSelected((previous) => {\n // From the effective selection, so values of removed items are never reported again.\n const current = registry.prune(previous);\n const isSelected = current.includes(value);\n if (multiple) {\n return isSelected ? current.filter((item) => item !== value) : [...current, value];\n }\n return isSelected ? [] : [value];\n });\n },\n [multiple, registry, setSelected],\n );\n\n // Registered values of a selectable list that more than one item holds (development warning).\n const duplicates = registered?.duplicates ?? EMPTY;\n React.useEffect(() => {\n for (const value of duplicates) warnDuplicateValue(value);\n }, [duplicates]);\n\n const selectedCount = effective.length;\n React.useEffect(() => {\n if (selectable && !multiple && selectedCount > 1) {\n warnOnce(\n 'List:single-several-selected',\n `List: a single-selection list (selectionMode \"single\") received ${selectedCount} selected items. Pass one value with \\`selectedItem\\`, or use selectionMode=\"multiple\".`,\n );\n }\n }, [selectable, multiple, selectedCount]);\n\n const contextValue = React.useMemo<ListContextValue>(\n () => ({ mode, selectedValues, toggleItem, getTabIndex, registry }),\n [mode, selectedValues, toggleItem, getTabIndex, registry],\n );\n\n const Root = (mode === 'grid' ? 'div' : 'ul') as React.ElementType;\n const role = mode === 'grid' ? 'grid' : mode === 'listbox' ? 'listbox' : 'list';\n\n return (\n <ListContext.Provider value={contextValue}>\n <Root\n role={role}\n aria-multiselectable={selectable && multiple ? true : undefined}\n className={cn('m-0 list-none p-0', className)}\n {...rest}\n ref={rootRef}\n data-roving-container={selectable ? '' : undefined}\n onKeyDown={selectable ? composeEventHandlers(onKeyDown, rovingKeyDown) : onKeyDown}\n onKeyDownCapture={\n selectable\n ? composeEventHandlers(onKeyDownCapture, rovingKeyDownCapture)\n : onKeyDownCapture\n }\n onFocus={\n selectable\n ? composeEventHandlers(onFocus, rovingFocus, { checkDefaultPrevented: false })\n : onFocus\n }\n >\n {children}\n </Root>\n </ListContext.Provider>\n );\n};\nListRoot.displayName = 'List';\n\n/* ------------------------------------------------------------------ */\n/* ListItem */\n/* ------------------------------------------------------------------ */\n\n/**\n * An item of a {@link List} (also available as `List.Item`). Renders an `<li>` (`listitem`, or\n * `option` in a selectable list), or a `<div role=\"row\">` in a selectable list with actions. In a\n * selectable list, Enter and Space toggle the selection without calling `onClick`, which receives\n * pointer clicks.\n *\n * Exported under the flat name `ListItem` so React Server Components can import it; `List.Item`\n * (dotted access) needs a client module.\n */\nexport const ListItem = ({\n value,\n action,\n className,\n children,\n onClick,\n onKeyDown,\n ref,\n ...rest\n}: ListItemProps) => {\n const { mode, selectedValues, toggleItem, getTabIndex, registry } = useListContext('ListItem');\n const autoValue = useId('list-item');\n const selectableValue = value ? value : undefined;\n const rovingValue = selectableValue ?? autoValue;\n // An action that renders nothing (`[]`, `null`, booleans, `''`) is no action.\n const hasAction = slotRendersContent(action);\n const [token] = React.useState(() => ({}));\n const itemRef = React.useRef<HTMLLIElement | HTMLDivElement | null>(null);\n const itemRefs = useMergedRefs<HTMLLIElement | HTMLDivElement>(ref, itemRef);\n\n // The record is updated in place when the value or the action changes and removed only on\n // unmount, so the item keeps its place in the registry (table-core#22).\n React.useLayoutEffect(() => {\n registry.set(token, { value: selectableValue, hasAction, element: itemRef });\n }, [registry, token, selectableValue, hasAction]);\n React.useLayoutEffect(() => () => registry.delete(token), [registry, token]);\n\n // Focus inside the action when it disappears: if that switches the list from grid to listbox, the\n // List moves focus to this item in the next commit (see ListActionCell and ListRoot).\n const recordActionFocusLoss = useEventCallback((cell: HTMLElement) => {\n const item = cell.parentElement;\n registry.recordFocusLoss({ value: selectableValue, index: item ? getItemIndex(item) : -1 });\n });\n\n // Unmount: a layout-effect cleanup runs while the element is still in the document, so it can\n // tell whether it held focus. The List moves focus to the same item when its items remount\n // (list ↔ grid semantics); see ListRoot.\n React.useLayoutEffect(() => {\n const node = itemRef.current;\n return () => {\n if (!node) return;\n const active = node.ownerDocument.activeElement;\n if (active && node.contains(active)) {\n registry.recordFocusLoss({ value: selectableValue, index: getItemIndex(node) });\n }\n };\n }, [registry, selectableValue]);\n\n const isSelected = selectableValue !== undefined && selectedValues.has(selectableValue);\n const selectable = mode !== 'list';\n\n const activate = () => {\n if (selectableValue !== undefined) toggleItem(selectableValue);\n };\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (isForeignEvent(event)) return;\n activate();\n };\n\n const handleOptionKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (isForeignEvent(event)) return;\n if (isActivationKey(event)) {\n event.preventDefault();\n activate();\n }\n };\n\n const handleRowKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n const rowElement = event.currentTarget;\n const target = event.target as HTMLElement;\n const cell = getActionCell(rowElement);\n\n if (!cell || !cell.contains(target)) {\n if (target !== rowElement) return;\n if (isActivationKey(event)) {\n event.preventDefault();\n activate();\n return;\n }\n const intent = getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(rowElement),\n });\n const first = intent === 'next' && cell ? getActionStops(cell)[0] : undefined;\n if (first) {\n event.preventDefault();\n first.focus();\n }\n return;\n }\n\n // Inside the action cell.\n if (target !== cell && isTextEntry(target)) {\n // The widget keeps its keys (caret movement, typing); Escape returns to the cell.\n if (event.key === 'Escape') {\n event.preventDefault();\n cell.focus();\n }\n return;\n }\n if (target === cell && (event.key === 'Enter' || event.key === 'F2')) {\n const entry = getFocusables(cell).find((el) => isTextEntry(el));\n if (entry) {\n event.preventDefault();\n entry.focus();\n }\n return;\n }\n const intent = getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(rowElement),\n });\n if (!intent) return;\n event.preventDefault();\n const stops = getActionStops(cell);\n const index = stops.indexOf(target);\n if (intent === 'next') {\n stops[index + 1]?.focus();\n } else if (index > 0) {\n stops[index - 1].focus();\n } else {\n rowElement.focus();\n }\n };\n\n const Element = (mode === 'grid' ? 'div' : 'li') as React.ElementType;\n const ContentCell = (mode === 'grid' ? 'div' : 'span') as React.ElementType;\n const role = mode === 'grid' ? 'row' : mode === 'listbox' ? 'option' : 'listitem';\n\n const interactiveProps: Record<string, unknown> = selectable\n ? {\n 'aria-selected': isSelected,\n tabIndex: getTabIndex(rovingValue),\n 'data-roving-value': rovingValue,\n 'data-selected': isSelected ? '' : undefined,\n onClick: composeEventHandlers(onClick, handleClick),\n onKeyDown: composeEventHandlers(\n onKeyDown,\n mode === 'grid' ? handleRowKeyDown : handleOptionKeyDown,\n ),\n }\n : { onClick, onKeyDown };\n\n return (\n <Element\n role={role}\n className={cn(\n 'flex items-center border-b border-border px-4 py-2 text-body-1',\n selectable && ['relative cursor-pointer', focusRingInset],\n selectable &&\n (isSelected\n ? [\n 'bg-subtle-selected before:absolute before:inset-y-2 before:start-0 before:w-0.5 before:rounded-full before:bg-primary',\n forcedColors.selectedContainer,\n ]\n : 'hover:bg-subtle-hover'),\n className,\n )}\n {...rest}\n ref={itemRefs}\n {...interactiveProps}\n >\n <ContentCell role={mode === 'grid' ? 'gridcell' : undefined} className=\"min-w-0 flex-1\">\n {children}\n </ContentCell>\n {hasAction && (\n <ListActionCell grid={mode === 'grid'} onRemovedWithFocus={recordActionFocusLoss}>\n {/* A generator was read once by the check above: render its items. */}\n {materialiseSlotContent(action)}\n </ListActionCell>\n )}\n </Element>\n );\n};\nListItem.displayName = 'ListItem';\n\n/**\n * Nested composite widgets (a Toolbar, a RadioGroup, …) manage their own tab indexes, so the action\n * cell never writes `tabindex` on or inside one (the same rule as the DataGrid's cell widgets).\n */\nconst COMPOSITE_SELECTOR = [\n '[data-roving-container]',\n ...[\n 'toolbar',\n 'radiogroup',\n 'listbox',\n 'grid',\n 'treegrid',\n 'tablist',\n 'menu',\n 'menubar',\n 'tree',\n ].map((role) => `[role=\"${role}\"]`),\n].join(', ');\n\n/** Attributes that can put an element of an action cell (back) into the Tab order. */\nconst STAMP_OBSERVED_ATTRIBUTES = ['tabindex', 'href', 'contenteditable', 'controls'];\n\n/**\n * Grid mode: takes the focusable elements of an action cell out of the Tab order (the row is the\n * only Tab stop; the actions are reached with the arrow keys) and keeps them out while the cell is\n * mounted. Returns the cleanup that disconnects the observer and restores the original values.\n *\n * It runs once per cell, not on every render of every item (an inline `action` has a new identity\n * on every parent render): a `MutationObserver` re-stamps when elements are added to the cell or an\n * element's `tabindex` is changed by someone else, including by an action component's own state.\n * Every candidate of `FOCUSABLE_SELECTOR` is stamped, disabled or hidden ones too, so an element\n * that is enabled or shown later is already out of the Tab order and no computed style is read.\n * Removed elements are dropped from the record on each pass. Nested composites are skipped (see\n * `COMPOSITE_SELECTOR`), and an element whose replaced `tabindex` something else re-applies (a\n * script that manages it) is left alone from then on, so the two never overwrite each other in an\n * endless loop of observer callbacks.\n */\nfunction stampActionCell(cell: HTMLElement): () => void {\n /** Stamped elements with the `tabindex` they had before (`null`: none). */\n const stamped = new Map<HTMLElement, string | null>();\n /** Elements whose `tabindex` something else keeps re-applying: they are left to it. */\n const yielded = new WeakSet<HTMLElement>();\n const stamp = () => {\n for (const el of stamped.keys()) {\n if (!cell.contains(el)) stamped.delete(el);\n }\n for (const el of cell.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)) {\n const tabIndex = el.getAttribute('tabindex');\n if (tabIndex === '-1' || yielded.has(el)) continue;\n const composite = el.closest(COMPOSITE_SELECTOR);\n if (composite && cell.contains(composite)) continue;\n stamped.set(el, tabIndex);\n el.setAttribute('tabindex', '-1');\n }\n };\n stamp();\n if (typeof MutationObserver === 'undefined') return () => {};\n\n const observer = new MutationObserver((records) => {\n // The records of this cell's own writes are taken below, so these values were set by someone\n // else: a changed prop (the new value to restore), or a script that manages the element's\n // tabindex and re-applied the value this cell replaced. Yielding to the latter keeps the two\n // from overwriting each other forever.\n const changed = new Set<HTMLElement>();\n for (const record of records) {\n const target = record.target as HTMLElement;\n if (record.attributeName === 'tabindex' && stamped.has(target)) changed.add(target);\n }\n for (const el of changed) {\n const value = el.getAttribute('tabindex');\n if (value !== '-1' && value === stamped.get(el)) {\n stamped.delete(el);\n yielded.add(el);\n } else {\n stamped.set(el, value);\n }\n }\n stamp();\n observer.takeRecords();\n });\n observer.observe(cell, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: STAMP_OBSERVED_ATTRIBUTES,\n });\n return () => {\n observer.disconnect();\n for (const [el, original] of stamped) {\n if (original === null) el.removeAttribute('tabindex');\n else el.setAttribute('tabindex', original);\n }\n stamped.clear();\n };\n}\n\ninterface ListActionCellProps {\n /** Grid mode: a focusable `gridcell` div whose widgets leave the Tab order; otherwise a `span`. */\n grid: boolean;\n /** Called when the cell is removed while focus is inside it (the cell is still in the document). */\n onRemovedWithFocus: (cell: HTMLElement) => void;\n children: React.ReactNode;\n}\n\n/**\n * The action cell of a {@link ListItem} (internal). React runs the layout-effect cleanups of a\n * removed subtree before it removes the subtree's DOM, but a component's own cleanups only after\n * its removed children are gone. So this cleanup, unlike one in ListItem, still sees focus inside\n * the cell when the action disappears (data-display#2).\n *\n * `grid` never changes for a mounted cell: switching between list and grid semantics changes the\n * List's root element, which remounts the items and their cells.\n */\nfunction ListActionCell({ grid, onRemovedWithFocus, children }: ListActionCellProps) {\n const cellRef = React.useRef<HTMLElement | null>(null);\n\n React.useLayoutEffect(() => {\n const cell = cellRef.current;\n return () => {\n if (!cell) return;\n const active = cell.ownerDocument.activeElement;\n if (active && cell.contains(active)) onRemovedWithFocus(cell);\n };\n }, [onRemovedWithFocus, grid]);\n\n React.useLayoutEffect(() => {\n const cell = cellRef.current;\n return grid && cell ? stampActionCell(cell) : undefined;\n }, [grid]);\n\n const Cell = (grid ? 'div' : 'span') as React.ElementType;\n return (\n <Cell\n ref={cellRef}\n role={grid ? 'gridcell' : undefined}\n tabIndex={grid ? -1 : undefined}\n data-list-action=\"\"\n className={cn('ms-2 shrink-0', grid && focusRingInset)}\n >\n {children}\n </Cell>\n );\n}\nListActionCell.displayName = 'ListActionCell';\n\n/**\n * A vertical list of items, optionally selectable.\n *\n * - **Plain** (`selectable` false): `role=\"list\"` with `listitem`s; item actions stay in the\n * normal Tab order.\n * - **Selectable** (APG Listbox): `role=\"listbox\"` with `option`s and one Tab stop (the first\n * selected option, else the first option). ArrowUp/Down move focus (wrapping), Home/End jump to\n * the ends, typeahead is on for more than 7 items, Enter/Space and clicks toggle selection (a\n * Space typed within 500 ms of a typeahead character continues the search instead; with Ctrl,\n * Alt or Meta, Enter and Space are left to the page).\n * - **Selectable with item actions** (APG Grid): `role=\"grid\"` with `row`s (carrying\n * `aria-selected`) and `gridcell`s for the content and the action. One Tab stop; Up/Down move\n * between rows, Right/Left (mirrored in RTL) move into and out of the actions. A cell that holds\n * a text-entry widget takes focus itself: Enter/F2 enter the widget, Escape returns to the cell.\n * Clicks and keys that start inside an action, or inside a popup it opens (a Popover, a Menu),\n * never toggle selection.\n * - **Switching semantics remounts the items.** Listbox/list and grid use different elements\n * (`ul`/`li` and `div`), so when a selectable list gains its first item action, loses its last\n * one, or `selectable` changes while items have actions, React remounts the items and their\n * content: state inside them (an inline rename input's draft, an uncontrolled checkbox) is reset.\n * Focus that is on an item or inside it when the list switches moves to the same item (by\n * `value`, else by position; the next item when the focused one was removed), so the switch\n * never drops it to `<body>`. This includes focus inside the last action when that action\n * removes itself (an inline rename input that unmounts on Enter). An action that removes itself\n * while focused without causing a switch drops focus, like any removed element. When the list\n * may switch, keep such state in the parent (or keep an action on at least one item).\n * - Selection: `selectionMode` `'single'` (default) or `'multiple'`; controlled with\n * `selectedItems` (or `selectedItem` in single mode) or uncontrolled with the `default*` props.\n * Values of items that are no longer rendered are dropped from the reported selection.\n * - Sub-component: `List.Item` (also exported as `ListItem` for React Server Components).\n *\n * @example\n * <List selectable selectionMode=\"multiple\" aria-label=\"Fruits\" onSelectionChange={setFruits}>\n * <List.Item value=\"apple\">Apple</List.Item>\n * <List.Item value=\"banana\">Banana</List.Item>\n * </List>\n */\nexport const List = /* @__PURE__ */ Object.assign(ListRoot, {\n Item: ListItem,\n});\n"],"mappings":"kqBAsGA,IAAMmC,EAAcnC,EAAM,cAAuC,IAAI,EACrE,EAAY,YA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