@kopexa/sidebar 1.0.2 → 1.0.4
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-QR6MW6DK.mjs → chunk-FPVGSRAX.mjs} +26 -2
- package/dist/index.js +9 -2
- package/dist/index.mjs +1 -1
- package/dist/namespace.d.mts +7 -0
- package/dist/namespace.d.ts +7 -0
- package/dist/namespace.js +452 -0
- package/dist/namespace.mjs +39 -0
- package/dist/sidebar.d.mts +1 -1
- package/dist/sidebar.d.ts +1 -1
- package/dist/sidebar.js +43 -2
- package/dist/sidebar.mjs +35 -1
- package/package.json +8 -8
|
@@ -198,7 +198,11 @@ function SidebarRoot({
|
|
|
198
198
|
}
|
|
199
199
|
);
|
|
200
200
|
}
|
|
201
|
-
function SidebarTrigger({
|
|
201
|
+
function SidebarTrigger({
|
|
202
|
+
className,
|
|
203
|
+
onClick,
|
|
204
|
+
...props
|
|
205
|
+
}) {
|
|
202
206
|
const { toggleSidebar, styles } = useSidebar();
|
|
203
207
|
return /* @__PURE__ */ jsxs(
|
|
204
208
|
IconButton,
|
|
@@ -284,7 +288,10 @@ function SidebarFooter({ className, ...props }) {
|
|
|
284
288
|
}
|
|
285
289
|
);
|
|
286
290
|
}
|
|
287
|
-
function SidebarSeparator({
|
|
291
|
+
function SidebarSeparator({
|
|
292
|
+
className,
|
|
293
|
+
...props
|
|
294
|
+
}) {
|
|
288
295
|
const { styles } = useSidebar();
|
|
289
296
|
return /* @__PURE__ */ jsx(
|
|
290
297
|
Separator,
|
|
@@ -469,5 +476,22 @@ var Sidebar = Object.assign(SidebarRoot, {
|
|
|
469
476
|
export {
|
|
470
477
|
useSidebar,
|
|
471
478
|
SidebarProvider,
|
|
479
|
+
SidebarRoot,
|
|
480
|
+
SidebarTrigger,
|
|
481
|
+
SidebarRail,
|
|
482
|
+
SidebarInset,
|
|
483
|
+
SidebarInput,
|
|
484
|
+
SidebarHeader,
|
|
485
|
+
SidebarFooter,
|
|
486
|
+
SidebarSeparator,
|
|
487
|
+
SidebarContent,
|
|
488
|
+
SidebarGroup,
|
|
489
|
+
SidebarGroupLabel,
|
|
490
|
+
SidebarGroupAction,
|
|
491
|
+
SidebarGroupContent,
|
|
492
|
+
SidebarMenu,
|
|
493
|
+
SidebarMenuItem,
|
|
494
|
+
SidebarMenuButton,
|
|
495
|
+
SidebarMenuAction,
|
|
472
496
|
Sidebar
|
|
473
497
|
};
|
package/dist/index.js
CHANGED
|
@@ -216,7 +216,11 @@ function SidebarRoot({
|
|
|
216
216
|
}
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
|
-
function SidebarTrigger({
|
|
219
|
+
function SidebarTrigger({
|
|
220
|
+
className,
|
|
221
|
+
onClick,
|
|
222
|
+
...props
|
|
223
|
+
}) {
|
|
220
224
|
const { toggleSidebar, styles } = useSidebar();
|
|
221
225
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
222
226
|
import_button.IconButton,
|
|
@@ -302,7 +306,10 @@ function SidebarFooter({ className, ...props }) {
|
|
|
302
306
|
}
|
|
303
307
|
);
|
|
304
308
|
}
|
|
305
|
-
function SidebarSeparator({
|
|
309
|
+
function SidebarSeparator({
|
|
310
|
+
className,
|
|
311
|
+
...props
|
|
312
|
+
}) {
|
|
306
313
|
const { styles } = useSidebar();
|
|
307
314
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
308
315
|
import_separator.Separator,
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { SidebarContent as Content, SidebarContentProps as ContentProps, SidebarFooter as Footer, SidebarFooterProps as FooterProps, SidebarGroup as Group, SidebarGroupAction as GroupAction, SidebarGroupActionProps as GroupActionProps, SidebarGroupContent as GroupContent, SidebarGroupContentProps as GroupContentProps, SidebarGroupLabel as GroupLabel, SidebarGroupLabelProps as GroupLabelProps, SidebarGroupProps as GroupProps, SidebarHeader as Header, SidebarHeaderProps as HeaderProps, SidebarInput as Input, SidebarInputProps as InputProps, SidebarInset as Inset, SidebarInsetProps as InsetProps, SidebarMenu as Menu, SidebarMenuAction as MenuAction, SidebarMenuActionProps as MenuActionProps, SidebarMenuButton as MenuButton, SidebarMenuButtonProps as MenuButtonProps, SidebarMenuItem as MenuItem, SidebarMenuItemProps as MenuItemProps, SidebarMenuProps as MenuProps, SidebarRail as Rail, SidebarRailProps as RailProps, SidebarRoot as Root, SidebarProps as RootProps, SidebarSeparator as Separator, SidebarSeparatorProps as SeparatorProps, SidebarTrigger as Trigger, SidebarTriggerProps as TriggerProps } from './sidebar.mjs';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '@kopexa/button';
|
|
4
|
+
import '@kopexa/input';
|
|
5
|
+
import '@kopexa/separator';
|
|
6
|
+
import '@kopexa/theme';
|
|
7
|
+
import 'react';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { SidebarContent as Content, SidebarContentProps as ContentProps, SidebarFooter as Footer, SidebarFooterProps as FooterProps, SidebarGroup as Group, SidebarGroupAction as GroupAction, SidebarGroupActionProps as GroupActionProps, SidebarGroupContent as GroupContent, SidebarGroupContentProps as GroupContentProps, SidebarGroupLabel as GroupLabel, SidebarGroupLabelProps as GroupLabelProps, SidebarGroupProps as GroupProps, SidebarHeader as Header, SidebarHeaderProps as HeaderProps, SidebarInput as Input, SidebarInputProps as InputProps, SidebarInset as Inset, SidebarInsetProps as InsetProps, SidebarMenu as Menu, SidebarMenuAction as MenuAction, SidebarMenuActionProps as MenuActionProps, SidebarMenuButton as MenuButton, SidebarMenuButtonProps as MenuButtonProps, SidebarMenuItem as MenuItem, SidebarMenuItemProps as MenuItemProps, SidebarMenuProps as MenuProps, SidebarRail as Rail, SidebarRailProps as RailProps, SidebarRoot as Root, SidebarProps as RootProps, SidebarSeparator as Separator, SidebarSeparatorProps as SeparatorProps, SidebarTrigger as Trigger, SidebarTriggerProps as TriggerProps } from './sidebar.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '@kopexa/button';
|
|
4
|
+
import '@kopexa/input';
|
|
5
|
+
import '@kopexa/separator';
|
|
6
|
+
import '@kopexa/theme';
|
|
7
|
+
import 'react';
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/namespace.ts
|
|
22
|
+
var namespace_exports = {};
|
|
23
|
+
__export(namespace_exports, {
|
|
24
|
+
Content: () => SidebarContent,
|
|
25
|
+
Footer: () => SidebarFooter,
|
|
26
|
+
Group: () => SidebarGroup,
|
|
27
|
+
GroupAction: () => SidebarGroupAction,
|
|
28
|
+
GroupContent: () => SidebarGroupContent,
|
|
29
|
+
GroupLabel: () => SidebarGroupLabel,
|
|
30
|
+
Header: () => SidebarHeader,
|
|
31
|
+
Input: () => SidebarInput,
|
|
32
|
+
Inset: () => SidebarInset,
|
|
33
|
+
Menu: () => SidebarMenu,
|
|
34
|
+
MenuAction: () => SidebarMenuAction,
|
|
35
|
+
MenuButton: () => SidebarMenuButton,
|
|
36
|
+
MenuItem: () => SidebarMenuItem,
|
|
37
|
+
Rail: () => SidebarRail,
|
|
38
|
+
Root: () => SidebarRoot,
|
|
39
|
+
Separator: () => SidebarSeparator,
|
|
40
|
+
Trigger: () => SidebarTrigger
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(namespace_exports);
|
|
43
|
+
|
|
44
|
+
// src/sidebar.tsx
|
|
45
|
+
var import_button = require("@kopexa/button");
|
|
46
|
+
var import_drawer = require("@kopexa/drawer");
|
|
47
|
+
var import_icons = require("@kopexa/icons");
|
|
48
|
+
var import_input = require("@kopexa/input");
|
|
49
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
50
|
+
var import_separator = require("@kopexa/separator");
|
|
51
|
+
var import_theme = require("@kopexa/theme");
|
|
52
|
+
var import_tooltip = require("@kopexa/tooltip");
|
|
53
|
+
var import_use_is_mobile = require("@kopexa/use-is-mobile");
|
|
54
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
55
|
+
var import_react = require("react");
|
|
56
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
57
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
58
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
59
|
+
var [Provider, useSidebar] = (0, import_react_utils.createContext)();
|
|
60
|
+
function SidebarRoot({
|
|
61
|
+
side = "left",
|
|
62
|
+
variant = "sidebar",
|
|
63
|
+
collapsible = "offcanvas",
|
|
64
|
+
className,
|
|
65
|
+
children,
|
|
66
|
+
...props
|
|
67
|
+
}) {
|
|
68
|
+
const { isMobile, state, openMobile, setOpenMobile, styles } = useSidebar();
|
|
69
|
+
if (collapsible === "none") {
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "sidebar",
|
|
74
|
+
className: styles.sidebar({
|
|
75
|
+
className
|
|
76
|
+
}),
|
|
77
|
+
...props,
|
|
78
|
+
children
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (isMobile) {
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
import_drawer.Drawer.Root,
|
|
85
|
+
{
|
|
86
|
+
open: openMobile,
|
|
87
|
+
onOpenChange: setOpenMobile,
|
|
88
|
+
placement: side,
|
|
89
|
+
...props,
|
|
90
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
91
|
+
import_drawer.Drawer.Content,
|
|
92
|
+
{
|
|
93
|
+
"data-sidebar": "sidebar",
|
|
94
|
+
"data-slot": "sidebar",
|
|
95
|
+
"data-mobile": "true",
|
|
96
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
97
|
+
style: {
|
|
98
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
99
|
+
},
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_drawer.Drawer.Header, { className: "sr-only", children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drawer.Drawer.Title, { children: "Sidebar" }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drawer.Drawer.Description, { children: "Displays the mobile sidebar." })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: styles.sidebarWrapper(),
|
|
116
|
+
"data-state": state,
|
|
117
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
118
|
+
"data-variant": variant,
|
|
119
|
+
"data-side": side,
|
|
120
|
+
"data-slot": "sidebar",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "sidebar-gap",
|
|
126
|
+
className: styles.gap({
|
|
127
|
+
variant
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
"data-slot": "sidebar-container",
|
|
135
|
+
className: styles.container({
|
|
136
|
+
side,
|
|
137
|
+
variant,
|
|
138
|
+
className
|
|
139
|
+
}),
|
|
140
|
+
...props,
|
|
141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
"data-sidebar": "sidebar",
|
|
145
|
+
"data-slot": "sidebar-inner",
|
|
146
|
+
className: styles.inner({
|
|
147
|
+
side,
|
|
148
|
+
variant
|
|
149
|
+
}),
|
|
150
|
+
children
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function SidebarTrigger({
|
|
160
|
+
className,
|
|
161
|
+
onClick,
|
|
162
|
+
...props
|
|
163
|
+
}) {
|
|
164
|
+
const { toggleSidebar, styles } = useSidebar();
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
166
|
+
import_button.IconButton,
|
|
167
|
+
{
|
|
168
|
+
"data-sidebar": "trigger",
|
|
169
|
+
"data-slot": "sidebar-trigger",
|
|
170
|
+
variant: "ghost",
|
|
171
|
+
size: "md",
|
|
172
|
+
className: styles.trigger({ className }),
|
|
173
|
+
onClick: (event) => {
|
|
174
|
+
onClick == null ? void 0 : onClick(event);
|
|
175
|
+
toggleSidebar();
|
|
176
|
+
},
|
|
177
|
+
"aria-label": "Toggle Sidebar",
|
|
178
|
+
...props,
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.PanelLeftIcon, {}),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
function SidebarRail({ className, ...props }) {
|
|
187
|
+
const { toggleSidebar, styles } = useSidebar();
|
|
188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
189
|
+
"button",
|
|
190
|
+
{
|
|
191
|
+
"data-sidebar": "rail",
|
|
192
|
+
"data-slot": "sidebar-rail",
|
|
193
|
+
"aria-label": "Toggle Sidebar",
|
|
194
|
+
tabIndex: -1,
|
|
195
|
+
onClick: toggleSidebar,
|
|
196
|
+
title: "Toggle Sidebar",
|
|
197
|
+
className: styles.rail({ className }),
|
|
198
|
+
...props
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
function SidebarInset({ className, ...props }) {
|
|
203
|
+
const { styles } = useSidebar();
|
|
204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
205
|
+
"main",
|
|
206
|
+
{
|
|
207
|
+
"data-slot": "sidebar-inset",
|
|
208
|
+
className: styles.inset({ className }),
|
|
209
|
+
...props
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
function SidebarInput({ className, ...props }) {
|
|
214
|
+
const { styles } = useSidebar();
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
|
+
import_input.Input,
|
|
217
|
+
{
|
|
218
|
+
"data-slot": "sidebar-input",
|
|
219
|
+
"data-sidebar": "input",
|
|
220
|
+
className: styles.input({ className }),
|
|
221
|
+
...props
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
function SidebarHeader({ className, ...props }) {
|
|
226
|
+
const { styles } = useSidebar();
|
|
227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
"data-slot": "sidebar-header",
|
|
231
|
+
"data-sidebar": "header",
|
|
232
|
+
className: styles.header({ className }),
|
|
233
|
+
...props
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
function SidebarFooter({ className, ...props }) {
|
|
238
|
+
const { styles } = useSidebar();
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
+
"div",
|
|
241
|
+
{
|
|
242
|
+
"data-slot": "sidebar-footer",
|
|
243
|
+
"data-sidebar": "footer",
|
|
244
|
+
className: styles.footer({ className }),
|
|
245
|
+
...props
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function SidebarSeparator({
|
|
250
|
+
className,
|
|
251
|
+
...props
|
|
252
|
+
}) {
|
|
253
|
+
const { styles } = useSidebar();
|
|
254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
255
|
+
import_separator.Separator,
|
|
256
|
+
{
|
|
257
|
+
"data-slot": "sidebar-separator",
|
|
258
|
+
"data-sidebar": "separator",
|
|
259
|
+
className: styles.separator({ className }),
|
|
260
|
+
...props
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function SidebarContent({ className, ...props }) {
|
|
265
|
+
const { styles } = useSidebar();
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
267
|
+
"div",
|
|
268
|
+
{
|
|
269
|
+
"data-slot": "sidebar-content",
|
|
270
|
+
"data-sidebar": "content",
|
|
271
|
+
className: styles.content({ className }),
|
|
272
|
+
...props
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
function SidebarGroup({ className, ...props }) {
|
|
277
|
+
const { styles } = useSidebar();
|
|
278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
"data-slot": "sidebar-group",
|
|
282
|
+
"data-sidebar": "group",
|
|
283
|
+
className: styles.group({ className }),
|
|
284
|
+
...props
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
function SidebarGroupLabel({
|
|
289
|
+
className,
|
|
290
|
+
asChild = false,
|
|
291
|
+
...props
|
|
292
|
+
}) {
|
|
293
|
+
const { styles } = useSidebar();
|
|
294
|
+
const Comp = asChild ? import_react_slot.Slot : "div";
|
|
295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
296
|
+
Comp,
|
|
297
|
+
{
|
|
298
|
+
"data-slot": "sidebar-group-label",
|
|
299
|
+
"data-sidebar": "group-label",
|
|
300
|
+
className: styles.groupLabel({ className }),
|
|
301
|
+
...props
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
function SidebarGroupAction({
|
|
306
|
+
className,
|
|
307
|
+
asChild = false,
|
|
308
|
+
...props
|
|
309
|
+
}) {
|
|
310
|
+
const { styles } = useSidebar();
|
|
311
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
313
|
+
Comp,
|
|
314
|
+
{
|
|
315
|
+
"data-slot": "sidebar-group-action",
|
|
316
|
+
"data-sidebar": "group-action",
|
|
317
|
+
className: styles.groupAction({ className }),
|
|
318
|
+
...props
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
function SidebarGroupContent({
|
|
323
|
+
className,
|
|
324
|
+
...props
|
|
325
|
+
}) {
|
|
326
|
+
const { styles } = useSidebar();
|
|
327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
"data-slot": "sidebar-group-content",
|
|
331
|
+
"data-sidebar": "group-content",
|
|
332
|
+
className: styles.groupContent({ className }),
|
|
333
|
+
...props
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
function SidebarMenu({ className, ...props }) {
|
|
338
|
+
const { styles } = useSidebar();
|
|
339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
340
|
+
"ul",
|
|
341
|
+
{
|
|
342
|
+
"data-slot": "sidebar-menu",
|
|
343
|
+
"data-sidebar": "menu",
|
|
344
|
+
className: styles.menu({ className }),
|
|
345
|
+
...props
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
350
|
+
const { styles } = useSidebar();
|
|
351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
352
|
+
"li",
|
|
353
|
+
{
|
|
354
|
+
"data-slot": "sidebar-menu-item",
|
|
355
|
+
"data-sidebar": "menu-item",
|
|
356
|
+
className: styles.menuItem({ className }),
|
|
357
|
+
...props
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
function SidebarMenuButton({
|
|
362
|
+
asChild = false,
|
|
363
|
+
isActive = false,
|
|
364
|
+
variant = "default",
|
|
365
|
+
size = "md",
|
|
366
|
+
tooltip,
|
|
367
|
+
className,
|
|
368
|
+
...props
|
|
369
|
+
}) {
|
|
370
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
371
|
+
const { isMobile, state } = useSidebar();
|
|
372
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
373
|
+
Comp,
|
|
374
|
+
{
|
|
375
|
+
"data-slot": "sidebar-menu-button",
|
|
376
|
+
"data-sidebar": "menu-button",
|
|
377
|
+
"data-size": size,
|
|
378
|
+
"data-active": isActive,
|
|
379
|
+
className: (0, import_theme.sidebarMenuButton)({ variant, size, className }),
|
|
380
|
+
...props
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
if (!tooltip) {
|
|
384
|
+
return button;
|
|
385
|
+
}
|
|
386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
387
|
+
import_tooltip.Tooltip,
|
|
388
|
+
{
|
|
389
|
+
content: tooltip,
|
|
390
|
+
side: "right",
|
|
391
|
+
align: "center",
|
|
392
|
+
disabled: state !== "collapsed" || isMobile,
|
|
393
|
+
children: button
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
function SidebarMenuAction({
|
|
398
|
+
className,
|
|
399
|
+
asChild = false,
|
|
400
|
+
showOnHover = false,
|
|
401
|
+
...props
|
|
402
|
+
}) {
|
|
403
|
+
const styles = (0, import_theme.sidebarMenuAction)({ showOnHover, className });
|
|
404
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
406
|
+
Comp,
|
|
407
|
+
{
|
|
408
|
+
"data-slot": "sidebar-menu-action",
|
|
409
|
+
"data-sidebar": "menu-action",
|
|
410
|
+
className: styles,
|
|
411
|
+
...props
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
var Sidebar = Object.assign(SidebarRoot, {
|
|
416
|
+
Trigger: SidebarTrigger,
|
|
417
|
+
Rail: SidebarRail,
|
|
418
|
+
Inset: SidebarInset,
|
|
419
|
+
Input: SidebarInput,
|
|
420
|
+
Header: SidebarHeader,
|
|
421
|
+
Footer: SidebarFooter,
|
|
422
|
+
Separator: SidebarSeparator,
|
|
423
|
+
Content: SidebarContent,
|
|
424
|
+
Group: SidebarGroup,
|
|
425
|
+
GroupLabel: SidebarGroupLabel,
|
|
426
|
+
GroupAction: SidebarGroupAction,
|
|
427
|
+
GroupContent: SidebarGroupContent,
|
|
428
|
+
Menu: SidebarMenu,
|
|
429
|
+
MenuItem: SidebarMenuItem,
|
|
430
|
+
MenuButton: SidebarMenuButton,
|
|
431
|
+
MenuAction: SidebarMenuAction
|
|
432
|
+
});
|
|
433
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
434
|
+
0 && (module.exports = {
|
|
435
|
+
Content,
|
|
436
|
+
Footer,
|
|
437
|
+
Group,
|
|
438
|
+
GroupAction,
|
|
439
|
+
GroupContent,
|
|
440
|
+
GroupLabel,
|
|
441
|
+
Header,
|
|
442
|
+
Input,
|
|
443
|
+
Inset,
|
|
444
|
+
Menu,
|
|
445
|
+
MenuAction,
|
|
446
|
+
MenuButton,
|
|
447
|
+
MenuItem,
|
|
448
|
+
Rail,
|
|
449
|
+
Root,
|
|
450
|
+
Separator,
|
|
451
|
+
Trigger
|
|
452
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
SidebarContent,
|
|
4
|
+
SidebarFooter,
|
|
5
|
+
SidebarGroup,
|
|
6
|
+
SidebarGroupAction,
|
|
7
|
+
SidebarGroupContent,
|
|
8
|
+
SidebarGroupLabel,
|
|
9
|
+
SidebarHeader,
|
|
10
|
+
SidebarInput,
|
|
11
|
+
SidebarInset,
|
|
12
|
+
SidebarMenu,
|
|
13
|
+
SidebarMenuAction,
|
|
14
|
+
SidebarMenuButton,
|
|
15
|
+
SidebarMenuItem,
|
|
16
|
+
SidebarRail,
|
|
17
|
+
SidebarRoot,
|
|
18
|
+
SidebarSeparator,
|
|
19
|
+
SidebarTrigger
|
|
20
|
+
} from "./chunk-FPVGSRAX.mjs";
|
|
21
|
+
export {
|
|
22
|
+
SidebarContent as Content,
|
|
23
|
+
SidebarFooter as Footer,
|
|
24
|
+
SidebarGroup as Group,
|
|
25
|
+
SidebarGroupAction as GroupAction,
|
|
26
|
+
SidebarGroupContent as GroupContent,
|
|
27
|
+
SidebarGroupLabel as GroupLabel,
|
|
28
|
+
SidebarHeader as Header,
|
|
29
|
+
SidebarInput as Input,
|
|
30
|
+
SidebarInset as Inset,
|
|
31
|
+
SidebarMenu as Menu,
|
|
32
|
+
SidebarMenuAction as MenuAction,
|
|
33
|
+
SidebarMenuButton as MenuButton,
|
|
34
|
+
SidebarMenuItem as MenuItem,
|
|
35
|
+
SidebarRail as Rail,
|
|
36
|
+
SidebarRoot as Root,
|
|
37
|
+
SidebarSeparator as Separator,
|
|
38
|
+
SidebarTrigger as Trigger
|
|
39
|
+
};
|
package/dist/sidebar.d.mts
CHANGED
|
@@ -93,4 +93,4 @@ declare const Sidebar: typeof SidebarRoot & {
|
|
|
93
93
|
MenuAction: typeof SidebarMenuAction;
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
export { Sidebar, type SidebarContentProps, type SidebarGroupActionProps, type SidebarGroupContentProps, type SidebarGroupLabelProps, type SidebarGroupProps, type SidebarInsetProps, type SidebarMenuActionProps, type SidebarMenuButtonProps, type SidebarMenuItemProps, type SidebarMenuProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, type SidebarRailProps, type SidebarSeparatorProps, type SidebarTriggerProps, useSidebar };
|
|
96
|
+
export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarRoot, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, useSidebar };
|
package/dist/sidebar.d.ts
CHANGED
|
@@ -93,4 +93,4 @@ declare const Sidebar: typeof SidebarRoot & {
|
|
|
93
93
|
MenuAction: typeof SidebarMenuAction;
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
export { Sidebar, type SidebarContentProps, type SidebarGroupActionProps, type SidebarGroupContentProps, type SidebarGroupLabelProps, type SidebarGroupProps, type SidebarInsetProps, type SidebarMenuActionProps, type SidebarMenuButtonProps, type SidebarMenuItemProps, type SidebarMenuProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, type SidebarRailProps, type SidebarSeparatorProps, type SidebarTriggerProps, useSidebar };
|
|
96
|
+
export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarRoot, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, useSidebar };
|
package/dist/sidebar.js
CHANGED
|
@@ -22,7 +22,24 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var sidebar_exports = {};
|
|
23
23
|
__export(sidebar_exports, {
|
|
24
24
|
Sidebar: () => Sidebar,
|
|
25
|
+
SidebarContent: () => SidebarContent,
|
|
26
|
+
SidebarFooter: () => SidebarFooter,
|
|
27
|
+
SidebarGroup: () => SidebarGroup,
|
|
28
|
+
SidebarGroupAction: () => SidebarGroupAction,
|
|
29
|
+
SidebarGroupContent: () => SidebarGroupContent,
|
|
30
|
+
SidebarGroupLabel: () => SidebarGroupLabel,
|
|
31
|
+
SidebarHeader: () => SidebarHeader,
|
|
32
|
+
SidebarInput: () => SidebarInput,
|
|
33
|
+
SidebarInset: () => SidebarInset,
|
|
34
|
+
SidebarMenu: () => SidebarMenu,
|
|
35
|
+
SidebarMenuAction: () => SidebarMenuAction,
|
|
36
|
+
SidebarMenuButton: () => SidebarMenuButton,
|
|
37
|
+
SidebarMenuItem: () => SidebarMenuItem,
|
|
25
38
|
SidebarProvider: () => SidebarProvider,
|
|
39
|
+
SidebarRail: () => SidebarRail,
|
|
40
|
+
SidebarRoot: () => SidebarRoot,
|
|
41
|
+
SidebarSeparator: () => SidebarSeparator,
|
|
42
|
+
SidebarTrigger: () => SidebarTrigger,
|
|
26
43
|
useSidebar: () => useSidebar
|
|
27
44
|
});
|
|
28
45
|
module.exports = __toCommonJS(sidebar_exports);
|
|
@@ -214,7 +231,11 @@ function SidebarRoot({
|
|
|
214
231
|
}
|
|
215
232
|
);
|
|
216
233
|
}
|
|
217
|
-
function SidebarTrigger({
|
|
234
|
+
function SidebarTrigger({
|
|
235
|
+
className,
|
|
236
|
+
onClick,
|
|
237
|
+
...props
|
|
238
|
+
}) {
|
|
218
239
|
const { toggleSidebar, styles } = useSidebar();
|
|
219
240
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
220
241
|
import_button.IconButton,
|
|
@@ -300,7 +321,10 @@ function SidebarFooter({ className, ...props }) {
|
|
|
300
321
|
}
|
|
301
322
|
);
|
|
302
323
|
}
|
|
303
|
-
function SidebarSeparator({
|
|
324
|
+
function SidebarSeparator({
|
|
325
|
+
className,
|
|
326
|
+
...props
|
|
327
|
+
}) {
|
|
304
328
|
const { styles } = useSidebar();
|
|
305
329
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
330
|
import_separator.Separator,
|
|
@@ -484,6 +508,23 @@ var Sidebar = Object.assign(SidebarRoot, {
|
|
|
484
508
|
// Annotate the CommonJS export names for ESM import in node:
|
|
485
509
|
0 && (module.exports = {
|
|
486
510
|
Sidebar,
|
|
511
|
+
SidebarContent,
|
|
512
|
+
SidebarFooter,
|
|
513
|
+
SidebarGroup,
|
|
514
|
+
SidebarGroupAction,
|
|
515
|
+
SidebarGroupContent,
|
|
516
|
+
SidebarGroupLabel,
|
|
517
|
+
SidebarHeader,
|
|
518
|
+
SidebarInput,
|
|
519
|
+
SidebarInset,
|
|
520
|
+
SidebarMenu,
|
|
521
|
+
SidebarMenuAction,
|
|
522
|
+
SidebarMenuButton,
|
|
523
|
+
SidebarMenuItem,
|
|
487
524
|
SidebarProvider,
|
|
525
|
+
SidebarRail,
|
|
526
|
+
SidebarRoot,
|
|
527
|
+
SidebarSeparator,
|
|
528
|
+
SidebarTrigger,
|
|
488
529
|
useSidebar
|
|
489
530
|
});
|
package/dist/sidebar.mjs
CHANGED
|
@@ -1,11 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Sidebar,
|
|
4
|
+
SidebarContent,
|
|
5
|
+
SidebarFooter,
|
|
6
|
+
SidebarGroup,
|
|
7
|
+
SidebarGroupAction,
|
|
8
|
+
SidebarGroupContent,
|
|
9
|
+
SidebarGroupLabel,
|
|
10
|
+
SidebarHeader,
|
|
11
|
+
SidebarInput,
|
|
12
|
+
SidebarInset,
|
|
13
|
+
SidebarMenu,
|
|
14
|
+
SidebarMenuAction,
|
|
15
|
+
SidebarMenuButton,
|
|
16
|
+
SidebarMenuItem,
|
|
4
17
|
SidebarProvider,
|
|
18
|
+
SidebarRail,
|
|
19
|
+
SidebarRoot,
|
|
20
|
+
SidebarSeparator,
|
|
21
|
+
SidebarTrigger,
|
|
5
22
|
useSidebar
|
|
6
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FPVGSRAX.mjs";
|
|
7
24
|
export {
|
|
8
25
|
Sidebar,
|
|
26
|
+
SidebarContent,
|
|
27
|
+
SidebarFooter,
|
|
28
|
+
SidebarGroup,
|
|
29
|
+
SidebarGroupAction,
|
|
30
|
+
SidebarGroupContent,
|
|
31
|
+
SidebarGroupLabel,
|
|
32
|
+
SidebarHeader,
|
|
33
|
+
SidebarInput,
|
|
34
|
+
SidebarInset,
|
|
35
|
+
SidebarMenu,
|
|
36
|
+
SidebarMenuAction,
|
|
37
|
+
SidebarMenuButton,
|
|
38
|
+
SidebarMenuItem,
|
|
9
39
|
SidebarProvider,
|
|
40
|
+
SidebarRail,
|
|
41
|
+
SidebarRoot,
|
|
42
|
+
SidebarSeparator,
|
|
43
|
+
SidebarTrigger,
|
|
10
44
|
useSidebar
|
|
11
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/sidebar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sidebar"
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"motion": ">=12.23.6",
|
|
29
29
|
"react": ">=19.0.0-rc.0",
|
|
30
30
|
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
-
"@kopexa/theme": "1.6.
|
|
31
|
+
"@kopexa/theme": "1.6.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@radix-ui/react-slot": "^1.2.3",
|
|
35
|
-
"@kopexa/button": "7.0.
|
|
36
|
-
"@kopexa/icons": "9.0.
|
|
37
|
-
"@kopexa/input": "2.0.
|
|
35
|
+
"@kopexa/button": "7.0.3",
|
|
36
|
+
"@kopexa/icons": "9.0.3",
|
|
37
|
+
"@kopexa/input": "2.0.3",
|
|
38
38
|
"@kopexa/react-utils": "2.0.6",
|
|
39
|
-
"@kopexa/separator": "1.0.
|
|
39
|
+
"@kopexa/separator": "1.0.3",
|
|
40
40
|
"@kopexa/shared-utils": "1.1.5",
|
|
41
|
-
"@kopexa/tooltip": "5.0.
|
|
41
|
+
"@kopexa/tooltip": "5.0.3",
|
|
42
42
|
"@kopexa/use-is-mobile": "0.0.1",
|
|
43
|
-
"@kopexa/drawer": "9.0.
|
|
43
|
+
"@kopexa/drawer": "9.0.3"
|
|
44
44
|
},
|
|
45
45
|
"clean-package": "../../../clean-package.config.json",
|
|
46
46
|
"module": "dist/index.mjs",
|