@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,641 @@
1
+ import { cn } from "../lib/utils.mjs";
2
+ import { Button } from "./button.mjs";
3
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.mjs";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { c } from "react/compiler-runtime";
7
+ import { Check, ChevronDown, X } from "lucide-react";
8
+ import { Combobox as Combobox$1 } from "@base-ui/react";
9
+
10
+ //#region src/ui/combobox.tsx
11
+ const Combobox = Combobox$1.Root;
12
+ function ComboboxValue(t0) {
13
+ const $ = c(4);
14
+ let props;
15
+ if ($[0] !== t0) {
16
+ ({...props} = t0);
17
+ $[0] = t0;
18
+ $[1] = props;
19
+ } else props = $[1];
20
+ let t1;
21
+ if ($[2] !== props) {
22
+ t1 = /* @__PURE__ */ jsx(Combobox$1.Value, {
23
+ "data-slot": "combobox-value",
24
+ ...props
25
+ });
26
+ $[2] = props;
27
+ $[3] = t1;
28
+ } else t1 = $[3];
29
+ return t1;
30
+ }
31
+ function ComboboxTrigger(t0) {
32
+ const $ = c(11);
33
+ let children;
34
+ let className;
35
+ let props;
36
+ if ($[0] !== t0) {
37
+ ({className, children, ...props} = t0);
38
+ $[0] = t0;
39
+ $[1] = children;
40
+ $[2] = className;
41
+ $[3] = props;
42
+ } else {
43
+ children = $[1];
44
+ className = $[2];
45
+ props = $[3];
46
+ }
47
+ let t1;
48
+ if ($[4] !== className) {
49
+ t1 = cn("[&_svg:not([class*='size-'])]:size-4", className);
50
+ $[4] = className;
51
+ $[5] = t1;
52
+ } else t1 = $[5];
53
+ let t2;
54
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
55
+ t2 = /* @__PURE__ */ jsx(ChevronDown, { className: "text-muted-foreground size-4 pointer-events-none" });
56
+ $[6] = t2;
57
+ } else t2 = $[6];
58
+ let t3;
59
+ if ($[7] !== children || $[8] !== props || $[9] !== t1) {
60
+ t3 = /* @__PURE__ */ jsxs(Combobox$1.Trigger, {
61
+ "data-slot": "combobox-trigger",
62
+ className: t1,
63
+ ...props,
64
+ children: [children, t2]
65
+ });
66
+ $[7] = children;
67
+ $[8] = props;
68
+ $[9] = t1;
69
+ $[10] = t3;
70
+ } else t3 = $[10];
71
+ return t3;
72
+ }
73
+ function ComboboxClear(t0) {
74
+ const $ = c(10);
75
+ let className;
76
+ let props;
77
+ if ($[0] !== t0) {
78
+ ({className, ...props} = t0);
79
+ $[0] = t0;
80
+ $[1] = className;
81
+ $[2] = props;
82
+ } else {
83
+ className = $[1];
84
+ props = $[2];
85
+ }
86
+ let t1;
87
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
88
+ t1 = /* @__PURE__ */ jsx(InputGroupButton, {
89
+ variant: "ghost",
90
+ size: "icon-xs"
91
+ });
92
+ $[3] = t1;
93
+ } else t1 = $[3];
94
+ let t2;
95
+ if ($[4] !== className) {
96
+ t2 = cn(className);
97
+ $[4] = className;
98
+ $[5] = t2;
99
+ } else t2 = $[5];
100
+ let t3;
101
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
102
+ t3 = /* @__PURE__ */ jsx(X, { className: "pointer-events-none" });
103
+ $[6] = t3;
104
+ } else t3 = $[6];
105
+ let t4;
106
+ if ($[7] !== props || $[8] !== t2) {
107
+ t4 = /* @__PURE__ */ jsx(Combobox$1.Clear, {
108
+ "data-slot": "combobox-clear",
109
+ render: t1,
110
+ className: t2,
111
+ ...props,
112
+ children: t3
113
+ });
114
+ $[7] = props;
115
+ $[8] = t2;
116
+ $[9] = t4;
117
+ } else t4 = $[9];
118
+ return t4;
119
+ }
120
+ function ComboboxInput(t0) {
121
+ const $ = c(28);
122
+ let children;
123
+ let className;
124
+ let props;
125
+ let t1;
126
+ let t2;
127
+ let t3;
128
+ if ($[0] !== t0) {
129
+ ({className, children, disabled: t1, showTrigger: t2, showClear: t3, ...props} = t0);
130
+ $[0] = t0;
131
+ $[1] = children;
132
+ $[2] = className;
133
+ $[3] = props;
134
+ $[4] = t1;
135
+ $[5] = t2;
136
+ $[6] = t3;
137
+ } else {
138
+ children = $[1];
139
+ className = $[2];
140
+ props = $[3];
141
+ t1 = $[4];
142
+ t2 = $[5];
143
+ t3 = $[6];
144
+ }
145
+ const disabled = t1 === void 0 ? false : t1;
146
+ const showTrigger = t2 === void 0 ? true : t2;
147
+ const showClear = t3 === void 0 ? false : t3;
148
+ let t4;
149
+ if ($[7] !== className) {
150
+ t4 = cn("w-auto", className);
151
+ $[7] = className;
152
+ $[8] = t4;
153
+ } else t4 = $[8];
154
+ let t5;
155
+ if ($[9] !== disabled) {
156
+ t5 = /* @__PURE__ */ jsx(InputGroupInput, { disabled });
157
+ $[9] = disabled;
158
+ $[10] = t5;
159
+ } else t5 = $[10];
160
+ let t6;
161
+ if ($[11] !== props || $[12] !== t5) {
162
+ t6 = /* @__PURE__ */ jsx(Combobox$1.Input, {
163
+ render: t5,
164
+ ...props
165
+ });
166
+ $[11] = props;
167
+ $[12] = t5;
168
+ $[13] = t6;
169
+ } else t6 = $[13];
170
+ let t7;
171
+ if ($[14] !== disabled || $[15] !== showTrigger) {
172
+ t7 = showTrigger && /* @__PURE__ */ jsx(InputGroupButton, {
173
+ size: "icon-xs",
174
+ variant: "ghost",
175
+ render: /* @__PURE__ */ jsx(ComboboxTrigger, {}),
176
+ "data-slot": "input-group-button",
177
+ className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
178
+ disabled
179
+ });
180
+ $[14] = disabled;
181
+ $[15] = showTrigger;
182
+ $[16] = t7;
183
+ } else t7 = $[16];
184
+ let t8;
185
+ if ($[17] !== disabled || $[18] !== showClear) {
186
+ t8 = showClear && /* @__PURE__ */ jsx(ComboboxClear, { disabled });
187
+ $[17] = disabled;
188
+ $[18] = showClear;
189
+ $[19] = t8;
190
+ } else t8 = $[19];
191
+ let t9;
192
+ if ($[20] !== t7 || $[21] !== t8) {
193
+ t9 = /* @__PURE__ */ jsxs(InputGroupAddon, {
194
+ align: "inline-end",
195
+ children: [t7, t8]
196
+ });
197
+ $[20] = t7;
198
+ $[21] = t8;
199
+ $[22] = t9;
200
+ } else t9 = $[22];
201
+ let t10;
202
+ if ($[23] !== children || $[24] !== t4 || $[25] !== t6 || $[26] !== t9) {
203
+ t10 = /* @__PURE__ */ jsxs(InputGroup, {
204
+ className: t4,
205
+ children: [
206
+ t6,
207
+ t9,
208
+ children
209
+ ]
210
+ });
211
+ $[23] = children;
212
+ $[24] = t4;
213
+ $[25] = t6;
214
+ $[26] = t9;
215
+ $[27] = t10;
216
+ } else t10 = $[27];
217
+ return t10;
218
+ }
219
+ function ComboboxContent(t0) {
220
+ const $ = c(21);
221
+ let anchor;
222
+ let className;
223
+ let props;
224
+ let t1;
225
+ let t2;
226
+ let t3;
227
+ let t4;
228
+ if ($[0] !== t0) {
229
+ ({className, side: t1, sideOffset: t2, align: t3, alignOffset: t4, anchor, ...props} = t0);
230
+ $[0] = t0;
231
+ $[1] = anchor;
232
+ $[2] = className;
233
+ $[3] = props;
234
+ $[4] = t1;
235
+ $[5] = t2;
236
+ $[6] = t3;
237
+ $[7] = t4;
238
+ } else {
239
+ anchor = $[1];
240
+ className = $[2];
241
+ props = $[3];
242
+ t1 = $[4];
243
+ t2 = $[5];
244
+ t3 = $[6];
245
+ t4 = $[7];
246
+ }
247
+ const side = t1 === void 0 ? "bottom" : t1;
248
+ const sideOffset = t2 === void 0 ? 6 : t2;
249
+ const align = t3 === void 0 ? "start" : t3;
250
+ const alignOffset = t4 === void 0 ? 0 : t4;
251
+ const t5 = !!anchor;
252
+ let t6;
253
+ if ($[8] !== className) {
254
+ t6 = cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 max-h-72 min-w-36 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)", className);
255
+ $[8] = className;
256
+ $[9] = t6;
257
+ } else t6 = $[9];
258
+ let t7;
259
+ if ($[10] !== props || $[11] !== t5 || $[12] !== t6) {
260
+ t7 = /* @__PURE__ */ jsx(Combobox$1.Popup, {
261
+ "data-slot": "combobox-content",
262
+ "data-chips": t5,
263
+ className: t6,
264
+ ...props
265
+ });
266
+ $[10] = props;
267
+ $[11] = t5;
268
+ $[12] = t6;
269
+ $[13] = t7;
270
+ } else t7 = $[13];
271
+ let t8;
272
+ if ($[14] !== align || $[15] !== alignOffset || $[16] !== anchor || $[17] !== side || $[18] !== sideOffset || $[19] !== t7) {
273
+ t8 = /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
274
+ side,
275
+ sideOffset,
276
+ align,
277
+ alignOffset,
278
+ anchor,
279
+ className: "isolate z-50",
280
+ children: t7
281
+ }) });
282
+ $[14] = align;
283
+ $[15] = alignOffset;
284
+ $[16] = anchor;
285
+ $[17] = side;
286
+ $[18] = sideOffset;
287
+ $[19] = t7;
288
+ $[20] = t8;
289
+ } else t8 = $[20];
290
+ return t8;
291
+ }
292
+ function ComboboxList(t0) {
293
+ const $ = c(8);
294
+ let className;
295
+ let props;
296
+ if ($[0] !== t0) {
297
+ ({className, ...props} = t0);
298
+ $[0] = t0;
299
+ $[1] = className;
300
+ $[2] = props;
301
+ } else {
302
+ className = $[1];
303
+ props = $[2];
304
+ }
305
+ let t1;
306
+ if ($[3] !== className) {
307
+ t1 = cn("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 p-1 data-empty:p-0 overflow-y-auto overscroll-contain", className);
308
+ $[3] = className;
309
+ $[4] = t1;
310
+ } else t1 = $[4];
311
+ let t2;
312
+ if ($[5] !== props || $[6] !== t1) {
313
+ t2 = /* @__PURE__ */ jsx(Combobox$1.List, {
314
+ "data-slot": "combobox-list",
315
+ className: t1,
316
+ ...props
317
+ });
318
+ $[5] = props;
319
+ $[6] = t1;
320
+ $[7] = t2;
321
+ } else t2 = $[7];
322
+ return t2;
323
+ }
324
+ function ComboboxItem(t0) {
325
+ const $ = c(11);
326
+ let children;
327
+ let className;
328
+ let props;
329
+ if ($[0] !== t0) {
330
+ ({className, children, ...props} = t0);
331
+ $[0] = t0;
332
+ $[1] = children;
333
+ $[2] = className;
334
+ $[3] = props;
335
+ } else {
336
+ children = $[1];
337
+ className = $[2];
338
+ props = $[3];
339
+ }
340
+ let t1;
341
+ if ($[4] !== className) {
342
+ t1 = cn("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className);
343
+ $[4] = className;
344
+ $[5] = t1;
345
+ } else t1 = $[5];
346
+ let t2;
347
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
348
+ t2 = /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
349
+ render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
350
+ children: /* @__PURE__ */ jsx(Check, { className: "pointer-events-none" })
351
+ });
352
+ $[6] = t2;
353
+ } else t2 = $[6];
354
+ let t3;
355
+ if ($[7] !== children || $[8] !== props || $[9] !== t1) {
356
+ t3 = /* @__PURE__ */ jsxs(Combobox$1.Item, {
357
+ "data-slot": "combobox-item",
358
+ className: t1,
359
+ ...props,
360
+ children: [children, t2]
361
+ });
362
+ $[7] = children;
363
+ $[8] = props;
364
+ $[9] = t1;
365
+ $[10] = t3;
366
+ } else t3 = $[10];
367
+ return t3;
368
+ }
369
+ function ComboboxGroup(t0) {
370
+ const $ = c(8);
371
+ let className;
372
+ let props;
373
+ if ($[0] !== t0) {
374
+ ({className, ...props} = t0);
375
+ $[0] = t0;
376
+ $[1] = className;
377
+ $[2] = props;
378
+ } else {
379
+ className = $[1];
380
+ props = $[2];
381
+ }
382
+ let t1;
383
+ if ($[3] !== className) {
384
+ t1 = cn(className);
385
+ $[3] = className;
386
+ $[4] = t1;
387
+ } else t1 = $[4];
388
+ let t2;
389
+ if ($[5] !== props || $[6] !== t1) {
390
+ t2 = /* @__PURE__ */ jsx(Combobox$1.Group, {
391
+ "data-slot": "combobox-group",
392
+ className: t1,
393
+ ...props
394
+ });
395
+ $[5] = props;
396
+ $[6] = t1;
397
+ $[7] = t2;
398
+ } else t2 = $[7];
399
+ return t2;
400
+ }
401
+ function ComboboxLabel(t0) {
402
+ const $ = c(8);
403
+ let className;
404
+ let props;
405
+ if ($[0] !== t0) {
406
+ ({className, ...props} = t0);
407
+ $[0] = t0;
408
+ $[1] = className;
409
+ $[2] = props;
410
+ } else {
411
+ className = $[1];
412
+ props = $[2];
413
+ }
414
+ let t1;
415
+ if ($[3] !== className) {
416
+ t1 = cn("text-muted-foreground px-2 py-1.5 text-xs", className);
417
+ $[3] = className;
418
+ $[4] = t1;
419
+ } else t1 = $[4];
420
+ let t2;
421
+ if ($[5] !== props || $[6] !== t1) {
422
+ t2 = /* @__PURE__ */ jsx(Combobox$1.GroupLabel, {
423
+ "data-slot": "combobox-label",
424
+ className: t1,
425
+ ...props
426
+ });
427
+ $[5] = props;
428
+ $[6] = t1;
429
+ $[7] = t2;
430
+ } else t2 = $[7];
431
+ return t2;
432
+ }
433
+ function ComboboxCollection(t0) {
434
+ const $ = c(4);
435
+ let props;
436
+ if ($[0] !== t0) {
437
+ ({...props} = t0);
438
+ $[0] = t0;
439
+ $[1] = props;
440
+ } else props = $[1];
441
+ let t1;
442
+ if ($[2] !== props) {
443
+ t1 = /* @__PURE__ */ jsx(Combobox$1.Collection, {
444
+ "data-slot": "combobox-collection",
445
+ ...props
446
+ });
447
+ $[2] = props;
448
+ $[3] = t1;
449
+ } else t1 = $[3];
450
+ return t1;
451
+ }
452
+ function ComboboxEmpty(t0) {
453
+ const $ = c(8);
454
+ let className;
455
+ let props;
456
+ if ($[0] !== t0) {
457
+ ({className, ...props} = t0);
458
+ $[0] = t0;
459
+ $[1] = className;
460
+ $[2] = props;
461
+ } else {
462
+ className = $[1];
463
+ props = $[2];
464
+ }
465
+ let t1;
466
+ if ($[3] !== className) {
467
+ t1 = cn("text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex", className);
468
+ $[3] = className;
469
+ $[4] = t1;
470
+ } else t1 = $[4];
471
+ let t2;
472
+ if ($[5] !== props || $[6] !== t1) {
473
+ t2 = /* @__PURE__ */ jsx(Combobox$1.Empty, {
474
+ "data-slot": "combobox-empty",
475
+ className: t1,
476
+ ...props
477
+ });
478
+ $[5] = props;
479
+ $[6] = t1;
480
+ $[7] = t2;
481
+ } else t2 = $[7];
482
+ return t2;
483
+ }
484
+ function ComboboxSeparator(t0) {
485
+ const $ = c(8);
486
+ let className;
487
+ let props;
488
+ if ($[0] !== t0) {
489
+ ({className, ...props} = t0);
490
+ $[0] = t0;
491
+ $[1] = className;
492
+ $[2] = props;
493
+ } else {
494
+ className = $[1];
495
+ props = $[2];
496
+ }
497
+ let t1;
498
+ if ($[3] !== className) {
499
+ t1 = cn("bg-border -mx-1 my-1 h-px", className);
500
+ $[3] = className;
501
+ $[4] = t1;
502
+ } else t1 = $[4];
503
+ let t2;
504
+ if ($[5] !== props || $[6] !== t1) {
505
+ t2 = /* @__PURE__ */ jsx(Combobox$1.Separator, {
506
+ "data-slot": "combobox-separator",
507
+ className: t1,
508
+ ...props
509
+ });
510
+ $[5] = props;
511
+ $[6] = t1;
512
+ $[7] = t2;
513
+ } else t2 = $[7];
514
+ return t2;
515
+ }
516
+ function ComboboxChips(t0) {
517
+ const $ = c(8);
518
+ let className;
519
+ let props;
520
+ if ($[0] !== t0) {
521
+ ({className, ...props} = t0);
522
+ $[0] = t0;
523
+ $[1] = className;
524
+ $[2] = props;
525
+ } else {
526
+ className = $[1];
527
+ props = $[2];
528
+ }
529
+ let t1;
530
+ if ($[3] !== className) {
531
+ t1 = cn("dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-[3px] has-aria-invalid:ring-[3px] has-data-[slot=combobox-chip]:px-1", className);
532
+ $[3] = className;
533
+ $[4] = t1;
534
+ } else t1 = $[4];
535
+ let t2;
536
+ if ($[5] !== props || $[6] !== t1) {
537
+ t2 = /* @__PURE__ */ jsx(Combobox$1.Chips, {
538
+ "data-slot": "combobox-chips",
539
+ className: t1,
540
+ ...props
541
+ });
542
+ $[5] = props;
543
+ $[6] = t1;
544
+ $[7] = t2;
545
+ } else t2 = $[7];
546
+ return t2;
547
+ }
548
+ function ComboboxChip(t0) {
549
+ const $ = c(14);
550
+ let children;
551
+ let className;
552
+ let props;
553
+ let t1;
554
+ if ($[0] !== t0) {
555
+ ({className, children, showRemove: t1, ...props} = t0);
556
+ $[0] = t0;
557
+ $[1] = children;
558
+ $[2] = className;
559
+ $[3] = props;
560
+ $[4] = t1;
561
+ } else {
562
+ children = $[1];
563
+ className = $[2];
564
+ props = $[3];
565
+ t1 = $[4];
566
+ }
567
+ const showRemove = t1 === void 0 ? true : t1;
568
+ let t2;
569
+ if ($[5] !== className) {
570
+ t2 = cn("bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-data-[slot=combobox-chip-remove]:pr-0 has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50", className);
571
+ $[5] = className;
572
+ $[6] = t2;
573
+ } else t2 = $[6];
574
+ let t3;
575
+ if ($[7] !== showRemove) {
576
+ t3 = showRemove && /* @__PURE__ */ jsx(Combobox$1.ChipRemove, {
577
+ render: /* @__PURE__ */ jsx(Button, {
578
+ variant: "ghost",
579
+ size: "icon-xs"
580
+ }),
581
+ className: "-ml-1 opacity-50 hover:opacity-100",
582
+ "data-slot": "combobox-chip-remove",
583
+ children: /* @__PURE__ */ jsx(X, { className: "pointer-events-none" })
584
+ });
585
+ $[7] = showRemove;
586
+ $[8] = t3;
587
+ } else t3 = $[8];
588
+ let t4;
589
+ if ($[9] !== children || $[10] !== props || $[11] !== t2 || $[12] !== t3) {
590
+ t4 = /* @__PURE__ */ jsxs(Combobox$1.Chip, {
591
+ "data-slot": "combobox-chip",
592
+ className: t2,
593
+ ...props,
594
+ children: [children, t3]
595
+ });
596
+ $[9] = children;
597
+ $[10] = props;
598
+ $[11] = t2;
599
+ $[12] = t3;
600
+ $[13] = t4;
601
+ } else t4 = $[13];
602
+ return t4;
603
+ }
604
+ function ComboboxChipsInput(t0) {
605
+ const $ = c(8);
606
+ let className;
607
+ let props;
608
+ if ($[0] !== t0) {
609
+ ({className, ...props} = t0);
610
+ $[0] = t0;
611
+ $[1] = className;
612
+ $[2] = props;
613
+ } else {
614
+ className = $[1];
615
+ props = $[2];
616
+ }
617
+ let t1;
618
+ if ($[3] !== className) {
619
+ t1 = cn("min-w-16 flex-1 outline-none", className);
620
+ $[3] = className;
621
+ $[4] = t1;
622
+ } else t1 = $[4];
623
+ let t2;
624
+ if ($[5] !== props || $[6] !== t1) {
625
+ t2 = /* @__PURE__ */ jsx(Combobox$1.Input, {
626
+ "data-slot": "combobox-chip-input",
627
+ className: t1,
628
+ ...props
629
+ });
630
+ $[5] = props;
631
+ $[6] = t1;
632
+ $[7] = t2;
633
+ } else t2 = $[7];
634
+ return t2;
635
+ }
636
+ function useComboboxAnchor() {
637
+ return React.useRef(null);
638
+ }
639
+
640
+ //#endregion
641
+ export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
@@ -0,0 +1,55 @@
1
+ import { Dialog } from "./dialog.mjs";
2
+ import * as React from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { Command as Command$1 } from "cmdk";
5
+
6
+ //#region src/ui/command.d.ts
7
+ declare function Command({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof Command$1>): react_jsx_runtime0.JSX.Element;
11
+ declare function CommandDialog({
12
+ title,
13
+ description,
14
+ children,
15
+ className,
16
+ showCloseButton,
17
+ ...props
18
+ }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
19
+ title?: string;
20
+ description?: string;
21
+ className?: string;
22
+ showCloseButton?: boolean;
23
+ children: React.ReactNode;
24
+ }): react_jsx_runtime0.JSX.Element;
25
+ declare function CommandInput({
26
+ className,
27
+ ...props
28
+ }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime0.JSX.Element;
29
+ declare function CommandList({
30
+ className,
31
+ ...props
32
+ }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime0.JSX.Element;
33
+ declare function CommandEmpty({
34
+ className,
35
+ ...props
36
+ }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime0.JSX.Element;
37
+ declare function CommandGroup({
38
+ className,
39
+ ...props
40
+ }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime0.JSX.Element;
41
+ declare function CommandSeparator({
42
+ className,
43
+ ...props
44
+ }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime0.JSX.Element;
45
+ declare function CommandItem({
46
+ className,
47
+ children,
48
+ ...props
49
+ }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime0.JSX.Element;
50
+ declare function CommandShortcut({
51
+ className,
52
+ ...props
53
+ }: React.ComponentProps<"span">): react_jsx_runtime0.JSX.Element;
54
+ //#endregion
55
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };