asterui 0.12.25 → 0.12.27
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/Cascader.d.ts +2 -0
- package/dist/components/Descriptions.d.ts +35 -3
- package/dist/components/Empty.d.ts +10 -1
- package/dist/components/Image.d.ts +13 -1
- package/dist/components/List.d.ts +74 -8
- package/dist/components/Table.d.ts +64 -10
- package/dist/components/Tag.d.ts +16 -4
- package/dist/components/Timeline.d.ts +62 -7
- package/dist/components/Tree.d.ts +2 -0
- package/dist/index.d.ts +6 -8
- package/dist/index.js +151 -152
- package/dist/index.js.map +1 -1
- package/dist/index10.js +1 -1
- package/dist/index100.js +5 -32
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +13 -5
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +43 -11
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +11 -44
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +12 -10
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +7 -14
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +12 -7
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +29 -11
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +16 -29
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +31 -16
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +517 -30
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +45 -515
- package/dist/index111.js.map +1 -1
- package/dist/index15.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.js +127 -93
- package/dist/index23.js.map +1 -1
- package/dist/index39.js +162 -115
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +398 -40
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +132 -389
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +252 -91
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +143 -247
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +15 -154
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +17 -15
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +136 -16
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +118 -133
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +35 -13
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +34 -35
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +81 -34
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +166 -71
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +144 -167
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +11 -152
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +55 -10
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +12 -55
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +7 -14
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +333 -6
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +47 -334
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +122 -47
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +108 -120
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +167 -107
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +29 -167
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +120 -30
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +80 -116
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +19 -85
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +73 -19
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +54 -71
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +44 -56
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +49 -42
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +121 -50
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +102 -118
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +72 -105
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +67 -73
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +19 -66
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +55 -18
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +251 -55
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -254
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +31 -22
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +93 -30
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +626 -86
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +73 -322
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +39 -79
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +23 -40
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +207 -23
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +149 -122
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +152 -147
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +143 -156
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -65
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +234 -35
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +31 -231
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +210 -34
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +418 -187
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +686 -376
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +165 -738
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +253 -173
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +64 -256
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +121 -61
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +14 -126
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +31 -12
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Indicator.d.ts +0 -7
- package/dist/index112.js +0 -53
- package/dist/index112.js.map +0 -1
package/dist/index44.js
CHANGED
|
@@ -1,157 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
parser: h,
|
|
16
|
-
className: w = "",
|
|
17
|
-
controls: v = !0,
|
|
18
|
-
block: C = !1,
|
|
19
|
-
...D
|
|
20
|
-
}, V) => {
|
|
21
|
-
const [j, m] = A(I ?? null), b = K(null);
|
|
22
|
-
W(V, () => b.current);
|
|
23
|
-
const t = o !== void 0 ? o : j, B = (e) => {
|
|
24
|
-
if (e === null) return "";
|
|
25
|
-
let n = e;
|
|
26
|
-
return s !== void 0 && (n = Number(e.toFixed(s))), f ? f(n) : String(n);
|
|
27
|
-
}, M = (e) => {
|
|
28
|
-
if (!e) return null;
|
|
29
|
-
const n = h ? h(e) : parseFloat(e);
|
|
30
|
-
return isNaN(n) ? null : n;
|
|
31
|
-
}, x = (e) => {
|
|
32
|
-
let n = Math.max(a, Math.min(u, e));
|
|
33
|
-
return s !== void 0 && (n = Number(n.toFixed(s))), n;
|
|
34
|
-
}, i = (e) => {
|
|
35
|
-
if (e === null) {
|
|
36
|
-
o === void 0 && m(null), d?.(null);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const n = x(e);
|
|
40
|
-
o === void 0 && m(n), d?.(n);
|
|
41
|
-
}, y = () => {
|
|
42
|
-
if (l) return;
|
|
43
|
-
i((t ?? 0) + p);
|
|
44
|
-
}, g = () => {
|
|
45
|
-
if (l) return;
|
|
46
|
-
i((t ?? 0) - p);
|
|
47
|
-
}, L = (e) => {
|
|
48
|
-
const n = M(e.target.value);
|
|
49
|
-
n !== null ? i(n) : e.target.value === "" && i(null);
|
|
50
|
-
}, $ = (e) => {
|
|
51
|
-
l || (e.key === "ArrowUp" ? (e.preventDefault(), y()) : e.key === "ArrowDown" && (e.preventDefault(), g()));
|
|
52
|
-
}, F = () => {
|
|
53
|
-
t !== null && (t < a || t > u) && i(x(t));
|
|
54
|
-
}, R = [
|
|
55
|
-
"input",
|
|
56
|
-
"w-full",
|
|
57
|
-
c && {
|
|
58
|
-
xs: "input-xs",
|
|
59
|
-
sm: "input-sm",
|
|
60
|
-
md: "input-md",
|
|
61
|
-
lg: "input-lg",
|
|
62
|
-
xl: "input-xl"
|
|
63
|
-
}[c],
|
|
64
|
-
l && "input-disabled",
|
|
65
|
-
v && "pr-8"
|
|
66
|
-
].filter(Boolean).join(" "), N = c === "xs" || c === "sm" ? "btn-xs" : "btn-sm";
|
|
67
|
-
return /* @__PURE__ */ k("div", { className: `relative ${C ? "w-full" : "inline-block"} group ${w}`, children: [
|
|
68
|
-
/* @__PURE__ */ r(
|
|
69
|
-
"input",
|
|
70
|
-
{
|
|
71
|
-
ref: b,
|
|
72
|
-
type: "text",
|
|
73
|
-
inputMode: "decimal",
|
|
74
|
-
role: "spinbutton",
|
|
75
|
-
"aria-valuemin": a !== -1 / 0 ? a : void 0,
|
|
76
|
-
"aria-valuemax": u !== 1 / 0 ? u : void 0,
|
|
77
|
-
"aria-valuenow": t ?? void 0,
|
|
78
|
-
className: R,
|
|
79
|
-
value: B(t),
|
|
80
|
-
onChange: L,
|
|
81
|
-
onKeyDown: $,
|
|
82
|
-
onBlur: F,
|
|
83
|
-
disabled: l,
|
|
84
|
-
...D
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
v && /* @__PURE__ */ k("div", { className: "absolute right-1 top-1/2 -translate-y-1/2 flex flex-col gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity", children: [
|
|
88
|
-
/* @__PURE__ */ r(
|
|
89
|
-
"button",
|
|
90
|
-
{
|
|
91
|
-
type: "button",
|
|
92
|
-
"aria-label": "Increase value",
|
|
93
|
-
className: `btn ${N} btn-ghost px-1 min-h-0 h-3.5`,
|
|
94
|
-
onClick: y,
|
|
95
|
-
disabled: l || t !== null && t >= u,
|
|
96
|
-
tabIndex: -1,
|
|
97
|
-
children: /* @__PURE__ */ r(
|
|
98
|
-
"svg",
|
|
99
|
-
{
|
|
100
|
-
className: "w-3 h-3",
|
|
101
|
-
fill: "none",
|
|
102
|
-
viewBox: "0 0 24 24",
|
|
103
|
-
stroke: "currentColor",
|
|
104
|
-
"aria-hidden": "true",
|
|
105
|
-
children: /* @__PURE__ */ r(
|
|
106
|
-
"path",
|
|
107
|
-
{
|
|
108
|
-
strokeLinecap: "round",
|
|
109
|
-
strokeLinejoin: "round",
|
|
110
|
-
strokeWidth: 2,
|
|
111
|
-
d: "M5 15l7-7 7 7"
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ r(
|
|
119
|
-
"button",
|
|
120
|
-
{
|
|
121
|
-
type: "button",
|
|
122
|
-
"aria-label": "Decrease value",
|
|
123
|
-
className: `btn ${N} btn-ghost px-1 min-h-0 h-3.5`,
|
|
124
|
-
onClick: g,
|
|
125
|
-
disabled: l || t !== null && t <= a,
|
|
126
|
-
tabIndex: -1,
|
|
127
|
-
children: /* @__PURE__ */ r(
|
|
128
|
-
"svg",
|
|
129
|
-
{
|
|
130
|
-
className: "w-3 h-3",
|
|
131
|
-
fill: "none",
|
|
132
|
-
viewBox: "0 0 24 24",
|
|
133
|
-
stroke: "currentColor",
|
|
134
|
-
"aria-hidden": "true",
|
|
135
|
-
children: /* @__PURE__ */ r(
|
|
136
|
-
"path",
|
|
137
|
-
{
|
|
138
|
-
strokeLinecap: "round",
|
|
139
|
-
strokeLinejoin: "round",
|
|
140
|
-
strokeWidth: 2,
|
|
141
|
-
d: "M19 9l-7 7-7-7"
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
] })
|
|
149
|
-
] });
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
H.displayName = "InputNumber";
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
function p({ children: i, direction: o = "horizontal", className: s = "", ...a }) {
|
|
4
|
+
const r = ["join", o === "vertical" && "join-vertical", s].filter(Boolean).join(" "), l = n.Children.map(i, (e) => {
|
|
5
|
+
if (n.isValidElement(e)) {
|
|
6
|
+
const t = e.props.className || "", m = t ? `join-item ${t}` : "join-item";
|
|
7
|
+
return n.cloneElement(e, {
|
|
8
|
+
className: m
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return e;
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ c("div", { className: r, ...a, children: l });
|
|
14
|
+
}
|
|
153
15
|
export {
|
|
154
|
-
|
|
155
|
-
H as default
|
|
16
|
+
p as Join
|
|
156
17
|
};
|
|
157
18
|
//# sourceMappingURL=index44.js.map
|
package/dist/index44.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index44.js","sources":["../src/components/InputNumber.tsx"],"sourcesContent":["import React, { useState, useRef, forwardRef, useImperativeHandle } from 'react'\n\nexport interface InputNumberProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange' | 'value' | 'defaultValue'> {\n value?: number\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n precision?: number\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n disabled?: boolean\n onChange?: (value: number | null) => void\n formatter?: (value: number | undefined) => string\n parser?: (displayValue: string) => number\n className?: string\n controls?: boolean\n block?: boolean\n}\n\nexport const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(\n (\n {\n value: controlledValue,\n defaultValue,\n min = -Infinity,\n max = Infinity,\n step = 1,\n precision,\n size,\n disabled = false,\n onChange,\n formatter,\n parser,\n className = '',\n controls = true,\n block = false,\n ...props\n },\n ref\n ) => {\n const [internalValue, setInternalValue] = useState<number | null>(defaultValue ?? null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n useImperativeHandle(ref, () => inputRef.current!)\n\n const value = controlledValue !== undefined ? controlledValue : internalValue\n\n const formatValue = (num: number | null): string => {\n if (num === null) return ''\n let formatted = num\n if (precision !== undefined) {\n formatted = Number(num.toFixed(precision))\n }\n return formatter ? formatter(formatted) : String(formatted)\n }\n\n const parseValue = (str: string): number | null => {\n if (!str) return null\n const parsed = parser ? parser(str) : parseFloat(str)\n if (isNaN(parsed)) return null\n return parsed\n }\n\n const clampValue = (num: number): number => {\n let clamped = Math.max(min, Math.min(max, num))\n if (precision !== undefined) {\n clamped = Number(clamped.toFixed(precision))\n }\n return clamped\n }\n\n const updateValue = (newValue: number | null) => {\n if (newValue === null) {\n if (controlledValue === undefined) {\n setInternalValue(null)\n }\n onChange?.(null)\n return\n }\n\n const clamped = clampValue(newValue)\n if (controlledValue === undefined) {\n setInternalValue(clamped)\n }\n onChange?.(clamped)\n }\n\n const handleIncrement = () => {\n if (disabled) return\n const currentValue = value ?? 0\n updateValue(currentValue + step)\n }\n\n const handleDecrement = () => {\n if (disabled) return\n const currentValue = value ?? 0\n updateValue(currentValue - step)\n }\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const parsed = parseValue(e.target.value)\n if (parsed !== null) {\n updateValue(parsed)\n } else if (e.target.value === '') {\n updateValue(null)\n }\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return\n\n if (e.key === 'ArrowUp') {\n e.preventDefault()\n handleIncrement()\n } else if (e.key === 'ArrowDown') {\n e.preventDefault()\n handleDecrement()\n }\n }\n\n const handleBlur = () => {\n // Ensure value is within bounds on blur\n if (value !== null && (value < min || value > max)) {\n updateValue(clampValue(value))\n }\n }\n\n const sizeClasses = {\n xs: 'input-xs',\n sm: 'input-sm',\n md: 'input-md',\n lg: 'input-lg',\n xl: 'input-xl',\n }\n\n const inputClasses = [\n 'input',\n 'w-full',\n size && sizeClasses[size],\n disabled && 'input-disabled',\n controls && 'pr-8',\n ]\n .filter(Boolean)\n .join(' ')\n\n const buttonSize = size === 'xs' || size === 'sm' ? 'btn-xs' : 'btn-sm'\n\n return (\n <div className={`relative ${block ? 'w-full' : 'inline-block'} group ${className}`}>\n <input\n ref={inputRef}\n type=\"text\"\n inputMode=\"decimal\"\n role=\"spinbutton\"\n aria-valuemin={min !== -Infinity ? min : undefined}\n aria-valuemax={max !== Infinity ? max : undefined}\n aria-valuenow={value ?? undefined}\n className={inputClasses}\n value={formatValue(value)}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n disabled={disabled}\n {...props}\n />\n {controls && (\n <div className=\"absolute right-1 top-1/2 -translate-y-1/2 flex flex-col gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity\">\n <button\n type=\"button\"\n aria-label=\"Increase value\"\n className={`btn ${buttonSize} btn-ghost px-1 min-h-0 h-3.5`}\n onClick={handleIncrement}\n disabled={disabled || (value !== null && value >= max)}\n tabIndex={-1}\n >\n <svg\n className=\"w-3 h-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M5 15l7-7 7 7\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n aria-label=\"Decrease value\"\n className={`btn ${buttonSize} btn-ghost px-1 min-h-0 h-3.5`}\n onClick={handleDecrement}\n disabled={disabled || (value !== null && value <= min)}\n tabIndex={-1}\n >\n <svg\n className=\"w-3 h-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n </div>\n )}\n </div>\n )\n }\n)\n\nInputNumber.displayName = 'InputNumber'\n\nexport default InputNumber\n"],"names":["InputNumber","forwardRef","controlledValue","defaultValue","min","max","step","precision","size","disabled","onChange","formatter","parser","className","controls","block","props","ref","internalValue","setInternalValue","useState","inputRef","useRef","useImperativeHandle","value","formatValue","num","formatted","parseValue","str","parsed","clampValue","clamped","updateValue","newValue","handleIncrement","handleDecrement","handleInputChange","handleKeyDown","handleBlur","inputClasses","buttonSize","jsxs","jsx"],"mappings":";;AAmBO,MAAMA,IAAcC;AAAA,EACzB,CACE;AAAA,IACE,OAAOC;AAAA,IACP,cAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,KAAAC,IAAM;AAAA,IACN,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAwBjB,KAAgB,IAAI,GAChFkB,IAAWC,EAAyB,IAAI;AAE9C,IAAAC,EAAoBN,GAAK,MAAMI,EAAS,OAAQ;AAEhD,UAAMG,IAAQtB,MAAoB,SAAYA,IAAkBgB,GAE1DO,IAAc,CAACC,MAA+B;AAClD,UAAIA,MAAQ,KAAM,QAAO;AACzB,UAAIC,IAAYD;AAChB,aAAInB,MAAc,WAChBoB,IAAY,OAAOD,EAAI,QAAQnB,CAAS,CAAC,IAEpCI,IAAYA,EAAUgB,CAAS,IAAI,OAAOA,CAAS;AAAA,IAC5D,GAEMC,IAAa,CAACC,MAA+B;AACjD,UAAI,CAACA,EAAK,QAAO;AACjB,YAAMC,IAASlB,IAASA,EAAOiB,CAAG,IAAI,WAAWA,CAAG;AACpD,aAAI,MAAMC,CAAM,IAAU,OACnBA;AAAA,IACT,GAEMC,IAAa,CAACL,MAAwB;AAC1C,UAAIM,IAAU,KAAK,IAAI5B,GAAK,KAAK,IAAIC,GAAKqB,CAAG,CAAC;AAC9C,aAAInB,MAAc,WAChByB,IAAU,OAAOA,EAA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KAAae,MAAU,QAAQA,KAASpB;AAAA,YAClD,UAAU;AAAA,YAEV,UAAA,gBAAAuC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,QAAO;AAAA,gBACP,eAAY;AAAA,gBAEZ,UAAA,gBAAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,aAAa;AAAA,oBACb,GAAE;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA3C,EAAY,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index44.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,18 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
const k = {
|
|
3
|
+
xs: "kbd-xs",
|
|
4
|
+
sm: "kbd-sm",
|
|
5
|
+
md: "kbd-md",
|
|
6
|
+
lg: "kbd-lg",
|
|
7
|
+
xl: "kbd-xl"
|
|
8
|
+
}, t = ({
|
|
9
|
+
size: s,
|
|
10
|
+
children: d,
|
|
11
|
+
className: l = "",
|
|
12
|
+
...o
|
|
13
|
+
}) => {
|
|
14
|
+
const b = ["kbd", s ? k[s] : "", l].filter(Boolean).join(" ");
|
|
15
|
+
return /* @__PURE__ */ e("kbd", { className: b, ...o, children: d });
|
|
16
|
+
};
|
|
15
17
|
export {
|
|
16
|
-
|
|
18
|
+
t as Kbd
|
|
17
19
|
};
|
|
18
20
|
//# sourceMappingURL=index45.js.map
|
package/dist/index45.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index45.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index45.js","sources":["../src/components/Kbd.tsx"],"sourcesContent":["import React from 'react'\n\nexport type KbdSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface KbdProps extends React.HTMLAttributes<HTMLElement> {\n /** Size of the kbd */\n size?: KbdSize\n /** Key content */\n children?: React.ReactNode\n}\n\nconst sizeClasses: Record<KbdSize, string> = {\n xs: 'kbd-xs',\n sm: 'kbd-sm',\n md: 'kbd-md',\n lg: 'kbd-lg',\n xl: 'kbd-xl',\n}\n\nexport const Kbd: React.FC<KbdProps> = ({\n size,\n children,\n className = '',\n ...rest\n}) => {\n const classes = ['kbd', size ? sizeClasses[size] : '', className]\n .filter(Boolean)\n .join(' ')\n\n return (\n <kbd className={classes} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"names":["sizeClasses","Kbd","size","children","className","rest","classes"],"mappings":";AAWA,MAAMA,IAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAA0B,CAAC;AAAA,EACtC,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAU,CAAC,OAAOJ,IAAOF,EAAYE,CAAI,IAAI,IAAIE,CAAS,EAC7D,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BACG,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAC1B,UAAAF,GACH;AAEJ;"}
|
package/dist/index46.js
CHANGED
|
@@ -1,20 +1,140 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 $ } from "react";
|
|
3
|
+
const L = P(null);
|
|
4
|
+
function K() {
|
|
5
|
+
return M(L);
|
|
6
|
+
}
|
|
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
|
+
"flex",
|
|
12
|
+
"min-h-0",
|
|
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
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
}) : n;
|
|
25
|
+
return /* @__PURE__ */ o("div", { className: m, style: a, children: r });
|
|
26
|
+
}
|
|
27
|
+
h.displayName = "LayoutRoot";
|
|
28
|
+
function F({ children: n, className: s = "", style: a }) {
|
|
29
|
+
const e = [
|
|
30
|
+
"flex",
|
|
31
|
+
"items-center",
|
|
32
|
+
"px-6",
|
|
33
|
+
"h-16",
|
|
34
|
+
"bg-base-300",
|
|
35
|
+
"flex-shrink-0",
|
|
36
|
+
s
|
|
37
|
+
].filter(Boolean).join(" ");
|
|
38
|
+
return /* @__PURE__ */ o("header", { className: e, style: a, children: n });
|
|
39
|
+
}
|
|
40
|
+
function H({ children: n, className: s = "", style: a }) {
|
|
41
|
+
const e = [
|
|
42
|
+
"px-6",
|
|
43
|
+
"py-4",
|
|
44
|
+
"text-center",
|
|
45
|
+
"bg-base-300",
|
|
46
|
+
"flex-shrink-0",
|
|
47
|
+
s
|
|
48
|
+
].filter(Boolean).join(" ");
|
|
49
|
+
return /* @__PURE__ */ o("footer", { className: e, style: a, children: n });
|
|
50
|
+
}
|
|
51
|
+
function I({ 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
|
+
}
|
|
55
|
+
const O = {
|
|
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)"
|
|
16
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
|
|
75
|
+
}) {
|
|
76
|
+
const [j, N] = C(f), [b, k] = C(!1), l = e ?? j;
|
|
77
|
+
_(() => {
|
|
78
|
+
if (!i) return;
|
|
79
|
+
const c = window.matchMedia(O[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 = $(() => {
|
|
86
|
+
const c = !l;
|
|
87
|
+
e === void 0 && N(c), r?.(c);
|
|
88
|
+
}, [l, e, r]), x = l ? a : s, B = [
|
|
89
|
+
"flex",
|
|
90
|
+
"flex-col",
|
|
91
|
+
"bg-base-200",
|
|
92
|
+
"flex-shrink-0",
|
|
93
|
+
"transition-all",
|
|
94
|
+
"duration-200",
|
|
95
|
+
w
|
|
96
|
+
].filter(Boolean).join(" "), E = m && t !== null && /* @__PURE__ */ o(
|
|
97
|
+
"button",
|
|
98
|
+
{
|
|
99
|
+
onClick: S,
|
|
100
|
+
className: "flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors",
|
|
101
|
+
"aria-label": l ? "Expand sidebar" : "Collapse sidebar",
|
|
102
|
+
children: /* @__PURE__ */ o(
|
|
103
|
+
"svg",
|
|
104
|
+
{
|
|
105
|
+
className: `w-4 h-4 transition-transform ${l ? "rotate-180" : ""}`,
|
|
106
|
+
fill: "none",
|
|
107
|
+
viewBox: "0 0 24 24",
|
|
108
|
+
stroke: "currentColor",
|
|
109
|
+
children: /* @__PURE__ */ o("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
return /* @__PURE__ */ o(L.Provider, { value: { collapsed: l, collapsedWidth: a, width: s }, children: /* @__PURE__ */ A(
|
|
115
|
+
"aside",
|
|
116
|
+
{
|
|
117
|
+
className: B,
|
|
118
|
+
style: {
|
|
119
|
+
width: typeof x == "number" ? `${x}px` : x,
|
|
120
|
+
...g
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-auto", children: n }),
|
|
124
|
+
t !== null && (t ?? E)
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
) });
|
|
128
|
+
}
|
|
129
|
+
v.displayName = "LayoutSider";
|
|
130
|
+
const Q = Object.assign(h, {
|
|
131
|
+
Header: F,
|
|
132
|
+
Footer: H,
|
|
133
|
+
Content: I,
|
|
134
|
+
Sider: v
|
|
135
|
+
});
|
|
17
136
|
export {
|
|
18
|
-
|
|
137
|
+
Q as Layout,
|
|
138
|
+
K as useSiderContext
|
|
19
139
|
};
|
|
20
140
|
//# sourceMappingURL=index46.js.map
|
package/dist/index46.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index46.js","sources":["../src/components/Kbd.tsx"],"sourcesContent":["import React from 'react'\n\nexport type KbdSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface KbdProps extends React.HTMLAttributes<HTMLElement> {\n /** Size of the kbd */\n size?: KbdSize\n /** Key content */\n children?: React.ReactNode\n}\n\nconst sizeClasses: Record<KbdSize, string> = {\n xs: 'kbd-xs',\n sm: 'kbd-sm',\n md: 'kbd-md',\n lg: 'kbd-lg',\n xl: 'kbd-xl',\n}\n\nexport const Kbd: React.FC<KbdProps> = ({\n size,\n children,\n className = '',\n ...rest\n}) => {\n const classes = ['kbd', size ? sizeClasses[size] : '', className]\n .filter(Boolean)\n .join(' ')\n\n return (\n <kbd className={classes} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"names":["sizeClasses","Kbd","size","children","className","rest","classes"],"mappings":";AAWA,MAAMA,IAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAA0B,CAAC;AAAA,EACtC,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAU,CAAC,OAAOJ,IAAOF,EAAYE,CAAI,IAAI,IAAIE,CAAS,EAC7D,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BACG,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAC1B,UAAAF,GACH;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index46.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;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,KAAa,gBAAgB,eACpC;AAEA,YAAMG,IAAqBH,EAAM,MAAc,aAAa;AAC5D,UAAI,CAACG,EAAkB,SAAS,QAAQ;AACtC,eAAOL,EAAM,aAAaE,GAAkC;AAAA,UAC1D,WAAW,UAAUG,CAAiB,GAAG,KAAA;AAAA,QAAK,CAC/C;AAAA,IAEL;AACA,WAAOH;AAAA,EACT,CAAC,IACDN;AAEJ,SACE,gBAAAU,EAAC,OAAA,EAAI,WAAWH,GAAe,OAAAL,GAC5B,UAAAM,GACH;AAEJ;AAEAT,EAAW,cAAc;AAEzB,SAASY,EAAa,EAAE,UAAAX,GAAU,WAAAC,IAAY,IA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