@brycks/core-front 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/feedback/Modal/Modal.d.ts.map +1 -1
- package/dist/components/layout/Flex/Flex.d.ts.map +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +410 -409
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as Ga, c as qa, e as Ua, i as Za, n as Qa, p as Ja, s as es, w as ts } from "./colors-B_8a3coi.js";
|
|
2
|
-
import { spacing as L, durations as te, easings as
|
|
2
|
+
import { spacing as L, durations as te, easings as J, fontSizes as oe, fontWeights as de, lineHeights as Ne, fontFamilies as se, containers as yt, textStyles as ce } from "./tokens.js";
|
|
3
3
|
import { animations as os, borderStyles as ns, borderWidths as as, breakpoints as ss, focusRings as is, glows as ls, letterSpacings as cs, mediaQueries as ds, radii as us, semanticSpacing as ys, shadows as fs, transitions as ms, zIndex as bs } from "./tokens.js";
|
|
4
4
|
import { T as ps, c as hs, d as ks, l as vs, u as xs, a as Ss } from "./cssVariables-D9uw0uKO.js";
|
|
5
|
-
import { forwardRef as z, useState as
|
|
5
|
+
import { forwardRef as z, useState as A, useCallback as E, useEffect as Y, useRef as Z, useImperativeHandle as ft, useId as Te, createContext as ge, useContext as pe, cloneElement as De, useMemo as mt, Children as bt, isValidElement as gt } from "react";
|
|
6
6
|
import { jsx as s, jsxs as w, Fragment as ne } from "react/jsx-runtime";
|
|
7
7
|
import { createPortal as ve } from "react-dom";
|
|
8
8
|
const fe = {
|
|
@@ -148,27 +148,27 @@ const fe = {
|
|
|
148
148
|
/** No transition */
|
|
149
149
|
none: "none",
|
|
150
150
|
/** Ultra-fast - for micro-interactions (50ms) */
|
|
151
|
-
instant: `all ${te.faster}ms ${
|
|
151
|
+
instant: `all ${te.faster}ms ${J.easeOut}`,
|
|
152
152
|
/** Fast - for hover states, toggles (100ms) */
|
|
153
|
-
fast: `all ${te.fast}ms ${
|
|
153
|
+
fast: `all ${te.fast}ms ${J.easeOut}`,
|
|
154
154
|
/** Quick - standard interactive feedback (150ms) */
|
|
155
|
-
quick: `all ${te.quick}ms ${
|
|
155
|
+
quick: `all ${te.quick}ms ${J.easeOut}`,
|
|
156
156
|
/** Default - most state changes (200ms) */
|
|
157
|
-
default: `all ${te.normal}ms ${
|
|
157
|
+
default: `all ${te.normal}ms ${J.easeOut}`,
|
|
158
158
|
/** Smooth - focus states, form elements (300ms) */
|
|
159
|
-
smooth: `all ${te.relaxed}ms ${
|
|
159
|
+
smooth: `all ${te.relaxed}ms ${J.smooth}`,
|
|
160
160
|
/** Slow - reveals, modals (400ms) */
|
|
161
|
-
slow: `all ${te.slow}ms ${
|
|
161
|
+
slow: `all ${te.slow}ms ${J.easeOut}`,
|
|
162
162
|
/** Spring - bouncy, tactile feel (300ms) */
|
|
163
|
-
spring: `all ${te.relaxed}ms ${
|
|
163
|
+
spring: `all ${te.relaxed}ms ${J.softSpring}`,
|
|
164
164
|
/** Colors only - optimized for color transitions */
|
|
165
|
-
colors: `color ${te.fast}ms ${
|
|
165
|
+
colors: `color ${te.fast}ms ${J.easeOut}, background-color ${te.fast}ms ${J.easeOut}, border-color ${te.fast}ms ${J.easeOut}`,
|
|
166
166
|
/** Transform only - for scale, translate */
|
|
167
|
-
transform: `transform ${te.normal}ms ${
|
|
167
|
+
transform: `transform ${te.normal}ms ${J.easeOut}`,
|
|
168
168
|
/** Opacity only - for fade effects */
|
|
169
|
-
opacity: `opacity ${te.normal}ms ${
|
|
169
|
+
opacity: `opacity ${te.normal}ms ${J.easeOut}`,
|
|
170
170
|
/** Shadow only - for elevation changes */
|
|
171
|
-
shadow: `box-shadow ${te.normal}ms ${
|
|
171
|
+
shadow: `box-shadow ${te.normal}ms ${J.easeOut}`
|
|
172
172
|
}, ga = {
|
|
173
173
|
all: "all",
|
|
174
174
|
colors: "color, background-color, border-color, fill, stroke",
|
|
@@ -185,15 +185,15 @@ const fe = {
|
|
|
185
185
|
slow: te.slow,
|
|
186
186
|
slower: te.slower
|
|
187
187
|
}, ha = {
|
|
188
|
-
linear:
|
|
189
|
-
ease:
|
|
190
|
-
easeIn:
|
|
191
|
-
easeOut:
|
|
192
|
-
easeInOut:
|
|
193
|
-
spring:
|
|
194
|
-
softSpring:
|
|
195
|
-
smooth:
|
|
196
|
-
snappy:
|
|
188
|
+
linear: J.linear,
|
|
189
|
+
ease: J.ease,
|
|
190
|
+
easeIn: J.easeIn,
|
|
191
|
+
easeOut: J.easeOut,
|
|
192
|
+
easeInOut: J.easeInOut,
|
|
193
|
+
spring: J.spring,
|
|
194
|
+
softSpring: J.softSpring,
|
|
195
|
+
smooth: J.smooth,
|
|
196
|
+
snappy: J.snappy
|
|
197
197
|
}, ka = {
|
|
198
198
|
fadeIn: `
|
|
199
199
|
@keyframes brycks-fade-in {
|
|
@@ -994,7 +994,7 @@ const Ee = {
|
|
|
994
994
|
}, C = {
|
|
995
995
|
display: "flex",
|
|
996
996
|
flexDirection: "column"
|
|
997
|
-
},
|
|
997
|
+
}, I = e || t || l;
|
|
998
998
|
return /* @__PURE__ */ w(
|
|
999
999
|
"section",
|
|
1000
1000
|
{
|
|
@@ -1004,7 +1004,7 @@ const Ee = {
|
|
|
1004
1004
|
"data-testid": y,
|
|
1005
1005
|
...m,
|
|
1006
1006
|
children: [
|
|
1007
|
-
|
|
1007
|
+
I && /* @__PURE__ */ w("div", { className: "brycks-section-header", style: p, children: [
|
|
1008
1008
|
/* @__PURE__ */ w("div", { style: b, children: [
|
|
1009
1009
|
e && /* @__PURE__ */ s(u, { style: v, children: e }),
|
|
1010
1010
|
t && /* @__PURE__ */ s("p", { style: x, children: t })
|
|
@@ -1078,15 +1078,16 @@ const er = {
|
|
|
1078
1078
|
testId: p,
|
|
1079
1079
|
...b
|
|
1080
1080
|
}, v) {
|
|
1081
|
-
const x = {
|
|
1081
|
+
const x = a ? { gap: L[a] } : {
|
|
1082
|
+
...l ? { rowGap: L[l] } : {},
|
|
1083
|
+
...i ? { columnGap: L[i] } : {}
|
|
1084
|
+
}, k = {
|
|
1082
1085
|
display: d ? "inline-flex" : "flex",
|
|
1083
1086
|
flexDirection: e,
|
|
1084
1087
|
flexWrap: t,
|
|
1085
1088
|
justifyContent: er[o],
|
|
1086
1089
|
alignItems: Ve[n],
|
|
1087
|
-
|
|
1088
|
-
rowGap: l ? L[l] : void 0,
|
|
1089
|
-
columnGap: i ? L[i] : void 0,
|
|
1090
|
+
...x,
|
|
1090
1091
|
flexGrow: c,
|
|
1091
1092
|
flexShrink: y,
|
|
1092
1093
|
flexBasis: m,
|
|
@@ -1097,7 +1098,7 @@ const er = {
|
|
|
1097
1098
|
{
|
|
1098
1099
|
ref: v,
|
|
1099
1100
|
className: S("brycks-flex", u),
|
|
1100
|
-
style:
|
|
1101
|
+
style: k,
|
|
1101
1102
|
"data-testid": p,
|
|
1102
1103
|
...b,
|
|
1103
1104
|
children: g
|
|
@@ -1218,30 +1219,30 @@ const ir = z(function({
|
|
|
1218
1219
|
testId: f,
|
|
1219
1220
|
...p
|
|
1220
1221
|
}, b) {
|
|
1221
|
-
const [v, x] =
|
|
1222
|
+
const [v, x] = A("loading"), k = E(
|
|
1222
1223
|
($) => {
|
|
1223
1224
|
x("loaded"), y == null || y($);
|
|
1224
1225
|
},
|
|
1225
1226
|
[y]
|
|
1226
|
-
), C =
|
|
1227
|
+
), C = E(
|
|
1227
1228
|
($) => {
|
|
1228
1229
|
x("error"), m == null || m($);
|
|
1229
1230
|
},
|
|
1230
1231
|
[m]
|
|
1231
|
-
),
|
|
1232
|
+
), I = sr(o), h = Ae[d] ?? Ae.none, D = {
|
|
1232
1233
|
position: "relative",
|
|
1233
1234
|
overflow: "hidden",
|
|
1234
1235
|
borderRadius: h,
|
|
1235
1236
|
backgroundColor: c && v === "loading" ? "var(--brycks-background-muted)" : void 0,
|
|
1236
|
-
...
|
|
1237
|
+
...I ? {
|
|
1237
1238
|
width: "100%",
|
|
1238
|
-
paddingBottom: `${1 /
|
|
1239
|
+
paddingBottom: `${1 / I * 100}%`
|
|
1239
1240
|
} : {}
|
|
1240
1241
|
}, M = {
|
|
1241
1242
|
display: "block",
|
|
1242
1243
|
objectFit: n,
|
|
1243
1244
|
borderRadius: h,
|
|
1244
|
-
...
|
|
1245
|
+
...I ? {
|
|
1245
1246
|
position: "absolute",
|
|
1246
1247
|
top: 0,
|
|
1247
1248
|
left: 0,
|
|
@@ -1296,7 +1297,7 @@ const ir = z(function({
|
|
|
1296
1297
|
role: "img",
|
|
1297
1298
|
"aria-label": t,
|
|
1298
1299
|
children: [
|
|
1299
|
-
|
|
1300
|
+
I && /* @__PURE__ */ s("div", { style: { paddingBottom: `${1 / I * 100}%` } }),
|
|
1300
1301
|
l && /* @__PURE__ */ s("div", { style: N, children: l })
|
|
1301
1302
|
]
|
|
1302
1303
|
}
|
|
@@ -1309,7 +1310,7 @@ const ir = z(function({
|
|
|
1309
1310
|
v === "loaded" && "brycks-image--loaded",
|
|
1310
1311
|
g
|
|
1311
1312
|
),
|
|
1312
|
-
style:
|
|
1313
|
+
style: I ? D : { position: "relative", borderRadius: h },
|
|
1313
1314
|
"data-testid": f,
|
|
1314
1315
|
children: [
|
|
1315
1316
|
v === "loading" && i && /* @__PURE__ */ s("div", { style: N, children: typeof i == "string" ? /* @__PURE__ */ s(
|
|
@@ -1346,8 +1347,8 @@ const ir = z(function({
|
|
|
1346
1347
|
});
|
|
1347
1348
|
ir.displayName = "Image";
|
|
1348
1349
|
function Me(r) {
|
|
1349
|
-
const [e, t] =
|
|
1350
|
-
return
|
|
1350
|
+
const [e, t] = A(() => typeof window > "u" ? !1 : window.matchMedia(r).matches);
|
|
1351
|
+
return Y(() => {
|
|
1351
1352
|
if (typeof window > "u") return;
|
|
1352
1353
|
const o = window.matchMedia(r), n = (a) => t(a.matches);
|
|
1353
1354
|
return t(o.matches), o.addEventListener("change", n), () => o.removeEventListener("change", n);
|
|
@@ -1409,10 +1410,10 @@ const cr = z(function({
|
|
|
1409
1410
|
style: x,
|
|
1410
1411
|
testId: k,
|
|
1411
1412
|
...C
|
|
1412
|
-
},
|
|
1413
|
-
const h =
|
|
1413
|
+
}, I) {
|
|
1414
|
+
const h = Z(null), [D, M] = A(!1), [N, $] = A(!1), R = We(), H = !(R || l === !1), T = c ?? (H || l === "muted");
|
|
1414
1415
|
ft(
|
|
1415
|
-
|
|
1416
|
+
I,
|
|
1416
1417
|
() => ({
|
|
1417
1418
|
play: async () => {
|
|
1418
1419
|
h.current && await h.current.play();
|
|
@@ -1442,31 +1443,31 @@ const cr = z(function({
|
|
|
1442
1443
|
getElement: () => h.current
|
|
1443
1444
|
}),
|
|
1444
1445
|
[]
|
|
1445
|
-
),
|
|
1446
|
-
|
|
1447
|
-
var
|
|
1446
|
+
), Y(() => {
|
|
1447
|
+
H && h.current && (async () => {
|
|
1448
|
+
var K;
|
|
1448
1449
|
try {
|
|
1449
|
-
await ((
|
|
1450
|
+
await ((K = h.current) == null ? void 0 : K.play());
|
|
1450
1451
|
} catch {
|
|
1451
1452
|
}
|
|
1452
1453
|
})();
|
|
1453
|
-
}, [
|
|
1454
|
-
const
|
|
1454
|
+
}, [H]);
|
|
1455
|
+
const F = E(
|
|
1455
1456
|
(_) => {
|
|
1456
1457
|
M(!0), g == null || g(_);
|
|
1457
1458
|
},
|
|
1458
1459
|
[g]
|
|
1459
|
-
), V =
|
|
1460
|
+
), V = E(
|
|
1460
1461
|
(_) => {
|
|
1461
1462
|
M(!1), u == null || u(_);
|
|
1462
1463
|
},
|
|
1463
1464
|
[u]
|
|
1464
|
-
), W =
|
|
1465
|
+
), W = E(
|
|
1465
1466
|
(_) => {
|
|
1466
1467
|
M(!1), f == null || f(_);
|
|
1467
1468
|
},
|
|
1468
1469
|
[f]
|
|
1469
|
-
),
|
|
1470
|
+
), B = E(
|
|
1470
1471
|
(_) => {
|
|
1471
1472
|
$(!0), b == null || b(_);
|
|
1472
1473
|
},
|
|
@@ -1541,13 +1542,13 @@ const cr = z(function({
|
|
|
1541
1542
|
preload: a,
|
|
1542
1543
|
loop: i,
|
|
1543
1544
|
controls: d,
|
|
1544
|
-
muted:
|
|
1545
|
+
muted: T,
|
|
1545
1546
|
playsInline: y,
|
|
1546
|
-
onPlay:
|
|
1547
|
+
onPlay: F,
|
|
1547
1548
|
onPause: V,
|
|
1548
1549
|
onEnded: W,
|
|
1549
1550
|
onCanPlay: p,
|
|
1550
|
-
onError:
|
|
1551
|
+
onError: B,
|
|
1551
1552
|
style: j,
|
|
1552
1553
|
...C
|
|
1553
1554
|
}
|
|
@@ -2143,28 +2144,28 @@ const Mr = ({
|
|
|
2143
2144
|
onMouseUp: v,
|
|
2144
2145
|
...x
|
|
2145
2146
|
}, k) => {
|
|
2146
|
-
const C = r || "button", [
|
|
2147
|
+
const C = r || "button", [I, h] = A(!1), [D, M] = A(!1), N = l || a, $ = zr({
|
|
2147
2148
|
variant: e,
|
|
2148
2149
|
intent: t,
|
|
2149
2150
|
size: o,
|
|
2150
2151
|
fullWidth: n,
|
|
2151
2152
|
isIconOnly: c
|
|
2152
|
-
}),
|
|
2153
|
+
}), R = {
|
|
2153
2154
|
...$.base,
|
|
2154
|
-
...
|
|
2155
|
+
...I && !N ? $.hover : {},
|
|
2155
2156
|
...D && !N ? $.active : {},
|
|
2156
2157
|
...N ? $.disabled : {},
|
|
2157
2158
|
...a ? $.loading : {},
|
|
2158
2159
|
...m
|
|
2159
|
-
},
|
|
2160
|
+
}, H = _e[o], T = (P) => {
|
|
2160
2161
|
h(!0), f == null || f(P);
|
|
2161
|
-
},
|
|
2162
|
+
}, F = (P) => {
|
|
2162
2163
|
h(!1), M(!1), p == null || p(P);
|
|
2163
2164
|
}, V = (P) => {
|
|
2164
2165
|
M(!0), b == null || b(P);
|
|
2165
2166
|
}, W = (P) => {
|
|
2166
2167
|
M(!1), v == null || v(P);
|
|
2167
|
-
},
|
|
2168
|
+
}, B = S(
|
|
2168
2169
|
"brycks-button",
|
|
2169
2170
|
`brycks-button--${e}`,
|
|
2170
2171
|
`brycks-button--${t}`,
|
|
@@ -2186,11 +2187,11 @@ const Mr = ({
|
|
|
2186
2187
|
C,
|
|
2187
2188
|
{
|
|
2188
2189
|
ref: k,
|
|
2189
|
-
className:
|
|
2190
|
-
style:
|
|
2190
|
+
className: B,
|
|
2191
|
+
style: R,
|
|
2191
2192
|
"data-testid": u,
|
|
2192
|
-
onMouseEnter:
|
|
2193
|
-
onMouseLeave:
|
|
2193
|
+
onMouseEnter: T,
|
|
2194
|
+
onMouseLeave: F,
|
|
2194
2195
|
onMouseDown: V,
|
|
2195
2196
|
onMouseUp: W,
|
|
2196
2197
|
...q,
|
|
@@ -2203,7 +2204,7 @@ const Mr = ({
|
|
|
2203
2204
|
display: "inline-flex",
|
|
2204
2205
|
position: c ? "absolute" : "relative"
|
|
2205
2206
|
},
|
|
2206
|
-
children: /* @__PURE__ */ s(Cr, { size:
|
|
2207
|
+
children: /* @__PURE__ */ s(Cr, { size: H.iconSize })
|
|
2207
2208
|
}
|
|
2208
2209
|
),
|
|
2209
2210
|
!a && i && /* @__PURE__ */ s(
|
|
@@ -2211,8 +2212,8 @@ const Mr = ({
|
|
|
2211
2212
|
{
|
|
2212
2213
|
style: {
|
|
2213
2214
|
display: "inline-flex",
|
|
2214
|
-
width:
|
|
2215
|
-
height:
|
|
2215
|
+
width: H.iconSize,
|
|
2216
|
+
height: H.iconSize
|
|
2216
2217
|
},
|
|
2217
2218
|
children: i
|
|
2218
2219
|
}
|
|
@@ -2231,8 +2232,8 @@ const Mr = ({
|
|
|
2231
2232
|
{
|
|
2232
2233
|
style: {
|
|
2233
2234
|
display: "inline-flex",
|
|
2234
|
-
width:
|
|
2235
|
-
height:
|
|
2235
|
+
width: H.iconSize,
|
|
2236
|
+
height: H.iconSize
|
|
2236
2237
|
},
|
|
2237
2238
|
children: d
|
|
2238
2239
|
}
|
|
@@ -2387,7 +2388,7 @@ const Ea = {
|
|
|
2387
2388
|
onBlur: m,
|
|
2388
2389
|
...g
|
|
2389
2390
|
}, u) {
|
|
2390
|
-
const [f, p] =
|
|
2391
|
+
const [f, p] = A(!1), b = $r[e], v = () => {
|
|
2391
2392
|
const h = {
|
|
2392
2393
|
display: "flex",
|
|
2393
2394
|
alignItems: "center",
|
|
@@ -2442,7 +2443,7 @@ const Ea = {
|
|
|
2442
2443
|
p(!0), y == null || y(h);
|
|
2443
2444
|
}, C = (h) => {
|
|
2444
2445
|
p(!1), m == null || m(h);
|
|
2445
|
-
},
|
|
2446
|
+
}, I = {
|
|
2446
2447
|
display: "flex",
|
|
2447
2448
|
alignItems: "center",
|
|
2448
2449
|
justifyContent: "center",
|
|
@@ -2466,7 +2467,7 @@ const Ea = {
|
|
|
2466
2467
|
"span",
|
|
2467
2468
|
{
|
|
2468
2469
|
className: "brycks-input-left-element",
|
|
2469
|
-
style: { ...
|
|
2470
|
+
style: { ...I, paddingLeft: b.paddingX },
|
|
2470
2471
|
children: n
|
|
2471
2472
|
}
|
|
2472
2473
|
),
|
|
@@ -2488,7 +2489,7 @@ const Ea = {
|
|
|
2488
2489
|
"span",
|
|
2489
2490
|
{
|
|
2490
2491
|
className: "brycks-input-right-element",
|
|
2491
|
-
style: { ...
|
|
2492
|
+
style: { ...I, paddingRight: b.paddingX },
|
|
2492
2493
|
children: a
|
|
2493
2494
|
}
|
|
2494
2495
|
)
|
|
@@ -2610,7 +2611,7 @@ const Rr = z(function({
|
|
|
2610
2611
|
value: g,
|
|
2611
2612
|
...u
|
|
2612
2613
|
}, f) {
|
|
2613
|
-
const [p, b] =
|
|
2614
|
+
const [p, b] = A(!1), v = Hr[e], x = g !== void 0 && g !== "", k = {
|
|
2614
2615
|
position: "relative",
|
|
2615
2616
|
display: "inline-flex",
|
|
2616
2617
|
width: "100%"
|
|
@@ -2634,7 +2635,7 @@ const Rr = z(function({
|
|
|
2634
2635
|
boxShadow: p ? o ? "0 0 0 3px rgba(239, 68, 68, 0.15)" : "0 0 0 3px rgba(85, 120, 244, 0.15)" : "none"
|
|
2635
2636
|
};
|
|
2636
2637
|
return d && (M.opacity = 0.5), M;
|
|
2637
|
-
},
|
|
2638
|
+
}, I = {
|
|
2638
2639
|
position: "absolute",
|
|
2639
2640
|
right: v.padding,
|
|
2640
2641
|
top: "50%",
|
|
@@ -2679,7 +2680,7 @@ const Rr = z(function({
|
|
|
2679
2680
|
]
|
|
2680
2681
|
}
|
|
2681
2682
|
),
|
|
2682
|
-
/* @__PURE__ */ s("span", { style:
|
|
2683
|
+
/* @__PURE__ */ s("span", { style: I, children: /* @__PURE__ */ s(Wr, {}) })
|
|
2683
2684
|
]
|
|
2684
2685
|
}
|
|
2685
2686
|
);
|
|
@@ -2722,7 +2723,7 @@ const Er = z(function({
|
|
|
2722
2723
|
onChange: m,
|
|
2723
2724
|
...g
|
|
2724
2725
|
}, u) {
|
|
2725
|
-
const [f, p] =
|
|
2726
|
+
const [f, p] = A(!1), [b, v] = A(!1), [x, k] = A(!1), C = pt[e], I = U[e], h = y || a, D = {
|
|
2726
2727
|
display: "inline-flex",
|
|
2727
2728
|
alignItems: "flex-start",
|
|
2728
2729
|
gap: le.lg,
|
|
@@ -2754,18 +2755,18 @@ const Er = z(function({
|
|
|
2754
2755
|
opacity: 0,
|
|
2755
2756
|
cursor: c ? "not-allowed" : "pointer",
|
|
2756
2757
|
margin: 0
|
|
2757
|
-
},
|
|
2758
|
+
}, R = {
|
|
2758
2759
|
display: "flex",
|
|
2759
2760
|
flexDirection: "column",
|
|
2760
2761
|
gap: le.xs,
|
|
2761
|
-
paddingTop: (C.box -
|
|
2762
|
-
},
|
|
2763
|
-
fontSize:
|
|
2762
|
+
paddingTop: (C.box - I) / 2
|
|
2763
|
+
}, H = {
|
|
2764
|
+
fontSize: I,
|
|
2764
2765
|
lineHeight: ee.snug,
|
|
2765
2766
|
color: "var(--brycks-foreground-default)",
|
|
2766
2767
|
userSelect: "none"
|
|
2767
|
-
},
|
|
2768
|
-
fontSize:
|
|
2768
|
+
}, T = {
|
|
2769
|
+
fontSize: I - 1,
|
|
2769
2770
|
lineHeight: ee.snug,
|
|
2770
2771
|
color: "var(--brycks-foreground-muted)",
|
|
2771
2772
|
userSelect: "none"
|
|
@@ -2808,9 +2809,9 @@ const Er = z(function({
|
|
|
2808
2809
|
),
|
|
2809
2810
|
/* @__PURE__ */ s("span", { style: N, children: a ? /* @__PURE__ */ s(Fr, { size: C.icon }) : /* @__PURE__ */ s(Br, { size: C.icon }) })
|
|
2810
2811
|
] }),
|
|
2811
|
-
(t || o) && /* @__PURE__ */ w("span", { style:
|
|
2812
|
-
t && /* @__PURE__ */ s("span", { style:
|
|
2813
|
-
o && /* @__PURE__ */ s("span", { style:
|
|
2812
|
+
(t || o) && /* @__PURE__ */ w("span", { style: R, children: [
|
|
2813
|
+
t && /* @__PURE__ */ s("span", { style: H, children: t }),
|
|
2814
|
+
o && /* @__PURE__ */ s("span", { style: T, children: o })
|
|
2814
2815
|
] })
|
|
2815
2816
|
]
|
|
2816
2817
|
}
|
|
@@ -2829,13 +2830,13 @@ const Ar = z(function({
|
|
|
2829
2830
|
onChange: c,
|
|
2830
2831
|
...y
|
|
2831
2832
|
}, m) {
|
|
2832
|
-
const [g, u] =
|
|
2833
|
+
const [g, u] = A(!1), [f, p] = A(!1), b = ht[e], v = U[e], x = (b.height - b.thumb) / 2, k = b.width - b.thumb - x * 2, C = {
|
|
2833
2834
|
display: "inline-flex",
|
|
2834
2835
|
alignItems: "flex-start",
|
|
2835
2836
|
gap: le.xl,
|
|
2836
2837
|
cursor: i ? "not-allowed" : "pointer",
|
|
2837
2838
|
opacity: i ? Le.disabled : 1
|
|
2838
|
-
},
|
|
2839
|
+
}, I = {
|
|
2839
2840
|
position: "relative",
|
|
2840
2841
|
width: b.width,
|
|
2841
2842
|
height: b.height,
|
|
@@ -2895,7 +2896,7 @@ const Ar = z(function({
|
|
|
2895
2896
|
onMouseUp: () => p(!1),
|
|
2896
2897
|
onMouseLeave: () => p(!1),
|
|
2897
2898
|
children: [
|
|
2898
|
-
/* @__PURE__ */ w("span", { style:
|
|
2899
|
+
/* @__PURE__ */ w("span", { style: I, children: [
|
|
2899
2900
|
/* @__PURE__ */ s(
|
|
2900
2901
|
"input",
|
|
2901
2902
|
{
|
|
@@ -2947,24 +2948,24 @@ const jr = {
|
|
|
2947
2948
|
onBlur: v,
|
|
2948
2949
|
...x
|
|
2949
2950
|
}, k) {
|
|
2950
|
-
const [C,
|
|
2951
|
+
const [C, I] = A(!1), [h, D] = A(0), M = Z(null), N = k || M, $ = jr[e], R = $.fontSize * $.lineHeight, H = R * a + $.padding * 2, T = R * l + $.padding * 2, F = E(() => {
|
|
2951
2952
|
const j = N.current;
|
|
2952
2953
|
if (!j || !n) return;
|
|
2953
2954
|
j.style.height = "auto";
|
|
2954
|
-
const re = j.scrollHeight, _ = Math.min(Math.max(re,
|
|
2955
|
+
const re = j.scrollHeight, _ = Math.min(Math.max(re, H), T);
|
|
2955
2956
|
j.style.height = `${_}px`;
|
|
2956
|
-
}, [n,
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
}, [u,
|
|
2957
|
+
}, [n, H, T, N]);
|
|
2958
|
+
Y(() => {
|
|
2959
|
+
F();
|
|
2960
|
+
}, [u, F]), Y(() => {
|
|
2960
2961
|
const j = String(u ?? f ?? "");
|
|
2961
2962
|
D(j.length);
|
|
2962
2963
|
}, [u, f]);
|
|
2963
2964
|
const V = () => {
|
|
2964
2965
|
const j = {
|
|
2965
2966
|
width: "100%",
|
|
2966
|
-
minHeight:
|
|
2967
|
-
maxHeight: n ?
|
|
2967
|
+
minHeight: H,
|
|
2968
|
+
maxHeight: n ? T : void 0,
|
|
2968
2969
|
padding: $.padding,
|
|
2969
2970
|
fontSize: $.fontSize,
|
|
2970
2971
|
lineHeight: $.lineHeight,
|
|
@@ -2982,7 +2983,7 @@ const jr = {
|
|
|
2982
2983
|
}, W = {
|
|
2983
2984
|
position: "relative",
|
|
2984
2985
|
width: "100%"
|
|
2985
|
-
},
|
|
2986
|
+
}, B = {
|
|
2986
2987
|
position: "absolute",
|
|
2987
2988
|
bottom: 8,
|
|
2988
2989
|
right: 12,
|
|
@@ -2993,9 +2994,9 @@ const jr = {
|
|
|
2993
2994
|
}, O = (j) => {
|
|
2994
2995
|
D(j.target.value.length), p == null || p(j);
|
|
2995
2996
|
}, q = (j) => {
|
|
2996
|
-
|
|
2997
|
+
I(!0), b == null || b(j);
|
|
2997
2998
|
}, P = (j) => {
|
|
2998
|
-
|
|
2999
|
+
I(!1), v == null || v(j);
|
|
2999
3000
|
};
|
|
3000
3001
|
return /* @__PURE__ */ w(
|
|
3001
3002
|
"div",
|
|
@@ -3028,7 +3029,7 @@ const jr = {
|
|
|
3028
3029
|
...x
|
|
3029
3030
|
}
|
|
3030
3031
|
),
|
|
3031
|
-
i && /* @__PURE__ */ w("span", { style:
|
|
3032
|
+
i && /* @__PURE__ */ w("span", { style: B, children: [
|
|
3032
3033
|
h,
|
|
3033
3034
|
d ? `/${d}` : ""
|
|
3034
3035
|
] })
|
|
@@ -3053,7 +3054,7 @@ const Or = {
|
|
|
3053
3054
|
checked: c,
|
|
3054
3055
|
...y
|
|
3055
3056
|
}, m) {
|
|
3056
|
-
const [g, u] =
|
|
3057
|
+
const [g, u] = A(!1), [f, p] = A(!1), b = Or[e], v = {
|
|
3057
3058
|
display: "inline-flex",
|
|
3058
3059
|
alignItems: "flex-start",
|
|
3059
3060
|
gap: b.gap,
|
|
@@ -3086,7 +3087,7 @@ const Or = {
|
|
|
3086
3087
|
backgroundColor: "white",
|
|
3087
3088
|
transform: c ? "scale(1)" : "scale(0)",
|
|
3088
3089
|
transition: "transform 150ms ease-out"
|
|
3089
|
-
},
|
|
3090
|
+
}, I = {
|
|
3090
3091
|
position: "absolute",
|
|
3091
3092
|
width: b.radio,
|
|
3092
3093
|
height: b.radio,
|
|
@@ -3124,7 +3125,7 @@ const Or = {
|
|
|
3124
3125
|
type: "radio",
|
|
3125
3126
|
disabled: a,
|
|
3126
3127
|
checked: c,
|
|
3127
|
-
style:
|
|
3128
|
+
style: I,
|
|
3128
3129
|
onFocus: () => p(!0),
|
|
3129
3130
|
onBlur: () => p(!1),
|
|
3130
3131
|
"data-testid": d,
|
|
@@ -3154,7 +3155,7 @@ function _r({
|
|
|
3154
3155
|
className: c,
|
|
3155
3156
|
style: y
|
|
3156
3157
|
}) {
|
|
3157
|
-
const [m, g] =
|
|
3158
|
+
const [m, g] = A(t ?? ""), u = e ?? m, f = (v) => {
|
|
3158
3159
|
e === void 0 && g(v), o == null || o(v);
|
|
3159
3160
|
}, p = {
|
|
3160
3161
|
display: "flex",
|
|
@@ -3212,34 +3213,34 @@ const Xr = {
|
|
|
3212
3213
|
testId: f,
|
|
3213
3214
|
...p
|
|
3214
3215
|
}, b) {
|
|
3215
|
-
const [v, x] =
|
|
3216
|
+
const [v, x] = A(l), [k, C] = A(!1), [I, h] = A(!1), D = Z(null), M = a ?? v, N = Xr[e], $ = (M - t) / (o - t) * 100, R = E(
|
|
3216
3217
|
(j) => {
|
|
3217
3218
|
const re = Math.max(t, Math.min(o, j));
|
|
3218
3219
|
a === void 0 && x(re), i == null || i(re);
|
|
3219
3220
|
},
|
|
3220
3221
|
[a, t, o, i]
|
|
3221
3222
|
);
|
|
3222
|
-
|
|
3223
|
+
Y(() => {
|
|
3223
3224
|
const j = D.current;
|
|
3224
3225
|
if (!j) return;
|
|
3225
3226
|
const re = (_) => {
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3227
|
+
const K = _.target;
|
|
3228
|
+
R(parseFloat(K.value));
|
|
3228
3229
|
};
|
|
3229
3230
|
return j.addEventListener("input", re), () => j.removeEventListener("input", re);
|
|
3230
|
-
}, [
|
|
3231
|
-
const
|
|
3231
|
+
}, [R]);
|
|
3232
|
+
const H = {
|
|
3232
3233
|
display: "flex",
|
|
3233
3234
|
flexDirection: "column",
|
|
3234
3235
|
gap: 8,
|
|
3235
3236
|
opacity: m ? 0.5 : 1,
|
|
3236
3237
|
...u
|
|
3237
|
-
},
|
|
3238
|
+
}, T = {
|
|
3238
3239
|
display: "flex",
|
|
3239
3240
|
alignItems: "center",
|
|
3240
3241
|
justifyContent: "space-between",
|
|
3241
3242
|
gap: 12
|
|
3242
|
-
},
|
|
3243
|
+
}, F = {
|
|
3243
3244
|
fontSize: N.fontSize,
|
|
3244
3245
|
fontWeight: 500,
|
|
3245
3246
|
color: "var(--brycks-foreground-default)"
|
|
@@ -3254,7 +3255,7 @@ const Xr = {
|
|
|
3254
3255
|
alignItems: "center",
|
|
3255
3256
|
height: N.thumb,
|
|
3256
3257
|
cursor: m ? "not-allowed" : "pointer"
|
|
3257
|
-
},
|
|
3258
|
+
}, B = {
|
|
3258
3259
|
position: "absolute",
|
|
3259
3260
|
width: "100%",
|
|
3260
3261
|
height: N.track,
|
|
@@ -3276,7 +3277,7 @@ const Xr = {
|
|
|
3276
3277
|
borderRadius: "50%",
|
|
3277
3278
|
backgroundColor: "white",
|
|
3278
3279
|
border: `2px solid ${m ? "var(--brycks-foreground-muted)" : "var(--brycks-primary-default)"}`,
|
|
3279
|
-
boxShadow: k ||
|
|
3280
|
+
boxShadow: k || I ? "var(--brycks-shadow-md)" : "var(--brycks-shadow-sm)",
|
|
3280
3281
|
transform: k ? "scale(1.1)" : "scale(1)",
|
|
3281
3282
|
transition: k ? "transform 100ms ease-out, box-shadow 100ms ease-out" : "all 100ms ease-out",
|
|
3282
3283
|
pointerEvents: "none"
|
|
@@ -3289,9 +3290,9 @@ const Xr = {
|
|
|
3289
3290
|
opacity: 0,
|
|
3290
3291
|
cursor: m ? "not-allowed" : "pointer"
|
|
3291
3292
|
};
|
|
3292
|
-
return /* @__PURE__ */ w("div", { className: S("brycks-slider", `brycks-slider--${e}`, g), style:
|
|
3293
|
-
(y || d) && /* @__PURE__ */ w("div", { style:
|
|
3294
|
-
y && /* @__PURE__ */ s("span", { style:
|
|
3293
|
+
return /* @__PURE__ */ w("div", { className: S("brycks-slider", `brycks-slider--${e}`, g), style: H, children: [
|
|
3294
|
+
(y || d) && /* @__PURE__ */ w("div", { style: T, children: [
|
|
3295
|
+
y && /* @__PURE__ */ s("span", { style: F, children: y }),
|
|
3295
3296
|
d && /* @__PURE__ */ s("span", { style: V, children: c(M) })
|
|
3296
3297
|
] }),
|
|
3297
3298
|
/* @__PURE__ */ w(
|
|
@@ -3301,7 +3302,7 @@ const Xr = {
|
|
|
3301
3302
|
onMouseEnter: () => h(!0),
|
|
3302
3303
|
onMouseLeave: () => h(!1),
|
|
3303
3304
|
children: [
|
|
3304
|
-
/* @__PURE__ */ s("div", { style:
|
|
3305
|
+
/* @__PURE__ */ s("div", { style: B }),
|
|
3305
3306
|
/* @__PURE__ */ s("div", { style: O }),
|
|
3306
3307
|
/* @__PURE__ */ s("div", { style: q }),
|
|
3307
3308
|
/* @__PURE__ */ s(
|
|
@@ -3350,7 +3351,7 @@ const Kr = {
|
|
|
3350
3351
|
testId: g,
|
|
3351
3352
|
...u
|
|
3352
3353
|
}, f) {
|
|
3353
|
-
const [p, b] =
|
|
3354
|
+
const [p, b] = A(!1), [v, x] = A(!1), k = Kr[e], C = i || !!l, I = {
|
|
3354
3355
|
display: "flex",
|
|
3355
3356
|
flexDirection: "column",
|
|
3356
3357
|
gap: 6,
|
|
@@ -3364,7 +3365,7 @@ const Kr = {
|
|
|
3364
3365
|
display: "flex",
|
|
3365
3366
|
alignItems: "center"
|
|
3366
3367
|
}, M = () => {
|
|
3367
|
-
const
|
|
3368
|
+
const R = {
|
|
3368
3369
|
width: "100%",
|
|
3369
3370
|
height: k.height,
|
|
3370
3371
|
fontSize: k.fontSize,
|
|
@@ -3379,7 +3380,7 @@ const Kr = {
|
|
|
3379
3380
|
cursor: c ? "not-allowed" : "pointer"
|
|
3380
3381
|
};
|
|
3381
3382
|
return t === "flushed" ? {
|
|
3382
|
-
...
|
|
3383
|
+
...R,
|
|
3383
3384
|
border: "none",
|
|
3384
3385
|
borderBottom: `2px solid ${C ? "var(--brycks-error-default)" : p ? "var(--brycks-primary-default)" : "var(--brycks-border-default)"}`,
|
|
3385
3386
|
borderRadius: 0,
|
|
@@ -3387,7 +3388,7 @@ const Kr = {
|
|
|
3387
3388
|
paddingRight: 0,
|
|
3388
3389
|
backgroundColor: "transparent"
|
|
3389
3390
|
} : {
|
|
3390
|
-
...
|
|
3391
|
+
...R,
|
|
3391
3392
|
border: `1px solid ${C ? "var(--brycks-error-default)" : p ? "var(--brycks-primary-default)" : v ? "var(--brycks-border-strong)" : "var(--brycks-border-default)"}`,
|
|
3392
3393
|
borderRadius: "var(--brycks-radius-md)",
|
|
3393
3394
|
boxShadow: p && !C ? "0 0 0 3px var(--brycks-primary-100)" : p && C ? "0 0 0 3px var(--brycks-error-100)" : void 0
|
|
@@ -3410,7 +3411,7 @@ const Kr = {
|
|
|
3410
3411
|
"div",
|
|
3411
3412
|
{
|
|
3412
3413
|
className: S("brycks-date-input", `brycks-date-input--${e}`, `brycks-date-input--${t}`, y),
|
|
3413
|
-
style:
|
|
3414
|
+
style: I,
|
|
3414
3415
|
children: [
|
|
3415
3416
|
n && /* @__PURE__ */ s("label", { style: h, children: n }),
|
|
3416
3417
|
/* @__PURE__ */ w(
|
|
@@ -3469,34 +3470,34 @@ const Zr = z(function({
|
|
|
3469
3470
|
testId: p,
|
|
3470
3471
|
...b
|
|
3471
3472
|
}, v) {
|
|
3472
|
-
const [x, k] =
|
|
3473
|
+
const [x, k] = A(!1), [C, I] = A(!1), h = Z(null), D = qr[e], M = c || !!d, N = E(
|
|
3473
3474
|
(X) => {
|
|
3474
3475
|
if (!X || X.length === 0) return;
|
|
3475
|
-
let
|
|
3476
|
-
a && (
|
|
3476
|
+
let Q = Array.from(X);
|
|
3477
|
+
a && (Q = Q.filter((ue) => ue.size <= a)), !n && Q.length > 1 && (Q = [Q[0]]), y == null || y(Q);
|
|
3477
3478
|
},
|
|
3478
3479
|
[a, n, y]
|
|
3479
|
-
), $ =
|
|
3480
|
+
), $ = E((X) => {
|
|
3480
3481
|
X.preventDefault(), X.stopPropagation(), g || k(!0);
|
|
3481
|
-
}, [g]),
|
|
3482
|
+
}, [g]), R = E((X) => {
|
|
3482
3483
|
X.preventDefault(), X.stopPropagation(), k(!1);
|
|
3483
|
-
}, []),
|
|
3484
|
+
}, []), H = E(
|
|
3484
3485
|
(X) => {
|
|
3485
3486
|
X.preventDefault(), X.stopPropagation(), k(!1), g || N(X.dataTransfer.files);
|
|
3486
3487
|
},
|
|
3487
3488
|
[g, N]
|
|
3488
|
-
),
|
|
3489
|
+
), T = E(
|
|
3489
3490
|
(X) => {
|
|
3490
3491
|
N(X.target.files), h.current && (h.current.value = "");
|
|
3491
3492
|
},
|
|
3492
3493
|
[N]
|
|
3493
|
-
),
|
|
3494
|
+
), F = E(() => {
|
|
3494
3495
|
var X;
|
|
3495
3496
|
g || (X = h.current) == null || X.click();
|
|
3496
|
-
}, [g]), V =
|
|
3497
|
+
}, [g]), V = E(
|
|
3497
3498
|
(X) => {
|
|
3498
|
-
var
|
|
3499
|
-
(X.key === "Enter" || X.key === " ") && !g && (X.preventDefault(), (
|
|
3499
|
+
var Q;
|
|
3500
|
+
(X.key === "Enter" || X.key === " ") && !g && (X.preventDefault(), (Q = h.current) == null || Q.click());
|
|
3500
3501
|
},
|
|
3501
3502
|
[g]
|
|
3502
3503
|
), W = {
|
|
@@ -3504,7 +3505,7 @@ const Zr = z(function({
|
|
|
3504
3505
|
flexDirection: "column",
|
|
3505
3506
|
gap: 6,
|
|
3506
3507
|
...f
|
|
3507
|
-
},
|
|
3508
|
+
}, B = {
|
|
3508
3509
|
fontSize: D.fontSize,
|
|
3509
3510
|
fontWeight: 500,
|
|
3510
3511
|
color: "var(--brycks-foreground-default)"
|
|
@@ -3542,7 +3543,7 @@ const Zr = z(function({
|
|
|
3542
3543
|
}, _ = {
|
|
3543
3544
|
color: "var(--brycks-primary-default)",
|
|
3544
3545
|
fontWeight: 500
|
|
3545
|
-
},
|
|
3546
|
+
}, K = {
|
|
3546
3547
|
fontSize: D.fontSize - 2,
|
|
3547
3548
|
color: "var(--brycks-error-default)"
|
|
3548
3549
|
}, ie = n ? "Drag files here or click to browse" : "Drag a file here or click to browse";
|
|
@@ -3552,18 +3553,18 @@ const Zr = z(function({
|
|
|
3552
3553
|
className: S("brycks-file-input", `brycks-file-input--${e}`, `brycks-file-input--${t}`, u),
|
|
3553
3554
|
style: W,
|
|
3554
3555
|
children: [
|
|
3555
|
-
l && /* @__PURE__ */ s("label", { style:
|
|
3556
|
+
l && /* @__PURE__ */ s("label", { style: B, children: l }),
|
|
3556
3557
|
/* @__PURE__ */ w(
|
|
3557
3558
|
"div",
|
|
3558
3559
|
{
|
|
3559
3560
|
style: O,
|
|
3560
3561
|
onDragOver: $,
|
|
3561
|
-
onDragLeave:
|
|
3562
|
-
onDrop:
|
|
3563
|
-
onClick:
|
|
3562
|
+
onDragLeave: R,
|
|
3563
|
+
onDrop: H,
|
|
3564
|
+
onClick: F,
|
|
3564
3565
|
onKeyDown: V,
|
|
3565
|
-
onFocus: () =>
|
|
3566
|
-
onBlur: () =>
|
|
3566
|
+
onFocus: () => I(!0),
|
|
3567
|
+
onBlur: () => I(!1),
|
|
3567
3568
|
tabIndex: g ? -1 : 0,
|
|
3568
3569
|
role: "button",
|
|
3569
3570
|
"aria-label": String(i) || ie,
|
|
@@ -3579,7 +3580,7 @@ const Zr = z(function({
|
|
|
3579
3580
|
]
|
|
3580
3581
|
}
|
|
3581
3582
|
),
|
|
3582
|
-
d && /* @__PURE__ */ s("span", { style:
|
|
3583
|
+
d && /* @__PURE__ */ s("span", { style: K, children: d }),
|
|
3583
3584
|
/* @__PURE__ */ s(
|
|
3584
3585
|
"input",
|
|
3585
3586
|
{
|
|
@@ -3590,7 +3591,7 @@ const Zr = z(function({
|
|
|
3590
3591
|
accept: o,
|
|
3591
3592
|
multiple: n,
|
|
3592
3593
|
disabled: g,
|
|
3593
|
-
onChange:
|
|
3594
|
+
onChange: T,
|
|
3594
3595
|
style: { display: "none" },
|
|
3595
3596
|
"data-testid": p,
|
|
3596
3597
|
...b
|
|
@@ -3606,14 +3607,14 @@ function Ie(r) {
|
|
|
3606
3607
|
return `${r}-${++Qr}`;
|
|
3607
3608
|
}
|
|
3608
3609
|
function Jr(r = "brycks") {
|
|
3609
|
-
const [e, t] =
|
|
3610
|
-
return
|
|
3610
|
+
const [e, t] = A("");
|
|
3611
|
+
return Y(() => {
|
|
3611
3612
|
t(Ie(r));
|
|
3612
3613
|
}, [r]), e || Ie(r);
|
|
3613
3614
|
}
|
|
3614
3615
|
function Aa(r, e = "brycks") {
|
|
3615
|
-
const [t, o] =
|
|
3616
|
-
return
|
|
3616
|
+
const [t, o] = A([]);
|
|
3617
|
+
return Y(() => {
|
|
3617
3618
|
o(Array.from({ length: r }, () => Ie(e)));
|
|
3618
3619
|
}, [r, e]), t.length ? t : Array.from({ length: r }, () => Ie(e));
|
|
3619
3620
|
}
|
|
@@ -3638,10 +3639,10 @@ const eo = {
|
|
|
3638
3639
|
testId: f,
|
|
3639
3640
|
...p
|
|
3640
3641
|
}, b) {
|
|
3641
|
-
const v = Jr("field"), x = d || v, k = `${x}-helper`, C = `${x}-error`,
|
|
3642
|
+
const v = Jr("field"), x = d || v, k = `${x}-helper`, C = `${x}-error`, I = eo[e], h = l || !!a, D = {
|
|
3642
3643
|
display: "flex",
|
|
3643
3644
|
flexDirection: c === "horizontal" ? "row" : "column",
|
|
3644
|
-
gap: c === "horizontal" ? 16 :
|
|
3645
|
+
gap: c === "horizontal" ? 16 : I.gap,
|
|
3645
3646
|
alignItems: c === "horizontal" ? "flex-start" : "stretch",
|
|
3646
3647
|
opacity: i ? 0.6 : 1,
|
|
3647
3648
|
...g
|
|
@@ -3655,23 +3656,23 @@ const eo = {
|
|
|
3655
3656
|
paddingTop: e === "lg" ? 14 : e === "md" ? 10 : 8
|
|
3656
3657
|
}
|
|
3657
3658
|
}, N = {
|
|
3658
|
-
fontSize:
|
|
3659
|
+
fontSize: I.labelSize,
|
|
3659
3660
|
fontWeight: 500,
|
|
3660
3661
|
color: i ? "var(--brycks-foreground-muted)" : "var(--brycks-foreground-default)",
|
|
3661
3662
|
lineHeight: 1.4
|
|
3662
3663
|
}, $ = {
|
|
3663
3664
|
color: "var(--brycks-error-default)",
|
|
3664
3665
|
marginLeft: 2
|
|
3665
|
-
},
|
|
3666
|
+
}, R = {
|
|
3666
3667
|
display: "flex",
|
|
3667
3668
|
flexDirection: "column",
|
|
3668
|
-
gap:
|
|
3669
|
+
gap: I.gap,
|
|
3669
3670
|
flex: 1
|
|
3670
|
-
},
|
|
3671
|
-
fontSize:
|
|
3671
|
+
}, H = {
|
|
3672
|
+
fontSize: I.helperSize,
|
|
3672
3673
|
color: h ? "var(--brycks-error-default)" : "var(--brycks-foreground-muted)",
|
|
3673
3674
|
lineHeight: 1.4
|
|
3674
|
-
},
|
|
3675
|
+
}, T = {
|
|
3675
3676
|
id: x,
|
|
3676
3677
|
"aria-describedby": n || a ? a ? C : k : void 0,
|
|
3677
3678
|
"aria-invalid": h ? !0 : void 0
|
|
@@ -3689,13 +3690,13 @@ const eo = {
|
|
|
3689
3690
|
t,
|
|
3690
3691
|
o && /* @__PURE__ */ s("span", { style: $, "aria-hidden": "true", children: "*" })
|
|
3691
3692
|
] }) }),
|
|
3692
|
-
/* @__PURE__ */ w("div", { style:
|
|
3693
|
-
typeof u == "function" ? u(
|
|
3693
|
+
/* @__PURE__ */ w("div", { style: R, children: [
|
|
3694
|
+
typeof u == "function" ? u(T) : u,
|
|
3694
3695
|
(n || a) && /* @__PURE__ */ s(
|
|
3695
3696
|
"span",
|
|
3696
3697
|
{
|
|
3697
3698
|
id: a ? C : k,
|
|
3698
|
-
style:
|
|
3699
|
+
style: H,
|
|
3699
3700
|
role: a ? "alert" : void 0,
|
|
3700
3701
|
children: a || n
|
|
3701
3702
|
}
|
|
@@ -3927,7 +3928,7 @@ const lo = {
|
|
|
3927
3928
|
}, C = {
|
|
3928
3929
|
...k,
|
|
3929
3930
|
color: "var(--brycks-error-default)"
|
|
3930
|
-
},
|
|
3931
|
+
}, I = {
|
|
3931
3932
|
...k,
|
|
3932
3933
|
color: "var(--brycks-foreground-muted)"
|
|
3933
3934
|
};
|
|
@@ -3958,7 +3959,7 @@ const lo = {
|
|
|
3958
3959
|
),
|
|
3959
3960
|
y,
|
|
3960
3961
|
i && /* @__PURE__ */ s("span", { className: "brycks-form-group__error", style: C, role: "alert", children: i }),
|
|
3961
|
-
!i && d && /* @__PURE__ */ s("span", { className: "brycks-form-group__helper", style:
|
|
3962
|
+
!i && d && /* @__PURE__ */ s("span", { className: "brycks-form-group__helper", style: I, children: d })
|
|
3962
3963
|
]
|
|
3963
3964
|
}
|
|
3964
3965
|
);
|
|
@@ -3978,42 +3979,42 @@ const uo = z(
|
|
|
3978
3979
|
className: y,
|
|
3979
3980
|
testId: m
|
|
3980
3981
|
}, g) {
|
|
3981
|
-
const [u, f] =
|
|
3982
|
-
(
|
|
3983
|
-
|
|
3982
|
+
const [u, f] = A(!1), p = Z(null), b = E(
|
|
3983
|
+
(T) => {
|
|
3984
|
+
T.preventDefault(), T.stopPropagation(), a || f(!0);
|
|
3984
3985
|
},
|
|
3985
3986
|
[a]
|
|
3986
|
-
), v =
|
|
3987
|
-
|
|
3988
|
-
}, []), x =
|
|
3989
|
-
(
|
|
3990
|
-
|
|
3987
|
+
), v = E((T) => {
|
|
3988
|
+
T.preventDefault(), T.stopPropagation(), f(!1);
|
|
3989
|
+
}, []), x = E(
|
|
3990
|
+
(T) => {
|
|
3991
|
+
T.preventDefault(), T.stopPropagation(), a || f(!0);
|
|
3991
3992
|
},
|
|
3992
3993
|
[a]
|
|
3993
|
-
), k =
|
|
3994
|
-
(
|
|
3995
|
-
if (!
|
|
3996
|
-
let
|
|
3997
|
-
n && (
|
|
3994
|
+
), k = E(
|
|
3995
|
+
(T) => {
|
|
3996
|
+
if (!T || T.length === 0) return;
|
|
3997
|
+
let F = Array.from(T);
|
|
3998
|
+
n && (F = F.filter((V) => V.size <= n)), !o && F.length > 1 && (F = [F[0]]), e == null || e(F);
|
|
3998
3999
|
},
|
|
3999
4000
|
[n, o, e]
|
|
4000
|
-
), C =
|
|
4001
|
-
(
|
|
4002
|
-
|
|
4001
|
+
), C = E(
|
|
4002
|
+
(T) => {
|
|
4003
|
+
T.preventDefault(), T.stopPropagation(), f(!1), !a && k(T.dataTransfer.files);
|
|
4003
4004
|
},
|
|
4004
4005
|
[a, k]
|
|
4005
|
-
),
|
|
4006
|
-
var
|
|
4007
|
-
a || (
|
|
4008
|
-
}, [a]), h =
|
|
4009
|
-
(
|
|
4010
|
-
k(
|
|
4006
|
+
), I = E(() => {
|
|
4007
|
+
var T;
|
|
4008
|
+
a || (T = p.current) == null || T.click();
|
|
4009
|
+
}, [a]), h = E(
|
|
4010
|
+
(T) => {
|
|
4011
|
+
k(T.target.files), p.current && (p.current.value = "");
|
|
4011
4012
|
},
|
|
4012
4013
|
[k]
|
|
4013
|
-
), D =
|
|
4014
|
-
(
|
|
4015
|
-
var
|
|
4016
|
-
(
|
|
4014
|
+
), D = E(
|
|
4015
|
+
(T) => {
|
|
4016
|
+
var F;
|
|
4017
|
+
(T.key === "Enter" || T.key === " ") && !a && (T.preventDefault(), (F = p.current) == null || F.click());
|
|
4017
4018
|
},
|
|
4018
4019
|
[a]
|
|
4019
4020
|
), M = {
|
|
@@ -4036,11 +4037,11 @@ const uo = z(
|
|
|
4036
4037
|
fontWeight: 500,
|
|
4037
4038
|
color: "var(--brycks-foreground-default)",
|
|
4038
4039
|
marginBottom: d ? 4 : 0
|
|
4039
|
-
},
|
|
4040
|
+
}, R = {
|
|
4040
4041
|
fontFamily: "var(--brycks-font-sans)",
|
|
4041
4042
|
fontSize: "var(--brycks-font-size-xs)",
|
|
4042
4043
|
color: "var(--brycks-foreground-muted)"
|
|
4043
|
-
},
|
|
4044
|
+
}, H = {
|
|
4044
4045
|
fontFamily: "var(--brycks-font-sans)",
|
|
4045
4046
|
fontSize: "var(--brycks-font-size-xs)",
|
|
4046
4047
|
color: "var(--brycks-error-default)",
|
|
@@ -4058,7 +4059,7 @@ const uo = z(
|
|
|
4058
4059
|
y
|
|
4059
4060
|
),
|
|
4060
4061
|
style: M,
|
|
4061
|
-
onClick:
|
|
4062
|
+
onClick: I,
|
|
4062
4063
|
onDragEnter: b,
|
|
4063
4064
|
onDragLeave: v,
|
|
4064
4065
|
onDragOver: x,
|
|
@@ -4083,8 +4084,8 @@ const uo = z(
|
|
|
4083
4084
|
),
|
|
4084
4085
|
i && /* @__PURE__ */ s("div", { style: N, children: i }),
|
|
4085
4086
|
l && /* @__PURE__ */ s("div", { style: $, children: l }),
|
|
4086
|
-
d && /* @__PURE__ */ s("div", { style:
|
|
4087
|
-
c && /* @__PURE__ */ s("div", { style:
|
|
4087
|
+
d && /* @__PURE__ */ s("div", { style: R, children: d }),
|
|
4088
|
+
c && /* @__PURE__ */ s("div", { style: H, children: c })
|
|
4088
4089
|
]
|
|
4089
4090
|
}
|
|
4090
4091
|
);
|
|
@@ -4208,37 +4209,38 @@ const go = z(function({
|
|
|
4208
4209
|
children: g,
|
|
4209
4210
|
...u
|
|
4210
4211
|
}, f) {
|
|
4211
|
-
const p =
|
|
4212
|
-
|
|
4212
|
+
const p = Z(null), b = Z(null), v = Z(!1);
|
|
4213
|
+
Y(() => {
|
|
4214
|
+
var H;
|
|
4215
|
+
e && !v.current ? (b.current = document.activeElement, v.current = !0) : !e && v.current && (document.activeElement instanceof HTMLElement && document.activeElement.blur(), (H = b.current) == null || H.focus(), b.current = null, v.current = !1);
|
|
4216
|
+
}, [e]), Y(() => {
|
|
4213
4217
|
if (!e) return;
|
|
4214
|
-
b.current = document.activeElement;
|
|
4215
4218
|
const H = p.current;
|
|
4216
4219
|
H && H.focus();
|
|
4217
|
-
const
|
|
4218
|
-
if (
|
|
4220
|
+
const T = (F) => {
|
|
4221
|
+
if (F.key === "Escape" && i) {
|
|
4219
4222
|
t();
|
|
4220
4223
|
return;
|
|
4221
4224
|
}
|
|
4222
|
-
if (
|
|
4223
|
-
const
|
|
4225
|
+
if (F.key === "Tab" && H) {
|
|
4226
|
+
const V = H.querySelectorAll(
|
|
4224
4227
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
4225
|
-
),
|
|
4226
|
-
|
|
4228
|
+
), W = V[0], B = V[V.length - 1];
|
|
4229
|
+
F.shiftKey && document.activeElement === W ? (F.preventDefault(), B == null || B.focus()) : !F.shiftKey && document.activeElement === B && (F.preventDefault(), W == null || W.focus());
|
|
4227
4230
|
}
|
|
4228
4231
|
};
|
|
4229
|
-
return document.addEventListener("keydown",
|
|
4230
|
-
|
|
4231
|
-
document.removeEventListener("keydown", F), document.body.style.overflow = "", (I = b.current) == null || I.focus();
|
|
4232
|
+
return document.addEventListener("keydown", T), document.body.style.overflow = "hidden", () => {
|
|
4233
|
+
document.removeEventListener("keydown", T), document.body.style.overflow = "";
|
|
4232
4234
|
};
|
|
4233
4235
|
}, [e, i, t]);
|
|
4234
|
-
const
|
|
4236
|
+
const x = E(
|
|
4235
4237
|
(H) => {
|
|
4236
4238
|
H.target === H.currentTarget && l && t();
|
|
4237
4239
|
},
|
|
4238
4240
|
[l, t]
|
|
4239
4241
|
);
|
|
4240
4242
|
if (!e) return null;
|
|
4241
|
-
const
|
|
4243
|
+
const k = {
|
|
4242
4244
|
position: "fixed",
|
|
4243
4245
|
inset: 0,
|
|
4244
4246
|
zIndex: "var(--brycks-z-modal)",
|
|
@@ -4249,7 +4251,7 @@ const go = z(function({
|
|
|
4249
4251
|
backgroundColor: "var(--brycks-background-overlay)",
|
|
4250
4252
|
backdropFilter: "blur(4px)",
|
|
4251
4253
|
animation: "brycks-fade-in 200ms ease-out"
|
|
4252
|
-
},
|
|
4254
|
+
}, C = {
|
|
4253
4255
|
position: "relative",
|
|
4254
4256
|
width: "100%",
|
|
4255
4257
|
maxWidth: mo[o],
|
|
@@ -4263,27 +4265,27 @@ const go = z(function({
|
|
|
4263
4265
|
animation: "brycks-scale-in 200ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
4264
4266
|
outline: "none",
|
|
4265
4267
|
...y
|
|
4266
|
-
},
|
|
4268
|
+
}, I = {
|
|
4267
4269
|
display: "flex",
|
|
4268
4270
|
alignItems: "flex-start",
|
|
4269
4271
|
justifyContent: "space-between",
|
|
4270
4272
|
padding: "20px 24px",
|
|
4271
4273
|
borderBottom: "1px solid var(--brycks-border-muted)"
|
|
4272
|
-
},
|
|
4274
|
+
}, h = {
|
|
4273
4275
|
display: "flex",
|
|
4274
4276
|
flexDirection: "column",
|
|
4275
4277
|
gap: 4
|
|
4276
|
-
},
|
|
4278
|
+
}, D = {
|
|
4277
4279
|
fontSize: 18,
|
|
4278
4280
|
fontWeight: 600,
|
|
4279
4281
|
color: "var(--brycks-foreground-default)",
|
|
4280
4282
|
margin: 0,
|
|
4281
4283
|
lineHeight: 1.3
|
|
4282
|
-
},
|
|
4284
|
+
}, M = {
|
|
4283
4285
|
fontSize: 14,
|
|
4284
4286
|
color: "var(--brycks-foreground-muted)",
|
|
4285
4287
|
margin: 0
|
|
4286
|
-
},
|
|
4288
|
+
}, N = {
|
|
4287
4289
|
display: "flex",
|
|
4288
4290
|
alignItems: "center",
|
|
4289
4291
|
justifyContent: "center",
|
|
@@ -4294,11 +4296,11 @@ const go = z(function({
|
|
|
4294
4296
|
transition: "all 150ms ease-out",
|
|
4295
4297
|
marginLeft: 12,
|
|
4296
4298
|
flexShrink: 0
|
|
4297
|
-
},
|
|
4299
|
+
}, $ = {
|
|
4298
4300
|
flex: 1,
|
|
4299
4301
|
overflow: "auto",
|
|
4300
4302
|
padding: 24
|
|
4301
|
-
},
|
|
4303
|
+
}, R = /* @__PURE__ */ w(ne, { children: [
|
|
4302
4304
|
/* @__PURE__ */ s("style", { children: `
|
|
4303
4305
|
@keyframes brycks-fade-in {
|
|
4304
4306
|
from { opacity: 0; }
|
|
@@ -4313,9 +4315,8 @@ const go = z(function({
|
|
|
4313
4315
|
"div",
|
|
4314
4316
|
{
|
|
4315
4317
|
className: "brycks-modal-overlay",
|
|
4316
|
-
style:
|
|
4317
|
-
onClick:
|
|
4318
|
-
"aria-hidden": "true",
|
|
4318
|
+
style: k,
|
|
4319
|
+
onClick: x,
|
|
4319
4320
|
children: /* @__PURE__ */ w(
|
|
4320
4321
|
"div",
|
|
4321
4322
|
{
|
|
@@ -4327,22 +4328,22 @@ const go = z(function({
|
|
|
4327
4328
|
"aria-labelledby": n ? "brycks-modal-title" : void 0,
|
|
4328
4329
|
"aria-describedby": a ? "brycks-modal-description" : void 0,
|
|
4329
4330
|
className: S("brycks-modal", `brycks-modal--${o}`, c),
|
|
4330
|
-
style:
|
|
4331
|
+
style: C,
|
|
4331
4332
|
tabIndex: -1,
|
|
4332
4333
|
"data-testid": m,
|
|
4333
4334
|
...u,
|
|
4334
4335
|
children: [
|
|
4335
|
-
(n || d) && /* @__PURE__ */ w("div", { className: "brycks-modal-header", style:
|
|
4336
|
-
/* @__PURE__ */ w("div", { style:
|
|
4337
|
-
n && /* @__PURE__ */ s("h2", { id: "brycks-modal-title", style:
|
|
4338
|
-
a && /* @__PURE__ */ s("p", { id: "brycks-modal-description", style:
|
|
4336
|
+
(n || d) && /* @__PURE__ */ w("div", { className: "brycks-modal-header", style: I, children: [
|
|
4337
|
+
/* @__PURE__ */ w("div", { style: h, children: [
|
|
4338
|
+
n && /* @__PURE__ */ s("h2", { id: "brycks-modal-title", style: D, children: n }),
|
|
4339
|
+
a && /* @__PURE__ */ s("p", { id: "brycks-modal-description", style: M, children: a })
|
|
4339
4340
|
] }),
|
|
4340
4341
|
d && /* @__PURE__ */ s(
|
|
4341
4342
|
"button",
|
|
4342
4343
|
{
|
|
4343
4344
|
type: "button",
|
|
4344
4345
|
className: "brycks-modal-close",
|
|
4345
|
-
style:
|
|
4346
|
+
style: N,
|
|
4346
4347
|
onClick: t,
|
|
4347
4348
|
"aria-label": "Close modal",
|
|
4348
4349
|
onMouseEnter: (H) => {
|
|
@@ -4355,14 +4356,14 @@ const go = z(function({
|
|
|
4355
4356
|
}
|
|
4356
4357
|
)
|
|
4357
4358
|
] }),
|
|
4358
|
-
/* @__PURE__ */ s("div", { className: "brycks-modal-content", style:
|
|
4359
|
+
/* @__PURE__ */ s("div", { className: "brycks-modal-content", style: $, children: g })
|
|
4359
4360
|
]
|
|
4360
4361
|
}
|
|
4361
4362
|
)
|
|
4362
4363
|
}
|
|
4363
4364
|
)
|
|
4364
4365
|
] });
|
|
4365
|
-
return ve(
|
|
4366
|
+
return ve(R, document.body);
|
|
4366
4367
|
});
|
|
4367
4368
|
go.displayName = "Modal";
|
|
4368
4369
|
const po = {
|
|
@@ -4497,7 +4498,7 @@ const po = {
|
|
|
4497
4498
|
fontWeight: 600,
|
|
4498
4499
|
marginBottom: g ? 4 : 0,
|
|
4499
4500
|
color: b.color
|
|
4500
|
-
},
|
|
4501
|
+
}, I = {
|
|
4501
4502
|
fontSize: 14,
|
|
4502
4503
|
lineHeight: 1.5,
|
|
4503
4504
|
color: t === "solid" ? b.color : "var(--brycks-foreground-muted)"
|
|
@@ -4535,7 +4536,7 @@ const po = {
|
|
|
4535
4536
|
a && /* @__PURE__ */ s("span", { className: "brycks-alert-icon", style: x, children: n ?? p.icon }),
|
|
4536
4537
|
/* @__PURE__ */ w("div", { className: "brycks-alert-content", style: k, children: [
|
|
4537
4538
|
o && /* @__PURE__ */ s("div", { className: "brycks-alert-title", style: C, children: o }),
|
|
4538
|
-
g && /* @__PURE__ */ s("div", { className: "brycks-alert-description", style:
|
|
4539
|
+
g && /* @__PURE__ */ s("div", { className: "brycks-alert-description", style: I, children: g })
|
|
4539
4540
|
] }),
|
|
4540
4541
|
(l || i) && /* @__PURE__ */ w("div", { className: "brycks-alert-actions", style: h, children: [
|
|
4541
4542
|
l,
|
|
@@ -4572,38 +4573,38 @@ const ko = z(function({
|
|
|
4572
4573
|
children: i,
|
|
4573
4574
|
...d
|
|
4574
4575
|
}, c) {
|
|
4575
|
-
const [y, m] =
|
|
4576
|
+
const [y, m] = A(!1), [g, u] = A({ top: 0, left: 0 }), f = Z(null), p = Z(null), b = Z(null), v = Te(), x = We(), k = E(() => {
|
|
4576
4577
|
if (!f.current || !p.current) return;
|
|
4577
|
-
const N = f.current.getBoundingClientRect(), $ = p.current.getBoundingClientRect(),
|
|
4578
|
-
let
|
|
4578
|
+
const N = f.current.getBoundingClientRect(), $ = p.current.getBoundingClientRect(), R = 8;
|
|
4579
|
+
let H = 0, T = 0;
|
|
4579
4580
|
switch (t) {
|
|
4580
4581
|
case "top":
|
|
4581
|
-
|
|
4582
|
+
H = N.top - $.height - R, T = N.left + (N.width - $.width) / 2;
|
|
4582
4583
|
break;
|
|
4583
4584
|
case "bottom":
|
|
4584
|
-
|
|
4585
|
+
H = N.bottom + R, T = N.left + (N.width - $.width) / 2;
|
|
4585
4586
|
break;
|
|
4586
4587
|
case "left":
|
|
4587
|
-
|
|
4588
|
+
H = N.top + (N.height - $.height) / 2, T = N.left - $.width - R;
|
|
4588
4589
|
break;
|
|
4589
4590
|
case "right":
|
|
4590
|
-
|
|
4591
|
+
H = N.top + (N.height - $.height) / 2, T = N.right + R;
|
|
4591
4592
|
break;
|
|
4592
4593
|
}
|
|
4593
|
-
const
|
|
4594
|
-
|
|
4594
|
+
const F = 8;
|
|
4595
|
+
T = Math.max(F, Math.min(T, window.innerWidth - $.width - F)), H = Math.max(F, Math.min(H, window.innerHeight - $.height - F)), u({ top: H, left: T });
|
|
4595
4596
|
}, [t]);
|
|
4596
|
-
|
|
4597
|
+
Y(() => (y && (k(), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k)), () => {
|
|
4597
4598
|
window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
|
|
4598
4599
|
}), [y, k]);
|
|
4599
4600
|
const C = () => {
|
|
4600
4601
|
n || (b.current = setTimeout(() => {
|
|
4601
4602
|
m(!0);
|
|
4602
4603
|
}, o));
|
|
4603
|
-
},
|
|
4604
|
+
}, I = () => {
|
|
4604
4605
|
b.current && clearTimeout(b.current), m(!1);
|
|
4605
4606
|
};
|
|
4606
|
-
|
|
4607
|
+
Y(() => () => {
|
|
4607
4608
|
b.current && clearTimeout(b.current);
|
|
4608
4609
|
}, []);
|
|
4609
4610
|
const h = {
|
|
@@ -4642,9 +4643,9 @@ const ko = z(function({
|
|
|
4642
4643
|
ref: f,
|
|
4643
4644
|
style: h,
|
|
4644
4645
|
onMouseEnter: C,
|
|
4645
|
-
onMouseLeave:
|
|
4646
|
+
onMouseLeave: I,
|
|
4646
4647
|
onFocus: C,
|
|
4647
|
-
onBlur:
|
|
4648
|
+
onBlur: I,
|
|
4648
4649
|
"aria-describedby": y ? v : void 0,
|
|
4649
4650
|
children: i
|
|
4650
4651
|
}
|
|
@@ -4729,8 +4730,8 @@ const Ge = z(function({
|
|
|
4729
4730
|
testId: g,
|
|
4730
4731
|
...u
|
|
4731
4732
|
}, f) {
|
|
4732
|
-
const [p, b] =
|
|
4733
|
-
if (
|
|
4733
|
+
const [p, b] = A(n), [v, x] = A(!1);
|
|
4734
|
+
if (Y(() => {
|
|
4734
4735
|
if (n)
|
|
4735
4736
|
b(!0), x(!1);
|
|
4736
4737
|
else {
|
|
@@ -4738,7 +4739,7 @@ const Ge = z(function({
|
|
|
4738
4739
|
const $ = setTimeout(() => b(!1), 200);
|
|
4739
4740
|
return () => clearTimeout($);
|
|
4740
4741
|
}
|
|
4741
|
-
}, [n]),
|
|
4742
|
+
}, [n]), Y(() => {
|
|
4742
4743
|
if (!n || a === 0) return;
|
|
4743
4744
|
const $ = setTimeout(() => {
|
|
4744
4745
|
l == null || l();
|
|
@@ -4757,7 +4758,7 @@ const Ge = z(function({
|
|
|
4757
4758
|
maxWidth: 400,
|
|
4758
4759
|
animation: v ? "brycks-toast-out 200ms ease-in forwards" : "brycks-toast-in 200ms ease-out",
|
|
4759
4760
|
...m
|
|
4760
|
-
},
|
|
4761
|
+
}, I = {
|
|
4761
4762
|
color: k.icon,
|
|
4762
4763
|
flexShrink: 0,
|
|
4763
4764
|
marginTop: 2
|
|
@@ -4809,7 +4810,7 @@ const Ge = z(function({
|
|
|
4809
4810
|
"data-testid": g,
|
|
4810
4811
|
...u,
|
|
4811
4812
|
children: [
|
|
4812
|
-
/* @__PURE__ */ s("span", { style:
|
|
4813
|
+
/* @__PURE__ */ s("span", { style: I, children: c || /* @__PURE__ */ s(xo, { intent: e }) }),
|
|
4813
4814
|
/* @__PURE__ */ w("div", { style: h, children: [
|
|
4814
4815
|
t && /* @__PURE__ */ s("span", { style: D, children: t }),
|
|
4815
4816
|
o && /* @__PURE__ */ s("span", { style: M, children: o }),
|
|
@@ -4858,11 +4859,11 @@ function Va({
|
|
|
4858
4859
|
position: e = "top-right",
|
|
4859
4860
|
maxToasts: t = 5
|
|
4860
4861
|
}) {
|
|
4861
|
-
const [o, n] =
|
|
4862
|
-
|
|
4862
|
+
const [o, n] = A([]), [a, l] = A(!1);
|
|
4863
|
+
Y(() => {
|
|
4863
4864
|
l(!0);
|
|
4864
4865
|
}, []);
|
|
4865
|
-
const i =
|
|
4866
|
+
const i = E(
|
|
4866
4867
|
(g) => {
|
|
4867
4868
|
const u = `toast-${++zo}`;
|
|
4868
4869
|
return n((f) => {
|
|
@@ -4871,9 +4872,9 @@ function Va({
|
|
|
4871
4872
|
}), u;
|
|
4872
4873
|
},
|
|
4873
4874
|
[t]
|
|
4874
|
-
), d =
|
|
4875
|
+
), d = E((g) => {
|
|
4875
4876
|
n((u) => u.filter((f) => f.id !== g));
|
|
4876
|
-
}, []), c =
|
|
4877
|
+
}, []), c = E(() => {
|
|
4877
4878
|
n([]);
|
|
4878
4879
|
}, []), y = {
|
|
4879
4880
|
position: "fixed",
|
|
@@ -4920,37 +4921,37 @@ const No = z(function({
|
|
|
4920
4921
|
testId: u,
|
|
4921
4922
|
...f
|
|
4922
4923
|
}, p) {
|
|
4923
|
-
const b =
|
|
4924
|
-
|
|
4924
|
+
const b = Z(null), v = Z(null);
|
|
4925
|
+
Y(() => {
|
|
4925
4926
|
if (!e) return;
|
|
4926
4927
|
v.current = document.activeElement;
|
|
4927
|
-
const
|
|
4928
|
-
|
|
4929
|
-
const
|
|
4928
|
+
const T = b.current;
|
|
4929
|
+
T && T.focus();
|
|
4930
|
+
const F = (V) => {
|
|
4930
4931
|
if (V.key === "Escape" && i) {
|
|
4931
4932
|
t();
|
|
4932
4933
|
return;
|
|
4933
4934
|
}
|
|
4934
|
-
if (V.key === "Tab" &&
|
|
4935
|
-
const W =
|
|
4935
|
+
if (V.key === "Tab" && T) {
|
|
4936
|
+
const W = T.querySelectorAll(
|
|
4936
4937
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
4937
|
-
),
|
|
4938
|
-
V.shiftKey && document.activeElement ===
|
|
4938
|
+
), B = W[0], O = W[W.length - 1];
|
|
4939
|
+
V.shiftKey && document.activeElement === B ? (V.preventDefault(), O == null || O.focus()) : !V.shiftKey && document.activeElement === O && (V.preventDefault(), B == null || B.focus());
|
|
4939
4940
|
}
|
|
4940
4941
|
};
|
|
4941
|
-
return document.addEventListener("keydown",
|
|
4942
|
+
return document.addEventListener("keydown", F), document.body.style.overflow = "hidden", () => {
|
|
4942
4943
|
var V;
|
|
4943
|
-
document.removeEventListener("keydown",
|
|
4944
|
+
document.removeEventListener("keydown", F), document.body.style.overflow = "", (V = v.current) == null || V.focus();
|
|
4944
4945
|
};
|
|
4945
4946
|
}, [e, i, t]);
|
|
4946
|
-
const x =
|
|
4947
|
-
(
|
|
4948
|
-
|
|
4947
|
+
const x = E(
|
|
4948
|
+
(T) => {
|
|
4949
|
+
T.target === T.currentTarget && l && t();
|
|
4949
4950
|
},
|
|
4950
4951
|
[l, t]
|
|
4951
4952
|
);
|
|
4952
4953
|
if (!e) return null;
|
|
4953
|
-
const k = o === "left" || o === "right", C = Co[n],
|
|
4954
|
+
const k = o === "left" || o === "right", C = Co[n], I = {
|
|
4954
4955
|
position: "fixed",
|
|
4955
4956
|
inset: 0,
|
|
4956
4957
|
zIndex: "var(--brycks-z-drawer)",
|
|
@@ -4959,7 +4960,7 @@ const No = z(function({
|
|
|
4959
4960
|
animation: "brycks-drawer-overlay-in 200ms ease-out"
|
|
4960
4961
|
}, D = {
|
|
4961
4962
|
...(() => {
|
|
4962
|
-
const
|
|
4963
|
+
const T = {
|
|
4963
4964
|
position: "absolute",
|
|
4964
4965
|
backgroundColor: "var(--brycks-background-elevated)",
|
|
4965
4966
|
boxShadow: "var(--brycks-shadow-2xl)",
|
|
@@ -4968,14 +4969,14 @@ const No = z(function({
|
|
|
4968
4969
|
overflow: "hidden"
|
|
4969
4970
|
};
|
|
4970
4971
|
return k ? {
|
|
4971
|
-
...
|
|
4972
|
+
...T,
|
|
4972
4973
|
top: 0,
|
|
4973
4974
|
bottom: 0,
|
|
4974
4975
|
[o]: 0,
|
|
4975
4976
|
width: C,
|
|
4976
4977
|
maxWidth: "100vw"
|
|
4977
4978
|
} : {
|
|
4978
|
-
...
|
|
4979
|
+
...T,
|
|
4979
4980
|
left: 0,
|
|
4980
4981
|
right: 0,
|
|
4981
4982
|
[o]: 0,
|
|
@@ -5007,11 +5008,11 @@ const No = z(function({
|
|
|
5007
5008
|
borderRadius: "var(--brycks-radius-md)",
|
|
5008
5009
|
color: "var(--brycks-foreground-muted)",
|
|
5009
5010
|
transition: "all 150ms ease-out"
|
|
5010
|
-
},
|
|
5011
|
+
}, R = {
|
|
5011
5012
|
flex: 1,
|
|
5012
5013
|
overflow: "auto",
|
|
5013
5014
|
padding: 20
|
|
5014
|
-
},
|
|
5015
|
+
}, H = /* @__PURE__ */ w(ne, { children: [
|
|
5015
5016
|
/* @__PURE__ */ s("style", { children: `
|
|
5016
5017
|
@keyframes brycks-drawer-overlay-in {
|
|
5017
5018
|
from { opacity: 0; }
|
|
@@ -5038,14 +5039,14 @@ const No = z(function({
|
|
|
5038
5039
|
"div",
|
|
5039
5040
|
{
|
|
5040
5041
|
className: "brycks-drawer-overlay",
|
|
5041
|
-
style:
|
|
5042
|
+
style: I,
|
|
5042
5043
|
onClick: x,
|
|
5043
5044
|
"aria-hidden": "true",
|
|
5044
5045
|
children: /* @__PURE__ */ w(
|
|
5045
5046
|
"div",
|
|
5046
5047
|
{
|
|
5047
|
-
ref: (
|
|
5048
|
-
b.current =
|
|
5048
|
+
ref: (T) => {
|
|
5049
|
+
b.current = T, typeof p == "function" ? p(T) : p && (p.current = T);
|
|
5049
5050
|
},
|
|
5050
5051
|
role: "dialog",
|
|
5051
5052
|
"aria-modal": "true",
|
|
@@ -5066,29 +5067,29 @@ const No = z(function({
|
|
|
5066
5067
|
style: $,
|
|
5067
5068
|
onClick: t,
|
|
5068
5069
|
"aria-label": "Close drawer",
|
|
5069
|
-
onMouseEnter: (
|
|
5070
|
-
|
|
5070
|
+
onMouseEnter: (T) => {
|
|
5071
|
+
T.currentTarget.style.backgroundColor = "var(--brycks-background-muted)", T.currentTarget.style.color = "var(--brycks-foreground-default)";
|
|
5071
5072
|
},
|
|
5072
|
-
onMouseLeave: (
|
|
5073
|
-
|
|
5073
|
+
onMouseLeave: (T) => {
|
|
5074
|
+
T.currentTarget.style.backgroundColor = "transparent", T.currentTarget.style.color = "var(--brycks-foreground-muted)";
|
|
5074
5075
|
},
|
|
5075
5076
|
children: /* @__PURE__ */ s(Mo, {})
|
|
5076
5077
|
}
|
|
5077
5078
|
)
|
|
5078
5079
|
] }),
|
|
5079
|
-
/* @__PURE__ */ s("div", { className: "brycks-drawer-content", style:
|
|
5080
|
+
/* @__PURE__ */ s("div", { className: "brycks-drawer-content", style: R, children: g })
|
|
5080
5081
|
]
|
|
5081
5082
|
}
|
|
5082
5083
|
)
|
|
5083
5084
|
}
|
|
5084
5085
|
)
|
|
5085
5086
|
] });
|
|
5086
|
-
return ve(
|
|
5087
|
+
return ve(H, document.body);
|
|
5087
5088
|
});
|
|
5088
5089
|
No.displayName = "Drawer";
|
|
5089
5090
|
function Io(r, e = {}) {
|
|
5090
|
-
const { enabled: t = !0, eventType: o = "mousedown" } = e, n =
|
|
5091
|
-
return
|
|
5091
|
+
const { enabled: t = !0, eventType: o = "mousedown" } = e, n = Z(null);
|
|
5092
|
+
return Y(() => {
|
|
5092
5093
|
if (!t) return;
|
|
5093
5094
|
const a = (l) => {
|
|
5094
5095
|
const i = n.current;
|
|
@@ -5117,102 +5118,102 @@ const To = z(function({
|
|
|
5117
5118
|
testId: p,
|
|
5118
5119
|
...b
|
|
5119
5120
|
}, v) {
|
|
5120
|
-
const [x, k] =
|
|
5121
|
-
(
|
|
5122
|
-
a === void 0 && k(
|
|
5121
|
+
const [x, k] = A(l), [C, I] = A({ top: 0, left: 0 }), [h, D] = A(!1), M = Z(null), N = Z(null), $ = Z(null), R = Z(null), H = Te(), T = We(), F = a ?? x, V = E(
|
|
5122
|
+
(K) => {
|
|
5123
|
+
a === void 0 && k(K), i == null || i(K);
|
|
5123
5124
|
},
|
|
5124
5125
|
[a, i]
|
|
5125
5126
|
), W = Io(() => {
|
|
5126
|
-
m && n === "click" &&
|
|
5127
|
-
}, { enabled:
|
|
5128
|
-
|
|
5129
|
-
if (!
|
|
5130
|
-
const
|
|
5127
|
+
m && n === "click" && F && V(!1);
|
|
5128
|
+
}, { enabled: F && n === "click" });
|
|
5129
|
+
Y(() => (D(!0), () => D(!1)), []), Y(() => {
|
|
5130
|
+
if (!F || !M.current || !h) return;
|
|
5131
|
+
const K = () => {
|
|
5131
5132
|
const ie = M.current, X = N.current;
|
|
5132
5133
|
if (!ie || !X) return;
|
|
5133
|
-
const
|
|
5134
|
+
const Q = ie.getBoundingClientRect(), ue = X.getBoundingClientRect(), we = window.scrollX, ze = window.scrollY;
|
|
5134
5135
|
let xe = 0, Se = 0;
|
|
5135
5136
|
switch (o) {
|
|
5136
5137
|
case "top":
|
|
5137
5138
|
case "top-start":
|
|
5138
5139
|
case "top-end":
|
|
5139
|
-
xe =
|
|
5140
|
+
xe = Q.top + ze - ue.height - d;
|
|
5140
5141
|
break;
|
|
5141
5142
|
case "bottom":
|
|
5142
5143
|
case "bottom-start":
|
|
5143
5144
|
case "bottom-end":
|
|
5144
|
-
xe =
|
|
5145
|
+
xe = Q.bottom + ze + d;
|
|
5145
5146
|
break;
|
|
5146
5147
|
case "left":
|
|
5147
5148
|
case "left-start":
|
|
5148
5149
|
case "left-end":
|
|
5149
|
-
Se =
|
|
5150
|
+
Se = Q.left + we - ue.width - d;
|
|
5150
5151
|
break;
|
|
5151
5152
|
case "right":
|
|
5152
5153
|
case "right-start":
|
|
5153
5154
|
case "right-end":
|
|
5154
|
-
Se =
|
|
5155
|
+
Se = Q.right + we + d;
|
|
5155
5156
|
break;
|
|
5156
5157
|
}
|
|
5157
5158
|
switch (o) {
|
|
5158
5159
|
case "top":
|
|
5159
5160
|
case "bottom":
|
|
5160
|
-
Se =
|
|
5161
|
+
Se = Q.left + we + (Q.width - ue.width) / 2;
|
|
5161
5162
|
break;
|
|
5162
5163
|
case "top-start":
|
|
5163
5164
|
case "bottom-start":
|
|
5164
|
-
Se =
|
|
5165
|
+
Se = Q.left + we;
|
|
5165
5166
|
break;
|
|
5166
5167
|
case "top-end":
|
|
5167
5168
|
case "bottom-end":
|
|
5168
|
-
Se =
|
|
5169
|
+
Se = Q.right + we - ue.width;
|
|
5169
5170
|
break;
|
|
5170
5171
|
case "left":
|
|
5171
5172
|
case "right":
|
|
5172
|
-
xe =
|
|
5173
|
+
xe = Q.top + ze + (Q.height - ue.height) / 2;
|
|
5173
5174
|
break;
|
|
5174
5175
|
case "left-start":
|
|
5175
5176
|
case "right-start":
|
|
5176
|
-
xe =
|
|
5177
|
+
xe = Q.top + ze;
|
|
5177
5178
|
break;
|
|
5178
5179
|
case "left-end":
|
|
5179
5180
|
case "right-end":
|
|
5180
|
-
xe =
|
|
5181
|
+
xe = Q.bottom + ze - ue.height;
|
|
5181
5182
|
break;
|
|
5182
5183
|
}
|
|
5183
|
-
|
|
5184
|
+
I({ top: xe, left: Se });
|
|
5184
5185
|
};
|
|
5185
|
-
return
|
|
5186
|
-
window.removeEventListener("resize",
|
|
5186
|
+
return K(), window.addEventListener("resize", K), window.addEventListener("scroll", K, !0), () => {
|
|
5187
|
+
window.removeEventListener("resize", K), window.removeEventListener("scroll", K, !0);
|
|
5187
5188
|
};
|
|
5188
|
-
}, [
|
|
5189
|
-
$.current && clearTimeout($.current),
|
|
5189
|
+
}, [F, o, d, h]), Y(() => () => {
|
|
5190
|
+
$.current && clearTimeout($.current), R.current && clearTimeout(R.current);
|
|
5190
5191
|
}, []);
|
|
5191
|
-
const
|
|
5192
|
-
|
|
5193
|
-
}, [n, c, V]), O =
|
|
5194
|
-
$.current && clearTimeout($.current), n === "hover" ?
|
|
5195
|
-
}, [n, y, V]), q =
|
|
5196
|
-
|
|
5197
|
-
}, [
|
|
5192
|
+
const B = E(() => {
|
|
5193
|
+
R.current && clearTimeout(R.current), n === "hover" ? $.current = setTimeout(() => V(!0), c) : V(!0);
|
|
5194
|
+
}, [n, c, V]), O = E(() => {
|
|
5195
|
+
$.current && clearTimeout($.current), n === "hover" ? R.current = setTimeout(() => V(!1), y) : V(!1);
|
|
5196
|
+
}, [n, y, V]), q = E(() => {
|
|
5197
|
+
F ? O() : B();
|
|
5198
|
+
}, [F, B, O]), P = t.props, j = De(t, {
|
|
5198
5199
|
ref: M,
|
|
5199
|
-
"aria-expanded":
|
|
5200
|
+
"aria-expanded": F,
|
|
5200
5201
|
"aria-haspopup": "dialog",
|
|
5201
|
-
"aria-controls":
|
|
5202
|
+
"aria-controls": F ? H : void 0,
|
|
5202
5203
|
...n === "click" && {
|
|
5203
|
-
onClick: (
|
|
5204
|
+
onClick: (K) => {
|
|
5204
5205
|
var ie;
|
|
5205
|
-
(ie = P.onClick) == null || ie.call(P,
|
|
5206
|
+
(ie = P.onClick) == null || ie.call(P, K), q();
|
|
5206
5207
|
}
|
|
5207
5208
|
},
|
|
5208
5209
|
...n === "hover" && {
|
|
5209
|
-
onMouseEnter: (
|
|
5210
|
+
onMouseEnter: (K) => {
|
|
5210
5211
|
var ie;
|
|
5211
|
-
(ie = P.onMouseEnter) == null || ie.call(P,
|
|
5212
|
+
(ie = P.onMouseEnter) == null || ie.call(P, K), B();
|
|
5212
5213
|
},
|
|
5213
|
-
onMouseLeave: (
|
|
5214
|
+
onMouseLeave: (K) => {
|
|
5214
5215
|
var ie;
|
|
5215
|
-
(ie = P.onMouseLeave) == null || ie.call(P,
|
|
5216
|
+
(ie = P.onMouseLeave) == null || ie.call(P, K), O();
|
|
5216
5217
|
}
|
|
5217
5218
|
}
|
|
5218
5219
|
}), re = {
|
|
@@ -5226,9 +5227,9 @@ const To = z(function({
|
|
|
5226
5227
|
boxShadow: "var(--brycks-shadow-lg)",
|
|
5227
5228
|
padding: "var(--brycks-space-3)",
|
|
5228
5229
|
minWidth: 120,
|
|
5229
|
-
animation:
|
|
5230
|
+
animation: T ? "none" : "brycks-popover-in 150ms ease-out",
|
|
5230
5231
|
...f
|
|
5231
|
-
}, _ =
|
|
5232
|
+
}, _ = F && h && /* @__PURE__ */ w(ne, { children: [
|
|
5232
5233
|
/* @__PURE__ */ s("style", { children: `
|
|
5233
5234
|
@keyframes brycks-popover-in {
|
|
5234
5235
|
from { opacity: 0; transform: scale(0.95); }
|
|
@@ -5238,16 +5239,16 @@ const To = z(function({
|
|
|
5238
5239
|
/* @__PURE__ */ s(
|
|
5239
5240
|
"div",
|
|
5240
5241
|
{
|
|
5241
|
-
ref: (
|
|
5242
|
-
N.current =
|
|
5242
|
+
ref: (K) => {
|
|
5243
|
+
N.current = K, W.current = K, typeof v == "function" ? v(K) : v && (v.current = K);
|
|
5243
5244
|
},
|
|
5244
|
-
id:
|
|
5245
|
+
id: H,
|
|
5245
5246
|
className: S("brycks-popover", u),
|
|
5246
5247
|
style: re,
|
|
5247
5248
|
role: "dialog",
|
|
5248
5249
|
"aria-modal": "false",
|
|
5249
5250
|
"data-testid": p,
|
|
5250
|
-
onMouseEnter: n === "hover" ?
|
|
5251
|
+
onMouseEnter: n === "hover" ? B : void 0,
|
|
5251
5252
|
onMouseLeave: n === "hover" ? O : void 0,
|
|
5252
5253
|
...b,
|
|
5253
5254
|
children: e
|
|
@@ -5292,17 +5293,17 @@ const Lo = {
|
|
|
5292
5293
|
}, f) {
|
|
5293
5294
|
const p = Math.min(100, Math.max(0, e / t * 100)), b = Do[a];
|
|
5294
5295
|
if (n === "circular") {
|
|
5295
|
-
const M = $o[o], N = (M.size - M.strokeWidth) / 2, $ = 2 * Math.PI * N,
|
|
5296
|
+
const M = $o[o], N = (M.size - M.strokeWidth) / 2, $ = 2 * Math.PI * N, R = $ - p / 100 * $, H = {
|
|
5296
5297
|
display: "inline-flex",
|
|
5297
5298
|
flexDirection: "column",
|
|
5298
5299
|
alignItems: "center",
|
|
5299
5300
|
gap: 8,
|
|
5300
5301
|
...m
|
|
5301
|
-
},
|
|
5302
|
+
}, T = {
|
|
5302
5303
|
transform: "rotate(-90deg)",
|
|
5303
5304
|
width: M.size,
|
|
5304
5305
|
height: M.size
|
|
5305
|
-
},
|
|
5306
|
+
}, F = {
|
|
5306
5307
|
fill: "none",
|
|
5307
5308
|
stroke: "var(--brycks-background-muted)",
|
|
5308
5309
|
strokeWidth: M.strokeWidth
|
|
@@ -5312,7 +5313,7 @@ const Lo = {
|
|
|
5312
5313
|
strokeWidth: M.strokeWidth,
|
|
5313
5314
|
strokeLinecap: "round",
|
|
5314
5315
|
strokeDasharray: $,
|
|
5315
|
-
strokeDashoffset: i ? $ * 0.75 :
|
|
5316
|
+
strokeDashoffset: i ? $ * 0.75 : R,
|
|
5316
5317
|
transition: i ? "none" : "stroke-dashoffset 300ms ease-out",
|
|
5317
5318
|
animation: i ? "brycks-progress-circular-spin 1s linear infinite" : void 0,
|
|
5318
5319
|
transformOrigin: "center"
|
|
@@ -5321,7 +5322,7 @@ const Lo = {
|
|
|
5321
5322
|
fontSize: o === "xs" ? 8 : o === "sm" ? 10 : o === "md" ? 12 : 14,
|
|
5322
5323
|
fontWeight: 600,
|
|
5323
5324
|
color: "var(--brycks-foreground-default)"
|
|
5324
|
-
},
|
|
5325
|
+
}, B = {
|
|
5325
5326
|
fontSize: o === "xs" ? 10 : o === "sm" ? 11 : o === "md" ? 12 : 14,
|
|
5326
5327
|
color: "var(--brycks-foreground-muted)"
|
|
5327
5328
|
};
|
|
@@ -5337,7 +5338,7 @@ const Lo = {
|
|
|
5337
5338
|
{
|
|
5338
5339
|
ref: f,
|
|
5339
5340
|
className: S("brycks-progress", "brycks-progress--circular", `brycks-progress--${o}`, y),
|
|
5340
|
-
style:
|
|
5341
|
+
style: H,
|
|
5341
5342
|
role: "progressbar",
|
|
5342
5343
|
"aria-valuenow": i ? void 0 : e,
|
|
5343
5344
|
"aria-valuemin": 0,
|
|
@@ -5347,13 +5348,13 @@ const Lo = {
|
|
|
5347
5348
|
...u,
|
|
5348
5349
|
children: [
|
|
5349
5350
|
/* @__PURE__ */ w("div", { style: { position: "relative", display: "flex", alignItems: "center", justifyContent: "center" }, children: [
|
|
5350
|
-
/* @__PURE__ */ w("svg", { style:
|
|
5351
|
-
/* @__PURE__ */ s("circle", { cx: M.size / 2, cy: M.size / 2, r: N, style:
|
|
5351
|
+
/* @__PURE__ */ w("svg", { style: T, children: [
|
|
5352
|
+
/* @__PURE__ */ s("circle", { cx: M.size / 2, cy: M.size / 2, r: N, style: F }),
|
|
5352
5353
|
/* @__PURE__ */ s("circle", { cx: M.size / 2, cy: M.size / 2, r: N, style: V })
|
|
5353
5354
|
] }),
|
|
5354
5355
|
l && !i && o !== "xs" && /* @__PURE__ */ s("span", { style: W, children: d(e, t) })
|
|
5355
5356
|
] }),
|
|
5356
|
-
c && /* @__PURE__ */ s("span", { style:
|
|
5357
|
+
c && /* @__PURE__ */ s("span", { style: B, children: c })
|
|
5357
5358
|
]
|
|
5358
5359
|
}
|
|
5359
5360
|
)
|
|
@@ -5374,7 +5375,7 @@ const Lo = {
|
|
|
5374
5375
|
fontSize: o === "xs" ? 11 : o === "sm" ? 12 : o === "md" ? 13 : 14,
|
|
5375
5376
|
fontWeight: 500,
|
|
5376
5377
|
color: "var(--brycks-foreground-default)"
|
|
5377
|
-
},
|
|
5378
|
+
}, I = {
|
|
5378
5379
|
fontSize: o === "xs" ? 11 : o === "sm" ? 12 : o === "md" ? 13 : 14,
|
|
5379
5380
|
fontWeight: 500,
|
|
5380
5381
|
color: "var(--brycks-foreground-muted)",
|
|
@@ -5416,7 +5417,7 @@ const Lo = {
|
|
|
5416
5417
|
children: [
|
|
5417
5418
|
(c || l) && /* @__PURE__ */ w("div", { style: k, children: [
|
|
5418
5419
|
c && /* @__PURE__ */ s("span", { style: C, children: c }),
|
|
5419
|
-
l && !i && /* @__PURE__ */ s("span", { style:
|
|
5420
|
+
l && !i && /* @__PURE__ */ s("span", { style: I, children: d(e, t) })
|
|
5420
5421
|
] }),
|
|
5421
5422
|
/* @__PURE__ */ s("div", { style: h, children: /* @__PURE__ */ s("div", { style: D }) })
|
|
5422
5423
|
]
|
|
@@ -5445,7 +5446,7 @@ const Wo = z(function({
|
|
|
5445
5446
|
testId: y,
|
|
5446
5447
|
...m
|
|
5447
5448
|
}, g) {
|
|
5448
|
-
const [u, f] =
|
|
5449
|
+
const [u, f] = A(t), p = e ?? u, b = E(
|
|
5449
5450
|
(x) => {
|
|
5450
5451
|
e === void 0 && f(x), o == null || o(x);
|
|
5451
5452
|
},
|
|
@@ -5509,9 +5510,9 @@ const Bo = {
|
|
|
5509
5510
|
if (t) return;
|
|
5510
5511
|
const C = Array.from(
|
|
5511
5512
|
((D = k.currentTarget.parentElement) == null ? void 0 : D.querySelectorAll('[role="tab"]:not([disabled])')) ?? []
|
|
5512
|
-
),
|
|
5513
|
+
), I = C.indexOf(k.currentTarget);
|
|
5513
5514
|
let h = null;
|
|
5514
|
-
u === "horizontal" ? (k.key === "ArrowRight" && (h = (
|
|
5515
|
+
u === "horizontal" ? (k.key === "ArrowRight" && (h = (I + 1) % C.length), k.key === "ArrowLeft" && (h = (I - 1 + C.length) % C.length)) : (k.key === "ArrowDown" && (h = (I + 1) % C.length), k.key === "ArrowUp" && (h = (I - 1 + C.length) % C.length)), k.key === "Home" && (h = 0), k.key === "End" && (h = C.length - 1), h !== null && (k.preventDefault(), (M = C[h]) == null || M.focus(), (N = C[h]) == null || N.click());
|
|
5515
5516
|
}, x = () => {
|
|
5516
5517
|
const k = {
|
|
5517
5518
|
display: "inline-flex",
|
|
@@ -5630,7 +5631,7 @@ const jo = z(function({
|
|
|
5630
5631
|
testId: c,
|
|
5631
5632
|
...y
|
|
5632
5633
|
}, m) {
|
|
5633
|
-
const [g, u] =
|
|
5634
|
+
const [g, u] = A(t), f = e ?? g, p = E(
|
|
5634
5635
|
(v) => {
|
|
5635
5636
|
const x = f.includes(v);
|
|
5636
5637
|
let k;
|
|
@@ -5803,86 +5804,86 @@ const Yo = z(function({
|
|
|
5803
5804
|
...g
|
|
5804
5805
|
}, u) {
|
|
5805
5806
|
var V;
|
|
5806
|
-
const [f, p] =
|
|
5807
|
-
|
|
5808
|
-
const N =
|
|
5807
|
+
const [f, p] = A(o), [b, v] = A({ top: 0, left: 0 }), [x, k] = A(-1), [C, I] = A(!1), h = Z(null), D = Z(null), M = t ?? f;
|
|
5808
|
+
Y(() => (I(!0), () => I(!1)), []);
|
|
5809
|
+
const N = E(
|
|
5809
5810
|
(W) => {
|
|
5810
5811
|
t === void 0 && p(W), n == null || n(W), W || k(-1);
|
|
5811
5812
|
},
|
|
5812
5813
|
[t, n]
|
|
5813
|
-
), $ =
|
|
5814
|
-
|
|
5814
|
+
), $ = E(() => N(!1), [N]);
|
|
5815
|
+
Y(() => {
|
|
5815
5816
|
if (!M || !h.current || !C) return;
|
|
5816
5817
|
const W = () => {
|
|
5817
|
-
const
|
|
5818
|
-
if (!
|
|
5819
|
-
const O =
|
|
5818
|
+
const B = h.current;
|
|
5819
|
+
if (!B) return;
|
|
5820
|
+
const O = B.getBoundingClientRect(), q = window.scrollX, P = window.scrollY;
|
|
5820
5821
|
let j = 0, re = 0;
|
|
5821
5822
|
a.startsWith("bottom") ? j = O.bottom + P + l : j = O.top + P - l, a.endsWith("start") ? re = O.left + q : re = O.right + q, v({ top: j, left: re });
|
|
5822
5823
|
};
|
|
5823
5824
|
return W(), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0), () => {
|
|
5824
5825
|
window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0);
|
|
5825
5826
|
};
|
|
5826
|
-
}, [M, a, l, C]),
|
|
5827
|
+
}, [M, a, l, C]), Y(() => {
|
|
5827
5828
|
if (!M) return;
|
|
5828
|
-
const W = (
|
|
5829
|
+
const W = (B) => {
|
|
5829
5830
|
var O, q;
|
|
5830
|
-
(O = h.current) != null && O.contains(
|
|
5831
|
+
(O = h.current) != null && O.contains(B.target) || (q = D.current) != null && q.contains(B.target) || N(!1);
|
|
5831
5832
|
};
|
|
5832
5833
|
return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
|
|
5833
5834
|
}, [M, N]);
|
|
5834
|
-
const
|
|
5835
|
+
const R = E(
|
|
5835
5836
|
(W) => {
|
|
5836
5837
|
var O, q, P;
|
|
5837
5838
|
if (!M) {
|
|
5838
5839
|
(W.key === "ArrowDown" || W.key === "Enter" || W.key === " ") && (W.preventDefault(), N(!0));
|
|
5839
5840
|
return;
|
|
5840
5841
|
}
|
|
5841
|
-
const
|
|
5842
|
-
if (
|
|
5842
|
+
const B = (O = D.current) == null ? void 0 : O.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');
|
|
5843
|
+
if (B != null && B.length)
|
|
5843
5844
|
switch (W.key) {
|
|
5844
5845
|
case "ArrowDown":
|
|
5845
|
-
W.preventDefault(), k((j) => (j + 1) %
|
|
5846
|
+
W.preventDefault(), k((j) => (j + 1) % B.length);
|
|
5846
5847
|
break;
|
|
5847
5848
|
case "ArrowUp":
|
|
5848
|
-
W.preventDefault(), k((j) => (j - 1 +
|
|
5849
|
+
W.preventDefault(), k((j) => (j - 1 + B.length) % B.length);
|
|
5849
5850
|
break;
|
|
5850
5851
|
case "Home":
|
|
5851
5852
|
W.preventDefault(), k(0);
|
|
5852
5853
|
break;
|
|
5853
5854
|
case "End":
|
|
5854
|
-
W.preventDefault(), k(
|
|
5855
|
+
W.preventDefault(), k(B.length - 1);
|
|
5855
5856
|
break;
|
|
5856
5857
|
case "Escape":
|
|
5857
5858
|
W.preventDefault(), N(!1), (q = h.current) == null || q.focus();
|
|
5858
5859
|
break;
|
|
5859
5860
|
case "Enter":
|
|
5860
5861
|
case " ":
|
|
5861
|
-
W.preventDefault(), x >= 0 && ((P =
|
|
5862
|
+
W.preventDefault(), x >= 0 && ((P = B[x]) == null || P.click());
|
|
5862
5863
|
break;
|
|
5863
5864
|
}
|
|
5864
5865
|
},
|
|
5865
5866
|
[M, x, N]
|
|
5866
5867
|
);
|
|
5867
|
-
|
|
5868
|
-
var
|
|
5868
|
+
Y(() => {
|
|
5869
|
+
var B, O;
|
|
5869
5870
|
if (!M || x < 0) return;
|
|
5870
|
-
const W = (
|
|
5871
|
+
const W = (B = D.current) == null ? void 0 : B.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');
|
|
5871
5872
|
(O = W == null ? void 0 : W[x]) == null || O.focus();
|
|
5872
5873
|
}, [M, x]);
|
|
5873
|
-
const
|
|
5874
|
+
const H = e.props, T = De(e, {
|
|
5874
5875
|
ref: h,
|
|
5875
5876
|
"aria-haspopup": "menu",
|
|
5876
5877
|
"aria-expanded": M,
|
|
5877
5878
|
onClick: (W) => {
|
|
5878
|
-
var
|
|
5879
|
-
(
|
|
5879
|
+
var B;
|
|
5880
|
+
(B = H.onClick) == null || B.call(H, W), N(!M);
|
|
5880
5881
|
},
|
|
5881
5882
|
onKeyDown: (W) => {
|
|
5882
|
-
var
|
|
5883
|
-
(
|
|
5883
|
+
var B;
|
|
5884
|
+
(B = H.onKeyDown) == null || B.call(H, W), R(W);
|
|
5884
5885
|
}
|
|
5885
|
-
}),
|
|
5886
|
+
}), F = {
|
|
5886
5887
|
position: "absolute",
|
|
5887
5888
|
top: b.top,
|
|
5888
5889
|
left: a.endsWith("end") ? "auto" : b.left,
|
|
@@ -5908,7 +5909,7 @@ const Yo = z(function({
|
|
|
5908
5909
|
"data-testid": m,
|
|
5909
5910
|
...g,
|
|
5910
5911
|
children: [
|
|
5911
|
-
|
|
5912
|
+
T,
|
|
5912
5913
|
M && C && ve(
|
|
5913
5914
|
/* @__PURE__ */ w(ne, { children: [
|
|
5914
5915
|
/* @__PURE__ */ s("style", { children: `
|
|
@@ -5922,8 +5923,8 @@ const Yo = z(function({
|
|
|
5922
5923
|
{
|
|
5923
5924
|
ref: D,
|
|
5924
5925
|
role: "menu",
|
|
5925
|
-
style:
|
|
5926
|
-
onKeyDown:
|
|
5926
|
+
style: F,
|
|
5927
|
+
onKeyDown: R,
|
|
5927
5928
|
tabIndex: -1,
|
|
5928
5929
|
children: y
|
|
5929
5930
|
}
|
|
@@ -6054,7 +6055,7 @@ const Uo = z(function({
|
|
|
6054
6055
|
testId: d,
|
|
6055
6056
|
...c
|
|
6056
6057
|
}, y) {
|
|
6057
|
-
const [m, g] =
|
|
6058
|
+
const [m, g] = A(null), u = e !== void 0 ? e : m, f = (b) => {
|
|
6058
6059
|
e === void 0 && g(b), t == null || t(b);
|
|
6059
6060
|
}, p = {
|
|
6060
6061
|
display: "flex",
|
|
@@ -6121,11 +6122,11 @@ const Zo = {
|
|
|
6121
6122
|
className: S("brycks-menu-item", p && "brycks-menu-item--active", l),
|
|
6122
6123
|
style: x,
|
|
6123
6124
|
onClick: v,
|
|
6124
|
-
onMouseEnter: (
|
|
6125
|
-
!n && !p && (
|
|
6125
|
+
onMouseEnter: (I) => {
|
|
6126
|
+
!n && !p && (I.currentTarget.style.backgroundColor = "var(--brycks-background-muted)");
|
|
6126
6127
|
},
|
|
6127
|
-
onMouseLeave: (
|
|
6128
|
-
p || (
|
|
6128
|
+
onMouseLeave: (I) => {
|
|
6129
|
+
p || (I.currentTarget.style.backgroundColor = "transparent");
|
|
6129
6130
|
},
|
|
6130
6131
|
title: f ? String(d) : void 0,
|
|
6131
6132
|
...c,
|
|
@@ -6216,17 +6217,17 @@ const sn = z(function({
|
|
|
6216
6217
|
if (N)
|
|
6217
6218
|
if ($) {
|
|
6218
6219
|
h.push(1), h.push("ellipsis");
|
|
6219
|
-
for (let
|
|
6220
|
-
h.push(
|
|
6220
|
+
for (let R = D; R <= M; R++)
|
|
6221
|
+
h.push(R);
|
|
6221
6222
|
h.push("ellipsis"), h.push(t);
|
|
6222
6223
|
} else {
|
|
6223
6224
|
h.push(1), h.push("ellipsis");
|
|
6224
|
-
for (let
|
|
6225
|
-
h.push(
|
|
6225
|
+
for (let R = Math.max(t - 2 - l, 1); R <= t; R++)
|
|
6226
|
+
h.push(R);
|
|
6226
6227
|
}
|
|
6227
6228
|
else {
|
|
6228
|
-
for (let
|
|
6229
|
-
h.push(
|
|
6229
|
+
for (let R = 1; R <= Math.min(3 + l, t); R++)
|
|
6230
|
+
h.push(R);
|
|
6230
6231
|
$ && (h.push("ellipsis"), h.push(t));
|
|
6231
6232
|
}
|
|
6232
6233
|
return h;
|
|
@@ -6263,7 +6264,7 @@ const sn = z(function({
|
|
|
6263
6264
|
fontSize: p.fontSize,
|
|
6264
6265
|
color: "var(--brycks-foreground-muted)",
|
|
6265
6266
|
padding: `0 ${p.gap}px`
|
|
6266
|
-
},
|
|
6267
|
+
}, I = (h) => {
|
|
6267
6268
|
h >= 1 && h <= t && h !== e && !c && o(h);
|
|
6268
6269
|
};
|
|
6269
6270
|
return /* @__PURE__ */ w(
|
|
@@ -6284,7 +6285,7 @@ const sn = z(function({
|
|
|
6284
6285
|
"aria-label": "First page",
|
|
6285
6286
|
disabled: e === 1 || c,
|
|
6286
6287
|
style: x(!1, e === 1 || c),
|
|
6287
|
-
onClick: () =>
|
|
6288
|
+
onClick: () => I(1),
|
|
6288
6289
|
onMouseEnter: (h) => {
|
|
6289
6290
|
e !== 1 && !c && (h.currentTarget.style.backgroundColor = "var(--brycks-background-muted)");
|
|
6290
6291
|
},
|
|
@@ -6301,7 +6302,7 @@ const sn = z(function({
|
|
|
6301
6302
|
"aria-label": "Previous page",
|
|
6302
6303
|
disabled: e === 1 || c,
|
|
6303
6304
|
style: x(!1, e === 1 || c),
|
|
6304
|
-
onClick: () =>
|
|
6305
|
+
onClick: () => I(e - 1),
|
|
6305
6306
|
onMouseEnter: (h) => {
|
|
6306
6307
|
e !== 1 && !c && (h.currentTarget.style.backgroundColor = "var(--brycks-background-muted)");
|
|
6307
6308
|
},
|
|
@@ -6320,7 +6321,7 @@ const sn = z(function({
|
|
|
6320
6321
|
"aria-current": h === e ? "page" : void 0,
|
|
6321
6322
|
disabled: c,
|
|
6322
6323
|
style: x(h === e, c),
|
|
6323
|
-
onClick: () =>
|
|
6324
|
+
onClick: () => I(h),
|
|
6324
6325
|
onMouseEnter: (M) => {
|
|
6325
6326
|
h !== e && !c && (M.currentTarget.style.backgroundColor = "var(--brycks-background-muted)");
|
|
6326
6327
|
},
|
|
@@ -6339,7 +6340,7 @@ const sn = z(function({
|
|
|
6339
6340
|
"aria-label": "Next page",
|
|
6340
6341
|
disabled: e === t || c,
|
|
6341
6342
|
style: x(!1, e === t || c),
|
|
6342
|
-
onClick: () =>
|
|
6343
|
+
onClick: () => I(e + 1),
|
|
6343
6344
|
onMouseEnter: (h) => {
|
|
6344
6345
|
e !== t && !c && (h.currentTarget.style.backgroundColor = "var(--brycks-background-muted)");
|
|
6345
6346
|
},
|
|
@@ -6356,7 +6357,7 @@ const sn = z(function({
|
|
|
6356
6357
|
"aria-label": "Last page",
|
|
6357
6358
|
disabled: e === t || c,
|
|
6358
6359
|
style: x(!1, e === t || c),
|
|
6359
|
-
onClick: () =>
|
|
6360
|
+
onClick: () => I(t),
|
|
6360
6361
|
onMouseEnter: (h) => {
|
|
6361
6362
|
e !== t && !c && (h.currentTarget.style.backgroundColor = "var(--brycks-background-muted)");
|
|
6362
6363
|
},
|
|
@@ -6429,10 +6430,10 @@ const cn = z(function({
|
|
|
6429
6430
|
"data-testid": i,
|
|
6430
6431
|
...d,
|
|
6431
6432
|
children: /* @__PURE__ */ s("ol", { style: p, children: g.map((k, C) => {
|
|
6432
|
-
const
|
|
6433
|
+
const I = C === g.length - 1, h = !I, D = u && C === Math.floor((o - 1) / 2) - 1;
|
|
6433
6434
|
return /* @__PURE__ */ w("li", { style: { display: "flex", alignItems: "center", gap: y.gap }, children: [
|
|
6434
6435
|
De(k, {
|
|
6435
|
-
isCurrentPage:
|
|
6436
|
+
isCurrentPage: I,
|
|
6436
6437
|
size: t
|
|
6437
6438
|
}),
|
|
6438
6439
|
D && /* @__PURE__ */ w(ne, { children: [
|
|
@@ -7575,8 +7576,8 @@ function jn({ size: r = 64 }) {
|
|
|
7575
7576
|
}
|
|
7576
7577
|
jn.displayName = "EmptyStateIcon";
|
|
7577
7578
|
function ct({ children: r, container: e, disabled: t = !1 }) {
|
|
7578
|
-
const [o, n] =
|
|
7579
|
-
return
|
|
7579
|
+
const [o, n] = A(!1), [a, l] = A(null);
|
|
7580
|
+
return Y(() => {
|
|
7580
7581
|
if (n(!0), typeof e == "string") {
|
|
7581
7582
|
const i = document.querySelector(e);
|
|
7582
7583
|
l(i);
|
|
@@ -7599,15 +7600,15 @@ function On(r = {}) {
|
|
|
7599
7600
|
autoFocus: t = !0,
|
|
7600
7601
|
restoreFocus: o = !0,
|
|
7601
7602
|
initialFocus: n
|
|
7602
|
-
} = r, a =
|
|
7603
|
+
} = r, a = Z(null), l = Z(null), i = E(() => a.current ? Array.from(a.current.querySelectorAll(Vn)) : [], []), d = E(() => {
|
|
7603
7604
|
var m;
|
|
7604
7605
|
(m = i()[0]) == null || m.focus();
|
|
7605
|
-
}, [i]), c =
|
|
7606
|
+
}, [i]), c = E(() => {
|
|
7606
7607
|
var m;
|
|
7607
7608
|
const y = i();
|
|
7608
7609
|
(m = y[y.length - 1]) == null || m.focus();
|
|
7609
7610
|
}, [i]);
|
|
7610
|
-
return
|
|
7611
|
+
return Y(() => {
|
|
7611
7612
|
if (e) {
|
|
7612
7613
|
if (l.current = document.activeElement, t) {
|
|
7613
7614
|
const y = a.current;
|
|
@@ -7622,7 +7623,7 @@ function On(r = {}) {
|
|
|
7622
7623
|
o && l.current && l.current.focus();
|
|
7623
7624
|
};
|
|
7624
7625
|
}
|
|
7625
|
-
}, [e, t, o, n, d]),
|
|
7626
|
+
}, [e, t, o, n, d]), Y(() => {
|
|
7626
7627
|
if (!e) return;
|
|
7627
7628
|
const y = (m) => {
|
|
7628
7629
|
if (m.key !== "Tab" || !a.current) return;
|
|
@@ -7992,11 +7993,11 @@ const sa = z(
|
|
|
7992
7993
|
);
|
|
7993
7994
|
sa.displayName = "Article";
|
|
7994
7995
|
function Pa(r = {}) {
|
|
7995
|
-
const { defaultIsOpen: e = !1, onOpen: t, onClose: o } = r, [n, a] =
|
|
7996
|
+
const { defaultIsOpen: e = !1, onOpen: t, onClose: o } = r, [n, a] = A(e), l = E(() => {
|
|
7996
7997
|
a(!0), t == null || t();
|
|
7997
|
-
}, [t]), i =
|
|
7998
|
+
}, [t]), i = E(() => {
|
|
7998
7999
|
a(!1), o == null || o();
|
|
7999
|
-
}, [o]), d =
|
|
8000
|
+
}, [o]), d = E(() => {
|
|
8000
8001
|
const c = !n;
|
|
8001
8002
|
a(c), c ? t == null || t() : o == null || o();
|
|
8002
8003
|
}, [n, t, o]);
|
|
@@ -8016,12 +8017,12 @@ function _a(r) {
|
|
|
8016
8017
|
orientation: n = "vertical",
|
|
8017
8018
|
onIndexChange: a,
|
|
8018
8019
|
onSelect: l
|
|
8019
|
-
} = r, [i, d] =
|
|
8020
|
+
} = r, [i, d] = A(t), c = E(
|
|
8020
8021
|
(u) => {
|
|
8021
8022
|
d(u), a == null || a(u);
|
|
8022
8023
|
},
|
|
8023
8024
|
[a]
|
|
8024
|
-
), y =
|
|
8025
|
+
), y = E(
|
|
8025
8026
|
(u) => {
|
|
8026
8027
|
let f;
|
|
8027
8028
|
switch (u) {
|
|
@@ -8041,7 +8042,7 @@ function _a(r) {
|
|
|
8041
8042
|
c(f);
|
|
8042
8043
|
},
|
|
8043
8044
|
[i, e, o, c]
|
|
8044
|
-
), m =
|
|
8045
|
+
), m = E(
|
|
8045
8046
|
(u) => {
|
|
8046
8047
|
const { key: f } = u, p = n === "vertical" || n === "both", b = n === "horizontal" || n === "both";
|
|
8047
8048
|
switch (f) {
|
|
@@ -8070,7 +8071,7 @@ function _a(r) {
|
|
|
8070
8071
|
}
|
|
8071
8072
|
},
|
|
8072
8073
|
[n, y, l, i]
|
|
8073
|
-
), g =
|
|
8074
|
+
), g = E(
|
|
8074
8075
|
(u) => ({
|
|
8075
8076
|
tabIndex: u === i ? 0 : -1,
|
|
8076
8077
|
"data-focused": u === i,
|
|
@@ -8086,13 +8087,13 @@ function _a(r) {
|
|
|
8086
8087
|
};
|
|
8087
8088
|
}
|
|
8088
8089
|
function Xa(r) {
|
|
8089
|
-
const { value: e, defaultValue: t, onChange: o } = r, n = e !== void 0, a =
|
|
8090
|
-
|
|
8090
|
+
const { value: e, defaultValue: t, onChange: o } = r, n = e !== void 0, a = Z(n);
|
|
8091
|
+
Y(() => {
|
|
8091
8092
|
a.current !== n && console.warn(
|
|
8092
8093
|
"Component is switching between controlled and uncontrolled modes. This is not recommended and may cause unexpected behavior."
|
|
8093
8094
|
), a.current = n;
|
|
8094
8095
|
}, [n]);
|
|
8095
|
-
const [l, i] =
|
|
8096
|
+
const [l, i] = A(t), d = n ? e : l, c = E(
|
|
8096
8097
|
(y) => {
|
|
8097
8098
|
const m = typeof y == "function" ? y(d) : y;
|
|
8098
8099
|
n || i(m), o == null || o(m);
|
|
@@ -8239,7 +8240,7 @@ export {
|
|
|
8239
8240
|
pa as duration,
|
|
8240
8241
|
te as durations,
|
|
8241
8242
|
ha as easing,
|
|
8242
|
-
|
|
8243
|
+
J as easings,
|
|
8243
8244
|
Ua as error,
|
|
8244
8245
|
be as focusRing,
|
|
8245
8246
|
ma as focusRingOffset,
|