@shmidko61/lc-ui-kit 0.13.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.
Files changed (67) hide show
  1. package/README.md +61 -0
  2. package/dist/box/box.d.ts +2 -1
  3. package/dist/box/box.types.d.ts +2 -2
  4. package/dist/box/helpers/box-animation.helpers.d.ts +8 -0
  5. package/dist/box/helpers/box-scrollbar.helpers.d.ts +7 -0
  6. package/dist/box/helpers/index.d.ts +2 -0
  7. package/dist/box/types/box-animation.types.d.ts +3 -0
  8. package/dist/box/types/box-scrollbar.types.d.ts +7 -0
  9. package/dist/box/types/index.d.ts +2 -0
  10. package/dist/box.cjs +1 -1
  11. package/dist/box.js +476 -307
  12. package/dist/button.cjs +1 -1
  13. package/dist/button.js +163 -156
  14. package/dist/flex/flex.d.ts +1 -0
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +70 -62
  18. package/dist/loader/helpers/index.d.ts +1 -0
  19. package/dist/loader/helpers/loader.helpers.d.ts +2 -0
  20. package/dist/loader/index.d.ts +2 -0
  21. package/dist/loader/loader.d.ts +5 -0
  22. package/dist/loader/types/index.d.ts +1 -0
  23. package/dist/loader/types/loader.types.d.ts +28 -0
  24. package/dist/loader-Daam055i.js +104 -0
  25. package/dist/loader-ODTCTLKE.cjs +1 -0
  26. package/dist/loader.cjs +1 -0
  27. package/dist/loader.js +4 -0
  28. package/dist/media-gallery.cjs +1 -1
  29. package/dist/media-gallery.js +42 -30
  30. package/dist/progress-bar/helpers/index.d.ts +1 -0
  31. package/dist/progress-bar/helpers/progress-bar.helpers.d.ts +6 -0
  32. package/dist/progress-bar/index.d.ts +2 -0
  33. package/dist/progress-bar/progress-bar.d.ts +5 -0
  34. package/dist/progress-bar/types/index.d.ts +1 -0
  35. package/dist/progress-bar/types/progress-bar.types.d.ts +80 -0
  36. package/dist/progress-bar-D4CL9r42.js +236 -0
  37. package/dist/progress-bar-XIJDb_UM.cjs +1 -0
  38. package/dist/progress-bar.cjs +1 -0
  39. package/dist/progress-bar.js +4 -0
  40. package/dist/shared/responsive-style/index.d.ts +1 -0
  41. package/dist/styles.css +1 -1
  42. package/dist/tabs/helpers/index.d.ts +1 -0
  43. package/dist/tabs/helpers/tabs.helpers.d.ts +7 -0
  44. package/dist/tabs/hooks/index.d.ts +1 -0
  45. package/dist/tabs/hooks/tabs.hooks.d.ts +5 -0
  46. package/dist/tabs/index.d.ts +2 -0
  47. package/dist/tabs/tabs.d.ts +4 -0
  48. package/dist/tabs/types/index.d.ts +1 -0
  49. package/dist/tabs/types/tabs.types.d.ts +95 -0
  50. package/dist/tabs-BNZDJRz_.cjs +1 -0
  51. package/dist/tabs-DIPSJX1z.js +264 -0
  52. package/dist/tabs.cjs +1 -0
  53. package/dist/tabs.js +5 -0
  54. package/dist/tooltip/helpers/index.d.ts +1 -0
  55. package/dist/tooltip/helpers/tooltip.helpers.d.ts +7 -0
  56. package/dist/tooltip/index.d.ts +2 -0
  57. package/dist/tooltip/tooltip.d.ts +5 -0
  58. package/dist/tooltip/types/index.d.ts +1 -0
  59. package/dist/tooltip/types/tooltip.types.d.ts +51 -0
  60. package/dist/tooltip-0RbTCYn_.cjs +1 -0
  61. package/dist/tooltip-CWnHAfbI.js +166 -0
  62. package/dist/tooltip.cjs +1 -0
  63. package/dist/tooltip.js +4 -0
  64. package/dist/types/animation.types.d.ts +35 -0
  65. package/dist/types/index.d.ts +2 -0
  66. package/dist/types/scrollbar.types.d.ts +33 -0
  67. package/package.json +44 -4
package/dist/box.js CHANGED
@@ -1,60 +1,215 @@
1
- import { jsx as bo } from "react/jsx-runtime";
2
- import { forwardRef as mo } from "react";
3
- import { a as H, c as po } from "./responsive-style.config-DFuATrIM.js";
4
- function Z({
5
- background: t,
6
- backgroundColor: o,
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({
123
+ background: o,
124
+ backgroundColor: t,
7
125
  bg: i,
8
- bgSize: a,
9
- bgRepeat: n,
10
- bgPosition: s,
11
- border: p,
12
- boxShadow: c,
13
- color: r,
14
- cursor: u,
15
- opacity: l,
16
- overflow: d,
17
- overflowX: v,
18
- overflowY: y,
19
- pointerEvents: B,
20
- aspectRatio: h,
21
- transform: g,
22
- transformOrigin: b,
126
+ bgSize: n,
127
+ bgRepeat: s,
128
+ bgPosition: r,
129
+ border: d,
130
+ boxShadow: u,
131
+ color: e,
132
+ cursor: c,
133
+ opacity: b,
134
+ overflow: f,
135
+ overflowX: l,
136
+ overflowY: p,
137
+ pointerEvents: h,
138
+ aspectRatio: m,
139
+ transform: y,
140
+ transformOrigin: g,
23
141
  p: S,
24
- m: x,
142
+ m: C,
25
143
  outlineColor: k,
26
144
  outlineWidth: R,
27
145
  outlineOffset: W,
28
- outlineStyle: L,
29
- listStyle: C,
30
- display: w,
31
- position: m,
146
+ outlineStyle: T,
147
+ listStyle: z,
148
+ display: I,
149
+ position: $,
32
150
  width: P,
33
- maxWidth: N,
34
- minWidth: I,
35
- height: j,
36
- maxHeight: O,
151
+ maxWidth: j,
152
+ minWidth: O,
153
+ height: M,
154
+ maxHeight: A,
37
155
  minHeight: E
38
156
  }) {
39
- const e = {};
40
- return i !== void 0 ? wo(e, i) : t !== void 0 && (e.background = G(t)), o !== void 0 && (e.backgroundColor = G(o)), a !== void 0 && (e.backgroundSize = To(a)), n !== void 0 && (e.backgroundRepeat = Vo(n)), s !== void 0 && (e.backgroundPosition = Lo(s)), Ro(e, p), c !== void 0 && (e.boxShadow = $(c)), r !== void 0 && (e.color = $(r)), u !== void 0 && (e.cursor = u), l !== void 0 && (e.opacity = typeof l == "number" ? l : $(l)), d !== void 0 && (e.overflowX = d, e.overflowY = d), v !== void 0 && (e.overflowX = v), y !== void 0 && (e.overflowY = y), B !== void 0 && (e.pointerEvents = B), h !== void 0 && (e.aspectRatio = typeof h == "number" ? String(h) : $(h)), g !== void 0 && (e.transform = $(g)), b !== void 0 && (e.transformOrigin = $(b)), yo(e, S), ko(e, x), k !== void 0 && (e.outlineColor = $(k)), R !== void 0 && (e.outlineWidth = R), W !== void 0 && (e.outlineOffset = W), L !== void 0 && (e.outlineStyle = L), C?.position !== void 0 && (e.listStylePosition = C.position), C?.type !== void 0 && (e.listStyleType = C.type), w !== void 0 && (e.display = zo(w)), m?.type !== void 0 && (e.position = m.type), m?.top !== void 0 && (e.top = A(m.top)), m?.left !== void 0 && (e.left = A(m.left)), m?.right !== void 0 && (e.right = A(m.right)), m?.bottom !== void 0 && (e.bottom = A(m.bottom)), m?.zIndex !== void 0 && (e.zIndex = m.zIndex), P !== void 0 && (e.width = z(P)), N !== void 0 && (e.maxWidth = z(N)), I !== void 0 && (e.minWidth = z(I)), j !== void 0 && (e.height = z(j)), O !== void 0 && (e.maxHeight = z(O)), E !== void 0 && (e.minHeight = z(E)), Object.keys(e).length > 0 ? e : void 0;
41
- }
42
- function go(t) {
43
- const o = [], i = {}, a = t.groupParent === !0;
44
- K(t, o, i, { isGroupParent: a });
45
- for (const n of H) {
46
- const s = t[n];
47
- s && K(s, o, i, {
48
- classPrefix: `${n}:`,
49
- variablePrefix: `${n}-`,
50
- isGroupParent: a
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;
159
+ }
160
+ function wt(o) {
161
+ const t = [], i = {}, n = o.groupParent === !0;
162
+ it(o, t, i, { isGroupParent: n });
163
+ for (const s of x) {
164
+ const r = o[s];
165
+ r && it(r, t, i, {
166
+ classPrefix: `${s}:`,
167
+ variablePrefix: `${s}-`,
168
+ isGroupParent: n
51
169
  });
52
170
  }
53
- return ho(t, o, i), {
54
- className: o.join(" "),
171
+ return zt(o, t, i), Tt(o, t, i), Lt(o, t, i), {
172
+ className: t.join(" "),
55
173
  style: Object.keys(i).length > 0 ? i : void 0
56
174
  };
57
175
  }
176
+ function Tt(o, t, i) {
177
+ let n = {};
178
+ const s = [
179
+ { value: o.animation, prefix: "", variable: "" },
180
+ ...x.map((r) => ({
181
+ value: o[r]?.animation,
182
+ prefix: r + ":",
183
+ variable: r + "-"
184
+ }))
185
+ ];
186
+ for (const r of s)
187
+ if (r.value !== void 0) {
188
+ if (r.value === "none")
189
+ n = {}, i[`--${r.variable}animation`] = "none";
190
+ else {
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 } : {}
197
+ };
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"
208
+ ].join(" ");
209
+ }
210
+ t.push(`${r.prefix}[animation:var(--${r.variable}animation)]`);
211
+ }
212
+ }
58
213
  const X = [
59
214
  {
60
215
  prop: "hover",
@@ -77,114 +232,114 @@ const X = [
77
232
  variant: "[&:is(:disabled,[aria-disabled=true],[data-disabled=true]):is(:disabled,[aria-disabled=true],[data-disabled=true])]"
78
233
  }
79
234
  ];
80
- function ho(t, o, i) {
81
- const a = [t, ...H.map((r) => t[r] ?? {})], n = /* @__PURE__ */ new Set();
82
- for (const r of X)
83
- for (const u of a)
84
- Object.keys(F(u, r.prop)).forEach(
85
- (l) => n.add(l)
86
- ), r.prop === "hover" && u.hover === null && n.add("backgroundColor");
87
- if (n.size === 0) return;
88
- for (const r of n) {
89
- const u = D(r);
90
- for (const l of X)
91
- o.push(`[--ui-state-${l.name}-${u}:initial]`);
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(
240
+ (b) => s.add(b)
241
+ ), e.prop === "hover" && c.hover === null && s.add("backgroundColor");
242
+ if (s.size === 0) return;
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]`);
92
247
  }
93
- let s = {};
94
- const p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
95
- a.forEach((r, u) => {
96
- s = { ...s, ...Y(r) };
97
- const l = u === 0 ? "" : `${H[u - 1]}:`;
98
- for (const d of X) {
99
- const v = p.get(d.name) ?? {}, y = F(r, d.prop), B = r[d.prop] === null ? {} : { ...v, ...y }, h = c.get(d.name) ?? /* @__PURE__ */ new Set();
100
- Object.keys(y).forEach((g) => h.add(g)), d.prop === "hover" && r.hover === null && h.add("backgroundColor"), p.set(d.name, B), c.set(d.name, h);
101
- for (const g of h) {
102
- const b = D(g), S = s[g] ?? vo(g, u), x = `--ui-state-normal-${u}-${b}`;
103
- i[x] = String(S);
104
- const k = `--${d.name}-${u}-${b}`;
105
- i[k] = String(B[g] ?? S);
106
- const R = `--ui-state-value-${d.name}-${u}-${b}`;
107
- i[R] = B[g] === void 0 ? "initial" : `var(${k})`;
108
- const W = `var(--ui-state-disabled-${b},var(--ui-state-active-${b},var(--ui-state-focus-visible-${b},var(--ui-state-hover-${b},var(${x})))))`;
109
- o.push(
110
- `${l}${d.variant}:[--ui-state-${d.name}-${b}:var(${R})]`,
111
- `${l}${d.variant}:[${b}:${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})))))`;
264
+ t.push(
265
+ `${b}${f.variant}:[--ui-state-${f.name}-${g}:var(${R})]`,
266
+ `${b}${f.variant}:[${g}:${W}]`
112
267
  );
113
268
  }
114
269
  }
115
270
  });
116
271
  }
117
- function F(t, o) {
118
- const i = t[o];
119
- return i ? o !== "hover" && "outlineWidth" in i && i.outlineStyle === void 0 ? Y({ ...i, outlineStyle: "solid" }) : Y(i) : {};
272
+ function ot(o, t) {
273
+ const i = o[t];
274
+ return i ? t !== "hover" && "outlineWidth" in i && i.outlineStyle === void 0 ? Y({ ...i, outlineStyle: "solid" }) : Y(i) : {};
120
275
  }
121
- function vo(t, o) {
122
- const i = t === "color" ? "inherit" : "initial";
123
- if (t !== "background" && t !== "backgroundColor" && t !== "color")
276
+ function Nt(o, t) {
277
+ const i = o === "color" ? "inherit" : "initial";
278
+ if (o !== "background" && o !== "backgroundColor" && o !== "color")
124
279
  return i;
125
- const a = t === "color" ? "color" : "bg";
126
- let n = `var(--button-${a},${i})`;
127
- for (let s = 0; s < o; s += 1)
128
- n = `var(--${H[s]}-button-${a},${n})`;
129
- return n;
130
- }
131
- function Y(t) {
132
- const o = { ...Z(t) };
133
- if (o.borderWidth !== void 0) {
134
- const i = String(o.borderWidth).split(/\s+(?![^()]*\))/), a = i[0], n = i[1] ?? a, s = i[2] ?? a, p = i[3] ?? n;
135
- Object.assign(o, {
136
- borderTopWidth: a,
137
- borderRightWidth: n,
138
- borderBottomWidth: s,
139
- borderLeftWidth: p
140
- }), delete o.borderWidth;
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})`;
284
+ return s;
285
+ }
286
+ function Y(o) {
287
+ const t = { ...nt(o) };
288
+ if (t.borderWidth !== void 0) {
289
+ const i = String(t.borderWidth).split(/\s+(?![^()]*\))/), n = i[0], s = i[1] ?? n, r = i[2] ?? n, d = i[3] ?? s;
290
+ Object.assign(t, {
291
+ borderTopWidth: n,
292
+ borderRightWidth: s,
293
+ borderBottomWidth: r,
294
+ borderLeftWidth: d
295
+ }), delete t.borderWidth;
141
296
  }
142
- if (o.borderRadius !== void 0) {
143
- const [i, a = i] = String(o.borderRadius).split("/"), n = (c) => {
144
- const r = c.trim().split(/\s+(?![^()]*\))/);
297
+ if (t.borderRadius !== void 0) {
298
+ const [i, n = i] = String(t.borderRadius).split("/"), s = (u) => {
299
+ const e = u.trim().split(/\s+(?![^()]*\))/);
145
300
  return [
146
- r[0],
147
- r[1] ?? r[0],
148
- r[2] ?? r[0],
149
- r[3] ?? r[1] ?? r[0]
301
+ e[0],
302
+ e[1] ?? e[0],
303
+ e[2] ?? e[0],
304
+ e[3] ?? e[1] ?? e[0]
150
305
  ];
151
- }, s = n(i), p = n(a);
152
- ["TopLeft", "TopRight", "BottomRight", "BottomLeft"].forEach((c, r) => {
153
- o[`border${c}Radius`] = `${s[r]} ${p[r]}`;
154
- }), delete o.borderRadius;
306
+ }, r = s(i), d = s(n);
307
+ ["TopLeft", "TopRight", "BottomRight", "BottomLeft"].forEach((u, e) => {
308
+ t[`border${u}Radius`] = `${r[e]} ${d[e]}`;
309
+ }), delete t.borderRadius;
155
310
  }
156
- return o;
311
+ return t;
157
312
  }
158
- function K(t, o, i, {
159
- classPrefix: a = "",
160
- variablePrefix: n = "",
161
- isGroupParent: s = !1
313
+ function it(o, t, i, {
314
+ classPrefix: n = "",
315
+ variablePrefix: s = "",
316
+ isGroupParent: r = !1
162
317
  } = {}) {
163
- const p = Z(t);
164
- for (const [c, r] of Object.entries(p ?? {})) {
165
- if (r == null)
318
+ const d = nt(o);
319
+ for (const [u, e] of Object.entries(d ?? {})) {
320
+ if (e == null)
166
321
  continue;
167
- const u = String(r), l = $o(c, u);
168
- if (l) {
169
- o.push(`${a}${l}`);
322
+ const c = String(e), b = Vt(u, c);
323
+ if (b) {
324
+ t.push(`${n}${b}`);
170
325
  continue;
171
326
  }
172
- const d = `${n}${D(c)}`, v = Bo(c, d);
173
- v && (i[`--${d}`] = u, o.push(`${a}${v}`));
327
+ const f = `${s}${J(u)}`, l = It(u, f);
328
+ l && (i[`--${f}`] = c, t.push(`${n}${l}`));
174
329
  }
175
- if (t.bgGroup !== void 0) {
176
- const c = `${n}group-background`;
177
- i[`--${c}`] = G(t.bgGroup), o.push(`${a}group-hover:[background:var(--${c})]`), s && o.push(`${a}hover:[background:var(--${c})]`);
330
+ if (o.bgGroup !== void 0) {
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})]`);
178
333
  }
179
334
  }
180
- function $o(t, o) {
181
- if (t === "display")
182
- return o === "none" ? "hidden" : o;
183
- if (t === "position")
184
- return o === "inherit" ? "[position:inherit]" : o;
185
- if (t === "cursor")
186
- return `cursor-${o}`;
187
- if (t === "backgroundRepeat")
335
+ function Vt(o, t) {
336
+ if (o === "display")
337
+ return t === "none" ? "hidden" : t;
338
+ if (o === "position")
339
+ return t === "inherit" ? "[position:inherit]" : t;
340
+ if (o === "cursor")
341
+ return `cursor-${t}`;
342
+ if (o === "backgroundRepeat")
188
343
  return {
189
344
  "no-repeat": "bg-no-repeat",
190
345
  repeat: "bg-repeat",
@@ -192,14 +347,14 @@ function $o(t, o) {
192
347
  space: "bg-repeat-space",
193
348
  "repeat-x": "bg-repeat-x",
194
349
  "repeat-y": "bg-repeat-y"
195
- }[o];
196
- if (t === "backgroundSize")
350
+ }[t];
351
+ if (o === "backgroundSize")
197
352
  return {
198
353
  auto: "bg-auto",
199
354
  contain: "bg-contain",
200
355
  cover: "bg-cover"
201
- }[o];
202
- if (t === "backgroundPosition")
356
+ }[t];
357
+ if (o === "backgroundPosition")
203
358
  return {
204
359
  bottom: "bg-bottom",
205
360
  center: "bg-center",
@@ -210,18 +365,18 @@ function $o(t, o) {
210
365
  "right bottom": "bg-right-bottom",
211
366
  "right top": "bg-right-top",
212
367
  top: "bg-top"
213
- }[o];
214
- if (t === "borderStyle")
215
- return o === "none" ? "border-none" : `border-${o}`;
216
- if (t === "outlineStyle")
217
- return o === "none" ? "outline-none" : `outline-${o}`;
218
- if (t === "listStylePosition")
219
- return `list-${o}`;
220
- if (t === "listStyleType")
221
- return `list-${o}`;
222
- }
223
- function Bo(t, o) {
224
- const i = `var(--${o})`;
368
+ }[t];
369
+ if (o === "borderStyle")
370
+ return t === "none" ? "border-none" : `border-${t}`;
371
+ if (o === "outlineStyle")
372
+ return t === "none" ? "outline-none" : `outline-${t}`;
373
+ if (o === "listStylePosition")
374
+ return `list-${t}`;
375
+ if (o === "listStyleType")
376
+ return `list-${t}`;
377
+ }
378
+ function It(o, t) {
379
+ const i = `var(--${t})`;
225
380
  return {
226
381
  background: `[background:${i}]`,
227
382
  backgroundColor: `bg-[${i}]`,
@@ -271,82 +426,82 @@ function Bo(t, o) {
271
426
  transformOrigin: `[transform-origin:${i}]`,
272
427
  width: `w-[${i}]`,
273
428
  zIndex: `z-[${i}]`
274
- }[t];
429
+ }[o];
275
430
  }
276
- function D(t) {
277
- return t.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`);
431
+ function J(o) {
432
+ return o.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
278
433
  }
279
- function yo(t, o) {
280
- if (o !== void 0) {
281
- if (Array.isArray(o)) {
282
- t.padding = o.map(f).join(" ");
434
+ function Pt(o, t) {
435
+ if (t !== void 0) {
436
+ if (Array.isArray(t)) {
437
+ o.padding = t.map(v).join(" ");
283
438
  return;
284
439
  }
285
- if (typeof o != "object") {
286
- t.padding = f(o);
440
+ if (typeof t != "object") {
441
+ o.padding = v(t);
287
442
  return;
288
443
  }
289
- "px" in o && o.px !== void 0 && (t.paddingLeft = f(o.px), t.paddingRight = f(o.px)), "py" in o && o.py !== void 0 && (t.paddingTop = f(o.py), t.paddingBottom = f(o.py)), "pt" in o && o.pt !== void 0 && (t.paddingTop = f(o.pt)), "pb" in o && o.pb !== void 0 && (t.paddingBottom = f(o.pb)), "pl" in o && o.pl !== void 0 && (t.paddingLeft = f(o.pl)), "pr" in o && o.pr !== void 0 && (t.paddingRight = f(o.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));
290
445
  }
291
446
  }
292
- function ko(t, o) {
293
- if (o !== void 0) {
294
- if (Array.isArray(o)) {
295
- t.margin = o.map(f).join(" ");
447
+ function jt(o, t) {
448
+ if (t !== void 0) {
449
+ if (Array.isArray(t)) {
450
+ o.margin = t.map(v).join(" ");
296
451
  return;
297
452
  }
298
- if (typeof o != "object") {
299
- t.margin = f(o);
453
+ if (typeof t != "object") {
454
+ o.margin = v(t);
300
455
  return;
301
456
  }
302
- "mx" in o && o.mx !== void 0 && (t.marginLeft = f(o.mx), t.marginRight = f(o.mx)), "my" in o && o.my !== void 0 && (t.marginTop = f(o.my), t.marginBottom = f(o.my)), "mt" in o && o.mt !== void 0 && (t.marginTop = f(o.mt)), "mb" in o && o.mb !== void 0 && (t.marginBottom = f(o.mb)), "ml" in o && o.ml !== void 0 && (t.marginLeft = f(o.ml)), "mr" in o && o.mr !== void 0 && (t.marginRight = f(o.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));
303
458
  }
304
459
  }
305
- function Ro(t, o) {
306
- o && (o.radius !== void 0 && So(t, o.radius), o.color !== void 0 && (t.borderColor = $(o.color)), o.width !== void 0 && xo(t, o.width), o.style !== void 0 && (t.borderStyle = o.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));
307
462
  }
308
- function So(t, o) {
309
- if (Wo(o)) {
310
- o.topLeft !== void 0 && (t.borderTopLeftRadius = T(o.topLeft)), o.topRight !== void 0 && (t.borderTopRightRadius = T(o.topRight)), o.bottomLeft !== void 0 && (t.borderBottomLeftRadius = T(o.bottomLeft)), o.bottomRight !== void 0 && (t.borderBottomRightRadius = T(o.bottomRight));
463
+ function Mt(o, t) {
464
+ if (Et(t)) {
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));
311
466
  return;
312
467
  }
313
- t.borderRadius = T(o);
468
+ o.borderRadius = L(t);
314
469
  }
315
- function xo(t, o) {
316
- if (Co(o)) {
317
- o.top !== void 0 && (t.borderTopWidth = V(o.top)), o.bottom !== void 0 && (t.borderBottomWidth = V(o.bottom)), o.left !== void 0 && (t.borderLeftWidth = V(o.left)), o.right !== void 0 && (t.borderRightWidth = V(o.right));
470
+ function At(o, t) {
471
+ if (Ft(t)) {
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));
318
473
  return;
319
474
  }
320
- t.borderWidth = V(o);
475
+ o.borderWidth = N(t);
321
476
  }
322
- function Wo(t) {
323
- return typeof t == "object";
477
+ function Et(o) {
478
+ return typeof o == "object";
324
479
  }
325
- function Co(t) {
326
- return typeof t == "object";
480
+ function Ft(o) {
481
+ return typeof o == "object";
327
482
  }
328
- function T(t) {
329
- return t.startsWith("--") ? `var(${t})` : t;
483
+ function L(o) {
484
+ return o.startsWith("--") ? `var(${o})` : o;
330
485
  }
331
- function V(t) {
332
- return t.startsWith("--") ? `var(${t})` : t;
486
+ function N(o) {
487
+ return o.startsWith("--") ? `var(${o})` : o;
333
488
  }
334
- function zo(t) {
335
- return t === "hidden" ? "none" : t;
489
+ function Dt(o) {
490
+ return o === "hidden" ? "none" : o;
336
491
  }
337
- function A(t) {
338
- return typeof t == "number" ? `${t}px` : t;
492
+ function D(o) {
493
+ return typeof o == "number" ? `${o}px` : o;
339
494
  }
340
- function f(t) {
341
- return typeof t == "number" ? `${t}px` : t;
495
+ function v(o) {
496
+ return typeof o == "number" ? `${o}px` : o;
342
497
  }
343
- function z(t) {
344
- return typeof t == "number" ? `${t}px` : t;
498
+ function w(o) {
499
+ return typeof o == "number" ? `${o}px` : o;
345
500
  }
346
- function To(t) {
347
- return typeof t == "number" ? `${t}px` : t;
501
+ function Ht(o) {
502
+ return typeof o == "number" ? `${o}px` : o;
348
503
  }
349
- function Vo(t) {
504
+ function Gt(o) {
350
505
  return {
351
506
  "no-repeat": "no-repeat",
352
507
  repeat: "repeat",
@@ -354,137 +509,151 @@ function Vo(t) {
354
509
  "repeat-space": "space",
355
510
  "repeat-x": "repeat-x",
356
511
  "repeat-y": "repeat-y"
357
- }[t];
512
+ }[o];
358
513
  }
359
- function Lo(t) {
360
- return t.replace("-", " ");
514
+ function qt(o) {
515
+ return o.replace("-", " ");
361
516
  }
362
- function G(t) {
363
- return $(t);
517
+ function H(o) {
518
+ return B(o);
364
519
  }
365
- function wo(t, o) {
366
- const i = G(o);
367
- if (Po(o)) {
368
- t.background = i;
520
+ function Kt(o, t) {
521
+ const i = H(t);
522
+ if (Xt(t)) {
523
+ o.background = i;
369
524
  return;
370
525
  }
371
- t.backgroundColor = i;
526
+ o.backgroundColor = i;
372
527
  }
373
- function Po(t) {
374
- const o = t.trim().toLowerCase();
375
- return o.includes("url(") || o.includes("gradient(") || o.includes("image-set(") || o.includes("cross-fade(") || o.includes("element(") || o.includes("paint(");
528
+ function Xt(o) {
529
+ const t = o.trim().toLowerCase();
530
+ return t.includes("url(") || t.includes("gradient(") || t.includes("image-set(") || t.includes("cross-fade(") || t.includes("element(") || t.includes("paint(");
376
531
  }
377
- function $(t) {
378
- return t.startsWith("--") ? `var(${t})` : t;
532
+ function B(o) {
533
+ return o.startsWith("--") ? `var(${o})` : o;
379
534
  }
380
- function No(t, o) {
535
+ function Yt(o, t) {
381
536
  const {
382
537
  as: i,
383
- children: a,
384
- className: n,
385
- background: s,
386
- backgroundColor: p,
387
- bg: c,
388
- bgSize: r,
389
- bgRepeat: u,
390
- bgGroup: l,
391
- groupParent: d,
392
- bgPosition: v,
393
- border: y,
394
- boxShadow: B,
395
- color: h,
396
- cursor: g,
397
- opacity: b,
538
+ children: n,
539
+ className: s,
540
+ background: r,
541
+ backgroundColor: d,
542
+ bg: u,
543
+ bgSize: e,
544
+ bgRepeat: c,
545
+ bgGroup: b,
546
+ groupParent: f,
547
+ bgPosition: l,
548
+ border: p,
549
+ boxShadow: h,
550
+ color: m,
551
+ cursor: y,
552
+ opacity: g,
398
553
  overflow: S,
399
- overflowX: x,
554
+ overflowX: C,
400
555
  overflowY: k,
401
- pointerEvents: R,
402
- aspectRatio: W,
403
- transform: L,
404
- transformOrigin: C,
405
- p: w,
406
- m,
407
- outlineColor: P,
408
- outlineWidth: N,
409
- outlineOffset: I,
410
- outlineStyle: j,
411
- listStyle: O,
412
- display: E,
413
- position: e,
414
- width: q,
415
- maxWidth: J,
416
- minWidth: Q,
417
- height: U,
418
- hover: oo,
419
- focusVisible: to,
420
- active: io,
421
- disabledStyle: eo,
422
- maxHeight: ro,
423
- minHeight: no,
424
- md: ao,
425
- lg: so,
426
- xl: fo,
427
- style: _,
428
- ...co
429
- } = t, uo = i ?? "div", M = go({
430
- hover: oo,
431
- focusVisible: to,
432
- active: io,
433
- disabledStyle: eo,
434
- background: s,
435
- backgroundColor: p,
436
- bg: c,
437
- bgSize: r,
438
- bgRepeat: u,
439
- bgGroup: l,
440
- groupParent: d,
441
- bgPosition: v,
442
- border: y,
443
- boxShadow: B,
444
- color: h,
445
- cursor: g,
446
- opacity: b,
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,
596
+ bgGroup: b,
597
+ groupParent: f,
598
+ bgPosition: l,
599
+ border: p,
600
+ boxShadow: h,
601
+ color: m,
602
+ cursor: y,
603
+ opacity: g,
447
604
  overflow: S,
448
- overflowX: x,
605
+ overflowX: C,
449
606
  overflowY: k,
450
- pointerEvents: R,
451
- aspectRatio: W,
452
- transform: L,
453
- transformOrigin: C,
454
- p: w,
455
- m,
456
- outlineColor: P,
457
- outlineWidth: N,
458
- outlineOffset: I,
459
- outlineStyle: j,
460
- listStyle: O,
461
- display: E,
462
- position: e,
463
- width: q,
464
- maxWidth: J,
465
- minWidth: Q,
466
- height: U,
467
- maxHeight: ro,
468
- minHeight: no,
469
- md: ao,
470
- lg: so,
471
- xl: fo
472
- }), lo = M.style || _ ? {
473
- ...M.style,
474
- ..._
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,
633
+ _?.animation,
634
+ Z?.animation,
635
+ Q?.animation,
636
+ F
637
+ ]), $t = kt(
638
+ () => Wt(t, G, F),
639
+ // Значения захваченных настроек представлены стабильным ключом.
640
+ [t, gt]
641
+ ), q = wt(G), yt = q.style || F ? {
642
+ ...q.style,
643
+ ...F
475
644
  } : void 0;
476
- return /* @__PURE__ */ bo(
477
- uo,
645
+ return /* @__PURE__ */ xt(
646
+ ht,
478
647
  {
479
- className: po(M.className, d && "group", n),
480
- ref: o,
481
- style: lo,
482
- ...co,
483
- children: a
648
+ className: St(q.className, f && "group", s),
649
+ ref: Ct(G) ? $t : t,
650
+ style: yt,
651
+ ...vt,
652
+ children: n
484
653
  }
485
654
  );
486
655
  }
487
- const Ao = mo(No);
656
+ const Ut = Bt(Yt);
488
657
  export {
489
- Ao as Box
658
+ Ut as Box
490
659
  };