@shmidko61/lc-ui-kit 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/box/box.d.ts +1 -0
- package/dist/box/box.types.d.ts +2 -2
- package/dist/box/helpers/box-scrollbar.helpers.d.ts +7 -0
- package/dist/box/helpers/index.d.ts +1 -0
- package/dist/box/types/box-scrollbar.types.d.ts +7 -0
- package/dist/box/types/index.d.ts +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +382 -337
- package/dist/flex/flex.d.ts +1 -0
- package/dist/shared/responsive-style/index.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/scrollbar.types.d.ts +33 -0
- package/package.json +5 -3
package/dist/box.js
CHANGED
|
@@ -1,98 +1,216 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { a as x, r as
|
|
4
|
-
|
|
1
|
+
import { jsx as xt } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Bt, useMemo as kt } from "react";
|
|
3
|
+
import { a as x, r as Rt, c as St } from "./responsive-style.config-DFuATrIM.js";
|
|
4
|
+
import { n as V } from "./responsive-style.utils-D10sC561.js";
|
|
5
|
+
function Ct(o) {
|
|
6
|
+
return [o.animation, ...x.map((t) => o[t]?.animation)].some(
|
|
7
|
+
(t) => t === "spin" || typeof t == "object" && t !== null && (Array.isArray(t.keyframes) || t.preset === "spin")
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
function U(o, t) {
|
|
11
|
+
if (typeof o == "number") return Number.isFinite(o) ? o : t;
|
|
12
|
+
if (o === void 0) return t;
|
|
13
|
+
const i = /^\s*(-?(?:\d+(?:\.\d*)?|\.\d+))(ms|s)\s*$/.exec(o);
|
|
14
|
+
return i ? Number(i[1]) * (i[2] === "s" ? 1e3 : 1) : t;
|
|
15
|
+
}
|
|
16
|
+
function tt(o, t, i) {
|
|
17
|
+
const n = x.map(
|
|
18
|
+
(e) => window.matchMedia("(min-width: " + Rt[e] + ")")
|
|
19
|
+
), s = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
20
|
+
let r, d = "";
|
|
21
|
+
const u = () => {
|
|
22
|
+
let e = {};
|
|
23
|
+
const c = [
|
|
24
|
+
t.animation,
|
|
25
|
+
...x.map(
|
|
26
|
+
(h, m) => n[m].matches ? t[h]?.animation : void 0
|
|
27
|
+
)
|
|
28
|
+
];
|
|
29
|
+
for (const h of c)
|
|
30
|
+
if (h !== void 0)
|
|
31
|
+
if (h === "none") e = {};
|
|
32
|
+
else {
|
|
33
|
+
const m = h === "spin" ? { preset: "spin", keyframes: null } : h;
|
|
34
|
+
e = {
|
|
35
|
+
...e,
|
|
36
|
+
...m,
|
|
37
|
+
...m.easing !== void 0 ? { timingFunction: m.easing } : {},
|
|
38
|
+
...m.iterations !== void 0 ? { iterationCount: m.iterations === 1 / 0 ? "infinite" : m.iterations } : {}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const b = e.keyframes ?? (e.preset === "spin" ? [{ transform: "rotate(0deg)" }, { transform: "rotate(360deg)" }] : void 0), f = i?.animation !== void 0 || i?.animationName !== void 0 || s.matches && e.reducedMotion !== "keep", l = b?.map(
|
|
42
|
+
(h) => Object.fromEntries(
|
|
43
|
+
Object.entries(h).filter(
|
|
44
|
+
([m]) => m === "offset" || m === "easing" || m === "composite" || !(m in (i ?? {}))
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
), p = JSON.stringify([l, e, f]);
|
|
48
|
+
d !== p && (d = p, r?.cancel(), r = void 0, !(!l?.length || f || typeof o.animate != "function") && (r = o.animate(l, {
|
|
49
|
+
duration: Math.max(0, U(i?.animationDuration ?? e.duration, 1e3)),
|
|
50
|
+
delay: U(i?.animationDelay ?? e.delay, 0),
|
|
51
|
+
easing: i?.animationTimingFunction ?? e.timingFunction ?? "linear",
|
|
52
|
+
iterations: i?.animationIterationCount !== void 0 ? i.animationIterationCount === "infinite" ? 1 / 0 : Math.max(0, Number(i.animationIterationCount)) : e.iterationCount === "infinite" || e.iterationCount === void 0 ? 1 / 0 : Math.max(0, e.iterationCount),
|
|
53
|
+
direction: i?.animationDirection ?? e.direction ?? "normal",
|
|
54
|
+
fill: i?.animationFillMode ?? e.fillMode ?? "none"
|
|
55
|
+
}), (i?.animationPlayState ?? e.playState) === "paused" && r.pause()));
|
|
56
|
+
};
|
|
57
|
+
for (const e of [...n, s]) e.addEventListener("change", u);
|
|
58
|
+
return u(), () => {
|
|
59
|
+
for (const e of [...n, s]) e.removeEventListener("change", u);
|
|
60
|
+
r?.cancel();
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function Wt(o, t, i) {
|
|
64
|
+
return (n) => {
|
|
65
|
+
if (typeof o == "function") {
|
|
66
|
+
const r = o(n);
|
|
67
|
+
if (!n) return;
|
|
68
|
+
const d = tt(n, t, i);
|
|
69
|
+
return () => {
|
|
70
|
+
d(), typeof r == "function" ? r() : o(null);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (o && (o.current = n), !n) return;
|
|
74
|
+
const s = tt(n, t, i);
|
|
75
|
+
return () => {
|
|
76
|
+
s(), o && (o.current = null);
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function zt(o, t, i) {
|
|
81
|
+
if (o.scrollbar === void 0 && x.every((r) => o[r]?.scrollbar === void 0))
|
|
82
|
+
return;
|
|
83
|
+
let n = {};
|
|
84
|
+
const s = [
|
|
85
|
+
{ value: o.scrollbar, prefix: "", variable: "" },
|
|
86
|
+
...x.map((r) => ({
|
|
87
|
+
value: o[r]?.scrollbar,
|
|
88
|
+
prefix: `${r}:`,
|
|
89
|
+
variable: `${r}-`
|
|
90
|
+
}))
|
|
91
|
+
];
|
|
92
|
+
t.push("lc-scrollbar");
|
|
93
|
+
for (const [r, { value: d, prefix: u, variable: e }] of s.entries()) {
|
|
94
|
+
if (d !== void 0 && (n = d === null ? {} : {
|
|
95
|
+
...n,
|
|
96
|
+
...Object.fromEntries(Object.entries(d).filter(([, l]) => l !== void 0))
|
|
97
|
+
}), Object.entries(n).some(
|
|
98
|
+
([l, p]) => l === "buttons" ? p === "hidden" : l !== "fallbackWidth" && p != null && (typeof p != "number" || Number.isFinite(p) && p >= 0)
|
|
99
|
+
)) {
|
|
100
|
+
const l = x[r], p = `${u}${l ? `max-${l}:` : ""}`;
|
|
101
|
+
t.push(`${p}lc-scrollbar-custom`);
|
|
102
|
+
}
|
|
103
|
+
if (d === void 0) continue;
|
|
104
|
+
const c = n.thumbColor, b = n.trackColor, f = {
|
|
105
|
+
size: K(n.size, "auto"),
|
|
106
|
+
"thumb-color": c == null ? "initial" : V(c),
|
|
107
|
+
"track-color": b == null ? "initial" : V(b),
|
|
108
|
+
"thumb-radius": K(n.thumbRadius, "initial"),
|
|
109
|
+
"track-radius": K(n.trackRadius, "initial"),
|
|
110
|
+
buttons: n.buttons === "hidden" ? "none" : "initial",
|
|
111
|
+
width: n.fallbackWidth ?? "auto",
|
|
112
|
+
// Стандартный API требует пару цветов; незаданный цвет берётся из системной палитры.
|
|
113
|
+
colors: c == null && b == null ? "auto" : `${c == null ? "CanvasText" : V(c)} ${b == null ? "Canvas" : V(b)}`
|
|
114
|
+
};
|
|
115
|
+
for (const [l, p] of Object.entries(f))
|
|
116
|
+
i[`--${e}scrollbar-${l}`] = p, t.push(`${u}[--lc-scrollbar-${l}:var(--${e}scrollbar-${l})]`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function K(o, t) {
|
|
120
|
+
return o == null ? t : typeof o == "number" ? Number.isFinite(o) && o >= 0 ? `${o}px` : t : V(o);
|
|
121
|
+
}
|
|
122
|
+
function nt({
|
|
5
123
|
background: o,
|
|
6
124
|
backgroundColor: t,
|
|
7
125
|
bg: i,
|
|
8
|
-
bgSize:
|
|
126
|
+
bgSize: n,
|
|
9
127
|
bgRepeat: s,
|
|
10
|
-
bgPosition:
|
|
11
|
-
border:
|
|
12
|
-
boxShadow:
|
|
13
|
-
color:
|
|
14
|
-
cursor:
|
|
128
|
+
bgPosition: r,
|
|
129
|
+
border: d,
|
|
130
|
+
boxShadow: u,
|
|
131
|
+
color: e,
|
|
132
|
+
cursor: c,
|
|
15
133
|
opacity: b,
|
|
16
134
|
overflow: f,
|
|
17
|
-
overflowX:
|
|
18
|
-
overflowY:
|
|
19
|
-
pointerEvents:
|
|
20
|
-
aspectRatio:
|
|
21
|
-
transform:
|
|
135
|
+
overflowX: l,
|
|
136
|
+
overflowY: p,
|
|
137
|
+
pointerEvents: h,
|
|
138
|
+
aspectRatio: m,
|
|
139
|
+
transform: y,
|
|
22
140
|
transformOrigin: g,
|
|
23
|
-
p:
|
|
24
|
-
m:
|
|
25
|
-
outlineColor:
|
|
26
|
-
outlineWidth:
|
|
27
|
-
outlineOffset:
|
|
141
|
+
p: S,
|
|
142
|
+
m: C,
|
|
143
|
+
outlineColor: k,
|
|
144
|
+
outlineWidth: R,
|
|
145
|
+
outlineOffset: W,
|
|
28
146
|
outlineStyle: T,
|
|
29
|
-
listStyle:
|
|
147
|
+
listStyle: z,
|
|
30
148
|
display: I,
|
|
31
|
-
position:
|
|
32
|
-
width:
|
|
33
|
-
maxWidth:
|
|
34
|
-
minWidth:
|
|
149
|
+
position: $,
|
|
150
|
+
width: P,
|
|
151
|
+
maxWidth: j,
|
|
152
|
+
minWidth: O,
|
|
35
153
|
height: M,
|
|
36
|
-
maxHeight:
|
|
37
|
-
minHeight:
|
|
154
|
+
maxHeight: A,
|
|
155
|
+
minHeight: E
|
|
38
156
|
}) {
|
|
39
|
-
const
|
|
40
|
-
return i !== void 0 ?
|
|
157
|
+
const a = {};
|
|
158
|
+
return i !== void 0 ? Kt(a, i) : o !== void 0 && (a.background = H(o)), t !== void 0 && (a.backgroundColor = H(t)), n !== void 0 && (a.backgroundSize = Ht(n)), s !== void 0 && (a.backgroundRepeat = Gt(s)), r !== void 0 && (a.backgroundPosition = qt(r)), Ot(a, d), u !== void 0 && (a.boxShadow = B(u)), e !== void 0 && (a.color = B(e)), c !== void 0 && (a.cursor = c), b !== void 0 && (a.opacity = typeof b == "number" ? b : B(b)), f !== void 0 && (a.overflowX = f, a.overflowY = f), l !== void 0 && (a.overflowX = l), p !== void 0 && (a.overflowY = p), h !== void 0 && (a.pointerEvents = h), m !== void 0 && (a.aspectRatio = typeof m == "number" ? String(m) : B(m)), y !== void 0 && (a.transform = B(y)), g !== void 0 && (a.transformOrigin = B(g)), Pt(a, S), jt(a, C), k !== void 0 && (a.outlineColor = B(k)), R !== void 0 && (a.outlineWidth = R), W !== void 0 && (a.outlineOffset = W), T !== void 0 && (a.outlineStyle = T), z?.position !== void 0 && (a.listStylePosition = z.position), z?.type !== void 0 && (a.listStyleType = z.type), I !== void 0 && (a.display = Dt(I)), $?.type !== void 0 && (a.position = $.type), $?.top !== void 0 && (a.top = D($.top)), $?.left !== void 0 && (a.left = D($.left)), $?.right !== void 0 && (a.right = D($.right)), $?.bottom !== void 0 && (a.bottom = D($.bottom)), $?.zIndex !== void 0 && (a.zIndex = $.zIndex), P !== void 0 && (a.width = w(P)), j !== void 0 && (a.maxWidth = w(j)), O !== void 0 && (a.minWidth = w(O)), M !== void 0 && (a.height = w(M)), A !== void 0 && (a.maxHeight = w(A)), E !== void 0 && (a.minHeight = w(E)), Object.keys(a).length > 0 ? a : void 0;
|
|
41
159
|
}
|
|
42
|
-
function
|
|
43
|
-
const t = [], i = {},
|
|
44
|
-
|
|
160
|
+
function wt(o) {
|
|
161
|
+
const t = [], i = {}, n = o.groupParent === !0;
|
|
162
|
+
it(o, t, i, { isGroupParent: n });
|
|
45
163
|
for (const s of x) {
|
|
46
|
-
const
|
|
47
|
-
|
|
164
|
+
const r = o[s];
|
|
165
|
+
r && it(r, t, i, {
|
|
48
166
|
classPrefix: `${s}:`,
|
|
49
167
|
variablePrefix: `${s}-`,
|
|
50
|
-
isGroupParent:
|
|
168
|
+
isGroupParent: n
|
|
51
169
|
});
|
|
52
170
|
}
|
|
53
|
-
return
|
|
171
|
+
return zt(o, t, i), Tt(o, t, i), Lt(o, t, i), {
|
|
54
172
|
className: t.join(" "),
|
|
55
173
|
style: Object.keys(i).length > 0 ? i : void 0
|
|
56
174
|
};
|
|
57
175
|
}
|
|
58
|
-
function
|
|
59
|
-
let
|
|
176
|
+
function Tt(o, t, i) {
|
|
177
|
+
let n = {};
|
|
60
178
|
const s = [
|
|
61
179
|
{ value: o.animation, prefix: "", variable: "" },
|
|
62
|
-
...x.map((
|
|
63
|
-
value: o[
|
|
64
|
-
prefix:
|
|
65
|
-
variable:
|
|
180
|
+
...x.map((r) => ({
|
|
181
|
+
value: o[r]?.animation,
|
|
182
|
+
prefix: r + ":",
|
|
183
|
+
variable: r + "-"
|
|
66
184
|
}))
|
|
67
185
|
];
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
71
|
-
|
|
186
|
+
for (const r of s)
|
|
187
|
+
if (r.value !== void 0) {
|
|
188
|
+
if (r.value === "none")
|
|
189
|
+
n = {}, i[`--${r.variable}animation`] = "none";
|
|
72
190
|
else {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
...
|
|
76
|
-
...
|
|
77
|
-
...
|
|
78
|
-
...
|
|
191
|
+
const d = r.value === "spin" ? { preset: "spin", keyframes: null } : r.value;
|
|
192
|
+
n = {
|
|
193
|
+
...n,
|
|
194
|
+
...d,
|
|
195
|
+
...d.easing !== void 0 ? { timingFunction: d.easing } : {},
|
|
196
|
+
...d.iterations !== void 0 ? { iterationCount: d.iterations === 1 / 0 ? "infinite" : d.iterations } : {}
|
|
79
197
|
};
|
|
80
|
-
const
|
|
81
|
-
i[`--${
|
|
82
|
-
|
|
83
|
-
typeof
|
|
84
|
-
|
|
85
|
-
typeof
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
198
|
+
const u = n.keyframes || n.preset === "spin" ? "none" : n.preset ?? "none";
|
|
199
|
+
i[`--${r.variable}animation`] = [
|
|
200
|
+
u,
|
|
201
|
+
typeof n.duration == "number" ? n.duration + "ms" : n.duration ?? "1s",
|
|
202
|
+
n.timingFunction ?? "linear",
|
|
203
|
+
typeof n.delay == "number" ? n.delay + "ms" : n.delay ?? "0ms",
|
|
204
|
+
n.iterationCount ?? "infinite",
|
|
205
|
+
n.direction ?? "normal",
|
|
206
|
+
n.fillMode ?? "none",
|
|
207
|
+
n.playState ?? "running"
|
|
90
208
|
].join(" ");
|
|
91
209
|
}
|
|
92
|
-
t.push(`${
|
|
210
|
+
t.push(`${r.prefix}[animation:var(--${r.variable}animation)]`);
|
|
93
211
|
}
|
|
94
212
|
}
|
|
95
|
-
const
|
|
213
|
+
const X = [
|
|
96
214
|
{
|
|
97
215
|
prop: "hover",
|
|
98
216
|
name: "hover",
|
|
@@ -114,107 +232,107 @@ const q = [
|
|
|
114
232
|
variant: "[&:is(:disabled,[aria-disabled=true],[data-disabled=true]):is(:disabled,[aria-disabled=true],[data-disabled=true])]"
|
|
115
233
|
}
|
|
116
234
|
];
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
for (const
|
|
120
|
-
for (const
|
|
121
|
-
Object.keys(
|
|
235
|
+
function Lt(o, t, i) {
|
|
236
|
+
const n = [o, ...x.map((e) => o[e] ?? {})], s = /* @__PURE__ */ new Set();
|
|
237
|
+
for (const e of X)
|
|
238
|
+
for (const c of n)
|
|
239
|
+
Object.keys(ot(c, e.prop)).forEach(
|
|
122
240
|
(b) => s.add(b)
|
|
123
|
-
),
|
|
241
|
+
), e.prop === "hover" && c.hover === null && s.add("backgroundColor");
|
|
124
242
|
if (s.size === 0) return;
|
|
125
|
-
for (const
|
|
126
|
-
const
|
|
127
|
-
for (const b of
|
|
128
|
-
t.push(`[--ui-state-${b.name}-${
|
|
243
|
+
for (const e of s) {
|
|
244
|
+
const c = J(e);
|
|
245
|
+
for (const b of X)
|
|
246
|
+
t.push(`[--ui-state-${b.name}-${c}:initial]`);
|
|
129
247
|
}
|
|
130
|
-
let
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const b =
|
|
135
|
-
for (const f of
|
|
136
|
-
const
|
|
137
|
-
Object.keys(
|
|
138
|
-
for (const
|
|
139
|
-
const g =
|
|
140
|
-
i[
|
|
141
|
-
const
|
|
142
|
-
i[
|
|
143
|
-
const
|
|
144
|
-
i[
|
|
145
|
-
const
|
|
248
|
+
let r = {};
|
|
249
|
+
const d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
250
|
+
n.forEach((e, c) => {
|
|
251
|
+
r = { ...r, ...Y(e) };
|
|
252
|
+
const b = c === 0 ? "" : `${x[c - 1]}:`;
|
|
253
|
+
for (const f of X) {
|
|
254
|
+
const l = d.get(f.name) ?? {}, p = ot(e, f.prop), h = e[f.prop] === null ? {} : { ...l, ...p }, m = u.get(f.name) ?? /* @__PURE__ */ new Set();
|
|
255
|
+
Object.keys(p).forEach((y) => m.add(y)), f.prop === "hover" && e.hover === null && m.add("backgroundColor"), d.set(f.name, h), u.set(f.name, m);
|
|
256
|
+
for (const y of m) {
|
|
257
|
+
const g = J(y), S = r[y] ?? Nt(y, c), C = `--ui-state-normal-${c}-${g}`;
|
|
258
|
+
i[C] = String(S);
|
|
259
|
+
const k = `--${f.name}-${c}-${g}`;
|
|
260
|
+
i[k] = String(h[y] ?? S);
|
|
261
|
+
const R = `--ui-state-value-${f.name}-${c}-${g}`;
|
|
262
|
+
i[R] = h[y] === void 0 ? "initial" : `var(${k})`;
|
|
263
|
+
const W = `var(--ui-state-disabled-${g},var(--ui-state-active-${g},var(--ui-state-focus-visible-${g},var(--ui-state-hover-${g},var(${C})))))`;
|
|
146
264
|
t.push(
|
|
147
|
-
`${b}${f.variant}:[--ui-state-${f.name}-${g}:var(${
|
|
148
|
-
`${b}${f.variant}:[${g}:${
|
|
265
|
+
`${b}${f.variant}:[--ui-state-${f.name}-${g}:var(${R})]`,
|
|
266
|
+
`${b}${f.variant}:[${g}:${W}]`
|
|
149
267
|
);
|
|
150
268
|
}
|
|
151
269
|
}
|
|
152
270
|
});
|
|
153
271
|
}
|
|
154
|
-
function
|
|
272
|
+
function ot(o, t) {
|
|
155
273
|
const i = o[t];
|
|
156
|
-
return i ? t !== "hover" && "outlineWidth" in i && i.outlineStyle === void 0 ?
|
|
274
|
+
return i ? t !== "hover" && "outlineWidth" in i && i.outlineStyle === void 0 ? Y({ ...i, outlineStyle: "solid" }) : Y(i) : {};
|
|
157
275
|
}
|
|
158
|
-
function
|
|
276
|
+
function Nt(o, t) {
|
|
159
277
|
const i = o === "color" ? "inherit" : "initial";
|
|
160
278
|
if (o !== "background" && o !== "backgroundColor" && o !== "color")
|
|
161
279
|
return i;
|
|
162
|
-
const
|
|
163
|
-
let s = `var(--button-${
|
|
164
|
-
for (let
|
|
165
|
-
s = `var(--${x[
|
|
280
|
+
const n = o === "color" ? "color" : "bg";
|
|
281
|
+
let s = `var(--button-${n},${i})`;
|
|
282
|
+
for (let r = 0; r < t; r += 1)
|
|
283
|
+
s = `var(--${x[r]}-button-${n},${s})`;
|
|
166
284
|
return s;
|
|
167
285
|
}
|
|
168
|
-
function
|
|
169
|
-
const t = { ...
|
|
286
|
+
function Y(o) {
|
|
287
|
+
const t = { ...nt(o) };
|
|
170
288
|
if (t.borderWidth !== void 0) {
|
|
171
|
-
const i = String(t.borderWidth).split(/\s+(?![^()]*\))/),
|
|
289
|
+
const i = String(t.borderWidth).split(/\s+(?![^()]*\))/), n = i[0], s = i[1] ?? n, r = i[2] ?? n, d = i[3] ?? s;
|
|
172
290
|
Object.assign(t, {
|
|
173
|
-
borderTopWidth:
|
|
291
|
+
borderTopWidth: n,
|
|
174
292
|
borderRightWidth: s,
|
|
175
|
-
borderBottomWidth:
|
|
176
|
-
borderLeftWidth:
|
|
293
|
+
borderBottomWidth: r,
|
|
294
|
+
borderLeftWidth: d
|
|
177
295
|
}), delete t.borderWidth;
|
|
178
296
|
}
|
|
179
297
|
if (t.borderRadius !== void 0) {
|
|
180
|
-
const [i,
|
|
181
|
-
const
|
|
298
|
+
const [i, n = i] = String(t.borderRadius).split("/"), s = (u) => {
|
|
299
|
+
const e = u.trim().split(/\s+(?![^()]*\))/);
|
|
182
300
|
return [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
301
|
+
e[0],
|
|
302
|
+
e[1] ?? e[0],
|
|
303
|
+
e[2] ?? e[0],
|
|
304
|
+
e[3] ?? e[1] ?? e[0]
|
|
187
305
|
];
|
|
188
|
-
},
|
|
189
|
-
["TopLeft", "TopRight", "BottomRight", "BottomLeft"].forEach((
|
|
190
|
-
t[`border${
|
|
306
|
+
}, r = s(i), d = s(n);
|
|
307
|
+
["TopLeft", "TopRight", "BottomRight", "BottomLeft"].forEach((u, e) => {
|
|
308
|
+
t[`border${u}Radius`] = `${r[e]} ${d[e]}`;
|
|
191
309
|
}), delete t.borderRadius;
|
|
192
310
|
}
|
|
193
311
|
return t;
|
|
194
312
|
}
|
|
195
|
-
function
|
|
196
|
-
classPrefix:
|
|
313
|
+
function it(o, t, i, {
|
|
314
|
+
classPrefix: n = "",
|
|
197
315
|
variablePrefix: s = "",
|
|
198
|
-
isGroupParent:
|
|
316
|
+
isGroupParent: r = !1
|
|
199
317
|
} = {}) {
|
|
200
|
-
const
|
|
201
|
-
for (const [
|
|
202
|
-
if (
|
|
318
|
+
const d = nt(o);
|
|
319
|
+
for (const [u, e] of Object.entries(d ?? {})) {
|
|
320
|
+
if (e == null)
|
|
203
321
|
continue;
|
|
204
|
-
const
|
|
322
|
+
const c = String(e), b = Vt(u, c);
|
|
205
323
|
if (b) {
|
|
206
|
-
t.push(`${
|
|
324
|
+
t.push(`${n}${b}`);
|
|
207
325
|
continue;
|
|
208
326
|
}
|
|
209
|
-
const f = `${s}${
|
|
210
|
-
|
|
327
|
+
const f = `${s}${J(u)}`, l = It(u, f);
|
|
328
|
+
l && (i[`--${f}`] = c, t.push(`${n}${l}`));
|
|
211
329
|
}
|
|
212
330
|
if (o.bgGroup !== void 0) {
|
|
213
|
-
const
|
|
214
|
-
i[`--${
|
|
331
|
+
const u = `${s}group-background`;
|
|
332
|
+
i[`--${u}`] = H(o.bgGroup), t.push(`${n}group-hover:[background:var(--${u})]`), r && t.push(`${n}hover:[background:var(--${u})]`);
|
|
215
333
|
}
|
|
216
334
|
}
|
|
217
|
-
function
|
|
335
|
+
function Vt(o, t) {
|
|
218
336
|
if (o === "display")
|
|
219
337
|
return t === "none" ? "hidden" : t;
|
|
220
338
|
if (o === "position")
|
|
@@ -257,7 +375,7 @@ function Wt(o, t) {
|
|
|
257
375
|
if (o === "listStyleType")
|
|
258
376
|
return `list-${t}`;
|
|
259
377
|
}
|
|
260
|
-
function
|
|
378
|
+
function It(o, t) {
|
|
261
379
|
const i = `var(--${t})`;
|
|
262
380
|
return {
|
|
263
381
|
background: `[background:${i}]`,
|
|
@@ -310,56 +428,56 @@ function wt(o, t) {
|
|
|
310
428
|
zIndex: `z-[${i}]`
|
|
311
429
|
}[o];
|
|
312
430
|
}
|
|
313
|
-
function
|
|
431
|
+
function J(o) {
|
|
314
432
|
return o.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
315
433
|
}
|
|
316
|
-
function
|
|
434
|
+
function Pt(o, t) {
|
|
317
435
|
if (t !== void 0) {
|
|
318
436
|
if (Array.isArray(t)) {
|
|
319
|
-
o.padding = t.map(
|
|
437
|
+
o.padding = t.map(v).join(" ");
|
|
320
438
|
return;
|
|
321
439
|
}
|
|
322
440
|
if (typeof t != "object") {
|
|
323
|
-
o.padding =
|
|
441
|
+
o.padding = v(t);
|
|
324
442
|
return;
|
|
325
443
|
}
|
|
326
|
-
"px" in t && t.px !== void 0 && (o.paddingLeft =
|
|
444
|
+
"px" in t && t.px !== void 0 && (o.paddingLeft = v(t.px), o.paddingRight = v(t.px)), "py" in t && t.py !== void 0 && (o.paddingTop = v(t.py), o.paddingBottom = v(t.py)), "pt" in t && t.pt !== void 0 && (o.paddingTop = v(t.pt)), "pb" in t && t.pb !== void 0 && (o.paddingBottom = v(t.pb)), "pl" in t && t.pl !== void 0 && (o.paddingLeft = v(t.pl)), "pr" in t && t.pr !== void 0 && (o.paddingRight = v(t.pr));
|
|
327
445
|
}
|
|
328
446
|
}
|
|
329
|
-
function
|
|
447
|
+
function jt(o, t) {
|
|
330
448
|
if (t !== void 0) {
|
|
331
449
|
if (Array.isArray(t)) {
|
|
332
|
-
o.margin = t.map(
|
|
450
|
+
o.margin = t.map(v).join(" ");
|
|
333
451
|
return;
|
|
334
452
|
}
|
|
335
453
|
if (typeof t != "object") {
|
|
336
|
-
o.margin =
|
|
454
|
+
o.margin = v(t);
|
|
337
455
|
return;
|
|
338
456
|
}
|
|
339
|
-
"mx" in t && t.mx !== void 0 && (o.marginLeft =
|
|
457
|
+
"mx" in t && t.mx !== void 0 && (o.marginLeft = v(t.mx), o.marginRight = v(t.mx)), "my" in t && t.my !== void 0 && (o.marginTop = v(t.my), o.marginBottom = v(t.my)), "mt" in t && t.mt !== void 0 && (o.marginTop = v(t.mt)), "mb" in t && t.mb !== void 0 && (o.marginBottom = v(t.mb)), "ml" in t && t.ml !== void 0 && (o.marginLeft = v(t.ml)), "mr" in t && t.mr !== void 0 && (o.marginRight = v(t.mr));
|
|
340
458
|
}
|
|
341
459
|
}
|
|
342
|
-
function
|
|
343
|
-
t && (t.radius !== void 0 &&
|
|
460
|
+
function Ot(o, t) {
|
|
461
|
+
t && (t.radius !== void 0 && Mt(o, t.radius), t.color !== void 0 && (o.borderColor = B(t.color)), t.width !== void 0 && At(o, t.width), t.style !== void 0 && (o.borderStyle = t.style));
|
|
344
462
|
}
|
|
345
|
-
function
|
|
346
|
-
if (
|
|
463
|
+
function Mt(o, t) {
|
|
464
|
+
if (Et(t)) {
|
|
347
465
|
t.topLeft !== void 0 && (o.borderTopLeftRadius = L(t.topLeft)), t.topRight !== void 0 && (o.borderTopRightRadius = L(t.topRight)), t.bottomLeft !== void 0 && (o.borderBottomLeftRadius = L(t.bottomLeft)), t.bottomRight !== void 0 && (o.borderBottomRightRadius = L(t.bottomRight));
|
|
348
466
|
return;
|
|
349
467
|
}
|
|
350
468
|
o.borderRadius = L(t);
|
|
351
469
|
}
|
|
352
|
-
function
|
|
353
|
-
if (
|
|
470
|
+
function At(o, t) {
|
|
471
|
+
if (Ft(t)) {
|
|
354
472
|
t.top !== void 0 && (o.borderTopWidth = N(t.top)), t.bottom !== void 0 && (o.borderBottomWidth = N(t.bottom)), t.left !== void 0 && (o.borderLeftWidth = N(t.left)), t.right !== void 0 && (o.borderRightWidth = N(t.right));
|
|
355
473
|
return;
|
|
356
474
|
}
|
|
357
475
|
o.borderWidth = N(t);
|
|
358
476
|
}
|
|
359
|
-
function
|
|
477
|
+
function Et(o) {
|
|
360
478
|
return typeof o == "object";
|
|
361
479
|
}
|
|
362
|
-
function
|
|
480
|
+
function Ft(o) {
|
|
363
481
|
return typeof o == "object";
|
|
364
482
|
}
|
|
365
483
|
function L(o) {
|
|
@@ -368,22 +486,22 @@ function L(o) {
|
|
|
368
486
|
function N(o) {
|
|
369
487
|
return o.startsWith("--") ? `var(${o})` : o;
|
|
370
488
|
}
|
|
371
|
-
function
|
|
489
|
+
function Dt(o) {
|
|
372
490
|
return o === "hidden" ? "none" : o;
|
|
373
491
|
}
|
|
374
|
-
function
|
|
492
|
+
function D(o) {
|
|
375
493
|
return typeof o == "number" ? `${o}px` : o;
|
|
376
494
|
}
|
|
377
|
-
function
|
|
495
|
+
function v(o) {
|
|
378
496
|
return typeof o == "number" ? `${o}px` : o;
|
|
379
497
|
}
|
|
380
|
-
function
|
|
498
|
+
function w(o) {
|
|
381
499
|
return typeof o == "number" ? `${o}px` : o;
|
|
382
500
|
}
|
|
383
|
-
function
|
|
501
|
+
function Ht(o) {
|
|
384
502
|
return typeof o == "number" ? `${o}px` : o;
|
|
385
503
|
}
|
|
386
|
-
function
|
|
504
|
+
function Gt(o) {
|
|
387
505
|
return {
|
|
388
506
|
"no-repeat": "no-repeat",
|
|
389
507
|
repeat: "repeat",
|
|
@@ -393,222 +511,149 @@ function Ot(o) {
|
|
|
393
511
|
"repeat-y": "repeat-y"
|
|
394
512
|
}[o];
|
|
395
513
|
}
|
|
396
|
-
function
|
|
514
|
+
function qt(o) {
|
|
397
515
|
return o.replace("-", " ");
|
|
398
516
|
}
|
|
399
|
-
function
|
|
517
|
+
function H(o) {
|
|
400
518
|
return B(o);
|
|
401
519
|
}
|
|
402
|
-
function
|
|
403
|
-
const i =
|
|
404
|
-
if (
|
|
520
|
+
function Kt(o, t) {
|
|
521
|
+
const i = H(t);
|
|
522
|
+
if (Xt(t)) {
|
|
405
523
|
o.background = i;
|
|
406
524
|
return;
|
|
407
525
|
}
|
|
408
526
|
o.backgroundColor = i;
|
|
409
527
|
}
|
|
410
|
-
function
|
|
528
|
+
function Xt(o) {
|
|
411
529
|
const t = o.trim().toLowerCase();
|
|
412
530
|
return t.includes("url(") || t.includes("gradient(") || t.includes("image-set(") || t.includes("cross-fade(") || t.includes("element(") || t.includes("paint(");
|
|
413
531
|
}
|
|
414
532
|
function B(o) {
|
|
415
533
|
return o.startsWith("--") ? `var(${o})` : o;
|
|
416
534
|
}
|
|
417
|
-
function
|
|
418
|
-
return [o.animation, ...x.map((t) => o[t]?.animation)].some(
|
|
419
|
-
(t) => t === "spin" || typeof t == "object" && t !== null && (Array.isArray(t.keyframes) || t.preset === "spin")
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
function U(o, t) {
|
|
423
|
-
if (typeof o == "number") return Number.isFinite(o) ? o : t;
|
|
424
|
-
if (o === void 0) return t;
|
|
425
|
-
const i = /^\s*(-?(?:\d+(?:\.\d*)?|\.\d+))(ms|s)\s*$/.exec(o);
|
|
426
|
-
return i ? Number(i[1]) * (i[2] === "s" ? 1e3 : 1) : t;
|
|
427
|
-
}
|
|
428
|
-
function tt(o, t, i) {
|
|
429
|
-
const e = x.map(
|
|
430
|
-
(n) => window.matchMedia("(min-width: " + Bt[n] + ")")
|
|
431
|
-
), s = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
432
|
-
let a, c = "";
|
|
433
|
-
const d = () => {
|
|
434
|
-
let n = {};
|
|
435
|
-
const l = [
|
|
436
|
-
t.animation,
|
|
437
|
-
...x.map(
|
|
438
|
-
(p, u) => e[u].matches ? t[p]?.animation : void 0
|
|
439
|
-
)
|
|
440
|
-
];
|
|
441
|
-
for (const p of l)
|
|
442
|
-
if (p !== void 0)
|
|
443
|
-
if (p === "none") n = {};
|
|
444
|
-
else {
|
|
445
|
-
const u = p === "spin" ? { preset: "spin", keyframes: null } : p;
|
|
446
|
-
n = {
|
|
447
|
-
...n,
|
|
448
|
-
...u,
|
|
449
|
-
...u.easing !== void 0 ? { timingFunction: u.easing } : {},
|
|
450
|
-
...u.iterations !== void 0 ? { iterationCount: u.iterations === 1 / 0 ? "infinite" : u.iterations } : {}
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
const b = n.keyframes ?? (n.preset === "spin" ? [{ transform: "rotate(0deg)" }, { transform: "rotate(360deg)" }] : void 0), f = i?.animation !== void 0 || i?.animationName !== void 0 || s.matches && n.reducedMotion !== "keep", h = b?.map(
|
|
454
|
-
(p) => Object.fromEntries(
|
|
455
|
-
Object.entries(p).filter(
|
|
456
|
-
([u]) => u === "offset" || u === "easing" || u === "composite" || !(u in (i ?? {}))
|
|
457
|
-
)
|
|
458
|
-
)
|
|
459
|
-
), y = JSON.stringify([h, n, f]);
|
|
460
|
-
c !== y && (c = y, a?.cancel(), a = void 0, !(!h?.length || f || typeof o.animate != "function") && (a = o.animate(h, {
|
|
461
|
-
duration: Math.max(0, U(i?.animationDuration ?? n.duration, 1e3)),
|
|
462
|
-
delay: U(i?.animationDelay ?? n.delay, 0),
|
|
463
|
-
easing: i?.animationTimingFunction ?? n.timingFunction ?? "linear",
|
|
464
|
-
iterations: i?.animationIterationCount !== void 0 ? i.animationIterationCount === "infinite" ? 1 / 0 : Math.max(0, Number(i.animationIterationCount)) : n.iterationCount === "infinite" || n.iterationCount === void 0 ? 1 / 0 : Math.max(0, n.iterationCount),
|
|
465
|
-
direction: i?.animationDirection ?? n.direction ?? "normal",
|
|
466
|
-
fill: i?.animationFillMode ?? n.fillMode ?? "none"
|
|
467
|
-
}), (i?.animationPlayState ?? n.playState) === "paused" && a.pause()));
|
|
468
|
-
};
|
|
469
|
-
for (const n of [...e, s]) n.addEventListener("change", d);
|
|
470
|
-
return d(), () => {
|
|
471
|
-
for (const n of [...e, s]) n.removeEventListener("change", d);
|
|
472
|
-
a?.cancel();
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
function Ht(o, t, i) {
|
|
476
|
-
return (e) => {
|
|
477
|
-
if (typeof o == "function") {
|
|
478
|
-
const a = o(e);
|
|
479
|
-
if (!e) return;
|
|
480
|
-
const c = tt(e, t, i);
|
|
481
|
-
return () => {
|
|
482
|
-
c(), typeof a == "function" ? a() : o(null);
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
if (o && (o.current = e), !e) return;
|
|
486
|
-
const s = tt(e, t, i);
|
|
487
|
-
return () => {
|
|
488
|
-
s(), o && (o.current = null);
|
|
489
|
-
};
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
function Gt(o, t) {
|
|
535
|
+
function Yt(o, t) {
|
|
493
536
|
const {
|
|
494
537
|
as: i,
|
|
495
|
-
children:
|
|
538
|
+
children: n,
|
|
496
539
|
className: s,
|
|
497
|
-
background:
|
|
498
|
-
backgroundColor:
|
|
499
|
-
bg:
|
|
500
|
-
bgSize:
|
|
501
|
-
bgRepeat:
|
|
540
|
+
background: r,
|
|
541
|
+
backgroundColor: d,
|
|
542
|
+
bg: u,
|
|
543
|
+
bgSize: e,
|
|
544
|
+
bgRepeat: c,
|
|
502
545
|
bgGroup: b,
|
|
503
546
|
groupParent: f,
|
|
504
|
-
bgPosition:
|
|
505
|
-
border:
|
|
506
|
-
boxShadow:
|
|
507
|
-
color:
|
|
508
|
-
cursor:
|
|
547
|
+
bgPosition: l,
|
|
548
|
+
border: p,
|
|
549
|
+
boxShadow: h,
|
|
550
|
+
color: m,
|
|
551
|
+
cursor: y,
|
|
509
552
|
opacity: g,
|
|
510
|
-
overflow:
|
|
511
|
-
overflowX:
|
|
512
|
-
overflowY:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
553
|
+
overflow: S,
|
|
554
|
+
overflowX: C,
|
|
555
|
+
overflowY: k,
|
|
556
|
+
scrollbar: R,
|
|
557
|
+
pointerEvents: W,
|
|
558
|
+
animation: T,
|
|
559
|
+
aspectRatio: z,
|
|
560
|
+
transform: I,
|
|
561
|
+
transformOrigin: $,
|
|
562
|
+
p: P,
|
|
563
|
+
m: j,
|
|
564
|
+
outlineColor: O,
|
|
565
|
+
outlineWidth: M,
|
|
566
|
+
outlineOffset: A,
|
|
567
|
+
outlineStyle: E,
|
|
568
|
+
listStyle: a,
|
|
569
|
+
display: et,
|
|
570
|
+
position: rt,
|
|
571
|
+
width: at,
|
|
572
|
+
maxWidth: st,
|
|
573
|
+
minWidth: dt,
|
|
574
|
+
height: ut,
|
|
575
|
+
hover: ct,
|
|
576
|
+
focusVisible: ft,
|
|
577
|
+
active: lt,
|
|
578
|
+
disabledStyle: mt,
|
|
579
|
+
maxHeight: bt,
|
|
580
|
+
minHeight: pt,
|
|
581
|
+
md: _,
|
|
582
|
+
lg: Z,
|
|
583
|
+
xl: Q,
|
|
584
|
+
style: F,
|
|
585
|
+
...vt
|
|
586
|
+
} = o, ht = i ?? "div", G = {
|
|
587
|
+
hover: ct,
|
|
588
|
+
focusVisible: ft,
|
|
589
|
+
active: lt,
|
|
590
|
+
disabledStyle: mt,
|
|
591
|
+
background: r,
|
|
592
|
+
backgroundColor: d,
|
|
593
|
+
bg: u,
|
|
594
|
+
bgSize: e,
|
|
595
|
+
bgRepeat: c,
|
|
552
596
|
bgGroup: b,
|
|
553
597
|
groupParent: f,
|
|
554
|
-
bgPosition:
|
|
555
|
-
border:
|
|
556
|
-
boxShadow:
|
|
557
|
-
color:
|
|
558
|
-
cursor:
|
|
598
|
+
bgPosition: l,
|
|
599
|
+
border: p,
|
|
600
|
+
boxShadow: h,
|
|
601
|
+
color: m,
|
|
602
|
+
cursor: y,
|
|
559
603
|
opacity: g,
|
|
560
|
-
overflow:
|
|
561
|
-
overflowX:
|
|
562
|
-
overflowY:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
J?.animation,
|
|
604
|
+
overflow: S,
|
|
605
|
+
overflowX: C,
|
|
606
|
+
overflowY: k,
|
|
607
|
+
scrollbar: R,
|
|
608
|
+
pointerEvents: W,
|
|
609
|
+
animation: T,
|
|
610
|
+
aspectRatio: z,
|
|
611
|
+
transform: I,
|
|
612
|
+
transformOrigin: $,
|
|
613
|
+
p: P,
|
|
614
|
+
m: j,
|
|
615
|
+
outlineColor: O,
|
|
616
|
+
outlineWidth: M,
|
|
617
|
+
outlineOffset: A,
|
|
618
|
+
outlineStyle: E,
|
|
619
|
+
listStyle: a,
|
|
620
|
+
display: et,
|
|
621
|
+
position: rt,
|
|
622
|
+
width: at,
|
|
623
|
+
maxWidth: st,
|
|
624
|
+
minWidth: dt,
|
|
625
|
+
height: ut,
|
|
626
|
+
maxHeight: bt,
|
|
627
|
+
minHeight: pt,
|
|
628
|
+
md: _,
|
|
629
|
+
lg: Z,
|
|
630
|
+
xl: Q
|
|
631
|
+
}, gt = JSON.stringify([
|
|
632
|
+
T,
|
|
590
633
|
_?.animation,
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
634
|
+
Z?.animation,
|
|
635
|
+
Q?.animation,
|
|
636
|
+
F
|
|
637
|
+
]), $t = kt(
|
|
638
|
+
() => Wt(t, G, F),
|
|
594
639
|
// Значения захваченных настроек представлены стабильным ключом.
|
|
595
|
-
[t,
|
|
596
|
-
),
|
|
597
|
-
...
|
|
598
|
-
...
|
|
640
|
+
[t, gt]
|
|
641
|
+
), q = wt(G), yt = q.style || F ? {
|
|
642
|
+
...q.style,
|
|
643
|
+
...F
|
|
599
644
|
} : void 0;
|
|
600
|
-
return /* @__PURE__ */
|
|
601
|
-
|
|
645
|
+
return /* @__PURE__ */ xt(
|
|
646
|
+
ht,
|
|
602
647
|
{
|
|
603
|
-
className:
|
|
604
|
-
ref:
|
|
605
|
-
style:
|
|
606
|
-
...
|
|
607
|
-
children:
|
|
648
|
+
className: St(q.className, f && "group", s),
|
|
649
|
+
ref: Ct(G) ? $t : t,
|
|
650
|
+
style: yt,
|
|
651
|
+
...vt,
|
|
652
|
+
children: n
|
|
608
653
|
}
|
|
609
654
|
);
|
|
610
655
|
}
|
|
611
|
-
const
|
|
656
|
+
const Ut = Bt(Yt);
|
|
612
657
|
export {
|
|
613
|
-
|
|
658
|
+
Ut as Box
|
|
614
659
|
};
|