@octavius2929-personal/design-system 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +428 -217
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -594
- package/dist/index.d.ts +3 -594
- package/dist/index.js +333 -122
- package/dist/index.js.map +1 -1
- package/package.json +3 -11
- package/LICENSE +0 -21
- package/README.md +0 -117
package/dist/index.cjs
CHANGED
|
@@ -182,13 +182,267 @@ ContainerForwarded.displayName = "Container";
|
|
|
182
182
|
var Container = ContainerForwarded;
|
|
183
183
|
|
|
184
184
|
// src/components/typography/index.tsx
|
|
185
|
-
var
|
|
185
|
+
var import_react9 = require("react");
|
|
186
186
|
|
|
187
187
|
// src/components/typography/use-styles.ts
|
|
188
|
+
var import_react8 = require("react");
|
|
189
|
+
|
|
190
|
+
// ../core/dist/index.js
|
|
191
|
+
var import_react6 = require("react");
|
|
192
|
+
var tokens = {
|
|
193
|
+
font: {
|
|
194
|
+
display: "'DM Serif Display', 'Times New Roman', serif",
|
|
195
|
+
text: "'Newsreader', Georgia, serif",
|
|
196
|
+
mono: "'IBM Plex Mono', 'SFMono-Regular', monospace",
|
|
197
|
+
black: "'UnifrakturMaguntia', 'Grenze Gotisch', serif"
|
|
198
|
+
},
|
|
199
|
+
// Roles tipográficos: tamaño/interlineado/peso/tracking listos para typography.css.ts.
|
|
200
|
+
text: {
|
|
201
|
+
eyebrow: { size: "0.694rem", lineHeight: "1.2", weight: "500", letterSpacing: "0.14em" },
|
|
202
|
+
display: { size: "5.6rem", lineHeight: "1.05", weight: "600", letterSpacing: "-0.01em" },
|
|
203
|
+
h1: { size: "2.9rem", lineHeight: "1.05", weight: "600", letterSpacing: "-0.01em" },
|
|
204
|
+
h2: { size: "2.1rem", lineHeight: "1.2", weight: "600", letterSpacing: "0" },
|
|
205
|
+
h3: { size: "1.563rem", lineHeight: "1.2", weight: "500", letterSpacing: "0" },
|
|
206
|
+
h4: { size: "1.25rem", lineHeight: "1.2", weight: "600", letterSpacing: "0" },
|
|
207
|
+
body: { size: "1rem", lineHeight: "1.7", weight: "400", letterSpacing: "0" },
|
|
208
|
+
lead: { size: "1.25rem", lineHeight: "1.7", weight: "400", letterSpacing: "0" },
|
|
209
|
+
small: { size: "0.95rem", lineHeight: "1.5", weight: "400", letterSpacing: "0" },
|
|
210
|
+
caption: { size: "0.833rem", lineHeight: "1.5", weight: "400", letterSpacing: "0.04em" }
|
|
211
|
+
},
|
|
212
|
+
space: {
|
|
213
|
+
s0: "0",
|
|
214
|
+
s1: "0.25rem",
|
|
215
|
+
// 4
|
|
216
|
+
s2: "0.5rem",
|
|
217
|
+
// 8
|
|
218
|
+
s3: "0.75rem",
|
|
219
|
+
// 12
|
|
220
|
+
s4: "1rem",
|
|
221
|
+
// 16
|
|
222
|
+
s5: "1.5rem",
|
|
223
|
+
// 24
|
|
224
|
+
s6: "2rem",
|
|
225
|
+
// 32
|
|
226
|
+
s7: "3rem",
|
|
227
|
+
// 48
|
|
228
|
+
s8: "4rem",
|
|
229
|
+
// 64
|
|
230
|
+
s9: "6rem"
|
|
231
|
+
// 96
|
|
232
|
+
},
|
|
233
|
+
radius: { none: "0px", sm: "3px", md: "5px", lg: "8px", base: "4px", full: "999px" },
|
|
234
|
+
border: { hair: "1px", rule: "1.5px", heavy: "2px" },
|
|
235
|
+
// Tracking de mayúsculas: escala coherente alineada al uso real (eyebrow = widest).
|
|
236
|
+
tracking: { tight: "-0.01em", normal: "0", wide: "0.04em", wider: "0.1em", widest: "0.14em" },
|
|
237
|
+
weight: { light: "300", regular: "400", medium: "500", semibold: "600", bold: "700" },
|
|
238
|
+
dur: { fast: "120ms", base: "200ms", slow: "360ms" },
|
|
239
|
+
ease: { ink: "cubic-bezier(0.2, 0, 0, 1)" },
|
|
240
|
+
shadow: {
|
|
241
|
+
sm: "0 1px 0 rgba(20,17,14,0.06)",
|
|
242
|
+
md: "0 2px 10px -4px rgba(20,17,14,0.22)",
|
|
243
|
+
lg: "0 12px 32px -10px rgba(20,17,14,0.34)"
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var tintaSchema = {
|
|
247
|
+
light: {
|
|
248
|
+
...tokens,
|
|
249
|
+
color: {
|
|
250
|
+
bg1: "#F8F7F4",
|
|
251
|
+
bg2: "#FFFFFF",
|
|
252
|
+
bg3: "#EDEBE6",
|
|
253
|
+
bgInset: "#E4E1DA",
|
|
254
|
+
fg1: "#15130F",
|
|
255
|
+
fg2: "#494640",
|
|
256
|
+
fg3: "#737069",
|
|
257
|
+
fgOnAccent: "#F8F7F4",
|
|
258
|
+
border1: "rgba(21, 19, 15, 0.12)",
|
|
259
|
+
border2: "rgba(21, 19, 15, 0.26)",
|
|
260
|
+
borderStrong: "rgba(21, 19, 15, 0.85)",
|
|
261
|
+
accent: "#7B1E1E",
|
|
262
|
+
accentHover: "#631616",
|
|
263
|
+
accentSoft: "rgba(123, 30, 30, 0.10)",
|
|
264
|
+
ok: "#3E5C3A",
|
|
265
|
+
warn: "#8A6A1E",
|
|
266
|
+
danger: "#7B1E1E",
|
|
267
|
+
dangerHover: "#631616",
|
|
268
|
+
dangerSoft: "rgba(123, 30, 30, 0.10)",
|
|
269
|
+
info: "#2E4257",
|
|
270
|
+
focus: "#7B1E1E",
|
|
271
|
+
scrim: "rgba(20, 17, 14, 0.55)"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
dark: {
|
|
275
|
+
...tokens,
|
|
276
|
+
color: {
|
|
277
|
+
bg1: "#100E0B",
|
|
278
|
+
bg2: "#1A1611",
|
|
279
|
+
bg3: "#070605",
|
|
280
|
+
bgInset: "#221D16",
|
|
281
|
+
fg1: "#F2EDE2",
|
|
282
|
+
fg2: "#B7AF9F",
|
|
283
|
+
fg3: "#878070",
|
|
284
|
+
fgOnAccent: "#F2EDE2",
|
|
285
|
+
border1: "rgba(242, 237, 226, 0.13)",
|
|
286
|
+
border2: "rgba(242, 237, 226, 0.26)",
|
|
287
|
+
borderStrong: "rgba(242, 237, 226, 0.80)",
|
|
288
|
+
accent: "#B23A3A",
|
|
289
|
+
accentHover: "#CC4A4A",
|
|
290
|
+
accentSoft: "rgba(178, 58, 58, 0.16)",
|
|
291
|
+
ok: "#7FA178",
|
|
292
|
+
warn: "#C7A04E",
|
|
293
|
+
danger: "#C24A4A",
|
|
294
|
+
dangerHover: "#D45C5C",
|
|
295
|
+
dangerSoft: "rgba(194, 74, 74, 0.16)",
|
|
296
|
+
info: "#6E92B4",
|
|
297
|
+
focus: "#CC4A4A",
|
|
298
|
+
scrim: "rgba(7, 6, 5, 0.65)"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
sepia: {
|
|
302
|
+
...tokens,
|
|
303
|
+
color: {
|
|
304
|
+
bg1: "#E9DDC4",
|
|
305
|
+
bg2: "#F2E9D5",
|
|
306
|
+
bg3: "#DCCDAC",
|
|
307
|
+
bgInset: "#D2C09B",
|
|
308
|
+
fg1: "#2A2013",
|
|
309
|
+
fg2: "#5A4A33",
|
|
310
|
+
fg3: "#6E6046",
|
|
311
|
+
fgOnAccent: "#F2E9D5",
|
|
312
|
+
border1: "rgba(42, 32, 19, 0.16)",
|
|
313
|
+
border2: "rgba(42, 32, 19, 0.32)",
|
|
314
|
+
borderStrong: "rgba(42, 32, 19, 0.82)",
|
|
315
|
+
accent: "#7A2E12",
|
|
316
|
+
accentHover: "#5F2109",
|
|
317
|
+
accentSoft: "rgba(122, 46, 18, 0.12)",
|
|
318
|
+
ok: "#4A5A2E",
|
|
319
|
+
warn: "#8A6A1E",
|
|
320
|
+
danger: "#7A2E12",
|
|
321
|
+
dangerHover: "#5F2109",
|
|
322
|
+
dangerSoft: "rgba(122, 46, 18, 0.12)",
|
|
323
|
+
info: "#3C4E57",
|
|
324
|
+
focus: "#7A2E12",
|
|
325
|
+
scrim: "rgba(42, 32, 19, 0.55)"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
contrast: {
|
|
329
|
+
...tokens,
|
|
330
|
+
color: {
|
|
331
|
+
bg1: "#FFFFFF",
|
|
332
|
+
bg2: "#FFFFFF",
|
|
333
|
+
bg3: "#F2F2F2",
|
|
334
|
+
bgInset: "#EAEAEA",
|
|
335
|
+
fg1: "#000000",
|
|
336
|
+
fg2: "#000000",
|
|
337
|
+
fg3: "#2B2B2B",
|
|
338
|
+
fgOnAccent: "#FFFFFF",
|
|
339
|
+
border1: "#000000",
|
|
340
|
+
border2: "#000000",
|
|
341
|
+
borderStrong: "#000000",
|
|
342
|
+
accent: "#000000",
|
|
343
|
+
accentHover: "#2B2B2B",
|
|
344
|
+
accentSoft: "rgba(0, 0, 0, 0.08)",
|
|
345
|
+
ok: "#000000",
|
|
346
|
+
warn: "#000000",
|
|
347
|
+
danger: "#8B0000",
|
|
348
|
+
dangerHover: "#6B0000",
|
|
349
|
+
dangerSoft: "rgba(139, 0, 0, 0.10)",
|
|
350
|
+
info: "#000000",
|
|
351
|
+
focus: "#000000",
|
|
352
|
+
scrim: "rgba(0, 0, 0, 0.7)"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
var schemas = { tinta: tintaSchema };
|
|
357
|
+
var modeNames2 = ["light", "dark", "sepia", "contrast"];
|
|
358
|
+
function resolveMode(preference, systemMode) {
|
|
359
|
+
return preference === "system" ? systemMode : preference;
|
|
360
|
+
}
|
|
361
|
+
function useThemeStore(options, storage, system) {
|
|
362
|
+
const { defaultSchema = "tinta", defaultMode = "light" } = options;
|
|
363
|
+
const [persisted] = (0, import_react6.useState)(() => storage.read());
|
|
364
|
+
const [schema, setSchema] = (0, import_react6.useState)(persisted?.schema ?? defaultSchema);
|
|
365
|
+
const [preference, setPreference] = (0, import_react6.useState)(
|
|
366
|
+
persisted?.preference ?? defaultMode
|
|
367
|
+
);
|
|
368
|
+
const [systemMode, setSystemMode] = (0, import_react6.useState)(() => system.get());
|
|
369
|
+
(0, import_react6.useEffect)(() => {
|
|
370
|
+
if (preference !== "system") return;
|
|
371
|
+
const update = () => setSystemMode(system.get());
|
|
372
|
+
update();
|
|
373
|
+
return system.subscribe(update);
|
|
374
|
+
}, [preference, system]);
|
|
375
|
+
const mode = resolveMode(preference, systemMode);
|
|
376
|
+
(0, import_react6.useEffect)(() => {
|
|
377
|
+
storage.write({ schema, preference });
|
|
378
|
+
}, [schema, preference, storage]);
|
|
379
|
+
return (0, import_react6.useMemo)(
|
|
380
|
+
() => ({
|
|
381
|
+
schema,
|
|
382
|
+
mode,
|
|
383
|
+
preference,
|
|
384
|
+
colorTokens: schemas[schema][mode].color,
|
|
385
|
+
setSchema,
|
|
386
|
+
setMode: setPreference,
|
|
387
|
+
toggleMode: () => setPreference(mode === "dark" ? "light" : "dark"),
|
|
388
|
+
cycleMode: () => {
|
|
389
|
+
const next = modeNames2[(modeNames2.indexOf(mode) + 1) % modeNames2.length];
|
|
390
|
+
if (next) setPreference(next);
|
|
391
|
+
}
|
|
392
|
+
}),
|
|
393
|
+
[schema, mode, preference]
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// src/theme/context/theme-context.tsx
|
|
188
398
|
var import_react7 = require("react");
|
|
189
399
|
|
|
400
|
+
// src/theme/adapters.ts
|
|
401
|
+
var SYSTEM_QUERIES = ["(prefers-contrast: more)", "(prefers-color-scheme: dark)"];
|
|
402
|
+
function createWebStorageAdapter(storageKey, persist) {
|
|
403
|
+
return {
|
|
404
|
+
read() {
|
|
405
|
+
if (!persist || typeof window === "undefined") return null;
|
|
406
|
+
try {
|
|
407
|
+
const raw = window.localStorage.getItem(storageKey);
|
|
408
|
+
return raw ? JSON.parse(raw) : null;
|
|
409
|
+
} catch {
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
write(value) {
|
|
414
|
+
if (!persist || typeof window === "undefined") return;
|
|
415
|
+
try {
|
|
416
|
+
window.localStorage.setItem(storageKey, JSON.stringify(value));
|
|
417
|
+
} catch {
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
function createWebSystemModeAdapter() {
|
|
423
|
+
function get() {
|
|
424
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return "light";
|
|
425
|
+
if (window.matchMedia("(prefers-contrast: more)").matches) return "contrast";
|
|
426
|
+
if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
|
|
427
|
+
return "light";
|
|
428
|
+
}
|
|
429
|
+
return {
|
|
430
|
+
get,
|
|
431
|
+
subscribe(onChange) {
|
|
432
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
433
|
+
return () => {
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
const mqls = SYSTEM_QUERIES.map((q) => window.matchMedia(q));
|
|
437
|
+
for (const mql of mqls) mql.addEventListener?.("change", onChange);
|
|
438
|
+
return () => {
|
|
439
|
+
for (const mql of mqls) mql.removeEventListener?.("change", onChange);
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
|
|
190
445
|
// src/theme/context/theme-context.tsx
|
|
191
|
-
var import_react6 = require("react");
|
|
192
446
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
193
447
|
var noop = () => {
|
|
194
448
|
};
|
|
@@ -202,29 +456,7 @@ var DEFAULT_VALUE = {
|
|
|
202
456
|
toggleMode: noop,
|
|
203
457
|
cycleMode: noop
|
|
204
458
|
};
|
|
205
|
-
var ThemeContext = (0,
|
|
206
|
-
function resolveSystemMode() {
|
|
207
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return "light";
|
|
208
|
-
if (window.matchMedia("(prefers-contrast: more)").matches) return "contrast";
|
|
209
|
-
if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
|
|
210
|
-
return "light";
|
|
211
|
-
}
|
|
212
|
-
function readStored(key) {
|
|
213
|
-
if (typeof window === "undefined") return null;
|
|
214
|
-
try {
|
|
215
|
-
const raw = window.localStorage.getItem(key);
|
|
216
|
-
return raw ? JSON.parse(raw) : null;
|
|
217
|
-
} catch {
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
function writeStored(key, value) {
|
|
222
|
-
if (typeof window === "undefined") return;
|
|
223
|
-
try {
|
|
224
|
-
window.localStorage.setItem(key, JSON.stringify(value));
|
|
225
|
-
} catch {
|
|
226
|
-
}
|
|
227
|
-
}
|
|
459
|
+
var ThemeContext = (0, import_react7.createContext)(null);
|
|
228
460
|
function ThemeProvider({
|
|
229
461
|
children,
|
|
230
462
|
defaultSchema = "tinta",
|
|
@@ -232,50 +464,29 @@ function ThemeProvider({
|
|
|
232
464
|
storageKey = "ds-theme",
|
|
233
465
|
persist = true
|
|
234
466
|
}) {
|
|
235
|
-
const
|
|
236
|
-
() =>
|
|
237
|
-
|
|
238
|
-
const [preference, setPreference] = (0, import_react6.useState)(
|
|
239
|
-
() => (persist ? readStored(storageKey)?.preference : null) ?? defaultMode
|
|
467
|
+
const storage = (0, import_react7.useMemo)(
|
|
468
|
+
() => createWebStorageAdapter(storageKey, persist),
|
|
469
|
+
[storageKey, persist]
|
|
240
470
|
);
|
|
241
|
-
const
|
|
242
|
-
(
|
|
243
|
-
|
|
244
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
245
|
-
const mqls = ["(prefers-contrast: more)", "(prefers-color-scheme: dark)"].map(
|
|
246
|
-
(q) => window.matchMedia(q)
|
|
247
|
-
);
|
|
248
|
-
const onChange = () => setSystemMode(resolveSystemMode());
|
|
249
|
-
onChange();
|
|
250
|
-
for (const mql of mqls) mql.addEventListener?.("change", onChange);
|
|
251
|
-
return () => {
|
|
252
|
-
for (const mql of mqls) mql.removeEventListener?.("change", onChange);
|
|
253
|
-
};
|
|
254
|
-
}, [preference]);
|
|
255
|
-
const mode = preference === "system" ? systemMode : preference;
|
|
256
|
-
(0, import_react6.useEffect)(() => {
|
|
257
|
-
if (persist) writeStored(storageKey, { schema, preference });
|
|
258
|
-
}, [schema, preference, persist, storageKey]);
|
|
259
|
-
const value = (0, import_react6.useMemo)(
|
|
471
|
+
const system = (0, import_react7.useMemo)(() => createWebSystemModeAdapter(), []);
|
|
472
|
+
const store = useThemeStore({ defaultSchema, defaultMode }, storage, system);
|
|
473
|
+
const value = (0, import_react7.useMemo)(
|
|
260
474
|
() => ({
|
|
261
|
-
schema,
|
|
262
|
-
mode,
|
|
263
|
-
preference,
|
|
264
|
-
themeClass: themes[schema][mode],
|
|
265
|
-
setSchema,
|
|
266
|
-
setMode:
|
|
267
|
-
toggleMode:
|
|
268
|
-
cycleMode:
|
|
269
|
-
const next = modeNames[(modeNames.indexOf(mode) + 1) % modeNames.length];
|
|
270
|
-
if (next) setPreference(next);
|
|
271
|
-
}
|
|
475
|
+
schema: store.schema,
|
|
476
|
+
mode: store.mode,
|
|
477
|
+
preference: store.preference,
|
|
478
|
+
themeClass: themes[store.schema][store.mode],
|
|
479
|
+
setSchema: store.setSchema,
|
|
480
|
+
setMode: store.setMode,
|
|
481
|
+
toggleMode: store.toggleMode,
|
|
482
|
+
cycleMode: store.cycleMode
|
|
272
483
|
}),
|
|
273
|
-
[
|
|
484
|
+
[store]
|
|
274
485
|
);
|
|
275
486
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ThemeContext.Provider, { value, children });
|
|
276
487
|
}
|
|
277
488
|
function useTheme() {
|
|
278
|
-
return (0,
|
|
489
|
+
return (0, import_react7.useContext)(ThemeContext) ?? DEFAULT_VALUE;
|
|
279
490
|
}
|
|
280
491
|
|
|
281
492
|
// src/theme/typography.css.ts
|
|
@@ -293,7 +504,7 @@ function useStyles2({
|
|
|
293
504
|
align: align2
|
|
294
505
|
}) {
|
|
295
506
|
const { themeClass } = useTheme();
|
|
296
|
-
const className = (0,
|
|
507
|
+
const className = (0, import_react8.useMemo)(
|
|
297
508
|
() => [
|
|
298
509
|
themeClass,
|
|
299
510
|
base,
|
|
@@ -328,14 +539,14 @@ function TypographyInner({ variant: variant2, as, color: color2, align: align2,
|
|
|
328
539
|
const { testId: dataTestId } = useTestId("text", testId);
|
|
329
540
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Component, { ref, "data-testid": dataTestId, ...rest, className: text2 });
|
|
330
541
|
}
|
|
331
|
-
var TypographyForwarded = (0,
|
|
542
|
+
var TypographyForwarded = (0, import_react9.forwardRef)(
|
|
332
543
|
TypographyInner
|
|
333
544
|
);
|
|
334
545
|
TypographyForwarded.displayName = "Typography";
|
|
335
546
|
var Typography = TypographyForwarded;
|
|
336
547
|
|
|
337
548
|
// src/components/button/index.tsx
|
|
338
|
-
var
|
|
549
|
+
var import_react11 = require("react");
|
|
339
550
|
|
|
340
551
|
// src/testing/states.ts
|
|
341
552
|
function states(map) {
|
|
@@ -344,7 +555,7 @@ function states(map) {
|
|
|
344
555
|
}
|
|
345
556
|
|
|
346
557
|
// src/components/button/use-styles.ts
|
|
347
|
-
var
|
|
558
|
+
var import_react10 = require("react");
|
|
348
559
|
|
|
349
560
|
// src/components/button/use-styles.css.ts
|
|
350
561
|
var full = "use-styles_full__1pbtill4";
|
|
@@ -365,7 +576,7 @@ function useStyles3({
|
|
|
365
576
|
className
|
|
366
577
|
}) {
|
|
367
578
|
const { themeClass } = useTheme();
|
|
368
|
-
const container = (0,
|
|
579
|
+
const container = (0, import_react10.useMemo)(
|
|
369
580
|
() => [
|
|
370
581
|
themeClass,
|
|
371
582
|
root,
|
|
@@ -382,7 +593,7 @@ function useStyles3({
|
|
|
382
593
|
// src/components/button/index.tsx
|
|
383
594
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
384
595
|
var ICON_SIZE = { sm: 14, md: 16, lg: 18 };
|
|
385
|
-
var Button = (0,
|
|
596
|
+
var Button = (0, import_react11.forwardRef)(function Button2({
|
|
386
597
|
variant: variant2,
|
|
387
598
|
tone: tone4,
|
|
388
599
|
size: size3 = "md",
|
|
@@ -417,10 +628,10 @@ var Button = (0, import_react10.forwardRef)(function Button2({
|
|
|
417
628
|
});
|
|
418
629
|
|
|
419
630
|
// src/components/divider/index.tsx
|
|
420
|
-
var
|
|
631
|
+
var import_react13 = require("react");
|
|
421
632
|
|
|
422
633
|
// src/components/divider/use-styles.ts
|
|
423
|
-
var
|
|
634
|
+
var import_react12 = require("react");
|
|
424
635
|
|
|
425
636
|
// src/components/divider/use-styles.css.ts
|
|
426
637
|
var horizontal = "use-styles_horizontal__1n7v7yj1";
|
|
@@ -433,7 +644,7 @@ var vertical = "use-styles_vertical__1n7v7yj2";
|
|
|
433
644
|
// src/components/divider/use-styles.ts
|
|
434
645
|
function useStyles4({ vertical: vertical2, hasLabel }) {
|
|
435
646
|
const { themeClass } = useTheme();
|
|
436
|
-
const root24 = (0,
|
|
647
|
+
const root24 = (0, import_react12.useMemo)(
|
|
437
648
|
() => [
|
|
438
649
|
themeClass,
|
|
439
650
|
root2,
|
|
@@ -446,7 +657,7 @@ function useStyles4({ vertical: vertical2, hasLabel }) {
|
|
|
446
657
|
|
|
447
658
|
// src/components/divider/index.tsx
|
|
448
659
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
449
|
-
var Divider = (0,
|
|
660
|
+
var Divider = (0, import_react13.forwardRef)(function Divider2({ vertical: vertical2, label: label7, testId, ...rest }, ref) {
|
|
450
661
|
const hasLabel = label7 != null;
|
|
451
662
|
const { root: root24, line: line2, label: labelClass } = useStyles4({ vertical: vertical2, hasLabel });
|
|
452
663
|
const { testId: dataTestId, slot } = useTestId("layout", testId);
|
|
@@ -461,10 +672,10 @@ var Divider = (0, import_react12.forwardRef)(function Divider2({ vertical: verti
|
|
|
461
672
|
});
|
|
462
673
|
|
|
463
674
|
// src/components/avatar/index.tsx
|
|
464
|
-
var
|
|
675
|
+
var import_react15 = require("react");
|
|
465
676
|
|
|
466
677
|
// src/components/avatar/use-styles.ts
|
|
467
|
-
var
|
|
678
|
+
var import_react14 = require("react");
|
|
468
679
|
|
|
469
680
|
// src/components/avatar/use-styles.css.ts
|
|
470
681
|
var root3 = "use-styles_root__1mn1rmu0";
|
|
@@ -478,7 +689,7 @@ function useStyles5({
|
|
|
478
689
|
className
|
|
479
690
|
}) {
|
|
480
691
|
const { themeClass } = useTheme();
|
|
481
|
-
const root24 = (0,
|
|
692
|
+
const root24 = (0, import_react14.useMemo)(
|
|
482
693
|
() => [
|
|
483
694
|
themeClass,
|
|
484
695
|
root3,
|
|
@@ -493,17 +704,17 @@ function useStyles5({
|
|
|
493
704
|
|
|
494
705
|
// src/components/avatar/index.tsx
|
|
495
706
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
496
|
-
var Avatar = (0,
|
|
707
|
+
var Avatar = (0, import_react15.forwardRef)(function Avatar2({ size: size3, filled, className, children, testId, ...rest }, ref) {
|
|
497
708
|
const { root: root24 } = useStyles5({ size: size3, filled, className });
|
|
498
709
|
const { testId: dataTestId } = useTestId("media", testId);
|
|
499
710
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { ref, className: root24, "data-testid": dataTestId, ...rest, children });
|
|
500
711
|
});
|
|
501
712
|
|
|
502
713
|
// src/components/badge/index.tsx
|
|
503
|
-
var
|
|
714
|
+
var import_react17 = require("react");
|
|
504
715
|
|
|
505
716
|
// src/components/badge/use-styles.ts
|
|
506
|
-
var
|
|
717
|
+
var import_react16 = require("react");
|
|
507
718
|
|
|
508
719
|
// src/components/badge/use-styles.css.ts
|
|
509
720
|
var dot = "use-styles_dot__1wpei6p1";
|
|
@@ -516,17 +727,17 @@ function useStyles6({
|
|
|
516
727
|
className
|
|
517
728
|
}) {
|
|
518
729
|
const { themeClass } = useTheme();
|
|
519
|
-
const root24 = (0,
|
|
730
|
+
const root24 = (0, import_react16.useMemo)(
|
|
520
731
|
() => [themeClass, root4, className].filter(Boolean).join(" "),
|
|
521
732
|
[themeClass, className]
|
|
522
733
|
);
|
|
523
|
-
const dot3 = (0,
|
|
734
|
+
const dot3 = (0, import_react16.useMemo)(() => [dot, tone2[tone4]].join(" "), [tone4]);
|
|
524
735
|
return { root: root24, dot: dot3 };
|
|
525
736
|
}
|
|
526
737
|
|
|
527
738
|
// src/components/badge/index.tsx
|
|
528
739
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
529
|
-
var Badge = (0,
|
|
740
|
+
var Badge = (0, import_react17.forwardRef)(function Badge2({ count, tone: tone4, className, children, testId, ...rest }, ref) {
|
|
530
741
|
const { root: root24, dot: dot3 } = useStyles6({ tone: tone4, className });
|
|
531
742
|
const { testId: dataTestId, slot } = useTestId("media", testId);
|
|
532
743
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { ref, className: root24, "data-testid": dataTestId, ...rest, children: [
|
|
@@ -536,10 +747,10 @@ var Badge = (0, import_react16.forwardRef)(function Badge2({ count, tone: tone4,
|
|
|
536
747
|
});
|
|
537
748
|
|
|
538
749
|
// src/components/progress/index.tsx
|
|
539
|
-
var
|
|
750
|
+
var import_react19 = require("react");
|
|
540
751
|
|
|
541
752
|
// src/components/progress/use-styles.ts
|
|
542
|
-
var
|
|
753
|
+
var import_react18 = require("react");
|
|
543
754
|
|
|
544
755
|
// src/components/progress/use-styles.css.ts
|
|
545
756
|
var bar = "use-styles_bar__kbop7v3";
|
|
@@ -555,7 +766,7 @@ function useStyles7({
|
|
|
555
766
|
}) {
|
|
556
767
|
const { themeClass } = useTheme();
|
|
557
768
|
const indeterminate2 = value === void 0;
|
|
558
|
-
return (0,
|
|
769
|
+
return (0, import_react18.useMemo)(() => {
|
|
559
770
|
const root24 = (...classes) => [themeClass, ...classes, className].filter(Boolean).join(" ");
|
|
560
771
|
if (variant2 === "circular") {
|
|
561
772
|
return { track: "", bar: "", spinner: root24(spinner) };
|
|
@@ -570,7 +781,7 @@ function useStyles7({
|
|
|
570
781
|
|
|
571
782
|
// src/components/progress/index.tsx
|
|
572
783
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
573
|
-
var Progress = (0,
|
|
784
|
+
var Progress = (0, import_react19.forwardRef)(function Progress2({ variant: variant2 = "linear", value, size: size3 = 20, className, testId, ...rest }, ref) {
|
|
574
785
|
const { track: track4, bar: bar2, spinner: spinner2 } = useStyles7({ variant: variant2, value, className });
|
|
575
786
|
const indeterminate2 = value === void 0;
|
|
576
787
|
const { testId: dataTestId, slot } = useTestId("media", testId);
|
|
@@ -616,7 +827,7 @@ var Progress = (0, import_react18.forwardRef)(function Progress2({ variant: vari
|
|
|
616
827
|
});
|
|
617
828
|
|
|
618
829
|
// src/components/chip/index.tsx
|
|
619
|
-
var
|
|
830
|
+
var import_react21 = require("react");
|
|
620
831
|
|
|
621
832
|
// src/components/icons/x/index.tsx
|
|
622
833
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -644,7 +855,7 @@ function XIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
644
855
|
}
|
|
645
856
|
|
|
646
857
|
// src/components/chip/use-styles.ts
|
|
647
|
-
var
|
|
858
|
+
var import_react20 = require("react");
|
|
648
859
|
|
|
649
860
|
// src/components/chip/use-styles.css.ts
|
|
650
861
|
var clickable = "use-styles_clickable__1axilf44";
|
|
@@ -660,7 +871,7 @@ function useStyles8({
|
|
|
660
871
|
clickable: clickable2
|
|
661
872
|
}) {
|
|
662
873
|
const { themeClass } = useTheme();
|
|
663
|
-
const root24 = (0,
|
|
874
|
+
const root24 = (0, import_react20.useMemo)(
|
|
664
875
|
() => [
|
|
665
876
|
themeClass,
|
|
666
877
|
root5,
|
|
@@ -674,7 +885,7 @@ function useStyles8({
|
|
|
674
885
|
|
|
675
886
|
// src/components/chip/index.tsx
|
|
676
887
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
677
|
-
var Chip = (0,
|
|
888
|
+
var Chip = (0, import_react21.forwardRef)(function Chip2({ selected: selected3, tone: tone4, onDelete, onClick, children, testId, ...rest }, ref) {
|
|
678
889
|
const clickable2 = Boolean(onClick);
|
|
679
890
|
const { root: root24, deleteBtn: deleteBtn2 } = useStyles8({ selected: selected3, tone: tone4, clickable: clickable2 });
|
|
680
891
|
const { testId: dataTestId, slot } = useTestId("media", testId);
|
|
@@ -710,7 +921,7 @@ var Chip = (0, import_react20.forwardRef)(function Chip2({ selected: selected3,
|
|
|
710
921
|
});
|
|
711
922
|
|
|
712
923
|
// src/components/checkbox/index.tsx
|
|
713
|
-
var
|
|
924
|
+
var import_react23 = require("react");
|
|
714
925
|
|
|
715
926
|
// src/components/icons/check/index.tsx
|
|
716
927
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
@@ -735,7 +946,7 @@ function CheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
735
946
|
}
|
|
736
947
|
|
|
737
948
|
// src/components/checkbox/use-styles.ts
|
|
738
|
-
var
|
|
949
|
+
var import_react22 = require("react");
|
|
739
950
|
|
|
740
951
|
// src/components/checkbox/use-styles.css.ts
|
|
741
952
|
var box = "use-styles_box__9zoga91";
|
|
@@ -748,11 +959,11 @@ var root6 = "use-styles_root__9zoga90";
|
|
|
748
959
|
// src/components/checkbox/use-styles.ts
|
|
749
960
|
function useStyles9({ checked, disabled: disabled3 }) {
|
|
750
961
|
const { themeClass } = useTheme();
|
|
751
|
-
const root24 = (0,
|
|
962
|
+
const root24 = (0, import_react22.useMemo)(
|
|
752
963
|
() => [themeClass, root6, disabled3 && disabled].filter(Boolean).join(" "),
|
|
753
964
|
[themeClass, disabled3]
|
|
754
965
|
);
|
|
755
|
-
const box2 = (0,
|
|
966
|
+
const box2 = (0, import_react22.useMemo)(
|
|
756
967
|
() => [box, checked && boxChecked].filter(Boolean).join(" "),
|
|
757
968
|
[checked]
|
|
758
969
|
);
|
|
@@ -761,7 +972,7 @@ function useStyles9({ checked, disabled: disabled3 }) {
|
|
|
761
972
|
|
|
762
973
|
// src/components/checkbox/index.tsx
|
|
763
974
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
764
|
-
var Checkbox = (0,
|
|
975
|
+
var Checkbox = (0, import_react23.forwardRef)(function Checkbox2({ checked = false, onChange, label: label7, disabled: disabled3 = false, id, testId, ...rest }, ref) {
|
|
765
976
|
const { root: root24, input: input6, box: box2, check: check2 } = useStyles9({ checked, disabled: disabled3 });
|
|
766
977
|
const { testId: dataTestId } = useTestId("toggle", testId);
|
|
767
978
|
const handleChange = (e) => {
|
|
@@ -788,10 +999,10 @@ var Checkbox = (0, import_react22.forwardRef)(function Checkbox2({ checked = fal
|
|
|
788
999
|
});
|
|
789
1000
|
|
|
790
1001
|
// src/components/radio/index.tsx
|
|
791
|
-
var
|
|
1002
|
+
var import_react25 = require("react");
|
|
792
1003
|
|
|
793
1004
|
// src/components/radio/use-styles.ts
|
|
794
|
-
var
|
|
1005
|
+
var import_react24 = require("react");
|
|
795
1006
|
|
|
796
1007
|
// src/components/radio/use-styles.css.ts
|
|
797
1008
|
var circle = "use-styles_circle__vy61b42";
|
|
@@ -807,7 +1018,7 @@ function useStyles10({
|
|
|
807
1018
|
className
|
|
808
1019
|
}) {
|
|
809
1020
|
const { themeClass } = useTheme();
|
|
810
|
-
const root24 = (0,
|
|
1021
|
+
const root24 = (0, import_react24.useMemo)(
|
|
811
1022
|
() => [themeClass, root7, disabled3 && disabled2, className].filter(Boolean).join(" "),
|
|
812
1023
|
[themeClass, disabled3, className]
|
|
813
1024
|
);
|
|
@@ -822,7 +1033,7 @@ function useStyles10({
|
|
|
822
1033
|
|
|
823
1034
|
// src/components/radio/index.tsx
|
|
824
1035
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
825
|
-
var Radio = (0,
|
|
1036
|
+
var Radio = (0, import_react25.forwardRef)(function Radio2({ checked, onChange, label: label7, name, value, disabled: disabled3, testId, ...rest }, ref) {
|
|
826
1037
|
const { root: root24, input: input6, circle: circle2, dot: dot3, label: labelClass } = useStyles10({ disabled: disabled3 });
|
|
827
1038
|
const { testId: dataTestId } = useTestId("toggle", testId);
|
|
828
1039
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: root24, "data-testid": dataTestId, "data-state": states({ checked, disabled: disabled3 }), children: [
|
|
@@ -846,10 +1057,10 @@ var Radio = (0, import_react24.forwardRef)(function Radio2({ checked, onChange,
|
|
|
846
1057
|
});
|
|
847
1058
|
|
|
848
1059
|
// src/components/switch/index.tsx
|
|
849
|
-
var
|
|
1060
|
+
var import_react27 = require("react");
|
|
850
1061
|
|
|
851
1062
|
// src/components/switch/use-styles.ts
|
|
852
|
-
var
|
|
1063
|
+
var import_react26 = require("react");
|
|
853
1064
|
|
|
854
1065
|
// src/components/switch/use-styles.css.ts
|
|
855
1066
|
var input3 = "surfaces_srOnly__1qa7atn0";
|
|
@@ -863,7 +1074,7 @@ var trackChecked = "use-styles_trackChecked__1r6kem72";
|
|
|
863
1074
|
// src/components/switch/use-styles.ts
|
|
864
1075
|
function useStyles11({ checked }) {
|
|
865
1076
|
const { themeClass } = useTheme();
|
|
866
|
-
return (0,
|
|
1077
|
+
return (0, import_react26.useMemo)(
|
|
867
1078
|
() => ({
|
|
868
1079
|
root: [themeClass, root8].filter(Boolean).join(" "),
|
|
869
1080
|
input: input3,
|
|
@@ -877,7 +1088,7 @@ function useStyles11({ checked }) {
|
|
|
877
1088
|
|
|
878
1089
|
// src/components/switch/index.tsx
|
|
879
1090
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
880
|
-
var Switch = (0,
|
|
1091
|
+
var Switch = (0, import_react27.forwardRef)(function Switch2({ checked = false, onChange, label: label7, disabled: disabled3, testId, ...rest }, ref) {
|
|
881
1092
|
const { root: root24, input: input6, track: track4, knob: knob2, label: labelClass } = useStyles11({ checked });
|
|
882
1093
|
const { testId: dataTestId } = useTestId("toggle", testId);
|
|
883
1094
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: root24, "data-testid": dataTestId, "data-state": states({ checked, disabled: disabled3 }), children: [
|
|
@@ -904,13 +1115,13 @@ var Switch = (0, import_react26.forwardRef)(function Switch2({ checked = false,
|
|
|
904
1115
|
});
|
|
905
1116
|
|
|
906
1117
|
// src/components/text-field/index.tsx
|
|
907
|
-
var
|
|
1118
|
+
var import_react30 = require("react");
|
|
908
1119
|
|
|
909
1120
|
// src/components/base-field/index.tsx
|
|
910
|
-
var
|
|
1121
|
+
var import_react29 = require("react");
|
|
911
1122
|
|
|
912
1123
|
// src/components/base-field/use-styles.ts
|
|
913
|
-
var
|
|
1124
|
+
var import_react28 = require("react");
|
|
914
1125
|
|
|
915
1126
|
// src/components/base-field/use-styles.css.ts
|
|
916
1127
|
var field = "use-styles_field__1c3cgd3";
|
|
@@ -929,7 +1140,7 @@ var trailingSlot = "use-styles_trailingSlot__1c3cgdb";
|
|
|
929
1140
|
// src/components/base-field/use-styles.ts
|
|
930
1141
|
function useStyles12({ error, hasStartIcon, hasTrailing, className }) {
|
|
931
1142
|
const { themeClass } = useTheme();
|
|
932
|
-
return (0,
|
|
1143
|
+
return (0, import_react28.useMemo)(() => {
|
|
933
1144
|
const root24 = [themeClass, root9].filter(Boolean).join(" ");
|
|
934
1145
|
const labelText2 = [labelText, error && labelTextError].filter(Boolean).join(" ");
|
|
935
1146
|
const input6 = [
|
|
@@ -954,8 +1165,8 @@ function useStyles12({ error, hasStartIcon, hasTrailing, className }) {
|
|
|
954
1165
|
|
|
955
1166
|
// src/components/base-field/index.tsx
|
|
956
1167
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
957
|
-
var BaseField = (0,
|
|
958
|
-
const autoId = (0,
|
|
1168
|
+
var BaseField = (0, import_react29.forwardRef)(function BaseField2({ label: label7, help, error, startIcon: StartIcon, trailing: trailing2, id, className, testId, children }, ref) {
|
|
1169
|
+
const autoId = (0, import_react29.useId)();
|
|
959
1170
|
const controlId = id ?? autoId;
|
|
960
1171
|
const errorMessage = error != null && error !== false && error !== true && error !== "" ? error : null;
|
|
961
1172
|
const hasError = error === true || errorMessage != null;
|
|
@@ -1003,7 +1214,7 @@ var import_jsx_runtime17 = (
|
|
|
1003
1214
|
// tipo público de la ref es HTMLInputElement (la ref aplica solo a la rama <input>).
|
|
1004
1215
|
require("react/jsx-runtime")
|
|
1005
1216
|
);
|
|
1006
|
-
var TextField = (0,
|
|
1217
|
+
var TextField = (0, import_react30.forwardRef)(function TextField2({
|
|
1007
1218
|
label: label7,
|
|
1008
1219
|
help,
|
|
1009
1220
|
error,
|
|
@@ -1054,7 +1265,7 @@ var TextField = (0, import_react29.forwardRef)(function TextField2({
|
|
|
1054
1265
|
});
|
|
1055
1266
|
|
|
1056
1267
|
// src/components/password-field/index.tsx
|
|
1057
|
-
var
|
|
1268
|
+
var import_react32 = require("react");
|
|
1058
1269
|
|
|
1059
1270
|
// src/components/icons/eye/index.tsx
|
|
1060
1271
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
@@ -1109,21 +1320,21 @@ function EyeOffIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1109
1320
|
}
|
|
1110
1321
|
|
|
1111
1322
|
// src/components/password-field/use-styles.ts
|
|
1112
|
-
var
|
|
1323
|
+
var import_react31 = require("react");
|
|
1113
1324
|
|
|
1114
1325
|
// src/components/password-field/use-styles.css.ts
|
|
1115
1326
|
var revealButton = "use-styles_revealButton__rsu9d50";
|
|
1116
1327
|
|
|
1117
1328
|
// src/components/password-field/use-styles.ts
|
|
1118
1329
|
function useStyles13() {
|
|
1119
|
-
return (0,
|
|
1330
|
+
return (0, import_react31.useMemo)(() => ({ revealButton }), []);
|
|
1120
1331
|
}
|
|
1121
1332
|
|
|
1122
1333
|
// src/components/password-field/index.tsx
|
|
1123
1334
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1124
|
-
var PasswordField = (0,
|
|
1335
|
+
var PasswordField = (0, import_react32.forwardRef)(
|
|
1125
1336
|
function PasswordField2({ label: label7, help, error, startIcon, onChange, id, className, ...rest }, ref) {
|
|
1126
|
-
const [reveal, setReveal] = (0,
|
|
1337
|
+
const [reveal, setReveal] = (0, import_react32.useState)(false);
|
|
1127
1338
|
const classes = useStyles13();
|
|
1128
1339
|
const handleChange = (e) => {
|
|
1129
1340
|
onChange?.(e.target.value);
|
|
@@ -1169,7 +1380,7 @@ var PasswordField = (0, import_react31.forwardRef)(
|
|
|
1169
1380
|
);
|
|
1170
1381
|
|
|
1171
1382
|
// src/components/money-field/index.tsx
|
|
1172
|
-
var
|
|
1383
|
+
var import_react33 = require("react");
|
|
1173
1384
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1174
1385
|
function parseAmount(raw) {
|
|
1175
1386
|
const cleaned = raw.replace(/[^0-9.-]/g, "");
|
|
@@ -1177,7 +1388,7 @@ function parseAmount(raw) {
|
|
|
1177
1388
|
const n = Number.parseFloat(cleaned);
|
|
1178
1389
|
return Number.isNaN(n) ? null : n;
|
|
1179
1390
|
}
|
|
1180
|
-
var MoneyField = (0,
|
|
1391
|
+
var MoneyField = (0, import_react33.forwardRef)(function MoneyField2({
|
|
1181
1392
|
value,
|
|
1182
1393
|
onChange,
|
|
1183
1394
|
currency = "USD",
|
|
@@ -1192,9 +1403,9 @@ var MoneyField = (0, import_react32.forwardRef)(function MoneyField2({
|
|
|
1192
1403
|
onBlur,
|
|
1193
1404
|
...rest
|
|
1194
1405
|
}, ref) {
|
|
1195
|
-
const [focused, setFocused] = (0,
|
|
1196
|
-
const [draft, setDraft] = (0,
|
|
1197
|
-
const formatter = (0,
|
|
1406
|
+
const [focused, setFocused] = (0, import_react33.useState)(false);
|
|
1407
|
+
const [draft, setDraft] = (0, import_react33.useState)("");
|
|
1408
|
+
const formatter = (0, import_react33.useMemo)(
|
|
1198
1409
|
() => new Intl.NumberFormat(locale, { style: "currency", currency }),
|
|
1199
1410
|
[locale, currency]
|
|
1200
1411
|
);
|
|
@@ -1237,10 +1448,10 @@ var MoneyField = (0, import_react32.forwardRef)(function MoneyField2({
|
|
|
1237
1448
|
});
|
|
1238
1449
|
|
|
1239
1450
|
// src/components/icon-button/index.tsx
|
|
1240
|
-
var
|
|
1451
|
+
var import_react35 = require("react");
|
|
1241
1452
|
|
|
1242
1453
|
// src/components/icon-button/use-styles.ts
|
|
1243
|
-
var
|
|
1454
|
+
var import_react34 = require("react");
|
|
1244
1455
|
|
|
1245
1456
|
// src/components/icon-button/use-styles.css.ts
|
|
1246
1457
|
var accent = "use-styles_accent__18np0q02";
|
|
@@ -1253,7 +1464,7 @@ function useStyles14({
|
|
|
1253
1464
|
tone: tone4 = "ink"
|
|
1254
1465
|
}) {
|
|
1255
1466
|
const { themeClass } = useTheme();
|
|
1256
|
-
const root24 = (0,
|
|
1467
|
+
const root24 = (0, import_react34.useMemo)(
|
|
1257
1468
|
() => [themeClass, root10, tone4 === "accent" && accent, active2 && active].filter(Boolean).join(" "),
|
|
1258
1469
|
[themeClass, active2, tone4]
|
|
1259
1470
|
);
|
|
@@ -1262,7 +1473,7 @@ function useStyles14({
|
|
|
1262
1473
|
|
|
1263
1474
|
// src/components/icon-button/index.tsx
|
|
1264
1475
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1265
|
-
var IconButton = (0,
|
|
1476
|
+
var IconButton = (0, import_react35.forwardRef)(function IconButton2({ icon: Icon, active: active2, tone: tone4, title, type = "button", testId, ...rest }, ref) {
|
|
1266
1477
|
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
1267
1478
|
const restProps = rest;
|
|
1268
1479
|
const hasName = title.trim() !== "" || restProps["aria-label"] != null || restProps["aria-labelledby"] != null;
|
|
@@ -1289,10 +1500,10 @@ var IconButton = (0, import_react34.forwardRef)(function IconButton2({ icon: Ico
|
|
|
1289
1500
|
});
|
|
1290
1501
|
|
|
1291
1502
|
// src/components/card/index.tsx
|
|
1292
|
-
var
|
|
1503
|
+
var import_react37 = require("react");
|
|
1293
1504
|
|
|
1294
1505
|
// src/components/card/use-styles.ts
|
|
1295
|
-
var
|
|
1506
|
+
var import_react36 = require("react");
|
|
1296
1507
|
|
|
1297
1508
|
// src/components/card/use-styles.css.ts
|
|
1298
1509
|
var body = "use-styles_body__1fuvd022";
|
|
@@ -1303,13 +1514,13 @@ var root11 = "use-styles_root__1fuvd020";
|
|
|
1303
1514
|
// src/components/card/use-styles.ts
|
|
1304
1515
|
function useStyles15() {
|
|
1305
1516
|
const { themeClass } = useTheme();
|
|
1306
|
-
const root24 = (0,
|
|
1517
|
+
const root24 = (0, import_react36.useMemo)(() => `${themeClass} ${root11}`, [themeClass]);
|
|
1307
1518
|
return { root: root24, header, body, footer };
|
|
1308
1519
|
}
|
|
1309
1520
|
|
|
1310
1521
|
// src/components/card/index.tsx
|
|
1311
1522
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1312
|
-
var CardRoot = (0,
|
|
1523
|
+
var CardRoot = (0, import_react37.forwardRef)(function Card({ children, testId, ...rest }, ref) {
|
|
1313
1524
|
const { root: root24 } = useStyles15();
|
|
1314
1525
|
const { testId: dataTestId } = useTestId("layout", testId);
|
|
1315
1526
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, className: root24, "data-testid": dataTestId, ...rest, children });
|
|
@@ -1337,7 +1548,7 @@ var Card2 = Object.assign(CardRoot, {
|
|
|
1337
1548
|
});
|
|
1338
1549
|
|
|
1339
1550
|
// src/components/alert/index.tsx
|
|
1340
|
-
var
|
|
1551
|
+
var import_react39 = require("react");
|
|
1341
1552
|
|
|
1342
1553
|
// src/components/icons/circle-check/index.tsx
|
|
1343
1554
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
@@ -1443,7 +1654,7 @@ function TriangleAlertIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1443
1654
|
}
|
|
1444
1655
|
|
|
1445
1656
|
// src/components/alert/use-styles.ts
|
|
1446
|
-
var
|
|
1657
|
+
var import_react38 = require("react");
|
|
1447
1658
|
|
|
1448
1659
|
// src/components/alert/use-styles.css.ts
|
|
1449
1660
|
var content = "use-styles_content__ivsh6u6";
|
|
@@ -1457,7 +1668,7 @@ function useStyles16({
|
|
|
1457
1668
|
className
|
|
1458
1669
|
}) {
|
|
1459
1670
|
const { themeClass } = useTheme();
|
|
1460
|
-
const root24 = (0,
|
|
1671
|
+
const root24 = (0, import_react38.useMemo)(
|
|
1461
1672
|
() => [themeClass, root12, severity[severity2], className].filter(Boolean).join(" "),
|
|
1462
1673
|
[themeClass, severity2, className]
|
|
1463
1674
|
);
|
|
@@ -1476,7 +1687,7 @@ var defaultIcons = {
|
|
|
1476
1687
|
warn: TriangleAlertIcon,
|
|
1477
1688
|
danger: CircleXIcon
|
|
1478
1689
|
};
|
|
1479
|
-
var Alert = (0,
|
|
1690
|
+
var Alert = (0, import_react39.forwardRef)(function Alert2({ severity: severity2 = "info", title, icon, className, testId, children, ...rest }, ref) {
|
|
1480
1691
|
const styles = useStyles16({ severity: severity2, className });
|
|
1481
1692
|
const { testId: dataTestId, slot } = useTestId("feedback", testId);
|
|
1482
1693
|
const IconComponent = icon ?? defaultIcons[severity2];
|
|
@@ -1490,10 +1701,10 @@ var Alert = (0, import_react38.forwardRef)(function Alert2({ severity: severity2
|
|
|
1490
1701
|
});
|
|
1491
1702
|
|
|
1492
1703
|
// src/components/tooltip/index.tsx
|
|
1493
|
-
var
|
|
1704
|
+
var import_react41 = require("react");
|
|
1494
1705
|
|
|
1495
1706
|
// src/components/tooltip/use-styles.ts
|
|
1496
|
-
var
|
|
1707
|
+
var import_react40 = require("react");
|
|
1497
1708
|
|
|
1498
1709
|
// src/components/tooltip/use-styles.css.ts
|
|
1499
1710
|
var bubble = "use-styles_bubble__h9kvh1 surfaces_inkySurface__1qa7atn2";
|
|
@@ -1505,11 +1716,11 @@ function useStyles17({
|
|
|
1505
1716
|
placement: placement2 = "top"
|
|
1506
1717
|
}) {
|
|
1507
1718
|
const { themeClass } = useTheme();
|
|
1508
|
-
const wrapper4 = (0,
|
|
1719
|
+
const wrapper4 = (0, import_react40.useMemo)(
|
|
1509
1720
|
() => [themeClass, wrapper].filter(Boolean).join(" "),
|
|
1510
1721
|
[themeClass]
|
|
1511
1722
|
);
|
|
1512
|
-
const bubble2 = (0,
|
|
1723
|
+
const bubble2 = (0, import_react40.useMemo)(
|
|
1513
1724
|
() => [bubble, placement[placement2]].filter(Boolean).join(" "),
|
|
1514
1725
|
[placement2]
|
|
1515
1726
|
);
|
|
@@ -1519,12 +1730,12 @@ function useStyles17({
|
|
|
1519
1730
|
// src/components/tooltip/index.tsx
|
|
1520
1731
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1521
1732
|
var HIDE_DELAY = 120;
|
|
1522
|
-
var Tooltip = (0,
|
|
1523
|
-
const [open, setOpen] = (0,
|
|
1524
|
-
const tooltipId = (0,
|
|
1733
|
+
var Tooltip = (0, import_react41.forwardRef)(function Tooltip2({ label: label7, children, placement: placement2, testId }, ref) {
|
|
1734
|
+
const [open, setOpen] = (0, import_react41.useState)(false);
|
|
1735
|
+
const tooltipId = (0, import_react41.useId)();
|
|
1525
1736
|
const { wrapper: wrapper4, bubble: bubble2 } = useStyles17({ placement: placement2 });
|
|
1526
1737
|
const { testId: dataTestId, slot } = useTestId("feedback", testId);
|
|
1527
|
-
const hideTimer = (0,
|
|
1738
|
+
const hideTimer = (0, import_react41.useRef)(null);
|
|
1528
1739
|
const clearHide = () => {
|
|
1529
1740
|
if (hideTimer.current) {
|
|
1530
1741
|
clearTimeout(hideTimer.current);
|
|
@@ -1543,7 +1754,7 @@ var Tooltip = (0, import_react40.forwardRef)(function Tooltip2({ label: label7,
|
|
|
1543
1754
|
clearHide();
|
|
1544
1755
|
setOpen(false);
|
|
1545
1756
|
};
|
|
1546
|
-
(0,
|
|
1757
|
+
(0, import_react41.useEffect)(() => {
|
|
1547
1758
|
return () => {
|
|
1548
1759
|
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
1549
1760
|
};
|
|
@@ -1556,7 +1767,7 @@ var Tooltip = (0, import_react40.forwardRef)(function Tooltip2({ label: label7,
|
|
|
1556
1767
|
};
|
|
1557
1768
|
const previousDescribedBy = children.props["aria-describedby"];
|
|
1558
1769
|
const describedBy = open ? [previousDescribedBy, tooltipId].filter(Boolean).join(" ") : previousDescribedBy;
|
|
1559
|
-
const trigger2 = (0,
|
|
1770
|
+
const trigger2 = (0, import_react41.cloneElement)(children, { "aria-describedby": describedBy });
|
|
1560
1771
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1561
1772
|
"span",
|
|
1562
1773
|
{
|
|
@@ -1588,7 +1799,7 @@ var Tooltip = (0, import_react40.forwardRef)(function Tooltip2({ label: label7,
|
|
|
1588
1799
|
});
|
|
1589
1800
|
|
|
1590
1801
|
// src/components/select/index.tsx
|
|
1591
|
-
var
|
|
1802
|
+
var import_react43 = require("react");
|
|
1592
1803
|
|
|
1593
1804
|
// src/components/icons/chevron-down/index.tsx
|
|
1594
1805
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -1613,7 +1824,7 @@ function ChevronDownIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1613
1824
|
}
|
|
1614
1825
|
|
|
1615
1826
|
// src/components/select/use-styles.ts
|
|
1616
|
-
var
|
|
1827
|
+
var import_react42 = require("react");
|
|
1617
1828
|
|
|
1618
1829
|
// src/components/select/use-styles.css.ts
|
|
1619
1830
|
var chevron = "use-styles_chevron__1w1czpb4";
|
|
@@ -1632,7 +1843,7 @@ function useStyles18({
|
|
|
1632
1843
|
open = false
|
|
1633
1844
|
}) {
|
|
1634
1845
|
const { themeClass } = useTheme();
|
|
1635
|
-
return (0,
|
|
1846
|
+
return (0, import_react42.useMemo)(() => {
|
|
1636
1847
|
const chevron3 = [chevron, open && chevronOpen].filter(Boolean).join(" ");
|
|
1637
1848
|
return {
|
|
1638
1849
|
root: [themeClass, root13].filter(Boolean).join(" "),
|
|
@@ -1648,16 +1859,16 @@ function useStyles18({
|
|
|
1648
1859
|
|
|
1649
1860
|
// src/components/select/index.tsx
|
|
1650
1861
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1651
|
-
var Select = (0,
|
|
1652
|
-
const [open, setOpen] = (0,
|
|
1653
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
1654
|
-
const rootRef = (0,
|
|
1862
|
+
var Select = (0, import_react43.forwardRef)(function Select2({ options, value, onChange, placeholder: placeholder2, label: label7, disabled: disabled3, ...rest }, ref) {
|
|
1863
|
+
const [open, setOpen] = (0, import_react43.useState)(false);
|
|
1864
|
+
const [activeIndex, setActiveIndex] = (0, import_react43.useState)(0);
|
|
1865
|
+
const rootRef = (0, import_react43.useRef)(null);
|
|
1655
1866
|
const setRootRef = (node) => {
|
|
1656
1867
|
rootRef.current = node;
|
|
1657
1868
|
if (typeof ref === "function") ref(node);
|
|
1658
1869
|
else if (ref) ref.current = node;
|
|
1659
1870
|
};
|
|
1660
|
-
const baseId = (0,
|
|
1871
|
+
const baseId = (0, import_react43.useId)();
|
|
1661
1872
|
const labelId = `${baseId}-label`;
|
|
1662
1873
|
const optionId = (index) => `${baseId}-option-${index}`;
|
|
1663
1874
|
const {
|
|
@@ -1669,7 +1880,7 @@ var Select = (0, import_react42.forwardRef)(function Select2({ options, value, o
|
|
|
1669
1880
|
menu: menu2,
|
|
1670
1881
|
optionClass
|
|
1671
1882
|
} = useStyles18({ open });
|
|
1672
|
-
(0,
|
|
1883
|
+
(0, import_react43.useEffect)(() => {
|
|
1673
1884
|
if (!open) return;
|
|
1674
1885
|
const onPointerDown = (event) => {
|
|
1675
1886
|
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
@@ -1780,10 +1991,10 @@ var Select = (0, import_react42.forwardRef)(function Select2({ options, value, o
|
|
|
1780
1991
|
});
|
|
1781
1992
|
|
|
1782
1993
|
// src/components/slider/index.tsx
|
|
1783
|
-
var
|
|
1994
|
+
var import_react45 = require("react");
|
|
1784
1995
|
|
|
1785
1996
|
// src/components/slider/use-styles.ts
|
|
1786
|
-
var
|
|
1997
|
+
var import_react44 = require("react");
|
|
1787
1998
|
|
|
1788
1999
|
// src/components/slider/use-styles.css.ts
|
|
1789
2000
|
var input5 = "use-styles_input__okw59n3";
|
|
@@ -1797,7 +2008,7 @@ var wrapper2 = "use-styles_wrapper__okw59n6";
|
|
|
1797
2008
|
// src/components/slider/use-styles.ts
|
|
1798
2009
|
function useStyles19() {
|
|
1799
2010
|
const { themeClass } = useTheme();
|
|
1800
|
-
return (0,
|
|
2011
|
+
return (0, import_react44.useMemo)(() => {
|
|
1801
2012
|
const root24 = [themeClass, root14].filter(Boolean).join(" ");
|
|
1802
2013
|
return {
|
|
1803
2014
|
wrapper: wrapper2,
|
|
@@ -1813,7 +2024,7 @@ function useStyles19() {
|
|
|
1813
2024
|
|
|
1814
2025
|
// src/components/slider/index.tsx
|
|
1815
2026
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1816
|
-
var Slider = (0,
|
|
2027
|
+
var Slider = (0, import_react45.forwardRef)(function Slider2({ value = 0, onChange, min = 0, max = 100, step: step2 = 1, disabled: disabled3, label: label7, ...rest }, ref) {
|
|
1817
2028
|
const { wrapper: wrapper4, label: labelClass, root: root24, track: track4, range: range2, thumb: thumb2, input: input6 } = useStyles19();
|
|
1818
2029
|
const span = max - min;
|
|
1819
2030
|
const percent = span > 0 ? (value - min) / span * 100 : 0;
|
|
@@ -1847,10 +2058,10 @@ var Slider = (0, import_react44.forwardRef)(function Slider2({ value = 0, onChan
|
|
|
1847
2058
|
});
|
|
1848
2059
|
|
|
1849
2060
|
// src/components/accordion/index.tsx
|
|
1850
|
-
var
|
|
2061
|
+
var import_react47 = require("react");
|
|
1851
2062
|
|
|
1852
2063
|
// src/components/accordion/use-styles.ts
|
|
1853
|
-
var
|
|
2064
|
+
var import_react46 = require("react");
|
|
1854
2065
|
|
|
1855
2066
|
// src/components/accordion/use-styles.css.ts
|
|
1856
2067
|
var chevron2 = "use-styles_chevron__1cjrdh93";
|
|
@@ -1863,7 +2074,7 @@ var root15 = "use-styles_root__1cjrdh90";
|
|
|
1863
2074
|
// src/components/accordion/use-styles.ts
|
|
1864
2075
|
function useStyles20({ className }) {
|
|
1865
2076
|
const { themeClass } = useTheme();
|
|
1866
|
-
return (0,
|
|
2077
|
+
return (0, import_react46.useMemo)(
|
|
1867
2078
|
() => ({
|
|
1868
2079
|
root: [themeClass, root15, className].filter(Boolean).join(" "),
|
|
1869
2080
|
item,
|
|
@@ -1877,8 +2088,8 @@ function useStyles20({ className }) {
|
|
|
1877
2088
|
|
|
1878
2089
|
// src/components/accordion/index.tsx
|
|
1879
2090
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1880
|
-
var Accordion = (0,
|
|
1881
|
-
const [open, setOpen] = (0,
|
|
2091
|
+
var Accordion = (0, import_react47.forwardRef)(function Accordion2({ items, multiple = false, defaultOpen = [], className, testId }, ref) {
|
|
2092
|
+
const [open, setOpen] = (0, import_react47.useState)(defaultOpen);
|
|
1882
2093
|
const { root: root24, item: item3, header: header3, chevronFor, panel: panel3 } = useStyles20({ className });
|
|
1883
2094
|
const { testId: dataTestId, slot } = useTestId("layout", testId);
|
|
1884
2095
|
const toggle = (id) => {
|
|
@@ -1935,7 +2146,7 @@ var Accordion = (0, import_react46.forwardRef)(function Accordion2({ items, mult
|
|
|
1935
2146
|
});
|
|
1936
2147
|
|
|
1937
2148
|
// src/components/breadcrumbs/index.tsx
|
|
1938
|
-
var
|
|
2149
|
+
var import_react49 = require("react");
|
|
1939
2150
|
|
|
1940
2151
|
// src/components/icons/chevron-right/index.tsx
|
|
1941
2152
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
@@ -1960,7 +2171,7 @@ function ChevronRightIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1960
2171
|
}
|
|
1961
2172
|
|
|
1962
2173
|
// src/components/breadcrumbs/use-styles.ts
|
|
1963
|
-
var
|
|
2174
|
+
var import_react48 = require("react");
|
|
1964
2175
|
|
|
1965
2176
|
// src/components/breadcrumbs/use-styles.css.ts
|
|
1966
2177
|
var crumb = "use-styles_crumb__7u0du61";
|
|
@@ -1971,7 +2182,7 @@ var separator = "use-styles_separator__7u0du63";
|
|
|
1971
2182
|
// src/components/breadcrumbs/use-styles.ts
|
|
1972
2183
|
function useStyles21({ className }) {
|
|
1973
2184
|
const { themeClass } = useTheme();
|
|
1974
|
-
const root24 = (0,
|
|
2185
|
+
const root24 = (0, import_react48.useMemo)(
|
|
1975
2186
|
() => [themeClass, root16, className].filter(Boolean).join(" "),
|
|
1976
2187
|
[themeClass, className]
|
|
1977
2188
|
);
|
|
@@ -1980,13 +2191,13 @@ function useStyles21({ className }) {
|
|
|
1980
2191
|
|
|
1981
2192
|
// src/components/breadcrumbs/index.tsx
|
|
1982
2193
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1983
|
-
var Breadcrumbs = (0,
|
|
2194
|
+
var Breadcrumbs = (0, import_react49.forwardRef)(function Breadcrumbs2({ items, className, testId, ...rest }, ref) {
|
|
1984
2195
|
const { root: root24, crumb: crumb2, current: current2, separator: separator2 } = useStyles21({ className });
|
|
1985
2196
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
1986
2197
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("nav", { ref, "aria-label": "Breadcrumb", className: root24, "data-testid": dataTestId, ...rest, children: items.map((item3, index) => {
|
|
1987
2198
|
const isLast = index === items.length - 1;
|
|
1988
2199
|
const key = index;
|
|
1989
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react49.Fragment, { children: [
|
|
1990
2201
|
isLast ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: current2, "aria-current": "page", "data-testid": slot(`crumb-${index}`), children: item3.label }) : item3.href ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("a", { className: crumb2, href: item3.href, "data-testid": slot(`crumb-${index}`), children: item3.label }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: crumb2, "data-testid": slot(`crumb-${index}`), children: item3.label }),
|
|
1991
2202
|
!isLast && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: separator2, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRightIcon, { size: 14 }) })
|
|
1992
2203
|
] }, key);
|
|
@@ -1994,7 +2205,7 @@ var Breadcrumbs = (0, import_react48.forwardRef)(function Breadcrumbs2({ items,
|
|
|
1994
2205
|
});
|
|
1995
2206
|
|
|
1996
2207
|
// src/components/pagination/index.tsx
|
|
1997
|
-
var
|
|
2208
|
+
var import_react51 = require("react");
|
|
1998
2209
|
|
|
1999
2210
|
// src/components/icons/chevron-left/index.tsx
|
|
2000
2211
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
@@ -2019,7 +2230,7 @@ function ChevronLeftIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
2019
2230
|
}
|
|
2020
2231
|
|
|
2021
2232
|
// src/components/pagination/use-styles.ts
|
|
2022
|
-
var
|
|
2233
|
+
var import_react50 = require("react");
|
|
2023
2234
|
|
|
2024
2235
|
// src/components/pagination/use-styles.css.ts
|
|
2025
2236
|
var ellipsis = "use-styles_ellipsis__1azgzoh3";
|
|
@@ -2031,7 +2242,7 @@ var root17 = "use-styles_root__1azgzoh0";
|
|
|
2031
2242
|
// src/components/pagination/use-styles.ts
|
|
2032
2243
|
function useStyles22() {
|
|
2033
2244
|
const { themeClass } = useTheme();
|
|
2034
|
-
return (0,
|
|
2245
|
+
return (0, import_react50.useMemo)(
|
|
2035
2246
|
() => ({
|
|
2036
2247
|
root: [themeClass, root17].filter(Boolean).join(" "),
|
|
2037
2248
|
pageBtnFor: (active2) => [pageBtn, active2 && pageActive].filter(Boolean).join(" "),
|
|
@@ -2057,7 +2268,7 @@ function buildItems(count, page, siblingCount) {
|
|
|
2057
2268
|
if (last > first) items.push(last);
|
|
2058
2269
|
return items;
|
|
2059
2270
|
}
|
|
2060
|
-
var Pagination = (0,
|
|
2271
|
+
var Pagination = (0, import_react51.forwardRef)(function Pagination2({ count, page = 1, onChange, siblingCount = 1, testId, ...rest }, ref) {
|
|
2061
2272
|
const { root: root24, pageBtnFor, ellipsis: ellipsis2, nav: nav2 } = useStyles22();
|
|
2062
2273
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2063
2274
|
const total = Math.max(1, count);
|
|
@@ -2115,10 +2326,10 @@ var Pagination = (0, import_react50.forwardRef)(function Pagination2({ count, pa
|
|
|
2115
2326
|
});
|
|
2116
2327
|
|
|
2117
2328
|
// src/components/stepper/index.tsx
|
|
2118
|
-
var
|
|
2329
|
+
var import_react53 = require("react");
|
|
2119
2330
|
|
|
2120
2331
|
// src/components/stepper/use-styles.ts
|
|
2121
|
-
var
|
|
2332
|
+
var import_react52 = require("react");
|
|
2122
2333
|
|
|
2123
2334
|
// src/components/stepper/use-styles.css.ts
|
|
2124
2335
|
var connector = "use-styles_connector__79pt4e7";
|
|
@@ -2133,7 +2344,7 @@ var step = "use-styles_step__79pt4e1";
|
|
|
2133
2344
|
// src/components/stepper/use-styles.ts
|
|
2134
2345
|
function useStyles23({ className }) {
|
|
2135
2346
|
const { themeClass } = useTheme();
|
|
2136
|
-
return (0,
|
|
2347
|
+
return (0, import_react52.useMemo)(() => {
|
|
2137
2348
|
const root24 = [themeClass, root18, className].filter(Boolean).join(" ");
|
|
2138
2349
|
const markerFor = (state) => [
|
|
2139
2350
|
marker,
|
|
@@ -2147,7 +2358,7 @@ function useStyles23({ className }) {
|
|
|
2147
2358
|
|
|
2148
2359
|
// src/components/stepper/index.tsx
|
|
2149
2360
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2150
|
-
var Stepper = (0,
|
|
2361
|
+
var Stepper = (0, import_react53.forwardRef)(function Stepper2({ steps, active: active2 = 0, className, testId, ...rest }, ref) {
|
|
2151
2362
|
const { root: root24, step: step2, connector: connector2, markerFor, labelFor } = useStyles23({ className });
|
|
2152
2363
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2153
2364
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref, className: root24, "data-testid": dataTestId, ...rest, children: steps.map((s, index) => {
|
|
@@ -2155,7 +2366,7 @@ var Stepper = (0, import_react52.forwardRef)(function Stepper2({ steps, active:
|
|
|
2155
2366
|
const isActive = state === "active";
|
|
2156
2367
|
return (
|
|
2157
2368
|
// biome-ignore lint/suspicious/noArrayIndexKey: steps are a static, ordered list with no stable id.
|
|
2158
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react53.Fragment, { children: [
|
|
2159
2370
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2160
2371
|
"div",
|
|
2161
2372
|
{
|
|
@@ -2176,10 +2387,10 @@ var Stepper = (0, import_react52.forwardRef)(function Stepper2({ steps, active:
|
|
|
2176
2387
|
});
|
|
2177
2388
|
|
|
2178
2389
|
// src/components/tabs/index.tsx
|
|
2179
|
-
var
|
|
2390
|
+
var import_react55 = require("react");
|
|
2180
2391
|
|
|
2181
2392
|
// src/components/tabs/use-styles.ts
|
|
2182
|
-
var
|
|
2393
|
+
var import_react54 = require("react");
|
|
2183
2394
|
|
|
2184
2395
|
// src/components/tabs/use-styles.css.ts
|
|
2185
2396
|
var panel2 = "use-styles_panel__1l4m7t43";
|
|
@@ -2190,7 +2401,7 @@ var tabActive = "use-styles_tabActive__1l4m7t42";
|
|
|
2190
2401
|
// src/components/tabs/use-styles.ts
|
|
2191
2402
|
function useStyles24() {
|
|
2192
2403
|
const { themeClass } = useTheme();
|
|
2193
|
-
return (0,
|
|
2404
|
+
return (0, import_react54.useMemo)(() => {
|
|
2194
2405
|
const root24 = [themeClass, root19].filter(Boolean).join(" ");
|
|
2195
2406
|
const tabClass = (active2) => [tab, active2 && tabActive].filter(Boolean).join(" ");
|
|
2196
2407
|
return { root: root24, tab, tabClass, panel: panel2 };
|
|
@@ -2199,11 +2410,11 @@ function useStyles24() {
|
|
|
2199
2410
|
|
|
2200
2411
|
// src/components/tabs/index.tsx
|
|
2201
2412
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2202
|
-
var Tabs = (0,
|
|
2413
|
+
var Tabs = (0, import_react55.forwardRef)(function Tabs2({ items, value, onChange, testId, ...rest }, ref) {
|
|
2203
2414
|
const { root: root24, tabClass, panel: panel3 } = useStyles24();
|
|
2204
2415
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2205
|
-
const baseId = (0,
|
|
2206
|
-
const tabRefs = (0,
|
|
2416
|
+
const baseId = (0, import_react55.useId)();
|
|
2417
|
+
const tabRefs = (0, import_react55.useRef)([]);
|
|
2207
2418
|
const hasPanels = items.some((item3) => item3.content !== void 0);
|
|
2208
2419
|
const activeIndex = items.findIndex((item3) => item3.value === value);
|
|
2209
2420
|
const tabId = (v) => `${baseId}-tab-${v}`;
|
|
@@ -2279,10 +2490,10 @@ var Tabs = (0, import_react54.forwardRef)(function Tabs2({ items, value, onChang
|
|
|
2279
2490
|
});
|
|
2280
2491
|
|
|
2281
2492
|
// src/components/menu/index.tsx
|
|
2282
|
-
var
|
|
2493
|
+
var import_react57 = require("react");
|
|
2283
2494
|
|
|
2284
2495
|
// src/components/menu/use-styles.ts
|
|
2285
|
-
var
|
|
2496
|
+
var import_react56 = require("react");
|
|
2286
2497
|
|
|
2287
2498
|
// src/components/menu/use-styles.css.ts
|
|
2288
2499
|
var danger = "use-styles_danger__1uyxaj3";
|
|
@@ -2293,7 +2504,7 @@ var wrapper3 = "use-styles_wrapper__1uyxaj0";
|
|
|
2293
2504
|
// src/components/menu/use-styles.ts
|
|
2294
2505
|
function useStyles25() {
|
|
2295
2506
|
const { themeClass } = useTheme();
|
|
2296
|
-
return (0,
|
|
2507
|
+
return (0, import_react56.useMemo)(
|
|
2297
2508
|
() => ({
|
|
2298
2509
|
wrapper: [themeClass, wrapper3].filter(Boolean).join(" "),
|
|
2299
2510
|
list,
|
|
@@ -2310,18 +2521,18 @@ function assignRef(ref, value) {
|
|
|
2310
2521
|
if (typeof ref === "function") ref(value);
|
|
2311
2522
|
else if (ref) ref.current = value;
|
|
2312
2523
|
}
|
|
2313
|
-
var Menu = (0,
|
|
2524
|
+
var Menu = (0, import_react57.forwardRef)(function Menu2({ trigger: trigger2, items, testId }, ref) {
|
|
2314
2525
|
const { wrapper: wrapper4, list: list2, item: item3, dangerItem } = useStyles25();
|
|
2315
2526
|
const { testId: rootTestId, slot } = useTestId("menu", testId);
|
|
2316
|
-
const [open, setOpen] = (0,
|
|
2317
|
-
const [alignEnd, setAlignEnd] = (0,
|
|
2318
|
-
const rootRef = (0,
|
|
2527
|
+
const [open, setOpen] = (0, import_react57.useState)(false);
|
|
2528
|
+
const [alignEnd, setAlignEnd] = (0, import_react57.useState)(false);
|
|
2529
|
+
const rootRef = (0, import_react57.useRef)(null);
|
|
2319
2530
|
const setRootRef = (node) => {
|
|
2320
2531
|
rootRef.current = node;
|
|
2321
2532
|
assignRef(ref, node);
|
|
2322
2533
|
};
|
|
2323
|
-
const listRef = (0,
|
|
2324
|
-
const triggerRef = (0,
|
|
2534
|
+
const listRef = (0, import_react57.useRef)(null);
|
|
2535
|
+
const triggerRef = (0, import_react57.useRef)(null);
|
|
2325
2536
|
const getMenuItems = () => Array.from(listRef.current?.querySelectorAll('[role="menuitem"]') ?? []);
|
|
2326
2537
|
const focusItemAt = (index) => {
|
|
2327
2538
|
const menuItems = getMenuItems();
|
|
@@ -2333,7 +2544,7 @@ var Menu = (0, import_react56.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
2333
2544
|
setOpen(false);
|
|
2334
2545
|
triggerRef.current?.focus();
|
|
2335
2546
|
};
|
|
2336
|
-
(0,
|
|
2547
|
+
(0, import_react57.useLayoutEffect)(() => {
|
|
2337
2548
|
if (!open) {
|
|
2338
2549
|
setAlignEnd(false);
|
|
2339
2550
|
return;
|
|
@@ -2345,7 +2556,7 @@ var Menu = (0, import_react56.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
2345
2556
|
const viewport = document.documentElement.clientWidth;
|
|
2346
2557
|
setAlignEnd(rootLeft + listEl.offsetWidth > viewport);
|
|
2347
2558
|
}, [open]);
|
|
2348
|
-
(0,
|
|
2559
|
+
(0, import_react57.useEffect)(() => {
|
|
2349
2560
|
if (!open) return;
|
|
2350
2561
|
listRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
2351
2562
|
const onDocMouseDown = (event) => {
|
|
@@ -2401,7 +2612,7 @@ var Menu = (0, import_react56.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
2401
2612
|
triggerRef.current = node;
|
|
2402
2613
|
assignRef(consumerRef, node);
|
|
2403
2614
|
};
|
|
2404
|
-
const clonedTrigger = (0,
|
|
2615
|
+
const clonedTrigger = (0, import_react57.cloneElement)(trigger2, {
|
|
2405
2616
|
ref: mergedTriggerRef,
|
|
2406
2617
|
"aria-haspopup": "menu",
|
|
2407
2618
|
"aria-expanded": open,
|
|
@@ -2452,11 +2663,11 @@ var Menu = (0, import_react56.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
2452
2663
|
});
|
|
2453
2664
|
|
|
2454
2665
|
// src/components/dialog/index.tsx
|
|
2455
|
-
var
|
|
2666
|
+
var import_react59 = require("react");
|
|
2456
2667
|
var import_react_dom = require("react-dom");
|
|
2457
2668
|
|
|
2458
2669
|
// src/components/dialog/use-styles.ts
|
|
2459
|
-
var
|
|
2670
|
+
var import_react58 = require("react");
|
|
2460
2671
|
|
|
2461
2672
|
// src/components/dialog/use-styles.css.ts
|
|
2462
2673
|
var actions = "use-styles_actions__5tstu83";
|
|
@@ -2467,7 +2678,7 @@ var surface = "use-styles_surface__5tstu81";
|
|
|
2467
2678
|
// src/components/dialog/use-styles.ts
|
|
2468
2679
|
function useStyles26() {
|
|
2469
2680
|
const { themeClass } = useTheme();
|
|
2470
|
-
return (0,
|
|
2681
|
+
return (0, import_react58.useMemo)(
|
|
2471
2682
|
() => ({
|
|
2472
2683
|
overlay: [themeClass, overlay].filter(Boolean).join(" "),
|
|
2473
2684
|
surface,
|
|
@@ -2485,18 +2696,18 @@ function assignRef2(ref, value) {
|
|
|
2485
2696
|
if (typeof ref === "function") ref(value);
|
|
2486
2697
|
else if (ref) ref.current = value;
|
|
2487
2698
|
}
|
|
2488
|
-
var Dialog = (0,
|
|
2699
|
+
var Dialog = (0, import_react59.forwardRef)(function Dialog2({ open, onClose, title, actions: actions3, children, testId }, ref) {
|
|
2489
2700
|
const { overlay: overlay2, surface: surface2, body: body3, actions: actionsClass } = useStyles26();
|
|
2490
2701
|
const { testId: rootTestId, slot } = useTestId("dialog", testId);
|
|
2491
|
-
const surfaceRef = (0,
|
|
2702
|
+
const surfaceRef = (0, import_react59.useRef)(null);
|
|
2492
2703
|
const setSurfaceRef = (node) => {
|
|
2493
2704
|
surfaceRef.current = node;
|
|
2494
2705
|
assignRef2(ref, node);
|
|
2495
2706
|
};
|
|
2496
|
-
const previouslyFocused = (0,
|
|
2497
|
-
const generatedId = (0,
|
|
2707
|
+
const previouslyFocused = (0, import_react59.useRef)(null);
|
|
2708
|
+
const generatedId = (0, import_react59.useId)();
|
|
2498
2709
|
const titleId = title != null ? generatedId : void 0;
|
|
2499
|
-
(0,
|
|
2710
|
+
(0, import_react59.useEffect)(() => {
|
|
2500
2711
|
if (!open) return;
|
|
2501
2712
|
const onKeyDown = (event) => {
|
|
2502
2713
|
if (event.key === "Escape") onClose();
|
|
@@ -2504,13 +2715,13 @@ var Dialog = (0, import_react58.forwardRef)(function Dialog2({ open, onClose, ti
|
|
|
2504
2715
|
document.addEventListener("keydown", onKeyDown);
|
|
2505
2716
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
2506
2717
|
}, [open, onClose]);
|
|
2507
|
-
(0,
|
|
2718
|
+
(0, import_react59.useEffect)(() => {
|
|
2508
2719
|
if (!open) return;
|
|
2509
2720
|
previouslyFocused.current = document.activeElement;
|
|
2510
2721
|
surfaceRef.current?.focus();
|
|
2511
2722
|
return () => previouslyFocused.current?.focus?.();
|
|
2512
2723
|
}, [open]);
|
|
2513
|
-
(0,
|
|
2724
|
+
(0, import_react59.useEffect)(() => {
|
|
2514
2725
|
if (!open) return;
|
|
2515
2726
|
const previousOverflow = document.body.style.overflow;
|
|
2516
2727
|
document.body.style.overflow = "hidden";
|
|
@@ -2572,11 +2783,11 @@ var Dialog = (0, import_react58.forwardRef)(function Dialog2({ open, onClose, ti
|
|
|
2572
2783
|
});
|
|
2573
2784
|
|
|
2574
2785
|
// src/components/snackbar/index.tsx
|
|
2575
|
-
var
|
|
2786
|
+
var import_react61 = require("react");
|
|
2576
2787
|
var import_react_dom2 = require("react-dom");
|
|
2577
2788
|
|
|
2578
2789
|
// src/components/snackbar/use-styles.ts
|
|
2579
|
-
var
|
|
2790
|
+
var import_react60 = require("react");
|
|
2580
2791
|
|
|
2581
2792
|
// src/components/snackbar/use-styles.css.ts
|
|
2582
2793
|
var closeBtn = "use-styles_closeBtn__ihzsep2";
|
|
@@ -2586,7 +2797,7 @@ var root20 = "use-styles_root__ihzsep0 surfaces_inkySurface__1qa7atn2";
|
|
|
2586
2797
|
// src/components/snackbar/use-styles.ts
|
|
2587
2798
|
function useStyles27() {
|
|
2588
2799
|
const { themeClass } = useTheme();
|
|
2589
|
-
return (0,
|
|
2800
|
+
return (0, import_react60.useMemo)(
|
|
2590
2801
|
() => ({
|
|
2591
2802
|
root: [themeClass, root20].filter(Boolean).join(" "),
|
|
2592
2803
|
message,
|
|
@@ -2598,7 +2809,7 @@ function useStyles27() {
|
|
|
2598
2809
|
|
|
2599
2810
|
// src/components/snackbar/index.tsx
|
|
2600
2811
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2601
|
-
var Snackbar = (0,
|
|
2812
|
+
var Snackbar = (0, import_react61.forwardRef)(function Snackbar2({ open, message: message2, action, onClose, testId }, ref) {
|
|
2602
2813
|
const { root: root24, message: messageClass, closeBtn: closeBtn2 } = useStyles27();
|
|
2603
2814
|
const { testId: dataTestId, slot } = useTestId("feedback", testId);
|
|
2604
2815
|
if (!open || typeof document === "undefined") return null;
|
|
@@ -2623,10 +2834,10 @@ var Snackbar = (0, import_react60.forwardRef)(function Snackbar2({ open, message
|
|
|
2623
2834
|
});
|
|
2624
2835
|
|
|
2625
2836
|
// src/components/table/index.tsx
|
|
2626
|
-
var
|
|
2837
|
+
var import_react63 = require("react");
|
|
2627
2838
|
|
|
2628
2839
|
// src/components/table/use-styles.ts
|
|
2629
|
-
var
|
|
2840
|
+
var import_react62 = require("react");
|
|
2630
2841
|
|
|
2631
2842
|
// src/components/table/use-styles.css.ts
|
|
2632
2843
|
var alignRight = "use-styles_alignRight__1n2cz6i3";
|
|
@@ -2638,7 +2849,7 @@ var th = "use-styles_th__1n2cz6i1";
|
|
|
2638
2849
|
// src/components/table/use-styles.ts
|
|
2639
2850
|
function useStyles28({ className }) {
|
|
2640
2851
|
const { themeClass } = useTheme();
|
|
2641
|
-
const root24 = (0,
|
|
2852
|
+
const root24 = (0, import_react62.useMemo)(
|
|
2642
2853
|
() => [themeClass, root21, className].filter(Boolean).join(" "),
|
|
2643
2854
|
[themeClass, className]
|
|
2644
2855
|
);
|
|
@@ -2664,15 +2875,15 @@ function TableInner({ columns, rows, getRowKey, className, caption: caption2, te
|
|
|
2664
2875
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tbody", { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { "data-testid": slot(`row-${index}`), children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { className: cellClass(column), children: column.render ? column.render(row) : String(row[column.key]) }, column.key)) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
2665
2876
|
] });
|
|
2666
2877
|
}
|
|
2667
|
-
var TableForwarded = (0,
|
|
2878
|
+
var TableForwarded = (0, import_react63.forwardRef)(TableInner);
|
|
2668
2879
|
TableForwarded.displayName = "Table";
|
|
2669
2880
|
var Table = TableForwarded;
|
|
2670
2881
|
|
|
2671
2882
|
// src/components/app-bar/index.tsx
|
|
2672
|
-
var
|
|
2883
|
+
var import_react65 = require("react");
|
|
2673
2884
|
|
|
2674
2885
|
// src/components/app-bar/use-styles.ts
|
|
2675
|
-
var
|
|
2886
|
+
var import_react64 = require("react");
|
|
2676
2887
|
|
|
2677
2888
|
// src/components/app-bar/use-styles.css.ts
|
|
2678
2889
|
var actions2 = "use-styles_actions__1h133nh2";
|
|
@@ -2682,7 +2893,7 @@ var root22 = "use-styles_root__1h133nh0";
|
|
|
2682
2893
|
// src/components/app-bar/use-styles.ts
|
|
2683
2894
|
function useStyles29({ className }) {
|
|
2684
2895
|
const { themeClass } = useTheme();
|
|
2685
|
-
const root24 = (0,
|
|
2896
|
+
const root24 = (0, import_react64.useMemo)(
|
|
2686
2897
|
() => [themeClass, root22, className].filter(Boolean).join(" "),
|
|
2687
2898
|
[themeClass, className]
|
|
2688
2899
|
);
|
|
@@ -2691,7 +2902,7 @@ function useStyles29({ className }) {
|
|
|
2691
2902
|
|
|
2692
2903
|
// src/components/app-bar/index.tsx
|
|
2693
2904
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2694
|
-
var AppBar = (0,
|
|
2905
|
+
var AppBar = (0, import_react65.forwardRef)(function AppBar2({ brand: brand2, actions: actions3, className, children, testId, ...rest }, ref) {
|
|
2695
2906
|
const styles = useStyles29({ className });
|
|
2696
2907
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2697
2908
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("header", { ref, className: styles.root, "data-testid": dataTestId, ...rest, children: [
|
|
@@ -2702,10 +2913,10 @@ var AppBar = (0, import_react64.forwardRef)(function AppBar2({ brand: brand2, ac
|
|
|
2702
2913
|
});
|
|
2703
2914
|
|
|
2704
2915
|
// src/components/list-item/index.tsx
|
|
2705
|
-
var
|
|
2916
|
+
var import_react67 = require("react");
|
|
2706
2917
|
|
|
2707
2918
|
// src/components/list-item/use-styles.ts
|
|
2708
|
-
var
|
|
2919
|
+
var import_react66 = require("react");
|
|
2709
2920
|
|
|
2710
2921
|
// src/components/list-item/use-styles.css.ts
|
|
2711
2922
|
var content2 = "use-styles_content__kbreq13";
|
|
@@ -2720,7 +2931,7 @@ function useStyles30({
|
|
|
2720
2931
|
className
|
|
2721
2932
|
}) {
|
|
2722
2933
|
const { themeClass } = useTheme();
|
|
2723
|
-
const root24 = (0,
|
|
2934
|
+
const root24 = (0, import_react66.useMemo)(
|
|
2724
2935
|
() => [themeClass, root23, selected3 && selected2, className].filter(Boolean).join(" "),
|
|
2725
2936
|
[themeClass, selected3, className]
|
|
2726
2937
|
);
|
|
@@ -2729,7 +2940,7 @@ function useStyles30({
|
|
|
2729
2940
|
|
|
2730
2941
|
// src/components/list-item/index.tsx
|
|
2731
2942
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2732
|
-
var ListItem = (0,
|
|
2943
|
+
var ListItem = (0, import_react67.forwardRef)(function ListItem2({ leading: leading2, trailing: trailing2, selected: selected3, className, testId, children, ...rest }, ref) {
|
|
2733
2944
|
const styles = useStyles30({ selected: selected3, className });
|
|
2734
2945
|
const { testId: dataTestId, slot } = useTestId("list", testId);
|
|
2735
2946
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|