@mortenbrudvik/waveui 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/README.md +564 -155
  2. package/dist/components/button/Button.cjs +1 -1
  3. package/dist/components/button/Button.cjs.map +1 -1
  4. package/dist/components/button/Button.mjs +36 -35
  5. package/dist/components/button/Button.mjs.map +1 -1
  6. package/dist/components/button/Button.slots.cjs +1 -1
  7. package/dist/components/button/Button.slots.cjs.map +1 -1
  8. package/dist/components/button/Button.slots.mjs +31 -21
  9. package/dist/components/button/Button.slots.mjs.map +1 -1
  10. package/dist/components/button/CompoundButton.cjs +1 -1
  11. package/dist/components/button/CompoundButton.cjs.map +1 -1
  12. package/dist/components/button/CompoundButton.mjs +31 -29
  13. package/dist/components/button/CompoundButton.mjs.map +1 -1
  14. package/dist/components/button/Link.cjs +1 -1
  15. package/dist/components/button/Link.cjs.map +1 -1
  16. package/dist/components/button/Link.mjs +24 -23
  17. package/dist/components/button/Link.mjs.map +1 -1
  18. package/dist/components/button/MenuButton.cjs +1 -1
  19. package/dist/components/button/MenuButton.cjs.map +1 -1
  20. package/dist/components/button/MenuButton.mjs +29 -28
  21. package/dist/components/button/MenuButton.mjs.map +1 -1
  22. package/dist/components/button/SplitButton.cjs +1 -1
  23. package/dist/components/button/SplitButton.cjs.map +1 -1
  24. package/dist/components/button/SplitButton.mjs +46 -45
  25. package/dist/components/button/SplitButton.mjs.map +1 -1
  26. package/dist/components/button/ToggleButton.cjs +1 -1
  27. package/dist/components/button/ToggleButton.cjs.map +1 -1
  28. package/dist/components/button/ToggleButton.mjs +38 -35
  29. package/dist/components/button/ToggleButton.mjs.map +1 -1
  30. package/dist/components/button/Toolbar.cjs +1 -1
  31. package/dist/components/button/Toolbar.cjs.map +1 -1
  32. package/dist/components/button/Toolbar.mjs +43 -42
  33. package/dist/components/button/Toolbar.mjs.map +1 -1
  34. package/dist/components/button/Toolbar.parts.cjs +1 -1
  35. package/dist/components/button/Toolbar.parts.cjs.map +1 -1
  36. package/dist/components/button/Toolbar.parts.mjs +76 -81
  37. package/dist/components/button/Toolbar.parts.mjs.map +1 -1
  38. package/dist/components/data-display/Avatar.cjs +1 -1
  39. package/dist/components/data-display/Avatar.cjs.map +1 -1
  40. package/dist/components/data-display/Avatar.mjs +72 -67
  41. package/dist/components/data-display/Avatar.mjs.map +1 -1
  42. package/dist/components/data-display/AvatarGroup.cjs +1 -1
  43. package/dist/components/data-display/AvatarGroup.cjs.map +1 -1
  44. package/dist/components/data-display/AvatarGroup.mjs +89 -88
  45. package/dist/components/data-display/AvatarGroup.mjs.map +1 -1
  46. package/dist/components/data-display/Badge.cjs +1 -1
  47. package/dist/components/data-display/Badge.cjs.map +1 -1
  48. package/dist/components/data-display/Badge.mjs +17 -16
  49. package/dist/components/data-display/Badge.mjs.map +1 -1
  50. package/dist/components/data-display/CounterBadge.cjs +1 -1
  51. package/dist/components/data-display/CounterBadge.cjs.map +1 -1
  52. package/dist/components/data-display/CounterBadge.mjs +18 -17
  53. package/dist/components/data-display/CounterBadge.mjs.map +1 -1
  54. package/dist/components/data-display/Divider.cjs +1 -1
  55. package/dist/components/data-display/Divider.cjs.map +1 -1
  56. package/dist/components/data-display/Divider.mjs +31 -30
  57. package/dist/components/data-display/Divider.mjs.map +1 -1
  58. package/dist/components/data-display/Image.cjs +1 -1
  59. package/dist/components/data-display/Image.cjs.map +1 -1
  60. package/dist/components/data-display/Image.mjs +16 -15
  61. package/dist/components/data-display/Image.mjs.map +1 -1
  62. package/dist/components/data-display/InfoButton.cjs +2 -0
  63. package/dist/components/data-display/InfoButton.cjs.map +1 -0
  64. package/dist/components/data-display/InfoButton.mjs +173 -0
  65. package/dist/components/data-display/InfoButton.mjs.map +1 -0
  66. package/dist/components/data-display/InfoLabel.cjs +1 -1
  67. package/dist/components/data-display/InfoLabel.cjs.map +1 -1
  68. package/dist/components/data-display/InfoLabel.mjs +36 -92
  69. package/dist/components/data-display/InfoLabel.mjs.map +1 -1
  70. package/dist/components/data-display/List.cjs +1 -1
  71. package/dist/components/data-display/List.cjs.map +1 -1
  72. package/dist/components/data-display/List.mjs +175 -174
  73. package/dist/components/data-display/List.mjs.map +1 -1
  74. package/dist/components/data-display/Persona.cjs +1 -1
  75. package/dist/components/data-display/Persona.cjs.map +1 -1
  76. package/dist/components/data-display/Persona.mjs +31 -29
  77. package/dist/components/data-display/Persona.mjs.map +1 -1
  78. package/dist/components/data-display/PresenceBadge.cjs +1 -1
  79. package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
  80. package/dist/components/data-display/PresenceBadge.mjs +25 -24
  81. package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
  82. package/dist/components/data-display/Tag.cjs +1 -1
  83. package/dist/components/data-display/Tag.cjs.map +1 -1
  84. package/dist/components/data-display/Tag.mjs +87 -82
  85. package/dist/components/data-display/Tag.mjs.map +1 -1
  86. package/dist/components/feedback/MessageBar.cjs +1 -1
  87. package/dist/components/feedback/MessageBar.cjs.map +1 -1
  88. package/dist/components/feedback/MessageBar.mjs +129 -71
  89. package/dist/components/feedback/MessageBar.mjs.map +1 -1
  90. package/dist/components/feedback/MessageBar.parts.cjs +2 -0
  91. package/dist/components/feedback/MessageBar.parts.cjs.map +1 -0
  92. package/dist/components/feedback/MessageBar.parts.mjs +84 -0
  93. package/dist/components/feedback/MessageBar.parts.mjs.map +1 -0
  94. package/dist/components/feedback/MessageBar.reflow.cjs +2 -0
  95. package/dist/components/feedback/MessageBar.reflow.cjs.map +1 -0
  96. package/dist/components/feedback/MessageBar.reflow.mjs +74 -0
  97. package/dist/components/feedback/MessageBar.reflow.mjs.map +1 -0
  98. package/dist/components/feedback/MessageBar.status.cjs +1 -1
  99. package/dist/components/feedback/MessageBar.status.cjs.map +1 -1
  100. package/dist/components/feedback/MessageBar.status.mjs +2 -1
  101. package/dist/components/feedback/MessageBar.status.mjs.map +1 -1
  102. package/dist/components/feedback/ProgressBar.cjs +1 -1
  103. package/dist/components/feedback/ProgressBar.cjs.map +1 -1
  104. package/dist/components/feedback/ProgressBar.mjs +44 -43
  105. package/dist/components/feedback/ProgressBar.mjs.map +1 -1
  106. package/dist/components/feedback/Skeleton.cjs +1 -1
  107. package/dist/components/feedback/Skeleton.cjs.map +1 -1
  108. package/dist/components/feedback/Skeleton.mjs +26 -24
  109. package/dist/components/feedback/Skeleton.mjs.map +1 -1
  110. package/dist/components/feedback/Spinner.cjs +1 -1
  111. package/dist/components/feedback/Spinner.cjs.map +1 -1
  112. package/dist/components/feedback/Spinner.mjs +32 -31
  113. package/dist/components/feedback/Spinner.mjs.map +1 -1
  114. package/dist/components/feedback/Toast.cjs +1 -1
  115. package/dist/components/feedback/Toast.cjs.map +1 -1
  116. package/dist/components/feedback/Toast.context.cjs +2 -0
  117. package/dist/components/feedback/Toast.context.cjs.map +1 -0
  118. package/dist/components/feedback/Toast.context.mjs +23 -0
  119. package/dist/components/feedback/Toast.context.mjs.map +1 -0
  120. package/dist/components/feedback/Toast.mjs +10 -342
  121. package/dist/components/feedback/Toast.mjs.map +1 -1
  122. package/dist/components/feedback/Toast.parts.cjs +2 -0
  123. package/dist/components/feedback/Toast.parts.cjs.map +1 -0
  124. package/dist/components/feedback/Toast.parts.mjs +98 -0
  125. package/dist/components/feedback/Toast.parts.mjs.map +1 -0
  126. package/dist/components/feedback/Toast.root.cjs +2 -0
  127. package/dist/components/feedback/Toast.root.cjs.map +1 -0
  128. package/dist/components/feedback/Toast.root.mjs +109 -0
  129. package/dist/components/feedback/Toast.root.mjs.map +1 -0
  130. package/dist/components/feedback/Toaster.cjs +2 -0
  131. package/dist/components/feedback/Toaster.cjs.map +1 -0
  132. package/dist/components/feedback/Toaster.mjs +564 -0
  133. package/dist/components/feedback/Toaster.mjs.map +1 -0
  134. package/dist/components/input/AlphaSlider.cjs +2 -0
  135. package/dist/components/input/AlphaSlider.cjs.map +1 -0
  136. package/dist/components/input/AlphaSlider.mjs +115 -0
  137. package/dist/components/input/AlphaSlider.mjs.map +1 -0
  138. package/dist/components/input/Checkbox.cjs +1 -1
  139. package/dist/components/input/Checkbox.cjs.map +1 -1
  140. package/dist/components/input/Checkbox.mjs +87 -70
  141. package/dist/components/input/Checkbox.mjs.map +1 -1
  142. package/dist/components/input/ColorArea.cjs +2 -0
  143. package/dist/components/input/ColorArea.cjs.map +1 -0
  144. package/dist/components/input/ColorArea.mjs +204 -0
  145. package/dist/components/input/ColorArea.mjs.map +1 -0
  146. package/dist/components/input/ColorPicker.cjs +5 -5
  147. package/dist/components/input/ColorPicker.cjs.map +1 -1
  148. package/dist/components/input/ColorPicker.mjs +142 -165
  149. package/dist/components/input/ColorPicker.mjs.map +1 -1
  150. package/dist/components/input/ColorPicker.parts.cjs +2 -0
  151. package/dist/components/input/ColorPicker.parts.cjs.map +1 -0
  152. package/dist/components/input/ColorPicker.parts.mjs +192 -0
  153. package/dist/components/input/ColorPicker.parts.mjs.map +1 -0
  154. package/dist/components/input/ColorSlider.cjs +2 -0
  155. package/dist/components/input/ColorSlider.cjs.map +1 -0
  156. package/dist/components/input/ColorSlider.mjs +138 -0
  157. package/dist/components/input/ColorSlider.mjs.map +1 -0
  158. package/dist/components/input/Combobox.cjs +1 -1
  159. package/dist/components/input/Combobox.cjs.map +1 -1
  160. package/dist/components/input/Combobox.expand.cjs +1 -1
  161. package/dist/components/input/Combobox.expand.cjs.map +1 -1
  162. package/dist/components/input/Combobox.expand.mjs +22 -22
  163. package/dist/components/input/Combobox.expand.mjs.map +1 -1
  164. package/dist/components/input/Combobox.mjs +151 -141
  165. package/dist/components/input/Combobox.mjs.map +1 -1
  166. package/dist/components/input/DatePicker.cjs +1 -1
  167. package/dist/components/input/DatePicker.cjs.map +1 -1
  168. package/dist/components/input/DatePicker.mjs +239 -234
  169. package/dist/components/input/DatePicker.mjs.map +1 -1
  170. package/dist/components/input/Dropdown.cjs +1 -1
  171. package/dist/components/input/Dropdown.cjs.map +1 -1
  172. package/dist/components/input/Dropdown.mjs +109 -100
  173. package/dist/components/input/Dropdown.mjs.map +1 -1
  174. package/dist/components/input/Field.cjs +1 -1
  175. package/dist/components/input/Field.cjs.map +1 -1
  176. package/dist/components/input/Field.mjs +139 -105
  177. package/dist/components/input/Field.mjs.map +1 -1
  178. package/dist/components/input/Input.cjs +1 -1
  179. package/dist/components/input/Input.cjs.map +1 -1
  180. package/dist/components/input/Input.mjs +80 -55
  181. package/dist/components/input/Input.mjs.map +1 -1
  182. package/dist/components/input/Label.cjs +1 -1
  183. package/dist/components/input/Label.cjs.map +1 -1
  184. package/dist/components/input/Label.mjs +19 -12
  185. package/dist/components/input/Label.mjs.map +1 -1
  186. package/dist/components/input/Option.cjs +1 -1
  187. package/dist/components/input/Option.cjs.map +1 -1
  188. package/dist/components/input/Option.mjs +100 -98
  189. package/dist/components/input/Option.mjs.map +1 -1
  190. package/dist/components/input/RadioGroup.cjs +1 -1
  191. package/dist/components/input/RadioGroup.cjs.map +1 -1
  192. package/dist/components/input/RadioGroup.mjs +89 -88
  193. package/dist/components/input/RadioGroup.mjs.map +1 -1
  194. package/dist/components/input/Rating.cjs +1 -1
  195. package/dist/components/input/Rating.cjs.map +1 -1
  196. package/dist/components/input/Rating.item.cjs +2 -0
  197. package/dist/components/input/Rating.item.cjs.map +1 -0
  198. package/dist/components/input/Rating.item.mjs +255 -0
  199. package/dist/components/input/Rating.item.mjs.map +1 -0
  200. package/dist/components/input/Rating.mjs +152 -152
  201. package/dist/components/input/Rating.mjs.map +1 -1
  202. package/dist/components/input/SearchBox.cjs +1 -1
  203. package/dist/components/input/SearchBox.cjs.map +1 -1
  204. package/dist/components/input/SearchBox.mjs +162 -132
  205. package/dist/components/input/SearchBox.mjs.map +1 -1
  206. package/dist/components/input/Select.cjs +1 -1
  207. package/dist/components/input/Select.cjs.map +1 -1
  208. package/dist/components/input/Select.mjs +34 -24
  209. package/dist/components/input/Select.mjs.map +1 -1
  210. package/dist/components/input/Slider.cjs +1 -1
  211. package/dist/components/input/Slider.cjs.map +1 -1
  212. package/dist/components/input/Slider.mjs +78 -54
  213. package/dist/components/input/Slider.mjs.map +1 -1
  214. package/dist/components/input/SpinButton.cjs +1 -1
  215. package/dist/components/input/SpinButton.cjs.map +1 -1
  216. package/dist/components/input/SpinButton.mjs +202 -99
  217. package/dist/components/input/SpinButton.mjs.map +1 -1
  218. package/dist/components/input/SwatchPicker.cjs +1 -1
  219. package/dist/components/input/SwatchPicker.cjs.map +1 -1
  220. package/dist/components/input/SwatchPicker.mjs +38 -37
  221. package/dist/components/input/SwatchPicker.mjs.map +1 -1
  222. package/dist/components/input/Switch.cjs +1 -1
  223. package/dist/components/input/Switch.cjs.map +1 -1
  224. package/dist/components/input/Switch.mjs +75 -58
  225. package/dist/components/input/Switch.mjs.map +1 -1
  226. package/dist/components/input/TagPicker.cjs +1 -1
  227. package/dist/components/input/TagPicker.cjs.map +1 -1
  228. package/dist/components/input/TagPicker.mjs +199 -169
  229. package/dist/components/input/TagPicker.mjs.map +1 -1
  230. package/dist/components/input/Textarea.cjs +1 -1
  231. package/dist/components/input/Textarea.cjs.map +1 -1
  232. package/dist/components/input/Textarea.mjs +31 -23
  233. package/dist/components/input/Textarea.mjs.map +1 -1
  234. package/dist/components/input/TimePicker.cjs +1 -1
  235. package/dist/components/input/TimePicker.cjs.map +1 -1
  236. package/dist/components/input/TimePicker.mjs +185 -177
  237. package/dist/components/input/TimePicker.mjs.map +1 -1
  238. package/dist/components/input/colorName.cjs +2 -0
  239. package/dist/components/input/colorName.cjs.map +1 -0
  240. package/dist/components/input/colorName.mjs +30 -0
  241. package/dist/components/input/colorName.mjs.map +1 -0
  242. package/dist/components/input/colorUtils.cjs +1 -1
  243. package/dist/components/input/colorUtils.cjs.map +1 -1
  244. package/dist/components/input/colorUtils.mjs +154 -56
  245. package/dist/components/input/colorUtils.mjs.map +1 -1
  246. package/dist/components/input/fieldLabel.cjs +2 -0
  247. package/dist/components/input/fieldLabel.cjs.map +1 -0
  248. package/dist/components/input/fieldLabel.mjs +17 -0
  249. package/dist/components/input/fieldLabel.mjs.map +1 -0
  250. package/dist/components/input/inputLook.cjs +2 -0
  251. package/dist/components/input/inputLook.cjs.map +1 -0
  252. package/dist/components/input/inputLook.mjs +28 -0
  253. package/dist/components/input/inputLook.mjs.map +1 -0
  254. package/dist/components/input/pickerStyles.cjs +1 -1
  255. package/dist/components/input/pickerStyles.cjs.map +1 -1
  256. package/dist/components/input/pickerStyles.mjs +42 -4
  257. package/dist/components/input/pickerStyles.mjs.map +1 -1
  258. package/dist/components/layout/Accordion.cjs +1 -1
  259. package/dist/components/layout/Accordion.cjs.map +1 -1
  260. package/dist/components/layout/Accordion.mjs +130 -129
  261. package/dist/components/layout/Accordion.mjs.map +1 -1
  262. package/dist/components/layout/Card.cjs +1 -1
  263. package/dist/components/layout/Card.cjs.map +1 -1
  264. package/dist/components/layout/Card.mjs +78 -77
  265. package/dist/components/layout/Card.mjs.map +1 -1
  266. package/dist/components/layout/Carousel.cjs +1 -1
  267. package/dist/components/layout/Carousel.cjs.map +1 -1
  268. package/dist/components/layout/Carousel.mjs +111 -110
  269. package/dist/components/layout/Carousel.mjs.map +1 -1
  270. package/dist/components/layout/Flex.cjs +1 -1
  271. package/dist/components/layout/Flex.cjs.map +1 -1
  272. package/dist/components/layout/Flex.mjs +22 -21
  273. package/dist/components/layout/Flex.mjs.map +1 -1
  274. package/dist/components/layout/Grid.cjs +1 -1
  275. package/dist/components/layout/Grid.cjs.map +1 -1
  276. package/dist/components/layout/Grid.mjs +19 -18
  277. package/dist/components/layout/Grid.mjs.map +1 -1
  278. package/dist/components/layout/Overflow.cjs +1 -1
  279. package/dist/components/layout/Overflow.cjs.map +1 -1
  280. package/dist/components/layout/Overflow.mjs +92 -91
  281. package/dist/components/layout/Overflow.mjs.map +1 -1
  282. package/dist/components/layout/Stack.cjs +1 -1
  283. package/dist/components/layout/Stack.cjs.map +1 -1
  284. package/dist/components/layout/Stack.mjs +14 -13
  285. package/dist/components/layout/Stack.mjs.map +1 -1
  286. package/dist/components/layout/TabList.cjs +1 -1
  287. package/dist/components/layout/TabList.cjs.map +1 -1
  288. package/dist/components/layout/TabList.mjs +118 -117
  289. package/dist/components/layout/TabList.mjs.map +1 -1
  290. package/dist/components/layout/Tree.cjs +1 -1
  291. package/dist/components/layout/Tree.cjs.map +1 -1
  292. package/dist/components/layout/Tree.context.cjs +2 -0
  293. package/dist/components/layout/Tree.context.cjs.map +1 -0
  294. package/dist/components/layout/Tree.context.mjs +33 -0
  295. package/dist/components/layout/Tree.context.mjs.map +1 -0
  296. package/dist/components/layout/Tree.core.cjs +2 -0
  297. package/dist/components/layout/Tree.core.cjs.map +1 -0
  298. package/dist/components/layout/Tree.core.mjs +416 -0
  299. package/dist/components/layout/Tree.core.mjs.map +1 -0
  300. package/dist/components/layout/Tree.itemPersonaLayout.cjs +2 -0
  301. package/dist/components/layout/Tree.itemPersonaLayout.cjs.map +1 -0
  302. package/dist/components/layout/Tree.itemPersonaLayout.mjs +46 -0
  303. package/dist/components/layout/Tree.itemPersonaLayout.mjs.map +1 -0
  304. package/dist/components/layout/Tree.mjs +7 -215
  305. package/dist/components/layout/Tree.mjs.map +1 -1
  306. package/dist/components/layout/Tree.selection.cjs +2 -0
  307. package/dist/components/layout/Tree.selection.cjs.map +1 -0
  308. package/dist/components/layout/Tree.selection.mjs +73 -0
  309. package/dist/components/layout/Tree.selection.mjs.map +1 -0
  310. package/dist/components/navigation/Breadcrumb.cjs +1 -1
  311. package/dist/components/navigation/Breadcrumb.cjs.map +1 -1
  312. package/dist/components/navigation/Breadcrumb.mjs +76 -75
  313. package/dist/components/navigation/Breadcrumb.mjs.map +1 -1
  314. package/dist/components/navigation/Menu.group.cjs +1 -1
  315. package/dist/components/navigation/Menu.group.cjs.map +1 -1
  316. package/dist/components/navigation/Menu.group.mjs +39 -37
  317. package/dist/components/navigation/Menu.group.mjs.map +1 -1
  318. package/dist/components/navigation/Menu.items.cjs +1 -1
  319. package/dist/components/navigation/Menu.items.cjs.map +1 -1
  320. package/dist/components/navigation/Menu.items.mjs +67 -61
  321. package/dist/components/navigation/Menu.items.mjs.map +1 -1
  322. package/dist/components/navigation/Menu.link.cjs +1 -1
  323. package/dist/components/navigation/Menu.link.cjs.map +1 -1
  324. package/dist/components/navigation/Menu.link.mjs +34 -28
  325. package/dist/components/navigation/Menu.link.mjs.map +1 -1
  326. package/dist/components/navigation/Menu.popover.cjs +1 -1
  327. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  328. package/dist/components/navigation/Menu.popover.mjs +114 -113
  329. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  330. package/dist/components/navigation/Menu.root.cjs +1 -1
  331. package/dist/components/navigation/Menu.root.cjs.map +1 -1
  332. package/dist/components/navigation/Menu.root.mjs +171 -170
  333. package/dist/components/navigation/Menu.root.mjs.map +1 -1
  334. package/dist/components/navigation/Menu.selectable.cjs +1 -1
  335. package/dist/components/navigation/Menu.selectable.cjs.map +1 -1
  336. package/dist/components/navigation/Menu.selectable.mjs +85 -63
  337. package/dist/components/navigation/Menu.selectable.mjs.map +1 -1
  338. package/dist/components/navigation/Menu.splitGroup.cjs +1 -1
  339. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -1
  340. package/dist/components/navigation/Menu.splitGroup.mjs +27 -26
  341. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -1
  342. package/dist/components/navigation/Menu.trigger.cjs +1 -1
  343. package/dist/components/navigation/Menu.trigger.cjs.map +1 -1
  344. package/dist/components/navigation/Menu.trigger.mjs +6 -6
  345. package/dist/components/navigation/Nav.cjs +1 -1
  346. package/dist/components/navigation/Nav.cjs.map +1 -1
  347. package/dist/components/navigation/Nav.mjs +170 -155
  348. package/dist/components/navigation/Nav.mjs.map +1 -1
  349. package/dist/components/navigation/Pagination.cjs +1 -1
  350. package/dist/components/navigation/Pagination.cjs.map +1 -1
  351. package/dist/components/navigation/Pagination.mjs +73 -65
  352. package/dist/components/navigation/Pagination.mjs.map +1 -1
  353. package/dist/components/navigation/Stepper.cjs +1 -1
  354. package/dist/components/navigation/Stepper.cjs.map +1 -1
  355. package/dist/components/navigation/Stepper.mjs +110 -109
  356. package/dist/components/navigation/Stepper.mjs.map +1 -1
  357. package/dist/components/overlays/Dialog.cjs +1 -1
  358. package/dist/components/overlays/Dialog.cjs.map +1 -1
  359. package/dist/components/overlays/Dialog.mjs +109 -108
  360. package/dist/components/overlays/Dialog.mjs.map +1 -1
  361. package/dist/components/overlays/Drawer.cjs +1 -1
  362. package/dist/components/overlays/Drawer.cjs.map +1 -1
  363. package/dist/components/overlays/Drawer.mjs +110 -109
  364. package/dist/components/overlays/Drawer.mjs.map +1 -1
  365. package/dist/components/overlays/Popover.cjs +1 -1
  366. package/dist/components/overlays/Popover.cjs.map +1 -1
  367. package/dist/components/overlays/Popover.mjs +148 -151
  368. package/dist/components/overlays/Popover.mjs.map +1 -1
  369. package/dist/components/overlays/Popover.shared.cjs +1 -1
  370. package/dist/components/overlays/Popover.shared.cjs.map +1 -1
  371. package/dist/components/overlays/Popover.shared.mjs +82 -77
  372. package/dist/components/overlays/Popover.shared.mjs.map +1 -1
  373. package/dist/components/overlays/TeachingPopover.cjs +1 -1
  374. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  375. package/dist/components/overlays/TeachingPopover.mjs +41 -37
  376. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  377. package/dist/components/overlays/Tooltip.cjs +1 -1
  378. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  379. package/dist/components/overlays/Tooltip.mjs +87 -86
  380. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  381. package/dist/components/portal/Portal.cjs +1 -1
  382. package/dist/components/portal/Portal.cjs.map +1 -1
  383. package/dist/components/portal/Portal.mjs +33 -32
  384. package/dist/components/portal/Portal.mjs.map +1 -1
  385. package/dist/components/provider/WaveProvider.cjs +1 -1
  386. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  387. package/dist/components/provider/WaveProvider.mjs +36 -29
  388. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  389. package/dist/components/table/DataGrid.cjs +1 -1
  390. package/dist/components/table/DataGrid.cjs.map +1 -1
  391. package/dist/components/table/DataGrid.mjs +228 -227
  392. package/dist/components/table/DataGrid.mjs.map +1 -1
  393. package/dist/components/table/Table.cjs +1 -1
  394. package/dist/components/table/Table.cjs.map +1 -1
  395. package/dist/components/table/Table.mjs +60 -59
  396. package/dist/components/table/Table.mjs.map +1 -1
  397. package/dist/components/typography/Text.cjs +1 -1
  398. package/dist/components/typography/Text.cjs.map +1 -1
  399. package/dist/components/typography/Text.mjs +12 -11
  400. package/dist/components/typography/Text.mjs.map +1 -1
  401. package/dist/hooks/useFieldControl.cjs.map +1 -1
  402. package/dist/hooks/useFieldControl.mjs.map +1 -1
  403. package/dist/hooks/useMediaQuery.cjs +2 -0
  404. package/dist/hooks/useMediaQuery.cjs.map +1 -0
  405. package/dist/hooks/useMediaQuery.mjs +20 -0
  406. package/dist/hooks/useMediaQuery.mjs.map +1 -0
  407. package/dist/hooks/usePrefersReducedMotion.cjs +1 -1
  408. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -1
  409. package/dist/hooks/usePrefersReducedMotion.mjs +4 -18
  410. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -1
  411. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  412. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  413. package/dist/hooks/useRovingTabIndex.mjs +3 -3
  414. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  415. package/dist/index.cjs +1 -1
  416. package/dist/index.d.cts +2890 -197
  417. package/dist/index.d.ts +2890 -197
  418. package/dist/index.mjs +101 -87
  419. package/dist/lib/classNames.cjs +2 -0
  420. package/dist/lib/classNames.cjs.map +1 -0
  421. package/dist/lib/classNames.mjs +423 -0
  422. package/dist/lib/classNames.mjs.map +1 -0
  423. package/dist/lib/color.cjs +2 -0
  424. package/dist/lib/color.cjs.map +1 -0
  425. package/dist/lib/color.mjs +86 -0
  426. package/dist/lib/color.mjs.map +1 -0
  427. package/dist/lib/globalRegistry.cjs.map +1 -1
  428. package/dist/lib/globalRegistry.mjs.map +1 -1
  429. package/dist/lib/styles.cjs +1 -1
  430. package/dist/lib/styles.cjs.map +1 -1
  431. package/dist/lib/styles.mjs +21 -4
  432. package/dist/lib/styles.mjs.map +1 -1
  433. package/dist/lib/toaster.cjs +2 -0
  434. package/dist/lib/toaster.cjs.map +1 -0
  435. package/dist/lib/toaster.mjs +77 -0
  436. package/dist/lib/toaster.mjs.map +1 -0
  437. package/dist/styles.css +1 -1
  438. package/package.json +1 -1
  439. package/src/styles/tokens.css +13 -0
@@ -4,185 +4,186 @@ import { flattenChildren as t, isElementOfType as n } from "../../lib/children.m
4
4
  import { warnOnce as r } from "../../lib/dev.mjs";
5
5
  import { slotRendersContent as i } from "../../lib/slot.mjs";
6
6
  import { composeEventHandlers as a } from "../../lib/composeEventHandlers.mjs";
7
+ import { carouselClassNames as o, carouselItemClassNames as s } from "../../lib/classNames.mjs";
7
8
  import { useEventCallback as ee } from "../../hooks/useEventCallback.mjs";
8
9
  import { useControllable as te } from "../../hooks/useControllable.mjs";
9
10
  import { useId as ne } from "../../hooks/useId.mjs";
10
11
  import { useMergedRefs as re } from "../../hooks/useMergedRefs.mjs";
11
- import { focusableDisabledProps as o, preventIfDisabled as s } from "../../lib/aria.mjs";
12
+ import { focusableDisabledProps as c, preventIfDisabled as l } from "../../lib/aria.mjs";
12
13
  import { usePrefersReducedMotion as ie } from "../../hooks/usePrefersReducedMotion.mjs";
13
14
  import { useDirection as ae } from "../../hooks/useDirection.mjs";
14
- import { disabledStyles as c, focusRing as l, forcedColors as oe } from "../../lib/styles.mjs";
15
+ import { disabledStyles as u, focusRing as d, forcedColors as oe } from "../../lib/styles.mjs";
15
16
  import { ChevronLeftIcon as se, ChevronRightIcon as ce } from "../../lib/icons.mjs";
16
- import * as u from "react";
17
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
17
+ import * as f from "react";
18
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
18
19
  //#region src/components/layout/Carousel.tsx
19
20
  var le = "Pause slide rotation", ue = "Start slide rotation", de = "Previous slide", fe = "Next slide", pe = "Choose slide", me = (e, t) => `Slide ${e + 1} of ${t}`, he = "carousel", ge = "slide";
20
- function p(e, t) {
21
+ function h(e, t) {
21
22
  return t <= 0 || !Number.isFinite(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t - 1);
22
23
  }
23
24
  function _e(e) {
24
25
  return e instanceof Element && e.closest("[data-carousel-rotation]") !== null;
25
26
  }
26
- var m = [
27
+ var g = [
27
28
  "absolute z-10 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background text-foreground shadow-2",
28
29
  "not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:active:bg-subtle-pressed",
29
- l,
30
- c
31
- ].join(" "), ve = () => /* @__PURE__ */ f("svg", {
30
+ d,
31
+ u
32
+ ].join(" "), ve = () => /* @__PURE__ */ m("svg", {
32
33
  width: "16",
33
34
  height: "16",
34
35
  viewBox: "0 0 16 16",
35
36
  fill: "currentColor",
36
37
  "aria-hidden": "true",
37
- children: [/* @__PURE__ */ d("rect", {
38
+ children: [/* @__PURE__ */ p("rect", {
38
39
  x: "4",
39
40
  y: "3",
40
41
  width: "3",
41
42
  height: "10",
42
43
  rx: "1"
43
- }), /* @__PURE__ */ d("rect", {
44
+ }), /* @__PURE__ */ p("rect", {
44
45
  x: "9",
45
46
  y: "3",
46
47
  width: "3",
47
48
  height: "10",
48
49
  rx: "1"
49
50
  })]
50
- }), ye = () => /* @__PURE__ */ d("svg", {
51
+ }), ye = () => /* @__PURE__ */ p("svg", {
51
52
  width: "16",
52
53
  height: "16",
53
54
  viewBox: "0 0 16 16",
54
55
  fill: "currentColor",
55
56
  "aria-hidden": "true",
56
- children: /* @__PURE__ */ d("path", { d: "M5 3.5v9a.5.5 0 0 0 .77.42l7-4.5a.5.5 0 0 0 0-.84l-7-4.5A.5.5 0 0 0 5 3.5Z" })
57
- }), h = ({ value: c, defaultValue: h = 0, onValueChange: _, autoPlay: be = !1, autoPlayInterval: v = 5e3, autoPlayLabels: y, labels: b, loop: x = !1, className: S, children: xe, onMouseEnter: Se, onMouseLeave: Ce, onFocus: we, onBlur: Te, ref: Ee, ...C }) => {
58
- let [De, w] = te(c, h, _), T = ne("carousel-slides"), [E, Oe] = u.useState(null), D = re(Ee, Oe), ke = ae(E), O = C.dir === "rtl" || C.dir === "ltr" ? C.dir : ke, Ae = ie(), [je, k] = u.useState(null), [A, j] = u.useState(null), [Me, M] = u.useState(!1), [Ne, N] = u.useState(!1), [Pe, P] = u.useState(!1), [Fe, F] = u.useState(!1), I = [], L = !1;
59
- for (let e of t(xe)) n(e.node, g) ? I.push(e) : i(e.node) && (L = !0);
60
- let R = I.length;
61
- u.useEffect(() => {
62
- L && r("Carousel:non-item-children", "Carousel: only `Carousel.Item` (`CarouselItem`) children are slides, directly or in Fragments; other children are not rendered. A component that renders `Carousel.Item` itself is not recognised: render the `Carousel.Item` in the Carousel and put the component inside it.");
63
- }, [L]);
64
- let z = p(De, R), B = z <= 0, V = z >= R - 1, H = R <= 1 || !x && B, U = R <= 1 || !x && V, W = A === R && !x, G = (je ?? Ae) || W, K = be && R > 1;
65
- K && !x && V && !G ? j(R) : A !== null && !W && j(null);
66
- let q = K && !G && !(Me && !Ne) && !(Pe && !Fe), J = (e) => {
67
- e >= 0 && e < R && e !== z && w(e);
68
- }, Ie = () => J(B ? R - 1 : z - 1), Le = () => J(V ? 0 : z + 1), Y = ee(() => {
69
- w((e) => {
70
- let t = p(e, R);
71
- return t < R - 1 ? t + 1 : x ? 0 : e;
57
+ children: /* @__PURE__ */ p("path", { d: "M5 3.5v9a.5.5 0 0 0 .77.42l7-4.5a.5.5 0 0 0 0-.84l-7-4.5A.5.5 0 0 0 5 3.5Z" })
58
+ }), _ = ({ value: s, defaultValue: u = 0, onValueChange: _, autoPlay: y = !1, autoPlayInterval: b = 5e3, autoPlayLabels: x, labels: S, loop: C = !1, className: w, children: be, onMouseEnter: xe, onMouseLeave: Se, onFocus: Ce, onBlur: we, ref: Te, ...T }) => {
59
+ let [Ee, E] = te(s, u, _), D = ne("carousel-slides"), [De, Oe] = f.useState(null), O = re(Te, Oe), ke = ae(De), k = T.dir === "rtl" || T.dir === "ltr" ? T.dir : ke, Ae = ie(), [je, A] = f.useState(null), [j, M] = f.useState(null), [Me, N] = f.useState(!1), [Ne, P] = f.useState(!1), [Pe, F] = f.useState(!1), [Fe, I] = f.useState(!1), L = [], R = !1;
60
+ for (let e of t(be)) n(e.node, v) ? L.push(e) : i(e.node) && (R = !0);
61
+ let z = L.length;
62
+ f.useEffect(() => {
63
+ R && r("Carousel:non-item-children", "Carousel: only `Carousel.Item` (`CarouselItem`) children are slides, directly or in Fragments; other children are not rendered. A component that renders `Carousel.Item` itself is not recognised: render the `Carousel.Item` in the Carousel and put the component inside it.");
64
+ }, [R]);
65
+ let B = h(Ee, z), V = B <= 0, H = B >= z - 1, U = z <= 1 || !C && V, W = z <= 1 || !C && H, G = j === z && !C, K = (je ?? Ae) || G, q = y && z > 1;
66
+ q && !C && H && !K ? M(z) : j !== null && !G && M(null);
67
+ let J = q && !K && !(Me && !Ne) && !(Pe && !Fe), Y = (e) => {
68
+ e >= 0 && e < z && e !== B && E(e);
69
+ }, Ie = () => Y(V ? z - 1 : B - 1), Le = () => Y(H ? 0 : B + 1), X = ee(() => {
70
+ E((e) => {
71
+ let t = h(e, z);
72
+ return t < z - 1 ? t + 1 : C ? 0 : e;
72
73
  });
73
74
  });
74
- u.useEffect(() => {
75
- if (!q) return;
76
- let e = setInterval(Y, v);
75
+ f.useEffect(() => {
76
+ if (!J) return;
77
+ let e = setInterval(X, b);
77
78
  return () => clearInterval(e);
78
79
  }, [
79
- q,
80
- v,
81
- Y
80
+ J,
81
+ b,
82
+ X
82
83
  ]);
83
84
  let Re = () => {
84
- G ? (!x && V && J(0), j(null), k(!1), F(!0)) : (k(!0), F(!1));
85
- }, X = {
86
- onMouseEnter: a(Se, () => M(!0)),
87
- onMouseLeave: a(Ce, () => M(!1)),
88
- onFocus: a(we, (e) => {
85
+ K ? (!C && H && Y(0), M(null), A(!1), I(!0)) : (A(!0), I(!1));
86
+ }, Z = {
87
+ onMouseEnter: a(xe, () => N(!0)),
88
+ onMouseLeave: a(Se, () => N(!1)),
89
+ onFocus: a(Ce, (e) => {
89
90
  let t = e.relatedTarget, n = !(t instanceof Node && e.currentTarget.contains(t));
90
- P(!0), (n || !_e(e.target)) && F(!1);
91
+ F(!0), (n || !_e(e.target)) && I(!1);
91
92
  }),
92
- onBlur: a(Te, (e) => {
93
+ onBlur: a(we, (e) => {
93
94
  let t = e.relatedTarget;
94
- t instanceof Node && e.currentTarget.contains(t) || (P(!1), F(!1));
95
+ t instanceof Node && e.currentTarget.contains(t) || (F(!1), I(!1));
95
96
  })
96
97
  };
97
- if (R === 0) return /* @__PURE__ */ d("div", {
98
- ref: D,
99
- className: e("relative", S),
100
- ...X,
101
- ...C
98
+ if (z === 0) return /* @__PURE__ */ p("div", {
99
+ ref: O,
100
+ className: e(o.root, "relative", w),
101
+ ...Z,
102
+ ...T
102
103
  });
103
- let ze = (O === "rtl" ? 1 : -1) * z * 100, Z = O === "rtl" ? "-scale-x-100" : void 0, Be = y?.pause ?? le, Ve = y?.play ?? ue, Q = b?.previous ?? de, He = b?.next ?? fe, Ue = b?.picker ?? pe, $ = b?.slide ?? me, We = b?.carouselRoleDescription ?? he, Ge = b?.slideRoleDescription ?? ge;
104
- return /* @__PURE__ */ f("div", {
105
- ref: D,
104
+ let ze = (k === "rtl" ? 1 : -1) * B * 100, Q = k === "rtl" ? "-scale-x-100" : void 0, Be = x?.pause ?? le, Ve = x?.play ?? ue, He = S?.previous ?? de, Ue = S?.next ?? fe, We = S?.picker ?? pe, $ = S?.slide ?? me, Ge = S?.carouselRoleDescription ?? he, Ke = S?.slideRoleDescription ?? ge;
105
+ return /* @__PURE__ */ m("div", {
106
+ ref: O,
106
107
  role: "region",
107
- "aria-roledescription": We,
108
+ "aria-roledescription": Ge,
108
109
  "aria-label": "Carousel",
109
- className: e("relative isolate overflow-hidden", S),
110
- ...X,
111
- ...C,
110
+ className: e(o.root, "relative isolate overflow-hidden", w),
111
+ ...Z,
112
+ ...T,
112
113
  children: [
113
- K && /* @__PURE__ */ d("button", {
114
+ q && /* @__PURE__ */ p("button", {
114
115
  type: "button",
115
116
  "data-carousel-rotation": "",
116
- "aria-label": G ? Ve : Be,
117
- "aria-controls": T,
117
+ "aria-label": K ? Ve : Be,
118
+ "aria-controls": D,
118
119
  onClick: Re,
119
- onMouseEnter: () => N(!0),
120
- onMouseLeave: () => N(!1),
121
- className: e(m, "top-2 start-2"),
122
- children: d(G ? ye : ve, {})
120
+ onMouseEnter: () => P(!0),
121
+ onMouseLeave: () => P(!1),
122
+ className: e(o.autoPlayButton, g, "top-2 start-2"),
123
+ children: p(K ? ye : ve, {})
123
124
  }),
124
- /* @__PURE__ */ d("div", {
125
- id: T,
126
- className: "flex transition-transform duration-300 ease-in-out motion-reduce:transition-none",
125
+ /* @__PURE__ */ p("div", {
126
+ id: D,
127
+ className: e(o.track, "flex transition-transform duration-300 ease-in-out motion-reduce:transition-none"),
127
128
  style: { transform: `translateX(${ze}%)` },
128
- children: I.map(({ key: e, node: t }, n) => {
129
- let r = n === z;
130
- return /* @__PURE__ */ d("div", {
129
+ children: L.map(({ key: t, node: n }, r) => {
130
+ let i = r === B;
131
+ return /* @__PURE__ */ p("div", {
131
132
  role: "group",
132
- "aria-roledescription": Ge,
133
- "aria-label": $(n, R),
134
- "aria-hidden": !r || void 0,
135
- inert: !r,
136
- className: "w-full shrink-0",
137
- children: t
138
- }, e);
133
+ "aria-roledescription": Ke,
134
+ "aria-label": $(r, z),
135
+ "aria-hidden": !i || void 0,
136
+ inert: !i,
137
+ className: e(o.slide, "w-full shrink-0"),
138
+ children: n
139
+ }, t);
139
140
  })
140
141
  }),
141
- /* @__PURE__ */ d("div", {
142
- "aria-live": q ? "off" : "polite",
142
+ /* @__PURE__ */ p("div", {
143
+ "aria-live": J ? "off" : "polite",
143
144
  "aria-atomic": "true",
144
145
  className: "sr-only",
145
- children: $(z, R)
146
+ children: $(B, z)
146
147
  }),
147
- /* @__PURE__ */ d("button", {
148
+ /* @__PURE__ */ p("button", {
148
149
  type: "button",
149
- "aria-label": Q,
150
- "aria-controls": T,
151
- ...o(H),
152
- onClick: s(H, Ie),
153
- className: e(m, "top-1/2 start-2 -translate-y-1/2"),
154
- children: /* @__PURE__ */ d(se, {
150
+ "aria-label": He,
151
+ "aria-controls": D,
152
+ ...c(U),
153
+ onClick: l(U, Ie),
154
+ className: e(o.previousButton, g, "top-1/2 start-2 -translate-y-1/2"),
155
+ children: /* @__PURE__ */ p(se, {
155
156
  size: 16,
156
- className: Z
157
+ className: Q
157
158
  })
158
159
  }),
159
- /* @__PURE__ */ d("button", {
160
+ /* @__PURE__ */ p("button", {
160
161
  type: "button",
161
- "aria-label": He,
162
- "aria-controls": T,
163
- ...o(U),
164
- onClick: s(U, Le),
165
- className: e(m, "top-1/2 end-2 -translate-y-1/2"),
166
- children: /* @__PURE__ */ d(ce, {
162
+ "aria-label": Ue,
163
+ "aria-controls": D,
164
+ ...c(W),
165
+ onClick: l(W, Le),
166
+ className: e(o.nextButton, g, "top-1/2 end-2 -translate-y-1/2"),
167
+ children: /* @__PURE__ */ p(ce, {
167
168
  size: 16,
168
- className: Z
169
+ className: Q
169
170
  })
170
171
  }),
171
- /* @__PURE__ */ d("div", {
172
+ /* @__PURE__ */ p("div", {
172
173
  role: "group",
173
- "aria-label": Ue,
174
- className: "absolute inset-x-0 bottom-1 z-10 mx-auto flex w-fit",
175
- children: I.map(({ key: t }, n) => {
176
- let r = n === z;
177
- return /* @__PURE__ */ d("button", {
174
+ "aria-label": We,
175
+ className: e(o.picker, "absolute inset-x-0 bottom-1 z-10 mx-auto flex w-fit"),
176
+ children: L.map(({ key: t }, n) => {
177
+ let r = n === B;
178
+ return /* @__PURE__ */ p("button", {
178
179
  type: "button",
179
- "aria-label": $(n, R),
180
+ "aria-label": $(n, z),
180
181
  "aria-current": r ? "true" : void 0,
181
- onClick: () => J(n),
182
- className: e("group inline-flex h-6 min-w-6 items-center justify-center", l),
183
- children: /* @__PURE__ */ d("span", {
182
+ onClick: () => Y(n),
183
+ className: e(o.pickerButton, "group inline-flex h-6 min-w-6 items-center justify-center", d),
184
+ children: /* @__PURE__ */ p("span", {
184
185
  "aria-hidden": "true",
185
- className: e("block h-2 rounded-full transition-[width,background-color] duration-200 motion-reduce:transition-none", r ? e("w-5 bg-primary", oe.selectedLeaf) : "w-2 bg-stroke-accessible group-hover:bg-foreground forced-colors:bg-[ButtonText] forced-colors:forced-color-adjust-none")
186
+ className: e(o.pickerIndicator, "block h-2 rounded-full transition-[width,background-color] duration-200 motion-reduce:transition-none", r ? e("w-5 bg-primary", oe.selectedLeaf) : "w-2 bg-stroke-accessible group-hover:bg-foreground forced-colors:bg-[ButtonText] forced-colors:forced-color-adjust-none")
186
187
  })
187
188
  }, t);
188
189
  })
@@ -190,16 +191,16 @@ var m = [
190
191
  ]
191
192
  });
192
193
  };
193
- h.displayName = "Carousel";
194
- var g = ({ className: t, children: n, ref: r, ...i }) => /* @__PURE__ */ d("div", {
194
+ _.displayName = "Carousel";
195
+ var v = ({ className: t, children: n, ref: r, ...i }) => /* @__PURE__ */ p("div", {
195
196
  ref: r,
196
- className: e("p-4", t),
197
+ className: e(s.root, "p-4", t),
197
198
  ...i,
198
199
  children: n
199
200
  });
200
- g.displayName = "CarouselItem";
201
- var _ = /* @__PURE__ */ Object.assign(h, { Item: g });
201
+ v.displayName = "CarouselItem";
202
+ var y = /* @__PURE__ */ Object.assign(_, { Item: v });
202
203
  //#endregion
203
- export { _ as Carousel, g as CarouselItem };
204
+ export { y as Carousel, v as CarouselItem };
204
205
 
205
206
  //# sourceMappingURL=Carousel.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.mjs","names":["useId","useId$1","React","DEFAULT_PAUSE_LABEL","DEFAULT_PLAY_LABEL","DEFAULT_PREVIOUS_LABEL","DEFAULT_NEXT_LABEL","DEFAULT_PICKER_LABEL","defaultSlideLabel","index","total","DEFAULT_CAROUSEL_ROLE_DESCRIPTION","DEFAULT_SLIDE_ROLE_DESCRIPTION","clampIndex","isRotationControl","target","controlButton","focusRing","disabledStyles","PauseGlyph","PlayGlyph","CarouselRoot","controlledValue","rest","storedIndex","setActiveIndex","useControllable","defaultValue","onValueChange","trackId","rootEl","setRootEl","rootRef","useMergedRefs","ref","renderedDir","useDirection","dir","prefersReducedMotion","usePrefersReducedMotion","userPaused","setUserPaused","endedAt","setEndedAt","hovered","setHovered","pointerOnControl","setPointerOnControl","focusWithin","setFocusWithin","startedFromControl","setStartedFromControl","items","droppedChildren","child","flattenChildren","children","isElementOfType","CarouselItem","slotRendersContent","warnOnce","atStart","atEnd","prevDisabled","loop","nextDisabled","ended","stopped","hasRotation","autoPlay","rotating","goTo","goPrev","goNext","advance","useEventCallback","current","prev","id","autoPlayInterval","toggleRotation","rootHandlers","composeEventHandlers","onMouseEnter","onMouseLeave","onFocus","from","event","entering","onBlur","next","cn","className","offset","chevronClass","pauseLabel","autoPlayLabels","playLabel","previousLabel","labels","nextLabel","pickerLabel","slideLabel","carouselRoleDescription","slideRoleDescription","jsx","active","i","node","key","focusableDisabledProps","preventIfDisabled","ChevronLeftIcon","ChevronRightIcon","forcedColors","Carousel"],"sources":["../../../src/components/layout/Carousel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { warnOnce } from '../../lib/dev';\nimport { slotRendersContent } from '../../lib/slot';\nimport { focusableDisabledProps, preventIfDisabled } from '../../lib/aria';\nimport { disabledStyles, focusRing, forcedColors } from '../../lib/styles';\nimport { ChevronLeftIcon, ChevronRightIcon } from '../../lib/icons';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useDirection } from '../../hooks/useDirection';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion';\n\n/** Accessible names of the rotation control shown while `autoPlay` is on. */\nexport interface CarouselAutoPlayLabels {\n /** Name of the control while slides rotate (activating it stops the rotation).\n * @default 'Pause slide rotation'\n */\n pause?: string;\n /** Name of the control while rotation is stopped (activating it starts the rotation).\n * @default 'Start slide rotation'\n */\n play?: string;\n}\n\n/**\n * Accessible names of the Carousel's built-in controls and slides, and the role descriptions of\n * the carousel and its slides, for localization. Each member is optional and falls back to its\n * English default. The rotation control has its own `autoPlayLabels`; the region's name comes\n * from `aria-label` or `aria-labelledby`.\n */\nexport interface CarouselLabels {\n /** Name of the Previous button.\n * @default 'Previous slide'\n */\n previous?: string;\n /** Name of the Next button.\n * @default 'Next slide'\n */\n next?: string;\n /** Name of the group that holds the slide picker buttons.\n * @default 'Choose slide'\n */\n picker?: string;\n /**\n * Name of the slide at `index` (zero-based, like `value`) out of `total` slides. It names the\n * slide itself and its picker button, and is announced by the live region when that slide is\n * shown.\n * @default (index, total) => `Slide ${index + 1} of ${total}`\n */\n slide?: (index: number, total: number) => string;\n /** How assistive technology announces the carousel region (`aria-roledescription`).\n * @default 'carousel'\n */\n carouselRoleDescription?: string;\n /** How assistive technology announces each slide (`aria-roledescription`).\n * @default 'slide'\n */\n slideRoleDescription?: string;\n}\n\n/** Properties for the Carousel component. */\nexport interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Controlled index of the currently active slide. Out-of-range values show the nearest slide. */\n value?: number;\n /** Default active slide index for uncontrolled usage.\n * @default 0\n */\n defaultValue?: number;\n /** Called with the new index when the active slide changes (not when it stays the same). */\n onValueChange?: (index: number) => void;\n /**\n * Rotates the slides automatically. A Pause/Start control is rendered as the first focusable\n * element. Rotation pauses while focus is anywhere inside the carousel (the control included;\n * clicking a control also moves focus there in most browsers) or the pointer is over it (except\n * over the control), and resumes when they leave, unless rotation is stopped. Activating Start\n * rotates at once, also while focus stays on the control; moving focus on to other content\n * pauses again. It starts stopped when the user prefers reduced motion. Without `loop`, rotation\n * ends at the last slide: the control shows Start, and rotation stays stopped (also after the\n * user moves back to an earlier slide) until Start is activated, which continues from the shown\n * slide, or from the first one while the last is shown. The end is tied to its cause: when the\n * number of slides changes (slides loaded later) or `loop` is turned on, rotation continues on\n * its own, unless the user stopped it with Pause.\n * @default false\n */\n autoPlay?: boolean;\n /** Interval in milliseconds between auto-play transitions.\n * @default 5000\n */\n autoPlayInterval?: number;\n /** Accessible names of the rotation control. */\n autoPlayLabels?: CarouselAutoPlayLabels;\n /**\n * Accessible names of the Previous and Next buttons, the slide picker and the slides (also\n * announced by the live region), and the role descriptions of the carousel and its slides, for\n * localization. Unset members keep their English defaults.\n */\n labels?: CarouselLabels;\n /** Whether the carousel loops back to the first slide after the last.\n * @default false\n */\n loop?: boolean;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Properties for the CarouselItem sub-component. */\nexport interface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst DEFAULT_PAUSE_LABEL = 'Pause slide rotation';\nconst DEFAULT_PLAY_LABEL = 'Start slide rotation';\nconst DEFAULT_PREVIOUS_LABEL = 'Previous slide';\nconst DEFAULT_NEXT_LABEL = 'Next slide';\nconst DEFAULT_PICKER_LABEL = 'Choose slide';\nconst defaultSlideLabel = (index: number, total: number) => `Slide ${index + 1} of ${total}`;\nconst DEFAULT_CAROUSEL_ROLE_DESCRIPTION = 'carousel';\nconst DEFAULT_SLIDE_ROLE_DESCRIPTION = 'slide';\n\nfunction clampIndex(index: number, total: number): number {\n if (total <= 0 || !Number.isFinite(index)) return 0;\n return Math.min(Math.max(Math.trunc(index), 0), total - 1);\n}\n\nfunction isRotationControl(target: EventTarget | null): boolean {\n return target instanceof Element && target.closest('[data-carousel-rotation]') !== null;\n}\n\nconst controlButton = [\n 'absolute z-10 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background text-foreground shadow-2',\n 'not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:active:bg-subtle-pressed',\n focusRing,\n disabledStyles,\n].join(' ');\n\nconst PauseGlyph = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"3\" width=\"3\" height=\"10\" rx=\"1\" />\n <rect x=\"9\" y=\"3\" width=\"3\" height=\"10\" rx=\"1\" />\n </svg>\n);\n\nconst PlayGlyph = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M5 3.5v9a.5.5 0 0 0 .77.42l7-4.5a.5.5 0 0 0 0-.84l-7-4.5A.5.5 0 0 0 5 3.5Z\" />\n </svg>\n);\n\n// The Carousel root, documented on the exported `Carousel` const.\nconst CarouselRoot = ({\n value: controlledValue,\n defaultValue = 0,\n onValueChange,\n autoPlay = false,\n autoPlayInterval = 5000,\n autoPlayLabels,\n labels,\n loop = false,\n className,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ref,\n ...rest\n}: CarouselProps) => {\n const [storedIndex, setActiveIndex] = useControllable(\n controlledValue,\n defaultValue,\n onValueChange,\n );\n const trackId = useId('carousel-slides');\n const [rootEl, setRootEl] = React.useState<HTMLDivElement | null>(null);\n const rootRef = useMergedRefs<HTMLDivElement>(ref, setRootEl);\n // The direction that applies to the rendered root (its own or an ancestor's `dir`, e.g. an RTL\n // section inside an LTR WaveProvider); before mount and on the server, the provider's/document's.\n const renderedDir = useDirection(rootEl);\n const dir = rest.dir === 'rtl' || rest.dir === 'ltr' ? rest.dir : renderedDir;\n const prefersReducedMotion = usePrefersReducedMotion();\n\n // Rotation state: stopped or not (the user's choice, stopped by default under reduced motion, or\n // ended at the last slide without loop) and the temporary pauses while the pointer is over the\n // content or focus is inside. An explicit Start overrides the focus pause while focus stays on\n // the rotation control (APG `hasUserActivatedPlay`), so pressing Start visibly starts the\n // rotation.\n const [userPaused, setUserPaused] = React.useState<boolean | null>(null);\n // The slide count at which rotation ended at the last slide (null while it has not ended), kept\n // apart from the user's choice so the end lasts only while its cause does.\n const [endedAt, setEndedAt] = React.useState<number | null>(null);\n const [hovered, setHovered] = React.useState(false);\n const [pointerOnControl, setPointerOnControl] = React.useState(false);\n const [focusWithin, setFocusWithin] = React.useState(false);\n const [startedFromControl, setStartedFromControl] = React.useState(false);\n\n // Slides are the `CarouselItem` children, Fragments flattened; the element type is unwrapped, so\n // slides written in a Server Component (lazy client references) count too (C-COMPOUND).\n const items: Array<{ key: string; node: React.ReactNode }> = [];\n let droppedChildren = false;\n for (const child of flattenChildren(children)) {\n if (isElementOfType(child.node, CarouselItem)) items.push(child);\n else if (slotRendersContent(child.node)) droppedChildren = true;\n }\n const total = items.length;\n\n React.useEffect(() => {\n if (droppedChildren) {\n warnOnce(\n 'Carousel:non-item-children',\n 'Carousel: only `Carousel.Item` (`CarouselItem`) children are slides, directly or in ' +\n 'Fragments; other children are not rendered. A component that renders `Carousel.Item` ' +\n 'itself is not recognised: render the `Carousel.Item` in the Carousel and put the ' +\n 'component inside it.',\n );\n }\n }, [droppedChildren]);\n\n // Derived during render (C-HOOKS): removed slides or an out-of-range value show the nearest one.\n const index = clampIndex(storedIndex, total);\n const atStart = index <= 0;\n const atEnd = index >= total - 1;\n const prevDisabled = total <= 1 || (!loop && atStart);\n const nextDisabled = total <= 1 || (!loop && atEnd);\n\n // Without loop, rotation ends at the last slide (however it got there) and stays stopped: moving\n // back to an earlier slide does not restart it, only Start does. The end applies to the slide\n // count it happened at: once slides are added or removed, or loop is turned on, it is dropped\n // and rotation continues unless the user stopped it (adjusting state during render, C-HOOKS).\n const ended = endedAt === total && !loop;\n const stopped = (userPaused ?? prefersReducedMotion) || ended;\n const hasRotation = autoPlay && total > 1;\n if (hasRotation && !loop && atEnd && !stopped) setEndedAt(total);\n else if (endedAt !== null && !ended) setEndedAt(null);\n const pausedByPointer = hovered && !pointerOnControl;\n const pausedByFocus = focusWithin && !startedFromControl;\n const rotating = hasRotation && !stopped && !pausedByPointer && !pausedByFocus;\n\n // Compares with the shown (clamped) index, so re-picking the visible slide reports nothing.\n const goTo = (target: number) => {\n if (target >= 0 && target < total && target !== index) setActiveIndex(target);\n };\n const goPrev = () => goTo(atStart ? total - 1 : index - 1);\n const goNext = () => goTo(atEnd ? 0 : index + 1);\n\n // Reads the latest index at tick time (the updater's base), so the interval does not restart on\n // every slide or parent render and consecutive ticks chain even before a re-render.\n const advance = useEventCallback(() => {\n setActiveIndex((prev) => {\n const current = clampIndex(prev, total);\n if (current < total - 1) return current + 1;\n return loop ? 0 : prev;\n });\n });\n\n React.useEffect(() => {\n if (!rotating) return;\n const id = setInterval(advance, autoPlayInterval);\n return () => clearInterval(id);\n }, [rotating, autoPlayInterval, advance]);\n\n const toggleRotation = () => {\n if (stopped) {\n // Start: from the first slide when rotation had ended at the last one.\n if (!loop && atEnd) goTo(0);\n setEndedAt(null);\n setUserPaused(false);\n setStartedFromControl(true);\n } else {\n setUserPaused(true);\n setStartedFromControl(false);\n }\n };\n\n // The consumer's pointer and focus handlers composed with the pause tracking (C-COMPOSE). The\n // empty root gets them too: the consumer's handlers still run, and a pointer or focus that leaves\n // while there are no slides (slides being reloaded) does not keep rotation paused afterwards.\n const rootHandlers = {\n onMouseEnter: composeEventHandlers(onMouseEnter, () => setHovered(true)),\n onMouseLeave: composeEventHandlers(onMouseLeave, () => setHovered(false)),\n onFocus: composeEventHandlers(onFocus, (event: React.FocusEvent<HTMLDivElement>) => {\n // Any focus inside pauses (APG), the rotation control included. Focus that enters from\n // outside or moves on to other content ends the exemption of an explicit Start.\n const from = event.relatedTarget;\n const entering = !(from instanceof Node && event.currentTarget.contains(from));\n setFocusWithin(true);\n if (entering || !isRotationControl(event.target)) setStartedFromControl(false);\n }),\n onBlur: composeEventHandlers(onBlur, (event: React.FocusEvent<HTMLDivElement>) => {\n const next = event.relatedTarget;\n if (!(next instanceof Node && event.currentTarget.contains(next))) {\n setFocusWithin(false);\n setStartedFromControl(false);\n }\n }),\n };\n\n if (total === 0) {\n return <div ref={rootRef} className={cn('relative', className)} {...rootHandlers} {...rest} />;\n }\n\n const offset = (dir === 'rtl' ? 1 : -1) * index * 100;\n // The chevrons mirror by the same resolved direction as the track. A CSS `rtl:` variant would\n // also match `[dir=rtl] *`, so an LTR carousel inside an RTL ancestor got mirrored chevrons.\n const chevronClass = dir === 'rtl' ? '-scale-x-100' : undefined;\n const pauseLabel = autoPlayLabels?.pause ?? DEFAULT_PAUSE_LABEL;\n const playLabel = autoPlayLabels?.play ?? DEFAULT_PLAY_LABEL;\n const previousLabel = labels?.previous ?? DEFAULT_PREVIOUS_LABEL;\n const nextLabel = labels?.next ?? DEFAULT_NEXT_LABEL;\n const pickerLabel = labels?.picker ?? DEFAULT_PICKER_LABEL;\n const slideLabel = labels?.slide ?? defaultSlideLabel;\n const carouselRoleDescription =\n labels?.carouselRoleDescription ?? DEFAULT_CAROUSEL_ROLE_DESCRIPTION;\n const slideRoleDescription = labels?.slideRoleDescription ?? DEFAULT_SLIDE_ROLE_DESCRIPTION;\n\n return (\n <div\n ref={rootRef}\n role=\"region\"\n aria-roledescription={carouselRoleDescription}\n aria-label=\"Carousel\"\n // A stacking context of its own: the controls' z-index cannot lift them over page headers.\n className={cn('relative isolate overflow-hidden', className)}\n {...rootHandlers}\n {...rest}\n >\n {hasRotation && (\n <button\n type=\"button\"\n data-carousel-rotation=\"\"\n aria-label={stopped ? playLabel : pauseLabel}\n aria-controls={trackId}\n onClick={toggleRotation}\n // The pointer over the control does not pause (APG): the user is operating it.\n onMouseEnter={() => setPointerOnControl(true)}\n onMouseLeave={() => setPointerOnControl(false)}\n className={cn(controlButton, 'top-2 start-2')}\n >\n {stopped ? <PlayGlyph /> : <PauseGlyph />}\n </button>\n )}\n <div\n id={trackId}\n className=\"flex transition-transform duration-300 ease-in-out motion-reduce:transition-none\"\n style={{ transform: `translateX(${offset}%)` }}\n >\n {items.map(({ key, node }, i) => {\n const active = i === index;\n return (\n <div\n key={key}\n role=\"group\"\n aria-roledescription={slideRoleDescription}\n aria-label={slideLabel(i, total)}\n aria-hidden={active ? undefined : true}\n inert={!active}\n className=\"w-full shrink-0\"\n >\n {node}\n </div>\n );\n })}\n </div>\n {/* Announces the current slide, except while slides rotate on their own. */}\n <div aria-live={rotating ? 'off' : 'polite'} aria-atomic=\"true\" className=\"sr-only\">\n {slideLabel(index, total)}\n </div>\n <button\n type=\"button\"\n aria-label={previousLabel}\n aria-controls={trackId}\n {...focusableDisabledProps(prevDisabled)}\n onClick={preventIfDisabled(prevDisabled, goPrev)}\n className={cn(controlButton, 'top-1/2 start-2 -translate-y-1/2')}\n >\n <ChevronLeftIcon size={16} className={chevronClass} />\n </button>\n <button\n type=\"button\"\n aria-label={nextLabel}\n aria-controls={trackId}\n {...focusableDisabledProps(nextDisabled)}\n onClick={preventIfDisabled(nextDisabled, goNext)}\n className={cn(controlButton, 'top-1/2 end-2 -translate-y-1/2')}\n >\n <ChevronRightIcon size={16} className={chevronClass} />\n </button>\n <div\n role=\"group\"\n aria-label={pickerLabel}\n className=\"absolute inset-x-0 bottom-1 z-10 mx-auto flex w-fit\"\n >\n {items.map(({ key }, i) => {\n const active = i === index;\n return (\n <button\n key={key}\n type=\"button\"\n aria-label={slideLabel(i, total)}\n aria-current={active ? 'true' : undefined}\n onClick={() => goTo(i)}\n className={cn('group inline-flex h-6 min-w-6 items-center justify-center', focusRing)}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'block h-2 rounded-full transition-[width,background-color] duration-200 motion-reduce:transition-none',\n active\n ? cn('w-5 bg-primary', forcedColors.selectedLeaf)\n : 'w-2 bg-stroke-accessible group-hover:bg-foreground forced-colors:bg-[ButtonText] forced-colors:forced-color-adjust-none',\n )}\n />\n </button>\n );\n })}\n </div>\n </div>\n );\n};\nCarouselRoot.displayName = 'Carousel';\n\n/**\n * One slide of a {@link Carousel}. Write it in the Carousel, directly or in a Fragment: a component\n * that renders `Carousel.Item` itself is not recognised as a slide (put that component inside the\n * `Carousel.Item` instead).\n */\nexport const CarouselItem = ({ className, children, ref, ...rest }: CarouselItemProps) => {\n return (\n <div ref={ref} className={cn('p-4', className)} {...rest}>\n {children}\n </div>\n );\n};\nCarouselItem.displayName = 'CarouselItem';\n\n/**\n * A slideshow that shows one slide at a time (WAI-ARIA APG carousel with previous/next buttons\n * and a slide picker).\n *\n * - Slides are the `Carousel.Item` (`CarouselItem`) children, written directly in the Carousel or\n * in Fragments. Other children are not rendered (a development warning says so). A component\n * that renders `Carousel.Item` itself is not recognised: write the `Carousel.Item` in the\n * Carousel and put the component inside it.\n * - Previous/Next stay focusable at the ends (`aria-disabled`), so keyboard focus is not lost.\n * - The slide picker is a group of buttons named \"Slide n of m\"; the active one has\n * `aria-current=\"true\"`.\n * - Inactive slides are `aria-hidden` and `inert`, so neither Tab nor a screen reader reaches\n * their content.\n * - With `autoPlay`, a Pause/Start control comes first (WAI-ARIA APG): rotation pauses while\n * focus is inside the carousel (in most browsers also after a click on one of its controls) or\n * the pointer is over its content, activating Start rotates at once, and the live region is\n * silent (`aria-live=\"off\"`) while slides rotate. Without `loop` rotation ends at the last slide\n * and stays stopped until the control's Start is activated (or the number of slides changes, or\n * `loop` is turned on).\n * - Right-to-left layouts slide the other way and mirror the Previous/Next chevrons: the direction\n * is read from the rendered element (its `dir` prop, the nearest ancestor's `dir`, WaveProvider\n * `dir` or the document's), so an LTR section inside an RTL page stays LTR throughout.\n * - Name the carousel with `aria-label` or `aria-labelledby` (the fallback name is \"Carousel\").\n * The built-in names and role descriptions are English: `labels` and `autoPlayLabels`\n * translate them.\n * - The controls are layered over the slides inside the carousel's own stacking context, so they\n * never paint over page headers that stay in view while the page scrolls.\n *\n * Compound access (`Carousel.Item`) needs a client module; React Server Components import the\n * flat name `CarouselItem` instead.\n */\nexport const Carousel = /* @__PURE__ */ Object.assign(CarouselRoot, {\n Item: CarouselItem,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiHA,IAAMG,KAAsB,wBACtBC,KAAqB,wBACrBC,KAAyB,kBACzBC,KAAqB,cACrBC,KAAuB,gBACvBC,MAAqB,GAAe,MAAkB,SAASC,IAAQ,EAAE,MAAMC,KAC/EC,KAAoC,YACpCC,KAAiC;AAEvC,SAASC,EAAW,GAAe,GAAuB;CAExD,OADIH,KAAS,KAAK,CAAC,OAAO,SAASD,CAAK,IAAU,IAC3C,KAAK,IAAI,KAAK,IAAI,KAAK,MAAMA,CAAK,GAAG,CAAC,GAAGC,IAAQ,CAAC;AAC3D;AAEA,SAASI,GAAkB,GAAqC;CAC9D,OAAOC,aAAkB,WAAWA,EAAO,QAAQ,0BAA0B,MAAM;AACrF;AAEA,IAAMC,IAAgB;CACpB;CACA;CACAC;CACAC;AACF,CAAC,CAAC,KAAK,GAAG,GAEJC,WACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAe,eAAY;CAAhF,UAAA,CACE,kBAAC,QAAD;EAAM,GAAE;EAAI,GAAE;EAAI,OAAM;EAAI,QAAO;EAAK,IAAG;CAAK,CAAA,GAChD,kBAAC,QAAD;EAAM,GAAE;EAAI,GAAE;EAAI,OAAM;EAAI,QAAO;EAAK,IAAG;CAAK,CAAA,CAC7C;IAGDC,WACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAe,eAAY;CAC9E,UAAA,kBAAC,QAAD,EAAM,GAAE,6EAA8E,CAAA;AACnF,CAAA,GAIDC,KAAgB,EACpB,OAAOC,GACP,kBAAe,GACf,kBACA,eAAW,IACX,sBAAmB,KACnB,mBACA,WACA,UAAO,IACP,cACA,cACA,kBACA,kBACA,aACA,YACA,SACA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C9C,yHACN;MACD,CAAA;KACK,GAhBDL,CAgBC;IAEZ,CAAC;GACE,CAAA;EACF;;AAET;AACA,EAAa,cAAc;AAO3B,IAAanD,KAAgB,EAAE,cAAW,aAAU,QAAK,GAAGnC,QAExD,kBAAC,OAAD;CAAU;CAAK,WAAWoE,EAAG,OAAOC,CAAS;CAAG,GAAIrE;CACjD;AACE,CAAA;AAGT,EAAa,cAAc;AAiC3B,IAAa4F,IAA2B,uBAAO,OAAO9F,GAAc,EAClE,MAAMqC,EACR,CAAC"}
1
+ {"version":3,"file":"Carousel.mjs","names":["useId","useId$1","React","DEFAULT_PAUSE_LABEL","DEFAULT_PLAY_LABEL","DEFAULT_PREVIOUS_LABEL","DEFAULT_NEXT_LABEL","DEFAULT_PICKER_LABEL","defaultSlideLabel","index","total","DEFAULT_CAROUSEL_ROLE_DESCRIPTION","DEFAULT_SLIDE_ROLE_DESCRIPTION","clampIndex","isRotationControl","target","controlButton","focusRing","disabledStyles","PauseGlyph","PlayGlyph","CarouselRoot","controlledValue","rest","storedIndex","setActiveIndex","useControllable","defaultValue","onValueChange","trackId","rootEl","setRootEl","rootRef","useMergedRefs","ref","renderedDir","useDirection","dir","prefersReducedMotion","usePrefersReducedMotion","userPaused","setUserPaused","endedAt","setEndedAt","hovered","setHovered","pointerOnControl","setPointerOnControl","focusWithin","setFocusWithin","startedFromControl","setStartedFromControl","items","droppedChildren","child","flattenChildren","children","isElementOfType","CarouselItem","slotRendersContent","warnOnce","atStart","atEnd","prevDisabled","loop","nextDisabled","ended","stopped","hasRotation","autoPlay","rotating","goTo","goPrev","goNext","advance","useEventCallback","current","prev","id","autoPlayInterval","toggleRotation","rootHandlers","composeEventHandlers","onMouseEnter","onMouseLeave","onFocus","from","event","entering","onBlur","next","cn","carouselClassNames","className","offset","chevronClass","pauseLabel","autoPlayLabels","playLabel","previousLabel","labels","nextLabel","pickerLabel","slideLabel","carouselRoleDescription","slideRoleDescription","jsx","active","i","node","key","focusableDisabledProps","preventIfDisabled","ChevronLeftIcon","ChevronRightIcon","forcedColors","carouselItemClassNames","Carousel"],"sources":["../../../src/components/layout/Carousel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { carouselClassNames, carouselItemClassNames } from '../../lib/classNames';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { warnOnce } from '../../lib/dev';\nimport { slotRendersContent } from '../../lib/slot';\nimport { focusableDisabledProps, preventIfDisabled } from '../../lib/aria';\nimport { disabledStyles, focusRing, forcedColors } from '../../lib/styles';\nimport { ChevronLeftIcon, ChevronRightIcon } from '../../lib/icons';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useDirection } from '../../hooks/useDirection';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion';\n\n/** Accessible names of the rotation control shown while `autoPlay` is on. */\nexport interface CarouselAutoPlayLabels {\n /** Name of the control while slides rotate (activating it stops the rotation).\n * @default 'Pause slide rotation'\n */\n pause?: string;\n /** Name of the control while rotation is stopped (activating it starts the rotation).\n * @default 'Start slide rotation'\n */\n play?: string;\n}\n\n/**\n * Accessible names of the Carousel's built-in controls and slides, and the role descriptions of\n * the carousel and its slides, for localization. Each member is optional and falls back to its\n * English default. The rotation control has its own `autoPlayLabels`; the region's name comes\n * from `aria-label` or `aria-labelledby`.\n */\nexport interface CarouselLabels {\n /** Name of the Previous button.\n * @default 'Previous slide'\n */\n previous?: string;\n /** Name of the Next button.\n * @default 'Next slide'\n */\n next?: string;\n /** Name of the group that holds the slide picker buttons.\n * @default 'Choose slide'\n */\n picker?: string;\n /**\n * Name of the slide at `index` (zero-based, like `value`) out of `total` slides. It names the\n * slide itself and its picker button, and is announced by the live region when that slide is\n * shown.\n * @default (index, total) => `Slide ${index + 1} of ${total}`\n */\n slide?: (index: number, total: number) => string;\n /** How assistive technology announces the carousel region (`aria-roledescription`).\n * @default 'carousel'\n */\n carouselRoleDescription?: string;\n /** How assistive technology announces each slide (`aria-roledescription`).\n * @default 'slide'\n */\n slideRoleDescription?: string;\n}\n\n/** Properties for the Carousel component. */\nexport interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Controlled index of the currently active slide. Out-of-range values show the nearest slide. */\n value?: number;\n /** Default active slide index for uncontrolled usage.\n * @default 0\n */\n defaultValue?: number;\n /** Called with the new index when the active slide changes (not when it stays the same). */\n onValueChange?: (index: number) => void;\n /**\n * Rotates the slides automatically. A Pause/Start control is rendered as the first focusable\n * element. Rotation pauses while focus is anywhere inside the carousel (the control included;\n * clicking a control also moves focus there in most browsers) or the pointer is over it (except\n * over the control), and resumes when they leave, unless rotation is stopped. Activating Start\n * rotates at once, also while focus stays on the control; moving focus on to other content\n * pauses again. It starts stopped when the user prefers reduced motion. Without `loop`, rotation\n * ends at the last slide: the control shows Start, and rotation stays stopped (also after the\n * user moves back to an earlier slide) until Start is activated, which continues from the shown\n * slide, or from the first one while the last is shown. The end is tied to its cause: when the\n * number of slides changes (slides loaded later) or `loop` is turned on, rotation continues on\n * its own, unless the user stopped it with Pause.\n * @default false\n */\n autoPlay?: boolean;\n /** Interval in milliseconds between auto-play transitions.\n * @default 5000\n */\n autoPlayInterval?: number;\n /** Accessible names of the rotation control. */\n autoPlayLabels?: CarouselAutoPlayLabels;\n /**\n * Accessible names of the Previous and Next buttons, the slide picker and the slides (also\n * announced by the live region), and the role descriptions of the carousel and its slides, for\n * localization. Unset members keep their English defaults.\n */\n labels?: CarouselLabels;\n /** Whether the carousel loops back to the first slide after the last.\n * @default false\n */\n loop?: boolean;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Properties for the CarouselItem sub-component. */\nexport interface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst DEFAULT_PAUSE_LABEL = 'Pause slide rotation';\nconst DEFAULT_PLAY_LABEL = 'Start slide rotation';\nconst DEFAULT_PREVIOUS_LABEL = 'Previous slide';\nconst DEFAULT_NEXT_LABEL = 'Next slide';\nconst DEFAULT_PICKER_LABEL = 'Choose slide';\nconst defaultSlideLabel = (index: number, total: number) => `Slide ${index + 1} of ${total}`;\nconst DEFAULT_CAROUSEL_ROLE_DESCRIPTION = 'carousel';\nconst DEFAULT_SLIDE_ROLE_DESCRIPTION = 'slide';\n\nfunction clampIndex(index: number, total: number): number {\n if (total <= 0 || !Number.isFinite(index)) return 0;\n return Math.min(Math.max(Math.trunc(index), 0), total - 1);\n}\n\nfunction isRotationControl(target: EventTarget | null): boolean {\n return target instanceof Element && target.closest('[data-carousel-rotation]') !== null;\n}\n\nconst controlButton = [\n 'absolute z-10 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background text-foreground shadow-2',\n 'not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:active:bg-subtle-pressed',\n focusRing,\n disabledStyles,\n].join(' ');\n\nconst PauseGlyph = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"3\" width=\"3\" height=\"10\" rx=\"1\" />\n <rect x=\"9\" y=\"3\" width=\"3\" height=\"10\" rx=\"1\" />\n </svg>\n);\n\nconst PlayGlyph = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M5 3.5v9a.5.5 0 0 0 .77.42l7-4.5a.5.5 0 0 0 0-.84l-7-4.5A.5.5 0 0 0 5 3.5Z\" />\n </svg>\n);\n\n// The Carousel root, documented on the exported `Carousel` const.\nconst CarouselRoot = ({\n value: controlledValue,\n defaultValue = 0,\n onValueChange,\n autoPlay = false,\n autoPlayInterval = 5000,\n autoPlayLabels,\n labels,\n loop = false,\n className,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ref,\n ...rest\n}: CarouselProps) => {\n const [storedIndex, setActiveIndex] = useControllable(\n controlledValue,\n defaultValue,\n onValueChange,\n );\n const trackId = useId('carousel-slides');\n const [rootEl, setRootEl] = React.useState<HTMLDivElement | null>(null);\n const rootRef = useMergedRefs<HTMLDivElement>(ref, setRootEl);\n // The direction that applies to the rendered root (its own or an ancestor's `dir`, e.g. an RTL\n // section inside an LTR WaveProvider); before mount and on the server, the provider's/document's.\n const renderedDir = useDirection(rootEl);\n const dir = rest.dir === 'rtl' || rest.dir === 'ltr' ? rest.dir : renderedDir;\n const prefersReducedMotion = usePrefersReducedMotion();\n\n // Rotation state: stopped or not (the user's choice, stopped by default under reduced motion, or\n // ended at the last slide without loop) and the temporary pauses while the pointer is over the\n // content or focus is inside. An explicit Start overrides the focus pause while focus stays on\n // the rotation control (APG `hasUserActivatedPlay`), so pressing Start visibly starts the\n // rotation.\n const [userPaused, setUserPaused] = React.useState<boolean | null>(null);\n // The slide count at which rotation ended at the last slide (null while it has not ended), kept\n // apart from the user's choice so the end lasts only while its cause does.\n const [endedAt, setEndedAt] = React.useState<number | null>(null);\n const [hovered, setHovered] = React.useState(false);\n const [pointerOnControl, setPointerOnControl] = React.useState(false);\n const [focusWithin, setFocusWithin] = React.useState(false);\n const [startedFromControl, setStartedFromControl] = React.useState(false);\n\n // Slides are the `CarouselItem` children, Fragments flattened; the element type is unwrapped, so\n // slides written in a Server Component (lazy client references) count too (C-COMPOUND).\n const items: Array<{ key: string; node: React.ReactNode }> = [];\n let droppedChildren = false;\n for (const child of flattenChildren(children)) {\n if (isElementOfType(child.node, CarouselItem)) items.push(child);\n else if (slotRendersContent(child.node)) droppedChildren = true;\n }\n const total = items.length;\n\n React.useEffect(() => {\n if (droppedChildren) {\n warnOnce(\n 'Carousel:non-item-children',\n 'Carousel: only `Carousel.Item` (`CarouselItem`) children are slides, directly or in ' +\n 'Fragments; other children are not rendered. A component that renders `Carousel.Item` ' +\n 'itself is not recognised: render the `Carousel.Item` in the Carousel and put the ' +\n 'component inside it.',\n );\n }\n }, [droppedChildren]);\n\n // Derived during render (C-HOOKS): removed slides or an out-of-range value show the nearest one.\n const index = clampIndex(storedIndex, total);\n const atStart = index <= 0;\n const atEnd = index >= total - 1;\n const prevDisabled = total <= 1 || (!loop && atStart);\n const nextDisabled = total <= 1 || (!loop && atEnd);\n\n // Without loop, rotation ends at the last slide (however it got there) and stays stopped: moving\n // back to an earlier slide does not restart it, only Start does. The end applies to the slide\n // count it happened at: once slides are added or removed, or loop is turned on, it is dropped\n // and rotation continues unless the user stopped it (adjusting state during render, C-HOOKS).\n const ended = endedAt === total && !loop;\n const stopped = (userPaused ?? prefersReducedMotion) || ended;\n const hasRotation = autoPlay && total > 1;\n if (hasRotation && !loop && atEnd && !stopped) setEndedAt(total);\n else if (endedAt !== null && !ended) setEndedAt(null);\n const pausedByPointer = hovered && !pointerOnControl;\n const pausedByFocus = focusWithin && !startedFromControl;\n const rotating = hasRotation && !stopped && !pausedByPointer && !pausedByFocus;\n\n // Compares with the shown (clamped) index, so re-picking the visible slide reports nothing.\n const goTo = (target: number) => {\n if (target >= 0 && target < total && target !== index) setActiveIndex(target);\n };\n const goPrev = () => goTo(atStart ? total - 1 : index - 1);\n const goNext = () => goTo(atEnd ? 0 : index + 1);\n\n // Reads the latest index at tick time (the updater's base), so the interval does not restart on\n // every slide or parent render and consecutive ticks chain even before a re-render.\n const advance = useEventCallback(() => {\n setActiveIndex((prev) => {\n const current = clampIndex(prev, total);\n if (current < total - 1) return current + 1;\n return loop ? 0 : prev;\n });\n });\n\n React.useEffect(() => {\n if (!rotating) return;\n const id = setInterval(advance, autoPlayInterval);\n return () => clearInterval(id);\n }, [rotating, autoPlayInterval, advance]);\n\n const toggleRotation = () => {\n if (stopped) {\n // Start: from the first slide when rotation had ended at the last one.\n if (!loop && atEnd) goTo(0);\n setEndedAt(null);\n setUserPaused(false);\n setStartedFromControl(true);\n } else {\n setUserPaused(true);\n setStartedFromControl(false);\n }\n };\n\n // The consumer's pointer and focus handlers composed with the pause tracking (C-COMPOSE). The\n // empty root gets them too: the consumer's handlers still run, and a pointer or focus that leaves\n // while there are no slides (slides being reloaded) does not keep rotation paused afterwards.\n const rootHandlers = {\n onMouseEnter: composeEventHandlers(onMouseEnter, () => setHovered(true)),\n onMouseLeave: composeEventHandlers(onMouseLeave, () => setHovered(false)),\n onFocus: composeEventHandlers(onFocus, (event: React.FocusEvent<HTMLDivElement>) => {\n // Any focus inside pauses (APG), the rotation control included. Focus that enters from\n // outside or moves on to other content ends the exemption of an explicit Start.\n const from = event.relatedTarget;\n const entering = !(from instanceof Node && event.currentTarget.contains(from));\n setFocusWithin(true);\n if (entering || !isRotationControl(event.target)) setStartedFromControl(false);\n }),\n onBlur: composeEventHandlers(onBlur, (event: React.FocusEvent<HTMLDivElement>) => {\n const next = event.relatedTarget;\n if (!(next instanceof Node && event.currentTarget.contains(next))) {\n setFocusWithin(false);\n setStartedFromControl(false);\n }\n }),\n };\n\n if (total === 0) {\n return (\n <div\n ref={rootRef}\n className={cn(carouselClassNames.root, 'relative', className)}\n {...rootHandlers}\n {...rest}\n />\n );\n }\n\n const offset = (dir === 'rtl' ? 1 : -1) * index * 100;\n // The chevrons mirror by the same resolved direction as the track. A CSS `rtl:` variant would\n // also match `[dir=rtl] *`, so an LTR carousel inside an RTL ancestor got mirrored chevrons.\n const chevronClass = dir === 'rtl' ? '-scale-x-100' : undefined;\n const pauseLabel = autoPlayLabels?.pause ?? DEFAULT_PAUSE_LABEL;\n const playLabel = autoPlayLabels?.play ?? DEFAULT_PLAY_LABEL;\n const previousLabel = labels?.previous ?? DEFAULT_PREVIOUS_LABEL;\n const nextLabel = labels?.next ?? DEFAULT_NEXT_LABEL;\n const pickerLabel = labels?.picker ?? DEFAULT_PICKER_LABEL;\n const slideLabel = labels?.slide ?? defaultSlideLabel;\n const carouselRoleDescription =\n labels?.carouselRoleDescription ?? DEFAULT_CAROUSEL_ROLE_DESCRIPTION;\n const slideRoleDescription = labels?.slideRoleDescription ?? DEFAULT_SLIDE_ROLE_DESCRIPTION;\n\n return (\n <div\n ref={rootRef}\n role=\"region\"\n aria-roledescription={carouselRoleDescription}\n aria-label=\"Carousel\"\n // A stacking context of its own: the controls' z-index cannot lift them over page headers.\n className={cn(carouselClassNames.root, 'relative isolate overflow-hidden', className)}\n {...rootHandlers}\n {...rest}\n >\n {hasRotation && (\n <button\n type=\"button\"\n data-carousel-rotation=\"\"\n aria-label={stopped ? playLabel : pauseLabel}\n aria-controls={trackId}\n onClick={toggleRotation}\n // The pointer over the control does not pause (APG): the user is operating it.\n onMouseEnter={() => setPointerOnControl(true)}\n onMouseLeave={() => setPointerOnControl(false)}\n className={cn(carouselClassNames.autoPlayButton, controlButton, 'top-2 start-2')}\n >\n {stopped ? <PlayGlyph /> : <PauseGlyph />}\n </button>\n )}\n <div\n id={trackId}\n className={cn(\n carouselClassNames.track,\n 'flex transition-transform duration-300 ease-in-out motion-reduce:transition-none',\n )}\n style={{ transform: `translateX(${offset}%)` }}\n >\n {items.map(({ key, node }, i) => {\n const active = i === index;\n return (\n <div\n key={key}\n role=\"group\"\n aria-roledescription={slideRoleDescription}\n aria-label={slideLabel(i, total)}\n aria-hidden={active ? undefined : true}\n inert={!active}\n className={cn(carouselClassNames.slide, 'w-full shrink-0')}\n >\n {node}\n </div>\n );\n })}\n </div>\n {/* Announces the current slide, except while slides rotate on their own. */}\n <div aria-live={rotating ? 'off' : 'polite'} aria-atomic=\"true\" className=\"sr-only\">\n {slideLabel(index, total)}\n </div>\n <button\n type=\"button\"\n aria-label={previousLabel}\n aria-controls={trackId}\n {...focusableDisabledProps(prevDisabled)}\n onClick={preventIfDisabled(prevDisabled, goPrev)}\n className={cn(\n carouselClassNames.previousButton,\n controlButton,\n 'top-1/2 start-2 -translate-y-1/2',\n )}\n >\n <ChevronLeftIcon size={16} className={chevronClass} />\n </button>\n <button\n type=\"button\"\n aria-label={nextLabel}\n aria-controls={trackId}\n {...focusableDisabledProps(nextDisabled)}\n onClick={preventIfDisabled(nextDisabled, goNext)}\n className={cn(\n carouselClassNames.nextButton,\n controlButton,\n 'top-1/2 end-2 -translate-y-1/2',\n )}\n >\n <ChevronRightIcon size={16} className={chevronClass} />\n </button>\n <div\n role=\"group\"\n aria-label={pickerLabel}\n className={cn(\n carouselClassNames.picker,\n 'absolute inset-x-0 bottom-1 z-10 mx-auto flex w-fit',\n )}\n >\n {items.map(({ key }, i) => {\n const active = i === index;\n return (\n <button\n key={key}\n type=\"button\"\n aria-label={slideLabel(i, total)}\n aria-current={active ? 'true' : undefined}\n onClick={() => goTo(i)}\n className={cn(\n carouselClassNames.pickerButton,\n 'group inline-flex h-6 min-w-6 items-center justify-center',\n focusRing,\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n carouselClassNames.pickerIndicator,\n 'block h-2 rounded-full transition-[width,background-color] duration-200 motion-reduce:transition-none',\n active\n ? cn('w-5 bg-primary', forcedColors.selectedLeaf)\n : 'w-2 bg-stroke-accessible group-hover:bg-foreground forced-colors:bg-[ButtonText] forced-colors:forced-color-adjust-none',\n )}\n />\n </button>\n );\n })}\n </div>\n </div>\n );\n};\nCarouselRoot.displayName = 'Carousel';\n\n/**\n * One slide of a {@link Carousel}. Write it in the Carousel, directly or in a Fragment: a component\n * that renders `Carousel.Item` itself is not recognised as a slide (put that component inside the\n * `Carousel.Item` instead).\n */\nexport const CarouselItem = ({ className, children, ref, ...rest }: CarouselItemProps) => {\n return (\n <div ref={ref} className={cn(carouselItemClassNames.root, 'p-4', className)} {...rest}>\n {children}\n </div>\n );\n};\nCarouselItem.displayName = 'CarouselItem';\n\n/**\n * A slideshow that shows one slide at a time (WAI-ARIA APG carousel with previous/next buttons\n * and a slide picker).\n *\n * - Slides are the `Carousel.Item` (`CarouselItem`) children, written directly in the Carousel or\n * in Fragments. Other children are not rendered (a development warning says so). A component\n * that renders `Carousel.Item` itself is not recognised: write the `Carousel.Item` in the\n * Carousel and put the component inside it.\n * - Previous/Next stay focusable at the ends (`aria-disabled`), so keyboard focus is not lost.\n * - The slide picker is a group of buttons named \"Slide n of m\"; the active one has\n * `aria-current=\"true\"`.\n * - Inactive slides are `aria-hidden` and `inert`, so neither Tab nor a screen reader reaches\n * their content.\n * - With `autoPlay`, a Pause/Start control comes first (WAI-ARIA APG): rotation pauses while\n * focus is inside the carousel (in most browsers also after a click on one of its controls) or\n * the pointer is over its content, activating Start rotates at once, and the live region is\n * silent (`aria-live=\"off\"`) while slides rotate. Without `loop` rotation ends at the last slide\n * and stays stopped until the control's Start is activated (or the number of slides changes, or\n * `loop` is turned on).\n * - Right-to-left layouts slide the other way and mirror the Previous/Next chevrons: the direction\n * is read from the rendered element (its `dir` prop, the nearest ancestor's `dir`, WaveProvider\n * `dir` or the document's), so an LTR section inside an RTL page stays LTR throughout.\n * - Name the carousel with `aria-label` or `aria-labelledby` (the fallback name is \"Carousel\").\n * The built-in names and role descriptions are English: `labels` and `autoPlayLabels`\n * translate them.\n * - The controls are layered over the slides inside the carousel's own stacking context, so they\n * never paint over page headers that stay in view while the page scrolls.\n *\n * Compound access (`Carousel.Item`) needs a client module; React Server Components import the\n * flat name `CarouselItem` instead.\n */\nexport const Carousel = /* @__PURE__ */ Object.assign(CarouselRoot, {\n Item: CarouselItem,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkHA,IAAMG,KAAsB,wBACtBC,KAAqB,wBACrBC,KAAyB,kBACzBC,KAAqB,cACrBC,KAAuB,gBACvBC,MAAqB,GAAe,MAAkB,SAASC,IAAQ,EAAE,MAAMC,KAC/EC,KAAoC,YACpCC,KAAiC;AAEvC,SAASC,EAAW,GAAe,GAAuB;CAExD,OADIH,KAAS,KAAK,CAAC,OAAO,SAASD,CAAK,IAAU,IAC3C,KAAK,IAAI,KAAK,IAAI,KAAK,MAAMA,CAAK,GAAG,CAAC,GAAGC,IAAQ,CAAC;AAC3D;AAEA,SAASI,GAAkB,GAAqC;CAC9D,OAAOC,aAAkB,WAAWA,EAAO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tual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs"),r=require("../../lib/focus.cjs"),i=require("../../hooks/useMergedRefs.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={row:`flex-row`,"row-reverse":`flex-row-reverse`,column:`flex-col`,"column-reverse":`flex-col-reverse`},c={nowrap:`flex-nowrap`,wrap:`flex-wrap`,"wrap-reverse":`flex-wrap-reverse`},l={start:`items-start`,center:`items-center`,end:`items-end`,stretch:`items-stretch`,baseline:`items-baseline`},u={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`},d=`Flex:reverse-focus-order`,f={none:`gap-0`,xs:`gap-1`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},p=e=>{let{as:p,direction:m=`row`,wrap:h,align:g,justify:_,gap:v,inline:y,grow:b,shrink:x,className:S,children:C,ref:w,...T}=e,E=p??`div`,D=m===`row-reverse`||m===`column-reverse`||h===`wrap-reverse`,O=a.useRef(null),k=i.useMergedRefs(w,O);return a.useEffect(()=>{let e=O.current;n.isDev&&D&&e&&!n.hasWarned(d)&&r.getTabbableElements(e).length>0&&n.warnOnce(d,"Flex: a reversed direction or wrap (`row-reverse`, `column-reverse`, `wrap-reverse`) changes the visual order only, so keyboard and screen-reader order run opposite to what users see. Reorder the DOM for focusable content instead.")}),(0,o.jsx)(E,{ref:k,className:t.cn(y?`inline-flex`:`flex`,s[m],h&&c[h],g&&l[g],_&&u[_],v&&f[v],b&&`grow`,x===!0&&`shrink`,x===!1&&`shrink-0`,S),...T,children:C})};p.displayName=`Flex`,exports.Flex=p;
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs"),r=require("../../lib/classNames.cjs"),i=require("../../lib/focus.cjs"),a=require("../../hooks/useMergedRefs.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c={row:`flex-row`,"row-reverse":`flex-row-reverse`,column:`flex-col`,"column-reverse":`flex-col-reverse`},l={nowrap:`flex-nowrap`,wrap:`flex-wrap`,"wrap-reverse":`flex-wrap-reverse`},u={start:`items-start`,center:`items-center`,end:`items-end`,stretch:`items-stretch`,baseline:`items-baseline`},d={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`},f=`Flex:reverse-focus-order`,p={none:`gap-0`,xs:`gap-1`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},m=e=>{let{as:m,direction:h=`row`,wrap:g,align:_,justify:v,gap:y,inline:b,grow:x,shrink:S,className:C,children:w,ref:T,...E}=e,D=m??`div`,O=h===`row-reverse`||h===`column-reverse`||g===`wrap-reverse`,k=o.useRef(null),A=a.useMergedRefs(T,k);return o.useEffect(()=>{let e=k.current;n.isDev&&O&&e&&!n.hasWarned(f)&&i.getTabbableElements(e).length>0&&n.warnOnce(f,"Flex: a reversed direction or wrap (`row-reverse`, `column-reverse`, `wrap-reverse`) changes the visual order only, so keyboard and screen-reader order run opposite to what users see. Reorder the DOM for focusable content instead.")}),(0,s.jsx)(D,{ref:A,className:t.cn(r.flexClassNames.root,b?`inline-flex`:`flex`,c[h],g&&l[g],_&&u[_],v&&d[v],y&&p[y],x&&`grow`,S===!0&&`shrink`,S===!1&&`shrink-0`,C),...E,children:w})};m.displayName=`Flex`,exports.Flex=m;
2
2
  //# sourceMappingURL=Flex.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.cjs","names":["React","useMergedRefs","isDev","hasWarned","getTabbableElements","cn","require_runtime","require_cn","require_dev","require_focus","require_useMergedRefs","react","react_jsx_runtime","directionMap","wrapMap","alignMap","justifyMap","REVERSE_WARNING","gapMap","Flex","rest","props","Component","as","reversed","direction","wrap","rootRef","mergedRef","ref","root","inline","align","justify","gap","grow","shrink","className"],"sources":["../../../src/components/layout/Flex.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { hasWarned, isDev, warnOnce } from '../../lib/dev';\nimport { getTabbableElements } from '../../lib/focus';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\n\nconst directionMap = {\n row: 'flex-row',\n 'row-reverse': 'flex-row-reverse',\n column: 'flex-col',\n 'column-reverse': 'flex-col-reverse',\n} as const;\n\nconst wrapMap = {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n} as const;\n\nconst alignMap = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\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/** Warn-once key of the \"reversed order with focusable content\" diagnostic. */\nconst REVERSE_WARNING = 'Flex:reverse-focus-order';\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\n/**\n * The Flex'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 FlexOwnProps {\n /**\n * Flex direction.\n *\n * **Accessibility:** `row-reverse` and `column-reverse` reverse the *visual* order only. Tab order\n * and screen-reader reading order still follow the DOM, so they run opposite to what sighted\n * users see (WCAG 1.3.2, 2.4.3). For focusable or meaningful content, reorder the DOM instead; a\n * development warning fires when a reversed Flex contains focusable elements.\n * @default 'row'\n */\n direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';\n /**\n * Flex wrap behavior. `wrap-reverse` reverses the visual line order only (see `direction`).\n */\n wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n /** Cross-axis alignment of items. */\n align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';\n /** Main-axis justification of items. */\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n /** Gap size between flex items. */\n gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Whether to use inline-flex instead of flex. */\n inline?: boolean;\n /** Whether the flex container should grow to fill available space in its own flex parent. */\n grow?: boolean;\n /**\n * How the container shrinks in its own flex parent: `false` prevents shrinking (`shrink-0`),\n * `true` sets `shrink` explicitly (the CSS default, useful to undo an inherited `shrink-0`).\n * Unset emits no class.\n */\n shrink?: boolean;\n}\n\n/**\n * Props of {@link Flex} rendered as `C` (default `'div'`). `FlexProps` without a type argument is\n * the 0.4 name: the props of a Flex rendered as a `<div>`, including `ref`.\n */\nexport type FlexProps<C extends React.ElementType = 'div'> = PolymorphicProps<C, FlexOwnProps>;\n\ntype FlexImplProps = FlexOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * A flexbox layout container with token-based gaps.\n *\n * Reversed directions (`row-reverse`, `column-reverse`, `wrap=\"wrap-reverse\"`) change the visual\n * order only: keep them for decorative or static content and reorder the DOM for anything\n * focusable (a development warning fires otherwise).\n *\n * @example\n * <Flex gap=\"md\" align=\"center\" justify=\"between\">\n * <Text>Title</Text>\n * <Button>Action</Button>\n * </Flex>\n */\nexport const Flex: PolymorphicComponent<'div', FlexOwnProps> = (props) => {\n const {\n as,\n direction = 'row',\n wrap,\n align,\n justify,\n gap,\n inline,\n grow,\n shrink,\n className,\n children,\n ref,\n ...rest\n } = props as FlexImplProps;\n const Component: React.ElementType = as ?? 'div';\n const reversed =\n direction === 'row-reverse' || direction === 'column-reverse' || wrap === 'wrap-reverse';\n\n const rootRef = React.useRef<HTMLElement | null>(null);\n const mergedRef = useMergedRefs<HTMLElement>(ref, rootRef);\n\n // Development diagnostic (C-DEV): children change without prop changes, so check every commit\n // until the warning has fired once; after that the DOM scan is skipped.\n React.useEffect(() => {\n const root = rootRef.current;\n if (!isDev || !reversed || !root || hasWarned(REVERSE_WARNING)) return;\n if (getTabbableElements(root).length > 0) {\n warnOnce(\n REVERSE_WARNING,\n 'Flex: a reversed direction or wrap (`row-reverse`, `column-reverse`, `wrap-reverse`) changes the visual order only, so keyboard and screen-reader order run opposite to what users see. Reorder the DOM for focusable content instead.',\n );\n }\n });\n\n return (\n <Component\n ref={mergedRef}\n className={cn(\n inline ? 'inline-flex' : 'flex',\n directionMap[direction],\n wrap && wrapMap[wrap],\n align && alignMap[align],\n justify && justifyMap[justify],\n gap && gapMap[gap],\n grow && 'grow',\n shrink === true && 'shrink',\n shrink === false && 'shrink-0',\n className,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n};\nFlex.displayName = 'Flex';\n"],"mappings":"yRAOA,IAAMa,EAAe,CACnB,IAAK,WACL,cAAe,mBACf,OAAQ,WACR,iBAAkB,kBACpB,EAEMC,EAAU,CACd,OAAQ,cACR,KAAM,YACN,eAAgB,mBAClB,EAEMC,EAAW,CACf,MAAO,cACP,OAAQ,eACR,IAAK,YACL,QAAS,gBACT,SAAU,gBACZ,EAEMC,EAAa,CACjB,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,OAAQ,gBACV,EAGMC,EAAkB,2BAElBC,EAAS,CACb,KAAM,QACN,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,EAgEaC,EAAmD,GAAU,CACxE,GAAM,CACJ,KACA,YAAY,MACZ,OACA,QACA,UACA,MACA,SACA,OACA,SACA,YACA,WACA,MACA,GAAGC,GACDC,EACEC,EAA+BC,GAAM,MACrCC,EACJC,IAAc,eAAiBA,IAAc,kBAAoBC,IAAS,eAEtEC,EAAU3B,EAAM,OAA2B,IAAI,EAC/C4B,EAAY3B,EAAAA,cAA2B4B,EAAKF,CAAO,EAezD,OAXAhB,EAAM,cAAgB,CACpB,IAAMmB,EAAOH,EAAQ,QAChBzB,EAAAA,OAAUsB,GAAaM,GAAQ3B,GAAAA,UAAUc,CAAe,GACzDb,EAAAA,oBAAoB0B,CAAI,CAAC,CAAC,OAAS,GACrCtB,EAAA,SACES,EACA,wOACF,CAEJ,CAAC,GAGC,EAAAL,EAAA,IAAA,CAACU,EAAD,CACE,IAAKM,EACL,UAAWvB,EAAAA,GACT0B,EAAS,cAAgB,OACzBlB,EAAaY,GACbC,GAAQZ,EAAQY,GAChBM,GAASjB,EAASiB,GAClBC,GAAWjB,EAAWiB,GACtBC,GAAOhB,EAAOgB,GACdC,GAAQ,OACRC,IAAW,IAAQ,SACnBA,IAAW,IAAS,WACpBC,CACF,EACA,GAAIjB,EAEH,UACQ,CAAA,CAEf,EACA,EAAK,YAAc"}
1
+ {"version":3,"file":"Flex.cjs","names":["React","useMergedRefs","isDev","hasWarned","getTabbableElements","cn","flexClassNames","require_runtime","require_cn","require_dev","require_classNames","require_focus","require_useMergedRefs","react","react_jsx_runtime","directionMap","wrapMap","alignMap","justifyMap","REVERSE_WARNING","gapMap","Flex","rest","props","Component","as","reversed","direction","wrap","rootRef","mergedRef","ref","root","inline","align","justify","gap","grow","shrink","className"],"sources":["../../../src/components/layout/Flex.tsx"],"sourcesContent":["import * as React from 'react';\nimport { flexClassNames } from '../../lib/classNames';\nimport { cn } from '../../lib/cn';\nimport { hasWarned, isDev, warnOnce } from '../../lib/dev';\nimport { getTabbableElements } from '../../lib/focus';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\n\nconst directionMap = {\n row: 'flex-row',\n 'row-reverse': 'flex-row-reverse',\n column: 'flex-col',\n 'column-reverse': 'flex-col-reverse',\n} as const;\n\nconst wrapMap = {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n} as const;\n\nconst alignMap = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\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/** Warn-once key of the \"reversed order with focusable content\" diagnostic. */\nconst REVERSE_WARNING = 'Flex:reverse-focus-order';\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\n/**\n * The Flex'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 FlexOwnProps {\n /**\n * Flex direction.\n *\n * **Accessibility:** `row-reverse` and `column-reverse` reverse the *visual* order only. Tab order\n * and screen-reader reading order still follow the DOM, so they run opposite to what sighted\n * users see (WCAG 1.3.2, 2.4.3). For focusable or meaningful content, reorder the DOM instead; a\n * development warning fires when a reversed Flex contains focusable elements.\n * @default 'row'\n */\n direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';\n /**\n * Flex wrap behavior. `wrap-reverse` reverses the visual line order only (see `direction`).\n */\n wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n /** Cross-axis alignment of items. */\n align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';\n /** Main-axis justification of items. */\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n /** Gap size between flex items. */\n gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Whether to use inline-flex instead of flex. */\n inline?: boolean;\n /** Whether the flex container should grow to fill available space in its own flex parent. */\n grow?: boolean;\n /**\n * How the container shrinks in its own flex parent: `false` prevents shrinking (`shrink-0`),\n * `true` sets `shrink` explicitly (the CSS default, useful to undo an inherited `shrink-0`).\n * Unset emits no class.\n */\n shrink?: boolean;\n}\n\n/**\n * Props of {@link Flex} rendered as `C` (default `'div'`). `FlexProps` without a type argument is\n * the 0.4 name: the props of a Flex rendered as a `<div>`, including `ref`.\n */\nexport type FlexProps<C extends React.ElementType = 'div'> = PolymorphicProps<C, FlexOwnProps>;\n\ntype FlexImplProps = FlexOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * A flexbox layout container with token-based gaps.\n *\n * Reversed directions (`row-reverse`, `column-reverse`, `wrap=\"wrap-reverse\"`) change the visual\n * order only: keep them for decorative or static content and reorder the DOM for anything\n * focusable (a development warning fires otherwise).\n *\n * @example\n * <Flex gap=\"md\" align=\"center\" justify=\"between\">\n * <Text>Title</Text>\n * <Button>Action</Button>\n * </Flex>\n */\nexport const Flex: PolymorphicComponent<'div', FlexOwnProps> = (props) => {\n const {\n as,\n direction = 'row',\n wrap,\n align,\n justify,\n gap,\n inline,\n grow,\n shrink,\n className,\n children,\n ref,\n ...rest\n } = props as FlexImplProps;\n const Component: React.ElementType = as ?? 'div';\n const reversed =\n direction === 'row-reverse' || direction === 'column-reverse' || wrap === 'wrap-reverse';\n\n const rootRef = React.useRef<HTMLElement | null>(null);\n const mergedRef = useMergedRefs<HTMLElement>(ref, rootRef);\n\n // Development diagnostic (C-DEV): children change without prop changes, so check every commit\n // until the warning has fired once; after that the DOM scan is skipped.\n React.useEffect(() => {\n const root = rootRef.current;\n if (!isDev || !reversed || !root || hasWarned(REVERSE_WARNING)) return;\n if (getTabbableElements(root).length > 0) {\n warnOnce(\n REVERSE_WARNING,\n 'Flex: a reversed direction or wrap (`row-reverse`, `column-reverse`, `wrap-reverse`) changes the visual order only, so keyboard and screen-reader order run opposite to what users see. Reorder the DOM for focusable content instead.',\n );\n }\n });\n\n return (\n <Component\n ref={mergedRef}\n className={cn(\n flexClassNames.root,\n inline ? 'inline-flex' : 'flex',\n directionMap[direction],\n wrap && wrapMap[wrap],\n align && alignMap[align],\n justify && justifyMap[justify],\n gap && gapMap[gap],\n grow && 'grow',\n shrink === true && 'shrink',\n shrink === false && 'shrink-0',\n className,\n )}\n {...rest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,GAAIjB,EAEH,UACQ,CAAA,CAEf,EACA,EAAK,YAAc"}
@@ -1,54 +1,55 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/cn.mjs";
3
3
  import { hasWarned as t, isDev as n, warnOnce as r } from "../../lib/dev.mjs";
4
- import { getTabbableElements as i } from "../../lib/focus.mjs";
5
- import { useMergedRefs as a } from "../../hooks/useMergedRefs.mjs";
6
- import * as o from "react";
7
- import { jsx as s } from "react/jsx-runtime";
4
+ import { flexClassNames as i } from "../../lib/classNames.mjs";
5
+ import { getTabbableElements as a } from "../../lib/focus.mjs";
6
+ import { useMergedRefs as o } from "../../hooks/useMergedRefs.mjs";
7
+ import * as s from "react";
8
+ import { jsx as c } from "react/jsx-runtime";
8
9
  //#region src/components/layout/Flex.tsx
9
- var c = {
10
+ var l = {
10
11
  row: "flex-row",
11
12
  "row-reverse": "flex-row-reverse",
12
13
  column: "flex-col",
13
14
  "column-reverse": "flex-col-reverse"
14
- }, l = {
15
+ }, u = {
15
16
  nowrap: "flex-nowrap",
16
17
  wrap: "flex-wrap",
17
18
  "wrap-reverse": "flex-wrap-reverse"
18
- }, u = {
19
+ }, d = {
19
20
  start: "items-start",
20
21
  center: "items-center",
21
22
  end: "items-end",
22
23
  stretch: "items-stretch",
23
24
  baseline: "items-baseline"
24
- }, d = {
25
+ }, f = {
25
26
  start: "justify-start",
26
27
  center: "justify-center",
27
28
  end: "justify-end",
28
29
  between: "justify-between",
29
30
  around: "justify-around",
30
31
  evenly: "justify-evenly"
31
- }, f = "Flex:reverse-focus-order", p = {
32
+ }, p = "Flex:reverse-focus-order", m = {
32
33
  none: "gap-0",
33
34
  xs: "gap-1",
34
35
  sm: "gap-2",
35
36
  md: "gap-3",
36
37
  lg: "gap-4",
37
38
  xl: "gap-6"
38
- }, m = (m) => {
39
- let { as: h, direction: g = "row", wrap: _, align: v, justify: y, gap: b, inline: x, grow: S, shrink: C, className: w, children: T, ref: E, ...D } = m, O = h ?? "div", k = g === "row-reverse" || g === "column-reverse" || _ === "wrap-reverse", A = o.useRef(null), j = a(E, A);
40
- return o.useEffect(() => {
41
- let e = A.current;
42
- n && k && e && !t(f) && i(e).length > 0 && r(f, "Flex: a reversed direction or wrap (`row-reverse`, `column-reverse`, `wrap-reverse`) changes the visual order only, so keyboard and screen-reader order run opposite to what users see. Reorder the DOM for focusable content instead.");
43
- }), /* @__PURE__ */ s(O, {
44
- ref: j,
45
- className: e(x ? "inline-flex" : "flex", c[g], _ && l[_], v && u[v], y && d[y], b && p[b], S && "grow", C === !0 && "shrink", C === !1 && "shrink-0", w),
46
- ...D,
47
- children: T
39
+ }, h = (h) => {
40
+ let { as: g, direction: _ = "row", wrap: v, align: y, justify: b, gap: x, inline: S, grow: C, shrink: w, className: T, children: E, ref: D, ...O } = h, k = g ?? "div", A = _ === "row-reverse" || _ === "column-reverse" || v === "wrap-reverse", j = s.useRef(null), M = o(D, j);
41
+ return s.useEffect(() => {
42
+ let e = j.current;
43
+ n && A && e && !t(p) && a(e).length > 0 && r(p, "Flex: a reversed direction or wrap (`row-reverse`, `column-reverse`, `wrap-reverse`) changes the visual order only, so keyboard and screen-reader order run opposite to what users see. Reorder the DOM for focusable content instead.");
44
+ }), /* @__PURE__ */ c(k, {
45
+ ref: M,
46
+ className: e(i.root, S ? "inline-flex" : "flex", l[_], v && u[v], y && d[y], b && f[b], x && m[x], C && "grow", w === !0 && "shrink", w === !1 && "shrink-0", T),
47
+ ...O,
48
+ children: E
48
49
  });
49
50
  };
50
- m.displayName = "Flex";
51
+ h.displayName = "Flex";
51
52
  //#endregion
52
- export { m as Flex };
53
+ export { h as Flex };
53
54
 
54
55
  //# sourceMappingURL=Flex.mjs.map