@octavius2929-personal/design-system 0.5.1 → 0.7.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 +627 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +169 -135
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +43 -3
- package/dist/index.d.ts +43 -3
- package/dist/index.js +571 -386
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -46,8 +46,10 @@ __export(index_exports, {
|
|
|
46
46
|
ListItem: () => ListItem,
|
|
47
47
|
Menu: () => Menu,
|
|
48
48
|
MinusIcon: () => MinusIcon,
|
|
49
|
+
MoneyField: () => MoneyField,
|
|
49
50
|
MoreHorizontalIcon: () => MoreHorizontalIcon,
|
|
50
51
|
Pagination: () => Pagination,
|
|
52
|
+
PasswordField: () => PasswordField,
|
|
51
53
|
PlusIcon: () => PlusIcon,
|
|
52
54
|
Progress: () => Progress,
|
|
53
55
|
Radio: () => Radio,
|
|
@@ -63,6 +65,7 @@ __export(index_exports, {
|
|
|
63
65
|
ThemeProvider: () => ThemeProvider,
|
|
64
66
|
Tooltip: () => Tooltip,
|
|
65
67
|
TriangleAlertIcon: () => TriangleAlertIcon,
|
|
68
|
+
Typography: () => Typography,
|
|
66
69
|
XIcon: () => XIcon,
|
|
67
70
|
colorVars: () => colorVars,
|
|
68
71
|
modeNames: () => modeNames,
|
|
@@ -101,7 +104,7 @@ function useToggle(initial = false) {
|
|
|
101
104
|
return [on, toggle, setOn];
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
// src/components/
|
|
107
|
+
// src/components/typography/use-styles.ts
|
|
105
108
|
var import_react4 = require("react");
|
|
106
109
|
|
|
107
110
|
// src/theme/context/theme-context.tsx
|
|
@@ -195,6 +198,65 @@ function useTheme() {
|
|
|
195
198
|
return (0, import_react3.useContext)(ThemeContext) ?? DEFAULT_VALUE;
|
|
196
199
|
}
|
|
197
200
|
|
|
201
|
+
// src/theme/typography.css.ts
|
|
202
|
+
var text = { eyebrow: "typography_text_eyebrow__1wmlzy0", display: "typography_text_display__1wmlzy1", h1: "typography_text_h1__1wmlzy2", h2: "typography_text_h2__1wmlzy3", h3: "typography_text_h3__1wmlzy4", h4: "typography_text_h4__1wmlzy5", body: "typography_text_body__1wmlzy6", lead: "typography_text_lead__1wmlzy7", small: "typography_text_small__1wmlzy8", caption: "typography_text_caption__1wmlzy9", code: "typography_text_code__1wmlzya", blackletter: "typography_text_blackletter__1wmlzyb" };
|
|
203
|
+
|
|
204
|
+
// src/components/typography/use-styles.css.ts
|
|
205
|
+
var align = { left: "use-styles_align_left__d74jf69", center: "use-styles_align_center__d74jf6a", right: "use-styles_align_right__d74jf6b" };
|
|
206
|
+
var base = "use-styles_base__d74jf60";
|
|
207
|
+
var color = { fg1: "use-styles_color_fg1__d74jf61", fg2: "use-styles_color_fg2__d74jf62", fg3: "use-styles_color_fg3__d74jf63", accent: "use-styles_color_accent__d74jf64", danger: "use-styles_color_danger__d74jf65", ok: "use-styles_color_ok__d74jf66", warn: "use-styles_color_warn__d74jf67", info: "use-styles_color_info__d74jf68" };
|
|
208
|
+
|
|
209
|
+
// src/components/typography/use-styles.ts
|
|
210
|
+
function useStyles({
|
|
211
|
+
variant: variant2,
|
|
212
|
+
color: color2,
|
|
213
|
+
align: align2
|
|
214
|
+
}) {
|
|
215
|
+
const { themeClass } = useTheme();
|
|
216
|
+
const className = (0, import_react4.useMemo)(
|
|
217
|
+
() => [
|
|
218
|
+
themeClass,
|
|
219
|
+
base,
|
|
220
|
+
text[variant2],
|
|
221
|
+
color2 && color[color2],
|
|
222
|
+
align2 && align[align2]
|
|
223
|
+
].filter(Boolean).join(" "),
|
|
224
|
+
[themeClass, variant2, color2, align2]
|
|
225
|
+
);
|
|
226
|
+
return { text: className };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// src/components/typography/index.tsx
|
|
230
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
231
|
+
var defaultElement = {
|
|
232
|
+
display: "h1",
|
|
233
|
+
h1: "h1",
|
|
234
|
+
h2: "h2",
|
|
235
|
+
h3: "h3",
|
|
236
|
+
h4: "h4",
|
|
237
|
+
body: "p",
|
|
238
|
+
lead: "p",
|
|
239
|
+
small: "span",
|
|
240
|
+
caption: "span",
|
|
241
|
+
eyebrow: "span",
|
|
242
|
+
code: "code",
|
|
243
|
+
blackletter: "span"
|
|
244
|
+
};
|
|
245
|
+
function Typography({
|
|
246
|
+
variant: variant2,
|
|
247
|
+
as,
|
|
248
|
+
color: color2,
|
|
249
|
+
align: align2,
|
|
250
|
+
...rest
|
|
251
|
+
}) {
|
|
252
|
+
const Component = as ?? defaultElement[variant2];
|
|
253
|
+
const { text: text2 } = useStyles({ variant: variant2, color: color2, align: align2 });
|
|
254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component, { ...rest, className: text2 });
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// src/components/button/use-styles.ts
|
|
258
|
+
var import_react5 = require("react");
|
|
259
|
+
|
|
198
260
|
// src/components/button/use-styles.css.ts
|
|
199
261
|
var full = "use-styles_full__1pbtill4";
|
|
200
262
|
var root = "use-styles_root__1pbtill0";
|
|
@@ -205,7 +267,7 @@ var tone = { filledInk: "use-styles_tone_filledInk__1pbtill5", filledAccent: "us
|
|
|
205
267
|
function toneKey(variant2, tone4) {
|
|
206
268
|
return `${variant2}${tone4 === "ink" ? "Ink" : "Accent"}`;
|
|
207
269
|
}
|
|
208
|
-
function
|
|
270
|
+
function useStyles2({
|
|
209
271
|
variant: variant2 = "filled",
|
|
210
272
|
tone: tone4 = "ink",
|
|
211
273
|
size: size3 = "md",
|
|
@@ -213,7 +275,7 @@ function useStyles({
|
|
|
213
275
|
className
|
|
214
276
|
}) {
|
|
215
277
|
const { themeClass } = useTheme();
|
|
216
|
-
const container = (0,
|
|
278
|
+
const container = (0, import_react5.useMemo)(
|
|
217
279
|
() => [
|
|
218
280
|
themeClass,
|
|
219
281
|
root,
|
|
@@ -228,7 +290,7 @@ function useStyles({
|
|
|
228
290
|
}
|
|
229
291
|
|
|
230
292
|
// src/components/button/index.tsx
|
|
231
|
-
var
|
|
293
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
232
294
|
var ICON_SIZE = { sm: 14, md: 16, lg: 18 };
|
|
233
295
|
function Button({
|
|
234
296
|
variant: variant2,
|
|
@@ -241,17 +303,17 @@ function Button({
|
|
|
241
303
|
children,
|
|
242
304
|
...rest
|
|
243
305
|
}) {
|
|
244
|
-
const { container } =
|
|
306
|
+
const { container } = useStyles2({ variant: variant2, tone: tone4, size: size3, full: full2, className });
|
|
245
307
|
const iconSize = ICON_SIZE[size3];
|
|
246
|
-
return /* @__PURE__ */ (0,
|
|
247
|
-
StartIcon && /* @__PURE__ */ (0,
|
|
308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { className: container, ...rest, children: [
|
|
309
|
+
StartIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StartIcon, { size: iconSize }),
|
|
248
310
|
children,
|
|
249
|
-
EndIcon && /* @__PURE__ */ (0,
|
|
311
|
+
EndIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EndIcon, { size: iconSize })
|
|
250
312
|
] });
|
|
251
313
|
}
|
|
252
314
|
|
|
253
315
|
// src/components/divider/use-styles.ts
|
|
254
|
-
var
|
|
316
|
+
var import_react6 = require("react");
|
|
255
317
|
|
|
256
318
|
// src/components/divider/use-styles.css.ts
|
|
257
319
|
var horizontal = "use-styles_horizontal__1n7v7yj1";
|
|
@@ -262,9 +324,9 @@ var root2 = "use-styles_root__1n7v7yj0";
|
|
|
262
324
|
var vertical = "use-styles_vertical__1n7v7yj2";
|
|
263
325
|
|
|
264
326
|
// src/components/divider/use-styles.ts
|
|
265
|
-
function
|
|
327
|
+
function useStyles3({ vertical: vertical2, hasLabel }) {
|
|
266
328
|
const { themeClass } = useTheme();
|
|
267
|
-
const root24 = (0,
|
|
329
|
+
const root24 = (0, import_react6.useMemo)(
|
|
268
330
|
() => [
|
|
269
331
|
themeClass,
|
|
270
332
|
root2,
|
|
@@ -276,22 +338,22 @@ function useStyles2({ vertical: vertical2, hasLabel }) {
|
|
|
276
338
|
}
|
|
277
339
|
|
|
278
340
|
// src/components/divider/index.tsx
|
|
279
|
-
var
|
|
341
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
280
342
|
function Divider({ vertical: vertical2, label: label7, ...rest }) {
|
|
281
343
|
const hasLabel = label7 != null;
|
|
282
|
-
const { root: root24, line: line2, label: labelClass } =
|
|
344
|
+
const { root: root24, line: line2, label: labelClass } = useStyles3({ vertical: vertical2, hasLabel });
|
|
283
345
|
if (hasLabel) {
|
|
284
|
-
return /* @__PURE__ */ (0,
|
|
285
|
-
/* @__PURE__ */ (0,
|
|
286
|
-
/* @__PURE__ */ (0,
|
|
287
|
-
/* @__PURE__ */ (0,
|
|
346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { role: "separator", className: root24, ...rest, children: [
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: line2 }),
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: labelClass, children: label7 }),
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: line2 })
|
|
288
350
|
] });
|
|
289
351
|
}
|
|
290
|
-
return /* @__PURE__ */ (0,
|
|
352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "separator", className: root24, ...rest });
|
|
291
353
|
}
|
|
292
354
|
|
|
293
355
|
// src/components/avatar/use-styles.ts
|
|
294
|
-
var
|
|
356
|
+
var import_react7 = require("react");
|
|
295
357
|
|
|
296
358
|
// src/components/avatar/use-styles.css.ts
|
|
297
359
|
var root3 = "use-styles_root__1mn1rmu0";
|
|
@@ -299,13 +361,13 @@ var size2 = { sm: "use-styles_size_sm__1mn1rmu1", md: "use-styles_size_md__1mn1r
|
|
|
299
361
|
var variant = { "default": "use-styles_variant_default__1mn1rmu4", filled: "use-styles_variant_filled__1mn1rmu5" };
|
|
300
362
|
|
|
301
363
|
// src/components/avatar/use-styles.ts
|
|
302
|
-
function
|
|
364
|
+
function useStyles4({
|
|
303
365
|
size: size3 = "md",
|
|
304
366
|
filled,
|
|
305
367
|
className
|
|
306
368
|
}) {
|
|
307
369
|
const { themeClass } = useTheme();
|
|
308
|
-
const root24 = (0,
|
|
370
|
+
const root24 = (0, import_react7.useMemo)(
|
|
309
371
|
() => [
|
|
310
372
|
themeClass,
|
|
311
373
|
root3,
|
|
@@ -319,14 +381,14 @@ function useStyles3({
|
|
|
319
381
|
}
|
|
320
382
|
|
|
321
383
|
// src/components/avatar/index.tsx
|
|
322
|
-
var
|
|
384
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
323
385
|
function Avatar({ size: size3, filled, className, children, ...rest }) {
|
|
324
|
-
const { root: root24 } =
|
|
325
|
-
return /* @__PURE__ */ (0,
|
|
386
|
+
const { root: root24 } = useStyles4({ size: size3, filled, className });
|
|
387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: root24, ...rest, children });
|
|
326
388
|
}
|
|
327
389
|
|
|
328
390
|
// src/components/badge/use-styles.ts
|
|
329
|
-
var
|
|
391
|
+
var import_react8 = require("react");
|
|
330
392
|
|
|
331
393
|
// src/components/badge/use-styles.css.ts
|
|
332
394
|
var dot = "use-styles_dot__1wpei6p1";
|
|
@@ -334,31 +396,31 @@ var root4 = "use-styles_root__1wpei6p0";
|
|
|
334
396
|
var tone2 = { ink: "use-styles_tone_ink__1wpei6p2", accent: "use-styles_tone_accent__1wpei6p3" };
|
|
335
397
|
|
|
336
398
|
// src/components/badge/use-styles.ts
|
|
337
|
-
function
|
|
399
|
+
function useStyles5({
|
|
338
400
|
tone: tone4 = "ink",
|
|
339
401
|
className
|
|
340
402
|
}) {
|
|
341
403
|
const { themeClass } = useTheme();
|
|
342
|
-
const root24 = (0,
|
|
404
|
+
const root24 = (0, import_react8.useMemo)(
|
|
343
405
|
() => [themeClass, root4, className].filter(Boolean).join(" "),
|
|
344
406
|
[themeClass, className]
|
|
345
407
|
);
|
|
346
|
-
const dot3 = (0,
|
|
408
|
+
const dot3 = (0, import_react8.useMemo)(() => [dot, tone2[tone4]].join(" "), [tone4]);
|
|
347
409
|
return { root: root24, dot: dot3 };
|
|
348
410
|
}
|
|
349
411
|
|
|
350
412
|
// src/components/badge/index.tsx
|
|
351
|
-
var
|
|
413
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
352
414
|
function Badge({ count, tone: tone4, className, children, ...rest }) {
|
|
353
|
-
const { root: root24, dot: dot3 } =
|
|
354
|
-
return /* @__PURE__ */ (0,
|
|
415
|
+
const { root: root24, dot: dot3 } = useStyles5({ tone: tone4, className });
|
|
416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: root24, ...rest, children: [
|
|
355
417
|
children,
|
|
356
|
-
count != null && /* @__PURE__ */ (0,
|
|
418
|
+
count != null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: dot3, children: count })
|
|
357
419
|
] });
|
|
358
420
|
}
|
|
359
421
|
|
|
360
422
|
// src/components/progress/use-styles.ts
|
|
361
|
-
var
|
|
423
|
+
var import_react9 = require("react");
|
|
362
424
|
|
|
363
425
|
// src/components/progress/use-styles.css.ts
|
|
364
426
|
var bar = "use-styles_bar__kbop7v3";
|
|
@@ -367,14 +429,14 @@ var spinner = "use-styles_spinner__kbop7v5";
|
|
|
367
429
|
var track = "use-styles_track__kbop7v2";
|
|
368
430
|
|
|
369
431
|
// src/components/progress/use-styles.ts
|
|
370
|
-
function
|
|
432
|
+
function useStyles6({
|
|
371
433
|
variant: variant2 = "linear",
|
|
372
434
|
value,
|
|
373
435
|
className
|
|
374
436
|
}) {
|
|
375
437
|
const { themeClass } = useTheme();
|
|
376
438
|
const indeterminate2 = value === void 0;
|
|
377
|
-
return (0,
|
|
439
|
+
return (0, import_react9.useMemo)(() => {
|
|
378
440
|
const root24 = (...classes) => [themeClass, ...classes, className].filter(Boolean).join(" ");
|
|
379
441
|
if (variant2 === "circular") {
|
|
380
442
|
return { track: "", bar: "", spinner: root24(spinner) };
|
|
@@ -388,7 +450,7 @@ function useStyles5({
|
|
|
388
450
|
}
|
|
389
451
|
|
|
390
452
|
// src/components/progress/index.tsx
|
|
391
|
-
var
|
|
453
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
392
454
|
function Progress({
|
|
393
455
|
variant: variant2 = "linear",
|
|
394
456
|
value,
|
|
@@ -396,10 +458,10 @@ function Progress({
|
|
|
396
458
|
className,
|
|
397
459
|
...rest
|
|
398
460
|
}) {
|
|
399
|
-
const { track: track4, bar: bar2, spinner: spinner2 } =
|
|
461
|
+
const { track: track4, bar: bar2, spinner: spinner2 } = useStyles6({ variant: variant2, value, className });
|
|
400
462
|
const indeterminate2 = value === void 0;
|
|
401
463
|
if (variant2 === "circular") {
|
|
402
|
-
return /* @__PURE__ */ (0,
|
|
464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
403
465
|
"span",
|
|
404
466
|
{
|
|
405
467
|
className: spinner2,
|
|
@@ -412,7 +474,7 @@ function Progress({
|
|
|
412
474
|
}
|
|
413
475
|
);
|
|
414
476
|
}
|
|
415
|
-
return /* @__PURE__ */ (0,
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
416
478
|
"div",
|
|
417
479
|
{
|
|
418
480
|
className: track4,
|
|
@@ -421,15 +483,15 @@ function Progress({
|
|
|
421
483
|
"aria-valuemin": indeterminate2 ? void 0 : 0,
|
|
422
484
|
"aria-valuemax": indeterminate2 ? void 0 : 100,
|
|
423
485
|
...rest,
|
|
424
|
-
children: /* @__PURE__ */ (0,
|
|
486
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: bar2, style: indeterminate2 ? void 0 : { width: `${value}%` } })
|
|
425
487
|
}
|
|
426
488
|
);
|
|
427
489
|
}
|
|
428
490
|
|
|
429
491
|
// src/components/icons/x/index.tsx
|
|
430
|
-
var
|
|
492
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
431
493
|
function XIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
432
|
-
return /* @__PURE__ */ (0,
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
433
495
|
"svg",
|
|
434
496
|
{
|
|
435
497
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -444,15 +506,15 @@ function XIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
444
506
|
"aria-hidden": "true",
|
|
445
507
|
...rest,
|
|
446
508
|
children: [
|
|
447
|
-
/* @__PURE__ */ (0,
|
|
448
|
-
/* @__PURE__ */ (0,
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M18 6 6 18" }),
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "m6 6 12 12" })
|
|
449
511
|
]
|
|
450
512
|
}
|
|
451
513
|
);
|
|
452
514
|
}
|
|
453
515
|
|
|
454
516
|
// src/components/chip/use-styles.ts
|
|
455
|
-
var
|
|
517
|
+
var import_react10 = require("react");
|
|
456
518
|
|
|
457
519
|
// src/components/chip/use-styles.css.ts
|
|
458
520
|
var clickable = "use-styles_clickable__1axilf44";
|
|
@@ -462,13 +524,13 @@ var selected = "use-styles_selected__1axilf43";
|
|
|
462
524
|
var tone3 = { ink: "use-styles_tone_ink__1axilf41", accent: "use-styles_tone_accent__1axilf42" };
|
|
463
525
|
|
|
464
526
|
// src/components/chip/use-styles.ts
|
|
465
|
-
function
|
|
527
|
+
function useStyles7({
|
|
466
528
|
selected: selected3,
|
|
467
529
|
tone: tone4 = "ink",
|
|
468
530
|
clickable: clickable2
|
|
469
531
|
}) {
|
|
470
532
|
const { themeClass } = useTheme();
|
|
471
|
-
const root24 = (0,
|
|
533
|
+
const root24 = (0, import_react10.useMemo)(
|
|
472
534
|
() => [
|
|
473
535
|
themeClass,
|
|
474
536
|
root5,
|
|
@@ -481,24 +543,24 @@ function useStyles6({
|
|
|
481
543
|
}
|
|
482
544
|
|
|
483
545
|
// src/components/chip/index.tsx
|
|
484
|
-
var
|
|
546
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
485
547
|
function Chip({ selected: selected3, tone: tone4, onDelete, onClick, children, ...rest }) {
|
|
486
548
|
const clickable2 = Boolean(onClick);
|
|
487
|
-
const { root: root24, deleteBtn: deleteBtn2 } =
|
|
549
|
+
const { root: root24, deleteBtn: deleteBtn2 } = useStyles7({ selected: selected3, tone: tone4, clickable: clickable2 });
|
|
488
550
|
const handleDelete = (event) => {
|
|
489
551
|
event.stopPropagation();
|
|
490
552
|
onDelete?.();
|
|
491
553
|
};
|
|
492
|
-
return /* @__PURE__ */ (0,
|
|
554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: root24, onClick, ...rest, children: [
|
|
493
555
|
children,
|
|
494
|
-
onDelete && /* @__PURE__ */ (0,
|
|
556
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: deleteBtn2, "aria-label": "Remove", onClick: handleDelete, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(XIcon, { size: 13 }) })
|
|
495
557
|
] });
|
|
496
558
|
}
|
|
497
559
|
|
|
498
560
|
// src/components/icons/check/index.tsx
|
|
499
|
-
var
|
|
561
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
500
562
|
function CheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
501
|
-
return /* @__PURE__ */ (0,
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
502
564
|
"svg",
|
|
503
565
|
{
|
|
504
566
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -512,13 +574,13 @@ function CheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
512
574
|
strokeLinejoin: "round",
|
|
513
575
|
"aria-hidden": "true",
|
|
514
576
|
...rest,
|
|
515
|
-
children: /* @__PURE__ */ (0,
|
|
577
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M20 6 9 17l-5-5" })
|
|
516
578
|
}
|
|
517
579
|
);
|
|
518
580
|
}
|
|
519
581
|
|
|
520
582
|
// src/components/checkbox/use-styles.ts
|
|
521
|
-
var
|
|
583
|
+
var import_react11 = require("react");
|
|
522
584
|
|
|
523
585
|
// src/components/checkbox/use-styles.css.ts
|
|
524
586
|
var box = "use-styles_box__9zoga91";
|
|
@@ -529,13 +591,13 @@ var input = "surfaces_srOnly__6hs0fg0";
|
|
|
529
591
|
var root6 = "use-styles_root__9zoga90";
|
|
530
592
|
|
|
531
593
|
// src/components/checkbox/use-styles.ts
|
|
532
|
-
function
|
|
594
|
+
function useStyles8({ checked, disabled: disabled3 }) {
|
|
533
595
|
const { themeClass } = useTheme();
|
|
534
|
-
const root24 = (0,
|
|
596
|
+
const root24 = (0, import_react11.useMemo)(
|
|
535
597
|
() => [themeClass, root6, disabled3 && disabled].filter(Boolean).join(" "),
|
|
536
598
|
[themeClass, disabled3]
|
|
537
599
|
);
|
|
538
|
-
const box2 = (0,
|
|
600
|
+
const box2 = (0, import_react11.useMemo)(
|
|
539
601
|
() => [box, checked && boxChecked].filter(Boolean).join(" "),
|
|
540
602
|
[checked]
|
|
541
603
|
);
|
|
@@ -543,7 +605,7 @@ function useStyles7({ checked, disabled: disabled3 }) {
|
|
|
543
605
|
}
|
|
544
606
|
|
|
545
607
|
// src/components/checkbox/index.tsx
|
|
546
|
-
var
|
|
608
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
547
609
|
function Checkbox({
|
|
548
610
|
checked = false,
|
|
549
611
|
onChange,
|
|
@@ -551,13 +613,13 @@ function Checkbox({
|
|
|
551
613
|
disabled: disabled3 = false,
|
|
552
614
|
id
|
|
553
615
|
}) {
|
|
554
|
-
const { root: root24, input: input6, box: box2, check: check2 } =
|
|
616
|
+
const { root: root24, input: input6, box: box2, check: check2 } = useStyles8({ checked, disabled: disabled3 });
|
|
555
617
|
const handleChange = (e) => {
|
|
556
618
|
if (disabled3) return;
|
|
557
619
|
onChange?.(e.target.checked);
|
|
558
620
|
};
|
|
559
|
-
return /* @__PURE__ */ (0,
|
|
560
|
-
/* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: root24, children: [
|
|
622
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
561
623
|
"input",
|
|
562
624
|
{
|
|
563
625
|
type: "checkbox",
|
|
@@ -568,13 +630,13 @@ function Checkbox({
|
|
|
568
630
|
onChange: handleChange
|
|
569
631
|
}
|
|
570
632
|
),
|
|
571
|
-
/* @__PURE__ */ (0,
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: box2, children: checked && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CheckIcon, { size: 12, className: check2 }) }),
|
|
572
634
|
label7
|
|
573
635
|
] });
|
|
574
636
|
}
|
|
575
637
|
|
|
576
638
|
// src/components/radio/use-styles.ts
|
|
577
|
-
var
|
|
639
|
+
var import_react12 = require("react");
|
|
578
640
|
|
|
579
641
|
// src/components/radio/use-styles.css.ts
|
|
580
642
|
var circle = "use-styles_circle__vy61b42";
|
|
@@ -585,12 +647,12 @@ var label2 = "use-styles_label__vy61b44";
|
|
|
585
647
|
var root7 = "use-styles_root__vy61b40";
|
|
586
648
|
|
|
587
649
|
// src/components/radio/use-styles.ts
|
|
588
|
-
function
|
|
650
|
+
function useStyles9({
|
|
589
651
|
disabled: disabled3,
|
|
590
652
|
className
|
|
591
653
|
}) {
|
|
592
654
|
const { themeClass } = useTheme();
|
|
593
|
-
const root24 = (0,
|
|
655
|
+
const root24 = (0, import_react12.useMemo)(
|
|
594
656
|
() => [themeClass, root7, disabled3 && disabled2, className].filter(Boolean).join(" "),
|
|
595
657
|
[themeClass, disabled3, className]
|
|
596
658
|
);
|
|
@@ -604,11 +666,11 @@ function useStyles8({
|
|
|
604
666
|
}
|
|
605
667
|
|
|
606
668
|
// src/components/radio/index.tsx
|
|
607
|
-
var
|
|
669
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
608
670
|
function Radio({ checked, onChange, label: label7, name, value, disabled: disabled3 }) {
|
|
609
|
-
const { root: root24, input: input6, circle: circle2, dot: dot3, label: labelClass } =
|
|
610
|
-
return /* @__PURE__ */ (0,
|
|
611
|
-
/* @__PURE__ */ (0,
|
|
671
|
+
const { root: root24, input: input6, circle: circle2, dot: dot3, label: labelClass } = useStyles9({ disabled: disabled3 });
|
|
672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: root24, children: [
|
|
673
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
612
674
|
"input",
|
|
613
675
|
{
|
|
614
676
|
className: input6,
|
|
@@ -620,13 +682,13 @@ function Radio({ checked, onChange, label: label7, name, value, disabled: disabl
|
|
|
620
682
|
onChange
|
|
621
683
|
}
|
|
622
684
|
),
|
|
623
|
-
/* @__PURE__ */ (0,
|
|
624
|
-
label7 != null && /* @__PURE__ */ (0,
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: circle2, children: checked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: dot3 }) }),
|
|
686
|
+
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: labelClass, children: label7 })
|
|
625
687
|
] });
|
|
626
688
|
}
|
|
627
689
|
|
|
628
690
|
// src/components/switch/use-styles.ts
|
|
629
|
-
var
|
|
691
|
+
var import_react13 = require("react");
|
|
630
692
|
|
|
631
693
|
// src/components/switch/use-styles.css.ts
|
|
632
694
|
var input3 = "surfaces_srOnly__6hs0fg0";
|
|
@@ -638,9 +700,9 @@ var track2 = "use-styles_track__1r6kem71";
|
|
|
638
700
|
var trackChecked = "use-styles_trackChecked__1r6kem72";
|
|
639
701
|
|
|
640
702
|
// src/components/switch/use-styles.ts
|
|
641
|
-
function
|
|
703
|
+
function useStyles10({ checked }) {
|
|
642
704
|
const { themeClass } = useTheme();
|
|
643
|
-
return (0,
|
|
705
|
+
return (0, import_react13.useMemo)(
|
|
644
706
|
() => ({
|
|
645
707
|
root: [themeClass, root8].filter(Boolean).join(" "),
|
|
646
708
|
input: input3,
|
|
@@ -653,11 +715,11 @@ function useStyles9({ checked }) {
|
|
|
653
715
|
}
|
|
654
716
|
|
|
655
717
|
// src/components/switch/index.tsx
|
|
656
|
-
var
|
|
718
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
657
719
|
function Switch({ checked = false, onChange, label: label7, disabled: disabled3 }) {
|
|
658
|
-
const { root: root24, input: input6, track: track4, knob: knob2, label: labelClass } =
|
|
659
|
-
return /* @__PURE__ */ (0,
|
|
660
|
-
/* @__PURE__ */ (0,
|
|
720
|
+
const { root: root24, input: input6, track: track4, knob: knob2, label: labelClass } = useStyles10({ checked });
|
|
721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: root24, children: [
|
|
722
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
661
723
|
"input",
|
|
662
724
|
{
|
|
663
725
|
type: "checkbox",
|
|
@@ -672,18 +734,147 @@ function Switch({ checked = false, onChange, label: label7, disabled: disabled3
|
|
|
672
734
|
}
|
|
673
735
|
}
|
|
674
736
|
),
|
|
675
|
-
/* @__PURE__ */ (0,
|
|
676
|
-
label7 != null && /* @__PURE__ */ (0,
|
|
737
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: track4, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: knob2 }) }),
|
|
738
|
+
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: labelClass, children: label7 })
|
|
677
739
|
] });
|
|
678
740
|
}
|
|
679
741
|
|
|
680
|
-
// src/components/
|
|
742
|
+
// src/components/base-field/index.tsx
|
|
743
|
+
var import_react15 = require("react");
|
|
744
|
+
|
|
745
|
+
// src/components/base-field/use-styles.ts
|
|
681
746
|
var import_react14 = require("react");
|
|
682
747
|
|
|
748
|
+
// src/components/base-field/use-styles.css.ts
|
|
749
|
+
var field = "use-styles_field__1c3cgd3";
|
|
750
|
+
var helpText = "use-styles_helpText__1c3cgd8";
|
|
751
|
+
var helpTextError = "use-styles_helpTextError__1c3cgd9";
|
|
752
|
+
var input4 = "use-styles_input__1c3cgd4";
|
|
753
|
+
var inputError = "use-styles_inputError__1c3cgd5";
|
|
754
|
+
var inputStartPad = "use-styles_inputStartPad__1c3cgd6";
|
|
755
|
+
var inputTrailingPad = "use-styles_inputTrailingPad__1c3cgd7";
|
|
756
|
+
var labelText = "use-styles_labelText__1c3cgd1";
|
|
757
|
+
var labelTextError = "use-styles_labelTextError__1c3cgd2";
|
|
758
|
+
var root9 = "use-styles_root__1c3cgd0";
|
|
759
|
+
var startIconSlot = "use-styles_startIconSlot__1c3cgda";
|
|
760
|
+
var trailingSlot = "use-styles_trailingSlot__1c3cgdb";
|
|
761
|
+
|
|
762
|
+
// src/components/base-field/use-styles.ts
|
|
763
|
+
function useStyles11({ error, hasStartIcon, hasTrailing, className }) {
|
|
764
|
+
const { themeClass } = useTheme();
|
|
765
|
+
return (0, import_react14.useMemo)(() => {
|
|
766
|
+
const root24 = [themeClass, root9].filter(Boolean).join(" ");
|
|
767
|
+
const labelText2 = [labelText, error && labelTextError].filter(Boolean).join(" ");
|
|
768
|
+
const input6 = [
|
|
769
|
+
input4,
|
|
770
|
+
error && inputError,
|
|
771
|
+
hasStartIcon && inputStartPad,
|
|
772
|
+
hasTrailing && inputTrailingPad,
|
|
773
|
+
className
|
|
774
|
+
].filter(Boolean).join(" ");
|
|
775
|
+
const helpText2 = [helpText, error && helpTextError].filter(Boolean).join(" ");
|
|
776
|
+
return {
|
|
777
|
+
root: root24,
|
|
778
|
+
labelText: labelText2,
|
|
779
|
+
field,
|
|
780
|
+
input: input6,
|
|
781
|
+
helpText: helpText2,
|
|
782
|
+
startIconSlot,
|
|
783
|
+
trailingSlot
|
|
784
|
+
};
|
|
785
|
+
}, [themeClass, error, hasStartIcon, hasTrailing, className]);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/components/base-field/index.tsx
|
|
789
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
790
|
+
function BaseField({
|
|
791
|
+
label: label7,
|
|
792
|
+
help,
|
|
793
|
+
error,
|
|
794
|
+
startIcon: StartIcon,
|
|
795
|
+
trailing: trailing2,
|
|
796
|
+
id,
|
|
797
|
+
className,
|
|
798
|
+
children
|
|
799
|
+
}) {
|
|
800
|
+
const autoId = (0, import_react15.useId)();
|
|
801
|
+
const controlId = id ?? autoId;
|
|
802
|
+
const helpId = help != null ? `${controlId}-help` : void 0;
|
|
803
|
+
const classes = useStyles11({
|
|
804
|
+
error,
|
|
805
|
+
hasStartIcon: StartIcon != null,
|
|
806
|
+
hasTrailing: trailing2 != null,
|
|
807
|
+
className
|
|
808
|
+
});
|
|
809
|
+
const control = {
|
|
810
|
+
id: controlId,
|
|
811
|
+
className: classes.input,
|
|
812
|
+
"aria-describedby": helpId,
|
|
813
|
+
"aria-invalid": error ? true : void 0
|
|
814
|
+
};
|
|
815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: classes.root, children: [
|
|
816
|
+
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { htmlFor: controlId, className: classes.labelText, children: label7 }),
|
|
817
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: classes.field, children: [
|
|
818
|
+
StartIcon != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: classes.startIconSlot, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StartIcon, { size: 18 }) }),
|
|
819
|
+
children(control),
|
|
820
|
+
trailing2 != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: classes.trailingSlot, children: trailing2 })
|
|
821
|
+
] }),
|
|
822
|
+
help != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { id: helpId, className: classes.helpText, children: help })
|
|
823
|
+
] });
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// src/components/text-field/index.tsx
|
|
827
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
828
|
+
function TextField({
|
|
829
|
+
label: label7,
|
|
830
|
+
help,
|
|
831
|
+
error,
|
|
832
|
+
startIcon,
|
|
833
|
+
multiline,
|
|
834
|
+
rows,
|
|
835
|
+
type = "text",
|
|
836
|
+
onChange,
|
|
837
|
+
className,
|
|
838
|
+
id,
|
|
839
|
+
...rest
|
|
840
|
+
}) {
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
842
|
+
BaseField,
|
|
843
|
+
{
|
|
844
|
+
label: label7,
|
|
845
|
+
help,
|
|
846
|
+
error,
|
|
847
|
+
startIcon,
|
|
848
|
+
id,
|
|
849
|
+
className,
|
|
850
|
+
children: (control) => multiline ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
851
|
+
"textarea",
|
|
852
|
+
{
|
|
853
|
+
...rest,
|
|
854
|
+
...control,
|
|
855
|
+
rows: rows ?? 4,
|
|
856
|
+
onChange: (e) => onChange?.(e.target.value)
|
|
857
|
+
}
|
|
858
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
859
|
+
"input",
|
|
860
|
+
{
|
|
861
|
+
...rest,
|
|
862
|
+
...control,
|
|
863
|
+
type,
|
|
864
|
+
onChange: (e) => onChange?.(e.target.value)
|
|
865
|
+
}
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// src/components/password-field/index.tsx
|
|
872
|
+
var import_react17 = require("react");
|
|
873
|
+
|
|
683
874
|
// src/components/icons/eye/index.tsx
|
|
684
|
-
var
|
|
875
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
685
876
|
function EyeIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
686
|
-
return /* @__PURE__ */ (0,
|
|
877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
687
878
|
"svg",
|
|
688
879
|
{
|
|
689
880
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -698,17 +889,17 @@ function EyeIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
698
889
|
"aria-hidden": "true",
|
|
699
890
|
...rest,
|
|
700
891
|
children: [
|
|
701
|
-
/* @__PURE__ */ (0,
|
|
702
|
-
/* @__PURE__ */ (0,
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
703
894
|
]
|
|
704
895
|
}
|
|
705
896
|
);
|
|
706
897
|
}
|
|
707
898
|
|
|
708
899
|
// src/components/icons/eye-off/index.tsx
|
|
709
|
-
var
|
|
900
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
710
901
|
function EyeOffIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
711
|
-
return /* @__PURE__ */ (0,
|
|
902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
712
903
|
"svg",
|
|
713
904
|
{
|
|
714
905
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -723,136 +914,142 @@ function EyeOffIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
723
914
|
"aria-hidden": "true",
|
|
724
915
|
...rest,
|
|
725
916
|
children: [
|
|
726
|
-
/* @__PURE__ */ (0,
|
|
727
|
-
/* @__PURE__ */ (0,
|
|
728
|
-
/* @__PURE__ */ (0,
|
|
729
|
-
/* @__PURE__ */ (0,
|
|
917
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
918
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "m2 2 20 20" })
|
|
730
921
|
]
|
|
731
922
|
}
|
|
732
923
|
);
|
|
733
924
|
}
|
|
734
925
|
|
|
735
|
-
// src/components/
|
|
736
|
-
var
|
|
926
|
+
// src/components/password-field/use-styles.ts
|
|
927
|
+
var import_react16 = require("react");
|
|
737
928
|
|
|
738
|
-
// src/components/
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
var inputRevealPad = "use-styles_inputRevealPad__vat8gv7";
|
|
745
|
-
var inputStartPad = "use-styles_inputStartPad__vat8gv6";
|
|
746
|
-
var labelText = "use-styles_labelText__vat8gv1";
|
|
747
|
-
var labelTextError = "use-styles_labelTextError__vat8gv2";
|
|
748
|
-
var revealButton = "use-styles_revealButton__vat8gvb";
|
|
749
|
-
var root9 = "use-styles_root__vat8gv0";
|
|
750
|
-
var startIcon = "use-styles_startIcon__vat8gva";
|
|
751
|
-
|
|
752
|
-
// src/components/text-field/use-styles.ts
|
|
753
|
-
function useStyles10({ error, hasStartIcon, hasReveal, className }) {
|
|
754
|
-
const { themeClass } = useTheme();
|
|
755
|
-
return (0, import_react13.useMemo)(() => {
|
|
756
|
-
const root24 = [themeClass, root9].filter(Boolean).join(" ");
|
|
757
|
-
const labelText2 = [labelText, error && labelTextError].filter(Boolean).join(" ");
|
|
758
|
-
const input6 = [
|
|
759
|
-
input4,
|
|
760
|
-
error && inputError,
|
|
761
|
-
hasStartIcon && inputStartPad,
|
|
762
|
-
hasReveal && inputRevealPad,
|
|
763
|
-
className
|
|
764
|
-
].filter(Boolean).join(" ");
|
|
765
|
-
const helpText2 = [helpText, error && helpTextError].filter(Boolean).join(" ");
|
|
766
|
-
return {
|
|
767
|
-
root: root24,
|
|
768
|
-
labelText: labelText2,
|
|
769
|
-
field,
|
|
770
|
-
input: input6,
|
|
771
|
-
helpText: helpText2,
|
|
772
|
-
startIcon,
|
|
773
|
-
revealButton
|
|
774
|
-
};
|
|
775
|
-
}, [themeClass, error, hasStartIcon, hasReveal, className]);
|
|
929
|
+
// src/components/password-field/use-styles.css.ts
|
|
930
|
+
var revealButton = "use-styles_revealButton__rsu9d50";
|
|
931
|
+
|
|
932
|
+
// src/components/password-field/use-styles.ts
|
|
933
|
+
function useStyles12() {
|
|
934
|
+
return (0, import_react16.useMemo)(() => ({ revealButton }), []);
|
|
776
935
|
}
|
|
777
936
|
|
|
778
|
-
// src/components/
|
|
779
|
-
var
|
|
780
|
-
function
|
|
937
|
+
// src/components/password-field/index.tsx
|
|
938
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
939
|
+
function PasswordField({
|
|
781
940
|
label: label7,
|
|
782
941
|
help,
|
|
783
942
|
error,
|
|
784
|
-
startIcon
|
|
785
|
-
multiline,
|
|
786
|
-
rows,
|
|
787
|
-
type = "text",
|
|
943
|
+
startIcon,
|
|
788
944
|
onChange,
|
|
789
|
-
className,
|
|
790
945
|
id,
|
|
946
|
+
className,
|
|
791
947
|
...rest
|
|
792
948
|
}) {
|
|
793
|
-
const [reveal, setReveal] = (0,
|
|
794
|
-
const
|
|
795
|
-
const
|
|
796
|
-
const effectiveType = isPassword ? reveal ? "text" : "password" : type;
|
|
797
|
-
const autoId = (0, import_react14.useId)();
|
|
798
|
-
const controlId = id ?? autoId;
|
|
799
|
-
const classes = useStyles10({
|
|
800
|
-
error,
|
|
801
|
-
hasStartIcon: Boolean(StartIcon),
|
|
802
|
-
hasReveal,
|
|
803
|
-
className
|
|
804
|
-
});
|
|
805
|
-
const handleInputChange = (e) => {
|
|
806
|
-
onChange?.(e.target.value);
|
|
807
|
-
};
|
|
808
|
-
const handleTextareaChange = (e) => {
|
|
949
|
+
const [reveal, setReveal] = (0, import_react17.useState)(false);
|
|
950
|
+
const classes = useStyles12();
|
|
951
|
+
const handleChange = (e) => {
|
|
809
952
|
onChange?.(e.target.value);
|
|
810
953
|
};
|
|
811
954
|
const handleToggleMouseDown = (e) => {
|
|
812
955
|
e.preventDefault();
|
|
813
956
|
};
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
957
|
+
const toggleButton = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
958
|
+
"button",
|
|
959
|
+
{
|
|
960
|
+
type: "button",
|
|
961
|
+
tabIndex: -1,
|
|
962
|
+
className: classes.revealButton,
|
|
963
|
+
"aria-label": reveal ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
964
|
+
onMouseDown: handleToggleMouseDown,
|
|
965
|
+
onClick: () => setReveal((r) => !r),
|
|
966
|
+
children: reveal ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EyeOffIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EyeIcon, { size: 18 })
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
970
|
+
BaseField,
|
|
971
|
+
{
|
|
972
|
+
label: label7,
|
|
973
|
+
help,
|
|
974
|
+
error,
|
|
975
|
+
startIcon,
|
|
976
|
+
trailing: toggleButton,
|
|
977
|
+
id,
|
|
978
|
+
className,
|
|
979
|
+
children: (control) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { ...rest, ...control, type: reveal ? "text" : "password", onChange: handleChange })
|
|
980
|
+
}
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
// src/components/money-field/index.tsx
|
|
985
|
+
var import_react18 = require("react");
|
|
986
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
987
|
+
function parseAmount(raw) {
|
|
988
|
+
const cleaned = raw.replace(/[^0-9.-]/g, "");
|
|
989
|
+
if (cleaned === "" || cleaned === "-" || cleaned === ".") return null;
|
|
990
|
+
const n = Number.parseFloat(cleaned);
|
|
991
|
+
return Number.isNaN(n) ? null : n;
|
|
992
|
+
}
|
|
993
|
+
function MoneyField({
|
|
994
|
+
value,
|
|
995
|
+
onChange,
|
|
996
|
+
currency = "USD",
|
|
997
|
+
locale = "en-US",
|
|
998
|
+
label: label7,
|
|
999
|
+
help,
|
|
1000
|
+
error,
|
|
1001
|
+
startIcon,
|
|
1002
|
+
id,
|
|
1003
|
+
className,
|
|
1004
|
+
onFocus,
|
|
1005
|
+
onBlur,
|
|
1006
|
+
...rest
|
|
1007
|
+
}) {
|
|
1008
|
+
const [focused, setFocused] = (0, import_react18.useState)(false);
|
|
1009
|
+
const [draft, setDraft] = (0, import_react18.useState)("");
|
|
1010
|
+
const formatter = (0, import_react18.useMemo)(
|
|
1011
|
+
() => new Intl.NumberFormat(locale, { style: "currency", currency }),
|
|
1012
|
+
[locale, currency]
|
|
1013
|
+
);
|
|
1014
|
+
const displayValue = focused ? draft : value != null ? formatter.format(value) : "";
|
|
1015
|
+
const handleFocus = (e) => {
|
|
1016
|
+
setDraft(value != null ? String(value) : "");
|
|
1017
|
+
setFocused(true);
|
|
1018
|
+
onFocus?.(e);
|
|
1019
|
+
};
|
|
1020
|
+
const handleChange = (e) => setDraft(e.target.value);
|
|
1021
|
+
const handleBlur = (e) => {
|
|
1022
|
+
setFocused(false);
|
|
1023
|
+
onChange?.(parseAmount(draft));
|
|
1024
|
+
onBlur?.(e);
|
|
1025
|
+
};
|
|
1026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1027
|
+
BaseField,
|
|
1028
|
+
{
|
|
1029
|
+
label: label7,
|
|
1030
|
+
help,
|
|
1031
|
+
error,
|
|
1032
|
+
startIcon,
|
|
1033
|
+
id,
|
|
1034
|
+
className,
|
|
1035
|
+
children: (control) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
828
1036
|
"input",
|
|
829
1037
|
{
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
hasReveal && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
838
|
-
"button",
|
|
839
|
-
{
|
|
840
|
-
type: "button",
|
|
841
|
-
tabIndex: -1,
|
|
842
|
-
className: classes.revealButton,
|
|
843
|
-
"aria-label": reveal ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
844
|
-
onMouseDown: handleToggleMouseDown,
|
|
845
|
-
onClick: () => setReveal((r) => !r),
|
|
846
|
-
children: reveal ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeOffIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeIcon, { size: 18 })
|
|
1038
|
+
...rest,
|
|
1039
|
+
...control,
|
|
1040
|
+
inputMode: "decimal",
|
|
1041
|
+
value: displayValue,
|
|
1042
|
+
onFocus: handleFocus,
|
|
1043
|
+
onChange: handleChange,
|
|
1044
|
+
onBlur: handleBlur
|
|
847
1045
|
}
|
|
848
1046
|
)
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
] });
|
|
1047
|
+
}
|
|
1048
|
+
);
|
|
852
1049
|
}
|
|
853
1050
|
|
|
854
1051
|
// src/components/icon-button/use-styles.ts
|
|
855
|
-
var
|
|
1052
|
+
var import_react19 = require("react");
|
|
856
1053
|
|
|
857
1054
|
// src/components/icon-button/use-styles.css.ts
|
|
858
1055
|
var accent = "use-styles_accent__18np0q02";
|
|
@@ -860,12 +1057,12 @@ var active = "use-styles_active__18np0q01";
|
|
|
860
1057
|
var root10 = "use-styles_root__18np0q00";
|
|
861
1058
|
|
|
862
1059
|
// src/components/icon-button/use-styles.ts
|
|
863
|
-
function
|
|
1060
|
+
function useStyles13({
|
|
864
1061
|
active: active2 = false,
|
|
865
1062
|
tone: tone4 = "ink"
|
|
866
1063
|
}) {
|
|
867
1064
|
const { themeClass } = useTheme();
|
|
868
|
-
const root24 = (0,
|
|
1065
|
+
const root24 = (0, import_react19.useMemo)(
|
|
869
1066
|
() => [themeClass, root10, tone4 === "accent" && accent, active2 && active].filter(Boolean).join(" "),
|
|
870
1067
|
[themeClass, active2, tone4]
|
|
871
1068
|
);
|
|
@@ -873,14 +1070,14 @@ function useStyles11({
|
|
|
873
1070
|
}
|
|
874
1071
|
|
|
875
1072
|
// src/components/icon-button/index.tsx
|
|
876
|
-
var
|
|
1073
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
877
1074
|
function IconButton({ icon: Icon, active: active2, tone: tone4, title, ...rest }) {
|
|
878
|
-
const { root: root24 } =
|
|
879
|
-
return /* @__PURE__ */ (0,
|
|
1075
|
+
const { root: root24 } = useStyles13({ active: active2, tone: tone4 });
|
|
1076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: root24, "aria-label": title, title, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { size: 18 }) });
|
|
880
1077
|
}
|
|
881
1078
|
|
|
882
1079
|
// src/components/card/use-styles.ts
|
|
883
|
-
var
|
|
1080
|
+
var import_react20 = require("react");
|
|
884
1081
|
|
|
885
1082
|
// src/components/card/use-styles.css.ts
|
|
886
1083
|
var body = "use-styles_body__1fuvd022";
|
|
@@ -889,29 +1086,29 @@ var header = "use-styles_header__1fuvd021";
|
|
|
889
1086
|
var root11 = "use-styles_root__1fuvd020";
|
|
890
1087
|
|
|
891
1088
|
// src/components/card/use-styles.ts
|
|
892
|
-
function
|
|
1089
|
+
function useStyles14() {
|
|
893
1090
|
const { themeClass } = useTheme();
|
|
894
|
-
const root24 = (0,
|
|
1091
|
+
const root24 = (0, import_react20.useMemo)(() => `${themeClass} ${root11}`, [themeClass]);
|
|
895
1092
|
return { root: root24, header, body, footer };
|
|
896
1093
|
}
|
|
897
1094
|
|
|
898
1095
|
// src/components/card/index.tsx
|
|
899
|
-
var
|
|
1096
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
900
1097
|
function CardRoot({ children, ...rest }) {
|
|
901
|
-
const { root: root24 } =
|
|
902
|
-
return /* @__PURE__ */ (0,
|
|
1098
|
+
const { root: root24 } = useStyles14();
|
|
1099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: root24, ...rest, children });
|
|
903
1100
|
}
|
|
904
1101
|
function CardHeader({ children, ...rest }) {
|
|
905
|
-
const { header: header3 } =
|
|
906
|
-
return /* @__PURE__ */ (0,
|
|
1102
|
+
const { header: header3 } = useStyles14();
|
|
1103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: header3, ...rest, children });
|
|
907
1104
|
}
|
|
908
1105
|
function CardBody({ children, ...rest }) {
|
|
909
|
-
const { body:
|
|
910
|
-
return /* @__PURE__ */ (0,
|
|
1106
|
+
const { body: body3 } = useStyles14();
|
|
1107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: body3, ...rest, children });
|
|
911
1108
|
}
|
|
912
1109
|
function CardFooter({ children, ...rest }) {
|
|
913
|
-
const { footer: footer2 } =
|
|
914
|
-
return /* @__PURE__ */ (0,
|
|
1110
|
+
const { footer: footer2 } = useStyles14();
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: footer2, ...rest, children });
|
|
915
1112
|
}
|
|
916
1113
|
CardRoot.displayName = "Card";
|
|
917
1114
|
CardHeader.displayName = "Card.Header";
|
|
@@ -924,9 +1121,9 @@ var Card = Object.assign(CardRoot, {
|
|
|
924
1121
|
});
|
|
925
1122
|
|
|
926
1123
|
// src/components/icons/circle-check/index.tsx
|
|
927
|
-
var
|
|
1124
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
928
1125
|
function CircleCheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
929
|
-
return /* @__PURE__ */ (0,
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
930
1127
|
"svg",
|
|
931
1128
|
{
|
|
932
1129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -941,17 +1138,17 @@ function CircleCheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
941
1138
|
"aria-hidden": "true",
|
|
942
1139
|
...rest,
|
|
943
1140
|
children: [
|
|
944
|
-
/* @__PURE__ */ (0,
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "m9 12 2 2 4-4" })
|
|
946
1143
|
]
|
|
947
1144
|
}
|
|
948
1145
|
);
|
|
949
1146
|
}
|
|
950
1147
|
|
|
951
1148
|
// src/components/icons/circle-x/index.tsx
|
|
952
|
-
var
|
|
1149
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
953
1150
|
function CircleXIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
954
|
-
return /* @__PURE__ */ (0,
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
955
1152
|
"svg",
|
|
956
1153
|
{
|
|
957
1154
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -966,18 +1163,18 @@ function CircleXIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
966
1163
|
"aria-hidden": "true",
|
|
967
1164
|
...rest,
|
|
968
1165
|
children: [
|
|
969
|
-
/* @__PURE__ */ (0,
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
971
|
-
/* @__PURE__ */ (0,
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "m15 9-6 6" }),
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "m9 9 6 6" })
|
|
972
1169
|
]
|
|
973
1170
|
}
|
|
974
1171
|
);
|
|
975
1172
|
}
|
|
976
1173
|
|
|
977
1174
|
// src/components/icons/info/index.tsx
|
|
978
|
-
var
|
|
1175
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
979
1176
|
function InfoIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
980
|
-
return /* @__PURE__ */ (0,
|
|
1177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
981
1178
|
"svg",
|
|
982
1179
|
{
|
|
983
1180
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -992,18 +1189,18 @@ function InfoIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
992
1189
|
"aria-hidden": "true",
|
|
993
1190
|
...rest,
|
|
994
1191
|
children: [
|
|
995
|
-
/* @__PURE__ */ (0,
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
1192
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M12 16v-4" }),
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M12 8h.01" })
|
|
998
1195
|
]
|
|
999
1196
|
}
|
|
1000
1197
|
);
|
|
1001
1198
|
}
|
|
1002
1199
|
|
|
1003
1200
|
// src/components/icons/triangle-alert/index.tsx
|
|
1004
|
-
var
|
|
1201
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1005
1202
|
function TriangleAlertIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1006
|
-
return /* @__PURE__ */ (0,
|
|
1203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1007
1204
|
"svg",
|
|
1008
1205
|
{
|
|
1009
1206
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1018,46 +1215,42 @@ function TriangleAlertIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1018
1215
|
"aria-hidden": "true",
|
|
1019
1216
|
...rest,
|
|
1020
1217
|
children: [
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
/* @__PURE__ */ (0,
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M12 9v4" }),
|
|
1220
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M12 17h.01" })
|
|
1024
1221
|
]
|
|
1025
1222
|
}
|
|
1026
1223
|
);
|
|
1027
1224
|
}
|
|
1028
1225
|
|
|
1029
1226
|
// src/components/alert/use-styles.ts
|
|
1030
|
-
var
|
|
1227
|
+
var import_react21 = require("react");
|
|
1031
1228
|
|
|
1032
1229
|
// src/components/alert/use-styles.css.ts
|
|
1033
|
-
var body2 = "use-styles_body__ivsh6u8";
|
|
1034
1230
|
var content = "use-styles_content__ivsh6u6";
|
|
1035
1231
|
var iconSlot = "use-styles_iconSlot__ivsh6u5";
|
|
1036
1232
|
var root12 = "use-styles_root__ivsh6u0";
|
|
1037
1233
|
var severity = { info: "use-styles_severity_info__ivsh6u1", ok: "use-styles_severity_ok__ivsh6u2", warn: "use-styles_severity_warn__ivsh6u3", danger: "use-styles_severity_danger__ivsh6u4" };
|
|
1038
|
-
var titleText = "use-styles_titleText__ivsh6u7";
|
|
1039
1234
|
|
|
1040
1235
|
// src/components/alert/use-styles.ts
|
|
1041
|
-
function
|
|
1236
|
+
function useStyles15({
|
|
1042
1237
|
severity: severity2 = "info",
|
|
1043
1238
|
className
|
|
1044
1239
|
}) {
|
|
1045
1240
|
const { themeClass } = useTheme();
|
|
1046
|
-
const root24 = (0,
|
|
1241
|
+
const root24 = (0, import_react21.useMemo)(
|
|
1047
1242
|
() => [themeClass, root12, severity[severity2], className].filter(Boolean).join(" "),
|
|
1048
1243
|
[themeClass, severity2, className]
|
|
1049
1244
|
);
|
|
1050
1245
|
return {
|
|
1051
1246
|
root: root24,
|
|
1052
1247
|
iconSlot,
|
|
1053
|
-
content
|
|
1054
|
-
titleText,
|
|
1055
|
-
body: body2
|
|
1248
|
+
content
|
|
1056
1249
|
};
|
|
1057
1250
|
}
|
|
1058
1251
|
|
|
1059
1252
|
// src/components/alert/index.tsx
|
|
1060
|
-
var
|
|
1253
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1061
1254
|
var defaultIcons = {
|
|
1062
1255
|
info: InfoIcon,
|
|
1063
1256
|
ok: CircleCheckIcon,
|
|
@@ -1072,22 +1265,22 @@ function Alert({
|
|
|
1072
1265
|
children,
|
|
1073
1266
|
...rest
|
|
1074
1267
|
}) {
|
|
1075
|
-
const styles =
|
|
1268
|
+
const styles = useStyles15({ severity: severity2, className });
|
|
1076
1269
|
const IconComponent = icon ?? defaultIcons[severity2];
|
|
1077
|
-
return /* @__PURE__ */ (0,
|
|
1078
|
-
/* @__PURE__ */ (0,
|
|
1079
|
-
/* @__PURE__ */ (0,
|
|
1080
|
-
title != null && /* @__PURE__ */ (0,
|
|
1081
|
-
children != null && /* @__PURE__ */ (0,
|
|
1270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { role: "alert", className: styles.root, ...rest, children: [
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: styles.iconSlot, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconComponent, {}) }),
|
|
1272
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: styles.content, children: [
|
|
1273
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Typography, { variant: "h4", children: title }),
|
|
1274
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Typography, { variant: "body", color: "fg2", children })
|
|
1082
1275
|
] })
|
|
1083
1276
|
] });
|
|
1084
1277
|
}
|
|
1085
1278
|
|
|
1086
1279
|
// src/components/tooltip/index.tsx
|
|
1087
|
-
var
|
|
1280
|
+
var import_react23 = require("react");
|
|
1088
1281
|
|
|
1089
1282
|
// src/components/tooltip/use-styles.ts
|
|
1090
|
-
var
|
|
1283
|
+
var import_react22 = require("react");
|
|
1091
1284
|
|
|
1092
1285
|
// src/components/tooltip/use-styles.css.ts
|
|
1093
1286
|
var bubble = "use-styles_bubble__h9kvh1 surfaces_inkySurface__6hs0fg2";
|
|
@@ -1095,15 +1288,15 @@ var placement = { top: "use-styles_placement_top__h9kvh2", bottom: "use-styles_p
|
|
|
1095
1288
|
var wrapper = "use-styles_wrapper__h9kvh0";
|
|
1096
1289
|
|
|
1097
1290
|
// src/components/tooltip/use-styles.ts
|
|
1098
|
-
function
|
|
1291
|
+
function useStyles16({
|
|
1099
1292
|
placement: placement2 = "top"
|
|
1100
1293
|
}) {
|
|
1101
1294
|
const { themeClass } = useTheme();
|
|
1102
|
-
const wrapper4 = (0,
|
|
1295
|
+
const wrapper4 = (0, import_react22.useMemo)(
|
|
1103
1296
|
() => [themeClass, wrapper].filter(Boolean).join(" "),
|
|
1104
1297
|
[themeClass]
|
|
1105
1298
|
);
|
|
1106
|
-
const bubble2 = (0,
|
|
1299
|
+
const bubble2 = (0, import_react22.useMemo)(
|
|
1107
1300
|
() => [bubble, placement[placement2]].filter(Boolean).join(" "),
|
|
1108
1301
|
[placement2]
|
|
1109
1302
|
);
|
|
@@ -1111,29 +1304,29 @@ function useStyles14({
|
|
|
1111
1304
|
}
|
|
1112
1305
|
|
|
1113
1306
|
// src/components/tooltip/index.tsx
|
|
1114
|
-
var
|
|
1307
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1115
1308
|
function Tooltip({ label: label7, children, placement: placement2 }) {
|
|
1116
|
-
const [open, setOpen] = (0,
|
|
1117
|
-
const tooltipId = (0,
|
|
1118
|
-
const { wrapper: wrapper4, bubble: bubble2 } =
|
|
1309
|
+
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
1310
|
+
const tooltipId = (0, import_react23.useId)();
|
|
1311
|
+
const { wrapper: wrapper4, bubble: bubble2 } = useStyles16({ placement: placement2 });
|
|
1119
1312
|
const show = () => setOpen(true);
|
|
1120
1313
|
const hide = () => setOpen(false);
|
|
1121
1314
|
const previousDescribedBy = children.props["aria-describedby"];
|
|
1122
1315
|
const describedBy = open ? [previousDescribedBy, tooltipId].filter(Boolean).join(" ") : previousDescribedBy;
|
|
1123
|
-
const trigger2 = (0,
|
|
1124
|
-
return /* @__PURE__ */ (0,
|
|
1316
|
+
const trigger2 = (0, import_react23.cloneElement)(children, { "aria-describedby": describedBy });
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: wrapper4, onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, children: [
|
|
1125
1318
|
trigger2,
|
|
1126
|
-
open && /* @__PURE__ */ (0,
|
|
1319
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { id: tooltipId, role: "tooltip", className: bubble2, children: label7 })
|
|
1127
1320
|
] });
|
|
1128
1321
|
}
|
|
1129
1322
|
|
|
1130
1323
|
// src/components/select/index.tsx
|
|
1131
|
-
var
|
|
1324
|
+
var import_react25 = require("react");
|
|
1132
1325
|
|
|
1133
1326
|
// src/components/icons/chevron-down/index.tsx
|
|
1134
|
-
var
|
|
1327
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1135
1328
|
function ChevronDownIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1136
|
-
return /* @__PURE__ */ (0,
|
|
1329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1137
1330
|
"svg",
|
|
1138
1331
|
{
|
|
1139
1332
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1147,13 +1340,13 @@ function ChevronDownIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1147
1340
|
strokeLinejoin: "round",
|
|
1148
1341
|
"aria-hidden": "true",
|
|
1149
1342
|
...rest,
|
|
1150
|
-
children: /* @__PURE__ */ (0,
|
|
1343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
1151
1344
|
}
|
|
1152
1345
|
);
|
|
1153
1346
|
}
|
|
1154
1347
|
|
|
1155
1348
|
// src/components/select/use-styles.ts
|
|
1156
|
-
var
|
|
1349
|
+
var import_react24 = require("react");
|
|
1157
1350
|
|
|
1158
1351
|
// src/components/select/use-styles.css.ts
|
|
1159
1352
|
var chevron = "use-styles_chevron__1w1czpb4";
|
|
@@ -1168,11 +1361,11 @@ var root13 = "use-styles_root__1w1czpb0";
|
|
|
1168
1361
|
var trigger = "use-styles_trigger__1w1czpb2";
|
|
1169
1362
|
|
|
1170
1363
|
// src/components/select/use-styles.ts
|
|
1171
|
-
function
|
|
1364
|
+
function useStyles17({
|
|
1172
1365
|
open = false
|
|
1173
1366
|
}) {
|
|
1174
1367
|
const { themeClass } = useTheme();
|
|
1175
|
-
return (0,
|
|
1368
|
+
return (0, import_react24.useMemo)(() => {
|
|
1176
1369
|
const chevron3 = [chevron, open && chevronOpen].filter(Boolean).join(" ");
|
|
1177
1370
|
return {
|
|
1178
1371
|
root: [themeClass, root13].filter(Boolean).join(" "),
|
|
@@ -1187,12 +1380,12 @@ function useStyles15({
|
|
|
1187
1380
|
}
|
|
1188
1381
|
|
|
1189
1382
|
// src/components/select/index.tsx
|
|
1190
|
-
var
|
|
1383
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1191
1384
|
function Select({ options, value, onChange, placeholder: placeholder2, label: label7, disabled: disabled3 }) {
|
|
1192
|
-
const [open, setOpen] = (0,
|
|
1193
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
1194
|
-
const rootRef = (0,
|
|
1195
|
-
const baseId = (0,
|
|
1385
|
+
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
1386
|
+
const [activeIndex, setActiveIndex] = (0, import_react25.useState)(0);
|
|
1387
|
+
const rootRef = (0, import_react25.useRef)(null);
|
|
1388
|
+
const baseId = (0, import_react25.useId)();
|
|
1196
1389
|
const labelId = `${baseId}-label`;
|
|
1197
1390
|
const optionId = (index) => `${baseId}-option-${index}`;
|
|
1198
1391
|
const {
|
|
@@ -1203,8 +1396,8 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1203
1396
|
chevron: chevron3,
|
|
1204
1397
|
menu: menu2,
|
|
1205
1398
|
optionClass
|
|
1206
|
-
} =
|
|
1207
|
-
(0,
|
|
1399
|
+
} = useStyles17({ open });
|
|
1400
|
+
(0, import_react25.useEffect)(() => {
|
|
1208
1401
|
if (!open) return;
|
|
1209
1402
|
const onPointerDown = (event) => {
|
|
1210
1403
|
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
@@ -1264,9 +1457,9 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1264
1457
|
break;
|
|
1265
1458
|
}
|
|
1266
1459
|
};
|
|
1267
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
-
label7 && /* @__PURE__ */ (0,
|
|
1269
|
-
/* @__PURE__ */ (0,
|
|
1460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: rootRef, className: root24, children: [
|
|
1461
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { id: labelId, className: labelClass, children: label7 }),
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1270
1463
|
"button",
|
|
1271
1464
|
{
|
|
1272
1465
|
type: "button",
|
|
@@ -1286,17 +1479,17 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1286
1479
|
},
|
|
1287
1480
|
onKeyDown: handleKeyDown,
|
|
1288
1481
|
children: [
|
|
1289
|
-
selected3 ? selected3.label : /* @__PURE__ */ (0,
|
|
1290
|
-
/* @__PURE__ */ (0,
|
|
1482
|
+
selected3 ? selected3.label : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: placeholderClass, children: placeholder2 }),
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: chevron3, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronDownIcon, { size: 18 }) })
|
|
1291
1484
|
]
|
|
1292
1485
|
}
|
|
1293
1486
|
),
|
|
1294
|
-
open && /* @__PURE__ */ (0,
|
|
1487
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: menu2, role: "listbox", children: options.map((option2, index) => {
|
|
1295
1488
|
const isSelected = option2.value === value;
|
|
1296
1489
|
const isActive = index === activeIndex;
|
|
1297
1490
|
return (
|
|
1298
1491
|
// biome-ignore lint/a11y/useKeyWithClickEvents: keyboard nav lives on the trigger via aria-activedescendant; options are not focusable.
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1300
1493
|
"div",
|
|
1301
1494
|
{
|
|
1302
1495
|
id: optionId(index),
|
|
@@ -1315,7 +1508,7 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1315
1508
|
}
|
|
1316
1509
|
|
|
1317
1510
|
// src/components/slider/use-styles.ts
|
|
1318
|
-
var
|
|
1511
|
+
var import_react26 = require("react");
|
|
1319
1512
|
|
|
1320
1513
|
// src/components/slider/use-styles.css.ts
|
|
1321
1514
|
var input5 = "use-styles_input__okw59n3";
|
|
@@ -1327,9 +1520,9 @@ var track3 = "use-styles_track__okw59n1";
|
|
|
1327
1520
|
var wrapper2 = "use-styles_wrapper__okw59n6";
|
|
1328
1521
|
|
|
1329
1522
|
// src/components/slider/use-styles.ts
|
|
1330
|
-
function
|
|
1523
|
+
function useStyles18() {
|
|
1331
1524
|
const { themeClass } = useTheme();
|
|
1332
|
-
return (0,
|
|
1525
|
+
return (0, import_react26.useMemo)(() => {
|
|
1333
1526
|
const root24 = [themeClass, root14].filter(Boolean).join(" ");
|
|
1334
1527
|
return {
|
|
1335
1528
|
wrapper: wrapper2,
|
|
@@ -1344,7 +1537,7 @@ function useStyles16() {
|
|
|
1344
1537
|
}
|
|
1345
1538
|
|
|
1346
1539
|
// src/components/slider/index.tsx
|
|
1347
|
-
var
|
|
1540
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1348
1541
|
function Slider({
|
|
1349
1542
|
value = 0,
|
|
1350
1543
|
onChange,
|
|
@@ -1354,19 +1547,19 @@ function Slider({
|
|
|
1354
1547
|
disabled: disabled3,
|
|
1355
1548
|
label: label7
|
|
1356
1549
|
}) {
|
|
1357
|
-
const { wrapper: wrapper4, label: labelClass, root: root24, track: track4, range: range2, thumb: thumb2, input: input6 } =
|
|
1550
|
+
const { wrapper: wrapper4, label: labelClass, root: root24, track: track4, range: range2, thumb: thumb2, input: input6 } = useStyles18();
|
|
1358
1551
|
const span = max - min;
|
|
1359
1552
|
const percent = span > 0 ? (value - min) / span * 100 : 0;
|
|
1360
1553
|
const clamped = Math.max(0, Math.min(100, percent));
|
|
1361
1554
|
const handleChange = (e) => {
|
|
1362
1555
|
onChange?.(Number(e.target.value));
|
|
1363
1556
|
};
|
|
1364
|
-
return /* @__PURE__ */ (0,
|
|
1365
|
-
label7 ? /* @__PURE__ */ (0,
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1369
|
-
/* @__PURE__ */ (0,
|
|
1557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: wrapper4, children: [
|
|
1558
|
+
label7 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: labelClass, children: label7 }) : null,
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: root24, children: [
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: track4 }),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: range2, style: { width: `${clamped}%` } }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1370
1563
|
"input",
|
|
1371
1564
|
{
|
|
1372
1565
|
className: input6,
|
|
@@ -1379,16 +1572,16 @@ function Slider({
|
|
|
1379
1572
|
onChange: handleChange
|
|
1380
1573
|
}
|
|
1381
1574
|
),
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: thumb2, style: { left: `${clamped}%` } })
|
|
1383
1576
|
] })
|
|
1384
1577
|
] });
|
|
1385
1578
|
}
|
|
1386
1579
|
|
|
1387
1580
|
// src/components/accordion/index.tsx
|
|
1388
|
-
var
|
|
1581
|
+
var import_react28 = require("react");
|
|
1389
1582
|
|
|
1390
1583
|
// src/components/accordion/use-styles.ts
|
|
1391
|
-
var
|
|
1584
|
+
var import_react27 = require("react");
|
|
1392
1585
|
|
|
1393
1586
|
// src/components/accordion/use-styles.css.ts
|
|
1394
1587
|
var chevron2 = "use-styles_chevron__1cjrdh93";
|
|
@@ -1399,9 +1592,9 @@ var panel = "use-styles_panel__1cjrdh95";
|
|
|
1399
1592
|
var root15 = "use-styles_root__1cjrdh90";
|
|
1400
1593
|
|
|
1401
1594
|
// src/components/accordion/use-styles.ts
|
|
1402
|
-
function
|
|
1595
|
+
function useStyles19({ className }) {
|
|
1403
1596
|
const { themeClass } = useTheme();
|
|
1404
|
-
return (0,
|
|
1597
|
+
return (0, import_react27.useMemo)(
|
|
1405
1598
|
() => ({
|
|
1406
1599
|
root: [themeClass, root15, className].filter(Boolean).join(" "),
|
|
1407
1600
|
item,
|
|
@@ -1414,15 +1607,15 @@ function useStyles17({ className }) {
|
|
|
1414
1607
|
}
|
|
1415
1608
|
|
|
1416
1609
|
// src/components/accordion/index.tsx
|
|
1417
|
-
var
|
|
1610
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1418
1611
|
function Accordion({
|
|
1419
1612
|
items,
|
|
1420
1613
|
multiple = false,
|
|
1421
1614
|
defaultOpen = [],
|
|
1422
1615
|
className
|
|
1423
1616
|
}) {
|
|
1424
|
-
const [open, setOpen] = (0,
|
|
1425
|
-
const { root: root24, item: item3, header: header3, chevronFor, panel: panel2 } =
|
|
1617
|
+
const [open, setOpen] = (0, import_react28.useState)(defaultOpen);
|
|
1618
|
+
const { root: root24, item: item3, header: header3, chevronFor, panel: panel2 } = useStyles19({ className });
|
|
1426
1619
|
const toggle = (id) => {
|
|
1427
1620
|
setOpen((current2) => {
|
|
1428
1621
|
const isOpen = current2.includes(id);
|
|
@@ -1430,12 +1623,12 @@ function Accordion({
|
|
|
1430
1623
|
return multiple ? [...current2, id] : [id];
|
|
1431
1624
|
});
|
|
1432
1625
|
};
|
|
1433
|
-
return /* @__PURE__ */ (0,
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: root24, children: items.map((it) => {
|
|
1434
1627
|
const isOpen = open.includes(it.id);
|
|
1435
1628
|
const panelId = `accordion-panel-${it.id}`;
|
|
1436
1629
|
const headerId = `accordion-header-${it.id}`;
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: item3, children: [
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1439
1632
|
"button",
|
|
1440
1633
|
{
|
|
1441
1634
|
type: "button",
|
|
@@ -1446,22 +1639,22 @@ function Accordion({
|
|
|
1446
1639
|
onClick: () => toggle(it.id),
|
|
1447
1640
|
children: [
|
|
1448
1641
|
it.title,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
1642
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ChevronDownIcon, { className: chevronFor(isOpen) })
|
|
1450
1643
|
]
|
|
1451
1644
|
}
|
|
1452
1645
|
),
|
|
1453
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1646
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: panelId, className: panel2, role: "region", "aria-labelledby": headerId, children: it.content })
|
|
1454
1647
|
] }, it.id);
|
|
1455
1648
|
}) });
|
|
1456
1649
|
}
|
|
1457
1650
|
|
|
1458
1651
|
// src/components/breadcrumbs/index.tsx
|
|
1459
|
-
var
|
|
1652
|
+
var import_react30 = require("react");
|
|
1460
1653
|
|
|
1461
1654
|
// src/components/icons/chevron-right/index.tsx
|
|
1462
|
-
var
|
|
1655
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1463
1656
|
function ChevronRightIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1464
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1465
1658
|
"svg",
|
|
1466
1659
|
{
|
|
1467
1660
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1475,13 +1668,13 @@ function ChevronRightIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1475
1668
|
strokeLinejoin: "round",
|
|
1476
1669
|
"aria-hidden": "true",
|
|
1477
1670
|
...rest,
|
|
1478
|
-
children: /* @__PURE__ */ (0,
|
|
1671
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
1479
1672
|
}
|
|
1480
1673
|
);
|
|
1481
1674
|
}
|
|
1482
1675
|
|
|
1483
1676
|
// src/components/breadcrumbs/use-styles.ts
|
|
1484
|
-
var
|
|
1677
|
+
var import_react29 = require("react");
|
|
1485
1678
|
|
|
1486
1679
|
// src/components/breadcrumbs/use-styles.css.ts
|
|
1487
1680
|
var crumb = "use-styles_crumb__7u0du61";
|
|
@@ -1490,9 +1683,9 @@ var root16 = "use-styles_root__7u0du60";
|
|
|
1490
1683
|
var separator = "use-styles_separator__7u0du63";
|
|
1491
1684
|
|
|
1492
1685
|
// src/components/breadcrumbs/use-styles.ts
|
|
1493
|
-
function
|
|
1686
|
+
function useStyles20({ className }) {
|
|
1494
1687
|
const { themeClass } = useTheme();
|
|
1495
|
-
const root24 = (0,
|
|
1688
|
+
const root24 = (0, import_react29.useMemo)(
|
|
1496
1689
|
() => [themeClass, root16, className].filter(Boolean).join(" "),
|
|
1497
1690
|
[themeClass, className]
|
|
1498
1691
|
);
|
|
@@ -1500,23 +1693,23 @@ function useStyles18({ className }) {
|
|
|
1500
1693
|
}
|
|
1501
1694
|
|
|
1502
1695
|
// src/components/breadcrumbs/index.tsx
|
|
1503
|
-
var
|
|
1696
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1504
1697
|
function Breadcrumbs({ items, className, ...rest }) {
|
|
1505
|
-
const { root: root24, crumb: crumb2, current: current2, separator: separator2 } =
|
|
1506
|
-
return /* @__PURE__ */ (0,
|
|
1698
|
+
const { root: root24, crumb: crumb2, current: current2, separator: separator2 } = useStyles20({ className });
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("nav", { "aria-label": "Breadcrumb", className: root24, ...rest, children: items.map((item3, index) => {
|
|
1507
1700
|
const isLast = index === items.length - 1;
|
|
1508
1701
|
const key = index;
|
|
1509
|
-
return /* @__PURE__ */ (0,
|
|
1510
|
-
isLast ? /* @__PURE__ */ (0,
|
|
1511
|
-
!isLast && /* @__PURE__ */ (0,
|
|
1702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react30.Fragment, { children: [
|
|
1703
|
+
isLast ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: current2, "aria-current": "page", children: item3.label }) : item3.href ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("a", { className: crumb2, href: item3.href, children: item3.label }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: crumb2, children: item3.label }),
|
|
1704
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: separator2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRightIcon, { size: 14 }) })
|
|
1512
1705
|
] }, key);
|
|
1513
1706
|
}) });
|
|
1514
1707
|
}
|
|
1515
1708
|
|
|
1516
1709
|
// src/components/icons/chevron-left/index.tsx
|
|
1517
|
-
var
|
|
1710
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1518
1711
|
function ChevronLeftIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1519
|
-
return /* @__PURE__ */ (0,
|
|
1712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1520
1713
|
"svg",
|
|
1521
1714
|
{
|
|
1522
1715
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1530,13 +1723,13 @@ function ChevronLeftIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1530
1723
|
strokeLinejoin: "round",
|
|
1531
1724
|
"aria-hidden": "true",
|
|
1532
1725
|
...rest,
|
|
1533
|
-
children: /* @__PURE__ */ (0,
|
|
1726
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { d: "m15 18-6-6 6-6" })
|
|
1534
1727
|
}
|
|
1535
1728
|
);
|
|
1536
1729
|
}
|
|
1537
1730
|
|
|
1538
1731
|
// src/components/pagination/use-styles.ts
|
|
1539
|
-
var
|
|
1732
|
+
var import_react31 = require("react");
|
|
1540
1733
|
|
|
1541
1734
|
// src/components/pagination/use-styles.css.ts
|
|
1542
1735
|
var ellipsis = "use-styles_ellipsis__1azgzoh3";
|
|
@@ -1546,9 +1739,9 @@ var pageBtn = "use-styles_pageBtn__1azgzoh1";
|
|
|
1546
1739
|
var root17 = "use-styles_root__1azgzoh0";
|
|
1547
1740
|
|
|
1548
1741
|
// src/components/pagination/use-styles.ts
|
|
1549
|
-
function
|
|
1742
|
+
function useStyles21() {
|
|
1550
1743
|
const { themeClass } = useTheme();
|
|
1551
|
-
return (0,
|
|
1744
|
+
return (0, import_react31.useMemo)(
|
|
1552
1745
|
() => ({
|
|
1553
1746
|
root: [themeClass, root17].filter(Boolean).join(" "),
|
|
1554
1747
|
pageBtnFor: (active2) => [pageBtn, active2 && pageActive].filter(Boolean).join(" "),
|
|
@@ -1560,7 +1753,7 @@ function useStyles19() {
|
|
|
1560
1753
|
}
|
|
1561
1754
|
|
|
1562
1755
|
// src/components/pagination/index.tsx
|
|
1563
|
-
var
|
|
1756
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1564
1757
|
function buildItems(count, page, siblingCount) {
|
|
1565
1758
|
const total = Math.max(1, count);
|
|
1566
1759
|
const first = 1;
|
|
@@ -1575,13 +1768,13 @@ function buildItems(count, page, siblingCount) {
|
|
|
1575
1768
|
return items;
|
|
1576
1769
|
}
|
|
1577
1770
|
function Pagination({ count, page = 1, onChange, siblingCount = 1 }) {
|
|
1578
|
-
const { root: root24, pageBtnFor, ellipsis: ellipsis2, nav: nav2 } =
|
|
1771
|
+
const { root: root24, pageBtnFor, ellipsis: ellipsis2, nav: nav2 } = useStyles21();
|
|
1579
1772
|
const total = Math.max(1, count);
|
|
1580
1773
|
const current2 = Math.min(Math.max(1, page), total);
|
|
1581
1774
|
const items = buildItems(total, current2, siblingCount);
|
|
1582
1775
|
const go = (n) => onChange?.(Math.min(Math.max(1, n), total));
|
|
1583
|
-
return /* @__PURE__ */ (0,
|
|
1584
|
-
/* @__PURE__ */ (0,
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("nav", { className: root24, "aria-label": "Pagination", children: [
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1585
1778
|
"button",
|
|
1586
1779
|
{
|
|
1587
1780
|
type: "button",
|
|
@@ -1589,14 +1782,14 @@ function Pagination({ count, page = 1, onChange, siblingCount = 1 }) {
|
|
|
1589
1782
|
"aria-label": "Previous page",
|
|
1590
1783
|
disabled: current2 <= 1,
|
|
1591
1784
|
onClick: () => go(current2 - 1),
|
|
1592
|
-
children: /* @__PURE__ */ (0,
|
|
1785
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronLeftIcon, { size: 18 })
|
|
1593
1786
|
}
|
|
1594
1787
|
),
|
|
1595
1788
|
items.map(
|
|
1596
1789
|
(item3, index) => item3 === "ellipsis" ? (
|
|
1597
1790
|
// biome-ignore lint/suspicious/noArrayIndexKey: ellipsis position is stable per render
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1599
|
-
) : /* @__PURE__ */ (0,
|
|
1791
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: ellipsis2, children: "\u2026" }, `ellipsis-${index}`)
|
|
1792
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1600
1793
|
"button",
|
|
1601
1794
|
{
|
|
1602
1795
|
type: "button",
|
|
@@ -1608,7 +1801,7 @@ function Pagination({ count, page = 1, onChange, siblingCount = 1 }) {
|
|
|
1608
1801
|
item3
|
|
1609
1802
|
)
|
|
1610
1803
|
),
|
|
1611
|
-
/* @__PURE__ */ (0,
|
|
1804
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1612
1805
|
"button",
|
|
1613
1806
|
{
|
|
1614
1807
|
type: "button",
|
|
@@ -1616,17 +1809,17 @@ function Pagination({ count, page = 1, onChange, siblingCount = 1 }) {
|
|
|
1616
1809
|
"aria-label": "Next page",
|
|
1617
1810
|
disabled: current2 >= total,
|
|
1618
1811
|
onClick: () => go(current2 + 1),
|
|
1619
|
-
children: /* @__PURE__ */ (0,
|
|
1812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRightIcon, { size: 18 })
|
|
1620
1813
|
}
|
|
1621
1814
|
)
|
|
1622
1815
|
] });
|
|
1623
1816
|
}
|
|
1624
1817
|
|
|
1625
1818
|
// src/components/stepper/index.tsx
|
|
1626
|
-
var
|
|
1819
|
+
var import_react33 = require("react");
|
|
1627
1820
|
|
|
1628
1821
|
// src/components/stepper/use-styles.ts
|
|
1629
|
-
var
|
|
1822
|
+
var import_react32 = require("react");
|
|
1630
1823
|
|
|
1631
1824
|
// src/components/stepper/use-styles.css.ts
|
|
1632
1825
|
var connector = "use-styles_connector__79pt4e7";
|
|
@@ -1639,9 +1832,9 @@ var root18 = "use-styles_root__79pt4e0";
|
|
|
1639
1832
|
var step = "use-styles_step__79pt4e1";
|
|
1640
1833
|
|
|
1641
1834
|
// src/components/stepper/use-styles.ts
|
|
1642
|
-
function
|
|
1835
|
+
function useStyles22({ className }) {
|
|
1643
1836
|
const { themeClass } = useTheme();
|
|
1644
|
-
return (0,
|
|
1837
|
+
return (0, import_react32.useMemo)(() => {
|
|
1645
1838
|
const root24 = [themeClass, root18, className].filter(Boolean).join(" ");
|
|
1646
1839
|
const markerFor = (state) => [
|
|
1647
1840
|
marker,
|
|
@@ -1654,27 +1847,27 @@ function useStyles20({ className }) {
|
|
|
1654
1847
|
}
|
|
1655
1848
|
|
|
1656
1849
|
// src/components/stepper/index.tsx
|
|
1657
|
-
var
|
|
1850
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1658
1851
|
function Stepper({ steps, active: active2 = 0, className, ...rest }) {
|
|
1659
|
-
const { root: root24, step: step2, connector: connector2, markerFor, labelFor } =
|
|
1660
|
-
return /* @__PURE__ */ (0,
|
|
1852
|
+
const { root: root24, step: step2, connector: connector2, markerFor, labelFor } = useStyles22({ className });
|
|
1853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: root24, ...rest, children: steps.map((s, index) => {
|
|
1661
1854
|
const state = index < active2 ? "done" : index === active2 ? "active" : "upcoming";
|
|
1662
1855
|
const isActive = state === "active";
|
|
1663
1856
|
return (
|
|
1664
1857
|
// biome-ignore lint/suspicious/noArrayIndexKey: steps are a static, ordered list with no stable id.
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1666
|
-
/* @__PURE__ */ (0,
|
|
1667
|
-
/* @__PURE__ */ (0,
|
|
1668
|
-
/* @__PURE__ */ (0,
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react33.Fragment, { children: [
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: step2, "aria-current": isActive ? "step" : void 0, children: [
|
|
1860
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: markerFor(state), children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CheckIcon, { size: 14 }) : index + 1 }),
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: labelFor(isActive), children: s.label })
|
|
1669
1862
|
] }),
|
|
1670
|
-
index < steps.length - 1 && /* @__PURE__ */ (0,
|
|
1863
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { "data-part": "connector", className: connector2 })
|
|
1671
1864
|
] }, index)
|
|
1672
1865
|
);
|
|
1673
1866
|
}) });
|
|
1674
1867
|
}
|
|
1675
1868
|
|
|
1676
1869
|
// src/components/tabs/use-styles.ts
|
|
1677
|
-
var
|
|
1870
|
+
var import_react34 = require("react");
|
|
1678
1871
|
|
|
1679
1872
|
// src/components/tabs/use-styles.css.ts
|
|
1680
1873
|
var root19 = "use-styles_root__1l4m7t40";
|
|
@@ -1682,9 +1875,9 @@ var tab = "use-styles_tab__1l4m7t41";
|
|
|
1682
1875
|
var tabActive = "use-styles_tabActive__1l4m7t42";
|
|
1683
1876
|
|
|
1684
1877
|
// src/components/tabs/use-styles.ts
|
|
1685
|
-
function
|
|
1878
|
+
function useStyles23() {
|
|
1686
1879
|
const { themeClass } = useTheme();
|
|
1687
|
-
return (0,
|
|
1880
|
+
return (0, import_react34.useMemo)(() => {
|
|
1688
1881
|
const root24 = [themeClass, root19].filter(Boolean).join(" ");
|
|
1689
1882
|
const tabClass = (active2) => [tab, active2 && tabActive].filter(Boolean).join(" ");
|
|
1690
1883
|
return { root: root24, tab, tabClass };
|
|
@@ -1692,12 +1885,12 @@ function useStyles21() {
|
|
|
1692
1885
|
}
|
|
1693
1886
|
|
|
1694
1887
|
// src/components/tabs/index.tsx
|
|
1695
|
-
var
|
|
1888
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1696
1889
|
function Tabs({ items, value, onChange }) {
|
|
1697
|
-
const { root: root24, tabClass } =
|
|
1698
|
-
return /* @__PURE__ */ (0,
|
|
1890
|
+
const { root: root24, tabClass } = useStyles23();
|
|
1891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { role: "tablist", className: root24, children: items.map((item3) => {
|
|
1699
1892
|
const active2 = item3.value === value;
|
|
1700
|
-
return /* @__PURE__ */ (0,
|
|
1893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1701
1894
|
"button",
|
|
1702
1895
|
{
|
|
1703
1896
|
type: "button",
|
|
@@ -1713,10 +1906,10 @@ function Tabs({ items, value, onChange }) {
|
|
|
1713
1906
|
}
|
|
1714
1907
|
|
|
1715
1908
|
// src/components/menu/index.tsx
|
|
1716
|
-
var
|
|
1909
|
+
var import_react36 = require("react");
|
|
1717
1910
|
|
|
1718
1911
|
// src/components/menu/use-styles.ts
|
|
1719
|
-
var
|
|
1912
|
+
var import_react35 = require("react");
|
|
1720
1913
|
|
|
1721
1914
|
// src/components/menu/use-styles.css.ts
|
|
1722
1915
|
var danger = "use-styles_danger__1uyxaj3";
|
|
@@ -1725,9 +1918,9 @@ var list = "use-styles_list__1uyxaj1 surfaces_panelSurface__6hs0fg1";
|
|
|
1725
1918
|
var wrapper3 = "use-styles_wrapper__1uyxaj0";
|
|
1726
1919
|
|
|
1727
1920
|
// src/components/menu/use-styles.ts
|
|
1728
|
-
function
|
|
1921
|
+
function useStyles24() {
|
|
1729
1922
|
const { themeClass } = useTheme();
|
|
1730
|
-
return (0,
|
|
1923
|
+
return (0, import_react35.useMemo)(
|
|
1731
1924
|
() => ({
|
|
1732
1925
|
wrapper: [themeClass, wrapper3].filter(Boolean).join(" "),
|
|
1733
1926
|
list,
|
|
@@ -1739,17 +1932,17 @@ function useStyles22() {
|
|
|
1739
1932
|
}
|
|
1740
1933
|
|
|
1741
1934
|
// src/components/menu/index.tsx
|
|
1742
|
-
var
|
|
1935
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1743
1936
|
function assignRef(ref, value) {
|
|
1744
1937
|
if (typeof ref === "function") ref(value);
|
|
1745
1938
|
else if (ref) ref.current = value;
|
|
1746
1939
|
}
|
|
1747
1940
|
function Menu({ trigger: trigger2, items }) {
|
|
1748
|
-
const { wrapper: wrapper4, list: list2, item: item3, dangerItem } =
|
|
1749
|
-
const [open, setOpen] = (0,
|
|
1750
|
-
const rootRef = (0,
|
|
1751
|
-
const listRef = (0,
|
|
1752
|
-
const triggerRef = (0,
|
|
1941
|
+
const { wrapper: wrapper4, list: list2, item: item3, dangerItem } = useStyles24();
|
|
1942
|
+
const [open, setOpen] = (0, import_react36.useState)(false);
|
|
1943
|
+
const rootRef = (0, import_react36.useRef)(null);
|
|
1944
|
+
const listRef = (0, import_react36.useRef)(null);
|
|
1945
|
+
const triggerRef = (0, import_react36.useRef)(null);
|
|
1753
1946
|
const getMenuItems = () => Array.from(listRef.current?.querySelectorAll('[role="menuitem"]') ?? []);
|
|
1754
1947
|
const focusItemAt = (index) => {
|
|
1755
1948
|
const menuItems = getMenuItems();
|
|
@@ -1761,7 +1954,7 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
1761
1954
|
setOpen(false);
|
|
1762
1955
|
triggerRef.current?.focus();
|
|
1763
1956
|
};
|
|
1764
|
-
(0,
|
|
1957
|
+
(0, import_react36.useEffect)(() => {
|
|
1765
1958
|
if (!open) return;
|
|
1766
1959
|
listRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
1767
1960
|
const onDocMouseDown = (event) => {
|
|
@@ -1817,7 +2010,7 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
1817
2010
|
triggerRef.current = node;
|
|
1818
2011
|
assignRef(consumerRef, node);
|
|
1819
2012
|
};
|
|
1820
|
-
const clonedTrigger = (0,
|
|
2013
|
+
const clonedTrigger = (0, import_react36.cloneElement)(trigger2, {
|
|
1821
2014
|
ref: mergedTriggerRef,
|
|
1822
2015
|
"aria-haspopup": "menu",
|
|
1823
2016
|
"aria-expanded": open,
|
|
@@ -1826,9 +2019,9 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
1826
2019
|
setOpen((prev) => !prev);
|
|
1827
2020
|
}
|
|
1828
2021
|
});
|
|
1829
|
-
return /* @__PURE__ */ (0,
|
|
2022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref: rootRef, className: wrapper4, children: [
|
|
1830
2023
|
clonedTrigger,
|
|
1831
|
-
open && /* @__PURE__ */ (0,
|
|
2024
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref: listRef, role: "menu", className: list2, onKeyDown: onMenuKeyDown, children: items.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1832
2025
|
"button",
|
|
1833
2026
|
{
|
|
1834
2027
|
type: "button",
|
|
@@ -1847,28 +2040,26 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
1847
2040
|
}
|
|
1848
2041
|
|
|
1849
2042
|
// src/components/dialog/index.tsx
|
|
1850
|
-
var
|
|
2043
|
+
var import_react38 = require("react");
|
|
1851
2044
|
var import_react_dom = require("react-dom");
|
|
1852
2045
|
|
|
1853
2046
|
// src/components/dialog/use-styles.ts
|
|
1854
|
-
var
|
|
2047
|
+
var import_react37 = require("react");
|
|
1855
2048
|
|
|
1856
2049
|
// src/components/dialog/use-styles.css.ts
|
|
1857
|
-
var actions = "use-
|
|
1858
|
-
var
|
|
2050
|
+
var actions = "use-styles_actions__5tstu83";
|
|
2051
|
+
var body2 = "use-styles_body__5tstu82";
|
|
1859
2052
|
var overlay = "use-styles_overlay__5tstu80";
|
|
1860
2053
|
var surface = "use-styles_surface__5tstu81";
|
|
1861
|
-
var titleText2 = "use-styles_titleText__5tstu82";
|
|
1862
2054
|
|
|
1863
2055
|
// src/components/dialog/use-styles.ts
|
|
1864
|
-
function
|
|
2056
|
+
function useStyles25() {
|
|
1865
2057
|
const { themeClass } = useTheme();
|
|
1866
|
-
return (0,
|
|
2058
|
+
return (0, import_react37.useMemo)(
|
|
1867
2059
|
() => ({
|
|
1868
2060
|
overlay: [themeClass, overlay].filter(Boolean).join(" "),
|
|
1869
2061
|
surface,
|
|
1870
|
-
|
|
1871
|
-
body: body3,
|
|
2062
|
+
body: body2,
|
|
1872
2063
|
actions
|
|
1873
2064
|
}),
|
|
1874
2065
|
[themeClass]
|
|
@@ -1876,15 +2067,15 @@ function useStyles23() {
|
|
|
1876
2067
|
}
|
|
1877
2068
|
|
|
1878
2069
|
// src/components/dialog/index.tsx
|
|
1879
|
-
var
|
|
2070
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1880
2071
|
var FOCUSABLE = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1881
2072
|
function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
1882
|
-
const { overlay: overlay2, surface: surface2,
|
|
1883
|
-
const surfaceRef = (0,
|
|
1884
|
-
const previouslyFocused = (0,
|
|
1885
|
-
const generatedId = (0,
|
|
2073
|
+
const { overlay: overlay2, surface: surface2, body: body3, actions: actionsClass } = useStyles25();
|
|
2074
|
+
const surfaceRef = (0, import_react38.useRef)(null);
|
|
2075
|
+
const previouslyFocused = (0, import_react38.useRef)(null);
|
|
2076
|
+
const generatedId = (0, import_react38.useId)();
|
|
1886
2077
|
const titleId = title != null ? generatedId : void 0;
|
|
1887
|
-
(0,
|
|
2078
|
+
(0, import_react38.useEffect)(() => {
|
|
1888
2079
|
if (!open) return;
|
|
1889
2080
|
const onKeyDown = (event) => {
|
|
1890
2081
|
if (event.key === "Escape") onClose();
|
|
@@ -1892,13 +2083,13 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
1892
2083
|
document.addEventListener("keydown", onKeyDown);
|
|
1893
2084
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
1894
2085
|
}, [open, onClose]);
|
|
1895
|
-
(0,
|
|
2086
|
+
(0, import_react38.useEffect)(() => {
|
|
1896
2087
|
if (!open) return;
|
|
1897
2088
|
previouslyFocused.current = document.activeElement;
|
|
1898
2089
|
surfaceRef.current?.focus();
|
|
1899
2090
|
return () => previouslyFocused.current?.focus?.();
|
|
1900
2091
|
}, [open]);
|
|
1901
|
-
(0,
|
|
2092
|
+
(0, import_react38.useEffect)(() => {
|
|
1902
2093
|
if (!open) return;
|
|
1903
2094
|
const previousOverflow = document.body.style.overflow;
|
|
1904
2095
|
document.body.style.overflow = "hidden";
|
|
@@ -1936,7 +2127,7 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
1936
2127
|
};
|
|
1937
2128
|
return (0, import_react_dom.createPortal)(
|
|
1938
2129
|
// biome-ignore lint/a11y/useKeyWithClickEvents: ESC handled by a document keydown listener.
|
|
1939
|
-
/* @__PURE__ */ (0,
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: overlay2, "data-testid": "dialog-overlay", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1940
2131
|
"div",
|
|
1941
2132
|
{
|
|
1942
2133
|
ref: surfaceRef,
|
|
@@ -1948,9 +2139,9 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
1948
2139
|
onClick: stop,
|
|
1949
2140
|
onKeyDown: onSurfaceKeyDown,
|
|
1950
2141
|
children: [
|
|
1951
|
-
title != null && /* @__PURE__ */ (0,
|
|
1952
|
-
children != null && /* @__PURE__ */ (0,
|
|
1953
|
-
actions3 != null && /* @__PURE__ */ (0,
|
|
2142
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Typography, { variant: "h3", as: "h2", id: titleId, children: title }),
|
|
2143
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: body3, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Typography, { variant: "body", color: "fg2", children }) }),
|
|
2144
|
+
actions3 != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: actionsClass, children: actions3 })
|
|
1954
2145
|
]
|
|
1955
2146
|
}
|
|
1956
2147
|
) }),
|
|
@@ -1962,7 +2153,7 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
1962
2153
|
var import_react_dom2 = require("react-dom");
|
|
1963
2154
|
|
|
1964
2155
|
// src/components/snackbar/use-styles.ts
|
|
1965
|
-
var
|
|
2156
|
+
var import_react39 = require("react");
|
|
1966
2157
|
|
|
1967
2158
|
// src/components/snackbar/use-styles.css.ts
|
|
1968
2159
|
var closeBtn = "use-styles_closeBtn__ihzsep2";
|
|
@@ -1970,9 +2161,9 @@ var message = "use-styles_message__ihzsep1";
|
|
|
1970
2161
|
var root20 = "use-styles_root__ihzsep0 surfaces_inkySurface__6hs0fg2";
|
|
1971
2162
|
|
|
1972
2163
|
// src/components/snackbar/use-styles.ts
|
|
1973
|
-
function
|
|
2164
|
+
function useStyles26() {
|
|
1974
2165
|
const { themeClass } = useTheme();
|
|
1975
|
-
return (0,
|
|
2166
|
+
return (0, import_react39.useMemo)(
|
|
1976
2167
|
() => ({
|
|
1977
2168
|
root: [themeClass, root20].filter(Boolean).join(" "),
|
|
1978
2169
|
message,
|
|
@@ -1983,22 +2174,22 @@ function useStyles24() {
|
|
|
1983
2174
|
}
|
|
1984
2175
|
|
|
1985
2176
|
// src/components/snackbar/index.tsx
|
|
1986
|
-
var
|
|
2177
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1987
2178
|
function Snackbar({ open, message: message2, action, onClose }) {
|
|
1988
|
-
const { root: root24, message: messageClass, closeBtn: closeBtn2 } =
|
|
2179
|
+
const { root: root24, message: messageClass, closeBtn: closeBtn2 } = useStyles26();
|
|
1989
2180
|
if (!open || typeof document === "undefined") return null;
|
|
1990
2181
|
return (0, import_react_dom2.createPortal)(
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { role: "status", className: root24, children: [
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: messageClass, children: message2 }),
|
|
1993
2184
|
action,
|
|
1994
|
-
onClose && /* @__PURE__ */ (0,
|
|
2185
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", "aria-label": "Close", className: closeBtn2, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(XIcon, { size: 18 }) })
|
|
1995
2186
|
] }),
|
|
1996
2187
|
document.body
|
|
1997
2188
|
);
|
|
1998
2189
|
}
|
|
1999
2190
|
|
|
2000
2191
|
// src/components/table/use-styles.ts
|
|
2001
|
-
var
|
|
2192
|
+
var import_react40 = require("react");
|
|
2002
2193
|
|
|
2003
2194
|
// src/components/table/use-styles.css.ts
|
|
2004
2195
|
var alignRight = "use-styles_alignRight__1n2cz6i3";
|
|
@@ -2007,9 +2198,9 @@ var td = "use-styles_td__1n2cz6i2";
|
|
|
2007
2198
|
var th = "use-styles_th__1n2cz6i1";
|
|
2008
2199
|
|
|
2009
2200
|
// src/components/table/use-styles.ts
|
|
2010
|
-
function
|
|
2201
|
+
function useStyles27({ className }) {
|
|
2011
2202
|
const { themeClass } = useTheme();
|
|
2012
|
-
const root24 = (0,
|
|
2203
|
+
const root24 = (0, import_react40.useMemo)(
|
|
2013
2204
|
() => [themeClass, root21, className].filter(Boolean).join(" "),
|
|
2014
2205
|
[themeClass, className]
|
|
2015
2206
|
);
|
|
@@ -2017,7 +2208,7 @@ function useStyles25({ className }) {
|
|
|
2017
2208
|
}
|
|
2018
2209
|
|
|
2019
2210
|
// src/components/table/index.tsx
|
|
2020
|
-
var
|
|
2211
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2021
2212
|
function Table({
|
|
2022
2213
|
columns,
|
|
2023
2214
|
rows,
|
|
@@ -2025,17 +2216,17 @@ function Table({
|
|
|
2025
2216
|
className,
|
|
2026
2217
|
...rest
|
|
2027
2218
|
}) {
|
|
2028
|
-
const { root: root24, th: th2, td: td2, alignRight: alignRight2 } =
|
|
2219
|
+
const { root: root24, th: th2, td: td2, alignRight: alignRight2 } = useStyles27({ className });
|
|
2029
2220
|
const headClass = (column) => column.align === "right" ? `${th2} ${alignRight2}` : th2;
|
|
2030
2221
|
const cellClass = (column) => column.align === "right" ? `${td2} ${alignRight2}` : td2;
|
|
2031
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
-
/* @__PURE__ */ (0,
|
|
2033
|
-
/* @__PURE__ */ (0,
|
|
2222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("table", { className: root24, ...rest, children: [
|
|
2223
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("tr", { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("th", { className: headClass(column), children: column.header }, column.key)) }) }),
|
|
2224
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("tbody", { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("tr", { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("td", { className: cellClass(column), children: column.render ? column.render(row) : String(row[column.key]) }, column.key)) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
2034
2225
|
] });
|
|
2035
2226
|
}
|
|
2036
2227
|
|
|
2037
2228
|
// src/components/app-bar/use-styles.ts
|
|
2038
|
-
var
|
|
2229
|
+
var import_react41 = require("react");
|
|
2039
2230
|
|
|
2040
2231
|
// src/components/app-bar/use-styles.css.ts
|
|
2041
2232
|
var actions2 = "use-styles_actions__1h133nh2";
|
|
@@ -2043,9 +2234,9 @@ var brand = "use-styles_brand__1h133nh1";
|
|
|
2043
2234
|
var root22 = "use-styles_root__1h133nh0";
|
|
2044
2235
|
|
|
2045
2236
|
// src/components/app-bar/use-styles.ts
|
|
2046
|
-
function
|
|
2237
|
+
function useStyles28({ className }) {
|
|
2047
2238
|
const { themeClass } = useTheme();
|
|
2048
|
-
const root24 = (0,
|
|
2239
|
+
const root24 = (0, import_react41.useMemo)(
|
|
2049
2240
|
() => [themeClass, root22, className].filter(Boolean).join(" "),
|
|
2050
2241
|
[themeClass, className]
|
|
2051
2242
|
);
|
|
@@ -2053,18 +2244,18 @@ function useStyles26({ className }) {
|
|
|
2053
2244
|
}
|
|
2054
2245
|
|
|
2055
2246
|
// src/components/app-bar/index.tsx
|
|
2056
|
-
var
|
|
2247
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2057
2248
|
function AppBar({ brand: brand2, actions: actions3, className, children, ...rest }) {
|
|
2058
|
-
const styles =
|
|
2059
|
-
return /* @__PURE__ */ (0,
|
|
2060
|
-
brand2 !== void 0 ? /* @__PURE__ */ (0,
|
|
2249
|
+
const styles = useStyles28({ className });
|
|
2250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { className: styles.root, ...rest, children: [
|
|
2251
|
+
brand2 !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: styles.brand, children: brand2 }) : null,
|
|
2061
2252
|
children,
|
|
2062
|
-
actions3 !== void 0 ? /* @__PURE__ */ (0,
|
|
2253
|
+
actions3 !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: styles.actions, children: actions3 }) : null
|
|
2063
2254
|
] });
|
|
2064
2255
|
}
|
|
2065
2256
|
|
|
2066
2257
|
// src/components/list-item/use-styles.ts
|
|
2067
|
-
var
|
|
2258
|
+
var import_react42 = require("react");
|
|
2068
2259
|
|
|
2069
2260
|
// src/components/list-item/use-styles.css.ts
|
|
2070
2261
|
var content2 = "use-styles_content__kbreq13";
|
|
@@ -2074,12 +2265,12 @@ var selected2 = "use-styles_selected__kbreq11";
|
|
|
2074
2265
|
var trailing = "use-styles_trailing__kbreq14";
|
|
2075
2266
|
|
|
2076
2267
|
// src/components/list-item/use-styles.ts
|
|
2077
|
-
function
|
|
2268
|
+
function useStyles29({
|
|
2078
2269
|
selected: selected3,
|
|
2079
2270
|
className
|
|
2080
2271
|
}) {
|
|
2081
2272
|
const { themeClass } = useTheme();
|
|
2082
|
-
const root24 = (0,
|
|
2273
|
+
const root24 = (0, import_react42.useMemo)(
|
|
2083
2274
|
() => [themeClass, root23, selected3 && selected2, className].filter(Boolean).join(" "),
|
|
2084
2275
|
[themeClass, selected3, className]
|
|
2085
2276
|
);
|
|
@@ -2087,7 +2278,7 @@ function useStyles27({
|
|
|
2087
2278
|
}
|
|
2088
2279
|
|
|
2089
2280
|
// src/components/list-item/index.tsx
|
|
2090
|
-
var
|
|
2281
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2091
2282
|
function ListItem({
|
|
2092
2283
|
leading: leading2,
|
|
2093
2284
|
trailing: trailing2,
|
|
@@ -2096,18 +2287,18 @@ function ListItem({
|
|
|
2096
2287
|
children,
|
|
2097
2288
|
...rest
|
|
2098
2289
|
}) {
|
|
2099
|
-
const styles =
|
|
2100
|
-
return /* @__PURE__ */ (0,
|
|
2101
|
-
leading2 != null && /* @__PURE__ */ (0,
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
trailing2 != null && /* @__PURE__ */ (0,
|
|
2290
|
+
const styles = useStyles29({ selected: selected3, className });
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: styles.root, ...rest, children: [
|
|
2292
|
+
leading2 != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: styles.leading, children: leading2 }),
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: styles.content, children }),
|
|
2294
|
+
trailing2 != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: styles.trailing, children: trailing2 })
|
|
2104
2295
|
] });
|
|
2105
2296
|
}
|
|
2106
2297
|
|
|
2107
2298
|
// src/components/icons/chevron-up/index.tsx
|
|
2108
|
-
var
|
|
2299
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2109
2300
|
function ChevronUpIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2111
2302
|
"svg",
|
|
2112
2303
|
{
|
|
2113
2304
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2121,15 +2312,15 @@ function ChevronUpIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
2121
2312
|
strokeLinejoin: "round",
|
|
2122
2313
|
"aria-hidden": "true",
|
|
2123
2314
|
...rest,
|
|
2124
|
-
children: /* @__PURE__ */ (0,
|
|
2315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "m18 15-6-6-6 6" })
|
|
2125
2316
|
}
|
|
2126
2317
|
);
|
|
2127
2318
|
}
|
|
2128
2319
|
|
|
2129
2320
|
// src/components/icons/search/index.tsx
|
|
2130
|
-
var
|
|
2321
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2131
2322
|
function SearchIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2132
|
-
return /* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2133
2324
|
"svg",
|
|
2134
2325
|
{
|
|
2135
2326
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2144,17 +2335,17 @@ function SearchIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
2144
2335
|
"aria-hidden": "true",
|
|
2145
2336
|
...rest,
|
|
2146
2337
|
children: [
|
|
2147
|
-
/* @__PURE__ */ (0,
|
|
2148
|
-
/* @__PURE__ */ (0,
|
|
2338
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
|
2339
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "m21 21-4.3-4.3" })
|
|
2149
2340
|
]
|
|
2150
2341
|
}
|
|
2151
2342
|
);
|
|
2152
2343
|
}
|
|
2153
2344
|
|
|
2154
2345
|
// src/components/icons/plus/index.tsx
|
|
2155
|
-
var
|
|
2346
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2156
2347
|
function PlusIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2157
|
-
return /* @__PURE__ */ (0,
|
|
2348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2158
2349
|
"svg",
|
|
2159
2350
|
{
|
|
2160
2351
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2169,17 +2360,17 @@ function PlusIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
2169
2360
|
"aria-hidden": "true",
|
|
2170
2361
|
...rest,
|
|
2171
2362
|
children: [
|
|
2172
|
-
/* @__PURE__ */ (0,
|
|
2173
|
-
/* @__PURE__ */ (0,
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("path", { d: "M5 12h14" }),
|
|
2364
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("path", { d: "M12 5v14" })
|
|
2174
2365
|
]
|
|
2175
2366
|
}
|
|
2176
2367
|
);
|
|
2177
2368
|
}
|
|
2178
2369
|
|
|
2179
2370
|
// src/components/icons/minus/index.tsx
|
|
2180
|
-
var
|
|
2371
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2181
2372
|
function MinusIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2182
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2183
2374
|
"svg",
|
|
2184
2375
|
{
|
|
2185
2376
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2193,15 +2384,15 @@ function MinusIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
2193
2384
|
strokeLinejoin: "round",
|
|
2194
2385
|
"aria-hidden": "true",
|
|
2195
2386
|
...rest,
|
|
2196
|
-
children: /* @__PURE__ */ (0,
|
|
2387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M5 12h14" })
|
|
2197
2388
|
}
|
|
2198
2389
|
);
|
|
2199
2390
|
}
|
|
2200
2391
|
|
|
2201
2392
|
// src/components/icons/more-horizontal/index.tsx
|
|
2202
|
-
var
|
|
2393
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2203
2394
|
function MoreHorizontalIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2204
|
-
return /* @__PURE__ */ (0,
|
|
2395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2205
2396
|
"svg",
|
|
2206
2397
|
{
|
|
2207
2398
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2216,16 +2407,13 @@ function MoreHorizontalIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
2216
2407
|
"aria-hidden": "true",
|
|
2217
2408
|
...rest,
|
|
2218
2409
|
children: [
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
/* @__PURE__ */ (0,
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "12", cy: "12", r: "1" }),
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "19", cy: "12", r: "1" }),
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "5", cy: "12", r: "1" })
|
|
2222
2413
|
]
|
|
2223
2414
|
}
|
|
2224
2415
|
);
|
|
2225
2416
|
}
|
|
2226
|
-
|
|
2227
|
-
// src/theme/typography.css.ts
|
|
2228
|
-
var text = { eyebrow: "typography_text_eyebrow__1wmlzy0", display: "typography_text_display__1wmlzy1", h1: "typography_text_h1__1wmlzy2", h2: "typography_text_h2__1wmlzy3", h3: "typography_text_h3__1wmlzy4", h4: "typography_text_h4__1wmlzy5", body: "typography_text_body__1wmlzy6", lead: "typography_text_lead__1wmlzy7", small: "typography_text_small__1wmlzy8", caption: "typography_text_caption__1wmlzy9", code: "typography_text_code__1wmlzya", blackletter: "typography_text_blackletter__1wmlzyb" };
|
|
2229
2417
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2230
2418
|
0 && (module.exports = {
|
|
2231
2419
|
Accordion,
|
|
@@ -2254,8 +2442,10 @@ var text = { eyebrow: "typography_text_eyebrow__1wmlzy0", display: "typography_t
|
|
|
2254
2442
|
ListItem,
|
|
2255
2443
|
Menu,
|
|
2256
2444
|
MinusIcon,
|
|
2445
|
+
MoneyField,
|
|
2257
2446
|
MoreHorizontalIcon,
|
|
2258
2447
|
Pagination,
|
|
2448
|
+
PasswordField,
|
|
2259
2449
|
PlusIcon,
|
|
2260
2450
|
Progress,
|
|
2261
2451
|
Radio,
|
|
@@ -2271,6 +2461,7 @@ var text = { eyebrow: "typography_text_eyebrow__1wmlzy0", display: "typography_t
|
|
|
2271
2461
|
ThemeProvider,
|
|
2272
2462
|
Tooltip,
|
|
2273
2463
|
TriangleAlertIcon,
|
|
2464
|
+
Typography,
|
|
2274
2465
|
XIcon,
|
|
2275
2466
|
colorVars,
|
|
2276
2467
|
modeNames,
|