@ucdjs-internal/shared-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/dist/components/shiki-code.d.mts +50 -0
  4. package/dist/components/shiki-code.mjs +76 -0
  5. package/dist/components/theme-toggle.d.mts +6 -0
  6. package/dist/components/theme-toggle.mjs +75 -0
  7. package/dist/hooks/index.d.mts +3 -0
  8. package/dist/hooks/index.mjs +4 -0
  9. package/dist/hooks/use-mobile.d.mts +4 -0
  10. package/dist/hooks/use-mobile.mjs +41 -0
  11. package/dist/hooks/use-theme.d.mts +11 -0
  12. package/dist/hooks/use-theme.mjs +105 -0
  13. package/dist/index.d.mts +3 -0
  14. package/dist/index.mjs +4 -0
  15. package/dist/lib/theme-script.d.mts +5 -0
  16. package/dist/lib/theme-script.mjs +26 -0
  17. package/dist/lib/utils.d.mts +6 -0
  18. package/dist/lib/utils.mjs +10 -0
  19. package/dist/styles/globals.css +219 -0
  20. package/dist/styles/shadcn-vendored.css +95 -0
  21. package/dist/ui/alert-dialog.d.mts +58 -0
  22. package/dist/ui/alert-dialog.mjs +387 -0
  23. package/dist/ui/avatar.d.mts +34 -0
  24. package/dist/ui/avatar.mjs +208 -0
  25. package/dist/ui/badge.d.mts +17 -0
  26. package/dist/ui/badge.mjs +76 -0
  27. package/dist/ui/breadcrumb.d.mts +37 -0
  28. package/dist/ui/breadcrumb.mjs +281 -0
  29. package/dist/ui/button.d.mts +18 -0
  30. package/dist/ui/button.mjs +82 -0
  31. package/dist/ui/card.d.mts +37 -0
  32. package/dist/ui/card.mjs +239 -0
  33. package/dist/ui/checkbox.d.mts +10 -0
  34. package/dist/ui/checkbox.mjs +52 -0
  35. package/dist/ui/collapsible.d.mts +15 -0
  36. package/dist/ui/collapsible.mjs +65 -0
  37. package/dist/ui/combobox.d.mts +81 -0
  38. package/dist/ui/combobox.mjs +641 -0
  39. package/dist/ui/command.d.mts +55 -0
  40. package/dist/ui/command.mjs +378 -0
  41. package/dist/ui/context-menu.d.mts +86 -0
  42. package/dist/ui/context-menu.mjs +520 -0
  43. package/dist/ui/dialog.d.mts +51 -0
  44. package/dist/ui/dialog.mjs +331 -0
  45. package/dist/ui/dropdown-menu.d.mts +84 -0
  46. package/dist/ui/dropdown-menu.mjs +534 -0
  47. package/dist/ui/field.d.mts +64 -0
  48. package/dist/ui/field.mjs +425 -0
  49. package/dist/ui/input-group.d.mts +45 -0
  50. package/dist/ui/input-group.mjs +254 -0
  51. package/dist/ui/input.d.mts +11 -0
  52. package/dist/ui/input.mjs +47 -0
  53. package/dist/ui/label.d.mts +10 -0
  54. package/dist/ui/label.mjs +41 -0
  55. package/dist/ui/scroll-area.d.mts +16 -0
  56. package/dist/ui/scroll-area.mjs +120 -0
  57. package/dist/ui/select.d.mts +55 -0
  58. package/dist/ui/select.mjs +414 -0
  59. package/dist/ui/separator.d.mts +11 -0
  60. package/dist/ui/separator.mjs +47 -0
  61. package/dist/ui/sheet.d.mts +42 -0
  62. package/dist/ui/sheet.mjs +318 -0
  63. package/dist/ui/sidebar.d.mts +160 -0
  64. package/dist/ui/sidebar.mjs +1258 -0
  65. package/dist/ui/skeleton.d.mts +9 -0
  66. package/dist/ui/skeleton.mjs +40 -0
  67. package/dist/ui/table.d.mts +38 -0
  68. package/dist/ui/table.mjs +269 -0
  69. package/dist/ui/textarea.d.mts +10 -0
  70. package/dist/ui/textarea.mjs +41 -0
  71. package/dist/ui/tooltip.d.mts +25 -0
  72. package/dist/ui/tooltip.mjs +149 -0
  73. package/package.json +111 -0
@@ -0,0 +1,425 @@
1
+ import { cn } from "../lib/utils.mjs";
2
+ import { Label } from "./label.mjs";
3
+ import { Separator } from "./separator.mjs";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { c } from "react/compiler-runtime";
6
+ import { cva } from "class-variance-authority";
7
+
8
+ //#region src/ui/field.tsx
9
+ function FieldSet(t0) {
10
+ const $ = c(8);
11
+ let className;
12
+ let props;
13
+ if ($[0] !== t0) {
14
+ ({className, ...props} = t0);
15
+ $[0] = t0;
16
+ $[1] = className;
17
+ $[2] = props;
18
+ } else {
19
+ className = $[1];
20
+ props = $[2];
21
+ }
22
+ let t1;
23
+ if ($[3] !== className) {
24
+ t1 = cn("gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className);
25
+ $[3] = className;
26
+ $[4] = t1;
27
+ } else t1 = $[4];
28
+ let t2;
29
+ if ($[5] !== props || $[6] !== t1) {
30
+ t2 = /* @__PURE__ */ jsx("fieldset", {
31
+ "data-slot": "field-set",
32
+ className: t1,
33
+ ...props
34
+ });
35
+ $[5] = props;
36
+ $[6] = t1;
37
+ $[7] = t2;
38
+ } else t2 = $[7];
39
+ return t2;
40
+ }
41
+ function FieldLegend(t0) {
42
+ const $ = c(10);
43
+ let className;
44
+ let props;
45
+ let t1;
46
+ if ($[0] !== t0) {
47
+ ({className, variant: t1, ...props} = t0);
48
+ $[0] = t0;
49
+ $[1] = className;
50
+ $[2] = props;
51
+ $[3] = t1;
52
+ } else {
53
+ className = $[1];
54
+ props = $[2];
55
+ t1 = $[3];
56
+ }
57
+ const variant = t1 === void 0 ? "legend" : t1;
58
+ let t2;
59
+ if ($[4] !== className) {
60
+ t2 = cn("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className);
61
+ $[4] = className;
62
+ $[5] = t2;
63
+ } else t2 = $[5];
64
+ let t3;
65
+ if ($[6] !== props || $[7] !== t2 || $[8] !== variant) {
66
+ t3 = /* @__PURE__ */ jsx("legend", {
67
+ "data-slot": "field-legend",
68
+ "data-variant": variant,
69
+ className: t2,
70
+ ...props
71
+ });
72
+ $[6] = props;
73
+ $[7] = t2;
74
+ $[8] = variant;
75
+ $[9] = t3;
76
+ } else t3 = $[9];
77
+ return t3;
78
+ }
79
+ function FieldGroup(t0) {
80
+ const $ = c(8);
81
+ let className;
82
+ let props;
83
+ if ($[0] !== t0) {
84
+ ({className, ...props} = t0);
85
+ $[0] = t0;
86
+ $[1] = className;
87
+ $[2] = props;
88
+ } else {
89
+ className = $[1];
90
+ props = $[2];
91
+ }
92
+ let t1;
93
+ if ($[3] !== className) {
94
+ t1 = cn("gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col", className);
95
+ $[3] = className;
96
+ $[4] = t1;
97
+ } else t1 = $[4];
98
+ let t2;
99
+ if ($[5] !== props || $[6] !== t1) {
100
+ t2 = /* @__PURE__ */ jsx("div", {
101
+ "data-slot": "field-group",
102
+ className: t1,
103
+ ...props
104
+ });
105
+ $[5] = props;
106
+ $[6] = t1;
107
+ $[7] = t2;
108
+ } else t2 = $[7];
109
+ return t2;
110
+ }
111
+ const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/field flex w-full", {
112
+ variants: { orientation: {
113
+ vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
114
+ horizontal: "flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
115
+ responsive: "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
116
+ } },
117
+ defaultVariants: { orientation: "vertical" }
118
+ });
119
+ function Field(t0) {
120
+ const $ = c(11);
121
+ let className;
122
+ let props;
123
+ let t1;
124
+ if ($[0] !== t0) {
125
+ ({className, orientation: t1, ...props} = t0);
126
+ $[0] = t0;
127
+ $[1] = className;
128
+ $[2] = props;
129
+ $[3] = t1;
130
+ } else {
131
+ className = $[1];
132
+ props = $[2];
133
+ t1 = $[3];
134
+ }
135
+ const orientation = t1 === void 0 ? "vertical" : t1;
136
+ let t2;
137
+ if ($[4] !== className || $[5] !== orientation) {
138
+ t2 = cn(fieldVariants({ orientation }), className);
139
+ $[4] = className;
140
+ $[5] = orientation;
141
+ $[6] = t2;
142
+ } else t2 = $[6];
143
+ let t3;
144
+ if ($[7] !== orientation || $[8] !== props || $[9] !== t2) {
145
+ t3 = /* @__PURE__ */ jsx("div", {
146
+ role: "group",
147
+ "data-slot": "field",
148
+ "data-orientation": orientation,
149
+ className: t2,
150
+ ...props
151
+ });
152
+ $[7] = orientation;
153
+ $[8] = props;
154
+ $[9] = t2;
155
+ $[10] = t3;
156
+ } else t3 = $[10];
157
+ return t3;
158
+ }
159
+ function FieldContent(t0) {
160
+ const $ = c(8);
161
+ let className;
162
+ let props;
163
+ if ($[0] !== t0) {
164
+ ({className, ...props} = t0);
165
+ $[0] = t0;
166
+ $[1] = className;
167
+ $[2] = props;
168
+ } else {
169
+ className = $[1];
170
+ props = $[2];
171
+ }
172
+ let t1;
173
+ if ($[3] !== className) {
174
+ t1 = cn("gap-0.5 group/field-content flex flex-1 flex-col leading-snug", className);
175
+ $[3] = className;
176
+ $[4] = t1;
177
+ } else t1 = $[4];
178
+ let t2;
179
+ if ($[5] !== props || $[6] !== t1) {
180
+ t2 = /* @__PURE__ */ jsx("div", {
181
+ "data-slot": "field-content",
182
+ className: t1,
183
+ ...props
184
+ });
185
+ $[5] = props;
186
+ $[6] = t1;
187
+ $[7] = t2;
188
+ } else t2 = $[7];
189
+ return t2;
190
+ }
191
+ function FieldLabel(t0) {
192
+ const $ = c(8);
193
+ let className;
194
+ let props;
195
+ if ($[0] !== t0) {
196
+ ({className, ...props} = t0);
197
+ $[0] = t0;
198
+ $[1] = className;
199
+ $[2] = props;
200
+ } else {
201
+ className = $[1];
202
+ props = $[2];
203
+ }
204
+ let t1;
205
+ if ($[3] !== className) {
206
+ t1 = cn("has-data-checked:bg-primary/5 has-data-checked:border-primary dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className);
207
+ $[3] = className;
208
+ $[4] = t1;
209
+ } else t1 = $[4];
210
+ let t2;
211
+ if ($[5] !== props || $[6] !== t1) {
212
+ t2 = /* @__PURE__ */ jsx(Label, {
213
+ "data-slot": "field-label",
214
+ className: t1,
215
+ ...props
216
+ });
217
+ $[5] = props;
218
+ $[6] = t1;
219
+ $[7] = t2;
220
+ } else t2 = $[7];
221
+ return t2;
222
+ }
223
+ function FieldTitle(t0) {
224
+ const $ = c(8);
225
+ let className;
226
+ let props;
227
+ if ($[0] !== t0) {
228
+ ({className, ...props} = t0);
229
+ $[0] = t0;
230
+ $[1] = className;
231
+ $[2] = props;
232
+ } else {
233
+ className = $[1];
234
+ props = $[2];
235
+ }
236
+ let t1;
237
+ if ($[3] !== className) {
238
+ t1 = cn("gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug", className);
239
+ $[3] = className;
240
+ $[4] = t1;
241
+ } else t1 = $[4];
242
+ let t2;
243
+ if ($[5] !== props || $[6] !== t1) {
244
+ t2 = /* @__PURE__ */ jsx("div", {
245
+ "data-slot": "field-label",
246
+ className: t1,
247
+ ...props
248
+ });
249
+ $[5] = props;
250
+ $[6] = t1;
251
+ $[7] = t2;
252
+ } else t2 = $[7];
253
+ return t2;
254
+ }
255
+ function FieldDescription(t0) {
256
+ const $ = c(8);
257
+ let className;
258
+ let props;
259
+ if ($[0] !== t0) {
260
+ ({className, ...props} = t0);
261
+ $[0] = t0;
262
+ $[1] = className;
263
+ $[2] = props;
264
+ } else {
265
+ className = $[1];
266
+ props = $[2];
267
+ }
268
+ let t1;
269
+ if ($[3] !== className) {
270
+ t1 = cn("text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-[orientation=horizontal]/field:text-balance", "last:mt-0 nth-last-2:-mt-1", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className);
271
+ $[3] = className;
272
+ $[4] = t1;
273
+ } else t1 = $[4];
274
+ let t2;
275
+ if ($[5] !== props || $[6] !== t1) {
276
+ t2 = /* @__PURE__ */ jsx("p", {
277
+ "data-slot": "field-description",
278
+ className: t1,
279
+ ...props
280
+ });
281
+ $[5] = props;
282
+ $[6] = t1;
283
+ $[7] = t2;
284
+ } else t2 = $[7];
285
+ return t2;
286
+ }
287
+ function FieldSeparator(t0) {
288
+ const $ = c(14);
289
+ let children;
290
+ let className;
291
+ let props;
292
+ if ($[0] !== t0) {
293
+ ({children, className, ...props} = t0);
294
+ $[0] = t0;
295
+ $[1] = children;
296
+ $[2] = className;
297
+ $[3] = props;
298
+ } else {
299
+ children = $[1];
300
+ className = $[2];
301
+ props = $[3];
302
+ }
303
+ const t1 = !!children;
304
+ let t2;
305
+ if ($[4] !== className) {
306
+ t2 = cn("-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative", className);
307
+ $[4] = className;
308
+ $[5] = t2;
309
+ } else t2 = $[5];
310
+ let t3;
311
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
312
+ t3 = /* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" });
313
+ $[6] = t3;
314
+ } else t3 = $[6];
315
+ let t4;
316
+ if ($[7] !== children) {
317
+ t4 = children && /* @__PURE__ */ jsx("span", {
318
+ className: "text-muted-foreground px-2 bg-background relative mx-auto block w-fit",
319
+ "data-slot": "field-separator-content",
320
+ children
321
+ });
322
+ $[7] = children;
323
+ $[8] = t4;
324
+ } else t4 = $[8];
325
+ let t5;
326
+ if ($[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t4) {
327
+ t5 = /* @__PURE__ */ jsxs("div", {
328
+ "data-slot": "field-separator",
329
+ "data-content": t1,
330
+ className: t2,
331
+ ...props,
332
+ children: [t3, t4]
333
+ });
334
+ $[9] = props;
335
+ $[10] = t1;
336
+ $[11] = t2;
337
+ $[12] = t4;
338
+ $[13] = t5;
339
+ } else t5 = $[13];
340
+ return t5;
341
+ }
342
+ function FieldError(t0) {
343
+ const $ = c(15);
344
+ let children;
345
+ let className;
346
+ let errors;
347
+ let props;
348
+ if ($[0] !== t0) {
349
+ ({className, children, errors, ...props} = t0);
350
+ $[0] = t0;
351
+ $[1] = children;
352
+ $[2] = className;
353
+ $[3] = errors;
354
+ $[4] = props;
355
+ } else {
356
+ children = $[1];
357
+ className = $[2];
358
+ errors = $[3];
359
+ props = $[4];
360
+ }
361
+ let t1;
362
+ bb0: {
363
+ if (children) {
364
+ t1 = children;
365
+ break bb0;
366
+ }
367
+ if (!errors?.length) {
368
+ t1 = null;
369
+ break bb0;
370
+ }
371
+ let t2;
372
+ if ($[5] !== errors) {
373
+ t2 = [...new Map(errors.map(_temp)).values()];
374
+ $[5] = errors;
375
+ $[6] = t2;
376
+ } else t2 = $[6];
377
+ const uniqueErrors = t2;
378
+ if (uniqueErrors?.length === 1) {
379
+ t1 = uniqueErrors[0]?.message;
380
+ break bb0;
381
+ }
382
+ let t3;
383
+ if ($[7] !== uniqueErrors) {
384
+ t3 = /* @__PURE__ */ jsx("ul", {
385
+ className: "ml-4 flex list-disc flex-col gap-1",
386
+ children: uniqueErrors.map(_temp2)
387
+ });
388
+ $[7] = uniqueErrors;
389
+ $[8] = t3;
390
+ } else t3 = $[8];
391
+ t1 = t3;
392
+ }
393
+ const content = t1;
394
+ if (!content) return null;
395
+ let t2;
396
+ if ($[9] !== className) {
397
+ t2 = cn("text-destructive text-sm font-normal", className);
398
+ $[9] = className;
399
+ $[10] = t2;
400
+ } else t2 = $[10];
401
+ let t3;
402
+ if ($[11] !== content || $[12] !== props || $[13] !== t2) {
403
+ t3 = /* @__PURE__ */ jsx("div", {
404
+ role: "alert",
405
+ "data-slot": "field-error",
406
+ className: t2,
407
+ ...props,
408
+ children: content
409
+ });
410
+ $[11] = content;
411
+ $[12] = props;
412
+ $[13] = t2;
413
+ $[14] = t3;
414
+ } else t3 = $[14];
415
+ return t3;
416
+ }
417
+ function _temp2(error_0) {
418
+ return error_0?.message && /* @__PURE__ */ jsx("li", { children: error_0.message }, `field-error-${error_0.message}`);
419
+ }
420
+ function _temp(error) {
421
+ return [error?.message, error];
422
+ }
423
+
424
+ //#endregion
425
+ export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
@@ -0,0 +1,45 @@
1
+ import { Button } from "./button.mjs";
2
+ import * as React from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { VariantProps } from "class-variance-authority";
5
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
6
+
7
+ //#region src/ui/input-group.d.ts
8
+ declare function InputGroup({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
12
+ declare const inputGroupAddonVariants: (props?: ({
13
+ align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
14
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
+ declare function InputGroupAddon({
16
+ className,
17
+ align,
18
+ ...props
19
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime0.JSX.Element;
20
+ declare const inputGroupButtonVariants: (props?: ({
21
+ size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
22
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
23
+ declare function InputGroupButton({
24
+ className,
25
+ type,
26
+ variant,
27
+ size,
28
+ ...props
29
+ }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> & VariantProps<typeof inputGroupButtonVariants> & {
30
+ type?: "button" | "submit" | "reset";
31
+ }): react_jsx_runtime0.JSX.Element;
32
+ declare function InputGroupText({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<"span">): react_jsx_runtime0.JSX.Element;
36
+ declare function InputGroupInput({
37
+ className,
38
+ ...props
39
+ }: React.ComponentProps<"input">): react_jsx_runtime0.JSX.Element;
40
+ declare function InputGroupTextarea({
41
+ className,
42
+ ...props
43
+ }: React.ComponentProps<"textarea">): react_jsx_runtime0.JSX.Element;
44
+ //#endregion
45
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,254 @@
1
+ import { cn } from "../lib/utils.mjs";
2
+ import { Button } from "./button.mjs";
3
+ import { Input } from "./input.mjs";
4
+ import { Textarea } from "./textarea.mjs";
5
+ import "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { c } from "react/compiler-runtime";
8
+ import { cva } from "class-variance-authority";
9
+
10
+ //#region src/ui/input-group.tsx
11
+ function InputGroup(t0) {
12
+ const $ = c(8);
13
+ let className;
14
+ let props;
15
+ if ($[0] !== t0) {
16
+ ({className, ...props} = t0);
17
+ $[0] = t0;
18
+ $[1] = className;
19
+ $[2] = props;
20
+ } else {
21
+ className = $[1];
22
+ props = $[2];
23
+ }
24
+ let t1;
25
+ if ($[3] !== className) {
26
+ t1 = cn("border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto", className);
27
+ $[3] = className;
28
+ $[4] = t1;
29
+ } else t1 = $[4];
30
+ let t2;
31
+ if ($[5] !== props || $[6] !== t1) {
32
+ t2 = /* @__PURE__ */ jsx("div", {
33
+ "data-slot": "input-group",
34
+ role: "group",
35
+ className: t1,
36
+ ...props
37
+ });
38
+ $[5] = props;
39
+ $[6] = t1;
40
+ $[7] = t2;
41
+ } else t2 = $[7];
42
+ return t2;
43
+ }
44
+ const inputGroupAddonVariants = cva("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", {
45
+ variants: { align: {
46
+ "inline-start": "pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first",
47
+ "inline-end": "pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last",
48
+ "block-start": "px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start",
49
+ "block-end": "px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"
50
+ } },
51
+ defaultVariants: { align: "inline-start" }
52
+ });
53
+ function InputGroupAddon(t0) {
54
+ const $ = c(11);
55
+ let className;
56
+ let props;
57
+ let t1;
58
+ if ($[0] !== t0) {
59
+ ({className, align: t1, ...props} = t0);
60
+ $[0] = t0;
61
+ $[1] = className;
62
+ $[2] = props;
63
+ $[3] = t1;
64
+ } else {
65
+ className = $[1];
66
+ props = $[2];
67
+ t1 = $[3];
68
+ }
69
+ const align = t1 === void 0 ? "inline-start" : t1;
70
+ let t2;
71
+ if ($[4] !== align || $[5] !== className) {
72
+ t2 = cn(inputGroupAddonVariants({ align }), className);
73
+ $[4] = align;
74
+ $[5] = className;
75
+ $[6] = t2;
76
+ } else t2 = $[6];
77
+ let t3;
78
+ if ($[7] !== align || $[8] !== props || $[9] !== t2) {
79
+ t3 = /* @__PURE__ */ jsx("div", {
80
+ role: "group",
81
+ "data-slot": "input-group-addon",
82
+ "data-align": align,
83
+ className: t2,
84
+ onClick: _temp,
85
+ ...props
86
+ });
87
+ $[7] = align;
88
+ $[8] = props;
89
+ $[9] = t2;
90
+ $[10] = t3;
91
+ } else t3 = $[10];
92
+ return t3;
93
+ }
94
+ function _temp(e) {
95
+ if (e.target.closest("button")) return;
96
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
97
+ }
98
+ const inputGroupButtonVariants = cva("gap-2 text-sm shadow-none flex items-center", {
99
+ variants: { size: {
100
+ "xs": "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
101
+ "sm": "",
102
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
103
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
104
+ } },
105
+ defaultVariants: { size: "xs" }
106
+ });
107
+ function InputGroupButton(t0) {
108
+ const $ = c(15);
109
+ let className;
110
+ let props;
111
+ let t1;
112
+ let t2;
113
+ let t3;
114
+ if ($[0] !== t0) {
115
+ ({className, type: t1, variant: t2, size: t3, ...props} = t0);
116
+ $[0] = t0;
117
+ $[1] = className;
118
+ $[2] = props;
119
+ $[3] = t1;
120
+ $[4] = t2;
121
+ $[5] = t3;
122
+ } else {
123
+ className = $[1];
124
+ props = $[2];
125
+ t1 = $[3];
126
+ t2 = $[4];
127
+ t3 = $[5];
128
+ }
129
+ const type = t1 === void 0 ? "button" : t1;
130
+ const variant = t2 === void 0 ? "ghost" : t2;
131
+ const size = t3 === void 0 ? "xs" : t3;
132
+ let t4;
133
+ if ($[6] !== className || $[7] !== size) {
134
+ t4 = cn(inputGroupButtonVariants({ size }), className);
135
+ $[6] = className;
136
+ $[7] = size;
137
+ $[8] = t4;
138
+ } else t4 = $[8];
139
+ let t5;
140
+ if ($[9] !== props || $[10] !== size || $[11] !== t4 || $[12] !== type || $[13] !== variant) {
141
+ t5 = /* @__PURE__ */ jsx(Button, {
142
+ type,
143
+ "data-size": size,
144
+ variant,
145
+ className: t4,
146
+ ...props
147
+ });
148
+ $[9] = props;
149
+ $[10] = size;
150
+ $[11] = t4;
151
+ $[12] = type;
152
+ $[13] = variant;
153
+ $[14] = t5;
154
+ } else t5 = $[14];
155
+ return t5;
156
+ }
157
+ function InputGroupText(t0) {
158
+ const $ = c(8);
159
+ let className;
160
+ let props;
161
+ if ($[0] !== t0) {
162
+ ({className, ...props} = t0);
163
+ $[0] = t0;
164
+ $[1] = className;
165
+ $[2] = props;
166
+ } else {
167
+ className = $[1];
168
+ props = $[2];
169
+ }
170
+ let t1;
171
+ if ($[3] !== className) {
172
+ t1 = cn("text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none", className);
173
+ $[3] = className;
174
+ $[4] = t1;
175
+ } else t1 = $[4];
176
+ let t2;
177
+ if ($[5] !== props || $[6] !== t1) {
178
+ t2 = /* @__PURE__ */ jsx("span", {
179
+ className: t1,
180
+ ...props
181
+ });
182
+ $[5] = props;
183
+ $[6] = t1;
184
+ $[7] = t2;
185
+ } else t2 = $[7];
186
+ return t2;
187
+ }
188
+ function InputGroupInput(t0) {
189
+ const $ = c(8);
190
+ let className;
191
+ let props;
192
+ if ($[0] !== t0) {
193
+ ({className, ...props} = t0);
194
+ $[0] = t0;
195
+ $[1] = className;
196
+ $[2] = props;
197
+ } else {
198
+ className = $[1];
199
+ props = $[2];
200
+ }
201
+ let t1;
202
+ if ($[3] !== className) {
203
+ t1 = cn("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1", className);
204
+ $[3] = className;
205
+ $[4] = t1;
206
+ } else t1 = $[4];
207
+ let t2;
208
+ if ($[5] !== props || $[6] !== t1) {
209
+ t2 = /* @__PURE__ */ jsx(Input, {
210
+ "data-slot": "input-group-control",
211
+ className: t1,
212
+ ...props
213
+ });
214
+ $[5] = props;
215
+ $[6] = t1;
216
+ $[7] = t2;
217
+ } else t2 = $[7];
218
+ return t2;
219
+ }
220
+ function InputGroupTextarea(t0) {
221
+ const $ = c(8);
222
+ let className;
223
+ let props;
224
+ if ($[0] !== t0) {
225
+ ({className, ...props} = t0);
226
+ $[0] = t0;
227
+ $[1] = className;
228
+ $[2] = props;
229
+ } else {
230
+ className = $[1];
231
+ props = $[2];
232
+ }
233
+ let t1;
234
+ if ($[3] !== className) {
235
+ t1 = cn("rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1 resize-none", className);
236
+ $[3] = className;
237
+ $[4] = t1;
238
+ } else t1 = $[4];
239
+ let t2;
240
+ if ($[5] !== props || $[6] !== t1) {
241
+ t2 = /* @__PURE__ */ jsx(Textarea, {
242
+ "data-slot": "input-group-control",
243
+ className: t1,
244
+ ...props
245
+ });
246
+ $[5] = props;
247
+ $[6] = t1;
248
+ $[7] = t2;
249
+ } else t2 = $[7];
250
+ return t2;
251
+ }
252
+
253
+ //#endregion
254
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };