@vuer-ai/vuer-uikit 0.0.2 → 0.0.4

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 (230) hide show
  1. package/README.md +80 -0
  2. package/dist/chunk-25GQKTNF.mjs +105 -0
  3. package/dist/chunk-277NQUJD.js +99 -0
  4. package/dist/chunk-3FR3WKI4.mjs +24 -0
  5. package/dist/chunk-3Q75Z2CT.mjs +76 -0
  6. package/dist/chunk-5BIQ3IN7.js +93 -0
  7. package/dist/chunk-5GPQ7U5B.mjs +50 -0
  8. package/dist/chunk-66JQXJEV.mjs +272 -0
  9. package/dist/chunk-6ILSFDR5.mjs +161 -0
  10. package/dist/chunk-6L4KPPOD.mjs +90 -0
  11. package/dist/chunk-75QDQ67T.js +56 -0
  12. package/dist/chunk-7A7VNE3J.mjs +31 -0
  13. package/dist/chunk-7SXCVFSA.mjs +200 -0
  14. package/dist/chunk-7V4ELMOH.js +52 -0
  15. package/dist/chunk-7WUQTWQX.js +303 -0
  16. package/dist/chunk-A2Z57NAA.js +202 -0
  17. package/dist/chunk-ATDHGFVI.mjs +82 -0
  18. package/dist/chunk-ATEHWT2R.mjs +78 -0
  19. package/dist/chunk-B5EMQBVL.js +93 -0
  20. package/dist/chunk-CLTLT5XW.js +27 -0
  21. package/dist/chunk-COFRS37Z.mjs +337 -0
  22. package/dist/chunk-CP7QYV4N.mjs +110 -0
  23. package/dist/chunk-CZSRIDXN.mjs +165 -0
  24. package/dist/chunk-D4C5V4EN.mjs +53 -0
  25. package/dist/chunk-DWIK2CUV.mjs +45 -0
  26. package/dist/chunk-ECWCQWV5.js +148 -0
  27. package/dist/chunk-ENZI5WM7.js +108 -0
  28. package/dist/chunk-FVT46HEE.js +21 -0
  29. package/dist/chunk-FXIL4NQZ.js +58 -0
  30. package/dist/chunk-FYS6YECN.js +33 -0
  31. package/dist/chunk-G7XNQVPB.js +187 -0
  32. package/dist/chunk-GSXXTAQ3.js +373 -0
  33. package/dist/chunk-HUQZOPYD.js +2 -0
  34. package/dist/chunk-HW6SLBO3.mjs +9 -0
  35. package/dist/chunk-IPKCIMU4.mjs +156 -0
  36. package/dist/chunk-J7PTSP4Q.mjs +19 -0
  37. package/dist/chunk-KJ42IGH6.js +2 -0
  38. package/dist/chunk-KO7BQ6RR.js +83 -0
  39. package/dist/chunk-KQHNQQUZ.js +103 -0
  40. package/dist/chunk-KVFK3YC7.js +187 -0
  41. package/dist/chunk-KYKEJFJT.js +110 -0
  42. package/dist/chunk-LD7Y34QT.js +79 -0
  43. package/dist/chunk-LVSI4HYF.mjs +409 -0
  44. package/dist/chunk-M3KBBKQR.mjs +15 -0
  45. package/dist/chunk-MASRZTZC.mjs +34 -0
  46. package/dist/chunk-NN7R5DNL.mjs +119 -0
  47. package/dist/chunk-OE56M4MX.js +93 -0
  48. package/dist/chunk-OTDY2E2A.js +163 -0
  49. package/dist/chunk-PKGNHHWG.mjs +60 -0
  50. package/dist/chunk-Q3APPCB2.mjs +91 -0
  51. package/dist/chunk-QOUX33X5.mjs +111 -0
  52. package/dist/chunk-QS7WS6DD.mjs +1 -0
  53. package/dist/chunk-QZASHJNJ.js +24 -0
  54. package/dist/chunk-R6XNT4PN.js +431 -0
  55. package/dist/chunk-RACVRWME.js +136 -0
  56. package/dist/chunk-S2F2GRDB.mjs +1 -0
  57. package/dist/chunk-SI56IQWH.js +102 -0
  58. package/dist/chunk-ST4P6AN6.js +2 -0
  59. package/dist/chunk-TOZYLDAL.mjs +72 -0
  60. package/dist/chunk-UFR656UY.mjs +87 -0
  61. package/dist/chunk-UWO6RBCE.js +11 -0
  62. package/dist/chunk-VGCVIHBR.mjs +1 -0
  63. package/dist/chunk-WOG6UIG5.mjs +71 -0
  64. package/dist/chunk-X2QENXCS.mjs +54 -0
  65. package/dist/chunk-XACRGXGF.js +75 -0
  66. package/dist/chunk-XPNUQSKQ.mjs +94 -0
  67. package/dist/chunk-YQORMF34.js +110 -0
  68. package/dist/chunk-Z37VNICQ.js +67 -0
  69. package/dist/chunk-ZJXBC33M.js +112 -0
  70. package/dist/highlight-cursor/cursor-context.d.mts +7 -0
  71. package/dist/highlight-cursor/cursor-context.d.ts +7 -0
  72. package/dist/highlight-cursor/cursor-context.js +14 -0
  73. package/dist/highlight-cursor/cursor-context.mjs +1 -0
  74. package/dist/highlight-cursor/cursor-provider.d.mts +7 -0
  75. package/dist/highlight-cursor/cursor-provider.d.ts +7 -0
  76. package/dist/highlight-cursor/cursor-provider.js +12 -0
  77. package/dist/highlight-cursor/cursor-provider.mjs +3 -0
  78. package/dist/highlight-cursor/enhanced-components.d.mts +20 -0
  79. package/dist/highlight-cursor/enhanced-components.d.ts +20 -0
  80. package/dist/highlight-cursor/enhanced-components.js +36 -0
  81. package/dist/highlight-cursor/enhanced-components.mjs +11 -0
  82. package/dist/highlight-cursor/index.d.mts +16 -0
  83. package/dist/highlight-cursor/index.d.ts +16 -0
  84. package/dist/highlight-cursor/index.js +50 -0
  85. package/dist/highlight-cursor/index.mjs +13 -0
  86. package/dist/highlight-cursor/tabs-cursor-context.d.mts +14 -0
  87. package/dist/highlight-cursor/tabs-cursor-context.d.ts +14 -0
  88. package/dist/highlight-cursor/tabs-cursor-context.js +14 -0
  89. package/dist/highlight-cursor/tabs-cursor-context.mjs +1 -0
  90. package/dist/highlight-cursor/types.d.mts +39 -0
  91. package/dist/highlight-cursor/types.d.ts +39 -0
  92. package/dist/highlight-cursor/types.js +2 -0
  93. package/dist/highlight-cursor/types.mjs +1 -0
  94. package/dist/highlight-cursor/with-cursor.d.mts +7 -0
  95. package/dist/highlight-cursor/with-cursor.d.ts +7 -0
  96. package/dist/highlight-cursor/with-cursor.js +11 -0
  97. package/dist/highlight-cursor/with-cursor.mjs +2 -0
  98. package/dist/index.css +314 -0
  99. package/dist/index.d.mts +51 -0
  100. package/dist/index.d.ts +51 -0
  101. package/dist/index.js +425 -6744
  102. package/dist/index.mjs +34 -0
  103. package/dist/styles/theme.css +191 -0
  104. package/dist/styles/theme.d.mts +2 -0
  105. package/dist/styles/theme.d.ts +2 -0
  106. package/dist/styles/toast.css +58 -0
  107. package/dist/styles/toast.d.mts +2 -0
  108. package/dist/styles/toast.d.ts +2 -0
  109. package/dist/styles/variables.css +188 -0
  110. package/dist/styles/variables.d.mts +2 -0
  111. package/dist/styles/variables.d.ts +2 -0
  112. package/dist/ui/avatar.d.mts +16 -0
  113. package/dist/ui/avatar.d.ts +16 -0
  114. package/dist/ui/avatar.js +23 -0
  115. package/dist/ui/avatar.mjs +2 -0
  116. package/dist/ui/badge.d.mts +14 -0
  117. package/dist/ui/badge.d.ts +14 -0
  118. package/dist/ui/badge.js +16 -0
  119. package/dist/ui/badge.mjs +3 -0
  120. package/dist/ui/button.d.mts +16 -0
  121. package/dist/ui/button.d.ts +16 -0
  122. package/dist/ui/button.js +12 -0
  123. package/dist/ui/button.mjs +3 -0
  124. package/dist/ui/card.d.mts +12 -0
  125. package/dist/ui/card.d.ts +12 -0
  126. package/dist/ui/card.js +36 -0
  127. package/dist/ui/card.mjs +3 -0
  128. package/dist/ui/checkbox.d.mts +11 -0
  129. package/dist/ui/checkbox.d.ts +11 -0
  130. package/dist/ui/checkbox.js +12 -0
  131. package/dist/ui/checkbox.mjs +3 -0
  132. package/dist/ui/collapsible.d.mts +9 -0
  133. package/dist/ui/collapsible.d.ts +9 -0
  134. package/dist/ui/collapsible.js +20 -0
  135. package/dist/ui/collapsible.mjs +3 -0
  136. package/dist/ui/dropdown.d.mts +28 -0
  137. package/dist/ui/dropdown.d.ts +28 -0
  138. package/dist/ui/dropdown.js +68 -0
  139. package/dist/ui/dropdown.mjs +3 -0
  140. package/dist/ui/index.d.mts +44 -0
  141. package/dist/ui/index.d.ts +44 -0
  142. package/dist/ui/index.js +398 -0
  143. package/dist/ui/index.mjs +29 -0
  144. package/dist/ui/input-numbers.d.mts +15 -0
  145. package/dist/ui/input-numbers.d.ts +15 -0
  146. package/dist/ui/input-numbers.js +13 -0
  147. package/dist/ui/input-numbers.mjs +4 -0
  148. package/dist/ui/input.d.mts +22 -0
  149. package/dist/ui/input.d.ts +22 -0
  150. package/dist/ui/input.js +16 -0
  151. package/dist/ui/input.mjs +3 -0
  152. package/dist/ui/layout.d.mts +12 -0
  153. package/dist/ui/layout.d.ts +12 -0
  154. package/dist/ui/layout.js +12 -0
  155. package/dist/ui/layout.mjs +3 -0
  156. package/dist/ui/modal.d.mts +28 -0
  157. package/dist/ui/modal.d.ts +28 -0
  158. package/dist/ui/modal.js +48 -0
  159. package/dist/ui/modal.mjs +3 -0
  160. package/dist/ui/popover.d.mts +10 -0
  161. package/dist/ui/popover.d.ts +10 -0
  162. package/dist/ui/popover.js +23 -0
  163. package/dist/ui/popover.mjs +2 -0
  164. package/dist/ui/radio-group.d.mts +8 -0
  165. package/dist/ui/radio-group.d.ts +8 -0
  166. package/dist/ui/radio-group.js +16 -0
  167. package/dist/ui/radio-group.mjs +3 -0
  168. package/dist/ui/select.d.mts +28 -0
  169. package/dist/{types/ui → ui}/select.d.ts +18 -14
  170. package/dist/ui/select.js +48 -0
  171. package/dist/ui/select.mjs +3 -0
  172. package/dist/ui/sheet.d.mts +16 -0
  173. package/dist/ui/sheet.d.ts +16 -0
  174. package/dist/ui/sheet.js +39 -0
  175. package/dist/ui/sheet.mjs +2 -0
  176. package/dist/ui/slider.d.mts +10 -0
  177. package/dist/ui/slider.d.ts +10 -0
  178. package/dist/ui/slider.js +12 -0
  179. package/dist/ui/slider.mjs +3 -0
  180. package/dist/ui/switch.d.mts +7 -0
  181. package/dist/ui/switch.d.ts +7 -0
  182. package/dist/ui/switch.js +12 -0
  183. package/dist/ui/switch.mjs +3 -0
  184. package/dist/ui/tabs.d.mts +16 -0
  185. package/dist/ui/tabs.d.ts +16 -0
  186. package/dist/ui/tabs.js +25 -0
  187. package/dist/ui/tabs.mjs +4 -0
  188. package/dist/ui/textarea.d.mts +16 -0
  189. package/dist/ui/textarea.d.ts +16 -0
  190. package/dist/ui/textarea.js +12 -0
  191. package/dist/ui/textarea.mjs +3 -0
  192. package/dist/ui/theme-context.d.mts +17 -0
  193. package/dist/{types/ui → ui}/theme-context.d.ts +5 -3
  194. package/dist/ui/theme-context.js +14 -0
  195. package/dist/ui/theme-context.mjs +1 -0
  196. package/dist/ui/toast.d.mts +7 -0
  197. package/dist/ui/toast.d.ts +7 -0
  198. package/dist/ui/toast.js +14 -0
  199. package/dist/ui/toast.mjs +1 -0
  200. package/dist/ui/toggle-group.d.mts +12 -0
  201. package/dist/ui/toggle-group.d.ts +12 -0
  202. package/dist/ui/toggle-group.js +17 -0
  203. package/dist/ui/toggle-group.mjs +4 -0
  204. package/dist/ui/toggle.d.mts +13 -0
  205. package/dist/ui/toggle.d.ts +13 -0
  206. package/dist/ui/toggle.js +16 -0
  207. package/dist/ui/toggle.mjs +3 -0
  208. package/dist/ui/tooltip.d.mts +10 -0
  209. package/dist/ui/tooltip.d.ts +10 -0
  210. package/dist/ui/tooltip.js +23 -0
  211. package/dist/ui/tooltip.mjs +2 -0
  212. package/dist/ui/tree-view.d.mts +27 -0
  213. package/dist/ui/tree-view.d.ts +27 -0
  214. package/dist/ui/tree-view.js +11 -0
  215. package/dist/ui/tree-view.mjs +2 -0
  216. package/dist/utils/cn.d.mts +5 -0
  217. package/dist/utils/cn.d.ts +5 -0
  218. package/dist/utils/cn.js +10 -0
  219. package/dist/utils/cn.mjs +1 -0
  220. package/dist/utils/index.d.mts +2 -0
  221. package/dist/utils/index.d.ts +2 -0
  222. package/dist/utils/index.js +11 -0
  223. package/dist/utils/index.mjs +2 -0
  224. package/package.json +49 -27
  225. package/dist/index.umd.js +0 -74
  226. package/dist/types/index.d.ts +0 -4
  227. package/dist/types/lib/utils.d.ts +0 -2
  228. package/dist/types/ui/button.d.ts +0 -13
  229. package/dist/types/ui/input.d.ts +0 -19
  230. package/dist/vuer-uikit.css +0 -1
@@ -0,0 +1,272 @@
1
+ import { cn } from './chunk-HW6SLBO3.mjs';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ import { cva } from 'class-variance-authority';
4
+ import { ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+
7
+ function Select({ ...props }) {
8
+ return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
9
+ }
10
+ function SelectGroup({ className, ...props }) {
11
+ return /* @__PURE__ */ jsx(
12
+ SelectPrimitive.Group,
13
+ {
14
+ "data-slot": "select-group",
15
+ className: cn("space-y-xs", className),
16
+ ...props
17
+ }
18
+ );
19
+ }
20
+ function SelectValue({ ...props }) {
21
+ return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
22
+ }
23
+ var selectTriggerVariants = cva(
24
+ [
25
+ // "data-[placeholder]:text-muted-foreground",
26
+ "flex",
27
+ "items-center",
28
+ "justify-between",
29
+ "gap-2",
30
+ "rounded-uk-sm",
31
+ "bg-bg-secondary",
32
+ "whitespace-nowrap",
33
+ "shadow-xs",
34
+ "transition-[color,box-shadow]",
35
+ "outline-none",
36
+ "*:data-[slot=select-value]:line-clamp-1",
37
+ "*:data-[slot=select-value]:flex",
38
+ "*:data-[slot=select-value]:items-center",
39
+ "*:data-[slot=select-value]:gap-2",
40
+ "[&_svg]:pointer-events-none",
41
+ "[&_svg]:shrink-0",
42
+ "[&_svg:not([class*='size-'])]:size-4",
43
+ "[&_svg:not([class*='text-'])]:text-muted-foreground"
44
+ ],
45
+ {
46
+ variants: {
47
+ state: {
48
+ default: ["hover:bg-bg-tertiary", "has-[input:focus]:bg-bg-quaternary"],
49
+ disabled: ["disabled:cursor-not-allowed", "bg-bg-tertiary", "text-text-tertiary"],
50
+ error: ["hover:bg-danger-primary/10", "bg-danger-primary/20"]
51
+ },
52
+ size: {
53
+ sm: "p-sm text-sm h-6.5",
54
+ base: "",
55
+ lg: ""
56
+ }
57
+ },
58
+ defaultVariants: {
59
+ state: "default",
60
+ size: "base"
61
+ }
62
+ }
63
+ );
64
+ function SelectTrigger({
65
+ className,
66
+ size,
67
+ children,
68
+ disabled,
69
+ state,
70
+ ...props
71
+ }) {
72
+ return /* @__PURE__ */ jsxs(
73
+ SelectPrimitive.Trigger,
74
+ {
75
+ "data-slot": "select-trigger",
76
+ "data-size": size,
77
+ className: cn(
78
+ selectTriggerVariants({ size, className, state: disabled ? "disabled" : state })
79
+ ),
80
+ disabled,
81
+ ...props,
82
+ children: [
83
+ children,
84
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
85
+ ]
86
+ }
87
+ );
88
+ }
89
+ function SelectContent({
90
+ className,
91
+ children,
92
+ position = "item-aligned",
93
+ ...props
94
+ }) {
95
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
96
+ SelectPrimitive.Content,
97
+ {
98
+ "data-slot": "select-content",
99
+ className: cn(
100
+ [
101
+ "bg-bg-primary",
102
+ "data-[state=open]:animate-in",
103
+ "data-[state=closed]:animate-out",
104
+ "data-[state=closed]:fade-out-0",
105
+ "data-[state=open]:fade-in-0",
106
+ "data-[state=closed]:zoom-out-95",
107
+ "data-[state=open]:zoom-in-95",
108
+ "data-[side=bottom]:slide-in-from-top-2",
109
+ "data-[side=left]:slide-in-from-right-2",
110
+ "data-[side=right]:slide-in-from-left-2",
111
+ "data-[side=top]:slide-in-from-bottom-2",
112
+ "relative",
113
+ "z-50",
114
+ "max-h-(--radix-select-content-available-height)",
115
+ "min-w-[8rem]",
116
+ "origin-(--radix-select-content-transform-origin)",
117
+ "overflow-x-hidden",
118
+ "overflow-y-auto",
119
+ "rounded-uk-md",
120
+ "shadow-md",
121
+ "shadow-[0_8px_20px_0_rgba(0,0,0,.80)]",
122
+ "liquid:liquid-bg"
123
+ ],
124
+ {
125
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1": position === "popper"
126
+ },
127
+ className
128
+ ),
129
+ position,
130
+ ...props,
131
+ children: [
132
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
133
+ /* @__PURE__ */ jsx(
134
+ SelectPrimitive.Viewport,
135
+ {
136
+ className: cn("p-md", {
137
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1": position === "popper"
138
+ }),
139
+ children
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
143
+ ]
144
+ }
145
+ ) });
146
+ }
147
+ function SelectLabel({ className, ...props }) {
148
+ return /* @__PURE__ */ jsx(
149
+ SelectPrimitive.Label,
150
+ {
151
+ "data-slot": "select-label",
152
+ className: cn("text-text-secondary px-2 py-1.5 text-xs", className),
153
+ ...props
154
+ }
155
+ );
156
+ }
157
+ function SelectItem({ className, children, prefix, suffix, disabled, ...props }) {
158
+ return /* @__PURE__ */ jsxs(
159
+ SelectPrimitive.Item,
160
+ {
161
+ "data-slot": "select-item",
162
+ disabled,
163
+ className: cn(
164
+ [
165
+ "group/select-item",
166
+ "w-full",
167
+ "flex",
168
+ "gap-md",
169
+ "items-center",
170
+ "px-md",
171
+ "py-xs",
172
+ "relative",
173
+ "cursor-default",
174
+ "rounded-uk-xs",
175
+ "text-xs",
176
+ "outline-hidden",
177
+ "select-none",
178
+ "focus:bg-bg-secondary",
179
+ "data-[state=checked]:bg-brand-primary",
180
+ "data-[disabled]:pointer-events-none",
181
+ "data-[disabled]:text-bg-quaternary",
182
+ "[&_svg]:pointer-events-none",
183
+ "[&_svg]:shrink-0",
184
+ "[&_svg:not([class*='size-'])]:size-4",
185
+ "[&_svg:not([class*='text-'])]:text-muted-foreground",
186
+ "*:[span]:last:flex",
187
+ "*:[span]:last:items-center",
188
+ "*:[span]:last:gap-2"
189
+ ],
190
+ className
191
+ ),
192
+ ...props,
193
+ children: [
194
+ /* @__PURE__ */ jsx(
195
+ "p",
196
+ {
197
+ "data-disabled": disabled,
198
+ className: cn([
199
+ "text-text-tertiary",
200
+ "flex",
201
+ "shrink-0",
202
+ "gap-0.5",
203
+ "data-[disabled=true]:text-bg-quaternary",
204
+ "group-data-[state=checked]/select-item:text-text-withbg"
205
+ ]),
206
+ children: prefix
207
+ }
208
+ ),
209
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }),
210
+ /* @__PURE__ */ jsx(
211
+ "p",
212
+ {
213
+ "data-disabled": disabled,
214
+ className: cn(
215
+ "text-text-tertiary",
216
+ "ml-auto",
217
+ "flex",
218
+ "shrink-0",
219
+ "gap-0.5",
220
+ "data-[disabled=true]:text-bg-quaternary",
221
+ "group-data-[state=checked]/select-item:text-text-withbg"
222
+ ),
223
+ children: suffix
224
+ }
225
+ )
226
+ ]
227
+ }
228
+ );
229
+ }
230
+ function SelectSeparator({
231
+ className,
232
+ ...props
233
+ }) {
234
+ return /* @__PURE__ */ jsx(
235
+ SelectPrimitive.Separator,
236
+ {
237
+ "data-slot": "select-separator",
238
+ className: cn("bg-line-primary my-lg pointer-events-none -mx-1 h-px", className),
239
+ ...props
240
+ }
241
+ );
242
+ }
243
+ function SelectScrollUpButton({
244
+ className,
245
+ ...props
246
+ }) {
247
+ return /* @__PURE__ */ jsx(
248
+ SelectPrimitive.ScrollUpButton,
249
+ {
250
+ "data-slot": "select-scroll-up-button",
251
+ className: cn("flex cursor-default items-center justify-center py-1", className),
252
+ ...props,
253
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
254
+ }
255
+ );
256
+ }
257
+ function SelectScrollDownButton({
258
+ className,
259
+ ...props
260
+ }) {
261
+ return /* @__PURE__ */ jsx(
262
+ SelectPrimitive.ScrollDownButton,
263
+ {
264
+ "data-slot": "select-scroll-down-button",
265
+ className: cn("flex cursor-default items-center justify-center py-1", className),
266
+ ...props,
267
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
268
+ }
269
+ );
270
+ }
271
+
272
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -0,0 +1,161 @@
1
+ import { InputRoot, InputSlot } from './chunk-25GQKTNF.mjs';
2
+ import { cn } from './chunk-HW6SLBO3.mjs';
3
+ import { useGesture } from '@use-gesture/react';
4
+ import { forwardRef, useRef, useCallback } from 'react';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ var getHoverElementAndIndex = (element, inputs) => {
8
+ if (!element) return null;
9
+ const container = element == null ? void 0 : element.closest("[data-input]");
10
+ const currentInput = container == null ? void 0 : container.querySelector("input");
11
+ if (!currentInput) return null;
12
+ return Array.from(inputs.values()).indexOf(currentInput);
13
+ };
14
+ var changeElementsHoverState = (inputs, range, changed) => {
15
+ const [first, last] = range;
16
+ Array.from(inputs.values()).forEach((input, i) => {
17
+ const container = input == null ? void 0 : input.closest("[data-input]");
18
+ if (first === null || last === null) {
19
+ container == null ? void 0 : container.setAttribute("data-hover", "none");
20
+ } else if (i >= Math.min(first, last) && i <= Math.max(first, last)) {
21
+ container == null ? void 0 : container.setAttribute("data-hover", changed !== "none" ? changed : "down");
22
+ } else {
23
+ container == null ? void 0 : container.setAttribute("data-hover", "none");
24
+ }
25
+ });
26
+ };
27
+ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChange, prefix, step = 0.1 }, ref) {
28
+ const inputs = useRef(/* @__PURE__ */ new Map());
29
+ const selectRange = useRef([null, null]);
30
+ const inputChange = useRef(false);
31
+ const stopClick = useCallback(() => {
32
+ const stopClick2 = (e) => {
33
+ e.stopPropagation();
34
+ e.preventDefault();
35
+ document.removeEventListener("click", stopClick2, true);
36
+ };
37
+ document.addEventListener("click", stopClick2, true);
38
+ }, []);
39
+ const bind = useGesture({
40
+ onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
41
+ event.stopPropagation();
42
+ event.preventDefault();
43
+ if (selectRange.current[0] === null) {
44
+ selectRange.current[0] = getHoverElementAndIndex(
45
+ document.elementFromPoint(...initial),
46
+ inputs.current
47
+ );
48
+ }
49
+ let newMX = memo + dx / 2;
50
+ if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
51
+ const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
52
+ const newValue = value.map((v, i) => {
53
+ const [first, last] = selectRange.current;
54
+ if (first === null || last === null) {
55
+ return v;
56
+ } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
57
+ return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
58
+ } else {
59
+ return v;
60
+ }
61
+ });
62
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
63
+ newMX = 0;
64
+ inputChange.current = true;
65
+ changeElementsHoverState(inputs.current, selectRange.current, "x");
66
+ stopClick();
67
+ }
68
+ if (!inputChange.current) {
69
+ const currentElement = document.elementFromPoint(...xy);
70
+ const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
71
+ selectRange.current[1] = currentIndex ?? selectRange.current[1];
72
+ changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
73
+ stopClick();
74
+ }
75
+ return newMX;
76
+ },
77
+ onDragEnd: () => {
78
+ selectRange.current = [null, null];
79
+ inputChange.current = false;
80
+ changeElementsHoverState(inputs.current, selectRange.current, "none");
81
+ }
82
+ });
83
+ const valueChangeHandler = useCallback(
84
+ (index) => {
85
+ return (e) => {
86
+ const inputValue = e.target.value;
87
+ if (inputValue === "" || !isNaN(Number(inputValue))) {
88
+ const newValue = value.map((v, i) => {
89
+ if (inputValue === "") {
90
+ return "";
91
+ }
92
+ return i === index ? Number(inputValue) : v;
93
+ });
94
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
95
+ }
96
+ };
97
+ },
98
+ [onValuesChange, value]
99
+ );
100
+ if ((value == null ? void 0 : value.length) === 0) {
101
+ throw new Error("`value` cannot be an empty array");
102
+ }
103
+ return /* @__PURE__ */ jsx(
104
+ "div",
105
+ {
106
+ ref,
107
+ ...bind(),
108
+ className: cn("gap-xs flex cursor-crosshair touch-none select-none flex-col"),
109
+ children: value.map((item, index) => /* @__PURE__ */ jsx(
110
+ InputRoot,
111
+ {
112
+ ref: (r) => {
113
+ inputs.current.set(index.toString(), r);
114
+ return () => {
115
+ inputs.current.delete(index.toString());
116
+ };
117
+ },
118
+ size,
119
+ value: item,
120
+ onClick: () => {
121
+ var _a;
122
+ (_a = inputs.current.get(index.toString())) == null ? void 0 : _a.focus();
123
+ },
124
+ onChange: valueChangeHandler(index),
125
+ "data-hover": "none",
126
+ className: cn([
127
+ "group/number-input",
128
+ "cursor-crosshair",
129
+ "data-[hover=down]:bg-bg-tertiary",
130
+ "data-[hover=x]:bg-bg-tertiary",
131
+ "data-[hover=y]:bg-bg-tertiary",
132
+ "data-[hover=down]:cursor-move",
133
+ "data-[hover=x]:cursor-col-resize",
134
+ "data-[hover=y]:cursor-row-resize"
135
+ ]),
136
+ inputClassName: cn([
137
+ "cursor-crosshair",
138
+ "group-data-[hover=down]/number-input:cursor-move",
139
+ "group-data-[hover=x]/number-input:cursor-col-resize",
140
+ "group-data-[hover=y]/number-input:cursor-row-resize"
141
+ ]),
142
+ children: /* @__PURE__ */ jsx(
143
+ InputSlot,
144
+ {
145
+ className: cn(
146
+ "cursor-crosshair",
147
+ "group-data-[hover=down]/number-input:cursor-move",
148
+ "group-data-[hover=x]/number-input:cursor-col-resize",
149
+ "group-data-[hover=y]/number-input:cursor-row-resize"
150
+ ),
151
+ children: prefix == null ? void 0 : prefix[index]
152
+ }
153
+ )
154
+ },
155
+ index
156
+ ))
157
+ }
158
+ );
159
+ });
160
+
161
+ export { InputNumbers };
@@ -0,0 +1,90 @@
1
+ import { motion } from 'framer-motion';
2
+ import { createContext, useState, useEffect, useCallback, useContext } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ // src/highlight-cursor/tabs-cursor-context.tsx
7
+ var TabsCursorContext = createContext(null);
8
+ var TabsCursorProvider = ({
9
+ children,
10
+ className,
11
+ ...props
12
+ }) => {
13
+ const [cursorTarget, setCursorTarget] = useState(null);
14
+ const [targetRect, setTargetRect] = useState(null);
15
+ const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
16
+ const [isMouseInside, setIsMouseInside] = useState(false);
17
+ useEffect(() => {
18
+ const handleMouseMove = (e) => {
19
+ setMousePosition({ x: e.clientX, y: e.clientY });
20
+ };
21
+ document.addEventListener("mousemove", handleMouseMove);
22
+ return () => document.removeEventListener("mousemove", handleMouseMove);
23
+ }, []);
24
+ useEffect(() => {
25
+ if (cursorTarget) {
26
+ setTargetRect(cursorTarget.getBoundingClientRect());
27
+ } else {
28
+ setTargetRect(null);
29
+ }
30
+ }, [cursorTarget]);
31
+ const handleMouseEnter = useCallback(() => {
32
+ setIsMouseInside(true);
33
+ }, []);
34
+ const handleMouseLeave = useCallback(() => {
35
+ setIsMouseInside(false);
36
+ setCursorTarget(null);
37
+ }, []);
38
+ const contextValue = { setCursorTarget };
39
+ return /* @__PURE__ */ jsx(
40
+ "div",
41
+ {
42
+ ...props,
43
+ className,
44
+ style: {
45
+ cursor: isMouseInside && !cursorTarget ? "none" : "auto",
46
+ ...props.style
47
+ },
48
+ onMouseEnter: handleMouseEnter,
49
+ onMouseLeave: handleMouseLeave,
50
+ children: /* @__PURE__ */ jsxs(TabsCursorContext.Provider, { value: contextValue, children: [
51
+ children,
52
+ isMouseInside && createPortal(
53
+ /* @__PURE__ */ jsx(
54
+ motion.div,
55
+ {
56
+ className: "pointer-events-none",
57
+ initial: false,
58
+ animate: {
59
+ x: targetRect ? targetRect.left : mousePosition.x - 8,
60
+ y: targetRect ? targetRect.top : mousePosition.y - 8,
61
+ width: targetRect ? targetRect.width : 16,
62
+ height: targetRect ? targetRect.height : 16,
63
+ borderRadius: targetRect && cursorTarget ? getComputedStyle(cursorTarget).borderRadius : "50%"
64
+ },
65
+ transition: { type: "spring", stiffness: 1e3, damping: 60, mass: 1 },
66
+ style: {
67
+ position: "fixed",
68
+ top: 0,
69
+ left: 0,
70
+ backgroundColor: "var(--shadow-tertiary)",
71
+ zIndex: 9999
72
+ }
73
+ }
74
+ ),
75
+ document.body
76
+ )
77
+ ] })
78
+ }
79
+ );
80
+ };
81
+ var useTabsCursor = () => {
82
+ const context = useContext(TabsCursorContext);
83
+ if (!context) {
84
+ return { setCursorTarget: () => {
85
+ } };
86
+ }
87
+ return context;
88
+ };
89
+
90
+ export { TabsCursorProvider, useTabsCursor };
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/ui/theme-context.tsx
7
+ var initialState = {
8
+ theme: "system",
9
+ setTheme: () => null
10
+ };
11
+ var ThemeProviderContext = react.createContext(initialState);
12
+ function ThemeProvider({
13
+ children,
14
+ defaultTheme = "system",
15
+ storageKey = "vuer-theme",
16
+ ...props
17
+ }) {
18
+ const [theme, setTheme] = react.useState(() => {
19
+ return localStorage.getItem(storageKey) || defaultTheme;
20
+ });
21
+ react.useEffect(() => {
22
+ const root = window.document.documentElement;
23
+ root.classList.remove("light", "dark", "liquidlight", "liquiddark", "system");
24
+ if (theme === "system") {
25
+ const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
26
+ root.classList.add(systemTheme);
27
+ return;
28
+ }
29
+ root.classList.add(theme);
30
+ }, [theme]);
31
+ return /* @__PURE__ */ jsxRuntime.jsx(
32
+ ThemeProviderContext.Provider,
33
+ {
34
+ ...props,
35
+ value: react.useMemo(
36
+ () => ({
37
+ theme,
38
+ setTheme: (theme2) => {
39
+ localStorage.setItem(storageKey, theme2);
40
+ setTheme(theme2);
41
+ }
42
+ }),
43
+ [storageKey, theme]
44
+ ),
45
+ children
46
+ }
47
+ );
48
+ }
49
+ var useTheme = () => {
50
+ const context = react.useContext(ThemeProviderContext);
51
+ if (context === void 0) throw new Error("useTheme must be used within a ThemeProvider");
52
+ return context;
53
+ };
54
+
55
+ exports.ThemeProvider = ThemeProvider;
56
+ exports.useTheme = useTheme;
@@ -0,0 +1,31 @@
1
+ import { cn } from './chunk-HW6SLBO3.mjs';
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function Layout({
6
+ asChild,
7
+ className,
8
+ children,
9
+ align = "start",
10
+ orientation = "horizontal"
11
+ }) {
12
+ const Com = asChild ? Slot : "div";
13
+ return /* @__PURE__ */ jsx(
14
+ Com,
15
+ {
16
+ className: cn(
17
+ {
18
+ "gap-xs flex flex-col": orientation === "horizontal",
19
+ "gap-xs grid grid-cols-[1fr_2fr] text-center": orientation === "vertical",
20
+ "items-baseline": align === "start",
21
+ "items-center": align === "center",
22
+ "items-end": align === "end"
23
+ },
24
+ className
25
+ ),
26
+ children
27
+ }
28
+ );
29
+ }
30
+
31
+ export { Layout };