@questpie/admin 0.0.1 → 1.0.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.
- package/README.md +439 -424
- package/dist/auth-layout-M8K8_q5R.mjs +181 -0
- package/dist/auth-layout-M8K8_q5R.mjs.map +1 -0
- package/dist/bulk-upload-dialog-h7zXD78Y.mjs +274 -0
- package/dist/bulk-upload-dialog-h7zXD78Y.mjs.map +1 -0
- package/dist/{components/ui/card.mjs → card-BKHjBQfw.mjs} +8 -8
- package/dist/card-BKHjBQfw.mjs.map +1 -0
- package/dist/client/styles/index.css +434 -0
- package/dist/client-BCGpkAz6.mjs +22635 -0
- package/dist/client-BCGpkAz6.mjs.map +1 -0
- package/dist/client-CcWZbkBP.d.mts +13585 -0
- package/dist/client-CcWZbkBP.d.mts.map +1 -0
- package/dist/client.d.mts +3 -0
- package/dist/client.mjs +14 -0
- package/dist/content-locales-provider-BXvuIgfg.mjs +1650 -0
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +1 -0
- package/dist/dashboard-page-B4PGEdc2.mjs +2500 -0
- package/dist/dashboard-page-B4PGEdc2.mjs.map +1 -0
- package/dist/dashboard-page-CVlyR40m.mjs +6 -0
- package/dist/dropzone-Do3awXKd.mjs +634 -0
- package/dist/dropzone-Do3awXKd.mjs.map +1 -0
- package/dist/{views/auth/forgot-password-form.mjs → forgot-password-page-Bcp-An4Y.mjs} +87 -14
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +1 -0
- package/dist/forgot-password-page-CIILVhfo.mjs +7 -0
- package/dist/index-B9Xwk4hi.d.mts +2753 -0
- package/dist/index-B9Xwk4hi.d.mts.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +14 -0
- package/dist/login-page-8K7fo0qK.mjs +7 -0
- package/dist/login-page-CP4gA-dl.mjs +298 -0
- package/dist/login-page-CP4gA-dl.mjs.map +1 -0
- package/dist/preview-utils-BKQ9-TMa.mjs +65 -0
- package/dist/preview-utils-BKQ9-TMa.mjs.map +1 -0
- package/dist/{views/auth/reset-password-form.mjs → reset-password-page-BqfDmLxA.mjs} +111 -14
- package/dist/reset-password-page-BqfDmLxA.mjs.map +1 -0
- package/dist/reset-password-page-DLATv0xQ.mjs +7 -0
- package/dist/runtime-6VZM878K.mjs +69 -0
- package/dist/runtime-6VZM878K.mjs.map +1 -0
- package/dist/saved-views.types-BMsz5mCy.d.mts +42 -0
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +1 -0
- package/dist/server.d.mts +250 -0
- package/dist/server.d.mts.map +1 -0
- package/dist/server.mjs +832 -0
- package/dist/server.mjs.map +1 -0
- package/dist/setup-page-CMZ5P_OE.mjs +6 -0
- package/dist/setup-page-YAP_fzqh.mjs +264 -0
- package/dist/setup-page-YAP_fzqh.mjs.map +1 -0
- package/dist/shared.d.mts +57 -0
- package/dist/shared.d.mts.map +1 -0
- package/dist/shared.mjs +3 -0
- package/dist/{hooks/use-auth.mjs → use-auth-BoLmWtmU.mjs} +42 -30
- package/dist/use-auth-BoLmWtmU.mjs.map +1 -0
- package/package.json +48 -197
- package/.turbo/turbo-build.log +0 -108
- package/CHANGELOG.md +0 -10
- package/STATUS.md +0 -917
- package/VALIDATION.md +0 -602
- package/components.json +0 -24
- package/dist/__tests__/setup.mjs +0 -38
- package/dist/__tests__/test-utils.mjs +0 -45
- package/dist/__tests__/vitest.d.mjs +0 -3
- package/dist/components/admin-app.mjs +0 -69
- package/dist/components/fields/array-field.mjs +0 -190
- package/dist/components/fields/checkbox-field.mjs +0 -34
- package/dist/components/fields/custom-field.mjs +0 -32
- package/dist/components/fields/date-field.mjs +0 -41
- package/dist/components/fields/datetime-field.mjs +0 -42
- package/dist/components/fields/email-field.mjs +0 -37
- package/dist/components/fields/embedded-collection.mjs +0 -253
- package/dist/components/fields/field-types.mjs +0 -1
- package/dist/components/fields/field-utils.mjs +0 -10
- package/dist/components/fields/field-wrapper.mjs +0 -34
- package/dist/components/fields/index.mjs +0 -23
- package/dist/components/fields/json-field.mjs +0 -243
- package/dist/components/fields/locale-badge.mjs +0 -16
- package/dist/components/fields/number-field.mjs +0 -39
- package/dist/components/fields/password-field.mjs +0 -37
- package/dist/components/fields/relation-field.mjs +0 -104
- package/dist/components/fields/relation-picker.mjs +0 -229
- package/dist/components/fields/relation-select.mjs +0 -188
- package/dist/components/fields/rich-text-editor/index.mjs +0 -897
- package/dist/components/fields/select-field.mjs +0 -41
- package/dist/components/fields/switch-field.mjs +0 -34
- package/dist/components/fields/text-field.mjs +0 -38
- package/dist/components/fields/textarea-field.mjs +0 -38
- package/dist/components/index.mjs +0 -59
- package/dist/components/primitives/checkbox-input.mjs +0 -127
- package/dist/components/primitives/date-input.mjs +0 -303
- package/dist/components/primitives/index.mjs +0 -12
- package/dist/components/primitives/number-input.mjs +0 -104
- package/dist/components/primitives/select-input.mjs +0 -177
- package/dist/components/primitives/tag-input.mjs +0 -135
- package/dist/components/primitives/text-input.mjs +0 -39
- package/dist/components/primitives/textarea-input.mjs +0 -37
- package/dist/components/primitives/toggle-input.mjs +0 -31
- package/dist/components/primitives/types.mjs +0 -12
- package/dist/components/ui/accordion.mjs +0 -55
- package/dist/components/ui/avatar.mjs +0 -54
- package/dist/components/ui/badge.mjs +0 -34
- package/dist/components/ui/button.mjs +0 -48
- package/dist/components/ui/checkbox.mjs +0 -21
- package/dist/components/ui/combobox.mjs +0 -163
- package/dist/components/ui/dialog.mjs +0 -95
- package/dist/components/ui/dropdown-menu.mjs +0 -138
- package/dist/components/ui/field.mjs +0 -113
- package/dist/components/ui/input-group.mjs +0 -82
- package/dist/components/ui/input.mjs +0 -17
- package/dist/components/ui/label.mjs +0 -15
- package/dist/components/ui/popover.mjs +0 -56
- package/dist/components/ui/scroll-area.mjs +0 -38
- package/dist/components/ui/select.mjs +0 -100
- package/dist/components/ui/separator.mjs +0 -16
- package/dist/components/ui/sheet.mjs +0 -90
- package/dist/components/ui/sidebar.mjs +0 -387
- package/dist/components/ui/skeleton.mjs +0 -14
- package/dist/components/ui/spinner.mjs +0 -16
- package/dist/components/ui/switch.mjs +0 -22
- package/dist/components/ui/table.mjs +0 -68
- package/dist/components/ui/tabs.mjs +0 -48
- package/dist/components/ui/textarea.mjs +0 -15
- package/dist/components/ui/tooltip.mjs +0 -44
- package/dist/config/component-registry.mjs +0 -38
- package/dist/config/index.mjs +0 -129
- package/dist/hooks/admin-provider.mjs +0 -70
- package/dist/hooks/index.mjs +0 -7
- package/dist/hooks/store.mjs +0 -178
- package/dist/hooks/use-collection-db.mjs +0 -146
- package/dist/hooks/use-collection.mjs +0 -112
- package/dist/hooks/use-global.mjs +0 -46
- package/dist/hooks/use-mobile.mjs +0 -20
- package/dist/lib/utils.mjs +0 -10
- package/dist/styles/index.css +0 -336
- package/dist/styles/index.mjs +0 -1
- package/dist/utils/index.mjs +0 -9
- package/dist/views/auth/auth-layout.mjs +0 -52
- package/dist/views/auth/index.mjs +0 -6
- package/dist/views/auth/login-form.mjs +0 -156
- package/dist/views/collection/auto-form-fields.mjs +0 -525
- package/dist/views/collection/collection-form.mjs +0 -91
- package/dist/views/collection/collection-list.mjs +0 -76
- package/dist/views/collection/form-field.mjs +0 -42
- package/dist/views/collection/index.mjs +0 -6
- package/dist/views/common/index.mjs +0 -4
- package/dist/views/common/locale-switcher.mjs +0 -39
- package/dist/views/common/version-history.mjs +0 -272
- package/dist/views/index.mjs +0 -9
- package/dist/views/layout/admin-layout.mjs +0 -40
- package/dist/views/layout/admin-router.mjs +0 -95
- package/dist/views/layout/admin-sidebar.mjs +0 -63
- package/dist/views/layout/index.mjs +0 -5
- package/src/__tests__/setup.ts +0 -44
- package/src/__tests__/test-utils.tsx +0 -49
- package/src/__tests__/vitest.d.ts +0 -9
- package/src/components/admin-app.tsx +0 -221
- package/src/components/fields/array-field.tsx +0 -237
- package/src/components/fields/checkbox-field.tsx +0 -47
- package/src/components/fields/custom-field.tsx +0 -50
- package/src/components/fields/date-field.tsx +0 -65
- package/src/components/fields/datetime-field.tsx +0 -67
- package/src/components/fields/email-field.tsx +0 -51
- package/src/components/fields/embedded-collection.tsx +0 -315
- package/src/components/fields/field-types.ts +0 -162
- package/src/components/fields/field-utils.ts +0 -6
- package/src/components/fields/field-wrapper.tsx +0 -52
- package/src/components/fields/index.ts +0 -66
- package/src/components/fields/json-field.tsx +0 -440
- package/src/components/fields/locale-badge.tsx +0 -15
- package/src/components/fields/number-field.tsx +0 -57
- package/src/components/fields/password-field.tsx +0 -51
- package/src/components/fields/relation-field.tsx +0 -243
- package/src/components/fields/relation-picker.tsx +0 -402
- package/src/components/fields/relation-select.tsx +0 -327
- package/src/components/fields/rich-text-editor/index.tsx +0 -1337
- package/src/components/fields/select-field.tsx +0 -61
- package/src/components/fields/switch-field.tsx +0 -47
- package/src/components/fields/text-field.tsx +0 -55
- package/src/components/fields/textarea-field.tsx +0 -55
- package/src/components/index.ts +0 -40
- package/src/components/primitives/checkbox-input.tsx +0 -193
- package/src/components/primitives/date-input.tsx +0 -401
- package/src/components/primitives/index.ts +0 -24
- package/src/components/primitives/number-input.tsx +0 -132
- package/src/components/primitives/select-input.tsx +0 -296
- package/src/components/primitives/tag-input.tsx +0 -200
- package/src/components/primitives/text-input.tsx +0 -49
- package/src/components/primitives/textarea-input.tsx +0 -46
- package/src/components/primitives/toggle-input.tsx +0 -36
- package/src/components/primitives/types.ts +0 -235
- package/src/components/ui/accordion.tsx +0 -72
- package/src/components/ui/avatar.tsx +0 -106
- package/src/components/ui/badge.tsx +0 -48
- package/src/components/ui/button.tsx +0 -53
- package/src/components/ui/card.tsx +0 -94
- package/src/components/ui/checkbox.tsx +0 -27
- package/src/components/ui/combobox.tsx +0 -290
- package/src/components/ui/dialog.tsx +0 -151
- package/src/components/ui/dropdown-menu.tsx +0 -254
- package/src/components/ui/field.tsx +0 -227
- package/src/components/ui/input-group.tsx +0 -149
- package/src/components/ui/input.tsx +0 -20
- package/src/components/ui/label.tsx +0 -18
- package/src/components/ui/popover.tsx +0 -88
- package/src/components/ui/scroll-area.tsx +0 -53
- package/src/components/ui/select.tsx +0 -192
- package/src/components/ui/separator.tsx +0 -23
- package/src/components/ui/sheet.tsx +0 -127
- package/src/components/ui/sidebar.tsx +0 -723
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/spinner.tsx +0 -10
- package/src/components/ui/switch.tsx +0 -32
- package/src/components/ui/table.tsx +0 -99
- package/src/components/ui/tabs.tsx +0 -82
- package/src/components/ui/textarea.tsx +0 -18
- package/src/components/ui/tooltip.tsx +0 -70
- package/src/config/component-registry.ts +0 -190
- package/src/config/index.ts +0 -1099
- package/src/hooks/README.md +0 -269
- package/src/hooks/admin-provider.tsx +0 -110
- package/src/hooks/index.ts +0 -41
- package/src/hooks/store.ts +0 -248
- package/src/hooks/use-auth.ts +0 -168
- package/src/hooks/use-collection-db.ts +0 -209
- package/src/hooks/use-collection.ts +0 -156
- package/src/hooks/use-global.ts +0 -69
- package/src/hooks/use-mobile.ts +0 -21
- package/src/lib/utils.ts +0 -6
- package/src/styles/index.css +0 -340
- package/src/utils/index.ts +0 -6
- package/src/views/auth/auth-layout.tsx +0 -77
- package/src/views/auth/forgot-password-form.tsx +0 -192
- package/src/views/auth/index.ts +0 -21
- package/src/views/auth/login-form.tsx +0 -229
- package/src/views/auth/reset-password-form.tsx +0 -232
- package/src/views/collection/auto-form-fields.tsx +0 -982
- package/src/views/collection/collection-form.tsx +0 -186
- package/src/views/collection/collection-list.tsx +0 -223
- package/src/views/collection/form-field.tsx +0 -52
- package/src/views/collection/index.ts +0 -15
- package/src/views/common/index.ts +0 -8
- package/src/views/common/locale-switcher.tsx +0 -45
- package/src/views/common/version-history.tsx +0 -406
- package/src/views/index.ts +0 -25
- package/src/views/layout/admin-layout.tsx +0 -117
- package/src/views/layout/admin-router.tsx +0 -206
- package/src/views/layout/admin-sidebar.tsx +0 -185
- package/src/views/layout/index.ts +0 -12
- package/tsconfig.json +0 -13
- package/tsconfig.tsbuildinfo +0 -1
- package/tsdown.config.ts +0 -13
- package/vitest.config.ts +0 -29
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Button } from "./button";
|
|
6
|
-
import { Input } from "./input";
|
|
7
|
-
import { Separator } from "./separator";
|
|
8
|
-
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet";
|
|
9
|
-
import { Skeleton } from "./skeleton";
|
|
10
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
|
|
11
|
-
import { cn } from "../../lib/utils";
|
|
12
|
-
import { SidebarIcon } from "@phosphor-icons/react";
|
|
13
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
14
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
15
|
-
import { cva } from "class-variance-authority";
|
|
16
|
-
import { useIsMobile } from "../../hooks/use-mobile";
|
|
17
|
-
|
|
18
|
-
//#region src/components/ui/sidebar.tsx
|
|
19
|
-
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
20
|
-
const SIDEBAR_COOKIE_MAX_AGE = 3600 * 24 * 7;
|
|
21
|
-
const SIDEBAR_WIDTH = "16rem";
|
|
22
|
-
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
23
|
-
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
24
|
-
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
25
|
-
const SidebarContext = React$1.createContext(null);
|
|
26
|
-
function useSidebar() {
|
|
27
|
-
const context = React$1.useContext(SidebarContext);
|
|
28
|
-
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
29
|
-
return context;
|
|
30
|
-
}
|
|
31
|
-
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
32
|
-
const isMobile = useIsMobile();
|
|
33
|
-
const [openMobile, setOpenMobile] = React$1.useState(false);
|
|
34
|
-
const [_open, _setOpen] = React$1.useState(defaultOpen);
|
|
35
|
-
const open = openProp ?? _open;
|
|
36
|
-
const setOpen = React$1.useCallback((value) => {
|
|
37
|
-
const openState = typeof value === "function" ? value(open) : value;
|
|
38
|
-
if (setOpenProp) setOpenProp(openState);
|
|
39
|
-
else _setOpen(openState);
|
|
40
|
-
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
41
|
-
}, [setOpenProp, open]);
|
|
42
|
-
const toggleSidebar = React$1.useCallback(() => {
|
|
43
|
-
return isMobile ? setOpenMobile((open$1) => !open$1) : setOpen((open$1) => !open$1);
|
|
44
|
-
}, [
|
|
45
|
-
isMobile,
|
|
46
|
-
setOpen,
|
|
47
|
-
setOpenMobile
|
|
48
|
-
]);
|
|
49
|
-
React$1.useEffect(() => {
|
|
50
|
-
const handleKeyDown = (event) => {
|
|
51
|
-
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
52
|
-
event.preventDefault();
|
|
53
|
-
toggleSidebar();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
57
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
58
|
-
}, [toggleSidebar]);
|
|
59
|
-
const state = open ? "expanded" : "collapsed";
|
|
60
|
-
const contextValue = React$1.useMemo(() => ({
|
|
61
|
-
state,
|
|
62
|
-
open,
|
|
63
|
-
setOpen,
|
|
64
|
-
isMobile,
|
|
65
|
-
openMobile,
|
|
66
|
-
setOpenMobile,
|
|
67
|
-
toggleSidebar
|
|
68
|
-
}), [
|
|
69
|
-
state,
|
|
70
|
-
open,
|
|
71
|
-
setOpen,
|
|
72
|
-
isMobile,
|
|
73
|
-
openMobile,
|
|
74
|
-
setOpenMobile,
|
|
75
|
-
toggleSidebar
|
|
76
|
-
]);
|
|
77
|
-
return /* @__PURE__ */ jsx(SidebarContext.Provider, {
|
|
78
|
-
value: contextValue,
|
|
79
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
80
|
-
"data-slot": "sidebar-wrapper",
|
|
81
|
-
style: {
|
|
82
|
-
"--sidebar-width": SIDEBAR_WIDTH,
|
|
83
|
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
84
|
-
...style
|
|
85
|
-
},
|
|
86
|
-
className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
|
|
87
|
-
...props,
|
|
88
|
-
children
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offExamples", className, children, ...props }) {
|
|
93
|
-
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
94
|
-
if (collapsible === "none") return /* @__PURE__ */ jsx("div", {
|
|
95
|
-
"data-slot": "sidebar",
|
|
96
|
-
className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
|
|
97
|
-
...props,
|
|
98
|
-
children
|
|
99
|
-
});
|
|
100
|
-
if (isMobile) return /* @__PURE__ */ jsx(Sheet, {
|
|
101
|
-
open: openMobile,
|
|
102
|
-
onOpenChange: setOpenMobile,
|
|
103
|
-
...props,
|
|
104
|
-
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
105
|
-
"data-sidebar": "sidebar",
|
|
106
|
-
"data-slot": "sidebar",
|
|
107
|
-
"data-mobile": "true",
|
|
108
|
-
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
109
|
-
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
110
|
-
side,
|
|
111
|
-
children: [/* @__PURE__ */ jsxs(SheetHeader, {
|
|
112
|
-
className: "sr-only",
|
|
113
|
-
children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }), /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })]
|
|
114
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
115
|
-
className: "flex h-full w-full flex-col",
|
|
116
|
-
children
|
|
117
|
-
})]
|
|
118
|
-
})
|
|
119
|
-
});
|
|
120
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
121
|
-
className: "group peer text-sidebar-foreground hidden md:block",
|
|
122
|
-
"data-state": state,
|
|
123
|
-
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
124
|
-
"data-variant": variant,
|
|
125
|
-
"data-side": side,
|
|
126
|
-
"data-slot": "sidebar",
|
|
127
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
128
|
-
"data-slot": "sidebar-gap",
|
|
129
|
-
className: cn("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent", "group-data-[collapsible=offExamples]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
130
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
131
|
-
"data-slot": "sidebar-container",
|
|
132
|
-
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", side === "left" ? "left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
133
|
-
...props,
|
|
134
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
135
|
-
"data-sidebar": "sidebar",
|
|
136
|
-
"data-slot": "sidebar-inner",
|
|
137
|
-
className: "bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",
|
|
138
|
-
children
|
|
139
|
-
})
|
|
140
|
-
})]
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
function SidebarTrigger({ className, onClick, ...props }) {
|
|
144
|
-
const { toggleSidebar } = useSidebar();
|
|
145
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
146
|
-
"data-sidebar": "trigger",
|
|
147
|
-
"data-slot": "sidebar-trigger",
|
|
148
|
-
variant: "ghost",
|
|
149
|
-
size: "icon-sm",
|
|
150
|
-
className: cn(className),
|
|
151
|
-
onClick: (event) => {
|
|
152
|
-
onClick?.(event);
|
|
153
|
-
toggleSidebar();
|
|
154
|
-
},
|
|
155
|
-
...props,
|
|
156
|
-
children: [/* @__PURE__ */ jsx(SidebarIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
157
|
-
className: "sr-only",
|
|
158
|
-
children: "Toggle Sidebar"
|
|
159
|
-
})]
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function SidebarRail({ className, ...props }) {
|
|
163
|
-
const { toggleSidebar } = useSidebar();
|
|
164
|
-
return /* @__PURE__ */ jsx("button", {
|
|
165
|
-
"data-sidebar": "rail",
|
|
166
|
-
"data-slot": "sidebar-rail",
|
|
167
|
-
"aria-label": "Toggle Sidebar",
|
|
168
|
-
tabIndex: -1,
|
|
169
|
-
onClick: toggleSidebar,
|
|
170
|
-
title: "Toggle Sidebar",
|
|
171
|
-
className: cn("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offExamples]:bg-sidebar group-data-[collapsible=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full", "[[data-side=left][data-collapsible=offExamples]_&]:-right-2", "[[data-side=right][data-collapsible=offExamples]_&]:-left-2", className),
|
|
172
|
-
...props
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
function SidebarInset({ className, ...props }) {
|
|
176
|
-
return /* @__PURE__ */ jsx("main", {
|
|
177
|
-
"data-slot": "sidebar-inset",
|
|
178
|
-
className: cn("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col", className),
|
|
179
|
-
...props
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
function SidebarInput({ className, ...props }) {
|
|
183
|
-
return /* @__PURE__ */ jsx(Input, {
|
|
184
|
-
"data-slot": "sidebar-input",
|
|
185
|
-
"data-sidebar": "input",
|
|
186
|
-
className: cn("bg-muted/20 dark:bg-muted/30 border-input h-8 w-full", className),
|
|
187
|
-
...props
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
function SidebarHeader({ className, ...props }) {
|
|
191
|
-
return /* @__PURE__ */ jsx("div", {
|
|
192
|
-
"data-slot": "sidebar-header",
|
|
193
|
-
"data-sidebar": "header",
|
|
194
|
-
className: cn("gap-2 p-2 flex flex-col", className),
|
|
195
|
-
...props
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function SidebarFooter({ className, ...props }) {
|
|
199
|
-
return /* @__PURE__ */ jsx("div", {
|
|
200
|
-
"data-slot": "sidebar-footer",
|
|
201
|
-
"data-sidebar": "footer",
|
|
202
|
-
className: cn("gap-2 p-2 flex flex-col", className),
|
|
203
|
-
...props
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
function SidebarSeparator({ className, ...props }) {
|
|
207
|
-
return /* @__PURE__ */ jsx(Separator, {
|
|
208
|
-
"data-slot": "sidebar-separator",
|
|
209
|
-
"data-sidebar": "separator",
|
|
210
|
-
className: cn("bg-sidebar-border mx-2 w-auto", className),
|
|
211
|
-
...props
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
function SidebarContent({ className, ...props }) {
|
|
215
|
-
return /* @__PURE__ */ jsx("div", {
|
|
216
|
-
"data-slot": "sidebar-content",
|
|
217
|
-
"data-sidebar": "content",
|
|
218
|
-
className: cn("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
219
|
-
...props
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function SidebarGroup({ className, ...props }) {
|
|
223
|
-
return /* @__PURE__ */ jsx("div", {
|
|
224
|
-
"data-slot": "sidebar-group",
|
|
225
|
-
"data-sidebar": "group",
|
|
226
|
-
className: cn("px-2 py-1 relative flex w-full min-w-0 flex-col", className),
|
|
227
|
-
...props
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
function SidebarGroupLabel({ className, render, ...props }) {
|
|
231
|
-
return useRender({
|
|
232
|
-
defaultTagName: "div",
|
|
233
|
-
props: mergeProps({ className: cn("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0", className) }, props),
|
|
234
|
-
render,
|
|
235
|
-
state: {
|
|
236
|
-
slot: "sidebar-group-label",
|
|
237
|
-
sidebar: "group-label"
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
function SidebarGroupAction({ className, render, ...props }) {
|
|
242
|
-
return useRender({
|
|
243
|
-
defaultTagName: "button",
|
|
244
|
-
props: mergeProps({ className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 w-5 rounded-md p-0 focus-visible:ring-2 [&>svg]:size-4 flex aspect-square items-center justify-center outline-hidden transition-transform [&>svg]:shrink-0 after:absolute after:-inset-2 md:after:hidden group-data-[collapsible=icon]:hidden", className) }, props),
|
|
245
|
-
render,
|
|
246
|
-
state: {
|
|
247
|
-
slot: "sidebar-group-action",
|
|
248
|
-
sidebar: "group-action"
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
function SidebarGroupContent({ className, ...props }) {
|
|
253
|
-
return /* @__PURE__ */ jsx("div", {
|
|
254
|
-
"data-slot": "sidebar-group-content",
|
|
255
|
-
"data-sidebar": "group-content",
|
|
256
|
-
className: cn("text-xs w-full", className),
|
|
257
|
-
...props
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
function SidebarMenu({ className, ...props }) {
|
|
261
|
-
return /* @__PURE__ */ jsx("ul", {
|
|
262
|
-
"data-slot": "sidebar-menu",
|
|
263
|
-
"data-sidebar": "menu",
|
|
264
|
-
className: cn("gap-px flex w-full min-w-0 flex-col", className),
|
|
265
|
-
...props
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
function SidebarMenuItem({ className, ...props }) {
|
|
269
|
-
return /* @__PURE__ */ jsx("li", {
|
|
270
|
-
"data-slot": "sidebar-menu-item",
|
|
271
|
-
"data-sidebar": "menu-item",
|
|
272
|
-
className: cn("group/menu-item relative", className),
|
|
273
|
-
...props
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
const sidebarMenuButtonVariants = cva("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
277
|
-
variants: {
|
|
278
|
-
variant: {
|
|
279
|
-
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
280
|
-
outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
281
|
-
},
|
|
282
|
-
size: {
|
|
283
|
-
default: "h-8 text-xs",
|
|
284
|
-
sm: "h-7 text-xs",
|
|
285
|
-
lg: "h-12 text-xs group-data-[collapsible=icon]:p-0!"
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
defaultVariants: {
|
|
289
|
-
variant: "default",
|
|
290
|
-
size: "default"
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
function SidebarMenuButton({ render, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
294
|
-
const { isMobile, state } = useSidebar();
|
|
295
|
-
const comp = useRender({
|
|
296
|
-
defaultTagName: "button",
|
|
297
|
-
props: mergeProps({ className: cn(sidebarMenuButtonVariants({
|
|
298
|
-
variant,
|
|
299
|
-
size
|
|
300
|
-
}), className) }, props),
|
|
301
|
-
render: !tooltip ? render : TooltipTrigger,
|
|
302
|
-
state: {
|
|
303
|
-
slot: "sidebar-menu-button",
|
|
304
|
-
sidebar: "menu-button",
|
|
305
|
-
size,
|
|
306
|
-
active: isActive
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
if (!tooltip) return comp;
|
|
310
|
-
if (typeof tooltip === "string") tooltip = { children: tooltip };
|
|
311
|
-
return /* @__PURE__ */ jsxs(Tooltip, { children: [comp, /* @__PURE__ */ jsx(TooltipContent, {
|
|
312
|
-
side: "right",
|
|
313
|
-
align: "center",
|
|
314
|
-
hidden: state !== "collapsed" || isMobile,
|
|
315
|
-
...tooltip
|
|
316
|
-
})] });
|
|
317
|
-
}
|
|
318
|
-
function SidebarMenuAction({ className, render, showOnHover = false, ...props }) {
|
|
319
|
-
return useRender({
|
|
320
|
-
defaultTagName: "button",
|
|
321
|
-
props: mergeProps({ className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-[calc(var(--radius-sm)-2px)] p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0", showOnHover && "peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-open:opacity-100 md:opacity-0", className) }, props),
|
|
322
|
-
render,
|
|
323
|
-
state: {
|
|
324
|
-
slot: "sidebar-menu-action",
|
|
325
|
-
sidebar: "menu-action"
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
function SidebarMenuBadge({ className, ...props }) {
|
|
330
|
-
return /* @__PURE__ */ jsx("div", {
|
|
331
|
-
"data-slot": "sidebar-menu-badge",
|
|
332
|
-
"data-sidebar": "menu-badge",
|
|
333
|
-
className: cn("text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 rounded-[calc(var(--radius-sm)-2px)] px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden", className),
|
|
334
|
-
...props
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
338
|
-
const [width] = React$1.useState(() => {
|
|
339
|
-
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
340
|
-
});
|
|
341
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
342
|
-
"data-slot": "sidebar-menu-skeleton",
|
|
343
|
-
"data-sidebar": "menu-skeleton",
|
|
344
|
-
className: cn("h-8 gap-2 rounded-md px-2 flex items-center", className),
|
|
345
|
-
...props,
|
|
346
|
-
children: [showIcon && /* @__PURE__ */ jsx(Skeleton, {
|
|
347
|
-
className: "size-4 rounded-md",
|
|
348
|
-
"data-sidebar": "menu-skeleton-icon"
|
|
349
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
350
|
-
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
351
|
-
"data-sidebar": "menu-skeleton-text",
|
|
352
|
-
style: { "--skeleton-width": width }
|
|
353
|
-
})]
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
function SidebarMenuSub({ className, ...props }) {
|
|
357
|
-
return /* @__PURE__ */ jsx("ul", {
|
|
358
|
-
"data-slot": "sidebar-menu-sub",
|
|
359
|
-
"data-sidebar": "menu-sub",
|
|
360
|
-
className: cn("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col", className),
|
|
361
|
-
...props
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
function SidebarMenuSubItem({ className, ...props }) {
|
|
365
|
-
return /* @__PURE__ */ jsx("li", {
|
|
366
|
-
"data-slot": "sidebar-menu-sub-item",
|
|
367
|
-
"data-sidebar": "menu-sub-item",
|
|
368
|
-
className: cn("group/menu-sub-item relative", className),
|
|
369
|
-
...props
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
function SidebarMenuSubButton({ render, size = "md", isActive = false, className, ...props }) {
|
|
373
|
-
return useRender({
|
|
374
|
-
defaultTagName: "a",
|
|
375
|
-
props: mergeProps({ className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-xs data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0", className) }, props),
|
|
376
|
-
render,
|
|
377
|
-
state: {
|
|
378
|
-
slot: "sidebar-menu-sub-button",
|
|
379
|
-
sidebar: "menu-sub-button",
|
|
380
|
-
size,
|
|
381
|
-
active: isActive
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
//#endregion
|
|
387
|
-
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 };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../lib/utils";
|
|
3
|
-
|
|
4
|
-
//#region src/components/ui/skeleton.tsx
|
|
5
|
-
function Skeleton({ className, ...props }) {
|
|
6
|
-
return /* @__PURE__ */ jsx("div", {
|
|
7
|
-
"data-slot": "skeleton",
|
|
8
|
-
className: cn("bg-muted rounded-md animate-pulse", className),
|
|
9
|
-
...props
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Skeleton };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../lib/utils";
|
|
3
|
-
import { SpinnerIcon } from "@phosphor-icons/react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/ui/spinner.tsx
|
|
6
|
-
function Spinner({ className, ...props }) {
|
|
7
|
-
return /* @__PURE__ */ jsx(SpinnerIcon, {
|
|
8
|
-
role: "status",
|
|
9
|
-
"aria-label": "Loading",
|
|
10
|
-
className: cn("size-4 animate-spin", className),
|
|
11
|
-
...props
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { Spinner };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
6
|
-
|
|
7
|
-
//#region src/components/ui/switch.tsx
|
|
8
|
-
function Switch({ className, size = "default", ...props }) {
|
|
9
|
-
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
10
|
-
"data-slot": "switch",
|
|
11
|
-
"data-size": size,
|
|
12
|
-
className: cn("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
|
|
13
|
-
...props,
|
|
14
|
-
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
15
|
-
"data-slot": "switch-thumb",
|
|
16
|
-
className: "bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"
|
|
17
|
-
})
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { Switch };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
//#region src/components/ui/table.tsx
|
|
6
|
-
function Table({ className, ...props }) {
|
|
7
|
-
return /* @__PURE__ */ jsx("div", {
|
|
8
|
-
"data-slot": "table-container",
|
|
9
|
-
className: "relative w-full overflow-x-auto",
|
|
10
|
-
children: /* @__PURE__ */ jsx("table", {
|
|
11
|
-
"data-slot": "table",
|
|
12
|
-
className: cn("w-full caption-bottom text-xs", className),
|
|
13
|
-
...props
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function TableHeader({ className, ...props }) {
|
|
18
|
-
return /* @__PURE__ */ jsx("thead", {
|
|
19
|
-
"data-slot": "table-header",
|
|
20
|
-
className: cn("[&_tr]:border-b", className),
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function TableBody({ className, ...props }) {
|
|
25
|
-
return /* @__PURE__ */ jsx("tbody", {
|
|
26
|
-
"data-slot": "table-body",
|
|
27
|
-
className: cn("[&_tr:last-child]:border-0", className),
|
|
28
|
-
...props
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function TableFooter({ className, ...props }) {
|
|
32
|
-
return /* @__PURE__ */ jsx("tfoot", {
|
|
33
|
-
"data-slot": "table-footer",
|
|
34
|
-
className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
|
|
35
|
-
...props
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function TableRow({ className, ...props }) {
|
|
39
|
-
return /* @__PURE__ */ jsx("tr", {
|
|
40
|
-
"data-slot": "table-row",
|
|
41
|
-
className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className),
|
|
42
|
-
...props
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function TableHead({ className, ...props }) {
|
|
46
|
-
return /* @__PURE__ */ jsx("th", {
|
|
47
|
-
"data-slot": "table-head",
|
|
48
|
-
className: cn("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
49
|
-
...props
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function TableCell({ className, ...props }) {
|
|
53
|
-
return /* @__PURE__ */ jsx("td", {
|
|
54
|
-
"data-slot": "table-cell",
|
|
55
|
-
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
56
|
-
...props
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function TableCaption({ className, ...props }) {
|
|
60
|
-
return /* @__PURE__ */ jsx("caption", {
|
|
61
|
-
"data-slot": "table-caption",
|
|
62
|
-
className: cn("text-muted-foreground mt-4 text-xs", className),
|
|
63
|
-
...props
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
|
-
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
7
|
-
|
|
8
|
-
//#region src/components/ui/tabs.tsx
|
|
9
|
-
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
11
|
-
"data-slot": "tabs",
|
|
12
|
-
"data-orientation": orientation,
|
|
13
|
-
className: cn("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col", className),
|
|
14
|
-
...props
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
const tabsListVariants = cva("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col", {
|
|
18
|
-
variants: { variant: {
|
|
19
|
-
default: "bg-muted",
|
|
20
|
-
line: "gap-1 bg-transparent"
|
|
21
|
-
} },
|
|
22
|
-
defaultVariants: { variant: "default" }
|
|
23
|
-
});
|
|
24
|
-
function TabsList({ className, variant = "default", ...props }) {
|
|
25
|
-
return /* @__PURE__ */ jsx(Tabs$1.List, {
|
|
26
|
-
"data-slot": "tabs-list",
|
|
27
|
-
"data-variant": variant,
|
|
28
|
-
className: cn(tabsListVariants({ variant }), className),
|
|
29
|
-
...props
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function TabsTrigger({ className, ...props }) {
|
|
33
|
-
return /* @__PURE__ */ jsx(Tabs$1.Tab, {
|
|
34
|
-
"data-slot": "tabs-trigger",
|
|
35
|
-
className: cn("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground", "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className),
|
|
36
|
-
...props
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function TabsContent({ className, ...props }) {
|
|
40
|
-
return /* @__PURE__ */ jsx(Tabs$1.Panel, {
|
|
41
|
-
"data-slot": "tabs-content",
|
|
42
|
-
className: cn("text-xs/relaxed flex-1 outline-none", className),
|
|
43
|
-
...props
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
//#region src/components/ui/textarea.tsx
|
|
6
|
-
function Textarea({ className, ...props }) {
|
|
7
|
-
return /* @__PURE__ */ jsx("textarea", {
|
|
8
|
-
"data-slot": "textarea",
|
|
9
|
-
className: cn("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
10
|
-
...props
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export { Textarea };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
6
|
-
|
|
7
|
-
//#region src/components/ui/tooltip.tsx
|
|
8
|
-
function TooltipProvider({ delay = 0, ...props }) {
|
|
9
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
10
|
-
"data-slot": "tooltip-provider",
|
|
11
|
-
delay,
|
|
12
|
-
...props
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function Tooltip({ ...props }) {
|
|
16
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(Tooltip$1.Root, {
|
|
17
|
-
"data-slot": "tooltip",
|
|
18
|
-
...props
|
|
19
|
-
}) });
|
|
20
|
-
}
|
|
21
|
-
function TooltipTrigger({ ...props }) {
|
|
22
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
23
|
-
"data-slot": "tooltip-trigger",
|
|
24
|
-
...props
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
|
|
28
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
|
|
29
|
-
align,
|
|
30
|
-
alignOffset,
|
|
31
|
-
side,
|
|
32
|
-
sideOffset,
|
|
33
|
-
className: "isolate z-50",
|
|
34
|
-
children: /* @__PURE__ */ jsxs(Tooltip$1.Popup, {
|
|
35
|
-
"data-slot": "tooltip-content",
|
|
36
|
-
className: cn("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-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 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)", className),
|
|
37
|
-
...props,
|
|
38
|
-
children: [children, /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })]
|
|
39
|
-
})
|
|
40
|
-
}) });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//#region src/config/component-registry.ts
|
|
2
|
-
/**
|
|
3
|
-
* Default component registry
|
|
4
|
-
* These are the built-in components from @questpie/admin
|
|
5
|
-
*/
|
|
6
|
-
const defaultComponentRegistry = {
|
|
7
|
-
fields: {},
|
|
8
|
-
layouts: {},
|
|
9
|
-
custom: {}
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Merge user registry with defaults
|
|
13
|
-
*/
|
|
14
|
-
function mergeComponentRegistry(userRegistry) {
|
|
15
|
-
return {
|
|
16
|
-
fields: {
|
|
17
|
-
...defaultComponentRegistry.fields,
|
|
18
|
-
...userRegistry?.fields
|
|
19
|
-
},
|
|
20
|
-
layouts: {
|
|
21
|
-
...defaultComponentRegistry.layouts,
|
|
22
|
-
...userRegistry?.layouts
|
|
23
|
-
},
|
|
24
|
-
custom: {
|
|
25
|
-
...defaultComponentRegistry.custom,
|
|
26
|
-
...userRegistry?.custom
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get component from registry by key
|
|
32
|
-
*/
|
|
33
|
-
function getComponent(registry, type, key) {
|
|
34
|
-
return registry[type]?.[key];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
export { defaultComponentRegistry, getComponent, mergeComponentRegistry };
|