@spear-ai/spectral 1.6.8 → 1.6.10
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/DateTimePicker/DateTimeDisplayInput.js +138 -151
- package/dist/Tabs/TabsBase.js +12 -8
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { getResolvedLocale as
|
|
5
|
-
import { Label as
|
|
6
|
-
import { useControllableState as
|
|
7
|
-
import { getInputClasses as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { forwardRef as
|
|
3
|
+
import { jsxs as K, jsx as x } from "react/jsx-runtime";
|
|
4
|
+
import { getResolvedLocale as ee, getLocalizedPeriodLabels as te, formatSelectPeriodLabel as re } from "./DateTimeUtils.js";
|
|
5
|
+
import { Label as ne } from "../Label.js";
|
|
6
|
+
import { useControllableState as ae } from "../hooks/useControllableState.js";
|
|
7
|
+
import { getInputClasses as ie } from "../utils/formFieldUtils.js";
|
|
8
|
+
import { cn as O } from "../utils/twUtils.js";
|
|
9
|
+
import { forwardRef as se, useRef as B, useMemo as g, useCallback as L, useEffect as oe } from "react";
|
|
10
10
|
const h = {
|
|
11
11
|
month: { type: "month", min: 1, max: 12, length: 2 },
|
|
12
12
|
day: { type: "day", min: 1, max: 31, length: 2 },
|
|
@@ -16,11 +16,11 @@ const h = {
|
|
|
16
16
|
minute: { type: "minute", min: 0, max: 59, length: 2 },
|
|
17
17
|
period: { type: "period", min: 0, max: 1, length: 2 }
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function ue(v, e) {
|
|
20
20
|
return v === 2 ? e % 4 === 0 && e % 100 !== 0 || e % 400 === 0 ? 29 : 28 : [4, 6, 9, 11].includes(v) ? 30 : 31;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
22
|
+
function ce({ ariaLabel: v, config: e, disabled: f, onLeftFocus: I, onRightFocus: w, onValueChange: c, periodLabels: D, value: s }) {
|
|
23
|
+
const o = B(null), a = B(""), u = B(!1), b = g(() => {
|
|
24
24
|
switch (e.type) {
|
|
25
25
|
case "month":
|
|
26
26
|
return "MM";
|
|
@@ -33,102 +33,102 @@ function ue({ ariaLabel: v, config: e, disabled: d, onLeftFocus: I, onRightFocus
|
|
|
33
33
|
case "minute":
|
|
34
34
|
return "mm";
|
|
35
35
|
case "period":
|
|
36
|
-
return (
|
|
36
|
+
return (D?.am ?? "am").toLowerCase();
|
|
37
37
|
default:
|
|
38
38
|
return "––";
|
|
39
39
|
}
|
|
40
|
-
}, [e.type, e.max,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
const
|
|
45
|
-
const t =
|
|
40
|
+
}, [e.type, e.max, D]), m = g(() => s === void 0 ? b : e.type === "period" ? (s === 0 ? D?.am ?? "am" : D?.pm ?? "pm").toLowerCase() : s.toString().padStart(e.length, "0"), [s, e, D, b]);
|
|
41
|
+
oe(() => {
|
|
42
|
+
o.current && !u.current && (o.current.value = m);
|
|
43
|
+
}, [m]);
|
|
44
|
+
const d = L(() => {
|
|
45
|
+
const t = a.current;
|
|
46
46
|
if (t) {
|
|
47
47
|
let r = parseInt(t, 10);
|
|
48
48
|
isNaN(r) || (r = Math.max(e.min, Math.min(e.max, r)), c(r));
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
}, [e.min, e.max,
|
|
50
|
+
a.current = "", u.current = !1, o.current && (o.current.value = m);
|
|
51
|
+
}, [e.min, e.max, m, c]), E = L(
|
|
52
52
|
(t) => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!f) {
|
|
54
54
|
if (t.key === "Tab") {
|
|
55
|
-
|
|
55
|
+
d();
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
if (t.key === "ArrowRight") {
|
|
59
|
-
t.preventDefault(),
|
|
59
|
+
t.preventDefault(), d(), w?.();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
if (t.key === "ArrowLeft") {
|
|
63
|
-
t.preventDefault(),
|
|
63
|
+
t.preventDefault(), d(), I?.();
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
if (e.type === "period") {
|
|
67
|
-
t.preventDefault(), t.key === "ArrowUp" || t.key === "ArrowDown" ? c(
|
|
67
|
+
t.preventDefault(), t.key === "ArrowUp" || t.key === "ArrowDown" ? c(s === 0 ? 1 : 0) : t.key.toLowerCase() === "a" ? c(0) : t.key.toLowerCase() === "p" && c(1);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
if (t.key === "ArrowUp") {
|
|
71
|
-
t.preventDefault(),
|
|
72
|
-
const r =
|
|
71
|
+
t.preventDefault(), a.current = "", u.current = !1;
|
|
72
|
+
const r = s === void 0 || s >= e.max ? e.min : s + 1;
|
|
73
73
|
c(r);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
if (t.key === "ArrowDown") {
|
|
77
|
-
t.preventDefault(),
|
|
78
|
-
const r =
|
|
77
|
+
t.preventDefault(), a.current = "", u.current = !1;
|
|
78
|
+
const r = s === void 0 || s <= e.min ? e.max : s - 1;
|
|
79
79
|
c(r);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
if (t.key === "Home") {
|
|
83
|
-
t.preventDefault(),
|
|
83
|
+
t.preventDefault(), a.current = "", u.current = !1, c(e.min);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
if (t.key === "End") {
|
|
87
|
-
t.preventDefault(),
|
|
87
|
+
t.preventDefault(), a.current = "", u.current = !1, c(e.max);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
if (t.key >= "0" && t.key <= "9") {
|
|
91
91
|
t.preventDefault();
|
|
92
|
-
const r =
|
|
92
|
+
const r = a.current + t.key, l = parseInt(r, 10);
|
|
93
93
|
if (e.length === 2)
|
|
94
94
|
if (r.length >= 2) {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
} else if (
|
|
98
|
-
const
|
|
99
|
-
|
|
95
|
+
const k = Math.max(e.min, Math.min(e.max, l));
|
|
96
|
+
a.current = "", u.current = !1, c(k), w?.();
|
|
97
|
+
} else if (l * 10 > e.max) {
|
|
98
|
+
const k = Math.max(e.min, Math.min(e.max, l));
|
|
99
|
+
a.current = "", u.current = !1, c(k), w?.();
|
|
100
100
|
} else
|
|
101
|
-
|
|
101
|
+
a.current = r, u.current = !0, o.current && (o.current.value = r);
|
|
102
102
|
else if (e.length === 4)
|
|
103
103
|
if (r.length >= 4) {
|
|
104
|
-
const
|
|
105
|
-
|
|
104
|
+
const k = Math.max(e.min, Math.min(e.max, l));
|
|
105
|
+
a.current = "", u.current = !1, c(k), w?.();
|
|
106
106
|
} else
|
|
107
|
-
|
|
107
|
+
a.current = r, u.current = !0, o.current && (o.current.value = r);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
if (t.key === "Backspace") {
|
|
111
|
-
if (t.preventDefault(),
|
|
112
|
-
const r =
|
|
113
|
-
|
|
111
|
+
if (t.preventDefault(), a.current) {
|
|
112
|
+
const r = a.current.slice(0, -1);
|
|
113
|
+
a.current = r, u.current = r.length > 0, o.current && (o.current.value = r || m);
|
|
114
114
|
}
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
[
|
|
120
|
-
),
|
|
121
|
-
|
|
122
|
-
}, [
|
|
123
|
-
u.current || (
|
|
124
|
-
const t =
|
|
119
|
+
[f, e, s, m, c, I, w, d]
|
|
120
|
+
), R = L(() => {
|
|
121
|
+
a.current && d();
|
|
122
|
+
}, [d]), S = L(() => {
|
|
123
|
+
u.current || (a.current = "");
|
|
124
|
+
const t = o.current;
|
|
125
125
|
if (t) {
|
|
126
126
|
const r = t.value.length;
|
|
127
127
|
t.setSelectionRange(r, r);
|
|
128
128
|
}
|
|
129
|
-
}, []),
|
|
130
|
-
|
|
131
|
-
}, [
|
|
129
|
+
}, []), T = L(() => {
|
|
130
|
+
o.current && (o.current.value = a.current || m);
|
|
131
|
+
}, [m]), y = (() => {
|
|
132
132
|
switch (e.type) {
|
|
133
133
|
case "year":
|
|
134
134
|
return { width: 46, paddingLeft: 0 };
|
|
@@ -145,155 +145,142 @@ function ue({ ariaLabel: v, config: e, disabled: d, onLeftFocus: I, onRightFocus
|
|
|
145
145
|
default:
|
|
146
146
|
return { width: 24, paddingLeft: 0 };
|
|
147
147
|
}
|
|
148
|
-
})(),
|
|
148
|
+
})(), M = s === void 0;
|
|
149
149
|
return /* @__PURE__ */ x(
|
|
150
150
|
"input",
|
|
151
151
|
{
|
|
152
152
|
"aria-label": v,
|
|
153
153
|
"aria-valuemax": e.max,
|
|
154
154
|
"aria-valuemin": e.min,
|
|
155
|
-
"aria-valuenow":
|
|
156
|
-
className:
|
|
155
|
+
"aria-valuenow": s,
|
|
156
|
+
className: O(
|
|
157
157
|
"inline-flex items-center justify-center rounded text-center tabular-nums",
|
|
158
158
|
"border-none bg-transparent outline-none",
|
|
159
159
|
"focus:bg-bg-tertiary focus:text-text-primary focus:ring-accent focus:ring-1",
|
|
160
160
|
"hover:bg-bg-secondary",
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
f && "cursor-not-allowed opacity-50",
|
|
162
|
+
M && "text-text-placeholder text-sm"
|
|
163
163
|
),
|
|
164
164
|
"data-segment": e.type,
|
|
165
|
-
defaultValue:
|
|
166
|
-
disabled:
|
|
165
|
+
defaultValue: m,
|
|
166
|
+
disabled: f,
|
|
167
167
|
inputMode: "numeric",
|
|
168
|
-
onBlur:
|
|
169
|
-
onChange:
|
|
170
|
-
onFocus:
|
|
171
|
-
onKeyDown:
|
|
172
|
-
ref:
|
|
168
|
+
onBlur: R,
|
|
169
|
+
onChange: T,
|
|
170
|
+
onFocus: S,
|
|
171
|
+
onKeyDown: E,
|
|
172
|
+
ref: o,
|
|
173
173
|
role: "spinbutton",
|
|
174
|
-
style:
|
|
175
|
-
tabIndex:
|
|
174
|
+
style: y,
|
|
175
|
+
tabIndex: f ? -1 : 0
|
|
176
176
|
}
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const le = se(
|
|
180
180
|
({
|
|
181
181
|
className: v,
|
|
182
|
+
id: e,
|
|
182
183
|
// New props
|
|
183
|
-
defaultValue:
|
|
184
|
-
onChange:
|
|
185
|
-
value:
|
|
184
|
+
defaultValue: f,
|
|
185
|
+
onChange: I,
|
|
186
|
+
value: w,
|
|
186
187
|
// Legacy props (deprecated)
|
|
187
|
-
date:
|
|
188
|
-
onDateChange:
|
|
188
|
+
date: c,
|
|
189
|
+
onDateChange: D,
|
|
189
190
|
// Other props
|
|
190
|
-
disabled:
|
|
191
|
+
disabled: s,
|
|
191
192
|
endIcon: o,
|
|
192
193
|
hourFormat: a = "12",
|
|
193
|
-
label:
|
|
194
|
-
locale:
|
|
195
|
-
showTime:
|
|
196
|
-
state:
|
|
197
|
-
...
|
|
194
|
+
label: u,
|
|
195
|
+
locale: b,
|
|
196
|
+
showTime: m = !0,
|
|
197
|
+
state: d = "default",
|
|
198
|
+
...E
|
|
198
199
|
}, R) => {
|
|
199
|
-
const S =
|
|
200
|
+
const S = B(null), T = w ?? c, U = I ?? D, [y, M] = ae({
|
|
200
201
|
value: T,
|
|
201
|
-
defaultValue:
|
|
202
|
-
onChange:
|
|
203
|
-
}),
|
|
204
|
-
if (!
|
|
205
|
-
const
|
|
206
|
-
let n,
|
|
207
|
-
return a === "24" ? (n =
|
|
208
|
-
month:
|
|
209
|
-
day:
|
|
210
|
-
year:
|
|
202
|
+
defaultValue: f,
|
|
203
|
+
onChange: U
|
|
204
|
+
}), t = g(() => ee(b), [b]), r = g(() => te(t), [t]), l = g(() => {
|
|
205
|
+
if (!y) return { month: void 0, day: void 0, year: void 0, hour: void 0, minute: void 0, period: void 0 };
|
|
206
|
+
const i = y.getHours();
|
|
207
|
+
let n, p;
|
|
208
|
+
return a === "24" ? (n = i, p = 0) : (p = i >= 12 ? 1 : 0, n = i % 12, n === 0 && (n = 12)), {
|
|
209
|
+
month: y.getMonth() + 1,
|
|
210
|
+
day: y.getDate(),
|
|
211
|
+
year: y.getFullYear(),
|
|
211
212
|
hour: n,
|
|
212
|
-
minute:
|
|
213
|
-
period:
|
|
213
|
+
minute: y.getMinutes(),
|
|
214
|
+
period: p
|
|
214
215
|
};
|
|
215
|
-
}, [
|
|
216
|
-
(
|
|
217
|
-
const n = { ...
|
|
216
|
+
}, [y, a]), k = l.month !== void 0 && l.day !== void 0 && l.year !== void 0, _ = L(
|
|
217
|
+
(i) => {
|
|
218
|
+
const n = { ...l, ...i };
|
|
218
219
|
if (n.month === void 0 && n.day === void 0 && n.year === void 0) {
|
|
219
220
|
M(void 0);
|
|
220
221
|
return;
|
|
221
222
|
}
|
|
222
|
-
const
|
|
223
|
-
let
|
|
223
|
+
const p = /* @__PURE__ */ new Date(), H = (n.month ?? p.getMonth() + 1) - 1, Y = n.day ?? p.getDate(), N = n.year ?? p.getFullYear(), P = ue(H + 1, N), j = Math.min(Y, P), W = l.month !== void 0 && l.day !== void 0 && l.year !== void 0, X = n.month !== void 0 && n.day !== void 0 && n.year !== void 0, A = !W && X;
|
|
224
|
+
let C;
|
|
224
225
|
if (a === "24")
|
|
225
|
-
|
|
226
|
+
C = A ? 0 : n.hour ?? 0;
|
|
226
227
|
else {
|
|
227
|
-
const
|
|
228
|
-
|
|
228
|
+
const F = A ? 12 : n.hour ?? 12, V = A ? 1 : n.period ?? 0, G = F, J = V;
|
|
229
|
+
G === 12 ? C = J === 0 ? 0 : 12 : C = J === 0 ? G : G + 12;
|
|
229
230
|
}
|
|
230
|
-
const
|
|
231
|
-
M(
|
|
231
|
+
const Z = A ? 0 : n.minute ?? 0, $ = new Date(N, H, j, C, Z, 0, 0);
|
|
232
|
+
M($);
|
|
232
233
|
},
|
|
233
|
-
[
|
|
234
|
+
[l, a, M]
|
|
234
235
|
), q = g(() => {
|
|
235
|
-
const
|
|
236
|
+
const i = [
|
|
236
237
|
{ key: "month", config: h.month, ariaLabel: "Month" },
|
|
237
238
|
{ key: "day", config: h.day, ariaLabel: "Day" },
|
|
238
239
|
{ key: "year", config: h.year, ariaLabel: "Year" }
|
|
239
240
|
];
|
|
240
|
-
if (!
|
|
241
|
+
if (!m) return i;
|
|
241
242
|
const n = a === "24" ? [
|
|
242
243
|
{ key: "hour", config: h.hour24, ariaLabel: "Hours" },
|
|
243
244
|
{ key: "minute", config: h.minute, ariaLabel: "Minutes" }
|
|
244
245
|
] : [
|
|
245
246
|
{ key: "hour", config: h.hour12, ariaLabel: "Hours" },
|
|
246
247
|
{ key: "minute", config: h.minute, ariaLabel: "Minutes" },
|
|
247
|
-
{ key: "period", config: h.period, ariaLabel:
|
|
248
|
+
{ key: "period", config: h.period, ariaLabel: re("Select {am} or {pm}", r) }
|
|
248
249
|
];
|
|
249
|
-
return [...
|
|
250
|
-
}, [
|
|
251
|
-
S.current?.querySelectorAll('[role="spinbutton"]')[
|
|
252
|
-
}, []),
|
|
253
|
-
return /* @__PURE__ */
|
|
254
|
-
|
|
255
|
-
/* @__PURE__ */ O(
|
|
256
|
-
"div",
|
|
257
|
-
|
|
258
|
-
className:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
onRightFocus: () => n < q.length - 1 && z(n + 1),
|
|
280
|
-
onValueChange: (G) => D({ [s.key]: G }),
|
|
281
|
-
periodLabels: t,
|
|
282
|
-
value: r[s.key]
|
|
283
|
-
}
|
|
284
|
-
),
|
|
285
|
-
m && !P && /* @__PURE__ */ x("span", { "aria-hidden": "true", className: "text-text-secondary select-none", children: "/" }),
|
|
286
|
-
N && /* @__PURE__ */ x("span", { "aria-hidden": "true", className: "text-inherit select-none", children: ":" })
|
|
287
|
-
] }, s.key);
|
|
288
|
-
}) }),
|
|
289
|
-
/* @__PURE__ */ x("div", { className: "text-input-icon absolute top-1/2 right-4 -translate-y-1/2", children: o })
|
|
290
|
-
]
|
|
291
|
-
}
|
|
292
|
-
)
|
|
250
|
+
return [...i, ...n];
|
|
251
|
+
}, [m, a, r]), z = L((i) => {
|
|
252
|
+
S.current?.querySelectorAll('[role="spinbutton"]')[i]?.focus();
|
|
253
|
+
}, []), Q = O(ie(d, v));
|
|
254
|
+
return /* @__PURE__ */ K("div", { className: "flex flex-col gap-1.5", children: [
|
|
255
|
+
u && /* @__PURE__ */ x(ne, { className: "text-text-primary text-sm font-medium", htmlFor: e, children: u }),
|
|
256
|
+
/* @__PURE__ */ K("div", { className: O(Q, "relative", (s || d === "disabled") && "cursor-not-allowed", v), "data-slot": "datetime-display-input", id: e ?? "datetime-display-input", ref: R ?? S, ...E, children: [
|
|
257
|
+
/* @__PURE__ */ x("div", { className: "flex items-center", ref: S, children: q.map((i, n) => {
|
|
258
|
+
const p = ["month", "day", "year"].includes(i.key), H = ["hour", "minute", "period"].includes(i.key), Y = i.key === "year", N = i.key === "hour", P = s || H && !k;
|
|
259
|
+
return /* @__PURE__ */ K("span", { className: "flex items-center", children: [
|
|
260
|
+
N && /* @__PURE__ */ x("span", { "aria-hidden": "true", className: "text-text-secondary select-none", children: ", " }),
|
|
261
|
+
/* @__PURE__ */ x(
|
|
262
|
+
ce,
|
|
263
|
+
{
|
|
264
|
+
ariaLabel: i.ariaLabel,
|
|
265
|
+
config: i.config,
|
|
266
|
+
disabled: P,
|
|
267
|
+
onLeftFocus: () => n > 0 && z(n - 1),
|
|
268
|
+
onRightFocus: () => n < q.length - 1 && z(n + 1),
|
|
269
|
+
onValueChange: (j) => _({ [i.key]: j }),
|
|
270
|
+
periodLabels: r,
|
|
271
|
+
value: l[i.key]
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
p && !Y && /* @__PURE__ */ x("span", { "aria-hidden": "true", className: "text-text-secondary select-none", children: "/" }),
|
|
275
|
+
N && /* @__PURE__ */ x("span", { "aria-hidden": "true", className: "text-inherit select-none", children: ":" })
|
|
276
|
+
] }, i.key);
|
|
277
|
+
}) }),
|
|
278
|
+
/* @__PURE__ */ x("div", { className: "text-input-icon absolute top-1/2 right-4 -translate-y-1/2", children: o })
|
|
279
|
+
] })
|
|
293
280
|
] });
|
|
294
281
|
}
|
|
295
282
|
);
|
|
296
|
-
|
|
283
|
+
le.displayName = "DateTimeDisplayInput";
|
|
297
284
|
export {
|
|
298
|
-
|
|
285
|
+
le as DateTimeDisplayInput
|
|
299
286
|
};
|
package/dist/Tabs/TabsBase.js
CHANGED
|
@@ -101,24 +101,28 @@ const N = k(null), A = (y = "Tabs") => {
|
|
|
101
101
|
D.div,
|
|
102
102
|
{
|
|
103
103
|
className: x(
|
|
104
|
-
"pointer-events-none absolute select-none",
|
|
104
|
+
"pointer-events-none absolute top-0 left-0 will-change-transform select-none",
|
|
105
105
|
t.orientation === "horizontal" && !t.isEnclosed && ["bottom-[1px] after:absolute after:bottom-0 after:left-0 after:w-full after:content-['']", "after:border-tabs-indicator z-10 after:rounded-t-[0.3rem] after:border-b-[0.3rem]"],
|
|
106
106
|
t.orientation === "vertical" && !t.isEnclosed && ["right-[1px]", "after:absolute after:top-0 after:right-0 after:h-full after:w-1 after:content-['']", "after:border-tabs-indicator z-10 after:rounded-l-[0.3rem] after:border-r-[0.3rem]"],
|
|
107
107
|
t.orientation === "horizontal" && t.isEnclosed && ["bg-tabs-enclosed-indicator z-0 rounded-lg shadow-lg"],
|
|
108
|
-
t.orientation === "vertical" && t.isEnclosed && ["bg-tabs-enclosed-indicator
|
|
108
|
+
t.orientation === "vertical" && t.isEnclosed && ["bg-tabs-enclosed-indicator z-0 rounded-lg shadow-lg"]
|
|
109
109
|
),
|
|
110
110
|
initial: !1,
|
|
111
111
|
animate: {
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
// Use x/y (translateX/translateY) for position - compositor-friendly, no reflows
|
|
113
|
+
x: t.left,
|
|
114
|
+
y: t.isEnclosed ? t.top + t.height * 0.1 : t.top,
|
|
115
|
+
// Width/height required for correct rendering: scaleX/Y would distort
|
|
116
|
+
// border-radius on enclosed variant and border widths on default variant
|
|
114
117
|
width: t.width,
|
|
115
118
|
height: t.isEnclosed ? t.orientation === "vertical" ? 40 : t.height * 0.8 : t.height
|
|
116
119
|
},
|
|
117
120
|
transition: I ? { duration: 0 } : {
|
|
118
|
-
|
|
119
|
-
stiffness: 500,
|
|
120
|
-
damping: 40,
|
|
121
|
-
mass: 1
|
|
121
|
+
// Separate transition configs: spring for transforms, tween for layout
|
|
122
|
+
x: { type: "spring", stiffness: 500, damping: 40, mass: 1 },
|
|
123
|
+
y: { type: "spring", stiffness: 500, damping: 40, mass: 1 },
|
|
124
|
+
width: { type: "spring", stiffness: 500, damping: 40, mass: 1 },
|
|
125
|
+
height: { type: "spring", stiffness: 500, damping: 40, mass: 1 }
|
|
122
126
|
},
|
|
123
127
|
"aria-hidden": "true"
|
|
124
128
|
}
|