@la-batcave/ui 3.1.2
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 +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { c as p } from "./_shared/utils-eGXXUFl7.js";
|
|
4
|
+
import * as m from "react";
|
|
5
|
+
import { P as d } from "./_shared/index-V-Ajw7Ac.js";
|
|
6
|
+
var f = "Separator", e = "horizontal", v = ["horizontal", "vertical"], s = m.forwardRef((r, o) => {
|
|
7
|
+
const { decorative: a, orientation: t = e, ...c } = r, i = u(t) ? t : e, l = a ? { role: "none" } : { "aria-orientation": i === "vertical" ? i : void 0, role: "separator" };
|
|
8
|
+
return /* @__PURE__ */ n(
|
|
9
|
+
d.div,
|
|
10
|
+
{
|
|
11
|
+
"data-orientation": i,
|
|
12
|
+
...l,
|
|
13
|
+
...c,
|
|
14
|
+
ref: o
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
s.displayName = f;
|
|
19
|
+
function u(r) {
|
|
20
|
+
return v.includes(r);
|
|
21
|
+
}
|
|
22
|
+
var h = s;
|
|
23
|
+
function T({
|
|
24
|
+
className: r,
|
|
25
|
+
orientation: o = "horizontal",
|
|
26
|
+
decorative: a = !0,
|
|
27
|
+
...t
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ n(
|
|
30
|
+
h,
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "separator",
|
|
33
|
+
decorative: a,
|
|
34
|
+
orientation: o,
|
|
35
|
+
className: p(
|
|
36
|
+
"shrink-0 bg-border",
|
|
37
|
+
o === "horizontal" ? "h-px w-full" : "w-px self-stretch",
|
|
38
|
+
r
|
|
39
|
+
),
|
|
40
|
+
...t
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
T as Separator
|
|
46
|
+
};
|
package/dist/Sheet.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
|
+
export interface SheetOverlayProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay> {
|
|
9
|
+
}
|
|
10
|
+
declare const SheetOverlay: React.ForwardRefExoticComponent<SheetOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const sheetVariants: (props?: ({
|
|
12
|
+
side?: "top" | "bottom" | "left" | "right" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
export interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
15
|
+
}
|
|
16
|
+
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
}
|
|
19
|
+
declare function SheetHeader({ className, ...props }: SheetHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export interface SheetFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
}
|
|
22
|
+
declare function SheetFooter({ className, ...props }: SheetFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export interface SheetTitleProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title> {
|
|
24
|
+
}
|
|
25
|
+
declare const SheetTitle: React.ForwardRefExoticComponent<SheetTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
26
|
+
export interface SheetDescriptionProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description> {
|
|
27
|
+
}
|
|
28
|
+
declare const SheetDescription: React.ForwardRefExoticComponent<SheetDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
29
|
+
export { Sheet, SheetTrigger, SheetClose, SheetPortal, SheetOverlay, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, sheetVariants, };
|
package/dist/Sheet.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { O as f, P as m, C as p, a as n, T as u, D as h, R as b, b as g } from "./_shared/index-DlSuDb9N.js";
|
|
5
|
+
import { c as x } from "./_shared/index-uPOYJZpG.js";
|
|
6
|
+
import { X as S } from "lucide-react";
|
|
7
|
+
import { c as s } from "./_shared/utils-eGXXUFl7.js";
|
|
8
|
+
const k = b, z = g, P = n, y = m, d = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
9
|
+
f,
|
|
10
|
+
{
|
|
11
|
+
ref: a,
|
|
12
|
+
className: s(
|
|
13
|
+
"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",
|
|
14
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
15
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
16
|
+
t
|
|
17
|
+
),
|
|
18
|
+
...e
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
d.displayName = "SheetOverlay";
|
|
22
|
+
const v = x(
|
|
23
|
+
"fixed z-50 flex flex-col gap-4 bg-card/95 backdrop-blur-lg border border-border shadow-lg transition-transform focus:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-300",
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
side: {
|
|
27
|
+
top: "inset-x-0 top-0 h-[320px] border-b data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top",
|
|
28
|
+
bottom: "inset-x-0 bottom-0 h-[320px] border-t data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom",
|
|
29
|
+
left: "inset-y-0 left-0 w-[320px] border-r data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left",
|
|
30
|
+
right: "inset-y-0 right-0 w-[320px] border-l data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
side: "right"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
), N = r.forwardRef(({ side: t = "right", className: e, children: a, ...l }, c) => /* @__PURE__ */ i(y, { children: [
|
|
38
|
+
/* @__PURE__ */ o(d, {}),
|
|
39
|
+
/* @__PURE__ */ i(
|
|
40
|
+
p,
|
|
41
|
+
{
|
|
42
|
+
ref: c,
|
|
43
|
+
className: s(v({ side: t }), e),
|
|
44
|
+
...l,
|
|
45
|
+
children: [
|
|
46
|
+
a,
|
|
47
|
+
/* @__PURE__ */ o(n, { className: "absolute right-4 top-4 w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring", children: /* @__PURE__ */ o(S, { size: 18 }) })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] }));
|
|
52
|
+
N.displayName = "SheetContent";
|
|
53
|
+
function V({ className: t, ...e }) {
|
|
54
|
+
return /* @__PURE__ */ o(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: s("flex flex-col gap-0.5 px-5 pt-5", t),
|
|
58
|
+
...e
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function F({ className: t, ...e }) {
|
|
63
|
+
return /* @__PURE__ */ o(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: s(
|
|
67
|
+
"flex items-center justify-end gap-2 py-4 px-5 mt-auto border-t border-border",
|
|
68
|
+
t
|
|
69
|
+
),
|
|
70
|
+
...e
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
const w = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
75
|
+
u,
|
|
76
|
+
{
|
|
77
|
+
ref: a,
|
|
78
|
+
className: s("text-base font-semibold text-foreground", t),
|
|
79
|
+
...e
|
|
80
|
+
}
|
|
81
|
+
));
|
|
82
|
+
w.displayName = "SheetTitle";
|
|
83
|
+
const R = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
84
|
+
h,
|
|
85
|
+
{
|
|
86
|
+
ref: a,
|
|
87
|
+
className: s("text-sm text-muted-foreground", t),
|
|
88
|
+
...e
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
R.displayName = "SheetDescription";
|
|
92
|
+
export {
|
|
93
|
+
k as Sheet,
|
|
94
|
+
P as SheetClose,
|
|
95
|
+
N as SheetContent,
|
|
96
|
+
R as SheetDescription,
|
|
97
|
+
F as SheetFooter,
|
|
98
|
+
V as SheetHeader,
|
|
99
|
+
d as SheetOverlay,
|
|
100
|
+
y as SheetPortal,
|
|
101
|
+
w as SheetTitle,
|
|
102
|
+
z as SheetTrigger,
|
|
103
|
+
v as sheetVariants
|
|
104
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface SidebarContextValue {
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
}
|
|
6
|
+
declare function useSidebar(): SidebarContextValue;
|
|
7
|
+
export interface SidebarLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Height offset for a fixed navbar above the sidebar (e.g. 56 for h-14).
|
|
10
|
+
* Controls `top` and `height` of the sidebar on desktop and mobile.
|
|
11
|
+
* @default 56
|
|
12
|
+
*/
|
|
13
|
+
navbarHeight?: number;
|
|
14
|
+
}
|
|
15
|
+
declare function SidebarLayout({ navbarHeight, className, children, ...props }: SidebarLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export interface SidebarTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
}
|
|
18
|
+
declare function SidebarTrigger({ className, ...props }: SidebarTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
20
|
+
/**
|
|
21
|
+
* Height offset matching the fixed navbar. Passed automatically
|
|
22
|
+
* when used inside SidebarLayout, but can be overridden.
|
|
23
|
+
* @default 56
|
|
24
|
+
*/
|
|
25
|
+
navbarHeight?: number;
|
|
26
|
+
}
|
|
27
|
+
declare function Sidebar({ navbarHeight, className, children, ...props }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface SidebarInsetProps extends React.HTMLAttributes<HTMLElement> {
|
|
29
|
+
/**
|
|
30
|
+
* Height offset matching the fixed navbar for top padding.
|
|
31
|
+
* @default 56
|
|
32
|
+
*/
|
|
33
|
+
navbarHeight?: number;
|
|
34
|
+
}
|
|
35
|
+
declare function SidebarInset({ navbarHeight, className, children, ...props }: SidebarInsetProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export interface SidebarHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
37
|
+
}
|
|
38
|
+
declare function SidebarHeader({ className, ...props }: SidebarHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export interface SidebarContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
}
|
|
41
|
+
declare function SidebarContent({ className, ...props }: SidebarContentProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export interface SidebarFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
}
|
|
44
|
+
declare function SidebarFooter({ className, ...props }: SidebarFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export interface SidebarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
46
|
+
/** Optional group label displayed above the items. */
|
|
47
|
+
label?: string;
|
|
48
|
+
}
|
|
49
|
+
declare function SidebarGroup({ label, className, children, ...props }: SidebarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export interface SidebarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
51
|
+
}
|
|
52
|
+
declare function SidebarSeparator({ className, ...props }: SidebarSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export interface SidebarItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
54
|
+
/** Icon component rendered before the label. */
|
|
55
|
+
icon?: React.ComponentType<{
|
|
56
|
+
size?: number;
|
|
57
|
+
className?: string;
|
|
58
|
+
}>;
|
|
59
|
+
/** Whether this item is currently active. */
|
|
60
|
+
active?: boolean;
|
|
61
|
+
/** Optional badge or indicator rendered on the right side. */
|
|
62
|
+
badge?: React.ReactNode;
|
|
63
|
+
/** Render as the child element (e.g., NavLink, anchor). @default false */
|
|
64
|
+
asChild?: boolean;
|
|
65
|
+
}
|
|
66
|
+
declare function SidebarItem({ icon: Icon, active, badge, asChild, className, children, ...props }: SidebarItemProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export interface EasySidebarItem {
|
|
68
|
+
/** Unique key for this item. */
|
|
69
|
+
key: string;
|
|
70
|
+
/** Display label. */
|
|
71
|
+
label: string;
|
|
72
|
+
/** Icon component. */
|
|
73
|
+
icon?: React.ComponentType<{
|
|
74
|
+
size?: number;
|
|
75
|
+
className?: string;
|
|
76
|
+
}>;
|
|
77
|
+
/** Navigation href. Used with renderLink or as a plain <a>. */
|
|
78
|
+
href?: string;
|
|
79
|
+
/** Badge content rendered on the right side (string, number, or ReactNode). */
|
|
80
|
+
badge?: React.ReactNode;
|
|
81
|
+
/** Whether this item is currently active. */
|
|
82
|
+
active?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface EasySidebarGroup {
|
|
85
|
+
/** Group label displayed above the items. */
|
|
86
|
+
label?: string;
|
|
87
|
+
/** Items in this group. */
|
|
88
|
+
items: EasySidebarItem[];
|
|
89
|
+
}
|
|
90
|
+
export type EasySidebarEntry = EasySidebarItem | EasySidebarGroup | "separator";
|
|
91
|
+
export interface EasySidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
92
|
+
/** Sidebar entries: items, groups, or "separator" strings. */
|
|
93
|
+
items: EasySidebarEntry[];
|
|
94
|
+
/** Header content rendered above the navigation. */
|
|
95
|
+
header?: React.ReactNode;
|
|
96
|
+
/** Footer content rendered below the navigation. */
|
|
97
|
+
footer?: React.ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* Custom link renderer. Receives the item and must return a single element.
|
|
100
|
+
* Used to integrate with react-router NavLink, Next.js Link, etc.
|
|
101
|
+
* When provided, SidebarItem renders with asChild, merging its props onto
|
|
102
|
+
* the element you return.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* renderLink={(item) => <NavLink to={item.href}>{item.label}</NavLink>}
|
|
106
|
+
*/
|
|
107
|
+
renderLink?: (item: EasySidebarItem) => React.ReactElement;
|
|
108
|
+
/** Callback when an item is clicked. Receives the item key. */
|
|
109
|
+
onNavigate?: (key: string) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Height offset matching the fixed navbar.
|
|
112
|
+
* @default 56
|
|
113
|
+
*/
|
|
114
|
+
navbarHeight?: number;
|
|
115
|
+
}
|
|
116
|
+
declare function EasySidebar({ items, header, footer, renderLink, onNavigate, navbarHeight, className, ...props }: EasySidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
117
|
+
export { SidebarLayout, SidebarTrigger, Sidebar, SidebarInset, SidebarHeader, SidebarContent, SidebarFooter, SidebarGroup, SidebarSeparator, SidebarItem, EasySidebar, useSidebar, };
|
package/dist/Sidebar.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as f, jsx as r, Fragment as S } from "react/jsx-runtime";
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import { S as k, a as N } from "./_shared/index-BrLJJgkl.js";
|
|
5
|
+
import { X as y, Menu as C } from "lucide-react";
|
|
6
|
+
import { c as i } from "./_shared/utils-eGXXUFl7.js";
|
|
7
|
+
const v = m.createContext({
|
|
8
|
+
open: !1,
|
|
9
|
+
setOpen: () => {
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function x() {
|
|
13
|
+
return m.useContext(v);
|
|
14
|
+
}
|
|
15
|
+
function P({
|
|
16
|
+
navbarHeight: e = 56,
|
|
17
|
+
className: n,
|
|
18
|
+
children: a,
|
|
19
|
+
...o
|
|
20
|
+
}) {
|
|
21
|
+
const [s, c] = m.useState(!1);
|
|
22
|
+
return /* @__PURE__ */ r(v.Provider, { value: { open: s, setOpen: c }, children: /* @__PURE__ */ r(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: i("relative flex min-h-screen", n),
|
|
26
|
+
...o,
|
|
27
|
+
children: a
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
}
|
|
31
|
+
function R({ className: e, ...n }) {
|
|
32
|
+
const { open: a, setOpen: o } = x();
|
|
33
|
+
return /* @__PURE__ */ r(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
className: i(
|
|
38
|
+
"inline-flex items-center justify-center w-8 h-8 rounded-md",
|
|
39
|
+
"text-muted-foreground hover:text-foreground hover:bg-muted",
|
|
40
|
+
"transition-colors cursor-pointer md:hidden",
|
|
41
|
+
e
|
|
42
|
+
),
|
|
43
|
+
onClick: () => o((s) => !s),
|
|
44
|
+
...n,
|
|
45
|
+
children: a ? /* @__PURE__ */ r(y, { size: 18 }) : /* @__PURE__ */ r(C, { size: 18 })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function w({ navbarHeight: e = 56, className: n, children: a, ...o }) {
|
|
50
|
+
const { open: s, setOpen: c } = x();
|
|
51
|
+
return /* @__PURE__ */ f(S, { children: [
|
|
52
|
+
s && /* @__PURE__ */ r(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "fixed inset-0 z-30 bg-black/50 md:hidden",
|
|
56
|
+
onClick: () => c(!1)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: i(
|
|
63
|
+
"fixed left-0 z-30 w-[220px] transition-transform duration-200",
|
|
64
|
+
"md:sticky md:translate-x-0 md:shrink-0",
|
|
65
|
+
s ? "translate-x-0" : "-translate-x-full"
|
|
66
|
+
),
|
|
67
|
+
style: {
|
|
68
|
+
top: e,
|
|
69
|
+
height: `calc(100vh - ${e}px)`
|
|
70
|
+
},
|
|
71
|
+
children: /* @__PURE__ */ r(
|
|
72
|
+
"aside",
|
|
73
|
+
{
|
|
74
|
+
className: i(
|
|
75
|
+
"flex flex-col h-full bg-card border-r border-border w-full",
|
|
76
|
+
n
|
|
77
|
+
),
|
|
78
|
+
...o,
|
|
79
|
+
children: a
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
function X({ navbarHeight: e = 56, className: n, children: a, ...o }) {
|
|
87
|
+
return /* @__PURE__ */ r(
|
|
88
|
+
"main",
|
|
89
|
+
{
|
|
90
|
+
className: i("flex-1 min-w-0", n),
|
|
91
|
+
style: { paddingTop: e },
|
|
92
|
+
...o,
|
|
93
|
+
children: a
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function z({ className: e, ...n }) {
|
|
98
|
+
return /* @__PURE__ */ r(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: i("px-3 py-3 shrink-0", e),
|
|
102
|
+
...n
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function O({ className: e, ...n }) {
|
|
107
|
+
return /* @__PURE__ */ r(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
className: i("flex-1 overflow-y-auto py-1 px-2 flex flex-col gap-2", e),
|
|
111
|
+
...n
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function j({ className: e, ...n }) {
|
|
116
|
+
return /* @__PURE__ */ r(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: i("px-2 py-2 shrink-0 border-t border-border", e),
|
|
120
|
+
...n
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
function E({ label: e, className: n, children: a, ...o }) {
|
|
125
|
+
return /* @__PURE__ */ f("div", { className: i("flex flex-col gap-0.5", n), ...o, children: [
|
|
126
|
+
e && /* @__PURE__ */ r("span", { className: "px-3 py-1.5 text-[0.6875rem] font-semibold uppercase tracking-wider text-muted-foreground", children: e }),
|
|
127
|
+
a
|
|
128
|
+
] });
|
|
129
|
+
}
|
|
130
|
+
function $({ className: e, ...n }) {
|
|
131
|
+
return /* @__PURE__ */ r(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: i("mx-2 my-2 h-px bg-border", e),
|
|
135
|
+
...n
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
function b({
|
|
140
|
+
icon: e,
|
|
141
|
+
active: n,
|
|
142
|
+
badge: a,
|
|
143
|
+
asChild: o,
|
|
144
|
+
className: s,
|
|
145
|
+
children: c,
|
|
146
|
+
...d
|
|
147
|
+
}) {
|
|
148
|
+
const p = o ? k : "button", { setOpen: u } = x(), h = (t) => {
|
|
149
|
+
u(!1), d.onClick && d.onClick(t);
|
|
150
|
+
};
|
|
151
|
+
return /* @__PURE__ */ f(
|
|
152
|
+
p,
|
|
153
|
+
{
|
|
154
|
+
"data-active": n || void 0,
|
|
155
|
+
className: i(
|
|
156
|
+
"flex items-center gap-2.5 w-full px-3 py-2 text-[0.8125rem] font-medium rounded-md transition-all duration-150 cursor-pointer",
|
|
157
|
+
"border-none bg-transparent text-left",
|
|
158
|
+
n ? "bg-primary/15 text-primary" : "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
159
|
+
s
|
|
160
|
+
),
|
|
161
|
+
...d,
|
|
162
|
+
onClick: h,
|
|
163
|
+
children: [
|
|
164
|
+
e && /* @__PURE__ */ r(e, { size: 16, className: "shrink-0" }),
|
|
165
|
+
o ? /* @__PURE__ */ r(N, { children: c }) : /* @__PURE__ */ r("span", { className: "flex-1 truncate", children: c }),
|
|
166
|
+
a && /* @__PURE__ */ r("span", { className: "shrink-0", children: a })
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
function F(e) {
|
|
172
|
+
return typeof e == "object" && "items" in e;
|
|
173
|
+
}
|
|
174
|
+
function G(e) {
|
|
175
|
+
return e === "separator";
|
|
176
|
+
}
|
|
177
|
+
function q({
|
|
178
|
+
items: e,
|
|
179
|
+
header: n,
|
|
180
|
+
footer: a,
|
|
181
|
+
renderLink: o,
|
|
182
|
+
onNavigate: s,
|
|
183
|
+
navbarHeight: c = 56,
|
|
184
|
+
className: d,
|
|
185
|
+
...p
|
|
186
|
+
}) {
|
|
187
|
+
const u = (t) => o ? /* @__PURE__ */ r(
|
|
188
|
+
b,
|
|
189
|
+
{
|
|
190
|
+
icon: t.icon,
|
|
191
|
+
active: t.active,
|
|
192
|
+
badge: t.badge,
|
|
193
|
+
asChild: !0,
|
|
194
|
+
children: o(t)
|
|
195
|
+
},
|
|
196
|
+
t.key
|
|
197
|
+
) : t.href ? /* @__PURE__ */ r(
|
|
198
|
+
b,
|
|
199
|
+
{
|
|
200
|
+
icon: t.icon,
|
|
201
|
+
active: t.active,
|
|
202
|
+
badge: t.badge,
|
|
203
|
+
asChild: !0,
|
|
204
|
+
children: /* @__PURE__ */ r("a", { href: t.href, children: t.label })
|
|
205
|
+
},
|
|
206
|
+
t.key
|
|
207
|
+
) : /* @__PURE__ */ r(
|
|
208
|
+
b,
|
|
209
|
+
{
|
|
210
|
+
icon: t.icon,
|
|
211
|
+
active: t.active,
|
|
212
|
+
badge: t.badge,
|
|
213
|
+
onClick: () => s?.(t.key),
|
|
214
|
+
children: t.label
|
|
215
|
+
},
|
|
216
|
+
t.key
|
|
217
|
+
);
|
|
218
|
+
return /* @__PURE__ */ f(w, { navbarHeight: c, className: d, ...p, children: [
|
|
219
|
+
n && /* @__PURE__ */ r(z, { children: n }),
|
|
220
|
+
/* @__PURE__ */ r(O, { children: ((t) => t.map((l, g) => G(l) ? /* @__PURE__ */ r($, {}, `sep-${g}`) : F(l) ? /* @__PURE__ */ r(E, { label: l.label, children: l.items.map(u) }, l.label || `group-${g}`) : u(l)))(e) }),
|
|
221
|
+
a && /* @__PURE__ */ r(j, { children: a })
|
|
222
|
+
] });
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
q as EasySidebar,
|
|
226
|
+
w as Sidebar,
|
|
227
|
+
O as SidebarContent,
|
|
228
|
+
j as SidebarFooter,
|
|
229
|
+
E as SidebarGroup,
|
|
230
|
+
z as SidebarHeader,
|
|
231
|
+
X as SidebarInset,
|
|
232
|
+
b as SidebarItem,
|
|
233
|
+
P as SidebarLayout,
|
|
234
|
+
$ as SidebarSeparator,
|
|
235
|
+
R as SidebarTrigger,
|
|
236
|
+
x as useSidebar
|
|
237
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Animated placeholder for loading states. Renders a pulsing rounded
|
|
6
|
+
* rectangle that fills its container width by default.
|
|
7
|
+
*
|
|
8
|
+
* @description Use width/height via className or inline style to control size.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <Skeleton className="h-4 w-48" />
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Skeleton className="h-12 w-full" />
|
|
15
|
+
*/
|
|
16
|
+
declare function Skeleton({ className, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface SkeletonTextProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/**
|
|
19
|
+
* Number of text lines to render.
|
|
20
|
+
* @default 3
|
|
21
|
+
*/
|
|
22
|
+
lines?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Gap between lines.
|
|
25
|
+
* @default "gap-2"
|
|
26
|
+
*/
|
|
27
|
+
gap?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Multiple skeleton lines simulating a block of text.
|
|
31
|
+
* The last line is rendered shorter (75% width) for a natural look.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <SkeletonText lines={4} />
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* <SkeletonText lines={2} className="max-w-sm" />
|
|
38
|
+
*/
|
|
39
|
+
declare function SkeletonText({ lines, gap, className, ...props }: SkeletonTextProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export interface SkeletonCircleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
/**
|
|
42
|
+
* Diameter of the circle in Tailwind size class (e.g. "size-10").
|
|
43
|
+
* @default "size-10"
|
|
44
|
+
*/
|
|
45
|
+
size?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Circular skeleton placeholder, useful for avatar or icon placeholders.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* <SkeletonCircle />
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* <SkeletonCircle size="size-16" />
|
|
55
|
+
*/
|
|
56
|
+
declare function SkeletonCircle({ size, className, ...props }: SkeletonCircleProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export { Skeleton, SkeletonText, SkeletonCircle };
|
package/dist/Skeleton.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "./_shared/utils-eGXXUFl7.js";
|
|
3
|
+
function m({ className: e, ...r }) {
|
|
4
|
+
return /* @__PURE__ */ t(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: n("animate-pulse rounded-md bg-muted", e),
|
|
8
|
+
...r
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
function s({
|
|
13
|
+
lines: e = 3,
|
|
14
|
+
gap: r,
|
|
15
|
+
className: a,
|
|
16
|
+
...o
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ t("div", { className: n("flex flex-col", r || "gap-2", a), ...o, children: Array.from({ length: e }, (u, l) => /* @__PURE__ */ t(
|
|
19
|
+
m,
|
|
20
|
+
{
|
|
21
|
+
className: n("h-3.5", l === e - 1 && e > 1 && "w-3/4")
|
|
22
|
+
},
|
|
23
|
+
l
|
|
24
|
+
)) });
|
|
25
|
+
}
|
|
26
|
+
function i({
|
|
27
|
+
size: e,
|
|
28
|
+
className: r,
|
|
29
|
+
...a
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ t(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: n(
|
|
35
|
+
"animate-pulse rounded-full bg-muted",
|
|
36
|
+
e || "size-10",
|
|
37
|
+
r
|
|
38
|
+
),
|
|
39
|
+
...a
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
m as Skeleton,
|
|
45
|
+
i as SkeletonCircle,
|
|
46
|
+
s as SkeletonText
|
|
47
|
+
};
|