@vuer-ai/vuer-uikit 0.0.96 → 0.0.98

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 (341) hide show
  1. package/README.md +106 -7
  2. package/cli/dial-cli.js +49 -7
  3. package/dist/SyncScroll/SyncScroll.cjs +10 -10
  4. package/dist/SyncScroll/SyncScroll.mjs +3 -3
  5. package/dist/SyncScroll/index.cjs +10 -10
  6. package/dist/SyncScroll/index.mjs +3 -3
  7. package/dist/chunk-3HEZVWRW.mjs +62 -0
  8. package/dist/chunk-4KWGGESI.cjs +494 -0
  9. package/dist/{chunk-CCMKL2OA.cjs → chunk-7GWDO25E.cjs} +2 -2
  10. package/dist/chunk-A5LCX2UQ.cjs +208 -0
  11. package/dist/chunk-BEJIZ56L.mjs +300 -0
  12. package/dist/chunk-C7VGRU3O.mjs +283 -0
  13. package/dist/{chunk-LONOMMFA.cjs → chunk-LJMNHTTG.cjs} +21 -21
  14. package/dist/chunk-O66RESRR.cjs +285 -0
  15. package/dist/{chunk-RINTUFYQ.cjs → chunk-RMK6W774.cjs} +24 -19
  16. package/dist/{chunk-BFQ2WL5U.mjs → chunk-TTYSYGVE.mjs} +2 -2
  17. package/dist/chunk-VA3PEYFM.mjs +489 -0
  18. package/dist/chunk-VBBJSIY7.cjs +308 -0
  19. package/dist/{chunk-AIINOWEH.mjs → chunk-W4JCKCW7.mjs} +5 -5
  20. package/dist/chunk-WWGF6TBZ.mjs +206 -0
  21. package/dist/chunk-ZGN4UEJR.cjs +679 -0
  22. package/dist/chunk-ZQLRMOUW.mjs +661 -0
  23. package/dist/dial/DialPanel.cjs +24 -24
  24. package/dist/dial/DialPanel.mjs +23 -23
  25. package/dist/dial/DialProvider.cjs +3 -3
  26. package/dist/dial/DialProvider.d.cts +1 -0
  27. package/dist/dial/DialProvider.d.ts +1 -0
  28. package/dist/dial/DialProvider.example.cjs +72 -0
  29. package/dist/dial/DialProvider.example.d.cts +7 -0
  30. package/dist/dial/DialProvider.example.d.ts +7 -0
  31. package/dist/dial/DialProvider.example.mjs +68 -0
  32. package/dist/dial/DialProvider.mjs +1 -1
  33. package/dist/dial/index.cjs +42 -42
  34. package/dist/dial/index.mjs +23 -23
  35. package/dist/dial/wrapped-inputs/ControlledInputs.cjs +27 -27
  36. package/dist/dial/wrapped-inputs/ControlledInputs.mjs +23 -23
  37. package/dist/dial/wrapped-inputs/DialInputs.cjs +34 -34
  38. package/dist/dial/wrapped-inputs/DialInputs.mjs +23 -23
  39. package/dist/dial/wrapped-inputs/DialVectorInput.cjs +24 -24
  40. package/dist/dial/wrapped-inputs/DialVectorInput.mjs +23 -23
  41. package/dist/dial/wrapped-inputs/index.cjs +39 -39
  42. package/dist/dial/wrapped-inputs/index.mjs +23 -23
  43. package/dist/highlight-cursor/cursor-provider.cjs +3 -3
  44. package/dist/highlight-cursor/cursor-provider.mjs +2 -2
  45. package/dist/highlight-cursor/enhanced-components.cjs +10 -10
  46. package/dist/highlight-cursor/enhanced-components.mjs +5 -5
  47. package/dist/highlight-cursor/index.cjs +16 -16
  48. package/dist/highlight-cursor/index.mjs +6 -6
  49. package/dist/hooks/index.cjs +5 -5
  50. package/dist/hooks/index.mjs +1 -1
  51. package/dist/index.cjs +190 -190
  52. package/dist/index.mjs +23 -23
  53. package/dist/ui/UIKitBadge.cjs +6 -6
  54. package/dist/ui/UIKitBadge.mjs +2 -2
  55. package/dist/ui/avatar.cjs +1 -1
  56. package/dist/ui/avatar.mjs +1 -1
  57. package/dist/ui/badge.cjs +1 -1
  58. package/dist/ui/badge.d.cts +1 -1
  59. package/dist/ui/badge.d.ts +1 -1
  60. package/dist/ui/badge.mjs +1 -1
  61. package/dist/ui/button.cjs +1 -1
  62. package/dist/ui/button.mjs +1 -1
  63. package/dist/ui/card.cjs +1 -1
  64. package/dist/ui/card.mjs +1 -1
  65. package/dist/ui/checkbox.cjs +1 -1
  66. package/dist/ui/checkbox.mjs +1 -1
  67. package/dist/ui/collapsible.cjs +1 -1
  68. package/dist/ui/collapsible.mjs +1 -1
  69. package/dist/ui/drawer.cjs +1 -1
  70. package/dist/ui/drawer.mjs +1 -1
  71. package/dist/ui/dropdown.cjs +1 -1
  72. package/dist/ui/dropdown.mjs +1 -1
  73. package/dist/ui/index.cjs +107 -107
  74. package/dist/ui/index.mjs +17 -17
  75. package/dist/ui/inputs/color-input.cjs +1 -1
  76. package/dist/ui/inputs/color-input.mjs +1 -1
  77. package/dist/ui/inputs/index.cjs +11 -11
  78. package/dist/ui/inputs/index.mjs +3 -3
  79. package/dist/ui/inputs/input-numbers.cjs +1 -1
  80. package/dist/ui/inputs/input-numbers.mjs +1 -1
  81. package/dist/ui/inputs/input.cjs +1 -1
  82. package/dist/ui/inputs/input.d.cts +1 -1
  83. package/dist/ui/inputs/input.d.ts +1 -1
  84. package/dist/ui/inputs/input.mjs +1 -1
  85. package/dist/ui/inputs/number-inputs/CmInput.cjs +1 -1
  86. package/dist/ui/inputs/number-inputs/CmInput.mjs +1 -1
  87. package/dist/ui/inputs/number-inputs/DegInput.cjs +1 -1
  88. package/dist/ui/inputs/number-inputs/DegInput.mjs +1 -1
  89. package/dist/ui/inputs/number-inputs/EulerDegInput.cjs +1 -1
  90. package/dist/ui/inputs/number-inputs/EulerDegInput.mjs +1 -1
  91. package/dist/ui/inputs/number-inputs/EulerInput.cjs +1 -1
  92. package/dist/ui/inputs/number-inputs/EulerInput.mjs +1 -1
  93. package/dist/ui/inputs/number-inputs/EulerRadInput.cjs +1 -1
  94. package/dist/ui/inputs/number-inputs/EulerRadInput.mjs +1 -1
  95. package/dist/ui/inputs/number-inputs/InchInput.cjs +1 -1
  96. package/dist/ui/inputs/number-inputs/InchInput.mjs +1 -1
  97. package/dist/ui/inputs/number-inputs/IntInput.cjs +1 -1
  98. package/dist/ui/inputs/number-inputs/IntInput.mjs +1 -1
  99. package/dist/ui/inputs/number-inputs/KVectorInput.cjs +1 -1
  100. package/dist/ui/inputs/number-inputs/KVectorInput.mjs +1 -1
  101. package/dist/ui/inputs/number-inputs/QuaternionInput.cjs +1 -1
  102. package/dist/ui/inputs/number-inputs/QuaternionInput.mjs +1 -1
  103. package/dist/ui/inputs/number-inputs/RadInput.cjs +1 -1
  104. package/dist/ui/inputs/number-inputs/RadInput.mjs +1 -1
  105. package/dist/ui/inputs/number-inputs/TimeInput.cjs +1 -1
  106. package/dist/ui/inputs/number-inputs/TimeInput.mjs +1 -1
  107. package/dist/ui/inputs/number-inputs/Vec3Input.cjs +1 -1
  108. package/dist/ui/inputs/number-inputs/Vec3Input.mjs +1 -1
  109. package/dist/ui/inputs/number-inputs/VectorInput.cjs +1 -1
  110. package/dist/ui/inputs/number-inputs/VectorInput.mjs +1 -1
  111. package/dist/ui/inputs/number-inputs/index.cjs +11 -11
  112. package/dist/ui/inputs/number-inputs/index.mjs +3 -3
  113. package/dist/ui/inputs/presets-input.cjs +1 -1
  114. package/dist/ui/inputs/presets-input.mjs +1 -1
  115. package/dist/ui/label.cjs +1 -1
  116. package/dist/ui/label.mjs +1 -1
  117. package/dist/ui/layout.cjs +1 -1
  118. package/dist/ui/layout.mjs +1 -1
  119. package/dist/ui/layouts/dock-layout/DockLayoutView.cjs +1 -1
  120. package/dist/ui/layouts/dock-layout/DockLayoutView.mjs +1 -1
  121. package/dist/ui/layouts/dock-layout/LayoutSlots.cjs +1 -1
  122. package/dist/ui/layouts/dock-layout/LayoutSlots.mjs +1 -1
  123. package/dist/ui/layouts/dock-layout/index.cjs +1 -1
  124. package/dist/ui/layouts/dock-layout/index.mjs +1 -1
  125. package/dist/ui/layouts/index.cjs +2 -2
  126. package/dist/ui/layouts/index.mjs +2 -2
  127. package/dist/ui/layouts/liquid-layout/LayoutSlots.cjs +1 -1
  128. package/dist/ui/layouts/liquid-layout/LayoutSlots.mjs +1 -1
  129. package/dist/ui/layouts/liquid-layout/LiquidLayoutView.cjs +1 -1
  130. package/dist/ui/layouts/liquid-layout/LiquidLayoutView.mjs +1 -1
  131. package/dist/ui/layouts/liquid-layout/index.cjs +1 -1
  132. package/dist/ui/layouts/liquid-layout/index.mjs +1 -1
  133. package/dist/ui/modal.cjs +1 -1
  134. package/dist/ui/modal.mjs +1 -1
  135. package/dist/ui/navigation.cjs +1 -1
  136. package/dist/ui/navigation.mjs +1 -1
  137. package/dist/ui/pagination.cjs +1 -1
  138. package/dist/ui/pagination.mjs +1 -1
  139. package/dist/ui/panel.cjs +1 -1
  140. package/dist/ui/panel.mjs +1 -1
  141. package/dist/ui/popover.cjs +1 -1
  142. package/dist/ui/popover.mjs +1 -1
  143. package/dist/ui/radio-group.cjs +1 -1
  144. package/dist/ui/radio-group.mjs +1 -1
  145. package/dist/ui/resizable.cjs +1 -1
  146. package/dist/ui/resizable.mjs +1 -1
  147. package/dist/ui/select.cjs +1 -1
  148. package/dist/ui/select.d.cts +1 -1
  149. package/dist/ui/select.d.ts +1 -1
  150. package/dist/ui/select.mjs +1 -1
  151. package/dist/ui/separator.cjs +1 -1
  152. package/dist/ui/separator.mjs +1 -1
  153. package/dist/ui/sheet.cjs +1 -1
  154. package/dist/ui/sheet.mjs +1 -1
  155. package/dist/ui/sidebar.cjs +26 -26
  156. package/dist/ui/sidebar.mjs +2 -2
  157. package/dist/ui/simple-tree-view.cjs +1 -1
  158. package/dist/ui/simple-tree-view.mjs +1 -1
  159. package/dist/ui/skeleton.cjs +1 -1
  160. package/dist/ui/skeleton.mjs +1 -1
  161. package/dist/ui/slider.cjs +1 -1
  162. package/dist/ui/slider.mjs +1 -1
  163. package/dist/ui/switch.cjs +1 -1
  164. package/dist/ui/switch.mjs +1 -1
  165. package/dist/ui/table.cjs +1 -1
  166. package/dist/ui/table.mjs +1 -1
  167. package/dist/ui/tabs.cjs +1 -1
  168. package/dist/ui/tabs.mjs +1 -1
  169. package/dist/ui/textarea.cjs +1 -1
  170. package/dist/ui/textarea.d.cts +1 -1
  171. package/dist/ui/textarea.d.ts +1 -1
  172. package/dist/ui/textarea.mjs +1 -1
  173. package/dist/ui/theme/ThemeToggles.cjs +1 -1
  174. package/dist/ui/theme/ThemeToggles.mjs +1 -1
  175. package/dist/ui/theme/index.cjs +1 -1
  176. package/dist/ui/theme/index.mjs +1 -1
  177. package/dist/ui/toggle-buttons.cjs +1 -1
  178. package/dist/ui/toggle-buttons.mjs +1 -1
  179. package/dist/ui/toggle-group.cjs +1 -1
  180. package/dist/ui/toggle-group.mjs +1 -1
  181. package/dist/ui/toggle.cjs +1 -1
  182. package/dist/ui/toggle.mjs +1 -1
  183. package/dist/ui/toolbar.cjs +1 -1
  184. package/dist/ui/toolbar.mjs +1 -1
  185. package/dist/ui/tooltip.cjs +1 -1
  186. package/dist/ui/tooltip.mjs +1 -1
  187. package/dist/ui/tree-view/TreeSearchBar.cjs +1 -1
  188. package/dist/ui/tree-view/TreeSearchBar.mjs +1 -1
  189. package/dist/ui/tree-view/TreeView.cjs +1 -1
  190. package/dist/ui/tree-view/TreeView.mjs +1 -1
  191. package/dist/ui/tree-view/index.cjs +6 -6
  192. package/dist/ui/tree-view/index.mjs +2 -2
  193. package/dist/ui/tree-view-legacy.cjs +9 -9
  194. package/dist/ui/tree-view-legacy.mjs +5 -5
  195. package/dist/ui/waterfall/CursorOverlay.cjs +1 -1
  196. package/dist/ui/waterfall/CursorOverlay.mjs +1 -1
  197. package/dist/ui/waterfall/TimelineEvent.cjs +1 -1
  198. package/dist/ui/waterfall/TimelineEvent.mjs +1 -1
  199. package/dist/ui/waterfall/TimelineProcessBar.cjs +1 -1
  200. package/dist/ui/waterfall/TimelineProcessBar.mjs +1 -1
  201. package/dist/ui/waterfall/Wedges.cjs +1 -1
  202. package/dist/ui/waterfall/Wedges.mjs +1 -1
  203. package/dist/ui/waterfall/index.cjs +8 -8
  204. package/dist/ui/waterfall/index.mjs +7 -7
  205. package/package.json +28 -2
  206. package/src/SyncScroll/README.md +283 -0
  207. package/src/SyncScroll/SyncScroll.tsx +361 -0
  208. package/src/SyncScroll/index.ts +22 -0
  209. package/src/SyncScroll/useSyncScroll.tsx +226 -0
  210. package/src/cli/dial-cli.ts +1133 -0
  211. package/src/dial/DialPanel.tsx +208 -0
  212. package/src/dial/DialProvider.example.tsx +80 -0
  213. package/src/dial/DialProvider.tsx +138 -0
  214. package/src/dial/index.ts +26 -0
  215. package/src/dial/wrapped-inputs/ControlledInputs.tsx +176 -0
  216. package/src/dial/wrapped-inputs/DialInputs.tsx +401 -0
  217. package/src/dial/wrapped-inputs/DialVectorInput.tsx +125 -0
  218. package/src/dial/wrapped-inputs/index.ts +25 -0
  219. package/src/highlight-cursor/cursor-context.tsx +23 -0
  220. package/src/highlight-cursor/cursor-provider.tsx +264 -0
  221. package/src/highlight-cursor/enhanced-components.tsx +16 -0
  222. package/src/highlight-cursor/index.ts +21 -0
  223. package/src/highlight-cursor/tabs-cursor-context.tsx +121 -0
  224. package/src/highlight-cursor/types.ts +40 -0
  225. package/src/highlight-cursor/with-cursor.tsx +144 -0
  226. package/src/hooks/clientOnly.tsx +54 -0
  227. package/src/hooks/cn.ts +33 -0
  228. package/src/hooks/index.ts +9 -0
  229. package/src/hooks/useDocument.tsx +18 -0
  230. package/src/hooks/useDragSelect.ts +116 -0
  231. package/src/hooks/useIsMobile.ts +35 -0
  232. package/src/hooks/useLocalStorage.ts +122 -0
  233. package/src/hooks/useLocation.tsx +95 -0
  234. package/src/hooks/useQueryParams.tsx +31 -0
  235. package/src/hooks/useWindow.tsx +18 -0
  236. package/src/index.css +5 -0
  237. package/src/index.ts +5 -0
  238. package/src/styles/.editorconfig +0 -0
  239. package/src/styles/theme.css +152 -0
  240. package/src/styles/toast.css +67 -0
  241. package/src/styles/variables.css +229 -0
  242. package/src/ui/UIKitBadge.tsx +171 -0
  243. package/src/ui/avatar.tsx +221 -0
  244. package/src/ui/badge.tsx +74 -0
  245. package/src/ui/button.tsx +143 -0
  246. package/src/ui/card.tsx +146 -0
  247. package/src/ui/checkbox.tsx +78 -0
  248. package/src/ui/collapsible.tsx +43 -0
  249. package/src/ui/drag-selectable/DragSelectProvider.tsx +178 -0
  250. package/src/ui/drag-selectable/createSelectable.tsx +43 -0
  251. package/src/ui/drag-selectable/index.ts +2 -0
  252. package/src/ui/drawer.tsx +137 -0
  253. package/src/ui/dropdown.tsx +707 -0
  254. package/src/ui/icons/MouseCursorIcons.tsx +39 -0
  255. package/src/ui/icons/cursor.tsx +38 -0
  256. package/src/ui/icons/index.ts +2 -0
  257. package/src/ui/index.ts +45 -0
  258. package/src/ui/inputs/color-input.tsx +61 -0
  259. package/src/ui/inputs/index.tsx +5 -0
  260. package/src/ui/inputs/input-numbers.tsx +394 -0
  261. package/src/ui/inputs/input.tsx +155 -0
  262. package/src/ui/inputs/number-inputs/CmInput.tsx +26 -0
  263. package/src/ui/inputs/number-inputs/DegInput.tsx +26 -0
  264. package/src/ui/inputs/number-inputs/EulerDegInput.tsx +14 -0
  265. package/src/ui/inputs/number-inputs/EulerInput.tsx +30 -0
  266. package/src/ui/inputs/number-inputs/EulerRadInput.tsx +14 -0
  267. package/src/ui/inputs/number-inputs/InchInput.tsx +26 -0
  268. package/src/ui/inputs/number-inputs/IntInput.tsx +46 -0
  269. package/src/ui/inputs/number-inputs/KVectorInput.tsx +20 -0
  270. package/src/ui/inputs/number-inputs/QuaternionInput.tsx +27 -0
  271. package/src/ui/inputs/number-inputs/RadInput.tsx +26 -0
  272. package/src/ui/inputs/number-inputs/TimeInput.tsx +26 -0
  273. package/src/ui/inputs/number-inputs/Vec3Input.tsx +26 -0
  274. package/src/ui/inputs/number-inputs/VectorInput.tsx +38 -0
  275. package/src/ui/inputs/number-inputs/index.ts +38 -0
  276. package/src/ui/inputs/presets-input.tsx +59 -0
  277. package/src/ui/label.tsx +35 -0
  278. package/src/ui/layout.tsx +43 -0
  279. package/src/ui/layouts/dock-layout/DockLayoutView.tsx +128 -0
  280. package/src/ui/layouts/dock-layout/LayoutSlots.tsx +85 -0
  281. package/src/ui/layouts/dock-layout/index.tsx +2 -0
  282. package/src/ui/layouts/index.ts +2 -0
  283. package/src/ui/layouts/liquid-layout/LayoutSlots.tsx +82 -0
  284. package/src/ui/layouts/liquid-layout/LiquidLayoutView.tsx +76 -0
  285. package/src/ui/layouts/liquid-layout/index.ts +1 -0
  286. package/src/ui/modal.tsx +211 -0
  287. package/src/ui/navigation.tsx +86 -0
  288. package/src/ui/pagination.tsx +129 -0
  289. package/src/ui/panel.tsx +146 -0
  290. package/src/ui/popover.tsx +112 -0
  291. package/src/ui/radio-group.tsx +63 -0
  292. package/src/ui/resizable.tsx +52 -0
  293. package/src/ui/select.tsx +365 -0
  294. package/src/ui/separator.tsx +26 -0
  295. package/src/ui/sheet.tsx +257 -0
  296. package/src/ui/sidebar.tsx +695 -0
  297. package/src/ui/simple-tree-view.tsx +604 -0
  298. package/src/ui/skeleton.tsx +15 -0
  299. package/src/ui/slider.tsx +204 -0
  300. package/src/ui/switch.tsx +45 -0
  301. package/src/ui/table.tsx +99 -0
  302. package/src/ui/tabs.tsx +192 -0
  303. package/src/ui/textarea.tsx +55 -0
  304. package/src/ui/theme/ThemeProvider.tsx +319 -0
  305. package/src/ui/theme/ThemeToggles.tsx +84 -0
  306. package/src/ui/theme/index.ts +21 -0
  307. package/src/ui/theme/themeScript.tsx +179 -0
  308. package/src/ui/theme/types.ts +61 -0
  309. package/src/ui/toast.tsx +30 -0
  310. package/src/ui/toggle-buttons.tsx +290 -0
  311. package/src/ui/toggle-group.tsx +236 -0
  312. package/src/ui/toggle.tsx +94 -0
  313. package/src/ui/toolbar.tsx +54 -0
  314. package/src/ui/tooltip.tsx +171 -0
  315. package/src/ui/tree-view/TreeSearchBar.tsx +88 -0
  316. package/src/ui/tree-view/TreeView.tsx +232 -0
  317. package/src/ui/tree-view/hooks.tsx +289 -0
  318. package/src/ui/tree-view/index.ts +4 -0
  319. package/src/ui/tree-view/types.ts +23 -0
  320. package/src/ui/tree-view-legacy.tsx +644 -0
  321. package/src/ui/version-badge.tsx +0 -0
  322. package/src/ui/waterfall/CursorOverlay.tsx +96 -0
  323. package/src/ui/waterfall/NavigationControls.tsx +42 -0
  324. package/src/ui/waterfall/Tick.tsx +51 -0
  325. package/src/ui/waterfall/TimeRuleEventDot.tsx +19 -0
  326. package/src/ui/waterfall/TimelineEvent.tsx +60 -0
  327. package/src/ui/waterfall/TimelineProcessBar.tsx +207 -0
  328. package/src/ui/waterfall/Wedges.tsx +67 -0
  329. package/src/ui/waterfall/WheelZoomContext.tsx +128 -0
  330. package/src/ui/waterfall/hooks/useTimelineState.tsx +134 -0
  331. package/src/ui/waterfall/hooks/useViewport.tsx +293 -0
  332. package/src/ui/waterfall/index.tsx +326 -0
  333. package/src/ui/waterfall/types.ts +20 -0
  334. package/src/ui/waterfall/utils.ts +91 -0
  335. package/dist/chunk-W2YAQV5N.mjs +0 -57
  336. package/dist/{chunk-QLCEHV4Q.mjs → chunk-2OZK5DY5.mjs} +2 -2
  337. package/dist/{chunk-Z35DNFRZ.cjs → chunk-7IS37C3P.cjs} +2 -2
  338. package/dist/{chunk-4AOAH77D.mjs → chunk-A2PCEL5S.mjs} +2 -2
  339. package/dist/{chunk-K4VD5PPY.mjs → chunk-BIUDC66P.mjs} +1 -1
  340. package/dist/{chunk-RKJR6RZU.cjs → chunk-OYNLQTHW.cjs} +1 -1
  341. package/dist/{chunk-VE3XLQLO.cjs → chunk-QUFZWF4E.cjs} +2 -2
@@ -0,0 +1,365 @@
1
+ import * as SelectPrimitive from "@radix-ui/react-select";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4
+ import { type ComponentProps, createContext, type ReactNode, useContext } from "react";
5
+
6
+ import { cn } from "../hooks";
7
+
8
+ const SelectContext = createContext<{
9
+ font: "standard" | "mono";
10
+ align: "left" | "center" | "right";
11
+ }>({ font: "mono", align: "left" });
12
+
13
+ interface SelectRootProps extends ComponentProps<typeof SelectPrimitive.Root> {
14
+ font?: "standard" | "mono";
15
+ align?: "left" | "center" | "right";
16
+ }
17
+
18
+ /**
19
+ * Select root primitive.
20
+ */
21
+ export function Select({ font = "mono", align = "left", ...props }: SelectRootProps) {
22
+ return (
23
+ <SelectContext.Provider value={{ font, align }}>
24
+ <SelectPrimitive.Root data-slot="select" data-font={font} data-align={align} {...props} />
25
+ </SelectContext.Provider>
26
+ );
27
+ }
28
+
29
+ /**
30
+ * Group container for related select items.
31
+ */
32
+ export function SelectGroup({ className, ...props }: ComponentProps<typeof SelectPrimitive.Group>) {
33
+ return (
34
+ <SelectPrimitive.Group
35
+ data-slot="select-group"
36
+ className={cn("space-y-xs", className)}
37
+ {...props}
38
+ />
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Displays the selected value inside the trigger.
44
+ */
45
+ export function SelectValue({ ...props }: ComponentProps<typeof SelectPrimitive.Value>) {
46
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
47
+ }
48
+
49
+ export const selectTriggerVariants = cva(
50
+ [
51
+ "flex",
52
+ "items-center",
53
+ "gap-2",
54
+ "bg-select-secondary",
55
+ "whitespace-nowrap",
56
+ "shadow-xs",
57
+ "transition-[color,box-shadow]",
58
+ "outline-none",
59
+ "*:data-[slot=select-value]:line-clamp-1",
60
+ "*:data-[slot=select-value]:flex",
61
+ "*:data-[slot=select-value]:items-center",
62
+ "*:data-[slot=select-value]:gap-2",
63
+ "[&_svg]:shrink-0",
64
+ "[&_svg]:pointer-events-none",
65
+ "[&_svg:not([class*='text-'])]:text-muted-foreground",
66
+ "[type=number]:font-number-input",
67
+ ],
68
+ {
69
+ variants: {
70
+ state: {
71
+ default: ["hover:bg-bg-secondary/80", "has-[input:focus]:bg-bg-secondary"],
72
+ disabled: ["disabled:cursor-not-allowed", "bg-bg-tertiary", "text-text-tertiary"],
73
+ error: ["hover:bg-danger-primary/10", "bg-danger-primary/20"],
74
+ },
75
+ size: {
76
+ sm: "px-sm py-xs text-uk-sm h-6 [&_svg:not([class*='size-'])]:size-3 rounded-uk-md",
77
+ md: "px-md py-sm text-uk-md h-8 [&_svg:not([class*='size-'])]:size-4 rounded-uk-lg",
78
+ lg: "px-lg py-sm text-uk-lg h-9 [&_svg:not([class*='size-'])]:size-5 rounded-uk-xl",
79
+ },
80
+ font: {
81
+ standard: "font-sans",
82
+ mono: "font-number-input",
83
+ },
84
+ align: {
85
+ left: "justify-between",
86
+ center:
87
+ "justify-center *:data-[slot=select-value]:flex-1 *:data-[slot=select-value]:justify-center",
88
+ right:
89
+ "justify-between *:data-[slot=select-value]:flex-1 *:data-[slot=select-value]:justify-end",
90
+ },
91
+ },
92
+ defaultVariants: {
93
+ state: "default",
94
+ size: "md",
95
+ font: "mono",
96
+ align: "left",
97
+ },
98
+ },
99
+ );
100
+
101
+ interface SelectTriggerProps
102
+ extends Omit<ComponentProps<typeof SelectPrimitive.Trigger>, "ref">,
103
+ VariantProps<typeof selectTriggerVariants> {}
104
+
105
+ /**
106
+ * Trigger button for the select.
107
+ */
108
+ export function SelectTrigger({
109
+ className,
110
+ size,
111
+ children,
112
+ disabled,
113
+ state,
114
+ font,
115
+ align,
116
+ ...props
117
+ }: SelectTriggerProps) {
118
+ return (
119
+ <SelectPrimitive.Trigger
120
+ data-slot="select-trigger"
121
+ data-size={size}
122
+ className={cn(
123
+ selectTriggerVariants({
124
+ size,
125
+ className,
126
+ state: disabled ? "disabled" : state,
127
+ font,
128
+ align,
129
+ }),
130
+ )}
131
+ disabled={disabled}
132
+ {...props}
133
+ >
134
+ {children}
135
+ <SelectPrimitive.Icon asChild>
136
+ <ChevronDownIcon className="opacity-50" />
137
+ </SelectPrimitive.Icon>
138
+ </SelectPrimitive.Trigger>
139
+ );
140
+ }
141
+
142
+ /**
143
+ * Floating panel containing options.
144
+ */
145
+ export function SelectContent({
146
+ className,
147
+ children,
148
+ position = "item-aligned",
149
+ ...props
150
+ }: ComponentProps<typeof SelectPrimitive.Content>) {
151
+ const { font } = useContext(SelectContext);
152
+ return (
153
+ <SelectPrimitive.Portal>
154
+ <SelectPrimitive.Content
155
+ data-slot="select-content"
156
+ data-font={font}
157
+ className={cn(
158
+ [
159
+ "bg-bg-primary",
160
+ "data-[state=open]:animate-in",
161
+ "data-[state=closed]:animate-out",
162
+ "data-[state=closed]:fade-out-0",
163
+ "data-[state=open]:fade-in-0",
164
+ "data-[state=closed]:zoom-out-95",
165
+ "data-[state=open]:zoom-in-95",
166
+ "data-[side=bottom]:slide-in-from-top-2",
167
+ "data-[side=left]:slide-in-from-right-2",
168
+ "data-[side=right]:slide-in-from-left-2",
169
+ "data-[side=top]:slide-in-from-bottom-2",
170
+ "relative",
171
+ "z-50",
172
+ "max-h-(--radix-select-content-available-height)",
173
+ "origin-(--radix-select-content-transform-origin)",
174
+ "overflow-x-hidden",
175
+ "overflow-y-auto",
176
+ "rounded-uk-md",
177
+ "shadow-[0_4px_16px_0_var(--color-shadow-secondary)]",
178
+ "liquid:liquid-bg",
179
+ font === "standard" ? "font-sans" : "font-number-input",
180
+ ],
181
+ {
182
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1":
183
+ position === "popper",
184
+ "-ml-2 translate-x-2": position === "item-aligned",
185
+ },
186
+ className,
187
+ )}
188
+ position={position}
189
+ {...props}
190
+ >
191
+ <SelectScrollUpButton />
192
+ <SelectPrimitive.Viewport
193
+ className={cn("p-md", {
194
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1":
195
+ position === "popper",
196
+ })}
197
+ >
198
+ {children}
199
+ </SelectPrimitive.Viewport>
200
+ <SelectScrollDownButton />
201
+ </SelectPrimitive.Content>
202
+ </SelectPrimitive.Portal>
203
+ );
204
+ }
205
+ /**
206
+ * Section label for options.
207
+ */
208
+ export function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) {
209
+ return (
210
+ <SelectPrimitive.Label
211
+ data-slot="select-label"
212
+ className={cn("text-text-secondary text-uk-sm px-2 py-1.5", className)}
213
+ {...props}
214
+ />
215
+ );
216
+ }
217
+
218
+ interface SelectItemProps extends Omit<ComponentProps<typeof SelectPrimitive.Item>, "prefix"> {
219
+ prefix?: ReactNode;
220
+ suffix?: ReactNode;
221
+ }
222
+
223
+ /**
224
+ * Single option row with optional prefix/suffix content.
225
+ */
226
+ export function SelectItem({
227
+ className,
228
+ children,
229
+ prefix,
230
+ suffix,
231
+ disabled,
232
+ ...props
233
+ }: SelectItemProps) {
234
+ return (
235
+ <SelectPrimitive.Item
236
+ data-slot="select-item"
237
+ disabled={disabled}
238
+ className={cn(
239
+ [
240
+ "group/select-item",
241
+ "w-full",
242
+ "flex",
243
+ "gap-sm",
244
+ "items-center",
245
+ "px-xs",
246
+ "py-xxs",
247
+ "relative",
248
+ "cursor-default",
249
+ "rounded-uk-sm",
250
+ "text-uk-sm",
251
+ "outline-hidden",
252
+ "select-none",
253
+ "focus:bg-bg-tertiary",
254
+ "active:text-text-withbg",
255
+ "active:bg-brand-primary/90",
256
+ "data-[state=checked]:bg-brand-primary",
257
+ "data-[state=checked]:text-text-withbg",
258
+ "data-[disabled]:pointer-events-none",
259
+ "data-[disabled]:text-bg-quaternary",
260
+ "[&_svg]:pointer-events-none",
261
+ "[&_svg]:shrink-0",
262
+ "[&_svg:not([class*='size-'])]:size-4",
263
+ "[&_svg:not([class*='text-'])]:text-muted-foreground",
264
+ "*:[span]:last:flex",
265
+ "*:[span]:last:items-center",
266
+ "*:[span]:last:gap-2",
267
+ // Font inheritance from parent select
268
+ "[*[data-font=standard]_&]:font-sans",
269
+ "[*[data-font=mono]_&]:font-number-input",
270
+ // Alignment inheritance from parent select
271
+ "[*[data-align=left]_&]:justify-start",
272
+ "[*[data-align=center]_&]:justify-center",
273
+ "[*[data-align=right]_&]:justify-end",
274
+ ],
275
+ className,
276
+ )}
277
+ {...props}
278
+ >
279
+ {prefix && (
280
+ <p
281
+ data-disabled={disabled}
282
+ className={cn([
283
+ "text-text-tertiary",
284
+ "flex",
285
+ "shrink-0",
286
+ "gap-0.5",
287
+ "data-[disabled=true]:text-bg-quaternary",
288
+ "group-data-[state=checked]/select-item:text-text-withbg",
289
+ ])}
290
+ >
291
+ {prefix}
292
+ </p>
293
+ )}
294
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
295
+ {suffix && (
296
+ <p
297
+ data-disabled={disabled}
298
+ className={cn(
299
+ "text-text-tertiary",
300
+ "ml-auto",
301
+ "flex",
302
+ "shrink-0",
303
+ "gap-0.5",
304
+ "data-[disabled=true]:text-bg-quaternary",
305
+ "group-data-[state=checked]/select-item:text-text-withbg",
306
+ )}
307
+ >
308
+ {suffix}
309
+ </p>
310
+ )}
311
+ </SelectPrimitive.Item>
312
+ );
313
+ }
314
+
315
+ /**
316
+ * Visual separator between groups.
317
+ */
318
+ export function SelectSeparator({
319
+ className,
320
+ ...props
321
+ }: ComponentProps<typeof SelectPrimitive.Separator>) {
322
+ return (
323
+ <SelectPrimitive.Separator
324
+ data-slot="select-separator"
325
+ className={cn("bg-line-primary my-lg pointer-events-none -mx-1 h-px", className)}
326
+ {...props}
327
+ />
328
+ );
329
+ }
330
+
331
+ /**
332
+ * Scroll button at top of list.
333
+ */
334
+ export function SelectScrollUpButton({
335
+ className,
336
+ ...props
337
+ }: ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
338
+ return (
339
+ <SelectPrimitive.ScrollUpButton
340
+ data-slot="select-scroll-up-button"
341
+ className={cn("mx-24 flex cursor-default items-center justify-center py-1", className)}
342
+ {...props}
343
+ >
344
+ <ChevronUpIcon className="size-4" />
345
+ </SelectPrimitive.ScrollUpButton>
346
+ );
347
+ }
348
+
349
+ /**
350
+ * Scroll button at bottom of list.
351
+ */
352
+ export function SelectScrollDownButton({
353
+ className,
354
+ ...props
355
+ }: ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
356
+ return (
357
+ <SelectPrimitive.ScrollDownButton
358
+ data-slot="select-scroll-down-button"
359
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
360
+ {...props}
361
+ >
362
+ <ChevronDownIcon className="size-4" />
363
+ </SelectPrimitive.ScrollDownButton>
364
+ );
365
+ }
@@ -0,0 +1,26 @@
1
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
2
+ import { ComponentProps } from "react";
3
+
4
+ import { cn } from "../hooks";
5
+
6
+ function Separator({
7
+ className,
8
+ orientation = "horizontal",
9
+ decorative = true,
10
+ ...props
11
+ }: ComponentProps<typeof SeparatorPrimitive.Root>) {
12
+ return (
13
+ <SeparatorPrimitive.Root
14
+ data-slot="separator-root"
15
+ decorative={decorative}
16
+ orientation={orientation}
17
+ className={cn(
18
+ "bg-line-primary shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
19
+ className,
20
+ )}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ export { Separator };
@@ -0,0 +1,257 @@
1
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
2
+ import { XIcon } from "lucide-react";
3
+ import { ComponentProps } from "react";
4
+
5
+ import { cn, createClientOnlyComponent } from "../hooks";
6
+
7
+ /**
8
+ * Sheet root using dialog primitives.
9
+ */
10
+ function SheetRoot({ ...props }: ComponentProps<typeof SheetPrimitive.Root>) {
11
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />;
12
+ }
13
+
14
+ function SheetFallback({ ...props }: ComponentProps<"div">) {
15
+ return <div data-slot="sheet" {...props} />;
16
+ }
17
+
18
+ const Sheet = createClientOnlyComponent(SheetRoot, SheetFallback);
19
+
20
+ /**
21
+ * Trigger element that opens the sheet.
22
+ */
23
+ function SheetTriggerRoot({ ...props }: ComponentProps<typeof SheetPrimitive.Trigger>) {
24
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
25
+ }
26
+
27
+ function SheetTriggerFallback({
28
+ asChild,
29
+ children,
30
+ ...props
31
+ }: ComponentProps<"button"> & { asChild?: boolean }) {
32
+ if (asChild) {
33
+ return <>{children}</>;
34
+ }
35
+ return (
36
+ <button data-slot="sheet-trigger" {...props}>
37
+ {children}
38
+ </button>
39
+ );
40
+ }
41
+
42
+ const SheetTrigger = createClientOnlyComponent(SheetTriggerRoot, SheetTriggerFallback);
43
+
44
+ /**
45
+ * Close control for the sheet.
46
+ */
47
+ function SheetCloseRoot({ ...props }: ComponentProps<typeof SheetPrimitive.Close>) {
48
+ return (
49
+ <SheetPrimitive.Close
50
+ data-slot="sheet-close"
51
+ className={cn("focus:ring-0 focus:outline-none")}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ function SheetCloseFallback({
58
+ asChild,
59
+ children,
60
+ ...props
61
+ }: ComponentProps<"button"> & { asChild?: boolean }) {
62
+ if (asChild) {
63
+ return <>{children}</>;
64
+ }
65
+ return (
66
+ <button data-slot="sheet-close" className={cn("focus:ring-0 focus:outline-none")} {...props}>
67
+ {children}
68
+ </button>
69
+ );
70
+ }
71
+
72
+ const SheetClose = createClientOnlyComponent(SheetCloseRoot, SheetCloseFallback);
73
+
74
+ /**
75
+ * Portal for sheet overlay and content.
76
+ */
77
+ function SheetPortal({ ...props }: ComponentProps<typeof SheetPrimitive.Portal>) {
78
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
79
+ }
80
+
81
+ /**
82
+ * Fullscreen overlay behind the sheet.
83
+ */
84
+ function SheetOverlay({ className, ...props }: ComponentProps<typeof SheetPrimitive.Overlay>) {
85
+ return (
86
+ <SheetPrimitive.Overlay
87
+ data-slot="sheet-overlay"
88
+ className={cn(
89
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-bg-mask fixed inset-0 z-50",
90
+ className,
91
+ )}
92
+ {...props}
93
+ />
94
+ );
95
+ }
96
+
97
+ /**
98
+ * Sliding panel content for the sheet.
99
+ */
100
+ function SheetContentRoot({
101
+ className,
102
+ children,
103
+ side = "right",
104
+ ...props
105
+ }: ComponentProps<typeof SheetPrimitive.Content> & {
106
+ side?: "top" | "right" | "bottom" | "left";
107
+ }) {
108
+ return (
109
+ <SheetPortal>
110
+ <SheetOverlay />
111
+ <SheetPrimitive.Content
112
+ data-slot="sheet-content"
113
+ className={cn(
114
+ "liquid:liquid-bg bg-bg-primary data-[state=open]:animate-in data-[state=closed]:animate-out p-xl fixed z-50 flex flex-col gap-4 shadow-[0_4px_16px_0_var(--color-shadow-secondary)] transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
115
+ side === "right" &&
116
+ "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-[340px]",
117
+ side === "left" &&
118
+ "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-[340px]",
119
+ side === "top" &&
120
+ "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto",
121
+ side === "bottom" &&
122
+ "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto",
123
+ className,
124
+ )}
125
+ {...props}
126
+ >
127
+ {children}
128
+ <SheetPrimitive.Close className="text-icon-primary hover:text-icon-highlight absolute top-4 right-4 disabled:pointer-events-none">
129
+ <XIcon className="size-4" />
130
+ <span className="sr-only">Close</span>
131
+ </SheetPrimitive.Close>
132
+ </SheetPrimitive.Content>
133
+ </SheetPortal>
134
+ );
135
+ }
136
+
137
+ function SheetContentFallback({
138
+ className,
139
+ children,
140
+ side = "right",
141
+ ...props
142
+ }: ComponentProps<"div"> & {
143
+ side?: "top" | "right" | "bottom" | "left";
144
+ }) {
145
+ return (
146
+ <div
147
+ data-slot="sheet-content"
148
+ className={cn(
149
+ "liquid:liquid-bg bg-bg-primary p-xl fixed z-50 flex flex-col gap-4 shadow-[0_4px_16px_0_var(--color-shadow-secondary)]",
150
+ side === "right" && "inset-y-0 right-0 h-full w-[340px]",
151
+ side === "left" && "inset-y-0 left-0 h-full w-[340px]",
152
+ side === "top" && "inset-x-0 top-0 h-auto",
153
+ side === "bottom" && "inset-x-0 bottom-0 h-auto",
154
+ className,
155
+ )}
156
+ {...props}
157
+ >
158
+ {children}
159
+ <button className="text-icon-primary hover:text-icon-highlight absolute top-4 right-4 disabled:pointer-events-none">
160
+ <XIcon className="size-4" />
161
+ <span className="sr-only">Close</span>
162
+ </button>
163
+ </div>
164
+ );
165
+ }
166
+
167
+ const SheetContent = createClientOnlyComponent(SheetContentRoot, SheetContentFallback);
168
+
169
+ /**
170
+ * Header section inside the sheet.
171
+ */
172
+ function SheetHeader({ className, ...props }: ComponentProps<"div">) {
173
+ return (
174
+ <div
175
+ data-slot="sheet-header"
176
+ className={cn("gap-md pb-xl flex flex-col", className)}
177
+ {...props}
178
+ />
179
+ );
180
+ }
181
+
182
+ /**
183
+ * Footer section inside the sheet.
184
+ */
185
+ function SheetFooter({ className, ...props }: ComponentProps<"div">) {
186
+ return (
187
+ <div
188
+ data-slot="sheet-footer"
189
+ className={cn("gap-lg pt-xl mt-auto flex flex-col", className)}
190
+ {...props}
191
+ />
192
+ );
193
+ }
194
+
195
+ /**
196
+ * Title text for the sheet.
197
+ */
198
+ function SheetTitleRoot({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) {
199
+ return (
200
+ <SheetPrimitive.Title
201
+ data-slot="sheet-title"
202
+ className={cn("text-text-highlight text-uk-xl leading-uk-xl font-medium", className)}
203
+ {...props}
204
+ />
205
+ );
206
+ }
207
+
208
+ function SheetTitleFallback({ className, ...props }: ComponentProps<"h2">) {
209
+ return (
210
+ <h2
211
+ data-slot="sheet-title"
212
+ className={cn("text-text-highlight text-uk-xl leading-uk-xl font-medium", className)}
213
+ {...props}
214
+ />
215
+ );
216
+ }
217
+
218
+ const SheetTitle = createClientOnlyComponent(SheetTitleRoot, SheetTitleFallback);
219
+
220
+ /**
221
+ * Secondary description text for the sheet.
222
+ */
223
+ function SheetDescriptionRoot({
224
+ className,
225
+ ...props
226
+ }: ComponentProps<typeof SheetPrimitive.Description>) {
227
+ return (
228
+ <SheetPrimitive.Description
229
+ data-slot="sheet-description"
230
+ className={cn("text-text-secondary text-uk-md leading-uk-md", className)}
231
+ {...props}
232
+ />
233
+ );
234
+ }
235
+
236
+ function SheetDescriptionFallback({ className, ...props }: ComponentProps<"p">) {
237
+ return (
238
+ <p
239
+ data-slot="sheet-description"
240
+ className={cn("text-text-secondary text-uk-md leading-uk-md", className)}
241
+ {...props}
242
+ />
243
+ );
244
+ }
245
+
246
+ const SheetDescription = createClientOnlyComponent(SheetDescriptionRoot, SheetDescriptionFallback);
247
+
248
+ export {
249
+ Sheet,
250
+ SheetTrigger,
251
+ SheetClose,
252
+ SheetContent,
253
+ SheetHeader,
254
+ SheetFooter,
255
+ SheetTitle,
256
+ SheetDescription,
257
+ };