@dxos/react-ui 0.1.12 → 0.1.14

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 (493) hide show
  1. package/README.md +83 -5
  2. package/dist/lib/browser/index.mjs +2092 -0
  3. package/dist/lib/browser/index.mjs.map +7 -0
  4. package/dist/lib/browser/meta.json +1 -0
  5. package/dist/plugin/node/esbuild-plugin.cjs +469 -0
  6. package/dist/plugin/node/esbuild-plugin.cjs.map +7 -0
  7. package/dist/plugin/node/meta.json +1 -0
  8. package/dist/plugin/node/plugin.cjs +460 -0
  9. package/dist/plugin/node/plugin.cjs.map +7 -0
  10. package/dist/{src → plugin/node}/theme.css +15 -19
  11. package/dist/plugin/node/theme.css.map +7 -0
  12. package/dist/{src → types/src}/components/Alert/Alert.d.ts +7 -2
  13. package/dist/types/src/components/Alert/Alert.d.ts.map +1 -0
  14. package/dist/{src → types/src}/components/Alert/Alert.stories.d.ts +1 -1
  15. package/dist/types/src/components/Alert/Alert.stories.d.ts.map +1 -0
  16. package/dist/{src → types/src}/components/Alert/index.d.ts +0 -0
  17. package/dist/types/src/components/Alert/index.d.ts.map +1 -0
  18. package/dist/types/src/components/AlertDialog/AlertDialog.d.ts +26 -0
  19. package/dist/types/src/components/AlertDialog/AlertDialog.d.ts.map +1 -0
  20. package/dist/{src → types/src}/components/AlertDialog/AlertDialog.stories.d.ts +1 -1
  21. package/dist/types/src/components/AlertDialog/AlertDialog.stories.d.ts.map +1 -0
  22. package/dist/{src → types/src}/components/AlertDialog/index.d.ts +0 -0
  23. package/dist/types/src/components/AlertDialog/index.d.ts.map +1 -0
  24. package/dist/types/src/components/Avatar/Avatar.d.ts +22 -0
  25. package/dist/types/src/components/Avatar/Avatar.d.ts.map +1 -0
  26. package/dist/types/src/components/Avatar/Avatar.stories.d.ts +12 -0
  27. package/dist/types/src/components/Avatar/Avatar.stories.d.ts.map +1 -0
  28. package/dist/{src → types/src}/components/Avatar/index.d.ts +0 -0
  29. package/dist/types/src/components/Avatar/index.d.ts.map +1 -0
  30. package/dist/types/src/components/Button/Button.d.ts +4 -0
  31. package/dist/types/src/components/Button/Button.d.ts.map +1 -0
  32. package/dist/types/src/components/Button/Button.stories.d.ts +13 -0
  33. package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
  34. package/dist/{src → types/src}/components/Button/ButtonGroup.d.ts +0 -0
  35. package/dist/types/src/components/Button/ButtonGroup.d.ts.map +1 -0
  36. package/dist/{src → types/src}/components/Button/ButtonProps.d.ts +0 -2
  37. package/dist/types/src/components/Button/ButtonProps.d.ts.map +1 -0
  38. package/dist/{src → types/src}/components/Button/buttonStyles.d.ts +0 -0
  39. package/dist/types/src/components/Button/buttonStyles.d.ts.map +1 -0
  40. package/dist/{src → types/src}/components/Button/index.d.ts +0 -0
  41. package/dist/types/src/components/Button/index.d.ts.map +1 -0
  42. package/dist/{src → types/src}/components/CompoundButton/CompoundButton.d.ts +0 -0
  43. package/dist/types/src/components/CompoundButton/CompoundButton.d.ts.map +1 -0
  44. package/dist/{src → types/src}/components/CompoundButton/CompoundButton.stories.d.ts +0 -0
  45. package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts.map +1 -0
  46. package/dist/{src → types/src}/components/CompoundButton/index.d.ts +0 -0
  47. package/dist/types/src/components/CompoundButton/index.d.ts.map +1 -0
  48. package/dist/types/src/components/Dialog/Dialog.d.ts +26 -0
  49. package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
  50. package/dist/{src → types/src}/components/Dialog/Dialog.stories.d.ts +1 -1
  51. package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
  52. package/dist/{src → types/src}/components/Dialog/index.d.ts +0 -0
  53. package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
  54. package/dist/{src → types/src}/components/Group/Group.d.ts +1 -1
  55. package/dist/types/src/components/Group/Group.d.ts.map +1 -0
  56. package/dist/{src → types/src}/components/Group/Group.stories.d.ts +1 -1
  57. package/dist/types/src/components/Group/Group.stories.d.ts.map +1 -0
  58. package/dist/{src → types/src}/components/Group/index.d.ts +0 -0
  59. package/dist/types/src/components/Group/index.d.ts.map +1 -0
  60. package/dist/{src → types/src}/components/Heading/Heading.d.ts +5 -8
  61. package/dist/types/src/components/Heading/Heading.d.ts.map +1 -0
  62. package/dist/{src → types/src}/components/Heading/Heading.stories.d.ts +5 -8
  63. package/dist/{src → types/src}/components/Heading/Heading.stories.d.ts.map +1 -1
  64. package/dist/{src → types/src}/components/Heading/index.d.ts +0 -0
  65. package/dist/types/src/components/Heading/index.d.ts.map +1 -0
  66. package/dist/{src → types/src}/components/Input/BarePinInput.d.ts +17 -16
  67. package/dist/types/src/components/Input/BarePinInput.d.ts.map +1 -0
  68. package/dist/types/src/components/Input/BareTextInput.d.ts +7 -0
  69. package/dist/types/src/components/Input/BareTextInput.d.ts.map +1 -0
  70. package/dist/types/src/components/Input/BareTextareaInput.d.ts +7 -0
  71. package/dist/types/src/components/Input/BareTextareaInput.d.ts.map +1 -0
  72. package/dist/types/src/components/Input/Input.d.ts +4 -0
  73. package/dist/types/src/components/Input/Input.d.ts.map +1 -0
  74. package/dist/{src → types/src}/components/Input/Input.stories.d.ts +1 -1
  75. package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -0
  76. package/dist/types/src/components/Input/InputProps.d.ts +37 -0
  77. package/dist/types/src/components/Input/InputProps.d.ts.map +1 -0
  78. package/dist/{src → types/src}/components/Input/index.d.ts +0 -0
  79. package/dist/types/src/components/Input/index.d.ts.map +1 -0
  80. package/dist/types/src/components/Loading/Loading.d.ts +15 -0
  81. package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
  82. package/dist/{src → types/src}/components/Loading/Loading.stories.d.ts +1 -3
  83. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
  84. package/dist/{src → types/src}/components/Loading/index.d.ts +0 -0
  85. package/dist/types/src/components/Loading/index.d.ts.map +1 -0
  86. package/dist/{src → types/src}/components/NavMenu/NavMenu.d.ts +11 -3
  87. package/dist/types/src/components/NavMenu/NavMenu.d.ts.map +1 -0
  88. package/dist/{src → types/src}/components/NavMenu/NavMenu.stories.d.ts +1 -1
  89. package/dist/types/src/components/NavMenu/NavMenu.stories.d.ts.map +1 -0
  90. package/dist/{src → types/src}/components/NavMenu/index.d.ts +0 -0
  91. package/dist/types/src/components/NavMenu/index.d.ts.map +1 -0
  92. package/dist/types/src/components/Popover/Popover.d.ts +21 -0
  93. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -0
  94. package/dist/{src → types/src}/components/Popover/Popover.stories.d.ts +1 -1
  95. package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -0
  96. package/dist/{src → types/src}/components/Popover/index.d.ts +0 -0
  97. package/dist/types/src/components/Popover/index.d.ts.map +1 -0
  98. package/dist/types/src/components/QrCode/QrCode.d.ts +39 -0
  99. package/dist/types/src/components/QrCode/QrCode.d.ts.map +1 -0
  100. package/dist/{src → types/src}/components/QrCode/QrCode.stories.d.ts +1 -1
  101. package/dist/types/src/components/QrCode/QrCode.stories.d.ts.map +1 -0
  102. package/dist/{src → types/src}/components/QrCode/index.d.ts +0 -0
  103. package/dist/types/src/components/QrCode/index.d.ts.map +1 -0
  104. package/dist/types/src/components/Tag/Tag.d.ts +8 -0
  105. package/dist/types/src/components/Tag/Tag.d.ts.map +1 -0
  106. package/dist/{src → types/src}/components/Tag/Tag.stories.d.ts +1 -1
  107. package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -0
  108. package/dist/{src → types/src}/components/Tag/index.d.ts +0 -0
  109. package/dist/types/src/components/Tag/index.d.ts.map +1 -0
  110. package/dist/{src → types/src}/components/Toast/Toast.d.ts +10 -1
  111. package/dist/types/src/components/Toast/Toast.d.ts.map +1 -0
  112. package/dist/{src → types/src}/components/Toast/Toast.stories.d.ts +1 -1
  113. package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -0
  114. package/dist/{src → types/src}/components/Toast/index.d.ts +0 -0
  115. package/dist/types/src/components/Toast/index.d.ts.map +1 -0
  116. package/dist/types/src/components/Tooltip/Tooltip.d.ts +19 -0
  117. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -0
  118. package/dist/{src → types/src}/components/Tooltip/Tooltip.stories.d.ts +1 -1
  119. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -0
  120. package/dist/{src → types/src}/components/Tooltip/index.d.ts +0 -0
  121. package/dist/types/src/components/Tooltip/index.d.ts.map +1 -0
  122. package/dist/{src → types/src}/components/UiProvider/UiProvider.d.ts +1 -1
  123. package/dist/types/src/components/UiProvider/UiProvider.d.ts.map +1 -0
  124. package/dist/{src → types/src}/components/UiProvider/index.d.ts +0 -0
  125. package/dist/types/src/components/UiProvider/index.d.ts.map +1 -0
  126. package/dist/{src → types/src}/components/index.d.ts +0 -0
  127. package/dist/types/src/components/index.d.ts.map +1 -0
  128. package/dist/types/src/config/index.d.ts +2 -0
  129. package/dist/types/src/config/index.d.ts.map +1 -0
  130. package/dist/types/src/config/tailwind.d.ts +7 -0
  131. package/dist/types/src/config/tailwind.d.ts.map +1 -0
  132. package/dist/types/src/esbuild-plugin.d.ts +6 -0
  133. package/dist/types/src/esbuild-plugin.d.ts.map +1 -0
  134. package/dist/{src → types/src}/hooks/index.d.ts +0 -0
  135. package/dist/types/src/hooks/index.d.ts.map +1 -0
  136. package/dist/{src → types/src}/hooks/useForwardedRef.d.ts +0 -0
  137. package/dist/types/src/hooks/useForwardedRef.d.ts.map +1 -0
  138. package/dist/{src → types/src}/hooks/useId.d.ts +0 -0
  139. package/dist/types/src/hooks/useId.d.ts.map +1 -0
  140. package/dist/{src → types/src}/hooks/useIsFocused.d.ts +0 -0
  141. package/dist/types/src/hooks/useIsFocused.d.ts.map +1 -0
  142. package/dist/{src → types/src}/index.d.ts +3 -2
  143. package/dist/types/src/index.d.ts.map +1 -0
  144. package/dist/{src → types/src}/plugin.d.ts +1 -1
  145. package/dist/types/src/plugin.d.ts.map +1 -0
  146. package/dist/types/src/props/Elevation.d.ts +2 -0
  147. package/dist/types/src/props/Elevation.d.ts.map +1 -0
  148. package/dist/types/src/props/MessageValence.d.ts +2 -0
  149. package/dist/types/src/props/MessageValence.d.ts.map +1 -0
  150. package/dist/types/src/props/Size.d.ts +2 -0
  151. package/dist/types/src/props/Size.d.ts.map +1 -0
  152. package/dist/{src → types/src}/props/index.d.ts +0 -0
  153. package/dist/types/src/props/index.d.ts.map +1 -0
  154. package/dist/{src → types/src}/styles/active.d.ts +0 -0
  155. package/dist/types/src/styles/active.d.ts.map +1 -0
  156. package/dist/{src → types/src}/styles/disabled.d.ts +0 -0
  157. package/dist/types/src/styles/disabled.d.ts.map +1 -0
  158. package/dist/{src → types/src}/styles/focus.d.ts +0 -0
  159. package/dist/types/src/styles/focus.d.ts.map +1 -0
  160. package/dist/{src → types/src}/styles/group.d.ts +0 -0
  161. package/dist/types/src/styles/group.d.ts.map +1 -0
  162. package/dist/{src → types/src}/styles/hover.d.ts +0 -0
  163. package/dist/types/src/styles/hover.d.ts.map +1 -0
  164. package/dist/{src → types/src}/styles/index.d.ts +0 -0
  165. package/dist/types/src/styles/index.d.ts.map +1 -0
  166. package/dist/types/src/styles/input.d.ts +11 -0
  167. package/dist/types/src/styles/input.d.ts.map +1 -0
  168. package/dist/{src → types/src}/styles/ornament.d.ts +0 -0
  169. package/dist/types/src/styles/ornament.d.ts.map +1 -0
  170. package/dist/{src → types/src}/styles/shimmer.d.ts +0 -0
  171. package/dist/types/src/styles/shimmer.d.ts.map +1 -0
  172. package/dist/{src → types/src}/styles/size.d.ts +1 -1
  173. package/dist/types/src/styles/size.d.ts.map +1 -0
  174. package/dist/{src → types/src}/styles/text.d.ts +0 -0
  175. package/dist/types/src/styles/text.d.ts.map +1 -0
  176. package/dist/{src → types/src}/styles/valence.d.ts +0 -0
  177. package/dist/types/src/styles/valence.d.ts.map +1 -0
  178. package/dist/{src → types/src}/testing/index.d.ts +0 -0
  179. package/dist/types/src/testing/index.d.ts.map +1 -0
  180. package/dist/{src → types/src}/testing/templateForComponent.d.ts +0 -0
  181. package/dist/types/src/testing/templateForComponent.d.ts.map +1 -0
  182. package/dist/types/src/util/index.d.ts +2 -0
  183. package/dist/types/src/util/index.d.ts.map +1 -0
  184. package/dist/types/src/util/mx.d.ts +2 -0
  185. package/dist/types/src/util/mx.d.ts.map +1 -0
  186. package/dist/types/src/util/withLogical.d.ts +3 -0
  187. package/dist/types/src/util/withLogical.d.ts.map +1 -0
  188. package/package.json +9 -5
  189. package/plugin.d.ts +1 -1
  190. package/plugin.js +1 -1
  191. package/src/components/Alert/Alert.tsx +12 -6
  192. package/src/components/AlertDialog/AlertDialog.tsx +31 -11
  193. package/src/components/Avatar/Avatar.tsx +35 -13
  194. package/src/components/Button/Button.tsx +11 -13
  195. package/src/components/Button/ButtonGroup.tsx +3 -2
  196. package/src/components/Button/ButtonProps.ts +0 -2
  197. package/src/components/Button/buttonStyles.ts +4 -7
  198. package/src/components/CompoundButton/CompoundButton.tsx +3 -3
  199. package/src/components/Dialog/Dialog.tsx +47 -14
  200. package/src/components/Group/Group.tsx +10 -5
  201. package/src/components/Heading/Heading.tsx +5 -4
  202. package/src/components/Input/BarePinInput.tsx +18 -13
  203. package/src/components/Input/BareTextInput.tsx +18 -15
  204. package/src/components/Input/BareTextareaInput.tsx +17 -16
  205. package/src/components/Input/Input.tsx +17 -23
  206. package/src/components/Input/InputProps.ts +23 -11
  207. package/src/components/Loading/Loading.tsx +18 -8
  208. package/src/components/NavMenu/NavMenu.stories.tsx +1 -1
  209. package/src/components/NavMenu/NavMenu.tsx +42 -19
  210. package/src/components/Popover/Popover.stories.tsx +7 -3
  211. package/src/components/Popover/Popover.tsx +54 -20
  212. package/src/components/QrCode/QrCode.tsx +61 -49
  213. package/src/components/Tag/Tag.tsx +6 -6
  214. package/src/components/Toast/Toast.tsx +48 -26
  215. package/src/components/Tooltip/Tooltip.tsx +32 -13
  216. package/src/components/UiProvider/UiProvider.tsx +3 -3
  217. package/src/config/index.ts +5 -0
  218. package/src/config/tailwind.ts +250 -0
  219. package/src/esbuild-plugin.ts +42 -0
  220. package/src/index.ts +3 -2
  221. package/src/plugin.ts +5 -240
  222. package/src/styles/active.ts +2 -2
  223. package/src/styles/group.ts +2 -3
  224. package/src/styles/input.ts +7 -26
  225. package/src/styles/size.ts +3 -4
  226. package/src/typings.d.ts +0 -1
  227. package/src/util/index.ts +5 -0
  228. package/src/util/mx.ts +28 -0
  229. package/src/util/withLogical.ts +103 -0
  230. package/dist/src/components/Alert/Alert.d.ts.map +0 -1
  231. package/dist/src/components/Alert/Alert.js +0 -21
  232. package/dist/src/components/Alert/Alert.js.map +0 -1
  233. package/dist/src/components/Alert/Alert.stories.d.ts.map +0 -1
  234. package/dist/src/components/Alert/Alert.stories.js +0 -30
  235. package/dist/src/components/Alert/Alert.stories.js.map +0 -1
  236. package/dist/src/components/Alert/index.d.ts.map +0 -1
  237. package/dist/src/components/Alert/index.js +0 -21
  238. package/dist/src/components/Alert/index.js.map +0 -1
  239. package/dist/src/components/AlertDialog/AlertDialog.d.ts +0 -17
  240. package/dist/src/components/AlertDialog/AlertDialog.d.ts.map +0 -1
  241. package/dist/src/components/AlertDialog/AlertDialog.js +0 -65
  242. package/dist/src/components/AlertDialog/AlertDialog.js.map +0 -1
  243. package/dist/src/components/AlertDialog/AlertDialog.stories.d.ts.map +0 -1
  244. package/dist/src/components/AlertDialog/AlertDialog.stories.js +0 -37
  245. package/dist/src/components/AlertDialog/AlertDialog.stories.js.map +0 -1
  246. package/dist/src/components/AlertDialog/index.d.ts.map +0 -1
  247. package/dist/src/components/AlertDialog/index.js +0 -21
  248. package/dist/src/components/AlertDialog/index.js.map +0 -1
  249. package/dist/src/components/Avatar/Avatar.d.ts +0 -13
  250. package/dist/src/components/Avatar/Avatar.d.ts.map +0 -1
  251. package/dist/src/components/Avatar/Avatar.js +0 -53
  252. package/dist/src/components/Avatar/Avatar.js.map +0 -1
  253. package/dist/src/components/Avatar/Avatar.stories.d.ts +0 -10
  254. package/dist/src/components/Avatar/Avatar.stories.d.ts.map +0 -1
  255. package/dist/src/components/Avatar/Avatar.stories.js +0 -30
  256. package/dist/src/components/Avatar/Avatar.stories.js.map +0 -1
  257. package/dist/src/components/Avatar/index.d.ts.map +0 -1
  258. package/dist/src/components/Avatar/index.js +0 -21
  259. package/dist/src/components/Avatar/index.js.map +0 -1
  260. package/dist/src/components/Button/Button.d.ts +0 -4
  261. package/dist/src/components/Button/Button.d.ts.map +0 -1
  262. package/dist/src/components/Button/Button.js +0 -37
  263. package/dist/src/components/Button/Button.js.map +0 -1
  264. package/dist/src/components/Button/Button.stories.d.ts +0 -13
  265. package/dist/src/components/Button/Button.stories.d.ts.map +0 -1
  266. package/dist/src/components/Button/Button.stories.js +0 -33
  267. package/dist/src/components/Button/Button.stories.js.map +0 -1
  268. package/dist/src/components/Button/ButtonGroup.d.ts.map +0 -1
  269. package/dist/src/components/Button/ButtonGroup.js +0 -16
  270. package/dist/src/components/Button/ButtonGroup.js.map +0 -1
  271. package/dist/src/components/Button/ButtonProps.d.ts.map +0 -1
  272. package/dist/src/components/Button/ButtonProps.js +0 -6
  273. package/dist/src/components/Button/ButtonProps.js.map +0 -1
  274. package/dist/src/components/Button/buttonStyles.d.ts.map +0 -1
  275. package/dist/src/components/Button/buttonStyles.js +0 -26
  276. package/dist/src/components/Button/buttonStyles.js.map +0 -1
  277. package/dist/src/components/Button/index.d.ts.map +0 -1
  278. package/dist/src/components/Button/index.js +0 -24
  279. package/dist/src/components/Button/index.js.map +0 -1
  280. package/dist/src/components/CompoundButton/CompoundButton.d.ts.map +0 -1
  281. package/dist/src/components/CompoundButton/CompoundButton.js +0 -27
  282. package/dist/src/components/CompoundButton/CompoundButton.js.map +0 -1
  283. package/dist/src/components/CompoundButton/CompoundButton.stories.d.ts.map +0 -1
  284. package/dist/src/components/CompoundButton/CompoundButton.stories.js +0 -40
  285. package/dist/src/components/CompoundButton/CompoundButton.stories.js.map +0 -1
  286. package/dist/src/components/CompoundButton/index.d.ts.map +0 -1
  287. package/dist/src/components/CompoundButton/index.js +0 -21
  288. package/dist/src/components/CompoundButton/index.js.map +0 -1
  289. package/dist/src/components/Dialog/Dialog.d.ts +0 -14
  290. package/dist/src/components/Dialog/Dialog.d.ts.map +0 -1
  291. package/dist/src/components/Dialog/Dialog.js +0 -59
  292. package/dist/src/components/Dialog/Dialog.js.map +0 -1
  293. package/dist/src/components/Dialog/Dialog.stories.d.ts.map +0 -1
  294. package/dist/src/components/Dialog/Dialog.stories.js +0 -37
  295. package/dist/src/components/Dialog/Dialog.stories.js.map +0 -1
  296. package/dist/src/components/Dialog/index.d.ts.map +0 -1
  297. package/dist/src/components/Dialog/index.js +0 -21
  298. package/dist/src/components/Dialog/index.js.map +0 -1
  299. package/dist/src/components/Group/Group.d.ts.map +0 -1
  300. package/dist/src/components/Group/Group.js +0 -22
  301. package/dist/src/components/Group/Group.js.map +0 -1
  302. package/dist/src/components/Group/Group.stories.d.ts.map +0 -1
  303. package/dist/src/components/Group/Group.stories.js +0 -27
  304. package/dist/src/components/Group/Group.stories.js.map +0 -1
  305. package/dist/src/components/Group/index.d.ts.map +0 -1
  306. package/dist/src/components/Group/index.js +0 -21
  307. package/dist/src/components/Group/index.js.map +0 -1
  308. package/dist/src/components/Heading/Heading.d.ts.map +0 -1
  309. package/dist/src/components/Heading/Heading.js +0 -28
  310. package/dist/src/components/Heading/Heading.js.map +0 -1
  311. package/dist/src/components/Heading/Heading.stories.js +0 -34
  312. package/dist/src/components/Heading/Heading.stories.js.map +0 -1
  313. package/dist/src/components/Heading/index.d.ts.map +0 -1
  314. package/dist/src/components/Heading/index.js +0 -21
  315. package/dist/src/components/Heading/index.js.map +0 -1
  316. package/dist/src/components/Input/BarePinInput.d.ts.map +0 -1
  317. package/dist/src/components/Input/BarePinInput.js +0 -62
  318. package/dist/src/components/Input/BarePinInput.js.map +0 -1
  319. package/dist/src/components/Input/BareTextInput.d.ts +0 -5
  320. package/dist/src/components/Input/BareTextInput.d.ts.map +0 -1
  321. package/dist/src/components/Input/BareTextInput.js +0 -29
  322. package/dist/src/components/Input/BareTextInput.js.map +0 -1
  323. package/dist/src/components/Input/BareTextareaInput.d.ts +0 -5
  324. package/dist/src/components/Input/BareTextareaInput.d.ts.map +0 -1
  325. package/dist/src/components/Input/BareTextareaInput.js +0 -23
  326. package/dist/src/components/Input/BareTextareaInput.js.map +0 -1
  327. package/dist/src/components/Input/Input.d.ts +0 -4
  328. package/dist/src/components/Input/Input.d.ts.map +0 -1
  329. package/dist/src/components/Input/Input.js +0 -87
  330. package/dist/src/components/Input/Input.js.map +0 -1
  331. package/dist/src/components/Input/Input.stories.d.ts.map +0 -1
  332. package/dist/src/components/Input/Input.stories.js +0 -86
  333. package/dist/src/components/Input/Input.stories.js.map +0 -1
  334. package/dist/src/components/Input/InputProps.d.ts +0 -26
  335. package/dist/src/components/Input/InputProps.d.ts.map +0 -1
  336. package/dist/src/components/Input/InputProps.js +0 -6
  337. package/dist/src/components/Input/InputProps.js.map +0 -1
  338. package/dist/src/components/Input/index.d.ts.map +0 -1
  339. package/dist/src/components/Input/index.js +0 -21
  340. package/dist/src/components/Input/index.js.map +0 -1
  341. package/dist/src/components/Loading/Loading.d.ts +0 -12
  342. package/dist/src/components/Loading/Loading.d.ts.map +0 -1
  343. package/dist/src/components/Loading/Loading.js +0 -29
  344. package/dist/src/components/Loading/Loading.js.map +0 -1
  345. package/dist/src/components/Loading/Loading.stories.d.ts.map +0 -1
  346. package/dist/src/components/Loading/Loading.stories.js +0 -39
  347. package/dist/src/components/Loading/Loading.stories.js.map +0 -1
  348. package/dist/src/components/Loading/index.d.ts.map +0 -1
  349. package/dist/src/components/Loading/index.js +0 -21
  350. package/dist/src/components/Loading/index.js.map +0 -1
  351. package/dist/src/components/NavMenu/NavMenu.d.ts.map +0 -1
  352. package/dist/src/components/NavMenu/NavMenu.js +0 -71
  353. package/dist/src/components/NavMenu/NavMenu.js.map +0 -1
  354. package/dist/src/components/NavMenu/NavMenu.stories.d.ts.map +0 -1
  355. package/dist/src/components/NavMenu/NavMenu.stories.js +0 -50
  356. package/dist/src/components/NavMenu/NavMenu.stories.js.map +0 -1
  357. package/dist/src/components/NavMenu/index.d.ts.map +0 -1
  358. package/dist/src/components/NavMenu/index.js +0 -21
  359. package/dist/src/components/NavMenu/index.js.map +0 -1
  360. package/dist/src/components/Popover/Popover.d.ts +0 -11
  361. package/dist/src/components/Popover/Popover.d.ts.map +0 -1
  362. package/dist/src/components/Popover/Popover.js +0 -56
  363. package/dist/src/components/Popover/Popover.js.map +0 -1
  364. package/dist/src/components/Popover/Popover.stories.d.ts.map +0 -1
  365. package/dist/src/components/Popover/Popover.stories.js +0 -39
  366. package/dist/src/components/Popover/Popover.stories.js.map +0 -1
  367. package/dist/src/components/Popover/index.d.ts.map +0 -1
  368. package/dist/src/components/Popover/index.js +0 -21
  369. package/dist/src/components/Popover/index.js.map +0 -1
  370. package/dist/src/components/QrCode/QrCode.d.ts +0 -22
  371. package/dist/src/components/QrCode/QrCode.d.ts.map +0 -1
  372. package/dist/src/components/QrCode/QrCode.js +0 -79
  373. package/dist/src/components/QrCode/QrCode.js.map +0 -1
  374. package/dist/src/components/QrCode/QrCode.stories.d.ts.map +0 -1
  375. package/dist/src/components/QrCode/QrCode.stories.js +0 -42
  376. package/dist/src/components/QrCode/QrCode.stories.js.map +0 -1
  377. package/dist/src/components/QrCode/index.d.ts.map +0 -1
  378. package/dist/src/components/QrCode/index.js +0 -21
  379. package/dist/src/components/QrCode/index.js.map +0 -1
  380. package/dist/src/components/Tag/Tag.d.ts +0 -8
  381. package/dist/src/components/Tag/Tag.d.ts.map +0 -1
  382. package/dist/src/components/Tag/Tag.js +0 -23
  383. package/dist/src/components/Tag/Tag.js.map +0 -1
  384. package/dist/src/components/Tag/Tag.stories.d.ts.map +0 -1
  385. package/dist/src/components/Tag/Tag.stories.js +0 -24
  386. package/dist/src/components/Tag/Tag.stories.js.map +0 -1
  387. package/dist/src/components/Tag/index.d.ts.map +0 -1
  388. package/dist/src/components/Tag/index.js +0 -21
  389. package/dist/src/components/Tag/index.js.map +0 -1
  390. package/dist/src/components/Toast/Toast.d.ts.map +0 -1
  391. package/dist/src/components/Toast/Toast.js +0 -54
  392. package/dist/src/components/Toast/Toast.js.map +0 -1
  393. package/dist/src/components/Toast/Toast.stories.d.ts.map +0 -1
  394. package/dist/src/components/Toast/Toast.stories.js +0 -32
  395. package/dist/src/components/Toast/Toast.stories.js.map +0 -1
  396. package/dist/src/components/Toast/index.d.ts.map +0 -1
  397. package/dist/src/components/Toast/index.js +0 -21
  398. package/dist/src/components/Toast/index.js.map +0 -1
  399. package/dist/src/components/Tooltip/Tooltip.d.ts +0 -12
  400. package/dist/src/components/Tooltip/Tooltip.d.ts.map +0 -1
  401. package/dist/src/components/Tooltip/Tooltip.js +0 -50
  402. package/dist/src/components/Tooltip/Tooltip.js.map +0 -1
  403. package/dist/src/components/Tooltip/Tooltip.stories.d.ts.map +0 -1
  404. package/dist/src/components/Tooltip/Tooltip.stories.js +0 -30
  405. package/dist/src/components/Tooltip/Tooltip.stories.js.map +0 -1
  406. package/dist/src/components/Tooltip/index.d.ts.map +0 -1
  407. package/dist/src/components/Tooltip/index.js +0 -21
  408. package/dist/src/components/Tooltip/index.js.map +0 -1
  409. package/dist/src/components/UiProvider/UiProvider.d.ts.map +0 -1
  410. package/dist/src/components/UiProvider/UiProvider.js +0 -21
  411. package/dist/src/components/UiProvider/UiProvider.js.map +0 -1
  412. package/dist/src/components/UiProvider/index.d.ts.map +0 -1
  413. package/dist/src/components/UiProvider/index.js +0 -21
  414. package/dist/src/components/UiProvider/index.js.map +0 -1
  415. package/dist/src/components/index.d.ts.map +0 -1
  416. package/dist/src/components/index.js +0 -37
  417. package/dist/src/components/index.js.map +0 -1
  418. package/dist/src/hooks/index.d.ts.map +0 -1
  419. package/dist/src/hooks/index.js +0 -23
  420. package/dist/src/hooks/index.js.map +0 -1
  421. package/dist/src/hooks/useForwardedRef.d.ts.map +0 -1
  422. package/dist/src/hooks/useForwardedRef.js +0 -24
  423. package/dist/src/hooks/useForwardedRef.js.map +0 -1
  424. package/dist/src/hooks/useId.d.ts.map +0 -1
  425. package/dist/src/hooks/useId.js +0 -20
  426. package/dist/src/hooks/useId.js.map +0 -1
  427. package/dist/src/hooks/useIsFocused.d.ts.map +0 -1
  428. package/dist/src/hooks/useIsFocused.js +0 -34
  429. package/dist/src/hooks/useIsFocused.js.map +0 -1
  430. package/dist/src/index.d.ts.map +0 -1
  431. package/dist/src/index.js +0 -24
  432. package/dist/src/index.js.map +0 -1
  433. package/dist/src/plugin.d.ts.map +0 -1
  434. package/dist/src/plugin.js +0 -276
  435. package/dist/src/plugin.js.map +0 -1
  436. package/dist/src/props/Elevation.d.ts +0 -2
  437. package/dist/src/props/Elevation.d.ts.map +0 -1
  438. package/dist/src/props/Elevation.js +0 -6
  439. package/dist/src/props/Elevation.js.map +0 -1
  440. package/dist/src/props/MessageValence.d.ts +0 -2
  441. package/dist/src/props/MessageValence.d.ts.map +0 -1
  442. package/dist/src/props/MessageValence.js +0 -6
  443. package/dist/src/props/MessageValence.js.map +0 -1
  444. package/dist/src/props/Size.d.ts +0 -2
  445. package/dist/src/props/Size.d.ts.map +0 -1
  446. package/dist/src/props/Size.js +0 -6
  447. package/dist/src/props/Size.js.map +0 -1
  448. package/dist/src/props/index.d.ts.map +0 -1
  449. package/dist/src/props/index.js +0 -23
  450. package/dist/src/props/index.js.map +0 -1
  451. package/dist/src/styles/active.d.ts.map +0 -1
  452. package/dist/src/styles/active.js +0 -12
  453. package/dist/src/styles/active.js.map +0 -1
  454. package/dist/src/styles/disabled.d.ts.map +0 -1
  455. package/dist/src/styles/disabled.js +0 -8
  456. package/dist/src/styles/disabled.js.map +0 -1
  457. package/dist/src/styles/focus.d.ts.map +0 -1
  458. package/dist/src/styles/focus.js +0 -9
  459. package/dist/src/styles/focus.js.map +0 -1
  460. package/dist/src/styles/group.d.ts.map +0 -1
  461. package/dist/src/styles/group.js +0 -26
  462. package/dist/src/styles/group.js.map +0 -1
  463. package/dist/src/styles/hover.d.ts.map +0 -1
  464. package/dist/src/styles/hover.js +0 -12
  465. package/dist/src/styles/hover.js.map +0 -1
  466. package/dist/src/styles/index.d.ts.map +0 -1
  467. package/dist/src/styles/index.js +0 -30
  468. package/dist/src/styles/index.js.map +0 -1
  469. package/dist/src/styles/input.d.ts +0 -17
  470. package/dist/src/styles/input.d.ts.map +0 -1
  471. package/dist/src/styles/input.js +0 -24
  472. package/dist/src/styles/input.js.map +0 -1
  473. package/dist/src/styles/ornament.d.ts.map +0 -1
  474. package/dist/src/styles/ornament.js +0 -9
  475. package/dist/src/styles/ornament.js.map +0 -1
  476. package/dist/src/styles/shimmer.d.ts.map +0 -1
  477. package/dist/src/styles/shimmer.js +0 -9
  478. package/dist/src/styles/shimmer.js.map +0 -1
  479. package/dist/src/styles/size.d.ts.map +0 -1
  480. package/dist/src/styles/size.js +0 -89
  481. package/dist/src/styles/size.js.map +0 -1
  482. package/dist/src/styles/text.d.ts.map +0 -1
  483. package/dist/src/styles/text.js +0 -11
  484. package/dist/src/styles/text.js.map +0 -1
  485. package/dist/src/styles/valence.d.ts.map +0 -1
  486. package/dist/src/styles/valence.js +0 -66
  487. package/dist/src/styles/valence.js.map +0 -1
  488. package/dist/src/testing/index.d.ts.map +0 -1
  489. package/dist/src/testing/index.js +0 -21
  490. package/dist/src/testing/index.js.map +0 -1
  491. package/dist/src/testing/templateForComponent.d.ts.map +0 -1
  492. package/dist/src/testing/templateForComponent.js +0 -18
  493. package/dist/src/testing/templateForComponent.js.map +0 -1
@@ -0,0 +1,2092 @@
1
+ // packages/common/react-ui/src/components/Alert/Alert.tsx
2
+ import React from "react";
3
+
4
+ // packages/common/react-ui/src/hooks/useId.ts
5
+ import alea from "alea";
6
+ import { useMemo } from "react";
7
+ var Alea = alea;
8
+ var prng = new Alea("@dxos/react-ui");
9
+ var randomString = (n = 4) => prng().toString(16).slice(2, n + 2);
10
+ var useId = (namespace, n) => useMemo(() => `${namespace}-${randomString(n)}`, []);
11
+
12
+ // packages/common/react-ui/src/hooks/useForwardedRef.ts
13
+ import { useRef, useEffect } from "react";
14
+ var useForwardedRef = (ref) => {
15
+ const innerRef = useRef(null);
16
+ useEffect(() => {
17
+ if (!ref) {
18
+ return;
19
+ }
20
+ if (typeof ref === "function") {
21
+ ref(innerRef.current);
22
+ } else {
23
+ ref.current = innerRef.current;
24
+ }
25
+ });
26
+ return innerRef;
27
+ };
28
+
29
+ // packages/common/react-ui/src/hooks/useIsFocused.ts
30
+ import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
31
+ var useIsFocused = (inputRef) => {
32
+ const [isFocused, setIsFocused] = useState(void 0);
33
+ const isFocusedRef = useRef2(isFocused);
34
+ isFocusedRef.current = isFocused;
35
+ useEffect2(() => {
36
+ const input = inputRef.current;
37
+ if (!input) {
38
+ return;
39
+ }
40
+ const onFocus = () => setIsFocused(true);
41
+ const onBlur = () => setIsFocused(false);
42
+ input.addEventListener("focus", onFocus);
43
+ input.addEventListener("blur", onBlur);
44
+ if (isFocusedRef.current === void 0) {
45
+ setIsFocused(document.activeElement === input);
46
+ }
47
+ return () => {
48
+ input.removeEventListener("focus", onFocus);
49
+ input.removeEventListener("blur", onBlur);
50
+ };
51
+ }, [
52
+ inputRef,
53
+ setIsFocused
54
+ ]);
55
+ return isFocused;
56
+ };
57
+
58
+ // packages/common/react-ui/src/util/mx.ts
59
+ import { extendTailwindMerge, validators as validators2 } from "tailwind-merge";
60
+
61
+ // packages/common/react-ui/src/util/withLogical.ts
62
+ import { mergeConfigs, validators } from "tailwind-merge";
63
+ var withLogical = (prevConfig) => {
64
+ const getLength = () => [
65
+ validators.isLength
66
+ ];
67
+ const getLengthWithAuto = () => [
68
+ "auto",
69
+ validators.isLength
70
+ ];
71
+ const getLengthWithEmpty = () => [
72
+ "",
73
+ validators.isLength
74
+ ];
75
+ const getAny = () => [
76
+ validators.isAny
77
+ ];
78
+ const getRounded = () => [
79
+ "none",
80
+ "",
81
+ "sm",
82
+ "md",
83
+ "lg",
84
+ "xl",
85
+ "2xl",
86
+ "3xl",
87
+ "full",
88
+ validators.isArbitraryLength
89
+ ];
90
+ return mergeConfigs(prevConfig, {
91
+ classGroups: {
92
+ float: [
93
+ {
94
+ float: [
95
+ "start",
96
+ "end"
97
+ ]
98
+ }
99
+ ],
100
+ clear: [
101
+ {
102
+ clear: [
103
+ "start",
104
+ "end"
105
+ ]
106
+ }
107
+ ],
108
+ resize: [
109
+ {
110
+ resize: [
111
+ "block ",
112
+ "inline"
113
+ ]
114
+ }
115
+ ],
116
+ "text-alignment": [
117
+ {
118
+ text: [
119
+ "start",
120
+ "end"
121
+ ]
122
+ }
123
+ ],
124
+ "logical.overscroll-b": [
125
+ {
126
+ "overscroll-b": [
127
+ "auto ",
128
+ "contain",
129
+ "auto"
130
+ ]
131
+ }
132
+ ],
133
+ "logical.overscroll-i": [
134
+ {
135
+ "overscroll-b": [
136
+ "auto ",
137
+ "contain",
138
+ "auto"
139
+ ]
140
+ }
141
+ ],
142
+ "logical.bs": [
143
+ {
144
+ bs: getLength()
145
+ }
146
+ ],
147
+ "logical.min-bs": [
148
+ {
149
+ "min-bs": getLength()
150
+ }
151
+ ],
152
+ "logical.max-bs": [
153
+ {
154
+ "max-bs": getLength()
155
+ }
156
+ ],
157
+ "logical.is": [
158
+ {
159
+ is: getLength()
160
+ }
161
+ ],
162
+ "logical.min-is": [
163
+ {
164
+ "min-is": getLength()
165
+ }
166
+ ],
167
+ "logical.max-is": [
168
+ {
169
+ "max-is": getLength()
170
+ }
171
+ ],
172
+ "logical.mlb": [
173
+ {
174
+ mlb: getLength()
175
+ }
176
+ ],
177
+ "logical.mli": [
178
+ {
179
+ mli: getLength()
180
+ }
181
+ ],
182
+ "logical.mbs": [
183
+ {
184
+ mbs: getLength()
185
+ }
186
+ ],
187
+ "logical.mbe": [
188
+ {
189
+ mbe: getLength()
190
+ }
191
+ ],
192
+ "logical.mis": [
193
+ {
194
+ mis: getLength()
195
+ }
196
+ ],
197
+ "logical.mie": [
198
+ {
199
+ mie: getLength()
200
+ }
201
+ ],
202
+ "logical.plb": [
203
+ {
204
+ plb: getLength()
205
+ }
206
+ ],
207
+ "logical.pli": [
208
+ {
209
+ pli: getLength()
210
+ }
211
+ ],
212
+ "logical.pbs": [
213
+ {
214
+ pbs: getLength()
215
+ }
216
+ ],
217
+ "logical.pbe": [
218
+ {
219
+ pbe: getLength()
220
+ }
221
+ ],
222
+ "logical.pis": [
223
+ {
224
+ pis: getLength()
225
+ }
226
+ ],
227
+ "logical.pie": [
228
+ {
229
+ pie: getLength()
230
+ }
231
+ ],
232
+ "logical.space-b": [
233
+ {
234
+ "space-b": getLength()
235
+ }
236
+ ],
237
+ "logical.space-i": [
238
+ {
239
+ "space-i": getLength()
240
+ }
241
+ ],
242
+ "logical.inset-block": [
243
+ {
244
+ "inset-block": getLengthWithAuto()
245
+ }
246
+ ],
247
+ "logical.inset-inline": [
248
+ {
249
+ "inset-inline": getLengthWithAuto()
250
+ }
251
+ ],
252
+ "logical.block-start": [
253
+ {
254
+ "block-start": getLengthWithAuto()
255
+ }
256
+ ],
257
+ "logical.block-end": [
258
+ {
259
+ "block-end": getLengthWithAuto()
260
+ }
261
+ ],
262
+ "logical.inline-start": [
263
+ {
264
+ "inline-start": getLengthWithAuto()
265
+ }
266
+ ],
267
+ "logical.inline-end": [
268
+ {
269
+ "inline-end": getLengthWithAuto()
270
+ }
271
+ ],
272
+ "logical.border-bs": [
273
+ {
274
+ "border-bs": getLengthWithEmpty()
275
+ }
276
+ ],
277
+ "logical.border-be": [
278
+ {
279
+ "border-be": getLengthWithEmpty()
280
+ }
281
+ ],
282
+ "logical.border-is": [
283
+ {
284
+ "border-is": getLengthWithEmpty()
285
+ }
286
+ ],
287
+ "logical.border-ie": [
288
+ {
289
+ "border-ie": getLengthWithEmpty()
290
+ }
291
+ ],
292
+ "logical.border-color-bs": [
293
+ {
294
+ "border-bs": getAny()
295
+ }
296
+ ],
297
+ "logical.border-color-be": [
298
+ {
299
+ "border-be": getAny()
300
+ }
301
+ ],
302
+ "logical.border-color-is": [
303
+ {
304
+ "border-is": getAny()
305
+ }
306
+ ],
307
+ "logical.border-color-ie": [
308
+ {
309
+ "border-ie": getAny()
310
+ }
311
+ ],
312
+ "logical.rounded-bs": [
313
+ {
314
+ "rounded-bs": getRounded()
315
+ }
316
+ ],
317
+ "logical.rounded-be": [
318
+ {
319
+ "rounded-be": getRounded()
320
+ }
321
+ ],
322
+ "logical.rounded-is": [
323
+ {
324
+ "rounded-is": getRounded()
325
+ }
326
+ ],
327
+ "logical.rounded-ie": [
328
+ {
329
+ "rounded-ie": getRounded()
330
+ }
331
+ ],
332
+ "logical.rounded-ss": [
333
+ {
334
+ "rounded-ss": getRounded()
335
+ }
336
+ ],
337
+ "logical.rounded-se": [
338
+ {
339
+ "rounded-se": getRounded()
340
+ }
341
+ ],
342
+ "logical.rounded-es": [
343
+ {
344
+ "rounded-es": getRounded()
345
+ }
346
+ ],
347
+ "logical.rounded-ee": [
348
+ {
349
+ "rounded-ee": getRounded()
350
+ }
351
+ ],
352
+ "logical.divide-b": [
353
+ {
354
+ "divide-b": getLengthWithEmpty()
355
+ }
356
+ ],
357
+ "logical.divide-i": [
358
+ {
359
+ "divide-i": getLengthWithEmpty()
360
+ }
361
+ ]
362
+ },
363
+ conflictingClassGroups: {
364
+ "inset-block": [
365
+ "logical.block-start",
366
+ "logical.block-end"
367
+ ],
368
+ "inset-inline": [
369
+ "logical.inline-start",
370
+ "logical.inline-end"
371
+ ],
372
+ p: [
373
+ "logical.plb",
374
+ "logical.pli",
375
+ "logical.pbs",
376
+ "logical.pbe",
377
+ "logical.pis",
378
+ "logical.pie"
379
+ ],
380
+ pli: [
381
+ "logical.pis",
382
+ "logical.pie"
383
+ ],
384
+ plb: [
385
+ "logical.pbs",
386
+ "logical.pbe"
387
+ ],
388
+ m: [
389
+ "logical.mlb",
390
+ "logical.mli",
391
+ "logical.mbs",
392
+ "logical.mbe",
393
+ "logical.mis",
394
+ "logical.mie"
395
+ ],
396
+ mli: [
397
+ "logical.mis",
398
+ "logical.mie"
399
+ ],
400
+ mlb: [
401
+ "logical.mbs",
402
+ "logical.mbe"
403
+ ],
404
+ overscroll: [
405
+ "overscroll-i",
406
+ "overscroll-b"
407
+ ],
408
+ rounded: [
409
+ "logical.rounded-bs",
410
+ "logical.rounded-be",
411
+ "logical.rounded-is",
412
+ "logical.rounded-ie",
413
+ "logical.rounded-ss",
414
+ "logical.rounded-se",
415
+ "logical.rounded-es",
416
+ "logical.rounded-ee"
417
+ ],
418
+ "logical.rounded-bs": [
419
+ "logical.rounded-ss",
420
+ "logical.rounded-se"
421
+ ],
422
+ "logical.rounded-be": [
423
+ "logical.rounded-es",
424
+ "logical.rounded-ee"
425
+ ],
426
+ "logical.rounded-is": [
427
+ "logical.rounded-ss",
428
+ "logical.rounded-es"
429
+ ],
430
+ "logical.rounded-ie": [
431
+ "logical.rounded-ee",
432
+ "logical.rounded-se"
433
+ ],
434
+ "border-color": [
435
+ "logical.border-color-bs",
436
+ "logical.border-color-be",
437
+ "logical.border-color-is",
438
+ "logical.border-color-ie"
439
+ ],
440
+ border: [
441
+ "logical.border-bs",
442
+ "logical.border-be",
443
+ "logical.border-is",
444
+ "logical.border-ie"
445
+ ]
446
+ }
447
+ });
448
+ };
449
+
450
+ // packages/common/react-ui/src/util/mx.ts
451
+ var mx = extendTailwindMerge({
452
+ classGroups: {
453
+ fontFamily: [
454
+ "font-body",
455
+ "font-display",
456
+ "font-mono"
457
+ ],
458
+ fontWeight: [
459
+ "font-thin",
460
+ "font-extralight",
461
+ "font-light",
462
+ "font-normal",
463
+ "font-medium",
464
+ "font-semibold",
465
+ "font-bold",
466
+ "font-extrabold",
467
+ "font-black",
468
+ validators2.isArbitraryNumber
469
+ ]
470
+ }
471
+ }, withLogical);
472
+
473
+ // packages/common/react-ui/src/styles/active.ts
474
+ var defaultActive = mx("radix-state-open:outline-2 radix-state-open:outline-offset-1 radix-state-open:outline-primary-300 radix-state-open:outline-offset-transparent dark:radix-state-open:outline-primary-400 dark:radix-state-open:outline-offset-transparent", "radix-state-on:outline-2 radix-state-on:outline-offset-1 radix-state-on:outline-primary-300 radix-state-on:outline-offset-transparent dark:radix-state-on:outline-primary-400 dark:radix-state-on:outline-offset-transparent", "radix-state-instant-open:outline-2 radix-state-instant-open:outline-offset-1 radix-state-instant-open:outline-primary-300 radix-state-instant-open:outline-offset-transparent dark:radix-state-instant-open:outline-primary-400 dark:radix-state-instant-open:outline-offset-transparent");
475
+
476
+ // packages/common/react-ui/src/styles/disabled.ts
477
+ var defaultDisabled = "opacity-50 cursor-not-allowed shadow-none";
478
+
479
+ // packages/common/react-ui/src/styles/focus.ts
480
+ var defaultFocus = "focus:outline-none focus-visible:z-[1] focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring focus-visible:ring-offset-1 focus-visible:ring-primary-500 focus-visible:ring-offset-white dark:focus-visible:ring-primary-200 dark:focus-visible:ring-offset-black";
481
+ var staticFocus = "ring ring-offset-1 ring-primary-500 ring-offset-white dark:ring-primary-200 dark:ring-offset-black";
482
+
483
+ // packages/common/react-ui/src/styles/group.ts
484
+ var elevationClassNameMap = /* @__PURE__ */ new Map([
485
+ [
486
+ 0,
487
+ "shadow-none"
488
+ ],
489
+ [
490
+ 1,
491
+ "shadow-sm"
492
+ ],
493
+ [
494
+ 2,
495
+ "shadow"
496
+ ],
497
+ [
498
+ 3,
499
+ "shadow-md"
500
+ ],
501
+ [
502
+ 4,
503
+ "shadow-lg"
504
+ ],
505
+ [
506
+ 5,
507
+ "shadow-xl"
508
+ ],
509
+ [
510
+ 6,
511
+ "shadow-2xl"
512
+ ]
513
+ ]);
514
+ var defaultGroup = ({ elevation, rounding, spacing }) => {
515
+ return mx(rounding != null ? rounding : "rounded-lg", spacing != null ? spacing : "p-4", elevation === 0 ? "bg-transparent border border-neutral-200 dark:border-neutral-700" : "bg-white dark:bg-neutral-800 elevated-buttons", elevationClassNameMap.get(elevation));
516
+ };
517
+
518
+ // packages/common/react-ui/src/styles/hover.ts
519
+ var defaultHover = ({ disabled }) => {
520
+ return !disabled && "outline outline-3 outline-transparent hover:z-[1] hover:outline-primary-300 dark:hover:outline-primary-400 hover:focus:outline-primary-300 dark:hover:focus:outline-primary-400";
521
+ };
522
+
523
+ // packages/common/react-ui/src/styles/ornament.ts
524
+ var defaultInlineSeparator = "border-is border-neutral-300 dark:border-neutral-700";
525
+ var defaultBlockSeparator = "border-bs border-neutral-300 dark:border-neutral-700";
526
+
527
+ // packages/common/react-ui/src/styles/shimmer.ts
528
+ var defaultShimmer = "relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-neutral-100/10 before:to-transparent isolate overflow-hidden";
529
+ var strongShimmer = "relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-primary-100/80 before:to-transparent isolate overflow-hidden";
530
+
531
+ // packages/common/react-ui/src/styles/size.ts
532
+ var sizeWidthMap = /* @__PURE__ */ new Map([
533
+ [
534
+ 0,
535
+ "w-0"
536
+ ],
537
+ [
538
+ "px",
539
+ "w-px"
540
+ ],
541
+ [
542
+ 0.5,
543
+ "w-0.5"
544
+ ],
545
+ [
546
+ 1,
547
+ "w-1"
548
+ ],
549
+ [
550
+ 1.5,
551
+ "w-1.5"
552
+ ],
553
+ [
554
+ 2,
555
+ "w-2"
556
+ ],
557
+ [
558
+ 2.5,
559
+ "w-2.5"
560
+ ],
561
+ [
562
+ 3,
563
+ "w-3"
564
+ ],
565
+ [
566
+ 3.5,
567
+ "w-3.5"
568
+ ],
569
+ [
570
+ 4,
571
+ "w-4"
572
+ ],
573
+ [
574
+ 5,
575
+ "w-5"
576
+ ],
577
+ [
578
+ 6,
579
+ "w-6"
580
+ ],
581
+ [
582
+ 7,
583
+ "w-7"
584
+ ],
585
+ [
586
+ 8,
587
+ "w-8"
588
+ ],
589
+ [
590
+ 9,
591
+ "w-9"
592
+ ],
593
+ [
594
+ 10,
595
+ "w-10"
596
+ ],
597
+ [
598
+ 11,
599
+ "w-11"
600
+ ],
601
+ [
602
+ 12,
603
+ "w-12"
604
+ ],
605
+ [
606
+ 14,
607
+ "w-14"
608
+ ],
609
+ [
610
+ 16,
611
+ "w-16"
612
+ ],
613
+ [
614
+ 20,
615
+ "w-20"
616
+ ],
617
+ [
618
+ 24,
619
+ "w-24"
620
+ ],
621
+ [
622
+ 28,
623
+ "w-28"
624
+ ],
625
+ [
626
+ 32,
627
+ "w-32"
628
+ ],
629
+ [
630
+ 36,
631
+ "w-36"
632
+ ],
633
+ [
634
+ 40,
635
+ "w-40"
636
+ ],
637
+ [
638
+ 44,
639
+ "w-44"
640
+ ],
641
+ [
642
+ 48,
643
+ "w-48"
644
+ ],
645
+ [
646
+ 52,
647
+ "w-52"
648
+ ],
649
+ [
650
+ 56,
651
+ "w-56"
652
+ ],
653
+ [
654
+ 60,
655
+ "w-60"
656
+ ],
657
+ [
658
+ 64,
659
+ "w-64"
660
+ ],
661
+ [
662
+ 72,
663
+ "w-72"
664
+ ],
665
+ [
666
+ 80,
667
+ "w-80"
668
+ ],
669
+ [
670
+ 96,
671
+ "w-96"
672
+ ]
673
+ ]);
674
+ var sizeHeightMap = /* @__PURE__ */ new Map([
675
+ [
676
+ 0,
677
+ "h-0"
678
+ ],
679
+ [
680
+ "px",
681
+ "h-px"
682
+ ],
683
+ [
684
+ 0.5,
685
+ "h-0.5"
686
+ ],
687
+ [
688
+ 1,
689
+ "h-1"
690
+ ],
691
+ [
692
+ 1.5,
693
+ "h-1.5"
694
+ ],
695
+ [
696
+ 2,
697
+ "h-2"
698
+ ],
699
+ [
700
+ 2.5,
701
+ "h-2.5"
702
+ ],
703
+ [
704
+ 3,
705
+ "h-3"
706
+ ],
707
+ [
708
+ 3.5,
709
+ "h-3.5"
710
+ ],
711
+ [
712
+ 4,
713
+ "h-4"
714
+ ],
715
+ [
716
+ 5,
717
+ "h-5"
718
+ ],
719
+ [
720
+ 6,
721
+ "h-6"
722
+ ],
723
+ [
724
+ 7,
725
+ "h-7"
726
+ ],
727
+ [
728
+ 8,
729
+ "h-8"
730
+ ],
731
+ [
732
+ 9,
733
+ "h-9"
734
+ ],
735
+ [
736
+ 10,
737
+ "h-10"
738
+ ],
739
+ [
740
+ 11,
741
+ "h-11"
742
+ ],
743
+ [
744
+ 12,
745
+ "h-12"
746
+ ],
747
+ [
748
+ 14,
749
+ "h-14"
750
+ ],
751
+ [
752
+ 16,
753
+ "h-16"
754
+ ],
755
+ [
756
+ 20,
757
+ "h-20"
758
+ ],
759
+ [
760
+ 24,
761
+ "h-24"
762
+ ],
763
+ [
764
+ 28,
765
+ "h-28"
766
+ ],
767
+ [
768
+ 32,
769
+ "h-32"
770
+ ],
771
+ [
772
+ 36,
773
+ "h-36"
774
+ ],
775
+ [
776
+ 40,
777
+ "h-40"
778
+ ],
779
+ [
780
+ 44,
781
+ "h-44"
782
+ ],
783
+ [
784
+ 48,
785
+ "h-48"
786
+ ],
787
+ [
788
+ 52,
789
+ "h-52"
790
+ ],
791
+ [
792
+ 56,
793
+ "h-56"
794
+ ],
795
+ [
796
+ 60,
797
+ "h-60"
798
+ ],
799
+ [
800
+ 64,
801
+ "h-64"
802
+ ],
803
+ [
804
+ 72,
805
+ "h-72"
806
+ ],
807
+ [
808
+ 80,
809
+ "h-80"
810
+ ],
811
+ [
812
+ 96,
813
+ "h-96"
814
+ ]
815
+ ]);
816
+ var getSizeHeight = sizeHeightMap.get.bind(sizeHeightMap);
817
+ var getSizeWidth = sizeWidthMap.get.bind(sizeWidthMap);
818
+ var getSize = (size) => mx(getSizeHeight(size), getSizeWidth(size));
819
+
820
+ // packages/common/react-ui/src/styles/text.ts
821
+ var defaultPlaceholder = "placeholder-neutral-500 dark:placeholder-neutral-400";
822
+ var defaultDescription = "text-xs font-normal text-neutral-650 dark:text-neutral-300";
823
+ var primaryDescription = "text-xs font-normal text-white/90";
824
+ var defaultTooltip = "text-xs font-normal text-neutral-900 dark:text-neutral-50";
825
+
826
+ // packages/common/react-ui/src/styles/valence.ts
827
+ var successText = "text-xs font-medium text-success-700 dark:text-success-300";
828
+ var infoText = "text-xs font-medium text-info-700 dark:text-info-300";
829
+ var warningText = "text-xs font-medium text-warning-700 dark:text-warning-300";
830
+ var errorText = "text-xs font-medium text-error-700 dark:text-error-300";
831
+ var valenceColorText = (valence) => {
832
+ switch (valence) {
833
+ case "success":
834
+ return successText;
835
+ case "info":
836
+ return infoText;
837
+ case "warning":
838
+ return warningText;
839
+ case "error":
840
+ return errorText;
841
+ default:
842
+ return void 0;
843
+ }
844
+ };
845
+ var neutralInputBorder = "border-neutral-500 dark:border-neutral-600";
846
+ var successInputBorder = "border-success-500 dark:border-success-600";
847
+ var infoInputBorder = "border-info-500 dark:border-info-600";
848
+ var warningInputBorder = "border-warning-500 dark:border-warning-600";
849
+ var errorInputBorder = "border-error-500 dark:border-error-600";
850
+ var valenceInputBorder = (valence) => {
851
+ switch (valence) {
852
+ case "success":
853
+ return successInputBorder;
854
+ case "info":
855
+ return infoInputBorder;
856
+ case "warning":
857
+ return warningInputBorder;
858
+ case "error":
859
+ return errorInputBorder;
860
+ default:
861
+ return neutralInputBorder;
862
+ }
863
+ };
864
+ var neutralAlertColors = "border-neutral-500 dark:border-neutral-600";
865
+ var successAlertColors = "border-success-500 dark:border-success-600 text-success-700 dark:text-success-100 bg-success-50 dark:bg-success-900";
866
+ var infoAlertColors = "border-info-500 dark:border-info-600 text-info-700 dark:text-info-100 bg-info-50 dark:bg-info-900";
867
+ var warningAlertColors = "border-warning-500 dark:border-warning-600 text-warning-700 dark:text-warning-100 bg-warning-50 dark:bg-warning-900";
868
+ var errorAlertColors = "border-error-500 dark:border-error-600 text-error-700 dark:text-error-100 bg-error-50 dark:bg-error-900";
869
+ var valenceAlertColors = (valence) => {
870
+ switch (valence) {
871
+ case "success":
872
+ return successAlertColors;
873
+ case "info":
874
+ return infoAlertColors;
875
+ case "warning":
876
+ return warningAlertColors;
877
+ case "error":
878
+ return errorAlertColors;
879
+ default:
880
+ return neutralAlertColors;
881
+ }
882
+ };
883
+
884
+ // packages/common/react-ui/src/components/Alert/Alert.tsx
885
+ function _extends() {
886
+ _extends = Object.assign || function(target) {
887
+ for (var i = 1; i < arguments.length; i++) {
888
+ var source = arguments[i];
889
+ for (var key in source) {
890
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
891
+ target[key] = source[key];
892
+ }
893
+ }
894
+ }
895
+ return target;
896
+ };
897
+ return _extends.apply(this, arguments);
898
+ }
899
+ var Alert = ({ title, children, assertive, valence, slots = {} }) => {
900
+ var _a, _b;
901
+ const labelId = useId("alertLabel");
902
+ return /* @__PURE__ */ React.createElement("div", _extends({}, slots.root, {
903
+ role: assertive ? "alert" : "group",
904
+ "aria-labelledby": labelId,
905
+ className: mx("p-3 border rounded-md", valenceAlertColors(valence), (_a = slots.root) == null ? void 0 : _a.className)
906
+ }), /* @__PURE__ */ React.createElement("p", _extends({}, slots.title, {
907
+ id: labelId,
908
+ className: mx("font-medium mb-2", (_b = slots.title) == null ? void 0 : _b.className)
909
+ }), title), children);
910
+ };
911
+
912
+ // packages/common/react-ui/src/components/AlertDialog/AlertDialog.tsx
913
+ import { Transition } from "@headlessui/react";
914
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
915
+ import React6, { cloneElement, Fragment, useEffect as useEffect3, useState as useState3 } from "react";
916
+
917
+ // packages/common/react-ui/src/components/Input/Input.tsx
918
+ import React5, { useCallback as useCallback2, useState as useState2, useTransition } from "react";
919
+
920
+ // packages/common/react-ui/src/components/Input/BarePinInput.tsx
921
+ import { CodeInput, getSegmentCssWidth } from "rci";
922
+ import React2, { forwardRef, useCallback } from "react";
923
+
924
+ // packages/common/react-ui/src/styles/input.ts
925
+ var defaultInput = ({ disabled, validationValence }) => {
926
+ return mx("text-base border rounded bg-white/50 text-neutral-900 dark:bg-neutral-700/50 dark:text-white", defaultFocus, defaultPlaceholder, defaultHover({
927
+ disabled
928
+ }), valenceInputBorder(validationValence), disabled && defaultDisabled);
929
+ };
930
+ var staticInput = ({ disabled, focused, validationValence }) => {
931
+ return mx(defaultPlaceholder, "text-base border rounded bg-white/50 text-neutral-900 dark:bg-neutral-700/50 dark:text-white", valenceInputBorder(validationValence), disabled && defaultDisabled, focused && staticFocus);
932
+ };
933
+
934
+ // packages/common/react-ui/src/components/Input/BarePinInput.tsx
935
+ function _extends2() {
936
+ _extends2 = Object.assign || function(target) {
937
+ for (var i = 1; i < arguments.length; i++) {
938
+ var source = arguments[i];
939
+ for (var key in source) {
940
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
941
+ target[key] = source[key];
942
+ }
943
+ }
944
+ }
945
+ return target;
946
+ };
947
+ return _extends2.apply(this, arguments);
948
+ }
949
+ var bareInputStyleProps = {
950
+ padding: "8px",
951
+ spacing: "8px",
952
+ fontFamily: ""
953
+ };
954
+ var BarePinInput = /* @__PURE__ */ forwardRef(({ initialValue, size, validationMessage, validationValence, value, onChange, placeholder, disabled, inputSlot }, ref) => {
955
+ const width = getSegmentCssWidth("13px");
956
+ const inputRef = useForwardedRef(ref);
957
+ const inputFocused = useIsFocused(inputRef);
958
+ const renderSegment = useCallback(({ state, index }) => /* @__PURE__ */ React2.createElement("div", {
959
+ key: index,
960
+ className: staticInput({
961
+ focused: inputFocused && !!state,
962
+ disabled,
963
+ ...validationMessage && {
964
+ validationValence
965
+ }
966
+ }),
967
+ "data-state": state,
968
+ style: {
969
+ width,
970
+ height: "100%"
971
+ }
972
+ }), [
973
+ inputFocused,
974
+ validationValence,
975
+ validationMessage,
976
+ disabled
977
+ ]);
978
+ return /* @__PURE__ */ React2.createElement(CodeInput, _extends2({}, {
979
+ spellCheck: false,
980
+ ...bareInputStyleProps,
981
+ ...inputSlot,
982
+ placeholder,
983
+ onChange,
984
+ inputRef,
985
+ renderSegment,
986
+ className: mx("font-mono selection:bg-transparent mli-auto", disabled && "cursor-not-allowed", inputSlot == null ? void 0 : inputSlot.className)
987
+ }));
988
+ });
989
+
990
+ // packages/common/react-ui/src/components/Input/BareTextInput.tsx
991
+ import React3 from "react";
992
+ function _extends3() {
993
+ _extends3 = Object.assign || function(target) {
994
+ for (var i = 1; i < arguments.length; i++) {
995
+ var source = arguments[i];
996
+ for (var key in source) {
997
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
998
+ target[key] = source[key];
999
+ }
1000
+ }
1001
+ }
1002
+ return target;
1003
+ };
1004
+ return _extends3.apply(this, arguments);
1005
+ }
1006
+ var sizeMap = {
1007
+ md: "text-base",
1008
+ lg: "text-lg",
1009
+ pin: "",
1010
+ textarea: ""
1011
+ };
1012
+ var BareTextInput = ({ validationValence, validationMessage, size, disabled, placeholder, onChange, value, inputSlot }) => {
1013
+ return /* @__PURE__ */ React3.createElement("input", _extends3({}, inputSlot, {
1014
+ placeholder,
1015
+ onChange,
1016
+ value,
1017
+ className: mx(defaultInput({
1018
+ disabled,
1019
+ ...validationMessage && {
1020
+ validationValence
1021
+ }
1022
+ }), sizeMap[size != null ? size : "md"], "block w-full px-2.5 py-2", inputSlot == null ? void 0 : inputSlot.className)
1023
+ }));
1024
+ };
1025
+
1026
+ // packages/common/react-ui/src/components/Input/BareTextareaInput.tsx
1027
+ import React4 from "react";
1028
+ function _extends4() {
1029
+ _extends4 = Object.assign || function(target) {
1030
+ for (var i = 1; i < arguments.length; i++) {
1031
+ var source = arguments[i];
1032
+ for (var key in source) {
1033
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1034
+ target[key] = source[key];
1035
+ }
1036
+ }
1037
+ }
1038
+ return target;
1039
+ };
1040
+ return _extends4.apply(this, arguments);
1041
+ }
1042
+ var BareTextareaInput = ({ validationValence, validationMessage, onChange, value, disabled, placeholder, inputSlot }) => {
1043
+ return /* @__PURE__ */ React4.createElement("textarea", _extends4({}, inputSlot, {
1044
+ placeholder,
1045
+ onChange,
1046
+ value,
1047
+ className: mx(defaultInput({
1048
+ disabled,
1049
+ ...validationMessage && {
1050
+ validationValence
1051
+ }
1052
+ }), "block w-full px-2.5 py-2", inputSlot == null ? void 0 : inputSlot.className)
1053
+ }));
1054
+ };
1055
+
1056
+ // packages/common/react-ui/src/components/Input/Input.tsx
1057
+ function _extends5() {
1058
+ _extends5 = Object.assign || function(target) {
1059
+ for (var i = 1; i < arguments.length; i++) {
1060
+ var source = arguments[i];
1061
+ for (var key in source) {
1062
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1063
+ target[key] = source[key];
1064
+ }
1065
+ }
1066
+ }
1067
+ return target;
1068
+ };
1069
+ return _extends5.apply(this, arguments);
1070
+ }
1071
+ var Input = ({ label, labelVisuallyHidden, description, descriptionVisuallyHidden, initialValue, onChange, disabled, placeholder, size, length = 6, validationMessage, validationValence, slots = {} }) => {
1072
+ var _a, _b, _c, _d, _e, _f, _g;
1073
+ const inputId = (_b = (_a = slots.input) == null ? void 0 : _a.id) != null ? _b : useId("input");
1074
+ const descriptionId = useId("input-description");
1075
+ const validationId = useId("input-validation");
1076
+ const isInvalid = !!validationMessage && validationValence === "error";
1077
+ const [_isPending, startTransition] = useTransition();
1078
+ const [internalValue, setInternalValue] = useState2((initialValue == null ? void 0 : initialValue.toString()) || "");
1079
+ const onInternalChange = useCallback2((e) => {
1080
+ var _a2;
1081
+ const nextValue = ((_a2 = e.target) == null ? void 0 : _a2.value) || "";
1082
+ setInternalValue(nextValue);
1083
+ onChange && startTransition(() => {
1084
+ onChange(nextValue);
1085
+ });
1086
+ }, [
1087
+ onChange
1088
+ ]);
1089
+ const bareInputBaseProps = {
1090
+ ...slots.input,
1091
+ id: inputId,
1092
+ ...((_c = slots.input) == null ? void 0 : _c.required) && {
1093
+ required: true
1094
+ },
1095
+ ...disabled && {
1096
+ disabled: true
1097
+ },
1098
+ ...description && {
1099
+ "aria-describedby": descriptionId
1100
+ },
1101
+ ...isInvalid && {
1102
+ "aria-invalid": "true",
1103
+ "aria-errormessage": validationId
1104
+ },
1105
+ placeholder,
1106
+ value: internalValue,
1107
+ onChange: onInternalChange,
1108
+ inputSlot: slots.input,
1109
+ validationMessage,
1110
+ validationValence
1111
+ };
1112
+ const bareInput = size === "pin" ? /* @__PURE__ */ React5.createElement(BarePinInput, _extends5({}, bareInputBaseProps, {
1113
+ length
1114
+ })) : size === "textarea" ? /* @__PURE__ */ React5.createElement(BareTextareaInput, _extends5({}, bareInputBaseProps)) : /* @__PURE__ */ React5.createElement(BareTextInput, _extends5({}, bareInputBaseProps, {
1115
+ size
1116
+ }));
1117
+ return /* @__PURE__ */ React5.createElement("div", {
1118
+ role: "none",
1119
+ className: mx("mlb-4", (_d = slots.root) == null ? void 0 : _d.className)
1120
+ }, /* @__PURE__ */ React5.createElement("label", _extends5({}, slots.label, {
1121
+ htmlFor: inputId,
1122
+ className: mx("block pbe-1 text-sm font-medium text-neutral-900 dark:text-neutral-100", labelVisuallyHidden && "sr-only", (_e = slots.label) == null ? void 0 : _e.className)
1123
+ }), label), bareInput, (description || validationMessage) && /* @__PURE__ */ React5.createElement("p", _extends5({}, !isInvalid && {
1124
+ id: descriptionId
1125
+ }, {
1126
+ className: mx(descriptionVisuallyHidden && !isInvalid && "sr-only")
1127
+ }), validationMessage && /* @__PURE__ */ React5.createElement("span", {
1128
+ id: validationId,
1129
+ className: mx(valenceColorText(validationValence), (_f = slots.validation) == null ? void 0 : _f.className)
1130
+ }, validationMessage, " "), /* @__PURE__ */ React5.createElement("span", _extends5({}, isInvalid && {
1131
+ id: descriptionId
1132
+ }, {
1133
+ className: mx(defaultDescription, descriptionVisuallyHidden && "sr-only", (_g = slots.description) == null ? void 0 : _g.className)
1134
+ }), description)));
1135
+ };
1136
+
1137
+ // packages/common/react-ui/src/components/AlertDialog/AlertDialog.tsx
1138
+ function _extends6() {
1139
+ _extends6 = Object.assign || function(target) {
1140
+ for (var i = 1; i < arguments.length; i++) {
1141
+ var source = arguments[i];
1142
+ for (var key in source) {
1143
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1144
+ target[key] = source[key];
1145
+ }
1146
+ }
1147
+ }
1148
+ return target;
1149
+ };
1150
+ return _extends6.apply(this, arguments);
1151
+ }
1152
+ var AlertDialog = ({ title, titleVisuallyHidden, description, openTrigger, cancelTrigger, confirmTrigger, destructiveConfirmString, destructiveConfirmInputProps, children, initiallyOpen, mountAsSibling, slots = {} }) => {
1153
+ var _a, _b, _c, _d, _e;
1154
+ const [isOpen, setIsOpen] = useState3(!!initiallyOpen);
1155
+ const [confirmDisabled, setConfirmDisabled] = useState3(!!destructiveConfirmString);
1156
+ const [confirmStringValue, setConfirmStringValue] = useState3("");
1157
+ useEffect3(() => {
1158
+ if (destructiveConfirmString) {
1159
+ setConfirmDisabled(confirmStringValue !== destructiveConfirmString);
1160
+ }
1161
+ }, [
1162
+ confirmStringValue
1163
+ ]);
1164
+ const dialogOverlayAndContent = /* @__PURE__ */ React6.createElement(Transition.Root, {
1165
+ show: isOpen
1166
+ }, /* @__PURE__ */ React6.createElement(Transition.Child, {
1167
+ as: Fragment,
1168
+ enter: "ease-out duration-300",
1169
+ enterFrom: "opacity-0",
1170
+ enterTo: "opacity-100",
1171
+ leave: "ease-in duration-200",
1172
+ leaveFrom: "opacity-100",
1173
+ leaveTo: "opacity-0"
1174
+ }, /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Overlay, {
1175
+ forceMount: true,
1176
+ className: mx("fixed inset-0 z-20 bg-black/50", (_a = slots.overlay) == null ? void 0 : _a.className)
1177
+ })), /* @__PURE__ */ React6.createElement(Transition.Child, {
1178
+ as: Fragment,
1179
+ enter: "ease-out duration-300",
1180
+ enterFrom: "opacity-0 scale-95",
1181
+ enterTo: "opacity-100 scale-100",
1182
+ leave: "ease-in duration-200",
1183
+ leaveFrom: "opacity-100 scale-100",
1184
+ leaveTo: "opacity-0 scale-95"
1185
+ }, /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Content, _extends6({
1186
+ forceMount: true
1187
+ }, slots.content, {
1188
+ className: mx("fixed z-50", "w-[95vw] max-w-md rounded-xl p-4 md:w-full", "top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]", "shadow-2xl bg-white dark:bg-neutral-800 elevated-buttons", defaultFocus, (_b = slots.content) == null ? void 0 : _b.className)
1189
+ }), /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Title, _extends6({
1190
+ tabIndex: 0
1191
+ }, slots.title, {
1192
+ className: mx("text-2xl font-display font-medium text-neutral-900 dark:text-neutral-100 rounded-md", titleVisuallyHidden && "sr-only", defaultFocus, (_c = slots.title) == null ? void 0 : _c.className)
1193
+ }), title), description && /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Description, _extends6({}, slots.description, {
1194
+ className: mx("my-2", defaultDescription, (_d = slots.description) == null ? void 0 : _d.className)
1195
+ }), description), children, destructiveConfirmInputProps && /* @__PURE__ */ React6.createElement(Input, _extends6({}, destructiveConfirmInputProps, {
1196
+ onChange: setConfirmStringValue
1197
+ })), /* @__PURE__ */ React6.createElement("div", _extends6({}, slots.actions, {
1198
+ className: mx("flex flex-wrap justify-end gap-4", (_e = slots.actions) == null ? void 0 : _e.className)
1199
+ }), cancelTrigger && /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Cancel, {
1200
+ asChild: typeof cancelTrigger !== "string"
1201
+ }, cancelTrigger), /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Action, {
1202
+ asChild: true
1203
+ }, /* @__PURE__ */ cloneElement(confirmTrigger, {
1204
+ disabled: confirmDisabled
1205
+ }))))));
1206
+ return /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Root, {
1207
+ open: isOpen,
1208
+ onOpenChange: setIsOpen
1209
+ }, openTrigger && /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Trigger, {
1210
+ asChild: true
1211
+ }, openTrigger), mountAsSibling ? dialogOverlayAndContent : /* @__PURE__ */ React6.createElement(AlertDialogPrimitive.Portal, null, dialogOverlayAndContent));
1212
+ };
1213
+
1214
+ // packages/common/react-ui/src/components/Avatar/Avatar.tsx
1215
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
1216
+ import * as PortalPrimitive from "@radix-ui/react-portal";
1217
+ import { toSvg } from "jdenticon";
1218
+ import React7, { cloneElement as cloneElement2, forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
1219
+ function _extends7() {
1220
+ _extends7 = Object.assign || function(target) {
1221
+ for (var i = 1; i < arguments.length; i++) {
1222
+ var source = arguments[i];
1223
+ for (var key in source) {
1224
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1225
+ target[key] = source[key];
1226
+ }
1227
+ }
1228
+ }
1229
+ return target;
1230
+ };
1231
+ return _extends7.apply(this, arguments);
1232
+ }
1233
+ var shapeStyles = {
1234
+ circle: "rounded-full",
1235
+ square: "rounded"
1236
+ };
1237
+ var Avatar = /* @__PURE__ */ forwardRef2(({ mediaSrc, mediaAlt, fallbackValue, label, variant = "square", size = 10, slots = {} }, ref) => {
1238
+ var _a, _b, _c;
1239
+ const labelId = useId("avatarLabel");
1240
+ const imgSrc = useMemo2(() => `data:image/svg+xml;utf8,${encodeURIComponent(toSvg(fallbackValue, size === "px" ? 1 : size * 4))}`, [
1241
+ fallbackValue
1242
+ ]);
1243
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(AvatarPrimitive.Root, _extends7({}, slots.root, {
1244
+ className: mx("relative inline-flex", getSize(size), (_a = slots.root) == null ? void 0 : _a.className),
1245
+ "aria-labelledby": labelId,
1246
+ ref
1247
+ }), mediaSrc && /* @__PURE__ */ React7.createElement(AvatarPrimitive.Image, _extends7({}, slots.image, {
1248
+ src: mediaSrc,
1249
+ alt: mediaAlt != null ? mediaAlt : "Avatar",
1250
+ className: mx("h-full w-full object-cover overflow-hidden", shapeStyles[variant], (_b = slots.image) == null ? void 0 : _b.className)
1251
+ })), /* @__PURE__ */ React7.createElement(AvatarPrimitive.Fallback, _extends7({
1252
+ delayMs: 0
1253
+ }, slots.fallback, {
1254
+ className: mx("shrink-0 flex h-full w-full items-center justify-center bg-white dark:bg-neutral-800 overflow-hidden", shapeStyles[variant], (_c = slots.fallback) == null ? void 0 : _c.className)
1255
+ }), /* @__PURE__ */ React7.createElement("img", {
1256
+ role: "none",
1257
+ alt: fallbackValue,
1258
+ src: imgSrc,
1259
+ className: "h-full w-full"
1260
+ }))), typeof label === "string" ? /* @__PURE__ */ React7.createElement(PortalPrimitive.Root, {
1261
+ asChild: true
1262
+ }, /* @__PURE__ */ React7.createElement("span", {
1263
+ id: labelId,
1264
+ className: "sr-only"
1265
+ }, label)) : /* @__PURE__ */ cloneElement2(label, {
1266
+ id: labelId
1267
+ }));
1268
+ });
1269
+
1270
+ // packages/common/react-ui/src/components/Button/Button.tsx
1271
+ import React8, { forwardRef as forwardRef3 } from "react";
1272
+
1273
+ // packages/common/react-ui/src/components/Button/buttonStyles.ts
1274
+ var primaryButtonColors = "bg-primary-600 text-white hover:bg-primary-650";
1275
+ var defaultButtonColors = "bg-white text-neutral-900 dark:bg-neutral-750 dark:text-neutral-50";
1276
+ var ghostButtonColors = "";
1277
+ var buttonStyles = (props) => {
1278
+ const resolvedVariant = props.variant || "default";
1279
+ return mx(
1280
+ "inline-flex select-none items-center justify-center text-sm font-medium rounded-md transition-color duration-100",
1281
+ props.compact ? "p-1.5" : "pli-4 plb-2",
1282
+ defaultHover(props),
1283
+ resolvedVariant === "default" && "border border-neutral-100 dark:border-neutral-650",
1284
+ resolvedVariant !== "ghost" && !props.disabled && "hover:focus:border-neutral-100 hover:border-transparent",
1285
+ resolvedVariant === "default" && defaultButtonColors,
1286
+ resolvedVariant === "ghost" && ghostButtonColors,
1287
+ resolvedVariant === "primary" && "border border-primary-550 hover:border-transparent",
1288
+ resolvedVariant === "primary" && primaryButtonColors,
1289
+ resolvedVariant === "outline" && "text-neutral-700 border border-neutral-600 dark:border-neutral-300 dark:text-neutral-150",
1290
+ defaultFocus,
1291
+ props.disabled ? defaultDisabled : resolvedVariant !== "outline" && resolvedVariant !== "ghost" && "button-elevation",
1292
+ "group",
1293
+ defaultActive
1294
+ );
1295
+ };
1296
+
1297
+ // packages/common/react-ui/src/components/Button/Button.tsx
1298
+ function _extends8() {
1299
+ _extends8 = Object.assign || function(target) {
1300
+ for (var i = 1; i < arguments.length; i++) {
1301
+ var source = arguments[i];
1302
+ for (var key in source) {
1303
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1304
+ target[key] = source[key];
1305
+ }
1306
+ }
1307
+ }
1308
+ return target;
1309
+ };
1310
+ return _extends8.apply(this, arguments);
1311
+ }
1312
+ var Button = /* @__PURE__ */ forwardRef3(({ children, compact, variant, ...rootSlot }, ref) => /* @__PURE__ */ React8.createElement("button", _extends8({
1313
+ ref
1314
+ }, rootSlot, {
1315
+ className: mx(buttonStyles({
1316
+ compact,
1317
+ variant,
1318
+ disabled: rootSlot.disabled
1319
+ }), rootSlot.className)
1320
+ }, rootSlot.disabled && {
1321
+ disabled: true
1322
+ }), children));
1323
+
1324
+ // packages/common/react-ui/src/components/Button/ButtonGroup.tsx
1325
+ import React9 from "react";
1326
+ function _extends9() {
1327
+ _extends9 = Object.assign || function(target) {
1328
+ for (var i = 1; i < arguments.length; i++) {
1329
+ var source = arguments[i];
1330
+ for (var key in source) {
1331
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1332
+ target[key] = source[key];
1333
+ }
1334
+ }
1335
+ }
1336
+ return target;
1337
+ };
1338
+ return _extends9.apply(this, arguments);
1339
+ }
1340
+ var ButtonGroup = ({ children, ...divProps }) => {
1341
+ return /* @__PURE__ */ React9.createElement("div", _extends9({
1342
+ role: "none"
1343
+ }, divProps, {
1344
+ className: mx("button-elevation [&>*]:grouped-buttons rounded-md", divProps.className)
1345
+ }), children);
1346
+ };
1347
+
1348
+ // packages/common/react-ui/src/components/CompoundButton/CompoundButton.tsx
1349
+ import React10 from "react";
1350
+ function _extends10() {
1351
+ _extends10 = Object.assign || function(target) {
1352
+ for (var i = 1; i < arguments.length; i++) {
1353
+ var source = arguments[i];
1354
+ for (var key in source) {
1355
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1356
+ target[key] = source[key];
1357
+ }
1358
+ }
1359
+ }
1360
+ return target;
1361
+ };
1362
+ return _extends10.apply(this, arguments);
1363
+ }
1364
+ var CompoundButton = ({ children, description, before, after, ...buttonProps }) => {
1365
+ const variant = buttonProps.variant || "default";
1366
+ const labelId = useId("compoundButton-label");
1367
+ const descriptionId = useId("compoundButton-description");
1368
+ return /* @__PURE__ */ React10.createElement("button", _extends10({}, buttonProps, {
1369
+ className: mx(buttonStyles(buttonProps), "flex items-center gap-4 py-2.5", buttonProps.className),
1370
+ "aria-labelledby": labelId
1371
+ }, description && {
1372
+ "aria-describedby": descriptionId
1373
+ }), before && /* @__PURE__ */ React10.createElement("div", {
1374
+ role: "none",
1375
+ className: "grow-0"
1376
+ }, before), /* @__PURE__ */ React10.createElement("div", {
1377
+ role: "none",
1378
+ className: "grow flex flex-col gap-1 text-left"
1379
+ }, /* @__PURE__ */ React10.createElement("p", {
1380
+ id: labelId
1381
+ }, children), description && /* @__PURE__ */ React10.createElement("p", {
1382
+ id: descriptionId,
1383
+ className: mx("text-xs font-normal mb-1", variant === "primary" ? primaryDescription : defaultDescription)
1384
+ }, description)), after && /* @__PURE__ */ React10.createElement("div", {
1385
+ role: "none",
1386
+ className: "grow-0"
1387
+ }, after));
1388
+ };
1389
+
1390
+ // packages/common/react-ui/src/components/Dialog/Dialog.tsx
1391
+ import { Transition as Transition2 } from "@headlessui/react";
1392
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
1393
+ import { X } from "phosphor-react";
1394
+ import React12, { Fragment as Fragment2, useState as useState5 } from "react";
1395
+
1396
+ // packages/common/react-ui/src/components/Tooltip/Tooltip.tsx
1397
+ import * as PortalPrimitive2 from "@radix-ui/react-portal";
1398
+ import { Button as ToolbarButtonItem } from "@radix-ui/react-toolbar";
1399
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
1400
+ import React11, { useState as useState4 } from "react";
1401
+ function _extends11() {
1402
+ _extends11 = Object.assign || function(target) {
1403
+ for (var i = 1; i < arguments.length; i++) {
1404
+ var source = arguments[i];
1405
+ for (var key in source) {
1406
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1407
+ target[key] = source[key];
1408
+ }
1409
+ }
1410
+ }
1411
+ return target;
1412
+ };
1413
+ return _extends11.apply(this, arguments);
1414
+ }
1415
+ var Tooltip = ({ content, children, side, compact, tooltipLabelsTrigger, mountAsSibling, triggerIsInToolbar, zIndex = "z-[2]", slots = {} }) => {
1416
+ var _a, _b, _c, _d;
1417
+ const [isOpen, setIsOpen] = useState4(false);
1418
+ const labelId = useId("tooltipLabel");
1419
+ const tooltipContent = /* @__PURE__ */ React11.createElement(TooltipPrimitive.Content, _extends11({
1420
+ forceMount: true
1421
+ }, slots.content, {
1422
+ side: (_b = side != null ? side : (_a = slots.content) == null ? void 0 : _a.side) != null ? _b : "top",
1423
+ className: mx("radix-side-top:animate-slide-down-fade", "radix-side-right:animate-slide-left-fade", "radix-side-bottom:animate-slide-up-fade", "radix-side-left:animate-slide-right-fade", "inline-flex items-center rounded-md", zIndex, !compact && "px-4 py-2.5", "shadow-lg bg-white dark:bg-neutral-800", !isOpen && "sr-only", defaultTooltip, (_c = slots.content) == null ? void 0 : _c.className)
1424
+ }), /* @__PURE__ */ React11.createElement(TooltipPrimitive.Arrow, {
1425
+ className: mx("fill-current text-white dark:text-neutral-800", (_d = slots.arrow) == null ? void 0 : _d.className)
1426
+ }), content);
1427
+ const triggerContent = /* @__PURE__ */ React11.createElement(TooltipPrimitive.Trigger, _extends11({
1428
+ asChild: true
1429
+ }, tooltipLabelsTrigger && {
1430
+ "aria-labelledby": labelId
1431
+ }), children);
1432
+ return /* @__PURE__ */ React11.createElement(TooltipPrimitive.Root, {
1433
+ open: isOpen,
1434
+ onOpenChange: setIsOpen
1435
+ }, triggerIsInToolbar ? /* @__PURE__ */ React11.createElement(ToolbarButtonItem, {
1436
+ asChild: true
1437
+ }, triggerContent) : triggerContent, tooltipLabelsTrigger && /* @__PURE__ */ React11.createElement(PortalPrimitive2.Root, {
1438
+ asChild: true
1439
+ }, /* @__PURE__ */ React11.createElement("span", {
1440
+ id: labelId,
1441
+ className: "sr-only"
1442
+ }, content)), mountAsSibling ? tooltipContent : /* @__PURE__ */ React11.createElement(TooltipPrimitive.Portal, {
1443
+ forceMount: true
1444
+ }, tooltipContent));
1445
+ };
1446
+
1447
+ // packages/common/react-ui/src/components/Dialog/Dialog.tsx
1448
+ function _extends12() {
1449
+ _extends12 = Object.assign || function(target) {
1450
+ for (var i = 1; i < arguments.length; i++) {
1451
+ var source = arguments[i];
1452
+ for (var key in source) {
1453
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1454
+ target[key] = source[key];
1455
+ }
1456
+ }
1457
+ }
1458
+ return target;
1459
+ };
1460
+ return _extends12.apply(this, arguments);
1461
+ }
1462
+ var Dialog = ({ title, titleVisuallyHidden, description, openTrigger, children, closeTriggers, closeLabel, initiallyOpen, mountAsSibling, slots = {} }) => {
1463
+ var _a, _b, _c, _d, _e, _f, _g;
1464
+ const [isOpen, setIsOpen] = useState5(!!initiallyOpen);
1465
+ const dialogOverlayAndContent = /* @__PURE__ */ React12.createElement(Transition2.Root, {
1466
+ show: isOpen
1467
+ }, /* @__PURE__ */ React12.createElement(Transition2.Child, {
1468
+ as: Fragment2,
1469
+ enter: "linear duration-300",
1470
+ enterFrom: "opacity-0",
1471
+ enterTo: "opacity-100",
1472
+ leave: "linear duration-200",
1473
+ leaveFrom: "opacity-100",
1474
+ leaveTo: "opacity-0"
1475
+ }, /* @__PURE__ */ React12.createElement(DialogPrimitive.Overlay, _extends12({
1476
+ forceMount: true
1477
+ }, slots.overlay, {
1478
+ className: mx("fixed inset-0 z-20 bg-black/50", (_a = slots.overlay) == null ? void 0 : _a.className)
1479
+ }))), /* @__PURE__ */ React12.createElement(Transition2.Child, {
1480
+ as: Fragment2,
1481
+ enter: "ease-out duration-300",
1482
+ enterFrom: "opacity-0 scale-95",
1483
+ enterTo: "opacity-100 scale-100",
1484
+ leave: "ease-in duration-200",
1485
+ leaveFrom: "opacity-100 scale-100",
1486
+ leaveTo: "opacity-0 scale-95"
1487
+ }, /* @__PURE__ */ React12.createElement(DialogPrimitive.Content, _extends12({
1488
+ forceMount: true
1489
+ }, slots.content, {
1490
+ className: mx("fixed z-50", "w-[95vw] max-w-md rounded-xl p-4 md:w-full", "top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]", "shadow-2xl bg-white dark:bg-neutral-800 elevated-buttons", defaultFocus, (_b = slots.content) == null ? void 0 : _b.className)
1491
+ }), /* @__PURE__ */ React12.createElement(DialogPrimitive.Title, _extends12({}, slots.title, {
1492
+ className: mx("text-2xl font-display font-medium text-neutral-900 dark:text-neutral-100 rounded-md", titleVisuallyHidden && "sr-only", defaultFocus, (_c = slots.content) == null ? void 0 : _c.className),
1493
+ tabIndex: 0
1494
+ }), title), description && /* @__PURE__ */ React12.createElement(DialogPrimitive.Description, _extends12({}, slots.description, {
1495
+ className: mx("mt-2", defaultDescription, (_d = slots.description) == null ? void 0 : _d.className)
1496
+ }), description), children, closeLabel && /* @__PURE__ */ React12.createElement(Tooltip, {
1497
+ zIndex: "z-[51]",
1498
+ content: closeLabel
1499
+ }, /* @__PURE__ */ React12.createElement(DialogPrimitive.Close, {
1500
+ className: mx("absolute top-3.5 right-3.5 inline-flex items-center justify-center rounded-sm p-1", defaultFocus, defaultHover({}), (_e = slots.close) == null ? void 0 : _e.className)
1501
+ }, /* @__PURE__ */ React12.createElement(X, {
1502
+ className: mx(getSize(4), "text-neutral-500 hover:text-neutral-700 dark:text-neutral-500 dark:hover:text-neutral-400", (_f = slots.closeIcon) == null ? void 0 : _f.className)
1503
+ }))), closeTriggers && /* @__PURE__ */ React12.createElement("div", _extends12({}, slots.closeTriggers, {
1504
+ className: mx("flex flex-wrap justify-end gap-4", (_g = slots.closeTriggers) == null ? void 0 : _g.className)
1505
+ }), closeTriggers.map((closeTrigger, key) => /* @__PURE__ */ React12.createElement(DialogPrimitive.Close, {
1506
+ key
1507
+ }, closeTrigger))))));
1508
+ return /* @__PURE__ */ React12.createElement(DialogPrimitive.Root, {
1509
+ open: isOpen,
1510
+ onOpenChange: setIsOpen
1511
+ }, openTrigger && /* @__PURE__ */ React12.createElement(DialogPrimitive.Trigger, {
1512
+ asChild: true
1513
+ }, openTrigger), mountAsSibling ? dialogOverlayAndContent : /* @__PURE__ */ React12.createElement(DialogPrimitive.Portal, null, dialogOverlayAndContent));
1514
+ };
1515
+
1516
+ // packages/common/react-ui/src/components/Group/Group.tsx
1517
+ import React14 from "react";
1518
+
1519
+ // packages/common/react-ui/src/components/Heading/Heading.tsx
1520
+ import { createElement } from "react";
1521
+ var levelClassNameMap = /* @__PURE__ */ new Map([
1522
+ [
1523
+ 1,
1524
+ "text-5xl"
1525
+ ],
1526
+ [
1527
+ 2,
1528
+ "text-4xl"
1529
+ ],
1530
+ [
1531
+ 3,
1532
+ "text-3xl"
1533
+ ],
1534
+ [
1535
+ 4,
1536
+ "text-2xl"
1537
+ ],
1538
+ [
1539
+ 5,
1540
+ "text-xl"
1541
+ ],
1542
+ [
1543
+ 6,
1544
+ "text-lg"
1545
+ ]
1546
+ ]);
1547
+ var Heading = ({ level, ...rootSlot }) => {
1548
+ const resolvedLevel = level || 1;
1549
+ return /* @__PURE__ */ createElement(`h${resolvedLevel}`, {
1550
+ ...rootSlot,
1551
+ className: mx("font-bold font-display", levelClassNameMap.get(resolvedLevel), rootSlot.className)
1552
+ });
1553
+ };
1554
+
1555
+ // packages/common/react-ui/src/components/Group/Group.tsx
1556
+ function _extends13() {
1557
+ _extends13 = Object.assign || function(target) {
1558
+ for (var i = 1; i < arguments.length; i++) {
1559
+ var source = arguments[i];
1560
+ for (var key in source) {
1561
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1562
+ target[key] = source[key];
1563
+ }
1564
+ }
1565
+ }
1566
+ return target;
1567
+ };
1568
+ return _extends13.apply(this, arguments);
1569
+ }
1570
+ var Group = ({ elevation = 3, children, label, labelVisuallyHidden, ...rootSlot }) => {
1571
+ const labelId = useId("groupLabel");
1572
+ return /* @__PURE__ */ React14.createElement("div", _extends13({
1573
+ role: "group",
1574
+ "aria-labelledby": labelId
1575
+ }, rootSlot, {
1576
+ className: mx(defaultGroup({
1577
+ elevation
1578
+ }), rootSlot == null ? void 0 : rootSlot.className)
1579
+ }), /* @__PURE__ */ React14.createElement(Heading, _extends13({}, label, {
1580
+ id: labelId,
1581
+ className: mx(labelVisuallyHidden && "sr-only", "mb-2", label == null ? void 0 : label.className)
1582
+ })), children);
1583
+ };
1584
+
1585
+ // packages/common/react-ui/src/components/Loading/Loading.tsx
1586
+ import React15 from "react";
1587
+ function _extends14() {
1588
+ _extends14 = Object.assign || function(target) {
1589
+ for (var i = 1; i < arguments.length; i++) {
1590
+ var source = arguments[i];
1591
+ for (var key in source) {
1592
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1593
+ target[key] = source[key];
1594
+ }
1595
+ }
1596
+ }
1597
+ return target;
1598
+ };
1599
+ return _extends14.apply(this, arguments);
1600
+ }
1601
+ var sizeMap2 = /* @__PURE__ */ new Map([
1602
+ [
1603
+ "sm",
1604
+ "w-4 h-4"
1605
+ ],
1606
+ [
1607
+ "md",
1608
+ "w-8 h-8"
1609
+ ],
1610
+ [
1611
+ "lg",
1612
+ "w-12 h-12"
1613
+ ],
1614
+ [
1615
+ "xl",
1616
+ "w-16 h-16"
1617
+ ]
1618
+ ]);
1619
+ var Loading = ({ size, color, label, slots = {} }) => {
1620
+ var _a, _b;
1621
+ const labelId = useId("loading-label");
1622
+ const sizeClassName = sizeMap2.get(size != null ? size : "md");
1623
+ return /* @__PURE__ */ React15.createElement("div", _extends14({}, slots.root, {
1624
+ className: mx("flex justify-center p-4", (_a = slots.root) == null ? void 0 : _a.className),
1625
+ role: "status",
1626
+ "aria-labelledby": labelId
1627
+ }), /* @__PURE__ */ React15.createElement("svg", {
1628
+ role: "none",
1629
+ className: mx(sizeClassName, "text-neutral-200/50 animate-spin dark:text-neutral-600/50", color === "neutral" ? "fill-neutral-400" : "fill-primary-400", (_b = slots.svg) == null ? void 0 : _b.className),
1630
+ viewBox: "0 0 100 101",
1631
+ fill: "none",
1632
+ xmlns: "http://www.w3.org/2000/svg"
1633
+ }, /* @__PURE__ */ React15.createElement("path", {
1634
+ d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
1635
+ fill: "currentColor"
1636
+ }), /* @__PURE__ */ React15.createElement("path", {
1637
+ d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
1638
+ fill: "currentFill"
1639
+ })), /* @__PURE__ */ React15.createElement("span", {
1640
+ className: "sr-only",
1641
+ id: labelId
1642
+ }, label));
1643
+ };
1644
+
1645
+ // packages/common/react-ui/src/components/NavMenu/NavMenu.tsx
1646
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
1647
+ import React16, { forwardRef as forwardRef4 } from "react";
1648
+ function _extends15() {
1649
+ _extends15 = Object.assign || function(target) {
1650
+ for (var i = 1; i < arguments.length; i++) {
1651
+ var source = arguments[i];
1652
+ for (var key in source) {
1653
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1654
+ target[key] = source[key];
1655
+ }
1656
+ }
1657
+ }
1658
+ return target;
1659
+ };
1660
+ return _extends15.apply(this, arguments);
1661
+ }
1662
+ var NavMenuInvokerItem = /* @__PURE__ */ forwardRef4(({ content, children, active }, ref) => {
1663
+ return /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Item, {
1664
+ ref
1665
+ }, /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Trigger, {
1666
+ className: mx("px-3 py-2 text-sm rounded-md text-sm font-medium transition-color", active ? primaryButtonColors : defaultButtonColors, defaultFocus, defaultHover({}))
1667
+ }, children), /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Content, {
1668
+ className: mx("absolute w-auto top-0 left-0 rounded-lg", "radix-motion-from-start:animate-enter-from-left", "radix-motion-from-end:animate-enter-from-right", "radix-motion-to-start:animate-exit-to-left", "radix-motion-to-end:animate-exit-to-right")
1669
+ }, content));
1670
+ });
1671
+ var NavMenuLinkItem = /* @__PURE__ */ forwardRef4(({ triggerLinkProps, children, active }, ref) => /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Item, {
1672
+ asChild: true,
1673
+ ref
1674
+ }, /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Link, _extends15({}, triggerLinkProps, {
1675
+ active,
1676
+ className: mx("px-3 py-2 text-sm rounded-md transition-color", active ? primaryButtonColors : defaultButtonColors, active ? "font-medium" : "font-normal", defaultFocus, defaultHover({}), triggerLinkProps.className)
1677
+ }), children)));
1678
+ var NavMenuTooltipLinkItem = /* @__PURE__ */ forwardRef4(({ tooltip, triggerLinkProps, active, children }, ref) => /* @__PURE__ */ React16.createElement(Tooltip, _extends15({}, tooltip), /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Item, {
1679
+ asChild: true,
1680
+ ref
1681
+ }, /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Link, _extends15({}, triggerLinkProps, {
1682
+ active,
1683
+ className: mx("px-3 py-2 text-sm rounded-md transition-color", active ? primaryButtonColors : defaultButtonColors, active ? "font-medium" : "font-normal", defaultFocus, defaultHover({}), triggerLinkProps.className)
1684
+ }), children))));
1685
+ var NavMenuLink = NavigationMenuPrimitive.Link;
1686
+ var NavMenuSeparatorItem = (_props) => {
1687
+ return /* @__PURE__ */ React16.createElement("span", {
1688
+ role: "none",
1689
+ className: mx(defaultInlineSeparator, "bs-5")
1690
+ });
1691
+ };
1692
+ var isTooltipLinkItem = (o) => "tooltip" in o;
1693
+ var isLinkItem = (o) => "triggerLinkProps" in o;
1694
+ var isSeparator = (o) => "separator" in o;
1695
+ var NavMenu = ({ items, slots = {} }) => {
1696
+ var _a, _b, _c, _d, _e;
1697
+ return /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Root, _extends15({}, slots.root, {
1698
+ className: mx("flex justify-center", (_a = slots.root) == null ? void 0 : _a.className)
1699
+ }), /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.List, _extends15({}, slots.list, {
1700
+ className: mx("relative flex flex-row items-center gap-1 rounded-lg bg-white dark:bg-neutral-750 p-1 button-elevation overflow-x-auto", (_b = slots.list) == null ? void 0 : _b.className)
1701
+ }), items.map((item, i) => {
1702
+ return isTooltipLinkItem(item) ? /* @__PURE__ */ React16.createElement(NavMenuTooltipLinkItem, _extends15({
1703
+ key: i
1704
+ }, item)) : isLinkItem(item) ? /* @__PURE__ */ React16.createElement(NavMenuLinkItem, _extends15({
1705
+ key: i
1706
+ }, item)) : isSeparator(item) ? /* @__PURE__ */ React16.createElement(NavMenuSeparatorItem, _extends15({
1707
+ key: i
1708
+ }, item)) : /* @__PURE__ */ React16.createElement(NavMenuInvokerItem, _extends15({
1709
+ key: i
1710
+ }, item));
1711
+ }), /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Indicator, _extends15({}, slots.indicator, {
1712
+ className: mx("z-10 top-[100%] flex items-end justify-center h-2 overflow-hidden", "radix-state-visible:animate-fade-in", "radix-state-hidden:animate-fade-out", "transition-[width_transform] duration-[250ms] ease-[ease]", (_c = slots.indicator) == null ? void 0 : _c.className)
1713
+ }), /* @__PURE__ */ React16.createElement("div", {
1714
+ className: mx("top-1 relative bg-white dark:bg-neutral-750 w-2 h-2 rotate-45", (_d = slots.indicatorIcon) == null ? void 0 : _d.className)
1715
+ }))), /* @__PURE__ */ React16.createElement("div", {
1716
+ className: mx("absolute flex justify-center", "w-[140%] left-[-20%] top-[100%]"),
1717
+ style: {
1718
+ perspective: "2000px"
1719
+ }
1720
+ }, /* @__PURE__ */ React16.createElement(NavigationMenuPrimitive.Viewport, _extends15({}, slots.viewport, {
1721
+ className: mx("relative mbs-2 shadow-lg rounded-md bg-white dark:bg-neutral-750 overflow-hidden", "w-radix-navigation-menu-viewport", "h-radix-navigation-menu-viewport", "radix-state-open:animate-scale-in-content", "radix-state-closed:animate-scale-out-content", "origin-[top_center] transition-[width_height] duration-300 ease-[ease]", (_e = slots.viewport) == null ? void 0 : _e.className)
1722
+ }))));
1723
+ };
1724
+
1725
+ // packages/common/react-ui/src/components/Popover/Popover.tsx
1726
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
1727
+ import { Button as ToolbarButtonItem2 } from "@radix-ui/react-toolbar";
1728
+ import { X as X2 } from "phosphor-react";
1729
+ import React17, { useCallback as useCallback3, useState as useState6 } from "react";
1730
+ function _extends16() {
1731
+ _extends16 = Object.assign || function(target) {
1732
+ for (var i = 1; i < arguments.length; i++) {
1733
+ var source = arguments[i];
1734
+ for (var key in source) {
1735
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1736
+ target[key] = source[key];
1737
+ }
1738
+ }
1739
+ }
1740
+ return target;
1741
+ };
1742
+ return _extends16.apply(this, arguments);
1743
+ }
1744
+ var Popover = ({ openTrigger, children, closeLabel, initiallyOpen, mountAsSibling, triggerIsInToolbar, slots = {} }) => {
1745
+ var _a, _b, _c, _d, _e, _f;
1746
+ const [isOpen, setIsOpen] = useState6(!!initiallyOpen);
1747
+ const onKeyUp = useCallback3((e) => {
1748
+ var _a2, _b2;
1749
+ const keyUpId = document.activeElement.dataset.keyupid;
1750
+ if (keyUpId && e.key === " ") {
1751
+ setIsOpen(keyUpId === "open");
1752
+ }
1753
+ (_b2 = (_a2 = slots.trigger) == null ? void 0 : _a2.onKeyUp) == null ? void 0 : _b2.call(_a2, e);
1754
+ }, [
1755
+ (_a = slots.trigger) == null ? void 0 : _a.onKeyUp
1756
+ ]);
1757
+ const popoverContent = /* @__PURE__ */ React17.createElement(PopoverPrimitive.Content, _extends16({
1758
+ align: "center"
1759
+ }, slots.content, {
1760
+ className: mx("radix-side-top:animate-slide-up radix-side-bottom:animate-slide-down", "rounded-lg p-4 shadow-xl elevated-buttons", "bg-white dark:bg-neutral-800", defaultFocus, (_b = slots.content) == null ? void 0 : _b.className)
1761
+ }), /* @__PURE__ */ React17.createElement(PopoverPrimitive.Arrow, {
1762
+ className: mx("fill-current text-white dark:text-neutral-800", (_c = slots.arrow) == null ? void 0 : _c.className)
1763
+ }), children, closeLabel && /* @__PURE__ */ React17.createElement(PopoverPrimitive.Close, _extends16({}, slots.close, {
1764
+ className: mx("absolute top-3.5 right-3.5 inline-flex items-center justify-center rounded-sm p-1", defaultFocus, defaultHover({}), (_d = slots.close) == null ? void 0 : _d.className),
1765
+ "aria-label": closeLabel,
1766
+ "data-keyupid": "close"
1767
+ }), /* @__PURE__ */ React17.createElement(X2, _extends16({}, slots.closeIcon, {
1768
+ className: mx(getSize(4), "text-neutral-500 hover:text-neutral-700 dark:text-neutral-500 dark:hover:text-neutral-400", (_e = slots.closeIcon) == null ? void 0 : _e.className)
1769
+ }))));
1770
+ const trigger = /* @__PURE__ */ React17.createElement(PopoverPrimitive.Trigger, _extends16({}, slots.trigger, {
1771
+ onKeyUp,
1772
+ "data-keyupid": "open",
1773
+ className: mx(defaultHover({}), defaultFocus, defaultActive, (_f = slots.trigger) == null ? void 0 : _f.className)
1774
+ }), openTrigger);
1775
+ return /* @__PURE__ */ React17.createElement(PopoverPrimitive.Root, {
1776
+ open: isOpen,
1777
+ onOpenChange: setIsOpen
1778
+ }, triggerIsInToolbar ? /* @__PURE__ */ React17.createElement(ToolbarButtonItem2, {
1779
+ asChild: true
1780
+ }, trigger) : trigger, mountAsSibling ? popoverContent : /* @__PURE__ */ React17.createElement(PopoverPrimitive.Portal, null, popoverContent));
1781
+ };
1782
+
1783
+ // packages/common/react-ui/src/components/QrCode/QrCode.tsx
1784
+ import { QrCode as QrCodeIcon, CopySimple } from "phosphor-react";
1785
+ import { QRCodeSVG } from "qrcode.react";
1786
+ import React18, { useCallback as useCallback4 } from "react";
1787
+ function _extends17() {
1788
+ _extends17 = Object.assign || function(target) {
1789
+ for (var i = 1; i < arguments.length; i++) {
1790
+ var source = arguments[i];
1791
+ for (var key in source) {
1792
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1793
+ target[key] = source[key];
1794
+ }
1795
+ }
1796
+ }
1797
+ return target;
1798
+ };
1799
+ return _extends17.apply(this, arguments);
1800
+ }
1801
+ var FullQrCode = ({ value, label, size, buttonCompact = true, slots = {} }) => {
1802
+ var _a, _b;
1803
+ const labelId = useId("qr-label");
1804
+ const copyValue = useCallback4(() => {
1805
+ void navigator.clipboard.writeText(value);
1806
+ }, [
1807
+ value
1808
+ ]);
1809
+ return /* @__PURE__ */ React18.createElement(Tooltip, _extends17({
1810
+ content: label
1811
+ }, slots.tooltipContent), /* @__PURE__ */ React18.createElement(Button, _extends17({
1812
+ compact: buttonCompact
1813
+ }, slots.button, {
1814
+ className: mx("overflow-hidden p-0", getSize(size != null ? size : 32), (_a = slots.button) == null ? void 0 : _a.className),
1815
+ onClick: copyValue
1816
+ }), /* @__PURE__ */ React18.createElement(QRCodeSVG, _extends17({
1817
+ includeMargin: true,
1818
+ role: "none"
1819
+ }, slots.qrSvg, {
1820
+ value,
1821
+ className: mx("w-full h-auto", (_b = slots.qrSvg) == null ? void 0 : _b.className)
1822
+ })), /* @__PURE__ */ React18.createElement("div", {
1823
+ id: labelId,
1824
+ className: "sr-only"
1825
+ }, label)));
1826
+ };
1827
+ var CompactQrCode = ({ value, displayQrLabel, copyLabel, buttonCompact, slots = {} }) => {
1828
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1829
+ const labelId = useId("qr-label");
1830
+ const copyValue = useCallback4(() => {
1831
+ void navigator.clipboard.writeText(value);
1832
+ }, [
1833
+ value
1834
+ ]);
1835
+ return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(ButtonGroup, {
1836
+ className: "inline-flex grow md:hidden"
1837
+ }, /* @__PURE__ */ React18.createElement("span", {
1838
+ className: "sr-only",
1839
+ id: labelId
1840
+ }, displayQrLabel), /* @__PURE__ */ React18.createElement(Tooltip, {
1841
+ compact: true,
1842
+ slots: {
1843
+ content: {
1844
+ ...slots.qrTooltipContent,
1845
+ side: (_b = (_a = slots == null ? void 0 : slots.qrTooltipContent) == null ? void 0 : _a.side) != null ? _b : "left"
1846
+ }
1847
+ },
1848
+ content: /* @__PURE__ */ React18.createElement("div", {
1849
+ role: "none",
1850
+ className: "overflow-hidden rounded-md"
1851
+ }, /* @__PURE__ */ React18.createElement(QRCodeSVG, _extends17({
1852
+ includeMargin: true,
1853
+ role: "none"
1854
+ }, slots.qrSvg, {
1855
+ value,
1856
+ className: mx(getSize(32), (_c = slots.qrSvg) == null ? void 0 : _c.className)
1857
+ })))
1858
+ }, /* @__PURE__ */ React18.createElement(Button, _extends17({
1859
+ compact: buttonCompact
1860
+ }, slots.qrButton, {
1861
+ className: mx("border-ie-0 grow rounded-is-md", (_d = slots.qrButton) == null ? void 0 : _d.className),
1862
+ "aria-labelledby": labelId
1863
+ }), /* @__PURE__ */ React18.createElement(QrCodeIcon, {
1864
+ className: getSize(5)
1865
+ }))), /* @__PURE__ */ React18.createElement(Tooltip, {
1866
+ content: copyLabel,
1867
+ tooltipLabelsTrigger: true,
1868
+ slots: {
1869
+ content: slots.qrTooltipContent
1870
+ }
1871
+ }, /* @__PURE__ */ React18.createElement(Button, _extends17({
1872
+ compact: buttonCompact
1873
+ }, slots.copyButton, {
1874
+ className: mx("rounded-ie-md grow", (_e = slots.copyButton) == null ? void 0 : _e.className),
1875
+ onClick: copyValue
1876
+ }), /* @__PURE__ */ React18.createElement(CopySimple, {
1877
+ className: getSize(5)
1878
+ })))), /* @__PURE__ */ React18.createElement(ButtonGroup, {
1879
+ className: "hidden md:inline-flex"
1880
+ }, /* @__PURE__ */ React18.createElement(Tooltip, {
1881
+ compact: true,
1882
+ slots: {
1883
+ content: {
1884
+ ...slots.qrTooltipContent,
1885
+ side: (_g = (_f = slots == null ? void 0 : slots.qrTooltipContent) == null ? void 0 : _f.side) != null ? _g : "left"
1886
+ }
1887
+ },
1888
+ content: /* @__PURE__ */ React18.createElement("div", {
1889
+ role: "none",
1890
+ className: "overflow-hidden rounded-md"
1891
+ }, /* @__PURE__ */ React18.createElement(QRCodeSVG, _extends17({
1892
+ includeMargin: true,
1893
+ role: "none"
1894
+ }, slots.qrSvg, {
1895
+ value,
1896
+ className: mx(getSize(32), (_h = slots.qrSvg) == null ? void 0 : _h.className)
1897
+ })))
1898
+ }, /* @__PURE__ */ React18.createElement(Button, _extends17({
1899
+ compact: buttonCompact
1900
+ }, slots.qrButton, {
1901
+ className: mx("border-ie-0 flex gap-1 rounded-is-md", (_i = slots.qrButton) == null ? void 0 : _i.className)
1902
+ }), /* @__PURE__ */ React18.createElement(QrCodeIcon, {
1903
+ className: getSize(5)
1904
+ }), displayQrLabel)), /* @__PURE__ */ React18.createElement(Button, _extends17({
1905
+ compact: buttonCompact
1906
+ }, slots.copyButton, {
1907
+ className: mx("flex gap-1 rounded-ie-md", (_j = slots.copyButton) == null ? void 0 : _j.className),
1908
+ onClick: copyValue
1909
+ }), /* @__PURE__ */ React18.createElement(CopySimple, {
1910
+ className: getSize(5)
1911
+ }), copyLabel)));
1912
+ };
1913
+ var QrCode = FullQrCode;
1914
+
1915
+ // packages/common/react-ui/src/components/Tag/Tag.tsx
1916
+ import React19 from "react";
1917
+ function _extends18() {
1918
+ _extends18 = Object.assign || function(target) {
1919
+ for (var i = 1; i < arguments.length; i++) {
1920
+ var source = arguments[i];
1921
+ for (var key in source) {
1922
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1923
+ target[key] = source[key];
1924
+ }
1925
+ }
1926
+ }
1927
+ return target;
1928
+ };
1929
+ return _extends18.apply(this, arguments);
1930
+ }
1931
+ var valenceColorMap = {
1932
+ neutral: "bg-neutral-100 text-neutral-800 dark:bg-neutral-700 dark:text-neutral-300",
1933
+ success: "bg-success-100 text-success-800 dark:bg-success-700 dark:text-success-300",
1934
+ info: "bg-info-100 text-info-800 dark:bg-info-700 dark:text-info-300",
1935
+ warning: "bg-warning-100 text-warning-800 dark:bg-warning-700 dark:text-warning-300",
1936
+ error: "bg-error-100 text-error-800 dark:bg-error-700 dark:text-error-300"
1937
+ };
1938
+ var Tag = ({ children, valence = "neutral", ...rootSlot }) => {
1939
+ return /* @__PURE__ */ React19.createElement("span", _extends18({}, rootSlot, {
1940
+ className: mx("text-xs font-semibold px-2.5 py-0.5 rounded", valenceColorMap[valence], rootSlot == null ? void 0 : rootSlot.className)
1941
+ }), children);
1942
+ };
1943
+
1944
+ // packages/common/react-ui/src/components/Toast/Toast.tsx
1945
+ import * as ToastPrimitive from "@radix-ui/react-toast";
1946
+ import React20, { cloneElement as cloneElement3, useState as useState7 } from "react";
1947
+ function _extends19() {
1948
+ _extends19 = Object.assign || function(target) {
1949
+ for (var i = 1; i < arguments.length; i++) {
1950
+ var source = arguments[i];
1951
+ for (var key in source) {
1952
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1953
+ target[key] = source[key];
1954
+ }
1955
+ }
1956
+ }
1957
+ return target;
1958
+ };
1959
+ return _extends19.apply(this, arguments);
1960
+ }
1961
+ var Toast = ({ title, titleVisuallyHidden, description, openTrigger, closeTrigger, actionTriggers, initiallyOpen, slots = {} }) => {
1962
+ var _a, _b, _c, _d;
1963
+ const [isOpen, setIsOpen] = useState7(!!initiallyOpen);
1964
+ return /* @__PURE__ */ React20.createElement(React20.Fragment, null, openTrigger && (typeof openTrigger === "string" ? /* @__PURE__ */ React20.createElement(Button, {
1965
+ onClick: () => setIsOpen(true)
1966
+ }, openTrigger) : /* @__PURE__ */ cloneElement3(openTrigger, {
1967
+ onClick: () => setIsOpen(true)
1968
+ })), /* @__PURE__ */ React20.createElement(ToastPrimitive.Root, _extends19({
1969
+ open: isOpen,
1970
+ onOpenChange: setIsOpen
1971
+ }, slots.root, {
1972
+ className: mx("shadow-lg rounded-lg elevated-buttons flex", "bg-white dark:bg-neutral-800", "radix-state-open:animate-toast-slide-in-bottom md:radix-state-open:animate-toast-slide-in-right", "radix-state-closed:animate-toast-hide", "radix-swipe-end:animate-toast-swipe-out", "translate-x-radix-toast-swipe-move-x", "radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]", defaultFocus, (_a = slots.root) == null ? void 0 : _a.className)
1973
+ }), /* @__PURE__ */ React20.createElement("div", _extends19({
1974
+ role: "none"
1975
+ }, slots.heading, {
1976
+ className: mx("w-0 flex-1 flex items-center pl-5 py-4 min-h-full", (_b = slots.heading) == null ? void 0 : _b.className)
1977
+ }), /* @__PURE__ */ React20.createElement("div", _extends19({
1978
+ role: "none"
1979
+ }, slots.headingInner, {
1980
+ className: mx("w-full radix flex flex-col justify-center min-h-full gap-1", (_c = slots.headingInner) == null ? void 0 : _c.className)
1981
+ }), /* @__PURE__ */ React20.createElement(ToastPrimitive.Title, {
1982
+ className: mx("text-md font-medium", titleVisuallyHidden && "sr-only")
1983
+ }, title), description && /* @__PURE__ */ React20.createElement(ToastPrimitive.Description, {
1984
+ className: defaultDescription
1985
+ }, description))), /* @__PURE__ */ React20.createElement("div", _extends19({
1986
+ role: "none"
1987
+ }, slots.actions, {
1988
+ className: mx("flex flex-col px-3 py-2 gap-1 items-stretch justify-center min-h-full", (_d = slots.actions) == null ? void 0 : _d.className)
1989
+ }), (actionTriggers || []).map(({ altText, trigger }, index) => /* @__PURE__ */ React20.createElement(ToastPrimitive.Action, {
1990
+ key: index,
1991
+ altText,
1992
+ asChild: typeof trigger !== "string"
1993
+ }, trigger)), closeTrigger && /* @__PURE__ */ React20.createElement(ToastPrimitive.Close, {
1994
+ asChild: typeof closeTrigger !== "string"
1995
+ }, closeTrigger))));
1996
+ };
1997
+
1998
+ // packages/common/react-ui/src/components/UiProvider/UiProvider.tsx
1999
+ import { Provider as ToastProvider, Viewport as ToastViewport } from "@radix-ui/react-toast";
2000
+ import { Provider as TooltipProvider } from "@radix-ui/react-tooltip";
2001
+ import React21 from "react";
2002
+ function _extends20() {
2003
+ _extends20 = Object.assign || function(target) {
2004
+ for (var i = 1; i < arguments.length; i++) {
2005
+ var source = arguments[i];
2006
+ for (var key in source) {
2007
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2008
+ target[key] = source[key];
2009
+ }
2010
+ }
2011
+ }
2012
+ return target;
2013
+ };
2014
+ return _extends20.apply(this, arguments);
2015
+ }
2016
+ var UiProvider = ({ children, tooltipProviderProps, toastProviderProps, toastViewportProps }) => {
2017
+ return /* @__PURE__ */ React21.createElement(ToastProvider, _extends20({}, toastProviderProps), /* @__PURE__ */ React21.createElement(TooltipProvider, _extends20({
2018
+ delayDuration: 0
2019
+ }, tooltipProviderProps), children), /* @__PURE__ */ React21.createElement(ToastViewport, _extends20({}, toastViewportProps, {
2020
+ className: mx("z-50 fixed bottom-4 inset-x-4 w-auto md:top-4 md:right-4 md:left-auto md:bottom-auto md:w-full md:max-w-sm rounded-lg flex flex-col gap-2", defaultFocus, toastViewportProps == null ? void 0 : toastViewportProps.className)
2021
+ })));
2022
+ };
2023
+ export {
2024
+ Alert,
2025
+ AlertDialog,
2026
+ Avatar,
2027
+ Button,
2028
+ ButtonGroup,
2029
+ CompactQrCode,
2030
+ CompoundButton,
2031
+ Dialog,
2032
+ FullQrCode,
2033
+ Group,
2034
+ Heading,
2035
+ Input,
2036
+ Loading,
2037
+ NavMenu,
2038
+ NavMenuLink,
2039
+ NavMenuSeparatorItem,
2040
+ Popover,
2041
+ QrCode,
2042
+ Tag,
2043
+ Toast,
2044
+ Tooltip,
2045
+ UiProvider,
2046
+ buttonStyles,
2047
+ defaultActive,
2048
+ defaultBlockSeparator,
2049
+ defaultButtonColors,
2050
+ defaultDescription,
2051
+ defaultDisabled,
2052
+ defaultFocus,
2053
+ defaultGroup,
2054
+ defaultHover,
2055
+ defaultInlineSeparator,
2056
+ defaultPlaceholder,
2057
+ defaultShimmer,
2058
+ defaultTooltip,
2059
+ errorAlertColors,
2060
+ errorInputBorder,
2061
+ errorText,
2062
+ getSize,
2063
+ getSizeHeight,
2064
+ getSizeWidth,
2065
+ ghostButtonColors,
2066
+ infoAlertColors,
2067
+ infoInputBorder,
2068
+ infoText,
2069
+ mx,
2070
+ neutralAlertColors,
2071
+ neutralInputBorder,
2072
+ primaryButtonColors,
2073
+ primaryDescription,
2074
+ randomString,
2075
+ sizeHeightMap,
2076
+ sizeWidthMap,
2077
+ staticFocus,
2078
+ strongShimmer,
2079
+ successAlertColors,
2080
+ successInputBorder,
2081
+ successText,
2082
+ useForwardedRef,
2083
+ useId,
2084
+ useIsFocused,
2085
+ valenceAlertColors,
2086
+ valenceColorText,
2087
+ valenceInputBorder,
2088
+ warningAlertColors,
2089
+ warningInputBorder,
2090
+ warningText
2091
+ };
2092
+ //# sourceMappingURL=index.mjs.map