@mortenbrudvik/waveui 0.4.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (574) hide show
  1. package/README.md +1221 -173
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/dist/components/button/Button.cjs +2 -0
  4. package/dist/components/button/Button.cjs.map +1 -0
  5. package/dist/components/button/Button.mjs +50 -0
  6. package/dist/components/button/Button.mjs.map +1 -0
  7. package/dist/components/button/Button.semantics.cjs +2 -0
  8. package/dist/components/button/Button.semantics.cjs.map +1 -0
  9. package/dist/components/button/Button.semantics.mjs +61 -0
  10. package/dist/components/button/Button.semantics.mjs.map +1 -0
  11. package/dist/components/button/Button.slots.cjs +2 -0
  12. package/dist/components/button/Button.slots.cjs.map +1 -0
  13. package/dist/components/button/Button.slots.mjs +47 -0
  14. package/dist/components/button/Button.slots.mjs.map +1 -0
  15. package/dist/components/button/CompoundButton.cjs +2 -0
  16. package/dist/components/button/CompoundButton.cjs.map +1 -0
  17. package/dist/components/button/CompoundButton.mjs +53 -0
  18. package/dist/components/button/CompoundButton.mjs.map +1 -0
  19. package/dist/components/button/Link.cjs +2 -0
  20. package/dist/components/button/Link.cjs.map +1 -0
  21. package/dist/components/button/Link.mjs +37 -0
  22. package/dist/components/button/Link.mjs.map +1 -0
  23. package/dist/components/button/MenuButton.cjs +2 -0
  24. package/dist/components/button/MenuButton.cjs.map +1 -0
  25. package/dist/components/button/MenuButton.mjs +45 -0
  26. package/dist/components/button/MenuButton.mjs.map +1 -0
  27. package/dist/components/button/SplitButton.cjs +2 -0
  28. package/dist/components/button/SplitButton.cjs.map +1 -0
  29. package/dist/components/button/SplitButton.mjs +66 -0
  30. package/dist/components/button/SplitButton.mjs.map +1 -0
  31. package/dist/components/button/ToggleButton.cjs +2 -0
  32. package/dist/components/button/ToggleButton.cjs.map +1 -0
  33. package/dist/components/button/ToggleButton.mjs +65 -0
  34. package/dist/components/button/ToggleButton.mjs.map +1 -0
  35. package/dist/components/button/Toolbar.cjs +2 -0
  36. package/dist/components/button/Toolbar.cjs.map +1 -0
  37. package/dist/components/button/Toolbar.context.cjs +2 -0
  38. package/dist/components/button/Toolbar.context.cjs.map +1 -0
  39. package/dist/components/button/Toolbar.context.mjs +31 -0
  40. package/dist/components/button/Toolbar.context.mjs.map +1 -0
  41. package/dist/components/button/Toolbar.mjs +63 -0
  42. package/dist/components/button/Toolbar.mjs.map +1 -0
  43. package/dist/components/button/Toolbar.parts.cjs +2 -0
  44. package/dist/components/button/Toolbar.parts.cjs.map +1 -0
  45. package/dist/components/button/Toolbar.parts.mjs +131 -0
  46. package/dist/components/button/Toolbar.parts.mjs.map +1 -0
  47. package/dist/components/button/buttonStyles.cjs +2 -0
  48. package/dist/components/button/buttonStyles.cjs.map +1 -0
  49. package/dist/components/button/buttonStyles.mjs +39 -0
  50. package/dist/components/button/buttonStyles.mjs.map +1 -0
  51. package/dist/components/data-display/Avatar.cjs +2 -0
  52. package/dist/components/data-display/Avatar.cjs.map +1 -0
  53. package/dist/components/data-display/Avatar.mjs +157 -0
  54. package/dist/components/data-display/Avatar.mjs.map +1 -0
  55. package/dist/components/data-display/AvatarGroup.cjs +2 -0
  56. package/dist/components/data-display/AvatarGroup.cjs.map +1 -0
  57. package/dist/components/data-display/AvatarGroup.mjs +134 -0
  58. package/dist/components/data-display/AvatarGroup.mjs.map +1 -0
  59. package/dist/components/data-display/Badge.cjs +2 -0
  60. package/dist/components/data-display/Badge.cjs.map +1 -0
  61. package/dist/components/data-display/Badge.colors.cjs +2 -0
  62. package/dist/components/data-display/Badge.colors.cjs.map +1 -0
  63. package/dist/components/data-display/Badge.colors.mjs +58 -0
  64. package/dist/components/data-display/Badge.colors.mjs.map +1 -0
  65. package/dist/components/data-display/Badge.mjs +32 -0
  66. package/dist/components/data-display/Badge.mjs.map +1 -0
  67. package/dist/components/data-display/CounterBadge.cjs +2 -0
  68. package/dist/components/data-display/CounterBadge.cjs.map +1 -0
  69. package/dist/components/data-display/CounterBadge.mjs +28 -0
  70. package/dist/components/data-display/CounterBadge.mjs.map +1 -0
  71. package/dist/components/data-display/Divider.cjs +2 -0
  72. package/dist/components/data-display/Divider.cjs.map +1 -0
  73. package/dist/components/data-display/Divider.mjs +52 -0
  74. package/dist/components/data-display/Divider.mjs.map +1 -0
  75. package/dist/components/data-display/Image.cjs +2 -0
  76. package/dist/components/data-display/Image.cjs.map +1 -0
  77. package/dist/components/data-display/Image.mjs +32 -0
  78. package/dist/components/data-display/Image.mjs.map +1 -0
  79. package/dist/components/data-display/InfoLabel.cjs +2 -0
  80. package/dist/components/data-display/InfoLabel.cjs.map +1 -0
  81. package/dist/components/data-display/InfoLabel.mjs +104 -0
  82. package/dist/components/data-display/InfoLabel.mjs.map +1 -0
  83. package/dist/components/data-display/List.cjs +2 -0
  84. package/dist/components/data-display/List.cjs.map +1 -0
  85. package/dist/components/data-display/List.mjs +381 -0
  86. package/dist/components/data-display/List.mjs.map +1 -0
  87. package/dist/components/data-display/List.registry.cjs +2 -0
  88. package/dist/components/data-display/List.registry.cjs.map +1 -0
  89. package/dist/components/data-display/List.registry.mjs +101 -0
  90. package/dist/components/data-display/List.registry.mjs.map +1 -0
  91. package/dist/components/data-display/Persona.cjs +2 -0
  92. package/dist/components/data-display/Persona.cjs.map +1 -0
  93. package/dist/components/data-display/Persona.mjs +48 -0
  94. package/dist/components/data-display/Persona.mjs.map +1 -0
  95. package/dist/components/data-display/PresenceBadge.cjs +2 -0
  96. package/dist/components/data-display/PresenceBadge.cjs.map +1 -0
  97. package/dist/components/data-display/PresenceBadge.mjs +71 -0
  98. package/dist/components/data-display/PresenceBadge.mjs.map +1 -0
  99. package/dist/components/data-display/Tag.cjs +2 -0
  100. package/dist/components/data-display/Tag.cjs.map +1 -0
  101. package/dist/components/data-display/Tag.mjs +147 -0
  102. package/dist/components/data-display/Tag.mjs.map +1 -0
  103. package/dist/components/feedback/MessageBar.cjs +2 -0
  104. package/dist/components/feedback/MessageBar.cjs.map +1 -0
  105. package/dist/components/feedback/MessageBar.mjs +144 -0
  106. package/dist/components/feedback/MessageBar.mjs.map +1 -0
  107. package/dist/components/feedback/MessageBar.status.cjs +2 -0
  108. package/dist/components/feedback/MessageBar.status.cjs.map +1 -0
  109. package/dist/components/feedback/MessageBar.status.mjs +45 -0
  110. package/dist/components/feedback/MessageBar.status.mjs.map +1 -0
  111. package/dist/components/feedback/ProgressBar.cjs +2 -0
  112. package/dist/components/feedback/ProgressBar.cjs.map +1 -0
  113. package/dist/components/feedback/ProgressBar.mjs +72 -0
  114. package/dist/components/feedback/ProgressBar.mjs.map +1 -0
  115. package/dist/components/feedback/Skeleton.cjs +2 -0
  116. package/dist/components/feedback/Skeleton.cjs.map +1 -0
  117. package/dist/components/feedback/Skeleton.mjs +47 -0
  118. package/dist/components/feedback/Skeleton.mjs.map +1 -0
  119. package/dist/components/feedback/Spinner.cjs +2 -0
  120. package/dist/components/feedback/Spinner.cjs.map +1 -0
  121. package/dist/components/feedback/Spinner.mjs +60 -0
  122. package/dist/components/feedback/Spinner.mjs.map +1 -0
  123. package/dist/components/feedback/Toast.cjs +2 -0
  124. package/dist/components/feedback/Toast.cjs.map +1 -0
  125. package/dist/components/feedback/Toast.mjs +347 -0
  126. package/dist/components/feedback/Toast.mjs.map +1 -0
  127. package/dist/components/input/Checkbox.cjs +2 -0
  128. package/dist/components/input/Checkbox.cjs.map +1 -0
  129. package/dist/components/input/Checkbox.mjs +96 -0
  130. package/dist/components/input/Checkbox.mjs.map +1 -0
  131. package/dist/components/input/ColorPicker.cjs +6 -0
  132. package/dist/components/input/ColorPicker.cjs.map +1 -0
  133. package/dist/components/input/ColorPicker.mjs +236 -0
  134. package/dist/components/input/ColorPicker.mjs.map +1 -0
  135. package/dist/components/input/Combobox.cjs +2 -0
  136. package/dist/components/input/Combobox.cjs.map +1 -0
  137. package/dist/components/input/Combobox.expand.cjs +2 -0
  138. package/dist/components/input/Combobox.expand.cjs.map +1 -0
  139. package/dist/components/input/Combobox.expand.mjs +38 -0
  140. package/dist/components/input/Combobox.expand.mjs.map +1 -0
  141. package/dist/components/input/Combobox.mjs +187 -0
  142. package/dist/components/input/Combobox.mjs.map +1 -0
  143. package/dist/components/input/DatePicker.cjs +2 -0
  144. package/dist/components/input/DatePicker.cjs.map +1 -0
  145. package/dist/components/input/DatePicker.mjs +340 -0
  146. package/dist/components/input/DatePicker.mjs.map +1 -0
  147. package/dist/components/input/Dropdown.cjs +2 -0
  148. package/dist/components/input/Dropdown.cjs.map +1 -0
  149. package/dist/components/input/Dropdown.mjs +128 -0
  150. package/dist/components/input/Dropdown.mjs.map +1 -0
  151. package/dist/components/input/Field.cjs +2 -0
  152. package/dist/components/input/Field.cjs.map +1 -0
  153. package/dist/components/input/Field.mjs +200 -0
  154. package/dist/components/input/Field.mjs.map +1 -0
  155. package/dist/components/input/Input.cjs +2 -0
  156. package/dist/components/input/Input.cjs.map +1 -0
  157. package/dist/components/input/Input.mjs +81 -0
  158. package/dist/components/input/Input.mjs.map +1 -0
  159. package/dist/components/input/Label.cjs +2 -0
  160. package/dist/components/input/Label.cjs.map +1 -0
  161. package/dist/components/input/Label.mjs +28 -0
  162. package/dist/components/input/Label.mjs.map +1 -0
  163. package/dist/components/input/Option.cjs +2 -0
  164. package/dist/components/input/Option.cjs.map +1 -0
  165. package/dist/components/input/Option.mjs +169 -0
  166. package/dist/components/input/Option.mjs.map +1 -0
  167. package/dist/components/input/RadioGroup.cjs +2 -0
  168. package/dist/components/input/RadioGroup.cjs.map +1 -0
  169. package/dist/components/input/RadioGroup.mjs +139 -0
  170. package/dist/components/input/RadioGroup.mjs.map +1 -0
  171. package/dist/components/input/Rating.cjs +2 -0
  172. package/dist/components/input/Rating.cjs.map +1 -0
  173. package/dist/components/input/Rating.mjs +196 -0
  174. package/dist/components/input/Rating.mjs.map +1 -0
  175. package/dist/components/input/SearchBox.cjs +2 -0
  176. package/dist/components/input/SearchBox.cjs.map +1 -0
  177. package/dist/components/input/SearchBox.mjs +205 -0
  178. package/dist/components/input/SearchBox.mjs.map +1 -0
  179. package/dist/components/input/Select.cjs +2 -0
  180. package/dist/components/input/Select.cjs.map +1 -0
  181. package/dist/components/input/Select.mjs +33 -0
  182. package/dist/components/input/Select.mjs.map +1 -0
  183. package/dist/components/input/Slider.cjs +2 -0
  184. package/dist/components/input/Slider.cjs.map +1 -0
  185. package/dist/components/input/Slider.mjs +79 -0
  186. package/dist/components/input/Slider.mjs.map +1 -0
  187. package/dist/components/input/SpinButton.cjs +2 -0
  188. package/dist/components/input/SpinButton.cjs.map +1 -0
  189. package/dist/components/input/SpinButton.mjs +157 -0
  190. package/dist/components/input/SpinButton.mjs.map +1 -0
  191. package/dist/components/input/SwatchPicker.cjs +2 -0
  192. package/dist/components/input/SwatchPicker.cjs.map +1 -0
  193. package/dist/components/input/SwatchPicker.mjs +113 -0
  194. package/dist/components/input/SwatchPicker.mjs.map +1 -0
  195. package/dist/components/input/Switch.cjs +2 -0
  196. package/dist/components/input/Switch.cjs.map +1 -0
  197. package/dist/components/input/Switch.mjs +92 -0
  198. package/dist/components/input/Switch.mjs.map +1 -0
  199. package/dist/components/input/TagPicker.cjs +2 -0
  200. package/dist/components/input/TagPicker.cjs.map +1 -0
  201. package/dist/components/input/TagPicker.mjs +249 -0
  202. package/dist/components/input/TagPicker.mjs.map +1 -0
  203. package/dist/components/input/Textarea.cjs +2 -0
  204. package/dist/components/input/Textarea.cjs.map +1 -0
  205. package/dist/components/input/Textarea.mjs +32 -0
  206. package/dist/components/input/Textarea.mjs.map +1 -0
  207. package/dist/components/input/TimePicker.cjs +2 -0
  208. package/dist/components/input/TimePicker.cjs.map +1 -0
  209. package/dist/components/input/TimePicker.mjs +292 -0
  210. package/dist/components/input/TimePicker.mjs.map +1 -0
  211. package/dist/components/input/colorUtils.cjs +2 -0
  212. package/dist/components/input/colorUtils.cjs.map +1 -0
  213. package/dist/components/input/colorUtils.mjs +96 -0
  214. package/dist/components/input/colorUtils.mjs.map +1 -0
  215. package/dist/components/input/dateUtils.cjs +2 -0
  216. package/dist/components/input/dateUtils.cjs.map +1 -0
  217. package/dist/components/input/dateUtils.mjs +250 -0
  218. package/dist/components/input/dateUtils.mjs.map +1 -0
  219. package/dist/components/input/pickerStyles.cjs +2 -0
  220. package/dist/components/input/pickerStyles.cjs.map +1 -0
  221. package/dist/components/input/pickerStyles.mjs +10 -0
  222. package/dist/components/input/pickerStyles.mjs.map +1 -0
  223. package/dist/components/internal/HiddenInput.cjs +2 -0
  224. package/dist/components/internal/HiddenInput.cjs.map +1 -0
  225. package/dist/components/internal/HiddenInput.mjs +88 -0
  226. package/dist/components/internal/HiddenInput.mjs.map +1 -0
  227. package/dist/components/layout/Accordion.cjs +2 -0
  228. package/dist/components/layout/Accordion.cjs.map +1 -0
  229. package/dist/components/layout/Accordion.mjs +236 -0
  230. package/dist/components/layout/Accordion.mjs.map +1 -0
  231. package/dist/components/layout/Card.cjs +2 -0
  232. package/dist/components/layout/Card.cjs.map +1 -0
  233. package/dist/components/layout/Card.mjs +121 -0
  234. package/dist/components/layout/Card.mjs.map +1 -0
  235. package/dist/components/layout/Carousel.cjs +2 -0
  236. package/dist/components/layout/Carousel.cjs.map +1 -0
  237. package/dist/components/layout/Carousel.mjs +205 -0
  238. package/dist/components/layout/Carousel.mjs.map +1 -0
  239. package/dist/components/layout/Flex.cjs +2 -0
  240. package/dist/components/layout/Flex.cjs.map +1 -0
  241. package/dist/components/layout/Flex.mjs +54 -0
  242. package/dist/components/layout/Flex.mjs.map +1 -0
  243. package/dist/components/layout/Grid.cjs +2 -0
  244. package/dist/components/layout/Grid.cjs.map +1 -0
  245. package/dist/components/layout/Grid.mjs +62 -0
  246. package/dist/components/layout/Grid.mjs.map +1 -0
  247. package/dist/components/layout/Overflow.cjs +2 -0
  248. package/dist/components/layout/Overflow.cjs.map +1 -0
  249. package/dist/components/layout/Overflow.mjs +269 -0
  250. package/dist/components/layout/Overflow.mjs.map +1 -0
  251. package/dist/components/layout/Stack.cjs +2 -0
  252. package/dist/components/layout/Stack.cjs.map +1 -0
  253. package/dist/components/layout/Stack.mjs +39 -0
  254. package/dist/components/layout/Stack.mjs.map +1 -0
  255. package/dist/components/layout/TabList.cjs +2 -0
  256. package/dist/components/layout/TabList.cjs.map +1 -0
  257. package/dist/components/layout/TabList.mjs +238 -0
  258. package/dist/components/layout/TabList.mjs.map +1 -0
  259. package/dist/components/layout/Tree.cjs +2 -0
  260. package/dist/components/layout/Tree.cjs.map +1 -0
  261. package/dist/components/layout/Tree.mjs +220 -0
  262. package/dist/components/layout/Tree.mjs.map +1 -0
  263. package/dist/components/layout/disclosureIds.cjs +2 -0
  264. package/dist/components/layout/disclosureIds.cjs.map +1 -0
  265. package/dist/components/layout/disclosureIds.mjs +12 -0
  266. package/dist/components/layout/disclosureIds.mjs.map +1 -0
  267. package/dist/components/motion/Presence.cjs +2 -0
  268. package/dist/components/motion/Presence.cjs.map +1 -0
  269. package/dist/components/motion/Presence.mjs +35 -0
  270. package/dist/components/motion/Presence.mjs.map +1 -0
  271. package/dist/components/navigation/Breadcrumb.cjs +2 -0
  272. package/dist/components/navigation/Breadcrumb.cjs.map +1 -0
  273. package/dist/components/navigation/Breadcrumb.mjs +144 -0
  274. package/dist/components/navigation/Breadcrumb.mjs.map +1 -0
  275. package/dist/components/navigation/Menu.cjs +2 -0
  276. package/dist/components/navigation/Menu.cjs.map +1 -0
  277. package/dist/components/navigation/Menu.context.cjs +2 -0
  278. package/dist/components/navigation/Menu.context.cjs.map +1 -0
  279. package/dist/components/navigation/Menu.context.mjs +82 -0
  280. package/dist/components/navigation/Menu.context.mjs.map +1 -0
  281. package/dist/components/navigation/Menu.group.cjs +2 -0
  282. package/dist/components/navigation/Menu.group.cjs.map +1 -0
  283. package/dist/components/navigation/Menu.group.mjs +58 -0
  284. package/dist/components/navigation/Menu.group.mjs.map +1 -0
  285. package/dist/components/navigation/Menu.items.cjs +2 -0
  286. package/dist/components/navigation/Menu.items.cjs.map +1 -0
  287. package/dist/components/navigation/Menu.items.mjs +127 -0
  288. package/dist/components/navigation/Menu.items.mjs.map +1 -0
  289. package/dist/components/navigation/Menu.link.cjs +2 -0
  290. package/dist/components/navigation/Menu.link.cjs.map +1 -0
  291. package/dist/components/navigation/Menu.link.mjs +41 -0
  292. package/dist/components/navigation/Menu.link.mjs.map +1 -0
  293. package/dist/components/navigation/Menu.mjs +27 -0
  294. package/dist/components/navigation/Menu.mjs.map +1 -0
  295. package/dist/components/navigation/Menu.popover.cjs +2 -0
  296. package/dist/components/navigation/Menu.popover.cjs.map +1 -0
  297. package/dist/components/navigation/Menu.popover.mjs +231 -0
  298. package/dist/components/navigation/Menu.popover.mjs.map +1 -0
  299. package/dist/components/navigation/Menu.root.cjs +2 -0
  300. package/dist/components/navigation/Menu.root.cjs.map +1 -0
  301. package/dist/components/navigation/Menu.root.mjs +308 -0
  302. package/dist/components/navigation/Menu.root.mjs.map +1 -0
  303. package/dist/components/navigation/Menu.selectable.cjs +2 -0
  304. package/dist/components/navigation/Menu.selectable.cjs.map +1 -0
  305. package/dist/components/navigation/Menu.selectable.mjs +89 -0
  306. package/dist/components/navigation/Menu.selectable.mjs.map +1 -0
  307. package/dist/components/navigation/Menu.shared.cjs +2 -0
  308. package/dist/components/navigation/Menu.shared.cjs.map +1 -0
  309. package/dist/components/navigation/Menu.shared.mjs +23 -0
  310. package/dist/components/navigation/Menu.shared.mjs.map +1 -0
  311. package/dist/components/navigation/Menu.splitGroup.cjs +2 -0
  312. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -0
  313. package/dist/components/navigation/Menu.splitGroup.mjs +51 -0
  314. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -0
  315. package/dist/components/navigation/Menu.trigger.cjs +2 -0
  316. package/dist/components/navigation/Menu.trigger.cjs.map +1 -0
  317. package/dist/components/navigation/Menu.trigger.mjs +79 -0
  318. package/dist/components/navigation/Menu.trigger.mjs.map +1 -0
  319. package/dist/components/navigation/Nav.cjs +2 -0
  320. package/dist/components/navigation/Nav.cjs.map +1 -0
  321. package/dist/components/navigation/Nav.mjs +276 -0
  322. package/dist/components/navigation/Nav.mjs.map +1 -0
  323. package/dist/components/navigation/Pagination.cjs +2 -0
  324. package/dist/components/navigation/Pagination.cjs.map +1 -0
  325. package/dist/components/navigation/Pagination.mjs +110 -0
  326. package/dist/components/navigation/Pagination.mjs.map +1 -0
  327. package/dist/components/navigation/Stepper.cjs +2 -0
  328. package/dist/components/navigation/Stepper.cjs.map +1 -0
  329. package/dist/components/navigation/Stepper.mjs +204 -0
  330. package/dist/components/navigation/Stepper.mjs.map +1 -0
  331. package/dist/components/overlays/Dialog.cjs +2 -0
  332. package/dist/components/overlays/Dialog.cjs.map +1 -0
  333. package/dist/components/overlays/Dialog.mjs +180 -0
  334. package/dist/components/overlays/Dialog.mjs.map +1 -0
  335. package/dist/components/overlays/Dialog.shared.cjs +2 -0
  336. package/dist/components/overlays/Dialog.shared.cjs.map +1 -0
  337. package/dist/components/overlays/Dialog.shared.mjs +227 -0
  338. package/dist/components/overlays/Dialog.shared.mjs.map +1 -0
  339. package/dist/components/overlays/Drawer.cjs +2 -0
  340. package/dist/components/overlays/Drawer.cjs.map +1 -0
  341. package/dist/components/overlays/Drawer.mjs +192 -0
  342. package/dist/components/overlays/Drawer.mjs.map +1 -0
  343. package/dist/components/overlays/Popover.cjs +2 -0
  344. package/dist/components/overlays/Popover.cjs.map +1 -0
  345. package/dist/components/overlays/Popover.mjs +365 -0
  346. package/dist/components/overlays/Popover.mjs.map +1 -0
  347. package/dist/components/overlays/Popover.shared.cjs +2 -0
  348. package/dist/components/overlays/Popover.shared.cjs.map +1 -0
  349. package/dist/components/overlays/Popover.shared.mjs +182 -0
  350. package/dist/components/overlays/Popover.shared.mjs.map +1 -0
  351. package/dist/components/overlays/TeachingPopover.cjs +2 -0
  352. package/dist/components/overlays/TeachingPopover.cjs.map +1 -0
  353. package/dist/components/overlays/TeachingPopover.mjs +181 -0
  354. package/dist/components/overlays/TeachingPopover.mjs.map +1 -0
  355. package/dist/components/overlays/Tooltip.cjs +2 -0
  356. package/dist/components/overlays/Tooltip.cjs.map +1 -0
  357. package/dist/components/overlays/Tooltip.mjs +160 -0
  358. package/dist/components/overlays/Tooltip.mjs.map +1 -0
  359. package/dist/components/portal/Portal.cjs +2 -0
  360. package/dist/components/portal/Portal.cjs.map +1 -0
  361. package/dist/components/portal/Portal.mjs +45 -0
  362. package/dist/components/portal/Portal.mjs.map +1 -0
  363. package/dist/components/provider/WaveProvider.cjs +2 -0
  364. package/dist/components/provider/WaveProvider.cjs.map +1 -0
  365. package/dist/components/provider/WaveProvider.mjs +51 -0
  366. package/dist/components/provider/WaveProvider.mjs.map +1 -0
  367. package/dist/components/table/DataGrid.cjs +2 -0
  368. package/dist/components/table/DataGrid.cjs.map +1 -0
  369. package/dist/components/table/DataGrid.mjs +489 -0
  370. package/dist/components/table/DataGrid.mjs.map +1 -0
  371. package/dist/components/table/Table.cjs +2 -0
  372. package/dist/components/table/Table.cjs.map +1 -0
  373. package/dist/components/table/Table.mjs +99 -0
  374. package/dist/components/table/Table.mjs.map +1 -0
  375. package/dist/components/table/useGridNavigation.cjs +2 -0
  376. package/dist/components/table/useGridNavigation.cjs.map +1 -0
  377. package/dist/components/table/useGridNavigation.mjs +336 -0
  378. package/dist/components/table/useGridNavigation.mjs.map +1 -0
  379. package/dist/components/typography/Text.cjs +2 -0
  380. package/dist/components/typography/Text.cjs.map +1 -0
  381. package/dist/components/typography/Text.mjs +38 -0
  382. package/dist/components/typography/Text.mjs.map +1 -0
  383. package/dist/hooks/useAnnounce.cjs +2 -0
  384. package/dist/hooks/useAnnounce.cjs.map +1 -0
  385. package/dist/hooks/useAnnounce.mjs +88 -0
  386. package/dist/hooks/useAnnounce.mjs.map +1 -0
  387. package/dist/hooks/useCheckedValues.cjs +2 -0
  388. package/dist/hooks/useCheckedValues.cjs.map +1 -0
  389. package/dist/hooks/useCheckedValues.mjs +102 -0
  390. package/dist/hooks/useCheckedValues.mjs.map +1 -0
  391. package/dist/hooks/useContextMenuAnchor.cjs +2 -0
  392. package/dist/hooks/useContextMenuAnchor.cjs.map +1 -0
  393. package/dist/hooks/useContextMenuAnchor.mjs +132 -0
  394. package/dist/hooks/useContextMenuAnchor.mjs.map +1 -0
  395. package/dist/hooks/useControllable.cjs +2 -0
  396. package/dist/hooks/useControllable.cjs.map +1 -0
  397. package/dist/hooks/useControllable.mjs +37 -0
  398. package/dist/hooks/useControllable.mjs.map +1 -0
  399. package/dist/hooks/useDirection.cjs +2 -0
  400. package/dist/hooks/useDirection.cjs.map +1 -0
  401. package/dist/hooks/useDirection.mjs +57 -0
  402. package/dist/hooks/useDirection.mjs.map +1 -0
  403. package/dist/hooks/useDismiss.cjs +2 -0
  404. package/dist/hooks/useDismiss.cjs.map +1 -0
  405. package/dist/hooks/useDismiss.mjs +57 -0
  406. package/dist/hooks/useDismiss.mjs.map +1 -0
  407. package/dist/hooks/useEventCallback.cjs +2 -0
  408. package/dist/hooks/useEventCallback.cjs.map +1 -0
  409. package/dist/hooks/useEventCallback.mjs +16 -0
  410. package/dist/hooks/useEventCallback.mjs.map +1 -0
  411. package/dist/hooks/useFieldControl.cjs +2 -0
  412. package/dist/hooks/useFieldControl.cjs.map +1 -0
  413. package/dist/hooks/useFieldControl.mjs +62 -0
  414. package/dist/hooks/useFieldControl.mjs.map +1 -0
  415. package/dist/hooks/useFocusTrap.cjs +2 -0
  416. package/dist/hooks/useFocusTrap.cjs.map +1 -0
  417. package/dist/hooks/useFocusTrap.mjs +266 -0
  418. package/dist/hooks/useFocusTrap.mjs.map +1 -0
  419. package/dist/hooks/useFormReset.cjs +2 -0
  420. package/dist/hooks/useFormReset.cjs.map +1 -0
  421. package/dist/hooks/useFormReset.mjs +33 -0
  422. package/dist/hooks/useFormReset.mjs.map +1 -0
  423. package/dist/hooks/useHoverIntent.cjs +2 -0
  424. package/dist/hooks/useHoverIntent.cjs.map +1 -0
  425. package/dist/hooks/useHoverIntent.mjs +201 -0
  426. package/dist/hooks/useHoverIntent.mjs.map +1 -0
  427. package/dist/hooks/useId.cjs +2 -0
  428. package/dist/hooks/useId.cjs.map +1 -0
  429. package/dist/hooks/useId.mjs +11 -0
  430. package/dist/hooks/useId.mjs.map +1 -0
  431. package/dist/hooks/useIsClient.cjs +2 -0
  432. package/dist/hooks/useIsClient.cjs.map +1 -0
  433. package/dist/hooks/useIsClient.mjs +19 -0
  434. package/dist/hooks/useIsClient.mjs.map +1 -0
  435. package/dist/hooks/useListbox.cjs +2 -0
  436. package/dist/hooks/useListbox.cjs.map +1 -0
  437. package/dist/hooks/useListbox.mjs +492 -0
  438. package/dist/hooks/useListbox.mjs.map +1 -0
  439. package/dist/hooks/useMergedRefs.cjs +2 -0
  440. package/dist/hooks/useMergedRefs.cjs.map +1 -0
  441. package/dist/hooks/useMergedRefs.mjs +57 -0
  442. package/dist/hooks/useMergedRefs.mjs.map +1 -0
  443. package/dist/hooks/useModalIsolation.cjs +2 -0
  444. package/dist/hooks/useModalIsolation.cjs.map +1 -0
  445. package/dist/hooks/useModalIsolation.mjs +87 -0
  446. package/dist/hooks/useModalIsolation.mjs.map +1 -0
  447. package/dist/hooks/useModalLayer.cjs +2 -0
  448. package/dist/hooks/useModalLayer.cjs.map +1 -0
  449. package/dist/hooks/useModalLayer.mjs +30 -0
  450. package/dist/hooks/useModalLayer.mjs.map +1 -0
  451. package/dist/hooks/usePopupPosition.cjs +2 -0
  452. package/dist/hooks/usePopupPosition.cjs.map +1 -0
  453. package/dist/hooks/usePopupPosition.mjs +117 -0
  454. package/dist/hooks/usePopupPosition.mjs.map +1 -0
  455. package/dist/hooks/usePrefersReducedMotion.cjs +2 -0
  456. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -0
  457. package/dist/hooks/usePrefersReducedMotion.mjs +24 -0
  458. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -0
  459. package/dist/hooks/usePresence.cjs +2 -0
  460. package/dist/hooks/usePresence.cjs.map +1 -0
  461. package/dist/hooks/usePresence.mjs +136 -0
  462. package/dist/hooks/usePresence.mjs.map +1 -0
  463. package/dist/hooks/usePreserveFocus.cjs +2 -0
  464. package/dist/hooks/usePreserveFocus.cjs.map +1 -0
  465. package/dist/hooks/usePreserveFocus.mjs +50 -0
  466. package/dist/hooks/usePreserveFocus.mjs.map +1 -0
  467. package/dist/hooks/useRestoreFocus.cjs +2 -0
  468. package/dist/hooks/useRestoreFocus.cjs.map +1 -0
  469. package/dist/hooks/useRestoreFocus.mjs +271 -0
  470. package/dist/hooks/useRestoreFocus.mjs.map +1 -0
  471. package/dist/hooks/useRovingTabIndex.cjs +2 -0
  472. package/dist/hooks/useRovingTabIndex.cjs.map +1 -0
  473. package/dist/hooks/useRovingTabIndex.mjs +389 -0
  474. package/dist/hooks/useRovingTabIndex.mjs.map +1 -0
  475. package/dist/hooks/useScrollLock.cjs +2 -0
  476. package/dist/hooks/useScrollLock.cjs.map +1 -0
  477. package/dist/hooks/useScrollLock.mjs +71 -0
  478. package/dist/hooks/useScrollLock.mjs.map +1 -0
  479. package/dist/hooks/useTriggerElement.cjs +2 -0
  480. package/dist/hooks/useTriggerElement.cjs.map +1 -0
  481. package/dist/hooks/useTriggerElement.mjs +126 -0
  482. package/dist/hooks/useTriggerElement.mjs.map +1 -0
  483. package/dist/hooks/useTypeahead.cjs +2 -0
  484. package/dist/hooks/useTypeahead.cjs.map +1 -0
  485. package/dist/hooks/useTypeahead.mjs +38 -0
  486. package/dist/hooks/useTypeahead.mjs.map +1 -0
  487. package/dist/index.cjs +1 -1
  488. package/dist/index.d.cts +9099 -0
  489. package/dist/index.d.ts +7688 -1027
  490. package/dist/index.mjs +91 -5695
  491. package/dist/lib/aria.cjs +2 -0
  492. package/dist/lib/aria.cjs.map +1 -0
  493. package/dist/lib/aria.mjs +29 -0
  494. package/dist/lib/aria.mjs.map +1 -0
  495. package/dist/lib/children.cjs +2 -0
  496. package/dist/lib/children.cjs.map +1 -0
  497. package/dist/lib/children.mjs +37 -0
  498. package/dist/lib/children.mjs.map +1 -0
  499. package/dist/lib/cn.cjs +2 -0
  500. package/dist/lib/cn.cjs.map +1 -0
  501. package/dist/lib/cn.mjs +64 -0
  502. package/dist/lib/cn.mjs.map +1 -0
  503. package/dist/lib/composeEventHandlers.cjs +2 -0
  504. package/dist/lib/composeEventHandlers.cjs.map +1 -0
  505. package/dist/lib/composeEventHandlers.mjs +11 -0
  506. package/dist/lib/composeEventHandlers.mjs.map +1 -0
  507. package/dist/lib/dev.cjs +2 -0
  508. package/dist/lib/dev.cjs.map +1 -0
  509. package/dist/lib/dev.mjs +42 -0
  510. package/dist/lib/dev.mjs.map +1 -0
  511. package/dist/lib/direction.cjs +2 -0
  512. package/dist/lib/direction.cjs.map +1 -0
  513. package/dist/lib/direction.mjs +35 -0
  514. package/dist/lib/direction.mjs.map +1 -0
  515. package/dist/lib/events.cjs +2 -0
  516. package/dist/lib/events.cjs.map +1 -0
  517. package/dist/lib/events.mjs +31 -0
  518. package/dist/lib/events.mjs.map +1 -0
  519. package/dist/lib/focus.cjs +2 -0
  520. package/dist/lib/focus.cjs.map +1 -0
  521. package/dist/lib/focus.mjs +119 -0
  522. package/dist/lib/focus.mjs.map +1 -0
  523. package/dist/lib/globalRegistry.cjs +2 -0
  524. package/dist/lib/globalRegistry.cjs.map +1 -0
  525. package/dist/lib/globalRegistry.mjs +13 -0
  526. package/dist/lib/globalRegistry.mjs.map +1 -0
  527. package/dist/lib/icons.cjs +2 -0
  528. package/dist/lib/icons.cjs.map +1 -0
  529. package/dist/lib/icons.mjs +254 -0
  530. package/dist/lib/icons.mjs.map +1 -0
  531. package/dist/lib/labelInName.cjs +2 -0
  532. package/dist/lib/labelInName.cjs.map +1 -0
  533. package/dist/lib/labelInName.mjs +54 -0
  534. package/dist/lib/labelInName.mjs.map +1 -0
  535. package/dist/lib/layers.cjs +2 -0
  536. package/dist/lib/layers.cjs.map +1 -0
  537. package/dist/lib/layers.mjs +224 -0
  538. package/dist/lib/layers.mjs.map +1 -0
  539. package/dist/lib/mergeProps.cjs +2 -0
  540. package/dist/lib/mergeProps.cjs.map +1 -0
  541. package/dist/lib/mergeProps.mjs +21 -0
  542. package/dist/lib/mergeProps.mjs.map +1 -0
  543. package/dist/lib/mergeRefs.cjs +2 -0
  544. package/dist/lib/mergeRefs.cjs.map +1 -0
  545. package/dist/lib/mergeRefs.mjs +29 -0
  546. package/dist/lib/mergeRefs.mjs.map +1 -0
  547. package/dist/lib/renderTrigger.cjs +2 -0
  548. package/dist/lib/renderTrigger.cjs.map +1 -0
  549. package/dist/lib/renderTrigger.mjs +29 -0
  550. package/dist/lib/renderTrigger.mjs.map +1 -0
  551. package/dist/lib/slot.cjs +2 -0
  552. package/dist/lib/slot.cjs.map +1 -0
  553. package/dist/lib/slot.mjs +122 -0
  554. package/dist/lib/slot.mjs.map +1 -0
  555. package/dist/lib/styles.cjs +2 -0
  556. package/dist/lib/styles.cjs.map +1 -0
  557. package/dist/lib/styles.mjs +16 -0
  558. package/dist/lib/styles.mjs.map +1 -0
  559. package/dist/lib/theme.cjs +2 -0
  560. package/dist/lib/theme.cjs.map +1 -0
  561. package/dist/lib/theme.mjs +16 -0
  562. package/dist/lib/theme.mjs.map +1 -0
  563. package/dist/preflight.css +2 -0
  564. package/dist/styles.css +2 -0
  565. package/package.json +149 -100
  566. package/src/styles/animations.css +7 -39
  567. package/src/styles/base.css +103 -0
  568. package/src/styles/globals.css +10 -22
  569. package/src/styles/legacy-tokens.css +184 -0
  570. package/src/styles/preflight.css +7 -0
  571. package/src/styles/styles.css +32 -0
  572. package/src/styles/tailwind.css +17 -0
  573. package/src/styles/tokens.css +561 -221
  574. package/src/styles/variants.css +29 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.mjs","names":["useId","useId$1","React","DrawerContext","inertDrawerContext","inertModalTrigger","useDrawerContext","useRequiredContext","componentName","positionClasses","NESTED_TRIGGER_WARNING_KEY","NESTED_TRIGGER_WARNING","UNREACHABLE_WARNING_KEY","UNREACHABLE_WARNING","REACHABILITY_CHECK_DELAY","DrawerTrigger","inPanel","warnOnce","useModalTriggerPart","panelId","props","DrawerClose","useModalClosePart","requestOpen","DrawerTitle","rest","titleId","titleRef","useModalTitle","id","ref","cn","className","NESTED_TRIGGER_MAX_DEPTH","hasNestedTrigger","visit","level","node","item","depth","type","getElementType","isFragment","nested","children","splitChildren","triggers","content","flattenChildren","keyed","isElementOfType","DrawerRoot","openProp","openState","useModalOpenState","defaultOpen","onOpenChange","isClient","useIsClient","open","trigger","useModalTrigger","generatedId","propTitleId","titles","useTitleRegistry","panel","setPanel","panelRef","attachPanel","mergedRef","useMergedRefs","backdropPress","useBackdropPress","onDismiss","useModalDismiss","layer","useModalLayer","useModalTriggerSession","useUnnamedModalWarning","nestedWarnedRef","isDev","unreachable","latestRef","timer","latest","context","panelContext","hasTitle","slotRendersContent","title","Portal","position","ModalSurfaceContext","Button","DismissIcon","closeLabel","event","Drawer"],"sources":["../../../src/components/overlays/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { flattenChildren, getElementType, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { isDev, warnOnce } from '../../lib/dev';\nimport { DismissIcon } from '../../lib/icons';\nimport { slotRendersContent } from '../../lib/slot';\nimport type { ModalOpenChangeReason, OpenChangeDetails } from '../../lib/types';\nimport { useId } from '../../hooks/useId';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useModalLayer } from '../../hooks/useModalLayer';\nimport { Button } from '../button/Button';\nimport { Portal } from '../portal/Portal';\nimport {\n inertModalTrigger,\n ModalSurfaceContext,\n useBackdropPress,\n useModalClosePart,\n useModalDismiss,\n useModalOpenState,\n useModalTitle,\n useModalTrigger,\n useModalTriggerPart,\n useModalTriggerSession,\n useRequiredContext,\n useTitleRegistry,\n useUnnamedModalWarning,\n type ModalRequestOpen,\n type ModalTrigger,\n} from './Dialog.shared';\n\n/**\n * Side of the screen the drawer is attached to. `start`/`end` follow the text direction (in a\n * right-to-left layout `end` is the left edge); `left`/`right` are physical sides.\n */\nexport type DrawerPosition = 'start' | 'end' | 'left' | 'right';\n\n/**\n * Why a {@link Drawer} asks to open or close: `trigger` (`Drawer.Trigger`), `close`\n * (`Drawer.Close`), `close-button` (the built-in Close button), `escape`, `outside-press` (the\n * backdrop). The shared `ModalOpenChangeReason`, as for Dialog.\n */\nexport type DrawerOpenChangeReason = ModalOpenChangeReason;\n\n/** The second argument of a {@link Drawer}'s `onOpenChange`: the reason and the DOM event. */\nexport type DrawerOpenChangeDetails = OpenChangeDetails<DrawerOpenChangeReason>;\n\n/** Properties for the Drawer component. */\nexport interface DrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Controlled open state of the drawer. The panel renders only in the browser: an open drawer\n * is closed in the server HTML and opens once it has hydrated.\n */\n open?: boolean;\n /**\n * Default open state for uncontrolled usage. The panel renders only in the browser: a drawer\n * open by default is closed in the server HTML and opens once it has hydrated.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Called with the new open state when it changes. `details.reason` tells how — `trigger`,\n * `close` (a `.Close` part), `close-button` (the built-in Close button), `escape` or\n * `outside-press` (the backdrop) — so a controlled drawer can refuse only some ways of closing\n * (for example keep a form with unsaved changes open on `outside-press`); `details.event` is the\n * DOM event behind the request. WaveUI always passes `details`; it is typed optional until 1.0\n * so that code which calls this prop itself keeps compiling.\n *\n * Fires only when the value changes; a controlled drawer stays as it is until the parent updates\n * `open`.\n */\n onOpenChange?: (open: boolean, details?: DrawerOpenChangeDetails) => void;\n /**\n * Side of the screen the drawer is attached to. `start`/`end` follow the text direction;\n * `left`/`right` are physical sides.\n * @default 'end'\n */\n position?: DrawerPosition;\n /**\n * Title displayed in the drawer header; it names the drawer (`aria-labelledby`). Without it,\n * render a `Drawer.Title` or pass `aria-label`/`aria-labelledby`. A title that renders nothing\n * (`''`, `[]`, `true`) counts as none.\n */\n title?: React.ReactNode;\n /**\n * Accessible name of the built-in Close button (an icon-only button). Localize it with the\n * page's language.\n * @default 'Close'\n */\n closeLabel?: string;\n /**\n * Where focus goes when the drawer closes, if it can take focus. Otherwise focus returns to the\n * element that had focus when the drawer opened, then to the trigger, then to an element next to\n * where that opener was.\n */\n finalFocusRef?: React.RefObject<HTMLElement | null>;\n /**\n * The drawer body. `Drawer.Trigger` children placed directly inside the Drawer, or in a Fragment\n * there (`{isMobile && <>…</>}`), render in place (outside the panel); everything else renders in\n * the panel's scrolling body. A `Drawer.Trigger` nested in another element, or rendered by a\n * component, is panel content, so it only exists while the drawer is open (development warnings\n * say so, also when an uncontrolled drawer still has no direct trigger a second after it mounts\n * and therefore cannot open; a controlled drawer whose trigger a component such as a Tooltip\n * wraps warns only once it opens).\n * Put wrappers inside the trigger instead: see `Drawer.Trigger`.\n */\n children: React.ReactNode;\n /** Ref to the drawer panel (`role=\"dialog\"`). */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Props a `Drawer.Trigger` puts on its element (and passes to a render-prop child). */\nexport interface DrawerTriggerRenderProps extends React.HTMLAttributes<HTMLElement> {\n 'aria-haspopup': 'dialog';\n 'aria-expanded': boolean;\n /** The panel's id, while the drawer is open. */\n 'aria-controls'?: string;\n onClick: React.MouseEventHandler<HTMLElement>;\n /** A callback ref, so the props spread onto any element type. */\n ref: React.RefCallback<HTMLElement>;\n}\n\n/** Properties for the DrawerTrigger sub-component. */\nexport interface DrawerTriggerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {\n /**\n * The element that opens the drawer. A single element receives the trigger props (merged with its\n * own); a function receives them.\n */\n children: React.ReactNode | ((props: DrawerTriggerRenderProps) => React.ReactNode);\n /**\n * `false` renders a wrapper `<span>` around the children instead of merging the trigger props\n * onto the child. The span carries the click handler; `aria-haspopup`, `aria-expanded` and\n * `aria-controls` go to the first element in the tab order inside it.\n * @default true\n */\n asChild?: boolean;\n /** Ref to the trigger element (the child, or the wrapper span). */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** Props a `Drawer.Close` puts on its element (and passes to a render-prop child). */\nexport interface DrawerCloseRenderProps extends React.HTMLAttributes<HTMLElement> {\n onClick: React.MouseEventHandler<HTMLElement>;\n /** A callback ref, so the props spread onto any element type. */\n ref: React.RefCallback<HTMLElement>;\n}\n\n/** Properties for the DrawerClose sub-component. */\nexport interface DrawerCloseProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {\n /**\n * The element that closes the drawer. A single element receives an `onClick` composed with its own\n * (its handler runs first; `preventDefault()` keeps the drawer open); a function receives the\n * props.\n */\n children: React.ReactNode | ((props: DrawerCloseRenderProps) => React.ReactNode);\n /** `false` renders a wrapper `<span>` that closes the drawer on click. @default true */\n asChild?: boolean;\n /** Ref to the close element (the child, or the wrapper span). */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** Properties for the DrawerTitle sub-component. */\nexport interface DrawerTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n /** The title; any content. */\n children: React.ReactNode;\n /** Ref to the heading element. */\n ref?: React.Ref<HTMLHeadingElement>;\n}\n\ninterface DrawerContextValue {\n open: boolean;\n /** Asks the root to open or close, with the reason and event for `onOpenChange`. */\n requestOpen: ModalRequestOpen;\n /** The trigger element (`attach`) and the focus-restore target resolved from it (`focusRef`). */\n trigger: ModalTrigger;\n /** The panel's id (for the trigger's `aria-controls`). */\n panelId: string;\n /** `true` for sub-components rendered inside the panel (a `Drawer.Trigger` there is misplaced). */\n inPanel: boolean;\n}\n\nconst DrawerContext = React.createContext<DrawerContextValue | null>(null);\nDrawerContext.displayName = 'DrawerContext';\n\nconst inertDrawerContext: DrawerContextValue = {\n open: false,\n requestOpen: () => {},\n trigger: inertModalTrigger,\n panelId: '',\n inPanel: false,\n};\n\nfunction useDrawerContext(componentName: string): DrawerContextValue {\n return useRequiredContext(DrawerContext, componentName, 'Drawer', () => inertDrawerContext);\n}\n\n/**\n * The side the panel is pinned to, and a border on its inner edge (the one facing the page): it\n * marks the panel where the shadow cannot, in high contrast (page, backdrop and panel are black)\n * and in forced colors (which drop shadows).\n */\nconst positionClasses: Record<DrawerPosition, string> = {\n start: 'start-0 border-e',\n end: 'end-0 border-s',\n left: 'left-0 border-r', // wave-allow-physical: the consumer asked for the physical left edge\n right: 'right-0 border-l', // wave-allow-physical: the consumer asked for the physical right edge\n};\n\nconst NESTED_TRIGGER_WARNING_KEY = 'Drawer.Trigger:nested';\nconst NESTED_TRIGGER_WARNING =\n 'Drawer.Trigger must be a direct child of Drawer (a Fragment is fine). Inside another element or a component it is rendered as panel content, which exists only while the drawer is open, so it cannot open the drawer. Make it a direct child, put wrappers such as a Tooltip inside the trigger, or control the Drawer with `open`/`onOpenChange` and open it from your own button.';\n\nconst UNREACHABLE_WARNING_KEY = 'Drawer:unreachable';\nconst UNREACHABLE_WARNING =\n 'Drawer has no way to open: a second after mounting it is still uncontrolled (no `open` prop), closed, and has no Drawer.Trigger as a direct child (or in a Fragment there). A Drawer.Trigger rendered by a component or nested in an element is panel content, which exists only while the drawer is open. Make the trigger a direct child of Drawer, or control the Drawer with `open`/`onOpenChange`.';\n\n/**\n * How long after mount (ms) the development check for a drawer without a trigger waits: long\n * enough for a trigger that a conditional Fragment renders once the page knows its layout.\n */\nconst REACHABILITY_CHECK_DELAY = 1000;\n\n/**\n * Opens the drawer. Place it directly inside `Drawer`, or in a Fragment there (not inside a wrapper\n * element or a component of your own): it renders in place, not in the panel; a misplaced one warns\n * in development. A Drawer may have several triggers: focus returns to the one that opened it. Puts\n * `aria-haspopup=\"dialog\"`, `aria-expanded`, `aria-controls` (while open), a click handler and a\n * ref on its single child, or passes them to a render-prop child. A custom child component must\n * forward `ref` and spread its props; one that does not is wrapped in a `<span>` automatically\n * (with a development warning), the span that `asChild={false}` renders. Focus returns to the\n * trigger when the drawer closes. On the span, the state ARIA goes to the first element in the tab\n * order inside it, and focus returns to that element (to the span when you made it the trigger\n * with a `role` such as `button` and `tabIndex={0}`, or when nothing inside it can take focus).\n *\n * A Tooltip (or any other wrapper) goes inside the trigger, not around it. Use a render-prop child\n * so the trigger props land on the button and the Tooltip describes that same button:\n *\n * @example\n * <Drawer title=\"Filters\">\n * <Drawer.Trigger>\n * {(triggerProps) => (\n * <Tooltip content=\"Narrow the list\">\n * <Button {...triggerProps}>Filters</Button>\n * </Tooltip>\n * )}\n * </Drawer.Trigger>\n * <FilterForm />\n * </Drawer>\n */\nexport const DrawerTrigger = (props: DrawerTriggerProps) => {\n const { open, requestOpen, trigger, panelId, inPanel } = useDrawerContext('Drawer.Trigger');\n\n // Rendered inside its own drawer's panel (e.g. by a component): it only exists while open.\n React.useEffect(() => {\n if (inPanel) warnOnce(NESTED_TRIGGER_WARNING_KEY, NESTED_TRIGGER_WARNING);\n }, [inPanel]);\n\n return useModalTriggerPart<DrawerTriggerRenderProps>(\n { open, requestOpen, trigger, controlsId: panelId },\n props,\n 'Drawer.Trigger',\n );\n};\nDrawerTrigger.displayName = 'DrawerTrigger';\n\n/**\n * Closes the drawer: composes a click handler onto its single child (its own `onClick` runs first;\n * calling `preventDefault()` there keeps the drawer open), or passes it to a render-prop child.\n */\nexport const DrawerClose = (props: DrawerCloseProps) => {\n const { requestOpen } = useDrawerContext('Drawer.Close');\n return useModalClosePart<DrawerCloseRenderProps>(requestOpen, props, 'Drawer.Close');\n};\nDrawerClose.displayName = 'DrawerClose';\n\n/**\n * A heading that names the drawer (`aria-labelledby`), for rich titles or custom layouts. Render it\n * inside the Drawer's content (instead of the `title` prop).\n */\nexport const DrawerTitle = ({ id, className, children, ref, ...rest }: DrawerTitleProps) => {\n const { id: titleId, ref: titleRef } = useModalTitle('Drawer.Title', 'Drawer', id, ref);\n return (\n <h2\n {...rest}\n id={titleId}\n ref={titleRef}\n className={cn('text-subtitle-1 font-semibold text-foreground', className)}\n >\n {children}\n </h2>\n );\n};\nDrawerTitle.displayName = 'DrawerTitle';\n\n/** Deepest element level the development check for nested triggers looks at. */\nconst NESTED_TRIGGER_MAX_DEPTH = 32;\n\n/**\n * Development check: whether the Drawer's children hold a `Drawer.Trigger` inside a host element\n * (at any depth, also through Fragments), which would become panel content; a trigger inside\n * Fragments only is direct (see `splitChildren`). Walks the element tree the consumer wrote, not\n * rendered output, so it descends only into host elements (`<div>`, `<span>`, …) and Fragments,\n * which render their `children` as written. A component's\n * output is unknown here — a wrapper that renders its own Drawer around its children, for one —\n * so components are not walked; a trigger rendered by a component is caught when it renders in the\n * open panel, or, while the drawer cannot open, by the unreachable-drawer check.\n */\nfunction hasNestedTrigger(children: React.ReactNode): boolean {\n // `depth` counts host elements only: a Fragment adds no level, as `splitChildren` flattens it.\n const visit = (node: unknown, depth: number, level: number): boolean => {\n if (level > NESTED_TRIGGER_MAX_DEPTH || typeof node !== 'object' || node === null) return false;\n if (Array.isArray(node)) return node.some((item) => visit(item, depth, level));\n if (!React.isValidElement(node)) return false;\n // A part written in a Server Component has a lazy type. The walk runs in effects, outside\n // render: a lazy part that is still loading must not throw its thenable there, so it counts\n // as no trigger (`suspend: false` returns the lazy itself, which matches nothing).\n const type = getElementType(node, { suspend: false });\n if (type === DrawerTrigger) return depth > 0;\n const isFragment = type === React.Fragment;\n if (typeof type !== 'string' && !isFragment) return false;\n const { children: nested } = node.props as { children?: unknown };\n return visit(nested, isFragment ? depth : depth + 1, level + 1);\n };\n return visit(children, 0, 0);\n}\n\n/**\n * Splits the Drawer's children into its direct `Drawer.Trigger` elements and the panel content.\n * Fragments are flattened (recursively), so a `Drawer.Trigger` in a Fragment —\n * `{isMobile && <><Drawer.Trigger>…</Drawer.Trigger><Filters /></>}` — counts as a direct child.\n * Every element keeps the key `flattenChildren` gives it: unique across Fragments and stable when a\n * sibling Fragment toggles, so panel content keeps its state. A trigger is recognised also when it\n * was written in a Server Component (a lazy type).\n */\nfunction splitChildren(children: React.ReactNode): {\n triggers: React.ReactNode[];\n content: React.ReactNode[];\n} {\n const triggers: React.ReactNode[] = [];\n const content: React.ReactNode[] = [];\n for (const { key, node } of flattenChildren(children)) {\n const keyed = React.isValidElement(node) ? React.cloneElement(node, { key }) : node;\n if (isElementOfType(node, DrawerTrigger)) triggers.push(keyed);\n else content.push(keyed);\n }\n return { triggers, content };\n}\n\n// The root of `Drawer` (documented on the export below).\nconst DrawerRoot = ({\n open: openProp,\n defaultOpen,\n onOpenChange,\n position = 'end',\n title,\n closeLabel = 'Close',\n finalFocusRef,\n children,\n className,\n id,\n ref,\n ...rest\n}: DrawerProps) => {\n const [openState, requestOpen] = useModalOpenState(openProp, defaultOpen, onOpenChange);\n // The panel lives in a portal, which renders only in the browser: until then (the server HTML,\n // hydration) the drawer reports itself closed, so the trigger's aria-expanded and aria-controls\n // never describe a panel that is not there.\n const isClient = useIsClient();\n const open = openState && isClient;\n const trigger = useModalTrigger();\n const generatedId = useId('wave-drawer');\n const panelId = id ?? generatedId;\n const propTitleId = useId('wave-drawer-title');\n const titles = useTitleRegistry();\n\n const [panel, setPanel] = React.useState<HTMLDivElement | null>(null);\n const panelRef = React.useRef<HTMLDivElement | null>(null);\n const attachPanel = React.useCallback((node: HTMLDivElement | null) => {\n panelRef.current = node;\n setPanel(node);\n }, []);\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, attachPanel);\n\n // Every backdrop press asks the drawer to close.\n const backdropPress = useBackdropPress(panelRef, true);\n const onDismiss = useModalDismiss(requestOpen, 'Drawer', backdropPress.afterOutsidePress);\n const layer = useModalLayer({\n open,\n onDismiss,\n refs: [panelRef],\n container: panel,\n triggerRef: trigger.focusRef,\n finalFocusRef,\n });\n // After useModalLayer's focus restore (effects run in order), start the trigger session, or end\n // it and forget the trigger that opened it.\n useModalTriggerSession(trigger, open);\n useUnnamedModalWarning(open ? panel : null, titles.hasTitle, 'Drawer', 'Drawer.Title');\n\n const { triggers, content } = splitChildren(children);\n\n // A trigger nested in the children is panel content: never rendered while the drawer is closed.\n // The children change on every parent render; once this drawer has warned, it stops walking.\n const nestedWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (!isDev || nestedWarnedRef.current || !hasNestedTrigger(children)) return;\n nestedWarnedRef.current = true;\n warnOnce(NESTED_TRIGGER_WARNING_KEY, NESTED_TRIGGER_WARNING);\n }, [children]);\n\n // An uncontrolled closed drawer without a direct trigger cannot open (e.g.\n // `<Drawer><FilterTrigger /></Drawer>`, whose trigger is panel content). Checked once, a moment\n // after mount, against the latest render: a trigger that a conditional Fragment adds right after\n // mount (`{isMobile && <>…</>}` with an SSR-safe media query) counts. A trigger nested in an\n // element already has the more specific warning above.\n const unreachable = openProp === undefined && !defaultOpen && triggers.length === 0;\n const latestRef = React.useRef({ unreachable, children });\n React.useLayoutEffect(() => {\n latestRef.current = { unreachable, children };\n });\n React.useEffect(() => {\n if (!isDev || !latestRef.current.unreachable) return;\n const timer = setTimeout(() => {\n const latest = latestRef.current;\n if (latest.unreachable && !hasNestedTrigger(latest.children)) {\n warnOnce(UNREACHABLE_WARNING_KEY, UNREACHABLE_WARNING);\n }\n }, REACHABILITY_CHECK_DELAY);\n return () => clearTimeout(timer);\n }, []);\n\n const context = React.useMemo<DrawerContextValue>(\n () => ({ open, requestOpen, trigger, panelId, inPanel: false }),\n [open, requestOpen, trigger, panelId],\n );\n const panelContext = React.useMemo<DrawerContextValue>(\n () => ({ ...context, inPanel: true }),\n [context],\n );\n\n const hasTitle = slotRendersContent(title);\n\n return (\n <DrawerContext.Provider value={context}>\n {triggers}\n {open && (\n <Portal layerId={layer.layerId}>\n <div className=\"fixed inset-0 bg-backdrop\" onMouseDown={backdropPress.onMouseDown}>\n <div\n ref={mergedRef}\n role=\"dialog\"\n id={panelId}\n aria-labelledby={hasTitle ? propTitleId : titles.titleId}\n tabIndex={-1}\n {...rest}\n className={cn(\n 'fixed top-0 flex h-full w-80 max-w-full flex-col border-border bg-background text-foreground shadow-64',\n positionClasses[position],\n className,\n )}\n >\n <DrawerContext.Provider value={panelContext}>\n <ModalSurfaceContext.Provider value={titles.context}>\n <div className=\"flex items-center justify-between gap-2 border-b border-border p-4\">\n {hasTitle && (\n <h2 id={propTitleId} className=\"text-subtitle-1 font-semibold\">\n {title}\n </h2>\n )}\n <Button\n appearance=\"subtle\"\n size=\"small\"\n icon={<DismissIcon />}\n aria-label={closeLabel}\n onClick={(event) =>\n requestOpen(false, { reason: 'close-button', event: event.nativeEvent })\n }\n className=\"ms-auto text-muted-foreground\"\n />\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto p-4\">{content}</div>\n </ModalSurfaceContext.Provider>\n </DrawerContext.Provider>\n </div>\n </div>\n </Portal>\n )}\n </DrawerContext.Provider>\n );\n};\nDrawerRoot.displayName = 'Drawer';\n\n/**\n * A modal panel attached to a side of the screen (Fluent UI v2 style), rendered in a portal\n * (inheriting the WaveProvider theme) while open.\n *\n * - **Opening**: controlled (`open`), or uncontrolled with a `Drawer.Trigger` placed directly inside\n * the Drawer or in a Fragment there (it renders in place, outside the panel).\n * - **Modal**: focus moves into the panel and Tab stays inside it (toasts included), the rest of the\n * page is `inert` (instead of `aria-modal`), and the page does not scroll.\n * - **Closing**: Escape (only the topmost layer: a popup opened inside closes first), a click on the\n * backdrop (a drag that starts inside does not close it), the Close button and `Drawer.Close`.\n * `onOpenChange` gets the reason as its second argument (`details.reason`), so a controlled\n * drawer can refuse some of them. A backdrop press blurs the focused field before the drawer\n * closes, so a typed value is committed as with the Close button; when a controlled drawer\n * refuses the press, the field gets focus back. Focus returns to the first of these that can\n * take focus: `finalFocusRef`, the element that had focus when the drawer opened, the trigger,\n * an element next to where that opener was.\n * - **Position**: `end` (default) and `start` follow the text direction.\n *\n * The sub-components are also exported under flat names (`DrawerTrigger`, `DrawerClose`,\n * `DrawerTitle`) for React Server Components, which cannot use the dotted form; dotted access\n * (`Drawer.Trigger`) needs a client file.\n *\n * @example\n * <Drawer title=\"Filters\">\n * <Drawer.Trigger><Button>Filters</Button></Drawer.Trigger>\n * <FilterForm />\n * <Drawer.Close><Button appearance=\"primary\">Apply</Button></Drawer.Close>\n * </Drawer>\n */\nexport const Drawer = /* @__PURE__ */ Object.assign(DrawerRoot, {\n Trigger: DrawerTrigger,\n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B,IAAamD,IAAyB,uBAAO,OAAO/C,GAAY;CAC9D,SAASpC;CACT,OAAOM;CACP,OAAOG;AACT,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs"),r=require("../../lib/slot.cjs"),i=require("../../lib/composeEventHandlers.cjs"),a=require("../../hooks/useEventCallback.cjs"),o=require("../../hooks/useControllable.cjs"),s=require("../../hooks/useId.cjs"),c=require("../../lib/focus.cjs"),l=require("../../hooks/useMergedRefs.cjs"),u=require("../../hooks/useIsClient.cjs"),d=require("../../lib/layers.cjs"),f=require("../../hooks/useDismiss.cjs"),p=require("../portal/Portal.cjs"),m=require("../../hooks/usePopupPosition.cjs"),h=require("../../hooks/useRestoreFocus.cjs"),g=require("../../hooks/useTriggerElement.cjs"),_=require("../../hooks/useHoverIntent.cjs"),v=require("../../hooks/useContextMenuAnchor.cjs"),y=require("./Popover.shared.cjs");let b=require("react");b=e.__toESM(b,1);let x=require("react/jsx-runtime");var S=b.createContext(null);S.displayName=`PopoverContext`;var C=null;function w(){return C??={open:!1,setOpen:()=>{},contentId:`wave-popover-inert-content`,setCustomContentId:()=>{},triggerId:`wave-popover-inert-trigger`,resolvedTriggerId:void 0,setResolvedTriggerId:()=>{},triggerRef:{current:null},triggerElement:null,triggerElementRef:()=>{},surfaceElementRef:()=>{},arrowRef:{current:null},onTriggerClick:()=>{},onTriggerKeyDown:()=>{},hoverTriggerHandlers:null,hoverSurfaceHandlers:null,contextMode:!1,contextTriggerHandlers:null,onContentContextMenu:()=>{},keyboardContext:!1,onContentKeyDown:()=>{},layerId:`wave-popover-inert-layer`,floatingProps:{"data-side":`bottom`,"data-align":`start`,style:{}},arrowStyles:{},placedSide:`bottom`},C}function ee(e){return b.useContext(S)||(n.reportMissingContext(e,`Popover`),w())}function T(e,t){let n=(t??``).split(/\s+/).filter(t=>t&&e.getElementById(t));return n.length>0?n.join(` `):void 0}function E(e,t){if(!e)return t;let n=e.ownerDocument,r=(t?n.getElementById(t):null)??g.getTriggerFocusTarget(e)??e;return T(n,r.getAttribute(`aria-labelledby`))??(r.id||e.id||void 0)}function te(e,t){return t.split(/\s+/).some(t=>{let n=t?e.getElementById(t):null;return n?n.getAttribute(`aria-label`)?.trim()||n.textContent?.trim()?!0:!!n.querySelector(`[aria-label]:not([aria-label=""]), [alt]:not([alt=""]), [title]:not([title=""])`):!1})}var ne=()=>()=>{};function D(e,t){let n=e?.ownerDocument.activeElement;return!e||!n?!1:e.contains(n)?!0:d.getLayerTreeElements(t,{includeOwnElements:!1}).some(e=>e.contains(n))}function O(e){return!!e&&typeof e.nodeType==`number`}function k(e){return{get current(){return e()}}}function re(e,t,n){return g.getTriggerFocusTarget(e)??y.getTabbableThrough(e,t,n)}var A=({open:e,defaultOpen:t,onOpenChange:r,side:i=`bottom`,align:d=`start`,ignoreOutsideRefs:p,openOnHover:C=!1,openDelay:w=250,closeDelay:ee=500,openOnContext:T=!1,target:E,children:te})=>{let[ne,A]=o.useControllable(e,t??!1,r),j=b.useRef(!1),M=a.useEventCallback(e=>{j.current=!1,A(e)}),N=b.useCallback(()=>j.current,[]),ie=u.useIsClient(),P=ne&&ie,[F,I]=b.useState(`other`),[L,ae]=b.useState(!1),[oe,se]=b.useState(P),R=F;P!==oe&&(se(P),P&&(R=L?`hover`:`other`)),R!==F&&I(R),L&&ae(!1);let z=s.useId(`popover-content`),[B,ce]=b.useState(void 0),V=B??z,H=s.useId(`popover-trigger`),[U,le]=b.useState(void 0),[W,ue]=b.useState(null),[G,de]=b.useState(null),K=b.useRef(null),q=b.useRef(null),fe=b.useRef(null),pe=O(E)?E:null,J=b.useRef(null);b.useInsertionEffect(()=>{J.current=pe},[pe]);let{setReference:me,setFloating:he,floatingProps:ge,arrowStyles:_e,side:ve}=m.usePopupPosition({open:P,side:i,align:d,offset:8,arrowRef:fe}),ye=b.useRef(null),Y=a.useEventCallback(()=>{let e=T?ye.current?.current:null;if(e&&c.isConnectedAndFocusable(e))return e;let t=K.current,n=t?g.getTriggerFocusTarget(t):null;if(n)return n;let r=J.current;return r&&c.isConnectedAndFocusable(r)?r:t}),be=b.useMemo(()=>k(Y),[Y]),xe=a.useEventCallback(e=>!(e.ctrlKey&&K.current?.contains(e.target))),{layerId:X}=f.useDismiss({open:P,onDismiss:()=>M(!1),refs:T?[q,J,...p??[]]:[q,K,J,...p??[]],anchorRef:be,kind:`popover`,outsidePress:!T||xe}),Z=b.useRef(!1),{anchor:Se,fromContext:Ce,origin:we,opener:Q,triggerHandlers:Te,surfaceHandlers:Ee}=v.useContextMenuAnchor({enabled:T,open:P,trigger:G,layerId:X,onOpen:e=>{Z.current=e===`keyboard`,M(!0)},onClose:()=>M(!1)});b.useInsertionEffect(()=>{ye.current=Q},[Q]);let De=g.useTriggerFocusRef(K);h.useRestoreFocus({enabled:P,container:W,triggerRef:T?void 0:De,finalFocusRef:T?Q:void 0,fallback:Y,onlyIfFocusInside:!0,isHoverClose:N}),b.useLayoutEffect(()=>{P&&(j.current=!1)},[P]);let Oe=l.useMergedRefs(K,de),ke=l.useMergedRefs(q,ue,he);b.useLayoutEffect(()=>{me(Ce?Se??(G&&(g.getTriggerFocusTarget(G)??G)):E??G)},[Se,Ce,E,G,me]),b.useLayoutEffect(()=>{if(Z.current){if(!P){Z.current=!1;return}W&&(Z.current=!1,c.focusElement(c.getFirstTabbable(W)??W,{preventScroll:!0}))}}),b.useEffect(()=>{C&&T&&n.warnOnce(`Popover:hover-and-context`,"Popover: `openOnHover` is ignored with `openOnContext`: a context popover opens on a right click, Shift+F10 or the ContextMenu key, not on hover.")},[C,T]);let $=C&&!T,Ae=a.useEventCallback(()=>R===`hover`&&!D(q.current,X)),{triggerHandlers:je,surfaceHandlers:Me,cancel:Ne}=_.useHoverIntent({enabled:$,open:P,openDelay:w,closeDelay:ee,trigger:G,surface:W,onOpen:()=>{ae(!0),M(!0)},onClose:()=>{j.current=!0,A(!1)},canClose:Ae}),Pe=a.useEventCallback(()=>{Ne(),P&&R===`hover`?I(`other`):M(e=>!e)}),Fe=a.useEventCallback(()=>{let e=K.current,t=T?Q.current:null;return t&&e?.contains(t)?t:e??J.current}),Ie=b.useMemo(()=>k(Fe),[Fe]),Le=a.useEventCallback(e=>{if(e.key!==`Tab`||e.shiftKey||!P)return;if(T){let t=Fe();if(!t||e.target!==(g.getTriggerFocusTarget(t)??t))return}let t=q.current,n=t?c.getFirstTabbable(t):null;n&&(e.preventDefault(),n.focus())}),Re=y.usePopoverTabOrder({enabled:P,surface:W,anchorRef:Ie,getPreviousStop:re}),ze=Ce&&we===`keyboard`,Be=b.useMemo(()=>({open:P,setOpen:M,contentId:V,setCustomContentId:ce,triggerId:H,resolvedTriggerId:U,setResolvedTriggerId:le,triggerRef:K,triggerElement:G,triggerElementRef:Oe,surfaceElementRef:ke,arrowRef:fe,onTriggerClick:Pe,onTriggerKeyDown:Le,hoverTriggerHandlers:$?je:null,hoverSurfaceHandlers:$?Me:null,contextMode:T,contextTriggerHandlers:T?Te:null,onContentContextMenu:Ee.onContextMenu,keyboardContext:ze,onContentKeyDown:Re,layerId:X,floatingProps:ge,arrowStyles:_e,placedSide:ve}),[P,M,V,H,U,G,Oe,ke,Pe,Le,$,je,Me,T,Te,Ee,ze,Re,X,ge,_e,ve]);return(0,x.jsx)(S.Provider,{value:Be,children:te})};A.displayName=`Popover`;var j=({children:e,asChild:t,id:n,onClick:r,onKeyDown:a,onContextMenu:o,onPointerEnter:s,onPointerMove:c,onPointerLeave:u,ref:d,...f})=>{let{open:p,contentId:m,triggerId:h,triggerElementRef:_,setResolvedTriggerId:v,onTriggerClick:y,onTriggerKeyDown:b,hoverTriggerHandlers:x,contextMode:S,contextTriggerHandlers:C}=ee(`Popover.Trigger`),w=l.useMergedRefs(d,_),T={...f,id:n??h,"aria-haspopup":`dialog`,"aria-expanded":!S&&p,"aria-controls":p&&!S?m:void 0,onClick:i.composeEventHandlers(r,S?void 0:y),onKeyDown:i.composeEventHandlers(a,C?i.composeEventHandlers(C.onKeyDown,b):b),onContextMenu:C?i.composeEventHandlers(o,C.onContextMenu):o,onPointerEnter:x?i.composeEventHandlers(s,x.onPointerEnter):s,onPointerMove:x?i.composeEventHandlers(c,x.onPointerMove):c,onPointerLeave:x?i.composeEventHandlers(u,x.onPointerLeave):u,ref:w};return g.useTriggerElement(e,T,{componentName:`Popover.Trigger`,asChild:t,onResolvedId:v,omitStateAria:S})};j.displayName=`PopoverTrigger`;var M=({children:e,title:a,id:o,className:c,style:u,"aria-label":d,"aria-labelledby":f,onKeyDown:m,onContextMenu:h,onPointerEnter:g,onPointerLeave:_,ref:v,...S})=>{let{open:C,contentId:w,setCustomContentId:T,resolvedTriggerId:D,triggerRef:O,triggerElement:k,surfaceElementRef:re,arrowRef:A,layerId:j,floatingProps:M,arrowStyles:N,placedSide:ie,onContentKeyDown:P,hoverSurfaceHandlers:F,contextMode:I,onContentContextMenu:L,keyboardContext:ae}=ee(`Popover.Content`),oe=s.useId(`popover-title`),se=l.useMergedRefs(v,re),R=r.slotRendersContent(a),z=f===void 0&&!d&&!R,B=C&&z&&!I,ce=b.useCallback(e=>{if(!B||!k||typeof MutationObserver>`u`)return ne();let t=new MutationObserver(e);return t.observe(k,{attributes:!0,attributeFilter:[`id`,`aria-labelledby`],childList:!0,subtree:!0}),()=>t.disconnect()},[B,k]),V=b.useSyncExternalStore(ce,()=>B?E(k,D):void 0,()=>B?D:void 0),H=f??(d?void 0:R?oe:V),U=o||void 0;return b.useEffect(()=>(T(U),()=>T(void 0)),[U,T]),b.useEffect(()=>{C&&z&&I&&n.isDev&&n.warnOnce(`Popover.Content:name`,"Popover.Content: the popover has no accessible name. A context popover (openOnContext) is not named by its region: pass `title`, `aria-label` or `aria-labelledby`.")},[C,z,I]),b.useEffect(()=>{if(!B||!n.isDev)return;let e=O.current;if(!e){n.warnOnce(`Popover.Content:name`,"Popover.Content: the popover has no accessible name. Pass `title`, `aria-label` or `aria-labelledby`, or open it from a Popover.Trigger.");return}let t=E(e,D);t?te(e.ownerDocument,t)||n.warnOnce(`Popover.Content:trigger-name`,"Popover.Content: the popover is named by its trigger, but the trigger has no text to name it (an icon-only trigger needs `aria-label`, or `aria-labelledby` pointing at text), so the popover has no accessible name. Name the trigger, or pass `title`, `aria-label` or `aria-labelledby`."):n.warnOnce(`Popover.Content:trigger-id`,"Popover.Content: the popover is named by its trigger, but the trigger element has no `id` (a render-prop child of Popover.Trigger must spread the `id` it receives), so the popover has no accessible name. Spread every trigger prop onto the element, or pass `title`, `aria-label` or `aria-labelledby`.")},[B,D,O,V]),C?(0,x.jsx)(p.Portal,{layerId:j,children:(0,x.jsxs)(`div`,{role:`dialog`,"aria-label":d,"aria-labelledby":H,tabIndex:ae?-1:void 0,...S,ref:se,id:U??w,"data-side":M[`data-side`],"data-align":M[`data-align`],style:{...u,...M.style},onKeyDown:i.composeEventHandlers(m,P),onContextMenu:i.composeEventHandlers(h,L),onPointerEnter:F?i.composeEventHandlers(g,F.onPointerEnter):g,onPointerLeave:F?i.composeEventHandlers(_,F.onPointerLeave):_,className:t.cn(`w-64 rounded-md border border-border bg-background p-4 text-body-1 font-normal text-foreground normal-case tracking-normal text-start shadow-4`,c),children:[(0,x.jsx)(y.PopoverBeak,{ref:A,side:ie,style:N,"data-wave-popover-arrow":``}),R&&(0,x.jsx)(`h2`,{id:oe,className:`mb-2 text-subtitle-2 font-semibold`,children:a}),e]})}):null};M.displayName=`PopoverContent`;var N=Object.assign(A,{Trigger:j,Content:M});exports.Popover=N,exports.PopoverContent=M,exports.PopoverTrigger=j;
2
+ //# sourceMappingURL=Popover.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.cjs","names":["React","getTriggerFocusTarget","getLayerTreeElements","getTabbableThrough","useControllable","useEventCallback","useIsClient","useId","usePopupPosition","isConnectedAndFocusable","useDismiss","useContextMenuAnchor","useTriggerFocusRef","useMergedRefs","getFirstTabbable","useHoverIntent","usePopoverTabOrder","composeEventHandlers","useTriggerElement","slotRendersContent","isDev","Portal","cn","PopoverBeak","require_runtime","require_cn","require_dev","require_slot","require_composeEventHandlers","require_useEventCallback","require_useControllable","require_useId","require_focus","require_useMergedRefs","require_useIsClient","require_layers","require_useDismiss","require_Portal","require_usePopupPosition","require_useRestoreFocus","require_useTriggerElement","require_useHoverIntent","require_useContextMenuAnchor","require_Popover_shared","react","react_jsx_runtime","PopoverContext","inertContext","getInertContext","usePopoverContext","componentName","presentIds","present","ids","id","doc","findTriggerLabelId","trigger","resolvedId","named","referencesText","el","subscribeNothing","isFocusInsideContentTree","active","surface","layerId","isElementTarget","target","createResolvedRef","resolve","getPopoverPreviousStop","anchor","order","PopoverRoot","openProp","openState","setOpen","defaultOpen","onOpenChange","hoverCloseRef","requestOpen","next","isHoverClose","isClient","open","openReason","setOpenReason","hoverRequested","setHoverRequested","previousOpen","setPreviousOpen","reason","generatedContentId","customContentId","setCustomContentId","contentId","triggerId","resolvedTriggerId","setResolvedTriggerId","setSurface","triggerElement","setTriggerElement","triggerRef","surfaceRef","arrowRef","targetElement","targetRef","placedSide","contextOpenerRef","resolveFocusTarget","gestureOpener","openOnContext","triggerTarget","targetEl","focusTargetRef","isOutsidePress","event","ignoreOutsideRefs","focusContentRef","contextAnchor","contextOrigin","contextOpener","contextTriggerHandlers","contextSurfaceHandlers","origin","triggerFocusRef","triggerElementRef","surfaceElementRef","setFloating","setReference","fromContext","openOnHover","hoverEnabled","canHoverClose","hoverTriggerHandlers","hoverSurfaceHandlers","cancelHover","onTriggerClick","current","resolveTabAnchor","tabAnchorRef","onTriggerKeyDown","surfaceElement","first","onContentKeyDown","keyboardContext","context","floatingProps","arrowStyles","PopoverTrigger","idProp","rest","hover","gesture","elementRef","ref","triggerProps","contextMode","onClick","onKeyDown","onContextMenu","onPointerEnter","onPointerMove","onPointerLeave","children","PopoverContent","ariaLabel","ariaLabelledBy","titleId","hasTitle","title","unnamed","checkTrigger","subscribeTrigger","observer","onChange","triggerLabelId","labelledBy","customId","labelIds","style","onContentContextMenu","className","Popover"],"sources":["../../../src/components/overlays/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { isDev, reportMissingContext, warnOnce } from '../../lib/dev';\nimport { slotRendersContent } from '../../lib/slot';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { focusElement, getFirstTabbable, isConnectedAndFocusable } from '../../lib/focus';\nimport { getLayerTreeElements } from '../../lib/layers';\nimport type { PopupAlign, PopupSide, PopupTarget } from '../../lib/types';\nimport { useId } from '../../hooks/useId';\nimport { useControllable, type SetValue } from '../../hooks/useControllable';\nimport { useContextMenuAnchor, type ContextMenuAnchor } from '../../hooks/useContextMenuAnchor';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport { useHoverIntent, type HoverIntent } from '../../hooks/useHoverIntent';\nimport { useRestoreFocus } from '../../hooks/useRestoreFocus';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport {\n getTriggerFocusTarget,\n useTriggerElement,\n useTriggerFocusRef,\n} from '../../hooks/useTriggerElement';\nimport { Portal } from '../portal/Portal';\nimport {\n getTabbableThrough,\n PopoverBeak,\n usePopoverTabOrder,\n type PopoverPhysicalSide,\n} from './Popover.shared';\n\n/** Properties for the Popover component. */\nexport interface PopoverProps {\n /**\n * Controlled open state of the popover. The content renders only in the browser: an open\n * popover is closed in the server HTML and opens once it has hydrated.\n */\n open?: boolean;\n /**\n * Default open state for uncontrolled usage. The content renders only in the browser: a\n * popover open by default is closed in the server HTML and opens once it has hydrated.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Called with the requested open state when it differs from the current one: a trigger click,\n * Escape and an outside press; the hover opening and closing of `openOnHover`; and, with\n * `openOnContext`, a context gesture (a right click, a macOS Ctrl+click, Shift+F10 or the\n * ContextMenu key), a right click outside, and a scroll that moves the row it opened at.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Side of the trigger the content opens on. `start`/`end` follow the writing direction. The\n * content flips to the opposite side when there is not enough room.\n * @default 'bottom'\n */\n side?: PopupSide;\n /** Alignment of the content along the trigger's edge.\n * @default 'start'\n */\n align?: PopupAlign;\n /**\n * Elements outside the popover whose presses must not dismiss it, e.g. an external toggle\n * button that opens and closes the popover itself.\n */\n ignoreOutsideRefs?: ReadonlyArray<React.RefObject<HTMLElement | null>>;\n /**\n * Open the popover when a mouse pointer rests on its trigger (a hover card), and close it once\n * the pointer has been off the trigger and the content for `closeDelay` while focus is not\n * inside the content. A popover opened by hover does not take focus, and its hover close leaves\n * focus where it is; a click on its trigger keeps it open and keeps focus where it is (a second\n * click closes it, as without hover). After Escape or an outside press it does not reopen until\n * the pointer has left the trigger. Touch and pen never open it by hover, and an `aria-disabled`\n * trigger never opens. A triangle between the trigger and the content keeps it open while the\n * pointer moves diagonally into it. Ignored with `openOnContext` (development warning).\n * @default false\n */\n openOnHover?: boolean;\n /**\n * Milliseconds a hovering mouse pointer rests on the trigger before the popover opens (mouse\n * hover only).\n * @default 250\n */\n openDelay?: number;\n /**\n * Milliseconds before a hover-opened popover closes once the mouse pointer has left it and its\n * trigger (Fluent's `mouseLeaveDelay`; mouse hover only).\n * @default 500\n */\n closeDelay?: number;\n /**\n * Make `Popover.Trigger` a context-menu region (a list, a row, a canvas): a right click (a\n * Ctrl+click on macOS, a long press where the browser reports one) opens the popover at the\n * pointer and leaves focus where it is (Tab from that element enters the content), and\n * Shift+F10 or the ContextMenu key opens it at the focused element inside the region and moves\n * focus into the content, instead of a click. Focus returns to the element that had it. The\n * browser's context menu is suppressed there and inside the content, except in text fields\n * inside the region, which keep it. A press elsewhere, a right click outside or a scroll that\n * moves the row it opened at (the one under the pointer, or the focused one), as a scroll of\n * the region's own content does, closes it. The trigger gets no `aria-haspopup`/`aria-expanded`\n * (it is not a popover button; with a render-prop child, do not spread them): name the content\n * with `title`, `aria-label` or `aria-labelledby`, and consider `aria-keyshortcuts=\"Shift+F10\"`\n * on the region. iOS Safari reports no long press. `openOnHover` is ignored with it.\n * @default false\n */\n openOnContext?: boolean;\n /**\n * Where to place the content instead of next to `Popover.Trigger`: an element or a\n * `VirtualElement` (a rectangle, such as a point; an inline object is fine). With a controlled\n * `open`, a popover with a `target` needs no trigger; name it with `title`, `aria-label` or\n * `aria-labelledby`, and give a toggle button you use as the target `aria-haspopup=\"dialog\"`,\n * `aria-expanded` and `aria-controls` yourself. A press on a target element does not close the\n * popover, and Tab from it enters the content when there is no trigger. Hold the element in\n * state (a ref cannot be observed; TeachingPopover's `target` also takes a ref). A popover\n * opened by `openOnContext` is placed at the gesture instead.\n */\n target?: PopupTarget;\n /** `Popover.Trigger` and `Popover.Content`. */\n children: React.ReactNode;\n}\n\n/**\n * Props the trigger puts on its element; a render-prop child of `Popover.Trigger` receives them\n * (spread them onto the element that opens the popover). With `openOnContext` the element is a\n * context-menu region, not a popover button: do not spread `aria-haspopup`, `aria-expanded` and\n * `aria-controls` onto it (`aria-expanded` is then always `false`, `aria-controls` is absent and\n * `onClick` does nothing); spread ones are removed after each commit, with a development warning.\n */\nexport type PopoverTriggerChildProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {\n id: string;\n 'aria-haspopup': 'dialog';\n 'aria-expanded': boolean;\n /** The content's id, only while the popover is open (never with `openOnContext`). */\n 'aria-controls': string | undefined;\n onClick: React.MouseEventHandler<HTMLElement>;\n /**\n * Moves Tab from the open trigger into the portaled content (which lives at the end of the\n * document), so the keyboard order follows the trigger.\n */\n onKeyDown: React.KeyboardEventHandler<HTMLElement>;\n ref: React.RefCallback<HTMLElement>;\n};\n\n/** Properties for the PopoverTrigger sub-component. */\nexport interface PopoverTriggerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {\n /**\n * The element that toggles the popover (its props are merged onto it), or a render function\n * that receives the trigger props.\n */\n children: React.ReactNode | ((props: PopoverTriggerChildProps) => React.ReactNode);\n /**\n * `false` renders the 0.4 wrapper `<span>` carrying the trigger props around the children\n * instead of merging them onto the child. `aria-haspopup`, `aria-expanded` and `aria-controls`,\n * which a generic element cannot carry, go to the first element in the tab order inside the\n * span. A render-prop child ignores `asChild` and receives every prop.\n * @default true\n */\n asChild?: boolean;\n /** Ref to the trigger element (the child, or the wrapper span). */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** Properties for the PopoverContent sub-component. */\nexport interface PopoverContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Content to render inside the popover. */\n children: React.ReactNode;\n /**\n * Visible heading rendered at the top of the popover; it names the dialog. Without `title`,\n * `aria-label` or `aria-labelledby`, the popover is labelled by its trigger, except with\n * `openOnContext` (a region's text is no name), where it needs one of them.\n */\n title?: React.ReactNode;\n /** Id of the surface; the trigger's `aria-controls` follows it. Defaults to a generated id. */\n id?: string;\n /** Ref to the popover surface. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\ninterface PopoverContextValue {\n open: boolean;\n setOpen: SetValue<boolean>;\n /** The content's id: the consumer's `Popover.Content` id when given, else a generated one. */\n contentId: string;\n /** `Popover.Content` reports the consumer's `id` so the trigger's `aria-controls` follows it. */\n setCustomContentId: (id: string | undefined) => void;\n triggerId: string;\n /** The id the trigger element ended up with (the child's own id wins). */\n resolvedTriggerId: string | undefined;\n setResolvedTriggerId: (id: string) => void;\n triggerRef: React.RefObject<HTMLElement | null>;\n /** The trigger element as state (read during render, e.g. to check the labelling id). */\n triggerElement: HTMLElement | null;\n /** Ref callback for the trigger element: focus-restore target and positioning anchor. */\n triggerElementRef: React.RefCallback<HTMLElement>;\n /** Ref callback for the surface: dismissal, focus restore and positioning. */\n surfaceElementRef: React.RefCallback<HTMLElement>;\n arrowRef: React.RefObject<HTMLDivElement | null>;\n /** The trigger's click: toggles the popover, or pins one that hover opened (keeps it open). */\n onTriggerClick: () => void;\n /** Tab from the open trigger enters the portaled content. */\n onTriggerKeyDown: React.KeyboardEventHandler<HTMLElement>;\n /** Hover opening (`openOnHover`): composed onto the trigger; `null` without it. */\n hoverTriggerHandlers: HoverIntent['triggerHandlers'] | null;\n /** Hover opening (`openOnHover`): composed onto the content; `null` without it. */\n hoverSurfaceHandlers: HoverIntent['surfaceHandlers'] | null;\n /** `openOnContext`: the trigger is a context-menu region, not a popover button. */\n contextMode: boolean;\n /** Context gestures (`openOnContext`): composed onto the trigger; `null` without it. */\n contextTriggerHandlers: ContextMenuAnchor['triggerHandlers'] | null;\n /** Composed onto the content: suppresses the browser's context menu there in context mode. */\n onContentContextMenu: React.MouseEventHandler<HTMLElement>;\n /** Opened by a keyboard context gesture: the content takes focus (itself when nothing can). */\n keyboardContext: boolean;\n /** Tab past the content's edges continues around the trigger in the page order. */\n onContentKeyDown: React.KeyboardEventHandler<HTMLElement>;\n layerId: string;\n floatingProps: { 'data-side': string; 'data-align': string; style: React.CSSProperties };\n arrowStyles: React.CSSProperties;\n placedSide: PopoverPhysicalSide;\n}\n\nconst PopoverContext = React.createContext<PopoverContextValue | null>(null);\nPopoverContext.displayName = 'PopoverContext';\n\nlet inertContext: PopoverContextValue | null = null;\n\n/** Production fallback for a misplaced sub-component: a closed popover that does nothing. */\nfunction getInertContext(): PopoverContextValue {\n inertContext ??= {\n open: false,\n setOpen: () => {},\n contentId: 'wave-popover-inert-content',\n setCustomContentId: () => {},\n triggerId: 'wave-popover-inert-trigger',\n resolvedTriggerId: undefined,\n setResolvedTriggerId: () => {},\n triggerRef: { current: null },\n triggerElement: null,\n triggerElementRef: () => {},\n surfaceElementRef: () => {},\n arrowRef: { current: null },\n onTriggerClick: () => {},\n onTriggerKeyDown: () => {},\n hoverTriggerHandlers: null,\n hoverSurfaceHandlers: null,\n contextMode: false,\n contextTriggerHandlers: null,\n onContentContextMenu: () => {},\n keyboardContext: false,\n onContentKeyDown: () => {},\n layerId: 'wave-popover-inert-layer',\n floatingProps: { 'data-side': 'bottom', 'data-align': 'start', style: {} },\n arrowStyles: {},\n placedSide: 'bottom',\n };\n return inertContext;\n}\n\nfunction usePopoverContext(componentName: string): PopoverContextValue {\n const context = React.useContext(PopoverContext);\n if (context) return context;\n reportMissingContext(componentName, 'Popover');\n return getInertContext();\n}\n\n/** The ids of an id list that exist in `doc`, joined; `undefined` when none does. */\nfunction presentIds(doc: Document, ids: string | null): string | undefined {\n const present = (ids ?? '').split(/\\s+/).filter((id) => id && doc.getElementById(id));\n return present.length > 0 ? present.join(' ') : undefined;\n}\n\n/**\n * The ids `Popover.Content`'s default `aria-labelledby` points at, so the popover gets its\n * trigger's name. The named element is the one with the resolved id when the document has it,\n * otherwise the trigger's focus target (for example the Button inside a Tooltip that sits between\n * `Popover.Trigger` and the Button, whose own id wins), else the trigger element. When that\n * element is itself named through `aria-labelledby` (an icon-only Button inside\n * `Tooltip relationship=\"label\"`, or a button labelled by a visible label), its label ids are\n * returned: a name computation does not follow a second `aria-labelledby` hop, so pointing at the\n * button would leave the popover unnamed. Otherwise the element's id, else the trigger's own.\n * `undefined` when none of them has an id (a render-prop child that does not spread `id`), so the\n * reference never dangles; only ids present in the document are returned. Before the trigger\n * element is known, the resolved id.\n */\nfunction findTriggerLabelId(\n trigger: HTMLElement | null,\n resolvedId: string | undefined,\n): string | undefined {\n if (!trigger) return resolvedId;\n const doc = trigger.ownerDocument;\n const named =\n (resolvedId ? doc.getElementById(resolvedId) : null) ??\n getTriggerFocusTarget(trigger) ??\n trigger;\n return (\n presentIds(doc, named.getAttribute('aria-labelledby')) ?? (named.id || trigger.id || undefined)\n );\n}\n\n/**\n * Whether one of the elements an id list references has text for a name: its own `aria-label`\n * or text, or a descendant's `aria-label`, `alt` or `title`. Deliberately lenient (it only drives\n * a development warning): content that assistive technology ignores still counts as text.\n */\nfunction referencesText(doc: Document, ids: string): boolean {\n return ids.split(/\\s+/).some((id) => {\n const el = id ? doc.getElementById(id) : null;\n if (!el) return false;\n if (el.getAttribute('aria-label')?.trim() || el.textContent?.trim()) return true;\n return !!el.querySelector(\n '[aria-label]:not([aria-label=\"\"]), [alt]:not([alt=\"\"]), [title]:not([title=\"\"])',\n );\n });\n}\n\nconst subscribeNothing = (): (() => void) => () => {};\n\n/**\n * Whether focus is inside the content or in a layer opened from it (a menu of the content, whose\n * portal lives elsewhere): what keeps a hover-opened popover open. Focus on the trigger does not\n * count, although the trigger belongs to the dismiss layer.\n */\nfunction isFocusInsideContentTree(surface: HTMLElement | null, layerId: string): boolean {\n const active = surface?.ownerDocument.activeElement;\n if (!surface || !active) return false;\n if (surface.contains(active)) return true;\n return getLayerTreeElements(layerId, { includeOwnElements: false }).some((el) =>\n el.contains(active),\n );\n}\n\n/** Why an open popover opened: hover (it closes by hover), or anything else (it is pinned). */\ntype OpenReason = 'hover' | 'other';\n\n/** Whether a `target` is an element rather than a VirtualElement (duck typed, any realm). */\nfunction isElementTarget(target: PopupTarget | undefined): target is HTMLElement {\n return !!target && typeof (target as Partial<Node>).nodeType === 'number';\n}\n\n/** A read-only ref whose `current` is `resolve()` at the time it is read (event time). */\nfunction createResolvedRef(resolve: () => HTMLElement | null): React.RefObject<HTMLElement | null> {\n return {\n get current() {\n return resolve();\n },\n };\n}\n\n/**\n * The content's previous stop: the focus target of the element it follows (the trigger, the row of\n * a context gesture, a `target` element), else the tab stop before that element.\n */\nfunction getPopoverPreviousStop(\n anchor: HTMLElement,\n surface: HTMLElement,\n order?: readonly HTMLElement[],\n): HTMLElement | null {\n return getTriggerFocusTarget(anchor) ?? getTabbableThrough(anchor, surface, order);\n}\n\n// A const arrow (like DialogRoot and DrawerRoot): its type can be named in consumers' declaration\n// files, e.g. a story's `satisfies Meta<typeof Popover>` (a function declaration's `typeof` cannot,\n// TS4023).\nconst PopoverRoot = ({\n open: openProp,\n defaultOpen,\n onOpenChange,\n side = 'bottom',\n align = 'start',\n ignoreOutsideRefs,\n openOnHover = false,\n openDelay = 250,\n closeDelay = 500,\n openOnContext = false,\n target,\n children,\n}: PopoverProps) => {\n const [openState, setOpen] = useControllable(openProp, defaultOpen ?? false, onOpenChange);\n // A hover close in flight (written in handlers, read when the popover closes): set when the hover\n // intent asks to close, so that close moves no focus even when a controlled parent applies it in\n // a later render (a transition). Every other request to open or close forgets it, and so does\n // the next opening.\n const hoverCloseRef = React.useRef(false);\n const requestOpen = useEventCallback<SetValue<boolean>>((next) => {\n hoverCloseRef.current = false;\n setOpen(next);\n });\n const isHoverClose = React.useCallback(() => hoverCloseRef.current, []);\n // The content lives in a portal, which renders only in the browser: until then (the server\n // HTML, hydration) the popover reports itself closed, so the trigger's aria-expanded and\n // aria-controls never describe content that is not there.\n const isClient = useIsClient();\n const open = openState && isClient;\n\n // Why the popover opened, decided when it opens (C-HOOKS: a previous-value state): `hover` when\n // hover asked for that open (a request consumed by the next render, so an open that a\n // controlled parent refused does not linger), else `other` (click, keys, a context gesture, a\n // controlled open).\n const [openReason, setOpenReason] = React.useState<OpenReason>('other');\n const [hoverRequested, setHoverRequested] = React.useState(false);\n const [previousOpen, setPreviousOpen] = React.useState(open);\n let reason = openReason;\n if (open !== previousOpen) {\n setPreviousOpen(open);\n if (open) reason = hoverRequested ? 'hover' : 'other';\n }\n if (reason !== openReason) setOpenReason(reason);\n if (hoverRequested) setHoverRequested(false);\n\n const generatedContentId = useId('popover-content');\n const [customContentId, setCustomContentId] = React.useState<string | undefined>(undefined);\n const contentId = customContentId ?? generatedContentId;\n const triggerId = useId('popover-trigger');\n const [resolvedTriggerId, setResolvedTriggerId] = React.useState<string | undefined>(undefined);\n const [surface, setSurface] = React.useState<HTMLElement | null>(null);\n const [triggerElement, setTriggerElement] = React.useState<HTMLElement | null>(null);\n const triggerRef = React.useRef<HTMLElement | null>(null);\n const surfaceRef = React.useRef<HTMLElement | null>(null);\n const arrowRef = React.useRef<HTMLDivElement | null>(null);\n // A `target` element (not a VirtualElement) belongs to the dismiss layer, anchors the keyboard\n // order without a trigger and can take focus back.\n const targetElement = isElementTarget(target) ? target : null;\n const targetRef = React.useRef<HTMLElement | null>(null);\n React.useInsertionEffect(() => {\n targetRef.current = targetElement;\n }, [targetElement]);\n\n // Destructured: react-hooks/refs treats an object whose member is passed to `ref` as a ref.\n const {\n setReference,\n setFloating,\n floatingProps,\n arrowStyles,\n side: placedSide,\n } = usePopupPosition({ open, side, align, offset: 8, arrowRef });\n\n // The one focus resolver: the focus-return fallback and the layer's anchor (where a surface\n // opened from the content restores focus once its opener is gone). In context mode the element\n // focused at the gesture (the row) first; then the trigger's focus target (for a wrapper span,\n // the element inside it that carries the state ARIA), a focusable `target` element, and the\n // trigger itself. The context hook's opener ref is stable; it is filled in once the hook runs.\n const contextOpenerRef = React.useRef<React.RefObject<HTMLElement | null> | null>(null);\n const resolveFocusTarget = useEventCallback((): HTMLElement | null => {\n const gestureOpener = openOnContext ? contextOpenerRef.current?.current : null;\n if (gestureOpener && isConnectedAndFocusable(gestureOpener)) return gestureOpener;\n const trigger = triggerRef.current;\n const triggerTarget = trigger ? getTriggerFocusTarget(trigger) : null;\n if (triggerTarget) return triggerTarget;\n const targetEl = targetRef.current;\n if (targetEl && isConnectedAndFocusable(targetEl)) return targetEl;\n return trigger;\n });\n const focusTargetRef = React.useMemo(\n () => createResolvedRef(resolveFocusTarget),\n [resolveFocusTarget],\n );\n\n // In context mode the region is no part of the layer: a primary press elsewhere in it closes the\n // popover like any outside press. A Ctrl+press inside it is a macOS context click, whose\n // `contextmenu` moves the popover instead.\n const isOutsidePress = useEventCallback(\n (event: PointerEvent | MouseEvent) =>\n !(event.ctrlKey && triggerRef.current?.contains(event.target as Node)),\n );\n const { layerId } = useDismiss({\n open,\n onDismiss: () => requestOpen(false),\n refs: openOnContext\n ? [surfaceRef, targetRef, ...(ignoreOutsideRefs ?? [])]\n : [surfaceRef, triggerRef, targetRef, ...(ignoreOutsideRefs ?? [])],\n anchorRef: focusTargetRef,\n kind: 'popover',\n outsidePress: openOnContext ? isOutsidePress : true,\n });\n\n // A keyboard context gesture moves focus into the content, once it is there (see below).\n const focusContentRef = React.useRef(false);\n const {\n anchor: contextAnchor,\n fromContext,\n origin: contextOrigin,\n opener: contextOpener,\n triggerHandlers: contextTriggerHandlers,\n surfaceHandlers: contextSurfaceHandlers,\n } = useContextMenuAnchor({\n enabled: openOnContext,\n open,\n trigger: triggerElement,\n layerId,\n onOpen: (origin) => {\n focusContentRef.current = origin === 'keyboard';\n requestOpen(true);\n },\n onClose: () => requestOpen(false),\n });\n React.useInsertionEffect(() => {\n contextOpenerRef.current = contextOpener;\n }, [contextOpener]);\n\n // Focus returns to the element that takes focus for the trigger, as Shift+Tab from the content\n // does, when the popover closes while focus is inside it or on `<body>`; a hover close restores\n // only focus inside, so it never moves focus. In context mode it returns to the element focused\n // at the gesture (the row): the region is no restore target of its own (as `triggerRef` it\n // would be taken for the opener).\n const triggerFocusRef = useTriggerFocusRef(triggerRef);\n useRestoreFocus({\n enabled: open,\n container: surface,\n triggerRef: openOnContext ? undefined : triggerFocusRef,\n finalFocusRef: openOnContext ? contextOpener : undefined,\n fallback: resolveFocusTarget,\n onlyIfFocusInside: true,\n isHoverClose,\n });\n React.useLayoutEffect(() => {\n if (open) hoverCloseRef.current = false;\n }, [open]);\n\n const triggerElementRef = useMergedRefs<HTMLElement>(triggerRef, setTriggerElement);\n const surfaceElementRef = useMergedRefs<HTMLElement>(surfaceRef, setSurface, setFloating);\n\n // The positioning anchor: the context gesture (the pointer, or the focused row, else the\n // trigger's focus target, else the trigger) while the popover was opened by one, else `target`,\n // else the trigger. A new VirtualElement on every render repositions without a render loop.\n React.useLayoutEffect(() => {\n if (fromContext) {\n setReference(\n contextAnchor ??\n (triggerElement && (getTriggerFocusTarget(triggerElement) ?? triggerElement)),\n );\n } else {\n setReference(target ?? triggerElement);\n }\n }, [contextAnchor, fromContext, target, triggerElement, setReference]);\n\n // After the commit that has the surface (and after a gesture while open): focus its first\n // tabbable element, else the surface itself (it then has `tabIndex={-1}`). A gesture whose open\n // was refused leaves nothing pending. No deps: every commit, since a gesture always renders.\n React.useLayoutEffect(() => {\n if (!focusContentRef.current) return;\n if (!open) {\n focusContentRef.current = false;\n return;\n }\n if (!surface) return;\n focusContentRef.current = false;\n focusElement(getFirstTabbable(surface) ?? surface, { preventScroll: true });\n });\n\n React.useEffect(() => {\n if (!openOnHover || !openOnContext) return;\n warnOnce(\n 'Popover:hover-and-context',\n 'Popover: `openOnHover` is ignored with `openOnContext`: a context popover opens on a right click, Shift+F10 or the ContextMenu key, not on hover.',\n );\n }, [openOnHover, openOnContext]);\n\n // Hover opening: a popover that hover opened closes by hover until a click on the trigger pins\n // it; focus inside the content (or a layer opened from it) keeps it open, focus on the trigger\n // does not.\n const hoverEnabled = openOnHover && !openOnContext;\n const canHoverClose = useEventCallback(\n () => reason === 'hover' && !isFocusInsideContentTree(surfaceRef.current, layerId),\n );\n const {\n triggerHandlers: hoverTriggerHandlers,\n surfaceHandlers: hoverSurfaceHandlers,\n cancel: cancelHover,\n } = useHoverIntent({\n enabled: hoverEnabled,\n open,\n openDelay,\n closeDelay,\n trigger: triggerElement,\n surface,\n onOpen: () => {\n setHoverRequested(true);\n requestOpen(true);\n },\n onClose: () => {\n // Before the request: a parent may apply it synchronously (flushSync).\n hoverCloseRef.current = true;\n setOpen(false);\n },\n canClose: canHoverClose,\n });\n\n const onTriggerClick = useEventCallback(() => {\n cancelHover();\n if (open && reason === 'hover') setOpenReason('other');\n else requestOpen((current) => !current);\n });\n\n // The element the content follows in the keyboard order: in context mode the element focused\n // at the gesture when it lies inside the region, else the trigger, else a `target` element.\n // With neither (a VirtualElement target and no trigger) the content keeps the portal's place.\n const resolveTabAnchor = useEventCallback((): HTMLElement | null => {\n const trigger = triggerRef.current;\n const gestureOpener = openOnContext ? contextOpener.current : null;\n if (gestureOpener && trigger?.contains(gestureOpener)) return gestureOpener;\n return trigger ?? targetRef.current;\n });\n const tabAnchorRef = React.useMemo(() => createResolvedRef(resolveTabAnchor), [resolveTabAnchor]);\n\n // Keyboard order of the portaled content (it lives at the end of the document), as if it\n // followed the trigger like 0.4's inline content: Tab from the open trigger enters it (here, in\n // the trigger's own `onKeyDown`, which runs before a dialog's focus trap), Tab past its last\n // element continues after the trigger, Shift+Tab from its first element returns to the trigger\n // (the element inside a wrapper span), and Shift+Tab from the element after the trigger enters\n // it at its last element. The end of the page does not visit it a second time where its portal\n // is, and no Tab cycle forms (see usePopoverTabOrder). In a context region only Tab from the\n // element the content follows enters it; Tab on the region's other rows moves on as usual.\n const onTriggerKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key !== 'Tab' || event.shiftKey || !open) return;\n if (openOnContext) {\n const anchor = resolveTabAnchor();\n if (!anchor || event.target !== (getTriggerFocusTarget(anchor) ?? anchor)) return;\n }\n const surfaceElement = surfaceRef.current;\n const first = surfaceElement ? getFirstTabbable(surfaceElement) : null;\n if (!first) return;\n event.preventDefault();\n first.focus();\n });\n\n const onContentKeyDown = usePopoverTabOrder({\n enabled: open,\n surface,\n anchorRef: tabAnchorRef,\n // Shift+Tab from the content's first element returns to the trigger (the element in a span),\n // or, when nothing in the trigger can take focus, to the tab stop before it.\n getPreviousStop: getPopoverPreviousStop,\n });\n\n const keyboardContext = fromContext && contextOrigin === 'keyboard';\n const context = React.useMemo<PopoverContextValue>(\n () => ({\n open,\n setOpen: requestOpen,\n contentId,\n setCustomContentId,\n triggerId,\n resolvedTriggerId,\n setResolvedTriggerId,\n triggerRef,\n triggerElement,\n triggerElementRef,\n surfaceElementRef,\n arrowRef,\n onTriggerClick,\n onTriggerKeyDown,\n hoverTriggerHandlers: hoverEnabled ? hoverTriggerHandlers : null,\n hoverSurfaceHandlers: hoverEnabled ? hoverSurfaceHandlers : null,\n contextMode: openOnContext,\n contextTriggerHandlers: openOnContext ? contextTriggerHandlers : null,\n onContentContextMenu: contextSurfaceHandlers.onContextMenu,\n keyboardContext,\n onContentKeyDown,\n layerId,\n floatingProps,\n arrowStyles,\n placedSide,\n }),\n [\n open,\n requestOpen,\n contentId,\n triggerId,\n resolvedTriggerId,\n triggerElement,\n triggerElementRef,\n surfaceElementRef,\n onTriggerClick,\n onTriggerKeyDown,\n hoverEnabled,\n hoverTriggerHandlers,\n hoverSurfaceHandlers,\n openOnContext,\n contextTriggerHandlers,\n contextSurfaceHandlers,\n keyboardContext,\n onContentKeyDown,\n layerId,\n floatingProps,\n arrowStyles,\n placedSide,\n ],\n );\n\n return <PopoverContext.Provider value={context}>{children}</PopoverContext.Provider>;\n};\n\nPopoverRoot.displayName = 'Popover';\n\n/**\n * The element that toggles the popover. Its props are merged onto the single child (no wrapper\n * element): `aria-haspopup=\"dialog\"`, `aria-expanded`, `aria-controls` (while open), an `id` that\n * labels the content, a composed `onClick` and the ref used as positioning anchor and focus-return\n * target. The child's own `id`, handlers and classes are kept; the live state ARIA always wins.\n * A render function receives the props instead (spread all of them, `id` included: the content is\n * named by it); `asChild={false}` renders the 0.4 wrapper span, and a custom child that neither\n * forwards `ref` nor spreads its props falls back to that span automatically (with a development\n * warning). On the span, the state ARIA goes to the first element in the tab order inside it, and\n * focus returns to that element (to the span when you made it the trigger with a `role` such as\n * `button` and `tabIndex={0}`, or when nothing inside it can take focus).\n *\n * With `openOnHover` a mouse pointer resting on it opens the popover, and a click pins a\n * hover-opened popover instead of closing it. With `openOnContext` it is a context-menu region (a\n * list, a row, a canvas) instead of a button: it receives its `id` and the context-menu and key\n * handlers, but no state ARIA and no click toggle (a render function still receives every prop:\n * do not spread the state ARIA then).\n *\n * A Tooltip goes between the trigger and the button: it passes the trigger's `id` and ARIA on to\n * the button, which the Tooltip also describes.\n *\n * @example\n * <Popover.Trigger>\n * <Tooltip content=\"Narrow the list\">\n * <Button>Filters</Button>\n * </Tooltip>\n * </Popover.Trigger>\n *\n * Also exported as `PopoverTrigger` for React Server Components, which cannot use the dotted\n * `Popover.Trigger` (that needs a client file).\n */\nexport const PopoverTrigger = ({\n children,\n asChild,\n id: idProp,\n onClick,\n onKeyDown,\n onContextMenu,\n onPointerEnter,\n onPointerMove,\n onPointerLeave,\n ref,\n ...rest\n}: PopoverTriggerProps) => {\n const {\n open,\n contentId,\n triggerId,\n triggerElementRef,\n setResolvedTriggerId,\n onTriggerClick,\n onTriggerKeyDown,\n hoverTriggerHandlers: hover,\n contextMode,\n contextTriggerHandlers: gesture,\n } = usePopoverContext('Popover.Trigger');\n const elementRef = useMergedRefs<HTMLElement>(ref, triggerElementRef);\n\n // On a wrapper span (`asChild={false}`, the automatic fallback) useTriggerElement moves the\n // state ARIA onto the first element in the tab order inside it. The hover handlers are there\n // only with `openOnHover`, the context handlers only with `openOnContext`. A context region is\n // no popover button: it gets no state ARIA and no click toggle (useTriggerElement\n // `omitStateAria`), and a render-prop child reads a constant closed state.\n const triggerProps = {\n ...rest,\n id: idProp ?? triggerId,\n 'aria-haspopup': 'dialog' as const,\n 'aria-expanded': contextMode ? false : open,\n 'aria-controls': open && !contextMode ? contentId : undefined,\n onClick: composeEventHandlers(onClick, contextMode ? undefined : onTriggerClick),\n onKeyDown: composeEventHandlers(\n onKeyDown,\n gesture ? composeEventHandlers(gesture.onKeyDown, onTriggerKeyDown) : onTriggerKeyDown,\n ),\n onContextMenu: gesture\n ? composeEventHandlers(onContextMenu, gesture.onContextMenu)\n : onContextMenu,\n onPointerEnter: hover\n ? composeEventHandlers(onPointerEnter, hover.onPointerEnter)\n : onPointerEnter,\n onPointerMove: hover ? composeEventHandlers(onPointerMove, hover.onPointerMove) : onPointerMove,\n onPointerLeave: hover\n ? composeEventHandlers(onPointerLeave, hover.onPointerLeave)\n : onPointerLeave,\n ref: elementRef,\n } as PopoverTriggerChildProps;\n\n return useTriggerElement(children, triggerProps, {\n componentName: 'Popover.Trigger',\n asChild,\n onResolvedId: setResolvedTriggerId,\n omitStateAria: contextMode,\n });\n};\nPopoverTrigger.displayName = 'PopoverTrigger';\n\n/**\n * The popover surface: a non-modal `role=\"dialog\"` rendered in a portal (so overflow containers\n * never clip it) and positioned next to the trigger with a beak, flipping and shifting to stay in\n * the viewport. It closes on Escape and on a press outside (presses inside nested overlays opened\n * from it count as inside), and focus returns to the trigger when it closes while focus was inside.\n * In the keyboard order it follows the trigger, like inline content: Tab from the open trigger\n * enters it, Tab past its last element continues after the trigger, and Shift+Tab from the element\n * after the trigger enters it at its last element. Tab from the last element of the page moves\n * past it, and Shift+Tab from outside the page reaches the page's last element first, so a lap\n * visits it once. For a trigger outside the tab order (nothing in it can take focus, or\n * `tabIndex={-1}`), Tab from the tab stop before the trigger enters it, and Shift+Tab from its\n * first element returns to the trigger, or to that tab stop when nothing in the trigger can take\n * focus. With no tab stop before the trigger, the content is reached at the end of the page.\n * Named by `title`, `aria-label`/`aria-labelledby`, or else by its trigger: `aria-labelledby`\n * points at the id the trigger element carries in the document, or at the trigger's own label\n * elements when the trigger is named through `aria-labelledby` (an icon-only Button inside\n * `Tooltip relationship=\"label\"`); never at a missing id. A development warning names the problem\n * when the trigger has no id or no text. With `openOnContext` it is never named by the trigger (a\n * region's text is no name): pass `title`, `aria-label` or `aria-labelledby` (a development\n * warning otherwise). A consumer `id` is kept, and the trigger's `aria-controls` follows it. The\n * beak inherits the surface's background and border colors, so a `className` that changes them\n * restyles the beak too.\n *\n * With `openOnContext` it opens at the pointer of a right click, or at the focused row for\n * Shift+F10 and the ContextMenu key, and it follows that row in the keyboard order; with a\n * `target` it is placed at the target and, without a trigger, follows a target element in the\n * keyboard order.\n *\n * Also exported as `PopoverContent` for React Server Components, which cannot use the dotted\n * `Popover.Content` (that needs a client file).\n */\nexport const PopoverContent = ({\n children,\n title,\n id: idProp,\n className,\n style,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n onKeyDown,\n onContextMenu,\n onPointerEnter,\n onPointerLeave,\n ref,\n ...rest\n}: PopoverContentProps) => {\n const {\n open,\n contentId,\n setCustomContentId,\n resolvedTriggerId,\n triggerRef,\n triggerElement,\n surfaceElementRef,\n arrowRef,\n layerId,\n floatingProps,\n arrowStyles,\n placedSide,\n onContentKeyDown,\n hoverSurfaceHandlers: hover,\n contextMode,\n onContentContextMenu,\n keyboardContext,\n } = usePopoverContext('Popover.Content');\n const titleId = useId('popover-title');\n const elementRef = useMergedRefs<HTMLDivElement>(ref, surfaceElementRef);\n const hasTitle = slotRendersContent(title);\n const unnamed = ariaLabelledBy === undefined && !ariaLabel && !hasTitle;\n // A context region is no popover button, and its whole text is no name: in context mode the\n // content is never labelled by the trigger.\n const checkTrigger = open && unnamed && !contextMode;\n\n // The trigger's label ids in the document, re-read when the trigger's ids or labels change: a\n // Tooltip between Popover.Trigger and the Button leaves the Button's own id in place (and with\n // `relationship=\"label\"` names it through `aria-labelledby`), and a render-prop child may not\n // spread `id` at all — never point aria-labelledby at an id that is not there.\n const subscribeTrigger = React.useCallback(\n (onChange: () => void) => {\n if (!checkTrigger || !triggerElement || typeof MutationObserver === 'undefined') {\n return subscribeNothing();\n }\n const observer = new MutationObserver(onChange);\n observer.observe(triggerElement, {\n attributes: true,\n attributeFilter: ['id', 'aria-labelledby'],\n childList: true,\n subtree: true,\n });\n return () => observer.disconnect();\n },\n [checkTrigger, triggerElement],\n );\n const triggerLabelId = React.useSyncExternalStore(\n subscribeTrigger,\n () => (checkTrigger ? findTriggerLabelId(triggerElement, resolvedTriggerId) : undefined),\n () => (checkTrigger ? resolvedTriggerId : undefined),\n );\n\n const labelledBy =\n ariaLabelledBy ?? (ariaLabel ? undefined : hasTitle ? titleId : triggerLabelId);\n const customId = idProp || undefined;\n\n // Report the consumer's id to the root so the trigger's `aria-controls` points at it.\n React.useEffect(() => {\n setCustomContentId(customId);\n return () => setCustomContentId(undefined);\n }, [customId, setCustomContentId]);\n\n React.useEffect(() => {\n if (!open || !unnamed || !contextMode || !isDev) return;\n warnOnce(\n 'Popover.Content:name',\n 'Popover.Content: the popover has no accessible name. A context popover (openOnContext) is not named by its region: pass `title`, `aria-label` or `aria-labelledby`.',\n );\n }, [open, unnamed, contextMode]);\n\n React.useEffect(() => {\n if (!checkTrigger || !isDev) return;\n // Read after commit: a trigger's ref is attached by now even before it reported its id.\n const trigger = triggerRef.current;\n if (!trigger) {\n warnOnce(\n 'Popover.Content:name',\n 'Popover.Content: the popover has no accessible name. Pass `title`, `aria-label` or `aria-labelledby`, or open it from a Popover.Trigger.',\n );\n return;\n }\n const labelIds = findTriggerLabelId(trigger, resolvedTriggerId);\n if (!labelIds) {\n warnOnce(\n 'Popover.Content:trigger-id',\n 'Popover.Content: the popover is named by its trigger, but the trigger element has no `id` (a render-prop child of Popover.Trigger must spread the `id` it receives), so the popover has no accessible name. Spread every trigger prop onto the element, or pass `title`, `aria-label` or `aria-labelledby`.',\n );\n } else if (!referencesText(trigger.ownerDocument, labelIds)) {\n warnOnce(\n 'Popover.Content:trigger-name',\n 'Popover.Content: the popover is named by its trigger, but the trigger has no text to name it (an icon-only trigger needs `aria-label`, or `aria-labelledby` pointing at text), so the popover has no accessible name. Name the trigger, or pass `title`, `aria-label` or `aria-labelledby`.',\n );\n }\n }, [checkTrigger, resolvedTriggerId, triggerRef, triggerLabelId]);\n\n if (!open) return null;\n\n return (\n <Portal layerId={layerId}>\n <div\n role=\"dialog\"\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n tabIndex={keyboardContext ? -1 : undefined}\n {...rest}\n ref={elementRef}\n id={customId ?? contentId}\n data-side={floatingProps['data-side']}\n data-align={floatingProps['data-align']}\n style={{ ...style, ...floatingProps.style }}\n onKeyDown={composeEventHandlers(onKeyDown, onContentKeyDown)}\n onContextMenu={composeEventHandlers(onContextMenu, onContentContextMenu)}\n onPointerEnter={\n hover ? composeEventHandlers(onPointerEnter, hover.onPointerEnter) : onPointerEnter\n }\n onPointerLeave={\n hover ? composeEventHandlers(onPointerLeave, hover.onPointerLeave) : onPointerLeave\n }\n className={cn(\n 'w-64 rounded-md border border-border bg-background p-4 text-body-1 font-normal text-foreground normal-case tracking-normal text-start shadow-4',\n className,\n )}\n >\n <PopoverBeak\n ref={arrowRef}\n side={placedSide}\n style={arrowStyles}\n data-wave-popover-arrow=\"\"\n />\n {hasTitle && (\n <h2 id={titleId} className=\"mb-2 text-subtitle-2 font-semibold\">\n {title}\n </h2>\n )}\n {children}\n </div>\n </Portal>\n );\n};\nPopoverContent.displayName = 'PopoverContent';\n\n/**\n * A non-modal popup anchored to a trigger: `Popover.Trigger` (merges its props onto the child\n * button) and `Popover.Content` (portaled, positioned `role=\"dialog\"` surface). Use it for custom\n * popups such as filters or details; for a menu button use `Menu.Trigger` and `Menu.Popover`,\n * which add menu semantics and keyboard support.\n *\n * Controlled (`open`/`onOpenChange`) or uncontrolled (`defaultOpen`); `side`/`align` place the\n * content, and `ignoreOutsideRefs` lists external elements (such as a toggle button) whose presses\n * do not dismiss it.\n *\n * - **Hover cards:** `openOnHover` opens it when a mouse pointer rests on the trigger\n * (`openDelay`) and closes it once the pointer has left the trigger and the content\n * (`closeDelay`), unless focus is inside; a click on the trigger pins it.\n * - **Context popovers:** `openOnContext` makes the trigger a context-menu region: a right click\n * opens it at the pointer, Shift+F10 or the ContextMenu key at the focused row (with focus\n * moving into the content). Name the content with `title` or `aria-label`.\n * - **Custom anchors:** `target` places it at another element or at a `VirtualElement` (a point, a\n * text selection); with a controlled `open` it needs no trigger.\n *\n * @example\n * <Popover>\n * <Popover.Trigger><Button>Details</Button></Popover.Trigger>\n * <Popover.Content title=\"Details\">…</Popover.Content>\n * </Popover>\n */\nexport const Popover = /* @__PURE__ */ Object.assign(PopoverRoot, {\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n});\n"],"mappings":"s4BA6NA,IAAM8C,EAAiB9C,EAAM,cAA0C,IAAI,EAC3E,EAAe,YAAc,iBAE7B,IAAI+C,EAA2C,KAG/C,SAASC,GAAuC,CA4B9C,MA3BA,KAAiB,CACf,KAAM,GACN,YAAe,CAAC,EAChB,UAAW,6BACX,uBAA0B,CAAC,EAC3B,UAAW,6BACX,kBAAmB,IAAA,GACnB,yBAA4B,CAAC,EAC7B,WAAY,CAAE,QAAS,IAAK,EAC5B,eAAgB,KAChB,sBAAyB,CAAC,EAC1B,sBAAyB,CAAC,EAC1B,SAAU,CAAE,QAAS,IAAK,EAC1B,mBAAsB,CAAC,EACvB,qBAA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BW,EACjB,SAAUhC,GAAkB,GAAK,IAAA,GACjC,GAAIM,EACJ,IAAKG,GACL,GAAIwB,GAAYnF,EAChB,YAAWoD,EAAc,aACzB,aAAYA,EAAc,cAC1B,MAAO,CAAE,GAAGiC,EAAO,GAAGjC,EAAc,KAAM,EAC1C,UAAWnI,EAAAA,qBAAqB+I,EAAWf,CAAgB,EAC3D,cAAehI,EAAAA,qBAAqBgJ,EAAeqB,CAAoB,EACvE,eACE7B,EAAQxI,EAAAA,qBAAqBiJ,EAAgBT,EAAM,cAAc,EAAIS,EAEvE,eACET,EAAQxI,EAAAA,qBAAqBmJ,EAAgBX,EAAM,cAAc,EAAIW,EAEvE,UAAW9I,EAAAA,GACT,iJACAiK,CACF,EAtBF,SAAA,EAwBE,EAAA1I,EAAA,IAAA,CAACtB,EAAAA,YAAD,CACE,IAAKkF,EACL,KAAMG,GACN,MAAOyC,EACP,0BAAwB,EACzB,CAAA,EACAqB,IACC,EAAA7H,EAAA,IAAA,CAAC,KAAD,CAAI,GAAI4H,GAAS,UAAU,qCACxB,SAAAE,CACC,CAAA,EAELN,CACE,GACC,CAAA,EAzCQ,IA2CpB,EACA,EAAe,YAAc,iBA2B7B,IAAamB,EAA0B,OAAO,OAAO9G,EAAa,CAChE,QAAS4E,EACT,QAASgB,CACX,CAAC"}
@@ -0,0 +1,365 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { isDev as t, reportMissingContext as n, warnOnce as r } from "../../lib/dev.mjs";
4
+ import { slotRendersContent as ee } from "../../lib/slot.mjs";
5
+ import { composeEventHandlers as i } from "../../lib/composeEventHandlers.mjs";
6
+ import { useEventCallback as a } from "../../hooks/useEventCallback.mjs";
7
+ import { useControllable as o } from "../../hooks/useControllable.mjs";
8
+ import { useId as s } from "../../hooks/useId.mjs";
9
+ import { focusElement as c, getFirstTabbable as l, isConnectedAndFocusable as u } from "../../lib/focus.mjs";
10
+ import { useMergedRefs as d } from "../../hooks/useMergedRefs.mjs";
11
+ import { useIsClient as f } from "../../hooks/useIsClient.mjs";
12
+ import { getLayerTreeElements as p } from "../../lib/layers.mjs";
13
+ import { useDismiss as te } from "../../hooks/useDismiss.mjs";
14
+ import { Portal as m } from "../portal/Portal.mjs";
15
+ import { usePopupPosition as h } from "../../hooks/usePopupPosition.mjs";
16
+ import { useRestoreFocus as g } from "../../hooks/useRestoreFocus.mjs";
17
+ import { getTriggerFocusTarget as _, useTriggerElement as ne, useTriggerFocusRef as v } from "../../hooks/useTriggerElement.mjs";
18
+ import { useHoverIntent as y } from "../../hooks/useHoverIntent.mjs";
19
+ import { useContextMenuAnchor as b } from "../../hooks/useContextMenuAnchor.mjs";
20
+ import { PopoverBeak as re, getTabbableThrough as x, usePopoverTabOrder as S } from "./Popover.shared.mjs";
21
+ import * as C from "react";
22
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
23
+ //#region src/components/overlays/Popover.tsx
24
+ var E = C.createContext(null);
25
+ E.displayName = "PopoverContext";
26
+ var D = null;
27
+ function ie() {
28
+ return D ??= {
29
+ open: !1,
30
+ setOpen: () => {},
31
+ contentId: "wave-popover-inert-content",
32
+ setCustomContentId: () => {},
33
+ triggerId: "wave-popover-inert-trigger",
34
+ resolvedTriggerId: void 0,
35
+ setResolvedTriggerId: () => {},
36
+ triggerRef: { current: null },
37
+ triggerElement: null,
38
+ triggerElementRef: () => {},
39
+ surfaceElementRef: () => {},
40
+ arrowRef: { current: null },
41
+ onTriggerClick: () => {},
42
+ onTriggerKeyDown: () => {},
43
+ hoverTriggerHandlers: null,
44
+ hoverSurfaceHandlers: null,
45
+ contextMode: !1,
46
+ contextTriggerHandlers: null,
47
+ onContentContextMenu: () => {},
48
+ keyboardContext: !1,
49
+ onContentKeyDown: () => {},
50
+ layerId: "wave-popover-inert-layer",
51
+ floatingProps: {
52
+ "data-side": "bottom",
53
+ "data-align": "start",
54
+ style: {}
55
+ },
56
+ arrowStyles: {},
57
+ placedSide: "bottom"
58
+ }, D;
59
+ }
60
+ function O(e) {
61
+ return C.useContext(E) || (n(e, "Popover"), ie());
62
+ }
63
+ function k(e, t) {
64
+ let n = (t ?? "").split(/\s+/).filter((t) => t && e.getElementById(t));
65
+ return n.length > 0 ? n.join(" ") : void 0;
66
+ }
67
+ function A(e, t) {
68
+ if (!e) return t;
69
+ let n = e.ownerDocument, r = (t ? n.getElementById(t) : null) ?? _(e) ?? e;
70
+ return k(n, r.getAttribute("aria-labelledby")) ?? (r.id || e.id || void 0);
71
+ }
72
+ function ae(e, t) {
73
+ return t.split(/\s+/).some((t) => {
74
+ let n = t ? e.getElementById(t) : null;
75
+ return n ? n.getAttribute("aria-label")?.trim() || n.textContent?.trim() ? !0 : !!n.querySelector("[aria-label]:not([aria-label=\"\"]), [alt]:not([alt=\"\"]), [title]:not([title=\"\"])") : !1;
76
+ });
77
+ }
78
+ var oe = () => () => {};
79
+ function j(e, t) {
80
+ let n = e?.ownerDocument.activeElement;
81
+ return !e || !n ? !1 : e.contains(n) ? !0 : p(t, { includeOwnElements: !1 }).some((e) => e.contains(n));
82
+ }
83
+ function se(e) {
84
+ return !!e && typeof e.nodeType == "number";
85
+ }
86
+ function M(e) {
87
+ return { get current() {
88
+ return e();
89
+ } };
90
+ }
91
+ function ce(e, t, n) {
92
+ return _(e) ?? x(e, t, n);
93
+ }
94
+ var N = ({ open: e, defaultOpen: t, onOpenChange: n, side: ee = "bottom", align: i = "start", ignoreOutsideRefs: p, openOnHover: m = !1, openDelay: ne = 250, closeDelay: re = 500, openOnContext: x = !1, target: T, children: D }) => {
95
+ let [ie, O] = o(e, t ?? !1, n), k = C.useRef(!1), A = a((e) => {
96
+ k.current = !1, O(e);
97
+ }), ae = C.useCallback(() => k.current, []), oe = f(), N = ie && oe, [P, F] = C.useState("other"), [I, L] = C.useState(!1), [le, R] = C.useState(N), z = P;
98
+ N !== le && (R(N), N && (z = I ? "hover" : "other")), z !== P && F(z), I && L(!1);
99
+ let B = s("popover-content"), [ue, V] = C.useState(void 0), H = ue ?? B, U = s("popover-trigger"), [de, fe] = C.useState(void 0), [W, pe] = C.useState(null), [G, me] = C.useState(null), K = C.useRef(null), q = C.useRef(null), he = C.useRef(null), ge = se(T) ? T : null, J = C.useRef(null);
100
+ C.useInsertionEffect(() => {
101
+ J.current = ge;
102
+ }, [ge]);
103
+ let { setReference: _e, setFloating: ve, floatingProps: ye, arrowStyles: be, side: xe } = h({
104
+ open: N,
105
+ side: ee,
106
+ align: i,
107
+ offset: 8,
108
+ arrowRef: he
109
+ }), Se = C.useRef(null), Ce = a(() => {
110
+ let e = x ? Se.current?.current : null;
111
+ if (e && u(e)) return e;
112
+ let t = K.current, n = t ? _(t) : null;
113
+ if (n) return n;
114
+ let r = J.current;
115
+ return r && u(r) ? r : t;
116
+ }), we = C.useMemo(() => M(Ce), [Ce]), Te = a((e) => !(e.ctrlKey && K.current?.contains(e.target))), { layerId: Y } = te({
117
+ open: N,
118
+ onDismiss: () => A(!1),
119
+ refs: x ? [
120
+ q,
121
+ J,
122
+ ...p ?? []
123
+ ] : [
124
+ q,
125
+ K,
126
+ J,
127
+ ...p ?? []
128
+ ],
129
+ anchorRef: we,
130
+ kind: "popover",
131
+ outsidePress: !x || Te
132
+ }), X = C.useRef(!1), { anchor: Ee, fromContext: De, origin: Oe, opener: Z, triggerHandlers: ke, surfaceHandlers: Ae } = b({
133
+ enabled: x,
134
+ open: N,
135
+ trigger: G,
136
+ layerId: Y,
137
+ onOpen: (e) => {
138
+ X.current = e === "keyboard", A(!0);
139
+ },
140
+ onClose: () => A(!1)
141
+ });
142
+ C.useInsertionEffect(() => {
143
+ Se.current = Z;
144
+ }, [Z]);
145
+ let je = v(K);
146
+ g({
147
+ enabled: N,
148
+ container: W,
149
+ triggerRef: x ? void 0 : je,
150
+ finalFocusRef: x ? Z : void 0,
151
+ fallback: Ce,
152
+ onlyIfFocusInside: !0,
153
+ isHoverClose: ae
154
+ }), C.useLayoutEffect(() => {
155
+ N && (k.current = !1);
156
+ }, [N]);
157
+ let Me = d(K, me), Ne = d(q, pe, ve);
158
+ C.useLayoutEffect(() => {
159
+ _e(De ? Ee ?? (G && (_(G) ?? G)) : T ?? G);
160
+ }, [
161
+ Ee,
162
+ De,
163
+ T,
164
+ G,
165
+ _e
166
+ ]), C.useLayoutEffect(() => {
167
+ if (X.current) {
168
+ if (!N) {
169
+ X.current = !1;
170
+ return;
171
+ }
172
+ W && (X.current = !1, c(l(W) ?? W, { preventScroll: !0 }));
173
+ }
174
+ }), C.useEffect(() => {
175
+ m && x && r("Popover:hover-and-context", "Popover: `openOnHover` is ignored with `openOnContext`: a context popover opens on a right click, Shift+F10 or the ContextMenu key, not on hover.");
176
+ }, [m, x]);
177
+ let Q = m && !x, Pe = a(() => z === "hover" && !j(q.current, Y)), { triggerHandlers: Fe, surfaceHandlers: Ie, cancel: Le } = y({
178
+ enabled: Q,
179
+ open: N,
180
+ openDelay: ne,
181
+ closeDelay: re,
182
+ trigger: G,
183
+ surface: W,
184
+ onOpen: () => {
185
+ L(!0), A(!0);
186
+ },
187
+ onClose: () => {
188
+ k.current = !0, O(!1);
189
+ },
190
+ canClose: Pe
191
+ }), Re = a(() => {
192
+ Le(), N && z === "hover" ? F("other") : A((e) => !e);
193
+ }), $ = a(() => {
194
+ let e = K.current, t = x ? Z.current : null;
195
+ return t && e?.contains(t) ? t : e ?? J.current;
196
+ }), ze = C.useMemo(() => M($), [$]), Be = a((e) => {
197
+ if (e.key !== "Tab" || e.shiftKey || !N) return;
198
+ if (x) {
199
+ let t = $();
200
+ if (!t || e.target !== (_(t) ?? t)) return;
201
+ }
202
+ let t = q.current, n = t ? l(t) : null;
203
+ n && (e.preventDefault(), n.focus());
204
+ }), Ve = S({
205
+ enabled: N,
206
+ surface: W,
207
+ anchorRef: ze,
208
+ getPreviousStop: ce
209
+ }), He = De && Oe === "keyboard", Ue = C.useMemo(() => ({
210
+ open: N,
211
+ setOpen: A,
212
+ contentId: H,
213
+ setCustomContentId: V,
214
+ triggerId: U,
215
+ resolvedTriggerId: de,
216
+ setResolvedTriggerId: fe,
217
+ triggerRef: K,
218
+ triggerElement: G,
219
+ triggerElementRef: Me,
220
+ surfaceElementRef: Ne,
221
+ arrowRef: he,
222
+ onTriggerClick: Re,
223
+ onTriggerKeyDown: Be,
224
+ hoverTriggerHandlers: Q ? Fe : null,
225
+ hoverSurfaceHandlers: Q ? Ie : null,
226
+ contextMode: x,
227
+ contextTriggerHandlers: x ? ke : null,
228
+ onContentContextMenu: Ae.onContextMenu,
229
+ keyboardContext: He,
230
+ onContentKeyDown: Ve,
231
+ layerId: Y,
232
+ floatingProps: ye,
233
+ arrowStyles: be,
234
+ placedSide: xe
235
+ }), [
236
+ N,
237
+ A,
238
+ H,
239
+ U,
240
+ de,
241
+ G,
242
+ Me,
243
+ Ne,
244
+ Re,
245
+ Be,
246
+ Q,
247
+ Fe,
248
+ Ie,
249
+ x,
250
+ ke,
251
+ Ae,
252
+ He,
253
+ Ve,
254
+ Y,
255
+ ye,
256
+ be,
257
+ xe
258
+ ]);
259
+ return /* @__PURE__ */ w(E.Provider, {
260
+ value: Ue,
261
+ children: D
262
+ });
263
+ };
264
+ N.displayName = "Popover";
265
+ var P = ({ children: e, asChild: t, id: n, onClick: r, onKeyDown: ee, onContextMenu: a, onPointerEnter: o, onPointerMove: s, onPointerLeave: c, ref: l, ...u }) => {
266
+ let { open: f, contentId: p, triggerId: te, triggerElementRef: m, setResolvedTriggerId: h, onTriggerClick: g, onTriggerKeyDown: _, hoverTriggerHandlers: v, contextMode: y, contextTriggerHandlers: b } = O("Popover.Trigger"), re = d(l, m), x = {
267
+ ...u,
268
+ id: n ?? te,
269
+ "aria-haspopup": "dialog",
270
+ "aria-expanded": !y && f,
271
+ "aria-controls": f && !y ? p : void 0,
272
+ onClick: i(r, y ? void 0 : g),
273
+ onKeyDown: i(ee, b ? i(b.onKeyDown, _) : _),
274
+ onContextMenu: b ? i(a, b.onContextMenu) : a,
275
+ onPointerEnter: v ? i(o, v.onPointerEnter) : o,
276
+ onPointerMove: v ? i(s, v.onPointerMove) : s,
277
+ onPointerLeave: v ? i(c, v.onPointerLeave) : c,
278
+ ref: re
279
+ };
280
+ return ne(e, x, {
281
+ componentName: "Popover.Trigger",
282
+ asChild: t,
283
+ onResolvedId: h,
284
+ omitStateAria: y
285
+ });
286
+ };
287
+ P.displayName = "PopoverTrigger";
288
+ var F = ({ children: n, title: a, id: o, className: c, style: l, "aria-label": u, "aria-labelledby": f, onKeyDown: p, onContextMenu: te, onPointerEnter: h, onPointerLeave: g, ref: _, ...ne }) => {
289
+ let { open: v, contentId: y, setCustomContentId: b, resolvedTriggerId: x, triggerRef: S, triggerElement: E, surfaceElementRef: D, arrowRef: ie, layerId: k, floatingProps: j, arrowStyles: se, placedSide: M, onContentKeyDown: ce, hoverSurfaceHandlers: N, contextMode: P, onContentContextMenu: F, keyboardContext: I } = O("Popover.Content"), L = s("popover-title"), le = d(_, D), R = ee(a), z = f === void 0 && !u && !R, B = v && z && !P, ue = C.useCallback((e) => {
290
+ if (!B || !E || typeof MutationObserver > "u") return oe();
291
+ let t = new MutationObserver(e);
292
+ return t.observe(E, {
293
+ attributes: !0,
294
+ attributeFilter: ["id", "aria-labelledby"],
295
+ childList: !0,
296
+ subtree: !0
297
+ }), () => t.disconnect();
298
+ }, [B, E]), V = C.useSyncExternalStore(ue, () => B ? A(E, x) : void 0, () => B ? x : void 0), H = f ?? (u ? void 0 : R ? L : V), U = o || void 0;
299
+ return C.useEffect(() => (b(U), () => b(void 0)), [U, b]), C.useEffect(() => {
300
+ v && z && P && t && r("Popover.Content:name", "Popover.Content: the popover has no accessible name. A context popover (openOnContext) is not named by its region: pass `title`, `aria-label` or `aria-labelledby`.");
301
+ }, [
302
+ v,
303
+ z,
304
+ P
305
+ ]), C.useEffect(() => {
306
+ if (!B || !t) return;
307
+ let e = S.current;
308
+ if (!e) {
309
+ r("Popover.Content:name", "Popover.Content: the popover has no accessible name. Pass `title`, `aria-label` or `aria-labelledby`, or open it from a Popover.Trigger.");
310
+ return;
311
+ }
312
+ let n = A(e, x);
313
+ n ? ae(e.ownerDocument, n) || r("Popover.Content:trigger-name", "Popover.Content: the popover is named by its trigger, but the trigger has no text to name it (an icon-only trigger needs `aria-label`, or `aria-labelledby` pointing at text), so the popover has no accessible name. Name the trigger, or pass `title`, `aria-label` or `aria-labelledby`.") : r("Popover.Content:trigger-id", "Popover.Content: the popover is named by its trigger, but the trigger element has no `id` (a render-prop child of Popover.Trigger must spread the `id` it receives), so the popover has no accessible name. Spread every trigger prop onto the element, or pass `title`, `aria-label` or `aria-labelledby`.");
314
+ }, [
315
+ B,
316
+ x,
317
+ S,
318
+ V
319
+ ]), v ? /* @__PURE__ */ w(m, {
320
+ layerId: k,
321
+ children: /* @__PURE__ */ T("div", {
322
+ role: "dialog",
323
+ "aria-label": u,
324
+ "aria-labelledby": H,
325
+ tabIndex: I ? -1 : void 0,
326
+ ...ne,
327
+ ref: le,
328
+ id: U ?? y,
329
+ "data-side": j["data-side"],
330
+ "data-align": j["data-align"],
331
+ style: {
332
+ ...l,
333
+ ...j.style
334
+ },
335
+ onKeyDown: i(p, ce),
336
+ onContextMenu: i(te, F),
337
+ onPointerEnter: N ? i(h, N.onPointerEnter) : h,
338
+ onPointerLeave: N ? i(g, N.onPointerLeave) : g,
339
+ className: e("w-64 rounded-md border border-border bg-background p-4 text-body-1 font-normal text-foreground normal-case tracking-normal text-start shadow-4", c),
340
+ children: [
341
+ /* @__PURE__ */ w(re, {
342
+ ref: ie,
343
+ side: M,
344
+ style: se,
345
+ "data-wave-popover-arrow": ""
346
+ }),
347
+ R && /* @__PURE__ */ w("h2", {
348
+ id: L,
349
+ className: "mb-2 text-subtitle-2 font-semibold",
350
+ children: a
351
+ }),
352
+ n
353
+ ]
354
+ })
355
+ }) : null;
356
+ };
357
+ F.displayName = "PopoverContent";
358
+ var I = /* @__PURE__ */ Object.assign(N, {
359
+ Trigger: P,
360
+ Content: F
361
+ });
362
+ //#endregion
363
+ export { I as Popover, F as PopoverContent, P as PopoverTrigger };
364
+
365
+ //# sourceMappingURL=Popover.mjs.map