@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 @@
1
+ {"version":3,"file":"Overflow.mjs","names":["React","NO_IDS","useForceRender","n","hasResizeObserver","documentOrder","a","b","REORDER_OBSERVER_OPTIONS","sameIds","id","i","warnDuplicateItemId","itemId","noop","readContainer","paddingInline","gap","view","container","style","OverflowStore","listener","el","onResize","node","order","isDev","counts","count","remaining","elements","entries","widths","total","sum","width","next","pinned","available","limit","used","cut","end","hiddenChanged","OverflowContext","INERT_CONTEXT","useOverflowContext","reportMissingContext","componentName","useOverflowMenu","hiddenIds","useIsOverflowItemVisible","hiddenSet","isElement","followDirectChildren","record","records","parent","observer","OverflowingStore","element","check","cleanups","resizeObserver","child","mutationObserver","cleanup","isRefObject","target","useIsOverflowing","store","isOverflowing","forceRender","unsubscribe","OverflowRoot","rest","setContainer","setButton","containerRef","useMergedRefs","ref","disconnect","buttonIds","ctx","hiddenCount","cn","className","children","overflowButton","OverflowItem","ariaHidden","isHidden","registerRef","mergedRef","inert","Overflow"],"sources":["../../../src/components/layout/Overflow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { isDev, reportMissingContext, warnOnce } from '../../lib/dev';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\n\n/** Properties for the Overflow component. */\nexport interface OverflowProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Renders the overflow button (for example a \"+3\" menu trigger) while at least one item is\n * hidden. Receives the number of hidden items and their `itemId`s in DOM order, so the button\n * can open a menu of the hidden items. `hiddenIds` is the button's own array (sorting it in\n * place affects nobody else). Its width is measured and reserved when items overflow.\n * Components rendered by it can also read the hidden items with {@link useOverflowMenu}.\n */\n overflowButton?: (count: number, hiddenIds: string[]) => React.ReactNode;\n /**\n * The {@link OverflowItem}s to lay out in one row. Only items and the overflow button are\n * measured: the container's whole content box is the room for them, so other content placed in\n * the row is not accounted for and could clip items that still count as visible. Keep fixed\n * content outside the Overflow (for example in a surrounding flex row), or wrap it in an\n * `OverflowItem` (the first item is never hidden).\n */\n children: React.ReactNode;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Properties for the OverflowItem sub-component. */\nexport interface OverflowItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Identifier for tracking this item's overflow visibility, unique within the Overflow (a\n * duplicate warns in development: items that share one are hidden and shown together).\n */\n itemId: string;\n /** Content of the overflow item. */\n children: React.ReactNode;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Result of {@link useOverflowMenu}. */\nexport interface UseOverflowMenuResult {\n /** `itemId`s of the hidden items, in DOM order (the caller's own array). */\n hiddenIds: string[];\n /** Number of hidden items. */\n count: number;\n}\n\n// ---------------------------------------------------------------------------\n// Measurement store\n// ---------------------------------------------------------------------------\n\n/**\n * The empty snapshot. Snapshots are internal: they are compared by identity and never handed to\n * consumers, who receive their own copies (see `useOverflowMenu` and `overflowButton`).\n */\nconst NO_IDS: string[] = [];\n\n/** A stable function that re-renders the calling component. */\nfunction useForceRender(): () => void {\n return React.useReducer((n: number) => n + 1, 0)[1];\n}\n\nfunction hasResizeObserver(): boolean {\n return typeof ResizeObserver !== 'undefined';\n}\n\nfunction documentOrder(a: Element, b: Element): number {\n if (a === b) return 0;\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n}\n\n/** Moves anywhere in the row: items reordered directly or inside wrappers. */\nconst REORDER_OBSERVER_OPTIONS: MutationObserverInit = { childList: true, subtree: true };\n\nfunction sameIds(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((id, i) => id === b[i]);\n}\n\nfunction warnDuplicateItemId(itemId: string): void {\n warnOnce(\n `Overflow:duplicate:${itemId}`,\n `Overflow: several items share the itemId \"${itemId}\". Item ids must be unique within an ` +\n 'Overflow; items with the same itemId are hidden and shown together.',\n );\n}\n\nconst noop = () => {};\n\n/** Width available to items: the content box of the container, and the flex gap between items. */\nfunction readContainer(container: HTMLElement): { available: number; gap: number } {\n let paddingInline = 0;\n let gap = 0;\n const view = container.ownerDocument.defaultView;\n if (view) {\n const style = view.getComputedStyle(container);\n paddingInline = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);\n gap = parseFloat(style.columnGap) || 0;\n }\n return { available: container.clientWidth - paddingInline, gap };\n}\n\n/**\n * Tracks the container, the items and the overflow button of one `Overflow` and publishes the ids\n * of the hidden items (DOM order), and whether the button covers the first item, to\n * `useSyncExternalStore`.\n *\n * - **Measurement never writes styles.** An item's width is read (`offsetWidth`) only while it is\n * visible and cached; a hidden item (`data-overflow-hidden` and an inline `display: none`, both\n * rendered by React) keeps its last visible width. All reads happen before React applies the\n * result.\n * - **Membership-only updates.** A new snapshot is published only when the hidden set (or whether\n * the button covers the first item) changes, so a resize that hides the same items renders\n * nothing.\n * - **One observer.** A single `ResizeObserver` (created when the root mounts) watches the\n * container, every item and the overflow button. Without `ResizeObserver` the store measures\n * whenever something registers and on window `resize`.\n * - **Reorders.** A keyed reorder moves item elements without registering them again or changing\n * a size. The order of the last measurement is re-checked (n − 1 `compareDocumentPosition`\n * calls, no layout reads) after every commit of the root and, through a `MutationObserver`\n * (`childList`, `subtree`) on the container, after moves that do not render the root (a list\n * component inside the row that owns its order); only an inversion re-measures.\n */\nclass OverflowStore {\n private container: HTMLElement | null = null;\n private button: HTMLElement | null = null;\n private buttonWidth = 0;\n private readonly items = new Map<HTMLElement, string>();\n /** How many mounted items use each `itemId` (development only: a repeated one warns). */\n private readonly itemIdCounts = new Map<string, number>();\n private readonly widths = new WeakMap<HTMLElement, number>();\n private readonly listeners = new Set<() => void>();\n private hidden: string[] = NO_IDS;\n /** The first item is wider than the room beside the button, so the button covers its end. */\n private pinned = false;\n /** The item elements of the last measurement, in the DOM order they had then. */\n private order: HTMLElement[] = [];\n private connected = false;\n private observer: ResizeObserver | null = null;\n private reorderObserver: MutationObserver | null = null;\n private removeResizeListener: (() => void) | null = null;\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n getSnapshot = (): string[] => this.hidden;\n\n getServerSnapshot = (): string[] => NO_IDS;\n\n getPinned = (): boolean => this.pinned;\n\n getServerPinned = (): boolean => false;\n\n /** Starts observing (root layout effect); returns the teardown. */\n connect = (): (() => void) => {\n this.connected = true;\n if (hasResizeObserver()) {\n this.observer = new ResizeObserver(() => this.measure());\n for (const el of this.observedElements()) this.observer.observe(el);\n } else if (typeof window !== 'undefined') {\n const onResize = () => this.measure();\n window.addEventListener('resize', onResize);\n this.removeResizeListener = () => window.removeEventListener('resize', onResize);\n }\n if (typeof MutationObserver !== 'undefined') {\n this.reorderObserver = new MutationObserver(() => this.checkOrder());\n if (this.container) this.reorderObserver.observe(this.container, REORDER_OBSERVER_OPTIONS);\n }\n this.measure();\n return () => {\n this.connected = false;\n this.observer?.disconnect();\n this.observer = null;\n this.reorderObserver?.disconnect();\n this.reorderObserver = null;\n this.removeResizeListener?.();\n this.removeResizeListener = null;\n };\n };\n\n /** Ref callback of the container. */\n setContainer = (node: HTMLDivElement | null): void => {\n if (node === this.container) return;\n if (this.container) this.observer?.unobserve(this.container);\n this.container = node;\n if (node) this.observer?.observe(node);\n if (this.reorderObserver) {\n this.reorderObserver.disconnect();\n if (node) this.reorderObserver.observe(node, REORDER_OBSERVER_OPTIONS);\n }\n this.measure();\n };\n\n /**\n * Re-measures when the items of the last measurement are no longer in DOM order (a keyed\n * reorder). Cheap: neighbour comparisons only, no layout reads.\n */\n checkOrder = (): void => {\n const order = this.order;\n for (let i = 1; i < order.length; i++) {\n if (documentOrder(order[i - 1], order[i]) > 0) {\n this.measure();\n return;\n }\n }\n };\n\n /** Ref callback of the overflow button wrapper. The last measured width outlives it. */\n setButton = (node: HTMLDivElement | null): void => {\n if (node === this.button) return;\n if (this.button) this.observer?.unobserve(this.button);\n this.button = node;\n if (node) this.observer?.observe(node);\n this.measure();\n };\n\n /** Registers an item element; returns its unregistration. */\n registerItem(el: HTMLElement, id: string): () => void {\n this.items.set(el, id);\n this.observer?.observe(el);\n this.measure();\n return () => {\n if (this.items.get(el) !== id) return;\n this.items.delete(el);\n this.observer?.unobserve(el);\n this.measure();\n };\n }\n\n /**\n * Counts the `itemId` of a mounted item (called from the item's effect, C-DEV); a second item\n * with an id already in use warns once per id. Returns the cleanup.\n */\n registerItemId = (itemId: string): (() => void) => {\n if (!isDev) return noop;\n const counts = this.itemIdCounts;\n const count = (counts.get(itemId) ?? 0) + 1;\n counts.set(itemId, count);\n if (count > 1) warnDuplicateItemId(itemId);\n return () => {\n const remaining = (counts.get(itemId) ?? 1) - 1;\n if (remaining > 0) counts.set(itemId, remaining);\n else counts.delete(itemId);\n };\n };\n\n private observedElements(): HTMLElement[] {\n const elements = Array.from(this.items.keys());\n if (this.container) elements.push(this.container);\n if (this.button) elements.push(this.button);\n return elements;\n }\n\n private measure(): void {\n const container = this.container;\n if (!this.connected || !container) return;\n\n // Reads first: widths of the visible items, the button and the container.\n const entries = Array.from(this.items)\n .filter(([el]) => el.isConnected && container.contains(el))\n .sort(([a], [b]) => documentOrder(a, b));\n this.order = entries.map(([el]) => el);\n for (const [el] of entries) {\n if (!el.hasAttribute('data-overflow-hidden')) this.widths.set(el, el.offsetWidth);\n }\n if (this.button?.isConnected) this.buttonWidth = this.button.offsetWidth;\n const { available, gap } = readContainer(container);\n\n const widths = entries.map(([el]) => this.widths.get(el) ?? 0);\n const total = widths.reduce((sum, width, i) => sum + width + (i > 0 ? gap : 0), 0);\n\n let next: string[] = NO_IDS;\n let pinned = false;\n if (total > available) {\n // Items that fit next to the overflow button stay; the first item always stays.\n const limit = available - (this.buttonWidth > 0 ? this.buttonWidth + gap : 0);\n let used = 0;\n let cut = entries.length;\n for (let i = 0; i < entries.length; i++) {\n const end = used + widths[i] + (i > 0 ? gap : 0);\n if (i > 0 && end > limit) {\n cut = i;\n break;\n }\n used = end;\n }\n next = entries.slice(cut).map(([, id]) => id);\n // The sticky button eats the gap before it first; it covers the first item only when the\n // two do not fit side by side.\n pinned = next.length > 0 && widths[0] + this.buttonWidth > available;\n }\n\n const hiddenChanged = !sameIds(next, this.hidden);\n if (!hiddenChanged && pinned === this.pinned) return;\n // The same hidden set keeps its array, so the items and useOverflowMenu() do not update.\n if (hiddenChanged) this.hidden = next.length > 0 ? next : NO_IDS;\n this.pinned = pinned;\n for (const listener of Array.from(this.listeners)) listener();\n }\n}\n\n// ---------------------------------------------------------------------------\n// Context (C-CONTEXT)\n// ---------------------------------------------------------------------------\n\ninterface OverflowContextValue {\n store: OverflowStore;\n hiddenIds: string[];\n hiddenSet: ReadonlySet<string>;\n}\n\nconst OverflowContext = React.createContext<OverflowContextValue | null>(null);\n\n/** Production fallback for a misplaced sub-component: a store that is never connected. */\nconst INERT_CONTEXT: OverflowContextValue = {\n store: /* @__PURE__ */ new OverflowStore(),\n hiddenIds: NO_IDS,\n hiddenSet: /* @__PURE__ */ new Set<string>(),\n};\n\n/**\n * The enclosing Overflow's context. Outside an Overflow it throws in development and, in\n * production, logs an error once and returns an inert value (C-CONTEXT).\n */\nfunction useOverflowContext(componentName: string): OverflowContextValue {\n const ctx = React.useContext(OverflowContext);\n if (ctx) return ctx;\n reportMissingContext(componentName, 'Overflow');\n return INERT_CONTEXT;\n}\n\n// ---------------------------------------------------------------------------\n// Hooks\n// ---------------------------------------------------------------------------\n\n/**\n * The items an {@link Overflow} currently hides: their `itemId`s in DOM order and their count. Use\n * it in the component that `overflowButton` renders to list the hidden items in a menu. Must be\n * called inside `Overflow`.\n */\nexport function useOverflowMenu(): UseOverflowMenuResult {\n const { hiddenIds } = useOverflowContext('useOverflowMenu');\n // A copy per caller and snapshot: sorting or reversing it cannot affect other consumers.\n return React.useMemo(() => ({ hiddenIds: [...hiddenIds], count: hiddenIds.length }), [hiddenIds]);\n}\n\n/**\n * Whether the {@link OverflowItem} with `itemId` is currently shown (`false` while it overflows).\n * Must be called inside `Overflow`.\n */\nexport function useIsOverflowItemVisible(itemId: string): boolean {\n const { hiddenSet } = useOverflowContext('useIsOverflowItemVisible');\n return !hiddenSet.has(itemId);\n}\n\nfunction isElement(node: Node): node is Element {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n\n/**\n * Keeps `observer` on the element children of `parent`: unobserves the removed ones and observes\n * the added ones that are still attached to `parent` (records are replayed in order, so a child\n * moved or re-added within one batch ends up observed exactly when it is present).\n */\nfunction followDirectChildren(\n observer: ResizeObserver,\n parent: Element,\n records: readonly MutationRecord[],\n): void {\n for (const record of records) {\n if (record.type !== 'childList' || record.target !== parent) continue;\n record.removedNodes.forEach((node) => {\n if (isElement(node)) observer.unobserve(node);\n });\n record.addedNodes.forEach((node) => {\n if (isElement(node) && node.parentNode === parent) observer.observe(node);\n });\n }\n}\n\n/** Tracks `scrollWidth > clientWidth` of one element. */\nclass OverflowingStore {\n private element: HTMLElement | null = null;\n private value = false;\n private readonly listeners = new Set<() => void>();\n private teardown: (() => void) | null = null;\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n getSnapshot = (): boolean => this.value;\n\n getServerSnapshot = (): boolean => false;\n\n /** Follows `element` (layout effect of every render); re-subscribes when it changes. */\n setElement(element: HTMLElement | null): void {\n if (element === this.element) return;\n this.disconnect();\n this.element = element;\n if (element) this.teardown = this.observe(element);\n this.check();\n }\n\n disconnect(): void {\n this.teardown?.();\n this.teardown = null;\n this.element = null;\n }\n\n private observe(element: HTMLElement): () => void {\n const check = () => this.check();\n const cleanups: Array<() => void> = [];\n\n // Resizes of the element and of its direct children (content that grows or shrinks).\n const resizeObserver = hasResizeObserver() ? new ResizeObserver(check) : null;\n if (resizeObserver) {\n resizeObserver.observe(element);\n for (const child of Array.from(element.children)) resizeObserver.observe(child);\n cleanups.push(() => resizeObserver.disconnect());\n } else if (typeof window !== 'undefined') {\n window.addEventListener('resize', check);\n cleanups.push(() => window.removeEventListener('resize', check));\n }\n\n // Content added, removed or edited. Only a change of the direct children changes what the\n // ResizeObserver watches, and only those children are (un)observed; text edits and deeper\n // changes just re-check.\n if (typeof MutationObserver !== 'undefined') {\n const mutationObserver = new MutationObserver((records) => {\n if (resizeObserver) followDirectChildren(resizeObserver, element, records);\n check();\n });\n mutationObserver.observe(element, { childList: true, subtree: true, characterData: true });\n cleanups.push(() => mutationObserver.disconnect());\n }\n\n return () => cleanups.forEach((cleanup) => cleanup());\n }\n\n private check(): void {\n const el = this.element;\n const next = el !== null && el.scrollWidth > el.clientWidth;\n if (next === this.value) return;\n this.value = next;\n for (const listener of Array.from(this.listeners)) listener();\n }\n}\n\nfunction isRefObject(\n target: React.RefObject<HTMLElement | null> | HTMLElement | null | undefined,\n): target is React.RefObject<HTMLElement | null> {\n return target != null && typeof target === 'object' && 'current' in target;\n}\n\n/**\n * Whether `target`'s content is wider than the element (`scrollWidth > clientWidth`).\n *\n * `target` is a ref object or the element itself (for example from callback-ref state:\n * `const [el, setEl] = useState(null)` + `ref={setEl}`). The hook re-checks when the element\n * resizes, when its direct children resize, and when content is added, removed or edited; an\n * element that mounts later (a ref attached conditionally) is picked up after the render that\n * mounts it. Without `ResizeObserver` it re-checks on window `resize` and content changes. Returns\n * `false` on the server.\n */\nexport function useIsOverflowing(\n target: React.RefObject<HTMLElement | null> | HTMLElement | null,\n): boolean {\n const [store] = React.useState(() => new OverflowingStore());\n const isOverflowing = React.useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n );\n const forceRender = useForceRender();\n\n // Every render: follow the element the ref points to now (cheap identity check). A change found\n // here re-renders from the layout phase, before paint: useSyncExternalStore only subscribes in a\n // passive effect, so on mount it would pick the first value up after the browser painted.\n React.useLayoutEffect(() => {\n const unsubscribe = store.subscribe(forceRender);\n store.setElement(isRefObject(target) ? target.current : target);\n unsubscribe();\n });\n\n React.useLayoutEffect(() => () => store.disconnect(), [store]);\n\n return isOverflowing;\n}\n\n// ---------------------------------------------------------------------------\n// Components\n// ---------------------------------------------------------------------------\n\nconst OverflowRoot = ({ overflowButton, children, className, ref, ...rest }: OverflowProps) => {\n const [store] = React.useState(() => new OverflowStore());\n const hiddenIds = React.useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n );\n const pinned = React.useSyncExternalStore(\n store.subscribe,\n store.getPinned,\n store.getServerPinned,\n );\n const setContainer = React.useCallback(\n (node: HTMLDivElement | null) => store.setContainer(node),\n [store],\n );\n const setButton = React.useCallback(\n (node: HTMLDivElement | null) => store.setButton(node),\n [store],\n );\n const containerRef = useMergedRefs<HTMLDivElement>(ref, setContainer);\n const forceRender = useForceRender();\n\n // Observers are created once per instance (not per render or per children change). The first\n // measurement (in connect) re-renders from this layout effect, before paint: useSyncExternalStore\n // only subscribes in a passive effect, which can run after the browser painted every item.\n React.useLayoutEffect(() => {\n const unsubscribe = store.subscribe(forceRender);\n const disconnect = store.connect();\n unsubscribe();\n return disconnect;\n }, [store, forceRender]);\n\n // After every commit of the root (new children, a keyed reorder): items moved without any size\n // change or registration are re-measured before paint. Cheap when nothing moved.\n React.useLayoutEffect(() => {\n store.checkOrder();\n });\n\n const hiddenSet = React.useMemo(() => new Set(hiddenIds), [hiddenIds]);\n // The overflowButton's own copy (consumers may sort it in place).\n const buttonIds = React.useMemo(() => [...hiddenIds], [hiddenIds]);\n const ctx = React.useMemo<OverflowContextValue>(\n () => ({ store, hiddenIds, hiddenSet }),\n [store, hiddenIds, hiddenSet],\n );\n\n const hiddenCount = hiddenIds.length;\n\n return (\n <OverflowContext.Provider value={ctx}>\n <div\n ref={containerRef}\n // The row clips its content at its padding edge: the 4px padding leaves room for the focus\n // indicator a focused item draws 4px around itself. No negative margin offsets it: the\n // row's box would then reach past its container, which a scroll container around an\n // edge-to-edge row (or the page) counts as overflow. The store measures the room without\n // the padding.\n className={cn('flex items-center overflow-hidden p-1', className)}\n {...rest}\n >\n {children}\n {hiddenCount > 0 && overflowButton && (\n // In the row's flow (it adds to the row height and follows justify-*), sticking to the\n // inline end when the first item is wider than the room beside it. Browsers stop a\n // sticky element at the scroll container's padding, so -end-1 lets it reach the\n // clipping edge, and while pinned it keeps 4px inside for its own focus indicator.\n // (WebKit stops a sticky element short of the inline end of a right-to-left row; it\n // stays in the row.)\n <div\n ref={setButton}\n data-overflow-button=\"\"\n data-overflow-pinned={pinned ? '' : undefined}\n className=\"sticky -end-1 flex shrink-0 items-center self-stretch ps-1 data-[overflow-pinned]:bg-background data-[overflow-pinned]:pe-1\"\n >\n {overflowButton(hiddenCount, buttonIds)}\n </div>\n )}\n </div>\n </OverflowContext.Provider>\n );\n};\nOverflowRoot.displayName = 'Overflow';\n\n/**\n * One entry of an {@link Overflow}. While it does not fit it stays mounted but is hidden\n * (`data-overflow-hidden` and an inline `display: none` placed after the consumer's own `style`),\n * `aria-hidden` and `inert`. The inline style wins over the consumer's `style.display` and over\n * display utilities in any cascade layer (a prefixed Tailwind app's `tw:flex` included), so a\n * hidden item is never shown while it is counted in \"+N\". Must be rendered inside `Overflow`.\n */\nexport const OverflowItem = ({\n itemId,\n children,\n className,\n style,\n ref,\n 'aria-hidden': ariaHidden,\n inert,\n ...rest\n}: OverflowItemProps) => {\n const { store, hiddenSet } = useOverflowContext('OverflowItem');\n const isHidden = hiddenSet.has(itemId);\n React.useEffect(() => store.registerItemId(itemId), [store, itemId]);\n\n const registerRef = React.useCallback(\n (node: HTMLDivElement | null) => (node ? store.registerItem(node, itemId) : undefined),\n [store, itemId],\n );\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, registerRef);\n\n return (\n <div\n ref={mergedRef}\n className={cn('shrink-0', className)}\n {...rest}\n style={isHidden ? { ...style, display: 'none' } : style}\n aria-hidden={isHidden ? true : ariaHidden}\n inert={isHidden ? true : inert}\n data-overflow-hidden={isHidden ? '' : undefined}\n >\n {children}\n </div>\n );\n};\nOverflowItem.displayName = 'OverflowItem';\n\n/**\n * A single row that hides the items which do not fit and shows an overflow button instead.\n *\n * Wrap each entry in {@link OverflowItem} with a unique `itemId`; the row holds only items (other\n * content is not measured, see `children`). Items are measured while visible, hidden from the end\n * (in DOM order; the first item always stays) and hidden items get `data-overflow-hidden`, an\n * inline `display: none`, `aria-hidden` and `inert`. Reordered items (for example a keyed sort) are\n * re-measured in their new order. `overflowButton(count, hiddenIds)` renders the button after the\n * visible items (its measured width is reserved); components inside it can use\n * {@link useOverflowMenu} to list the hidden items (e.g. in a Menu), and\n * {@link useIsOverflowItemVisible} reports a single item. The button sticks to the inline end of\n * the row, so a first item wider than the room beside it cannot push it out of view: it then covers\n * the end of that item and gets `data-overflow-pinned`, with the `background` token behind it. (In\n * a right-to-left row, WebKit stops the pinned button short of the end, still inside the row.)\n *\n * The row clips what does not fit. So that the focus indicators of its items are not cut off, it\n * has a 4px padding: the items sit 4px in from its edges, and the row is 8px taller than they are.\n * An explicit width (such as `w-full` or a style width) includes that padding. The row never\n * reaches past its own box, so an edge-to-edge row adds no scrollbar to the page or to a scroll\n * container around it. A negative margin of 4px lines the items up with the content around the\n * row; add it only where nothing within 4px of the row scrolls (the row's box then reaches 4px past\n * its container on every side). `p-0` removes the room (focus indicators at the row's edges are\n * then clipped).\n *\n * Works without `ResizeObserver` (jsdom, old browsers): it then re-measures on window resize and\n * when items mount, unmount or move.\n *\n * The item is also `Overflow.Item`. The same component is exported as `OverflowItem`; React Server\n * Components import that flat name (dotted access needs a client file).\n */\nexport const Overflow = /* @__PURE__ */ Object.assign(OverflowRoot, {\n Item: OverflowItem,\n});\n"],"mappings":";;;;;;;AAsDA,IAAMC,IAAmB,CAAC;AAG1B,SAASC,IAA6B;CACpC,OAAOF,EAAM,YAAY,MAAcG,IAAI,GAAG,CAAC,CAAC,CAAC;AACnD;AAEA,SAASC,IAA6B;CACpC,OAAO,OAAO,iBAAmB;AACnC;AAEA,SAASC,EAAc,GAAY,GAAoB;CAErD,OADIC,MAAMC,IAAU,IACbD,EAAE,wBAAwBC,CAAC,IAAI,KAAK,8BAA8B,KAAK;AAChF;AAGA,IAAMC,IAAiD;CAAE,WAAW;CAAM,SAAS;AAAK;AAExF,SAASC,EAAQ,GAAsB,GAA+B;CACpE,OAAOH,EAAE,WAAWC,EAAE,UAAUD,EAAE,OAAO,GAAI,MAAMI,MAAOH,EAAEI,EAAE;AAChE;AAEA,SAASC,EAAoB,GAAsB;CACjD,EACE,sBAAsBC,KACtB,6CAA6CA,EAAO,yGAEtD;AACF;AAEA,IAAMC,UAAa,CAAC;A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AAc,GACxD6C,IAAWvC,EAAU,IAAIxC,CAAM;CACrC,EAAM,gBAAgB0D,EAAM,eAAe1D,CAAM,GAAG,CAAC0D,GAAO1D,CAAM,CAAC;CAEnE,IAAMgF,IAAc7F,EAAM,aACvB,MAAiCyB,IAAO8C,EAAM,aAAa9C,GAAMZ,CAAM,IAAI,KAAA,GAC5E,CAAC0D,GAAO1D,CAAM,CAChB,GACMiF,IAAYd,EAA8BC,GAAKY,CAAW;CAEhE,OACE,kBAAC,OAAD;EACE,KAAKC;EACL,WAAWR,EAAG,YAAYC,CAAS;EACnC,GAAIX;EACJ,OAAOgB,IAAW;GAAE,GAAGxE;GAAO,SAAS;EAAO,IAAIA;EAClD,eAAawE,IAAW,KAAOD;EAC/B,OAAOC,IAAW,KAAOG;EACzB,wBAAsBH,IAAW,KAAK,KAAA;EAErC;CACE,CAAA;AAET;AACA,EAAa,cAAc;AAgC3B,IAAaI,IAA2B,uBAAO,OAAOrB,GAAc,EAClE,MAAMe,EACR,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:`gap-0`,xs:`gap-1`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},o={start:`items-start`,center:`items-center`,end:`items-end`,stretch:`items-stretch`},s={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`},c=e=>{let{as:r,orientation:c,direction:l,gap:u=`md`,align:d,justify:f,wrap:p,inline:m,className:h,children:g,ref:_,...v}=e,y=r??`div`,b=n.resolveDeprecatedProp(`Stack`,c,l,`direction`,`orientation`)??`vertical`;return(0,i.jsx)(y,{ref:_,className:t.cn(m?`inline-flex`:`flex`,b===`horizontal`?`flex-row`:`flex-col`,a[u],d&&o[d],f&&s[f],p&&`flex-wrap`,h),...v,children:g})};c.displayName=`Stack`,exports.Stack=c;
2
+ //# sourceMappingURL=Stack.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stack.cjs","names":["resolveDeprecatedProp","cn","require_runtime","require_cn","require_dev","react","react_jsx_runtime","gapMap","alignMap","justifyMap","Stack","orientationProp","rest","props","Component","as","orientation","direction","inline","gap","align","justify","wrap","className"],"sources":["../../../src/components/layout/Stack.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { resolveDeprecatedProp } from '../../lib/dev';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport type { Orientation } from '../../lib/types';\n\nconst gapMap = {\n none: 'gap-0',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6',\n} as const;\n\nconst alignMap = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n} as const;\n\nconst justifyMap = {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n} as const;\n\n/**\n * The Stack's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props only).\n * Every other prop comes from the rendered element (`as`).\n */\nexport interface StackOwnProps {\n /**\n * Layout axis of the stack.\n * @default 'vertical'\n */\n orientation?: Orientation;\n /**\n * @deprecated Use `orientation` (same values). Still works, warns once in development, and\n * `orientation` wins when both are given.\n */\n direction?: Orientation;\n /**\n * Gap size between stack items.\n * @default 'md'\n */\n gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Cross-axis alignment of items. */\n align?: 'start' | 'center' | 'end' | 'stretch';\n /** Main-axis justification of items. */\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n /** Whether items should wrap to the next line. */\n wrap?: boolean;\n /** Whether to use inline-flex instead of flex. */\n inline?: boolean;\n}\n\n/**\n * Props of {@link Stack} rendered as `C` (default `'div'`). `StackProps` without a type argument\n * is the 0.4 name: the props of a Stack rendered as a `<div>`, including `ref`.\n */\nexport type StackProps<C extends React.ElementType = 'div'> = PolymorphicProps<C, StackOwnProps>;\n\ntype StackImplProps = StackOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * A one-dimensional layout: items stacked vertically (default) or horizontally with a token gap.\n *\n * @example\n * <Stack orientation=\"horizontal\" gap=\"sm\" align=\"center\">\n * <Avatar name=\"Ada\" />\n * <Text>Ada Lovelace</Text>\n * </Stack>\n */\nexport const Stack: PolymorphicComponent<'div', StackOwnProps> = (props) => {\n const {\n as,\n orientation: orientationProp,\n direction,\n gap = 'md',\n align,\n justify,\n wrap,\n inline,\n className,\n children,\n ref,\n ...rest\n } = props as StackImplProps;\n const Component: React.ElementType = as ?? 'div';\n const orientation =\n resolveDeprecatedProp('Stack', orientationProp, direction, 'direction', 'orientation') ??\n 'vertical';\n\n return (\n <Component\n ref={ref}\n className={cn(\n inline ? 'inline-flex' : 'flex',\n orientation === 'horizontal' ? 'flex-row' : 'flex-col',\n gapMap[gap],\n align && alignMap[align],\n justify && justifyMap[justify],\n wrap && 'flex-wrap',\n className,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n};\nStack.displayName = 'Stack';\n"],"mappings":"6MAMA,IAAMO,EAAS,CACb,KAAM,QACN,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,EAEMC,EAAW,CACf,MAAO,cACP,OAAQ,eACR,IAAK,YACL,QAAS,eACX,EAEMC,EAAa,CACjB,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,OAAQ,gBACV,EAqDaC,EAAqD,GAAU,CAC1E,GAAM,CACJ,KACA,YAAaC,EACb,YACA,MAAM,KACN,QACA,UACA,OACA,SACA,YACA,WACA,MACA,GAAGC,GACDC,EACEC,EAA+BC,GAAM,MACrCC,EACJhB,EAAAA,sBAAsB,QAASW,EAAiBM,EAAW,YAAa,aAAa,GACrF,WAEF,OACE,EAAAX,EAAA,IAAA,CAACQ,EAAD,CACO,MACL,UAAWb,EAAAA,GACTiB,EAAS,cAAgB,OACzBF,IAAgB,aAAe,WAAa,WAC5CT,EAAOY,GACPC,GAASZ,EAASY,GAClBC,GAAWZ,EAAWY,GACtBC,GAAQ,YACRC,CACF,EACA,GAAIX,EAEH,UACQ,CAAA,CAEf,EACA,EAAM,YAAc"}
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { resolveDeprecatedProp as t } from "../../lib/dev.mjs";
4
+ import "react";
5
+ import { jsx as n } from "react/jsx-runtime";
6
+ //#region src/components/layout/Stack.tsx
7
+ var r = {
8
+ none: "gap-0",
9
+ xs: "gap-1",
10
+ sm: "gap-2",
11
+ md: "gap-3",
12
+ lg: "gap-4",
13
+ xl: "gap-6"
14
+ }, i = {
15
+ start: "items-start",
16
+ center: "items-center",
17
+ end: "items-end",
18
+ stretch: "items-stretch"
19
+ }, a = {
20
+ start: "justify-start",
21
+ center: "justify-center",
22
+ end: "justify-end",
23
+ between: "justify-between",
24
+ around: "justify-around",
25
+ evenly: "justify-evenly"
26
+ }, o = (o) => {
27
+ let { as: s, orientation: c, direction: l, gap: u = "md", align: d, justify: f, wrap: p, inline: m, className: h, children: g, ref: _, ...v } = o, y = s ?? "div", b = t("Stack", c, l, "direction", "orientation") ?? "vertical";
28
+ return /* @__PURE__ */ n(y, {
29
+ ref: _,
30
+ className: e(m ? "inline-flex" : "flex", b === "horizontal" ? "flex-row" : "flex-col", r[u], d && i[d], f && a[f], p && "flex-wrap", h),
31
+ ...v,
32
+ children: g
33
+ });
34
+ };
35
+ o.displayName = "Stack";
36
+ //#endregion
37
+ export { o as Stack };
38
+
39
+ //# sourceMappingURL=Stack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stack.mjs","names":["gapMap","alignMap","justifyMap","Stack","orientationProp","rest","props","Component","as","orientation","resolveDeprecatedProp","direction","cn","inline","gap","align","justify","wrap","className"],"sources":["../../../src/components/layout/Stack.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { resolveDeprecatedProp } from '../../lib/dev';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport type { Orientation } from '../../lib/types';\n\nconst gapMap = {\n none: 'gap-0',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6',\n} as const;\n\nconst alignMap = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n} as const;\n\nconst justifyMap = {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n} as const;\n\n/**\n * The Stack's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props only).\n * Every other prop comes from the rendered element (`as`).\n */\nexport interface StackOwnProps {\n /**\n * Layout axis of the stack.\n * @default 'vertical'\n */\n orientation?: Orientation;\n /**\n * @deprecated Use `orientation` (same values). Still works, warns once in development, and\n * `orientation` wins when both are given.\n */\n direction?: Orientation;\n /**\n * Gap size between stack items.\n * @default 'md'\n */\n gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Cross-axis alignment of items. */\n align?: 'start' | 'center' | 'end' | 'stretch';\n /** Main-axis justification of items. */\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n /** Whether items should wrap to the next line. */\n wrap?: boolean;\n /** Whether to use inline-flex instead of flex. */\n inline?: boolean;\n}\n\n/**\n * Props of {@link Stack} rendered as `C` (default `'div'`). `StackProps` without a type argument\n * is the 0.4 name: the props of a Stack rendered as a `<div>`, including `ref`.\n */\nexport type StackProps<C extends React.ElementType = 'div'> = PolymorphicProps<C, StackOwnProps>;\n\ntype StackImplProps = StackOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * A one-dimensional layout: items stacked vertically (default) or horizontally with a token gap.\n *\n * @example\n * <Stack orientation=\"horizontal\" gap=\"sm\" align=\"center\">\n * <Avatar name=\"Ada\" />\n * <Text>Ada Lovelace</Text>\n * </Stack>\n */\nexport const Stack: PolymorphicComponent<'div', StackOwnProps> = (props) => {\n const {\n as,\n orientation: orientationProp,\n direction,\n gap = 'md',\n align,\n justify,\n wrap,\n inline,\n className,\n children,\n ref,\n ...rest\n } = props as StackImplProps;\n const Component: React.ElementType = as ?? 'div';\n const orientation =\n resolveDeprecatedProp('Stack', orientationProp, direction, 'direction', 'orientation') ??\n 'vertical';\n\n return (\n <Component\n ref={ref}\n className={cn(\n inline ? 'inline-flex' : 'flex',\n orientation === 'horizontal' ? 'flex-row' : 'flex-col',\n gapMap[gap],\n align && alignMap[align],\n justify && justifyMap[justify],\n wrap && 'flex-wrap',\n className,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n};\nStack.displayName = 'Stack';\n"],"mappings":";;;;;;AAMA,IAAMA,IAAS;CACb,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN,GAEMC,IAAW;CACf,OAAO;CACP,QAAQ;CACR,KAAK;CACL,SAAS;AACX,GAEMC,IAAa;CACjB,OAAO;CACP,QAAQ;CACR,KAAK;CACL,SAAS;CACT,QAAQ;CACR,QAAQ;AACV,GAqDaC,KAAqD,MAAU;CAC1E,IAAM,EACJ,OACA,aAAaC,GACb,cACA,SAAM,MACN,UACA,YACA,SACA,WACA,cACA,aACA,QACA,GAAGC,MACDC,GACEC,IAA+BC,KAAM,OACrCC,IACJC,EAAsB,SAASN,GAAiBO,GAAW,aAAa,aAAa,KACrF;CAEF,OACE,kBAACJ,GAAD;EACO;EACL,WAAWK,EACTC,IAAS,gBAAgB,QACzBJ,MAAgB,eAAe,aAAa,YAC5CT,EAAOc,IACPC,KAASd,EAASc,IAClBC,KAAWd,EAAWc,IACtBC,KAAQ,aACRC,CACF;EACA,GAAIb;EAEH;CACQ,CAAA;AAEf;AACA,EAAM,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/composeEventHandlers.cjs"),a=require("../../hooks/useEventCallback.cjs"),o=require("../../hooks/useControllable.cjs"),s=require("../../hooks/useId.cjs"),c=require("../../hooks/useRovingTabIndex.cjs"),l=require("../../hooks/useMergedRefs.cjs"),u=require("../../lib/styles.cjs"),d=require("./disclosureIds.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("react/jsx-runtime");function m(e){r.warnOnce(`TabList:duplicate:${e}`,`TabList: several tabs share the value "${e}". Tab values must be unique within a TabList; tabs with the same value share one id and are selected (and tab stops) together.`)}function h(){let e={tab:new Map,panel:new Map},t=new Set,n=!1,r=()=>{t.forEach(e=>e())};return{register(t,n,i){let a=e[t],o=a.get(n)??[];return t===`tab`&&o.length>0&&m(n),a.set(n,[...o,i]),r(),()=>{let e=[...a.get(n)??[]],t=e.indexOf(i);t!==-1&&e.splice(t,1),e.length>0?a.set(n,e):a.delete(n),r()}},get:(t,r)=>n?e[t].get(r)?.[0]??null:void 0,markReady(){n||(n=!0,r())},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var g={register:()=>()=>{},get:()=>void 0,markReady:()=>{},subscribe:()=>()=>{}},_=f.createContext(null),v={orientation:`horizontal`,isSelected:()=>!1,select:()=>{},getTabIndex:()=>-1,getGeneratedId:(e,t)=>`wave-tablist-inert-${e}-${t}`,getStaticTabId:e=>`wave-tablist-inert-tab-${e}`,getStaticPanelId:()=>void 0,registry:g};function y(e){return f.useContext(_)||(r.reportMissingContext(e,`<TabList>`),v)}function b(e){let t=e[`aria-disabled`];return e.disabled===!0||t===!0||t===`true`}function x(e){return typeof e==`string`&&e!==``?e:null}function S(e,t){if(Array.isArray(e))return e.forEach(e=>S(e,t)),t;if(!f.isValidElement(e))return t;let{props:r}=e,i=n.getElementType(e,{suspend:!1}),a=typeof r.value==`string`?r.value:void 0;if(i===O){if(a!==void 0){t.firstEnabled===void 0&&!b(r)&&(t.firstEnabled=a);let e=x(r.id);e!==null&&t.tabIds.push([a,e])}return t}return i===k?(a!==void 0&&t.panels.push([a,x(r.id)]),t):i===D?t:S(r.children,t)}function C(e,t){if(Array.isArray(e))return e.some(e=>C(e,t));if(!f.isValidElement(e))return!1;let r=n.getElementType(e,{suspend:!1});return r===O?t===`tab`:r===k||r===A?t===`panel`:r!==D&&C(e.props.children,t)}function w(e){return C(e,`panel`)&&!C(e,`tab`)}var T=f.createContext(null),E=`TabList.Panel was rendered inside the role="tablist" element, where only tabs belong (axe aria-required-children). The TabList moves a Panel after the tablist when it is its child, or in a wrapper that holds no Tab, but it cannot see a Panel that a component renders itself, or separate a wrapper's Panels from its Tabs. Place such panels inside TabList.Panels, which renders after the tablist.`,D=({value:e,defaultValue:u,onValueChange:m,orientation:g,selectTabOnFocus:v=!0,selectedValue:y,defaultSelectedValue:b,onTabSelect:x,vertical:C,className:E,children:D,onKeyDown:O,onFocus:k,ref:A,...j})=>{let M=r.resolveDeprecatedProp(`TabList`,e,y,`selectedValue`,`value`),N=r.resolveDeprecatedProp(`TabList`,u,b,`defaultSelectedValue`,`defaultValue`),P=r.resolveDeprecatedProp(`TabList`,g,C===void 0?void 0:C?`vertical`:`horizontal`,`vertical`,`orientation`)??`horizontal`;x&&r.warnDeprecated(`TabList`,`onTabSelect`,`onValueChange`,"`onValueChange` is called only when the selected tab changes.");let[F,I,L]=o.useControllable(M,N??``,m),R=JSON.stringify(S(D,{tabIds:[],panels:[]})),z=f.useMemo(()=>{let e=JSON.parse(R);return{firstEnabled:e.firstEnabled,tabIds:new Map(e.tabIds),panels:new Map(e.panels)}},[R]),B=!L&&F===``,{containerProps:V,getTabIndex:H}=c.useRovingTabIndex({activeValue:B?z.firstEnabled??null:F,orientation:P,loop:!0,onFocusMove:v?e=>W(e):void 0}),U=f.useCallback(e=>B?H(e)===0:F===e,[B,H,F]),W=a.useEventCallback(e=>{x?.(e),U(e)||I(e)}),G=s.useId(`tablist`),[K]=f.useState(h);f.useLayoutEffect(()=>K.markReady(),[K]);let q=f.useMemo(()=>({orientation:P,isSelected:U,select:W,getTabIndex:H,getGeneratedId:(e,t)=>d.getPartId(G,e,t),getStaticTabId:e=>z.tabIds.get(e)??d.getPartId(G,`tab`,e),getStaticPanelId:e=>{let t=z.panels.get(e);if(t!==void 0)return t??d.getPartId(G,`panel`,e)},registry:K}),[P,U,W,H,G,z,K]),J=l.useMergedRefs(A,V.ref),Y=[],X=[];n.flattenChildren(D).forEach(({key:e,node:t})=>{let n=(0,p.jsx)(f.Fragment,{children:t},e);(w(t)?X:Y).push(n)});let Z=P===`vertical`;return(0,p.jsx)(_.Provider,{value:q,children:(0,p.jsxs)(`div`,{className:t.cn(Z&&`flex`),children:[(0,p.jsx)(`div`,{role:`tablist`,"aria-orientation":P,className:t.cn(Z?`flex w-40 flex-col border-e border-border`:`flex border-b border-border`,E),...j,"data-roving-container":``,onKeyDown:i.composeEventHandlers(O,V.onKeyDown),onFocus:i.composeEventHandlers(k,V.onFocus,{checkDefaultPrevented:!1}),ref:J,children:(0,p.jsx)(T.Provider,{value:`tabs`,children:Y})}),(0,p.jsx)(T.Provider,{value:`panels`,children:X})]})})};D.displayName=`TabList`;var O=({value:e,id:n,className:r,children:a,onClick:o,ref:s,...c})=>{let l=y(`TabList.Tab`),d=l.isSelected(e),m=l.orientation===`vertical`,h=b(c),{registry:g}=l,_=x(n)??l.getGeneratedId(`tab`,e);f.useLayoutEffect(()=>g.register(`tab`,e,_),[g,e,_]);let v=f.useSyncExternalStore(g.subscribe,()=>g.get(`panel`,e),()=>void 0),S=v===void 0?l.getStaticPanelId(e):v??void 0;return(0,p.jsx)(`button`,{type:`button`,role:`tab`,className:t.cn(`px-4 py-2 text-body-1 font-semibold transition-colors motion-reduce:transition-none`,m&&`text-start`,d?t.cn(`text-primary`,m?`border-s-2 border-s-primary`:`border-b-2 border-b-primary`):`text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground`,u.disabledStyles,u.focusRingInset,r),...c,id:_,"aria-selected":d,"aria-controls":d?S:void 0,tabIndex:l.getTabIndex(e),"data-roving-value":e,"data-selected":d?``:void 0,onClick:i.composeEventHandlers(o,()=>{h||l.select(e)}),ref:s,children:a})};O.displayName=`Tab`;var k=({value:e,id:n,children:i,className:a,ref:o,...s})=>{let c=y(`TabList.Panel`),l=f.useContext(T)===`tabs`;f.useEffect(()=>{l&&r.warnOnce(`TabList.Panel:inside-tablist`,E)},[l]);let{registry:d}=c,m=x(n)??c.getGeneratedId(`panel`,e);f.useLayoutEffect(()=>d.register(`panel`,e,m),[d,e,m]);let h=f.useSyncExternalStore(d.subscribe,()=>d.get(`tab`,e),()=>void 0);if(!c.isSelected(e))return null;let g=h===void 0?c.getStaticTabId(e):h??void 0;return(0,p.jsx)(`div`,{role:`tabpanel`,tabIndex:0,className:t.cn(`p-4`,u.focusRing,a),...s,id:m,"aria-labelledby":g,ref:o,children:i})};k.displayName=`TabPanel`;var A=({className:e,children:n,ref:r,...i})=>(0,p.jsx)(`div`,{ref:r,className:t.cn(`min-w-0 flex-1`,e),...i,children:n});A.displayName=`TabPanels`;var j=Object.assign(D,{Tab:O,Panel:k,Panels:A});exports.TabList=j,exports.TabListPanel=k,exports.TabListPanels=A,exports.TabListTab=O;
2
+ //# sourceMappingURL=TabList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.cjs","names":["React","getElementType","resolveDeprecatedProp","useControllable","useRovingTabIndex","useEventCallback","useId","getPartId","useMergedRefs","cn","composeEventHandlers","disabledStyles","focusRingInset","focusRing","require_runtime","require_cn","require_children","require_dev","require_composeEventHandlers","require_useEventCallback","require_useControllable","require_useId","require_useRovingTabIndex","require_useMergedRefs","require_styles","require_disclosureIds","react","react_jsx_runtime","warnDuplicateTabValue","value","createRegistry","entries","listeners","ready","emit","listener","map","part","ids","id","index","INERT_REGISTRY","TabListContext","INERT_CONTEXT","useTabListContext","component","isUnavailable","ariaDisabled","props","consumerId","collectStructure","node","child","into","type","Tab","TabPanel","TabListRoot","containsPart","TabPanels","rendersAfterTablist","TabListAreaContext","PANEL_IN_TABLIST_MESSAGE","valueProp","defaultValueProp","orientationProp","rest","selectedValue","defaultValue","defaultSelectedValue","orientation","vertical","onTabSelect","selected","setSelected","isControlled","onValueChange","structureKey","children","structure","parsed","derivesSelection","selectTabOnFocus","select","next","isSelected","getTabIndex","tabValue","baseId","registry","context","itemValue","panel","mergedRef","ref","containerProps","tabs","panels","keyed","key","isVertical","className","onKeyDown","onFocus","idProp","ctx","unavailable","mountedPanelId","panelId","onClick","insideTablist","mountedTabId","tabId","TabList"],"sources":["../../../src/components/layout/TabList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { flattenChildren, getElementType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport {\n reportMissingContext,\n resolveDeprecatedProp,\n warnDeprecated,\n warnOnce,\n} from '../../lib/dev';\nimport { disabledStyles, focusRing, focusRingInset } from '../../lib/styles';\nimport type { Orientation } 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 { getPartId } from './disclosureIds';\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\ntype TabListPart = 'tab' | 'panel';\n\n/**\n * The ids of the mounted Tabs and Panels by value. A Tab references a panel only while one with\n * its value is mounted (a TabList used as a filter bar has none), and each side references the\n * other's actual id, a consumer `id` included. Read with `useSyncExternalStore`.\n *\n * Before the TabList has mounted (server HTML, hydration and the first client render) the\n * registry is not ready and the static structure of the children stands in for it; once it is\n * ready, it alone decides, so a Panel that is in the element tree but never mounts (inside a\n * wrapper that renders nothing) is not referenced.\n */\ninterface TabListRegistry {\n /** Registers a mounted Tab or Panel; returns the unregister function. */\n register: (part: TabListPart, value: string, id: string) => () => void;\n /**\n * Id of the first mounted Tab or Panel with this value, `null` when none is mounted, or\n * `undefined` while the registry is not ready (use the static structure then).\n */\n get: (part: TabListPart, value: string) => string | null | undefined;\n /** Called by the TabList once it (and so every Tab and Panel mounted with it) has mounted. */\n markReady: () => void;\n subscribe: (listener: () => void) => () => void;\n}\n\n/** Tabs that share a value share one id, and are selected and tab stops together. */\nfunction warnDuplicateTabValue(value: string): void {\n warnOnce(\n `TabList:duplicate:${value}`,\n `TabList: several tabs share the value \"${value}\". Tab values must be unique within a ` +\n 'TabList; tabs with the same value share one id and are selected (and tab stops) together.',\n );\n}\n\nfunction createRegistry(): TabListRegistry {\n const entries: Record<TabListPart, Map<string, string[]>> = { tab: new Map(), panel: new Map() };\n const listeners = new Set<() => void>();\n let ready = false;\n const emit = () => {\n listeners.forEach((listener) => listener());\n };\n return {\n register(part, value, id) {\n const map = entries[part];\n const ids = map.get(value) ?? [];\n // Called from the part's layout effect (C-DEV). Two Panels may share a value (the Tab links\n // to the first mounted one); two Tabs may not.\n if (part === 'tab' && ids.length > 0) warnDuplicateTabValue(value);\n map.set(value, [...ids, id]);\n emit();\n return () => {\n const ids = [...(map.get(value) ?? [])];\n const index = ids.indexOf(id);\n if (index !== -1) ids.splice(index, 1);\n if (ids.length > 0) map.set(value, ids);\n else map.delete(value);\n emit();\n };\n },\n get: (part, value) => (ready ? (entries[part].get(value)?.[0] ?? null) : undefined),\n markReady() {\n if (ready) return;\n ready = true;\n emit();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nconst INERT_REGISTRY: TabListRegistry = {\n register: () => () => {},\n get: () => undefined,\n markReady: () => {},\n subscribe: () => () => {},\n};\n\n/**\n * What the TabList's children show before anything mounts (server HTML and the first render):\n * found in the element tree through Fragments and the `children` of wrapper elements, but not\n * inside a component that renders a Tab or Panel itself (the registry covers those once mounted).\n */\ninterface TabListStructure {\n /** Value of the first Tab without `disabled`/`aria-disabled`: the uncontrolled default. */\n firstEnabled?: string;\n /** Consumer `id`s of Tabs, by value. */\n tabIds: Array<[string, string]>;\n /** Values of the Panels, each with its consumer `id` or `null`. */\n panels: Array<[string, string | null]>;\n}\n\ninterface TabListContextValue {\n orientation: Orientation;\n /** Whether the tab with this value is the selected one (explicit value, else the tab stop). */\n isSelected: (value: string) => boolean;\n /**\n * Activates a tab: a click (Enter and Space click the tab button), or with automatic activation\n * focus moved by the keys.\n */\n select: (value: string) => void;\n getTabIndex: (value: string) => 0 | -1;\n /** The generated id of a Tab or Panel (used when it has no consumer `id`). */\n getGeneratedId: (part: TabListPart, value: string) => string;\n /**\n * Id of the Tab with this value before the TabList mounts: its consumer `id`, else the\n * generated one.\n */\n getStaticTabId: (value: string) => string;\n /**\n * Id of the Panel with this value before the TabList mounts, or `undefined` when the children\n * have none.\n */\n getStaticPanelId: (value: string) => string | undefined;\n registry: TabListRegistry;\n}\n\nconst TabListContext = React.createContext<TabListContextValue | null>(null);\n\nconst INERT_CONTEXT: TabListContextValue = {\n orientation: 'horizontal',\n isSelected: () => false,\n select: () => {},\n getTabIndex: () => -1,\n getGeneratedId: (part, value) => `wave-tablist-inert-${part}-${value}`,\n getStaticTabId: (value) => `wave-tablist-inert-tab-${value}`,\n getStaticPanelId: () => undefined,\n registry: INERT_REGISTRY,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nfunction useTabListContext(component: string): TabListContextValue {\n const context = React.useContext(TabListContext);\n if (context) return context;\n reportMissingContext(component, '<TabList>');\n return INERT_CONTEXT;\n}\n\ninterface StructureProps {\n value?: unknown;\n id?: unknown;\n disabled?: unknown;\n 'aria-disabled'?: unknown;\n children?: unknown;\n}\n\n/** Whether a Tab's props make it unavailable (it cannot be selected and is skipped by keys). */\nfunction isUnavailable(props: StructureProps): boolean {\n const ariaDisabled = props['aria-disabled'];\n return props.disabled === true || ariaDisabled === true || ariaDisabled === 'true';\n}\n\n/** A consumer `id` that replaces the generated one: a non-empty string (`''` counts as none). */\nfunction consumerId(id: unknown): string | null {\n return typeof id === 'string' && id !== '' ? id : null;\n}\n\n/**\n * Walks the element tree of the TabList's children (see {@link TabListStructure}). Parts are\n * identified through their element type, so parts written in a Server Component (lazy\n * references) count too. A `React.lazy` still loading (inside the consumer's own `<Suspense>`,\n * such as code-split panels in `TabList.Panels`) is no part and never suspends the TabList: its\n * children are walked instead. Runs during render only.\n */\nfunction collectStructure(node: unknown, into: TabListStructure): TabListStructure {\n if (Array.isArray(node)) {\n node.forEach((child) => collectStructure(child, into));\n return into;\n }\n if (!React.isValidElement<StructureProps>(node)) return into;\n const { props } = node;\n const type = getElementType(node, { suspend: false });\n const value = typeof props.value === 'string' ? props.value : undefined;\n if (type === Tab) {\n if (value !== undefined) {\n if (into.firstEnabled === undefined && !isUnavailable(props)) into.firstEnabled = value;\n const id = consumerId(props.id);\n if (id !== null) into.tabIds.push([value, id]);\n }\n return into;\n }\n if (type === TabPanel) {\n if (value !== undefined) into.panels.push([value, consumerId(props.id)]);\n return into;\n }\n if (type === TabListRoot) return into;\n return collectStructure(props.children, into);\n}\n\n/**\n * Whether an element tree shows a Tab, or a Panel (`TabList.Panel` or `TabList.Panels`), found as\n * in {@link collectStructure}: through Fragments and the `children` of wrapper elements, not inside\n * a nested TabList or a component that renders the part itself.\n */\nfunction containsPart(node: unknown, part: TabListPart): boolean {\n if (Array.isArray(node)) return node.some((child) => containsPart(child, part));\n if (!React.isValidElement<StructureProps>(node)) return false;\n const type = getElementType(node, { suspend: false });\n if (type === Tab) return part === 'tab';\n if (type === TabPanel || type === TabPanels) return part === 'panel';\n if (type === TabListRoot) return false;\n return containsPart(node.props.children, part);\n}\n\n/**\n * Whether a child of the TabList renders after the tablist: a Panel, `TabList.Panels`, or a\n * wrapper (an element, `Suspense`, an error boundary) that holds panels and no tab.\n */\nfunction rendersAfterTablist(child: React.ReactNode): boolean {\n return containsPart(child, 'panel') && !containsPart(child, 'tab');\n}\n\n/**\n * Where the TabList renders its children: inside the `role=\"tablist\"` element (`'tabs'`) or after\n * it (`'panels'`). A Panel that ends up inside the tablist warns in development.\n */\nconst TabListAreaContext = React.createContext<'tabs' | 'panels' | null>(null);\n\nconst PANEL_IN_TABLIST_MESSAGE =\n 'TabList.Panel was rendered inside the role=\"tablist\" element, where only tabs belong (axe ' +\n 'aria-required-children). The TabList moves a Panel after the tablist when it is its child, or ' +\n 'in a wrapper that holds no Tab, but it cannot see a Panel that a component renders itself, or ' +\n \"separate a wrapper's Panels from its Tabs. Place such panels inside TabList.Panels, which \" +\n 'renders after the tablist.';\n\n/* ------------------------------------------------------------------ */\n/* TabList */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabList component. */\nexport interface TabListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n /**\n * Controlled value of the selected tab (`''`: no tab selected). A controlled value that becomes\n * `undefined` also selects no tab: the TabList stays controlled.\n */\n value?: string;\n /**\n * Selected tab for uncontrolled usage. When it is omitted (or `''`), the first enabled tab\n * written in the TabList's children is selected, from the first render (and in server-rendered\n * HTML) on. Tabs written directly in the children, in Fragments or in wrapper elements that\n * pass them as `children` (such as a Tooltip) count; a tab rendered by a custom component that\n * renders `TabList.Tab` itself does not, even when it comes first in the DOM, so that server\n * and client pick the same tab. When every tab comes from such a component, the first enabled\n * tab in the DOM is selected once the tabs mount. To select a tab that a custom component\n * renders, pass `defaultValue`.\n */\n defaultValue?: string;\n /** Called with the new value when the selected tab changes (not when it is activated again). */\n onValueChange?: (value: string) => void;\n /**\n * Layout and arrow-key axis: `'horizontal'` (Left/Right, mirrored in RTL) or `'vertical'`\n * (Up/Down).\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /**\n * Whether moving focus with the arrow keys, Home and End also selects the tab (automatic\n * activation, as in 0.5). With `false`, the keys only move focus and Enter, Space or a click\n * selects the focused tab (manual activation, for panels that are slow to show). Fluent's\n * default is `false`.\n * @default true\n */\n selectTabOnFocus?: boolean;\n /** @deprecated Use `value`. */\n selectedValue?: string;\n /** @deprecated Use `defaultValue`. */\n defaultSelectedValue?: string;\n /**\n * @deprecated Use `onValueChange`. Unlike `onValueChange`, it is called on every activation,\n * including a click on the tab that is already selected.\n */\n onTabSelect?: (value: string) => void;\n /** @deprecated Use `orientation=\"vertical\"`. */\n vertical?: boolean;\n /** Ref to the `role=\"tablist\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst TabListRoot = ({\n value: valueProp,\n defaultValue: defaultValueProp,\n onValueChange,\n orientation: orientationProp,\n selectTabOnFocus = true,\n selectedValue,\n defaultSelectedValue,\n onTabSelect,\n vertical,\n className,\n children,\n onKeyDown,\n onFocus,\n ref,\n ...rest\n}: TabListProps) => {\n const value = resolveDeprecatedProp(\n 'TabList',\n valueProp,\n selectedValue,\n 'selectedValue',\n 'value',\n );\n const defaultValue = resolveDeprecatedProp(\n 'TabList',\n defaultValueProp,\n defaultSelectedValue,\n 'defaultSelectedValue',\n 'defaultValue',\n );\n const orientation =\n resolveDeprecatedProp<Orientation>(\n 'TabList',\n orientationProp,\n vertical === undefined ? undefined : vertical ? 'vertical' : 'horizontal',\n 'vertical',\n 'orientation',\n ) ?? 'horizontal';\n if (onTabSelect) {\n warnDeprecated(\n 'TabList',\n 'onTabSelect',\n 'onValueChange',\n '`onValueChange` is called only when the selected tab changes.',\n );\n }\n\n // The sticky mode: a controlled value that becomes `undefined` clears the selection (`''`).\n const [selected, setSelected, isControlled] = useControllable(\n value,\n defaultValue ?? '',\n onValueChange,\n );\n\n // The children are a new element tree on every parent render: memoized by content, so the\n // context value stays stable while the tabs and panels stay the same.\n const structureKey = JSON.stringify(collectStructure(children, { tabIds: [], panels: [] }));\n const structure = React.useMemo(() => {\n const parsed = JSON.parse(structureKey) as TabListStructure;\n return {\n firstEnabled: parsed.firstEnabled,\n tabIds: new Map(parsed.tabIds),\n panels: new Map(parsed.panels),\n };\n }, [structureKey]);\n\n // Uncontrolled without a selection: the first enabled tab is selected. It is the tab stop the\n // roving store resolves from `activeValue` (the first enabled tab of the children, replaced by\n // the first enabled tab in the DOM once the store sees it disabled), so the selection is\n // derived during render, present from the first render on, and follows tabs that disable\n // themselves.\n const derivesSelection = !isControlled && selected === '';\n\n const { containerProps, getTabIndex } = useRovingTabIndex({\n activeValue: derivesSelection ? (structure.firstEnabled ?? null) : selected,\n orientation,\n loop: true,\n // Automatic activation (APG Tabs): moving focus selects the tab. With manual activation the\n // keys only move focus; the tab stop stays on the selected tab (`tabStop: 'active'`), and Enter\n // or Space selects the focused tab through its native click.\n onFocusMove: selectTabOnFocus ? (next) => select(next) : undefined,\n });\n\n const isSelected = React.useCallback(\n (tabValue: string) => (derivesSelection ? getTabIndex(tabValue) === 0 : selected === tabValue),\n [derivesSelection, getTabIndex, selected],\n );\n\n const select = useEventCallback((next: string) => {\n onTabSelect?.(next);\n if (!isSelected(next)) setSelected(next);\n });\n\n const baseId = useId('tablist');\n const [registry] = React.useState(createRegistry);\n // Runs after the layout effects of the Tabs and Panels mounted with the TabList, which have\n // registered by then: from here on the registry, not the static structure, decides the links.\n React.useLayoutEffect(() => registry.markReady(), [registry]);\n const context = React.useMemo<TabListContextValue>(\n () => ({\n orientation,\n isSelected,\n select,\n getTabIndex,\n getGeneratedId: (part, itemValue) => getPartId(baseId, part, itemValue),\n getStaticTabId: (tabValue) =>\n structure.tabIds.get(tabValue) ?? getPartId(baseId, 'tab', tabValue),\n getStaticPanelId: (tabValue) => {\n const panel = structure.panels.get(tabValue);\n if (panel === undefined) return undefined;\n return panel ?? getPartId(baseId, 'panel', tabValue);\n },\n registry,\n }),\n [orientation, isSelected, select, getTabIndex, baseId, structure, registry],\n );\n\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, containerProps.ref);\n\n const tabs: React.ReactNode[] = [];\n const panels: React.ReactNode[] = [];\n flattenChildren(children).forEach(({ key, node: child }) => {\n const keyed = <React.Fragment key={key}>{child}</React.Fragment>;\n (rendersAfterTablist(child) ? panels : tabs).push(keyed);\n });\n\n const isVertical = orientation === 'vertical';\n return (\n <TabListContext.Provider value={context}>\n <div className={cn(isVertical && 'flex')}>\n <div\n role=\"tablist\"\n aria-orientation={orientation}\n className={cn(\n isVertical\n ? 'flex w-40 flex-col border-e border-border'\n : 'flex border-b border-border',\n className,\n )}\n {...rest}\n data-roving-container=\"\"\n onKeyDown={composeEventHandlers(onKeyDown, containerProps.onKeyDown)}\n onFocus={composeEventHandlers(onFocus, containerProps.onFocus, {\n checkDefaultPrevented: false,\n })}\n ref={mergedRef}\n >\n <TabListAreaContext.Provider value=\"tabs\">{tabs}</TabListAreaContext.Provider>\n </div>\n <TabListAreaContext.Provider value=\"panels\">{panels}</TabListAreaContext.Provider>\n </div>\n </TabListContext.Provider>\n );\n};\nTabListRoot.displayName = 'TabList';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Tab */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the Tab sub-component. */\nexport interface TabProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Unique value identifying this tab (and its panel). */\n value: string;\n /** Ref to the tab `<button>`. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * A tab button. `onClick` runs before the selection (call `event.preventDefault()` to keep the\n * current tab). A `disabled` (or `aria-disabled=\"true\"`) tab is skipped by the keyboard and cannot\n * be selected. A non-empty `id` replaces the generated one (its panel's `aria-labelledby` follows\n * it). The selected tab references its panel with `aria-controls` only while a `TabList.Panel`\n * with its value is mounted.\n */\nconst Tab = ({ value, id: idProp, className, children, onClick, ref, ...rest }: TabProps) => {\n const ctx = useTabListContext('TabList.Tab');\n const selected = ctx.isSelected(value);\n const isVertical = ctx.orientation === 'vertical';\n const unavailable = isUnavailable(rest);\n\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('tab', value);\n React.useLayoutEffect(() => registry.register('tab', value, id), [registry, value, id]);\n const mountedPanelId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('panel', value),\n () => undefined,\n );\n // Before the TabList mounts the static structure stands in; after that only a mounted panel is\n // referenced (`null`: none).\n const panelId =\n mountedPanelId === undefined ? ctx.getStaticPanelId(value) : (mountedPanelId ?? undefined);\n\n return (\n <button\n type=\"button\"\n role=\"tab\"\n className={cn(\n 'px-4 py-2 text-body-1 font-semibold transition-colors motion-reduce:transition-none',\n isVertical && 'text-start',\n selected\n ? cn(\n 'text-primary',\n isVertical ? 'border-s-2 border-s-primary' : 'border-b-2 border-b-primary',\n )\n : 'text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground',\n disabledStyles,\n focusRingInset,\n className,\n )}\n {...rest}\n id={id}\n aria-selected={selected}\n aria-controls={selected ? panelId : undefined}\n tabIndex={ctx.getTabIndex(value)}\n data-roving-value={value}\n data-selected={selected ? '' : undefined}\n onClick={composeEventHandlers(onClick, () => {\n if (!unavailable) ctx.select(value);\n })}\n ref={ref}\n >\n {children}\n </button>\n );\n};\nTab.displayName = 'Tab';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panel */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanel sub-component. */\nexport interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Value of the Tab that shows this panel. */\n value: string;\n /** Ref to the `role=\"tabpanel\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * The content of one tab, rendered only while its tab is selected and labelled by it (while a Tab\n * with its value is mounted). A non-empty `id` replaces the generated one (the tab's\n * `aria-controls` follows it).\n */\nconst TabPanel = ({ value, id: idProp, children, className, ref, ...rest }: TabPanelProps) => {\n const ctx = useTabListContext('TabList.Panel');\n const insideTablist = React.useContext(TabListAreaContext) === 'tabs';\n React.useEffect(() => {\n if (insideTablist) warnOnce('TabList.Panel:inside-tablist', PANEL_IN_TABLIST_MESSAGE);\n }, [insideTablist]);\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('panel', value);\n // Registered while mounted, also while hidden: the tab that selects it links to it.\n React.useLayoutEffect(() => registry.register('panel', value, id), [registry, value, id]);\n const mountedTabId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('tab', value),\n () => undefined,\n );\n if (!ctx.isSelected(value)) return null;\n // As for the Tab's aria-controls: the static structure only before the TabList mounts.\n const tabId =\n mountedTabId === undefined ? ctx.getStaticTabId(value) : (mountedTabId ?? undefined);\n return (\n <div\n role=\"tabpanel\"\n tabIndex={0}\n className={cn('p-4', focusRing, className)}\n {...rest}\n id={id}\n aria-labelledby={tabId}\n ref={ref}\n >\n {children}\n </div>\n );\n};\nTabPanel.displayName = 'TabPanel';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panels */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanels sub-component. */\nexport interface TabPanelsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the container `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * Optional container for the panels, rendered after the tablist. Use it to style the panel area,\n * and for panels that components render themselves: the TabList finds a Panel in its children, in\n * a Fragment or in a wrapper that holds no Tab, but a component that renders a Panel itself\n * renders inside the tablist unless it is placed in `TabList.Panels`.\n */\nconst TabPanels = ({ className, children, ref, ...rest }: TabPanelsProps) => (\n <div ref={ref} className={cn('min-w-0 flex-1', className)} {...rest}>\n {children}\n </div>\n);\nTabPanels.displayName = 'TabPanels';\n\n/* ------------------------------------------------------------------ */\n/* Export */\n/* ------------------------------------------------------------------ */\n\n/**\n * A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored\n * in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with\n * `selectTabOnFocus={false}` they only move focus, and Enter, Space or a click selects the focused\n * tab (manual activation). The selected tab is the only tab stop; disabled tabs are skipped. Every\n * tab needs a `value` that is unique within the TabList (a development warning names a value that\n * several tabs share).\n *\n * Tabs register through context and are found in DOM order, so they may be wrapped (a Fragment,\n * a Tooltip). The children render inside the `role=\"tablist\"` element, except panels, which render\n * after it: a `TabList.Panel` or `TabList.Panels` child, or a wrapper (an element, `Suspense`, an\n * error boundary) that holds panels and no Tab. A Panel that a component renders itself cannot be\n * seen from the children: put that component inside `TabList.Panels` (a development warning names\n * a Panel that ends up inside the tablist). Content that is not a tab, such as a button next to\n * the tabs, does not belong in a tablist either: render it outside the TabList.\n *\n * Sub-components are also exported under flat names (`TabListTab`, `TabListPanel`,\n * `TabListPanels`) for React Server Components, which cannot use the dotted form.\n */\nexport const TabList = /* @__PURE__ */ Object.assign(TabListRoot, {\n Tab,\n Panel: TabPanel,\n Panels: TabPanels,\n});\n\nexport { Tab as TabListTab, TabPanel as TabListPanel, TabPanels as TabListPanels };\n"],"mappings":"4jBAiDA,SAAS4B,EAAsB,EAAqB,CAClDX,EAAA,SACE,qBAAqBY,IACrB,0CAA0CA,EAAM,gIAElD,CACF,CAEA,SAASC,GAAkC,CACzC,IAAMC,EAAsD,CAAE,IAAK,IAAI,IAAO,MAAO,IAAI,GAAM,EACzFC,EAAY,IAAI,IAClBC,EAAQ,GACNC,MAAa,CACjBF,EAAU,QAAS,GAAaG,EAAS,CAAC,CAC5C,EACA,MAAO,CACL,SAAS,EAAM,EAAO,EAAI,CACxB,IAAMC,EAAML,EAAQM,GACdC,EAAMF,EAAI,IAAIP,CAAK,GAAK,CAAC,EAM/B,OAHIQ,IAAS,OAASC,EAAI,OAAS,GAAGV,EAAsBC,CAAK,EACjEO,EAAI,IAAIP,EAAO,CAAC,GAAGS,EAAKC,CAAE,CAAC,EAC3BL,EAAK,MACQ,CACX,IAAMI,EAAM,CAAC,GAAIF,EAAI,IAAIP,CAAK,GAAK,CAAC,CAAE,EAChCW,EAAQF,EAAI,QAAQC,CAAE,EACxBC,IAAU,IAAIF,EAAI,OAAOE,EAAO,CAAC,EAC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AAa,CAChE,MACA,MAAOD,EACP,OAAQG,CACV,CAAC"}
@@ -0,0 +1,238 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { flattenChildren as t, getElementType as n } from "../../lib/children.mjs";
4
+ import { reportMissingContext as r, resolveDeprecatedProp as i, warnDeprecated as a, warnOnce as o } from "../../lib/dev.mjs";
5
+ import { composeEventHandlers as s } from "../../lib/composeEventHandlers.mjs";
6
+ import { useEventCallback as c } from "../../hooks/useEventCallback.mjs";
7
+ import { useControllable as l } from "../../hooks/useControllable.mjs";
8
+ import { useId as u } from "../../hooks/useId.mjs";
9
+ import { useRovingTabIndex as d } from "../../hooks/useRovingTabIndex.mjs";
10
+ import { useMergedRefs as f } from "../../hooks/useMergedRefs.mjs";
11
+ import { disabledStyles as p, focusRing as m, focusRingInset as h } from "../../lib/styles.mjs";
12
+ import { getPartId as g } from "./disclosureIds.mjs";
13
+ import * as _ from "react";
14
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ //#region src/components/layout/TabList.tsx
16
+ function b(e) {
17
+ o(`TabList:duplicate:${e}`, `TabList: several tabs share the value "${e}". Tab values must be unique within a TabList; tabs with the same value share one id and are selected (and tab stops) together.`);
18
+ }
19
+ function x() {
20
+ let e = {
21
+ tab: /* @__PURE__ */ new Map(),
22
+ panel: /* @__PURE__ */ new Map()
23
+ }, t = /* @__PURE__ */ new Set(), n = !1, r = () => {
24
+ t.forEach((e) => e());
25
+ };
26
+ return {
27
+ register(t, n, i) {
28
+ let a = e[t], o = a.get(n) ?? [];
29
+ return t === "tab" && o.length > 0 && b(n), a.set(n, [...o, i]), r(), () => {
30
+ let e = [...a.get(n) ?? []], t = e.indexOf(i);
31
+ t !== -1 && e.splice(t, 1), e.length > 0 ? a.set(n, e) : a.delete(n), r();
32
+ };
33
+ },
34
+ get: (t, r) => n ? e[t].get(r)?.[0] ?? null : void 0,
35
+ markReady() {
36
+ n || (n = !0, r());
37
+ },
38
+ subscribe(e) {
39
+ return t.add(e), () => {
40
+ t.delete(e);
41
+ };
42
+ }
43
+ };
44
+ }
45
+ var S = {
46
+ register: () => () => {},
47
+ get: () => void 0,
48
+ markReady: () => {},
49
+ subscribe: () => () => {}
50
+ }, C = _.createContext(null), w = {
51
+ orientation: "horizontal",
52
+ isSelected: () => !1,
53
+ select: () => {},
54
+ getTabIndex: () => -1,
55
+ getGeneratedId: (e, t) => `wave-tablist-inert-${e}-${t}`,
56
+ getStaticTabId: (e) => `wave-tablist-inert-tab-${e}`,
57
+ getStaticPanelId: () => void 0,
58
+ registry: S
59
+ };
60
+ function T(e) {
61
+ return _.useContext(C) || (r(e, "<TabList>"), w);
62
+ }
63
+ function E(e) {
64
+ let t = e["aria-disabled"];
65
+ return e.disabled === !0 || t === !0 || t === "true";
66
+ }
67
+ function D(e) {
68
+ return typeof e == "string" && e !== "" ? e : null;
69
+ }
70
+ function O(e, t) {
71
+ if (Array.isArray(e)) return e.forEach((e) => O(e, t)), t;
72
+ if (!_.isValidElement(e)) return t;
73
+ let { props: r } = e, i = n(e, { suspend: !1 }), a = typeof r.value == "string" ? r.value : void 0;
74
+ if (i === P) {
75
+ if (a !== void 0) {
76
+ t.firstEnabled === void 0 && !E(r) && (t.firstEnabled = a);
77
+ let e = D(r.id);
78
+ e !== null && t.tabIds.push([a, e]);
79
+ }
80
+ return t;
81
+ }
82
+ return i === F ? (a !== void 0 && t.panels.push([a, D(r.id)]), t) : i === N ? t : O(r.children, t);
83
+ }
84
+ function k(e, t) {
85
+ if (Array.isArray(e)) return e.some((e) => k(e, t));
86
+ if (!_.isValidElement(e)) return !1;
87
+ let r = n(e, { suspend: !1 });
88
+ return r === P ? t === "tab" : r === F || r === I ? t === "panel" : r !== N && k(e.props.children, t);
89
+ }
90
+ function A(e) {
91
+ return k(e, "panel") && !k(e, "tab");
92
+ }
93
+ var j = _.createContext(null), M = "TabList.Panel was rendered inside the role=\"tablist\" element, where only tabs belong (axe aria-required-children). The TabList moves a Panel after the tablist when it is its child, or in a wrapper that holds no Tab, but it cannot see a Panel that a component renders itself, or separate a wrapper's Panels from its Tabs. Place such panels inside TabList.Panels, which renders after the tablist.", N = ({ value: n, defaultValue: r, onValueChange: o, orientation: p, selectTabOnFocus: m = !0, selectedValue: h, defaultSelectedValue: b, onTabSelect: S, vertical: w, className: T, children: E, onKeyDown: D, onFocus: k, ref: M, ...N }) => {
94
+ let P = i("TabList", n, h, "selectedValue", "value"), F = i("TabList", r, b, "defaultSelectedValue", "defaultValue"), I = i("TabList", p, w === void 0 ? void 0 : w ? "vertical" : "horizontal", "vertical", "orientation") ?? "horizontal";
95
+ S && a("TabList", "onTabSelect", "onValueChange", "`onValueChange` is called only when the selected tab changes.");
96
+ let [L, R, z] = l(P, F ?? "", o), B = JSON.stringify(O(E, {
97
+ tabIds: [],
98
+ panels: []
99
+ })), V = _.useMemo(() => {
100
+ let e = JSON.parse(B);
101
+ return {
102
+ firstEnabled: e.firstEnabled,
103
+ tabIds: new Map(e.tabIds),
104
+ panels: new Map(e.panels)
105
+ };
106
+ }, [B]), H = !z && L === "", { containerProps: U, getTabIndex: W } = d({
107
+ activeValue: H ? V.firstEnabled ?? null : L,
108
+ orientation: I,
109
+ loop: !0,
110
+ onFocusMove: m ? (e) => K(e) : void 0
111
+ }), G = _.useCallback((e) => H ? W(e) === 0 : L === e, [
112
+ H,
113
+ W,
114
+ L
115
+ ]), K = c((e) => {
116
+ S?.(e), G(e) || R(e);
117
+ }), q = u("tablist"), [J] = _.useState(x);
118
+ _.useLayoutEffect(() => J.markReady(), [J]);
119
+ let Y = _.useMemo(() => ({
120
+ orientation: I,
121
+ isSelected: G,
122
+ select: K,
123
+ getTabIndex: W,
124
+ getGeneratedId: (e, t) => g(q, e, t),
125
+ getStaticTabId: (e) => V.tabIds.get(e) ?? g(q, "tab", e),
126
+ getStaticPanelId: (e) => {
127
+ let t = V.panels.get(e);
128
+ if (t !== void 0) return t ?? g(q, "panel", e);
129
+ },
130
+ registry: J
131
+ }), [
132
+ I,
133
+ G,
134
+ K,
135
+ W,
136
+ q,
137
+ V,
138
+ J
139
+ ]), X = f(M, U.ref), Z = [], Q = [];
140
+ t(E).forEach(({ key: e, node: t }) => {
141
+ let n = /* @__PURE__ */ v(_.Fragment, { children: t }, e);
142
+ (A(t) ? Q : Z).push(n);
143
+ });
144
+ let $ = I === "vertical";
145
+ return /* @__PURE__ */ v(C.Provider, {
146
+ value: Y,
147
+ children: /* @__PURE__ */ y("div", {
148
+ className: e($ && "flex"),
149
+ children: [/* @__PURE__ */ v("div", {
150
+ role: "tablist",
151
+ "aria-orientation": I,
152
+ className: e($ ? "flex w-40 flex-col border-e border-border" : "flex border-b border-border", T),
153
+ ...N,
154
+ "data-roving-container": "",
155
+ onKeyDown: s(D, U.onKeyDown),
156
+ onFocus: s(k, U.onFocus, { checkDefaultPrevented: !1 }),
157
+ ref: X,
158
+ children: /* @__PURE__ */ v(j.Provider, {
159
+ value: "tabs",
160
+ children: Z
161
+ })
162
+ }), /* @__PURE__ */ v(j.Provider, {
163
+ value: "panels",
164
+ children: Q
165
+ })]
166
+ })
167
+ });
168
+ };
169
+ N.displayName = "TabList";
170
+ var P = ({ value: t, id: n, className: r, children: i, onClick: a, ref: o, ...c }) => {
171
+ let l = T("TabList.Tab"), u = l.isSelected(t), d = l.orientation === "vertical", f = E(c), { registry: m } = l, g = D(n) ?? l.getGeneratedId("tab", t);
172
+ _.useLayoutEffect(() => m.register("tab", t, g), [
173
+ m,
174
+ t,
175
+ g
176
+ ]);
177
+ let y = _.useSyncExternalStore(m.subscribe, () => m.get("panel", t), () => void 0), b = y === void 0 ? l.getStaticPanelId(t) : y ?? void 0;
178
+ return /* @__PURE__ */ v("button", {
179
+ type: "button",
180
+ role: "tab",
181
+ className: e("px-4 py-2 text-body-1 font-semibold transition-colors motion-reduce:transition-none", d && "text-start", u ? e("text-primary", d ? "border-s-2 border-s-primary" : "border-b-2 border-b-primary") : "text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground", p, h, r),
182
+ ...c,
183
+ id: g,
184
+ "aria-selected": u,
185
+ "aria-controls": u ? b : void 0,
186
+ tabIndex: l.getTabIndex(t),
187
+ "data-roving-value": t,
188
+ "data-selected": u ? "" : void 0,
189
+ onClick: s(a, () => {
190
+ f || l.select(t);
191
+ }),
192
+ ref: o,
193
+ children: i
194
+ });
195
+ };
196
+ P.displayName = "Tab";
197
+ var F = ({ value: t, id: n, children: r, className: i, ref: a, ...s }) => {
198
+ let c = T("TabList.Panel"), l = _.useContext(j) === "tabs";
199
+ _.useEffect(() => {
200
+ l && o("TabList.Panel:inside-tablist", M);
201
+ }, [l]);
202
+ let { registry: u } = c, d = D(n) ?? c.getGeneratedId("panel", t);
203
+ _.useLayoutEffect(() => u.register("panel", t, d), [
204
+ u,
205
+ t,
206
+ d
207
+ ]);
208
+ let f = _.useSyncExternalStore(u.subscribe, () => u.get("tab", t), () => void 0);
209
+ if (!c.isSelected(t)) return null;
210
+ let p = f === void 0 ? c.getStaticTabId(t) : f ?? void 0;
211
+ return /* @__PURE__ */ v("div", {
212
+ role: "tabpanel",
213
+ tabIndex: 0,
214
+ className: e("p-4", m, i),
215
+ ...s,
216
+ id: d,
217
+ "aria-labelledby": p,
218
+ ref: a,
219
+ children: r
220
+ });
221
+ };
222
+ F.displayName = "TabPanel";
223
+ var I = ({ className: t, children: n, ref: r, ...i }) => /* @__PURE__ */ v("div", {
224
+ ref: r,
225
+ className: e("min-w-0 flex-1", t),
226
+ ...i,
227
+ children: n
228
+ });
229
+ I.displayName = "TabPanels";
230
+ var L = /* @__PURE__ */ Object.assign(N, {
231
+ Tab: P,
232
+ Panel: F,
233
+ Panels: I
234
+ });
235
+ //#endregion
236
+ export { L as TabList, F as TabListPanel, I as TabListPanels, P as TabListTab };
237
+
238
+ //# sourceMappingURL=TabList.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabList.mjs","names":["useId","useId$1","React","warnDuplicateTabValue","value","createRegistry","entries","listeners","ready","emit","listener","map","part","ids","id","index","INERT_REGISTRY","TabListContext","INERT_CONTEXT","useTabListContext","reportMissingContext","component","isUnavailable","ariaDisabled","props","consumerId","collectStructure","node","child","into","type","getElementType","Tab","TabPanel","TabListRoot","containsPart","TabPanels","rendersAfterTablist","TabListAreaContext","PANEL_IN_TABLIST_MESSAGE","valueProp","defaultValueProp","orientationProp","rest","resolveDeprecatedProp","selectedValue","defaultValue","defaultSelectedValue","orientation","vertical","onTabSelect","warnDeprecated","selected","setSelected","isControlled","useControllable","onValueChange","structureKey","children","structure","parsed","derivesSelection","useRovingTabIndex","selectTabOnFocus","select","next","isSelected","getTabIndex","tabValue","useEventCallback","baseId","registry","context","getPartId","itemValue","panel","mergedRef","useMergedRefs","ref","containerProps","tabs","panels","keyed","key","isVertical","cn","className","composeEventHandlers","onKeyDown","onFocus","idProp","ctx","unavailable","mountedPanelId","panelId","disabledStyles","focusRingInset","onClick","insideTablist","warnOnce","mountedTabId","tabId","focusRing","TabList"],"sources":["../../../src/components/layout/TabList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { flattenChildren, getElementType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport {\n reportMissingContext,\n resolveDeprecatedProp,\n warnDeprecated,\n warnOnce,\n} from '../../lib/dev';\nimport { disabledStyles, focusRing, focusRingInset } from '../../lib/styles';\nimport type { Orientation } 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 { getPartId } from './disclosureIds';\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\ntype TabListPart = 'tab' | 'panel';\n\n/**\n * The ids of the mounted Tabs and Panels by value. A Tab references a panel only while one with\n * its value is mounted (a TabList used as a filter bar has none), and each side references the\n * other's actual id, a consumer `id` included. Read with `useSyncExternalStore`.\n *\n * Before the TabList has mounted (server HTML, hydration and the first client render) the\n * registry is not ready and the static structure of the children stands in for it; once it is\n * ready, it alone decides, so a Panel that is in the element tree but never mounts (inside a\n * wrapper that renders nothing) is not referenced.\n */\ninterface TabListRegistry {\n /** Registers a mounted Tab or Panel; returns the unregister function. */\n register: (part: TabListPart, value: string, id: string) => () => void;\n /**\n * Id of the first mounted Tab or Panel with this value, `null` when none is mounted, or\n * `undefined` while the registry is not ready (use the static structure then).\n */\n get: (part: TabListPart, value: string) => string | null | undefined;\n /** Called by the TabList once it (and so every Tab and Panel mounted with it) has mounted. */\n markReady: () => void;\n subscribe: (listener: () => void) => () => void;\n}\n\n/** Tabs that share a value share one id, and are selected and tab stops together. */\nfunction warnDuplicateTabValue(value: string): void {\n warnOnce(\n `TabList:duplicate:${value}`,\n `TabList: several tabs share the value \"${value}\". Tab values must be unique within a ` +\n 'TabList; tabs with the same value share one id and are selected (and tab stops) together.',\n );\n}\n\nfunction createRegistry(): TabListRegistry {\n const entries: Record<TabListPart, Map<string, string[]>> = { tab: new Map(), panel: new Map() };\n const listeners = new Set<() => void>();\n let ready = false;\n const emit = () => {\n listeners.forEach((listener) => listener());\n };\n return {\n register(part, value, id) {\n const map = entries[part];\n const ids = map.get(value) ?? [];\n // Called from the part's layout effect (C-DEV). Two Panels may share a value (the Tab links\n // to the first mounted one); two Tabs may not.\n if (part === 'tab' && ids.length > 0) warnDuplicateTabValue(value);\n map.set(value, [...ids, id]);\n emit();\n return () => {\n const ids = [...(map.get(value) ?? [])];\n const index = ids.indexOf(id);\n if (index !== -1) ids.splice(index, 1);\n if (ids.length > 0) map.set(value, ids);\n else map.delete(value);\n emit();\n };\n },\n get: (part, value) => (ready ? (entries[part].get(value)?.[0] ?? null) : undefined),\n markReady() {\n if (ready) return;\n ready = true;\n emit();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\nconst INERT_REGISTRY: TabListRegistry = {\n register: () => () => {},\n get: () => undefined,\n markReady: () => {},\n subscribe: () => () => {},\n};\n\n/**\n * What the TabList's children show before anything mounts (server HTML and the first render):\n * found in the element tree through Fragments and the `children` of wrapper elements, but not\n * inside a component that renders a Tab or Panel itself (the registry covers those once mounted).\n */\ninterface TabListStructure {\n /** Value of the first Tab without `disabled`/`aria-disabled`: the uncontrolled default. */\n firstEnabled?: string;\n /** Consumer `id`s of Tabs, by value. */\n tabIds: Array<[string, string]>;\n /** Values of the Panels, each with its consumer `id` or `null`. */\n panels: Array<[string, string | null]>;\n}\n\ninterface TabListContextValue {\n orientation: Orientation;\n /** Whether the tab with this value is the selected one (explicit value, else the tab stop). */\n isSelected: (value: string) => boolean;\n /**\n * Activates a tab: a click (Enter and Space click the tab button), or with automatic activation\n * focus moved by the keys.\n */\n select: (value: string) => void;\n getTabIndex: (value: string) => 0 | -1;\n /** The generated id of a Tab or Panel (used when it has no consumer `id`). */\n getGeneratedId: (part: TabListPart, value: string) => string;\n /**\n * Id of the Tab with this value before the TabList mounts: its consumer `id`, else the\n * generated one.\n */\n getStaticTabId: (value: string) => string;\n /**\n * Id of the Panel with this value before the TabList mounts, or `undefined` when the children\n * have none.\n */\n getStaticPanelId: (value: string) => string | undefined;\n registry: TabListRegistry;\n}\n\nconst TabListContext = React.createContext<TabListContextValue | null>(null);\n\nconst INERT_CONTEXT: TabListContextValue = {\n orientation: 'horizontal',\n isSelected: () => false,\n select: () => {},\n getTabIndex: () => -1,\n getGeneratedId: (part, value) => `wave-tablist-inert-${part}-${value}`,\n getStaticTabId: (value) => `wave-tablist-inert-tab-${value}`,\n getStaticPanelId: () => undefined,\n registry: INERT_REGISTRY,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nfunction useTabListContext(component: string): TabListContextValue {\n const context = React.useContext(TabListContext);\n if (context) return context;\n reportMissingContext(component, '<TabList>');\n return INERT_CONTEXT;\n}\n\ninterface StructureProps {\n value?: unknown;\n id?: unknown;\n disabled?: unknown;\n 'aria-disabled'?: unknown;\n children?: unknown;\n}\n\n/** Whether a Tab's props make it unavailable (it cannot be selected and is skipped by keys). */\nfunction isUnavailable(props: StructureProps): boolean {\n const ariaDisabled = props['aria-disabled'];\n return props.disabled === true || ariaDisabled === true || ariaDisabled === 'true';\n}\n\n/** A consumer `id` that replaces the generated one: a non-empty string (`''` counts as none). */\nfunction consumerId(id: unknown): string | null {\n return typeof id === 'string' && id !== '' ? id : null;\n}\n\n/**\n * Walks the element tree of the TabList's children (see {@link TabListStructure}). Parts are\n * identified through their element type, so parts written in a Server Component (lazy\n * references) count too. A `React.lazy` still loading (inside the consumer's own `<Suspense>`,\n * such as code-split panels in `TabList.Panels`) is no part and never suspends the TabList: its\n * children are walked instead. Runs during render only.\n */\nfunction collectStructure(node: unknown, into: TabListStructure): TabListStructure {\n if (Array.isArray(node)) {\n node.forEach((child) => collectStructure(child, into));\n return into;\n }\n if (!React.isValidElement<StructureProps>(node)) return into;\n const { props } = node;\n const type = getElementType(node, { suspend: false });\n const value = typeof props.value === 'string' ? props.value : undefined;\n if (type === Tab) {\n if (value !== undefined) {\n if (into.firstEnabled === undefined && !isUnavailable(props)) into.firstEnabled = value;\n const id = consumerId(props.id);\n if (id !== null) into.tabIds.push([value, id]);\n }\n return into;\n }\n if (type === TabPanel) {\n if (value !== undefined) into.panels.push([value, consumerId(props.id)]);\n return into;\n }\n if (type === TabListRoot) return into;\n return collectStructure(props.children, into);\n}\n\n/**\n * Whether an element tree shows a Tab, or a Panel (`TabList.Panel` or `TabList.Panels`), found as\n * in {@link collectStructure}: through Fragments and the `children` of wrapper elements, not inside\n * a nested TabList or a component that renders the part itself.\n */\nfunction containsPart(node: unknown, part: TabListPart): boolean {\n if (Array.isArray(node)) return node.some((child) => containsPart(child, part));\n if (!React.isValidElement<StructureProps>(node)) return false;\n const type = getElementType(node, { suspend: false });\n if (type === Tab) return part === 'tab';\n if (type === TabPanel || type === TabPanels) return part === 'panel';\n if (type === TabListRoot) return false;\n return containsPart(node.props.children, part);\n}\n\n/**\n * Whether a child of the TabList renders after the tablist: a Panel, `TabList.Panels`, or a\n * wrapper (an element, `Suspense`, an error boundary) that holds panels and no tab.\n */\nfunction rendersAfterTablist(child: React.ReactNode): boolean {\n return containsPart(child, 'panel') && !containsPart(child, 'tab');\n}\n\n/**\n * Where the TabList renders its children: inside the `role=\"tablist\"` element (`'tabs'`) or after\n * it (`'panels'`). A Panel that ends up inside the tablist warns in development.\n */\nconst TabListAreaContext = React.createContext<'tabs' | 'panels' | null>(null);\n\nconst PANEL_IN_TABLIST_MESSAGE =\n 'TabList.Panel was rendered inside the role=\"tablist\" element, where only tabs belong (axe ' +\n 'aria-required-children). The TabList moves a Panel after the tablist when it is its child, or ' +\n 'in a wrapper that holds no Tab, but it cannot see a Panel that a component renders itself, or ' +\n \"separate a wrapper's Panels from its Tabs. Place such panels inside TabList.Panels, which \" +\n 'renders after the tablist.';\n\n/* ------------------------------------------------------------------ */\n/* TabList */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabList component. */\nexport interface TabListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n /**\n * Controlled value of the selected tab (`''`: no tab selected). A controlled value that becomes\n * `undefined` also selects no tab: the TabList stays controlled.\n */\n value?: string;\n /**\n * Selected tab for uncontrolled usage. When it is omitted (or `''`), the first enabled tab\n * written in the TabList's children is selected, from the first render (and in server-rendered\n * HTML) on. Tabs written directly in the children, in Fragments or in wrapper elements that\n * pass them as `children` (such as a Tooltip) count; a tab rendered by a custom component that\n * renders `TabList.Tab` itself does not, even when it comes first in the DOM, so that server\n * and client pick the same tab. When every tab comes from such a component, the first enabled\n * tab in the DOM is selected once the tabs mount. To select a tab that a custom component\n * renders, pass `defaultValue`.\n */\n defaultValue?: string;\n /** Called with the new value when the selected tab changes (not when it is activated again). */\n onValueChange?: (value: string) => void;\n /**\n * Layout and arrow-key axis: `'horizontal'` (Left/Right, mirrored in RTL) or `'vertical'`\n * (Up/Down).\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /**\n * Whether moving focus with the arrow keys, Home and End also selects the tab (automatic\n * activation, as in 0.5). With `false`, the keys only move focus and Enter, Space or a click\n * selects the focused tab (manual activation, for panels that are slow to show). Fluent's\n * default is `false`.\n * @default true\n */\n selectTabOnFocus?: boolean;\n /** @deprecated Use `value`. */\n selectedValue?: string;\n /** @deprecated Use `defaultValue`. */\n defaultSelectedValue?: string;\n /**\n * @deprecated Use `onValueChange`. Unlike `onValueChange`, it is called on every activation,\n * including a click on the tab that is already selected.\n */\n onTabSelect?: (value: string) => void;\n /** @deprecated Use `orientation=\"vertical\"`. */\n vertical?: boolean;\n /** Ref to the `role=\"tablist\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst TabListRoot = ({\n value: valueProp,\n defaultValue: defaultValueProp,\n onValueChange,\n orientation: orientationProp,\n selectTabOnFocus = true,\n selectedValue,\n defaultSelectedValue,\n onTabSelect,\n vertical,\n className,\n children,\n onKeyDown,\n onFocus,\n ref,\n ...rest\n}: TabListProps) => {\n const value = resolveDeprecatedProp(\n 'TabList',\n valueProp,\n selectedValue,\n 'selectedValue',\n 'value',\n );\n const defaultValue = resolveDeprecatedProp(\n 'TabList',\n defaultValueProp,\n defaultSelectedValue,\n 'defaultSelectedValue',\n 'defaultValue',\n );\n const orientation =\n resolveDeprecatedProp<Orientation>(\n 'TabList',\n orientationProp,\n vertical === undefined ? undefined : vertical ? 'vertical' : 'horizontal',\n 'vertical',\n 'orientation',\n ) ?? 'horizontal';\n if (onTabSelect) {\n warnDeprecated(\n 'TabList',\n 'onTabSelect',\n 'onValueChange',\n '`onValueChange` is called only when the selected tab changes.',\n );\n }\n\n // The sticky mode: a controlled value that becomes `undefined` clears the selection (`''`).\n const [selected, setSelected, isControlled] = useControllable(\n value,\n defaultValue ?? '',\n onValueChange,\n );\n\n // The children are a new element tree on every parent render: memoized by content, so the\n // context value stays stable while the tabs and panels stay the same.\n const structureKey = JSON.stringify(collectStructure(children, { tabIds: [], panels: [] }));\n const structure = React.useMemo(() => {\n const parsed = JSON.parse(structureKey) as TabListStructure;\n return {\n firstEnabled: parsed.firstEnabled,\n tabIds: new Map(parsed.tabIds),\n panels: new Map(parsed.panels),\n };\n }, [structureKey]);\n\n // Uncontrolled without a selection: the first enabled tab is selected. It is the tab stop the\n // roving store resolves from `activeValue` (the first enabled tab of the children, replaced by\n // the first enabled tab in the DOM once the store sees it disabled), so the selection is\n // derived during render, present from the first render on, and follows tabs that disable\n // themselves.\n const derivesSelection = !isControlled && selected === '';\n\n const { containerProps, getTabIndex } = useRovingTabIndex({\n activeValue: derivesSelection ? (structure.firstEnabled ?? null) : selected,\n orientation,\n loop: true,\n // Automatic activation (APG Tabs): moving focus selects the tab. With manual activation the\n // keys only move focus; the tab stop stays on the selected tab (`tabStop: 'active'`), and Enter\n // or Space selects the focused tab through its native click.\n onFocusMove: selectTabOnFocus ? (next) => select(next) : undefined,\n });\n\n const isSelected = React.useCallback(\n (tabValue: string) => (derivesSelection ? getTabIndex(tabValue) === 0 : selected === tabValue),\n [derivesSelection, getTabIndex, selected],\n );\n\n const select = useEventCallback((next: string) => {\n onTabSelect?.(next);\n if (!isSelected(next)) setSelected(next);\n });\n\n const baseId = useId('tablist');\n const [registry] = React.useState(createRegistry);\n // Runs after the layout effects of the Tabs and Panels mounted with the TabList, which have\n // registered by then: from here on the registry, not the static structure, decides the links.\n React.useLayoutEffect(() => registry.markReady(), [registry]);\n const context = React.useMemo<TabListContextValue>(\n () => ({\n orientation,\n isSelected,\n select,\n getTabIndex,\n getGeneratedId: (part, itemValue) => getPartId(baseId, part, itemValue),\n getStaticTabId: (tabValue) =>\n structure.tabIds.get(tabValue) ?? getPartId(baseId, 'tab', tabValue),\n getStaticPanelId: (tabValue) => {\n const panel = structure.panels.get(tabValue);\n if (panel === undefined) return undefined;\n return panel ?? getPartId(baseId, 'panel', tabValue);\n },\n registry,\n }),\n [orientation, isSelected, select, getTabIndex, baseId, structure, registry],\n );\n\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, containerProps.ref);\n\n const tabs: React.ReactNode[] = [];\n const panels: React.ReactNode[] = [];\n flattenChildren(children).forEach(({ key, node: child }) => {\n const keyed = <React.Fragment key={key}>{child}</React.Fragment>;\n (rendersAfterTablist(child) ? panels : tabs).push(keyed);\n });\n\n const isVertical = orientation === 'vertical';\n return (\n <TabListContext.Provider value={context}>\n <div className={cn(isVertical && 'flex')}>\n <div\n role=\"tablist\"\n aria-orientation={orientation}\n className={cn(\n isVertical\n ? 'flex w-40 flex-col border-e border-border'\n : 'flex border-b border-border',\n className,\n )}\n {...rest}\n data-roving-container=\"\"\n onKeyDown={composeEventHandlers(onKeyDown, containerProps.onKeyDown)}\n onFocus={composeEventHandlers(onFocus, containerProps.onFocus, {\n checkDefaultPrevented: false,\n })}\n ref={mergedRef}\n >\n <TabListAreaContext.Provider value=\"tabs\">{tabs}</TabListAreaContext.Provider>\n </div>\n <TabListAreaContext.Provider value=\"panels\">{panels}</TabListAreaContext.Provider>\n </div>\n </TabListContext.Provider>\n );\n};\nTabListRoot.displayName = 'TabList';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Tab */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the Tab sub-component. */\nexport interface TabProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Unique value identifying this tab (and its panel). */\n value: string;\n /** Ref to the tab `<button>`. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * A tab button. `onClick` runs before the selection (call `event.preventDefault()` to keep the\n * current tab). A `disabled` (or `aria-disabled=\"true\"`) tab is skipped by the keyboard and cannot\n * be selected. A non-empty `id` replaces the generated one (its panel's `aria-labelledby` follows\n * it). The selected tab references its panel with `aria-controls` only while a `TabList.Panel`\n * with its value is mounted.\n */\nconst Tab = ({ value, id: idProp, className, children, onClick, ref, ...rest }: TabProps) => {\n const ctx = useTabListContext('TabList.Tab');\n const selected = ctx.isSelected(value);\n const isVertical = ctx.orientation === 'vertical';\n const unavailable = isUnavailable(rest);\n\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('tab', value);\n React.useLayoutEffect(() => registry.register('tab', value, id), [registry, value, id]);\n const mountedPanelId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('panel', value),\n () => undefined,\n );\n // Before the TabList mounts the static structure stands in; after that only a mounted panel is\n // referenced (`null`: none).\n const panelId =\n mountedPanelId === undefined ? ctx.getStaticPanelId(value) : (mountedPanelId ?? undefined);\n\n return (\n <button\n type=\"button\"\n role=\"tab\"\n className={cn(\n 'px-4 py-2 text-body-1 font-semibold transition-colors motion-reduce:transition-none',\n isVertical && 'text-start',\n selected\n ? cn(\n 'text-primary',\n isVertical ? 'border-s-2 border-s-primary' : 'border-b-2 border-b-primary',\n )\n : 'text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground',\n disabledStyles,\n focusRingInset,\n className,\n )}\n {...rest}\n id={id}\n aria-selected={selected}\n aria-controls={selected ? panelId : undefined}\n tabIndex={ctx.getTabIndex(value)}\n data-roving-value={value}\n data-selected={selected ? '' : undefined}\n onClick={composeEventHandlers(onClick, () => {\n if (!unavailable) ctx.select(value);\n })}\n ref={ref}\n >\n {children}\n </button>\n );\n};\nTab.displayName = 'Tab';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panel */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanel sub-component. */\nexport interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Value of the Tab that shows this panel. */\n value: string;\n /** Ref to the `role=\"tabpanel\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * The content of one tab, rendered only while its tab is selected and labelled by it (while a Tab\n * with its value is mounted). A non-empty `id` replaces the generated one (the tab's\n * `aria-controls` follows it).\n */\nconst TabPanel = ({ value, id: idProp, children, className, ref, ...rest }: TabPanelProps) => {\n const ctx = useTabListContext('TabList.Panel');\n const insideTablist = React.useContext(TabListAreaContext) === 'tabs';\n React.useEffect(() => {\n if (insideTablist) warnOnce('TabList.Panel:inside-tablist', PANEL_IN_TABLIST_MESSAGE);\n }, [insideTablist]);\n const { registry } = ctx;\n const id = consumerId(idProp) ?? ctx.getGeneratedId('panel', value);\n // Registered while mounted, also while hidden: the tab that selects it links to it.\n React.useLayoutEffect(() => registry.register('panel', value, id), [registry, value, id]);\n const mountedTabId = React.useSyncExternalStore(\n registry.subscribe,\n () => registry.get('tab', value),\n () => undefined,\n );\n if (!ctx.isSelected(value)) return null;\n // As for the Tab's aria-controls: the static structure only before the TabList mounts.\n const tabId =\n mountedTabId === undefined ? ctx.getStaticTabId(value) : (mountedTabId ?? undefined);\n return (\n <div\n role=\"tabpanel\"\n tabIndex={0}\n className={cn('p-4', focusRing, className)}\n {...rest}\n id={id}\n aria-labelledby={tabId}\n ref={ref}\n >\n {children}\n </div>\n );\n};\nTabPanel.displayName = 'TabPanel';\n\n/* ------------------------------------------------------------------ */\n/* TabList.Panels */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TabPanels sub-component. */\nexport interface TabPanelsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the container `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * Optional container for the panels, rendered after the tablist. Use it to style the panel area,\n * and for panels that components render themselves: the TabList finds a Panel in its children, in\n * a Fragment or in a wrapper that holds no Tab, but a component that renders a Panel itself\n * renders inside the tablist unless it is placed in `TabList.Panels`.\n */\nconst TabPanels = ({ className, children, ref, ...rest }: TabPanelsProps) => (\n <div ref={ref} className={cn('min-w-0 flex-1', className)} {...rest}>\n {children}\n </div>\n);\nTabPanels.displayName = 'TabPanels';\n\n/* ------------------------------------------------------------------ */\n/* Export */\n/* ------------------------------------------------------------------ */\n\n/**\n * A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored\n * in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with\n * `selectTabOnFocus={false}` they only move focus, and Enter, Space or a click selects the focused\n * tab (manual activation). The selected tab is the only tab stop; disabled tabs are skipped. Every\n * tab needs a `value` that is unique within the TabList (a development warning names a value that\n * several tabs share).\n *\n * Tabs register through context and are found in DOM order, so they may be wrapped (a Fragment,\n * a Tooltip). The children render inside the `role=\"tablist\"` element, except panels, which render\n * after it: a `TabList.Panel` or `TabList.Panels` child, or a wrapper (an element, `Suspense`, an\n * error boundary) that holds panels and no Tab. A Panel that a component renders itself cannot be\n * seen from the children: put that component inside `TabList.Panels` (a development warning names\n * a Panel that ends up inside the tablist). Content that is not a tab, such as a button next to\n * the tabs, does not belong in a tablist either: render it outside the TabList.\n *\n * Sub-components are also exported under flat names (`TabListTab`, `TabListPanel`,\n * `TabListPanels`) for React Server Components, which cannot use the dotted form.\n */\nexport const TabList = /* @__PURE__ */ Object.assign(TabListRoot, {\n Tab,\n Panel: TabPanel,\n Panels: TabPanels,\n});\n\nexport { Tab as TabListTab, TabPanel as TabListPanel, TabPanels as TabListPanels };\n"],"mappings":";;;;;;;;;;;;;;;AAiDA,SAASG,EAAsB,GAAqB;CAClD,EACE,qBAAqBC,KACrB,0CAA0CA,EAAM,gIAElD;AACF;AAEA,SAASC,IAAkC;CACzC,IAAMC,IAAsD;EAAE,qBAAK,IAAI,IAAI;EAAG,uBAAO,IAAI,IAAI;CAAE,GACzFC,oBAAY,IAAI,IAAgB,GAClCC,IAAQ,IACNC,UAAa;EACjB,EAAU,SAAS,MAAaC,EAAS,CAAC;CAC5C;CACA,OAAO;EACL,SAAS,GAAM,GAAO,GAAI;GACxB,IAAMC,IAAML,EAAQM,IACdC,IAAMF,EAAI,IAAIP,CAAK,KAAK,CAAC;GAM/B,OAHIQ,MAAS,SAASC,EAAI,SAAS,KAAGV,EAAsBC,CAAK,GACjEO,EAAI,IAAIP,GAAO,CAAC,GAAGS,GAAKC,CAAE,CAAC,GAC3BL,EAAK,SACQ;IACX,IAAMI,IAAM,CAAC,GAAIF,EAAI,IAAIP,CAAK,KAAK,CAAC,CAAE,GACh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