@octavius2929-personal/design-system 1.5.0 → 1.5.1
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 +331 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +7 -21
- package/dist/index.css.map +1 -1
- package/dist/index.js +246 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2258,41 +2258,123 @@ var Alert = (0, import_react43.forwardRef)(function Alert2({ severity: severity2
|
|
|
2258
2258
|
});
|
|
2259
2259
|
|
|
2260
2260
|
// src/components/tooltip/index.tsx
|
|
2261
|
-
var
|
|
2261
|
+
var import_react46 = require("react");
|
|
2262
|
+
var import_react_dom = require("react-dom");
|
|
2262
2263
|
|
|
2263
|
-
// src/
|
|
2264
|
+
// src/hooks/use-floating-position/index.ts
|
|
2264
2265
|
var import_react44 = require("react");
|
|
2265
2266
|
|
|
2267
|
+
// src/hooks/use-floating-position/compute-position.ts
|
|
2268
|
+
function computeFloatingPosition({
|
|
2269
|
+
anchorRect,
|
|
2270
|
+
overlaySize,
|
|
2271
|
+
viewport,
|
|
2272
|
+
placement = "bottom",
|
|
2273
|
+
align: align2 = "center",
|
|
2274
|
+
offset = 4,
|
|
2275
|
+
margin = 8
|
|
2276
|
+
}) {
|
|
2277
|
+
const spaceBelow = viewport.height - anchorRect.bottom;
|
|
2278
|
+
const spaceAbove = anchorRect.top;
|
|
2279
|
+
const needed = overlaySize.height + offset;
|
|
2280
|
+
const fitsBelow = spaceBelow >= needed;
|
|
2281
|
+
const fitsAbove = spaceAbove >= needed;
|
|
2282
|
+
let resolvedPlacement = placement;
|
|
2283
|
+
if (placement === "bottom" && !fitsBelow && fitsAbove) {
|
|
2284
|
+
resolvedPlacement = "top";
|
|
2285
|
+
} else if (placement === "top" && !fitsAbove && fitsBelow) {
|
|
2286
|
+
resolvedPlacement = "bottom";
|
|
2287
|
+
}
|
|
2288
|
+
const top = resolvedPlacement === "bottom" ? anchorRect.bottom + offset : anchorRect.top - offset - overlaySize.height;
|
|
2289
|
+
let left;
|
|
2290
|
+
if (align2 === "start") {
|
|
2291
|
+
left = anchorRect.left;
|
|
2292
|
+
} else if (align2 === "end") {
|
|
2293
|
+
left = anchorRect.right - overlaySize.width;
|
|
2294
|
+
} else {
|
|
2295
|
+
left = anchorRect.left + anchorRect.width / 2 - overlaySize.width / 2;
|
|
2296
|
+
}
|
|
2297
|
+
const minLeft = margin;
|
|
2298
|
+
const maxLeft = viewport.width - overlaySize.width - margin;
|
|
2299
|
+
left = maxLeft < minLeft ? minLeft : Math.min(Math.max(left, minLeft), maxLeft);
|
|
2300
|
+
return { placement: resolvedPlacement, top, left };
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
// src/hooks/use-floating-position/index.ts
|
|
2304
|
+
function useFloatingPosition(anchorRef, overlayRef, { open, placement, align: align2, offset, margin }) {
|
|
2305
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
2306
|
+
if (!open) return;
|
|
2307
|
+
const recalc = () => {
|
|
2308
|
+
const anchor = anchorRef.current;
|
|
2309
|
+
const overlay2 = overlayRef.current;
|
|
2310
|
+
if (!anchor || !overlay2) return;
|
|
2311
|
+
const next = computeFloatingPosition({
|
|
2312
|
+
anchorRect: anchor.getBoundingClientRect(),
|
|
2313
|
+
overlaySize: { width: overlay2.offsetWidth, height: overlay2.offsetHeight },
|
|
2314
|
+
viewport: { width: document.documentElement.clientWidth, height: window.innerHeight },
|
|
2315
|
+
placement,
|
|
2316
|
+
align: align2,
|
|
2317
|
+
offset,
|
|
2318
|
+
margin
|
|
2319
|
+
});
|
|
2320
|
+
overlay2.style.top = `${next.top}px`;
|
|
2321
|
+
overlay2.style.left = `${next.left}px`;
|
|
2322
|
+
overlay2.style.visibility = "visible";
|
|
2323
|
+
};
|
|
2324
|
+
recalc();
|
|
2325
|
+
window.addEventListener("scroll", recalc, true);
|
|
2326
|
+
window.addEventListener("resize", recalc);
|
|
2327
|
+
return () => {
|
|
2328
|
+
window.removeEventListener("scroll", recalc, true);
|
|
2329
|
+
window.removeEventListener("resize", recalc);
|
|
2330
|
+
};
|
|
2331
|
+
}, [open, placement, align2, offset, margin, anchorRef, overlayRef]);
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
// src/components/tooltip/use-styles.ts
|
|
2335
|
+
var import_react45 = require("react");
|
|
2336
|
+
|
|
2266
2337
|
// src/components/tooltip/use-styles.css.ts
|
|
2267
2338
|
var bubble = "use-styles_bubble__h9kvh1 surfaces_inkySurface__1qa7atn2";
|
|
2268
|
-
var placement = { top: "use-styles_placement_top__h9kvh2", bottom: "use-styles_placement_bottom__h9kvh3" };
|
|
2269
2339
|
var wrapper = "use-styles_wrapper__h9kvh0";
|
|
2270
2340
|
|
|
2271
2341
|
// src/components/tooltip/use-styles.ts
|
|
2272
|
-
function useStyles19({
|
|
2273
|
-
placement: placement2 = "top"
|
|
2274
|
-
}) {
|
|
2342
|
+
function useStyles19() {
|
|
2275
2343
|
const { themeClass } = useTheme();
|
|
2276
|
-
const wrapper4 = (0,
|
|
2344
|
+
const wrapper4 = (0, import_react45.useMemo)(
|
|
2277
2345
|
() => [themeClass, wrapper].filter(Boolean).join(" "),
|
|
2278
2346
|
[themeClass]
|
|
2279
2347
|
);
|
|
2280
|
-
const bubble2 = (0,
|
|
2281
|
-
() => [bubble, placement[placement2]].filter(Boolean).join(" "),
|
|
2282
|
-
[placement2]
|
|
2283
|
-
);
|
|
2348
|
+
const bubble2 = (0, import_react45.useMemo)(() => [themeClass, bubble].filter(Boolean).join(" "), [themeClass]);
|
|
2284
2349
|
return { wrapper: wrapper4, bubble: bubble2 };
|
|
2285
2350
|
}
|
|
2286
2351
|
|
|
2287
2352
|
// src/components/tooltip/index.tsx
|
|
2288
2353
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2289
2354
|
var HIDE_DELAY = 120;
|
|
2290
|
-
var
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2355
|
+
var GAP = 4;
|
|
2356
|
+
function assignRef(ref, value) {
|
|
2357
|
+
if (typeof ref === "function") ref(value);
|
|
2358
|
+
else if (ref) ref.current = value;
|
|
2359
|
+
}
|
|
2360
|
+
var Tooltip = (0, import_react46.forwardRef)(function Tooltip2({ label: label8, children, placement = "top", testId }, ref) {
|
|
2361
|
+
const [open, setOpen] = (0, import_react46.useState)(false);
|
|
2362
|
+
const tooltipId = (0, import_react46.useId)();
|
|
2363
|
+
const { wrapper: wrapper4, bubble: bubble2 } = useStyles19();
|
|
2294
2364
|
const { testId: dataTestId, slot } = useTestId("feedback", testId);
|
|
2295
|
-
const hideTimer = (0,
|
|
2365
|
+
const hideTimer = (0, import_react46.useRef)(null);
|
|
2366
|
+
const wrapperRef = (0, import_react46.useRef)(null);
|
|
2367
|
+
const setWrapperRef = (node) => {
|
|
2368
|
+
wrapperRef.current = node;
|
|
2369
|
+
assignRef(ref, node);
|
|
2370
|
+
};
|
|
2371
|
+
const bubbleRef = (0, import_react46.useRef)(null);
|
|
2372
|
+
useFloatingPosition(wrapperRef, bubbleRef, {
|
|
2373
|
+
open,
|
|
2374
|
+
placement,
|
|
2375
|
+
align: "center",
|
|
2376
|
+
offset: GAP
|
|
2377
|
+
});
|
|
2296
2378
|
const clearHide = () => {
|
|
2297
2379
|
if (hideTimer.current) {
|
|
2298
2380
|
clearTimeout(hideTimer.current);
|
|
@@ -2311,7 +2393,7 @@ var Tooltip = (0, import_react45.forwardRef)(function Tooltip2({ label: label8,
|
|
|
2311
2393
|
clearHide();
|
|
2312
2394
|
setOpen(false);
|
|
2313
2395
|
};
|
|
2314
|
-
(0,
|
|
2396
|
+
(0, import_react46.useEffect)(() => {
|
|
2315
2397
|
return () => {
|
|
2316
2398
|
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
2317
2399
|
};
|
|
@@ -2324,11 +2406,11 @@ var Tooltip = (0, import_react45.forwardRef)(function Tooltip2({ label: label8,
|
|
|
2324
2406
|
};
|
|
2325
2407
|
const previousDescribedBy = children.props["aria-describedby"];
|
|
2326
2408
|
const describedBy = open ? [previousDescribedBy, tooltipId].filter(Boolean).join(" ") : previousDescribedBy;
|
|
2327
|
-
const trigger2 = (0,
|
|
2409
|
+
const trigger2 = (0, import_react46.cloneElement)(children, { "aria-describedby": describedBy });
|
|
2328
2410
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2329
2411
|
"span",
|
|
2330
2412
|
{
|
|
2331
|
-
ref,
|
|
2413
|
+
ref: setWrapperRef,
|
|
2332
2414
|
className: wrapper4,
|
|
2333
2415
|
"data-testid": dataTestId,
|
|
2334
2416
|
onMouseEnter: show,
|
|
@@ -2338,25 +2420,29 @@ var Tooltip = (0, import_react45.forwardRef)(function Tooltip2({ label: label8,
|
|
|
2338
2420
|
onKeyDown: handleKeyDown,
|
|
2339
2421
|
children: [
|
|
2340
2422
|
trigger2,
|
|
2341
|
-
open &&
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2423
|
+
open && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2425
|
+
"span",
|
|
2426
|
+
{
|
|
2427
|
+
ref: bubbleRef,
|
|
2428
|
+
id: tooltipId,
|
|
2429
|
+
role: "tooltip",
|
|
2430
|
+
className: bubble2,
|
|
2431
|
+
"data-testid": slot("bubble"),
|
|
2432
|
+
onMouseEnter: show,
|
|
2433
|
+
onMouseLeave: scheduleHide,
|
|
2434
|
+
children: label8
|
|
2435
|
+
}
|
|
2436
|
+
),
|
|
2437
|
+
document.body
|
|
2438
|
+
) : null
|
|
2353
2439
|
]
|
|
2354
2440
|
}
|
|
2355
2441
|
);
|
|
2356
2442
|
});
|
|
2357
2443
|
|
|
2358
2444
|
// src/components/select/index.tsx
|
|
2359
|
-
var
|
|
2445
|
+
var import_react48 = require("react");
|
|
2360
2446
|
|
|
2361
2447
|
// src/components/icons/chevron-down/index.tsx
|
|
2362
2448
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
@@ -2381,7 +2467,7 @@ function ChevronDownIcon({ size: size3 = 20, strokeWidth = 1.75, title, ...rest
|
|
|
2381
2467
|
}
|
|
2382
2468
|
|
|
2383
2469
|
// src/components/select/use-styles.ts
|
|
2384
|
-
var
|
|
2470
|
+
var import_react47 = require("react");
|
|
2385
2471
|
|
|
2386
2472
|
// src/components/select/use-styles.css.ts
|
|
2387
2473
|
var chevron = "use-styles_chevron__1w1czpb4";
|
|
@@ -2400,7 +2486,7 @@ function useStyles20({
|
|
|
2400
2486
|
open = false
|
|
2401
2487
|
}) {
|
|
2402
2488
|
const { themeClass } = useTheme();
|
|
2403
|
-
return (0,
|
|
2489
|
+
return (0, import_react47.useMemo)(() => {
|
|
2404
2490
|
const chevron3 = [chevron, open && chevronOpen].filter(Boolean).join(" ");
|
|
2405
2491
|
return {
|
|
2406
2492
|
root: [themeClass, root14].filter(Boolean).join(" "),
|
|
@@ -2416,7 +2502,7 @@ function useStyles20({
|
|
|
2416
2502
|
|
|
2417
2503
|
// src/components/select/index.tsx
|
|
2418
2504
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2419
|
-
var Select = (0,
|
|
2505
|
+
var Select = (0, import_react48.forwardRef)(function Select2({
|
|
2420
2506
|
options,
|
|
2421
2507
|
value,
|
|
2422
2508
|
onChange,
|
|
@@ -2427,15 +2513,15 @@ var Select = (0, import_react47.forwardRef)(function Select2({
|
|
|
2427
2513
|
"aria-labelledby": ariaLabelledBy,
|
|
2428
2514
|
...rest
|
|
2429
2515
|
}, ref) {
|
|
2430
|
-
const [open, setOpen] = (0,
|
|
2431
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
2432
|
-
const rootRef = (0,
|
|
2516
|
+
const [open, setOpen] = (0, import_react48.useState)(false);
|
|
2517
|
+
const [activeIndex, setActiveIndex] = (0, import_react48.useState)(0);
|
|
2518
|
+
const rootRef = (0, import_react48.useRef)(null);
|
|
2433
2519
|
const setRootRef = (node) => {
|
|
2434
2520
|
rootRef.current = node;
|
|
2435
2521
|
if (typeof ref === "function") ref(node);
|
|
2436
2522
|
else if (ref) ref.current = node;
|
|
2437
2523
|
};
|
|
2438
|
-
const baseId = (0,
|
|
2524
|
+
const baseId = (0, import_react48.useId)();
|
|
2439
2525
|
const labelId = `${baseId}-label`;
|
|
2440
2526
|
const optionId = (index) => `${baseId}-option-${index}`;
|
|
2441
2527
|
const triggerLabelledBy = [label8 ? labelId : null, ariaLabelledBy].filter(Boolean).join(" ") || void 0;
|
|
@@ -2448,7 +2534,7 @@ var Select = (0, import_react47.forwardRef)(function Select2({
|
|
|
2448
2534
|
menu: menu2,
|
|
2449
2535
|
optionClass
|
|
2450
2536
|
} = useStyles20({ open });
|
|
2451
|
-
(0,
|
|
2537
|
+
(0, import_react48.useEffect)(() => {
|
|
2452
2538
|
if (!open) return;
|
|
2453
2539
|
const onPointerDown = (event) => {
|
|
2454
2540
|
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
@@ -2560,10 +2646,10 @@ var Select = (0, import_react47.forwardRef)(function Select2({
|
|
|
2560
2646
|
});
|
|
2561
2647
|
|
|
2562
2648
|
// src/components/slider/index.tsx
|
|
2563
|
-
var
|
|
2649
|
+
var import_react50 = require("react");
|
|
2564
2650
|
|
|
2565
2651
|
// src/components/slider/use-styles.ts
|
|
2566
|
-
var
|
|
2652
|
+
var import_react49 = require("react");
|
|
2567
2653
|
|
|
2568
2654
|
// src/components/slider/use-styles.css.ts
|
|
2569
2655
|
var input5 = "use-styles_input__okw59n3";
|
|
@@ -2577,7 +2663,7 @@ var wrapper2 = "use-styles_wrapper__okw59n6";
|
|
|
2577
2663
|
// src/components/slider/use-styles.ts
|
|
2578
2664
|
function useStyles21() {
|
|
2579
2665
|
const { themeClass } = useTheme();
|
|
2580
|
-
return (0,
|
|
2666
|
+
return (0, import_react49.useMemo)(() => {
|
|
2581
2667
|
const root25 = [themeClass, root15].filter(Boolean).join(" ");
|
|
2582
2668
|
return {
|
|
2583
2669
|
wrapper: wrapper2,
|
|
@@ -2593,7 +2679,7 @@ function useStyles21() {
|
|
|
2593
2679
|
|
|
2594
2680
|
// src/components/slider/index.tsx
|
|
2595
2681
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2596
|
-
var Slider = (0,
|
|
2682
|
+
var Slider = (0, import_react50.forwardRef)(function Slider2({ value = 0, onChange, min = 0, max = 100, step: step2 = 1, disabled: disabled4, label: label8, ...rest }, ref) {
|
|
2597
2683
|
const { wrapper: wrapper4, label: labelClass, root: root25, track: track4, range: range2, thumb: thumb2, input: input6 } = useStyles21();
|
|
2598
2684
|
const span = max - min;
|
|
2599
2685
|
const percent = span > 0 ? (value - min) / span * 100 : 0;
|
|
@@ -2627,10 +2713,10 @@ var Slider = (0, import_react49.forwardRef)(function Slider2({ value = 0, onChan
|
|
|
2627
2713
|
});
|
|
2628
2714
|
|
|
2629
2715
|
// src/components/accordion/index.tsx
|
|
2630
|
-
var
|
|
2716
|
+
var import_react52 = require("react");
|
|
2631
2717
|
|
|
2632
2718
|
// src/components/accordion/use-styles.ts
|
|
2633
|
-
var
|
|
2719
|
+
var import_react51 = require("react");
|
|
2634
2720
|
|
|
2635
2721
|
// src/components/accordion/use-styles.css.ts
|
|
2636
2722
|
var chevron2 = "use-styles_chevron__1cjrdh93";
|
|
@@ -2643,7 +2729,7 @@ var root16 = "use-styles_root__1cjrdh90";
|
|
|
2643
2729
|
// src/components/accordion/use-styles.ts
|
|
2644
2730
|
function useStyles22({ className }) {
|
|
2645
2731
|
const { themeClass } = useTheme();
|
|
2646
|
-
return (0,
|
|
2732
|
+
return (0, import_react51.useMemo)(
|
|
2647
2733
|
() => ({
|
|
2648
2734
|
root: [themeClass, root16, className].filter(Boolean).join(" "),
|
|
2649
2735
|
item,
|
|
@@ -2657,8 +2743,8 @@ function useStyles22({ className }) {
|
|
|
2657
2743
|
|
|
2658
2744
|
// src/components/accordion/index.tsx
|
|
2659
2745
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2660
|
-
var Accordion = (0,
|
|
2661
|
-
const [open, setOpen] = (0,
|
|
2746
|
+
var Accordion = (0, import_react52.forwardRef)(function Accordion2({ items, multiple = false, defaultOpen = [], className, testId }, ref) {
|
|
2747
|
+
const [open, setOpen] = (0, import_react52.useState)(defaultOpen);
|
|
2662
2748
|
const { root: root25, item: item3, header: header3, chevronFor, panel: panel3 } = useStyles22({ className });
|
|
2663
2749
|
const { testId: dataTestId, slot } = useTestId("layout", testId);
|
|
2664
2750
|
const toggle = (id) => {
|
|
@@ -2715,7 +2801,7 @@ var Accordion = (0, import_react51.forwardRef)(function Accordion2({ items, mult
|
|
|
2715
2801
|
});
|
|
2716
2802
|
|
|
2717
2803
|
// src/components/breadcrumbs/index.tsx
|
|
2718
|
-
var
|
|
2804
|
+
var import_react54 = require("react");
|
|
2719
2805
|
|
|
2720
2806
|
// src/components/icons/chevron-right/index.tsx
|
|
2721
2807
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
@@ -2740,7 +2826,7 @@ function ChevronRightIcon({ size: size3 = 20, strokeWidth = 1.75, title, ...rest
|
|
|
2740
2826
|
}
|
|
2741
2827
|
|
|
2742
2828
|
// src/components/breadcrumbs/use-styles.ts
|
|
2743
|
-
var
|
|
2829
|
+
var import_react53 = require("react");
|
|
2744
2830
|
|
|
2745
2831
|
// src/components/breadcrumbs/use-styles.css.ts
|
|
2746
2832
|
var crumb = "use-styles_crumb__7u0du61";
|
|
@@ -2751,7 +2837,7 @@ var separator = "use-styles_separator__7u0du63";
|
|
|
2751
2837
|
// src/components/breadcrumbs/use-styles.ts
|
|
2752
2838
|
function useStyles23({ className }) {
|
|
2753
2839
|
const { themeClass } = useTheme();
|
|
2754
|
-
const root25 = (0,
|
|
2840
|
+
const root25 = (0, import_react53.useMemo)(
|
|
2755
2841
|
() => [themeClass, root17, className].filter(Boolean).join(" "),
|
|
2756
2842
|
[themeClass, className]
|
|
2757
2843
|
);
|
|
@@ -2760,13 +2846,13 @@ function useStyles23({ className }) {
|
|
|
2760
2846
|
|
|
2761
2847
|
// src/components/breadcrumbs/index.tsx
|
|
2762
2848
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2763
|
-
var Breadcrumbs = (0,
|
|
2849
|
+
var Breadcrumbs = (0, import_react54.forwardRef)(function Breadcrumbs2({ items, className, testId, ...rest }, ref) {
|
|
2764
2850
|
const { root: root25, crumb: crumb2, current: current2, separator: separator2 } = useStyles23({ className });
|
|
2765
2851
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2766
2852
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("nav", { ref, "aria-label": "Breadcrumb", className: root25, "data-testid": dataTestId, ...rest, children: items.map((item3, index) => {
|
|
2767
2853
|
const isLast = index === items.length - 1;
|
|
2768
2854
|
const key = index;
|
|
2769
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react54.Fragment, { children: [
|
|
2770
2856
|
isLast ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: current2, "aria-current": "page", "data-testid": slot(`crumb-${index}`), children: item3.label }) : item3.href ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("a", { className: crumb2, href: item3.href, "data-testid": slot(`crumb-${index}`), children: item3.label }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: crumb2, "data-testid": slot(`crumb-${index}`), children: item3.label }),
|
|
2771
2857
|
!isLast && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: separator2, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronRightIcon, { size: 14 }) })
|
|
2772
2858
|
] }, key);
|
|
@@ -2774,7 +2860,7 @@ var Breadcrumbs = (0, import_react53.forwardRef)(function Breadcrumbs2({ items,
|
|
|
2774
2860
|
});
|
|
2775
2861
|
|
|
2776
2862
|
// src/components/pagination/index.tsx
|
|
2777
|
-
var
|
|
2863
|
+
var import_react56 = require("react");
|
|
2778
2864
|
|
|
2779
2865
|
// src/components/icons/chevron-left/index.tsx
|
|
2780
2866
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
@@ -2799,7 +2885,7 @@ function ChevronLeftIcon({ size: size3 = 20, strokeWidth = 1.75, title, ...rest
|
|
|
2799
2885
|
}
|
|
2800
2886
|
|
|
2801
2887
|
// src/components/pagination/use-styles.ts
|
|
2802
|
-
var
|
|
2888
|
+
var import_react55 = require("react");
|
|
2803
2889
|
|
|
2804
2890
|
// src/components/pagination/use-styles.css.ts
|
|
2805
2891
|
var ellipsis = "use-styles_ellipsis__1azgzoh3";
|
|
@@ -2811,7 +2897,7 @@ var root18 = "use-styles_root__1azgzoh0";
|
|
|
2811
2897
|
// src/components/pagination/use-styles.ts
|
|
2812
2898
|
function useStyles24() {
|
|
2813
2899
|
const { themeClass } = useTheme();
|
|
2814
|
-
return (0,
|
|
2900
|
+
return (0, import_react55.useMemo)(
|
|
2815
2901
|
() => ({
|
|
2816
2902
|
root: [themeClass, root18].filter(Boolean).join(" "),
|
|
2817
2903
|
pageBtnFor: (active2) => [pageBtn, active2 && pageActive].filter(Boolean).join(" "),
|
|
@@ -2837,7 +2923,7 @@ function buildItems(count, page, siblingCount) {
|
|
|
2837
2923
|
if (last > first) items.push(last);
|
|
2838
2924
|
return items;
|
|
2839
2925
|
}
|
|
2840
|
-
var Pagination = (0,
|
|
2926
|
+
var Pagination = (0, import_react56.forwardRef)(function Pagination2({ count, page = 1, onChange, siblingCount = 1, testId, ...rest }, ref) {
|
|
2841
2927
|
const { root: root25, pageBtnFor, ellipsis: ellipsis2, nav: nav2 } = useStyles24();
|
|
2842
2928
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2843
2929
|
const total = Math.max(1, count);
|
|
@@ -2895,10 +2981,10 @@ var Pagination = (0, import_react55.forwardRef)(function Pagination2({ count, pa
|
|
|
2895
2981
|
});
|
|
2896
2982
|
|
|
2897
2983
|
// src/components/stepper/index.tsx
|
|
2898
|
-
var
|
|
2984
|
+
var import_react58 = require("react");
|
|
2899
2985
|
|
|
2900
2986
|
// src/components/stepper/use-styles.ts
|
|
2901
|
-
var
|
|
2987
|
+
var import_react57 = require("react");
|
|
2902
2988
|
|
|
2903
2989
|
// src/components/stepper/use-styles.css.ts
|
|
2904
2990
|
var connector = "use-styles_connector__79pt4e7";
|
|
@@ -2913,7 +2999,7 @@ var step = "use-styles_step__79pt4e1";
|
|
|
2913
2999
|
// src/components/stepper/use-styles.ts
|
|
2914
3000
|
function useStyles25({ className }) {
|
|
2915
3001
|
const { themeClass } = useTheme();
|
|
2916
|
-
return (0,
|
|
3002
|
+
return (0, import_react57.useMemo)(() => {
|
|
2917
3003
|
const root25 = [themeClass, root19, className].filter(Boolean).join(" ");
|
|
2918
3004
|
const markerFor = (state) => [
|
|
2919
3005
|
marker,
|
|
@@ -2927,7 +3013,7 @@ function useStyles25({ className }) {
|
|
|
2927
3013
|
|
|
2928
3014
|
// src/components/stepper/index.tsx
|
|
2929
3015
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2930
|
-
var Stepper = (0,
|
|
3016
|
+
var Stepper = (0, import_react58.forwardRef)(function Stepper2({ steps, active: active2 = 0, className, testId, ...rest }, ref) {
|
|
2931
3017
|
const { root: root25, step: step2, connector: connector2, markerFor, labelFor } = useStyles25({ className });
|
|
2932
3018
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2933
3019
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: root25, "data-testid": dataTestId, ...rest, children: steps.map((s, index) => {
|
|
@@ -2935,7 +3021,7 @@ var Stepper = (0, import_react57.forwardRef)(function Stepper2({ steps, active:
|
|
|
2935
3021
|
const isActive = state === "active";
|
|
2936
3022
|
return (
|
|
2937
3023
|
// biome-ignore lint/suspicious/noArrayIndexKey: steps are a static, ordered list with no stable id.
|
|
2938
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3024
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react58.Fragment, { children: [
|
|
2939
3025
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2940
3026
|
"div",
|
|
2941
3027
|
{
|
|
@@ -2956,10 +3042,10 @@ var Stepper = (0, import_react57.forwardRef)(function Stepper2({ steps, active:
|
|
|
2956
3042
|
});
|
|
2957
3043
|
|
|
2958
3044
|
// src/components/tabs/index.tsx
|
|
2959
|
-
var
|
|
3045
|
+
var import_react60 = require("react");
|
|
2960
3046
|
|
|
2961
3047
|
// src/components/tabs/use-styles.ts
|
|
2962
|
-
var
|
|
3048
|
+
var import_react59 = require("react");
|
|
2963
3049
|
|
|
2964
3050
|
// src/components/tabs/use-styles.css.ts
|
|
2965
3051
|
var panel2 = "use-styles_panel__1l4m7t43";
|
|
@@ -2970,7 +3056,7 @@ var tabActive = "use-styles_tabActive__1l4m7t42";
|
|
|
2970
3056
|
// src/components/tabs/use-styles.ts
|
|
2971
3057
|
function useStyles26() {
|
|
2972
3058
|
const { themeClass } = useTheme();
|
|
2973
|
-
return (0,
|
|
3059
|
+
return (0, import_react59.useMemo)(() => {
|
|
2974
3060
|
const root25 = [themeClass, root20].filter(Boolean).join(" ");
|
|
2975
3061
|
const tabClass = (active2) => [tab, active2 && tabActive].filter(Boolean).join(" ");
|
|
2976
3062
|
return { root: root25, tab, tabClass, panel: panel2 };
|
|
@@ -2980,11 +3066,11 @@ function useStyles26() {
|
|
|
2980
3066
|
// src/components/tabs/index.tsx
|
|
2981
3067
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2982
3068
|
var ICON_SIZE3 = 16;
|
|
2983
|
-
var Tabs = (0,
|
|
3069
|
+
var Tabs = (0, import_react60.forwardRef)(function Tabs2({ items, value, onChange, testId, ...rest }, ref) {
|
|
2984
3070
|
const { root: root25, tabClass, panel: panel3 } = useStyles26();
|
|
2985
3071
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
2986
|
-
const baseId = (0,
|
|
2987
|
-
const tabRefs = (0,
|
|
3072
|
+
const baseId = (0, import_react60.useId)();
|
|
3073
|
+
const tabRefs = (0, import_react60.useRef)([]);
|
|
2988
3074
|
const hasPanels = items.some((item3) => item3.content !== void 0);
|
|
2989
3075
|
const activeIndex = items.findIndex((item3) => item3.value === value);
|
|
2990
3076
|
const tabId = (v) => `${baseId}-tab-${v}`;
|
|
@@ -3064,10 +3150,11 @@ var Tabs = (0, import_react59.forwardRef)(function Tabs2({ items, value, onChang
|
|
|
3064
3150
|
});
|
|
3065
3151
|
|
|
3066
3152
|
// src/components/menu/index.tsx
|
|
3067
|
-
var
|
|
3153
|
+
var import_react62 = require("react");
|
|
3154
|
+
var import_react_dom2 = require("react-dom");
|
|
3068
3155
|
|
|
3069
3156
|
// src/components/menu/use-styles.ts
|
|
3070
|
-
var
|
|
3157
|
+
var import_react61 = require("react");
|
|
3071
3158
|
|
|
3072
3159
|
// src/components/menu/use-styles.css.ts
|
|
3073
3160
|
var danger = "use-styles_danger__1uyxaj3";
|
|
@@ -3078,10 +3165,10 @@ var wrapper3 = "use-styles_wrapper__1uyxaj0";
|
|
|
3078
3165
|
// src/components/menu/use-styles.ts
|
|
3079
3166
|
function useStyles27() {
|
|
3080
3167
|
const { themeClass } = useTheme();
|
|
3081
|
-
return (0,
|
|
3168
|
+
return (0, import_react61.useMemo)(
|
|
3082
3169
|
() => ({
|
|
3083
3170
|
wrapper: [themeClass, wrapper3].filter(Boolean).join(" "),
|
|
3084
|
-
list: list2,
|
|
3171
|
+
list: [themeClass, list2].filter(Boolean).join(" "),
|
|
3085
3172
|
item: item2,
|
|
3086
3173
|
dangerItem: [item2, danger].join(" ")
|
|
3087
3174
|
}),
|
|
@@ -3092,23 +3179,38 @@ function useStyles27() {
|
|
|
3092
3179
|
// src/components/menu/index.tsx
|
|
3093
3180
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3094
3181
|
var ICON_SIZE4 = 16;
|
|
3095
|
-
|
|
3182
|
+
var GAP2 = 4;
|
|
3183
|
+
var TYPEAHEAD_RESET_MS = 500;
|
|
3184
|
+
function assignRef2(ref, value) {
|
|
3096
3185
|
if (typeof ref === "function") ref(value);
|
|
3097
3186
|
else if (ref) ref.current = value;
|
|
3098
3187
|
}
|
|
3099
|
-
var Menu = (0,
|
|
3188
|
+
var Menu = (0, import_react62.forwardRef)(function Menu2({ trigger: trigger2, items, testId }, ref) {
|
|
3100
3189
|
const { wrapper: wrapper4, list: list3, item: item3, dangerItem } = useStyles27();
|
|
3101
3190
|
const { testId: rootTestId, slot } = useTestId("menu", testId);
|
|
3102
|
-
const [open, setOpen] = (0,
|
|
3103
|
-
const
|
|
3104
|
-
const rootRef = (0, import_react61.useRef)(null);
|
|
3191
|
+
const [open, setOpen] = (0, import_react62.useState)(false);
|
|
3192
|
+
const rootRef = (0, import_react62.useRef)(null);
|
|
3105
3193
|
const setRootRef = (node) => {
|
|
3106
3194
|
rootRef.current = node;
|
|
3107
|
-
|
|
3195
|
+
assignRef2(ref, node);
|
|
3108
3196
|
};
|
|
3109
|
-
const listRef = (0,
|
|
3110
|
-
const triggerRef = (0,
|
|
3111
|
-
const
|
|
3197
|
+
const listRef = (0, import_react62.useRef)(null);
|
|
3198
|
+
const triggerRef = (0, import_react62.useRef)(null);
|
|
3199
|
+
const pendingFocusRef = (0, import_react62.useRef)("first");
|
|
3200
|
+
const typeAheadRef = (0, import_react62.useRef)({
|
|
3201
|
+
query: "",
|
|
3202
|
+
timeout: null
|
|
3203
|
+
});
|
|
3204
|
+
useFloatingPosition(rootRef, listRef, {
|
|
3205
|
+
open,
|
|
3206
|
+
placement: "bottom",
|
|
3207
|
+
align: "start",
|
|
3208
|
+
offset: GAP2
|
|
3209
|
+
});
|
|
3210
|
+
const getMenuItems = (0, import_react62.useCallback)(
|
|
3211
|
+
() => Array.from(listRef.current?.querySelectorAll('[role="menuitem"]') ?? []),
|
|
3212
|
+
[]
|
|
3213
|
+
);
|
|
3112
3214
|
const focusItemAt = (index) => {
|
|
3113
3215
|
const menuItems = getMenuItems();
|
|
3114
3216
|
if (menuItems.length === 0) return;
|
|
@@ -3119,23 +3221,41 @@ var Menu = (0, import_react61.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
3119
3221
|
setOpen(false);
|
|
3120
3222
|
triggerRef.current?.focus();
|
|
3121
3223
|
};
|
|
3122
|
-
(0,
|
|
3123
|
-
if (
|
|
3124
|
-
|
|
3125
|
-
|
|
3224
|
+
const resetTypeAhead = (0, import_react62.useCallback)(() => {
|
|
3225
|
+
if (typeAheadRef.current.timeout) clearTimeout(typeAheadRef.current.timeout);
|
|
3226
|
+
typeAheadRef.current = { query: "", timeout: null };
|
|
3227
|
+
}, []);
|
|
3228
|
+
const handleTypeAhead = (key) => {
|
|
3229
|
+
if (typeAheadRef.current.timeout) clearTimeout(typeAheadRef.current.timeout);
|
|
3230
|
+
const query = typeAheadRef.current.query + key.toLowerCase();
|
|
3231
|
+
typeAheadRef.current.query = query;
|
|
3232
|
+
typeAheadRef.current.timeout = setTimeout(() => {
|
|
3233
|
+
typeAheadRef.current = { query: "", timeout: null };
|
|
3234
|
+
}, TYPEAHEAD_RESET_MS);
|
|
3235
|
+
const menuItems = getMenuItems();
|
|
3236
|
+
if (menuItems.length === 0) return;
|
|
3237
|
+
const current2 = menuItems.indexOf(document.activeElement);
|
|
3238
|
+
const startIndex = current2 === -1 ? 0 : current2 + 1;
|
|
3239
|
+
for (let i = 0; i < menuItems.length; i++) {
|
|
3240
|
+
const candidate = menuItems[(startIndex + i) % menuItems.length];
|
|
3241
|
+
const text2 = candidate?.textContent?.trim().toLowerCase() ?? "";
|
|
3242
|
+
if (text2.startsWith(query)) {
|
|
3243
|
+
candidate?.focus();
|
|
3244
|
+
return;
|
|
3245
|
+
}
|
|
3126
3246
|
}
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
if (!listEl || !rootEl) return;
|
|
3130
|
-
const rootLeft = rootEl.getBoundingClientRect().left;
|
|
3131
|
-
const viewport = document.documentElement.clientWidth;
|
|
3132
|
-
setAlignEnd(rootLeft + listEl.offsetWidth > viewport);
|
|
3133
|
-
}, [open]);
|
|
3134
|
-
(0, import_react61.useEffect)(() => {
|
|
3247
|
+
};
|
|
3248
|
+
(0, import_react62.useEffect)(() => {
|
|
3135
3249
|
if (!open) return;
|
|
3136
|
-
|
|
3250
|
+
const menuItems = getMenuItems();
|
|
3251
|
+
const index = pendingFocusRef.current === "last" ? menuItems.length - 1 : 0;
|
|
3252
|
+
menuItems[index]?.focus();
|
|
3253
|
+
pendingFocusRef.current = "first";
|
|
3137
3254
|
const onDocMouseDown = (event) => {
|
|
3138
|
-
|
|
3255
|
+
const target = event.target;
|
|
3256
|
+
const insideTrigger = rootRef.current?.contains(target) ?? false;
|
|
3257
|
+
const insideList = listRef.current?.contains(target) ?? false;
|
|
3258
|
+
if (!insideTrigger && !insideList) {
|
|
3139
3259
|
setOpen(false);
|
|
3140
3260
|
}
|
|
3141
3261
|
};
|
|
@@ -3150,8 +3270,9 @@ var Menu = (0, import_react61.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
3150
3270
|
return () => {
|
|
3151
3271
|
document.removeEventListener("mousedown", onDocMouseDown);
|
|
3152
3272
|
document.removeEventListener("keydown", onKeyDown);
|
|
3273
|
+
resetTypeAhead();
|
|
3153
3274
|
};
|
|
3154
|
-
}, [open]);
|
|
3275
|
+
}, [open, getMenuItems, resetTypeAhead]);
|
|
3155
3276
|
const onMenuKeyDown = (event) => {
|
|
3156
3277
|
const menuItems = getMenuItems();
|
|
3157
3278
|
const current2 = menuItems.indexOf(document.activeElement);
|
|
@@ -3179,22 +3300,58 @@ var Menu = (0, import_react61.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
3179
3300
|
case "Tab":
|
|
3180
3301
|
setOpen(false);
|
|
3181
3302
|
break;
|
|
3303
|
+
case " ":
|
|
3304
|
+
event.preventDefault();
|
|
3305
|
+
if (typeAheadRef.current.query.length > 0) {
|
|
3306
|
+
handleTypeAhead(event.key);
|
|
3307
|
+
} else {
|
|
3308
|
+
menuItems[current2]?.click();
|
|
3309
|
+
}
|
|
3310
|
+
break;
|
|
3311
|
+
default:
|
|
3312
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
3313
|
+
event.preventDefault();
|
|
3314
|
+
handleTypeAhead(event.key);
|
|
3315
|
+
}
|
|
3316
|
+
break;
|
|
3182
3317
|
}
|
|
3183
3318
|
};
|
|
3184
3319
|
const triggerProps = trigger2.props;
|
|
3185
3320
|
const consumerRef = trigger2.ref;
|
|
3186
3321
|
const mergedTriggerRef = (node) => {
|
|
3187
3322
|
triggerRef.current = node;
|
|
3188
|
-
|
|
3323
|
+
assignRef2(consumerRef, node);
|
|
3189
3324
|
};
|
|
3190
|
-
const
|
|
3325
|
+
const handleTriggerKeyDown = (event) => {
|
|
3326
|
+
triggerProps.onKeyDown?.(event);
|
|
3327
|
+
if (open) return;
|
|
3328
|
+
switch (event.key) {
|
|
3329
|
+
case "Enter":
|
|
3330
|
+
case " ":
|
|
3331
|
+
case "ArrowDown":
|
|
3332
|
+
event.preventDefault();
|
|
3333
|
+
pendingFocusRef.current = "first";
|
|
3334
|
+
setOpen(true);
|
|
3335
|
+
break;
|
|
3336
|
+
case "ArrowUp":
|
|
3337
|
+
event.preventDefault();
|
|
3338
|
+
pendingFocusRef.current = "last";
|
|
3339
|
+
setOpen(true);
|
|
3340
|
+
break;
|
|
3341
|
+
}
|
|
3342
|
+
};
|
|
3343
|
+
const clonedTrigger = (0, import_react62.cloneElement)(trigger2, {
|
|
3191
3344
|
ref: mergedTriggerRef,
|
|
3192
3345
|
"aria-haspopup": "menu",
|
|
3193
3346
|
"aria-expanded": open,
|
|
3194
3347
|
onClick: (event) => {
|
|
3195
3348
|
triggerProps.onClick?.(event);
|
|
3196
|
-
setOpen((prev) =>
|
|
3197
|
-
|
|
3349
|
+
setOpen((prev) => {
|
|
3350
|
+
if (!prev) pendingFocusRef.current = "first";
|
|
3351
|
+
return !prev;
|
|
3352
|
+
});
|
|
3353
|
+
},
|
|
3354
|
+
onKeyDown: handleTriggerKeyDown
|
|
3198
3355
|
});
|
|
3199
3356
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3200
3357
|
"div",
|
|
@@ -3205,50 +3362,52 @@ var Menu = (0, import_react61.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
3205
3362
|
"data-state": open ? "open" : "closed",
|
|
3206
3363
|
children: [
|
|
3207
3364
|
clonedTrigger,
|
|
3208
|
-
open &&
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3365
|
+
open && typeof document !== "undefined" ? (0, import_react_dom2.createPortal)(
|
|
3366
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3367
|
+
"div",
|
|
3368
|
+
{
|
|
3369
|
+
ref: listRef,
|
|
3370
|
+
role: "menu",
|
|
3371
|
+
className: list3,
|
|
3372
|
+
"data-testid": slot("list"),
|
|
3373
|
+
onKeyDown: onMenuKeyDown,
|
|
3374
|
+
children: items.map((entry, index) => {
|
|
3375
|
+
const ItemIcon = entry.icon;
|
|
3376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3377
|
+
"button",
|
|
3378
|
+
{
|
|
3379
|
+
type: "button",
|
|
3380
|
+
role: "menuitem",
|
|
3381
|
+
tabIndex: -1,
|
|
3382
|
+
className: entry.danger ? dangerItem : item3,
|
|
3383
|
+
"data-testid": slot(`item-${index}`),
|
|
3384
|
+
onClick: () => {
|
|
3385
|
+
entry.onClick?.();
|
|
3386
|
+
setOpen(false);
|
|
3387
|
+
},
|
|
3388
|
+
children: [
|
|
3389
|
+
ItemIcon ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ItemIcon, { size: ICON_SIZE4 }) : null,
|
|
3390
|
+
entry.label
|
|
3391
|
+
]
|
|
3230
3392
|
},
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
})
|
|
3239
|
-
}
|
|
3240
|
-
)
|
|
3393
|
+
index
|
|
3394
|
+
);
|
|
3395
|
+
})
|
|
3396
|
+
}
|
|
3397
|
+
),
|
|
3398
|
+
document.body
|
|
3399
|
+
) : null
|
|
3241
3400
|
]
|
|
3242
3401
|
}
|
|
3243
3402
|
);
|
|
3244
3403
|
});
|
|
3245
3404
|
|
|
3246
3405
|
// src/components/dialog/index.tsx
|
|
3247
|
-
var
|
|
3248
|
-
var
|
|
3406
|
+
var import_react64 = require("react");
|
|
3407
|
+
var import_react_dom3 = require("react-dom");
|
|
3249
3408
|
|
|
3250
3409
|
// src/components/dialog/use-styles.ts
|
|
3251
|
-
var
|
|
3410
|
+
var import_react63 = require("react");
|
|
3252
3411
|
|
|
3253
3412
|
// src/components/dialog/use-styles.css.ts
|
|
3254
3413
|
var actions = "use-styles_actions__5tstu83";
|
|
@@ -3259,7 +3418,7 @@ var surface2 = "use-styles_surface__5tstu81";
|
|
|
3259
3418
|
// src/components/dialog/use-styles.ts
|
|
3260
3419
|
function useStyles28() {
|
|
3261
3420
|
const { themeClass } = useTheme();
|
|
3262
|
-
return (0,
|
|
3421
|
+
return (0, import_react63.useMemo)(
|
|
3263
3422
|
() => ({
|
|
3264
3423
|
overlay: [themeClass, overlay].filter(Boolean).join(" "),
|
|
3265
3424
|
surface: surface2,
|
|
@@ -3273,22 +3432,22 @@ function useStyles28() {
|
|
|
3273
3432
|
// src/components/dialog/index.tsx
|
|
3274
3433
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3275
3434
|
var FOCUSABLE = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
3276
|
-
function
|
|
3435
|
+
function assignRef3(ref, value) {
|
|
3277
3436
|
if (typeof ref === "function") ref(value);
|
|
3278
3437
|
else if (ref) ref.current = value;
|
|
3279
3438
|
}
|
|
3280
|
-
var Dialog = (0,
|
|
3439
|
+
var Dialog = (0, import_react64.forwardRef)(function Dialog2({ open, onClose, title, actions: actions3, children, testId }, ref) {
|
|
3281
3440
|
const { overlay: overlay2, surface: surface3, body: body3, actions: actionsClass } = useStyles28();
|
|
3282
3441
|
const { testId: rootTestId, slot } = useTestId("dialog", testId);
|
|
3283
|
-
const surfaceRef = (0,
|
|
3442
|
+
const surfaceRef = (0, import_react64.useRef)(null);
|
|
3284
3443
|
const setSurfaceRef = (node) => {
|
|
3285
3444
|
surfaceRef.current = node;
|
|
3286
|
-
|
|
3445
|
+
assignRef3(ref, node);
|
|
3287
3446
|
};
|
|
3288
|
-
const previouslyFocused = (0,
|
|
3289
|
-
const generatedId = (0,
|
|
3447
|
+
const previouslyFocused = (0, import_react64.useRef)(null);
|
|
3448
|
+
const generatedId = (0, import_react64.useId)();
|
|
3290
3449
|
const titleId = title != null ? generatedId : void 0;
|
|
3291
|
-
(0,
|
|
3450
|
+
(0, import_react64.useEffect)(() => {
|
|
3292
3451
|
if (!open) return;
|
|
3293
3452
|
const onKeyDown = (event) => {
|
|
3294
3453
|
if (event.key === "Escape") onClose();
|
|
@@ -3296,13 +3455,13 @@ var Dialog = (0, import_react63.forwardRef)(function Dialog2({ open, onClose, ti
|
|
|
3296
3455
|
document.addEventListener("keydown", onKeyDown);
|
|
3297
3456
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
3298
3457
|
}, [open, onClose]);
|
|
3299
|
-
(0,
|
|
3458
|
+
(0, import_react64.useEffect)(() => {
|
|
3300
3459
|
if (!open) return;
|
|
3301
3460
|
previouslyFocused.current = document.activeElement;
|
|
3302
3461
|
surfaceRef.current?.focus();
|
|
3303
3462
|
return () => previouslyFocused.current?.focus?.();
|
|
3304
3463
|
}, [open]);
|
|
3305
|
-
(0,
|
|
3464
|
+
(0, import_react64.useEffect)(() => {
|
|
3306
3465
|
if (!open) return;
|
|
3307
3466
|
const previousOverflow = document.body.style.overflow;
|
|
3308
3467
|
document.body.style.overflow = "hidden";
|
|
@@ -3338,7 +3497,7 @@ var Dialog = (0, import_react63.forwardRef)(function Dialog2({ open, onClose, ti
|
|
|
3338
3497
|
first.focus();
|
|
3339
3498
|
}
|
|
3340
3499
|
};
|
|
3341
|
-
return (0,
|
|
3500
|
+
return (0, import_react_dom3.createPortal)(
|
|
3342
3501
|
// biome-ignore lint/a11y/useKeyWithClickEvents: ESC handled by a document keydown listener.
|
|
3343
3502
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: overlay2, "data-testid": slot("overlay"), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3344
3503
|
"div",
|
|
@@ -3364,11 +3523,11 @@ var Dialog = (0, import_react63.forwardRef)(function Dialog2({ open, onClose, ti
|
|
|
3364
3523
|
});
|
|
3365
3524
|
|
|
3366
3525
|
// src/components/snackbar/index.tsx
|
|
3367
|
-
var
|
|
3368
|
-
var
|
|
3526
|
+
var import_react66 = require("react");
|
|
3527
|
+
var import_react_dom4 = require("react-dom");
|
|
3369
3528
|
|
|
3370
3529
|
// src/components/snackbar/use-styles.ts
|
|
3371
|
-
var
|
|
3530
|
+
var import_react65 = require("react");
|
|
3372
3531
|
|
|
3373
3532
|
// src/components/snackbar/use-styles.css.ts
|
|
3374
3533
|
var closeBtn = "use-styles_closeBtn__ihzsep2";
|
|
@@ -3378,7 +3537,7 @@ var root21 = "use-styles_root__ihzsep0 surfaces_inkySurface__1qa7atn2";
|
|
|
3378
3537
|
// src/components/snackbar/use-styles.ts
|
|
3379
3538
|
function useStyles29() {
|
|
3380
3539
|
const { themeClass } = useTheme();
|
|
3381
|
-
return (0,
|
|
3540
|
+
return (0, import_react65.useMemo)(
|
|
3382
3541
|
() => ({
|
|
3383
3542
|
root: [themeClass, root21].filter(Boolean).join(" "),
|
|
3384
3543
|
message,
|
|
@@ -3391,7 +3550,7 @@ function useStyles29() {
|
|
|
3391
3550
|
// src/components/snackbar/index.tsx
|
|
3392
3551
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3393
3552
|
var DEFAULT_DURATION = 5e3;
|
|
3394
|
-
var Snackbar = (0,
|
|
3553
|
+
var Snackbar = (0, import_react66.forwardRef)(function Snackbar2({
|
|
3395
3554
|
open,
|
|
3396
3555
|
message: message2,
|
|
3397
3556
|
action,
|
|
@@ -3406,19 +3565,19 @@ var Snackbar = (0, import_react65.forwardRef)(function Snackbar2({
|
|
|
3406
3565
|
}, ref) {
|
|
3407
3566
|
const { root: root25, message: messageClass, closeBtn: closeBtn2 } = useStyles29();
|
|
3408
3567
|
const { testId: dataTestId, slot } = useTestId("feedback", testId);
|
|
3409
|
-
const onCloseRef = (0,
|
|
3410
|
-
(0,
|
|
3568
|
+
const onCloseRef = (0, import_react66.useRef)(onClose);
|
|
3569
|
+
(0, import_react66.useEffect)(() => {
|
|
3411
3570
|
onCloseRef.current = onClose;
|
|
3412
3571
|
}, [onClose]);
|
|
3413
|
-
const interactingRef = (0,
|
|
3414
|
-
const timeoutRef = (0,
|
|
3415
|
-
const clearTimer = (0,
|
|
3572
|
+
const interactingRef = (0, import_react66.useRef)({ hover: false, focus: false });
|
|
3573
|
+
const timeoutRef = (0, import_react66.useRef)();
|
|
3574
|
+
const clearTimer = (0, import_react66.useCallback)(() => {
|
|
3416
3575
|
if (timeoutRef.current !== void 0) {
|
|
3417
3576
|
clearTimeout(timeoutRef.current);
|
|
3418
3577
|
timeoutRef.current = void 0;
|
|
3419
3578
|
}
|
|
3420
3579
|
}, []);
|
|
3421
|
-
const scheduleTimer = (0,
|
|
3580
|
+
const scheduleTimer = (0, import_react66.useCallback)(() => {
|
|
3422
3581
|
clearTimer();
|
|
3423
3582
|
if (!open || duration == null || !onCloseRef.current) return;
|
|
3424
3583
|
if (interactingRef.current.hover || interactingRef.current.focus) return;
|
|
@@ -3426,7 +3585,7 @@ var Snackbar = (0, import_react65.forwardRef)(function Snackbar2({
|
|
|
3426
3585
|
onCloseRef.current?.();
|
|
3427
3586
|
}, duration);
|
|
3428
3587
|
}, [open, duration, clearTimer]);
|
|
3429
|
-
(0,
|
|
3588
|
+
(0, import_react66.useEffect)(() => {
|
|
3430
3589
|
scheduleTimer();
|
|
3431
3590
|
return clearTimer;
|
|
3432
3591
|
}, [scheduleTimer, clearTimer]);
|
|
@@ -3451,7 +3610,7 @@ var Snackbar = (0, import_react65.forwardRef)(function Snackbar2({
|
|
|
3451
3610
|
onBlur?.(event);
|
|
3452
3611
|
};
|
|
3453
3612
|
if (!open || typeof document === "undefined") return null;
|
|
3454
|
-
return (0,
|
|
3613
|
+
return (0, import_react_dom4.createPortal)(
|
|
3455
3614
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3456
3615
|
"div",
|
|
3457
3616
|
{
|
|
@@ -3486,10 +3645,10 @@ var Snackbar = (0, import_react65.forwardRef)(function Snackbar2({
|
|
|
3486
3645
|
});
|
|
3487
3646
|
|
|
3488
3647
|
// src/components/table/index.tsx
|
|
3489
|
-
var
|
|
3648
|
+
var import_react68 = require("react");
|
|
3490
3649
|
|
|
3491
3650
|
// src/components/table/use-styles.ts
|
|
3492
|
-
var
|
|
3651
|
+
var import_react67 = require("react");
|
|
3493
3652
|
|
|
3494
3653
|
// src/components/table/use-styles.css.ts
|
|
3495
3654
|
var alignRight = "use-styles_alignRight__1n2cz6i3";
|
|
@@ -3501,7 +3660,7 @@ var th = "use-styles_th__1n2cz6i1";
|
|
|
3501
3660
|
// src/components/table/use-styles.ts
|
|
3502
3661
|
function useStyles30({ className }) {
|
|
3503
3662
|
const { themeClass } = useTheme();
|
|
3504
|
-
const root25 = (0,
|
|
3663
|
+
const root25 = (0, import_react67.useMemo)(
|
|
3505
3664
|
() => [themeClass, root22, className].filter(Boolean).join(" "),
|
|
3506
3665
|
[themeClass, className]
|
|
3507
3666
|
);
|
|
@@ -3527,15 +3686,15 @@ function TableInner({ columns, rows, getRowKey, className, caption: caption2, te
|
|
|
3527
3686
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tbody", { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tr", { "data-testid": slot(`row-${index}`), children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: cellClass(column), children: column.render ? column.render(row) : String(row[column.key]) }, column.key)) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
3528
3687
|
] });
|
|
3529
3688
|
}
|
|
3530
|
-
var TableForwarded = (0,
|
|
3689
|
+
var TableForwarded = (0, import_react68.forwardRef)(TableInner);
|
|
3531
3690
|
TableForwarded.displayName = "Table";
|
|
3532
3691
|
var Table = TableForwarded;
|
|
3533
3692
|
|
|
3534
3693
|
// src/components/app-bar/index.tsx
|
|
3535
|
-
var
|
|
3694
|
+
var import_react70 = require("react");
|
|
3536
3695
|
|
|
3537
3696
|
// src/components/app-bar/use-styles.ts
|
|
3538
|
-
var
|
|
3697
|
+
var import_react69 = require("react");
|
|
3539
3698
|
|
|
3540
3699
|
// src/components/app-bar/use-styles.css.ts
|
|
3541
3700
|
var actions2 = "use-styles_actions__1h133nh2";
|
|
@@ -3545,7 +3704,7 @@ var root23 = "use-styles_root__1h133nh0";
|
|
|
3545
3704
|
// src/components/app-bar/use-styles.ts
|
|
3546
3705
|
function useStyles31({ className }) {
|
|
3547
3706
|
const { themeClass } = useTheme();
|
|
3548
|
-
const root25 = (0,
|
|
3707
|
+
const root25 = (0, import_react69.useMemo)(
|
|
3549
3708
|
() => [themeClass, root23, className].filter(Boolean).join(" "),
|
|
3550
3709
|
[themeClass, className]
|
|
3551
3710
|
);
|
|
@@ -3554,7 +3713,7 @@ function useStyles31({ className }) {
|
|
|
3554
3713
|
|
|
3555
3714
|
// src/components/app-bar/index.tsx
|
|
3556
3715
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3557
|
-
var AppBar = (0,
|
|
3716
|
+
var AppBar = (0, import_react70.forwardRef)(function AppBar2({ brand: brand2, actions: actions3, className, children, testId, ...rest }, ref) {
|
|
3558
3717
|
const styles = useStyles31({ className });
|
|
3559
3718
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
3560
3719
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { ref, className: styles.root, "data-testid": dataTestId, ...rest, children: [
|
|
@@ -3565,10 +3724,10 @@ var AppBar = (0, import_react69.forwardRef)(function AppBar2({ brand: brand2, ac
|
|
|
3565
3724
|
});
|
|
3566
3725
|
|
|
3567
3726
|
// src/components/list-item/index.tsx
|
|
3568
|
-
var
|
|
3727
|
+
var import_react72 = require("react");
|
|
3569
3728
|
|
|
3570
3729
|
// src/components/list-item/use-styles.ts
|
|
3571
|
-
var
|
|
3730
|
+
var import_react71 = require("react");
|
|
3572
3731
|
|
|
3573
3732
|
// src/components/list-item/use-styles.css.ts
|
|
3574
3733
|
var content3 = "use-styles_content__kbreq13";
|
|
@@ -3583,7 +3742,7 @@ function useStyles32({
|
|
|
3583
3742
|
className
|
|
3584
3743
|
}) {
|
|
3585
3744
|
const { themeClass } = useTheme();
|
|
3586
|
-
const root25 = (0,
|
|
3745
|
+
const root25 = (0, import_react71.useMemo)(
|
|
3587
3746
|
() => [themeClass, root24, selected4 && selected3, className].filter(Boolean).join(" "),
|
|
3588
3747
|
[themeClass, selected4, className]
|
|
3589
3748
|
);
|
|
@@ -3592,7 +3751,7 @@ function useStyles32({
|
|
|
3592
3751
|
|
|
3593
3752
|
// src/components/list-item/index.tsx
|
|
3594
3753
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3595
|
-
var ListItem = (0,
|
|
3754
|
+
var ListItem = (0, import_react72.forwardRef)(function ListItem2({ leading: leading2, trailing: trailing2, selected: selected4, className, testId, children, ...rest }, ref) {
|
|
3596
3755
|
const styles = useStyles32({ selected: selected4, className });
|
|
3597
3756
|
const { testId: dataTestId, slot } = useTestId("list", testId);
|
|
3598
3757
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|