@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,331 @@
1
+ import { cn } from "../lib/utils.mjs";
2
+ import { Button } from "./button.mjs";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { c } from "react/compiler-runtime";
6
+ import { XIcon } from "lucide-react";
7
+ import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
8
+
9
+ //#region src/ui/dialog.tsx
10
+ function Dialog(t0) {
11
+ const $ = c(4);
12
+ let props;
13
+ if ($[0] !== t0) {
14
+ ({...props} = t0);
15
+ $[0] = t0;
16
+ $[1] = props;
17
+ } else props = $[1];
18
+ let t1;
19
+ if ($[2] !== props) {
20
+ t1 = /* @__PURE__ */ jsx(Dialog$1.Root, {
21
+ "data-slot": "dialog",
22
+ ...props
23
+ });
24
+ $[2] = props;
25
+ $[3] = t1;
26
+ } else t1 = $[3];
27
+ return t1;
28
+ }
29
+ function DialogTrigger(t0) {
30
+ const $ = c(4);
31
+ let props;
32
+ if ($[0] !== t0) {
33
+ ({...props} = t0);
34
+ $[0] = t0;
35
+ $[1] = props;
36
+ } else props = $[1];
37
+ let t1;
38
+ if ($[2] !== props) {
39
+ t1 = /* @__PURE__ */ jsx(Dialog$1.Trigger, {
40
+ "data-slot": "dialog-trigger",
41
+ ...props
42
+ });
43
+ $[2] = props;
44
+ $[3] = t1;
45
+ } else t1 = $[3];
46
+ return t1;
47
+ }
48
+ function DialogPortal(t0) {
49
+ const $ = c(4);
50
+ let props;
51
+ if ($[0] !== t0) {
52
+ ({...props} = t0);
53
+ $[0] = t0;
54
+ $[1] = props;
55
+ } else props = $[1];
56
+ let t1;
57
+ if ($[2] !== props) {
58
+ t1 = /* @__PURE__ */ jsx(Dialog$1.Portal, {
59
+ "data-slot": "dialog-portal",
60
+ ...props
61
+ });
62
+ $[2] = props;
63
+ $[3] = t1;
64
+ } else t1 = $[3];
65
+ return t1;
66
+ }
67
+ function DialogClose(t0) {
68
+ const $ = c(4);
69
+ let props;
70
+ if ($[0] !== t0) {
71
+ ({...props} = t0);
72
+ $[0] = t0;
73
+ $[1] = props;
74
+ } else props = $[1];
75
+ let t1;
76
+ if ($[2] !== props) {
77
+ t1 = /* @__PURE__ */ jsx(Dialog$1.Close, {
78
+ "data-slot": "dialog-close",
79
+ ...props
80
+ });
81
+ $[2] = props;
82
+ $[3] = t1;
83
+ } else t1 = $[3];
84
+ return t1;
85
+ }
86
+ function DialogOverlay(t0) {
87
+ const $ = c(8);
88
+ let className;
89
+ let props;
90
+ if ($[0] !== t0) {
91
+ ({className, ...props} = t0);
92
+ $[0] = t0;
93
+ $[1] = className;
94
+ $[2] = props;
95
+ } else {
96
+ className = $[1];
97
+ props = $[2];
98
+ }
99
+ let t1;
100
+ if ($[3] !== className) {
101
+ t1 = cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50", className);
102
+ $[3] = className;
103
+ $[4] = t1;
104
+ } else t1 = $[4];
105
+ let t2;
106
+ if ($[5] !== props || $[6] !== t1) {
107
+ t2 = /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
108
+ "data-slot": "dialog-overlay",
109
+ className: t1,
110
+ ...props
111
+ });
112
+ $[5] = props;
113
+ $[6] = t1;
114
+ $[7] = t2;
115
+ } else t2 = $[7];
116
+ return t2;
117
+ }
118
+ function DialogContent(t0) {
119
+ const $ = c(15);
120
+ let children;
121
+ let className;
122
+ let props;
123
+ let t1;
124
+ if ($[0] !== t0) {
125
+ ({className, children, showCloseButton: t1, ...props} = t0);
126
+ $[0] = t0;
127
+ $[1] = children;
128
+ $[2] = className;
129
+ $[3] = props;
130
+ $[4] = t1;
131
+ } else {
132
+ children = $[1];
133
+ className = $[2];
134
+ props = $[3];
135
+ t1 = $[4];
136
+ }
137
+ const showCloseButton = t1 === void 0 ? true : t1;
138
+ let t2;
139
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
140
+ t2 = /* @__PURE__ */ jsx(DialogOverlay, {});
141
+ $[5] = t2;
142
+ } else t2 = $[5];
143
+ let t3;
144
+ if ($[6] !== className) {
145
+ t3 = cn("bg-background 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 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none", className);
146
+ $[6] = className;
147
+ $[7] = t3;
148
+ } else t3 = $[7];
149
+ let t4;
150
+ if ($[8] !== showCloseButton) {
151
+ t4 = showCloseButton && /* @__PURE__ */ jsxs(Dialog$1.Close, {
152
+ "data-slot": "dialog-close",
153
+ render: /* @__PURE__ */ jsx(Button, {
154
+ variant: "ghost",
155
+ className: "absolute top-2 right-2",
156
+ size: "icon-sm"
157
+ }),
158
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
159
+ className: "sr-only",
160
+ children: "Close"
161
+ })]
162
+ });
163
+ $[8] = showCloseButton;
164
+ $[9] = t4;
165
+ } else t4 = $[9];
166
+ let t5;
167
+ if ($[10] !== children || $[11] !== props || $[12] !== t3 || $[13] !== t4) {
168
+ t5 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t2, /* @__PURE__ */ jsxs(Dialog$1.Popup, {
169
+ "data-slot": "dialog-content",
170
+ className: t3,
171
+ ...props,
172
+ children: [children, t4]
173
+ })] });
174
+ $[10] = children;
175
+ $[11] = props;
176
+ $[12] = t3;
177
+ $[13] = t4;
178
+ $[14] = t5;
179
+ } else t5 = $[14];
180
+ return t5;
181
+ }
182
+ function DialogHeader(t0) {
183
+ const $ = c(8);
184
+ let className;
185
+ let props;
186
+ if ($[0] !== t0) {
187
+ ({className, ...props} = t0);
188
+ $[0] = t0;
189
+ $[1] = className;
190
+ $[2] = props;
191
+ } else {
192
+ className = $[1];
193
+ props = $[2];
194
+ }
195
+ let t1;
196
+ if ($[3] !== className) {
197
+ t1 = cn("gap-2 flex flex-col", className);
198
+ $[3] = className;
199
+ $[4] = t1;
200
+ } else t1 = $[4];
201
+ let t2;
202
+ if ($[5] !== props || $[6] !== t1) {
203
+ t2 = /* @__PURE__ */ jsx("div", {
204
+ "data-slot": "dialog-header",
205
+ className: t1,
206
+ ...props
207
+ });
208
+ $[5] = props;
209
+ $[6] = t1;
210
+ $[7] = t2;
211
+ } else t2 = $[7];
212
+ return t2;
213
+ }
214
+ function DialogFooter(t0) {
215
+ const $ = c(14);
216
+ let children;
217
+ let className;
218
+ let props;
219
+ let t1;
220
+ if ($[0] !== t0) {
221
+ ({className, showCloseButton: t1, children, ...props} = t0);
222
+ $[0] = t0;
223
+ $[1] = children;
224
+ $[2] = className;
225
+ $[3] = props;
226
+ $[4] = t1;
227
+ } else {
228
+ children = $[1];
229
+ className = $[2];
230
+ props = $[3];
231
+ t1 = $[4];
232
+ }
233
+ const showCloseButton = t1 === void 0 ? false : t1;
234
+ let t2;
235
+ if ($[5] !== className) {
236
+ t2 = cn("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className);
237
+ $[5] = className;
238
+ $[6] = t2;
239
+ } else t2 = $[6];
240
+ let t3;
241
+ if ($[7] !== showCloseButton) {
242
+ t3 = showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
243
+ render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
244
+ children: "Close"
245
+ });
246
+ $[7] = showCloseButton;
247
+ $[8] = t3;
248
+ } else t3 = $[8];
249
+ let t4;
250
+ if ($[9] !== children || $[10] !== props || $[11] !== t2 || $[12] !== t3) {
251
+ t4 = /* @__PURE__ */ jsxs("div", {
252
+ "data-slot": "dialog-footer",
253
+ className: t2,
254
+ ...props,
255
+ children: [children, t3]
256
+ });
257
+ $[9] = children;
258
+ $[10] = props;
259
+ $[11] = t2;
260
+ $[12] = t3;
261
+ $[13] = t4;
262
+ } else t4 = $[13];
263
+ return t4;
264
+ }
265
+ function DialogTitle(t0) {
266
+ const $ = c(8);
267
+ let className;
268
+ let props;
269
+ if ($[0] !== t0) {
270
+ ({className, ...props} = t0);
271
+ $[0] = t0;
272
+ $[1] = className;
273
+ $[2] = props;
274
+ } else {
275
+ className = $[1];
276
+ props = $[2];
277
+ }
278
+ let t1;
279
+ if ($[3] !== className) {
280
+ t1 = cn("text-base leading-none font-medium", className);
281
+ $[3] = className;
282
+ $[4] = t1;
283
+ } else t1 = $[4];
284
+ let t2;
285
+ if ($[5] !== props || $[6] !== t1) {
286
+ t2 = /* @__PURE__ */ jsx(Dialog$1.Title, {
287
+ "data-slot": "dialog-title",
288
+ className: t1,
289
+ ...props
290
+ });
291
+ $[5] = props;
292
+ $[6] = t1;
293
+ $[7] = t2;
294
+ } else t2 = $[7];
295
+ return t2;
296
+ }
297
+ function DialogDescription(t0) {
298
+ const $ = c(8);
299
+ let className;
300
+ let props;
301
+ if ($[0] !== t0) {
302
+ ({className, ...props} = t0);
303
+ $[0] = t0;
304
+ $[1] = className;
305
+ $[2] = props;
306
+ } else {
307
+ className = $[1];
308
+ props = $[2];
309
+ }
310
+ let t1;
311
+ if ($[3] !== className) {
312
+ t1 = cn("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3", className);
313
+ $[3] = className;
314
+ $[4] = t1;
315
+ } else t1 = $[4];
316
+ let t2;
317
+ if ($[5] !== props || $[6] !== t1) {
318
+ t2 = /* @__PURE__ */ jsx(Dialog$1.Description, {
319
+ "data-slot": "dialog-description",
320
+ className: t1,
321
+ ...props
322
+ });
323
+ $[5] = props;
324
+ $[6] = t1;
325
+ $[7] = t2;
326
+ } else t2 = $[7];
327
+ return t2;
328
+ }
329
+
330
+ //#endregion
331
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,84 @@
1
+ import * as React from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { Menu } from "@base-ui/react/menu";
4
+
5
+ //#region src/ui/dropdown-menu.d.ts
6
+ declare function DropdownMenu({
7
+ ...props
8
+ }: Menu.Root.Props): react_jsx_runtime0.JSX.Element;
9
+ declare function DropdownMenuPortal({
10
+ ...props
11
+ }: Menu.Portal.Props): react_jsx_runtime0.JSX.Element;
12
+ declare function DropdownMenuTrigger({
13
+ ...props
14
+ }: Menu.Trigger.Props): react_jsx_runtime0.JSX.Element;
15
+ declare function DropdownMenuContent({
16
+ align,
17
+ alignOffset,
18
+ side,
19
+ sideOffset,
20
+ className,
21
+ ...props
22
+ }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): react_jsx_runtime0.JSX.Element;
23
+ declare function DropdownMenuGroup({
24
+ ...props
25
+ }: Menu.Group.Props): react_jsx_runtime0.JSX.Element;
26
+ declare function DropdownMenuLabel({
27
+ className,
28
+ inset,
29
+ ...props
30
+ }: Menu.GroupLabel.Props & {
31
+ inset?: boolean;
32
+ }): react_jsx_runtime0.JSX.Element;
33
+ declare function DropdownMenuItem({
34
+ className,
35
+ inset,
36
+ variant,
37
+ ...props
38
+ }: Menu.Item.Props & {
39
+ inset?: boolean;
40
+ variant?: "default" | "destructive";
41
+ }): react_jsx_runtime0.JSX.Element;
42
+ declare function DropdownMenuSub({
43
+ ...props
44
+ }: Menu.SubmenuRoot.Props): react_jsx_runtime0.JSX.Element;
45
+ declare function DropdownMenuSubTrigger({
46
+ className,
47
+ inset,
48
+ children,
49
+ ...props
50
+ }: Menu.SubmenuTrigger.Props & {
51
+ inset?: boolean;
52
+ }): react_jsx_runtime0.JSX.Element;
53
+ declare function DropdownMenuSubContent({
54
+ align,
55
+ alignOffset,
56
+ side,
57
+ sideOffset,
58
+ className,
59
+ ...props
60
+ }: React.ComponentProps<typeof DropdownMenuContent>): react_jsx_runtime0.JSX.Element;
61
+ declare function DropdownMenuCheckboxItem({
62
+ className,
63
+ children,
64
+ checked,
65
+ ...props
66
+ }: Menu.CheckboxItem.Props): react_jsx_runtime0.JSX.Element;
67
+ declare function DropdownMenuRadioGroup({
68
+ ...props
69
+ }: Menu.RadioGroup.Props): react_jsx_runtime0.JSX.Element;
70
+ declare function DropdownMenuRadioItem({
71
+ className,
72
+ children,
73
+ ...props
74
+ }: Menu.RadioItem.Props): react_jsx_runtime0.JSX.Element;
75
+ declare function DropdownMenuSeparator({
76
+ className,
77
+ ...props
78
+ }: Menu.Separator.Props): react_jsx_runtime0.JSX.Element;
79
+ declare function DropdownMenuShortcut({
80
+ className,
81
+ ...props
82
+ }: React.ComponentProps<"span">): react_jsx_runtime0.JSX.Element;
83
+ //#endregion
84
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };