@dxos/react-ui 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8

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 (684) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/browser/chunk-5SPBSIWS.mjs +33 -0
  4. package/dist/lib/browser/chunk-5SPBSIWS.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-7JFD5ZHZ.mjs +1612 -0
  6. package/dist/lib/browser/chunk-7JFD5ZHZ.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +5263 -60
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/testing/index.mjs +110 -61
  11. package/dist/lib/browser/testing/index.mjs.map +4 -4
  12. package/dist/lib/browser/translations.mjs +9 -0
  13. package/dist/lib/browser/translations.mjs.map +7 -0
  14. package/dist/lib/node-esm/chunk-FPVTVXND.mjs +35 -0
  15. package/dist/lib/node-esm/chunk-FPVTVXND.mjs.map +7 -0
  16. package/dist/lib/node-esm/chunk-TTEL2FP2.mjs +1614 -0
  17. package/dist/lib/node-esm/chunk-TTEL2FP2.mjs.map +7 -0
  18. package/dist/lib/node-esm/index.mjs +5263 -60
  19. package/dist/lib/node-esm/index.mjs.map +4 -4
  20. package/dist/lib/node-esm/meta.json +1 -1
  21. package/dist/lib/node-esm/testing/index.mjs +110 -61
  22. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  23. package/dist/lib/node-esm/translations.mjs +10 -0
  24. package/dist/lib/node-esm/translations.mjs.map +7 -0
  25. package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
  26. package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
  27. package/dist/types/src/components/Avatars/Avatar.stories.d.ts +5 -31
  28. package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Avatars/Avatar.theme.d.ts +11 -0
  30. package/dist/types/src/components/Avatars/Avatar.theme.d.ts.map +1 -0
  31. package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +5 -11
  32. package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +5 -1
  34. package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  35. package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -20
  36. package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/Breadcrumb/Breadcrumb.theme.d.ts +4 -0
  38. package/dist/types/src/components/Breadcrumb/Breadcrumb.theme.d.ts.map +1 -0
  39. package/dist/types/src/components/{Buttons → Button}/Button.d.ts +5 -5
  40. package/dist/types/src/components/Button/Button.d.ts.map +1 -0
  41. package/dist/types/src/components/Button/Button.stories.d.ts +17 -0
  42. package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
  43. package/dist/types/src/components/Button/Button.theme.d.ts +11 -0
  44. package/dist/types/src/components/Button/Button.theme.d.ts.map +1 -0
  45. package/dist/types/src/components/{Buttons → Button}/IconButton.d.ts +4 -3
  46. package/dist/types/src/components/Button/IconButton.d.ts.map +1 -0
  47. package/dist/types/src/components/Button/IconButton.stories.d.ts +17 -0
  48. package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -0
  49. package/dist/types/src/components/Button/IconButton.theme.d.ts +8 -0
  50. package/dist/types/src/components/Button/IconButton.theme.d.ts.map +1 -0
  51. package/dist/types/src/components/{Buttons → Button}/Toggle.d.ts +2 -2
  52. package/dist/types/src/components/Button/Toggle.d.ts.map +1 -0
  53. package/dist/types/src/components/Button/Toggle.stories.d.ts +16 -0
  54. package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -0
  55. package/dist/types/src/components/Button/ToggleGroup.d.ts +27 -0
  56. package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -0
  57. package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +27 -0
  58. package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -0
  59. package/dist/types/src/components/Button/index.d.ts.map +1 -0
  60. package/dist/types/src/components/Calendar/Calendar.d.ts +33 -0
  61. package/dist/types/src/components/Calendar/Calendar.d.ts.map +1 -0
  62. package/dist/types/src/components/Calendar/Calendar.stories.d.ts +9 -0
  63. package/dist/types/src/components/Calendar/Calendar.stories.d.ts.map +1 -0
  64. package/dist/types/src/components/Calendar/Calendar.theme.d.ts +4 -0
  65. package/dist/types/src/components/Calendar/Calendar.theme.d.ts.map +1 -0
  66. package/dist/types/src/components/Calendar/index.d.ts +2 -0
  67. package/dist/types/src/components/Calendar/index.d.ts.map +1 -0
  68. package/dist/types/src/components/Card/Card.d.ts +126 -0
  69. package/dist/types/src/components/Card/Card.d.ts.map +1 -0
  70. package/dist/types/src/components/Card/Card.stories.d.ts +22 -0
  71. package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -0
  72. package/dist/types/src/components/Card/Card.theme.d.ts +12 -0
  73. package/dist/types/src/components/Card/Card.theme.d.ts.map +1 -0
  74. package/dist/types/src/components/Card/index.d.ts +2 -0
  75. package/dist/types/src/components/Card/index.d.ts.map +1 -0
  76. package/dist/types/src/components/Carousel/Carousel.d.ts +106 -0
  77. package/dist/types/src/components/Carousel/Carousel.d.ts.map +1 -0
  78. package/dist/types/src/components/Carousel/Carousel.stories.d.ts +14 -0
  79. package/dist/types/src/components/Carousel/Carousel.stories.d.ts.map +1 -0
  80. package/dist/types/src/components/Carousel/index.d.ts +2 -0
  81. package/dist/types/src/components/Carousel/index.d.ts.map +1 -0
  82. package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
  83. package/dist/types/src/components/Clipboard/CopyButton.d.ts +1 -1
  84. package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
  85. package/dist/types/src/components/Clipboard/index.d.ts +10 -1
  86. package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
  87. package/dist/types/src/components/Column/Column.d.ts +33 -0
  88. package/dist/types/src/components/Column/Column.d.ts.map +1 -0
  89. package/dist/types/src/components/Column/Column.stories.d.ts +25 -0
  90. package/dist/types/src/components/Column/Column.stories.d.ts.map +1 -0
  91. package/dist/types/src/components/Column/Column.theme.d.ts +9 -0
  92. package/dist/types/src/components/Column/Column.theme.d.ts.map +1 -0
  93. package/dist/types/src/components/Column/index.d.ts +3 -0
  94. package/dist/types/src/components/Column/index.d.ts.map +1 -0
  95. package/dist/types/src/components/Column/withColumn.d.ts +21 -0
  96. package/dist/types/src/components/Column/withColumn.d.ts.map +1 -0
  97. package/dist/types/src/components/DatePicker/DatePicker.d.ts +72 -0
  98. package/dist/types/src/components/DatePicker/DatePicker.d.ts.map +1 -0
  99. package/dist/types/src/components/DatePicker/DatePicker.stories.d.ts +10 -0
  100. package/dist/types/src/components/DatePicker/DatePicker.stories.d.ts.map +1 -0
  101. package/dist/types/src/components/DatePicker/DatePicker.theme.d.ts +6 -0
  102. package/dist/types/src/components/DatePicker/DatePicker.theme.d.ts.map +1 -0
  103. package/dist/types/src/components/DatePicker/index.d.ts +2 -0
  104. package/dist/types/src/components/DatePicker/index.d.ts.map +1 -0
  105. package/dist/types/src/components/Dialog/AlertDialog.d.ts +51 -0
  106. package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -0
  107. package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts +11 -0
  108. package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -0
  109. package/dist/types/src/components/Dialog/Dialog.d.ts +66 -0
  110. package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
  111. package/dist/types/src/components/Dialog/Dialog.stories.d.ts +25 -0
  112. package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
  113. package/dist/types/src/components/Dialog/Dialog.theme.d.ts +10 -0
  114. package/dist/types/src/components/Dialog/Dialog.theme.d.ts.map +1 -0
  115. package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
  116. package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts +11 -0
  117. package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts.map +1 -0
  118. package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts +7 -0
  119. package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts.map +1 -0
  120. package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts +19 -0
  121. package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts.map +1 -0
  122. package/dist/types/src/components/ErrorFallback/ThrowError.d.ts +9 -0
  123. package/dist/types/src/components/ErrorFallback/ThrowError.d.ts.map +1 -0
  124. package/dist/types/src/components/ErrorFallback/index.d.ts +5 -0
  125. package/dist/types/src/components/ErrorFallback/index.d.ts.map +1 -0
  126. package/dist/types/src/components/Focus/Focus.d.ts +36 -0
  127. package/dist/types/src/components/Focus/Focus.d.ts.map +1 -0
  128. package/dist/types/src/components/Focus/Focus.stories.d.ts +9 -0
  129. package/dist/types/src/components/Focus/Focus.stories.d.ts.map +1 -0
  130. package/dist/types/src/components/Focus/Focus.theme.d.ts +6 -0
  131. package/dist/types/src/components/Focus/Focus.theme.d.ts.map +1 -0
  132. package/dist/types/src/components/Focus/index.d.ts +2 -0
  133. package/dist/types/src/components/Focus/index.d.ts.map +1 -0
  134. package/dist/types/src/components/Icon/Icon.d.ts +6 -2
  135. package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
  136. package/dist/types/src/components/Icon/Icon.stories.d.ts +25 -0
  137. package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -0
  138. package/dist/types/src/components/Icon/Icon.theme.d.ts +11 -0
  139. package/dist/types/src/components/Icon/Icon.theme.d.ts.map +1 -0
  140. package/dist/types/src/components/Icon/IconBlock.d.ts +15 -0
  141. package/dist/types/src/components/Icon/IconBlock.d.ts.map +1 -0
  142. package/dist/types/src/components/Icon/index.d.ts +1 -0
  143. package/dist/types/src/components/Icon/index.d.ts.map +1 -1
  144. package/dist/types/src/components/Image/Image.d.ts +21 -0
  145. package/dist/types/src/components/Image/Image.d.ts.map +1 -0
  146. package/dist/types/src/components/Image/Image.stories.d.ts +34 -0
  147. package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -0
  148. package/dist/types/src/components/Image/index.d.ts +2 -0
  149. package/dist/types/src/components/Image/index.d.ts.map +1 -0
  150. package/dist/types/src/components/Input/Input.d.ts +95 -22
  151. package/dist/types/src/components/Input/Input.d.ts.map +1 -1
  152. package/dist/types/src/components/Input/Input.stories.d.ts +29 -19
  153. package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
  154. package/dist/types/src/components/Input/Input.theme.d.ts +115 -0
  155. package/dist/types/src/components/Input/Input.theme.d.ts.map +1 -0
  156. package/dist/types/src/components/Input/SegmentedInput.d.ts +79 -0
  157. package/dist/types/src/components/Input/SegmentedInput.d.ts.map +1 -0
  158. package/dist/types/src/components/Input/constants.d.ts +2 -0
  159. package/dist/types/src/components/Input/constants.d.ts.map +1 -0
  160. package/dist/types/src/components/Input/index.d.ts +2 -0
  161. package/dist/types/src/components/Input/index.d.ts.map +1 -1
  162. package/dist/types/src/components/Link/Link.d.ts.map +1 -1
  163. package/dist/types/src/components/Link/Link.stories.d.ts +8 -8
  164. package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
  165. package/dist/types/src/components/Link/Link.theme.d.ts +6 -0
  166. package/dist/types/src/components/Link/Link.theme.d.ts.map +1 -0
  167. package/dist/types/src/components/{Lists → List}/List.d.ts +6 -4
  168. package/dist/types/src/components/List/List.d.ts.map +1 -0
  169. package/dist/types/src/components/List/List.stories.d.ts +16 -0
  170. package/dist/types/src/components/List/List.stories.d.ts.map +1 -0
  171. package/dist/types/src/components/List/List.theme.d.ts +7 -0
  172. package/dist/types/src/components/List/List.theme.d.ts.map +1 -0
  173. package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -0
  174. package/dist/types/src/components/{Lists → List}/Tree.d.ts +2 -2
  175. package/dist/types/src/components/List/Tree.d.ts.map +1 -0
  176. package/dist/types/src/components/List/Tree.stories.d.ts +15 -0
  177. package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -0
  178. package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -0
  179. package/dist/types/src/components/{Lists → List}/Treegrid.d.ts +6 -10
  180. package/dist/types/src/components/List/Treegrid.d.ts.map +1 -0
  181. package/dist/types/src/components/List/Treegrid.stories.d.ts +12 -0
  182. package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -0
  183. package/dist/types/src/components/List/Treegrid.theme.d.ts +7 -0
  184. package/dist/types/src/components/List/Treegrid.theme.d.ts.map +1 -0
  185. package/dist/types/src/components/List/index.d.ts.map +1 -0
  186. package/dist/types/src/components/Main/Main.d.ts +25 -31
  187. package/dist/types/src/components/Main/Main.d.ts.map +1 -1
  188. package/dist/types/src/components/Main/Main.stories.d.ts +6 -10
  189. package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
  190. package/dist/types/src/components/Main/Main.theme.d.ts +20 -0
  191. package/dist/types/src/components/Main/Main.theme.d.ts.map +1 -0
  192. package/dist/types/src/components/Main/constants.d.ts +3 -0
  193. package/dist/types/src/components/Main/constants.d.ts.map +1 -0
  194. package/dist/types/src/components/Main/index.d.ts +1 -0
  195. package/dist/types/src/components/Main/index.d.ts.map +1 -1
  196. package/dist/types/src/components/Main/useSwipeToDismiss.d.ts.map +1 -1
  197. package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts +47 -0
  198. package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts.map +1 -0
  199. package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts +16 -0
  200. package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts.map +1 -0
  201. package/dist/types/src/components/MediaPlayer/index.d.ts +2 -0
  202. package/dist/types/src/components/MediaPlayer/index.d.ts.map +1 -0
  203. package/dist/types/src/components/{Menus → Menu}/ContextMenu.d.ts +6 -6
  204. package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -0
  205. package/dist/types/src/components/Menu/ContextMenu.stories.d.ts +12 -0
  206. package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -0
  207. package/dist/types/src/components/Menu/DropdownMenu.d.ts +121 -0
  208. package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -0
  209. package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts +28 -0
  210. package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -0
  211. package/dist/types/src/components/Menu/Menu.theme.d.ts +7 -0
  212. package/dist/types/src/components/Menu/Menu.theme.d.ts.map +1 -0
  213. package/dist/types/src/components/Menu/index.d.ts.map +1 -0
  214. package/dist/types/src/components/Message/Message.d.ts +4 -4
  215. package/dist/types/src/components/Message/Message.d.ts.map +1 -1
  216. package/dist/types/src/components/Message/Message.stories.d.ts +16 -22
  217. package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
  218. package/dist/types/src/components/Message/Message.theme.d.ts +7 -0
  219. package/dist/types/src/components/Message/Message.theme.d.ts.map +1 -0
  220. package/dist/types/src/components/Panel/Panel.d.ts +35 -0
  221. package/dist/types/src/components/Panel/Panel.d.ts.map +1 -0
  222. package/dist/types/src/components/Panel/Panel.stories.d.ts +6 -0
  223. package/dist/types/src/components/Panel/Panel.stories.d.ts.map +1 -0
  224. package/dist/types/src/components/Panel/Panel.theme.d.ts +13 -0
  225. package/dist/types/src/components/Panel/Panel.theme.d.ts.map +1 -0
  226. package/dist/types/src/components/Panel/index.d.ts +2 -0
  227. package/dist/types/src/components/Panel/index.d.ts.map +1 -0
  228. package/dist/types/src/components/Popover/Popover.d.ts +41 -24
  229. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  230. package/dist/types/src/components/Popover/Popover.stories.d.ts +6 -34
  231. package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
  232. package/dist/types/src/components/Popover/Popover.theme.d.ts +8 -0
  233. package/dist/types/src/components/Popover/Popover.theme.d.ts.map +1 -0
  234. package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +27 -27
  235. package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
  236. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +50 -27
  237. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
  238. package/dist/types/src/components/ScrollArea/ScrollArea.theme.d.ts +17 -0
  239. package/dist/types/src/components/ScrollArea/ScrollArea.theme.d.ts.map +1 -0
  240. package/dist/types/src/components/ScrollArea/index.d.ts +1 -0
  241. package/dist/types/src/components/ScrollArea/index.d.ts.map +1 -1
  242. package/dist/types/src/components/ScrollArea/scrollbar.d.ts +18 -0
  243. package/dist/types/src/components/ScrollArea/scrollbar.d.ts.map +1 -0
  244. package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +62 -0
  245. package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -0
  246. package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +23 -0
  247. package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -0
  248. package/dist/types/src/components/ScrollContainer/index.d.ts +2 -0
  249. package/dist/types/src/components/ScrollContainer/index.d.ts.map +1 -0
  250. package/dist/types/src/components/Select/Select.d.ts +10 -10
  251. package/dist/types/src/components/Select/Select.d.ts.map +1 -1
  252. package/dist/types/src/components/Select/Select.stories.d.ts +6 -11
  253. package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
  254. package/dist/types/src/components/Select/Select.theme.d.ts +6 -0
  255. package/dist/types/src/components/Select/Select.theme.d.ts.map +1 -0
  256. package/dist/types/src/components/Separator/Separator.d.ts +4 -4
  257. package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
  258. package/dist/types/src/components/Separator/Separator.theme.d.ts +7 -0
  259. package/dist/types/src/components/Separator/Separator.theme.d.ts.map +1 -0
  260. package/dist/types/src/components/Skeleton/Skeleton.d.ts +12 -0
  261. package/dist/types/src/components/Skeleton/Skeleton.d.ts.map +1 -0
  262. package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts +17 -0
  263. package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -0
  264. package/dist/types/src/components/Skeleton/Skeleton.theme.d.ts +6 -0
  265. package/dist/types/src/components/Skeleton/Skeleton.theme.d.ts.map +1 -0
  266. package/dist/types/src/components/Skeleton/index.d.ts +2 -0
  267. package/dist/types/src/components/Skeleton/index.d.ts.map +1 -0
  268. package/dist/types/src/components/Splitter/Splitter.d.ts +32 -0
  269. package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -0
  270. package/dist/types/src/components/Splitter/Splitter.stories.d.ts +7 -0
  271. package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -0
  272. package/dist/types/src/components/Splitter/Splitter.theme.d.ts +4 -0
  273. package/dist/types/src/components/Splitter/Splitter.theme.d.ts.map +1 -0
  274. package/dist/types/src/components/Splitter/index.d.ts +2 -0
  275. package/dist/types/src/components/Splitter/index.d.ts.map +1 -0
  276. package/dist/types/src/components/Status/Status.d.ts +3 -4
  277. package/dist/types/src/components/Status/Status.d.ts.map +1 -1
  278. package/dist/types/src/components/Status/Status.stories.d.ts +6 -10
  279. package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
  280. package/dist/types/src/components/Status/Status.theme.d.ts +7 -0
  281. package/dist/types/src/components/Status/Status.theme.d.ts.map +1 -0
  282. package/dist/types/src/components/Tag/Tag.d.ts +1 -1
  283. package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
  284. package/dist/types/src/components/Tag/Tag.stories.d.ts +8 -13
  285. package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
  286. package/dist/types/src/components/Tag/Tag.theme.d.ts +6 -0
  287. package/dist/types/src/components/Tag/Tag.theme.d.ts.map +1 -0
  288. package/dist/types/src/components/Toast/Toast.d.ts +27 -24
  289. package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
  290. package/dist/types/src/components/Toast/Toast.stories.d.ts +11 -46
  291. package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
  292. package/dist/types/src/components/Toast/Toast.theme.d.ts +4 -0
  293. package/dist/types/src/components/Toast/Toast.theme.d.ts.map +1 -0
  294. package/dist/types/src/components/Toolbar/Toolbar.d.ts +54 -24
  295. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  296. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +6 -50
  297. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  298. package/dist/types/src/components/Toolbar/Toolbar.theme.d.ts +8 -0
  299. package/dist/types/src/components/Toolbar/Toolbar.theme.d.ts.map +1 -0
  300. package/dist/types/src/components/Tooltip/Tooltip.d.ts +16 -18
  301. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  302. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +10 -63
  303. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  304. package/dist/types/src/components/Tooltip/Tooltip.theme.d.ts +6 -0
  305. package/dist/types/src/components/Tooltip/Tooltip.theme.d.ts.map +1 -0
  306. package/dist/types/src/components/Tooltip/index.d.ts +1 -0
  307. package/dist/types/src/components/Tooltip/index.d.ts.map +1 -1
  308. package/dist/types/src/components/Tooltip/tooltipContent.d.ts +4 -0
  309. package/dist/types/src/components/Tooltip/tooltipContent.d.ts.map +1 -0
  310. package/dist/types/src/components/index.d.ts +18 -9
  311. package/dist/types/src/components/index.d.ts.map +1 -1
  312. package/dist/types/src/exemplars/generics.stories.d.ts +19 -0
  313. package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -0
  314. package/dist/types/src/exemplars/slot.stories.d.ts +15 -0
  315. package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -0
  316. package/dist/types/src/exemplars/tabster.stories.d.ts +8 -0
  317. package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -0
  318. package/dist/types/src/exemplars/virtualizer.stories.d.ts +11 -0
  319. package/dist/types/src/exemplars/virtualizer.stories.d.ts.map +1 -0
  320. package/dist/types/src/hooks/index.d.ts +1 -0
  321. package/dist/types/src/hooks/index.d.ts.map +1 -1
  322. package/dist/types/src/hooks/useDensityContext.d.ts +2 -2
  323. package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
  324. package/dist/types/src/hooks/useElevationContext.d.ts +1 -1
  325. package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
  326. package/dist/types/src/hooks/useIconHref.d.ts.map +1 -1
  327. package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
  328. package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -1
  329. package/dist/types/src/hooks/useTranslationsContext.d.ts +1 -1
  330. package/dist/types/src/hooks/useVisualViewport.d.ts +2 -2
  331. package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
  332. package/dist/types/src/index.d.ts +3 -1
  333. package/dist/types/src/index.d.ts.map +1 -1
  334. package/dist/types/src/playground/Controls.stories.d.ts +5 -9
  335. package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
  336. package/dist/types/src/playground/Custom.stories.d.ts +12 -4
  337. package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
  338. package/dist/types/src/playground/Typography.stories.d.ts +5 -11
  339. package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
  340. package/dist/types/src/primitives/Container/Container.d.ts +7 -0
  341. package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
  342. package/dist/types/src/primitives/Container/Container.stories.d.ts +6 -0
  343. package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
  344. package/dist/types/src/primitives/Container/index.d.ts +2 -0
  345. package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
  346. package/dist/types/src/{components → primitives}/DensityProvider/DensityProvider.d.ts +1 -1
  347. package/dist/types/src/{components → primitives}/DensityProvider/DensityProvider.d.ts.map +1 -1
  348. package/dist/types/src/primitives/DensityProvider/index.d.ts.map +1 -0
  349. package/dist/types/src/{components → primitives}/ElevationProvider/ElevationProvider.d.ts +1 -1
  350. package/dist/types/src/{components → primitives}/ElevationProvider/ElevationProvider.d.ts.map +1 -1
  351. package/dist/types/src/primitives/ElevationProvider/index.d.ts.map +1 -0
  352. package/dist/types/src/primitives/Flex/Flex.d.ts +11 -0
  353. package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -0
  354. package/dist/types/src/primitives/Flex/Flex.stories.d.ts +8 -0
  355. package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -0
  356. package/dist/types/src/primitives/Flex/index.d.ts +2 -0
  357. package/dist/types/src/primitives/Flex/index.d.ts.map +1 -0
  358. package/dist/types/src/primitives/Grid/Grid.d.ts +10 -0
  359. package/dist/types/src/primitives/Grid/Grid.d.ts.map +1 -0
  360. package/dist/types/src/primitives/Grid/Grid.stories.d.ts +8 -0
  361. package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -0
  362. package/dist/types/src/primitives/Grid/index.d.ts +2 -0
  363. package/dist/types/src/primitives/Grid/index.d.ts.map +1 -0
  364. package/dist/types/src/{components → primitives}/ThemeProvider/ThemeProvider.d.ts +3 -3
  365. package/dist/types/src/primitives/ThemeProvider/ThemeProvider.d.ts.map +1 -0
  366. package/dist/types/src/primitives/ThemeProvider/ThemeProvider.stories.d.ts +12 -0
  367. package/dist/types/src/primitives/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -0
  368. package/dist/types/src/primitives/ThemeProvider/TranslationsProvider.d.ts +128 -0
  369. package/dist/types/src/primitives/ThemeProvider/TranslationsProvider.d.ts.map +1 -0
  370. package/dist/types/src/primitives/ThemeProvider/index.d.ts +4 -0
  371. package/dist/types/src/primitives/ThemeProvider/index.d.ts.map +1 -0
  372. package/dist/types/src/primitives/index.d.ts +7 -0
  373. package/dist/types/src/primitives/index.d.ts.map +1 -0
  374. package/dist/types/src/testing/Loading.d.ts +9 -0
  375. package/dist/types/src/testing/Loading.d.ts.map +1 -0
  376. package/dist/types/src/testing/decorators/index.d.ts +2 -1
  377. package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
  378. package/dist/types/src/testing/decorators/withLayout.d.ts +15 -0
  379. package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -0
  380. package/dist/types/src/testing/decorators/withLayoutVariants.d.ts +12 -0
  381. package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -0
  382. package/dist/types/src/testing/decorators/withTheme.d.ts +9 -1
  383. package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
  384. package/dist/types/src/testing/index.d.ts +1 -0
  385. package/dist/types/src/testing/index.d.ts.map +1 -1
  386. package/dist/types/src/theme/bindTheme.d.ts +3 -0
  387. package/dist/types/src/theme/bindTheme.d.ts.map +1 -0
  388. package/dist/types/src/theme/defaultTheme.d.ts +4 -0
  389. package/dist/types/src/theme/defaultTheme.d.ts.map +1 -0
  390. package/dist/types/src/theme/index.d.ts +31 -0
  391. package/dist/types/src/theme/index.d.ts.map +1 -0
  392. package/dist/types/src/translations.d.ts +25 -0
  393. package/dist/types/src/translations.d.ts.map +1 -0
  394. package/dist/types/src/util/index.d.ts +4 -2
  395. package/dist/types/src/util/index.d.ts.map +1 -1
  396. package/dist/types/src/util/mobile.d.ts +5 -0
  397. package/dist/types/src/util/mobile.d.ts.map +1 -0
  398. package/dist/types/src/util/slots.d.ts +57 -0
  399. package/dist/types/src/util/slots.d.ts.map +1 -0
  400. package/dist/types/src/util/usePx.d.ts +8 -0
  401. package/dist/types/src/util/usePx.d.ts.map +1 -0
  402. package/dist/types/tsconfig.tsbuildinfo +1 -1
  403. package/package.json +55 -40
  404. package/src/components/Avatars/Avatar.stories.tsx +22 -16
  405. package/src/components/Avatars/Avatar.theme.ts +93 -0
  406. package/src/components/Avatars/Avatar.tsx +7 -15
  407. package/src/components/Avatars/AvatarGroup.stories.tsx +10 -8
  408. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +19 -16
  409. package/src/components/Breadcrumb/Breadcrumb.theme.ts +26 -0
  410. package/src/components/Breadcrumb/Breadcrumb.tsx +25 -39
  411. package/src/components/{Buttons → Button}/Button.stories.tsx +7 -10
  412. package/src/components/Button/Button.theme.ts +31 -0
  413. package/src/components/{Buttons → Button}/Button.tsx +13 -27
  414. package/src/components/Button/IconButton.stories.tsx +92 -0
  415. package/src/components/Button/IconButton.theme.ts +21 -0
  416. package/src/components/{Buttons → Button}/IconButton.tsx +21 -16
  417. package/src/components/Button/Toggle.stories.tsx +36 -0
  418. package/src/components/{Buttons → Button}/Toggle.tsx +4 -4
  419. package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +10 -9
  420. package/src/components/Button/ToggleGroup.tsx +50 -0
  421. package/src/components/Calendar/Calendar.stories.tsx +43 -0
  422. package/src/components/Calendar/Calendar.theme.ts +74 -0
  423. package/src/components/Calendar/Calendar.tsx +196 -0
  424. package/src/components/Calendar/index.ts +5 -0
  425. package/src/components/Card/Card.stories.tsx +172 -0
  426. package/src/components/Card/Card.theme.ts +93 -0
  427. package/src/components/Card/Card.tsx +485 -0
  428. package/src/components/Card/index.ts +5 -0
  429. package/src/components/Carousel/Carousel.stories.tsx +47 -0
  430. package/src/components/Carousel/Carousel.tsx +373 -0
  431. package/src/components/Carousel/index.ts +5 -0
  432. package/src/components/Clipboard/CopyButton.tsx +11 -12
  433. package/src/components/Column/AUDIT.md +148 -0
  434. package/src/components/Column/Column.stories.tsx +181 -0
  435. package/src/components/Column/Column.theme.ts +48 -0
  436. package/src/components/Column/Column.tsx +166 -0
  437. package/src/components/Column/index.ts +6 -0
  438. package/src/components/Column/withColumn.ts +27 -0
  439. package/src/components/DatePicker/DatePicker.stories.tsx +102 -0
  440. package/src/components/DatePicker/DatePicker.theme.ts +35 -0
  441. package/src/components/DatePicker/DatePicker.tsx +279 -0
  442. package/src/components/DatePicker/index.ts +5 -0
  443. package/src/components/Dialog/AlertDialog.stories.tsx +68 -0
  444. package/src/components/Dialog/AlertDialog.tsx +209 -0
  445. package/src/components/Dialog/Dialog.stories.tsx +177 -0
  446. package/src/components/Dialog/Dialog.theme.ts +61 -0
  447. package/src/components/Dialog/Dialog.tsx +314 -0
  448. package/src/components/ErrorFallback/ErrorFallback.stories.tsx +45 -0
  449. package/src/components/ErrorFallback/ErrorFallback.tsx +76 -0
  450. package/src/components/ErrorFallback/ErrorStack.tsx +120 -0
  451. package/src/components/ErrorFallback/ThrowError.tsx +37 -0
  452. package/src/components/ErrorFallback/index.ts +9 -0
  453. package/src/components/Focus/AUDIT.md +43 -0
  454. package/src/components/Focus/Focus.stories.tsx +230 -0
  455. package/src/components/Focus/Focus.theme.ts +32 -0
  456. package/src/components/Focus/Focus.tsx +201 -0
  457. package/src/components/Focus/index.ts +5 -0
  458. package/src/components/Icon/Icon.stories.tsx +143 -0
  459. package/src/components/Icon/Icon.theme.ts +45 -0
  460. package/src/components/Icon/Icon.tsx +15 -4
  461. package/src/components/Icon/IconBlock.tsx +38 -0
  462. package/src/components/Icon/index.ts +1 -0
  463. package/src/components/Image/Image.stories.tsx +86 -0
  464. package/src/components/Image/Image.tsx +252 -0
  465. package/src/components/Image/index.ts +5 -0
  466. package/src/components/Input/Input.stories.tsx +152 -72
  467. package/src/components/Input/Input.theme.ts +191 -0
  468. package/src/components/Input/Input.tsx +247 -77
  469. package/src/components/Input/SegmentedInput.tsx +454 -0
  470. package/src/components/Input/constants.ts +5 -0
  471. package/src/components/Input/index.ts +2 -0
  472. package/src/components/Link/Link.stories.tsx +10 -8
  473. package/src/components/Link/Link.theme.ts +16 -0
  474. package/src/components/Link/Link.tsx +11 -3
  475. package/src/components/{Lists → List}/List.stories.tsx +42 -45
  476. package/src/components/List/List.theme.ts +47 -0
  477. package/src/components/{Lists → List}/List.tsx +22 -23
  478. package/src/components/{Lists → List}/ListDropIndicator.tsx +7 -8
  479. package/src/components/{Lists → List}/Tree.stories.tsx +15 -14
  480. package/src/components/{Lists → List}/Tree.tsx +0 -1
  481. package/src/components/{Lists → List}/TreeDropIndicator.tsx +6 -6
  482. package/src/components/{Lists → List}/Treegrid.stories.tsx +39 -35
  483. package/src/components/List/Treegrid.theme.ts +35 -0
  484. package/src/components/List/Treegrid.tsx +187 -0
  485. package/src/components/Main/Main.stories.tsx +52 -28
  486. package/src/components/Main/Main.theme.ts +29 -0
  487. package/src/components/Main/Main.tsx +176 -104
  488. package/src/components/Main/constants.ts +6 -0
  489. package/src/components/Main/index.ts +1 -0
  490. package/src/components/MediaPlayer/MediaPlayer.stories.tsx +50 -0
  491. package/src/components/MediaPlayer/MediaPlayer.tsx +182 -0
  492. package/src/components/MediaPlayer/index.ts +5 -0
  493. package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +11 -13
  494. package/src/components/{Menus → Menu}/ContextMenu.tsx +10 -33
  495. package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +12 -14
  496. package/src/components/{Menus → Menu}/DropdownMenu.tsx +166 -129
  497. package/src/components/Menu/Menu.theme.ts +48 -0
  498. package/src/components/Message/Message.stories.tsx +74 -19
  499. package/src/components/Message/Message.theme.ts +44 -0
  500. package/src/components/Message/Message.tsx +107 -38
  501. package/src/components/Panel/Panel.stories.tsx +67 -0
  502. package/src/components/Panel/Panel.theme.ts +41 -0
  503. package/src/components/Panel/Panel.tsx +121 -0
  504. package/src/components/Panel/index.ts +5 -0
  505. package/src/components/Popover/Popover.stories.tsx +17 -16
  506. package/src/components/Popover/Popover.theme.ts +40 -0
  507. package/src/components/Popover/Popover.tsx +125 -103
  508. package/src/components/ScrollArea/ScrollArea.stories.tsx +220 -33
  509. package/src/components/ScrollArea/ScrollArea.theme.ts +107 -0
  510. package/src/components/ScrollArea/ScrollArea.tsx +98 -79
  511. package/src/components/ScrollArea/index.ts +2 -1
  512. package/src/components/ScrollArea/scrollbar.ts +21 -0
  513. package/src/components/ScrollContainer/ScrollContainer.stories.tsx +91 -0
  514. package/src/components/ScrollContainer/ScrollContainer.tsx +347 -0
  515. package/src/components/ScrollContainer/index.ts +5 -0
  516. package/src/components/Select/Select.stories.tsx +19 -18
  517. package/src/components/Select/Select.theme.ts +55 -0
  518. package/src/components/Select/Select.tsx +40 -39
  519. package/src/components/Separator/Separator.theme.ts +23 -0
  520. package/src/components/Separator/Separator.tsx +5 -8
  521. package/src/components/Skeleton/Skeleton.stories.tsx +51 -0
  522. package/src/components/Skeleton/Skeleton.theme.ts +22 -0
  523. package/src/components/Skeleton/Skeleton.tsx +26 -0
  524. package/src/components/Skeleton/index.ts +5 -0
  525. package/src/components/Splitter/Splitter.stories.tsx +83 -0
  526. package/src/components/Splitter/Splitter.theme.ts +18 -0
  527. package/src/components/Splitter/Splitter.tsx +122 -0
  528. package/src/components/Splitter/index.ts +5 -0
  529. package/src/components/Status/Status.stories.tsx +28 -23
  530. package/src/components/Status/Status.theme.ts +31 -0
  531. package/src/components/Status/Status.tsx +9 -7
  532. package/src/components/Tag/Tag.stories.tsx +16 -14
  533. package/src/components/Tag/Tag.theme.ts +22 -0
  534. package/src/components/Tag/Tag.tsx +3 -8
  535. package/src/components/Toast/Toast.stories.tsx +52 -30
  536. package/src/components/Toast/Toast.theme.ts +56 -0
  537. package/src/components/Toast/Toast.tsx +103 -54
  538. package/src/components/Toolbar/Toolbar.stories.tsx +14 -14
  539. package/src/components/Toolbar/Toolbar.theme.ts +36 -0
  540. package/src/components/Toolbar/Toolbar.tsx +238 -12
  541. package/src/components/Tooltip/Tooltip.stories.tsx +34 -39
  542. package/src/components/Tooltip/Tooltip.theme.ts +19 -0
  543. package/src/components/Tooltip/Tooltip.tsx +60 -56
  544. package/src/components/Tooltip/index.ts +1 -0
  545. package/src/components/Tooltip/tooltipContent.ts +16 -0
  546. package/src/components/index.ts +18 -10
  547. package/src/exemplars/generics.stories.tsx +40 -0
  548. package/src/exemplars/slot.stories.tsx +116 -0
  549. package/src/exemplars/tabster.stories.tsx +127 -0
  550. package/src/exemplars/virtualizer.stories.tsx +136 -0
  551. package/src/hooks/index.ts +1 -0
  552. package/src/hooks/useDensityContext.ts +4 -4
  553. package/src/hooks/useElevationContext.ts +2 -2
  554. package/src/hooks/useSafeArea.ts +3 -2
  555. package/src/hooks/useThemeContext.ts +1 -1
  556. package/src/hooks/useTranslationsContext.ts +1 -1
  557. package/src/hooks/useVisualViewport.ts +4 -4
  558. package/src/index.ts +3 -1
  559. package/src/playground/Controls.stories.tsx +12 -15
  560. package/src/playground/Custom.stories.tsx +22 -56
  561. package/src/playground/Typography.stories.tsx +11 -9
  562. package/src/primitives/Container/Container.stories.tsx +29 -0
  563. package/src/primitives/Container/Container.tsx +21 -0
  564. package/src/primitives/Container/index.ts +5 -0
  565. package/src/{components → primitives}/DensityProvider/DensityProvider.tsx +2 -2
  566. package/src/{components → primitives}/ElevationProvider/ElevationProvider.tsx +1 -1
  567. package/src/primitives/Flex/Flex.stories.tsx +57 -0
  568. package/src/primitives/Flex/Flex.tsx +29 -0
  569. package/src/primitives/Flex/index.ts +5 -0
  570. package/src/primitives/Grid/Grid.stories.tsx +56 -0
  571. package/src/primitives/Grid/Grid.tsx +32 -0
  572. package/src/primitives/Grid/index.ts +5 -0
  573. package/src/primitives/ThemeProvider/ThemeProvider.stories.tsx +31 -0
  574. package/src/{components → primitives}/ThemeProvider/ThemeProvider.tsx +11 -11
  575. package/src/{components → primitives}/ThemeProvider/TranslationsProvider.tsx +1 -16
  576. package/src/primitives/ThemeProvider/index.ts +8 -0
  577. package/src/primitives/index.ts +11 -0
  578. package/src/testing/Loading.tsx +47 -0
  579. package/src/testing/decorators/index.ts +2 -1
  580. package/src/testing/decorators/withLayout.tsx +67 -0
  581. package/src/testing/decorators/withLayoutVariants.tsx +48 -0
  582. package/src/testing/decorators/withTheme.tsx +45 -0
  583. package/src/testing/index.ts +2 -0
  584. package/src/theme/bindTheme.ts +13 -0
  585. package/src/theme/defaultTheme.ts +83 -0
  586. package/src/theme/index.ts +37 -0
  587. package/src/translations.ts +33 -0
  588. package/src/util/index.ts +5 -2
  589. package/src/util/mobile.ts +11 -0
  590. package/src/util/slots.ts +129 -0
  591. package/src/util/usePx.ts +65 -0
  592. package/dist/lib/browser/chunk-BKNGMGOK.mjs +0 -4373
  593. package/dist/lib/browser/chunk-BKNGMGOK.mjs.map +0 -7
  594. package/dist/lib/node-esm/chunk-D2HZS6F4.mjs +0 -4375
  595. package/dist/lib/node-esm/chunk-D2HZS6F4.mjs.map +0 -7
  596. package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts +0 -15
  597. package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +0 -1
  598. package/dist/types/src/components/AnchoredOverflow/index.d.ts +0 -2
  599. package/dist/types/src/components/AnchoredOverflow/index.d.ts.map +0 -1
  600. package/dist/types/src/components/Buttons/Button.d.ts.map +0 -1
  601. package/dist/types/src/components/Buttons/Button.stories.d.ts +0 -12
  602. package/dist/types/src/components/Buttons/Button.stories.d.ts.map +0 -1
  603. package/dist/types/src/components/Buttons/IconButton.d.ts.map +0 -1
  604. package/dist/types/src/components/Buttons/IconButton.stories.d.ts +0 -22
  605. package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +0 -1
  606. package/dist/types/src/components/Buttons/Toggle.d.ts.map +0 -1
  607. package/dist/types/src/components/Buttons/Toggle.stories.d.ts +0 -19
  608. package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +0 -1
  609. package/dist/types/src/components/Buttons/ToggleGroup.d.ts +0 -28
  610. package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +0 -1
  611. package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +0 -39
  612. package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +0 -1
  613. package/dist/types/src/components/Buttons/index.d.ts.map +0 -1
  614. package/dist/types/src/components/DensityProvider/index.d.ts.map +0 -1
  615. package/dist/types/src/components/Dialogs/AlertDialog.d.ts +0 -31
  616. package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +0 -1
  617. package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +0 -43
  618. package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +0 -1
  619. package/dist/types/src/components/Dialogs/Dialog.d.ts +0 -31
  620. package/dist/types/src/components/Dialogs/Dialog.d.ts.map +0 -1
  621. package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +0 -48
  622. package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +0 -1
  623. package/dist/types/src/components/Dialogs/index.d.ts.map +0 -1
  624. package/dist/types/src/components/ElevationProvider/index.d.ts.map +0 -1
  625. package/dist/types/src/components/Lists/List.d.ts.map +0 -1
  626. package/dist/types/src/components/Lists/List.stories.d.ts +0 -37
  627. package/dist/types/src/components/Lists/List.stories.d.ts.map +0 -1
  628. package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +0 -1
  629. package/dist/types/src/components/Lists/Tree.d.ts.map +0 -1
  630. package/dist/types/src/components/Lists/Tree.stories.d.ts +0 -41
  631. package/dist/types/src/components/Lists/Tree.stories.d.ts.map +0 -1
  632. package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +0 -1
  633. package/dist/types/src/components/Lists/Treegrid.d.ts.map +0 -1
  634. package/dist/types/src/components/Lists/Treegrid.stories.d.ts +0 -10
  635. package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +0 -1
  636. package/dist/types/src/components/Lists/index.d.ts.map +0 -1
  637. package/dist/types/src/components/Menus/ContextMenu.d.ts.map +0 -1
  638. package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +0 -50
  639. package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +0 -1
  640. package/dist/types/src/components/Menus/DropdownMenu.d.ts +0 -112
  641. package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +0 -1
  642. package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +0 -50
  643. package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +0 -1
  644. package/dist/types/src/components/Menus/index.d.ts.map +0 -1
  645. package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +0 -1
  646. package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +0 -136
  647. package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +0 -1
  648. package/dist/types/src/components/ThemeProvider/index.d.ts +0 -3
  649. package/dist/types/src/components/ThemeProvider/index.d.ts.map +0 -1
  650. package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts +0 -12
  651. package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +0 -1
  652. package/dist/types/src/util/ThemedClassName.d.ts +0 -5
  653. package/dist/types/src/util/ThemedClassName.d.ts.map +0 -1
  654. package/dist/types/src/util/hasIosKeyboard.d.ts +0 -2
  655. package/dist/types/src/util/hasIosKeyboard.d.ts.map +0 -1
  656. package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +0 -59
  657. package/src/components/AnchoredOverflow/index.ts +0 -5
  658. package/src/components/Buttons/IconButton.stories.tsx +0 -40
  659. package/src/components/Buttons/Toggle.stories.tsx +0 -34
  660. package/src/components/Buttons/ToggleGroup.tsx +0 -41
  661. package/src/components/Dialogs/AlertDialog.stories.tsx +0 -67
  662. package/src/components/Dialogs/AlertDialog.tsx +0 -172
  663. package/src/components/Dialogs/Dialog.stories.tsx +0 -66
  664. package/src/components/Dialogs/Dialog.tsx +0 -159
  665. package/src/components/Lists/Treegrid.tsx +0 -152
  666. package/src/components/ThemeProvider/index.ts +0 -8
  667. package/src/testing/decorators/withSurfaceVariantsLayout.tsx +0 -51
  668. package/src/testing/decorators/withTheme.ts +0 -25
  669. package/src/util/ThemedClassName.ts +0 -7
  670. package/src/util/hasIosKeyboard.ts +0 -8
  671. /package/dist/types/src/components/{Buttons → Button}/index.d.ts +0 -0
  672. /package/dist/types/src/components/{Dialogs → Dialog}/index.d.ts +0 -0
  673. /package/dist/types/src/components/{Lists → List}/ListDropIndicator.d.ts +0 -0
  674. /package/dist/types/src/components/{Lists → List}/TreeDropIndicator.d.ts +0 -0
  675. /package/dist/types/src/components/{Lists → List}/index.d.ts +0 -0
  676. /package/dist/types/src/components/{Menus → Menu}/index.d.ts +0 -0
  677. /package/dist/types/src/{components → primitives}/DensityProvider/index.d.ts +0 -0
  678. /package/dist/types/src/{components → primitives}/ElevationProvider/index.d.ts +0 -0
  679. /package/src/components/{Buttons → Button}/index.ts +0 -0
  680. /package/src/components/{Dialogs → Dialog}/index.ts +0 -0
  681. /package/src/components/{Lists → List}/index.ts +0 -0
  682. /package/src/components/{Menus → Menu}/index.ts +0 -0
  683. /package/src/{components → primitives}/DensityProvider/index.ts +0 -0
  684. /package/src/{components → primitives}/ElevationProvider/index.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport { type Resource, type TFunction } from 'i18next';\nexport { Trans } from 'react-i18next';\n\nexport * from '@dxos/react-hooks';\nexport type * from '@dxos/react-ui-types';\n\nexport * from './components';\nexport * from './hooks';\nexport * from './util';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASA,aAAa;AAEtB,cAAc;",
6
- "names": ["Trans"]
3
+ "sources": ["../../../src/index.ts", "../../../src/components/Avatars/Avatar.tsx", "../../../src/hooks/useDensityContext.ts", "../../../src/primitives/ThemeProvider/index.ts", "../../../src/util/slots.ts", "../../../src/util/usePx.ts", "../../../src/primitives/Container/Container.tsx", "../../../src/primitives/Flex/Flex.tsx", "../../../src/primitives/Grid/Grid.tsx", "../../../src/hooks/useIconHref.ts", "../../../src/hooks/useSafeCollisionPadding.ts", "../../../src/hooks/useTranslationsContext.ts", "../../../src/hooks/useVisualViewport.ts", "../../../src/components/Breadcrumb/Breadcrumb.tsx", "../../../src/components/Icon/Icon.tsx", "../../../src/components/Icon/IconBlock.tsx", "../../../src/components/Link/Link.tsx", "../../../src/components/Button/Button.tsx", "../../../src/components/Button/IconButton.tsx", "../../../src/components/Button/Toggle.tsx", "../../../src/components/Button/ToggleGroup.tsx", "../../../src/components/Calendar/Calendar.tsx", "../../../src/components/Card/Card.tsx", "../../../src/components/Column/Column.tsx", "../../../src/components/Image/Image.tsx", "../../../src/components/Toolbar/Toolbar.tsx", "../../../src/components/Menu/ContextMenu.tsx", "../../../src/components/Menu/DropdownMenu.tsx", "../../../src/components/Separator/Separator.tsx", "../../../src/components/Carousel/Carousel.tsx", "../../../src/components/MediaPlayer/MediaPlayer.tsx", "../../../src/components/Clipboard/ClipboardProvider.tsx", "../../../src/components/Clipboard/CopyButton.tsx", "../../../src/components/Clipboard/index.ts", "../../../src/components/DatePicker/DatePicker.tsx", "../../../src/components/Popover/Popover.tsx", "../../../src/components/Dialog/Dialog.tsx", "../../../src/components/Dialog/AlertDialog.tsx", "../../../src/components/ErrorFallback/index.ts", "../../../src/components/ErrorFallback/ErrorFallback.tsx", "../../../src/components/ErrorFallback/ThrowError.tsx", "../../../src/components/Focus/Focus.tsx", "../../../src/components/Input/Input.tsx", "../../../src/components/Input/SegmentedInput.tsx", "../../../src/components/List/List.tsx", "../../../src/components/List/ListDropIndicator.tsx", "../../../src/components/List/Tree.tsx", "../../../src/components/List/TreeDropIndicator.tsx", "../../../src/components/List/Treegrid.tsx", "../../../src/components/Main/Main.tsx", "../../../src/components/Main/useSwipeToDismiss.ts", "../../../src/components/Message/Message.tsx", "../../../src/components/Panel/Panel.tsx", "../../../src/components/ScrollArea/ScrollArea.tsx", "../../../src/components/ScrollArea/scrollbar.ts", "../../../src/components/ScrollContainer/ScrollContainer.tsx", "../../../src/components/Select/Select.tsx", "../../../src/components/Skeleton/Skeleton.tsx", "../../../src/components/Splitter/Splitter.tsx", "../../../src/components/Status/Status.tsx", "../../../src/components/Tag/Tag.tsx", "../../../src/components/Toast/Toast.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport { type Resource, type TFunction } from 'i18next';\nexport { Trans } from 'react-i18next';\n\nexport * from '@dxos/react-hooks';\nexport * from '@dxos/ui-types';\n\nexport * from './components';\nexport * from './hooks';\nexport * from './primitives';\nexport * from './theme';\nexport * from './util';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentProps, type ComponentPropsWithRef, type PropsWithChildren, forwardRef } from 'react';\n\nimport '@dxos/lit-ui/dx-avatar.pcss';\nimport {\n type AvatarAnimation,\n type AvatarStatus,\n type AvatarVariant,\n type DxAvatar as NaturalDxAvatar,\n} from '@dxos/lit-ui';\nimport { DxAvatar } from '@dxos/lit-ui/react';\nimport { useId } from '@dxos/react-hooks';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useIconHref, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\nexport type AvatarRootProps = PropsWithChildren<Partial<AvatarContextValue>>;\n\ntype AvatarContextValue = {\n labelId: string;\n descriptionId: string;\n};\n\nconst AVATAR_NAME = 'Avatar';\nconst [AvatarProvider, useAvatarContext] = createContext<AvatarContextValue>(AVATAR_NAME);\n\nconst AvatarRoot = ({ children, labelId: propsLabelId, descriptionId: propsDescriptionId }: AvatarRootProps) => {\n const labelId = useId('avatar__label', propsLabelId);\n const descriptionId = useId('avatar__description', propsDescriptionId);\n return <AvatarProvider {...{ labelId, descriptionId }}>{children}</AvatarProvider>;\n};\n\ntype AvatarContentProps = ThemedClassName<Omit<ComponentProps<typeof DxAvatar>, 'children'>>;\n\nconst AvatarContent = forwardRef<NaturalDxAvatar, AvatarContentProps>(\n ({ icon, classNames, ...props }, forwardedRef) => {\n const href = useIconHref(icon);\n const { labelId, descriptionId } = useAvatarContext('AvatarContent');\n return (\n <DxAvatar\n {...props}\n icon={href}\n aria-labelledby={labelId}\n aria-describedby={descriptionId}\n rootClassName={mx(classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\ntype AvatarLabelProps = ThemedClassName<Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'>> & {\n asChild?: boolean;\n srOnly?: boolean;\n};\n\nconst AvatarLabel = forwardRef<HTMLSpanElement, AvatarLabelProps>(\n ({ asChild, srOnly, classNames, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : Primitive.span;\n const { tx } = useThemeContext();\n const { labelId } = useAvatarContext('AvatarLabel');\n return <Comp {...props} id={labelId} ref={forwardedRef} className={tx('avatar.label', { srOnly }, classNames)} />;\n },\n);\n\ntype AvatarDescriptionProps = ThemedClassName<Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'>> & {\n asChild?: boolean;\n srOnly?: boolean;\n};\n\nconst AvatarDescription = forwardRef<HTMLSpanElement, AvatarDescriptionProps>(\n ({ asChild, srOnly, classNames, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : Primitive.span;\n const { tx } = useThemeContext();\n const { descriptionId } = useAvatarContext('AvatarDescription');\n return (\n <Comp\n {...props}\n id={descriptionId}\n ref={forwardedRef}\n className={tx('avatar.description', { srOnly }, classNames)}\n />\n );\n },\n);\n\nexport const Avatar = {\n Root: AvatarRoot,\n Content: AvatarContent,\n Label: AvatarLabel,\n Description: AvatarDescription,\n};\n\nexport { useAvatarContext };\n\nexport type {\n AvatarStatus,\n AvatarVariant,\n AvatarAnimation,\n AvatarContentProps,\n AvatarLabelProps,\n AvatarDescriptionProps,\n NaturalDxAvatar as DxAvatar,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { type Density } from '@dxos/ui-types';\n\nimport { DensityContext } from '../primitives';\n\nexport const useDensityContext = (densityProp?: Density): Density | undefined => {\n const { density } = useContext(DensityContext);\n return densityProp ?? density;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport { type Label, isLabel, toLocalizedString } from '@dxos/ui-types/translations';\n\nexport * from './ThemeProvider';\nexport { TranslationsContext, useTranslation } from './TranslationsProvider';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport {\n Children,\n createElement,\n forwardRef,\n type ForwardRefExoticComponent,\n type ForwardedRef,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n type RefAttributes,\n type CSSProperties,\n} from 'react';\n\nimport { log } from '@dxos/log';\nimport { mx } from '@dxos/ui-theme';\nimport { type ComposableProps, type SlottableProps, type ThemedClassName } from '@dxos/ui-types';\n\n/**\n * Reconciles className properties from a parent slot.\n * - `className` is set by the Slot merge mechanism.\n * - `classNames` is the consumer-facing prop for theming overrides.\n * Use `composableProps` to reconcile both into a single `className`.\n */\nexport const composableProps = <P extends HTMLElement = HTMLElement>(\n { className, classNames, role, style, ...props }: ComposableProps,\n { classNames: defaultClassNames, ...defaults }: ThemedClassName<Partial<HTMLAttributes<P>>> | undefined = {},\n) => ({\n // Default props.\n ...(defaults as object),\n\n // Spread supplied props.\n ...props,\n\n // Prefer explicit role, then defaults role, then 'none'.\n role: role ?? defaults.role ?? 'none',\n\n // Merge styles.\n style: { ...defaults.style, ...style } as CSSProperties,\n\n // Compose classnames.\n className: mx(defaultClassNames, className, classNames),\n});\n\n/** Symbol used to mark components created by `composable()` or `slottable()`. */\nconst COMPOSABLE = Symbol.for('dxos.composable');\n\n/**\n * Factory for slottable components.\n * The implementation receives full `HTMLAttributes<E>` so it can destructure `role`, `style`, etc.\n * Consumers see only `SlottableProps<P>` — a narrow type exposing `classNames`, `className`,\n * `children`, `asChild`, and the custom props `P`.\n *\n * @example\n * ```tsx\n * const MyPanel = slottable<HTMLDivElement, { border?: boolean }>(\n * ({ children, asChild, border, ...props }, forwardedRef) => {\n * const Comp = asChild ? Slot : Primitive.div;\n * return (\n * <Comp {...composableProps(props, { classNames: border && 'border' })} ref={forwardedRef}>\n * {children}\n * </Comp>\n * );\n * },\n * );\n * ```\n */\nexport function slottable<E extends HTMLElement, P extends object = {}>(\n render: (props: SlottableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => ReactNode,\n): ForwardRefExoticComponent<SlottableProps<P> & RefAttributes<E>> {\n const wrapped = (props: SlottableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => {\n let warn = false;\n if (props.asChild) {\n try {\n const child = Children.only(props.children);\n if (isValidElement(child) && typeof child.type !== 'string' && !(child.type as any)[COMPOSABLE]) {\n warn = true;\n log.warn('slot child is not composable; create it with composable() or slottable()', {\n child: (child.type as any).displayName ?? (child.type as any).name,\n });\n }\n } catch {\n // Children.only throws if not exactly one child — Slot handles this.\n }\n }\n\n const result = render(props, forwardedRef);\n if (warn) {\n return createElement('div', { role: 'none', className: 'dx-slot-warning' }, result);\n }\n\n return result;\n };\n\n const component = forwardRef(wrapped as any) as any;\n (component as any)[COMPOSABLE] = true;\n return component;\n}\n\n/**\n * Factory for composable (leaf) components.\n * The implementation receives full `HTMLAttributes<E>` so it can destructure `role`, `style`, etc.\n * Consumers see only `ComposableProps<P>` — a narrow type exposing `classNames`, `className`,\n * `children`, and the custom props `P`.\n *\n * For generic components, use `any` for the type parameter inside `composable` and\n * cast the result to restore the generic signature for consumers.\n *\n * @example\n * ```tsx\n * const Leaf = composable<HTMLButtonElement>(({ children, ...props }, forwardedRef) => {\n * return (\n * <button {...composableProps(props, { classNames: 'btn' })} ref={forwardedRef}>\n * {children}\n * </button>\n * );\n * });\n * ```\n */\nexport function composable<E extends HTMLElement, P extends object = {}>(\n render: (props: ComposableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => ReactNode,\n): ForwardRefExoticComponent<ComposableProps<P> & RefAttributes<E>> {\n const component = forwardRef(render as any) as any;\n (component as any)[COMPOSABLE] = true;\n return component;\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nconst getDocumentElementFontSize = () => parseFloat(getComputedStyle(document.documentElement).fontSize);\n\n/**\n * React hook that converts rem values to pixels and updates when the root font size changes.\n *\n * @param rem The rem value to convert to pixels\n * @returns The current pixel value equivalent of the rem input\n */\n// TODO(burdon): Change to array.\n// TODO(burdon): Integrate with theme provider.\nexport const usePx = (rem: number): number => {\n const [fontSize, setFontSize] = useState(() => {\n if (typeof document !== 'undefined') {\n return getDocumentElementFontSize();\n }\n\n // Default fallback for SSR\n return 16;\n });\n\n const updateFontSize = useCallback(() => {\n setFontSize(getDocumentElementFontSize());\n }, []);\n\n useEffect(() => {\n if (typeof document === 'undefined') {\n return;\n }\n\n // Create a ResizeObserver to watch for font size changes on the document element\n const resizeObserver = new ResizeObserver(updateFontSize);\n resizeObserver.observe(document.documentElement);\n\n // Also listen for viewport changes that might affect font size\n const mediaQueryList = window.matchMedia('all');\n const handleMediaChange = () => {\n updateFontSize();\n };\n\n if (mediaQueryList.addEventListener) {\n mediaQueryList.addEventListener('change', handleMediaChange);\n } else {\n // Fallback for older browsers\n mediaQueryList.addListener(handleMediaChange);\n }\n\n return () => {\n resizeObserver.disconnect();\n if (mediaQueryList.removeEventListener) {\n mediaQueryList.removeEventListener('change', handleMediaChange);\n } else {\n // Fallback for older browsers\n mediaQueryList.removeListener(handleMediaChange);\n }\n };\n }, []);\n\n return useMemo(() => rem * fontSize, [fontSize]);\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { composableProps, slottable } from '../../util';\n\nexport const Container = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps<HTMLDivElement>(props);\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp {...rest} className={mx('dx-container', className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { composableProps, slottable } from '../../util';\n\nexport type FlexProps = { column?: boolean; grow?: boolean };\n\nexport const Flex = slottable<HTMLDivElement, FlexProps>(\n ({ children, asChild, column, grow, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp\n ref={forwardedRef}\n {...rest}\n className={mx('flex', column && 'flex-col', grow && 'flex-1 overflow-hidden', className)}\n >\n {children}\n </Comp>\n );\n },\n);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { composable, composableProps } from '../../util';\n\nexport type GridProps = { cols?: number; rows?: number; grow?: boolean };\n\nexport const Grid = composable<HTMLDivElement, GridProps>(\n ({ children, style, role, cols, rows, grow = true, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n return (\n <div\n ref={forwardedRef}\n {...rest}\n role={role ?? 'none'}\n className={mx('grid overflow-hidden', grow && 'dx-container', className)}\n style={{\n gridTemplateColumns: cols ? `repeat(${cols}, 1fr)` : undefined,\n gridTemplateRows: rows ? `repeat(${rows}, 1fr)` : undefined,\n ...style,\n }}\n >\n {children}\n </div>\n );\n },\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useThemeContext } from './useThemeContext';\n\nconst ICONS_URL = '/icons.svg';\n\nexport const useIconHref = (icon?: string) => {\n const { noCache } = useThemeContext();\n const url = noCache ? `${ICONS_URL}?nocache=${new Date().getMinutes()}` : ICONS_URL;\n return icon ? `${url}#${icon}` : undefined;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type TooltipContentProps } from '@radix-ui/react-tooltip';\nimport { useMemo } from 'react';\n\nimport { type SafeAreaPadding } from './useSafeArea';\nimport { useThemeContext } from './useThemeContext';\n\ntype PaddingProp = TooltipContentProps['collisionPadding'];\ntype PaddingRecord = Exclude<PaddingProp, number | undefined>;\n\nconst propIsNumber = (prop: PaddingProp): prop is number => Number.isFinite(prop);\nconst propsIsRecord = (prop: PaddingProp): prop is PaddingRecord => !!(prop && typeof prop === 'object');\n\nconst safePadding = (\n propsPadding: TooltipContentProps['collisionPadding'],\n safePadding: SafeAreaPadding,\n side: keyof SafeAreaPadding,\n) => {\n return (\n (propIsNumber(safePadding[side]) ? safePadding[side] : 0) +\n (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? (propsPadding[side] ?? 0) : 0)\n );\n};\n\nexport const useSafeCollisionPadding = (collisionPadding?: PaddingProp) => {\n const { safeAreaPadding } = useThemeContext();\n return useMemo(\n () => ({\n top: safePadding(collisionPadding, safeAreaPadding!, 'top'),\n right: safePadding(collisionPadding, safeAreaPadding!, 'right'),\n bottom: safePadding(collisionPadding, safeAreaPadding!, 'bottom'),\n left: safePadding(collisionPadding, safeAreaPadding!, 'left'),\n }),\n [collisionPadding, safeAreaPadding],\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { TranslationsContext } from '../primitives';\n\nexport const useTranslationsContext = () => useContext(TranslationsContext);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useCallback, useState } from 'react';\n\nimport { useViewportResize } from '@dxos/react-hooks';\n\nexport const useVisualViewport = (deps?: Parameters<typeof useViewportResize>[1]) => {\n const [width, setWidth] = useState<number | null>(null);\n const [height, setHeight] = useState<number | null>(null);\n\n const handleResize = useCallback(() => {\n if (window.visualViewport) {\n setWidth(window.visualViewport.width);\n setHeight(window.visualViewport.height);\n }\n }, []);\n\n useViewportResize(handleResize, deps);\n\n return { width, height };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, type ComponentPropsWithoutRef, forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { Icon } from '../Icon';\nimport { Link, type LinkProps } from '../Link';\n\ntype BreadcrumbRootProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n 'aria-label': string;\n asChild?: boolean;\n};\n\nconst BreadcrumbRoot = forwardRef<HTMLDivElement, BreadcrumbRootProps>(\n ({ asChild, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.div;\n return <Comp role='navigation' {...props} className={tx('breadcrumb.root', {}, classNames)} ref={forwardedRef} />;\n },\n);\n\nBreadcrumbRoot.displayName = 'Breadcrumb.Root';\n\ntype BreadcrumbListProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.ol>> & { asChild?: boolean };\n\nconst BreadcrumbList = forwardRef<HTMLOListElement, BreadcrumbListProps>(\n ({ asChild, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.ol;\n return <Comp role='list' {...props} className={tx('breadcrumb.list', {}, classNames)} ref={forwardedRef} />;\n },\n);\n\nBreadcrumbList.displayName = 'Breadcrumb.List';\n\ntype BreadcrumbListItemProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.li>> & { asChild?: boolean };\n\nconst BreadcrumbListItem = forwardRef<HTMLLIElement, BreadcrumbListItemProps>(\n ({ asChild, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.li;\n return <Comp role='listitem' {...props} className={tx('breadcrumb.listItem', {}, classNames)} ref={forwardedRef} />;\n },\n);\n\nBreadcrumbListItem.displayName = 'Breadcrumb.ListItem';\n\ntype BreadcrumbLinkProps = LinkProps;\n\nconst BreadcrumbLink = forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(({ asChild, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : Link;\n return <Comp {...props} ref={forwardedRef} />;\n});\n\nBreadcrumbLink.displayName = 'Breadcrumb.Link';\n\ntype BreadcrumbCurrentProps = ThemedClassName<ComponentPropsWithRef<'h1'>> & { asChild?: boolean };\n\nconst BreadcrumbCurrent = forwardRef<HTMLHeadingElement, BreadcrumbCurrentProps>(\n ({ asChild, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : 'h1';\n return (\n <Comp {...props} aria-current='page' className={tx('breadcrumb.current', {}, classNames)} ref={forwardedRef} />\n );\n },\n);\n\nBreadcrumbCurrent.displayName = 'Breadcrumb.Current';\n\ntype BreadcrumbSeparatorProps = ThemedClassName<ComponentPropsWithoutRef<typeof Primitive.span>>;\n\nfunction BreadcrumbSeparator({ children, classNames, ...props }: BreadcrumbSeparatorProps) {\n const { tx } = useThemeContext();\n return (\n <Primitive.span\n role='separator'\n aria-hidden='true'\n {...props}\n className={tx('breadcrumb.separator', {}, classNames)}\n >\n {children ?? <Icon icon='ph--dot--bold' />}\n </Primitive.span>\n );\n}\n\nBreadcrumbSeparator.displayName = 'Breadcrumb.Separator';\n\nexport const Breadcrumb = {\n Root: BreadcrumbRoot,\n List: BreadcrumbList,\n ListItem: BreadcrumbListItem,\n Link: BreadcrumbLink,\n Current: BreadcrumbCurrent,\n Separator: BreadcrumbSeparator,\n};\n\nexport type {\n BreadcrumbRootProps,\n BreadcrumbListProps,\n BreadcrumbListItemProps,\n BreadcrumbLinkProps,\n BreadcrumbCurrentProps,\n BreadcrumbSeparatorProps,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Primitive } from '@radix-ui/react-primitive';\nimport React, { type ComponentPropsWithRef, forwardRef, memo, useMemo } from 'react';\n\nimport { type Size } from '@dxos/ui-types';\n\nimport { useIconHref, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\nexport type IconProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.svg>> & {\n icon: string;\n size?: Size;\n synchronized?: boolean;\n};\n\n/**\n * The Icon's size can be set directly or inherited from the `--dx-icon-size` CSS variable.\n */\nexport const Icon = memo(\n forwardRef<SVGSVGElement, IconProps>(({ classNames, icon, size, synchronized, style, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const spinDelay = useMemo(() => (synchronized ? `${-(Date.now() % 1_000)}ms` : undefined), [synchronized]);\n const href = useIconHref(icon);\n\n return (\n <svg\n {...props}\n style={{ ...style, animationDelay: spinDelay }}\n className={tx('icon.root', { size }, classNames)}\n ref={forwardedRef}\n >\n <use href={href} />\n </svg>\n );\n }),\n);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type ComponentPropsWithRef, type PropsWithChildren, forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { IconBlockStyleProps } from './Icon.theme';\n\nexport type IconBlockProps = ThemedClassName<ComponentPropsWithRef<'div'> & PropsWithChildren<IconBlockStyleProps>>;\n\n/**\n * Static layout slot sized to `--dx-rail-item` (the same square that an `IconButton iconOnly`\n * occupies). Use whenever a decorative `<Icon>` needs to share a row, column, or grid track with\n * interactive `IconButton`s without drifting by a pixel.\n *\n * Defaults `aria-hidden='true'` — the slot wraps decorative chrome by default. Pass\n * `aria-hidden={false}` when the slot's contents convey meaning that isn't already labelled\n * elsewhere in the row.\n */\nexport const IconBlock = forwardRef<HTMLDivElement, IconBlockProps>(\n ({ classNames, children, compact, square, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <div\n aria-hidden='true'\n {...props}\n className={tx('icon.block', { compact, square }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\nIconBlock.displayName = 'IconBlock';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\nexport type LinkProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.a>> &\n Partial<{\n asChild: boolean;\n variant: 'accent' | 'neutral';\n }>;\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n ({ classNames, asChild, variant, target = '_blank', rel = 'noreferrer', ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.a;\n return (\n <Comp\n {...props}\n target={target}\n rel={rel}\n className={tx('link.root', { variant }, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, forwardRef, memo } from 'react';\n\nimport { type Density, type Elevation } from '@dxos/ui-types';\n\nimport { useDensityContext, useElevationContext, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\ntype ButtonProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.button>> & {\n variant?: 'default' | 'primary' | 'outline' | 'ghost' | 'destructive' | 'valence';\n density?: Density;\n elevation?: Elevation;\n asChild?: boolean;\n};\n\ntype ButtonGroupContextValue = { inGroup?: boolean };\n\nconst BUTTON_GROUP_NAME = 'ButtonGroup';\nconst BUTTON_NAME = 'Button';\n\nconst [ButtonGroupProvider, useButtonGroupContext] = createContext<ButtonGroupContextValue>(BUTTON_GROUP_NAME, {\n inGroup: false,\n});\n\nconst Button = memo(\n forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { classNames, children, density: densityProp, elevation: elevationProp, variant = 'default', asChild, ...props },\n ref,\n ) => {\n const { inGroup } = useButtonGroupContext(BUTTON_NAME);\n const { tx } = useThemeContext();\n const elevation = useElevationContext(elevationProp);\n const density = useDensityContext(densityProp);\n const Comp = asChild ? Slot : Primitive.button;\n return (\n <Comp\n ref={ref}\n {...props}\n data-variant={variant}\n data-density={density}\n data-props={inGroup ? 'grouped' : ''}\n className={tx(\n 'button.root',\n {\n variant,\n inGroup,\n disabled: props.disabled,\n density,\n elevation,\n },\n classNames,\n )}\n {...(props.disabled && { disabled: true })}\n >\n {children}\n </Comp>\n );\n },\n ),\n);\n\nButton.displayName = BUTTON_NAME;\n\ntype ButtonGroupProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n elevation?: Elevation;\n asChild?: boolean;\n};\n\nconst ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(\n ({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const elevation = useElevationContext(propsElevation);\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp {...props} className={tx('button.group', { elevation }, classNames)} ref={forwardedRef}>\n <ButtonGroupProvider inGroup>{children}</ButtonGroupProvider>\n </Comp>\n );\n },\n);\n\nButtonGroup.displayName = BUTTON_GROUP_NAME;\n\nexport { Button, ButtonGroup, BUTTON_GROUP_NAME, useButtonGroupContext };\n\nexport type { ButtonProps, ButtonGroupProps };\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { Icon, type IconProps } from '../Icon';\nimport { Tooltip, type TooltipSide } from '../Tooltip';\nimport { Button, type ButtonProps } from './Button';\n\ntype IconButtonProps = Omit<ButtonProps, 'children'> &\n Partial<Pick<IconProps, 'icon' | 'size'>> & {\n label: string;\n noTooltip?: boolean;\n caretDown?: boolean;\n iconOnly?: boolean;\n square?: boolean; // TODO(burdon): Handle more uniformly.\n iconEnd?: boolean;\n iconClassNames?: ThemedClassName<any>['classNames'];\n tooltipSide?: TooltipSide;\n };\n\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>((props, forwardedRef) =>\n props.iconOnly ? (\n <IconOnlyButton {...props} ref={forwardedRef} />\n ) : (\n <LabelledIconButton {...props} ref={forwardedRef} />\n ),\n);\n\nconst IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ noTooltip, tooltipSide, ...props }, forwardedRef) => {\n if (noTooltip) {\n return <LabelledIconButton {...props} ref={forwardedRef} />;\n }\n\n return (\n <Tooltip.Trigger asChild content={props.label} side={tooltipSide}>\n <LabelledIconButton {...props} ref={forwardedRef} />\n </Tooltip.Trigger>\n );\n },\n);\n\nconst LabelledIconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n { size, icon, iconOnly, square, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props },\n forwardedRef,\n ) => {\n const { tx } = useThemeContext();\n return (\n <Button {...props} classNames={tx('iconButton.root', { iconOnly, square }, classNames)} ref={forwardedRef}>\n {icon && !iconEnd && <Icon icon={icon} size={size} classNames={iconClassNames} />}\n <span className={iconOnly ? 'sr-only' : undefined}>{label}</span>\n {icon && iconEnd && <Icon icon={icon} size={size} classNames={iconClassNames} />}\n {caretDown && <Icon size={3} icon='ph--caret-down--bold' />}\n </Button>\n );\n },\n);\n\nexport { IconButton };\n\nexport type { IconButtonProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport React, { forwardRef } from 'react';\n\nimport { Button, type ButtonProps } from './Button';\n\ntype ToggleProps = Omit<TogglePrimitive.ToggleProps, 'asChild'> & ButtonProps;\n\nconst Toggle = forwardRef<HTMLButtonElement, ToggleProps>(\n ({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {\n return (\n <TogglePrimitive.Root {...{ defaultPressed, pressed, onPressedChange }} asChild>\n <Button {...props} ref={forwardedRef} />\n </TogglePrimitive.Root>\n );\n },\n);\n\nexport { Toggle };\nexport type { ToggleProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport React, { forwardRef } from 'react';\n\nimport { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps } from './Button';\nimport { IconButton, type IconButtonProps } from './IconButton';\n\ntype ToggleGroupProps =\n | Omit<ToggleGroupPrimitive.ToggleGroupSingleProps, 'className'>\n | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps, 'className'>;\n\nconst ToggleGroup = forwardRef<HTMLDivElement, ToggleGroupProps & ButtonGroupProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n return (\n <ToggleGroupPrimitive.Root {...props} asChild>\n <ButtonGroup {...{ classNames, children }} ref={forwardedRef} />\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\ntype ToggleGroupItemProps = Omit<ToggleGroupPrimitive.ToggleGroupItemProps, 'className'> & ButtonProps;\n\nconst ToggleGroupItem = forwardRef<HTMLButtonElement, ToggleGroupItemProps>(\n ({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {\n return (\n <ToggleGroupPrimitive.Item {...props} asChild>\n <Button {...{ variant, elevation, density, classNames, children }} ref={forwardedRef} />\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\ntype ToggleGroupIconItemProps = Omit<ToggleGroupPrimitive.ToggleGroupItemProps, 'className'> & IconButtonProps;\n\nconst ToggleGroupIconItem = forwardRef<HTMLButtonElement, ToggleGroupIconItemProps>(\n ({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {\n return (\n <ToggleGroupPrimitive.Item {...props} asChild>\n <IconButton {...{ variant, elevation, density, classNames, label, icon, size }} ref={forwardedRef} />\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nexport { ToggleGroup, ToggleGroupItem, ToggleGroupIconItem };\nexport type { ToggleGroupProps, ToggleGroupItemProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { CalendarDate, parseDate } from '@internationalized/date';\nimport React, { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport {\n Button as RACButton,\n Calendar as RACCalendar,\n CalendarCell as RACCalendarCell,\n type CalendarProps as RACCalendarProps,\n CalendarGrid as RACCalendarGrid,\n CalendarGridBody as RACCalendarGridBody,\n CalendarGridHeader as RACCalendarGridHeader,\n CalendarHeaderCell as RACCalendarHeaderCell,\n Heading as RACHeading,\n RangeCalendar as RACRangeCalendar,\n type RangeCalendarProps as RACRangeCalendarProps,\n type DateValue,\n} from 'react-aria-components';\n\nimport { type ClassNameValue } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { Icon } from '../Icon';\n\n//\n// Date <-> CalendarDate conversion.\n// External API stays `Date` (and `{from,to}`-style range objects) so existing call sites keep working.\n//\n\nconst toCalendarDate = (date: Date | undefined): CalendarDate | null => {\n if (!date) {\n return null;\n }\n return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());\n};\n\nconst fromCalendarDate = (value: DateValue | null | undefined): Date | undefined => {\n if (!value) {\n return undefined;\n }\n return new Date(value.year, value.month - 1, value.day);\n};\n\nexport type DateRange = { from: Date; to?: Date };\n\n//\n// Public API.\n//\n\ntype BaseCalendarProps = {\n classNames?: ClassNameValue;\n className?: string;\n isDisabled?: boolean;\n minValue?: Date;\n maxValue?: Date;\n /** Month to render when there's no selection — driven by the consuming picker. */\n defaultMonth?: Date;\n};\n\ntype SingleProps = BaseCalendarProps & {\n mode?: 'single';\n selected?: Date;\n onSelect?: (date: Date | undefined) => void;\n};\n\ntype RangeProps = BaseCalendarProps & {\n mode: 'range';\n selected?: DateRange;\n onSelect?: (range: DateRange | undefined) => void;\n};\n\nexport type CalendarRootProps = SingleProps | RangeProps;\n\nconst CalendarShell = ({\n classNames,\n className,\n isDisabled,\n forwardedRef,\n children,\n}: {\n classNames?: ClassNameValue;\n className?: string;\n isDisabled?: boolean;\n forwardedRef?: React.Ref<HTMLDivElement>;\n children: ReactNode;\n}) => {\n const { tx } = useThemeContext();\n return (\n <div\n ref={forwardedRef}\n className={tx('calendar.root', {}, classNames, className) ?? undefined}\n aria-disabled={isDisabled || undefined}\n >\n {children}\n </div>\n );\n};\n\nconst CalendarChrome = () => {\n const { tx } = useThemeContext();\n return (\n <header className={tx('calendar.nav', {}) ?? undefined}>\n <RACButton slot='previous' className={tx('calendar.button_previous', {}) ?? undefined}>\n <Icon size={4} icon='ph--caret-left--regular' />\n </RACButton>\n <RACHeading className={tx('calendar.caption_label', {}) ?? undefined} />\n <RACButton slot='next' className={tx('calendar.button_next', {}) ?? undefined}>\n <Icon size={4} icon='ph--caret-right--regular' />\n </RACButton>\n </header>\n );\n};\n\nconst CalendarGridContent = () => {\n const { tx } = useThemeContext();\n return (\n <RACCalendarGrid className={tx('calendar.month_grid', {}) ?? undefined}>\n <RACCalendarGridHeader className={tx('calendar.weekdays', {}) ?? undefined}>\n {(day) => (\n <RACCalendarHeaderCell className={tx('calendar.weekday', {}) ?? undefined}>{day}</RACCalendarHeaderCell>\n )}\n </RACCalendarGridHeader>\n <RACCalendarGridBody>\n {(date) => <RACCalendarCell date={date} className={tx('calendar.day', {}) ?? undefined} />}\n </RACCalendarGridBody>\n </RACCalendarGrid>\n );\n};\n\nconst CalendarRoot = forwardRef<HTMLDivElement, CalendarRootProps>((props, forwardedRef) => {\n const { classNames, className, isDisabled, minValue, maxValue, defaultMonth } = props;\n const defaultFocused = toCalendarDate(defaultMonth) ?? undefined;\n\n if (props.mode === 'range') {\n const racProps: RACRangeCalendarProps<CalendarDate> = {\n isDisabled,\n minValue: toCalendarDate(minValue) ?? undefined,\n maxValue: toCalendarDate(maxValue) ?? undefined,\n defaultFocusedValue: defaultFocused,\n value: props.selected?.from\n ? {\n start: toCalendarDate(props.selected.from)!,\n end: toCalendarDate(props.selected.to ?? props.selected.from)!,\n }\n : undefined,\n onChange: (next) => {\n if (!next) {\n props.onSelect?.(undefined);\n return;\n }\n const from = fromCalendarDate(next.start);\n const to = fromCalendarDate(next.end);\n if (from) {\n props.onSelect?.({ from, to });\n }\n },\n };\n return (\n <CalendarShell classNames={classNames} className={className} isDisabled={isDisabled} forwardedRef={forwardedRef}>\n <RACRangeCalendar {...racProps}>\n <CalendarChrome />\n <CalendarGridContent />\n </RACRangeCalendar>\n </CalendarShell>\n );\n }\n\n const racProps: RACCalendarProps<CalendarDate> = {\n isDisabled,\n minValue: toCalendarDate(minValue) ?? undefined,\n maxValue: toCalendarDate(maxValue) ?? undefined,\n defaultFocusedValue: defaultFocused,\n value: toCalendarDate(props.selected),\n onChange: (next) => props.onSelect?.(fromCalendarDate(next)),\n };\n return (\n <CalendarShell classNames={classNames} className={className} isDisabled={isDisabled} forwardedRef={forwardedRef}>\n <RACCalendar {...racProps}>\n <CalendarChrome />\n <CalendarGridContent />\n </RACCalendar>\n </CalendarShell>\n );\n});\n\nCalendarRoot.displayName = 'Calendar.Root';\n\nexport const Calendar = {\n Root: CalendarRoot,\n};\n\n// Re-export the iso parser for convenience.\nexport { parseDate as parseCalendarDate };\nexport type { ComponentPropsWithoutRef };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport DOMPurify from 'dompurify';\nimport React, { CSSProperties, JSX, MouseEventHandler, type ReactNode, forwardRef, useId, useMemo } from 'react';\n\nimport { iconSize } from '@dxos/ui-theme';\nimport { type Density } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { composable, composableProps, slottable } from '../../util';\nimport { type ThemedClassName } from '../../util';\nimport { Button } from '../Button';\nimport { Column } from '../Column';\nimport { Icon, IconBlock, type IconBlockProps, type IconProps } from '../Icon';\nimport { Image, type ImageProps } from '../Image';\nimport {\n Toolbar,\n type ToolbarActionIconButtonProps,\n ToolbarDragHandleProps,\n type ToolbarMenuProps,\n type ToolbarRootProps,\n} from '../Toolbar';\n\n//\n// Root\n//\n\nconst CARD_ROOT_NAME = 'Card.Root';\n\ntype CardRootProps = {\n id?: string;\n border?: boolean;\n fullWidth?: boolean;\n density?: Density;\n style?: CSSProperties;\n tabIndex?: number;\n onClick?: MouseEventHandler<HTMLDivElement>;\n 'data-selected'?: boolean;\n 'data-testid'?: string;\n};\n\n/**\n * `Card.Root` does not support `asChild`. The Column grid is the root element\n * (one `<div>` carrying both the `dx-card` and `dx-column-root` classes\n * instead of the previous outer-card + inner-column pair), so caller-provided\n * HTML attributes — `onClick`, `tabIndex`, `style`, `data-*`, `grid-template-rows`\n * overrides via `classNames` — land directly on the grid container.\n * Slot-parents (`Focus.Item asChild`, `Mosaic.Tile asChild`, etc.) continue to\n * work because `composable()` preserves the COMPOSABLE marker that slottable parents\n * check before warning, and Radix `Slot` merges the parent's props onto the inner\n * `<div>` exactly the way `slottable`'s `Slot`/`Primitive.div` branch did.\n */\nconst CardRoot = composable<HTMLDivElement, CardRootProps>(\n ({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const { tx } = useThemeContext();\n\n return (\n <Column.Root\n asChild\n gutter={density === 'lg' ? 'lg' : density === 'sm' || density === 'xs' ? 'sm' : 'md'}\n classNames={tx('card.root', { border, fullWidth }, className)}\n role={role ?? 'group'}\n >\n <div {...rest} {...(id && { 'data-object-id': id })} ref={forwardedRef}>\n {children}\n </div>\n </Column.Root>\n );\n },\n);\n\nCardRoot.displayName = CARD_ROOT_NAME;\n\n//\n// Header\n//\n\nconst CARD_HEADER_NAME = 'Card.Header';\n\ntype CardHeaderProps = ToolbarRootProps;\n\n/**\n * Top \"header\" slot of a Card. Despite the name, this renders as an ARIA\n * toolbar (`role=\"toolbar\"`) so its action children get keyboard navigation\n * for free — `<header>` is allowed to contain a toolbar.\n */\nconst CardHeader = composable<HTMLDivElement, CardHeaderProps>(({ children, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n\n return (\n <Toolbar.Root {...props} style={iconSize(5)} classNames={[tx('card.header', {}), classNames]} ref={forwardedRef}>\n {children}\n </Toolbar.Root>\n );\n});\n\nCardHeader.displayName = CARD_HEADER_NAME;\n\n//\n// DragHandle\n//\n\nconst CARD_DRAG_HANDLE_NAME = 'Card.DragHandle';\n\ntype CardDragHandleProps = ToolbarDragHandleProps;\n\nconst CardDragHandle = forwardRef<HTMLButtonElement, CardDragHandleProps>((props, forwardedRef) => {\n return (\n <CardIconBlock>\n <Toolbar.DragHandle {...props} ref={forwardedRef} />\n </CardIconBlock>\n );\n});\n\nCardDragHandle.displayName = CARD_DRAG_HANDLE_NAME;\n\n//\n// ActionIconButton\n//\n\nconst CARD_ACTION_ICON_BUTTON_NAME = 'Card.ActionIconButton';\n\ntype CardActionIconButtonProps = ToolbarActionIconButtonProps;\n\nconst CardActionIconButton = forwardRef<HTMLButtonElement, CardActionIconButtonProps>((props, forwardedRef) => {\n return (\n <CardIconBlock>\n <Toolbar.ActionIconButton {...props} ref={forwardedRef} />\n </CardIconBlock>\n );\n});\n\nCardActionIconButton.displayName = CARD_ACTION_ICON_BUTTON_NAME;\n\n//\n// Menu\n//\n\nconst CARD_MENU_NAME = 'Card.Menu';\n\ntype CardMenuProps<T extends any | void = void> = ToolbarMenuProps<T>;\n\nfunction CardMenu<T extends any | void = void>({ context, items, ...props }: CardMenuProps<T>) {\n return (\n <CardIconBlock>\n <Toolbar.Menu {...props} context={context} items={items ?? []} />\n </CardIconBlock>\n );\n}\n\nCardMenu.displayName = CARD_MENU_NAME;\n\n//\n// Icon\n//\n\nconst CARD_ICON_NAME = 'Card.Icon';\n\nfunction CardIcon(props: IconProps) {\n return (\n <CardIconBlock>\n <Icon {...props} />\n </CardIconBlock>\n );\n}\n\nCardIcon.displayName = CARD_ICON_NAME;\n\n//\n// IconBlock\n//\n\nconst CARD_ICON_BLOCK_NAME = 'Card.IconBlock';\n\nconst CardIconBlock = forwardRef<HTMLDivElement, IconBlockProps>((props, forwardedRef) => {\n return <IconBlock {...props} ref={forwardedRef} />;\n});\n\nCardIconBlock.displayName = CARD_ICON_BLOCK_NAME;\n\n//\n// Title\n//\n\nconst CARD_TITLE_NAME = 'Card.Title';\n\nconst CardTitle = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { className, ...rest } = composableProps(props, { role: 'heading' });\n const Comp = asChild ? Slot : Primitive.div;\n\n return (\n <Comp {...rest} className={tx('card.title', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nCardTitle.displayName = CARD_TITLE_NAME;\n\n//\n// Body\n//\n\nconst CARD_BODY_NAME = 'Card.Body';\n\nconst CardBody = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n\n return (\n <Comp {...rest} className={tx('card.body', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nCardBody.displayName = CARD_BODY_NAME;\n\n//\n// Section\n//\n\nconst CARD_SECTION_NAME = 'Card.Section';\n\ntype CardSectionProps = { title?: ReactNode };\n\n/**\n * A labeled grouping of card content. `display: contents` keeps children aligned\n * to the Card's column grid (like `Card.Body`); when `title` is provided,\n * renders a subheading row at the top and exposes the group with\n * `role='group' aria-labelledby=…` for screen readers.\n */\nconst CardSection = slottable<HTMLDivElement, CardSectionProps>(\n ({ children, asChild, title, role, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n const titleId = useId();\n\n return (\n <Comp\n {...rest}\n role={role ?? (title ? 'group' : 'none')}\n aria-labelledby={title ? titleId : undefined}\n className={tx('card.section', {}, className)}\n ref={forwardedRef}\n >\n {title && (\n <div id={titleId} className={tx('card.section-title', {})}>\n {title}\n </div>\n )}\n {children}\n </Comp>\n );\n },\n);\n\nCardSection.displayName = CARD_SECTION_NAME;\n\n//\n// Row\n//\n\nconst CARD_ROW_NAME = 'Card.Row';\n\ntype CardRowProps = { icon?: string | JSX.Element; fullWidth?: boolean };\n\n/**\n * A row inside a Card.\n * - Default: spans all 3 columns and establishes a subgrid so children align to the Card's columns.\n * An optional `icon` lands in the first column; when omitted, the first column is left empty.\n * - `fullWidth`: spans all columns without a subgrid — children do their own internal layout.\n * The `icon` prop is ignored in this mode.\n */\nconst CardRow = slottable<HTMLDivElement, CardRowProps>(\n ({ children, asChild, icon: iconProp, fullWidth, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const icon =\n typeof iconProp === 'string' ? (\n <CardIcon classNames='text-subdued' icon={iconProp as string} size={4} />\n ) : iconProp ? (\n iconProp\n ) : (\n <div />\n );\n\n return (\n <Comp {...rest} className={tx('card.row', { fullWidth }, className)} ref={forwardedRef}>\n {!fullWidth && icon}\n {children}\n </Comp>\n );\n },\n);\n\nCardRow.displayName = CARD_ROW_NAME;\n\n//\n// Text\n//\n\nconst CARD_TEXT_NAME = 'Card.Text';\n\n// `onClick` is opted in explicitly: `ComposableProps` deliberately excludes event handlers, but the\n// part spreads rest props onto its element, so the handler is forwarded at runtime.\ntype CardTextProps = {\n truncate?: boolean;\n variant?: 'default' | 'description';\n onClick?: MouseEventHandler<HTMLDivElement>;\n};\n\nconst CardText = slottable<HTMLDivElement, CardTextProps>(\n ({ children, asChild, role, truncate, variant = 'default', ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n\n return (\n <Comp {...rest} role={role ?? 'none'} className={tx('card.text', { variant }, className)} ref={forwardedRef}>\n <span className={tx('card.text-span', { variant, truncate })}>{children}</span>\n </Comp>\n );\n },\n);\n\nCardText.displayName = CARD_TEXT_NAME;\n\n//\n// Html\n//\n\nconst CARD_HTML_NAME = 'Card.Html';\n\ntype CardHtmlProps = { html?: string; variant?: 'default' | 'description' };\n\n/**\n * Renders sanitized HTML content inside a card text slot.\n * Uses DOMPurify to prevent XSS from untrusted markup (e.g. RSS feed content).\n */\nfunction CardHtml({ html = '', variant = 'default', ...props }: CardHtmlProps & ThemedClassName<object>) {\n const { tx } = useThemeContext();\n const sanitized = useMemo(() => DOMPurify.sanitize(html), [html]);\n\n return (\n <div\n {...props}\n className={tx('card.text', { variant })}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: sanitized }}\n />\n );\n}\n\nCardHtml.displayName = CARD_HTML_NAME;\n\n//\n// Poster\n//\n\nconst CARD_POSTER_NAME = 'Card.Poster';\n\ntype CardPosterProps = ThemedClassName<\n {\n alt: string;\n aspect?: 'video' | 'auto';\n } & Partial<{ image: string; icon: string }> &\n // The image-rendering props (`fit`, `crossOrigin`, color-extraction options) are forwarded to\n // the underlying `Image`. `src`/`alt`/`classNames` are owned by the poster.\n Omit<ImageProps, 'src' | 'alt' | 'classNames'>\n>;\n\nfunction CardPoster({ classNames, alt, aspect: aspectProp, image, icon, ...imageProps }: CardPosterProps) {\n const { tx } = useThemeContext();\n const aspect = aspectProp === 'auto' ? 'aspect-auto' : 'aspect-video';\n\n if (image) {\n return (\n <div className='col-span-full'>\n <Image classNames={[tx('card.poster', {}), aspect, classNames]} src={image} alt={alt} {...imageProps} />\n </div>\n );\n }\n\n if (icon) {\n return (\n <div role='image' className={tx('card.poster-icon', {}, [aspect, classNames])} aria-label={alt}>\n <Icon icon={icon} size={10} />\n </div>\n );\n }\n}\n\nCardPoster.displayName = CARD_POSTER_NAME;\n\n//\n// Action\n//\n\nconst CARD_ACTION_NAME = 'Card.Action';\n\ntype CardActionProps = { icon?: string; label: string; actionIcon?: string; onClick?: () => void };\n\nfunction CardAction({ icon, actionIcon = 'ph--arrow-right--regular', label, onClick }: CardActionProps) {\n const { tx } = useThemeContext();\n return (\n <Button variant='ghost' classNames={tx('card.action', {})} onClick={onClick}>\n {icon ? <CardIcon classNames='text-subdued' icon={icon} size={4} /> : <div />}\n <span className={tx('card.action-label', {}, !actionIcon ? 'col-span-2' : undefined)}>{label}</span>\n {actionIcon && <CardIcon icon={actionIcon} size={4} />}\n </Button>\n );\n}\n\nCardAction.displayName = CARD_ACTION_NAME;\n\n//\n// Link\n//\n\nconst CARD_LINK_NAME = 'Card.Link';\n\ntype CardLinkProps = { label: string; href: string };\n\nfunction CardLink({ label, href }: CardLinkProps) {\n const { tx } = useThemeContext();\n return (\n <a className={tx('card.link', {})} data-variant='ghost' href={href} target='_blank' rel='noreferrer'>\n <CardIcon classNames='text-subdued' icon='ph--link--regular' />\n <span className={tx('card.link-label', {})}>{label}</span>\n <CardIcon classNames='invisible group-hover:visible' icon='ph--arrow-square-out--regular' />\n </a>\n );\n}\n\nCardLink.displayName = CARD_LINK_NAME;\n\n//\n// Card\n//\n\nexport const Card = {\n Root: CardRoot,\n\n // Header\n Header: CardHeader,\n\n // Header parts\n IconBlock: CardIconBlock,\n DragHandle: CardDragHandle,\n ActionIconButton: CardActionIconButton,\n Menu: CardMenu,\n Icon: CardIcon,\n Title: CardTitle,\n\n // Body\n Body: CardBody,\n Section: CardSection,\n Row: CardRow,\n\n // Body parts\n Text: CardText,\n Html: CardHtml,\n Poster: CardPoster,\n Action: CardAction,\n Link: CardLink,\n};\n\nexport type {\n CardRootProps,\n CardHeaderProps,\n CardDragHandleProps,\n CardActionIconButtonProps,\n CardMenuProps,\n CardSectionProps,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type CSSProperties } from 'react';\n\nimport { type SlottableProps } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { composableProps, slottable } from '../../util';\n\n//\n// Root\n//\n\nconst COLUMN_ROOT_NAME = 'Column.Root';\n\ntype GutterSize = 'xs' | 'sm' | 'md' | 'lg';\n\nconst gutterSizes: Record<GutterSize, string> = {\n xs: 'var(--dx-gutter-xs)',\n sm: 'var(--dx-gutter-sm)',\n md: 'var(--dx-gutter-md)',\n lg: 'var(--dx-gutter-lg)',\n};\n\ntype ColumnRootProps = { gutter?: GutterSize };\n\n/**\n * Creates a 3-column CSS grid with left/right gutter columns and a center content column.\n * Sets `--gutter` and `--dx-col` CSS variables for nested components.\n *\n * `--dx-col` defaults to `2 / span 1` (center column),\n * enabling `withColumn` utilities to cascade the correct grid placement to slotted children.\n *\n * Direct children participate in the grid in one of several ways:\n * - **Column.Center** — places element in the center column (col 2). Preferred for plain content.\n * - **Column.Bleed** — spans all 3 columns gutter-to-gutter. Preferred for `ScrollArea` and\n * other content that should ignore the gutters.\n * - **Column.Row** — 3-col subgrid row (icons in gutters, content in center).\n *\n * Use `withColumn.center()` / `withColumn.bleed()` helpers to apply placement on slotted elements.\n *\n * Gutter sizes: `'sm'` for compact layouts (Dialog); `'md'` (default); `'lg'` for wider spacing.\n */\nconst ColumnRoot = slottable<HTMLDivElement, ColumnRootProps>(\n ({ children, asChild, role, gutter = 'md', ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n const gutterSize = gutterSizes[gutter];\n return (\n <Comp\n {...rest}\n role={role ?? 'none'}\n style={\n {\n ...rest.style,\n '--gutter': gutterSize,\n '--dx-col': '2 / span 1',\n gridTemplateColumns: [gutterSize, 'minmax(0,1fr)', gutterSize].join(' '),\n } as CSSProperties\n }\n className={tx('column.root', { gutter }, className)}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\nColumnRoot.displayName = COLUMN_ROOT_NAME;\n\n//\n// Row\n//\n\nconst COLUMN_ROW_NAME = 'Column.Row';\n\ntype ColumnRowProps = {};\n\n/**\n * Spans all 3 columns of the parent Column.Root and uses CSS subgrid to inherit their sizing.\n * Children map to: [col-1: icon/slot] [col-2: content] [col-3: icon/action].\n * Must be a direct child of Column.Root.\n */\nconst ColumnRow = slottable<HTMLDivElement, ColumnRowProps>(({ children, asChild, role, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} role={role ?? 'none'} className={tx('column.row', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nColumnRow.displayName = COLUMN_ROW_NAME;\n\n//\n// Bleed\n//\n\nconst COLUMN_BLEED_NAME = 'Column.Bleed';\n\ntype ColumnBleedProps = SlottableProps;\n\n/**\n * Spans all 3 columns of the parent Column.Root (gutter-to-gutter).\n * Establishes a CSS subgrid so that grandchildren can participate in the parent column tracks.\n * Use for `ScrollArea`, full-width dividers, tables, or any content that should ignore the gutters.\n */\nconst ColumnBleed = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp {...rest} className={tx('column.bleed', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nColumnBleed.displayName = COLUMN_BLEED_NAME;\n\n//\n// Center\n//\n\nconst COLUMN_CENTER_NAME = 'Column.Center';\n\ntype ColumnCenterProps = SlottableProps;\n\n/**\n * Places its element in column 2 (the center track between gutters) of the parent Column.Root.\n * Does NOT use subgrid — placement is explicit on this element only, so it is safe to nest\n * arbitrary compound components (including ones that render `display: contents` wrappers).\n */\nconst ColumnCenter = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp {...rest} className={tx('column.center', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nColumnCenter.displayName = COLUMN_CENTER_NAME;\n\n//\n// Column\n//\n\nexport const Column = {\n Root: ColumnRoot,\n Row: ColumnRow,\n Bleed: ColumnBleed,\n Center: ColumnCenter,\n};\n\nexport type { ColumnRootProps, ColumnRowProps, ColumnBleedProps, ColumnCenterProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type SyntheticEvent, useCallback, useRef, useState } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nconst cache = new Map<string, string>();\n\nexport type ImageProps = ThemedClassName<\n {\n src: string;\n alt?: string;\n fit?: 'contain' | 'cover';\n /**\n * Image CORS mode (sets the `<img crossorigin>` attribute). Omitted by default: cross-origin\n * images load without a CORS request (no console errors), but the dominant-color sampler can't\n * read their pixels off the canvas (the browser taints it). Opt in with `'anonymous'` when the\n * image host sends CORS headers and you want the dominant-color gradient.\n */\n crossOrigin?: 'anonymous' | 'use-credentials' | '';\n } & ColorOptions\n>;\n\nexport const Image = ({\n classNames,\n src,\n alt = '',\n fit = 'contain',\n crossOrigin,\n sampleSize = 64,\n contrast = 0.9,\n}: ImageProps) => {\n const [crossOriginState, setCrossOriginState] = useState<ImageProps['crossOrigin']>(crossOrigin);\n const [dominantColor, setDominantColor] = useState<string | undefined>(undefined);\n const [imageLoaded, setImageLoaded] = useState<boolean>(false);\n const canvasRef = useRef<HTMLCanvasElement>(null);\n\n // CORS not supported by server.\n const handleImageError = (): void => {\n setCrossOriginState(undefined);\n };\n\n const handleImageLoad = useCallback(\n ({ target }: SyntheticEvent<HTMLImageElement>): void => {\n const rgb = cache.get(src);\n if (rgb) {\n setDominantColor(rgb);\n setImageLoaded(true);\n return;\n }\n\n const img = target as HTMLImageElement;\n if (!canvasRef.current) {\n return;\n }\n\n try {\n const color = extractDominantColor(canvasRef.current, img, { sampleSize, contrast });\n if (color) {\n const rgb = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;\n cache.set(src, rgb);\n setDominantColor(rgb);\n }\n } catch {\n setCrossOriginState(undefined);\n }\n\n setImageLoaded(true);\n },\n [sampleSize, contrast, src],\n );\n\n return (\n <div\n // `isolate` (`isolation: isolate`) creates a new stacking context so\n // the inner <img>'s `z-10` stays scoped to this wrapper. Without it\n // the z-10 leaks into the parent's stacking context and elevates the\n // image above any pseudo-element rings (e.g. Focus.Item's\n // `dx-ring-pseudo` `::after`) painted on ancestors — most visibly,\n // the focus ring on a Card containing a Card.Poster.\n className={mx(\n `relative flex w-full justify-center overflow-hidden transition-all duration-700 isolate`,\n classNames,\n )}\n style={{\n backgroundColor: dominantColor,\n }}\n >\n {/* Hidden canvas for color extraction. */}\n <canvas ref={canvasRef} style={{ display: 'none' }} aria-hidden='true' />\n\n {/* Background gradient overlay for smooth transition. */}\n <div\n className='absolute inset-0 pointer-events-none'\n style={{\n background: dominantColor\n ? `radial-gradient(circle at center, transparent 30%, ${dominantColor} 100%)`\n : undefined,\n transition: 'opacity 0.7s ease-in-out',\n opacity: 0.5,\n }}\n />\n\n <img\n src={src}\n alt={alt}\n crossOrigin={crossOriginState}\n onError={handleImageError}\n onLoad={handleImageLoad}\n className={mx(\n 'z-10 transition-opacity duration-500',\n fit === 'cover' ? 'w-full h-full object-cover' : 'object-contain',\n )}\n style={{\n opacity: imageLoaded ? 1 : 0,\n }}\n />\n </div>\n );\n};\n\ntype ColorOptions = {\n sampleSize?: number;\n contrast?: number;\n};\n\n/**\n * Get dominant color from image (esp. from corners).\n */\nconst extractDominantColor = (\n canvas: HTMLCanvasElement,\n img: HTMLImageElement,\n { sampleSize = 64, contrast = 0.95 }: ColorOptions,\n): [number, number, number] | null => {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return null;\n }\n\n // Draw the image scaled down.\n canvas.width = sampleSize;\n canvas.height = sampleSize;\n ctx.drawImage(img, 0, 0, sampleSize, sampleSize);\n\n // Get image data.\n const imageData = ctx.getImageData(0, 0, sampleSize, sampleSize);\n const pixels = imageData.data;\n\n // Check for transparent background.\n if (isTransparent(pixels, sampleSize)) {\n return null;\n }\n\n let r = 0;\n let g = 0;\n let b = 0;\n let totalWeight = 0;\n\n // Define corner sampling areas (e.g., 25% of each dimension from each corner).\n const cornerSize = Math.floor(sampleSize * 0.125);\n\n // Sample only pixels in corner areas.\n for (let y = 0; y < sampleSize; y++) {\n for (let x = 0; x < sampleSize; x++) {\n // Check if pixel is in any corner area.\n const isInTopLeft = x < cornerSize && y < cornerSize;\n const isInTopRight = x >= sampleSize - cornerSize && y < cornerSize;\n const isInBottomLeft = x < cornerSize && y >= sampleSize - cornerSize;\n const isInBottomRight = x >= sampleSize - cornerSize && y >= sampleSize - cornerSize;\n if (!isInTopLeft && !isInTopRight && !isInBottomLeft && !isInBottomRight) {\n continue; // Skip pixels not in corner areas.\n }\n\n const i = (y * sampleSize + x) * 4;\n const red = pixels[i];\n const green = pixels[i + 1];\n const blue = pixels[i + 2];\n const alpha = pixels[i + 3];\n\n // Skip transparent pixels.\n if (alpha === 0) {\n continue;\n }\n\n // Calculate saturation to weight vibrant colors more.\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const saturation = max === 0 ? 0 : (max - min) / max;\n const weight = 1 + saturation * 2;\n\n r += red * weight;\n g += green * weight;\n b += blue * weight;\n totalWeight += weight;\n }\n }\n\n if (totalWeight > 0) {\n // Slightly darken the color for better contrast.\n r = Math.round(Math.round(r / totalWeight) * contrast);\n g = Math.round(Math.round(g / totalWeight) * contrast);\n b = Math.round(Math.round(b / totalWeight) * contrast);\n return [r, g, b];\n }\n\n return null;\n};\n\n/**\n * Detects if an image has a transparent background by examining edge pixels.\n * @param pixels - Image pixel data from canvas\n * @param sampleSize - Size of the sampled image\n * @param threshold - Percentage threshold for considering background transparent (default: 0.5)\n * @returns True if the image has a transparent background\n */\nconst isTransparent = (pixels: Uint8ClampedArray, sampleSize: number, threshold: number = 0.5): boolean => {\n let edgeTransparentPixels = 0;\n const edgePixels = sampleSize * 4 - 4; // Perimeter minus corners counted twice.\n\n for (let x = 0; x < sampleSize; x++) {\n // Top edge.\n const topIndex = x * 4;\n if (pixels[topIndex + 3] === 0) {\n edgeTransparentPixels++;\n }\n\n // Bottom edge.\n const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;\n if (pixels[bottomIndex + 3] === 0) {\n edgeTransparentPixels++;\n }\n }\n\n for (let y = 1; y < sampleSize - 1; y++) {\n // Left edge.\n const leftIndex = y * sampleSize * 4;\n if (pixels[leftIndex + 3] === 0) {\n edgeTransparentPixels++;\n }\n\n // Right edge.\n const rightIndex = (y * sampleSize + sampleSize - 1) * 4;\n if (pixels[rightIndex + 3] === 0) {\n edgeTransparentPixels++;\n }\n }\n\n return edgeTransparentPixels / edgePixels > threshold;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ToggleGroupItemProps as ToggleGroupItemPrimitiveProps } from '@radix-ui/react-toggle-group';\nimport * as ToolbarPrimitive from '@radix-ui/react-toolbar';\nimport React, { type MouseEventHandler, forwardRef } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { type SlottableProps } from '@dxos/ui-types';\n\nimport { translationKey } from '#translations';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ToolbarStyleProps } from '../../theme';\nimport { composable, composableProps, slottable } from '../../util';\nimport {\n Button,\n ButtonGroup,\n type ButtonGroupProps,\n type ButtonProps,\n IconButton,\n type IconButtonProps,\n Toggle,\n type ToggleGroupItemProps,\n type ToggleProps,\n} from '../Button';\nimport { Link, type LinkProps } from '../Link';\nimport { DropdownMenu } from '../Menu';\nimport { Separator, type SeparatorProps } from '../Separator';\n\n//\n// Root\n//\n\ntype ToolbarRootProps = ToolbarPrimitive.ToolbarProps & ToolbarStyleProps;\n\nconst ToolbarRoot = composable<HTMLDivElement, ToolbarRootProps>(\n ({ children, density, disabled, layoutManaged, orientation, ...props }, forwardedRef) => {\n const { className, role, ...rest } = composableProps(props);\n const { tx } = useThemeContext();\n\n return (\n <ToolbarPrimitive.Root\n {...rest}\n // Only pass role when explicitly set; radix provides role=\"toolbar\" by default.\n {...(role !== 'none' && { role })}\n orientation={orientation}\n data-arrow-keys={orientation === 'vertical' ? 'up down' : 'left right'}\n className={tx('toolbar.root', { density, disabled, layoutManaged }, className)}\n ref={forwardedRef}\n >\n {children}\n </ToolbarPrimitive.Root>\n );\n },\n);\n\nToolbarRoot.displayName = 'Toolbar.Root';\n\n//\n// Text\n//\n\ntype ToolbarTextProps = SlottableProps;\n\nconst ToolbarText = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} className={tx('toolbar.text', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nToolbarText.displayName = 'Toolbar.Text';\n\n//\n// Button\n//\n\ntype ToolbarButtonProps = ButtonProps;\n\nconst ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n return (\n <ToolbarPrimitive.Button asChild>\n <Button {...props} ref={forwardedRef} />\n </ToolbarPrimitive.Button>\n );\n});\n\nToolbarButton.displayName = 'Toolbar.Button';\n\n//\n// IconButton\n//\n\ntype ToolbarIconButtonProps = IconButtonProps;\n\nconst ToolbarIconButton = forwardRef<HTMLButtonElement, ToolbarIconButtonProps>((props, forwardedRef) => {\n return (\n <ToolbarPrimitive.Button asChild>\n <IconButton {...props} ref={forwardedRef} />\n </ToolbarPrimitive.Button>\n );\n});\n\nToolbarIconButton.displayName = 'Toolbar.IconButton';\n\ntype ToolbarToggleProps = ToggleProps;\n\nconst ToolbarToggle = forwardRef<HTMLButtonElement, ToolbarToggleProps>((props, forwardedRef) => {\n return (\n <ToolbarPrimitive.Button asChild>\n <Toggle {...props} ref={forwardedRef} />\n </ToolbarPrimitive.Button>\n );\n});\n\nToolbarToggle.displayName = 'Toolbar.Toggle';\n\n//\n// Link\n//\n\ntype ToolbarLinkProps = LinkProps;\n\nconst ToolbarLink = forwardRef<HTMLAnchorElement, ToolbarLinkProps>((props, forwardedRef) => {\n return (\n <ToolbarPrimitive.Link asChild>\n <Link {...props} ref={forwardedRef} />\n </ToolbarPrimitive.Link>\n );\n});\n\nToolbarLink.displayName = 'Toolbar.Link';\n\ntype ToolbarToggleGroupProps = (\n | Omit<ToolbarPrimitive.ToolbarToggleGroupSingleProps, 'className'>\n | Omit<ToolbarPrimitive.ToolbarToggleGroupMultipleProps, 'className'>\n) &\n ButtonGroupProps;\n\n//\n// ToggleGroup\n//\n\nconst ToolbarToggleGroup = forwardRef<HTMLDivElement, ToolbarToggleGroupProps>(\n ({ classNames, children, elevation, ...props }, forwardedRef) => {\n return (\n <ToolbarPrimitive.ToolbarToggleGroup {...props} asChild>\n <ButtonGroup {...{ classNames, children, elevation }} ref={forwardedRef} />\n </ToolbarPrimitive.ToolbarToggleGroup>\n );\n },\n);\n\nToolbarToggleGroup.displayName = 'Toolbar.ToggleGroup';\n\ntype ToolbarToggleGroupItemProps = ToggleGroupItemProps;\n\nconst ToolbarToggleGroupItem = forwardRef<HTMLButtonElement, ToolbarToggleGroupItemProps>(\n ({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {\n return (\n <ToolbarPrimitive.ToolbarToggleItem {...props} asChild>\n <Button {...{ variant, density, elevation, classNames, children }} ref={forwardedRef} />\n </ToolbarPrimitive.ToolbarToggleItem>\n );\n },\n);\n\nToolbarToggleGroupItem.displayName = 'Toolbar.ToggleGroupItem';\n\ntype ToolbarToggleGroupIconItemProps = Omit<ToggleGroupItemPrimitiveProps, 'className'> & IconButtonProps;\n\nconst ToolbarToggleGroupIconItem = forwardRef<HTMLButtonElement, ToolbarToggleGroupIconItemProps>(\n ({ variant, density, elevation, classNames, icon, label, iconOnly, iconClassNames, ...props }, forwardedRef) => {\n return (\n <ToolbarPrimitive.ToolbarToggleItem {...props} asChild>\n <IconButton\n {...{\n variant,\n density,\n elevation,\n classNames,\n icon,\n label,\n iconOnly,\n iconClassNames,\n }}\n ref={forwardedRef}\n />\n </ToolbarPrimitive.ToolbarToggleItem>\n );\n },\n);\n\nToolbarToggleGroupIconItem.displayName = 'Toolbar.ToggleGroupIconItem';\n\n//\n// Separator\n//\n\ntype ToolbarSeparatorProps = SeparatorProps & { variant?: 'gap' | 'line' };\n\nconst ToolbarSeparator = forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ variant = 'gap', ...props }, forwardedRef) => {\n return variant === 'line' ? (\n <ToolbarPrimitive.Separator asChild>\n <Separator orientation='vertical' {...props} ref={forwardedRef} />\n </ToolbarPrimitive.Separator>\n ) : (\n <ToolbarPrimitive.Separator className='grow' ref={forwardedRef} />\n );\n },\n);\n\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n//\n// DragHandle\n//\n\ntype ToolbarDragHandleProps = { testId?: string; label?: string };\n\nconst ToolbarDragHandle = forwardRef<HTMLButtonElement, ToolbarDragHandleProps>(\n ({ testId = 'drag-handle', label }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n return (\n <ToolbarIconButton\n data-testid={testId}\n tabIndex={-1}\n noTooltip\n iconOnly\n icon='ph--dots-six-vertical--regular'\n variant='ghost'\n label={label ?? t('toolbar-drag-handle.label')}\n classNames='dx-focus-ring-none cursor-pointer'\n disabled={!forwardedRef}\n ref={forwardedRef}\n />\n );\n },\n);\n\nToolbarDragHandle.displayName = 'Toolbar.DragHandle';\n\n//\n// ActionIconButton\n//\n\n/**\n * Known semantic actions a toolbar icon-button can represent. Each action\n * picks its own phosphor icon + default translation key so call sites just\n * declare intent (`action='delete'`) rather than re-specifying the icon /\n * label every time.\n */\ntype ToolbarActionIconButtonAction = 'close' | 'delete';\n\ntype ToolbarActionIconButtonProps = {\n action: ToolbarActionIconButtonAction;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n label?: string;\n};\n\nconst TOOLBAR_ACTION_ICONS: Record<ToolbarActionIconButtonAction, string> = {\n close: 'ph--x--regular',\n delete: 'ph--trash--regular',\n};\n\nconst TOOLBAR_ACTION_LABEL_KEYS: Record<ToolbarActionIconButtonAction, string> = {\n close: 'toolbar-close.label',\n delete: 'toolbar-delete.label',\n};\n\nconst ToolbarActionIconButton = forwardRef<HTMLButtonElement, ToolbarActionIconButtonProps>(\n ({ action, onClick, label }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n\n return (\n <ToolbarIconButton\n iconOnly\n icon={TOOLBAR_ACTION_ICONS[action]}\n variant='ghost'\n label={label ?? t(TOOLBAR_ACTION_LABEL_KEYS[action])}\n classNames='cursor-pointer'\n onClick={onClick}\n ref={forwardedRef}\n />\n );\n },\n);\n\nToolbarActionIconButton.displayName = 'Toolbar.ActionIconButton';\n\n//\n// Menu\n//\n\ntype ToolbarMenuItem<T extends any | void = void> = {\n label: string;\n onClick: (context: T) => void;\n};\n\ntype ToolbarMenuProps<T extends any | void = void> = {\n context?: T;\n items?: ToolbarMenuItem<T>[];\n};\n\n// TODO(burdon): Make slottable.\nfunction ToolbarMenu<T extends any | void = void>({ context, items }: ToolbarMenuProps<T>) {\n const { t } = useTranslation(translationKey);\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger disabled={!items?.length} asChild>\n <ToolbarIconButton\n iconOnly\n variant='ghost'\n icon='ph--dots-three-vertical--regular'\n label={t('toolbar-menu.label')}\n />\n </DropdownMenu.Trigger>\n {(items?.length ?? 0) > 0 && (\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {items?.map(({ label, onClick: onSelect }, index) => (\n <DropdownMenu.Item key={index} onSelect={() => onSelect(context as T)}>\n {label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n )}\n </DropdownMenu.Root>\n );\n}\n\nToolbarMenu.displayName = 'Toolbar.Menu';\n\n//\n// Toolbar\n//\n\nexport const Toolbar = {\n Root: ToolbarRoot,\n Text: ToolbarText,\n Button: ToolbarButton,\n IconButton: ToolbarIconButton,\n Link: ToolbarLink,\n Toggle: ToolbarToggle,\n ToggleGroup: ToolbarToggleGroup,\n ToggleGroupItem: ToolbarToggleGroupItem,\n ToggleGroupIconItem: ToolbarToggleGroupIconItem,\n Separator: ToolbarSeparator,\n DragHandle: ToolbarDragHandle,\n ActionIconButton: ToolbarActionIconButton,\n Menu: ToolbarMenu,\n};\n\nexport type {\n ToolbarRootProps,\n ToolbarTextProps,\n ToolbarButtonProps,\n ToolbarIconButtonProps,\n ToolbarLinkProps,\n ToolbarToggleProps,\n ToolbarToggleGroupProps,\n ToolbarToggleGroupItemProps,\n ToolbarToggleGroupIconItemProps,\n ToolbarSeparatorProps,\n ToolbarDragHandleProps,\n ToolbarActionIconButtonAction,\n ToolbarActionIconButtonProps,\n ToolbarMenuItem,\n ToolbarMenuProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { useElevationContext, useThemeContext } from '../../hooks';\nimport { useSafeCollisionPadding } from '../../hooks/useSafeCollisionPadding';\nimport { type ThemedClassName } from '../../util';\n\ntype ContextMenuRootProps = ContextMenuPrimitive.ContextMenuProps;\n\nconst ContextMenuRoot = ContextMenuPrimitive.ContextMenu;\n\ntype ContextMenuTriggerProps = ContextMenuPrimitive.ContextMenuTriggerProps;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\ntype ContextMenuPortalProps = ContextMenuPrimitive.ContextMenuPortalProps;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\ntype ContextMenuContentProps = ThemedClassName<ContextMenuPrimitive.ContextMenuContentProps> & {\n constrainBlockSize?: boolean;\n};\n\nconst ContextMenuContent = forwardRef<HTMLDivElement, ContextMenuContentProps>(\n ({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const elevation = useElevationContext();\n const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);\n return (\n <ContextMenuPrimitive.Content\n {...props}\n data-arrow-keys='up down'\n collisionPadding={safeCollisionPadding}\n className={tx('menu.content', { elevation }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </ContextMenuPrimitive.Content>\n );\n },\n);\n\ntype ContextMenuViewportProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n asChild?: boolean;\n};\n\nconst ContextMenuViewport = forwardRef<HTMLDivElement, ContextMenuViewportProps>(\n ({ classNames, asChild, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp {...props} className={tx('menu.viewport', {}, classNames)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n },\n);\n\ntype ContextMenuArrowProps = ThemedClassName<ContextMenuPrimitive.ContextMenuArrowProps>;\n\nconst ContextMenuArrow = forwardRef<SVGSVGElement, ContextMenuArrowProps>(({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return <ContextMenuPrimitive.Arrow {...props} className={tx('menu.arrow', {}, classNames)} ref={forwardedRef} />;\n});\n\ntype ContextMenuGroupProps = ContextMenuPrimitive.ContextMenuGroupProps;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\ntype ContextMenuItemIndicatorProps = ContextMenuPrimitive.ContextMenuItemIndicatorProps;\n\nconst ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;\n\ntype ContextMenuItemProps = ThemedClassName<ContextMenuPrimitive.ContextMenuItemProps>;\n\nconst ContextMenuItem = forwardRef<HTMLDivElement, ContextMenuItemProps>(\n ({ classNames, ...props }: ContextMenuItemProps, forwardedRef) => {\n const { tx } = useThemeContext();\n return <ContextMenuPrimitive.Item {...props} className={tx('menu.item', {}, classNames)} ref={forwardedRef} />;\n },\n);\n\ntype ContextMenuCheckboxItemProps = ThemedClassName<ContextMenuPrimitive.ContextMenuCheckboxItemProps>;\n\nconst ContextMenuCheckboxItem = forwardRef<HTMLDivElement, ContextMenuCheckboxItemProps>(\n ({ classNames, ...props }: ContextMenuItemProps, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <ContextMenuPrimitive.CheckboxItem {...props} className={tx('menu.item', {}, classNames)} ref={forwardedRef} />\n );\n },\n);\n\ntype ContextMenuSeparatorProps = ThemedClassName<ContextMenuPrimitive.ContextMenuSeparatorProps>;\n\nconst ContextMenuSeparator = forwardRef<HTMLDivElement, ContextMenuSeparatorProps>(\n ({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <ContextMenuPrimitive.Separator {...props} className={tx('menu.separator', {}, classNames)} ref={forwardedRef} />\n );\n },\n);\n\ntype ContextMenuGroupLabelProps = ThemedClassName<ContextMenuPrimitive.ContextMenuLabelProps>;\n\nconst ContextMenuGroupLabel = forwardRef<HTMLDivElement, ContextMenuGroupLabelProps>(\n ({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <ContextMenuPrimitive.Label {...props} className={tx('menu.groupLabel', {}, classNames)} ref={forwardedRef} />\n );\n },\n);\n\nexport const ContextMenu = {\n Root: ContextMenuRoot,\n Trigger: ContextMenuTrigger,\n Portal: ContextMenuPortal,\n Content: ContextMenuContent,\n Viewport: ContextMenuViewport,\n Arrow: ContextMenuArrow,\n Group: ContextMenuGroup,\n Item: ContextMenuItem,\n CheckboxItem: ContextMenuCheckboxItem,\n ItemIndicator: ContextMenuItemIndicator,\n Separator: ContextMenuSeparator,\n GroupLabel: ContextMenuGroupLabel,\n};\n\nexport type {\n ContextMenuRootProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuViewportProps,\n ContextMenuArrowProps,\n ContextMenuGroupProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuGroupLabelProps,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// This is based upon `@radix-ui/react-dropdown-menu` fetched 25 Oct 2024 at https://github.com/radix-ui/primitives at commit 06de2d4.\n\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport type { Scope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentPropsWithRef,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type FC,\n PropsWithChildren,\n type ReactNode,\n type RefObject,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { useElevationContext, useThemeContext } from '../../hooks';\nimport { useSafeCollisionPadding } from '../../hooks/useSafeCollisionPadding';\nimport { type ThemedClassName } from '../../util';\n\ntype Direction = 'ltr' | 'rtl';\n\n//\n// DropdownMenu\n//\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]);\nconst useMenuScope: (scope?: Scope) => any = createMenuScope();\n\ntype DropdownMenuContextValue = {\n triggerId: string;\n triggerRef: RefObject<HTMLButtonElement | null>;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] =\n createDropdownMenuContext<DropdownMenuContextValue>(DROPDOWN_MENU_NAME);\n\ntype DropdownMenuRootProps = PropsWithChildren<{\n dir?: Direction;\n modal?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}>;\n\nconst DropdownMenuRoot = ({\n __scopeDropdownMenu,\n children,\n dir,\n modal = true,\n open: openProp,\n defaultOpen,\n onOpenChange,\n}: ScopedProps<DropdownMenuRootProps>) => {\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n triggerId={useId()}\n triggerRef={triggerRef}\n contentId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n <MenuPrimitive.Root {...menuScope} dir={dir} modal={modal} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Root>\n </DropdownMenuProvider>\n );\n};\n\nDropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;\n\n//\n// DropdownMenuTrigger\n//\n\nconst TRIGGER_NAME = 'DropdownMenu.Trigger';\n\ntype DropdownMenuTriggerElement = ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;\ntype DropdownMenuTriggerProps = PrimitiveButtonProps;\n\nconst DropdownMenuTrigger = forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n (props: ScopedProps<DropdownMenuTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return (\n <MenuPrimitive.Anchor asChild {...menuScope}>\n <Primitive.button\n type='button'\n id={context.triggerId}\n aria-haspopup='menu'\n aria-expanded={context.open}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...triggerProps}\n ref={composeRefs(forwardedRef, context.triggerRef)}\n data-arrow-keys='down'\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) {\n event.preventDefault();\n }\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) {\n return;\n }\n if (['Enter', ' '].includes(event.key)) {\n context.onOpenToggle();\n }\n if (event.key === 'ArrowDown') {\n context.onOpenChange(true);\n }\n // prevent keydown from scrolling window / first focused item to execute\n // that keydown (inadvertently closing the menu)\n if (['Enter', ' ', 'ArrowDown'].includes(event.key)) {\n event.preventDefault();\n }\n })}\n />\n </MenuPrimitive.Anchor>\n );\n },\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n//\n// DropdownMenuVirtualTrigger\n//\n\nconst VIRTUAL_TRIGGER_NAME = 'DropdownMenu.VirtualTrigger';\n\ntype DropdownMenuVirtualTriggerProps = {\n virtualRef: RefObject<DropdownMenuTriggerElement | null>;\n};\n\nconst DropdownMenuVirtualTrigger = (props: ScopedProps<DropdownMenuVirtualTriggerProps>) => {\n const { __scopeDropdownMenu, virtualRef } = props;\n const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n useEffect(() => {\n if (virtualRef.current) {\n context.triggerRef.current = virtualRef.current;\n }\n });\n return <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef as RefObject<DropdownMenuTriggerElement>} />;\n};\n\nDropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;\n\n//\n// DropdownMenuPortal\n//\n\nconst PORTAL_NAME = 'DropdownMenu.Portal';\n\ntype MenuPortalProps = ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ntype DropdownMenuPortalProps = MenuPortalProps;\n\nconst DropdownMenuPortal: FC<DropdownMenuPortalProps> = (props: ScopedProps<DropdownMenuPortalProps>) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\nDropdownMenuPortal.displayName = PORTAL_NAME;\n\n//\n// DropdownMenuViewport\n//\n\ntype DropdownMenuViewportProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n asChild?: boolean;\n};\n\nconst DropdownMenuViewport = forwardRef<HTMLDivElement, DropdownMenuViewportProps>(\n ({ classNames, asChild, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp {...props} className={tx('menu.viewport', {}, classNames)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n },\n);\n\n//\n// DropdownMenuContent\n//\n\nconst CONTENT_NAME = 'DropdownMenu.Content';\n\ntype DropdownMenuContentElement = ComponentRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = ThemedClassName<ComponentPropsWithoutRef<typeof MenuPrimitive.Content>>;\ntype DropdownMenuContentProps = Omit<MenuContentProps, 'onEntryFocus'>;\n\nconst DropdownMenuContent = forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;\n const { tx } = useThemeContext();\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const elevation = useElevationContext();\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = useRef(false);\n const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);\n\n // Check for the closest annotated collision boundary in the DOM tree.\n const computedCollisionBoundary = useMemo(() => {\n const closestBoundary = context.triggerRef.current?.closest(\n '[data-popover-collision-boundary]',\n ) as HTMLElement | null;\n return closestBoundary\n ? Array.isArray(collisionBoundary)\n ? [closestBoundary, ...collisionBoundary]\n : collisionBoundary\n ? [closestBoundary, collisionBoundary]\n : [closestBoundary]\n : collisionBoundary;\n }, [context.open, collisionBoundary, context.triggerRef.current]);\n\n return (\n <MenuPrimitive.Content\n id={context.contentId}\n aria-labelledby={context.triggerId}\n {...menuScope}\n {...contentProps}\n collisionBoundary={computedCollisionBoundary}\n collisionPadding={safeCollisionPadding}\n ref={forwardedRef}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) {\n context.triggerRef.current?.focus();\n }\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) {\n hasInteractedOutsideRef.current = true;\n }\n })}\n data-arrow-keys='up down'\n className={tx('menu.content', { elevation }, classNames)}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n//\n// DropdownMenuGroup\n//\n\nconst GROUP_NAME = 'DropdownMenu.Group';\n\ntype DropdownMenuGroupElement = ComponentRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ntype DropdownMenuGroupProps = MenuGroupProps;\n\nconst DropdownMenuGroup = forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n (props: ScopedProps<DropdownMenuGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n },\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n//\n// DropdownMenuLabel\n//\n\nconst LABEL_NAME = 'DropdownMenu.Label';\n\ntype DropdownMenuLabelElement = ComponentRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = ThemedClassName<ComponentPropsWithoutRef<typeof MenuPrimitive.Label>>;\ntype DropdownMenuLabelProps = MenuLabelProps;\n\nconst DropdownMenuGroupLabel = forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n (props: ScopedProps<DropdownMenuLabelProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const { tx } = useThemeContext();\n return (\n <MenuPrimitive.Label\n {...menuScope}\n {...labelProps}\n className={tx('menu.groupLabel', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDropdownMenuGroupLabel.displayName = LABEL_NAME;\n\n//\n// DropdownMenuItem\n//\n\nconst ITEM_NAME = 'DropdownMenu.Item';\n\ntype DropdownMenuItemElement = ComponentRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = ThemedClassName<ComponentPropsWithoutRef<typeof MenuPrimitive.Item>>;\ntype DropdownMenuItemProps = MenuItemProps;\n\nconst DropdownMenuItem = forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props: ScopedProps<DropdownMenuItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const { tx } = useThemeContext();\n return (\n <MenuPrimitive.Item\n {...menuScope}\n {...itemProps}\n className={tx('menu.item', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n//\n// DropdownMenuCheckboxItem\n//\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenu.CheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = ComponentRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = ThemedClassName<ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>>;\ntype DropdownMenuCheckboxItemProps = MenuCheckboxItemProps;\n\nconst DropdownMenuCheckboxItem = forwardRef<DropdownMenuCheckboxItemElement, DropdownMenuCheckboxItemProps>(\n (props: ScopedProps<DropdownMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const { tx } = useThemeContext();\n return (\n <MenuPrimitive.CheckboxItem\n {...menuScope}\n {...checkboxItemProps}\n className={tx('menu.item', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n//\n// DropdownMenuRadioGroup\n//\n\nconst RADIO_GROUP_NAME = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioGroupElement = ComponentRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ntype DropdownMenuRadioGroupProps = MenuRadioGroupProps;\n\nconst DropdownMenuRadioGroup = forwardRef<DropdownMenuRadioGroupElement, DropdownMenuRadioGroupProps>(\n (props: ScopedProps<DropdownMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n },\n);\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n//\n// DropdownMenuRadioItem\n//\n\nconst RADIO_ITEM_NAME = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuRadioItemElement = ComponentRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemProps = ThemedClassName<MenuRadioItemProps>;\n\nconst DropdownMenuRadioItem = forwardRef<DropdownMenuRadioItemElement, DropdownMenuRadioItemProps>(\n (props: ScopedProps<DropdownMenuRadioItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const { tx } = useThemeContext();\n return (\n <MenuPrimitive.Item\n {...menuScope}\n {...itemProps}\n className={tx('menu.item', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n//\n// DropdownMenuItemIndicator\n//\n\nconst INDICATOR_NAME = 'DropdownMenu.ItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = ComponentRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ntype DropdownMenuItemIndicatorProps = MenuItemIndicatorProps;\n\nconst DropdownMenuItemIndicator = forwardRef<DropdownMenuItemIndicatorElement, DropdownMenuItemIndicatorProps>(\n (props: ScopedProps<DropdownMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n },\n);\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n//\n// DropdownMenuSeparator\n//\n\nconst SEPARATOR_NAME = 'DropdownMenu.Separator';\n\ntype DropdownMenuSeparatorElement = ComponentRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = ThemedClassName<ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>>;\ntype DropdownMenuSeparatorProps = MenuSeparatorProps;\n\nconst DropdownMenuSeparator = forwardRef<DropdownMenuSeparatorElement, DropdownMenuSeparatorProps>(\n (props: ScopedProps<DropdownMenuSeparatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const { tx } = useThemeContext();\n return (\n <MenuPrimitive.Separator\n {...menuScope}\n {...separatorProps}\n className={tx('menu.separator', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n//\n// DropdownMenuArrow\n//\n\nconst ARROW_NAME = 'DropdownMenu.Arrow';\n\ntype DropdownMenuArrowElement = ComponentRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = ThemedClassName<ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>>;\ntype DropdownMenuArrowProps = MenuArrowProps;\n\nconst DropdownMenuArrow = forwardRef<DropdownMenuArrowElement, DropdownMenuArrowProps>(\n (props: ScopedProps<DropdownMenuArrowProps>, forwardedRef) => {\n const { __scopeDropdownMenu, classNames, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const { tx } = useThemeContext();\n return (\n <MenuPrimitive.Arrow\n {...menuScope}\n {...arrowProps}\n className={tx('menu.arrow', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n//\n// DropdownMenuSub\n//\n\ntype DropdownMenuSubProps = {\n children?: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n};\n\nconst DropdownMenuSub: FC<DropdownMenuSubProps> = (props: ScopedProps<DropdownMenuSubProps>) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\n//\n// DropdownMenuSubTrigger\n//\n\nconst SUB_TRIGGER_NAME = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSubTriggerElement = ComponentRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ntype DropdownMenuSubTriggerProps = MenuSubTriggerProps;\n\nconst DropdownMenuSubTrigger = forwardRef<DropdownMenuSubTriggerElement, DropdownMenuSubTriggerProps>(\n (props: ScopedProps<DropdownMenuSubTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...subTriggerProps} ref={forwardedRef} />;\n },\n);\n\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n//\n// DropdownMenuSubContent\n//\n\nconst SUB_CONTENT_NAME = 'DropdownMenu.SubContent';\n\ntype DropdownMenuSubContentElement = ComponentRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ntype DropdownMenuSubContentProps = MenuSubContentProps;\n\nconst DropdownMenuSubContent = forwardRef<DropdownMenuSubContentElement, DropdownMenuSubContentProps>(\n (props: ScopedProps<DropdownMenuSubContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n//\n// DropdownMenu\n//\n\nexport const DropdownMenu = {\n Root: DropdownMenuRoot,\n Trigger: DropdownMenuTrigger,\n VirtualTrigger: DropdownMenuVirtualTrigger,\n Portal: DropdownMenuPortal,\n Content: DropdownMenuContent,\n Viewport: DropdownMenuViewport,\n Group: DropdownMenuGroup,\n GroupLabel: DropdownMenuGroupLabel,\n Item: DropdownMenuItem,\n CheckboxItem: DropdownMenuCheckboxItem,\n RadioGroup: DropdownMenuRadioGroup,\n RadioItem: DropdownMenuRadioItem,\n ItemIndicator: DropdownMenuItemIndicator,\n Separator: DropdownMenuSeparator,\n Arrow: DropdownMenuArrow,\n Sub: DropdownMenuSub,\n SubTrigger: DropdownMenuSubTrigger,\n SubContent: DropdownMenuSubContent,\n};\n\ntype DropdownMenuScope = Scope;\n\nconst useDropdownMenuMenuScope: (scope?: DropdownMenuScope) => any = useMenuScope;\n\nexport { createDropdownMenuScope, useDropdownMenuContext, useDropdownMenuMenuScope };\n\nexport type {\n DropdownMenuRootProps,\n DropdownMenuTriggerProps,\n DropdownMenuVirtualTriggerProps,\n DropdownMenuPortalProps,\n DropdownMenuContentProps,\n DropdownMenuViewportProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport React, { forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\ntype SeparatorProps = ThemedClassName<SeparatorPrimitive.SeparatorProps> & { subdued?: boolean };\n\nconst Separator = forwardRef<HTMLDivElement, SeparatorProps>(\n ({ classNames, orientation = 'horizontal', subdued, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SeparatorPrimitive.Root\n {...props}\n orientation={orientation}\n className={tx('separator.root', { orientation, subdued }, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nexport type { SeparatorProps };\n\nexport { Separator };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { createContext } from '@radix-ui/react-context';\nimport React, {\n type KeyboardEvent,\n type PropsWithChildren,\n type ReactNode,\n useCallback,\n useEffect,\n useState,\n} from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { useTranslation } from '../../primitives';\nimport { translationKey } from '../../translations';\nimport { type ThemedClassName, composable, composableProps } from '../../util';\nimport { IconButton } from '../Button';\nimport { MediaPlayer, type MediaKind } from '../MediaPlayer';\n\n// TODO(burdon): Move per-element class strings to `@dxos/ui-theme` (theme tokens)\n// so callers can re-theme via the same mechanism the rest of `react-ui` uses.\n\n//\n// Context\n//\n\ntype CarouselContextValue = {\n index: number;\n count: number;\n setIndex: (index: number) => void;\n next: () => void;\n prev: () => void;\n};\n\nconst CAROUSEL_NAME = 'Carousel';\n\nconst [CarouselProvider, useCarouselContext] = createContext<CarouselContextValue>(CAROUSEL_NAME);\n\n/** Returns the current carousel state. Must be used within {@link Carousel.Root}. */\nexport const useCarousel = (): CarouselContextValue => useCarouselContext('useCarousel');\n\n//\n// Root\n//\n\nexport type CarouselRootProps = PropsWithChildren<{\n /** Total number of slides; drives auto-advance and indicator counts. */\n count: number;\n /** Whether to auto-advance slides on mount. Defaults to `false`. */\n autorun?: boolean;\n /** Auto-advance interval in milliseconds. Set 0 to disable. */\n intervalMs?: number;\n defaultIndex?: number;\n}>;\n\nconst CarouselRoot = ({\n children,\n count,\n autorun = false,\n intervalMs = 5_000,\n defaultIndex = 0,\n}: CarouselRootProps) => {\n const [index, setIndexState] = useState(defaultIndex);\n const [autoAdvance, setAutoAdvance] = useState(autorun);\n\n // Reset to first slide if the slide count shrinks below the current index.\n useEffect(() => {\n if (index >= count) {\n setIndexState(0);\n }\n }, [count, index]);\n\n // Auto-advance — stops permanently once the user interacts with any control.\n useEffect(() => {\n if (!autoAdvance || count <= 1 || intervalMs <= 0) {\n return;\n }\n const handle = setInterval(() => setIndexState((i) => (i + 1) % count), intervalMs);\n return () => clearInterval(handle);\n }, [autoAdvance, count, intervalMs]);\n\n const setIndex = useCallback((next: number) => {\n setAutoAdvance(false);\n setIndexState(next);\n }, []);\n const next = useCallback(() => {\n setAutoAdvance(false);\n setIndexState((i) => (i + 1) % count);\n }, [count]);\n const prev = useCallback(() => {\n setAutoAdvance(false);\n setIndexState((i) => (i - 1 + count) % count);\n }, [count]);\n\n if (count === 0) {\n return null;\n }\n\n return (\n <CarouselProvider index={index} count={count} setIndex={setIndex} next={next} prev={prev}>\n {children}\n </CarouselProvider>\n );\n};\n\nCarouselRoot.displayName = 'Carousel.Root';\n\n//\n// Content\n//\n\nexport type CarouselContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\n// `composable` so a parent `<… asChild>` (Slot) is respected — the injected className/ref land on the grid.\nconst CarouselContent = composable<HTMLDivElement>(({ children, ...props }, forwardedRef) => (\n // Rows are `[1fr, auto]`: row 1 (Previous|Viewport|Next) stretches when the parent\n // gives the carousel a definite height, and row 2 (Indicators / Caption) sticks to\n // its content height. With no parent height constraint, the `1fr` row simply tracks\n // row-1 content — preserving the existing aspect-video behaviour for unbounded use.\n // TODO(burdon): Move to Carousel.theme.ts\n <div\n {...composableProps(props, {\n classNames:\n 'w-full grid grid-cols-[min-content_1fr_min-content] grid-rows-[minmax(0,1fr)_auto] gap-4 items-center',\n })}\n ref={forwardedRef}\n >\n {children}\n </div>\n));\n\nCarouselContent.displayName = 'Carousel.Content';\n\n//\n// Viewport\n//\n\nexport type CarouselViewportProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst CarouselViewport = ({ children, classNames }: CarouselViewportProps) => {\n const { t } = useTranslation(translationKey);\n const { count, next, prev } = useCarousel();\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (count <= 1) {\n return;\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n prev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n next();\n }\n },\n [count, next, prev],\n );\n\n return (\n <div\n // TODO(burdon): Move to ui-theme.\n className={mx(\n 'relative w-full aspect-video overflow-hidden',\n 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500',\n classNames,\n )}\n tabIndex={0}\n role='region'\n aria-roledescription='carousel'\n aria-label={t('carousel-viewport.label')}\n onKeyDown={handleKeyDown}\n >\n {children}\n </div>\n );\n};\n\nCarouselViewport.displayName = 'Carousel.Viewport';\n\n//\n// Slide\n//\n\nexport type CarouselSlideProps = ThemedClassName<{\n index: number;\n /** Media source URL — rendered via the embedded {@link MediaPlayer}. */\n src: string;\n /** Override media auto-detection (`'video' | 'audio'`). */\n kind?: MediaKind;\n /** Accessible label / `<img alt>` fallback. */\n alt?: string;\n controls?: boolean;\n autoPlay?: boolean;\n loop?: boolean;\n muted?: boolean;\n crossOrigin?: 'anonymous' | 'use-credentials' | '';\n}>;\n\nconst CarouselSlide = ({\n index,\n classNames,\n src,\n kind,\n alt,\n controls,\n autoPlay,\n loop,\n muted,\n crossOrigin,\n}: CarouselSlideProps) => {\n const { index: active } = useCarousel();\n if (active !== index) {\n return null;\n }\n\n return (\n <div className={mx('absolute inset-0 w-full h-full bg-baseSurface', classNames)}>\n <MediaPlayer\n src={src}\n kind={kind}\n alt={alt}\n classNames='w-full h-full'\n controls={controls}\n autoPlay={autoPlay}\n loop={loop}\n muted={muted}\n crossOrigin={crossOrigin}\n />\n </div>\n );\n};\n\nCarouselSlide.displayName = 'Carousel.Slide';\n\n//\n// Previous / Next\n//\n\nexport type CarouselButtonProps = ThemedClassName<{}>;\n\nconst CarouselPrevious = ({ classNames }: CarouselButtonProps) => {\n const { t } = useTranslation(translationKey);\n const { count, prev } = useCarousel();\n if (count <= 1) {\n return <div />;\n }\n\n return (\n <IconButton\n classNames={mx('self-center', classNames)}\n square\n variant='ghost'\n icon='ph--caret-left--regular'\n iconOnly\n label={t('carousel-prev.label')}\n onClick={prev}\n />\n );\n};\n\nCarouselPrevious.displayName = 'Carousel.Previous';\n\nconst CarouselNext = ({ classNames }: CarouselButtonProps) => {\n const { t } = useTranslation(translationKey);\n const { count, next } = useCarousel();\n if (count <= 1) {\n return <div />;\n }\n\n return (\n <IconButton\n classNames={mx('self-center', classNames)}\n square\n variant='ghost'\n icon='ph--caret-right--regular'\n iconOnly\n label={t('carousel-next.label')}\n onClick={next}\n />\n );\n};\n\nCarouselNext.displayName = 'Carousel.Next';\n\n//\n// Indicators\n//\n\nexport type CarouselIndicatorsProps = ThemedClassName<{}>;\n\n/** Tab-strip of slide indicators. Sits in the centre column so it matches the viewport's width. */\nconst CarouselIndicators = ({ classNames }: CarouselIndicatorsProps) => {\n const { t } = useTranslation(translationKey);\n const { count, index, setIndex } = useCarousel();\n const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n if (count <= 1) {\n return null;\n }\n\n return (\n <div className='col-start-2 overflow-hidden'>\n <div\n {...arrowNavigationAttrs}\n className={mx('flex items-center justify-center', classNames)}\n role='tablist'\n aria-label={t('carousel-indicators.label')}\n >\n {Array.from({ length: count }).map((_, i) => (\n <IconButton\n key={i}\n role='tab'\n aria-selected={i === index}\n classNames={i === index ? 'text-primary-500' : 'text-description'}\n icon={i === index ? 'ph--circle--fill' : 'ph--circle--regular'}\n iconOnly\n label={t('carousel-go-to.label', { index: i + 1 })}\n onClick={() => setIndex(i)}\n onFocus={() => setIndex(i)}\n size={3}\n variant='ghost'\n />\n ))}\n </div>\n </div>\n );\n};\n\nCarouselIndicators.displayName = 'Carousel.Indicators';\n\n//\n// Caption\n//\n\nexport type CarouselCaptionProps = ThemedClassName<{\n /** Render prop receiving the active slide index. */\n children: (index: number) => ReactNode;\n}>;\n\n/** Caption sized to the viewport's column. */\nconst CarouselCaption = ({ children, classNames }: CarouselCaptionProps) => {\n const { index } = useCarousel();\n const content = children(index);\n if (content == null || content === false || content === '') {\n return null;\n }\n return (\n // TODO(burdon): Move to ui-theme.\n <div className='col-start-2'>\n <p className={mx('text-center text-description', classNames)}>{content}</p>\n </div>\n );\n};\n\nCarouselCaption.displayName = 'Carousel.Caption';\n\n//\n// Carousel\n//\n\nexport const Carousel = {\n Root: CarouselRoot,\n Content: CarouselContent,\n Viewport: CarouselViewport,\n Slide: CarouselSlide,\n Previous: CarouselPrevious,\n Next: CarouselNext,\n Indicators: CarouselIndicators,\n Caption: CarouselCaption,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { type ThemedClassName } from '../../util';\n\nexport type MediaKind = 'video' | 'audio';\n\nexport type MediaFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';\n\n/** Static map to keep Tailwind's class scanner happy (no dynamic `object-${fit}`). */\nconst FIT_CLASS: Record<MediaFit, string> = {\n cover: 'object-cover',\n contain: 'object-contain',\n fill: 'object-fill',\n none: 'object-none',\n 'scale-down': 'object-scale-down',\n};\n\nconst VIDEO_EXTENSIONS = ['.mp4', '.webm', '.ogv', '.mov', '.m4v'];\nconst AUDIO_EXTENSIONS = ['.mp3', '.wav', '.ogg', '.m4a', '.aac', '.flac'];\n\n/** iframe sandbox flags compatible with typical oEmbed-style players. */\nconst DEFAULT_IFRAME_SANDBOX = 'allow-scripts allow-same-origin allow-presentation';\n\n/**\n * Best-effort detection of `video` vs `audio` from a media URL.\n * Inspects the pathname's extension (ignoring query/hash). Returns `undefined`\n * when the URL doesn't look like a recognised media file — callers should\n * default to 'video' or render a fallback (e.g. iframe / img).\n */\nexport const detectMediaKind = (src: string): MediaKind | undefined => {\n // Strip query and hash, then take the last path segment's extension.\n const pathname = src.split(/[?#]/, 1)[0]!;\n const lower = pathname.toLowerCase();\n if (VIDEO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {\n return 'video';\n }\n if (AUDIO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {\n return 'audio';\n }\n\n return undefined;\n};\n\n/**\n * Heuristic match for URLs that should render as native `<video>` / `<audio>`\n * (i.e. URLs ending in a recognised media extension).\n *\n * NB: Cloudflare Stream embed URLs serve an HTML player page, **not** a media\n * stream, so they cannot be loaded via `<video>`. Those are detected by\n * {@link isCloudflareStreamEmbed} and rendered via `<iframe>` instead.\n */\nexport const isEmbedUrl = (src: string): boolean => detectMediaKind(src) !== undefined;\n\n/**\n * Match Cloudflare Stream `/iframe` embed URLs of the form\n * `https://customer-<code>.cloudflarestream.com/<32-hex-uid>/iframe[?…]`.\n */\nconst CLOUDFLARE_STREAM_IFRAME_PATTERN =\n /^https:\\/\\/[a-z0-9-]+\\.cloudflarestream\\.com\\/[a-f0-9]{32}\\/iframe(?:[/?#]|$)/i;\n\nconst isCloudflareStreamEmbed = (src: string): boolean => CLOUDFLARE_STREAM_IFRAME_PATTERN.test(src);\n\nexport type MediaPlayerProps = ThemedClassName<{\n src: string;\n alt?: string;\n /** Override auto-detection. When omitted, `detectMediaKind(src)` is used and falls back to 'video'. */\n kind?: MediaKind;\n controls?: boolean;\n autoPlay?: boolean;\n loop?: boolean;\n muted?: boolean;\n /**\n * CORS mode for `<video>`/`<audio>`. Omitted by default — plain playback needs no CORS, and\n * forcing it breaks sources whose response/redirect lacks `access-control-allow-origin` (e.g.\n * Cloudflare Stream's signed MP4 redirect). Set 'anonymous' only when reading frames into a canvas.\n */\n crossOrigin?: 'anonymous' | 'use-credentials' | '';\n /** CSS `object-fit` for `<img>` and `<video>`. Ignored for `<iframe>`/`<audio>`. Defaults to 'cover'. */\n fit?: MediaFit;\n}>;\n\n/**\n * Renders a media URL using the appropriate element:\n * - Direct media URLs (mp4, mp3, …) → native `<video>` / `<audio>`.\n * - Cloudflare Stream `/iframe` embed URLs → `<iframe>`.\n * - Everything else → `<img>` that hides itself on load failure (broken images\n * are common in feeds and the placeholder is uglier than nothing).\n */\nexport const MediaPlayer = ({\n classNames,\n src,\n kind,\n controls = true,\n autoPlay = false,\n loop = false,\n muted = false,\n alt,\n crossOrigin,\n fit = 'cover',\n}: MediaPlayerProps) => {\n const fitClass = FIT_CLASS[fit];\n if (isEmbedUrl(src)) {\n const resolved = kind ?? detectMediaKind(src) ?? 'video';\n if (resolved === 'audio') {\n return (\n <audio\n className={mx('w-full', classNames)}\n src={src}\n controls={controls}\n autoPlay={autoPlay}\n loop={loop}\n muted={muted}\n crossOrigin={crossOrigin}\n aria-label={alt}\n />\n );\n }\n\n return (\n <video\n className={mx('max-w-full max-h-full aspect-video', fitClass, classNames)}\n src={src}\n controls={controls}\n autoPlay={autoPlay}\n loop={loop}\n muted={muted}\n crossOrigin={crossOrigin}\n aria-label={alt}\n />\n );\n }\n\n if (isCloudflareStreamEmbed(src)) {\n return <IframePlayer key={src} classNames={classNames} src={src} alt={alt} />;\n }\n\n return (\n <img\n className={mx(fitClass, classNames)}\n src={src}\n alt={alt ?? ''}\n loading='lazy'\n onError={(event) => {\n event.currentTarget.style.display = 'none';\n }}\n />\n );\n};\n\ntype IframePlayerProps = ThemedClassName<{\n src: string;\n alt?: string;\n}>;\n\nconst IframePlayer = ({ src, alt, classNames }: IframePlayerProps) => {\n const [loaded, setLoaded] = useState(false);\n return (\n <div className={mx('relative bg-baseSurface', classNames)}>\n <iframe\n src={src}\n title={alt ?? 'Embedded media'}\n loading='lazy'\n className={mx(\n 'border-none w-full h-full transition-opacity duration-150',\n loaded ? 'opacity-100' : 'opacity-0',\n )}\n style={{ colorScheme: 'dark' }}\n sandbox={DEFAULT_IFRAME_SANDBOX}\n referrerPolicy='no-referrer'\n allow='accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;'\n allowFullScreen\n onLoad={() => setLoaded(true)}\n />\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';\n\nexport type ClipboardContextValue = {\n textValue: string;\n setTextValue: (nextValue: string) => Promise<void>;\n};\n\nexport const ClipboardContext = createContext<ClipboardContextValue>({\n textValue: '',\n setTextValue: async (_) => {},\n});\n\nexport const useClipboard = () => useContext(ClipboardContext);\n\nexport const ClipboardProvider = ({ children }: PropsWithChildren<{}>) => {\n const [textValue, setInternalTextValue] = useState('');\n const setTextValue = useCallback(async (nextValue: string) => {\n await navigator.clipboard.writeText(nextValue);\n return setInternalTextValue(nextValue);\n }, []);\n return <ClipboardContext.Provider value={{ textValue, setTextValue }}>{children}</ClipboardContext.Provider>;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useTranslation } from '../../primitives';\nimport { Button, type ButtonProps, IconButton } from '../Button';\nimport { Icon, type IconProps } from '../Icon';\nimport { type TooltipScopedProps, useTooltipContext } from '../Tooltip';\nimport { useClipboard } from './ClipboardProvider';\n\nexport type CopyButtonProps = ButtonProps &\n Pick<IconProps, 'size'> & {\n value: string;\n };\n\nconst inactiveLabelStyles = 'invisible h-px -mb-px overflow-hidden';\n\nexport const CopyButton = ({ classNames, value, size = 5, ...props }: CopyButtonProps) => {\n const { t } = useTranslation(osTranslations);\n const { textValue, setTextValue } = useClipboard();\n const isCopied = textValue === value;\n return (\n <Button\n {...props}\n classNames={['inline-flex flex-col justify-center', classNames]}\n onClick={() => setTextValue(value)}\n data-testid='copy-invitation'\n >\n <div className={mx('flex gap-1 items-center', isCopied && inactiveLabelStyles)}>\n <span className='px-1'>{t('copy.label')}</span>\n <Icon icon='ph--copy--regular' size={size} />\n </div>\n <div className={mx('flex gap-1 items-center', !isCopied && inactiveLabelStyles)}>\n <span className='px-1'>{t('copy-success.label')}</span>\n <Icon icon='ph--check--regular' size={size} />\n </div>\n </Button>\n );\n};\n\ntype CopyButtonIconOnlyProps = CopyButtonProps & {\n label?: string;\n};\n\nexport const CopyButtonIconOnly = ({\n __scopeTooltip,\n value,\n classNames,\n size,\n variant,\n ...props\n}: TooltipScopedProps<CopyButtonIconOnlyProps>) => {\n const { t } = useTranslation(osTranslations);\n const { textValue, setTextValue } = useClipboard();\n const isCopied = textValue === value;\n const label = isCopied ? t('copy-success.label') : (props.label ?? t('copy.label'));\n const { onOpen } = useTooltipContext('CopyButton', __scopeTooltip);\n return (\n <IconButton\n iconOnly\n label={label!}\n icon='ph--copy--regular'\n size={size}\n variant={variant}\n classNames={['inline-flex flex-col justify-center', classNames]}\n onClick={() => setTextValue(value).then(onOpen)}\n data-testid='copy-invitation'\n />\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClipboardProvider } from './ClipboardProvider';\nimport { CopyButton, CopyButtonIconOnly } from './CopyButton';\n\nexport const Clipboard = {\n Button: CopyButton,\n IconButton: CopyButtonIconOnly,\n Provider: ClipboardProvider,\n};\n\nexport { useClipboard } from './ClipboardProvider';\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { format as formatDate } from 'date-fns';\nimport React, {\n type ComponentPropsWithoutRef,\n type PropsWithChildren,\n type ReactNode,\n forwardRef,\n useCallback,\n useState,\n} from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { useTranslation } from '../../primitives';\nimport { translationKey } from '../../translations';\nimport { type ThemedClassName } from '../../util';\nimport { Calendar, type DateRange } from '../Calendar';\nimport { Icon } from '../Icon';\nimport { Popover } from '../Popover';\n\n//\n// Public API.\n//\n// Wraps the new react-aria-components-backed `<Calendar>` (single + range) in a Radix Popover,\n// preserving the previous slot-style namespace: `<DatePicker.Root>`, `<DatePicker.Trigger>`,\n// `<DatePicker.Content>`, `<DatePicker.Calendar>`. Multi-select is no longer supported (no\n// in-repo consumers); use `<Calendar.Root>` directly with custom state if needed.\n//\n\nexport type DatePickerMode = 'single' | 'range';\n\ntype ValueByMode = {\n single: Date | undefined;\n range: DateRange | undefined;\n};\n\ntype DatePickerContextValue = {\n mode: DatePickerMode;\n value: ValueByMode[DatePickerMode];\n setValue: (next: ValueByMode[DatePickerMode]) => void;\n withTime: boolean;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n};\n\nconst [DatePickerProvider, useDatePickerContext] = createContext<DatePickerContextValue>('DatePicker');\n\n//\n// Root.\n//\n\nexport type DatePickerRootProps<M extends DatePickerMode = 'single'> = {\n mode?: M;\n value?: ValueByMode[M];\n defaultValue?: ValueByMode[M];\n onValueChange?: (value: ValueByMode[M]) => void;\n /** Preserve hour/minute on the selected date(s) when picking a new day. */\n withTime?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nconst DatePickerRoot = <M extends DatePickerMode = 'single'>({\n mode = 'single' as M,\n value,\n defaultValue,\n onValueChange,\n withTime = false,\n open,\n defaultOpen,\n onOpenChange,\n children,\n}: DatePickerRootProps<M>) => {\n const [internalValue, setInternalValue] = useState<ValueByMode[M] | undefined>(defaultValue);\n const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);\n\n const controlled = value !== undefined || onValueChange !== undefined;\n const resolvedValue = (controlled ? value : internalValue) as ValueByMode[DatePickerMode];\n\n const setValue = useCallback(\n (next: ValueByMode[DatePickerMode]) => {\n if (!controlled) {\n setInternalValue(next as ValueByMode[M] | undefined);\n }\n onValueChange?.(next as ValueByMode[M]);\n },\n [controlled, onValueChange],\n );\n\n const resolvedOpen = open ?? internalOpen;\n const handleOpenChange = useCallback(\n (next: boolean) => {\n if (open === undefined) {\n setInternalOpen(next);\n }\n onOpenChange?.(next);\n },\n [open, onOpenChange],\n );\n\n return (\n <DatePickerProvider\n mode={mode as DatePickerMode}\n value={resolvedValue}\n setValue={setValue}\n withTime={withTime}\n open={resolvedOpen}\n onOpenChange={handleOpenChange}\n >\n <Popover.Root open={resolvedOpen} onOpenChange={handleOpenChange}>\n {children}\n </Popover.Root>\n </DatePickerProvider>\n );\n};\n\n//\n// Trigger.\n//\n\nconst formatValue = (mode: DatePickerMode, value: unknown, fmt: string): string | undefined => {\n if (value === undefined || value === null) {\n return undefined;\n }\n switch (mode) {\n case 'single':\n return formatDate(value as Date, fmt);\n case 'range': {\n const r = value as DateRange;\n if (!r.from) {\n return undefined;\n }\n return r.to ? `${formatDate(r.from, fmt)} – ${formatDate(r.to, fmt)}` : formatDate(r.from, fmt);\n }\n }\n};\n\nexport type DatePickerTriggerProps = ThemedClassName<Omit<ComponentPropsWithoutRef<'button'>, 'children'>> &\n PropsWithChildren<{\n format?: string;\n placeholder?: string;\n /** Show the leading calendar icon in the default trigger. Defaults to true. */\n icon?: boolean;\n }>;\n\nconst DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n ({ classNames, format: fmt = 'PPP', placeholder, icon = true, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { t } = useTranslation(translationKey);\n const { mode, value } = useDatePickerContext('DatePickerTrigger');\n\n const placeholderText = placeholder ?? (t(`date-picker.placeholder.${mode}.label`) as string);\n const label = formatValue(mode, value, fmt) ?? placeholderText;\n const hasValue = label !== placeholderText;\n\n return (\n <Popover.Trigger asChild>\n <button\n ref={forwardedRef}\n type='button'\n {...props}\n className={tx('datePicker.trigger', { hasValue }, classNames) ?? undefined}\n >\n {children ?? (\n <>\n {icon && <Icon size={4} icon='ph--calendar--regular' />}\n {label}\n </>\n )}\n </button>\n </Popover.Trigger>\n );\n },\n);\n\nDatePickerTrigger.displayName = 'DatePickerTrigger';\n\n//\n// Content.\n//\n\nexport type DatePickerContentProps = ThemedClassName<ComponentPropsWithoutRef<typeof Popover.Content>>;\n\nconst DatePickerContent = forwardRef<HTMLDivElement, DatePickerContentProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <Popover.Portal>\n <Popover.Content ref={forwardedRef} align='start' sideOffset={4} {...props}>\n <div className={tx('datePicker.content', {}, classNames)}>{children}</div>\n </Popover.Content>\n </Popover.Portal>\n );\n },\n);\n\nDatePickerContent.displayName = 'DatePickerContent';\n\n//\n// Calendar — single or range, time-of-day preservation, auto-dismiss on completion.\n//\n\nconst carryTime = (oldDate: Date | undefined, newDate: Date | undefined): Date | undefined => {\n if (!newDate) {\n return newDate;\n }\n if (!oldDate) {\n return newDate;\n }\n const out = new Date(newDate);\n out.setHours(oldDate.getHours(), oldDate.getMinutes(), 0, 0);\n return out;\n};\n\nconst DatePickerCalendar = ({ classNames }: { classNames?: string } = {}) => {\n const { mode, value, setValue, withTime, onOpenChange } = useDatePickerContext('DatePickerCalendar');\n\n if (mode === 'single') {\n const date = value as Date | undefined;\n return (\n <Calendar.Root\n mode='single'\n classNames={classNames}\n selected={date}\n onSelect={(next) => {\n const merged = withTime ? carryTime(date, next) : next;\n setValue(merged);\n if (next !== undefined) {\n onOpenChange(false);\n }\n }}\n />\n );\n }\n\n const range = value as DateRange | undefined;\n return (\n <Calendar.Root\n mode='range'\n classNames={classNames}\n selected={range}\n onSelect={(next) => {\n if (!next) {\n setValue(undefined);\n return;\n }\n const merged: DateRange = withTime\n ? { from: carryTime(range?.from, next.from)!, to: carryTime(range?.to, next.to) }\n : next;\n setValue(merged);\n if (merged.from && merged.to) {\n onOpenChange(false);\n }\n }}\n />\n );\n};\n\nDatePickerCalendar.displayName = 'DatePickerCalendar';\n\n//\n// Public namespace.\n//\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Trigger: DatePickerTrigger,\n Content: DatePickerContent,\n Calendar: DatePickerCalendar,\n};\n\nexport { useDatePickerContext };\n\nexport type { ValueByMode };\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// This is based upon `@radix-ui/react-popover` fetched Oct 25, 2024 at https://github.com/radix-ui/primitives at commit 374c7d7.\n\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { type Scope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { hideOthers } from 'aria-hidden';\nimport React, {\n type ComponentPropsWithRef,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type FC,\n type ReactNode,\n type RefObject,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport { useSafeCollisionPadding, useElevationContext, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\n//\n// Context\n//\n\ntype ScopedProps<P> = P & { __scopePopover?: Scope };\n\nconst POPOVER_NAME = 'Popover';\n\nconst [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [createPopperScope]);\n\nconst usePopperScope = createPopperScope();\n\ntype PopoverContextValue = {\n triggerRef: RefObject<HTMLButtonElement>;\n contentId: string;\n hasCustomAnchor: boolean;\n modal: boolean;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n onCustomAnchorAdd(): void;\n onCustomAnchorRemove(): void;\n};\n\nconst [PopoverProvider, usePopoverContext] = createPopoverContext<PopoverContextValue>(POPOVER_NAME);\n\n//\n// PopoverRoot\n//\n\ntype PopoverRootProps = {\n children?: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n};\n\nconst PopoverRoot: FC<PopoverRootProps> = (props: ScopedProps<PopoverRootProps>) => {\n const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [hasCustomAnchor, setHasCustomAnchor] = useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <PopoverProvider\n scope={__scopePopover}\n contentId={useId()}\n triggerRef={triggerRef as RefObject<HTMLButtonElement>}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={useCallback(() => setHasCustomAnchor(false), [])}\n modal={modal}\n >\n {children}\n </PopoverProvider>\n </PopperPrimitive.Root>\n );\n};\n\nPopoverRoot.displayName = POPOVER_NAME;\n\n//\n// PopoverAnchor\n//\n\nconst ANCHOR_NAME = 'Popover.Anchor';\n\ntype PopoverAnchorElement = ComponentRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ntype PopoverAnchorProps = PopperAnchorProps;\n\nconst PopoverAnchor = forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props: ScopedProps<PopoverAnchorProps>, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n\n useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\n return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n },\n);\n\nPopoverAnchor.displayName = ANCHOR_NAME;\n\n//\n// PopoverTrigger\n//\n\nconst TRIGGER_NAME = 'Popover.Trigger';\n\ntype PopoverTriggerElement = ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;\ntype PopoverTriggerProps = PrimitiveButtonProps & {\n asChild?: boolean;\n};\n\nconst PopoverTrigger = forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n (props: ScopedProps<PopoverTriggerProps>, forwardedRef) => {\n const { __scopePopover, asChild, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const Comp = asChild ? Slot : Primitive.button;\n\n const trigger = (\n <Comp\n type='button'\n aria-haspopup='dialog'\n aria-expanded={context.open}\n aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onClick={composeEventHandlers(props.onClick, context.onOpenToggle)}\n />\n );\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n {trigger}\n </PopperPrimitive.Anchor>\n );\n },\n);\n\nPopoverTrigger.displayName = TRIGGER_NAME;\n\n//\n// PopoverVirtualTrigger\n//\n\nconst VIRTUAL_TRIGGER_NAME = 'Popover.VirtualTrigger';\n\ntype PopoverVirtualTriggerProps = {\n virtualRef: RefObject<PopoverTriggerElement | null>;\n};\n\nconst PopoverVirtualTrigger = (props: ScopedProps<PopoverVirtualTriggerProps>) => {\n const { __scopePopover, virtualRef } = props;\n const context = usePopoverContext(VIRTUAL_TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useEffect(() => {\n if (virtualRef.current) {\n context.triggerRef.current = virtualRef.current;\n }\n });\n return <PopperPrimitive.Anchor {...popperScope} virtualRef={virtualRef as RefObject<PopoverTriggerElement>} />;\n};\n\nPopoverVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;\n\n//\n// PopoverPortal\n//\n\nconst PORTAL_NAME = 'Popover.Portal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createPopoverContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = ComponentPropsWithoutRef<typeof PortalPrimitive>;\ntype PopoverPortalProps = {\n children?: ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n};\n\nconst PopoverPortal = (props: ScopedProps<PopoverPortalProps>) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return (\n <PortalProvider scope={__scopePopover} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nPopoverPortal.displayName = PORTAL_NAME;\n\n//\n// PopoverContent\n//\n\nconst CONTENT_NAME = 'Popover.Content';\n\ntype PopoverContentProps = ThemedClassName<PopoverContentTypeProps> & {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: boolean;\n};\n\nconst PopoverContent = forwardRef<PopoverContentTypeElement, PopoverContentProps>(\n (props: ScopedProps<PopoverContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n\n return (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <PopoverContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <PopoverContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n },\n);\n\nPopoverContent.displayName = CONTENT_NAME;\n\ntype PopoverContentTypeElement = PopoverContentImplElement;\nexport interface PopoverContentTypeProps extends Omit<\n PopoverContentImplProps,\n 'trapFocus' | 'disableOutsidePointerEvents'\n> {}\n\nconst PopoverContentModal = forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n useEffect(() => {\n const content = contentRef.current;\n if (content) {\n return hideOthers(content);\n }\n }, []);\n\n return (\n <RemoveScroll as={Slot} allowPinchZoom>\n <PopoverContentImpl\n {...props}\n ref={composedRefs}\n // Make sure we're not trapping once it's been closed (closed !== unmounted when animating out).\n trapFocus={context.open}\n disableOutsidePointerEvents\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) {\n context.triggerRef.current?.focus();\n }\n })}\n onPointerDownOutside={composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false },\n )}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault(), {\n checkForDefaultPrevented: false,\n })}\n />\n </RemoveScroll>\n );\n },\n);\n\nconst PopoverContentNonModal = forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = useRef(false);\n const hasPointerDownOutsideRef = useRef(false);\n\n return (\n <PopoverContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) {\n context.triggerRef.current?.focus();\n }\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) {\n event.preventDefault();\n }\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n },\n);\n\ntype PopoverContentImplElement = ComponentRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = ThemedClassName<ComponentPropsWithoutRef<typeof PopperPrimitive.Content>>;\n\ntype PopoverContentImplProps = Omit<PopperContentProps, 'onPlaced'> &\n Omit<DismissableLayerProps, 'onDismiss'> & {\n /**\n * Whether focus should be trapped within the `Popover`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n };\n\nconst PopoverContentImpl = forwardRef<PopoverContentImplElement, PopoverContentImplProps>(\n (props: ScopedProps<PopoverContentImplProps>, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n collisionPadding = 8,\n collisionBoundary,\n classNames,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { tx } = useThemeContext();\n const elevation = useElevationContext();\n const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);\n\n // Make sure the whole tree has focus guards as our `Popover` may be the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n // Check for the closest annotated collision boundary in the DOM tree.\n const computedCollisionBoundary = useMemo(() => {\n const closestBoundary = context.triggerRef.current?.closest(\n '[data-popover-collision-boundary]',\n ) as HTMLElement | null;\n return closestBoundary\n ? Array.isArray(collisionBoundary)\n ? [closestBoundary, ...collisionBoundary]\n : collisionBoundary\n ? [closestBoundary, collisionBoundary]\n : [closestBoundary]\n : collisionBoundary;\n }, [context.open, collisionBoundary, context.triggerRef.current]);\n\n return (\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={disableOutsidePointerEvents}\n onInteractOutside={onInteractOutside}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onDismiss={() => context.onOpenChange(false)}\n >\n <PopperPrimitive.Content\n data-state={getState(context.open)}\n role='dialog'\n id={context.contentId}\n {...popperScope}\n {...contentProps}\n collisionPadding={safeCollisionPadding}\n collisionBoundary={computedCollisionBoundary}\n className={tx('popover.content', { elevation }, classNames)}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // Re-namespace exposed content custom properties.\n ...{\n '--radix-popover-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-popover-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-popover-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-popover-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-popover-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n </DismissableLayer>\n </FocusScope>\n );\n },\n);\n\n//\n// PopoverClose\n//\n\nconst CLOSE_NAME = 'Popover.Close';\n\ntype PopoverCloseElement = ComponentRef<typeof Primitive.button>;\ntype PopoverCloseProps = PrimitiveButtonProps;\n\nconst PopoverClose = forwardRef<PopoverCloseElement, PopoverCloseProps>(\n (props: ScopedProps<PopoverCloseProps>, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return (\n <Primitive.button\n type='button'\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n },\n);\n\nPopoverClose.displayName = CLOSE_NAME;\n\n//\n// PopoverArrow\n//\n\nconst ARROW_NAME = 'Popover.Arrow';\n\ntype PopoverArrowElement = ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = ThemedClassName<ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>>;\ntype PopoverArrowProps = PopperArrowProps;\n\nconst PopoverArrow = forwardRef<PopoverArrowElement, PopoverArrowProps>(\n (props: ScopedProps<PopoverArrowProps>, forwardedRef) => {\n const { __scopePopover, classNames, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n const { tx } = useThemeContext();\n return (\n <PopperPrimitive.Arrow\n {...popperScope}\n {...arrowProps}\n className={tx('popover.arrow', {}, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nPopoverArrow.displayName = ARROW_NAME;\n\n//\n// PopoverViewport\n//\n\ntype PopoverViewportProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n asChild?: boolean;\n constrainInline?: boolean;\n constrainBlock?: boolean;\n};\n\nconst PopoverViewport = forwardRef<HTMLDivElement, PopoverViewportProps>(\n ({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.div;\n return (\n <Comp\n {...props}\n className={tx('popover.viewport', { constrainInline, constrainBlock }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\nconst getState = (open: boolean) => (open ? 'open' : 'closed');\n\ntype PopoverContentInteractOutsideEvent = Parameters<NonNullable<PopoverContentProps['onInteractOutside']>>[0];\n\n//\n// Popver\n//\n\nexport const Popover = {\n Root: PopoverRoot,\n Anchor: PopoverAnchor,\n Trigger: PopoverTrigger,\n VirtualTrigger: PopoverVirtualTrigger,\n Portal: PopoverPortal,\n Content: PopoverContent,\n Close: PopoverClose,\n Arrow: PopoverArrow,\n Viewport: PopoverViewport,\n};\n\nexport { createPopoverScope };\n\nexport type {\n PopoverRootProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverVirtualTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n PopoverViewportProps,\n PopoverContentInteractOutsideEvent,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type ComponentPropsWithRef,\n type ForwardRefExoticComponent,\n type FunctionComponent,\n forwardRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { osTranslations } from '@dxos/ui-theme';\nimport { type SlottableProps } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { ElevationProvider } from '../../primitives';\nimport { type DialogSize } from '../../theme';\nimport { type ThemedClassName, composableProps, slottable } from '../../util';\nimport { IconButton } from '../Button';\nimport { Column } from '../Column';\n\n//\n// Root\n//\n\ntype DialogRootProps = DialogPrimitive.DialogProps;\n\nconst DialogRoot: FunctionComponent<DialogRootProps> = (props) => (\n <ElevationProvider elevation='dialog'>\n <DialogPrimitive.Root\n // NOTE: Radix warning unless set to undefined.\n // https://www.radix-ui.com/primitives/docs/components/dialog#description\n aria-describedby={undefined}\n {...props}\n />\n </ElevationProvider>\n);\n\nDialogRoot.displayName = 'Dialog.Root';\n\n//\n// Trigger\n//\n\ntype DialogTriggerProps = DialogPrimitive.DialogTriggerProps;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n//\n// Portal\n//\n\ntype DialogPortalProps = DialogPrimitive.DialogPortalProps;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\n//\n// Overlay\n//\n\nconst DIALOG_OVERLAY_NAME = 'Dialog.Overlay';\n\ntype OverlayLayoutContextValue = { inOverlayLayout?: boolean };\n\nconst [OverlayLayoutProvider, useOverlayLayoutContext] = createContext<OverlayLayoutContextValue>(\n DIALOG_OVERLAY_NAME,\n {},\n);\n\ntype DialogOverlayProps = ThemedClassName<\n DialogPrimitive.DialogOverlayProps & { blockAlign?: 'center' | 'start' | 'end' }\n>;\n\nconst DialogOverlay: ForwardRefExoticComponent<DialogOverlayProps> = forwardRef<HTMLDivElement, DialogOverlayProps>(\n ({ classNames, children, blockAlign, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n\n return (\n <DialogPrimitive.Overlay\n {...props}\n data-block-align={blockAlign}\n className={tx('dialog.overlay', {}, classNames)}\n ref={forwardedRef}\n >\n <OverlayLayoutProvider inOverlayLayout>{children}</OverlayLayoutProvider>\n </DialogPrimitive.Overlay>\n );\n },\n);\n\nDialogOverlay.displayName = DIALOG_OVERLAY_NAME;\n\n//\n// Content\n//\n\nconst DIALOG_CONTENT_NAME = 'Dialog.Content';\n\ntype DialogContentProps = ThemedClassName<ComponentPropsWithRef<typeof DialogPrimitive.Content>> & {\n size?: DialogSize;\n inOverlayLayout?: boolean;\n};\n\nconst DialogContent: ForwardRefExoticComponent<DialogContentProps> = forwardRef<HTMLDivElement, DialogContentProps>(\n ({ classNames, children, size = 'md', inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);\n\n return (\n <DialogPrimitive.Content\n {...props}\n // NOTE: Radix warning unless set to undefined.\n // https://www.radix-ui.com/primitives/docs/components/dialog#description\n aria-describedby={undefined}\n className={tx(\n 'dialog.content',\n {\n size,\n inOverlayLayout: propsInOverlayLayout || inOverlayLayout,\n },\n classNames,\n )}\n ref={forwardedRef}\n >\n <Column.Root classNames='dx-expander' gutter='sm'>\n {children}\n </Column.Root>\n </DialogPrimitive.Content>\n );\n },\n);\n\nDialogContent.displayName = DIALOG_CONTENT_NAME;\n\n//\n// Header\n//\n\ntype DialogHeaderProps = SlottableProps;\n\nconst DialogHeader = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} className={tx('dialog.header', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nDialogHeader.displayName = 'Dialog.Header';\n\n//\n// ActionIconButton\n//\n\ntype DialogActionIconButtonAction = 'close' | 'delete';\n\ntype DialogActionIconButtonProps = { action: DialogActionIconButtonAction; label?: string };\n\nconst DIALOG_ACTION_ICONS: Record<DialogActionIconButtonAction, string> = {\n close: 'ph--x--regular',\n delete: 'ph--trash--regular',\n};\n\nconst DIALOG_ACTION_LABEL_KEYS: Record<DialogActionIconButtonAction, string> = {\n // Preserves the legacy `close-dialog.label` translation key for backward compat.\n close: 'close-dialog.label',\n delete: 'toolbar-delete.label',\n};\n\nconst DialogActionIconButton = forwardRef<HTMLButtonElement, DialogActionIconButtonProps>(\n ({ action, label, ...props }, forwardedRef) => {\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n {...props}\n label={label ?? t(DIALOG_ACTION_LABEL_KEYS[action])}\n icon={DIALOG_ACTION_ICONS[action]}\n iconOnly\n size={4}\n variant='ghost'\n ref={forwardedRef}\n />\n );\n },\n);\n\nDialogActionIconButton.displayName = 'Dialog.ActionIconButton';\n\n//\n// Body\n//\n\ntype DialogBodyProps = SlottableProps;\n\nconst DialogBody = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} className={tx('dialog.body', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nDialogBody.displayName = 'Dialog.Body';\n\n//\n// Title\n//\n\ntype DialogTitleProps = ThemedClassName<DialogPrimitive.DialogTitleProps> & { srOnly?: boolean };\n\nconst DialogTitle = forwardRef<HTMLHeadingElement, DialogTitleProps>(\n ({ classNames, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <DialogPrimitive.Title {...props} className={tx('dialog.title', { srOnly }, classNames)} ref={forwardedRef} />\n );\n },\n);\n\nDialogTitle.displayName = 'Dialog.Title';\n\n//\n// Description\n//\n\ntype DialogDescriptionProps = ThemedClassName<DialogPrimitive.DialogDescriptionProps> & { srOnly?: boolean };\n\nconst DialogDescription = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n ({ classNames, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <DialogPrimitive.Description\n {...props}\n className={tx('dialog.description', { srOnly }, classNames)}\n ref={forwardedRef}\n />\n );\n },\n);\n\nDialogDescription.displayName = 'Dialog.Description';\n\n//\n// ActionBar\n//\n\ntype DialogActionBarProps = SlottableProps;\n\nconst DialogActionBar = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className: classNames, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} className={tx('dialog.actionbar', {}, classNames)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nDialogActionBar.displayName = 'Dialog.ActionBar';\n\n//\n// Close\n//\n\ntype DialogCloseProps = DialogPrimitive.DialogCloseProps;\n\nconst DialogClose = DialogPrimitive.Close;\n\n//\n// Dialog\n//\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Overlay: DialogOverlay,\n Content: DialogContent,\n Header: DialogHeader,\n Body: DialogBody,\n Title: DialogTitle,\n Description: DialogDescription,\n ActionBar: DialogActionBar,\n Close: DialogClose,\n ActionIconButton: DialogActionIconButton,\n};\n\nexport type {\n DialogRootProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogHeaderProps,\n DialogBodyProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogActionBarProps,\n DialogCloseProps,\n DialogActionIconButtonAction,\n DialogActionIconButtonProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ForwardRefExoticComponent, type FunctionComponent, forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { ElevationProvider } from '../../primitives';\nimport { type DialogSize } from '../../theme';\nimport { type ThemedClassName } from '../../util';\nimport { Column } from '../Column';\nimport {\n Dialog,\n type DialogHeaderProps,\n type DialogBodyProps,\n type DialogActionBarProps,\n type DialogActionIconButtonProps,\n} from './Dialog';\n\n//\n// Root\n//\n\ntype AlertDialogRootProps = AlertDialogPrimitive.AlertDialogProps;\n\nconst AlertDialogRoot: FunctionComponent<AlertDialogRootProps> = (props) => (\n <ElevationProvider elevation='dialog'>\n <AlertDialogPrimitive.Root {...props} />\n </ElevationProvider>\n);\n\n//\n// Trigger\n//\n\ntype AlertDialogTriggerProps = AlertDialogPrimitive.AlertDialogTriggerProps;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\n//\n// Portal\n//\n\ntype AlertDialogPortalProps = AlertDialogPrimitive.AlertDialogPortalProps;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n//\n// Cancel\n//\n\ntype AlertDialogCancelProps = AlertDialogPrimitive.AlertDialogCancelProps;\n\nconst AlertDialogCancel = AlertDialogPrimitive.Cancel;\n\n//\n// Action\n//\n\ntype AlertDialogActionProps = AlertDialogPrimitive.AlertDialogActionProps;\n\nconst AlertDialogAction = AlertDialogPrimitive.Action;\n\n//\n// Context\n//\n\ntype OverlayLayoutContextValue = { inOverlayLayout?: boolean };\n\nconst ALERT_DIALOG_OVERLAY_NAME = 'AlertDialog.Overlay';\nconst ALERT_DIALOG_CONTENT_NAME = 'AlertDialog.Content';\n\nconst [OverlayLayoutProvider, useOverlayLayoutContext] = createContext<OverlayLayoutContextValue>(\n ALERT_DIALOG_OVERLAY_NAME,\n { inOverlayLayout: false },\n);\n\n//\n// Overlay\n//\n\ntype AlertDialogOverlayProps = ThemedClassName<\n AlertDialogPrimitive.AlertDialogOverlayProps & { blockAlign?: 'center' | 'start' | 'end' }\n>;\n\nconst AlertDialogOverlay: ForwardRefExoticComponent<AlertDialogOverlayProps> = forwardRef<\n HTMLDivElement,\n AlertDialogOverlayProps\n>(({ classNames, children, blockAlign, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <AlertDialogPrimitive.Overlay\n {...props}\n data-block-align={blockAlign}\n className={tx('dialog.overlay', {}, classNames)}\n ref={forwardedRef}\n >\n <OverlayLayoutProvider inOverlayLayout>{children}</OverlayLayoutProvider>\n </AlertDialogPrimitive.Overlay>\n );\n});\n\nAlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;\n\n//\n// Content\n//\n\ntype AlertDialogContentProps = ThemedClassName<AlertDialogPrimitive.AlertDialogContentProps> & { size?: DialogSize };\n\nconst AlertDialogContent: ForwardRefExoticComponent<AlertDialogContentProps> = forwardRef<\n HTMLDivElement,\n AlertDialogContentProps\n>(({ classNames, children, size = 'md', ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { inOverlayLayout } = useOverlayLayoutContext(ALERT_DIALOG_CONTENT_NAME);\n return (\n <AlertDialogPrimitive.Content\n {...props}\n className={tx('dialog.content', { inOverlayLayout, size }, classNames)}\n ref={forwardedRef}\n >\n <Column.Root classNames='dx-expander' gutter='sm'>\n {children}\n </Column.Root>\n </AlertDialogPrimitive.Content>\n );\n});\n\nAlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;\n\n//\n// Title\n//\n\ntype AlertDialogTitleProps = ThemedClassName<AlertDialogPrimitive.AlertDialogTitleProps> & { srOnly?: boolean };\n\nconst AlertDialogTitle: ForwardRefExoticComponent<AlertDialogTitleProps> = forwardRef<\n HTMLHeadingElement,\n AlertDialogTitleProps\n>(({ classNames, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <AlertDialogPrimitive.Title {...props} className={tx('dialog.title', { srOnly }, classNames)} ref={forwardedRef} />\n );\n});\n\n//\n// Description\n//\n\ntype AlertDialogDescriptionProps = ThemedClassName<AlertDialogPrimitive.AlertDialogDescriptionProps> & {\n srOnly?: boolean;\n};\n\nconst AlertDialogDescription: ForwardRefExoticComponent<AlertDialogDescriptionProps> = forwardRef<\n HTMLParagraphElement,\n AlertDialogDescriptionProps\n>(({ classNames, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <AlertDialogPrimitive.Description\n {...props}\n className={tx('dialog.description', { srOnly }, classNames)}\n ref={forwardedRef}\n />\n );\n});\n\n//\n// AlertDialog\n//\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n // Shared with Dialog.\n Header: Dialog.Header,\n Body: Dialog.Body,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n ActionBar: Dialog.ActionBar,\n ActionIconButton: Dialog.ActionIconButton,\n // AlertDialog-specific dismissal.\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n};\n\nexport type {\n AlertDialogRootProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n AlertDialogCancelProps,\n AlertDialogActionProps,\n // Re-export shared types.\n DialogHeaderProps as AlertDialogHeaderProps,\n DialogBodyProps as AlertDialogBodyProps,\n DialogActionBarProps as AlertDialogActionBarProps,\n DialogActionIconButtonProps as AlertDialogActionIconButtonProps,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nexport { ErrorBoundary, type ErrorBoundaryProps, type FallbackProps } from '@dxos/react-error-boundary';\n\nexport * from './ErrorFallback';\nexport * from './ErrorStack';\nexport * from './ThrowError';\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\nimport { type FallbackProps } from 'react-error-boundary';\n\nimport { safeStringify } from '@dxos/util';\n\nimport { translationKey } from '#translations';\n\nimport { useTranslation } from '../../primitives';\nimport { IconButton } from '../Button';\nimport { ErrorStack } from './ErrorStack';\n\nexport type ErrorFallbackProps = PropsWithChildren<Pick<FallbackProps, 'error'> & { title?: string; data?: any }>;\n\n/**\n * Themed fallback component for `ErrorBoundary`.\n */\nexport const ErrorFallback = ({ children, error, title, data }: ErrorFallbackProps) => {\n const { t } = useTranslation(translationKey);\n const isDev = process.env.NODE_ENV === 'development';\n const message = error instanceof Error ? error.message : String(error);\n\n return (\n <div role='alert' data-testid='error-boundary-fallback' className='flex flex-col p-4 gap-4 overflow-auto'>\n <h1 className='text-lg text-info-text'>{title ?? 'Runtime Error'}</h1>\n <p>{message}</p>\n\n {isDev && error instanceof Error && (\n <Section\n title='Stack'\n onClick={() => {\n const text = error instanceof Error ? (error.stack ?? error.message) : String(error);\n void navigator.clipboard.writeText(text);\n }}\n >\n <ErrorStack error={error} />\n </Section>\n )}\n\n {data && (\n <Section\n title='Data'\n onClick={() => {\n void navigator.clipboard.writeText(JSON.stringify(data, undefined, 2));\n }}\n >\n <pre className='overflow-x-auto text-xs'>{safeStringify(data, undefined, 2)}</pre>\n </Section>\n )}\n\n {children}\n </div>\n );\n};\n\nconst Section = ({ children, title, onClick }: PropsWithChildren<{ title?: string; onClick?: () => void }>) => {\n return (\n <div className='flex flex-col gap-1'>\n {onClick && (\n <div>\n <IconButton\n classNames='text-xs uppercase'\n label={title ?? 'Copy'}\n icon='ph--clipboard-text--regular'\n size={5}\n onClick={onClick}\n />\n </div>\n )}\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nexport type ThrowErrorProps = {\n error?: () => Error;\n delay?: number;\n};\n\n/**\n * Use this to debug the error boundary.\n */\nexport const ThrowError = ({ delay = 1_000, ...props }: ThrowErrorProps) => {\n const [error, setError] = useState<Error>();\n useEffect(() => {\n if (delay < 0) {\n return;\n }\n\n const t = setTimeout(() => {\n setError(generator({ delay, ...props }));\n }, delay);\n return () => clearTimeout(t);\n }, [delay, generator]);\n\n if (error) {\n throw error;\n }\n\n return null;\n};\n\nconst generator = ({ error, delay }: ThrowErrorProps) => {\n return error?.() ?? new Error(`Error generated after ${delay}ms`);\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport {\n useArrowNavigationGroup,\n useFocusableGroup,\n useMergedTabsterAttributes_unstable,\n} from '@fluentui/react-tabster';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type FocusEvent,\n type KeyboardEvent,\n type MouseEvent,\n createContext,\n useCallback,\n useContext,\n useRef,\n useState,\n} from 'react';\n\nimport { type Axis } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { composableProps, slottable } from '../../util';\n\n//\n// Context\n//\n\ntype FocusState = 'active' | 'error';\n\nconst FOCUS_STATE_ATTR = 'focus-state';\n\ntype ContextValue = {\n setFocus?: (state: FocusState | undefined) => void;\n /** True when any item within the group has DOM focus. */\n groupHasFocus?: boolean;\n};\n\nconst FocusContext = createContext<ContextValue>({});\n\nconst useFocus = () => useContext(FocusContext);\n\n//\n// Group\n//\n\ntype GroupProps = {\n orientation?: Axis;\n /** Show a subdued ring when unfocused (e.g., as a cell border). */\n border?: boolean;\n onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;\n};\n\n/**\n * Provides arrow-key navigation across focusable children via tabster.\n * Does not manage `aria-current` — use `Focus.Item` on each child for that.\n */\n// TODO(wittjosiah): Consider how this could integrate with with react-ui-attention.\n// Perhaps react-ui-attention comes under the mosaic umbrella as it supports selection?\nconst Group = slottable<HTMLDivElement, GroupProps>(\n ({ children, asChild, orientation = 'vertical', border = false, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n const rootRef = useRef<HTMLDivElement>(null);\n const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited-trap-focus' });\n const arrowNavigationAttrs = useArrowNavigationGroup({ axis: orientation, memorizeCurrent: true });\n const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);\n const [state, setState] = useState<FocusState | undefined>();\n const [groupHasFocus, setGroupHasFocus] = useState(false);\n\n const handleFocusIn = useCallback(() => setGroupHasFocus(true), []);\n const handleFocusOut = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const related = event.relatedTarget as HTMLElement | null;\n if (!related || !rootRef.current?.contains(related)) {\n setGroupHasFocus(false);\n }\n }, []);\n\n const { className, ...rest } = composableProps(props);\n return (\n <FocusContext.Provider value={{ setFocus: setState, groupHasFocus }}>\n <Comp\n {...rest}\n tabIndex={0}\n className={tx('focus.group', { border }, className)}\n {...tabsterAttrs}\n {...(state && {\n [`data-${FOCUS_STATE_ATTR}`]: state,\n })}\n onBlur={handleFocusOut}\n onFocus={handleFocusIn}\n ref={useComposedRefs<HTMLDivElement>(rootRef, forwardedRef)}\n >\n {children}\n </Comp>\n </FocusContext.Provider>\n );\n },\n);\n\n//\n// Item\n//\n\ntype ItemProps = {\n current?: boolean;\n /** Show a subdued ring when unfocused (e.g., as a cell border). */\n border?: boolean;\n onCurrentChange?: () => void;\n};\n\n/**\n * Focusable item within a `Focus.Group`.\n * Uses `useFocusableGroup` so the parent Group's arrow navigation treats this as a single unit\n * (internal buttons are not arrow-navigation targets; Enter/Escape to go in/out).\n * Supports controlled (`current` prop) and uncontrolled (focus-driven) `aria-current`.\n */\nconst Item = slottable<HTMLDivElement, ItemProps>(\n (\n { children, asChild, current, border = false, onCurrentChange, onClick, onFocus, onBlur, ...props },\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n // Tell tabster's groupper to ignore Enter so it doesn't move focus into the group.\n const focusableGroupAttrs = useFocusableGroup({ ignoreDefaultKeydown: { Enter: true } });\n const [focused, setFocused] = useState(false);\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n onCurrentChange?.();\n onClick?.(event);\n },\n [onCurrentChange, onClick],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter') {\n onCurrentChange?.();\n }\n },\n [onCurrentChange],\n );\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n setFocused(true);\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n setFocused(false);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n // Controlled `current` prop takes precedence (e.g., virtualized items that scroll back into view).\n // Otherwise fall back to DOM focus state.\n const isCurrent = current ?? focused;\n\n const { className, ...rest } = composableProps(props);\n return (\n <Comp\n {...rest}\n tabIndex={0}\n className={tx('focus.item', { border }, className)}\n {...focusableGroupAttrs}\n aria-current={isCurrent || undefined}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\n//\n// Focus\n//\n\nexport const Focus = {\n Group,\n Item,\n};\n\nexport type { GroupProps as FocusGroupProps, ItemProps as FocusItemProps };\n\nexport { useFocus };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createContext } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentPropsWithRef,\n type ForwardRefExoticComponent,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport {\n DescriptionAndValidation as DescriptionAndValidationPrimitive,\n type DescriptionAndValidationProps as DescriptionAndValidationPrimitiveProps,\n Description as DescriptionPrimitive,\n type DescriptionProps as DescriptionPrimitiveProps,\n INPUT_NAME,\n InputRoot,\n type InputRootProps,\n type InputScopedProps,\n Label as LabelPrimitive,\n type LabelProps as LabelPrimitiveProps,\n PinInput as PinInputPrimitive,\n type PinInputProps as PinInputPrimitiveProps,\n TextArea as TextAreaPrimitive,\n type TextAreaProps as TextAreaPrimitiveProps,\n TextInput as TextInputPrimitive,\n type TextInputProps as TextInputPrimitiveProps,\n Validation as ValidationPrimitive,\n type ValidationProps as ValidationPrimitiveProps,\n useInputContext,\n} from '@dxos/react-input';\nimport { mx } from '@dxos/ui-theme';\nimport { type Density, type Elevation, type Size } from '@dxos/ui-types';\n\nimport { translationKey } from '#translations';\n\nimport { useDensityContext, useElevationContext, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { IconButton, IconButtonProps } from '../Button';\nimport { Icon } from '../Icon';\nimport {\n SegmentedDate,\n type SegmentedDateProps,\n SegmentedDateTime,\n type SegmentedDateTimeProps,\n SegmentedTime,\n type SegmentedTimeProps,\n} from './SegmentedInput';\n\ntype InputVariant = 'default' | 'subdued';\n\ntype InputSharedProps = Partial<{ density: Density; elevation: Elevation; variant: InputVariant }>;\n\n//\n// Trigger context — lets a sibling `Input.TriggerIcon` open a picker registered by a field inside\n// the same `Input.Root`. Each registered handler is keyed; the most recent registration wins.\n//\n\ntype InputTriggerHandler = () => void;\n\ntype InputTriggerContextValue = {\n registerTrigger: (handler: InputTriggerHandler) => () => void;\n trigger: () => void;\n hasTrigger: boolean;\n};\n\n// Default context makes the trigger registry a no-op outside `Input.Root` (consumers opt in).\nconst [InputTriggerProvider, useInputTriggerContext] = createContext<InputTriggerContextValue>(INPUT_NAME, {\n registerTrigger: () => () => {},\n trigger: () => {},\n hasTrigger: false,\n});\n\n/**\n * Field hook. Pass an opener function; while the field is mounted, an `Input.TriggerIcon`\n * sibling will call this opener on press. Returns a no-op when used outside `Input.Root`.\n */\nconst useInputTrigger = (handler: InputTriggerHandler | undefined) => {\n const ctx = useInputTriggerContext('useInputTrigger');\n useEffect(() => {\n if (!handler) {\n return;\n }\n return ctx.registerTrigger(handler);\n }, [ctx, handler]);\n};\n\n//\n// Root — wraps the @dxos/react-input primitive root with the trigger registry.\n//\n\nconst Root = (props: InputRootProps) => {\n const handlerRef = useRef<InputTriggerHandler | null>(null);\n const [hasTrigger, setHasTrigger] = useState(false);\n\n const registerTrigger = useCallback((handler: InputTriggerHandler) => {\n handlerRef.current = handler;\n setHasTrigger(true);\n return () => {\n if (handlerRef.current === handler) {\n handlerRef.current = null;\n setHasTrigger(false);\n }\n };\n }, []);\n\n const trigger = useCallback(() => {\n handlerRef.current?.();\n }, []);\n\n return (\n <InputTriggerProvider registerTrigger={registerTrigger} trigger={trigger} hasTrigger={hasTrigger}>\n <InputRoot {...props} />\n </InputTriggerProvider>\n );\n};\n\nRoot.displayName = 'Input.Root';\n\n//\n// TriggerIcon — sibling button that opens the picker of the registered field. Renders nothing\n// when no field in the surrounding `Input.Root` has registered an opener.\n//\n\n// `label` and `icon` have defaults below, so both are optional for callers (e.g. `<Input.TriggerIcon />`).\n// `onClick` is reserved — the trigger always opens the registered picker.\ntype TriggerIconProps = Omit<IconButtonProps, 'label' | 'onClick'> & { label?: string };\n\nconst TriggerIcon = forwardRef<HTMLButtonElement, TriggerIconProps>(\n ({ classNames, icon = 'ph--calendar--regular', 'aria-label': ariaLabel, label, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const ctx = useInputTriggerContext('Input.TriggerIcon');\n if (!ctx.hasTrigger) {\n return null;\n }\n\n return (\n <IconButton\n ref={forwardedRef}\n variant='ghost'\n icon={icon}\n iconOnly\n classNames={classNames}\n aria-label={ariaLabel}\n label={label ?? ariaLabel ?? t('trigger-button.label')}\n {...props}\n onClick={ctx.trigger}\n />\n );\n },\n);\n\nTriggerIcon.displayName = 'Input.TriggerIcon';\n\n//\n// Label\n//\n\ntype LabelProps = ThemedClassName<LabelPrimitiveProps> & { srOnly?: boolean };\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(({ classNames, children, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <LabelPrimitive {...props} className={tx('input.label', { srOnly }, classNames)} ref={forwardedRef}>\n {children}\n </LabelPrimitive>\n );\n});\n\nLabel.displayName = 'Input.Label';\n\n//\n// Description\n//\n\ntype DescriptionProps = ThemedClassName<DescriptionPrimitiveProps> & { srOnly?: boolean };\n\nconst Description = forwardRef<HTMLSpanElement, DescriptionProps>(\n ({ classNames, children, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <DescriptionPrimitive {...props} className={tx('input.description', { srOnly }, classNames)} ref={forwardedRef}>\n {children}\n </DescriptionPrimitive>\n );\n },\n);\n\nDescription.displayName = 'Input.Description';\n\n//\n// Validation\n//\n\ntype ValidationProps = ThemedClassName<ValidationPrimitiveProps> & { srOnly?: boolean };\n\nconst Validation = forwardRef<HTMLSpanElement, InputScopedProps<ValidationProps>>(\n ({ __inputScope, classNames, children, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { validationValence } = useInputContext(INPUT_NAME, __inputScope);\n return (\n <ValidationPrimitive\n {...props}\n className={tx('input.validation', { srOnly, validationValence }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </ValidationPrimitive>\n );\n },\n);\n\nValidation.displayName = 'Input.Validation';\n\n//\n// DescriptionAndValidation\n//\n\ntype DescriptionAndValidationProps = ThemedClassName<DescriptionAndValidationPrimitiveProps> & { srOnly?: boolean };\n\nconst DescriptionAndValidation = forwardRef<HTMLParagraphElement, DescriptionAndValidationProps>(\n ({ classNames, children, srOnly, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <DescriptionAndValidationPrimitive\n {...props}\n className={tx('input.descriptionAndValidation', { srOnly }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </DescriptionAndValidationPrimitive>\n );\n },\n);\n\nDescriptionAndValidation.displayName = 'Input.DescriptionAndValidation';\n\n//\n// PinInput\n//\n\ntype PinInputProps = ThemedClassName<InputSharedProps & Omit<PinInputPrimitiveProps, 'className' | 'segmentClassName'>>;\n\nconst PinInput = forwardRef<HTMLInputElement, PinInputProps>(\n ({ classNames, density: propsDensity, elevation: propsElevation, ...props }, forwardedRef) => {\n const { hasIosKeyboard } = useThemeContext();\n const { tx } = useThemeContext();\n const density = useDensityContext(propsDensity);\n const elevation = useElevationContext(propsElevation);\n\n return (\n <PinInputPrimitive\n {...{\n ...props,\n ...(props.autoFocus && !hasIosKeyboard && { autoFocus: true }),\n }}\n className={tx('input.inputWithSegments', { disabled: props.disabled }, classNames) || ''}\n segmentClassName={tx('input.segment', { disabled: props.disabled, density, elevation }) || ''}\n ref={forwardedRef}\n />\n );\n },\n);\n\nPinInput.displayName = 'Input.PinInput';\n\n//\n// TextInput\n// TODO(burdon): Implement inline icon within button: e.g., https://www.radix-ui.com/themes/playground#text-field\n//\n\ntype AutoFillProps = {\n noAutoFill?: boolean;\n};\n\ntype TextInputProps = InputSharedProps & ThemedClassName<TextInputPrimitiveProps> & AutoFillProps;\n\nconst TextInput = forwardRef<HTMLInputElement, InputScopedProps<TextInputProps>>(\n (\n { __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props },\n forwardedRef,\n ) => {\n const { hasIosKeyboard } = useThemeContext();\n const { tx } = useThemeContext();\n const density = useDensityContext(densityProp);\n const elevation = useElevationContext(elevationProp);\n const { validationValence } = useInputContext(INPUT_NAME, __inputScope);\n\n return (\n <TextInputPrimitive\n {...props}\n // TODO(wittjosiah): Factor out autofill properies.\n {...{ 'data-1p-ignore': noAutoFill }}\n className={tx(\n 'input.input',\n {\n variant,\n disabled: props.disabled,\n density,\n elevation,\n validationValence,\n },\n classNames,\n )}\n {...(props.autoFocus && !hasIosKeyboard && { autoFocus: true })}\n ref={forwardedRef}\n />\n );\n },\n);\n\nTextInput.displayName = 'Input.TextInput';\n\n//\n// TextArea\n//\n\ntype TextAreaProps = InputSharedProps & ThemedClassName<TextAreaPrimitiveProps>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, InputScopedProps<TextAreaProps>>(\n ({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {\n const { hasIosKeyboard } = useThemeContext();\n const { tx } = useThemeContext();\n const density = useDensityContext(propsDensity);\n const elevation = useElevationContext(propsElevation);\n const { validationValence } = useInputContext(INPUT_NAME, __inputScope);\n\n return (\n <TextAreaPrimitive\n {...props}\n className={tx(\n 'input.textArea',\n {\n variant,\n disabled: props.disabled,\n density,\n elevation,\n validationValence,\n },\n classNames,\n )}\n {...(props.autoFocus && !hasIosKeyboard && { autoFocus: true })}\n ref={forwardedRef}\n />\n );\n },\n);\n\nTextArea.displayName = 'Input.TextArea';\n\n//\n// Checkbox\n//\n\ntype CheckboxProps = ThemedClassName<Omit<CheckboxPrimitive.CheckboxProps, 'children'>> & {\n size?: Size;\n};\n\nconst Checkbox: ForwardRefExoticComponent<CheckboxProps> = forwardRef<\n HTMLButtonElement,\n InputScopedProps<CheckboxProps>\n>(\n (\n {\n __inputScope,\n classNames,\n checked: propsChecked,\n defaultChecked: propsDefaultChecked,\n onCheckedChange: propsOnCheckedChange,\n size,\n ...props\n },\n forwardedRef,\n ) => {\n const [checked, onCheckedChange] = useControllableState({\n prop: propsChecked,\n defaultProp: propsDefaultChecked,\n onChange: propsOnCheckedChange,\n });\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n const { tx } = useThemeContext();\n\n return (\n <CheckboxPrimitive.Root\n {...{\n ...props,\n checked,\n onCheckedChange,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n className: tx('input.checkbox', { size }, 'shrink-0', classNames),\n }}\n ref={forwardedRef}\n >\n <Icon\n icon={checked === 'indeterminate' ? 'ph--minus--regular' : 'ph--check--regular'}\n classNames={tx('input.checkboxIndicator', { size, checked })}\n />\n </CheckboxPrimitive.Root>\n );\n },\n);\n\nCheckbox.displayName = 'Input.Checkbox';\n\n//\n// Switch\n//\n\ntype SwitchProps = ThemedClassName<\n Omit<ComponentPropsWithRef<'input'>, 'children' | 'onChange'> & { onCheckedChange?: (checked: boolean) => void }\n>;\n\nconst Switch = forwardRef<HTMLInputElement, InputScopedProps<SwitchProps>>(\n (\n {\n __inputScope,\n classNames,\n checked: propsChecked,\n defaultChecked: propsDefaultChecked,\n onCheckedChange: propsOnCheckedChange,\n ...props\n },\n forwardedRef,\n ) => {\n const [checked, onCheckedChange] = useControllableState({\n prop: propsChecked,\n defaultProp: propsDefaultChecked ?? false,\n onChange: propsOnCheckedChange,\n });\n\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n\n return (\n <input\n type='checkbox'\n className={mx('dx-checkbox--switch dx-focus-ring', classNames)}\n checked={checked}\n onChange={(event) => {\n onCheckedChange(event.target.checked);\n }}\n id={id}\n aria-describedby={descriptionId}\n {...props}\n {...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n })}\n ref={forwardedRef}\n />\n );\n },\n);\n\nSwitch.displayName = 'Input.Switch';\n\n//\n// Date / Time / DateTime — segmented react-aria-components fields with locale-aware ordering,\n// spinbutton semantics, and immutable separators. ISO string API:\n// - Date `YYYY-MM-DD`\n// - Time `HH:mm`\n// - DateTime `YYYY-MM-DDTHH:mm`\n// Pair `Input.Date` or `Input.DateTime` with a sibling `Input.TriggerIcon` inside an\n// `Input.Root` to expose a calendar popover; `Input.Time` has no picker.\n//\n\nconst Time = SegmentedTime;\nconst Date = SegmentedDate;\nconst DateTime = SegmentedDateTime;\n\ntype TimeProps = SegmentedTimeProps;\ntype DateInputProps = SegmentedDateProps;\ntype DateTimeInputProps = SegmentedDateTimeProps;\n\n//\n// Input\n//\n\nexport const Input = {\n Root,\n TriggerIcon,\n PinInput,\n TextInput,\n TextArea,\n Time,\n Date,\n DateTime,\n Checkbox,\n Switch,\n Label,\n Description,\n Validation,\n DescriptionAndValidation,\n};\n\nexport { useInputTrigger };\n\nexport type {\n InputVariant,\n InputRootProps,\n InputSharedProps,\n PinInputProps,\n TextInputProps,\n TextAreaProps,\n TimeProps,\n DateInputProps,\n DateTimeInputProps,\n CheckboxProps,\n SwitchProps,\n LabelProps,\n DescriptionProps,\n ValidationProps,\n DescriptionAndValidationProps,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { CalendarDate, CalendarDateTime, Time, parseDate, parseDateTime, parseTime } from '@internationalized/date';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { forwardRef, useCallback, useState } from 'react';\nimport {\n DateField,\n type DateFieldProps,\n DateInput,\n DateSegment,\n TimeField,\n type TimeFieldProps,\n} from 'react-aria-components';\n\nimport { INPUT_NAME, type InputScopedProps, useInputContext } from '@dxos/react-input';\n\nimport { useDensityContext, useElevationContext, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { DatePicker } from '../DatePicker';\nimport { Popover } from '../Popover';\nimport { type InputSharedProps, useInputTrigger } from './Input';\n\n//\n// Value <-> @internationalized/date adapters.\n//\n\nconst tryParse = <T,>(parser: (input: string) => T, value: string | undefined): T | null => {\n if (!value) {\n return null;\n }\n try {\n return parser(value);\n } catch {\n return null;\n }\n};\n\nconst pad = (value: number, length = 2) => String(value).padStart(length, '0');\n\nconst formatCalendarDate = (date: CalendarDate): string => `${pad(date.year, 4)}-${pad(date.month)}-${pad(date.day)}`;\n\nconst formatCalendarDateTime = (datetime: CalendarDateTime): string =>\n `${pad(datetime.year, 4)}-${pad(datetime.month)}-${pad(datetime.day)}` +\n `T${pad(datetime.hour)}:${pad(datetime.minute)}`;\n\nconst formatTime = (time: Time): string => `${pad(time.hour)}:${pad(time.minute)}`;\n\nconst toCalendarDate = (date: Date) => new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());\n\n//\n// Theming.\n//\n\nconst fieldClass = 'inline-flex items-center gap-px font-mono tabular-nums focus-within:bg-attention-surface';\n\n// React Aria sets `caret-color: transparent` inline on each segment because spinbuttons replace\n// the whole value rather than inserting at a caret position. We override with `!important` so a\n// caret is visible while typing — friendlier UX even though it's slightly misleading mid-segment.\n//\n// `tabular-nums` on the field combined with `min-width` per segment keeps each segment a fixed\n// width regardless of value (so e.g. month `1` and `12` occupy the same space). `text-align: end`\n// right-aligns the digits within that fixed width.\n// TODO(burdon): Move to Input.theme.ts\nconst segmentClass =\n 'rounded-xs outline-none text-end [caret-color:currentColor]! ' +\n 'data-[type=year]:min-w-[4ch] ' +\n 'data-[type=month]:min-w-[2ch] data-[type=day]:min-w-[2ch] ' +\n 'data-[type=hour]:min-w-[2ch] data-[type=minute]:min-w-[2ch] ' +\n 'data-[placeholder]:text-subdued data-[type=literal]:text-subdued ' +\n 'data-[focused]:bg-accent-bg data-[focused]:text-accent-fg ' +\n 'data-[invalid]:text-rose-500 ' +\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50';\n\n// Match bidi format characters (LRI/RLI/PDI/LRE/RLE/PDF/LRO/RLO) that React Aria inserts to\n// isolate locale-formatted portions. These are invisible glyphs but the browser still gives\n// them ~4px of width, which pushes the first visible character of time-only fields out of\n// alignment with date fields. Keep them in the DOM (so directional isolation survives) but\n// collapse them to zero width.\nconst BIDI_FORMAT_RE = /^[‪-‮⁦-⁩]+$/;\n\n/**\n * Render a single DateSegment. Locale-specific literals between date and time portions\n * (e.g. en-US's `\", \"`) become a plain space; bidi format markers are kept but rendered\n * zero-width so the visible content lines up at the field's left edge.\n */\nconst renderSegment = (segment: { type: string; text: string }) => {\n if (segment.type === 'literal') {\n if (BIDI_FORMAT_RE.test(segment.text)) {\n // Render as a fixed-width spacer (between date and time portions of a datetime field),\n // but hide when at the field's edges — opening LRI is the first child of a time-only\n // field and would push everything right; closing PDI is the last child everywhere.\n return <span aria-hidden className='select-none w-[2ch] first:hidden last:hidden' />;\n }\n if (segment.text.includes(',')) {\n return (\n <span aria-hidden className='select-none'>\n {' '}\n </span>\n );\n }\n }\n return <DateSegment segment={segment as any} className={segmentClass} />;\n};\n\n//\n// Shared props.\n//\n\ntype SegmentedInputBaseProps = InputSharedProps &\n ThemedClassName<{\n id?: string;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n disabled?: boolean;\n autoFocus?: boolean;\n 'aria-label'?: string;\n }>;\n\ntype SegmentedTimeBearingProps = SegmentedInputBaseProps & {\n /** `24` (default) renders HH:mm; `12` renders hh:mm with an AM/PM segment. */\n hourCycle?: 12 | 24;\n};\n\n//\n// Internal helpers.\n//\n\nconst useFieldChrome = ({\n __inputScope,\n density: densityProp,\n elevation: elevationProp,\n}: {\n __inputScope?: any;\n density: InputSharedProps['density'];\n elevation: InputSharedProps['elevation'];\n}) => {\n const { tx } = useThemeContext();\n const density = useDensityContext(densityProp);\n const elevation = useElevationContext(elevationProp);\n const { id: contextId, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n return { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId };\n};\n\n/**\n * Wraps a field with `Popover.Anchor` and a `DatePicker.Root` whose open state is driven by\n * the surrounding `Input.Root`'s registered trigger. `Input.TriggerIcon` (a sibling under\n * `Input.Root`) calls the registered handler on press; the popover anchors to this field.\n */\nconst PickerWrapper = ({\n pickerValue,\n onPickerChange,\n withTime,\n disabled = false,\n children,\n calendar,\n}: {\n pickerValue: Date | undefined;\n onPickerChange: (next: Date | undefined) => void;\n withTime: boolean;\n disabled?: boolean;\n children: React.ReactNode;\n calendar: React.ReactNode;\n}) => {\n const [open, setOpen] = useState(false);\n const openPicker = useCallback(() => {\n if (!disabled) {\n setOpen(true);\n }\n }, [disabled]);\n useInputTrigger(disabled ? undefined : openPicker);\n return (\n <DatePicker.Root\n mode='single'\n withTime={withTime}\n value={pickerValue}\n onValueChange={disabled ? undefined : onPickerChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Popover.Anchor asChild>{children}</Popover.Anchor>\n <DatePicker.Content>{calendar}</DatePicker.Content>\n </DatePicker.Root>\n );\n};\n\n//\n// SegmentedDate.\n//\n\ntype SegmentedDateProps = SegmentedInputBaseProps;\n\nconst SegmentedDate = forwardRef<HTMLDivElement, InputScopedProps<SegmentedDateProps>>(\n (\n {\n __inputScope,\n classNames,\n density: densityProp,\n elevation: elevationProp,\n variant,\n value,\n defaultValue,\n onValueChange,\n disabled,\n autoFocus,\n id,\n 'aria-label': ariaLabel,\n },\n forwardedRef,\n ) => {\n const { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId } = useFieldChrome({\n __inputScope,\n density: densityProp,\n elevation: elevationProp,\n });\n\n const [stringValue, setStringValue] = useControllableState<string>({\n prop: value,\n defaultProp: defaultValue ?? '',\n onChange: onValueChange,\n });\n\n const parsed = tryParse(parseDate, stringValue);\n\n const fieldProps: DateFieldProps<CalendarDate> = {\n value: parsed,\n onChange: (next) => setStringValue(next ? formatCalendarDate(next) : ''),\n isDisabled: disabled,\n autoFocus,\n 'aria-label': ariaLabel ?? 'date',\n granularity: 'day',\n shouldForceLeadingZeros: true,\n };\n\n const field = (\n <DateField {...fieldProps}>\n <DateInput\n ref={forwardedRef}\n {...((id ?? contextId) ? { id: id ?? contextId } : {})}\n {...(descriptionId ? { 'aria-describedby': descriptionId } : {})}\n {...(validationValence === 'error' && errorMessageId\n ? { 'aria-invalid': true, 'aria-errormessage': errorMessageId }\n : {})}\n data-density={density}\n className={tx(\n 'input.input',\n { variant, disabled, density, elevation, validationValence },\n fieldClass,\n classNames,\n )}\n >\n {renderSegment}\n </DateInput>\n </DateField>\n );\n\n return (\n <PickerWrapper\n pickerValue={parsed ? new Date(parsed.year, parsed.month - 1, parsed.day) : undefined}\n onPickerChange={(next) => setStringValue(next ? formatCalendarDate(toCalendarDate(next)) : '')}\n withTime={false}\n disabled={disabled}\n calendar={<DatePicker.Calendar />}\n >\n {field}\n </PickerWrapper>\n );\n },\n);\nSegmentedDate.displayName = 'Input.SegmentedDate';\n\n//\n// SegmentedTime — no picker (no time-only picker primitive available); does not register a trigger.\n//\n\ntype SegmentedTimeProps = SegmentedTimeBearingProps;\n\nconst SegmentedTime = forwardRef<HTMLDivElement, InputScopedProps<SegmentedTimeProps>>(\n (\n {\n __inputScope,\n classNames,\n density: densityProp,\n elevation: elevationProp,\n variant,\n value,\n defaultValue,\n onValueChange,\n disabled,\n autoFocus,\n id,\n hourCycle = 24,\n 'aria-label': ariaLabel,\n },\n forwardedRef,\n ) => {\n const { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId } = useFieldChrome({\n __inputScope,\n density: densityProp,\n elevation: elevationProp,\n });\n\n const [stringValue, setStringValue] = useControllableState<string>({\n prop: value,\n defaultProp: defaultValue ?? '',\n onChange: onValueChange,\n });\n\n const parsed = tryParse(parseTime, stringValue);\n\n const fieldProps: TimeFieldProps<Time> = {\n value: parsed,\n onChange: (next) => setStringValue(next ? formatTime(next) : ''),\n isDisabled: disabled,\n autoFocus,\n 'aria-label': ariaLabel ?? 'time',\n granularity: 'minute',\n hourCycle,\n shouldForceLeadingZeros: true,\n };\n\n return (\n <TimeField {...fieldProps}>\n <DateInput\n ref={forwardedRef}\n {...((id ?? contextId) ? { id: id ?? contextId } : {})}\n {...(descriptionId ? { 'aria-describedby': descriptionId } : {})}\n {...(validationValence === 'error' && errorMessageId\n ? { 'aria-invalid': true, 'aria-errormessage': errorMessageId }\n : {})}\n data-density={density}\n className={tx(\n 'input.input',\n { variant, disabled, density, elevation, validationValence },\n fieldClass,\n classNames,\n )}\n >\n {renderSegment}\n </DateInput>\n </TimeField>\n );\n },\n);\nSegmentedTime.displayName = 'Input.SegmentedTime';\n\n//\n// SegmentedDateTime.\n//\n\ntype SegmentedDateTimeProps = SegmentedTimeBearingProps;\n\nconst SegmentedDateTime = forwardRef<HTMLDivElement, InputScopedProps<SegmentedDateTimeProps>>(\n (\n {\n __inputScope,\n classNames,\n density: densityProp,\n elevation: elevationProp,\n variant,\n value,\n defaultValue,\n onValueChange,\n disabled,\n autoFocus,\n id,\n hourCycle = 24,\n 'aria-label': ariaLabel,\n },\n forwardedRef,\n ) => {\n const { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId } = useFieldChrome({\n __inputScope,\n density: densityProp,\n elevation: elevationProp,\n });\n\n const [stringValue, setStringValue] = useControllableState<string>({\n prop: value,\n defaultProp: defaultValue ?? '',\n onChange: onValueChange,\n });\n\n const parsed = tryParse(parseDateTime, stringValue);\n\n const fieldProps: DateFieldProps<CalendarDateTime> = {\n value: parsed,\n onChange: (next) => setStringValue(next ? formatCalendarDateTime(next) : ''),\n isDisabled: disabled,\n autoFocus,\n 'aria-label': ariaLabel ?? 'date-time',\n granularity: 'minute',\n hourCycle,\n shouldForceLeadingZeros: true,\n };\n\n const field = (\n <DateField {...fieldProps}>\n <DateInput\n ref={forwardedRef}\n {...((id ?? contextId) ? { id: id ?? contextId } : {})}\n {...(descriptionId ? { 'aria-describedby': descriptionId } : {})}\n {...(validationValence === 'error' && errorMessageId\n ? { 'aria-invalid': true, 'aria-errormessage': errorMessageId }\n : {})}\n data-density={density}\n className={tx(\n 'input.input',\n { variant, disabled, density, elevation, validationValence },\n fieldClass,\n classNames,\n )}\n >\n {renderSegment}\n </DateInput>\n </DateField>\n );\n\n return (\n <PickerWrapper\n pickerValue={\n parsed ? new Date(parsed.year, parsed.month - 1, parsed.day, parsed.hour, parsed.minute) : undefined\n }\n onPickerChange={(next) =>\n setStringValue(\n next\n ? formatCalendarDateTime(\n new CalendarDateTime(\n next.getFullYear(),\n next.getMonth() + 1,\n next.getDate(),\n next.getHours(),\n next.getMinutes(),\n ),\n )\n : '',\n )\n }\n withTime\n disabled={disabled}\n calendar={<DatePicker.Calendar />}\n >\n {field}\n </PickerWrapper>\n );\n },\n);\nSegmentedDateTime.displayName = 'Input.SegmentedDateTime';\n\nexport { SegmentedDate, SegmentedTime, SegmentedDateTime };\n\nexport type { SegmentedDateProps, SegmentedTimeProps, SegmentedDateTimeProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithoutRef, type FC, type ForwardRefExoticComponent, forwardRef } from 'react';\n\nimport {\n LIST_ITEM_NAME,\n LIST_NAME,\n ListItemCollapsibleContent,\n type ListItemCollapsibleContentProps,\n type ListItemScopedProps,\n List as ListPrimitive,\n ListItem as ListPrimitiveItem,\n ListItemHeading as ListPrimitiveItemHeading,\n type ListItemHeadingProps as ListPrimitiveItemHeadingProps,\n ListItemOpenTrigger as ListPrimitiveItemOpenTrigger,\n type ListItemOpenTriggerProps as ListPrimitiveItemOpenTriggerProps,\n type ListItemProps as ListPrimitiveItemProps,\n type ListProps as ListPrimitiveProps,\n type ListScopedProps,\n useListContext,\n useListItemContext,\n} from '@dxos/react-list';\nimport { type Density } from '@dxos/ui-types';\n\nimport { useDensityContext, useThemeContext } from '../../hooks';\nimport { DensityProvider } from '../../primitives';\nimport { composable, composableProps } from '../../util';\nimport { type ThemedClassName } from '../../util';\nimport { Icon } from '../Icon';\nimport { ListDropIndicator } from './ListDropIndicator';\n\ntype ListProps = ThemedClassName<ListPrimitiveProps & { density?: Density }>;\n\nconst List = composable<HTMLOListElement, ListProps>(({ children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const density = useDensityContext(props.density);\n const { className, ...rest } = composableProps(props);\n\n return (\n <DensityProvider density={density}>\n <ListPrimitive {...rest} className={tx('list.root', {}, className)} ref={forwardedRef}>\n {children}\n </ListPrimitive>\n </DensityProvider>\n );\n});\n\ntype ListItemEndcapProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & { asChild?: boolean };\n\nconst ListItemEndcap = forwardRef<HTMLDivElement, ListItemEndcapProps>(\n ({ children, classNames, asChild, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : Primitive.div;\n const density = useDensityContext();\n const { tx } = useThemeContext();\n return (\n <Comp\n {...(!asChild && { role: 'none' })}\n {...props}\n className={tx('list.item.endcap', { density }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\nconst MockListItemOpenTrigger = ({\n classNames,\n ...props\n}: ThemedClassName<Omit<ComponentPropsWithoutRef<'div'>, 'children'>>) => {\n const density = useDensityContext();\n const { tx } = useThemeContext();\n return <div {...props} className={tx('list.item.openTrigger', { density }, classNames)} />;\n};\n\ntype ListItemHeadingProps = ThemedClassName<ListPrimitiveItemHeadingProps>;\n\nconst ListItemHeading = forwardRef<HTMLParagraphElement, ListItemHeadingProps>(\n ({ children, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const density = useDensityContext();\n return (\n <ListPrimitiveItemHeading\n {...props}\n className={tx('list.item.heading', { density }, classNames)}\n ref={forwardedRef}\n >\n <span>{children}</span>\n </ListPrimitiveItemHeading>\n );\n },\n);\n\ntype ListItemOpenTriggerProps = ThemedClassName<ListPrimitiveItemOpenTriggerProps>;\n\nconst ListItemOpenTrigger = forwardRef<HTMLButtonElement, ListItemOpenTriggerProps>(\n ({ __listItemScope, classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const density = useDensityContext();\n const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);\n return (\n <ListPrimitiveItemOpenTrigger\n {...props}\n className={tx('list.item.openTrigger', { density }, classNames)}\n ref={forwardedRef}\n >\n {children || (\n <Icon\n size={3}\n icon={open ? 'ph--caret-down--bold' : 'ph--caret-right--bold'}\n classNames={tx('list.item.openTriggerIcon', {})}\n />\n )}\n </ListPrimitiveItemOpenTrigger>\n );\n },\n);\n\ntype ListItemRootProps = ThemedClassName<ListPrimitiveItemProps>;\n\nconst ListItemRoot = forwardRef<HTMLLIElement, ListItemRootProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const density = useDensityContext();\n return (\n <ListPrimitiveItem\n {...props}\n className={tx('list.item.root', { density, collapsible: props.collapsible }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </ListPrimitiveItem>\n );\n },\n);\n\nexport const ListItem: {\n Root: ForwardRefExoticComponent<ListItemRootProps>;\n Endcap: ForwardRefExoticComponent<ListItemEndcapProps>;\n Heading: ForwardRefExoticComponent<ListItemHeadingProps>;\n OpenTrigger: ForwardRefExoticComponent<ListItemOpenTriggerProps>;\n CollapsibleContent: ForwardRefExoticComponent<ListItemCollapsibleContentProps>;\n MockOpenTrigger: FC<ThemedClassName<Omit<ComponentPropsWithoutRef<'div'>, 'children'>>>;\n DropIndicator: typeof ListDropIndicator;\n} = {\n Root: ListItemRoot,\n Endcap: ListItemEndcap,\n Heading: ListItemHeading,\n OpenTrigger: ListItemOpenTrigger,\n CollapsibleContent: ListItemCollapsibleContent,\n MockOpenTrigger: MockListItemOpenTrigger,\n DropIndicator: ListDropIndicator,\n};\n\nexport { List, useListContext, useListItemContext, LIST_NAME, LIST_ITEM_NAME };\n\nexport type {\n ListProps,\n ListScopedProps,\n ListItemRootProps,\n ListItemScopedProps,\n ListItemEndcapProps,\n ListItemHeadingProps,\n ListItemOpenTriggerProps,\n ListItemCollapsibleContentProps,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport React, { type CSSProperties, type HTMLAttributes } from 'react';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nconst edgeToOrientationMap: Record<Edge, Orientation> = {\n top: 'horizontal',\n bottom: 'horizontal',\n left: 'vertical',\n right: 'vertical',\n};\n\nconst orientationStyles: Record<Orientation, HTMLAttributes<HTMLElement>['className']> = {\n horizontal:\n 'h-(--line-thickness) left-[calc(var(--line-inset)+var(--terminal-radius))] right-(--line-inset) before:left-(--terminal-inset)',\n vertical:\n 'w-(--line-thickness) top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-(--line-inset) before:top-(--terminal-inset)',\n};\n\nconst edgeStyles: Record<Edge, HTMLAttributes<HTMLElement>['className']> = {\n top: 'top-(--line-offset) before:top-(--offset-terminal)',\n right: 'right-(--line-offset) before:right-(--offset-terminal)',\n bottom: 'bottom-(--line-offset) before:bottom-(--offset-terminal)',\n left: 'left-(--line-offset) before:left-(--offset-terminal)',\n};\n\nconst strokeSize = 2;\nconst terminalSize = 8;\nconst offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;\n\nexport type DropIndicatorProps = {\n edge: Edge;\n gap?: number;\n terminalInset?: number;\n lineInset?: number;\n};\n\n/**\n * This is a tailwind port of `@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box`\n */\nexport const ListDropIndicator = ({\n edge,\n gap = 0,\n lineInset = 0,\n terminalInset = lineInset - terminalSize,\n}: DropIndicatorProps) => {\n const orientation = edgeToOrientationMap[edge];\n\n return (\n <div\n style={\n {\n '--line-thickness': `${strokeSize}px`,\n '--line-offset': `calc(-0.5 * (${gap}px + ${strokeSize}px))`,\n '--line-inset': `${lineInset}px`,\n '--terminal-size': `${terminalSize}px`,\n '--terminal-radius': `${terminalSize / 2}px`,\n '--terminal-inset': `${terminalInset}px`,\n '--offset-terminal': `${offsetToAlignTerminalWithLine}px`,\n } as CSSProperties\n }\n className={`absolute z-10 pointer-events-none bg-accent-bg before:content-[''] before:w-(--terminal-size) before:h-(--terminal-size) box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accent-bg before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`}\n />\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef, type FC, type ForwardRefExoticComponent, forwardRef } from 'react';\n\nimport { type ThemedClassName } from '../../util';\nimport {\n LIST_ITEM_NAME,\n List,\n ListItem,\n type ListItemCollapsibleContentProps,\n type ListItemHeadingProps,\n type ListItemOpenTriggerProps,\n type ListItemRootProps,\n type ListProps,\n type ListScopedProps,\n useListItemContext,\n} from './List';\nimport { TreeDropIndicator } from './TreeDropIndicator';\n\ntype TreeRootProps = ListProps;\n\ntype TreeItemProps = ListItemRootProps;\n\nconst TreeRoot = forwardRef<HTMLOListElement, TreeRootProps>((props, forwardedRef) => {\n return <List {...props} ref={forwardedRef} />;\n});\n\ntype TreeBranchProps = TreeRootProps;\n\nconst TreeBranch = forwardRef<HTMLOListElement, ListScopedProps<TreeBranchProps>>(\n ({ __listScope, ...props }, forwardedRef) => {\n const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);\n return <List {...props} aria-labelledby={headingId} ref={forwardedRef} />;\n },\n);\n\nconst TreeItemRoot = forwardRef<HTMLLIElement, ListItemRootProps>((props, forwardedRef) => {\n return <ListItem.Root role='treeitem' {...props} ref={forwardedRef} />;\n});\n\ntype TreeItemHeadingProps = ListItemHeadingProps;\n\nconst TreeItemHeading = ListItem.Heading;\n\ntype TreeItemOpenTriggerProps = ListItemOpenTriggerProps;\n\nconst TreeItemOpenTrigger = ListItem.OpenTrigger;\n\nconst MockTreeItemOpenTrigger = ListItem.MockOpenTrigger;\n\ntype TreeItemBodyProps = ListItemCollapsibleContentProps;\n\nconst TreeItemBody: ForwardRefExoticComponent<TreeItemBodyProps> = ListItem.CollapsibleContent;\n\nexport const Tree = { Root: TreeRoot, Branch: TreeBranch };\nexport const TreeItem: {\n Root: ForwardRefExoticComponent<TreeItemProps>;\n Heading: ForwardRefExoticComponent<TreeItemHeadingProps>;\n Body: ForwardRefExoticComponent<TreeItemBodyProps>;\n OpenTrigger: ForwardRefExoticComponent<TreeItemOpenTriggerProps>;\n MockOpenTrigger: FC<ThemedClassName<Omit<ComponentPropsWithoutRef<'div'>, 'children'>>>;\n DropIndicator: typeof TreeDropIndicator;\n} = {\n Root: TreeItemRoot,\n Heading: TreeItemHeading,\n Body: TreeItemBody,\n OpenTrigger: TreeItemOpenTrigger,\n MockOpenTrigger: MockTreeItemOpenTrigger,\n DropIndicator: TreeDropIndicator,\n};\n\nexport type { TreeRootProps, TreeItemProps, TreeItemHeadingProps, TreeItemBodyProps, TreeItemOpenTriggerProps };\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport React, { type CSSProperties, type HTMLAttributes } from 'react';\n\n// Tree item hitbox\n// https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx#tree-item\n\ntype InstructionType = Exclude<Instruction, { type: 'instruction-blocked' }>['type'];\ntype Orientation = 'sibling' | 'child';\n\nconst edgeToOrientationMap: Record<InstructionType, Orientation> = {\n 'reorder-above': 'sibling',\n 'reorder-below': 'sibling',\n 'make-child': 'child',\n reparent: 'child',\n};\n\nconst orientationStyles: Record<Orientation, HTMLAttributes<HTMLElement>['className']> = {\n // TODO(wittjosiah): Stop using left/right here.\n sibling:\n 'h-(--line-thickness) left-(--horizontal-indent) right-0 bg-accent-bg before:left-(--negative-terminal-size)',\n child: 'inset-0 border-[length:var(--line-thickness)] before:invisible',\n};\n\nconst instructionStyles: Record<InstructionType, HTMLAttributes<HTMLElement>['className']> = {\n 'reorder-above': 'top-(--line-offset) before:top-(--offset-terminal)',\n 'reorder-below': 'bottom-(--line-offset) before:bottom-(--offset-terminal)',\n 'make-child': 'border-accent-bg',\n // TODO(wittjosiah): This is not occurring in the current implementation.\n reparent: '',\n};\n\nconst strokeSize = 2;\nconst terminalSize = 8;\nconst offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;\n\nexport type DropIndicatorProps = {\n instruction: Instruction;\n gap?: number;\n};\n\nexport const TreeDropIndicator = ({ instruction, gap = 0 }: DropIndicatorProps) => {\n const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize}px))`;\n const isBlocked = instruction.type === 'instruction-blocked';\n const desiredInstruction = isBlocked ? instruction.desired : instruction;\n const orientation = edgeToOrientationMap[desiredInstruction.type];\n if (isBlocked) {\n return null;\n }\n\n return (\n <div\n style={\n {\n '--line-thickness': `${strokeSize}px`,\n '--line-offset': `${lineOffset}`,\n '--terminal-size': `${terminalSize}px`,\n '--terminal-radius': `${terminalSize / 2}px`,\n '--negative-terminal-size': `-${terminalSize}px`,\n '--offset-terminal': `${offsetToAlignTerminalWithLine}px`,\n '--horizontal-indent': `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`,\n } as CSSProperties\n }\n className={`absolute z-10 pointer-events-none before:w-(--terminal-size) before:h-(--terminal-size) box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accent-bg before:rounded-full ${orientationStyles[orientation]} ${instructionStyles[desiredInstruction.type]}`}\n ></div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { type Scope, createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type CSSProperties,\n type ComponentPropsWithRef,\n type KeyboardEvent,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { composable, composableProps } from '../../util';\nimport { type ThemedClassName } from '../../util';\n\n// TODO(thure): https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/treegrid_role\n\nconst TREEGRID_ROW_NAME = 'Treegrid.Row';\n\ntype TreegridRowScopedProps<P> = P & { __treegridRowScope?: Scope };\n\nconst [createTreegridRowContext, createTreegridRowScope] = createContextScope(TREEGRID_ROW_NAME, []);\n\ntype TreegridRowContextValue = {\n open?: boolean;\n onOpenChange?: (nextOpen: boolean) => void;\n};\n\nconst [TreegridRowProvider, useTreegridRowContext] =\n createTreegridRowContext<TreegridRowContextValue>(TREEGRID_ROW_NAME);\n\n// TODO(burdon): Replace with functions.\nexport const TREEGRID_PATH_SEPARATOR = '~';\nexport const TREEGRID_PARENT_OF_SEPARATOR = ' ';\n\ntype TreegridRootProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n gridTemplateColumns?: CSSProperties['gridTemplateColumns'];\n asChild?: boolean;\n};\n\nconst TreegridRoot = composable<HTMLDivElement, TreegridRootProps>(\n ({ asChild, classNames, children, style, gridTemplateColumns, onKeyDown: onKeyDownProp, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { className, role: _role, ...rest } = composableProps<HTMLDivElement>(props, { classNames });\n const Comp = asChild ? Slot : Primitive.div;\n const { findFirstFocusable } = useFocusFinders();\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n const direction = event.key === 'ArrowDown' ? 'down' : 'up';\n const target = event.target as HTMLElement;\n\n // Find ancestor with data-arrow-keys containing the relevant direction.\n const ancestorWithArrowKeys = target.closest(`[data-arrow-keys*=\"${direction}\"], [data-arrow-keys=\"all\"]`);\n\n // If no ancestor with data-arrow-keys found, proceed with row navigation.\n if (!ancestorWithArrowKeys) {\n // Find the closest row\n const currentRow = target.closest('[role=\"row\"]');\n if (currentRow) {\n // Find the treegrid container.\n const treegrid = currentRow.closest('[role=\"treegrid\"]');\n if (treegrid) {\n // Get all rows in the treegrid.\n const rows = Array.from(treegrid.querySelectorAll('[role=\"row\"]'));\n const currentIndex = rows.indexOf(currentRow as Element);\n\n // Find next or previous row.\n const nextIndex = direction === 'down' ? currentIndex + 1 : currentIndex - 1;\n const targetRow = rows[nextIndex];\n\n if (targetRow) {\n // Focus the first focusable element in the target row.\n const firstFocusable = findFirstFocusable(targetRow as HTMLElement);\n if (firstFocusable) {\n event.preventDefault();\n firstFocusable.focus();\n }\n }\n }\n }\n }\n break;\n }\n }\n onKeyDownProp?.(event);\n },\n [findFirstFocusable, onKeyDownProp],\n );\n\n return (\n <Comp\n role='treegrid'\n {...rest}\n className={tx('treegrid.root', {}, className)}\n style={{ ...style, gridTemplateColumns }}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\ntype TreegridRowProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n id: string;\n asChild?: boolean;\n parentOf?: string;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n};\n\nconst TreegridRow = forwardRef<HTMLDivElement, TreegridRowScopedProps<TreegridRowProps>>(\n (\n {\n __treegridRowScope,\n asChild,\n classNames,\n children,\n id,\n parentOf,\n open: propsOpen,\n defaultOpen,\n onOpenChange: propsOnOpenChange,\n ...props\n },\n forwardedRef,\n ) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.div;\n const pathParts = id.split(TREEGRID_PATH_SEPARATOR);\n const level = pathParts.length - 1;\n const [open, onOpenChange] = useControllableState({\n prop: propsOpen,\n onChange: propsOnOpenChange,\n defaultProp: defaultOpen,\n });\n\n return (\n <TreegridRowProvider open={open} onOpenChange={onOpenChange} scope={__treegridRowScope}>\n <Comp\n role='row'\n aria-level={level}\n className={tx('treegrid.row', { level }, classNames)}\n {...(parentOf && { 'aria-expanded': open, 'aria-owns': parentOf })}\n {...props}\n id={id}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n </TreegridRowProvider>\n );\n },\n);\n\ntype TreegridCellProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & { indent?: boolean };\n\nconst TreegridCell = forwardRef<HTMLDivElement, TreegridCellProps>(\n ({ classNames, children, indent, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <div role='gridcell' className={tx('treegrid.cell', { indent }, classNames)} {...props} ref={forwardedRef}>\n {children}\n </div>\n );\n },\n);\n\nexport type { TreegridRootProps, TreegridRowProps };\n\nexport const Treegrid = {\n Root: TreegridRoot,\n Row: TreegridRow,\n Cell: TreegridCell,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { createContext } from '@radix-ui/react-context';\nimport { DialogContent, Root as DialogRoot, DialogTitle } from '@radix-ui/react-dialog';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, {\n type ComponentPropsWithRef,\n type ComponentPropsWithoutRef,\n type Dispatch,\n type KeyboardEvent,\n type PropsWithChildren,\n type SetStateAction,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { log } from '@dxos/log';\nimport { useForwardedRef, useMediaQuery } from '@dxos/react-hooks';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { useThemeContext } from '../../hooks';\nimport { type Label, toLocalizedString, useTranslation } from '../../primitives';\nimport { type MainStyleProps } from '../../theme';\nimport { type ThemedClassName } from '../../util';\nimport { useSwipeToDismiss } from './useSwipeToDismiss';\n\nconst MAIN_NAME = 'Main';\nconst MAIN_ROOT_NAME = 'Main.Root';\nconst MAIN_OVERLAY_NAME = 'Main.Overlay';\nconst MAIN_CONTENT_NAME = 'Main.Content';\nconst NAVIGATION_SIDEBAR_NAME = 'Main.NavigationSidebar';\nconst COMPLEMENTARY_SIDEBAR_NAME = 'Main.ComplementarySidebar';\n\nconst handleOpenAutoFocus = (event: Event) => {\n !document.body.hasAttribute('data-w-keyboard') && event.preventDefault();\n};\n\n//\n// Landmark\n//\n\nconst landmarkAttr = 'data-main-landmark';\n\n/**\n * Facilitates moving focus between landmarks.\n * Ref https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role\n */\nconst useLandmarkMover = (propsOnKeyDown: ComponentPropsWithoutRef<'div'>['onKeyDown'], landmark: string) => {\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target as HTMLDivElement;\n if (event.target === event.currentTarget && event.key === 'Tab' && target.hasAttribute(landmarkAttr)) {\n event.preventDefault();\n const landmarks = Array.from(document.querySelectorAll(`[${landmarkAttr}]:not([inert])`))\n .map((el) => (el.hasAttribute(landmarkAttr) ? parseInt(el.getAttribute(landmarkAttr)!) : NaN))\n .sort();\n const l = landmarks.length;\n const cursor = landmarks.indexOf(parseInt(target.getAttribute(landmarkAttr)!));\n const nextLandmark = landmarks[(cursor + l + (event.getModifierState('Shift') ? -1 : 1)) % l];\n (document.querySelector(`[${landmarkAttr}=\"${nextLandmark}\"]`) as HTMLDivElement | null)?.focus();\n }\n propsOnKeyDown?.(event);\n },\n [propsOnKeyDown],\n );\n\n // TODO(thure): This was disconnected once before in #8818;\n // if this should change again to support the browser extension, please ensure the change doesn’t break web, desktop and mobile.\n const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited', ignoreDefaultKeydown: { Tab: true } });\n\n return {\n [landmarkAttr]: landmark,\n tabIndex: 0,\n onKeyDown: handleKeyDown,\n ...focusableGroupAttrs,\n };\n};\n\n//\n// Context\n//\n\n// TODO(burdon): Define collapsed state.\ntype SidebarState = 'expanded' | 'collapsed' | 'closed';\n\ntype MainContextValue = {\n resizing: boolean;\n\n // Navigation\n navigationSidebarState: SidebarState;\n setNavigationSidebarState: Dispatch<SetStateAction<SidebarState | undefined>>;\n\n // Complementary\n complementarySidebarState: SidebarState;\n setComplementarySidebarState: Dispatch<SetStateAction<SidebarState | undefined>>;\n};\n\nconst [MainProvider, useMainContext] = createContext<MainContextValue>(MAIN_NAME, {\n resizing: false,\n\n navigationSidebarState: 'closed',\n setNavigationSidebarState: (_nextState) => {\n log.warn('Not initialized');\n },\n\n complementarySidebarState: 'closed',\n setComplementarySidebarState: (_nextState) => {\n log.warn('Not initialized');\n },\n});\n\nconst useSidebars = (consumerName: string) => {\n const {\n navigationSidebarState,\n setNavigationSidebarState,\n\n complementarySidebarState,\n setComplementarySidebarState,\n } = useMainContext(consumerName);\n\n return {\n navigationSidebarState,\n setNavigationSidebarState,\n toggleNavigationSidebar: useCallback(\n () => setNavigationSidebarState(navigationSidebarState === 'expanded' ? 'closed' : 'expanded'),\n [navigationSidebarState, setNavigationSidebarState],\n ),\n openNavigationSidebar: useCallback(() => setNavigationSidebarState('expanded'), []),\n collapseNavigationSidebar: useCallback(() => setNavigationSidebarState('collapsed'), []),\n closeNavigationSidebar: useCallback(() => setNavigationSidebarState('closed'), []),\n\n complementarySidebarState,\n setComplementarySidebarState,\n toggleComplementarySidebar: useCallback(\n () => setComplementarySidebarState(complementarySidebarState === 'expanded' ? 'closed' : 'expanded'),\n [complementarySidebarState, setComplementarySidebarState],\n ),\n openComplementarySidebar: useCallback(() => setComplementarySidebarState('expanded'), []),\n collapseComplementarySidebar: useCallback(() => setComplementarySidebarState('collapsed'), []),\n closeComplementarySidebar: useCallback(() => setComplementarySidebarState('closed'), []),\n };\n};\n\n//\n// Root\n//\n\ntype MainRootProps = PropsWithChildren<{\n navigationSidebarState?: SidebarState;\n defaultNavigationSidebarState?: SidebarState;\n onNavigationSidebarStateChange?: (nextState: SidebarState) => void;\n\n complementarySidebarState?: SidebarState;\n defaultComplementarySidebarState?: SidebarState;\n onComplementarySidebarStateChange?: (nextState: SidebarState) => void;\n}>;\n\nconst MainRoot = ({\n navigationSidebarState: propsNavigationSidebarState,\n defaultNavigationSidebarState = 'closed',\n onNavigationSidebarStateChange,\n\n complementarySidebarState: propsComplementarySidebarState,\n defaultComplementarySidebarState = 'closed',\n onComplementarySidebarStateChange,\n\n children,\n ...props\n}: MainRootProps) => {\n const [isLg] = useMediaQuery('lg');\n const [navigationSidebarState = isLg ? 'expanded' : 'collapsed', setNavigationSidebarState] =\n useControllableState<SidebarState>({\n prop: propsNavigationSidebarState,\n defaultProp: defaultNavigationSidebarState,\n onChange: onNavigationSidebarStateChange,\n });\n const [complementarySidebarState = isLg ? 'expanded' : 'collapsed', setComplementarySidebarState] =\n useControllableState<SidebarState>({\n prop: propsComplementarySidebarState,\n defaultProp: defaultComplementarySidebarState,\n onChange: onComplementarySidebarStateChange,\n });\n\n const [resizing, setResizing] = useState(false);\n const resizeInterval = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () =>\n addEventListener(window, 'resize', () => {\n setResizing(true);\n if (resizeInterval.current) {\n clearTimeout(resizeInterval.current);\n }\n\n resizeInterval.current = setTimeout(() => {\n setResizing(false);\n resizeInterval.current = null;\n }, 3_000);\n }),\n [],\n );\n\n return (\n <MainProvider\n {...props}\n {...{\n navigationSidebarState,\n setNavigationSidebarState,\n complementarySidebarState,\n setComplementarySidebarState,\n }}\n resizing={resizing}\n >\n {children}\n </MainProvider>\n );\n};\n\nMainRoot.displayName = MAIN_ROOT_NAME;\n\n//\n// Overlay\n//\n\ntype MainOverlayProps = ThemedClassName<Omit<ComponentPropsWithRef<typeof Primitive.div>, 'children' | 'onClick'>>;\n\nconst MainOverlay = forwardRef<HTMLDivElement, MainOverlayProps>(({ classNames, ...props }, forwardedRef) => {\n const [isLg] = useMediaQuery('lg');\n const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } =\n useMainContext(MAIN_OVERLAY_NAME);\n const { tx } = useThemeContext();\n return (\n <div\n {...props}\n onClick={() => {\n setNavigationSidebarState('collapsed');\n setComplementarySidebarState('collapsed');\n }}\n className={tx(\n 'main.overlay',\n {\n isLg,\n inlineStartSidebarOpen: navigationSidebarState,\n inlineEndSidebarOpen: complementarySidebarState,\n },\n classNames,\n )}\n data-state={navigationSidebarState === 'expanded' || complementarySidebarState === 'expanded' ? 'open' : 'closed'}\n aria-hidden='true'\n ref={forwardedRef}\n />\n );\n});\n\nMainOverlay.displayName = MAIN_OVERLAY_NAME;\n\n//\n// Sidebar\n//\n\ntype MainSidebarProps = ThemedClassName<ComponentPropsWithRef<typeof DialogContent>> & {\n swipeToDismiss?: boolean;\n state?: SidebarState;\n resizing?: boolean;\n onStateChange?: (nextState: SidebarState) => void;\n side: 'w-start' | 'w-end';\n label: Label;\n};\n\nconst MainSidebar = forwardRef<HTMLDivElement, MainSidebarProps>(\n (\n { classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props },\n forwardedRef,\n ) => {\n const [isLg] = useMediaQuery('lg');\n const { tx } = useThemeContext();\n const { t } = useTranslation(osTranslations);\n const ref = useForwardedRef(forwardedRef);\n const noopRef = useRef(null);\n\n useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {\n onDismiss: () => onStateChange?.('closed'),\n });\n\n // NOTE(thure): This is a workaround for something further down the tree grabbing focus on Escape. Adding this\n // intervention to `Tabs.Root` or `Tabs.Tabpenel` instances is somehow ineffectual.\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n const focusGroupParent = (event.target as HTMLElement).closest('[data-tabster]');\n if (event.key === 'Escape' && focusGroupParent) {\n event.preventDefault();\n event.stopPropagation();\n (focusGroupParent as HTMLElement).focus();\n }\n props.onKeyDown?.(event);\n },\n [props.onKeyDown],\n );\n\n const Root = isLg ? Primitive.div : DialogContent;\n\n return (\n <DialogRoot open={state !== 'closed'} aria-label={toLocalizedString(label, t)} modal={false}>\n {!isLg && <DialogTitle className='sr-only'>{toLocalizedString(label, t)}</DialogTitle>}\n <Root\n {...(!isLg && { forceMount: true, tabIndex: -1, onOpenAutoFocus: onOpenAutoFocus ?? handleOpenAutoFocus })}\n {...(state === 'closed' && { inert: true })}\n {...props}\n data-side={side === 'w-end' ? 'ie' : 'is'}\n data-state={state}\n data-resizing={resizing ? 'true' : 'false'}\n className={tx('main.sidebar', {}, classNames)}\n onKeyDownCapture={handleKeyDown}\n ref={ref}\n >\n {children}\n </Root>\n </DialogRoot>\n );\n },\n);\n\n//\n// Navigation Sidebar\n//\n\ntype MainNavigationSidebarProps = Omit<MainSidebarProps, 'expanded' | 'side'>;\n\nconst MainNavigationSidebar = forwardRef<HTMLDivElement, MainNavigationSidebarProps>((props, forwardedRef) => {\n const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);\n const mover = useLandmarkMover(props.onKeyDown, '0');\n\n return (\n <MainSidebar\n {...mover}\n {...props}\n state={navigationSidebarState}\n onStateChange={setNavigationSidebarState}\n resizing={resizing}\n side='w-start'\n ref={forwardedRef}\n />\n );\n});\n\nMainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;\n\n//\n// Complementary Sidebar\n//\n\ntype MainComplementarySidebarProps = Omit<MainSidebarProps, 'expanded' | 'side'>;\n\nconst MainComplementarySidebar = forwardRef<HTMLDivElement, MainComplementarySidebarProps>((props, forwardedRef) => {\n const { complementarySidebarState, setComplementarySidebarState, resizing } =\n useMainContext(COMPLEMENTARY_SIDEBAR_NAME);\n const mover = useLandmarkMover(props.onKeyDown, '2');\n\n return (\n <MainSidebar\n {...mover}\n {...props}\n state={complementarySidebarState}\n onStateChange={setComplementarySidebarState}\n resizing={resizing}\n side='w-end'\n ref={forwardedRef}\n />\n );\n});\n\nMainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;\n\n//\n// Content\n//\n\ntype MainContentProps = ThemedClassName<\n ComponentPropsWithRef<typeof Primitive.div> &\n MainStyleProps & {\n asChild?: boolean;\n }\n>;\n\nconst MainContent = forwardRef<HTMLDivElement, MainContentProps>(\n ({ asChild, classNames, bounce, handlesFocus, children, role, ...props }: MainContentProps, forwardedRef) => {\n const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : role ? Primitive.div : 'main';\n const mover = useLandmarkMover(props.onKeyDown, '1');\n\n return (\n <Comp\n {...(handlesFocus && { ...mover })}\n {...props}\n role={role}\n data-sidebar-left-state={navigationSidebarState}\n data-sidebar-right-state={complementarySidebarState}\n data-handles-focus={handlesFocus}\n className={tx('main.content', { bounce, handlesFocus }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\nMainContent.displayName = MAIN_CONTENT_NAME;\n\n//\n// Main\n//\n\nexport const Main = {\n Root: MainRoot,\n Overlay: MainOverlay,\n Content: MainContent,\n NavigationSidebar: MainNavigationSidebar,\n ComplementarySidebar: MainComplementarySidebar,\n};\n\nexport { useMainContext, useSidebars, useLandmarkMover };\n\nexport type { MainRootProps, MainOverlayProps, MainContentProps, MainNavigationSidebarProps, SidebarState };\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// This implementation is based upon https://github.com/hosembafer/react-swipe-to-dismiss, commit d88deafe910a6bd1400cf8fa90459a76cf4f71d3\n\nimport { type RefObject, useCallback, useEffect, useState } from 'react';\n\nenum MotionState {\n IDLE,\n DEBOUNCING,\n FOLLOWING,\n}\n\ntype Options = Partial<{\n onDismiss: () => void;\n dismissThreshold: number;\n debounceThreshold: number;\n side: 'inline-start' | 'inline-end';\n offset: number;\n}>;\n\nexport const useSwipeToDismiss = (\n ref: RefObject<HTMLElement | null>,\n { onDismiss, dismissThreshold = 64, debounceThreshold = 8, offset = 0 /* side = 'inline-start' */ }: Options,\n) => {\n const $root = ref.current;\n // todo(thure): Implement other sides.\n // const dK = direction === 'inline-start' ? 1 : -1;\n\n const [motionState, setMotionState] = useState<MotionState>(MotionState.IDLE);\n const [gestureStartX, setGestureStartX] = useState(0);\n\n const setIdle = useCallback(() => {\n setMotionState(MotionState.IDLE);\n $root?.style.removeProperty('inset-inline-start');\n $root?.style.setProperty('transition-duration', '200ms');\n }, [$root]);\n\n const setFollowing = useCallback(() => {\n setMotionState(MotionState.FOLLOWING);\n $root?.style.setProperty('transition-duration', '0ms');\n }, [$root]);\n\n const handlePointerDown = useCallback(\n ({ screenX }: PointerEvent) => {\n if (motionState === MotionState.IDLE) {\n setMotionState(MotionState.DEBOUNCING);\n setGestureStartX(screenX);\n }\n },\n [motionState],\n );\n\n const handlePointerMove = useCallback(\n ({ screenX }: PointerEvent) => {\n if ($root) {\n const delta = Math.min(screenX - gestureStartX, 0);\n switch (motionState) {\n case MotionState.FOLLOWING:\n if (Math.abs(delta) > dismissThreshold) {\n setIdle();\n onDismiss?.();\n } else {\n $root.style.setProperty('inset-inline-start', `${offset + delta}px`);\n }\n break;\n case MotionState.DEBOUNCING:\n if (Math.abs(delta) > debounceThreshold) {\n setFollowing();\n }\n break;\n }\n }\n },\n [$root, motionState, gestureStartX],\n );\n\n const handlePointerUp = useCallback(() => {\n setIdle();\n }, [setIdle]);\n\n useEffect(() => {\n $root?.addEventListener('pointerdown', handlePointerDown);\n return () => {\n $root?.removeEventListener('pointerdown', handlePointerDown);\n };\n }, [$root, handlePointerDown]);\n\n useEffect(() => {\n $root && document.documentElement.addEventListener('pointermove', handlePointerMove);\n return () => {\n document.documentElement.removeEventListener('pointermove', handlePointerMove);\n };\n }, [$root, handlePointerMove]);\n\n useEffect(() => {\n $root && document.documentElement.addEventListener('pointerup', handlePointerUp);\n return () => {\n document.documentElement.removeEventListener('pointerup', handlePointerUp);\n };\n }, [$root, handlePointerUp]);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type CSSProperties, type ComponentPropsWithRef, forwardRef } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { useId } from '@dxos/react-hooks';\nimport { type Elevation, type MessageValence } from '@dxos/ui-types';\n\nimport { translationKey } from '#translations';\n\nimport { useElevationContext, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { IconButton } from '../Button';\nimport { Column } from '../Column';\nimport { Icon } from '../Icon';\n\nconst messageIcons: Record<MessageValence, string> = {\n success: 'ph--check-circle--duotone',\n info: 'ph--info--duotone',\n warning: 'ph--warning--duotone',\n error: 'ph--warning-circle--duotone',\n neutral: 'ph--info--duotone',\n};\n\ntype MessageRootProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {\n valence?: MessageValence;\n elevation?: Elevation;\n asChild?: boolean;\n titleId?: string;\n descriptionId?: string;\n};\n\ntype MessageContextValue = { titleId?: string; descriptionId: string; valence: MessageValence };\n\nconst MESSAGE_NAME = 'Message';\n\n// CSS custom properties for valence color inheritance — consumed by Button variant='valence'.\n// Extending CSSProperties so entries satisfy the style prop type without a cast at the use site.\ntype ValenceCSSVars = CSSProperties & {\n '--dx-valence-bg': string;\n '--dx-valence-bg-hover': string;\n '--dx-valence-text': string;\n};\n\nconst valenceVars: Record<MessageValence, ValenceCSSVars> = {\n success: {\n '--dx-valence-bg': 'var(--color-success-bg)',\n '--dx-valence-bg-hover': 'var(--color-success-bg-hover)',\n '--dx-valence-text': 'var(--color-success-text)',\n },\n info: {\n '--dx-valence-bg': 'var(--color-info-bg)',\n '--dx-valence-bg-hover': 'var(--color-info-bg-hover)',\n '--dx-valence-text': 'var(--color-info-text)',\n },\n warning: {\n '--dx-valence-bg': 'var(--color-warning-bg)',\n '--dx-valence-bg-hover': 'var(--color-warning-bg-hover)',\n '--dx-valence-text': 'var(--color-warning-text)',\n },\n error: {\n '--dx-valence-bg': 'var(--color-error-bg)',\n '--dx-valence-bg-hover': 'var(--color-error-bg-hover)',\n '--dx-valence-text': 'var(--color-error-text)',\n },\n neutral: {\n '--dx-valence-bg': 'var(--color-neutral-bg)',\n '--dx-valence-bg-hover': 'var(--color-neutral-bg-hover)',\n '--dx-valence-text': 'var(--color-neutral-text)',\n },\n};\n\nconst [MessageProvider, useMessageContext] = createContext<MessageContextValue>(MESSAGE_NAME);\n\n//\n// Root\n//\n\nconst MessageRoot = forwardRef<HTMLDivElement, MessageRootProps>(\n (\n {\n asChild,\n valence = 'neutral',\n elevation: propsElevation,\n classNames,\n titleId: propsTitleId,\n descriptionId: propsDescriptionId,\n children,\n ...props\n },\n forwardedRef,\n ) => {\n const { tx } = useThemeContext();\n const titleId = useId('message__title', propsTitleId);\n const descriptionId = useId('message__description', propsDescriptionId);\n const elevation = useElevationContext(propsElevation);\n\n return (\n <MessageProvider {...{ titleId, descriptionId, valence }}>\n <Column.Root\n asChild={asChild}\n role={valence === 'neutral' ? 'paragraph' : 'alert'}\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n {...props}\n style={{ ...valenceVars[valence], ...(props.style || {}) }}\n classNames={tx('message.root', { valence, elevation }, classNames)}\n ref={forwardedRef}\n >\n {children}\n </Column.Root>\n </MessageProvider>\n );\n },\n);\n\nMessageRoot.displayName = MESSAGE_NAME;\n\n//\n// Title\n//\n\ntype MessageTitleProps = Omit<ThemedClassName<ComponentPropsWithRef<typeof Primitive.h2>>, 'id'> & {\n icon?: string;\n onClose?: () => void;\n};\n\nconst MESSAGE_TITLE_NAME = 'Message.Title';\n\nconst MessageTitle = forwardRef<HTMLDivElement, MessageTitleProps>(\n ({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { tx } = useThemeContext();\n const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);\n const icon = iconProp ?? messageIcons[valence];\n return (\n <Column.Row classNames={tx('message.header', {}, classNames)} ref={forwardedRef}>\n {icon && (\n <div className={tx('message.icon', { valence })}>\n <Icon icon={icon} />\n </div>\n )}\n <h2 className={tx('message.title', {}, classNames)} id={titleId}>\n {children}\n </h2>\n {onClose && (\n <div className={tx('message.close', {})}>\n <IconButton\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n density='sm'\n label={t('toolbar-close.label')}\n onClick={onClose}\n />\n </div>\n )}\n </Column.Row>\n );\n },\n);\n\nMessageTitle.displayName = MESSAGE_TITLE_NAME;\n\n//\n// Content\n//\n\ntype MessageContentProps = Omit<ThemedClassName<ComponentPropsWithRef<typeof Primitive.h2>>, 'id'> & {\n asChild?: boolean;\n};\n\nconst MESSAGE_CONTENT_NAME = 'Message.Content';\n\nconst MessageContent = forwardRef<HTMLParagraphElement, MessageContentProps>(\n ({ asChild, classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);\n const Comp = asChild ? Slot : Primitive.p;\n return (\n <Comp {...props} className={tx('message.content', {}, classNames)} id={descriptionId} ref={forwardedRef}>\n {children}\n </Comp>\n );\n },\n);\n\nMessageContent.displayName = MESSAGE_CONTENT_NAME;\n\n//\n// Message\n//\n\nexport const Message = {\n Root: MessageRoot,\n Title: MessageTitle,\n Content: MessageContent,\n};\n\nexport const Callout = Message;\n\nexport type { MessageRootProps, MessageTitleProps, MessageContentProps };\n\nexport { messageIcons };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type CSSProperties } from 'react';\n\nimport { type SlottableProps } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { PanelStyleProps } from '../../theme';\nimport { composableProps, slottable } from '../../util';\n\n//\n// Root\n//\n\nconst GRID_TEMPLATE_ROWS = 'auto 1fr auto';\nconst GRID_TEMPLATE_AREAS = '\"toolbar\" \"content\" \"statusbar\"';\n\ntype PanelRootProps = SlottableProps<{ style?: CSSProperties }>;\n\nconst PanelRoot = slottable<HTMLDivElement, { style?: CSSProperties }>(\n ({ children, asChild, role, style, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp\n {...rest}\n role={role ?? 'none'}\n style={{\n gridTemplateRows: GRID_TEMPLATE_ROWS,\n gridTemplateAreas: GRID_TEMPLATE_AREAS,\n ...style,\n }}\n className={tx('panel.root', {}, className)}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n },\n);\n\nPanelRoot.displayName = 'Panel.Root';\n\n//\n// Toolbar\n//\n\ntype PanelToolbarProps = SlottableProps & Pick<PanelStyleProps, 'size'>;\n\nconst PanelToolbar = slottable<HTMLDivElement, Pick<PanelStyleProps, 'size'>>(\n ({ children, asChild, size, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} data-slot='toolbar' className={tx('panel.toolbar', { size }, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n },\n);\n\nPanelToolbar.displayName = 'Panel.Toolbar';\n\n//\n// Content\n//\n\ntype PanelContentProps = SlottableProps;\n\nconst PanelContent = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} data-slot='content' className={tx('panel.content', {}, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n});\n\nPanelContent.displayName = 'Panel.Content';\n\n//\n// Statusbar\n//\n\ntype PanelStatusbarProps = SlottableProps & Pick<PanelStyleProps, 'size'>;\n\nconst PanelStatusbar = slottable<HTMLDivElement, Pick<PanelStyleProps, 'size'>>(\n ({ children, asChild, size, ...props }, forwardedRef) => {\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const { tx } = useThemeContext();\n return (\n <Comp {...rest} data-slot='statusbar' className={tx('panel.statusbar', { size }, className)} ref={forwardedRef}>\n {children}\n </Comp>\n );\n },\n);\n\nPanelStatusbar.displayName = 'Panel.Statusbar';\n\n//\n// Panel\n//\n\nexport const Panel = {\n Root: PanelRoot,\n Toolbar: PanelToolbar,\n Content: PanelContent,\n Statusbar: PanelStatusbar,\n};\n\nexport type { PanelRootProps, PanelToolbarProps, PanelContentProps, PanelStatusbarProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { CSSProperties, useMemo } from 'react';\n\nimport { type AllowedAxis, type SlottableProps } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { composableProps, slottable } from '../../util';\nimport { scrollbar } from './scrollbar';\n\n//\n// Context\n//\n\nconst SCROLLAREA_NAME = 'ScrollArea';\n\ntype ScrollAreaContextType = {\n /** Orientation of scrollbars. */\n orientation: AllowedAxis;\n /** Hide scrollbars when not scrolling. */\n autoHide: boolean;\n /** Apply padding to opposite side of scrollbar. */\n centered?: boolean;\n /** Apply padding. */\n padding: boolean;\n /** Use thin scrollbars. */\n thin: boolean;\n /** Enable snap scrolling. */\n snap: boolean;\n};\n\nconst [ScrollAreaProvider, useScrollAreaContext] = createContext<ScrollAreaContextType>(SCROLLAREA_NAME);\n\n//\n// Root\n//\n\nconst SCROLLAREA_ROOT_NAME = 'ScrollArea.Root';\n\ntype ScrollAreaRootProps = Partial<ScrollAreaContextType>;\n\n/**\n * ScrollArea provides native scrollbars with custom styling.\n */\nconst ScrollAreaRoot = slottable<HTMLDivElement, ScrollAreaRootProps>(\n (\n {\n children,\n asChild,\n orientation = 'vertical',\n autoHide = true,\n centered = false,\n padding = false,\n thin = false,\n snap = false,\n ...props\n },\n forwardedRef,\n ) => {\n const { tx } = useThemeContext();\n const { className, ...rest } = composableProps(props);\n const Comp = asChild ? Slot : Primitive.div;\n const options = useMemo(\n () => ({ orientation, autoHide, centered, padding, thin, snap }),\n [orientation, autoHide, centered, padding, thin, snap],\n );\n\n return (\n <ScrollAreaProvider {...options}>\n <Comp {...rest} className={tx('scrollArea.root', options, className)} ref={forwardedRef}>\n {children}\n </Comp>\n </ScrollAreaProvider>\n );\n },\n);\n\nScrollAreaRoot.displayName = SCROLLAREA_ROOT_NAME;\n\n//\n// Viewport\n//\n\nconst SCROLLAREA_VIEWPORT_NAME = 'ScrollArea.Viewport';\n\ntype ScrollAreaViewportProps = SlottableProps;\n\nconst ScrollAreaViewport = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const options = useScrollAreaContext(SCROLLAREA_VIEWPORT_NAME);\n const density = options.thin ? scrollbar.md : scrollbar.lg;\n const { className, ...rest } = composableProps(props);\n const { style, ...restWithoutStyle } = rest as { style?: CSSProperties; [key: string]: any };\n const Comp = asChild ? Slot : Primitive.div;\n\n return (\n <Comp\n {...restWithoutStyle}\n style={\n {\n '--scroll-width': `${density.size}px`,\n '--scroll-padding': `${density.padding}px`,\n ...style,\n } as CSSProperties\n }\n className={tx('scrollArea.viewport', options, className)}\n ref={forwardedRef}\n >\n {children}\n </Comp>\n );\n});\n\nScrollAreaViewport.displayName = SCROLLAREA_VIEWPORT_NAME;\n\n//\n// ScrollArea\n//\n\nexport const ScrollArea = {\n Root: ScrollAreaRoot,\n Viewport: ScrollAreaViewport,\n};\n\nexport type { ScrollAreaRootProps, ScrollAreaViewportProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\n/**\n * Scrollbar sizing presets keyed by density tier.\n */\nexport const scrollbar = {\n sm: {\n size: 2,\n padding: 2,\n },\n md: {\n size: 4,\n padding: 4,\n },\n lg: {\n size: 8,\n padding: 8,\n },\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, {\n type PropsWithChildren,\n type RefObject,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { addEventListener, combine } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { useMergeRefs } from '@dxos/react-hooks';\nimport { mx } from '@dxos/ui-theme';\nimport { type SlottableProps } from '@dxos/ui-types';\n\nimport { composable, composableProps, slottable } from '../../util';\nimport { type ThemedClassName } from '../../util';\nimport { IconButton } from '../Button';\nimport { ScrollArea, type ScrollAreaRootProps } from '../ScrollArea';\n\nconst isBottom = (el: HTMLElement | null) => {\n return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);\n};\n\nexport interface ScrollController {\n viewport: HTMLDivElement | null;\n scrollToTop: (behavior?: ScrollBehavior) => void;\n scrollToBottom: (behavior?: ScrollBehavior) => void;\n}\n\ntype ScrollContainerContextValue = {\n controller?: ScrollController;\n pinned?: boolean;\n overflow?: boolean;\n /** Called by Viewport to register/unregister the scroll element. */\n setViewport: (el: HTMLDivElement | null) => void;\n /** Called by Viewport on wheel events to update pinned state. */\n setPinned: (value: boolean) => void;\n /** Called by Viewport on scroll events to update overflow state. */\n setOverflow: (value: boolean) => void;\n};\n\nconst [ScrollContainerProvider, useScrollContainerContext] =\n createContext<ScrollContainerContextValue>('ScrollContainer');\n\n//\n// Root\n//\n\ntype ScrollContainerRootProps = PropsWithChildren<{\n pin?: boolean;\n behavior?: ScrollBehavior;\n}>;\n\n/**\n * Headless scroll container that provides context for scroll state.\n * Render ScrollContainer.Content and ScrollContainer.Viewport as children.\n */\nconst ScrollContainerRoot = forwardRef<ScrollController, ScrollContainerRootProps>(\n ({ children, pin, behavior: behaviorProp = 'smooth' }, forwardedRef) => {\n const scrollerRef = useRef<HTMLDivElement | null>(null);\n const autoScrollRef = useRef(false);\n const [pinned, setPinned] = useState(pin);\n const [overflow, setOverflow] = useState(false);\n\n const timeoutRef = useRef<NodeJS.Timeout>(undefined);\n const scrollToBottom = useCallback(\n (behavior: ScrollBehavior = behaviorProp) => {\n if (scrollerRef.current) {\n if (behavior !== 'instant') {\n // Temporarily hide scrollbar to prevent flickering during smooth scroll.\n // For instant scrolling we skip this — there's no animation to hide,\n // and adding the class changes element size which re-fires the ResizeObserver.\n autoScrollRef.current = true;\n scrollerRef.current.classList.add('scrollbar-none');\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => {\n scrollerRef.current?.classList.remove('scrollbar-none');\n autoScrollRef.current = false;\n }, 500);\n }\n\n scrollerRef.current.scrollTo({\n top: scrollerRef.current.scrollHeight,\n behavior,\n });\n\n setPinned(true);\n }\n },\n [behaviorProp],\n );\n\n const controller = useMemo<ScrollController>(\n () => ({\n get viewport() {\n return scrollerRef.current;\n },\n scrollToTop: () => {\n invariant(scrollerRef.current);\n scrollerRef.current.scrollTo({ top: 0, behavior: 'smooth' });\n setPinned(false);\n },\n scrollToBottom: (behavior = 'smooth' as ScrollBehavior) => {\n scrollToBottom(behavior);\n },\n }),\n [scrollToBottom],\n );\n\n // Scroll controller imperative ref.\n useImperativeHandle(forwardedRef, () => controller, [controller]);\n\n // Called by Viewport when the scroll element mounts/unmounts.\n const setViewport = useCallback((el: HTMLDivElement | null) => {\n scrollerRef.current = el;\n }, []);\n\n return (\n <ScrollContainerProvider\n pinned={pinned}\n overflow={overflow}\n controller={controller}\n setViewport={setViewport}\n setPinned={setPinned}\n setOverflow={setOverflow}\n >\n {children}\n </ScrollContainerProvider>\n );\n },\n);\n\nScrollContainerRoot.displayName = 'ScrollContainer.Root';\n\n//\n// Content\n//\n\ntype ScrollContainerContentProps = Pick<ScrollAreaRootProps, 'thin' | 'padding' | 'centered'>;\n\n/**\n * Composable wrapper around ScrollArea.Root.\n * Provides the DOM structure for the scroll container.\n */\nconst ScrollContainerContent = composable<HTMLDivElement, ScrollContainerContentProps>(\n ({ children, thin, padding, centered, ...props }, forwardedRef) => {\n return (\n <ScrollArea.Root\n {...composableProps(props, { classNames: 'relative isolate' })}\n thin={thin}\n padding={padding}\n centered={centered}\n ref={forwardedRef}\n >\n {children}\n </ScrollArea.Root>\n );\n },\n);\n\nScrollContainerContent.displayName = 'ScrollContainer.Content';\n\n//\n// Viewport\n//\n\nconst VIEWPORT_NAME = 'ScrollContainer.Viewport';\n\ntype ScrollContainerViewportProps = SlottableProps;\n\nconst ScrollContainerViewport = slottable<HTMLDivElement, ScrollContainerViewportProps>(\n ({ children, asChild, ...props }, forwardedRef) => {\n const scrollerRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs([forwardedRef, scrollerRef]);\n const { setViewport, setPinned, setOverflow } = useScrollContainerContext(VIEWPORT_NAME);\n\n // Register the scroll element with Root and set up wheel/scroll listeners.\n useEffect(() => {\n const el = scrollerRef.current;\n if (!el) {\n return;\n }\n\n setViewport(el);\n\n return combine(\n addEventListener(el, 'wheel', () => setPinned(isBottom(el))),\n addEventListener(el, 'scroll', () => setOverflow((el.scrollTop ?? 0) > 0)),\n () => setViewport(null),\n );\n }, [setViewport, setPinned, setOverflow]);\n\n return (\n <>\n <ScrollArea.Viewport asChild={asChild} {...composableProps(props)} ref={mergedRef}>\n {children}\n </ScrollArea.Viewport>\n <ScrollContainerPinEffect scrollerRef={scrollerRef} />\n </>\n );\n },\n);\n\nScrollContainerViewport.displayName = VIEWPORT_NAME;\n\n/**\n * Isolated component that consumes pinned/controller from context.\n * Kept separate so that Viewport does not re-render when pinned changes.\n */\nconst PIN_EFFECT_NAME = 'ScrollContainer.PinEffect';\n\nconst ScrollContainerPinEffect = ({ scrollerRef }: { scrollerRef: RefObject<HTMLDivElement | null> }) => {\n const { pinned, controller } = useScrollContainerContext(PIN_EFFECT_NAME);\n\n // Pin scroll to bottom when content changes.\n useEffect(() => {\n const viewport = scrollerRef.current;\n if (!pinned || !viewport) {\n return;\n }\n\n // Scroll instantly so we don't visually jump while content is being added.\n controller?.scrollToBottom('instant');\n\n // Setup resize observer on content children to detect size changes (e.g. streaming).\n // We observe children rather than the viewport itself, because the viewport's size\n // stays fixed — only its content grows.\n // Use instant scroll in the callback — smooth scrolling adds/removes the\n // scrollbar-none class, which changes the element size and re-fires the\n // observer, creating an infinite loop.\n const resizeObserver = new ResizeObserver(() => controller?.scrollToBottom('smooth'));\n Array.from(viewport.children).forEach((child) => {\n resizeObserver.observe(child);\n });\n\n // Watch for added/removed children.\n const mutationObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n if (node instanceof Element) {\n resizeObserver.observe(node);\n }\n });\n });\n\n controller?.scrollToBottom('smooth');\n });\n mutationObserver.observe(viewport, { childList: true });\n\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n }, [pinned, controller, scrollerRef]);\n\n return null;\n};\n\n//\n// Fade\n//\n\nconst FADE_NAME = 'ScrollContainer.Fade';\n\ntype ScrollContainerFadeProps = {};\n\nfunction ScrollContainerFade() {\n const { overflow } = useScrollContainerContext(FADE_NAME);\n\n return (\n <div\n data-visible={overflow}\n className={mx(\n // NOTE: Gradients may not be visible with dark reader extensions.\n 'z-10 absolute top-0 inset-x-0 h-24 w-full',\n 'opacity-0 duration-200 transition-opacity data-[visible=\"true\"]:opacity-100',\n 'bg-gradient-to-b from-(--color-base-surface) to-transparent pointer-events-none',\n )}\n />\n );\n}\n\nScrollContainerFade.displayName = FADE_NAME;\n\n//\n// ScrollDownButton\n//\n\nconst SCROLL_DOWN_BUTTON_NAME = 'ScrollContainer.ScrollDownButton';\n\ntype ScrollContainerScrollDownButtonProps = ThemedClassName;\n\nfunction ScrollContainerScrollDownButton({ classNames }: ScrollContainerScrollDownButtonProps) {\n const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);\n\n return (\n <div\n className={mx(\n 'absolute bottom-2 right-4 opacity-100 transition-opacity duration-300',\n pinned && 'opacity-0',\n classNames,\n )}\n >\n <IconButton\n variant='primary'\n icon='ph--arrow-down--regular'\n iconOnly\n size={4}\n label='Scroll down'\n onClick={() => controller?.scrollToBottom()}\n />\n </div>\n );\n}\n\nScrollContainerScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\n\n//\n// ScrollContainer\n//\n\nexport { useScrollContainerContext };\n\nexport const ScrollContainer = {\n Root: ScrollContainerRoot,\n Content: ScrollContainerContent,\n Viewport: ScrollContainerViewport,\n Fade: ScrollContainerFade,\n ScrollDownButton: ScrollContainerScrollDownButton,\n};\n\nexport type {\n ScrollContainerRootProps,\n ScrollContainerContentProps,\n ScrollContainerViewportProps,\n ScrollContainerFadeProps,\n ScrollContainerScrollDownButtonProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport React, { forwardRef } from 'react';\n\nimport { useSafeCollisionPadding, useElevationContext, useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\nimport { Button, type ButtonProps } from '../Button';\nimport { Icon } from '../Icon';\n\ntype SelectRootProps = SelectPrimitive.SelectProps;\n\nconst SelectRoot = SelectPrimitive.Root;\n\ntype SelectTriggerProps = SelectPrimitive.SelectTriggerProps;\n\nconst SelectTrigger = SelectPrimitive.Trigger;\n\ntype SelectValueProps = SelectPrimitive.SelectValueProps;\n\nconst SelectValue = SelectPrimitive.Value;\n\ntype SelectIconProps = SelectPrimitive.SelectIconProps;\n\nconst SelectIcon = SelectPrimitive.Icon;\n\ntype SelectPortalProps = SelectPrimitive.SelectPortalProps;\n\nconst SelectPortal = SelectPrimitive.Portal;\n\ntype SelectTriggerButtonProps = Omit<ButtonProps, 'children'> & Pick<SelectValueProps, 'placeholder' | 'children'>;\n\nconst SelectTriggerButton = forwardRef<HTMLButtonElement, SelectTriggerButtonProps>(\n ({ children, placeholder, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SelectPrimitive.Trigger asChild ref={forwardedRef}>\n <Button {...props} classNames={tx('select.triggerButton', {}, classNames)}>\n <SelectPrimitive.Value placeholder={placeholder}>{children}</SelectPrimitive.Value>\n <SelectPrimitive.Icon asChild>\n <Icon size={3} icon='ph--caret-down--bold' />\n </SelectPrimitive.Icon>\n </Button>\n </SelectPrimitive.Trigger>\n );\n },\n);\n\nSelectTriggerButton.displayName = 'Select.TriggerButton';\n\ntype SelectContentProps = ThemedClassName<SelectPrimitive.SelectContentProps>;\n\nconst SelectContent = forwardRef<HTMLDivElement, SelectContentProps>(\n ({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const elevation = useElevationContext();\n const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);\n return (\n <SelectPrimitive.Content\n {...props}\n data-arrow-keys='up down'\n collisionPadding={safeCollisionPadding}\n className={tx('select.content', { elevation }, classNames)}\n position='popper'\n ref={forwardedRef}\n >\n {children}\n </SelectPrimitive.Content>\n );\n },\n);\n\nSelectContent.displayName = 'Select.Content';\n\ntype SelectScrollUpButtonProps = ThemedClassName<SelectPrimitive.SelectScrollUpButtonProps>;\n\nconst SelectScrollUpButton = forwardRef<HTMLDivElement, SelectScrollUpButtonProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SelectPrimitive.SelectScrollUpButton\n {...props}\n className={tx('select.scrollButton', {}, classNames)}\n ref={forwardedRef}\n >\n {children ?? <Icon size={3} icon='ph--caret-up--bold' />}\n </SelectPrimitive.SelectScrollUpButton>\n );\n },\n);\n\nSelectScrollUpButton.displayName = 'Select.ScrollUpButton';\n\ntype SelectScrollDownButtonProps = ThemedClassName<SelectPrimitive.SelectScrollDownButtonProps>;\n\nconst SelectScrollDownButton = forwardRef<HTMLDivElement, SelectScrollDownButtonProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SelectPrimitive.SelectScrollDownButton\n {...props}\n className={tx('select.scrollButton', {}, classNames)}\n ref={forwardedRef}\n >\n {children ?? <Icon size={3} icon='ph--caret-down--bold' />}\n </SelectPrimitive.SelectScrollDownButton>\n );\n },\n);\n\nSelectScrollDownButton.displayName = 'Select.ScrollDownButton';\n\ntype SelectViewportProps = ThemedClassName<SelectPrimitive.SelectViewportProps>;\n\nconst SelectViewport = forwardRef<HTMLDivElement, SelectViewportProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SelectPrimitive.SelectViewport {...props} className={tx('select.viewport', {}, classNames)} ref={forwardedRef}>\n {children}\n </SelectPrimitive.SelectViewport>\n );\n },\n);\n\nSelectViewport.displayName = 'Select.Viewport';\n\ntype SelectItemProps = ThemedClassName<SelectPrimitive.SelectItemProps>;\n\nconst SelectItem = forwardRef<HTMLDivElement, SelectItemProps>(({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return <SelectPrimitive.Item {...props} className={tx('select.item', {}, classNames)} ref={forwardedRef} />;\n});\n\nSelectItem.displayName = 'Select.Item';\n\ntype SelectItemTextProps = SelectPrimitive.SelectItemTextProps;\n\nconst SelectItemText = SelectPrimitive.ItemText;\n\ntype SelectItemIndicatorProps = ThemedClassName<SelectPrimitive.SelectItemIndicatorProps>;\n\nconst SelectItemIndicator = forwardRef<HTMLDivElement, SelectItemIndicatorProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SelectPrimitive.ItemIndicator\n {...props}\n className={tx('select.itemIndicator', {}, classNames)}\n ref={forwardedRef}\n >\n {children}\n </SelectPrimitive.ItemIndicator>\n );\n },\n);\n\nSelectItemIndicator.displayName = 'Select.ItemIndicator';\n\ntype SelectOptionProps = SelectItemProps;\n\nconst SelectOption = forwardRef<HTMLDivElement, SelectItemProps>(({ children, classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <SelectPrimitive.Item {...props} className={tx('select.item', {}, classNames)} ref={forwardedRef}>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className='grow' />\n <Icon size={3} icon='ph--check--regular' />\n </SelectPrimitive.Item>\n );\n});\n\nSelectOption.displayName = 'Select.Option';\n\ntype SelectGroupProps = SelectPrimitive.SelectGroupProps;\n\nconst SelectGroup = SelectPrimitive.Group;\n\ntype SelectLabelProps = SelectPrimitive.SelectLabelProps;\n\nconst SelectLabel = SelectPrimitive.Label;\n\ntype SelectSeparatorProps = ThemedClassName<SelectPrimitive.SelectSeparatorProps>;\n\nconst SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return <SelectPrimitive.Separator {...props} className={tx('select.separator', {}, classNames)} ref={forwardedRef} />;\n});\n\nSelectSeparator.displayName = 'Select.Separator';\n\ntype SelectArrowProps = ThemedClassName<SelectPrimitive.SelectArrowProps>;\n\nconst SelectArrow = forwardRef<SVGSVGElement, SelectArrowProps>(({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return <SelectPrimitive.Arrow {...props} className={tx('select.arrow', {}, classNames)} ref={forwardedRef} />;\n});\n\nSelectArrow.displayName = 'Select.Arrow';\n\nexport const Select = {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n TriggerButton: SelectTriggerButton,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Content: SelectContent,\n ScrollUpButton: SelectScrollUpButton,\n ScrollDownButton: SelectScrollDownButton,\n Viewport: SelectViewport,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Option: SelectOption,\n Group: SelectGroup,\n Label: SelectLabel,\n Separator: SelectSeparator,\n Arrow: SelectArrow,\n};\n\nexport type {\n SelectRootProps,\n SelectTriggerProps,\n SelectTriggerButtonProps,\n SelectValueProps,\n SelectIconProps,\n SelectPortalProps,\n SelectContentProps,\n SelectScrollUpButtonProps,\n SelectScrollDownButtonProps,\n SelectViewportProps,\n SelectItemProps,\n SelectItemTextProps,\n SelectItemIndicatorProps,\n SelectOptionProps,\n SelectGroupProps,\n SelectLabelProps,\n SelectSeparatorProps,\n SelectArrowProps,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\ntype SkeletonProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {\n variant?: 'default' | 'circle' | 'text';\n};\n\n/**\n * A skeleton loading component that displays a placeholder while content is loading.\n */\nconst Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n ({ classNames, variant = 'default', ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return <div {...props} className={tx('skeleton.root', { variant }, classNames)} ref={forwardedRef} />;\n },\n);\n\nexport { Skeleton };\n\nexport type { SkeletonProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { composableProps, slottable } from '../../util';\nimport { ThemedClassName } from '../../util';\n\ntype ScopedProps<P> = P & { __scopeSplitter?: any };\n\n// TODO(burdon): Generalize horizontal/vertical and change to start/end.\ntype Mode = 'top' | 'bottom' | 'split';\n\ntype SplitterContextValue = {\n mode: Mode;\n ratio?: number;\n transition: number;\n};\n\nconst SPLITTER_NAME = 'Splitter';\n\nconst [createSplitterContext, createSplitterScope] = createContextScope(SPLITTER_NAME);\n\nconst [SplitterProvider, useSplitterContext] = createSplitterContext<SplitterContextValue>(SPLITTER_NAME);\n\n//\n// Root\n//\n\nconst ROOT_NAME = 'Splitter.Root';\n\ntype SplitterRootProps = Partial<SplitterContextValue>;\n\nconst SplitterRoot = slottable<HTMLDivElement, SplitterRootProps>(\n ({ asChild, mode = 'top', ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { __scopeSplitter, ...rest } = props as ScopedProps<typeof props>;\n const { className, ...restProps } = composableProps(rest);\n const Comp = asChild ? Slot : Primitive.div;\n\n return (\n <SplitterProvider scope={__scopeSplitter} mode={mode} ratio={ratio} transition={transition}>\n <Comp {...restProps} ref={forwardedRef} className={tx('splitter.root', {}, className)}>\n {children}\n </Comp>\n </SplitterProvider>\n );\n },\n);\n\nSplitterRoot.displayName = ROOT_NAME;\n\n//\n// Panel\n//\n\nconst PANEL_NAME = 'Splitter.Panel';\n\ntype SplitterPanelProps = ThemedClassName<{\n position: 'top' | 'bottom';\n}>;\n\nconst SplitterPanel = slottable<HTMLDivElement, SplitterPanelProps>(\n ({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const { __scopeSplitter, ...rest } = props as ScopedProps<typeof props>;\n const Comp = asChild ? Slot : Primitive.div;\n const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);\n const { className, ...restProps } = composableProps(rest);\n\n // Calculate position and height based on mode and ratio.\n const isTopPanel = position === 'top';\n const topOffset = isTopPanel ? '0%' : mode === 'top' ? '100%' : mode === 'bottom' ? '0%' : `${ratio * 100}%`;\n const height = isTopPanel\n ? mode === 'top'\n ? '100%'\n : mode === 'bottom'\n ? '0%'\n : `${ratio * 100}%`\n : mode === 'bottom'\n ? '100%'\n : mode === 'top'\n ? '0%'\n : `${(1 - ratio) * 100}%`;\n\n return (\n <Comp\n {...restProps}\n ref={forwardedRef}\n className={tx('splitter.panel', {}, className)}\n style={{\n top: topOffset,\n height,\n transition: `top ${transition}ms, height ${transition}ms ease-out`,\n ...style,\n }}\n >\n {children}\n </Comp>\n );\n },\n);\n\nSplitterPanel.displayName = PANEL_NAME;\n\n//\n// Splitter\n//\n\nconst Splitter = {\n Root: SplitterRoot,\n Panel: SplitterPanel,\n};\n\nexport { Splitter, createSplitterScope };\n\nexport type { Mode as SplitterMode, SplitterRootProps, SplitterPanelProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { useThemeContext } from '../../hooks';\nimport { type StatusStyleProps } from '../../theme';\nimport { type ThemedClassName } from '../../util';\n\ntype StatusProps = ThemedClassName<\n ComponentPropsWithRef<'span'> &\n StatusStyleProps & {\n progress?: number;\n }\n>;\n\nconst Status = forwardRef<HTMLSpanElement, StatusProps>(\n ({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <span\n role='status'\n {...props}\n className={tx('status.root', { indeterminate, variant }, classNames)}\n ref={forwardedRef}\n >\n <span\n role='none'\n className={tx('status.bar', { indeterminate, variant }, classNames)}\n {...(!indeterminate && { style: { width: `${Math.round(progress * 100)}%` } })}\n />\n {children}\n </span>\n );\n },\n);\n\nexport { Status };\n\nexport type { StatusProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { type ChromaticPalette, type MessageValence, type NeutralPalette } from '@dxos/ui-types';\n\nimport { useThemeContext } from '../../hooks';\nimport { type ThemedClassName } from '../../util';\n\nexport type TagProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.span>> & {\n palette?: NeutralPalette | ChromaticPalette | MessageValence;\n asChild?: boolean;\n};\n\nexport const Tag = forwardRef<HTMLSpanElement, TagProps>(\n ({ asChild, palette = 'neutral', classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n const Comp = asChild ? Slot : Primitive.span;\n return (\n <Comp {...props} className={tx('tag.root', { palette }, classNames)} data-hue={palette} ref={forwardedRef} />\n );\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { translationKey } from '#translations';\n\nimport { useThemeContext } from '../../hooks';\nimport { DensityProvider, ElevationProvider } from '../../primitives';\nimport { type ThemedClassName } from '../../util';\nimport { IconButton } from '../Button';\nimport { Column } from '../Column';\nimport { Icon } from '../Icon';\n\n//\n// Provider\n//\n\ntype ToastProviderProps = ToastPrimitive.ToastProviderProps;\n\nconst ToastProvider = ToastPrimitive.Provider;\n\n//\n// Viewport\n//\n\ntype ToastViewportProps = ThemedClassName<ToastPrimitive.ToastViewportProps>;\n\nconst ToastViewport = forwardRef<HTMLOListElement, ToastViewportProps>(({ classNames, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return <ToastPrimitive.Viewport {...props} className={tx('toast.viewport', {}, classNames)} ref={forwardedRef} />;\n});\n\nToastViewport.displayName = 'Toast.Viewport';\n\n//\n// Root\n//\n\ntype ToastRootProps = ThemedClassName<ToastPrimitive.ToastProps>;\n\nconst ToastRoot = forwardRef<HTMLLIElement, ToastRootProps>(({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <ToastPrimitive.Root {...props} className={tx('toast.root', {}, classNames)} ref={forwardedRef}>\n <ElevationProvider elevation='toast'>\n <Column.Root classNames={tx('toast.grid', {})}>{children}</Column.Root>\n </ElevationProvider>\n </ToastPrimitive.Root>\n );\n});\n\nToastRoot.displayName = 'Toast.Root';\n\n//\n// Title\n//\n\ntype ToastTitleProps = ThemedClassName<ToastPrimitive.ToastTitleProps> & {\n icon?: string;\n onClose?: () => void;\n};\n\nconst ToastTitle = forwardRef<HTMLHeadingElement, ToastTitleProps>(\n ({ classNames, children, icon, onClose, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { tx } = useThemeContext();\n return (\n <Column.Row classNames={tx('toast.header', {})}>\n {icon && (\n <div className={tx('toast.icon', {})}>\n <Icon icon={icon} size={5} />\n </div>\n )}\n <ToastPrimitive.Title {...props} className={tx('toast.title', {}, classNames)} ref={forwardedRef}>\n {children}\n </ToastPrimitive.Title>\n {onClose && (\n <IconButton\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('toolbar-close.label')}\n classNames={tx('toast.close', {})}\n onClick={onClose}\n />\n )}\n </Column.Row>\n );\n },\n);\n\nToastTitle.displayName = 'Toast.Title';\n\n//\n// Description\n//\n\ntype ToastDescriptionProps = ThemedClassName<ToastPrimitive.ToastDescriptionProps>;\n\nconst ToastDescription = forwardRef<HTMLParagraphElement, ToastDescriptionProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <ToastPrimitive.Description {...props} className={tx('toast.description', {}, classNames)} ref={forwardedRef}>\n {children}\n </ToastPrimitive.Description>\n );\n },\n);\n\nToastDescription.displayName = 'Toast.Description';\n\n//\n// Actions\n//\n\ntype ToastActionsProps = ThemedClassName<ComponentPropsWithRef<'div'>>;\n\nconst ToastActions = forwardRef<HTMLDivElement, ToastActionsProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n const { tx } = useThemeContext();\n return (\n <Column.Center classNames={tx('toast.actions', {}, classNames)} ref={forwardedRef} {...props}>\n <DensityProvider density='sm'>{children}</DensityProvider>\n </Column.Center>\n );\n },\n);\n\nToastActions.displayName = 'Toast.Actions';\n\n//\n// Action / Close\n//\n\ntype ToastActionProps = ToastPrimitive.ToastActionProps;\n\nconst ToastAction = ToastPrimitive.Action;\n\ntype ToastCloseProps = ToastPrimitive.ToastCloseProps;\n\nconst ToastClose = ToastPrimitive.Close;\n\n//\n// Toast\n//\n\nexport const Toast = {\n Provider: ToastProvider,\n Viewport: ToastViewport,\n Root: ToastRoot,\n Title: ToastTitle,\n Description: ToastDescription,\n Actions: ToastActions,\n Action: ToastAction,\n Close: ToastClose,\n};\n\nexport type {\n ToastProviderProps,\n ToastViewportProps,\n ToastRootProps,\n ToastTitleProps,\n ToastDescriptionProps,\n ToastActionsProps,\n ToastActionProps,\n ToastCloseProps,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASA,aAAa;AAEtB,cAAc;AACd,cAAc;;;ACJd,SAASC,qBAAqB;AAC9B,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,QAAAA,aAAY;AACrB,OAAOC,UAAkFC,cAAAA,mBAAkB;AAE3G,OAAO;AAOP,SAASC,gBAAgB;AACzB,SAASC,aAAa;AACtB,SAASC,MAAAA,WAAU;;;ACdnB,SAASC,kBAAkB;;;ACA3B,SAAqBC,SAASC,yBAAyB;;;ACAvD,SACEC,UACAC,eACAC,YAIAC,sBAIK;AAEP,SAASC,WAAW;AACpB,SAASC,UAAU;AAGnB,IAAA,eAAA;AAWMC,IAAAA,kBAAQ,CAAA,EAAA,WAAA,YAAA,MAAA,OAAA,GAAA,MAAA,GAAA,EAAA,YAAA,mBAAA,GAAA,SAAA,IAAA,CAAA,OAAA;;EAGZ,GAAGC;;EAGHC,GAAAA;;EAGAC,MAAAA,QAAO,SAAA,QAAA;;SAAwBA;IAAM,G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AAG,eAAe,CAAC,CAAA;IAC/B4B,SAASb;;AAKnB,CAAA;AAGFF,WAAWP,cAAc;AAQzB,IAAMuB,mBAAmBjC,gBAAAA,aACvB,CAAC,EAAEC,YAAYW,UAAU,GAAGV,MAAAA,GAASC,iBAAAA;AACnC,QAAM,EAAEC,GAAE,IAAKC,gBAAAA;AACf,SACE,gBAAAC,QAAA,cAAgB4B,4BAAW;IAAE,GAAGhC;IAAOM,WAAWJ,GAAG,qBAAqB,CAAC,GAAGH,UAAAA;IAAaQ,KAAKN;KAC7FS,QAAAA;AAGP,CAAA;AAGFqB,iBAAiBvB,cAAc;AAQ/B,IAAMyB,eAAenC,gBAAAA,aACnB,CAAC,EAAEC,YAAYW,UAAU,GAAGV,MAAAA,GAASC,iBAAAA;AACnC,QAAM,EAAEC,GAAE,IAAKC,gBAAAA;AACf,SACE,gBAAAC,QAAA,cAACU,OAAOoB,QAAM;IAACnC,YAAYG,GAAG,iBAAiB,CAAC,GAAGH,UAAAA;IAAaQ,KAAKN;IAAe,GAAGD;KACrF,gBAAAI,QAAA,cAAC+B,iBAAAA;IAAgBC,SAAQ;KAAM1B,QAAAA,CAAAA;AAGrC,CAAA;AAGFuB,aAAazB,cAAc;AAQ3B,IAAM6B,cAA6BC;AAInC,IAAMC,aAA4BC;AAM3B,IAAMC,QAAQ;EACnB7C,UAAUD;EACVU,UAAUR;EACVc,MAAMF;EACNgB,OAAOV;EACPiB,aAAaD;EACbW,SAAST;EACTK,QAAQD;EACRG,OAAOD;AACT;",
6
+ "names": ["Trans", "createContext", "Primitive", "Slot", "React", "forwardRef", "DxAvatar", "useId", "mx", "useContext", "isLabel", "toLocalizedString", "Children", "createElement", "forwardRef", "isValidElement", "log", "mx", "defaults", "props", "role", "style", "className", "asChild", "child", "warn", "result", "component", "COMPOSABLE", "useCallback", "useEffect", "useMemo", "useState", "getDocumentElementFontSize", "parseFloat", "getComputedStyle", "document", "documentElement", "fontSize", "usePx", "rem", "setFontSize", "updateFontSize", "resizeObserver", "ResizeObserver", "observe", "mediaQueryList", "window", "matchMedia", "handleMediaChange", "addEventListener", "addListener", "disconnect", "removeEventListener", "removeListener", "Primitive", "Slot", "React", "mx", "Container", "slottable", "children", "asChild", "props", "forwardedRef", "className", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "mx", "ref", "Primitive", "Slot", "React", "mx", "Flex", "slottable", "children", "asChild", "column", "grow", "props", "forwardedRef", "className", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "React", "ref", "mx", "React", "mx", "Grid", "composable", "children", "style", "role", "cols", "rows", "grow", "props", "forwardedRef", "className", "rest", "composableProps", "React", "div", "ref", "mx", "gridTemplateColumns", "undefined", "gridTemplateRows", "useDensityContext", "densityProp", "density", "useContext", "DensityContext", "ICONS_URL", "useIconHref", "icon", "noCache", "useThemeContext", "url", "Date", "getMinutes", "undefined", "useMemo", "propIsNumber", "prop", "Number", "isFinite", "propsIsRecord", "safePadding", "propsPadding", "side", "useSafeCollisionPadding", "collisionPadding", "safeAreaPadding", "useThemeContext", "useMemo", "top", "right", "bottom", "left", "useContext", "useTranslationsContext", "useContext", "TranslationsContext", "useCallback", "useState", "useViewportResize", "useVisualViewport", "deps", "width", "setWidth", "height", "setHeight", "handleResize", "window", "visualViewport", "AVATAR_NAME", "AvatarProvider", "useAvatarContext", "createContext", "AvatarRoot", "children", "labelId", "propsLabelId", "descriptionId", "propsDescriptionId", "useId", "React", "AvatarContent", "forwardRef", "icon", "classNames", "props", "forwardedRef", "href", "useIconHref", "DxAvatar", "aria-labelledby", "aria-describedby", "rootClassName", "mx", "ref", "AvatarLabel", "asChild", "srOnly", "Comp", "Slot", "Primitive", "span", "tx", "useThemeContext", "id", "className", "AvatarDescription", "Avatar", "Root", "Content", "Label", "Description", "Primitive", "Slot", "React", "forwardRef", "React", "forwardRef", "memo", "useMemo", "Icon", "memo", "forwardRef", "classNames", "icon", "size", "synchronized", "style", "props", "forwardedRef", "tx", "useThemeContext", "spinDelay", "useMemo", "Date", "now", "undefined", "href", "useIconHref", "React", "svg", "animationDelay", "className", "ref", "use", "React", "forwardRef", "IconBlock", "forwardRef", "classNames", "children", "compact", "square", "props", "forwardedRef", "tx", "useThemeContext", "React", "div", "aria-hidden", "className", "ref", "displayName", "Primitive", "Slot", "React", "forwardRef", "Link", "forwardRef", "classNames", "asChild", "variant", "target", "rel", "props", "forwardedRef", "tx", "useThemeContext", "Comp", "Slot", "Primitive", "a", "React", "className", "ref", "BreadcrumbRoot", "forwardRef", "asChild", "classNames", "props", "forwardedRef", "tx", "useThemeContext", "Comp", "Slot", "Primitive", "div", "React", "role", "className", "ref", "displayName", "BreadcrumbList", "ol", "BreadcrumbListItem", "li", "BreadcrumbLink", "Link", "BreadcrumbCurrent", "aria-current", "BreadcrumbSeparator", "children", "span", "aria-hidden", "Icon", "icon", "Breadcrumb", "Root", "List", "ListItem", "Current", "Separator", "createContext", "Primitive", "Slot", "React", "forwardRef", "memo", "BUTTON_GROUP_NAME", "BUTTON_NAME", "ButtonGroupProvider", "useButtonGroupContext", "createContext", "inGroup", "Button", "memo", "forwardRef", "classNames", "children", "density", "densityProp", "elevation", "elevationProp", "variant", "asChild", "props", "ref", "tx", "useThemeContext", "useElevationContext", "useDensityContext", "Comp", "Slot", "Primitive", "button", "React", "data-variant", "data-density", "data-props", "className", "disabled", "displayName", "ButtonGroup", "propsElevation", "forwardedRef", "div", "React", "forwardRef", "IconButton", "forwardRef", "props", "forwardedRef", "iconOnly", "React", "IconOnlyButton", "ref", "LabelledIconButton", "noTooltip", "tooltipSide", "Tooltip", "Trigger", "asChild", "content", "label", "side", "size", "icon", "square", "iconEnd", "iconClassNames", "caretDown", "_", "classNames", "tx", "useThemeContext", "Button", "Icon", "span", "className", "undefined", "TogglePrimitive", "React", "forwardRef", "Toggle", "forwardRef", "defaultPressed", "pressed", "onPressedChange", "props", "forwardedRef", "React", "Root", "asChild", "Button", "ref", "ToggleGroupPrimitive", "React", "forwardRef", "ToggleGroup", "forwardRef", "classNames", "children", "props", "forwardedRef", "React", "Root", "asChild", "ButtonGroup", "ref", "ToggleGroupItem", "variant", "elevation", "density", "Item", "Button", "ToggleGroupIconItem", "label", "icon", "size", "IconButton", "CalendarDate", "parseDate", "React", "forwardRef", "Button", "RACButton", "Calendar", "RACCalendar", "CalendarCell", "RACCalendarCell", "CalendarGrid", "RACCalendarGrid", "CalendarGridBody", "RACCalendarGridBody", "CalendarGridHeader", "RACCalendarGridHeader", "CalendarHeaderCell", "RACCalendarHeaderCell", "Heading", "RACHeading", "RangeCalendar", "RACRangeCalendar", "toCalendarDate", "date", "CalendarDate", "getFullYear", "getMonth", "getDate", "fromCalendarDate", "value", "undefined", "Date", "year", "month", "day", "CalendarShell", "classNames", "className", "isDisabled", "forwardedRef", "children", "tx", "useThemeContext", "React", "div", "ref", "aria-disabled", "CalendarChrome", "header", "RACButton", "slot", "Icon", "size", "icon", "RACHeading", "CalendarGridContent", "RACCalendarGrid", "RACCalendarGridHeader", "RACCalendarHeaderCell", "RACCalendarGridBody", "RACCalendarCell", "CalendarRoot", "forwardRef", "props", "minValue", "maxValue", "defaultMonth", "defaultFocused", "mode", "racProps", "defaultFocusedValue", "selected", "from", "start", "end", "to", "onChange", "next", "onSelect", "RACRangeCalendar", "RACCalendar", "displayName", "Calendar", "Root", "Primitive", "Slot", "DOMPurify", "React", "forwardRef", "useId", "useMemo", "iconSize", "Primitive", "Slot", "React", "COLUMN_ROOT_NAME", "gutterSizes", "xs", "sm", "md", "lg", "ColumnRoot", "slottable", "children", "asChild", "role", "gutter", "props", "forwardedRef", "className", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "tx", "useThemeContext", "gutterSize", "React", "style", "gridTemplateColumns", "join", "ref", "displayName", "COLUMN_ROW_NAME", "ColumnRow", "COLUMN_BLEED_NAME", "ColumnBleed", "COLUMN_CENTER_NAME", "ColumnCenter", "Column", "Root", "Row", "Bleed", "Center", "React", "useCallback", "useRef", "useState", "mx", "cache", "Map", "Image", "classNames", "src", "alt", "fit", "crossOrigin", "sampleSize", "contrast", "crossOriginState", "setCrossOriginState", "dominantColor", "setDominantColor", "undefined", "imageLoaded", "setImageLoaded", "canvasRef", "handleImageError", "handleImageLoad", "target", "rgb", "get", "img", "current", "color", "extractDominantColor", "set", "div", "className", "style", "backgroundColor", "canvas", "ref", "display", "aria-hidden", "background", "transition", "opacity", "onError", "onLoad", "ctx", "getContext", "width", "height", "drawImage", "imageData", "getImageData", "pixels", "data", "isTransparent", "r", "g", "b", "totalWeight", "cornerSize", "Math", "floor", "y", "x", "isInTopLeft", "isInTopRight", "isInBottomLeft", "isInBottomRight", "i", "red", "green", "blue", "alpha", "max", "min", "saturation", "weight", "round", "threshold", "edgeTransparentPixels", "edgePixels", "topIndex", "bottomIndex", "leftIndex", "rightIndex", "Primitive", "Slot", "ToolbarPrimitive", "React", "forwardRef", "useTranslation", "translationKey", "ContextMenuPrimitive", "Primitive", "Slot", "React", "forwardRef", "ContextMenuRoot", "ContextMenu", "ContextMenuTrigger", "Trigger", "ContextMenuPortal", "Portal", "ContextMenuContent", "forwardRef", "classNames", "children", "collisionPadding", "props", "forwardedRef", "tx", "useThemeContext", "elevation", "useElevationContext", "safeCollisionPadding", "useSafeCollisionPadding", "React", "Content", "data-arrow-keys", "className", "ref", "ContextMenuViewport", "asChild", "Comp", "Slot", "Primitive", "div", "ContextMenuArrow", "Arrow", "ContextMenuGroup", "Group", "ContextMenuItemIndicator", "ItemIndicator", "ContextMenuItem", "Item", "ContextMenuCheckboxItem", "CheckboxItem", "ContextMenuSeparator", "Separator", "ContextMenuGroupLabel", "Label", "Root", "Viewport", "GroupLabel", "composeEventHandlers", "composeRefs", "createContextScope", "useId", "MenuPrimitive", "createMenuScope", "Primitive", "Slot", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "DROPDOWN_MENU_NAME", "createDropdownMenuContext", "createDropdownMenuScope", "createContextScope", "createMenuScope", "useMenuScope", "DropdownMenuProvider", "useDropdownMenuContext", "DropdownMenuRoot", "__scopeDropdownMenu", "children", "dir", "modal", "open", "openProp", "defaultOpen", "onOpenChange", "menuScope", "triggerRef", "useRef", "setOpen", "useControllableState", "prop", "defaultProp", "onChange", "React", "scope", "triggerId", "useId", "contentId", "onOpenToggle", "useCallback", "prevOpen", "Root", "displayName", "TRIGGER_NAME", "DropdownMenuTrigger", "forwardRef", "props", "forwardedRef", "disabled", "triggerProps", "context", "Anchor", "asChild", "Primitive", "button", "type", "id", "aria-haspopup", "aria-expanded", "aria-controls", "undefined", "data-state", "data-disabled", "ref", "composeRefs", "data-arrow-keys", "onPointerDown", "composeEventHandlers", "event", "ctrlKey", "preventDefault", "onKeyDown", "includes", "key", "VIRTUAL_TRIGGER_NAME", "DropdownMenuVirtualTrigger", "virtualRef", "useEffect", "current", "PORTAL_NAME", "DropdownMenuPortal", "portalProps", "Portal", "DropdownMenuViewport", "classNames", "tx", "useThemeContext", "Comp", "Slot", "div", "className", "CONTENT_NAME", "DropdownMenuContent", "collisionPadding", "collisionBoundary", "contentProps", "elevation", "useElevationContext", "hasInteractedOutsideRef", "safeCollisionPadding", "useSafeCollisionPadding", "computedCollisionBoundary", "useMemo", "closestBoundary", "closest", "Array", "isArray", "Content", "aria-labelledby", "onCloseAutoFocus", "focus", "onInteractOutside", "originalEvent", "detail", "ctrlLeftClick", "isRightClick", "style", "GROUP_NAME", "DropdownMenuGroup", "groupProps", "Group", "LABEL_NAME", "DropdownMenuGroupLabel", "labelProps", "Label", "ITEM_NAME", "DropdownMenuItem", "itemProps", "Item", "CHECKBOX_ITEM_NAME", "DropdownMenuCheckboxItem", "checkboxItemProps", "CheckboxItem", "RADIO_GROUP_NAME", "DropdownMenuRadioGroup", "radioGroupProps", "RadioGroup", "RADIO_ITEM_NAME", "DropdownMenuRadioItem", "INDICATOR_NAME", "DropdownMenuItemIndicator", "itemIndicatorProps", "ItemIndicator", "SEPARATOR_NAME", "DropdownMenuSeparator", "separatorProps", "Separator", "ARROW_NAME", "DropdownMenuArrow", "arrowProps", "Arrow", "DropdownMenuSub", "Sub", "SUB_TRIGGER_NAME", "DropdownMenuSubTrigger", "subTriggerProps", "SubTrigger", "SUB_CONTENT_NAME", "DropdownMenuSubContent", "subContentProps", "SubContent", "DropdownMenu", "Trigger", "VirtualTrigger", "Viewport", "GroupLabel", "RadioItem", "useDropdownMenuMenuScope", "SeparatorPrimitive", "React", "forwardRef", "Separator", "forwardRef", "classNames", "orientation", "subdued", "props", "forwardedRef", "tx", "useThemeContext", "React", "Root", "className", "ref", "ToolbarRoot", "composable", "children", "density", "disabled", "layoutManaged", "orientation", "props", "forwardedRef", "className", "role", "rest", "composableProps", "tx", "useThemeContext", "React", "Root", "data-arrow-keys", "ref", "displayName", "ToolbarText", "slottable", "asChild", "Comp", "Slot", "Primitive", "div", "ToolbarButton", "forwardRef", "Button", "ToolbarIconButton", "IconButton", "ToolbarToggle", "Toggle", "ToolbarLink", "Link", "ToolbarToggleGroup", "classNames", "elevation", "ButtonGroup", "ToolbarToggleGroupItem", "variant", "ToolbarToggleItem", "ToolbarToggleGroupIconItem", "icon", "label", "iconOnly", "iconClassNames", "ToolbarSeparator", "Separator", "ToolbarDragHandle", "testId", "t", "useTranslation", "translationKey", "data-testid", "tabIndex", "noTooltip", "TOOLBAR_ACTION_ICONS", "close", "delete", "TOOLBAR_ACTION_LABEL_KEYS", "ToolbarActionIconButton", "action", "onClick", "ToolbarMenu", "context", "items", "DropdownMenu", "Trigger", "length", "Portal", "Content", "Viewport", "map", "onSelect", "index", "Item", "key", "Arrow", "Toolbar", "Text", "ToggleGroup", "ToggleGroupItem", "ToggleGroupIconItem", "DragHandle", "ActionIconButton", "Menu", "CARD_ROOT_NAME", "CardRoot", "composable", "children", "id", "role", "border", "fullWidth", "density", "props", "forwardedRef", "className", "rest", "composableProps", "tx", "useThemeContext", "React", "Column", "Root", "asChild", "gutter", "classNames", "div", "ref", "displayName", "CARD_HEADER_NAME", "CardHeader", "Toolbar", "style", "iconSize", "CARD_DRAG_HANDLE_NAME", "CardDragHandle", "forwardRef", "CardIconBlock", "DragHandle", "CARD_ACTION_ICON_BUTTON_NAME", "CardActionIconButton", "ActionIconButton", "CARD_MENU_NAME", "CardMenu", "context", "items", "Menu", "CARD_ICON_NAME", "CardIcon", "Icon", "CARD_ICON_BLOCK_NAME", "IconBlock", "CARD_TITLE_NAME", "CardTitle", "slottable", "Comp", "Slot", "Primitive", "CARD_BODY_NAME", "CardBody", "CARD_SECTION_NAME", "CardSection", "title", "titleId", "useId", "aria-labelledby", "undefined", "CARD_ROW_NAME", "CardRow", "icon", "iconProp", "size", "CARD_TEXT_NAME", "CardText", "truncate", "variant", "span", "CARD_HTML_NAME", "CardHtml", "html", "sanitized", "useMemo", "DOMPurify", "sanitize", "dangerouslySetInnerHTML", "__html", "CARD_POSTER_NAME", "CardPoster", "alt", "aspect", "aspectProp", "image", "imageProps", "Image", "src", "aria-label", "CARD_ACTION_NAME", "CardAction", "actionIcon", "label", "onClick", "Button", "CARD_LINK_NAME", "CardLink", "href", "a", "data-variant", "target", "rel", "Card", "Header", "Title", "Body", "Section", "Row", "Text", "Html", "Poster", "Action", "Link", "useArrowNavigationGroup", "createContext", "React", "useCallback", "useEffect", "useState", "mx", "React", "useState", "mx", "FIT_CLASS", "cover", "contain", "fill", "none", "VIDEO_EXTENSIONS", "AUDIO_EXTENSIONS", "DEFAULT_IFRAME_SANDBOX", "detectMediaKind", "src", "pathname", "split", "lower", "toLowerCase", "some", "extension", "endsWith", "undefined", "isEmbedUrl", "CLOUDFLARE_STREAM_IFRAME_PATTERN", "isCloudflareStreamEmbed", "test", "MediaPlayer", "classNames", "kind", "controls", "autoPlay", "loop", "muted", "alt", "crossOrigin", "fit", "fitClass", "resolved", "audio", "className", "aria-label", "video", "IframePlayer", "key", "img", "loading", "onError", "event", "currentTarget", "style", "display", "loaded", "setLoaded", "div", "iframe", "title", "colorScheme", "sandbox", "referrerPolicy", "allow", "allowFullScreen", "onLoad", "CAROUSEL_NAME", "CarouselProvider", "useCarouselContext", "createContext", "useCarousel", "CarouselRoot", "children", "count", "autorun", "intervalMs", "defaultIndex", "index", "setIndexState", "useState", "autoAdvance", "setAutoAdvance", "useEffect", "handle", "setInterval", "i", "clearInterval", "setIndex", "useCallback", "next", "prev", "React", "displayName", "CarouselContent", "composable", "props", "forwardedRef", "div", "composableProps", "classNames", "ref", "CarouselViewport", "t", "useTranslation", "translationKey", "handleKeyDown", "event", "key", "preventDefault", "className", "mx", "tabIndex", "role", "aria-roledescription", "aria-label", "onKeyDown", "CarouselSlide", "src", "kind", "alt", "controls", "autoPlay", "loop", "muted", "crossOrigin", "active", "MediaPlayer", "CarouselPrevious", "IconButton", "square", "variant", "icon", "iconOnly", "label", "onClick", "CarouselNext", "CarouselIndicators", "arrowNavigationAttrs", "useArrowNavigationGroup", "axis", "memorizeCurrent", "Array", "from", "length", "map", "_", "aria-selected", "onFocus", "size", "CarouselCaption", "content", "p", "Carousel", "Root", "Content", "Viewport", "Slide", "Previous", "Next", "Indicators", "Caption", "React", "createContext", "useCallback", "useContext", "useState", "ClipboardContext", "textValue", "setTextValue", "_", "useClipboard", "ClipboardProvider", "children", "setInternalTextValue", "nextValue", "navigator", "clipboard", "writeText", "Provider", "value", "React", "mx", "osTranslations", "inactiveLabelStyles", "CopyButton", "classNames", "value", "size", "props", "t", "useTranslation", "osTranslations", "textValue", "setTextValue", "useClipboard", "isCopied", "React", "Button", "onClick", "data-testid", "div", "className", "mx", "span", "Icon", "icon", "CopyButtonIconOnly", "__scopeTooltip", "variant", "label", "onOpen", "useTooltipContext", "IconButton", "iconOnly", "then", "Clipboard", "Button", "CopyButton", "IconButton", "CopyButtonIconOnly", "Provider", "ClipboardProvider", "createContext", "format", "formatDate", "React", "forwardRef", "useCallback", "useState", "composeEventHandlers", "useComposedRefs", "createContextScope", "DismissableLayer", "useFocusGuards", "FocusScope", "useId", "PopperPrimitive", "createPopperScope", "Portal", "PortalPrimitive", "Presence", "Primitive", "Slot", "useControllableState", "hideOthers", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "RemoveScroll", "POPOVER_NAME", "createPopoverContext", "createPopoverScope", "createContextScope", "createPopperScope", "usePopperScope", "PopoverProvider", "usePopoverContext", "PopoverRoot", "props", "__scopePopover", "children", "open", "openProp", "defaultOpen", "onOpenChange", "modal", "popperScope", "triggerRef", "useRef", "hasCustomAnchor", "setHasCustomAnchor", "useState", "setOpen", "useControllableState", "prop", "defaultProp", "onChange", "React", "Root", "scope", "contentId", "useId", "onOpenToggle", "useCallback", "prevOpen", "onCustomAnchorAdd", "onCustomAnchorRemove", "displayName", "ANCHOR_NAME", "PopoverAnchor", "forwardRef", "forwardedRef", "anchorProps", "context", "useEffect", "Anchor", "ref", "TRIGGER_NAME", "PopoverTrigger", "asChild", "triggerProps", "composedTriggerRef", "useComposedRefs", "Comp", "Slot", "Primitive", "button", "trigger", "type", "aria-haspopup", "aria-expanded", "aria-controls", "data-state", "getState", "onClick", "composeEventHandlers", "VIRTUAL_TRIGGER_NAME", "PopoverVirtualTrigger", "virtualRef", "current", "PORTAL_NAME", "PortalProvider", "usePortalContext", "forceMount", "undefined", "PopoverPortal", "container", "Presence", "present", "PortalPrimitive", "CONTENT_NAME", "PopoverContent", "portalContext", "contentProps", "PopoverContentModal", "PopoverContentNonModal", "contentRef", "composedRefs", "isRightClickOutsideRef", "content", "hideOthers", "RemoveScroll", "as", "allowPinchZoom", "PopoverContentImpl", "trapFocus", "disableOutsidePointerEvents", "onCloseAutoFocus", "event", "preventDefault", "focus", "onPointerDownOutside", "originalEvent", "detail", "ctrlLeftClick", "ctrlKey", "isRightClick", "checkForDefaultPrevented", "onFocusOutside", "hasInteractedOutsideRef", "hasPointerDownOutsideRef", "defaultPrevented", "onInteractOutside", "target", "targetIsTrigger", "contains", "onOpenAutoFocus", "onEscapeKeyDown", "collisionPadding", "collisionBoundary", "classNames", "tx", "useThemeContext", "elevation", "useElevationContext", "safeCollisionPadding", "useSafeCollisionPadding", "useFocusGuards", "computedCollisionBoundary", "useMemo", "closestBoundary", "closest", "Array", "isArray", "FocusScope", "loop", "trapped", "onMountAutoFocus", "onUnmountAutoFocus", "DismissableLayer", "onDismiss", "Content", "role", "id", "className", "style", "CLOSE_NAME", "PopoverClose", "closeProps", "ARROW_NAME", "PopoverArrow", "arrowProps", "Arrow", "PopoverViewport", "constrainInline", "constrainBlock", "div", "Popover", "Trigger", "VirtualTrigger", "Portal", "Close", "Viewport", "DatePickerProvider", "useDatePickerContext", "createContext", "DatePickerRoot", "mode", "value", "defaultValue", "onValueChange", "withTime", "open", "defaultOpen", "onOpenChange", "children", "internalValue", "setInternalValue", "useState", "internalOpen", "setInternalOpen", "controlled", "undefined", "resolvedValue", "setValue", "useCallback", "next", "resolvedOpen", "handleOpenChange", "React", "Popover", "Root", "formatValue", "fmt", "formatDate", "r", "from", "to", "DatePickerTrigger", "forwardRef", "classNames", "format", "placeholder", "icon", "props", "forwardedRef", "tx", "useThemeContext", "t", "useTranslation", "translationKey", "placeholderText", "label", "hasValue", "Trigger", "asChild", "button", "ref", "type", "className", "Icon", "size", "displayName", "DatePickerContent", "Portal", "Content", "align", "sideOffset", "div", "carryTime", "oldDate", "newDate", "out", "Date", "setHours", "getHours", "getMinutes", "DatePickerCalendar", "date", "Calendar", "selected", "onSelect", "merged", "range", "DatePicker", "createContext", "DialogPrimitive", "Primitive", "Slot", "React", "forwardRef", "useTranslation", "osTranslations", "DialogRoot", "props", "React", "ElevationProvider", "elevation", "Root", "aria-describedby", "undefined", "displayName", "DialogTrigger", "Trigger", "DialogPortal", "Portal", "DIALOG_OVERLAY_NAME", "OverlayLayoutProvider", "useOverlayLayoutContext", "createContext", "DialogOverlay", "forwardRef", "classNames", "children", "blockAlign", "forwardedRef", "tx", "useThemeContext", "Overlay", "data-block-align", "className", "ref", "inOverlayLayout", "DIALOG_CONTENT_NAME", "DialogContent", "size", "propsInOverlayLayout", "Content", "Column", "gutter", "DialogHeader", "slottable", "asChild", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "DIALOG_ACTION_ICONS", "close", "delete", "DIALOG_ACTION_LABEL_KEYS", "DialogActionIconButton", "action", "label", "t", "useTranslation", "osTranslations", "IconButton", "icon", "iconOnly", "variant", "DialogBody", "DialogTitle", "srOnly", "Title", "DialogDescription", "Description", "DialogActionBar", "DialogClose", "Close", "Dialog", "Header", "Body", "ActionBar", "ActionIconButton", "AlertDialogPrimitive", "createContext", "React", "forwardRef", "AlertDialogRoot", "props", "React", "ElevationProvider", "elevation", "Root", "AlertDialogTrigger", "Trigger", "AlertDialogPortal", "Portal", "AlertDialogCancel", "Cancel", "AlertDialogAction", "Action", "ALERT_DIALOG_OVERLAY_NAME", "ALERT_DIALOG_CONTENT_NAME", "OverlayLayoutProvider", "useOverlayLayoutContext", "createContext", "inOverlayLayout", "AlertDialogOverlay", "forwardRef", "classNames", "children", "blockAlign", "forwardedRef", "tx", "useThemeContext", "Overlay", "data-block-align", "className", "ref", "displayName", "AlertDialogContent", "size", "Content", "Column", "gutter", "AlertDialogTitle", "srOnly", "Title", "AlertDialogDescription", "Description", "AlertDialog", "Header", "Dialog", "Body", "ActionBar", "ActionIconButton", "ErrorBoundary", "React", "safeStringify", "translationKey", "ErrorFallback", "children", "error", "title", "data", "t", "useTranslation", "translationKey", "isDev", "process", "message", "Error", "String", "React", "div", "role", "data-testid", "className", "h1", "p", "Section", "onClick", "text", "stack", "navigator", "clipboard", "writeText", "ErrorStack", "JSON", "stringify", "undefined", "pre", "safeStringify", "IconButton", "classNames", "label", "icon", "size", "useEffect", "useState", "ThrowError", "delay", "props", "error", "setError", "t", "setTimeout", "generator", "clearTimeout", "Error", "useArrowNavigationGroup", "useFocusableGroup", "useMergedTabsterAttributes_unstable", "useComposedRefs", "Primitive", "Slot", "React", "createContext", "useCallback", "useContext", "useRef", "useState", "FOCUS_STATE_ATTR", "FocusContext", "createContext", "useFocus", "useContext", "Group", "slottable", "children", "asChild", "orientation", "border", "props", "forwardedRef", "Comp", "Slot", "Primitive", "div", "tx", "useThemeContext", "rootRef", "useRef", "focusableGroupAttrs", "useFocusableGroup", "tabBehavior", "arrowNavigationAttrs", "useArrowNavigationGroup", "axis", "memorizeCurrent", "tabsterAttrs", "useMergedTabsterAttributes_unstable", "state", "setState", "useState", "groupHasFocus", "setGroupHasFocus", "handleFocusIn", "useCallback", "handleFocusOut", "event", "related", "relatedTarget", "current", "contains", "className", "rest", "composableProps", "React", "Provider", "value", "setFocus", "tabIndex", "onBlur", "onFocus", "ref", "useComposedRefs", "Item", "onCurrentChange", "onClick", "ignoreDefaultKeydown", "Enter", "focused", "setFocused", "handleClick", "handleKeyDown", "key", "handleFocus", "handleBlur", "isCurrent", "aria-current", "undefined", "onKeyDown", "Focus", "CheckboxPrimitive", "createContext", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "useTranslation", "DescriptionAndValidation", "DescriptionAndValidationPrimitive", "Description", "DescriptionPrimitive", "INPUT_NAME", "InputRoot", "Label", "LabelPrimitive", "PinInput", "PinInputPrimitive", "TextArea", "TextAreaPrimitive", "TextInput", "TextInputPrimitive", "Validation", "ValidationPrimitive", "useInputContext", "mx", "translationKey", "CalendarDate", "CalendarDateTime", "parseDate", "parseDateTime", "parseTime", "useControllableState", "React", "forwardRef", "useCallback", "useState", "DateField", "DateInput", "DateSegment", "TimeField", "INPUT_NAME", "useInputContext", "tryParse", "parser", "value", "pad", "length", "String", "padStart", "formatCalendarDate", "date", "year", "month", "day", "formatCalendarDateTime", "datetime", "hour", "minute", "formatTime", "time", "toCalendarDate", "CalendarDate", "getFullYear", "getMonth", "getDate", "fieldClass", "segmentClass", "BIDI_FORMAT_RE", "renderSegment", "segment", "type", "test", "text", "React", "span", "aria-hidden", "className", "includes", "DateSegment", "useFieldChrome", "__inputScope", "density", "densityProp", "elevation", "elevationProp", "tx", "useThemeContext", "useDensityContext", "useElevationContext", "id", "contextId", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "PickerWrapper", "pickerValue", "onPickerChange", "withTime", "disabled", "children", "calendar", "open", "setOpen", "useState", "openPicker", "useCallback", "useInputTrigger", "undefined", "DatePicker", "Root", "mode", "onValueChange", "onOpenChange", "Popover", "Anchor", "asChild", "Content", "SegmentedDate", "forwardRef", "classNames", "variant", "defaultValue", "autoFocus", "ariaLabel", "forwardedRef", "stringValue", "setStringValue", "useControllableState", "prop", "defaultProp", "onChange", "parsed", "parseDate", "fieldProps", "next", "isDisabled", "granularity", "shouldForceLeadingZeros", "field", "DateField", "DateInput", "ref", "data-density", "Date", "Calendar", "displayName", "SegmentedTime", "hourCycle", "parseTime", "TimeField", "SegmentedDateTime", "parseDateTime", "CalendarDateTime", "getHours", "getMinutes", "InputTriggerProvider", "useInputTriggerContext", "createContext", "INPUT_NAME", "registerTrigger", "trigger", "hasTrigger", "useInputTrigger", "handler", "ctx", "useEffect", "Root", "props", "handlerRef", "useRef", "setHasTrigger", "useState", "useCallback", "current", "React", "InputRoot", "displayName", "TriggerIcon", "forwardRef", "classNames", "icon", "ariaLabel", "label", "forwardedRef", "t", "useTranslation", "translationKey", "IconButton", "ref", "variant", "iconOnly", "aria-label", "onClick", "Label", "children", "srOnly", "tx", "useThemeContext", "LabelPrimitive", "className", "Description", "DescriptionPrimitive", "Validation", "__inputScope", "validationValence", "useInputContext", "ValidationPrimitive", "DescriptionAndValidation", "DescriptionAndValidationPrimitive", "PinInput", "density", "propsDensity", "elevation", "propsElevation", "hasIosKeyboard", "useDensityContext", "useElevationContext", "PinInputPrimitive", "autoFocus", "disabled", "segmentClassName", "TextInput", "densityProp", "elevationProp", "noAutoFill", "TextInputPrimitive", "TextArea", "TextAreaPrimitive", "Checkbox", "checked", "propsChecked", "defaultChecked", "propsDefaultChecked", "onCheckedChange", "propsOnCheckedChange", "size", "useControllableState", "prop", "defaultProp", "onChange", "id", "descriptionId", "errorMessageId", "Icon", "Switch", "input", "type", "mx", "event", "target", "aria-describedby", "Time", "SegmentedTime", "Date", "SegmentedDate", "DateTime", "SegmentedDateTime", "Input", "Primitive", "Slot", "React", "forwardRef", "LIST_ITEM_NAME", "LIST_NAME", "ListItemCollapsibleContent", "List", "ListPrimitive", "ListItem", "ListPrimitiveItem", "ListItemHeading", "ListPrimitiveItemHeading", "ListItemOpenTrigger", "ListPrimitiveItemOpenTrigger", "useListContext", "useListItemContext", "React", "edgeToOrientationMap", "top", "bottom", "left", "right", "orientationStyles", "horizontal", "vertical", "edgeStyles", "strokeSize", "terminalSize", "offsetToAlignTerminalWithLine", "ListDropIndicator", "edge", "gap", "lineInset", "terminalInset", "orientation", "div", "style", "className", "List", "composable", "children", "props", "forwardedRef", "tx", "useThemeContext", "density", "useDensityContext", "className", "rest", "composableProps", "React", "DensityProvider", "ListPrimitive", "ref", "ListItemEndcap", "forwardRef", "classNames", "asChild", "Comp", "Slot", "Primitive", "div", "role", "MockListItemOpenTrigger", "ListItemHeading", "ListPrimitiveItemHeading", "span", "ListItemOpenTrigger", "__listItemScope", "open", "useListItemContext", "LIST_ITEM_NAME", "ListPrimitiveItemOpenTrigger", "Icon", "size", "icon", "ListItemRoot", "ListPrimitiveItem", "collapsible", "ListItem", "Root", "Endcap", "Heading", "OpenTrigger", "CollapsibleContent", "ListItemCollapsibleContent", "MockOpenTrigger", "DropIndicator", "ListDropIndicator", "React", "forwardRef", "React", "edgeToOrientationMap", "reparent", "orientationStyles", "sibling", "child", "instructionStyles", "strokeSize", "terminalSize", "offsetToAlignTerminalWithLine", "TreeDropIndicator", "instruction", "gap", "lineOffset", "isBlocked", "type", "desiredInstruction", "desired", "orientation", "div", "style", "currentLevel", "indentPerLevel", "className", "TreeRoot", "forwardRef", "props", "forwardedRef", "React", "List", "ref", "TreeBranch", "__listScope", "headingId", "useListItemContext", "LIST_ITEM_NAME", "aria-labelledby", "TreeItemRoot", "ListItem", "Root", "role", "TreeItemHeading", "Heading", "TreeItemOpenTrigger", "OpenTrigger", "MockTreeItemOpenTrigger", "MockOpenTrigger", "TreeItemBody", "CollapsibleContent", "Tree", "Branch", "TreeItem", "Body", "DropIndicator", "TreeDropIndicator", "useFocusFinders", "createContextScope", "Primitive", "Slot", "useControllableState", "React", "forwardRef", "useCallback", "TREEGRID_ROW_NAME", "createTreegridRowContext", "createTreegridRowScope", "createContextScope", "TreegridRowProvider", "useTreegridRowContext", "TREEGRID_PATH_SEPARATOR", "TREEGRID_PARENT_OF_SEPARATOR", "TreegridRoot", "composable", "asChild", "classNames", "children", "style", "gridTemplateColumns", "onKeyDown", "onKeyDownProp", "props", "forwardedRef", "tx", "useThemeContext", "className", "role", "_role", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "findFirstFocusable", "useFocusFinders", "handleKeyDown", "useCallback", "event", "key", "direction", "target", "ancestorWithArrowKeys", "closest", "currentRow", "treegrid", "rows", "Array", "from", "querySelectorAll", "currentIndex", "indexOf", "nextIndex", "targetRow", "firstFocusable", "preventDefault", "focus", "React", "ref", "TreegridRow", "forwardRef", "__treegridRowScope", "id", "parentOf", "open", "propsOpen", "defaultOpen", "onOpenChange", "propsOnOpenChange", "pathParts", "split", "level", "length", "useControllableState", "prop", "onChange", "defaultProp", "scope", "aria-level", "TreegridCell", "indent", "Treegrid", "Root", "Row", "Cell", "useFocusableGroup", "createContext", "DialogContent", "Root", "DialogRoot", "DialogTitle", "Primitive", "Slot", "useControllableState", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "addEventListener", "log", "useForwardedRef", "useMediaQuery", "osTranslations", "useCallback", "useEffect", "useState", "useSwipeToDismiss", "ref", "onDismiss", "dismissThreshold", "debounceThreshold", "offset", "$root", "current", "motionState", "setMotionState", "useState", "gestureStartX", "setGestureStartX", "setIdle", "useCallback", "style", "removeProperty", "setProperty", "setFollowing", "handlePointerDown", "screenX", "handlePointerMove", "delta", "Math", "min", "abs", "handlePointerUp", "useEffect", "addEventListener", "removeEventListener", "document", "documentElement", "__dxlog_file", "MAIN_NAME", "MAIN_OVERLAY_NAME", "MAIN_CONTENT_NAME", "NAVIGATION_SIDEBAR_NAME", "COMPLEMENTARY_SIDEBAR_NAME", "handleOpenAutoFocus", "event", "document", "target", "useCallback", "currentTarget", "preventDefault", "landmarks", "Array", "querySelectorAll", "landmarkAttr", "el", "l", "length", "cursor", "indexOf", "parseInt", "getAttribute", "nextLandmark", "querySelector", "focus", "propsOnKeyDown", "ignoreDefaultKeydown", "useFocusableGroup", "tabIndex", "onKeyDown", "handleKeyDown", "focusableGroupAttrs", "navigationSidebarState", "createContext", "setNavigationSidebarState", "complementarySidebarState", "setComplementarySidebarState", "log", "toggleNavigationSidebar", "openNavigationSidebar", "collapseNavigationSidebar", "closeNavigationSidebar", "toggleComplementarySidebar", "openComplementarySidebar", "collapseComplementarySidebar", "closeComplementarySidebar", "useControllableState", "prop", "propsNavigationSidebarState", "defaultProp", "defaultNavigationSidebarState", "onChange", "defaultComplementarySidebarState", "resizing", "useEffect", "addEventListener", "window", "useRef", "resizeInterval", "current", "clearTimeout", "setTimeout", "props", "children", "MainRoot", "displayName", "useMediaQuery", "forwardRef", "useThemeContext", "div", "React", "className", "inlineStartSidebarOpen", "inlineEndSidebarOpen", "classNames", "data-state", "aria-hidden", "ref", "forwardedRef", "MainOverlay", "isLg", "useTranslation", "osTranslations", "useForwardedRef", "noopRef", "useSwipeToDismiss", "swipeToDismiss", "onDismiss", "onStateChange", "focusGroupParent", "stopPropagation", "Root", "open", "state", "Primitive", "DialogContent", "toLocalizedString", "label", "t", "modal", "onOpenAutoFocus", "data-side", "data-resizing", "onKeyDownCapture", "MainNavigationSidebar", "MainSidebar", "side", "MainComplementarySidebar", "Comp", "role", "mover", "useLandmarkMover", "Slot", "handlesFocus", "data-sidebar-left-state", "data-sidebar-right-state", "data-handles-focus", "bounce", "MainContent", "Overlay", "Content", "NavigationSidebar", "ComplementarySidebar", "useSidebars", "createContext", "Primitive", "Slot", "React", "forwardRef", "useTranslation", "useId", "translationKey", "messageIcons", "success", "info", "warning", "error", "neutral", "MESSAGE_NAME", "valenceVars", "MessageProvider", "useMessageContext", "createContext", "MessageRoot", "forwardRef", "asChild", "valence", "elevation", "propsElevation", "classNames", "titleId", "propsTitleId", "descriptionId", "propsDescriptionId", "children", "props", "forwardedRef", "tx", "useThemeContext", "useId", "useElevationContext", "React", "Column", "Root", "role", "aria-labelledby", "aria-describedby", "style", "ref", "displayName", "MESSAGE_TITLE_NAME", "MessageTitle", "icon", "iconProp", "onClose", "t", "useTranslation", "translationKey", "Row", "div", "className", "Icon", "h2", "id", "IconButton", "variant", "iconOnly", "density", "label", "onClick", "MESSAGE_CONTENT_NAME", "MessageContent", "Comp", "Slot", "Primitive", "p", "Message", "Title", "Content", "Callout", "Primitive", "Slot", "React", "GRID_TEMPLATE_ROWS", "GRID_TEMPLATE_AREAS", "PanelRoot", "slottable", "children", "asChild", "role", "style", "props", "forwardedRef", "className", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "tx", "useThemeContext", "React", "gridTemplateRows", "gridTemplateAreas", "ref", "displayName", "PanelToolbar", "size", "data-slot", "PanelContent", "PanelStatusbar", "Panel", "Root", "Toolbar", "Content", "Statusbar", "createContext", "Primitive", "Slot", "React", "useMemo", "scrollbar", "sm", "size", "padding", "md", "lg", "SCROLLAREA_NAME", "ScrollAreaProvider", "useScrollAreaContext", "createContext", "SCROLLAREA_ROOT_NAME", "ScrollAreaRoot", "slottable", "children", "asChild", "orientation", "autoHide", "centered", "padding", "thin", "snap", "props", "forwardedRef", "tx", "useThemeContext", "className", "rest", "composableProps", "Comp", "Slot", "Primitive", "div", "options", "useMemo", "React", "ref", "displayName", "SCROLLAREA_VIEWPORT_NAME", "ScrollAreaViewport", "density", "scrollbar", "md", "lg", "style", "restWithoutStyle", "size", "ScrollArea", "Root", "Viewport", "createContext", "React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "addEventListener", "combine", "invariant", "useMergeRefs", "mx", "__dxlog_file", "ScrollContainerProvider", "useScrollContainerContext", "autoScrollRef", "forwardRef", "setPinned", "useState", "setOverflow", "timeoutRef", "useRef", "undefined", "scrollToBottom", "useCallback", "behavior", "scrollerRef", "current", "clearTimeout", "setTimeout", "classList", "behaviorProp", "scrollToTop", "useImperativeHandle", "pinned", "overflow", "controller", "setViewport", "children", "ScrollContainerRoot", "React", "thin", "padding", "centered", "ref", "ScrollContainerContent", "useMergeRefs", "forwardedRef", "useEffect", "el", "composableProps", "props", "ScrollContainerViewport", "resizeObserver", "observe", "child", "addedNodes", "forEach", "node", "Element", "mutationObserver", "viewport", "data-visible", "ScrollContainerFade", "div", "className", "mx", "IconButton", "variant", "iconOnly", "size", "label", "onClick", "ScrollContainerScrollDownButton", "Content", "ScrollContainerContent", "Viewport", "Fade", "ScrollContainerFade", "ScrollDownButton", "SelectPrimitive", "React", "forwardRef", "SelectRoot", "Root", "SelectTrigger", "Trigger", "SelectValue", "Value", "SelectIcon", "Icon", "SelectPortal", "Portal", "SelectTriggerButton", "forwardRef", "children", "placeholder", "classNames", "props", "forwardedRef", "tx", "useThemeContext", "React", "asChild", "ref", "Button", "size", "icon", "displayName", "SelectContent", "collisionPadding", "elevation", "useElevationContext", "safeCollisionPadding", "useSafeCollisionPadding", "Content", "data-arrow-keys", "className", "position", "SelectScrollUpButton", "SelectScrollDownButton", "SelectViewport", "SelectItem", "Item", "SelectItemText", "ItemText", "SelectItemIndicator", "ItemIndicator", "SelectOption", "span", "SelectGroup", "Group", "SelectLabel", "Label", "SelectSeparator", "Separator", "SelectArrow", "Arrow", "Select", "TriggerButton", "ScrollUpButton", "ScrollDownButton", "Viewport", "Option", "React", "forwardRef", "Skeleton", "forwardRef", "classNames", "variant", "props", "forwardedRef", "tx", "useThemeContext", "React", "div", "className", "ref", "createContextScope", "Primitive", "Slot", "React", "SPLITTER_NAME", "createSplitterContext", "createSplitterScope", "createContextScope", "SplitterProvider", "useSplitterContext", "ROOT_NAME", "SplitterRoot", "slottable", "asChild", "mode", "ratio", "transition", "children", "props", "forwardedRef", "tx", "useThemeContext", "__scopeSplitter", "rest", "className", "restProps", "composableProps", "Comp", "Slot", "Primitive", "div", "React", "scope", "ref", "displayName", "PANEL_NAME", "SplitterPanel", "classNames", "position", "style", "isTopPanel", "topOffset", "height", "top", "Splitter", "Root", "Panel", "React", "forwardRef", "Status", "forwardRef", "classNames", "children", "progress", "indeterminate", "variant", "props", "forwardedRef", "tx", "useThemeContext", "React", "span", "role", "className", "ref", "style", "width", "Math", "round", "Primitive", "Slot", "React", "forwardRef", "Tag", "forwardRef", "asChild", "palette", "classNames", "props", "forwardedRef", "tx", "useThemeContext", "Comp", "Slot", "Primitive", "span", "React", "className", "data-hue", "ref", "ToastPrimitive", "React", "forwardRef", "useTranslation", "translationKey", "ToastProvider", "Provider", "ToastViewport", "forwardRef", "classNames", "props", "forwardedRef", "tx", "useThemeContext", "React", "Viewport", "className", "ref", "displayName", "ToastRoot", "children", "Root", "ElevationProvider", "elevation", "Column", "ToastTitle", "icon", "onClose", "t", "useTranslation", "translationKey", "Row", "div", "Icon", "size", "Title", "IconButton", "variant", "iconOnly", "label", "onClick", "ToastDescription", "Description", "ToastActions", "Center", "DensityProvider", "density", "ToastAction", "Action", "ToastClose", "Close", "Toast", "Actions"]
7
7
  }