@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,318 @@
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 { X } from "lucide-react";
7
+ import { Dialog } from "@base-ui/react/dialog";
8
+
9
+ //#region src/ui/sheet.tsx
10
+ function Sheet(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.Root, {
21
+ "data-slot": "sheet",
22
+ ...props
23
+ });
24
+ $[2] = props;
25
+ $[3] = t1;
26
+ } else t1 = $[3];
27
+ return t1;
28
+ }
29
+ function SheetTrigger(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.Trigger, {
40
+ "data-slot": "sheet-trigger",
41
+ ...props
42
+ });
43
+ $[2] = props;
44
+ $[3] = t1;
45
+ } else t1 = $[3];
46
+ return t1;
47
+ }
48
+ function SheetClose(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.Close, {
59
+ "data-slot": "sheet-close",
60
+ ...props
61
+ });
62
+ $[2] = props;
63
+ $[3] = t1;
64
+ } else t1 = $[3];
65
+ return t1;
66
+ }
67
+ function SheetPortal(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.Portal, {
78
+ "data-slot": "sheet-portal",
79
+ ...props
80
+ });
81
+ $[2] = props;
82
+ $[3] = t1;
83
+ } else t1 = $[3];
84
+ return t1;
85
+ }
86
+ function SheetOverlay(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 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 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.Backdrop, {
108
+ "data-slot": "sheet-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 SheetContent(t0) {
119
+ const $ = c(17);
120
+ let children;
121
+ let className;
122
+ let props;
123
+ let t1;
124
+ let t2;
125
+ if ($[0] !== t0) {
126
+ ({className, children, side: t1, showCloseButton: t2, ...props} = t0);
127
+ $[0] = t0;
128
+ $[1] = children;
129
+ $[2] = className;
130
+ $[3] = props;
131
+ $[4] = t1;
132
+ $[5] = t2;
133
+ } else {
134
+ children = $[1];
135
+ className = $[2];
136
+ props = $[3];
137
+ t1 = $[4];
138
+ t2 = $[5];
139
+ }
140
+ const side = t1 === void 0 ? "right" : t1;
141
+ const showCloseButton = t2 === void 0 ? true : t2;
142
+ let t3;
143
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
144
+ t3 = /* @__PURE__ */ jsx(SheetOverlay, {});
145
+ $[6] = t3;
146
+ } else t3 = $[6];
147
+ let t4;
148
+ if ($[7] !== className) {
149
+ t4 = cn("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className);
150
+ $[7] = className;
151
+ $[8] = t4;
152
+ } else t4 = $[8];
153
+ let t5;
154
+ if ($[9] !== showCloseButton) {
155
+ t5 = showCloseButton && /* @__PURE__ */ jsxs(Dialog.Close, {
156
+ "data-slot": "sheet-close",
157
+ render: /* @__PURE__ */ jsx(Button, {
158
+ variant: "ghost",
159
+ className: "absolute top-3 right-3",
160
+ size: "icon-sm"
161
+ }),
162
+ children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
163
+ className: "sr-only",
164
+ children: "Close"
165
+ })]
166
+ });
167
+ $[9] = showCloseButton;
168
+ $[10] = t5;
169
+ } else t5 = $[10];
170
+ let t6;
171
+ if ($[11] !== children || $[12] !== props || $[13] !== side || $[14] !== t4 || $[15] !== t5) {
172
+ t6 = /* @__PURE__ */ jsxs(SheetPortal, { children: [t3, /* @__PURE__ */ jsxs(Dialog.Popup, {
173
+ "data-slot": "sheet-content",
174
+ "data-side": side,
175
+ className: t4,
176
+ ...props,
177
+ children: [children, t5]
178
+ })] });
179
+ $[11] = children;
180
+ $[12] = props;
181
+ $[13] = side;
182
+ $[14] = t4;
183
+ $[15] = t5;
184
+ $[16] = t6;
185
+ } else t6 = $[16];
186
+ return t6;
187
+ }
188
+ function SheetHeader(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("gap-0.5 p-4 flex flex-col", className);
204
+ $[3] = className;
205
+ $[4] = t1;
206
+ } else t1 = $[4];
207
+ let t2;
208
+ if ($[5] !== props || $[6] !== t1) {
209
+ t2 = /* @__PURE__ */ jsx("div", {
210
+ "data-slot": "sheet-header",
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 SheetFooter(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("gap-2 p-4 mt-auto flex flex-col", className);
236
+ $[3] = className;
237
+ $[4] = t1;
238
+ } else t1 = $[4];
239
+ let t2;
240
+ if ($[5] !== props || $[6] !== t1) {
241
+ t2 = /* @__PURE__ */ jsx("div", {
242
+ "data-slot": "sheet-footer",
243
+ className: t1,
244
+ ...props
245
+ });
246
+ $[5] = props;
247
+ $[6] = t1;
248
+ $[7] = t2;
249
+ } else t2 = $[7];
250
+ return t2;
251
+ }
252
+ function SheetTitle(t0) {
253
+ const $ = c(8);
254
+ let className;
255
+ let props;
256
+ if ($[0] !== t0) {
257
+ ({className, ...props} = t0);
258
+ $[0] = t0;
259
+ $[1] = className;
260
+ $[2] = props;
261
+ } else {
262
+ className = $[1];
263
+ props = $[2];
264
+ }
265
+ let t1;
266
+ if ($[3] !== className) {
267
+ t1 = cn("text-foreground text-base font-medium", className);
268
+ $[3] = className;
269
+ $[4] = t1;
270
+ } else t1 = $[4];
271
+ let t2;
272
+ if ($[5] !== props || $[6] !== t1) {
273
+ t2 = /* @__PURE__ */ jsx(Dialog.Title, {
274
+ "data-slot": "sheet-title",
275
+ className: t1,
276
+ ...props
277
+ });
278
+ $[5] = props;
279
+ $[6] = t1;
280
+ $[7] = t2;
281
+ } else t2 = $[7];
282
+ return t2;
283
+ }
284
+ function SheetDescription(t0) {
285
+ const $ = c(8);
286
+ let className;
287
+ let props;
288
+ if ($[0] !== t0) {
289
+ ({className, ...props} = t0);
290
+ $[0] = t0;
291
+ $[1] = className;
292
+ $[2] = props;
293
+ } else {
294
+ className = $[1];
295
+ props = $[2];
296
+ }
297
+ let t1;
298
+ if ($[3] !== className) {
299
+ t1 = cn("text-muted-foreground text-sm", className);
300
+ $[3] = className;
301
+ $[4] = t1;
302
+ } else t1 = $[4];
303
+ let t2;
304
+ if ($[5] !== props || $[6] !== t1) {
305
+ t2 = /* @__PURE__ */ jsx(Dialog.Description, {
306
+ "data-slot": "sheet-description",
307
+ className: t1,
308
+ ...props
309
+ });
310
+ $[5] = props;
311
+ $[6] = t1;
312
+ $[7] = t2;
313
+ } else t2 = $[7];
314
+ return t2;
315
+ }
316
+
317
+ //#endregion
318
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -0,0 +1,160 @@
1
+ import { Button } from "./button.mjs";
2
+ import { Input } from "./input.mjs";
3
+ import { Separator } from "./separator.mjs";
4
+ import { TooltipContent } from "./tooltip.mjs";
5
+ import * as React from "react";
6
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
7
+ import { VariantProps } from "class-variance-authority";
8
+ import { useRender } from "@base-ui/react/use-render";
9
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
10
+
11
+ //#region src/ui/sidebar.d.ts
12
+ interface SidebarContextProps {
13
+ state: "expanded" | "collapsed";
14
+ open: boolean;
15
+ setOpen: (open: boolean) => void;
16
+ openMobile: boolean;
17
+ setOpenMobile: (open: boolean) => void;
18
+ isMobile: boolean;
19
+ toggleSidebar: () => void;
20
+ }
21
+ declare function useSidebar(): SidebarContextProps;
22
+ declare function SidebarProvider({
23
+ defaultOpen,
24
+ open: openProp,
25
+ onOpenChange: setOpenProp,
26
+ className,
27
+ style,
28
+ children,
29
+ ...props
30
+ }: React.ComponentProps<"div"> & {
31
+ defaultOpen?: boolean;
32
+ open?: boolean;
33
+ onOpenChange?: (open: boolean) => void;
34
+ }): react_jsx_runtime0.JSX.Element;
35
+ declare function Sidebar({
36
+ side,
37
+ variant,
38
+ collapsible,
39
+ className,
40
+ children,
41
+ ...props
42
+ }: React.ComponentProps<"div"> & {
43
+ side?: "left" | "right";
44
+ variant?: "sidebar" | "floating" | "inset";
45
+ collapsible?: "offExamples" | "icon" | "none";
46
+ }): react_jsx_runtime0.JSX.Element;
47
+ declare function SidebarTrigger({
48
+ className,
49
+ onClick,
50
+ ...props
51
+ }: React.ComponentProps<typeof Button>): react_jsx_runtime0.JSX.Element;
52
+ declare function SidebarRail({
53
+ className,
54
+ ...props
55
+ }: React.ComponentProps<"button">): react_jsx_runtime0.JSX.Element;
56
+ declare function SidebarInset({
57
+ className,
58
+ ...props
59
+ }: React.ComponentProps<"main">): react_jsx_runtime0.JSX.Element;
60
+ declare function SidebarInput({
61
+ className,
62
+ ...props
63
+ }: React.ComponentProps<typeof Input>): react_jsx_runtime0.JSX.Element;
64
+ declare function SidebarHeader({
65
+ className,
66
+ ...props
67
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
68
+ declare function SidebarFooter({
69
+ className,
70
+ ...props
71
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
72
+ declare function SidebarSeparator({
73
+ className,
74
+ ...props
75
+ }: React.ComponentProps<typeof Separator>): react_jsx_runtime0.JSX.Element;
76
+ declare function SidebarContent({
77
+ className,
78
+ ...props
79
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
80
+ declare function SidebarGroup({
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
84
+ declare function SidebarGroupLabel({
85
+ className,
86
+ render,
87
+ ...props
88
+ }: useRender.ComponentProps<"div"> & React.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
89
+ declare function SidebarGroupAction({
90
+ className,
91
+ render,
92
+ ...props
93
+ }: useRender.ComponentProps<"button"> & React.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
94
+ declare function SidebarGroupContent({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
98
+ declare function SidebarMenu({
99
+ className,
100
+ ...props
101
+ }: React.ComponentProps<"ul">): react_jsx_runtime0.JSX.Element;
102
+ declare function SidebarMenuItem({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<"li">): react_jsx_runtime0.JSX.Element;
106
+ declare const sidebarMenuButtonVariants: (props?: ({
107
+ variant?: "default" | "outline" | null | undefined;
108
+ size?: "default" | "sm" | "lg" | null | undefined;
109
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
110
+ declare function SidebarMenuButton({
111
+ render,
112
+ isActive,
113
+ variant,
114
+ size,
115
+ tooltip,
116
+ className,
117
+ ...props
118
+ }: useRender.ComponentProps<"button"> & React.ComponentProps<"button"> & {
119
+ isActive?: boolean;
120
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
121
+ } & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime0.JSX.Element;
122
+ declare function SidebarMenuAction({
123
+ className,
124
+ render,
125
+ showOnHover,
126
+ ...props
127
+ }: useRender.ComponentProps<"button"> & React.ComponentProps<"button"> & {
128
+ showOnHover?: boolean;
129
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
130
+ declare function SidebarMenuBadge({
131
+ className,
132
+ ...props
133
+ }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
134
+ declare function SidebarMenuSkeleton({
135
+ className,
136
+ showIcon,
137
+ ...props
138
+ }: React.ComponentProps<"div"> & {
139
+ showIcon?: boolean;
140
+ }): react_jsx_runtime0.JSX.Element;
141
+ declare function SidebarMenuSub({
142
+ className,
143
+ ...props
144
+ }: React.ComponentProps<"ul">): react_jsx_runtime0.JSX.Element;
145
+ declare function SidebarMenuSubItem({
146
+ className,
147
+ ...props
148
+ }: React.ComponentProps<"li">): react_jsx_runtime0.JSX.Element;
149
+ declare function SidebarMenuSubButton({
150
+ render,
151
+ size,
152
+ isActive,
153
+ className,
154
+ ...props
155
+ }: useRender.ComponentProps<"a"> & React.ComponentProps<"a"> & {
156
+ size?: "sm" | "md";
157
+ isActive?: boolean;
158
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
159
+ //#endregion
160
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };