@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/dist/box.js CHANGED
@@ -1,98 +1,216 @@
1
- import { jsx as ht } from "react/jsx-runtime";
2
- import { forwardRef as $t, useMemo as yt } from "react";
3
- import { a as x, r as Bt, c as xt } from "./responsive-style.config-DFuATrIM.js";
4
- function ot({
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: e,
126
+ bgSize: n,
9
127
  bgRepeat: s,
10
- bgPosition: a,
11
- border: c,
12
- boxShadow: d,
13
- color: n,
14
- cursor: l,
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: h,
18
- overflowY: y,
19
- pointerEvents: p,
20
- aspectRatio: u,
21
- transform: $,
135
+ overflowX: l,
136
+ overflowY: p,
137
+ pointerEvents: h,
138
+ aspectRatio: m,
139
+ transform: y,
22
140
  transformOrigin: g,
23
- p: C,
24
- m: W,
25
- outlineColor: S,
26
- outlineWidth: k,
27
- outlineOffset: R,
141
+ p: S,
142
+ m: C,
143
+ outlineColor: k,
144
+ outlineWidth: R,
145
+ outlineOffset: W,
28
146
  outlineStyle: T,
29
- listStyle: w,
147
+ listStyle: z,
30
148
  display: I,
31
- position: v,
32
- width: V,
33
- maxWidth: P,
34
- minWidth: j,
149
+ position: $,
150
+ width: P,
151
+ maxWidth: j,
152
+ minWidth: O,
35
153
  height: M,
36
- maxHeight: O,
37
- minHeight: A
154
+ maxHeight: A,
155
+ minHeight: E
38
156
  }) {
39
- const r = {};
40
- return i !== void 0 ? Et(r, i) : o !== void 0 && (r.background = D(o)), t !== void 0 && (r.backgroundColor = D(t)), e !== void 0 && (r.backgroundSize = Mt(e)), s !== void 0 && (r.backgroundRepeat = Ot(s)), a !== void 0 && (r.backgroundPosition = At(a)), Nt(r, c), d !== void 0 && (r.boxShadow = B(d)), n !== void 0 && (r.color = B(n)), l !== void 0 && (r.cursor = l), b !== void 0 && (r.opacity = typeof b == "number" ? b : B(b)), f !== void 0 && (r.overflowX = f, r.overflowY = f), h !== void 0 && (r.overflowX = h), y !== void 0 && (r.overflowY = y), p !== void 0 && (r.pointerEvents = p), u !== void 0 && (r.aspectRatio = typeof u == "number" ? String(u) : B(u)), $ !== void 0 && (r.transform = B($)), g !== void 0 && (r.transformOrigin = B(g)), zt(r, C), Lt(r, W), S !== void 0 && (r.outlineColor = B(S)), k !== void 0 && (r.outlineWidth = k), R !== void 0 && (r.outlineOffset = R), T !== void 0 && (r.outlineStyle = T), w?.position !== void 0 && (r.listStylePosition = w.position), w?.type !== void 0 && (r.listStyleType = w.type), I !== void 0 && (r.display = jt(I)), v?.type !== void 0 && (r.position = v.type), v?.top !== void 0 && (r.top = F(v.top)), v?.left !== void 0 && (r.left = F(v.left)), v?.right !== void 0 && (r.right = F(v.right)), v?.bottom !== void 0 && (r.bottom = F(v.bottom)), v?.zIndex !== void 0 && (r.zIndex = v.zIndex), V !== void 0 && (r.width = z(V)), P !== void 0 && (r.maxWidth = z(P)), j !== void 0 && (r.minWidth = z(j)), M !== void 0 && (r.height = z(M)), O !== void 0 && (r.maxHeight = z(O)), A !== void 0 && (r.minHeight = z(A)), Object.keys(r).length > 0 ? r : 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 St(o) {
43
- const t = [], i = {}, e = o.groupParent === !0;
44
- Q(o, t, i, { isGroupParent: e });
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 a = o[s];
47
- a && Q(a, t, i, {
164
+ const r = o[s];
165
+ r && it(r, t, i, {
48
166
  classPrefix: `${s}:`,
49
167
  variablePrefix: `${s}-`,
50
- isGroupParent: e
168
+ isGroupParent: n
51
169
  });
52
170
  }
53
- return kt(o, t, i), Rt(o, t, i), {
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 kt(o, t, i) {
59
- let e = {};
176
+ function Tt(o, t, i) {
177
+ let n = {};
60
178
  const s = [
61
179
  { value: o.animation, prefix: "", variable: "" },
62
- ...x.map((a) => ({
63
- value: o[a]?.animation,
64
- prefix: a + ":",
65
- variable: a + "-"
180
+ ...x.map((r) => ({
181
+ value: o[r]?.animation,
182
+ prefix: r + ":",
183
+ variable: r + "-"
66
184
  }))
67
185
  ];
68
- for (const a of s)
69
- if (a.value !== void 0) {
70
- if (a.value === "none")
71
- e = {}, i[`--${a.variable}animation`] = "none";
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 c = a.value === "spin" ? { preset: "spin", keyframes: null } : a.value;
74
- e = {
75
- ...e,
76
- ...c,
77
- ...c.easing !== void 0 ? { timingFunction: c.easing } : {},
78
- ...c.iterations !== void 0 ? { iterationCount: c.iterations === 1 / 0 ? "infinite" : c.iterations } : {}
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 d = e.keyframes || e.preset === "spin" ? "none" : e.preset ?? "none";
81
- i[`--${a.variable}animation`] = [
82
- d,
83
- typeof e.duration == "number" ? e.duration + "ms" : e.duration ?? "1s",
84
- e.timingFunction ?? "linear",
85
- typeof e.delay == "number" ? e.delay + "ms" : e.delay ?? "0ms",
86
- e.iterationCount ?? "infinite",
87
- e.direction ?? "normal",
88
- e.fillMode ?? "none",
89
- e.playState ?? "running"
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(`${a.prefix}[animation:var(--${a.variable}animation)]`);
210
+ t.push(`${r.prefix}[animation:var(--${r.variable}animation)]`);
93
211
  }
94
212
  }
95
- const q = [
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 Rt(o, t, i) {
118
- const e = [o, ...x.map((n) => o[n] ?? {})], s = /* @__PURE__ */ new Set();
119
- for (const n of q)
120
- for (const l of e)
121
- Object.keys(Z(l, n.prop)).forEach(
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
- ), n.prop === "hover" && l.hover === null && s.add("backgroundColor");
241
+ ), e.prop === "hover" && c.hover === null && s.add("backgroundColor");
124
242
  if (s.size === 0) return;
125
- for (const n of s) {
126
- const l = X(n);
127
- for (const b of q)
128
- t.push(`[--ui-state-${b.name}-${l}:initial]`);
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 a = {};
131
- const c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
132
- e.forEach((n, l) => {
133
- a = { ...a, ...K(n) };
134
- const b = l === 0 ? "" : `${x[l - 1]}:`;
135
- for (const f of q) {
136
- const h = c.get(f.name) ?? {}, y = Z(n, f.prop), p = n[f.prop] === null ? {} : { ...h, ...y }, u = d.get(f.name) ?? /* @__PURE__ */ new Set();
137
- Object.keys(y).forEach(($) => u.add($)), f.prop === "hover" && n.hover === null && u.add("backgroundColor"), c.set(f.name, p), d.set(f.name, u);
138
- for (const $ of u) {
139
- const g = X($), C = a[$] ?? Ct($, l), W = `--ui-state-normal-${l}-${g}`;
140
- i[W] = String(C);
141
- const S = `--${f.name}-${l}-${g}`;
142
- i[S] = String(p[$] ?? C);
143
- const k = `--ui-state-value-${f.name}-${l}-${g}`;
144
- i[k] = p[$] === void 0 ? "initial" : `var(${S})`;
145
- const R = `var(--ui-state-disabled-${g},var(--ui-state-active-${g},var(--ui-state-focus-visible-${g},var(--ui-state-hover-${g},var(${W})))))`;
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(${k})]`,
148
- `${b}${f.variant}:[${g}:${R}]`
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 Z(o, t) {
272
+ function ot(o, t) {
155
273
  const i = o[t];
156
- return i ? t !== "hover" && "outlineWidth" in i && i.outlineStyle === void 0 ? K({ ...i, outlineStyle: "solid" }) : K(i) : {};
274
+ return i ? t !== "hover" && "outlineWidth" in i && i.outlineStyle === void 0 ? Y({ ...i, outlineStyle: "solid" }) : Y(i) : {};
157
275
  }
158
- function Ct(o, t) {
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 e = o === "color" ? "color" : "bg";
163
- let s = `var(--button-${e},${i})`;
164
- for (let a = 0; a < t; a += 1)
165
- s = `var(--${x[a]}-button-${e},${s})`;
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 K(o) {
169
- const t = { ...ot(o) };
286
+ function Y(o) {
287
+ const t = { ...nt(o) };
170
288
  if (t.borderWidth !== void 0) {
171
- const i = String(t.borderWidth).split(/\s+(?![^()]*\))/), e = i[0], s = i[1] ?? e, a = i[2] ?? e, c = i[3] ?? 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: e,
291
+ borderTopWidth: n,
174
292
  borderRightWidth: s,
175
- borderBottomWidth: a,
176
- borderLeftWidth: c
293
+ borderBottomWidth: r,
294
+ borderLeftWidth: d
177
295
  }), delete t.borderWidth;
178
296
  }
179
297
  if (t.borderRadius !== void 0) {
180
- const [i, e = i] = String(t.borderRadius).split("/"), s = (d) => {
181
- const n = d.trim().split(/\s+(?![^()]*\))/);
298
+ const [i, n = i] = String(t.borderRadius).split("/"), s = (u) => {
299
+ const e = u.trim().split(/\s+(?![^()]*\))/);
182
300
  return [
183
- n[0],
184
- n[1] ?? n[0],
185
- n[2] ?? n[0],
186
- n[3] ?? n[1] ?? n[0]
301
+ e[0],
302
+ e[1] ?? e[0],
303
+ e[2] ?? e[0],
304
+ e[3] ?? e[1] ?? e[0]
187
305
  ];
188
- }, a = s(i), c = s(e);
189
- ["TopLeft", "TopRight", "BottomRight", "BottomLeft"].forEach((d, n) => {
190
- t[`border${d}Radius`] = `${a[n]} ${c[n]}`;
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 Q(o, t, i, {
196
- classPrefix: e = "",
313
+ function it(o, t, i, {
314
+ classPrefix: n = "",
197
315
  variablePrefix: s = "",
198
- isGroupParent: a = !1
316
+ isGroupParent: r = !1
199
317
  } = {}) {
200
- const c = ot(o);
201
- for (const [d, n] of Object.entries(c ?? {})) {
202
- if (n == null)
318
+ const d = nt(o);
319
+ for (const [u, e] of Object.entries(d ?? {})) {
320
+ if (e == null)
203
321
  continue;
204
- const l = String(n), b = Wt(d, l);
322
+ const c = String(e), b = Vt(u, c);
205
323
  if (b) {
206
- t.push(`${e}${b}`);
324
+ t.push(`${n}${b}`);
207
325
  continue;
208
326
  }
209
- const f = `${s}${X(d)}`, h = wt(d, f);
210
- h && (i[`--${f}`] = l, t.push(`${e}${h}`));
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 d = `${s}group-background`;
214
- i[`--${d}`] = D(o.bgGroup), t.push(`${e}group-hover:[background:var(--${d})]`), a && t.push(`${e}hover:[background:var(--${d})]`);
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 Wt(o, t) {
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 wt(o, t) {
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 X(o) {
431
+ function J(o) {
314
432
  return o.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
315
433
  }
316
- function zt(o, t) {
434
+ function Pt(o, t) {
317
435
  if (t !== void 0) {
318
436
  if (Array.isArray(t)) {
319
- o.padding = t.map(m).join(" ");
437
+ o.padding = t.map(v).join(" ");
320
438
  return;
321
439
  }
322
440
  if (typeof t != "object") {
323
- o.padding = m(t);
441
+ o.padding = v(t);
324
442
  return;
325
443
  }
326
- "px" in t && t.px !== void 0 && (o.paddingLeft = m(t.px), o.paddingRight = m(t.px)), "py" in t && t.py !== void 0 && (o.paddingTop = m(t.py), o.paddingBottom = m(t.py)), "pt" in t && t.pt !== void 0 && (o.paddingTop = m(t.pt)), "pb" in t && t.pb !== void 0 && (o.paddingBottom = m(t.pb)), "pl" in t && t.pl !== void 0 && (o.paddingLeft = m(t.pl)), "pr" in t && t.pr !== void 0 && (o.paddingRight = m(t.pr));
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 Lt(o, t) {
447
+ function jt(o, t) {
330
448
  if (t !== void 0) {
331
449
  if (Array.isArray(t)) {
332
- o.margin = t.map(m).join(" ");
450
+ o.margin = t.map(v).join(" ");
333
451
  return;
334
452
  }
335
453
  if (typeof t != "object") {
336
- o.margin = m(t);
454
+ o.margin = v(t);
337
455
  return;
338
456
  }
339
- "mx" in t && t.mx !== void 0 && (o.marginLeft = m(t.mx), o.marginRight = m(t.mx)), "my" in t && t.my !== void 0 && (o.marginTop = m(t.my), o.marginBottom = m(t.my)), "mt" in t && t.mt !== void 0 && (o.marginTop = m(t.mt)), "mb" in t && t.mb !== void 0 && (o.marginBottom = m(t.mb)), "ml" in t && t.ml !== void 0 && (o.marginLeft = m(t.ml)), "mr" in t && t.mr !== void 0 && (o.marginRight = m(t.mr));
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 Nt(o, t) {
343
- t && (t.radius !== void 0 && Tt(o, t.radius), t.color !== void 0 && (o.borderColor = B(t.color)), t.width !== void 0 && It(o, t.width), t.style !== void 0 && (o.borderStyle = t.style));
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 Tt(o, t) {
346
- if (Vt(t)) {
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 It(o, t) {
353
- if (Pt(t)) {
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 Vt(o) {
477
+ function Et(o) {
360
478
  return typeof o == "object";
361
479
  }
362
- function Pt(o) {
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 jt(o) {
489
+ function Dt(o) {
372
490
  return o === "hidden" ? "none" : o;
373
491
  }
374
- function F(o) {
492
+ function D(o) {
375
493
  return typeof o == "number" ? `${o}px` : o;
376
494
  }
377
- function m(o) {
495
+ function v(o) {
378
496
  return typeof o == "number" ? `${o}px` : o;
379
497
  }
380
- function z(o) {
498
+ function w(o) {
381
499
  return typeof o == "number" ? `${o}px` : o;
382
500
  }
383
- function Mt(o) {
501
+ function Ht(o) {
384
502
  return typeof o == "number" ? `${o}px` : o;
385
503
  }
386
- function Ot(o) {
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 At(o) {
514
+ function qt(o) {
397
515
  return o.replace("-", " ");
398
516
  }
399
- function D(o) {
517
+ function H(o) {
400
518
  return B(o);
401
519
  }
402
- function Et(o, t) {
403
- const i = D(t);
404
- if (Ft(t)) {
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 Ft(o) {
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 Dt(o) {
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: e,
538
+ children: n,
496
539
  className: s,
497
- background: a,
498
- backgroundColor: c,
499
- bg: d,
500
- bgSize: n,
501
- bgRepeat: l,
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: h,
505
- border: y,
506
- boxShadow: p,
507
- color: u,
508
- cursor: $,
547
+ bgPosition: l,
548
+ border: p,
549
+ boxShadow: h,
550
+ color: m,
551
+ cursor: y,
509
552
  opacity: g,
510
- overflow: C,
511
- overflowX: W,
512
- overflowY: S,
513
- pointerEvents: k,
514
- animation: R,
515
- aspectRatio: T,
516
- transform: w,
517
- transformOrigin: I,
518
- p: v,
519
- m: V,
520
- outlineColor: P,
521
- outlineWidth: j,
522
- outlineOffset: M,
523
- outlineStyle: O,
524
- listStyle: A,
525
- display: r,
526
- position: it,
527
- width: nt,
528
- maxWidth: et,
529
- minWidth: rt,
530
- height: at,
531
- hover: st,
532
- focusVisible: dt,
533
- active: ft,
534
- disabledStyle: ut,
535
- maxHeight: ct,
536
- minHeight: lt,
537
- md: Y,
538
- lg: J,
539
- xl: _,
540
- style: E,
541
- ...mt
542
- } = o, bt = i ?? "div", H = {
543
- hover: st,
544
- focusVisible: dt,
545
- active: ft,
546
- disabledStyle: ut,
547
- background: a,
548
- backgroundColor: c,
549
- bg: d,
550
- bgSize: n,
551
- bgRepeat: l,
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: h,
555
- border: y,
556
- boxShadow: p,
557
- color: u,
558
- cursor: $,
598
+ bgPosition: l,
599
+ border: p,
600
+ boxShadow: h,
601
+ color: m,
602
+ cursor: y,
559
603
  opacity: g,
560
- overflow: C,
561
- overflowX: W,
562
- overflowY: S,
563
- pointerEvents: k,
564
- animation: R,
565
- aspectRatio: T,
566
- transform: w,
567
- transformOrigin: I,
568
- p: v,
569
- m: V,
570
- outlineColor: P,
571
- outlineWidth: j,
572
- outlineOffset: M,
573
- outlineStyle: O,
574
- listStyle: A,
575
- display: r,
576
- position: it,
577
- width: nt,
578
- maxWidth: et,
579
- minWidth: rt,
580
- height: at,
581
- maxHeight: ct,
582
- minHeight: lt,
583
- md: Y,
584
- lg: J,
585
- xl: _
586
- }, pt = JSON.stringify([
587
- R,
588
- Y?.animation,
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
- E
592
- ]), gt = yt(
593
- () => Ht(t, H, E),
634
+ Z?.animation,
635
+ Q?.animation,
636
+ F
637
+ ]), $t = kt(
638
+ () => Wt(t, G, F),
594
639
  // Значения захваченных настроек представлены стабильным ключом.
595
- [t, pt]
596
- ), G = St(H), vt = G.style || E ? {
597
- ...G.style,
598
- ...E
640
+ [t, gt]
641
+ ), q = wt(G), yt = q.style || F ? {
642
+ ...q.style,
643
+ ...F
599
644
  } : void 0;
600
- return /* @__PURE__ */ ht(
601
- bt,
645
+ return /* @__PURE__ */ xt(
646
+ ht,
602
647
  {
603
- className: xt(G.className, f && "group", s),
604
- ref: Dt(H) ? gt : t,
605
- style: vt,
606
- ...mt,
607
- children: e
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 Yt = $t(Gt);
656
+ const Ut = Bt(Yt);
612
657
  export {
613
- Yt as Box
658
+ Ut as Box
614
659
  };