asterui 0.12.8 → 0.12.9
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/Hero.d.ts +14 -5
- package/dist/components/Join.d.ts +2 -2
- package/dist/components/Layout.d.ts +1 -1
- package/dist/components/Masonry.d.ts +1 -1
- package/dist/index35.js +27 -15
- package/dist/index35.js.map +1 -1
- package/dist/index42.js +6 -6
- package/dist/index42.js.map +1 -1
- package/dist/index45.js +86 -68
- package/dist/index45.js.map +1 -1
- package/dist/index49.js +79 -114
- package/dist/index49.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface HeroProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
overlay?: boolean;
|
|
5
|
-
overlayClassName?: string;
|
|
6
|
-
contentClassName?: string;
|
|
7
|
-
wrapperClassName?: string;
|
|
8
4
|
}
|
|
9
|
-
export
|
|
5
|
+
export interface HeroContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface HeroOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function HeroRoot({ children, className, ...rest }: HeroProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function HeroContent({ children, className, ...rest }: HeroContentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function HeroOverlay({ children, className, ...rest }: HeroOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const Hero: typeof HeroRoot & {
|
|
15
|
+
Content: typeof HeroContent;
|
|
16
|
+
Overlay: typeof HeroOverlay;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface JoinProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
direction?: 'horizontal' | 'vertical';
|
|
5
5
|
}
|
|
6
|
-
export declare function Join({ children,
|
|
6
|
+
export declare function Join({ children, direction, className, ...rest }: JoinProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -46,7 +46,7 @@ declare namespace LayoutRoot {
|
|
|
46
46
|
declare function LayoutHeader({ children, className, style }: LayoutHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
47
47
|
declare function LayoutFooter({ children, className, style }: LayoutFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
48
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, className, style, }: LayoutSiderProps): 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
50
|
declare namespace LayoutSider {
|
|
51
51
|
var displayName: string;
|
|
52
52
|
}
|
package/dist/index35.js
CHANGED
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
function s({
|
|
3
3
|
children: o,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
contentClassName: a = "",
|
|
7
|
-
wrapperClassName: s,
|
|
8
|
-
className: i = "",
|
|
9
|
-
style: r,
|
|
10
|
-
...t
|
|
4
|
+
className: e = "",
|
|
5
|
+
...n
|
|
11
6
|
}) {
|
|
12
|
-
const
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
n && /* @__PURE__ */ e("div", { className: m }),
|
|
15
|
-
/* @__PURE__ */ e("div", { className: f, children: s ? /* @__PURE__ */ e("div", { className: s, children: o }) : o })
|
|
16
|
-
] });
|
|
7
|
+
const t = ["hero", e].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ r("div", { className: t, ...n, children: o });
|
|
17
9
|
}
|
|
10
|
+
function a({
|
|
11
|
+
children: o,
|
|
12
|
+
className: e = "",
|
|
13
|
+
...n
|
|
14
|
+
}) {
|
|
15
|
+
const t = ["hero-content", e].filter(Boolean).join(" ");
|
|
16
|
+
return /* @__PURE__ */ r("div", { className: t, ...n, children: o });
|
|
17
|
+
}
|
|
18
|
+
function c({
|
|
19
|
+
children: o,
|
|
20
|
+
className: e = "",
|
|
21
|
+
...n
|
|
22
|
+
}) {
|
|
23
|
+
const t = ["hero-overlay", "bg-opacity-60", e].filter(Boolean).join(" ");
|
|
24
|
+
return /* @__PURE__ */ r("div", { className: t, ...n, children: o });
|
|
25
|
+
}
|
|
26
|
+
const l = Object.assign(s, {
|
|
27
|
+
Content: a,
|
|
28
|
+
Overlay: c
|
|
29
|
+
});
|
|
18
30
|
export {
|
|
19
|
-
|
|
31
|
+
l as Hero
|
|
20
32
|
};
|
|
21
33
|
//# sourceMappingURL=index35.js.map
|
package/dist/index35.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index35.js","sources":["../src/components/Hero.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface HeroProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n
|
|
1
|
+
{"version":3,"file":"index35.js","sources":["../src/components/Hero.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface HeroProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n}\n\nexport interface HeroContentProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n}\n\nexport interface HeroOverlayProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode\n}\n\nfunction HeroRoot({\n children,\n className = '',\n ...rest\n}: HeroProps) {\n const classes = ['hero', className].filter(Boolean).join(' ')\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n )\n}\n\nfunction HeroContent({\n children,\n className = '',\n ...rest\n}: HeroContentProps) {\n const classes = ['hero-content', className].filter(Boolean).join(' ')\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n )\n}\n\nfunction HeroOverlay({\n children,\n className = '',\n ...rest\n}: HeroOverlayProps) {\n const classes = ['hero-overlay', 'bg-opacity-60', className].filter(Boolean).join(' ')\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n )\n}\n\nexport const Hero = Object.assign(HeroRoot, {\n Content: HeroContent,\n Overlay: HeroOverlay,\n})\n"],"names":["HeroRoot","children","className","rest","classes","HeroContent","HeroOverlay","Hero"],"mappings":";AAcA,SAASA,EAAS;AAAA,EAChB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAc;AACZ,QAAMC,IAAU,CAAC,QAAQF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE5D,2BACG,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAC1B,UAAAF,GACH;AAEJ;AAEA,SAASI,EAAY;AAAA,EACnB,UAAAJ;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAqB;AACnB,QAAMC,IAAU,CAAC,gBAAgBF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEpE,2BACG,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAC1B,UAAAF,GACH;AAEJ;AAEA,SAASK,EAAY;AAAA,EACnB,UAAAL;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAqB;AACnB,QAAMC,IAAU,CAAC,gBAAgB,iBAAiBF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAErF,2BACG,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAC1B,UAAAF,GACH;AAEJ;AAEO,MAAMM,IAAO,OAAO,OAAOP,GAAU;AAAA,EAC1C,SAASK;AAAA,EACT,SAASC;AACX,CAAC;"}
|
package/dist/index42.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import n from "react";
|
|
3
|
-
function
|
|
4
|
-
const
|
|
3
|
+
function f({ children: o, direction: t = "horizontal", className: s = "", ...r }) {
|
|
4
|
+
const a = ["join", t === "vertical" && "join-vertical", s].filter(Boolean).join(" "), l = n.Children.map(o, (e) => {
|
|
5
5
|
if (n.isValidElement(e)) {
|
|
6
|
-
const
|
|
6
|
+
const i = e.props.className || "", m = i ? `join-item ${i}` : "join-item";
|
|
7
7
|
return n.cloneElement(e, {
|
|
8
|
-
className:
|
|
8
|
+
className: m
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
return e;
|
|
12
12
|
});
|
|
13
|
-
return /* @__PURE__ */ c("div", { className:
|
|
13
|
+
return /* @__PURE__ */ c("div", { className: a, ...r, children: l });
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
f as Join
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=index42.js.map
|
package/dist/index42.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index42.js","sources":["../src/components/Join.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface JoinProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n
|
|
1
|
+
{"version":3,"file":"index42.js","sources":["../src/components/Join.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface JoinProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n direction?: 'horizontal' | 'vertical'\n}\n\nexport function Join({ children, direction = 'horizontal', className = '', ...rest }: JoinProps) {\n const classes = ['join', direction === 'vertical' && 'join-vertical', className].filter(Boolean).join(' ')\n\n // Automatically add join-item class to all children\n const childrenWithJoinItem = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const existingClassName = (child.props as any).className || ''\n const newClassName = existingClassName ? `join-item ${existingClassName}` : 'join-item'\n\n return React.cloneElement(child as React.ReactElement<any>, {\n className: newClassName,\n })\n }\n return child\n })\n\n return <div className={classes} {...rest}>{childrenWithJoinItem}</div>\n}\n"],"names":["Join","children","direction","className","rest","classes","childrenWithJoinItem","React","child","existingClassName","newClassName"],"mappings":";;AAOO,SAASA,EAAK,EAAE,UAAAC,GAAU,WAAAC,IAAY,cAAc,WAAAC,IAAY,IAAI,GAAGC,KAAmB;AAC/F,QAAMC,IAAU,CAAC,QAAQH,MAAc,cAAc,iBAAiBC,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAGnGG,IAAuBC,EAAM,SAAS,IAAIN,GAAU,CAACO,MAAU;AACnE,QAAID,EAAM,eAAeC,CAAK,GAAG;AAC/B,YAAMC,IAAqBD,EAAM,MAAc,aAAa,IACtDE,IAAeD,IAAoB,aAAaA,CAAiB,KAAK;AAE5E,aAAOF,EAAM,aAAaC,GAAkC;AAAA,QAC1D,WAAWE;AAAA,MAAA,CACZ;AAAA,IACH;AACA,WAAOF;AAAA,EACT,CAAC;AAED,2BAAQ,OAAA,EAAI,WAAWH,GAAU,GAAGD,GAAO,UAAAE,GAAqB;AAClE;"}
|
package/dist/index45.js
CHANGED
|
@@ -1,122 +1,140 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { jsx as o, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import d, { useContext as M, createContext as P, useState as C, useEffect as $, useCallback as F } from "react";
|
|
3
|
+
const L = P(null);
|
|
4
|
+
function Q() {
|
|
5
|
+
return M(L);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
(
|
|
10
|
-
),
|
|
7
|
+
function h({ children: n, className: s = "", style: a }) {
|
|
8
|
+
const e = d.Children.toArray(n), f = e.some(
|
|
9
|
+
(t) => d.isValidElement(t) && t.type.displayName === "LayoutSider"
|
|
10
|
+
), m = [
|
|
11
11
|
"flex",
|
|
12
12
|
"min-h-0",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
].filter(Boolean).join(" "),
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
19
|
-
return
|
|
20
|
-
className: `flex-1 ${
|
|
13
|
+
f ? "flex-row" : "flex-col",
|
|
14
|
+
s
|
|
15
|
+
].filter(Boolean).join(" "), r = f ? e.map((t) => {
|
|
16
|
+
if (d.isValidElement(t) && (t.type === h || t.type.displayName === "LayoutRoot") && t.type.displayName !== "LayoutSider") {
|
|
17
|
+
const i = t.props.className || "";
|
|
18
|
+
if (!i.includes("flex-1"))
|
|
19
|
+
return d.cloneElement(t, {
|
|
20
|
+
className: `flex-1 ${i}`.trim()
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
return
|
|
24
|
-
}) :
|
|
25
|
-
return /* @__PURE__ */
|
|
23
|
+
return t;
|
|
24
|
+
}) : n;
|
|
25
|
+
return /* @__PURE__ */ o("div", { className: m, style: a, children: r });
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
const
|
|
27
|
+
h.displayName = "LayoutRoot";
|
|
28
|
+
function H({ children: n, className: s = "", style: a }) {
|
|
29
|
+
const e = [
|
|
30
30
|
"flex",
|
|
31
31
|
"items-center",
|
|
32
32
|
"px-6",
|
|
33
33
|
"h-16",
|
|
34
34
|
"bg-base-300",
|
|
35
35
|
"flex-shrink-0",
|
|
36
|
-
|
|
36
|
+
s
|
|
37
37
|
].filter(Boolean).join(" ");
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ o("header", { className: e, style: a, children: n });
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
40
|
+
function I({ children: n, className: s = "", style: a }) {
|
|
41
|
+
const e = [
|
|
42
42
|
"px-6",
|
|
43
43
|
"py-4",
|
|
44
44
|
"text-center",
|
|
45
45
|
"bg-base-300",
|
|
46
46
|
"flex-shrink-0",
|
|
47
|
-
|
|
47
|
+
s
|
|
48
48
|
].filter(Boolean).join(" ");
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ o("footer", { className: e, style: a, children: n });
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
return /* @__PURE__ */
|
|
51
|
+
function O({ children: n, className: s = "", style: a }) {
|
|
52
|
+
const e = ["flex-1", "min-h-0", "overflow-auto", s].filter(Boolean).join(" ");
|
|
53
|
+
return /* @__PURE__ */ o("main", { className: e, style: a, children: n });
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
width:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
const T = {
|
|
56
|
+
sm: "(max-width: 639px)",
|
|
57
|
+
md: "(max-width: 767px)",
|
|
58
|
+
lg: "(max-width: 1023px)",
|
|
59
|
+
xl: "(max-width: 1279px)",
|
|
60
|
+
"2xl": "(max-width: 1535px)"
|
|
61
|
+
};
|
|
62
|
+
function v({
|
|
63
|
+
children: n,
|
|
64
|
+
width: s = 200,
|
|
65
|
+
collapsedWidth: a = 80,
|
|
66
|
+
collapsed: e,
|
|
67
|
+
defaultCollapsed: f = !1,
|
|
68
|
+
collapsible: m = !1,
|
|
69
|
+
onCollapse: r,
|
|
70
|
+
trigger: t,
|
|
71
|
+
breakpoint: i,
|
|
72
|
+
onBreakpoint: p,
|
|
73
|
+
className: w = "",
|
|
74
|
+
style: g
|
|
66
75
|
}) {
|
|
67
|
-
const [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
const [j, N] = C(f), [b, k] = C(!1), l = e ?? j;
|
|
77
|
+
$(() => {
|
|
78
|
+
if (!i) return;
|
|
79
|
+
const c = window.matchMedia(T[i]), y = (R) => {
|
|
80
|
+
const u = R.matches;
|
|
81
|
+
k(u), p?.(u), e === void 0 && N(u), u !== b && r?.(u);
|
|
82
|
+
};
|
|
83
|
+
return y(c), c.addEventListener("change", y), () => c.removeEventListener("change", y);
|
|
84
|
+
}, [i, p, e, r, b]);
|
|
85
|
+
const S = F(() => {
|
|
86
|
+
const c = !l;
|
|
87
|
+
e === void 0 && N(c), r?.(c);
|
|
88
|
+
}, [l, e, r]), x = l ? a : s, B = [
|
|
71
89
|
"flex",
|
|
72
90
|
"flex-col",
|
|
73
91
|
"bg-base-200",
|
|
74
92
|
"flex-shrink-0",
|
|
75
93
|
"transition-all",
|
|
76
94
|
"duration-200",
|
|
77
|
-
|
|
78
|
-
].filter(Boolean).join(" "),
|
|
95
|
+
w
|
|
96
|
+
].filter(Boolean).join(" "), E = m && t !== null && /* @__PURE__ */ o(
|
|
79
97
|
"button",
|
|
80
98
|
{
|
|
81
|
-
onClick:
|
|
99
|
+
onClick: S,
|
|
82
100
|
className: "flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors",
|
|
83
|
-
"aria-label":
|
|
84
|
-
children: /* @__PURE__ */
|
|
101
|
+
"aria-label": l ? "Expand sidebar" : "Collapse sidebar",
|
|
102
|
+
children: /* @__PURE__ */ o(
|
|
85
103
|
"svg",
|
|
86
104
|
{
|
|
87
|
-
className: `w-4 h-4 transition-transform ${
|
|
105
|
+
className: `w-4 h-4 transition-transform ${l ? "rotate-180" : ""}`,
|
|
88
106
|
fill: "none",
|
|
89
107
|
viewBox: "0 0 24 24",
|
|
90
108
|
stroke: "currentColor",
|
|
91
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ o("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
92
110
|
}
|
|
93
111
|
)
|
|
94
112
|
}
|
|
95
113
|
);
|
|
96
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ o(L.Provider, { value: { collapsed: l, collapsedWidth: a, width: s }, children: /* @__PURE__ */ A(
|
|
97
115
|
"aside",
|
|
98
116
|
{
|
|
99
|
-
className:
|
|
117
|
+
className: B,
|
|
100
118
|
style: {
|
|
101
|
-
width: typeof
|
|
102
|
-
...
|
|
119
|
+
width: typeof x == "number" ? `${x}px` : x,
|
|
120
|
+
...g
|
|
103
121
|
},
|
|
104
122
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
123
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-auto", children: n }),
|
|
124
|
+
t !== null && (t ?? E)
|
|
107
125
|
]
|
|
108
126
|
}
|
|
109
127
|
) });
|
|
110
128
|
}
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
Header:
|
|
114
|
-
Footer:
|
|
115
|
-
Content:
|
|
116
|
-
Sider:
|
|
129
|
+
v.displayName = "LayoutSider";
|
|
130
|
+
const W = Object.assign(h, {
|
|
131
|
+
Header: H,
|
|
132
|
+
Footer: I,
|
|
133
|
+
Content: O,
|
|
134
|
+
Sider: v
|
|
117
135
|
});
|
|
118
136
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
137
|
+
W as Layout,
|
|
138
|
+
Q as useSiderContext
|
|
121
139
|
};
|
|
122
140
|
//# sourceMappingURL=index45.js.map
|
package/dist/index45.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index45.js","sources":["../src/components/Layout.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useCallback } 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\nfunction LayoutSider({\n children,\n width = 200,\n collapsedWidth = 80,\n collapsed: controlledCollapsed,\n defaultCollapsed = false,\n collapsible = false,\n onCollapse,\n trigger,\n className = '',\n style,\n}: LayoutSiderProps) {\n const [internalCollapsed, setInternalCollapsed] = useState(defaultCollapsed)\n\n const collapsed = controlledCollapsed ?? internalCollapsed\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","LayoutSider","width","collapsedWidth","controlledCollapsed","defaultCollapsed","collapsible","onCollapse","trigger","internalCollapsed","setInternalCollapsed","useState","collapsed","handleCollapse","useCallback","newCollapsed","currentWidth","siderClasses","defaultTrigger","jsxs","Layout"],"mappings":";;AA+CA,MAAMA,IAAeC,EAAwC,IAAI;AAE1D,SAASC,IAAkB;AAChC,SAAOC,EAAWH,CAAY;AAChC;AAEA,SAASI,EAAW,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,OAAAC,KAAsB;AAEpE,QAAMC,IAAaC,EAAM,SAAS,QAAQJ,CAAQ,GAC5CK,IAAWF,EAAW;AAAA,IAC1B,CAACG,MAAUF,EAAM,eAAeE,CAAK,KAAMA,EAAM,KAAa,gBAAgB;AAAA,EAAA,GAG1EC,IAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACAF,IAAW,aAAa;AAAA,IACxBJ;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAGLO,IAAoBH,IACtBF,EAAW,IAAI,CAACG,MAAU;AACxB,QACEF,EAAM,eAAeE,CAAK,MACzBA,EAAM,SAASP,KAAeO,EAAM,KAAa,gBAAgB,iBACjEA,EAAM,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WAAWF;AAAA,MACX,OAAO;AAAA,QACL,OAAO,OAAOD,KAAiB,WAAW,GAAGA,CAAY,OAAOA;AAAA,QAChE,GAAG9B;AAAA,MAAA;AAAA,MAGL,UAAA;AAAA,QAAA,gBAAAQ,EAAC,OAAA,EAAI,WAAU,wBAAwB,UAAAV,EAAA,CAAS;AAAA,QAC/CwB,MAAY,SAASA,KAAWU;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAErC;AAEJ;AAEAjB,EAAY,cAAc;AAEnB,MAAMmB,IAAS,OAAO,OAAOrC,GAAY;AAAA,EAC9C,QAAQY;AAAA,EACR,QAAQE;AAAA,EACR,SAASE;AAAA,EACT,OAAOE;AACT,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index45.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;AAE1D,SAASC,IAAkB;AAChC,SAAOC,EAAWH,CAAY;AAChC;AAEA,SAASI,EAAW,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,OAAAC,KAAsB;AAEpE,QAAMC,IAAaC,EAAM,SAAS,QAAQJ,CAAQ,GAC5CK,IAAWF,EAAW;AAAA,IAC1B,CAACG,MAAUF,EAAM,eAAeE,CAAK,KAAMA,EAAM,KAAa,gBAAgB;AAAA,EAAA,GAG1EC,IAAgB;AAAA,IACpB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AAEnB,MAAM4B,IAAS,OAAO,OAAO/C,GAAY;AAAA,EAC9C,QAAQY;AAAA,EACR,QAAQE;AAAA,EACR,SAASE;AAAA,EACT,OAAOG;AACT,CAAC;"}
|
package/dist/index49.js
CHANGED
|
@@ -1,119 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import I, { useRef as R, useState as b, useCallback as K, useLayoutEffect as A } from "react";
|
|
3
|
+
const d = {
|
|
4
|
+
sm: 640,
|
|
5
|
+
md: 768,
|
|
6
|
+
lg: 1024,
|
|
7
|
+
xl: 1280,
|
|
8
|
+
"2xl": 1536
|
|
9
|
+
};
|
|
10
|
+
function L(t, e) {
|
|
11
|
+
return typeof t == "number" ? t : t ? t["2xl"] !== void 0 && e >= d["2xl"] ? t["2xl"] : t.xl !== void 0 && e >= d.xl ? t.xl : t.lg !== void 0 && e >= d.lg ? t.lg : t.md !== void 0 && e >= d.md ? t.md : t.sm !== void 0 && e >= d.sm ? t.sm : t.xs !== void 0 ? t.xs : 3 : 3;
|
|
12
|
+
}
|
|
13
|
+
const O = ({
|
|
14
|
+
children: t,
|
|
15
|
+
columns: e = 3,
|
|
16
|
+
gap: r = 16,
|
|
17
|
+
className: z = "",
|
|
18
|
+
style: M,
|
|
19
|
+
...P
|
|
9
20
|
}) => {
|
|
10
|
-
const
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
4: "lg:columns-4",
|
|
68
|
-
5: "lg:columns-5",
|
|
69
|
-
6: "lg:columns-6",
|
|
70
|
-
7: "lg:columns-7",
|
|
71
|
-
8: "lg:columns-8",
|
|
72
|
-
9: "lg:columns-9",
|
|
73
|
-
10: "lg:columns-10",
|
|
74
|
-
11: "lg:columns-11",
|
|
75
|
-
12: "lg:columns-12"
|
|
76
|
-
}, e = {
|
|
77
|
-
1: "xl:columns-1",
|
|
78
|
-
2: "xl:columns-2",
|
|
79
|
-
3: "xl:columns-3",
|
|
80
|
-
4: "xl:columns-4",
|
|
81
|
-
5: "xl:columns-5",
|
|
82
|
-
6: "xl:columns-6",
|
|
83
|
-
7: "xl:columns-7",
|
|
84
|
-
8: "xl:columns-8",
|
|
85
|
-
9: "xl:columns-9",
|
|
86
|
-
10: "xl:columns-10",
|
|
87
|
-
11: "xl:columns-11",
|
|
88
|
-
12: "xl:columns-12"
|
|
89
|
-
}, i = {
|
|
90
|
-
1: "2xl:columns-1",
|
|
91
|
-
2: "2xl:columns-2",
|
|
92
|
-
3: "2xl:columns-3",
|
|
93
|
-
4: "2xl:columns-4",
|
|
94
|
-
5: "2xl:columns-5",
|
|
95
|
-
6: "2xl:columns-6",
|
|
96
|
-
7: "2xl:columns-7",
|
|
97
|
-
8: "2xl:columns-8",
|
|
98
|
-
9: "2xl:columns-9",
|
|
99
|
-
10: "2xl:columns-10",
|
|
100
|
-
11: "2xl:columns-11",
|
|
101
|
-
12: "2xl:columns-12"
|
|
102
|
-
}, t = [
|
|
103
|
-
(() => {
|
|
104
|
-
if (typeof l == "number")
|
|
105
|
-
return o[l] || "columns-3";
|
|
106
|
-
const s = [];
|
|
107
|
-
return l.xs !== void 0 && s.push(o[l.xs] || "columns-3"), l.sm !== void 0 && s.push(x[l.sm] || "sm:columns-3"), l.md !== void 0 && s.push(g[l.md] || "md:columns-3"), l.lg !== void 0 && s.push(d[l.lg] || "lg:columns-3"), l.xl !== void 0 && s.push(e[l.xl] || "xl:columns-3"), l["2xl"] !== void 0 && s.push(i[l["2xl"]] || "2xl:columns-3"), s.join(" ");
|
|
108
|
-
})(),
|
|
109
|
-
p(),
|
|
110
|
-
c
|
|
111
|
-
].filter(Boolean).join(" "), r = C.Children.map(u, (s, f) => /* @__PURE__ */ n("div", { className: "break-inside-avoid mb-4", children: s }, f));
|
|
112
|
-
return /* @__PURE__ */ n("div", { className: t, ...a, children: r });
|
|
21
|
+
const u = R(null), [l, T] = b([]), [y, N] = b(0), w = R([]), c = I.Children.toArray(t), s = K(() => {
|
|
22
|
+
const i = u.current;
|
|
23
|
+
if (!i || c.length === 0) return;
|
|
24
|
+
const n = i.offsetWidth, m = typeof window < "u" ? window.innerWidth : n, a = L(e, m), j = (n - r * (a - 1)) / a, o = new Array(a).fill(0), W = [];
|
|
25
|
+
c.forEach((_, x) => {
|
|
26
|
+
const C = w.current[x];
|
|
27
|
+
if (!C) return;
|
|
28
|
+
let h = 0, E = o[0];
|
|
29
|
+
for (let f = 1; f < a; f++)
|
|
30
|
+
o[f] < E && (E = o[f], h = f);
|
|
31
|
+
const k = h * (j + r), B = o[h];
|
|
32
|
+
W[x] = { left: k, top: B };
|
|
33
|
+
const F = C.offsetHeight;
|
|
34
|
+
o[h] += F + r;
|
|
35
|
+
}), T(W), N(Math.max(...o) - r);
|
|
36
|
+
}, [t, e, r, c.length]);
|
|
37
|
+
A(() => {
|
|
38
|
+
s();
|
|
39
|
+
const i = () => {
|
|
40
|
+
s();
|
|
41
|
+
};
|
|
42
|
+
return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
|
43
|
+
}, [s]), A(() => {
|
|
44
|
+
const i = setTimeout(s, 0);
|
|
45
|
+
return () => clearTimeout(i);
|
|
46
|
+
}, [t, s]);
|
|
47
|
+
const v = u.current?.offsetWidth ?? 0, S = typeof window < "u" ? window.innerWidth : v, g = L(e, S), p = v > 0 ? (v - r * (g - 1)) / g : 0;
|
|
48
|
+
return /* @__PURE__ */ H(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: u,
|
|
52
|
+
className: z,
|
|
53
|
+
style: {
|
|
54
|
+
position: "relative",
|
|
55
|
+
height: y > 0 ? y : void 0,
|
|
56
|
+
...M
|
|
57
|
+
},
|
|
58
|
+
...P,
|
|
59
|
+
children: c.map((i, n) => /* @__PURE__ */ H(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref: (m) => {
|
|
63
|
+
w.current[n] = m;
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
position: l.length > 0 ? "absolute" : "relative",
|
|
67
|
+
left: l[n]?.left ?? 0,
|
|
68
|
+
top: l[n]?.top ?? 0,
|
|
69
|
+
width: p > 0 ? p : "100%",
|
|
70
|
+
visibility: l.length > 0 ? "visible" : "hidden"
|
|
71
|
+
},
|
|
72
|
+
children: i
|
|
73
|
+
},
|
|
74
|
+
n
|
|
75
|
+
))
|
|
76
|
+
}
|
|
77
|
+
);
|
|
113
78
|
};
|
|
114
|
-
|
|
79
|
+
O.displayName = "Masonry";
|
|
115
80
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
81
|
+
O as Masonry,
|
|
82
|
+
O as default
|
|
118
83
|
};
|
|
119
84
|
//# sourceMappingURL=index49.js.map
|
package/dist/index49.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index49.js","sources":["../src/components/Masonry.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface MasonryProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n columns
|
|
1
|
+
{"version":3,"file":"index49.js","sources":["../src/components/Masonry.tsx"],"sourcesContent":["import React, { useRef, useState, useLayoutEffect, useCallback } from 'react'\n\nexport interface MasonryProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n columns?:\n | number\n | {\n xs?: number\n sm?: number\n md?: number\n lg?: number\n xl?: number\n '2xl'?: number\n }\n gap?: number\n}\n\n// Tailwind breakpoints in pixels\nconst BREAKPOINTS = {\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n '2xl': 1536,\n}\n\nfunction getColumnsForWidth(\n columns: MasonryProps['columns'],\n width: number\n): number {\n if (typeof columns === 'number') {\n return columns\n }\n\n if (!columns) return 3\n\n // Find the appropriate column count for current width\n // Start from largest breakpoint and work down\n if (columns['2xl'] !== undefined && width >= BREAKPOINTS['2xl']) {\n return columns['2xl']\n }\n if (columns.xl !== undefined && width >= BREAKPOINTS.xl) {\n return columns.xl\n }\n if (columns.lg !== undefined && width >= BREAKPOINTS.lg) {\n return columns.lg\n }\n if (columns.md !== undefined && width >= BREAKPOINTS.md) {\n return columns.md\n }\n if (columns.sm !== undefined && width >= BREAKPOINTS.sm) {\n return columns.sm\n }\n if (columns.xs !== undefined) {\n return columns.xs\n }\n\n // Default fallback\n return 3\n}\n\nexport const Masonry: React.FC<MasonryProps> = ({\n children,\n columns = 3,\n gap = 16,\n className = '',\n style,\n ...rest\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [positions, setPositions] = useState<\n Array<{ left: number; top: number }>\n >([])\n const [containerHeight, setContainerHeight] = useState(0)\n const itemRefs = useRef<(HTMLDivElement | null)[]>([])\n\n const childArray = React.Children.toArray(children)\n\n const calculateLayout = useCallback(() => {\n const container = containerRef.current\n if (!container || childArray.length === 0) return\n\n const containerWidth = container.offsetWidth\n // Use viewport width for responsive breakpoints (matches Tailwind behavior)\n const viewportWidth = typeof window !== 'undefined' ? window.innerWidth : containerWidth\n const numColumns = getColumnsForWidth(columns, viewportWidth)\n const columnWidth = (containerWidth - gap * (numColumns - 1)) / numColumns\n\n // Track height of each column\n const columnHeights = new Array(numColumns).fill(0)\n const newPositions: Array<{ left: number; top: number }> = []\n\n // Place each item in the shortest column\n childArray.forEach((_, index) => {\n const itemEl = itemRefs.current[index]\n if (!itemEl) return\n\n // Find shortest column\n let shortestColumn = 0\n let minHeight = columnHeights[0]\n for (let i = 1; i < numColumns; i++) {\n if (columnHeights[i] < minHeight) {\n minHeight = columnHeights[i]\n shortestColumn = i\n }\n }\n\n // Calculate position\n const left = shortestColumn * (columnWidth + gap)\n const top = columnHeights[shortestColumn]\n\n newPositions[index] = { left, top }\n\n // Update column height\n const itemHeight = itemEl.offsetHeight\n columnHeights[shortestColumn] += itemHeight + gap\n })\n\n setPositions(newPositions)\n setContainerHeight(Math.max(...columnHeights) - gap)\n }, [children, columns, gap, childArray.length])\n\n // Calculate layout after render and on resize\n useLayoutEffect(() => {\n calculateLayout()\n\n const handleResize = () => {\n calculateLayout()\n }\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [calculateLayout])\n\n // Recalculate when children change\n useLayoutEffect(() => {\n // Small delay to ensure refs are populated\n const timer = setTimeout(calculateLayout, 0)\n return () => clearTimeout(timer)\n }, [children, calculateLayout])\n\n const containerWidth = containerRef.current?.offsetWidth ?? 0\n const viewportWidth = typeof window !== 'undefined' ? window.innerWidth : containerWidth\n const numColumns = getColumnsForWidth(columns, viewportWidth)\n const columnWidth =\n containerWidth > 0\n ? (containerWidth - gap * (numColumns - 1)) / numColumns\n : 0\n\n return (\n <div\n ref={containerRef}\n className={className}\n style={{\n position: 'relative',\n height: containerHeight > 0 ? containerHeight : undefined,\n ...style,\n }}\n {...rest}\n >\n {childArray.map((child, index) => (\n <div\n key={index}\n ref={(el) => {\n itemRefs.current[index] = el\n }}\n style={{\n position: positions.length > 0 ? 'absolute' : 'relative',\n left: positions[index]?.left ?? 0,\n top: positions[index]?.top ?? 0,\n width: columnWidth > 0 ? columnWidth : '100%',\n visibility: positions.length > 0 ? 'visible' : 'hidden',\n }}\n >\n {child}\n </div>\n ))}\n </div>\n )\n}\n\nMasonry.displayName = 'Masonry'\n\nexport default Masonry\n"],"names":["BREAKPOINTS","getColumnsForWidth","columns","width","Masonry","children","gap","className","style","rest","containerRef","useRef","positions","setPositions","useState","containerHeight","setContainerHeight","itemRefs","childArray","React","calculateLayout","useCallback","container","containerWidth","viewportWidth","numColumns","columnWidth","columnHeights","newPositions","index","itemEl","shortestColumn","minHeight","i","left","top","itemHeight","useLayoutEffect","handleResize","timer","jsx","child","el"],"mappings":";;AAkBA,MAAMA,IAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AACT;AAEA,SAASC,EACPC,GACAC,GACQ;AACR,SAAI,OAAOD,KAAY,WACdA,IAGJA,IAIDA,EAAQ,KAAK,MAAM,UAAaC,KAASH,EAAY,KAAK,IACrDE,EAAQ,KAAK,IAElBA,EAAQ,OAAO,UAAaC,KAASH,EAAY,KAC5CE,EAAQ,KAEbA,EAAQ,OAAO,UAAaC,KAASH,EAAY,KAC5CE,EAAQ,KAEbA,EAAQ,OAAO,UAAaC,KAASH,EAAY,KAC5CE,EAAQ,KAEbA,EAAQ,OAAO,UAAaC,KAASH,EAAY,KAC5CE,EAAQ,KAEbA,EAAQ,OAAO,SACVA,EAAQ,KAIV,IAxBc;AAyBvB;AAEO,MAAME,IAAkC,CAAC;AAAA,EAC9C,UAAAC;AAAA,EACA,SAAAH,IAAU;AAAA,EACV,KAAAI,IAAM;AAAA,EACN,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAeC,EAAuB,IAAI,GAC1C,CAAC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