@kopexa/sidebar 17.1.74 → 17.2.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/dist/chunk-3L2F566G.mjs +147 -0
- package/dist/chunk-CMYTESJM.mjs +274 -0
- package/dist/chunk-EIXUCY5M.mjs +458 -0
- package/dist/chunk-PZFEB2PM.mjs +109 -0
- package/dist/chunk-SDMGFB6V.mjs +14 -0
- package/dist/chunk-WA2NSEYE.mjs +41 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +984 -2
- package/dist/index.mjs +56 -1
- package/dist/v2/app-shell.d.mts +43 -0
- package/dist/v2/app-shell.d.ts +43 -0
- package/dist/v2/app-shell.js +147 -0
- package/dist/v2/app-shell.mjs +19 -0
- package/dist/v2/components.d.mts +78 -0
- package/dist/v2/components.d.ts +78 -0
- package/dist/v2/components.js +504 -0
- package/dist/v2/components.mjs +32 -0
- package/dist/v2/context.d.mts +81 -0
- package/dist/v2/context.d.ts +81 -0
- package/dist/v2/context.js +167 -0
- package/dist/v2/context.mjs +10 -0
- package/dist/v2/from-config.d.mts +12 -0
- package/dist/v2/from-config.d.ts +12 -0
- package/dist/v2/from-config.js +691 -0
- package/dist/v2/from-config.mjs +11 -0
- package/dist/v2/index.d.mts +47 -0
- package/dist/v2/index.d.ts +47 -0
- package/dist/v2/index.js +1011 -0
- package/dist/v2/index.mjs +59 -0
- package/dist/v2/types.d.mts +80 -0
- package/dist/v2/types.d.ts +80 -0
- package/dist/v2/types.js +38 -0
- package/dist/v2/types.mjs +9 -0
- package/package.json +11 -11
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,46 @@ import {
|
|
|
21
21
|
SidebarTrigger,
|
|
22
22
|
useSidebar
|
|
23
23
|
} from "./chunk-FPVGSRAX.mjs";
|
|
24
|
+
import {
|
|
25
|
+
SidebarV2
|
|
26
|
+
} from "./chunk-WA2NSEYE.mjs";
|
|
27
|
+
import {
|
|
28
|
+
AppShell,
|
|
29
|
+
AppShellAside,
|
|
30
|
+
AppShellHeader,
|
|
31
|
+
AppShellMain,
|
|
32
|
+
AppShellPanelContent,
|
|
33
|
+
AppShellRoot
|
|
34
|
+
} from "./chunk-PZFEB2PM.mjs";
|
|
35
|
+
import {
|
|
36
|
+
SidebarV2FromConfig
|
|
37
|
+
} from "./chunk-CMYTESJM.mjs";
|
|
38
|
+
import {
|
|
39
|
+
SidebarV2Inset,
|
|
40
|
+
SidebarV2Panel,
|
|
41
|
+
SidebarV2PanelGroup,
|
|
42
|
+
SidebarV2PanelItems,
|
|
43
|
+
SidebarV2PanelLabel,
|
|
44
|
+
SidebarV2PanelLeaf,
|
|
45
|
+
SidebarV2Rail,
|
|
46
|
+
SidebarV2RailItem,
|
|
47
|
+
SidebarV2RailLink,
|
|
48
|
+
SidebarV2RailSpacer,
|
|
49
|
+
SidebarV2Trigger,
|
|
50
|
+
SidebarV2Workspace
|
|
51
|
+
} from "./chunk-EIXUCY5M.mjs";
|
|
52
|
+
import "./chunk-SDMGFB6V.mjs";
|
|
53
|
+
import {
|
|
54
|
+
SidebarV2Provider,
|
|
55
|
+
useSidebarV2
|
|
56
|
+
} from "./chunk-3L2F566G.mjs";
|
|
24
57
|
export {
|
|
58
|
+
AppShell,
|
|
59
|
+
AppShellAside,
|
|
60
|
+
AppShellHeader,
|
|
61
|
+
AppShellMain,
|
|
62
|
+
AppShellPanelContent,
|
|
63
|
+
AppShellRoot,
|
|
25
64
|
Sidebar,
|
|
26
65
|
SidebarContent,
|
|
27
66
|
SidebarFooter,
|
|
@@ -41,5 +80,21 @@ export {
|
|
|
41
80
|
SidebarRoot,
|
|
42
81
|
SidebarSeparator,
|
|
43
82
|
SidebarTrigger,
|
|
44
|
-
|
|
83
|
+
SidebarV2,
|
|
84
|
+
SidebarV2FromConfig,
|
|
85
|
+
SidebarV2Inset,
|
|
86
|
+
SidebarV2Panel,
|
|
87
|
+
SidebarV2PanelGroup,
|
|
88
|
+
SidebarV2PanelItems,
|
|
89
|
+
SidebarV2PanelLabel,
|
|
90
|
+
SidebarV2PanelLeaf,
|
|
91
|
+
SidebarV2Provider,
|
|
92
|
+
SidebarV2Rail,
|
|
93
|
+
SidebarV2RailItem,
|
|
94
|
+
SidebarV2RailLink,
|
|
95
|
+
SidebarV2RailSpacer,
|
|
96
|
+
SidebarV2Trigger,
|
|
97
|
+
SidebarV2Workspace,
|
|
98
|
+
useSidebar,
|
|
99
|
+
useSidebarV2
|
|
45
100
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AppShell — the layout owner: a CSS grid with named zones.
|
|
7
|
+
*
|
|
8
|
+
* ┌──────────────────────────────────────┐
|
|
9
|
+
* │ Header │ (full width)
|
|
10
|
+
* ├──────┬────────┬───────────────┬───────┤
|
|
11
|
+
* │ rail │ panel │ main │ aside │
|
|
12
|
+
* └──────┴────────┴───────────────┴───────┘
|
|
13
|
+
*
|
|
14
|
+
* Rail + panel content come from <SidebarV2.FromConfig> (or primitives), which
|
|
15
|
+
* place themselves into the `rail` / `panel` grid areas. Must be used inside
|
|
16
|
+
* <SidebarV2> (the context provider).
|
|
17
|
+
*/
|
|
18
|
+
declare function AppShellRoot({ className, style, children, ...props }: ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function AppShellHeader({ className, style, ...props }: ComponentProps<"header">): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function AppShellMain({ className, style, ...props }: ComponentProps<"main">): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function AppShellAside({ className, style, ...props }: ComponentProps<"aside">): react_jsx_runtime.JSX.Element;
|
|
22
|
+
type AppShellPanelContentProps = {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Render arbitrary content into the shell's panel zone from any page/sub-layout
|
|
27
|
+
* (e.g. an LLM "Threats" panel). While mounted it overrides the nav panel.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // app/(demo)/threats/page.tsx
|
|
31
|
+
* <AppShell.PanelContent>
|
|
32
|
+
* <SidebarV2.Panel title="Threats">{…}</SidebarV2.Panel>
|
|
33
|
+
* </AppShell.PanelContent>
|
|
34
|
+
*/
|
|
35
|
+
declare function AppShellPanelContent({ children }: AppShellPanelContentProps): react.ReactPortal | null;
|
|
36
|
+
declare const AppShell: typeof AppShellRoot & {
|
|
37
|
+
Header: typeof AppShellHeader;
|
|
38
|
+
Main: typeof AppShellMain;
|
|
39
|
+
Aside: typeof AppShellAside;
|
|
40
|
+
PanelContent: typeof AppShellPanelContent;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { AppShell, AppShellAside, AppShellHeader, AppShellMain, AppShellPanelContent, type AppShellPanelContentProps, AppShellRoot };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AppShell — the layout owner: a CSS grid with named zones.
|
|
7
|
+
*
|
|
8
|
+
* ┌──────────────────────────────────────┐
|
|
9
|
+
* │ Header │ (full width)
|
|
10
|
+
* ├──────┬────────┬───────────────┬───────┤
|
|
11
|
+
* │ rail │ panel │ main │ aside │
|
|
12
|
+
* └──────┴────────┴───────────────┴───────┘
|
|
13
|
+
*
|
|
14
|
+
* Rail + panel content come from <SidebarV2.FromConfig> (or primitives), which
|
|
15
|
+
* place themselves into the `rail` / `panel` grid areas. Must be used inside
|
|
16
|
+
* <SidebarV2> (the context provider).
|
|
17
|
+
*/
|
|
18
|
+
declare function AppShellRoot({ className, style, children, ...props }: ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function AppShellHeader({ className, style, ...props }: ComponentProps<"header">): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function AppShellMain({ className, style, ...props }: ComponentProps<"main">): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function AppShellAside({ className, style, ...props }: ComponentProps<"aside">): react_jsx_runtime.JSX.Element;
|
|
22
|
+
type AppShellPanelContentProps = {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Render arbitrary content into the shell's panel zone from any page/sub-layout
|
|
27
|
+
* (e.g. an LLM "Threats" panel). While mounted it overrides the nav panel.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // app/(demo)/threats/page.tsx
|
|
31
|
+
* <AppShell.PanelContent>
|
|
32
|
+
* <SidebarV2.Panel title="Threats">{…}</SidebarV2.Panel>
|
|
33
|
+
* </AppShell.PanelContent>
|
|
34
|
+
*/
|
|
35
|
+
declare function AppShellPanelContent({ children }: AppShellPanelContentProps): react.ReactPortal | null;
|
|
36
|
+
declare const AppShell: typeof AppShellRoot & {
|
|
37
|
+
Header: typeof AppShellHeader;
|
|
38
|
+
Main: typeof AppShellMain;
|
|
39
|
+
Aside: typeof AppShellAside;
|
|
40
|
+
PanelContent: typeof AppShellPanelContent;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { AppShell, AppShellAside, AppShellHeader, AppShellMain, AppShellPanelContent, type AppShellPanelContentProps, AppShellRoot };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/v2/app-shell.tsx
|
|
23
|
+
var app_shell_exports = {};
|
|
24
|
+
__export(app_shell_exports, {
|
|
25
|
+
AppShell: () => AppShell,
|
|
26
|
+
AppShellAside: () => AppShellAside,
|
|
27
|
+
AppShellHeader: () => AppShellHeader,
|
|
28
|
+
AppShellMain: () => AppShellMain,
|
|
29
|
+
AppShellPanelContent: () => AppShellPanelContent,
|
|
30
|
+
AppShellRoot: () => AppShellRoot
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(app_shell_exports);
|
|
33
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
34
|
+
var import_react2 = require("react");
|
|
35
|
+
var import_react_dom = require("react-dom");
|
|
36
|
+
|
|
37
|
+
// src/v2/context.tsx
|
|
38
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
39
|
+
var import_tooltip = require("@kopexa/tooltip");
|
|
40
|
+
var import_use_is_mobile = require("@kopexa/use-is-mobile");
|
|
41
|
+
var import_react = require("react");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
var PIN_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
44
|
+
var [Provider, useSidebarV2] = (0, import_react_utils.createContext)({
|
|
45
|
+
name: "SidebarV2Context",
|
|
46
|
+
errorMessage: "useSidebarV2 must be used within <SidebarV2> (the provider component)."
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// src/v2/app-shell.tsx
|
|
50
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
51
|
+
var RAIL_WIDTH = "4rem";
|
|
52
|
+
var PANEL_WIDTH = "15rem";
|
|
53
|
+
function AppShellRoot({
|
|
54
|
+
className,
|
|
55
|
+
style,
|
|
56
|
+
children,
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
const { tone } = useSidebarV2();
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
"data-slot": "app-shell",
|
|
64
|
+
"data-tone": tone,
|
|
65
|
+
className: (0, import_shared_utils.cn)(
|
|
66
|
+
"relative isolate grid h-svh w-full overflow-hidden antialiased",
|
|
67
|
+
tone === "light" ? "bg-muted text-foreground" : "bg-sidebar text-sidebar-foreground",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
style: {
|
|
71
|
+
"--kpx-rail-width": RAIL_WIDTH,
|
|
72
|
+
"--kpx-panel-width": PANEL_WIDTH,
|
|
73
|
+
gridTemplateAreas: '"header header header header" "rail panel main aside"',
|
|
74
|
+
gridTemplateRows: "auto 1fr",
|
|
75
|
+
gridTemplateColumns: "auto auto 1fr auto",
|
|
76
|
+
...style
|
|
77
|
+
},
|
|
78
|
+
...props,
|
|
79
|
+
children
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function AppShellHeader({
|
|
84
|
+
className,
|
|
85
|
+
style,
|
|
86
|
+
...props
|
|
87
|
+
}) {
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
89
|
+
"header",
|
|
90
|
+
{
|
|
91
|
+
"data-slot": "app-shell-header",
|
|
92
|
+
className: (0, import_shared_utils.cn)("z-20 flex h-14 items-center gap-3 px-2", className),
|
|
93
|
+
style: { gridArea: "header", ...style },
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function AppShellMain({ className, style, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
100
|
+
"main",
|
|
101
|
+
{
|
|
102
|
+
"data-slot": "app-shell-main",
|
|
103
|
+
className: (0, import_shared_utils.cn)(
|
|
104
|
+
"relative flex min-h-0 min-w-0 flex-col overflow-hidden bg-background",
|
|
105
|
+
"m-2 rounded-xl shadow-sm",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
style: { gridArea: "main", ...style },
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function AppShellAside({
|
|
114
|
+
className,
|
|
115
|
+
style,
|
|
116
|
+
...props
|
|
117
|
+
}) {
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
119
|
+
"aside",
|
|
120
|
+
{
|
|
121
|
+
"data-slot": "app-shell-aside",
|
|
122
|
+
className: (0, import_shared_utils.cn)("min-h-0 min-w-0 overflow-hidden", className),
|
|
123
|
+
style: { gridArea: "aside", ...style },
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function AppShellPanelContent({ children }) {
|
|
129
|
+
const { panelHost, registerPanelOverride, navPreviewActive } = useSidebarV2();
|
|
130
|
+
(0, import_react2.useEffect)(() => registerPanelOverride(), [registerPanelOverride]);
|
|
131
|
+
if (!panelHost || navPreviewActive) return null;
|
|
132
|
+
return (0, import_react_dom.createPortal)(children, panelHost);
|
|
133
|
+
}
|
|
134
|
+
var AppShell = AppShellRoot;
|
|
135
|
+
AppShell.Header = AppShellHeader;
|
|
136
|
+
AppShell.Main = AppShellMain;
|
|
137
|
+
AppShell.Aside = AppShellAside;
|
|
138
|
+
AppShell.PanelContent = AppShellPanelContent;
|
|
139
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
140
|
+
0 && (module.exports = {
|
|
141
|
+
AppShell,
|
|
142
|
+
AppShellAside,
|
|
143
|
+
AppShellHeader,
|
|
144
|
+
AppShellMain,
|
|
145
|
+
AppShellPanelContent,
|
|
146
|
+
AppShellRoot
|
|
147
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import {
|
|
4
|
+
AppShell,
|
|
5
|
+
AppShellAside,
|
|
6
|
+
AppShellHeader,
|
|
7
|
+
AppShellMain,
|
|
8
|
+
AppShellPanelContent,
|
|
9
|
+
AppShellRoot
|
|
10
|
+
} from "../chunk-PZFEB2PM.mjs";
|
|
11
|
+
import "../chunk-3L2F566G.mjs";
|
|
12
|
+
export {
|
|
13
|
+
AppShell,
|
|
14
|
+
AppShellAside,
|
|
15
|
+
AppShellHeader,
|
|
16
|
+
AppShellMain,
|
|
17
|
+
AppShellPanelContent,
|
|
18
|
+
AppShellRoot
|
|
19
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { IconButton } from '@kopexa/button';
|
|
5
|
+
import { SidebarV2Icon, SidebarV2PanelItem } from './types.mjs';
|
|
6
|
+
|
|
7
|
+
declare function SidebarV2Inset({ className, ...props }: ComponentProps<"main">): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function SidebarV2Rail({ className, ...props }: ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function SidebarV2RailSpacer(): react_jsx_runtime.JSX.Element;
|
|
10
|
+
type SidebarV2WorkspaceProps = ComponentProps<"button"> & {
|
|
11
|
+
/** Workspace display name, e.g. "Webinar". */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Secondary line, e.g. "Administrator". */
|
|
14
|
+
role?: string;
|
|
15
|
+
/** Custom logo node. Defaults to the workspace initial. */
|
|
16
|
+
logo?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* "rail" = compact icon tile for the dark rail (default).
|
|
19
|
+
* "bar" = horizontal logo + name/role for a light header/topbar.
|
|
20
|
+
*/
|
|
21
|
+
appearance?: "rail" | "bar";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Workspace switcher trigger. Compose it with a DropdownMenu (asChild):
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <DropdownMenu.Trigger asChild>
|
|
28
|
+
* <SidebarV2.Workspace appearance="bar" name="Webinar" role="Administrator" />
|
|
29
|
+
* </DropdownMenu.Trigger>
|
|
30
|
+
*/
|
|
31
|
+
declare const SidebarV2Workspace: react.ForwardRefExoticComponent<Omit<SidebarV2WorkspaceProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
declare function SidebarV2RailLink({ icon, label, href, badge, }: {
|
|
33
|
+
icon: SidebarV2Icon;
|
|
34
|
+
label: string;
|
|
35
|
+
href: string;
|
|
36
|
+
badge?: number | string;
|
|
37
|
+
}): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare function SidebarV2RailItem({ icon, label, active, hasPanel, onClick, onMouseEnter, onMouseLeave, badge, }: {
|
|
39
|
+
icon: SidebarV2Icon;
|
|
40
|
+
label: string;
|
|
41
|
+
active: boolean;
|
|
42
|
+
hasPanel?: boolean;
|
|
43
|
+
onClick?: () => void;
|
|
44
|
+
onMouseEnter?: () => void;
|
|
45
|
+
onMouseLeave?: () => void;
|
|
46
|
+
badge?: number | string;
|
|
47
|
+
}): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function SidebarV2Panel({ title, subtitle, floating, hidePin, action, children, className, }: {
|
|
49
|
+
title?: string;
|
|
50
|
+
subtitle?: string;
|
|
51
|
+
floating?: boolean;
|
|
52
|
+
/** Hide the pin toggle — useful for page-supplied panels (no nav semantics). */
|
|
53
|
+
hidePin?: boolean;
|
|
54
|
+
/** Optional header action node, shown in place of the pin toggle. */
|
|
55
|
+
action?: ReactNode;
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
className?: string;
|
|
58
|
+
}): react_jsx_runtime.JSX.Element;
|
|
59
|
+
/** Static section label inside a panel (non-collapsible group heading). */
|
|
60
|
+
declare function SidebarV2PanelLabel({ className, ...props }: ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare function SidebarV2PanelLeaf({ item, active: activeProp, }: {
|
|
62
|
+
item: Extract<SidebarV2PanelItem, {
|
|
63
|
+
href: string;
|
|
64
|
+
}>;
|
|
65
|
+
/** Override the derived active state (e.g. for custom page routing rules). */
|
|
66
|
+
active?: boolean;
|
|
67
|
+
}): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare function SidebarV2PanelGroup({ item, }: {
|
|
69
|
+
item: Extract<SidebarV2PanelItem, {
|
|
70
|
+
children: unknown;
|
|
71
|
+
}>;
|
|
72
|
+
}): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare function SidebarV2PanelItems({ items, }: {
|
|
74
|
+
items: SidebarV2PanelItem[];
|
|
75
|
+
}): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function SidebarV2Trigger({ className, ...props }: Omit<ComponentProps<typeof IconButton>, "aria-label">): react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
export { SidebarV2Inset, SidebarV2Panel, SidebarV2PanelGroup, SidebarV2PanelItems, SidebarV2PanelLabel, SidebarV2PanelLeaf, SidebarV2Rail, SidebarV2RailItem, SidebarV2RailLink, SidebarV2RailSpacer, SidebarV2Trigger, SidebarV2Workspace, type SidebarV2WorkspaceProps };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { IconButton } from '@kopexa/button';
|
|
5
|
+
import { SidebarV2Icon, SidebarV2PanelItem } from './types.js';
|
|
6
|
+
|
|
7
|
+
declare function SidebarV2Inset({ className, ...props }: ComponentProps<"main">): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function SidebarV2Rail({ className, ...props }: ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function SidebarV2RailSpacer(): react_jsx_runtime.JSX.Element;
|
|
10
|
+
type SidebarV2WorkspaceProps = ComponentProps<"button"> & {
|
|
11
|
+
/** Workspace display name, e.g. "Webinar". */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Secondary line, e.g. "Administrator". */
|
|
14
|
+
role?: string;
|
|
15
|
+
/** Custom logo node. Defaults to the workspace initial. */
|
|
16
|
+
logo?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* "rail" = compact icon tile for the dark rail (default).
|
|
19
|
+
* "bar" = horizontal logo + name/role for a light header/topbar.
|
|
20
|
+
*/
|
|
21
|
+
appearance?: "rail" | "bar";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Workspace switcher trigger. Compose it with a DropdownMenu (asChild):
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <DropdownMenu.Trigger asChild>
|
|
28
|
+
* <SidebarV2.Workspace appearance="bar" name="Webinar" role="Administrator" />
|
|
29
|
+
* </DropdownMenu.Trigger>
|
|
30
|
+
*/
|
|
31
|
+
declare const SidebarV2Workspace: react.ForwardRefExoticComponent<Omit<SidebarV2WorkspaceProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
declare function SidebarV2RailLink({ icon, label, href, badge, }: {
|
|
33
|
+
icon: SidebarV2Icon;
|
|
34
|
+
label: string;
|
|
35
|
+
href: string;
|
|
36
|
+
badge?: number | string;
|
|
37
|
+
}): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare function SidebarV2RailItem({ icon, label, active, hasPanel, onClick, onMouseEnter, onMouseLeave, badge, }: {
|
|
39
|
+
icon: SidebarV2Icon;
|
|
40
|
+
label: string;
|
|
41
|
+
active: boolean;
|
|
42
|
+
hasPanel?: boolean;
|
|
43
|
+
onClick?: () => void;
|
|
44
|
+
onMouseEnter?: () => void;
|
|
45
|
+
onMouseLeave?: () => void;
|
|
46
|
+
badge?: number | string;
|
|
47
|
+
}): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function SidebarV2Panel({ title, subtitle, floating, hidePin, action, children, className, }: {
|
|
49
|
+
title?: string;
|
|
50
|
+
subtitle?: string;
|
|
51
|
+
floating?: boolean;
|
|
52
|
+
/** Hide the pin toggle — useful for page-supplied panels (no nav semantics). */
|
|
53
|
+
hidePin?: boolean;
|
|
54
|
+
/** Optional header action node, shown in place of the pin toggle. */
|
|
55
|
+
action?: ReactNode;
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
className?: string;
|
|
58
|
+
}): react_jsx_runtime.JSX.Element;
|
|
59
|
+
/** Static section label inside a panel (non-collapsible group heading). */
|
|
60
|
+
declare function SidebarV2PanelLabel({ className, ...props }: ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare function SidebarV2PanelLeaf({ item, active: activeProp, }: {
|
|
62
|
+
item: Extract<SidebarV2PanelItem, {
|
|
63
|
+
href: string;
|
|
64
|
+
}>;
|
|
65
|
+
/** Override the derived active state (e.g. for custom page routing rules). */
|
|
66
|
+
active?: boolean;
|
|
67
|
+
}): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare function SidebarV2PanelGroup({ item, }: {
|
|
69
|
+
item: Extract<SidebarV2PanelItem, {
|
|
70
|
+
children: unknown;
|
|
71
|
+
}>;
|
|
72
|
+
}): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare function SidebarV2PanelItems({ items, }: {
|
|
74
|
+
items: SidebarV2PanelItem[];
|
|
75
|
+
}): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function SidebarV2Trigger({ className, ...props }: Omit<ComponentProps<typeof IconButton>, "aria-label">): react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
export { SidebarV2Inset, SidebarV2Panel, SidebarV2PanelGroup, SidebarV2PanelItems, SidebarV2PanelLabel, SidebarV2PanelLeaf, SidebarV2Rail, SidebarV2RailItem, SidebarV2RailLink, SidebarV2RailSpacer, SidebarV2Trigger, SidebarV2Workspace, type SidebarV2WorkspaceProps };
|