asterui 0.12.32 → 0.12.33
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/components/Drawer.d.ts +34 -4
- package/dist/components/Drawer.js +240 -169
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/Layout.d.ts +40 -32
- package/dist/components/Layout.js +178 -130
- package/dist/components/Layout.js.map +1 -1
- package/dist/components/ResponsiveDrawer.d.ts +34 -0
- package/dist/components/ResponsiveDrawer.js +75 -0
- package/dist/components/ResponsiveDrawer.js.map +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +127 -129
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/PageLayout.d.ts +0 -9
- package/dist/components/PageLayout.js +0 -35
- package/dist/components/PageLayout.js.map +0 -1
- package/dist/components/SidebarDrawer.d.ts +0 -21
- package/dist/components/SidebarDrawer.js +0 -44
- package/dist/components/SidebarDrawer.js.map +0 -1
|
@@ -1,37 +1,56 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type SiderTheme = 'light' | 'dark';
|
|
3
|
+
export type SiderCollapsedType = 'clickTrigger' | 'responsive';
|
|
4
|
+
export interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
5
|
children: React.ReactNode;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
/** Whether contains Sider (auto-detected if not specified) */
|
|
7
|
+
hasSider?: boolean;
|
|
8
|
+
/** Test ID for testing */
|
|
9
|
+
'data-testid'?: string;
|
|
6
10
|
}
|
|
7
|
-
export interface LayoutHeaderProps {
|
|
11
|
+
export interface LayoutHeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
12
|
children: React.ReactNode;
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
/** Test ID for testing */
|
|
14
|
+
'data-testid'?: string;
|
|
11
15
|
}
|
|
12
|
-
export interface LayoutFooterProps {
|
|
16
|
+
export interface LayoutFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
13
17
|
children: React.ReactNode;
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
/** Test ID for testing */
|
|
19
|
+
'data-testid'?: string;
|
|
16
20
|
}
|
|
17
|
-
export interface LayoutContentProps {
|
|
21
|
+
export interface LayoutContentProps extends React.HTMLAttributes<HTMLElement> {
|
|
18
22
|
children: React.ReactNode;
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
/** Test ID for testing */
|
|
24
|
+
'data-testid'?: string;
|
|
21
25
|
}
|
|
22
|
-
export interface LayoutSiderProps {
|
|
26
|
+
export interface LayoutSiderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
23
27
|
children: React.ReactNode;
|
|
28
|
+
/** Width of the sider */
|
|
24
29
|
width?: number | string;
|
|
30
|
+
/** Width when collapsed */
|
|
25
31
|
collapsedWidth?: number | string;
|
|
32
|
+
/** Controlled collapsed state */
|
|
26
33
|
collapsed?: boolean;
|
|
34
|
+
/** Initial collapsed state (uncontrolled) */
|
|
27
35
|
defaultCollapsed?: boolean;
|
|
36
|
+
/** Whether can be collapsed */
|
|
28
37
|
collapsible?: boolean;
|
|
29
|
-
|
|
38
|
+
/** Callback when collapse state changes */
|
|
39
|
+
onCollapse?: (collapsed: boolean, type: SiderCollapsedType) => void;
|
|
40
|
+
/** Custom trigger element (null to hide) */
|
|
30
41
|
trigger?: React.ReactNode | null;
|
|
42
|
+
/** Responsive breakpoint for auto-collapse */
|
|
31
43
|
breakpoint?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
44
|
+
/** Callback when breakpoint is crossed */
|
|
32
45
|
onBreakpoint?: (broken: boolean) => void;
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
/** Reverse direction of arrow (for right-side sider) */
|
|
47
|
+
reverseArrow?: boolean;
|
|
48
|
+
/** Color theme of the sider */
|
|
49
|
+
theme?: SiderTheme;
|
|
50
|
+
/** Style for zero-width trigger */
|
|
51
|
+
zeroWidthTriggerStyle?: React.CSSProperties;
|
|
52
|
+
/** Test ID for testing */
|
|
53
|
+
'data-testid'?: string;
|
|
35
54
|
}
|
|
36
55
|
interface SiderContextValue {
|
|
37
56
|
collapsed: boolean;
|
|
@@ -39,21 +58,10 @@ interface SiderContextValue {
|
|
|
39
58
|
width: number | string;
|
|
40
59
|
}
|
|
41
60
|
export declare function useSiderContext(): SiderContextValue | null;
|
|
42
|
-
declare
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
declare function LayoutFooter({ children, className, style }: LayoutFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
declare function LayoutContent({ children, className, style }: LayoutContentProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
-
declare function LayoutSider({ children, width, collapsedWidth, collapsed: controlledCollapsed, defaultCollapsed, collapsible, onCollapse, trigger, breakpoint, onBreakpoint, className, style, }: LayoutSiderProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
declare namespace LayoutSider {
|
|
51
|
-
var displayName: string;
|
|
52
|
-
}
|
|
53
|
-
export declare const Layout: typeof LayoutRoot & {
|
|
54
|
-
Header: typeof LayoutHeader;
|
|
55
|
-
Footer: typeof LayoutFooter;
|
|
56
|
-
Content: typeof LayoutContent;
|
|
57
|
-
Sider: typeof LayoutSider;
|
|
61
|
+
export declare const Layout: React.ForwardRefExoticComponent<LayoutProps & React.RefAttributes<HTMLDivElement>> & {
|
|
62
|
+
Header: React.ForwardRefExoticComponent<LayoutHeaderProps & React.RefAttributes<HTMLElement>>;
|
|
63
|
+
Footer: React.ForwardRefExoticComponent<LayoutFooterProps & React.RefAttributes<HTMLElement>>;
|
|
64
|
+
Content: React.ForwardRefExoticComponent<LayoutContentProps & React.RefAttributes<HTMLElement>>;
|
|
65
|
+
Sider: React.ForwardRefExoticComponent<LayoutSiderProps & React.RefAttributes<HTMLElement>>;
|
|
58
66
|
};
|
|
59
67
|
export {};
|
|
@@ -1,140 +1,188 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { jsx as a, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import N, { forwardRef as y, useContext as Z, createContext as _, useState as S, useEffect as q, useCallback as G } from "react";
|
|
3
|
+
const B = _(null);
|
|
4
|
+
function I() {
|
|
5
|
+
return Z(B);
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
7
|
+
const v = y(
|
|
8
|
+
({ children: s, hasSider: o, className: n = "", "data-testid": e, ...l }, r) => {
|
|
9
|
+
const d = N.Children.toArray(s), f = d.some(
|
|
10
|
+
(t) => N.isValidElement(t) && t.type.displayName === "LayoutSider"
|
|
11
|
+
), c = o ?? f, p = [
|
|
12
|
+
"flex",
|
|
13
|
+
"min-h-0",
|
|
14
|
+
c ? "flex-row" : "flex-col",
|
|
15
|
+
n
|
|
16
|
+
].filter(Boolean).join(" "), b = c ? d.map((t) => {
|
|
17
|
+
if (N.isValidElement(t) && (t.type === v || t.type.displayName === "LayoutRoot") && t.type.displayName !== "LayoutSider") {
|
|
18
|
+
const g = t.props.className || "";
|
|
19
|
+
if (!g.includes("flex-1"))
|
|
20
|
+
return N.cloneElement(t, {
|
|
21
|
+
className: `flex-1 ${g}`.trim()
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
}) : s;
|
|
26
|
+
return /* @__PURE__ */ a("div", { ref: r, className: p, "data-testid": e, ...l, children: b });
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
v.displayName = "LayoutRoot";
|
|
30
|
+
const E = y(
|
|
31
|
+
({ children: s, className: o = "", "data-testid": n, ...e }, l) => {
|
|
32
|
+
const r = [
|
|
33
|
+
"flex",
|
|
34
|
+
"items-center",
|
|
35
|
+
"px-6",
|
|
36
|
+
"h-16",
|
|
37
|
+
"bg-base-300",
|
|
38
|
+
"flex-shrink-0",
|
|
39
|
+
o
|
|
40
|
+
].filter(Boolean).join(" ");
|
|
41
|
+
return /* @__PURE__ */ a("header", { ref: l, className: r, "data-testid": n, ...e, children: s });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
E.displayName = "LayoutHeader";
|
|
45
|
+
const R = y(
|
|
46
|
+
({ children: s, className: o = "", "data-testid": n, ...e }, l) => {
|
|
47
|
+
const r = [
|
|
48
|
+
"px-6",
|
|
49
|
+
"py-4",
|
|
50
|
+
"text-center",
|
|
51
|
+
"bg-base-300",
|
|
52
|
+
"flex-shrink-0",
|
|
53
|
+
o
|
|
54
|
+
].filter(Boolean).join(" ");
|
|
55
|
+
return /* @__PURE__ */ a("footer", { ref: l, className: r, "data-testid": n, ...e, children: s });
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
R.displayName = "LayoutFooter";
|
|
59
|
+
const $ = y(
|
|
60
|
+
({ children: s, className: o = "", "data-testid": n, ...e }, l) => {
|
|
61
|
+
const r = ["flex-1", "min-h-0", "overflow-auto", o].filter(Boolean).join(" ");
|
|
62
|
+
return /* @__PURE__ */ a("main", { ref: l, className: r, "data-testid": n, ...e, children: s });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
$.displayName = "LayoutContent";
|
|
66
|
+
const J = {
|
|
56
67
|
sm: "(max-width: 639px)",
|
|
57
68
|
md: "(max-width: 767px)",
|
|
58
69
|
lg: "(max-width: 1023px)",
|
|
59
70
|
xl: "(max-width: 1279px)",
|
|
60
71
|
"2xl": "(max-width: 1535px)"
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
72
|
+
}, A = y(
|
|
73
|
+
({
|
|
74
|
+
children: s,
|
|
75
|
+
width: o = 200,
|
|
76
|
+
collapsedWidth: n = 80,
|
|
77
|
+
collapsed: e,
|
|
78
|
+
defaultCollapsed: l = !1,
|
|
79
|
+
collapsible: r = !1,
|
|
80
|
+
onCollapse: d,
|
|
81
|
+
trigger: f,
|
|
82
|
+
breakpoint: c,
|
|
83
|
+
onBreakpoint: p,
|
|
84
|
+
reverseArrow: b = !1,
|
|
85
|
+
theme: t = "dark",
|
|
86
|
+
zeroWidthTriggerStyle: g,
|
|
87
|
+
className: M = "",
|
|
88
|
+
style: T,
|
|
89
|
+
"data-testid": x,
|
|
90
|
+
...W
|
|
91
|
+
}, z) => {
|
|
92
|
+
const [F, L] = S(l), [w, H] = S(!1), i = e ?? F;
|
|
93
|
+
q(() => {
|
|
94
|
+
if (!c) return;
|
|
95
|
+
const m = window.matchMedia(J[c]), C = (K) => {
|
|
96
|
+
const h = K.matches;
|
|
97
|
+
H(h), p?.(h), e === void 0 && L(h), h !== w && d?.(h, "responsive");
|
|
98
|
+
};
|
|
99
|
+
return C(m), m.addEventListener("change", C), () => m.removeEventListener("change", C);
|
|
100
|
+
}, [c, p, e, d, w]);
|
|
101
|
+
const k = G(() => {
|
|
102
|
+
const m = !i;
|
|
103
|
+
e === void 0 && L(m), d?.(m, "clickTrigger");
|
|
104
|
+
}, [i, e, d]), u = i ? n : o, j = u === 0 || u === "0" || u === "0px", P = [
|
|
105
|
+
"flex",
|
|
106
|
+
"flex-col",
|
|
107
|
+
{
|
|
108
|
+
light: "bg-base-100",
|
|
109
|
+
dark: "bg-base-200"
|
|
110
|
+
}[t],
|
|
111
|
+
"flex-shrink-0",
|
|
112
|
+
"transition-all",
|
|
113
|
+
"duration-200",
|
|
114
|
+
"relative",
|
|
115
|
+
M
|
|
116
|
+
].filter(Boolean).join(" "), O = () => b ? i ? "" : "rotate-180" : i ? "rotate-180" : "", V = r && f !== null && /* @__PURE__ */ a(
|
|
117
|
+
"button",
|
|
118
|
+
{
|
|
119
|
+
onClick: k,
|
|
120
|
+
className: "flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors",
|
|
121
|
+
"aria-label": i ? "Expand sidebar" : "Collapse sidebar",
|
|
122
|
+
"data-testid": x ? `${x}-trigger` : void 0,
|
|
123
|
+
children: /* @__PURE__ */ a(
|
|
124
|
+
"svg",
|
|
125
|
+
{
|
|
126
|
+
className: `w-4 h-4 transition-transform ${O()}`,
|
|
127
|
+
fill: "none",
|
|
128
|
+
viewBox: "0 0 24 24",
|
|
129
|
+
stroke: "currentColor",
|
|
130
|
+
children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
), D = r && j && i && /* @__PURE__ */ a(
|
|
135
|
+
"button",
|
|
136
|
+
{
|
|
137
|
+
onClick: k,
|
|
138
|
+
className: "absolute top-1/2 -translate-y-1/2 right-0 translate-x-full w-6 h-12 flex items-center justify-center bg-base-300 hover:bg-base-content/10 transition-colors rounded-r z-10",
|
|
139
|
+
"aria-label": "Expand sidebar",
|
|
140
|
+
style: g,
|
|
141
|
+
"data-testid": x ? `${x}-zero-trigger` : void 0,
|
|
142
|
+
children: /* @__PURE__ */ a(
|
|
143
|
+
"svg",
|
|
144
|
+
{
|
|
145
|
+
className: `w-3 h-3 ${b ? "rotate-180" : ""}`,
|
|
146
|
+
fill: "none",
|
|
147
|
+
viewBox: "0 0 24 24",
|
|
148
|
+
stroke: "currentColor",
|
|
149
|
+
children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
return /* @__PURE__ */ a(B.Provider, { value: { collapsed: i, collapsedWidth: n, width: o }, children: /* @__PURE__ */ Q(
|
|
155
|
+
"aside",
|
|
156
|
+
{
|
|
157
|
+
ref: z,
|
|
158
|
+
className: P,
|
|
159
|
+
style: {
|
|
160
|
+
width: typeof u == "number" ? `${u}px` : u,
|
|
161
|
+
...T
|
|
162
|
+
},
|
|
163
|
+
"data-collapsed": i,
|
|
164
|
+
"data-theme": t,
|
|
165
|
+
"data-testid": x,
|
|
166
|
+
"aria-expanded": !i,
|
|
167
|
+
...W,
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ a("div", { className: "flex-1 overflow-auto", children: s }),
|
|
170
|
+
!j && f !== null && (f ?? V),
|
|
171
|
+
D
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
) });
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
A.displayName = "LayoutSider";
|
|
178
|
+
const ee = Object.assign(v, {
|
|
179
|
+
Header: E,
|
|
180
|
+
Footer: R,
|
|
181
|
+
Content: $,
|
|
182
|
+
Sider: A
|
|
135
183
|
});
|
|
136
184
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
185
|
+
ee as Layout,
|
|
186
|
+
I as useSiderContext
|
|
139
187
|
};
|
|
140
188
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sources":["../../src/components/Layout.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useCallback, useEffect } from 'react'\n\nexport interface LayoutProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutHeaderProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutFooterProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutContentProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutSiderProps {\n children: React.ReactNode\n width?: number | string\n collapsedWidth?: number | string\n collapsed?: boolean\n defaultCollapsed?: boolean\n collapsible?: boolean\n onCollapse?: (collapsed: boolean) => void\n trigger?: React.ReactNode | null\n breakpoint?: 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n onBreakpoint?: (broken: boolean) => void\n className?: string\n style?: React.CSSProperties\n}\n\ninterface SiderContextValue {\n collapsed: boolean\n collapsedWidth: number | string\n width: number | string\n}\n\nconst SiderContext = createContext<SiderContextValue | null>(null)\n\nexport function useSiderContext() {\n return useContext(SiderContext)\n}\n\nfunction LayoutRoot({ children, className = '', style }: LayoutProps) {\n // Check if any child is a Sider to determine flex direction\n const childArray = React.Children.toArray(children)\n const hasSider = childArray.some(\n (child) => React.isValidElement(child) && (child.type as any).displayName === 'LayoutSider'\n )\n\n const layoutClasses = [\n 'flex',\n 'min-h-0',\n hasSider ? 'flex-row' : 'flex-col',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // If we have a Sider, auto-add flex-1 to non-Sider Layout children\n const processedChildren = hasSider\n ? childArray.map((child) => {\n if (\n React.isValidElement(child) &&\n (child.type === LayoutRoot || (child.type as any).displayName === 'LayoutRoot') &&\n (child.type as any).displayName !== 'LayoutSider'\n ) {\n // Clone the Layout child and add flex-1 if not already present\n const existingClassName = (child.props as any).className || ''\n if (!existingClassName.includes('flex-1')) {\n return React.cloneElement(child as React.ReactElement<any>, {\n className: `flex-1 ${existingClassName}`.trim(),\n })\n }\n }\n return child\n })\n : children\n\n return (\n <div className={layoutClasses} style={style}>\n {processedChildren}\n </div>\n )\n}\n\nLayoutRoot.displayName = 'LayoutRoot'\n\nfunction LayoutHeader({ children, className = '', style }: LayoutHeaderProps) {\n const headerClasses = [\n 'flex',\n 'items-center',\n 'px-6',\n 'h-16',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <header className={headerClasses} style={style}>\n {children}\n </header>\n )\n}\n\nfunction LayoutFooter({ children, className = '', style }: LayoutFooterProps) {\n const footerClasses = [\n 'px-6',\n 'py-4',\n 'text-center',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <footer className={footerClasses} style={style}>\n {children}\n </footer>\n )\n}\n\nfunction LayoutContent({ children, className = '', style }: LayoutContentProps) {\n // flex-1 by default so Content fills available space\n const contentClasses = ['flex-1', 'min-h-0', 'overflow-auto', className].filter(Boolean).join(' ')\n\n return (\n <main className={contentClasses} style={style}>\n {children}\n </main>\n )\n}\n\nconst BREAKPOINT_MAP: Record<string, string> = {\n sm: '(max-width: 639px)',\n md: '(max-width: 767px)',\n lg: '(max-width: 1023px)',\n xl: '(max-width: 1279px)',\n '2xl': '(max-width: 1535px)',\n}\n\nfunction LayoutSider({\n children,\n width = 200,\n collapsedWidth = 80,\n collapsed: controlledCollapsed,\n defaultCollapsed = false,\n collapsible = false,\n onCollapse,\n trigger,\n breakpoint,\n onBreakpoint,\n className = '',\n style,\n}: LayoutSiderProps) {\n const [internalCollapsed, setInternalCollapsed] = useState(defaultCollapsed)\n const [broken, setBroken] = useState(false)\n\n const collapsed = controlledCollapsed ?? internalCollapsed\n\n // Handle responsive breakpoint\n useEffect(() => {\n if (!breakpoint) return\n\n const mediaQuery = window.matchMedia(BREAKPOINT_MAP[breakpoint])\n\n const handleChange = (e: MediaQueryListEvent | MediaQueryList) => {\n const isBroken = e.matches\n setBroken(isBroken)\n onBreakpoint?.(isBroken)\n\n // Auto-collapse when breakpoint is crossed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(isBroken)\n }\n if (isBroken !== broken) {\n onCollapse?.(isBroken)\n }\n }\n\n // Check initial state\n handleChange(mediaQuery)\n\n // Listen for changes\n mediaQuery.addEventListener('change', handleChange)\n return () => mediaQuery.removeEventListener('change', handleChange)\n }, [breakpoint, onBreakpoint, controlledCollapsed, onCollapse, broken])\n\n const handleCollapse = useCallback(() => {\n const newCollapsed = !collapsed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(newCollapsed)\n }\n onCollapse?.(newCollapsed)\n }, [collapsed, controlledCollapsed, onCollapse])\n\n const currentWidth = collapsed ? collapsedWidth : width\n\n const siderClasses = [\n 'flex',\n 'flex-col',\n 'bg-base-200',\n 'flex-shrink-0',\n 'transition-all',\n 'duration-200',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const defaultTrigger = collapsible && trigger !== null && (\n <button\n onClick={handleCollapse}\n className=\"flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors\"\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n >\n <svg\n className={`w-4 h-4 transition-transform ${collapsed ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )\n\n return (\n <SiderContext.Provider value={{ collapsed, collapsedWidth, width }}>\n <aside\n className={siderClasses}\n style={{\n width: typeof currentWidth === 'number' ? `${currentWidth}px` : currentWidth,\n ...style,\n }}\n >\n <div className=\"flex-1 overflow-auto\">{children}</div>\n {trigger !== null && (trigger ?? defaultTrigger)}\n </aside>\n </SiderContext.Provider>\n )\n}\n\nLayoutSider.displayName = 'LayoutSider'\n\nexport const Layout = Object.assign(LayoutRoot, {\n Header: LayoutHeader,\n Footer: LayoutFooter,\n Content: LayoutContent,\n Sider: LayoutSider,\n})\n"],"names":["SiderContext","createContext","useSiderContext","useContext","LayoutRoot","children","className","style","childArray","React","hasSider","child","layoutClasses","processedChildren","existingClassName","jsx","LayoutHeader","headerClasses","LayoutFooter","footerClasses","LayoutContent","contentClasses","BREAKPOINT_MAP","LayoutSider","width","collapsedWidth","controlledCollapsed","defaultCollapsed","collapsible","onCollapse","trigger","breakpoint","onBreakpoint","internalCollapsed","setInternalCollapsed","useState","broken","setBroken","collapsed","useEffect","mediaQuery","handleChange","e","isBroken","handleCollapse","useCallback","newCollapsed","currentWidth","siderClasses","defaultTrigger","jsxs","Layout"],"mappings":";;AA+CA,MAAMA,IAAeC,EAAwC,IAAI;AAE1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AA,MACX,OAAO;AAAA,QACL,OAAO,OAAOD,KAAiB,WAAW,GAAGA,CAAY,OAAOA;AAAA,QAChE,GAAGxC;AAAA,MAAA;AAAA,MAGL,UAAA;AAAA,QAAA,gBAAAQ,EAAC,OAAA,EAAI,WAAU,wBAAwB,UAAAV,EAAA,CAAS;AAAA,QAC/CyB,MAAY,SAASA,KAAWmB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAErC;AAEJ;AAEA1B,EAAY,cAAc;AAEnB,MAAM4B,IAAS,OAAO,OAAO/C,GAAY;AAAA,EAC9C,QAAQY;AAAA,EACR,QAAQE;AAAA,EACR,SAASE;AAAA,EACT,OAAOG;AACT,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Layout.js","sources":["../../src/components/Layout.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useCallback, useEffect, forwardRef } from 'react'\n\nexport type SiderTheme = 'light' | 'dark'\nexport type SiderCollapsedType = 'clickTrigger' | 'responsive'\n\nexport interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n /** Whether contains Sider (auto-detected if not specified) */\n hasSider?: boolean\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nexport interface LayoutHeaderProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nexport interface LayoutFooterProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nexport interface LayoutContentProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nexport interface LayoutSiderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {\n children: React.ReactNode\n /** Width of the sider */\n width?: number | string\n /** Width when collapsed */\n collapsedWidth?: number | string\n /** Controlled collapsed state */\n collapsed?: boolean\n /** Initial collapsed state (uncontrolled) */\n defaultCollapsed?: boolean\n /** Whether can be collapsed */\n collapsible?: boolean\n /** Callback when collapse state changes */\n onCollapse?: (collapsed: boolean, type: SiderCollapsedType) => void\n /** Custom trigger element (null to hide) */\n trigger?: React.ReactNode | null\n /** Responsive breakpoint for auto-collapse */\n breakpoint?: 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n /** Callback when breakpoint is crossed */\n onBreakpoint?: (broken: boolean) => void\n /** Reverse direction of arrow (for right-side sider) */\n reverseArrow?: boolean\n /** Color theme of the sider */\n theme?: SiderTheme\n /** Style for zero-width trigger */\n zeroWidthTriggerStyle?: React.CSSProperties\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\ninterface SiderContextValue {\n collapsed: boolean\n collapsedWidth: number | string\n width: number | string\n}\n\nconst SiderContext = createContext<SiderContextValue | null>(null)\n\nexport function useSiderContext() {\n return useContext(SiderContext)\n}\n\nconst LayoutRoot = forwardRef<HTMLDivElement, LayoutProps>(\n ({ children, hasSider: hasSiderProp, className = '', 'data-testid': testId, ...rest }, ref) => {\n // Check if any child is a Sider to determine flex direction\n const childArray = React.Children.toArray(children)\n const hasSiderDetected = childArray.some(\n (child) => React.isValidElement(child) && (child.type as any).displayName === 'LayoutSider'\n )\n const hasSider = hasSiderProp ?? hasSiderDetected\n\n const layoutClasses = [\n 'flex',\n 'min-h-0',\n hasSider ? 'flex-row' : 'flex-col',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // If we have a Sider, auto-add flex-1 to non-Sider Layout children\n const processedChildren = hasSider\n ? childArray.map((child) => {\n if (\n React.isValidElement(child) &&\n (child.type === LayoutRoot || (child.type as any).displayName === 'LayoutRoot') &&\n (child.type as any).displayName !== 'LayoutSider'\n ) {\n // Clone the Layout child and add flex-1 if not already present\n const existingClassName = (child.props as any).className || ''\n if (!existingClassName.includes('flex-1')) {\n return React.cloneElement(child as React.ReactElement<any>, {\n className: `flex-1 ${existingClassName}`.trim(),\n })\n }\n }\n return child\n })\n : children\n\n return (\n <div ref={ref} className={layoutClasses} data-testid={testId} {...rest}>\n {processedChildren}\n </div>\n )\n }\n)\n\nLayoutRoot.displayName = 'LayoutRoot'\n\nconst LayoutHeader = forwardRef<HTMLElement, LayoutHeaderProps>(\n ({ children, className = '', 'data-testid': testId, ...rest }, ref) => {\n const headerClasses = [\n 'flex',\n 'items-center',\n 'px-6',\n 'h-16',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <header ref={ref} className={headerClasses} data-testid={testId} {...rest}>\n {children}\n </header>\n )\n }\n)\n\nLayoutHeader.displayName = 'LayoutHeader'\n\nconst LayoutFooter = forwardRef<HTMLElement, LayoutFooterProps>(\n ({ children, className = '', 'data-testid': testId, ...rest }, ref) => {\n const footerClasses = [\n 'px-6',\n 'py-4',\n 'text-center',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <footer ref={ref} className={footerClasses} data-testid={testId} {...rest}>\n {children}\n </footer>\n )\n }\n)\n\nLayoutFooter.displayName = 'LayoutFooter'\n\nconst LayoutContent = forwardRef<HTMLElement, LayoutContentProps>(\n ({ children, className = '', 'data-testid': testId, ...rest }, ref) => {\n // flex-1 by default so Content fills available space\n const contentClasses = ['flex-1', 'min-h-0', 'overflow-auto', className].filter(Boolean).join(' ')\n\n return (\n <main ref={ref} className={contentClasses} data-testid={testId} {...rest}>\n {children}\n </main>\n )\n }\n)\n\nLayoutContent.displayName = 'LayoutContent'\n\nconst BREAKPOINT_MAP: Record<string, string> = {\n sm: '(max-width: 639px)',\n md: '(max-width: 767px)',\n lg: '(max-width: 1023px)',\n xl: '(max-width: 1279px)',\n '2xl': '(max-width: 1535px)',\n}\n\nconst LayoutSider = forwardRef<HTMLElement, LayoutSiderProps>(\n (\n {\n children,\n width = 200,\n collapsedWidth = 80,\n collapsed: controlledCollapsed,\n defaultCollapsed = false,\n collapsible = false,\n onCollapse,\n trigger,\n breakpoint,\n onBreakpoint,\n reverseArrow = false,\n theme = 'dark',\n zeroWidthTriggerStyle,\n className = '',\n style,\n 'data-testid': testId,\n ...rest\n },\n ref\n ) => {\n const [internalCollapsed, setInternalCollapsed] = useState(defaultCollapsed)\n const [broken, setBroken] = useState(false)\n\n const collapsed = controlledCollapsed ?? internalCollapsed\n\n // Handle responsive breakpoint\n useEffect(() => {\n if (!breakpoint) return\n\n const mediaQuery = window.matchMedia(BREAKPOINT_MAP[breakpoint])\n\n const handleChange = (e: MediaQueryListEvent | MediaQueryList) => {\n const isBroken = e.matches\n setBroken(isBroken)\n onBreakpoint?.(isBroken)\n\n // Auto-collapse when breakpoint is crossed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(isBroken)\n }\n if (isBroken !== broken) {\n onCollapse?.(isBroken, 'responsive')\n }\n }\n\n // Check initial state\n handleChange(mediaQuery)\n\n // Listen for changes\n mediaQuery.addEventListener('change', handleChange)\n return () => mediaQuery.removeEventListener('change', handleChange)\n }, [breakpoint, onBreakpoint, controlledCollapsed, onCollapse, broken])\n\n const handleCollapse = useCallback(() => {\n const newCollapsed = !collapsed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(newCollapsed)\n }\n onCollapse?.(newCollapsed, 'clickTrigger')\n }, [collapsed, controlledCollapsed, onCollapse])\n\n const currentWidth = collapsed ? collapsedWidth : width\n const isZeroWidth = currentWidth === 0 || currentWidth === '0' || currentWidth === '0px'\n\n const themeClasses: Record<SiderTheme, string> = {\n light: 'bg-base-100',\n dark: 'bg-base-200',\n }\n\n const siderClasses = [\n 'flex',\n 'flex-col',\n themeClasses[theme],\n 'flex-shrink-0',\n 'transition-all',\n 'duration-200',\n 'relative',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // Determine arrow rotation based on collapsed state and reverseArrow prop\n const getArrowRotation = () => {\n if (reverseArrow) {\n return collapsed ? '' : 'rotate-180'\n }\n return collapsed ? 'rotate-180' : ''\n }\n\n const defaultTrigger = collapsible && trigger !== null && (\n <button\n onClick={handleCollapse}\n className=\"flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors\"\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n data-testid={testId ? `${testId}-trigger` : undefined}\n >\n <svg\n className={`w-4 h-4 transition-transform ${getArrowRotation()}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )\n\n // Zero-width trigger (floating button when sider is collapsed to 0)\n const zeroWidthTrigger = collapsible && isZeroWidth && collapsed && (\n <button\n onClick={handleCollapse}\n className=\"absolute top-1/2 -translate-y-1/2 right-0 translate-x-full w-6 h-12 flex items-center justify-center bg-base-300 hover:bg-base-content/10 transition-colors rounded-r z-10\"\n aria-label=\"Expand sidebar\"\n style={zeroWidthTriggerStyle}\n data-testid={testId ? `${testId}-zero-trigger` : undefined}\n >\n <svg\n className={`w-3 h-3 ${reverseArrow ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n )\n\n return (\n <SiderContext.Provider value={{ collapsed, collapsedWidth, width }}>\n <aside\n ref={ref}\n className={siderClasses}\n style={{\n width: typeof currentWidth === 'number' ? `${currentWidth}px` : currentWidth,\n ...style,\n }}\n data-collapsed={collapsed}\n data-theme={theme}\n data-testid={testId}\n aria-expanded={!collapsed}\n {...rest}\n >\n <div className=\"flex-1 overflow-auto\">{children}</div>\n {!isZeroWidth && trigger !== null && (trigger ?? defaultTrigger)}\n {zeroWidthTrigger}\n </aside>\n </SiderContext.Provider>\n )\n }\n)\n\nLayoutSider.displayName = 'LayoutSider'\n\nexport const Layout = Object.assign(LayoutRoot, {\n Header: LayoutHeader,\n Footer: LayoutFooter,\n Content: LayoutContent,\n Sider: LayoutSider,\n})\n"],"names":["SiderContext","createContext","useSiderContext","useContext","LayoutRoot","forwardRef","children","hasSiderProp","className","testId","rest","ref","childArray","React","hasSiderDetected","child","hasSider","layoutClasses","processedChildren","existingClassName","jsx","LayoutHeader","headerClasses","LayoutFooter","footerClasses","LayoutContent","contentClasses","BREAKPOINT_MAP","LayoutSider","width","collapsedWidth","controlledCollapsed","defaultCollapsed","collapsible","onCollapse","trigger","breakpoint","onBreakpoint","reverseArrow","theme","zeroWidthTriggerStyle","style","internalCollapsed","setInternalCollapsed","useState","broken","setBroken","collapsed","useEffect","mediaQuery","handleChange","e","isBroken","handleCollapse","useCallback","newCollapsed","currentWidth","isZeroWidth","siderClasses","getArrowRotation","defaultTrigger","zeroWidthTrigger","jsxs","Layout"],"mappings":";;AAmEA,MAAMA,IAAeC,EAAwC,IAAI;AAE1D,SAASC,IAAkB;AAChC,SAAOC,EAAWH,CAAY;AAChC;AAEA,MAAMI,IAAaC;AAAA,EACjB,CAAC,EAAE,UAAAC,GAAU,UAAUC,GAAc,WAAAC,IAAY,IAAI,eAAeC,GAAQ,GAAGC,EAAA,GAAQC,MAAQ;AAE7F,UAAMC,IAAaC,EAAM,SAAS,QAAQP,CAAQ,GAC5CQ,IAAmBF,EAAW;AAAA,MAClC,CAACG,MAAUF,EAAM,eAAeE,CAAK,KAAMA,EAAM,KAAa,gBAAgB;AAAA,IAAA,GAE1EC,IAAWT,KAAgBO,GAE3BG,IAAgB;AAAA,MACpB;AAAA,MACA;AAAA,MACAD,IAAW,aAAa;AAAA,MACxBR;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAGLU,IAAoBF,IACtBJ,EAAW,IAAI,CAACG,MAAU;AACxB,UACEF,EAAM,eAAeE,CAAK,MACzBA,EAAM,SAASX,KAAeW,EAAM,KAAa,gBAAgB,iBACjEA,EAAM,KAAa,gBAAgB,eACpC;AAEA,cAAMI,IAAqBJ,EAAM,MAAc,aAAa;AAC5D,YAAI,CAACI,EAAkB,SAAS,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2
|
+
export type ResponsiveDrawerBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
export interface ResponsiveDrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Main content area */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Sidebar content */
|
|
7
|
+
sidebar: React.ReactNode;
|
|
8
|
+
/** Controlled open state */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/** Callback when open state changes */
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
/** Position sidebar on the right side */
|
|
13
|
+
end?: boolean;
|
|
14
|
+
/** Width of the sidebar */
|
|
15
|
+
width?: number | string;
|
|
16
|
+
/** Breakpoint at which sidebar becomes always visible (e.g., 'lg' for lg:drawer-open) */
|
|
17
|
+
responsive?: ResponsiveDrawerBreakpoint;
|
|
18
|
+
/** Additional classes for sidebar container */
|
|
19
|
+
sidebarClassName?: string;
|
|
20
|
+
/** Additional classes for content area */
|
|
21
|
+
contentClassName?: string;
|
|
22
|
+
/** Additional classes for the overlay */
|
|
23
|
+
overlayClassName?: string;
|
|
24
|
+
/** Unique ID for the drawer (auto-generated if not provided) */
|
|
25
|
+
id?: string;
|
|
26
|
+
/** Test ID for testing */
|
|
27
|
+
'data-testid'?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ResponsiveDrawer - A responsive sidebar layout using DaisyUI's drawer.
|
|
31
|
+
* Use for navigation sidebars that toggle on mobile but can be always visible on larger screens.
|
|
32
|
+
* For overlay panel drawers (forms, details), use the Drawer component instead.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ResponsiveDrawer: React.ForwardRefExoticComponent<ResponsiveDrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import R, { forwardRef as k } from "react";
|
|
3
|
+
const I = k(
|
|
4
|
+
({
|
|
5
|
+
children: n,
|
|
6
|
+
sidebar: i,
|
|
7
|
+
open: s = !1,
|
|
8
|
+
onOpenChange: c,
|
|
9
|
+
end: r = !1,
|
|
10
|
+
width: a = 320,
|
|
11
|
+
responsive: l,
|
|
12
|
+
className: m = "",
|
|
13
|
+
sidebarClassName: w = "",
|
|
14
|
+
contentClassName: p = "",
|
|
15
|
+
overlayClassName: g = "",
|
|
16
|
+
id: f,
|
|
17
|
+
"data-testid": h,
|
|
18
|
+
...b
|
|
19
|
+
}, v) => {
|
|
20
|
+
const x = R.useId(), o = f || x, y = (B) => {
|
|
21
|
+
c?.(B.target.checked);
|
|
22
|
+
}, C = [
|
|
23
|
+
"drawer",
|
|
24
|
+
r && "drawer-end",
|
|
25
|
+
l && {
|
|
26
|
+
sm: "sm:drawer-open",
|
|
27
|
+
md: "md:drawer-open",
|
|
28
|
+
lg: "lg:drawer-open",
|
|
29
|
+
xl: "xl:drawer-open",
|
|
30
|
+
"2xl": "2xl:drawer-open"
|
|
31
|
+
}[l],
|
|
32
|
+
m
|
|
33
|
+
].filter(Boolean).join(" "), N = ["bg-base-200 min-h-full p-4", w].filter(Boolean).join(" "), j = ["drawer-content", p].filter(Boolean).join(" "), u = ["drawer-overlay", g].filter(Boolean).join(" "), t = typeof a == "number" ? `${a}px` : a;
|
|
34
|
+
return /* @__PURE__ */ d(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
ref: v,
|
|
38
|
+
className: C,
|
|
39
|
+
"data-state": s ? "open" : "closed",
|
|
40
|
+
"data-testid": h,
|
|
41
|
+
...b,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
"input",
|
|
45
|
+
{
|
|
46
|
+
id: o,
|
|
47
|
+
type: "checkbox",
|
|
48
|
+
className: "drawer-toggle",
|
|
49
|
+
checked: s,
|
|
50
|
+
onChange: y,
|
|
51
|
+
"aria-label": r ? "Toggle right sidebar" : "Toggle sidebar"
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ e("div", { className: j, children: n }),
|
|
55
|
+
/* @__PURE__ */ d("div", { className: "drawer-side", style: { "--drawer-width": t }, children: [
|
|
56
|
+
/* @__PURE__ */ e(
|
|
57
|
+
"label",
|
|
58
|
+
{
|
|
59
|
+
htmlFor: o,
|
|
60
|
+
"aria-label": "Close sidebar",
|
|
61
|
+
className: u
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ e("div", { className: N, style: { width: t }, children: i })
|
|
65
|
+
] })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
I.displayName = "ResponsiveDrawer";
|
|
72
|
+
export {
|
|
73
|
+
I as ResponsiveDrawer
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=ResponsiveDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveDrawer.js","sources":["../../src/components/ResponsiveDrawer.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nexport type ResponsiveDrawerBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n\nexport interface ResponsiveDrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Main content area */\n children: React.ReactNode\n /** Sidebar content */\n sidebar: React.ReactNode\n /** Controlled open state */\n open?: boolean\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void\n /** Position sidebar on the right side */\n end?: boolean\n /** Width of the sidebar */\n width?: number | string\n /** Breakpoint at which sidebar becomes always visible (e.g., 'lg' for lg:drawer-open) */\n responsive?: ResponsiveDrawerBreakpoint\n /** Additional classes for sidebar container */\n sidebarClassName?: string\n /** Additional classes for content area */\n contentClassName?: string\n /** Additional classes for the overlay */\n overlayClassName?: string\n /** Unique ID for the drawer (auto-generated if not provided) */\n id?: string\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\n/**\n * ResponsiveDrawer - A responsive sidebar layout using DaisyUI's drawer.\n * Use for navigation sidebars that toggle on mobile but can be always visible on larger screens.\n * For overlay panel drawers (forms, details), use the Drawer component instead.\n */\nexport const ResponsiveDrawer = forwardRef<HTMLDivElement, ResponsiveDrawerProps>(\n (\n {\n children,\n sidebar,\n open = false,\n onOpenChange,\n end = false,\n width = 320,\n responsive,\n className = '',\n sidebarClassName = '',\n contentClassName = '',\n overlayClassName = '',\n id,\n 'data-testid': testId,\n ...rest\n },\n ref\n ) => {\n const autoId = React.useId()\n const drawerId = id || autoId\n\n const handleToggle = (e: React.ChangeEvent<HTMLInputElement>) => {\n onOpenChange?.(e.target.checked)\n }\n\n // Build responsive class if specified\n const responsiveClasses: Record<ResponsiveDrawerBreakpoint, string> = {\n sm: 'sm:drawer-open',\n md: 'md:drawer-open',\n lg: 'lg:drawer-open',\n xl: 'xl:drawer-open',\n '2xl': '2xl:drawer-open',\n }\n\n const drawerClasses = [\n 'drawer',\n end && 'drawer-end',\n responsive && responsiveClasses[responsive],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const sidebarClasses = ['bg-base-200 min-h-full p-4', sidebarClassName]\n .filter(Boolean)\n .join(' ')\n\n const contentClasses = ['drawer-content', contentClassName]\n .filter(Boolean)\n .join(' ')\n\n const overlayClasses = ['drawer-overlay', overlayClassName]\n .filter(Boolean)\n .join(' ')\n\n // Calculate width style\n const widthStyle = typeof width === 'number' ? `${width}px` : width\n\n return (\n <div\n ref={ref}\n className={drawerClasses}\n data-state={open ? 'open' : 'closed'}\n data-testid={testId}\n {...rest}\n >\n <input\n id={drawerId}\n type=\"checkbox\"\n className=\"drawer-toggle\"\n checked={open}\n onChange={handleToggle}\n aria-label={end ? 'Toggle right sidebar' : 'Toggle sidebar'}\n />\n <div className={contentClasses}>{children}</div>\n <div className=\"drawer-side\" style={{ '--drawer-width': widthStyle } as React.CSSProperties}>\n <label\n htmlFor={drawerId}\n aria-label=\"Close sidebar\"\n className={overlayClasses}\n />\n <div className={sidebarClasses} style={{ width: widthStyle }}>\n {sidebar}\n </div>\n </div>\n </div>\n )\n }\n)\n\nResponsiveDrawer.displayName = 'ResponsiveDrawer'\n"],"names":["ResponsiveDrawer","forwardRef","children","sidebar","open","onOpenChange","end","width","responsive","className","sidebarClassName","contentClassName","overlayClassName","id","testId","rest","ref","autoId","React","drawerId","handleToggle","e","drawerClasses","sidebarClasses","contentClasses","overlayClasses","widthStyle","jsxs","jsx"],"mappings":";;AAoCO,MAAMA,IAAmBC;AAAA,EAC9B,CACE;AAAA,IACE,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,cAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,OAAAC,IAAQ;AAAA,IACR,YAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,kBAAAC,IAAmB;AAAA,IACnB,kBAAAC,IAAmB;AAAA,IACnB,kBAAAC,IAAmB;AAAA,IACnB,IAAAC;AAAA,IACA,eAAeC;AAAA,IACf,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAASC,EAAM,MAAA,GACfC,IAAWN,KAAMI,GAEjBG,IAAe,CAACC,MAA2C;AAC/D,MAAAhB,IAAegB,EAAE,OAAO,OAAO;AAAA,IACjC,GAWMC,IAAgB;AAAA,MACpB;AAAA,MACAhB,KAAO;AAAA,MACPE,KAXoE;AAAA,QACpE,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MAAA,EAMyBA,CAAU;AAAA,MAC1CC;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELc,IAAiB,CAAC,8BAA8Bb,CAAgB,EACnE,OAAO,OAAO,EACd,KAAK,GAAG,GAELc,IAAiB,CAAC,kBAAkBb,CAAgB,EACvD,OAAO,OAAO,EACd,KAAK,GAAG,GAELc,IAAiB,CAAC,kBAAkBb,CAAgB,EACvD,OAAO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