@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,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Available log severity levels. */
|
|
3
|
+
export type LogLevel = "info" | "warn" | "error" | "debug";
|
|
4
|
+
export interface LogLineProps {
|
|
5
|
+
/** Severity level controlling the badge color. @default "info" */
|
|
6
|
+
level?: LogLevel;
|
|
7
|
+
/** Timestamp string displayed after the level badge. */
|
|
8
|
+
time?: string;
|
|
9
|
+
/** Log message content. */
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Additional CSS classes. */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LogEntry {
|
|
15
|
+
/** Severity level. @default "info" */
|
|
16
|
+
level?: LogLevel;
|
|
17
|
+
/** Timestamp string. */
|
|
18
|
+
time?: string;
|
|
19
|
+
/** Log message. */
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export interface LogViewerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
/** Array of log entries to display. */
|
|
24
|
+
logs: LogEntry[];
|
|
25
|
+
/** Maximum height before scrolling. @default "400px" */
|
|
26
|
+
maxHeight?: string | number;
|
|
27
|
+
/** Show filter badges by log level. @default true */
|
|
28
|
+
filterable?: boolean;
|
|
29
|
+
/** Auto-scroll to the bottom when new logs are added. @default true */
|
|
30
|
+
autoScroll?: boolean;
|
|
31
|
+
/** Title displayed in the header. */
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Single log entry line with a colored level badge, optional timestamp,
|
|
36
|
+
* and a copy button on hover.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <LogLine level="error" time="12:34:56">Connection refused</LogLine>
|
|
40
|
+
*/
|
|
41
|
+
declare function LogLine({ level, time, children, className }: LogLineProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* Log viewer with level filtering, auto-scroll, and Card styling.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <LogViewer
|
|
47
|
+
* title="Server Logs"
|
|
48
|
+
* logs={[
|
|
49
|
+
* { level: 'info', time: '22:52:50', message: 'Server started' },
|
|
50
|
+
* { level: 'error', time: '22:56:01', message: 'Connection timeout' },
|
|
51
|
+
* ]}
|
|
52
|
+
* filterable
|
|
53
|
+
* autoScroll
|
|
54
|
+
* />
|
|
55
|
+
*/
|
|
56
|
+
declare function LogViewer({ logs, maxHeight, filterable, autoScroll, title, className, ...props }: LogViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export { LogLine, LogViewer };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import { useState as v } from "react";
|
|
5
|
+
import { c as f } from "./_shared/utils-eGXXUFl7.js";
|
|
6
|
+
import { Check as w, Copy as y } from "lucide-react";
|
|
7
|
+
const N = {
|
|
8
|
+
info: "bg-info/15 text-info",
|
|
9
|
+
warn: "bg-warning/15 text-warning",
|
|
10
|
+
error: "bg-destructive/15 text-destructive",
|
|
11
|
+
debug: "bg-muted text-muted-foreground"
|
|
12
|
+
};
|
|
13
|
+
function C({ level: t = "info", time: n, children: s, className: l }) {
|
|
14
|
+
const [a, d] = u.useState(!1), b = () => {
|
|
15
|
+
const o = [t.toUpperCase(), n, typeof s == "string" ? s : ""].filter(Boolean).join(" ");
|
|
16
|
+
navigator.clipboard.writeText(o), d(!0), setTimeout(() => d(!1), 1500);
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ p(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: f(
|
|
22
|
+
"group relative flex items-baseline gap-3 px-3 py-1.5 font-mono text-xs transition-colors hover:bg-primary/8",
|
|
23
|
+
l
|
|
24
|
+
),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
className: f(
|
|
30
|
+
"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-bold uppercase shrink-0",
|
|
31
|
+
N[t]
|
|
32
|
+
),
|
|
33
|
+
children: t.toUpperCase()
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
n && /* @__PURE__ */ r("span", { className: "text-muted-foreground shrink-0", children: n }),
|
|
37
|
+
/* @__PURE__ */ r("span", { className: "text-foreground flex-1", children: s }),
|
|
38
|
+
/* @__PURE__ */ r(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
type: "button",
|
|
42
|
+
onClick: b,
|
|
43
|
+
className: "opacity-0 group-hover:opacity-100 shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-opacity cursor-pointer bg-transparent border-none",
|
|
44
|
+
children: a ? /* @__PURE__ */ r(w, { size: 12, className: "text-success" }) : /* @__PURE__ */ r(y, { size: 12 })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function B({
|
|
52
|
+
logs: t,
|
|
53
|
+
maxHeight: n = "400px",
|
|
54
|
+
filterable: s = !0,
|
|
55
|
+
autoScroll: l = !0,
|
|
56
|
+
title: a,
|
|
57
|
+
className: d,
|
|
58
|
+
...b
|
|
59
|
+
}) {
|
|
60
|
+
const [o, g] = v("all"), c = u.useRef(null), x = u.useMemo(() => {
|
|
61
|
+
const e = { all: t.length, info: 0, warn: 0, error: 0, debug: 0 };
|
|
62
|
+
for (const i of t)
|
|
63
|
+
e[i.level || "info"]++;
|
|
64
|
+
return e;
|
|
65
|
+
}, [t]), m = o === "all" ? t : t.filter((e) => (e.level || "info") === o);
|
|
66
|
+
u.useEffect(() => {
|
|
67
|
+
l && c.current && (c.current.scrollTop = c.current.scrollHeight);
|
|
68
|
+
}, [t, l, o]);
|
|
69
|
+
const h = [
|
|
70
|
+
{ key: "all", label: "ALL" },
|
|
71
|
+
{ key: "info", label: "INFO" },
|
|
72
|
+
{ key: "warn", label: "WARN" },
|
|
73
|
+
{ key: "error", label: "ERROR" },
|
|
74
|
+
{ key: "debug", label: "DEBUG" }
|
|
75
|
+
];
|
|
76
|
+
return /* @__PURE__ */ p(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: f(
|
|
80
|
+
"rounded-xl border border-border bg-card overflow-hidden",
|
|
81
|
+
d
|
|
82
|
+
),
|
|
83
|
+
...b,
|
|
84
|
+
children: [
|
|
85
|
+
(a || s) && /* @__PURE__ */ p("div", { className: "flex items-center justify-between gap-3 px-4 py-3 border-b border-border", children: [
|
|
86
|
+
a && /* @__PURE__ */ r("span", { className: "text-sm font-medium text-foreground", children: a }),
|
|
87
|
+
s && /* @__PURE__ */ r("div", { className: "flex gap-1.5 flex-wrap", children: h.map(({ key: e, label: i }) => /* @__PURE__ */ p(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
onClick: () => g(e),
|
|
92
|
+
className: f(
|
|
93
|
+
"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wide transition-all cursor-pointer border",
|
|
94
|
+
e === "all" ? "text-primary" + (o === e ? " bg-primary/15 border-primary/30" : " border-transparent hover:bg-primary/10") : e === "info" ? "text-info" + (o === e ? " bg-info/15 border-info/30" : " border-transparent hover:bg-info/10") : e === "warn" ? "text-warning" + (o === e ? " bg-warning/15 border-warning/30" : " border-transparent hover:bg-warning/10") : e === "error" ? "text-destructive" + (o === e ? " bg-destructive/15 border-destructive/30" : " border-transparent hover:bg-destructive/10") : "text-muted-foreground" + (o === e ? " bg-muted border-border" : " border-transparent hover:bg-muted")
|
|
95
|
+
),
|
|
96
|
+
children: [
|
|
97
|
+
i,
|
|
98
|
+
/* @__PURE__ */ r("span", { className: "font-mono", children: x[e] })
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
e
|
|
102
|
+
)) })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ r(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
ref: c,
|
|
108
|
+
className: "overflow-y-auto bg-muted/30",
|
|
109
|
+
style: { maxHeight: typeof n == "number" ? `${n}px` : n },
|
|
110
|
+
children: m.length === 0 ? /* @__PURE__ */ r("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: "Aucun log" }) : m.map((e, i) => /* @__PURE__ */ r(C, { level: e.level, time: e.time, children: e.message }, i))
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
C as LogLine,
|
|
119
|
+
B as LogViewer
|
|
120
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
3
|
+
export interface MenubarProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root> {
|
|
4
|
+
}
|
|
5
|
+
declare const Menubar: React.ForwardRefExoticComponent<MenubarProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const MenubarMenu: {
|
|
7
|
+
(props: MenubarPrimitive.MenubarMenuProps & {
|
|
8
|
+
__scopeMenubar?: import("@radix-ui/react-context").Scope;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export interface MenubarTriggerProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger> {
|
|
13
|
+
}
|
|
14
|
+
declare const MenubarTrigger: React.ForwardRefExoticComponent<MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export interface MenubarContentProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content> {
|
|
16
|
+
}
|
|
17
|
+
declare const MenubarContent: React.ForwardRefExoticComponent<MenubarContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export interface MenubarItemProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> {
|
|
19
|
+
/** When true, applies destructive (red) styling. @default false */
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const MenubarItem: React.ForwardRefExoticComponent<MenubarItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export interface MenubarSeparatorProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator> {
|
|
24
|
+
}
|
|
25
|
+
declare const MenubarSeparator: React.ForwardRefExoticComponent<MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export interface MenubarLabelProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> {
|
|
27
|
+
/** Add left indent to align with items that have icons. @default false */
|
|
28
|
+
inset?: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare const MenubarLabel: React.ForwardRefExoticComponent<MenubarLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const MenubarGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarGroup, };
|
package/dist/Menubar.js
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { u as W, R as X, I as Y, c as O, a as q } from "./_shared/index-C0gNQvxa.js";
|
|
5
|
+
import { u as J, c as v, a as Q } from "./_shared/index-CXeb1OMI.js";
|
|
6
|
+
import { u as Z } from "./_shared/index-DLcqcWxM.js";
|
|
7
|
+
import { u as y } from "./_shared/index-BC7vfx-u.js";
|
|
8
|
+
import { A as ee, P as re, C as ae, I as ne, S as oe, L as te, c as se, G as ue, R as ie, a as ce, b as de, d as le, e as pe, f as be, g as me, h as fe } from "./_shared/index-CukUn3R0.js";
|
|
9
|
+
import { P as G } from "./_shared/index-V-Ajw7Ac.js";
|
|
10
|
+
import { c as R } from "./_shared/utils-eGXXUFl7.js";
|
|
11
|
+
var _ = "Menubar", [I, ge, Me] = q(_), [D] = Q(_, [
|
|
12
|
+
Me,
|
|
13
|
+
O
|
|
14
|
+
]), d = se(), k = O(), [ve, S] = D(_), K = s.forwardRef(
|
|
15
|
+
(e, a) => {
|
|
16
|
+
const {
|
|
17
|
+
__scopeMenubar: r,
|
|
18
|
+
value: n,
|
|
19
|
+
onValueChange: o,
|
|
20
|
+
defaultValue: h,
|
|
21
|
+
loop: p = !0,
|
|
22
|
+
dir: c,
|
|
23
|
+
...i
|
|
24
|
+
} = e, b = W(c), u = k(r), [f, m] = J({
|
|
25
|
+
prop: n,
|
|
26
|
+
onChange: o,
|
|
27
|
+
defaultProp: h ?? "",
|
|
28
|
+
caller: _
|
|
29
|
+
}), [g, l] = s.useState(null);
|
|
30
|
+
return /* @__PURE__ */ t(
|
|
31
|
+
ve,
|
|
32
|
+
{
|
|
33
|
+
scope: r,
|
|
34
|
+
value: f,
|
|
35
|
+
onMenuOpen: s.useCallback(
|
|
36
|
+
(M) => {
|
|
37
|
+
m(M), l(M);
|
|
38
|
+
},
|
|
39
|
+
[m]
|
|
40
|
+
),
|
|
41
|
+
onMenuClose: s.useCallback(() => m(""), [m]),
|
|
42
|
+
onMenuToggle: s.useCallback(
|
|
43
|
+
(M) => {
|
|
44
|
+
m((P) => P ? "" : M), l(M);
|
|
45
|
+
},
|
|
46
|
+
[m]
|
|
47
|
+
),
|
|
48
|
+
dir: b,
|
|
49
|
+
loop: p,
|
|
50
|
+
children: /* @__PURE__ */ t(I.Provider, { scope: r, children: /* @__PURE__ */ t(I.Slot, { scope: r, children: /* @__PURE__ */ t(
|
|
51
|
+
X,
|
|
52
|
+
{
|
|
53
|
+
asChild: !0,
|
|
54
|
+
...u,
|
|
55
|
+
orientation: "horizontal",
|
|
56
|
+
loop: p,
|
|
57
|
+
dir: b,
|
|
58
|
+
currentTabStopId: g,
|
|
59
|
+
onCurrentTabStopIdChange: l,
|
|
60
|
+
children: /* @__PURE__ */ t(G.div, { role: "menubar", ...i, ref: a })
|
|
61
|
+
}
|
|
62
|
+
) }) })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
K.displayName = _;
|
|
68
|
+
var A = "MenubarMenu", [he, F] = D(A), L = (e) => {
|
|
69
|
+
const { __scopeMenubar: a, value: r, ...n } = e, o = y(), h = r || o || "LEGACY_REACT_AUTO_VALUE", p = S(A, a), c = d(a), i = s.useRef(null), b = s.useRef(!1), u = p.value === h;
|
|
70
|
+
return s.useEffect(() => {
|
|
71
|
+
u || (b.current = !1);
|
|
72
|
+
}, [u]), /* @__PURE__ */ t(
|
|
73
|
+
he,
|
|
74
|
+
{
|
|
75
|
+
scope: a,
|
|
76
|
+
value: h,
|
|
77
|
+
triggerId: y(),
|
|
78
|
+
triggerRef: i,
|
|
79
|
+
contentId: y(),
|
|
80
|
+
wasKeyboardTriggerOpenRef: b,
|
|
81
|
+
children: /* @__PURE__ */ t(
|
|
82
|
+
ie,
|
|
83
|
+
{
|
|
84
|
+
...c,
|
|
85
|
+
open: u,
|
|
86
|
+
onOpenChange: (f) => {
|
|
87
|
+
f || p.onMenuClose();
|
|
88
|
+
},
|
|
89
|
+
modal: !1,
|
|
90
|
+
dir: p.dir,
|
|
91
|
+
...n
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
L.displayName = A;
|
|
98
|
+
var N = "MenubarTrigger", $ = s.forwardRef(
|
|
99
|
+
(e, a) => {
|
|
100
|
+
const { __scopeMenubar: r, disabled: n = !1, ...o } = e, h = k(r), p = d(r), c = S(N, r), i = F(N, r), b = s.useRef(null), u = Z(a, b, i.triggerRef), [f, m] = s.useState(!1), g = c.value === i.value;
|
|
101
|
+
return /* @__PURE__ */ t(I.ItemSlot, { scope: r, value: i.value, disabled: n, children: /* @__PURE__ */ t(
|
|
102
|
+
Y,
|
|
103
|
+
{
|
|
104
|
+
asChild: !0,
|
|
105
|
+
...h,
|
|
106
|
+
focusable: !n,
|
|
107
|
+
tabStopId: i.value,
|
|
108
|
+
children: /* @__PURE__ */ t(ee, { asChild: !0, ...p, children: /* @__PURE__ */ t(
|
|
109
|
+
G.button,
|
|
110
|
+
{
|
|
111
|
+
type: "button",
|
|
112
|
+
role: "menuitem",
|
|
113
|
+
id: i.triggerId,
|
|
114
|
+
"aria-haspopup": "menu",
|
|
115
|
+
"aria-expanded": g,
|
|
116
|
+
"aria-controls": g ? i.contentId : void 0,
|
|
117
|
+
"data-highlighted": f ? "" : void 0,
|
|
118
|
+
"data-state": g ? "open" : "closed",
|
|
119
|
+
"data-disabled": n ? "" : void 0,
|
|
120
|
+
disabled: n,
|
|
121
|
+
...o,
|
|
122
|
+
ref: u,
|
|
123
|
+
onPointerDown: v(e.onPointerDown, (l) => {
|
|
124
|
+
!n && l.button === 0 && l.ctrlKey === !1 && (c.onMenuOpen(i.value), g || l.preventDefault());
|
|
125
|
+
}),
|
|
126
|
+
onPointerEnter: v(e.onPointerEnter, () => {
|
|
127
|
+
c.value && !g && (c.onMenuOpen(i.value), b.current?.focus());
|
|
128
|
+
}),
|
|
129
|
+
onKeyDown: v(e.onKeyDown, (l) => {
|
|
130
|
+
n || (["Enter", " "].includes(l.key) && c.onMenuToggle(i.value), l.key === "ArrowDown" && c.onMenuOpen(i.value), ["Enter", " ", "ArrowDown"].includes(l.key) && (i.wasKeyboardTriggerOpenRef.current = !0, l.preventDefault()));
|
|
131
|
+
}),
|
|
132
|
+
onFocus: v(e.onFocus, () => m(!0)),
|
|
133
|
+
onBlur: v(e.onBlur, () => m(!1))
|
|
134
|
+
}
|
|
135
|
+
) })
|
|
136
|
+
}
|
|
137
|
+
) });
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
$.displayName = N;
|
|
141
|
+
var xe = "MenubarPortal", B = (e) => {
|
|
142
|
+
const { __scopeMenubar: a, ...r } = e, n = d(a);
|
|
143
|
+
return /* @__PURE__ */ t(re, { ...n, ...r });
|
|
144
|
+
};
|
|
145
|
+
B.displayName = xe;
|
|
146
|
+
var C = "MenubarContent", U = s.forwardRef(
|
|
147
|
+
(e, a) => {
|
|
148
|
+
const { __scopeMenubar: r, align: n = "start", ...o } = e, h = d(r), p = S(C, r), c = F(C, r), i = ge(r), b = s.useRef(!1);
|
|
149
|
+
return /* @__PURE__ */ t(
|
|
150
|
+
ae,
|
|
151
|
+
{
|
|
152
|
+
id: c.contentId,
|
|
153
|
+
"aria-labelledby": c.triggerId,
|
|
154
|
+
"data-radix-menubar-content": "",
|
|
155
|
+
...h,
|
|
156
|
+
...o,
|
|
157
|
+
ref: a,
|
|
158
|
+
align: n,
|
|
159
|
+
onCloseAutoFocus: v(e.onCloseAutoFocus, (u) => {
|
|
160
|
+
!p.value && !b.current && c.triggerRef.current?.focus(), b.current = !1, u.preventDefault();
|
|
161
|
+
}),
|
|
162
|
+
onFocusOutside: v(e.onFocusOutside, (u) => {
|
|
163
|
+
const f = u.target;
|
|
164
|
+
i().some((g) => g.ref.current?.contains(f)) && u.preventDefault();
|
|
165
|
+
}),
|
|
166
|
+
onInteractOutside: v(e.onInteractOutside, () => {
|
|
167
|
+
b.current = !0;
|
|
168
|
+
}),
|
|
169
|
+
onEntryFocus: (u) => {
|
|
170
|
+
c.wasKeyboardTriggerOpenRef.current || u.preventDefault();
|
|
171
|
+
},
|
|
172
|
+
onKeyDown: v(
|
|
173
|
+
e.onKeyDown,
|
|
174
|
+
(u) => {
|
|
175
|
+
if (["ArrowRight", "ArrowLeft"].includes(u.key)) {
|
|
176
|
+
const f = u.target, m = f.hasAttribute("data-radix-menubar-subtrigger"), g = f.closest("[data-radix-menubar-content]") !== u.currentTarget, M = (p.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === u.key;
|
|
177
|
+
if (!M && m || g && M) return;
|
|
178
|
+
let x = i().filter((w) => !w.disabled).map((w) => w.value);
|
|
179
|
+
M && x.reverse();
|
|
180
|
+
const E = x.indexOf(c.value);
|
|
181
|
+
x = p.loop ? Le(x, E + 1) : x.slice(E + 1);
|
|
182
|
+
const [T] = x;
|
|
183
|
+
T && p.onMenuOpen(T);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{ checkForDefaultPrevented: !1 }
|
|
187
|
+
),
|
|
188
|
+
style: {
|
|
189
|
+
...e.style,
|
|
190
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
191
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
192
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
193
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
194
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
U.displayName = C;
|
|
201
|
+
var Re = "MenubarGroup", V = s.forwardRef(
|
|
202
|
+
(e, a) => {
|
|
203
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
204
|
+
return /* @__PURE__ */ t(ue, { ...o, ...n, ref: a });
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
V.displayName = Re;
|
|
208
|
+
var _e = "MenubarLabel", z = s.forwardRef(
|
|
209
|
+
(e, a) => {
|
|
210
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
211
|
+
return /* @__PURE__ */ t(te, { ...o, ...n, ref: a });
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
z.displayName = _e;
|
|
215
|
+
var we = "MenubarItem", H = s.forwardRef(
|
|
216
|
+
(e, a) => {
|
|
217
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
218
|
+
return /* @__PURE__ */ t(ne, { ...o, ...n, ref: a });
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
H.displayName = we;
|
|
222
|
+
var ye = "MenubarCheckboxItem", Ie = s.forwardRef(
|
|
223
|
+
(e, a) => {
|
|
224
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
225
|
+
return /* @__PURE__ */ t(ce, { ...o, ...n, ref: a });
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
Ie.displayName = ye;
|
|
229
|
+
var Ne = "MenubarRadioGroup", Ce = s.forwardRef(
|
|
230
|
+
(e, a) => {
|
|
231
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
232
|
+
return /* @__PURE__ */ t(de, { ...o, ...n, ref: a });
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
Ce.displayName = Ne;
|
|
236
|
+
var Se = "MenubarRadioItem", Ae = s.forwardRef(
|
|
237
|
+
(e, a) => {
|
|
238
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
239
|
+
return /* @__PURE__ */ t(le, { ...o, ...n, ref: a });
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
Ae.displayName = Se;
|
|
243
|
+
var Pe = "MenubarItemIndicator", Ee = s.forwardRef((e, a) => {
|
|
244
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
245
|
+
return /* @__PURE__ */ t(pe, { ...o, ...n, ref: a });
|
|
246
|
+
});
|
|
247
|
+
Ee.displayName = Pe;
|
|
248
|
+
var Te = "MenubarSeparator", j = s.forwardRef(
|
|
249
|
+
(e, a) => {
|
|
250
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
251
|
+
return /* @__PURE__ */ t(oe, { ...o, ...n, ref: a });
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
j.displayName = Te;
|
|
255
|
+
var Oe = "MenubarArrow", Ge = s.forwardRef(
|
|
256
|
+
(e, a) => {
|
|
257
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
258
|
+
return /* @__PURE__ */ t(be, { ...o, ...n, ref: a });
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
Ge.displayName = Oe;
|
|
262
|
+
var De = "MenubarSubTrigger", ke = s.forwardRef(
|
|
263
|
+
(e, a) => {
|
|
264
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
265
|
+
return /* @__PURE__ */ t(
|
|
266
|
+
me,
|
|
267
|
+
{
|
|
268
|
+
"data-radix-menubar-subtrigger": "",
|
|
269
|
+
...o,
|
|
270
|
+
...n,
|
|
271
|
+
ref: a
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
ke.displayName = De;
|
|
277
|
+
var Ke = "MenubarSubContent", Fe = s.forwardRef(
|
|
278
|
+
(e, a) => {
|
|
279
|
+
const { __scopeMenubar: r, ...n } = e, o = d(r);
|
|
280
|
+
return /* @__PURE__ */ t(
|
|
281
|
+
fe,
|
|
282
|
+
{
|
|
283
|
+
...o,
|
|
284
|
+
"data-radix-menubar-content": "",
|
|
285
|
+
...n,
|
|
286
|
+
ref: a,
|
|
287
|
+
style: {
|
|
288
|
+
...e.style,
|
|
289
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
290
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
291
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
292
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
293
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
Fe.displayName = Ke;
|
|
300
|
+
function Le(e, a) {
|
|
301
|
+
return e.map((r, n) => e[(a + n) % e.length]);
|
|
302
|
+
}
|
|
303
|
+
var $e = K, Be = L, Ue = $, Ve = B, ze = U, He = V, je = z, We = H, Xe = j;
|
|
304
|
+
const Ye = s.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
305
|
+
$e,
|
|
306
|
+
{
|
|
307
|
+
ref: r,
|
|
308
|
+
className: R(
|
|
309
|
+
"flex items-center gap-1 border border-border rounded-lg bg-card p-1",
|
|
310
|
+
e
|
|
311
|
+
),
|
|
312
|
+
...a
|
|
313
|
+
}
|
|
314
|
+
));
|
|
315
|
+
Ye.displayName = "Menubar";
|
|
316
|
+
const dr = Be, qe = s.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
317
|
+
Ue,
|
|
318
|
+
{
|
|
319
|
+
ref: r,
|
|
320
|
+
className: R(
|
|
321
|
+
"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md text-foreground cursor-pointer select-none outline-none transition-colors",
|
|
322
|
+
"hover:bg-muted hover:text-foreground",
|
|
323
|
+
"data-[state=open]:bg-muted data-[state=open]:text-foreground",
|
|
324
|
+
"focus-visible:ring-2 focus-visible:ring-ring",
|
|
325
|
+
e
|
|
326
|
+
),
|
|
327
|
+
...a
|
|
328
|
+
}
|
|
329
|
+
));
|
|
330
|
+
qe.displayName = "MenubarTrigger";
|
|
331
|
+
const Je = s.forwardRef(({ className: e, sideOffset: a = 8, alignOffset: r = -4, ...n }, o) => /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ t(
|
|
332
|
+
ze,
|
|
333
|
+
{
|
|
334
|
+
ref: o,
|
|
335
|
+
sideOffset: a,
|
|
336
|
+
alignOffset: r,
|
|
337
|
+
className: R(
|
|
338
|
+
"z-50 min-w-[180px] overflow-hidden rounded-lg border border-border bg-card/95 backdrop-blur-md p-1 shadow-lg",
|
|
339
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
340
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
341
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
342
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
343
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
344
|
+
e
|
|
345
|
+
),
|
|
346
|
+
...n
|
|
347
|
+
}
|
|
348
|
+
) }));
|
|
349
|
+
Je.displayName = "MenubarContent";
|
|
350
|
+
const Qe = s.forwardRef(({ className: e, inset: a, ...r }, n) => /* @__PURE__ */ t(
|
|
351
|
+
We,
|
|
352
|
+
{
|
|
353
|
+
ref: n,
|
|
354
|
+
className: R(
|
|
355
|
+
"relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground cursor-pointer select-none outline-none transition-colors",
|
|
356
|
+
"data-[highlighted]:bg-primary/10 data-[highlighted]:text-foreground",
|
|
357
|
+
"data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",
|
|
358
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
359
|
+
a && "pl-8",
|
|
360
|
+
e
|
|
361
|
+
),
|
|
362
|
+
...r
|
|
363
|
+
}
|
|
364
|
+
));
|
|
365
|
+
Qe.displayName = "MenubarItem";
|
|
366
|
+
const Ze = s.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
367
|
+
Xe,
|
|
368
|
+
{
|
|
369
|
+
ref: r,
|
|
370
|
+
className: R("-mx-1 my-1 h-px bg-border", e),
|
|
371
|
+
...a
|
|
372
|
+
}
|
|
373
|
+
));
|
|
374
|
+
Ze.displayName = "MenubarSeparator";
|
|
375
|
+
const er = s.forwardRef(({ className: e, inset: a, ...r }, n) => /* @__PURE__ */ t(
|
|
376
|
+
je,
|
|
377
|
+
{
|
|
378
|
+
ref: n,
|
|
379
|
+
className: R(
|
|
380
|
+
"px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",
|
|
381
|
+
a && "pl-8",
|
|
382
|
+
e
|
|
383
|
+
),
|
|
384
|
+
...r
|
|
385
|
+
}
|
|
386
|
+
));
|
|
387
|
+
er.displayName = "MenubarLabel";
|
|
388
|
+
const lr = He;
|
|
389
|
+
export {
|
|
390
|
+
Ye as Menubar,
|
|
391
|
+
Je as MenubarContent,
|
|
392
|
+
lr as MenubarGroup,
|
|
393
|
+
Qe as MenubarItem,
|
|
394
|
+
er as MenubarLabel,
|
|
395
|
+
dr as MenubarMenu,
|
|
396
|
+
Ze as MenubarSeparator,
|
|
397
|
+
qe as MenubarTrigger
|
|
398
|
+
};
|
package/dist/Navbar.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface NavbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Application name displayed in the left branding area. */
|
|
4
|
+
appName?: React.ReactNode;
|
|
5
|
+
/** Colored suffix appended to the app name (rendered in primary color). */
|
|
6
|
+
appSuffix?: React.ReactNode;
|
|
7
|
+
/** Action elements (buttons, icons) rendered on the right side. */
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Sticky top navigation bar with glassmorphism styling. Children are centered
|
|
12
|
+
* absolutely for navigation links; actions are right-aligned.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Navbar appName="BATCAVE" appSuffix="UI" actions={<Button size="sm">Login</Button>}>
|
|
16
|
+
* <NavPills items={navItems} active={page} onChange={setPage} />
|
|
17
|
+
* </Navbar>
|
|
18
|
+
*/
|
|
19
|
+
declare function Navbar({ appName, appSuffix, children, actions, className, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export { Navbar };
|
package/dist/Navbar.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "./_shared/utils-eGXXUFl7.js";
|
|
3
|
+
function o({ appName: t, appSuffix: l, children: a, actions: s, className: d, ...n }) {
|
|
4
|
+
return /* @__PURE__ */ r(
|
|
5
|
+
"header",
|
|
6
|
+
{
|
|
7
|
+
className: i(
|
|
8
|
+
"fixed top-0 z-40 w-full h-14 px-6",
|
|
9
|
+
"flex items-center justify-between",
|
|
10
|
+
"bg-card/85 backdrop-blur-xl border-b border-border",
|
|
11
|
+
d
|
|
12
|
+
),
|
|
13
|
+
...n,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-3 shrink-0", children: [
|
|
16
|
+
/* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-primary" }),
|
|
17
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-bold uppercase tracking-wider text-foreground", children: [
|
|
18
|
+
t,
|
|
19
|
+
" ",
|
|
20
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-primary", children: l })
|
|
21
|
+
] })
|
|
22
|
+
] }),
|
|
23
|
+
a && /* @__PURE__ */ e("nav", { className: "hidden md:block absolute left-1/2 -translate-x-1/2", children: a }),
|
|
24
|
+
s && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 shrink-0", children: s })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
o as Navbar
|
|
31
|
+
};
|