@mediaradar/design-components 0.37.0 → 0.39.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 CHANGED
@@ -2459,10 +2459,104 @@ function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2459
2459
  }
2460
2460
 
2461
2461
  // src/SelectionPicker.tsx
2462
- var import_react11 = require("react");
2462
+ var import_react12 = require("react");
2463
2463
  var import_react_dom4 = require("react-dom");
2464
2464
  var import_lucide_react15 = require("lucide-react");
2465
+
2466
+ // src/Tabs.tsx
2467
+ var import_react11 = require("react");
2465
2468
  var import_jsx_runtime26 = require("react/jsx-runtime");
2469
+ function arrowKeys(e, row) {
2470
+ if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
2471
+ const items = Array.from(row.querySelectorAll("button:not([disabled])"));
2472
+ const at = items.indexOf(document.activeElement);
2473
+ const next = e.key === "Home" ? 0 : e.key === "End" ? items.length - 1 : (at + (e.key === "ArrowRight" ? 1 : -1) + items.length) % items.length;
2474
+ e.preventDefault();
2475
+ items[next]?.focus();
2476
+ items[next]?.click();
2477
+ }
2478
+ function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest }) {
2479
+ const row = (0, import_react11.useRef)(null);
2480
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2481
+ "div",
2482
+ {
2483
+ ref: row,
2484
+ role: "tablist",
2485
+ "aria-label": rest["aria-label"],
2486
+ onKeyDown: (e) => arrowKeys(e, row.current),
2487
+ className: cn("flex gap-6 border-b border-border-default", className),
2488
+ children: items.map((item) => {
2489
+ const on = item.value === value;
2490
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2491
+ "button",
2492
+ {
2493
+ type: "button",
2494
+ role: "tab",
2495
+ id: `${idPrefix}-tab-${item.value}`,
2496
+ "aria-controls": `${idPrefix}-panel-${item.value}`,
2497
+ "aria-selected": on,
2498
+ tabIndex: on ? 0 : -1,
2499
+ disabled: item.disabled,
2500
+ onClick: () => onChange(item.value),
2501
+ className: cn(
2502
+ "-mb-px flex items-center gap-1.5 border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:opacity-50",
2503
+ on ? "border-brand-primaryAction font-semibold text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"
2504
+ ),
2505
+ children: [
2506
+ item.label,
2507
+ item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
2508
+ ]
2509
+ },
2510
+ item.value
2511
+ );
2512
+ })
2513
+ }
2514
+ );
2515
+ }
2516
+ function SegmentedControl({
2517
+ options,
2518
+ value,
2519
+ onChange,
2520
+ size = "sm",
2521
+ className,
2522
+ ...rest
2523
+ }) {
2524
+ const row = (0, import_react11.useRef)(null);
2525
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2526
+ "div",
2527
+ {
2528
+ ref: row,
2529
+ role: "radiogroup",
2530
+ "aria-label": rest["aria-label"],
2531
+ onKeyDown: (e) => arrowKeys(e, row.current),
2532
+ className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
2533
+ children: options.map((o) => {
2534
+ const on = o.value === value;
2535
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2536
+ "button",
2537
+ {
2538
+ type: "button",
2539
+ role: "radio",
2540
+ "aria-checked": on,
2541
+ tabIndex: on ? 0 : -1,
2542
+ onClick: () => onChange(o.value),
2543
+ "data-testid": o.testId,
2544
+ className: cn(
2545
+ "rounded-full px-3 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
2546
+ size === "md" ? "text-sm" : "text-xs",
2547
+ on ? "bg-surface font-semibold text-text-primary shadow-raised" : "text-text-secondary hover:text-text-primary"
2548
+ ),
2549
+ children: o.label
2550
+ },
2551
+ o.value
2552
+ );
2553
+ })
2554
+ }
2555
+ );
2556
+ }
2557
+
2558
+ // src/SelectionPicker.tsx
2559
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2466
2560
  function cx8(...parts) {
2467
2561
  return parts.filter(Boolean).join(" ");
2468
2562
  }
@@ -2498,15 +2592,15 @@ function SelectionPicker({
2498
2592
  testIdPrefix
2499
2593
  }) {
2500
2594
  const hasAccountLists = !!accountLists;
2501
- const [source, setSource] = (0, import_react11.useState)("search");
2502
- const [query, setQuery] = (0, import_react11.useState)("");
2503
- const [activeFilters, setActiveFilters] = (0, import_react11.useState)(() => {
2595
+ const [source, setSource] = (0, import_react12.useState)("search");
2596
+ const [query, setQuery] = (0, import_react12.useState)("");
2597
+ const [activeFilters, setActiveFilters] = (0, import_react12.useState)(() => {
2504
2598
  const init = {};
2505
2599
  if (defaultFilters) for (const [label, opts] of Object.entries(defaultFilters)) init[label] = new Set(opts);
2506
2600
  return init;
2507
2601
  });
2508
- const [expanded, setExpanded] = (0, import_react11.useState)(/* @__PURE__ */ new Set());
2509
- const selectedIds = (0, import_react11.useMemo)(() => new Set(selected.map((s) => s.id)), [selected]);
2602
+ const [expanded, setExpanded] = (0, import_react12.useState)(/* @__PURE__ */ new Set());
2603
+ const selectedIds = (0, import_react12.useMemo)(() => new Set(selected.map((s) => s.id)), [selected]);
2510
2604
  const toggleFilter = (label, opt) => {
2511
2605
  setActiveFilters((prev) => {
2512
2606
  const next = { ...prev };
@@ -2518,7 +2612,7 @@ function SelectionPicker({
2518
2612
  };
2519
2613
  const activeFilterCount = filters.reduce((n, f) => n + (activeFilters[f.label]?.size ?? 0), 0);
2520
2614
  const hasSearched = showResultsWithoutSearch || query.trim().length > 0 || !requireQuery && activeFilterCount > 0;
2521
- const filteredCatalog = (0, import_react11.useMemo)(() => {
2615
+ const filteredCatalog = (0, import_react12.useMemo)(() => {
2522
2616
  if (!hasSearched || results !== void 0) return [];
2523
2617
  const q = query.trim().toLowerCase();
2524
2618
  return catalog.filter((row) => {
@@ -2557,39 +2651,29 @@ function SelectionPicker({
2557
2651
  }
2558
2652
  };
2559
2653
  const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
2560
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-4", children: [
2561
- helper && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2562
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-secondary", children: helper }),
2563
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
2654
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-4", children: [
2655
+ helper && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
2656
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-dense text-text-secondary", children: helper }),
2657
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
2564
2658
  ] }),
2565
- hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "inline-flex gap-0.5 self-start rounded-control border border-border-default bg-canvas p-0.5", children: [
2566
- { id: "search", label: "Search", icon: import_lucide_react15.Search },
2567
- { id: "lists", label: "Account lists", icon: import_lucide_react15.List }
2568
- ].map((t) => {
2569
- const on = source === t.id;
2570
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2571
- "button",
2572
- {
2573
- type: "button",
2574
- onClick: () => setSource(t.id),
2575
- "data-testid": testIdPrefix && `${testIdPrefix}-source-${t.id}`,
2576
- className: cx8(
2577
- "inline-flex items-center gap-1.5 rounded-[6px] px-3 py-1.5 text-[13px] font-medium transition-colors",
2578
- on ? "bg-surface text-text-primary shadow-raised" : "text-text-secondary hover:text-text-primary"
2579
- ),
2580
- children: [
2581
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(t.icon, { size: 14, "aria-hidden": "true" }),
2582
- t.label
2583
- ]
2584
- },
2585
- t.id
2586
- );
2587
- }) }),
2588
- source === "search" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2589
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2590
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex h-8 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
2591
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2592
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2659
+ hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2660
+ SegmentedControl,
2661
+ {
2662
+ "aria-label": "Add from",
2663
+ className: "self-start",
2664
+ value: source,
2665
+ onChange: setSource,
2666
+ options: [
2667
+ { value: "search", label: "Search", testId: testIdPrefix && `${testIdPrefix}-source-search` },
2668
+ { value: "lists", label: "Account lists", testId: testIdPrefix && `${testIdPrefix}-source-lists` }
2669
+ ]
2670
+ }
2671
+ ),
2672
+ source === "search" && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2673
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2674
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex h-8 min-w-50 flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
2675
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2676
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2593
2677
  "input",
2594
2678
  {
2595
2679
  value: query,
@@ -2605,7 +2689,7 @@ function SelectionPicker({
2605
2689
  }
2606
2690
  )
2607
2691
  ] }),
2608
- filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2692
+ filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2609
2693
  FilterDropdown,
2610
2694
  {
2611
2695
  filter: f,
@@ -2617,22 +2701,22 @@ function SelectionPicker({
2617
2701
  )),
2618
2702
  toolbarExtra
2619
2703
  ] }),
2620
- !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2621
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2622
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
2623
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "Search to get started" }),
2624
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Use the search or filters above to find and add options." })
2704
+ !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2705
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2706
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-1", children: [
2707
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
2708
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
2625
2709
  ] })
2626
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
2627
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2710
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
2711
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2628
2712
  "div",
2629
2713
  {
2630
2714
  className: cx8(
2631
- "grid items-center gap-2 border-b border-border-default bg-canvas px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.06em] text-text-secondary",
2715
+ "grid items-center gap-2 border-b border-border-default bg-canvas px-3 py-2 text-micro font-semibold uppercase tracking-[0.06em] text-text-secondary",
2632
2716
  rowGridCols
2633
2717
  ),
2634
2718
  children: [
2635
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2719
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2636
2720
  CheckBox,
2637
2721
  {
2638
2722
  checked: allSelected,
@@ -2643,18 +2727,18 @@ function SelectionPicker({
2643
2727
  testId: testIdPrefix && `${testIdPrefix}-select-all`
2644
2728
  }
2645
2729
  ),
2646
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
2647
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-right", children: "Info" })
2730
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cx8("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
2731
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right", children: "Info" })
2648
2732
  ]
2649
2733
  }
2650
2734
  ),
2651
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "max-h-[360px] overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
2735
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
2652
2736
  const isSel = selectedIds.has(row.id);
2653
2737
  const isLocked = lockedIds?.has(row.id) ?? false;
2654
2738
  const kids = getChildren?.(row);
2655
2739
  const isOpen = expanded.has(row.id);
2656
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
2657
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2740
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
2741
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2658
2742
  "div",
2659
2743
  {
2660
2744
  onClick: isLocked ? void 0 : () => toggleRow(row),
@@ -2667,7 +2751,7 @@ function SelectionPicker({
2667
2751
  !isLocked && isSel && "opacity-70"
2668
2752
  ),
2669
2753
  children: [
2670
- isLocked ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2754
+ isLocked ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2671
2755
  CheckBox,
2672
2756
  {
2673
2757
  checked: isSel,
@@ -2676,8 +2760,8 @@ function SelectionPicker({
2676
2760
  testId: testIdPrefix && `${testIdPrefix}-row-${slug4(row.id)}`
2677
2761
  }
2678
2762
  ),
2679
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("grid gap-2 text-[13px] text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cx8("truncate", c.className), children: c.render(row) }, c.key)) }),
2680
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2763
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cx8("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cx8("truncate", c.className), children: c.render(row) }, c.key)) }),
2764
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2681
2765
  "button",
2682
2766
  {
2683
2767
  type: "button",
@@ -2691,39 +2775,39 @@ function SelectionPicker({
2691
2775
  });
2692
2776
  },
2693
2777
  className: "flex h-7 w-7 items-center justify-center rounded-control text-text-secondary hover:bg-canvas hover:text-text-primary",
2694
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.ChevronRight, { size: 15, className: cx8("transition-transform", isOpen && "rotate-90") })
2778
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ChevronRight, { size: 15, className: cx8("transition-transform", isOpen && "rotate-90") })
2695
2779
  }
2696
- ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2780
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2697
2781
  "span",
2698
2782
  {
2699
2783
  className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
2700
2784
  title: "No additional details",
2701
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Info, { size: 14 })
2785
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Info, { size: 14 })
2702
2786
  }
2703
2787
  ) })
2704
2788
  ]
2705
2789
  }
2706
2790
  ),
2707
- isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
2791
+ isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
2708
2792
  const kidSel = selectedIds.has(kid.id);
2709
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2793
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2710
2794
  "div",
2711
2795
  {
2712
2796
  className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
2713
2797
  children: [
2714
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-[13px] text-text-secondary", children: kid.name }),
2715
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2798
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
2799
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2716
2800
  "button",
2717
2801
  {
2718
2802
  type: "button",
2719
2803
  disabled: kidSel,
2720
2804
  onClick: () => addRows([kid]),
2721
2805
  className: cx8(
2722
- "inline-flex items-center gap-1 rounded-control px-2 py-1 text-[12px] font-medium",
2806
+ "inline-flex items-center gap-1 rounded-control px-2 py-1 text-xs font-medium",
2723
2807
  kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
2724
2808
  ),
2725
2809
  children: [
2726
- kidSel ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Plus, { size: 13 }),
2810
+ kidSel ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Plus, { size: 13 }),
2727
2811
  kidSel ? "Added" : "Add"
2728
2812
  ]
2729
2813
  }
@@ -2735,28 +2819,28 @@ function SelectionPicker({
2735
2819
  }) })
2736
2820
  ] }, row.id);
2737
2821
  }) }),
2738
- !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2822
+ !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2739
2823
  "button",
2740
2824
  {
2741
2825
  type: "button",
2742
2826
  onClick: onLoadMore,
2743
2827
  disabled: loadingMore,
2744
2828
  "data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
2745
- className: "flex w-full items-center justify-center gap-2 border-t border-border-default px-2 py-1.5 text-[13px] text-brand-primaryAction transition-colors hover:bg-subtle disabled:opacity-50",
2829
+ className: "flex w-full items-center justify-center gap-2 border-t border-border-default px-2 py-1.5 text-dense text-brand-primaryAction transition-colors hover:bg-subtle disabled:opacity-50",
2746
2830
  children: [
2747
- loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
2831
+ loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
2748
2832
  loadingMore ? "Loading\u2026" : "Load more"
2749
2833
  ]
2750
2834
  }
2751
2835
  )
2752
2836
  ] })
2753
2837
  ] }),
2754
- source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2755
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
2756
- accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2757
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScrollFade, { className: "flex max-h-[396px] flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
2838
+ source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2839
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-dense text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
2840
+ accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
2841
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
2758
2842
  const on = (selectedListIds ?? []).includes(list.id);
2759
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2843
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2760
2844
  "button",
2761
2845
  {
2762
2846
  type: "button",
@@ -2768,19 +2852,19 @@ function SelectionPicker({
2768
2852
  on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
2769
2853
  ),
2770
2854
  children: [
2771
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2855
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2772
2856
  "span",
2773
2857
  {
2774
2858
  className: cx8(
2775
2859
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
2776
2860
  on ? "text-brand-primaryAction" : "text-text-secondary"
2777
2861
  ),
2778
- children: on ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Plus, { size: 16 })
2862
+ children: on ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Plus, { size: 16 })
2779
2863
  }
2780
2864
  ),
2781
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "min-w-0 flex-1", children: [
2782
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-[14px] font-medium text-text-primary", children: list.name }) }),
2783
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "block truncate text-[12px] text-text-secondary", children: [
2865
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "min-w-0 flex-1", children: [
2866
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
2867
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "block truncate text-xs text-text-secondary", children: [
2784
2868
  list.count,
2785
2869
  " accounts \xB7 ",
2786
2870
  list.entityTypes.join(", "),
@@ -2788,16 +2872,16 @@ function SelectionPicker({
2788
2872
  formatListDate(list.updatedAt)
2789
2873
  ] })
2790
2874
  ] }),
2791
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cx8("shrink-0 text-[12px] font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
2875
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cx8("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
2792
2876
  ]
2793
2877
  },
2794
2878
  list.id
2795
2879
  );
2796
2880
  }) }),
2797
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2881
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2798
2882
  "p",
2799
2883
  {
2800
- className: "border-t border-border-default pt-2 text-right text-[12px] font-medium text-text-tertiary",
2884
+ className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
2801
2885
  "data-testid": testIdPrefix && `${testIdPrefix}-list-count`,
2802
2886
  children: [
2803
2887
  accountLists.length,
@@ -2806,11 +2890,11 @@ function SelectionPicker({
2806
2890
  ]
2807
2891
  }
2808
2892
  )
2809
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2810
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2811
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
2812
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "No account lists yet" }),
2813
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Account lists set up for you will appear here." })
2893
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2894
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2895
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-1", children: [
2896
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
2897
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
2814
2898
  ] })
2815
2899
  ] })
2816
2900
  ] })
@@ -2818,16 +2902,16 @@ function SelectionPicker({
2818
2902
  }
2819
2903
  var EDGE_FADE = 44;
2820
2904
  function ScrollFade({ className, children }) {
2821
- const elRef = (0, import_react11.useRef)(null);
2822
- const [edges, setEdges] = (0, import_react11.useState)({ top: false, bottom: false });
2823
- const sync = (0, import_react11.useCallback)(() => {
2905
+ const elRef = (0, import_react12.useRef)(null);
2906
+ const [edges, setEdges] = (0, import_react12.useState)({ top: false, bottom: false });
2907
+ const sync = (0, import_react12.useCallback)(() => {
2824
2908
  const el = elRef.current;
2825
2909
  if (!el) return;
2826
2910
  const top = el.scrollTop > 2;
2827
2911
  const bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 2;
2828
2912
  setEdges((prev) => prev.top === top && prev.bottom === bottom ? prev : { top, bottom });
2829
2913
  }, []);
2830
- const attach = (0, import_react11.useCallback)(
2914
+ const attach = (0, import_react12.useCallback)(
2831
2915
  (el) => {
2832
2916
  elRef.current = el;
2833
2917
  if (!el) return;
@@ -2842,7 +2926,7 @@ function ScrollFade({ className, children }) {
2842
2926
  [sync]
2843
2927
  );
2844
2928
  const mask = edges.top || edges.bottom ? `linear-gradient(to bottom, transparent 0, #000 ${edges.top ? EDGE_FADE : 0}px, #000 calc(100% - ${edges.bottom ? EDGE_FADE : 0}px), transparent 100%)` : void 0;
2845
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
2929
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
2846
2930
  }
2847
2931
  function formatListDate(iso) {
2848
2932
  try {
@@ -2857,19 +2941,19 @@ function FilterDropdown({
2857
2941
  onToggle,
2858
2942
  testIdPrefix
2859
2943
  }) {
2860
- const [open, setOpen] = (0, import_react11.useState)(false);
2861
- const [q, setQ] = (0, import_react11.useState)("");
2862
- const btnRef = (0, import_react11.useRef)(null);
2863
- const menuRef = (0, import_react11.useRef)(null);
2864
- const [pos, setPos] = (0, import_react11.useState)(null);
2944
+ const [open, setOpen] = (0, import_react12.useState)(false);
2945
+ const [q, setQ] = (0, import_react12.useState)("");
2946
+ const btnRef = (0, import_react12.useRef)(null);
2947
+ const menuRef = (0, import_react12.useRef)(null);
2948
+ const [pos, setPos] = (0, import_react12.useState)(null);
2865
2949
  const searchable = filter.options.length > 8;
2866
2950
  const shownOptions = searchable && q.trim() ? filter.options.filter((o) => o.toLowerCase().includes(q.trim().toLowerCase())) : filter.options;
2867
- (0, import_react11.useLayoutEffect)(() => {
2951
+ (0, import_react12.useLayoutEffect)(() => {
2868
2952
  if (!open || !btnRef.current) return;
2869
2953
  const r = btnRef.current.getBoundingClientRect();
2870
2954
  setPos({ top: r.bottom + 6, left: r.left });
2871
2955
  }, [open]);
2872
- (0, import_react11.useEffect)(() => {
2956
+ (0, import_react12.useEffect)(() => {
2873
2957
  if (!open) {
2874
2958
  setQ("");
2875
2959
  return;
@@ -2892,8 +2976,8 @@ function FilterDropdown({
2892
2976
  const count = active.size;
2893
2977
  const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
2894
2978
  const filterSlug = slug4(filter.label);
2895
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
2896
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2979
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
2980
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2897
2981
  "button",
2898
2982
  {
2899
2983
  ref: btnRef,
@@ -2901,44 +2985,44 @@ function FilterDropdown({
2901
2985
  onClick: () => setOpen((v) => !v),
2902
2986
  "aria-expanded": open,
2903
2987
  "data-testid": testIdPrefix && `${testIdPrefix}-filter-${filterSlug}`,
2904
- className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-[13px] font-medium text-text-secondary transition-colors hover:bg-subtle",
2988
+ className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-dense font-medium text-text-secondary transition-colors hover:bg-subtle",
2905
2989
  children: [
2906
2990
  label,
2907
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
2991
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
2908
2992
  ]
2909
2993
  }
2910
2994
  ),
2911
2995
  open && pos && (0, import_react_dom4.createPortal)(
2912
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2996
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2913
2997
  "div",
2914
2998
  {
2915
2999
  ref: menuRef,
2916
3000
  role: "group",
2917
3001
  "aria-label": filter.label,
2918
3002
  style: { top: pos.top, left: pos.left },
2919
- className: "fixed z-[80] min-w-[220px] rounded-card border border-border-default bg-surface p-2 shadow-overlay",
3003
+ className: "fixed z-[80] min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
2920
3004
  children: [
2921
- searchable && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
2922
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
2923
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3005
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
3006
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
3007
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2924
3008
  "input",
2925
3009
  {
2926
3010
  autoFocus: true,
2927
3011
  value: q,
2928
3012
  onChange: (e) => setQ(e.target.value),
2929
3013
  placeholder: `Search ${filter.label.toLowerCase()}\u2026`,
2930
- className: "h-full flex-1 bg-transparent text-[13px] outline-hidden placeholder:text-text-tertiary"
3014
+ className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
2931
3015
  }
2932
3016
  )
2933
3017
  ] }),
2934
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("flex flex-col gap-0.5", searchable && "max-h-[240px] overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-2 py-3 text-center text-[12px] text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
3018
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cx8("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
2935
3019
  const on = active.has(opt);
2936
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3020
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2937
3021
  "label",
2938
3022
  {
2939
- className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-[13px] text-text-primary hover:bg-subtle",
3023
+ className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
2940
3024
  children: [
2941
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3025
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2942
3026
  CheckBox,
2943
3027
  {
2944
3028
  checked: on,
@@ -2968,8 +3052,8 @@ function gridForColumns(columns) {
2968
3052
  }
2969
3053
 
2970
3054
  // src/PublisherBreakdownList.tsx
2971
- var import_react12 = require("react");
2972
- var import_jsx_runtime27 = require("react/jsx-runtime");
3055
+ var import_react13 = require("react");
3056
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2973
3057
  function cx9(...parts) {
2974
3058
  return parts.filter(Boolean).join(" ");
2975
3059
  }
@@ -2984,7 +3068,7 @@ function initials(name) {
2984
3068
  return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
2985
3069
  }
2986
3070
  function Monogram({ name, size = 28 }) {
2987
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3071
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2988
3072
  "span",
2989
3073
  {
2990
3074
  "aria-hidden": "true",
@@ -2995,12 +3079,12 @@ function Monogram({ name, size = 28 }) {
2995
3079
  );
2996
3080
  }
2997
3081
  function BreakdownTag({ children }) {
2998
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary", children });
3082
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary", children });
2999
3083
  }
3000
3084
  function DelayedTip({ label, children }) {
3001
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
3085
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
3002
3086
  children,
3003
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3087
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3004
3088
  "span",
3005
3089
  {
3006
3090
  role: "tooltip",
@@ -3014,22 +3098,22 @@ var COL_CURRENT = 76;
3014
3098
  var COL_PREVIOUS = 76;
3015
3099
  var COL_YOY = 44;
3016
3100
  function MetricListHeader({ className }) {
3017
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
3018
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex-1" }),
3019
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3020
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
3021
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
3022
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
3101
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
3102
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "flex-1" }),
3103
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3104
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
3105
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
3106
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
3023
3107
  ] })
3024
3108
  ] });
3025
3109
  }
3026
3110
  function MetricCells({ spendN, yoy }) {
3027
3111
  const prior = priorYearAmt(spendN, yoy);
3028
3112
  const up = yoy !== "NEW" && yoy >= 0;
3029
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3030
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
3031
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
3032
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
3113
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3114
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
3115
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
3116
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
3033
3117
  up ? "+" : "\u2212",
3034
3118
  Math.abs(yoy),
3035
3119
  "%"
@@ -3037,48 +3121,48 @@ function MetricCells({ spendN, yoy }) {
3037
3121
  ] });
3038
3122
  }
3039
3123
  function PublisherBreakdownList({ rows, defaultVisibleCount = 10, padded = true, viewAllHref, renderLogo }) {
3040
- const [showAll, setShowAll] = (0, import_react12.useState)(false);
3124
+ const [showAll, setShowAll] = (0, import_react13.useState)(false);
3041
3125
  const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
3042
3126
  const rowPad = padded ? "px-5" : "";
3043
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col", children: [
3044
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col", children: [
3045
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetricListHeader, { className: rowPad }),
3046
- visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
3047
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
3048
- renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Monogram, { name: p.brand, size: 28 }),
3049
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "min-w-0", children: [
3050
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
3051
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: p.brand }),
3052
- p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(BreakdownTag, { children: t }, t))
3127
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col", children: [
3128
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col", children: [
3129
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MetricListHeader, { className: rowPad }),
3130
+ visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cx9("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
3131
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
3132
+ renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Monogram, { name: p.brand, size: 28 }),
3133
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "min-w-0", children: [
3134
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
3135
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: p.brand }),
3136
+ p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BreakdownTag, { children: t }, t))
3053
3137
  ] }),
3054
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
3138
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
3055
3139
  ] })
3056
3140
  ] }),
3057
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
3141
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
3058
3142
  ] }, p.brand))
3059
3143
  ] }),
3060
- rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cx9("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("a", { href: viewAllHref, className: "text-[12px] font-semibold text-text-link hover:underline", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-center gap-2 border-t border-border-default py-3 text-[12px] text-text-tertiary", rowPad), children: [
3061
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
3144
+ rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cx9("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("a", { href: viewAllHref, className: "text-[12px] font-semibold text-text-link hover:underline", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cx9("flex items-center gap-2 border-t border-border-default py-3 text-[12px] text-text-tertiary", rowPad), children: [
3145
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
3062
3146
  "Showing ",
3063
3147
  visible.length,
3064
3148
  " of ",
3065
3149
  rows.length
3066
3150
  ] }),
3067
- !showAll ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline", children: [
3151
+ !showAll ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline", children: [
3068
3152
  "See all (",
3069
3153
  rows.length - defaultVisibleCount,
3070
3154
  " more)"
3071
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline", children: "Show less" })
3155
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline", children: "Show less" })
3072
3156
  ] }))
3073
3157
  ] });
3074
3158
  }
3075
3159
 
3076
3160
  // src/Button.tsx
3077
- var import_react13 = require("react");
3161
+ var import_react14 = require("react");
3078
3162
  var import_react_slot = require("@radix-ui/react-slot");
3079
3163
  var import_class_variance_authority = require("class-variance-authority");
3080
3164
  var import_lucide_react16 = require("lucide-react");
3081
- var import_jsx_runtime28 = require("react/jsx-runtime");
3165
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3082
3166
  var buttonVariants = (0, import_class_variance_authority.cva)(
3083
3167
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
3084
3168
  {
@@ -3139,7 +3223,7 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
3139
3223
  }
3140
3224
  }
3141
3225
  );
3142
- var Button = (0, import_react13.forwardRef)(
3226
+ var Button = (0, import_react14.forwardRef)(
3143
3227
  ({ className, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
3144
3228
  const shared = {
3145
3229
  className: cn(buttonVariants({ variant, size, iconOnly, className })),
@@ -3148,10 +3232,10 @@ var Button = (0, import_react13.forwardRef)(
3148
3232
  ...props
3149
3233
  };
3150
3234
  if (asChild) {
3151
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_slot.Slot, { ref, ...shared, children });
3235
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_slot.Slot, { ref, ...shared, children });
3152
3236
  }
3153
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { ref, ...shared, children: [
3154
- loading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
3237
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { ref, ...shared, children: [
3238
+ loading && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react16.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
3155
3239
  children
3156
3240
  ] });
3157
3241
  }
@@ -3159,14 +3243,14 @@ var Button = (0, import_react13.forwardRef)(
3159
3243
  Button.displayName = "Button";
3160
3244
 
3161
3245
  // src/FilterDropdownFooter.tsx
3162
- var import_jsx_runtime29 = require("react/jsx-runtime");
3246
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3163
3247
  function FilterDropdownFooter({
3164
3248
  onClear,
3165
3249
  onApply,
3166
3250
  clearLabel = "Clear all",
3167
3251
  applyLabel = "Apply"
3168
3252
  }) {
3169
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3253
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3170
3254
  "div",
3171
3255
  {
3172
3256
  className: cn(
@@ -3174,17 +3258,17 @@ function FilterDropdownFooter({
3174
3258
  onClear ? "justify-between" : "justify-end"
3175
3259
  ),
3176
3260
  children: [
3177
- onClear && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3178
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3261
+ onClear && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3262
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3179
3263
  ]
3180
3264
  }
3181
3265
  );
3182
3266
  }
3183
3267
 
3184
3268
  // src/NameListModal.tsx
3185
- var import_react14 = require("react");
3269
+ var import_react15 = require("react");
3186
3270
  var import_react_dom5 = require("react-dom");
3187
- var import_jsx_runtime30 = require("react/jsx-runtime");
3271
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3188
3272
  function NameListModal({
3189
3273
  title,
3190
3274
  initialName,
@@ -3195,21 +3279,21 @@ function NameListModal({
3195
3279
  placeholder = "e.g. Q4 prospecting targets",
3196
3280
  options
3197
3281
  }) {
3198
- const [name, setName] = (0, import_react14.useState)(initialName);
3199
- const [checked, setChecked] = (0, import_react14.useState)(
3282
+ const [name, setName] = (0, import_react15.useState)(initialName);
3283
+ const [checked, setChecked] = (0, import_react15.useState)(
3200
3284
  () => Object.fromEntries((options ?? []).map((o) => [o.key, !!o.initial]))
3201
3285
  );
3202
3286
  const toggle = (key) => setChecked((c) => ({ ...c, [key]: !c[key] }));
3203
- const dialogRef = (0, import_react14.useRef)(null);
3204
- const titleId = (0, import_react14.useId)();
3205
- const fieldId = (0, import_react14.useId)();
3206
- (0, import_react14.useEffect)(() => {
3287
+ const dialogRef = (0, import_react15.useRef)(null);
3288
+ const titleId = (0, import_react15.useId)();
3289
+ const fieldId = (0, import_react15.useId)();
3290
+ (0, import_react15.useEffect)(() => {
3207
3291
  const onKey = (e) => e.key === "Escape" && onCancel();
3208
3292
  window.addEventListener("keydown", onKey);
3209
3293
  return () => window.removeEventListener("keydown", onKey);
3210
3294
  }, [onCancel]);
3211
- const [opener] = (0, import_react14.useState)(() => typeof document === "undefined" ? null : document.activeElement);
3212
- (0, import_react14.useEffect)(
3295
+ const [opener] = (0, import_react15.useState)(() => typeof document === "undefined" ? null : document.activeElement);
3296
+ (0, import_react15.useEffect)(
3213
3297
  () => () => {
3214
3298
  const active = document.activeElement;
3215
3299
  if (!active || active === document.body) opener?.focus?.();
@@ -3236,12 +3320,12 @@ function NameListModal({
3236
3320
  // bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
3237
3321
  // No in-data-[theme=dark] override needed any more -- the token redefines
3238
3322
  // itself under that attribute in dark.css, so one class covers both themes.
3239
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3323
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3240
3324
  "div",
3241
3325
  {
3242
3326
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
3243
3327
  onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
3244
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3328
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3245
3329
  "div",
3246
3330
  {
3247
3331
  ref: dialogRef,
@@ -3251,10 +3335,10 @@ function NameListModal({
3251
3335
  onKeyDown: trapTab,
3252
3336
  className: "w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay",
3253
3337
  children: [
3254
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3255
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
3256
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: fieldId, className: "text-[12px] font-medium text-text-secondary", children: fieldLabel }),
3257
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3338
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3339
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
3340
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: fieldId, className: "text-[12px] font-medium text-text-secondary", children: fieldLabel }),
3341
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3258
3342
  "input",
3259
3343
  {
3260
3344
  id: fieldId,
@@ -3266,13 +3350,13 @@ function NameListModal({
3266
3350
  }
3267
3351
  )
3268
3352
  ] }),
3269
- options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-[13px] text-text-primary", children: [
3270
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
3353
+ options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-[13px] text-text-primary", children: [
3354
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
3271
3355
  o.label
3272
3356
  ] }, o.key)) }),
3273
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
3274
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
3275
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
3357
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
3358
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
3359
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
3276
3360
  ] })
3277
3361
  ]
3278
3362
  }
@@ -3285,11 +3369,11 @@ function NameListModal({
3285
3369
 
3286
3370
  // src/FilterChipBar.tsx
3287
3371
  var import_lucide_react17 = require("lucide-react");
3288
- var import_jsx_runtime31 = require("react/jsx-runtime");
3372
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3289
3373
  function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
3290
3374
  if (chips.length === 0) return null;
3291
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", children: [
3292
- chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3375
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", children: [
3376
+ chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3293
3377
  Chip,
3294
3378
  {
3295
3379
  label: c.label,
@@ -3299,7 +3383,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
3299
3383
  },
3300
3384
  c.key
3301
3385
  )),
3302
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-[12px] font-medium text-text-link hover:underline", children: "Clear all" })
3386
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-[12px] font-medium text-text-link hover:underline", children: "Clear all" })
3303
3387
  ] });
3304
3388
  }
3305
3389
  function Chip({
@@ -3308,8 +3392,8 @@ function Chip({
3308
3392
  parked,
3309
3393
  onRemove
3310
3394
  }) {
3311
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "group relative inline-flex", children: [
3312
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3395
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "group relative inline-flex", children: [
3396
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3313
3397
  "span",
3314
3398
  {
3315
3399
  className: cn(
@@ -3321,22 +3405,22 @@ function Chip({
3321
3405
  ) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
3322
3406
  ),
3323
3407
  children: [
3324
- parked && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
3408
+ parked && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
3325
3409
  label,
3326
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3410
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3327
3411
  "button",
3328
3412
  {
3329
3413
  type: "button",
3330
3414
  onClick: onRemove,
3331
3415
  "aria-label": `Remove ${groupLabel}: ${label}`,
3332
3416
  className: "text-text-tertiary transition-colors hover:text-text-primary",
3333
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.X, { size: 12 })
3417
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.X, { size: 12 })
3334
3418
  }
3335
3419
  )
3336
3420
  ]
3337
3421
  }
3338
3422
  ),
3339
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3423
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3340
3424
  "span",
3341
3425
  {
3342
3426
  role: "tooltip",
@@ -3349,7 +3433,7 @@ function Chip({
3349
3433
 
3350
3434
  // src/SortButton.tsx
3351
3435
  var import_lucide_react18 = require("lucide-react");
3352
- var import_jsx_runtime32 = require("react/jsx-runtime");
3436
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3353
3437
  var ALIGN = {
3354
3438
  left: "justify-start text-left",
3355
3439
  center: "justify-center text-center",
@@ -3365,9 +3449,9 @@ function SortButton({
3365
3449
  align = "left",
3366
3450
  testIdPrefix
3367
3451
  }) {
3368
- if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn("inline-flex", ALIGN[align]), children: label });
3452
+ if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("inline-flex", ALIGN[align]), children: label });
3369
3453
  const active = !disabled && sort.key === sortKey;
3370
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3454
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3371
3455
  "button",
3372
3456
  {
3373
3457
  type: "button",
@@ -3396,7 +3480,7 @@ function SortButton({
3396
3480
  ),
3397
3481
  children: [
3398
3482
  label,
3399
- !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3483
+ !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react18.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react18.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3400
3484
  import_lucide_react18.ArrowUpDown,
3401
3485
  {
3402
3486
  size: 12,
@@ -3425,7 +3509,7 @@ function ariaSortFor(sort, key) {
3425
3509
 
3426
3510
  // src/Pager.tsx
3427
3511
  var import_lucide_react19 = require("lucide-react");
3428
- var import_jsx_runtime33 = require("react/jsx-runtime");
3512
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3429
3513
  function pageWindow(current, total) {
3430
3514
  if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
3431
3515
  const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
@@ -3441,8 +3525,8 @@ function pageWindow(current, total) {
3441
3525
  }
3442
3526
  function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination" }) {
3443
3527
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-30";
3444
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3445
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3528
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3529
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3446
3530
  "button",
3447
3531
  {
3448
3532
  type: "button",
@@ -3450,11 +3534,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3450
3534
  disabled: disabled || page === 1,
3451
3535
  "aria-label": "Previous page",
3452
3536
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3453
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3537
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3454
3538
  }
3455
3539
  ),
3456
3540
  pageWindow(page, totalPages).map(
3457
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3541
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3458
3542
  "button",
3459
3543
  {
3460
3544
  type: "button",
@@ -3470,7 +3554,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3470
3554
  p
3471
3555
  )
3472
3556
  ),
3473
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3557
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3474
3558
  "button",
3475
3559
  {
3476
3560
  type: "button",
@@ -3478,14 +3562,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3478
3562
  disabled: disabled || page === totalPages,
3479
3563
  "aria-label": "Next page",
3480
3564
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3481
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3565
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3482
3566
  }
3483
3567
  )
3484
3568
  ] });
3485
3569
  }
3486
3570
 
3487
3571
  // src/WorkspaceAvatar.tsx
3488
- var import_jsx_runtime34 = require("react/jsx-runtime");
3572
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3489
3573
  function workspaceInitials(name) {
3490
3574
  const words = name.trim().split(/\s+/).filter(Boolean);
3491
3575
  if (words.length === 0) return "\xB7";
@@ -3504,7 +3588,7 @@ var SIZES = {
3504
3588
  lg: "h-11 w-11 text-panel-title"
3505
3589
  };
3506
3590
  function WorkspaceAvatar({ name, size = "md" }) {
3507
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3591
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3508
3592
  "span",
3509
3593
  {
3510
3594
  "aria-hidden": "true",
@@ -3518,20 +3602,20 @@ function WorkspaceAvatar({ name, size = "md" }) {
3518
3602
  }
3519
3603
 
3520
3604
  // src/Toast.tsx
3521
- var import_react15 = require("react");
3605
+ var import_react16 = require("react");
3522
3606
  var import_react_dom6 = require("react-dom");
3523
3607
  var import_lucide_react20 = require("lucide-react");
3524
- var import_jsx_runtime35 = require("react/jsx-runtime");
3608
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3525
3609
  var ICON = {
3526
3610
  neutral: null,
3527
- success: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react20.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
3528
- warning: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react20.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
3611
+ success: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
3612
+ warning: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
3529
3613
  };
3530
3614
  function Toast({ message, action, onClose, tone = "neutral", duration, className }) {
3531
3615
  const ms = duration ?? (action ? 1e4 : 5e3);
3532
- const [paused, setPaused] = (0, import_react15.useState)(false);
3533
- const closed = (0, import_react15.useRef)(false);
3534
- (0, import_react15.useEffect)(() => {
3616
+ const [paused, setPaused] = (0, import_react16.useState)(false);
3617
+ const closed = (0, import_react16.useRef)(false);
3618
+ (0, import_react16.useEffect)(() => {
3535
3619
  if (paused) return;
3536
3620
  const t = window.setTimeout(() => {
3537
3621
  if (closed.current) return;
@@ -3541,7 +3625,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3541
3625
  return () => window.clearTimeout(t);
3542
3626
  }, [message, ms, paused]);
3543
3627
  return (0, import_react_dom6.createPortal)(
3544
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3628
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
3545
3629
  "div",
3546
3630
  {
3547
3631
  role: "status",
@@ -3558,7 +3642,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3558
3642
  children: [
3559
3643
  ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
3560
3644
  // for the page, and on the toast's flipped surface amber drops to 2:1.
3561
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3645
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3562
3646
  "span",
3563
3647
  {
3564
3648
  className: cn(
@@ -3568,8 +3652,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3568
3652
  children: ICON[tone]
3569
3653
  }
3570
3654
  ),
3571
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "min-w-0", children: message }),
3572
- action && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3655
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "min-w-0", children: message }),
3656
+ action && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3573
3657
  "button",
3574
3658
  {
3575
3659
  type: "button",
@@ -3591,14 +3675,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3591
3675
  }
3592
3676
 
3593
3677
  // src/Tag.tsx
3594
- var import_jsx_runtime36 = require("react/jsx-runtime");
3678
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3595
3679
  function Tag({ children, className }) {
3596
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Badge, { kind: "category", className, children });
3680
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Badge, { kind: "category", className, children });
3597
3681
  }
3598
3682
 
3599
3683
  // src/TablePagination.tsx
3600
3684
  var import_lucide_react21 = require("lucide-react");
3601
- var import_jsx_runtime37 = require("react/jsx-runtime");
3685
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3602
3686
  function TablePagination({
3603
3687
  page,
3604
3688
  perPage,
@@ -3618,7 +3702,7 @@ function TablePagination({
3618
3702
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-dense transition-colors";
3619
3703
  const off = "disabled:pointer-events-none disabled:opacity-30";
3620
3704
  const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
3621
- const range = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
3705
+ const range = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
3622
3706
  rangeStart.toLocaleString(),
3623
3707
  " \u2013 ",
3624
3708
  rangeEnd.toLocaleString(),
@@ -3627,13 +3711,13 @@ function TablePagination({
3627
3711
  " ",
3628
3712
  itemLabel
3629
3713
  ] });
3630
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3631
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3714
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3715
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3632
3716
  "div",
3633
3717
  {
3634
3718
  className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
3635
3719
  children: [
3636
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3720
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3637
3721
  SelectFilter,
3638
3722
  {
3639
3723
  size: "sm",
@@ -3649,8 +3733,8 @@ function TablePagination({
3649
3733
  ]
3650
3734
  }
3651
3735
  ),
3652
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3653
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3736
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3737
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3654
3738
  "button",
3655
3739
  {
3656
3740
  type: "button",
@@ -3659,10 +3743,10 @@ function TablePagination({
3659
3743
  "aria-label": "First page",
3660
3744
  "data-testid": testIdPrefix && `${testIdPrefix}-first`,
3661
3745
  className: stepBtn,
3662
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronFirst, { size: 16, "aria-hidden": "true" })
3746
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.ChevronFirst, { size: 16, "aria-hidden": "true" })
3663
3747
  }
3664
3748
  ),
3665
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3749
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3666
3750
  "button",
3667
3751
  {
3668
3752
  type: "button",
@@ -3671,11 +3755,11 @@ function TablePagination({
3671
3755
  "aria-label": "Previous page",
3672
3756
  "data-testid": testIdPrefix && `${testIdPrefix}-prev`,
3673
3757
  className: stepBtn,
3674
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronLeft, { size: 16, "aria-hidden": "true" })
3758
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.ChevronLeft, { size: 16, "aria-hidden": "true" })
3675
3759
  }
3676
3760
  ),
3677
3761
  pageWindow(current, totalPages).map(
3678
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3762
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3679
3763
  "button",
3680
3764
  {
3681
3765
  type: "button",
@@ -3693,7 +3777,7 @@ function TablePagination({
3693
3777
  p
3694
3778
  )
3695
3779
  ),
3696
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3780
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3697
3781
  "button",
3698
3782
  {
3699
3783
  type: "button",
@@ -3702,10 +3786,10 @@ function TablePagination({
3702
3786
  "aria-label": "Next page",
3703
3787
  "data-testid": testIdPrefix && `${testIdPrefix}-next`,
3704
3788
  className: stepBtn,
3705
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronRight, { size: 16, "aria-hidden": "true" })
3789
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.ChevronRight, { size: 16, "aria-hidden": "true" })
3706
3790
  }
3707
3791
  ),
3708
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3792
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3709
3793
  "button",
3710
3794
  {
3711
3795
  type: "button",
@@ -3714,7 +3798,7 @@ function TablePagination({
3714
3798
  "aria-label": "Last page",
3715
3799
  "data-testid": testIdPrefix && `${testIdPrefix}-last`,
3716
3800
  className: stepBtn,
3717
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronLast, { size: 16, "aria-hidden": "true" })
3801
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.ChevronLast, { size: 16, "aria-hidden": "true" })
3718
3802
  }
3719
3803
  )
3720
3804
  ] }),
@@ -3723,9 +3807,9 @@ function TablePagination({
3723
3807
  }
3724
3808
 
3725
3809
  // src/DateRangePicker.tsx
3726
- var import_react16 = require("react");
3810
+ var import_react17 = require("react");
3727
3811
  var import_lucide_react22 = require("lucide-react");
3728
- var import_jsx_runtime38 = require("react/jsx-runtime");
3812
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3729
3813
  var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
3730
3814
  var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
3731
3815
  var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
@@ -3761,7 +3845,7 @@ function spanLabel2(label, today) {
3761
3845
  return `${fmtDate(s)} \u2013 ${fmtDate(e)}`;
3762
3846
  }
3763
3847
  function MiniSelect({ value, onChange, options }) {
3764
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3848
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3765
3849
  "select",
3766
3850
  {
3767
3851
  value: String(value),
@@ -3770,7 +3854,7 @@ function MiniSelect({ value, onChange, options }) {
3770
3854
  if (opt) onChange(opt.value);
3771
3855
  },
3772
3856
  className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-[12px] text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
3773
- children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3857
+ children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3774
3858
  }
3775
3859
  );
3776
3860
  }
@@ -3785,19 +3869,19 @@ function DateRangePicker({
3785
3869
  today,
3786
3870
  years
3787
3871
  }) {
3788
- const end = (0, import_react16.useMemo)(() => today ?? startOfToday(), [today]);
3872
+ const end = (0, import_react17.useMemo)(() => today ?? startOfToday(), [today]);
3789
3873
  const yearOptions = years ?? [3, 2, 1, 0].map((n) => end.getFullYear() - n);
3790
- const [open, setOpen] = (0, import_react16.useState)(false);
3791
- const [value, setValue] = (0, import_react16.useState)(defaultValue);
3792
- const [draft, setDraft] = (0, import_react16.useState)(defaultValue);
3793
- const ref = (0, import_react16.useRef)(null);
3794
- const [fromMo, setFromMo] = (0, import_react16.useState)(end.getMonth());
3795
- const [fromYr, setFromYr] = (0, import_react16.useState)(end.getFullYear() - 1);
3796
- const [toMo, setToMo] = (0, import_react16.useState)(end.getMonth());
3797
- const [toYr, setToYr] = (0, import_react16.useState)(end.getFullYear());
3798
- const [fromQ, setFromQ] = (0, import_react16.useState)(Math.floor(end.getMonth() / 3));
3799
- const [toQ, setToQ] = (0, import_react16.useState)(Math.floor(end.getMonth() / 3));
3800
- (0, import_react16.useEffect)(() => {
3874
+ const [open, setOpen] = (0, import_react17.useState)(false);
3875
+ const [value, setValue] = (0, import_react17.useState)(defaultValue);
3876
+ const [draft, setDraft] = (0, import_react17.useState)(defaultValue);
3877
+ const ref = (0, import_react17.useRef)(null);
3878
+ const [fromMo, setFromMo] = (0, import_react17.useState)(end.getMonth());
3879
+ const [fromYr, setFromYr] = (0, import_react17.useState)(end.getFullYear() - 1);
3880
+ const [toMo, setToMo] = (0, import_react17.useState)(end.getMonth());
3881
+ const [toYr, setToYr] = (0, import_react17.useState)(end.getFullYear());
3882
+ const [fromQ, setFromQ] = (0, import_react17.useState)(Math.floor(end.getMonth() / 3));
3883
+ const [toQ, setToQ] = (0, import_react17.useState)(Math.floor(end.getMonth() / 3));
3884
+ (0, import_react17.useEffect)(() => {
3801
3885
  const [s, e] = resolveRange(value, end);
3802
3886
  onRangeChange?.(s, e);
3803
3887
  }, [value]);
@@ -3805,7 +3889,7 @@ function DateRangePicker({
3805
3889
  if (!open) setDraft(value);
3806
3890
  setOpen((o) => !o);
3807
3891
  };
3808
- (0, import_react16.useEffect)(() => {
3892
+ (0, import_react17.useEffect)(() => {
3809
3893
  if (!open) return;
3810
3894
  const onDown = (e) => {
3811
3895
  if (ref.current && !ref.current.contains(e.target)) setOpen(false);
@@ -3831,8 +3915,8 @@ function DateRangePicker({
3831
3915
  if (showFooter) setDraft(label);
3832
3916
  else commit(label);
3833
3917
  };
3834
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative", ref, children: [
3835
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3918
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative", ref, children: [
3919
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3836
3920
  "button",
3837
3921
  {
3838
3922
  type: "button",
@@ -3841,16 +3925,16 @@ function DateRangePicker({
3841
3925
  "aria-haspopup": "listbox",
3842
3926
  className: chipTriggerClass(),
3843
3927
  children: [
3844
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3845
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel2(value, end) }),
3846
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3928
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3929
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel2(value, end) }),
3930
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3847
3931
  ] }),
3848
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
3932
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
3849
3933
  ]
3850
3934
  }
3851
3935
  ),
3852
- open && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("absolute top-[calc(100%+8px)] z-30 w-[280px] overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
3853
- presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3936
+ open && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("absolute top-[calc(100%+8px)] z-30 w-[280px] overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
3937
+ presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3854
3938
  "button",
3855
3939
  {
3856
3940
  type: "button",
@@ -3860,26 +3944,26 @@ function DateRangePicker({
3860
3944
  },
3861
3945
  p
3862
3946
  )),
3863
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
3864
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "text-[13px] font-semibold text-text-primary", children: "Custom range" }),
3865
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
3866
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3947
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
3948
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-[13px] font-semibold text-text-primary", children: "Custom range" }),
3949
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
3950
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3867
3951
  "From",
3868
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex gap-1", children: [
3869
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3870
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3871
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3952
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex gap-1", children: [
3953
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3954
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3955
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3872
3956
  ] })
3873
3957
  ] }),
3874
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3958
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3875
3959
  "To",
3876
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex gap-1", children: [
3877
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3878
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3879
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3960
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex gap-1", children: [
3961
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3962
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3963
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3880
3964
  ] })
3881
3965
  ] }),
3882
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3966
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3883
3967
  "button",
3884
3968
  {
3885
3969
  type: "button",
@@ -3891,15 +3975,15 @@ function DateRangePicker({
3891
3975
  )
3892
3976
  ] })
3893
3977
  ] }),
3894
- showFooter && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
3978
+ showFooter && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
3895
3979
  ] })
3896
3980
  ] });
3897
3981
  }
3898
3982
 
3899
3983
  // src/MultiSelectFilter.tsx
3900
- var import_react17 = require("react");
3984
+ var import_react18 = require("react");
3901
3985
  var import_lucide_react23 = require("lucide-react");
3902
- var import_jsx_runtime39 = require("react/jsx-runtime");
3986
+ var import_jsx_runtime40 = require("react/jsx-runtime");
3903
3987
  function MultiSelectFilter({
3904
3988
  caption,
3905
3989
  options = [],
@@ -3926,11 +4010,11 @@ function MultiSelectFilter({
3926
4010
  }) {
3927
4011
  const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
3928
4012
  const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
3929
- const [open, setOpen] = (0, import_react17.useState)(false);
3930
- const [q, setQ] = (0, import_react17.useState)("");
3931
- const [draft, setDraft] = (0, import_react17.useState)(selected);
3932
- const ref = (0, import_react17.useRef)(null);
3933
- const close = (0, import_react17.useCallback)(() => {
4013
+ const [open, setOpen] = (0, import_react18.useState)(false);
4014
+ const [q, setQ] = (0, import_react18.useState)("");
4015
+ const [draft, setDraft] = (0, import_react18.useState)(selected);
4016
+ const ref = (0, import_react18.useRef)(null);
4017
+ const close = (0, import_react18.useCallback)(() => {
3934
4018
  setOpen(false);
3935
4019
  setQ("");
3936
4020
  if (showFooter) return;
@@ -3947,7 +4031,7 @@ function MultiSelectFilter({
3947
4031
  setOpen(false);
3948
4032
  setQ("");
3949
4033
  };
3950
- (0, import_react17.useEffect)(() => {
4034
+ (0, import_react18.useEffect)(() => {
3951
4035
  if (!open) return;
3952
4036
  const onKey = (e) => e.key === "Escape" && close();
3953
4037
  const onClick = (e) => {
@@ -3993,8 +4077,8 @@ function MultiSelectFilter({
3993
4077
  const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
3994
4078
  return kids.length ? { ...g, children: kids } : null;
3995
4079
  }).filter((g) => g !== null) : [];
3996
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, children: [
3997
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4080
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, children: [
4081
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
3998
4082
  "button",
3999
4083
  {
4000
4084
  type: "button",
@@ -4002,8 +4086,8 @@ function MultiSelectFilter({
4002
4086
  "aria-expanded": open,
4003
4087
  className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
4004
4088
  children: [
4005
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChipContent, { caption, value, icon }),
4006
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4089
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChipContent, { caption, value, icon }),
4090
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4007
4091
  import_lucide_react23.ChevronDown,
4008
4092
  {
4009
4093
  size: 14,
@@ -4014,7 +4098,7 @@ function MultiSelectFilter({
4014
4098
  ]
4015
4099
  }
4016
4100
  ),
4017
- open && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4101
+ open && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4018
4102
  "div",
4019
4103
  {
4020
4104
  className: cn(
@@ -4024,10 +4108,10 @@ function MultiSelectFilter({
4024
4108
  ),
4025
4109
  role: "dialog",
4026
4110
  "aria-label": caption,
4027
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
4028
- searchable && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
4029
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
4030
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4111
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
4112
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
4113
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
4114
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4031
4115
  "input",
4032
4116
  {
4033
4117
  type: "text",
@@ -4037,37 +4121,37 @@ function MultiSelectFilter({
4037
4121
  className: "h-full flex-1 bg-transparent text-[13px] outline-hidden placeholder:text-text-tertiary"
4038
4122
  }
4039
4123
  ),
4040
- q && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.X, { size: 13 }) })
4124
+ q && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react23.X, { size: 13 }) })
4041
4125
  ] }) }),
4042
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: [
4126
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: [
4043
4127
  groups ? visibleGroups.map((g) => {
4044
4128
  const state = groupState(g);
4045
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
4046
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4129
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
4130
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4047
4131
  "button",
4048
4132
  {
4049
4133
  type: "button",
4050
4134
  onClick: () => toggleGroup(g),
4051
4135
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
4052
4136
  children: [
4053
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
4054
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("flex-1 text-[14px] text-text-primary", !plainParent && "font-semibold"), children: g.label }),
4055
- counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(g.id) })
4137
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
4138
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: cn("flex-1 text-[14px] text-text-primary", !plainParent && "font-semibold"), children: g.label }),
4139
+ counts && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionCount, { n: countFor(g.id) })
4056
4140
  ]
4057
4141
  }
4058
4142
  ),
4059
4143
  g.children.map((c) => {
4060
4144
  const checked = draft.includes(c.id);
4061
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4145
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4062
4146
  "button",
4063
4147
  {
4064
4148
  type: "button",
4065
4149
  onClick: () => toggle(c.id),
4066
4150
  className: "flex w-full items-center gap-2.5 rounded-control py-2 pl-9 pr-2 text-left transition-colors hover:bg-subtle",
4067
4151
  children: [
4068
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CheckBoxBox, { checked }),
4069
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: c.label }),
4070
- counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(c.id) })
4152
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckBoxBox, { checked }),
4153
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: c.label }),
4154
+ counts && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionCount, { n: countFor(c.id) })
4071
4155
  ]
4072
4156
  },
4073
4157
  c.id
@@ -4076,24 +4160,24 @@ function MultiSelectFilter({
4076
4160
  ] }, g.id);
4077
4161
  }) : items.map((o) => {
4078
4162
  const checked = draft.includes(o.id);
4079
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4163
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4080
4164
  "button",
4081
4165
  {
4082
4166
  type: "button",
4083
4167
  onClick: () => toggle(o.id),
4084
4168
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
4085
4169
  children: [
4086
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CheckBoxBox, { checked }),
4087
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: o.label }),
4088
- counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(o.id) })
4170
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckBoxBox, { checked }),
4171
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: o.label }),
4172
+ counts && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionCount, { n: countFor(o.id) })
4089
4173
  ]
4090
4174
  },
4091
4175
  o.id
4092
4176
  );
4093
4177
  }),
4094
- (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "py-6 text-center text-[13px] text-text-tertiary", children: "No matches." })
4178
+ (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "py-6 text-center text-[13px] text-text-tertiary", children: "No matches." })
4095
4179
  ] }),
4096
- showFooter ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FilterDropdownFooter, { onClear: () => setDraft(clearValue), onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4180
+ showFooter ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FilterDropdownFooter, { onClear: () => setDraft(clearValue), onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4097
4181
  "button",
4098
4182
  {
4099
4183
  type: "button",
@@ -4111,7 +4195,7 @@ function MultiSelectFilter({
4111
4195
  ] });
4112
4196
  }
4113
4197
  function OptionCount({ n }) {
4114
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "shrink-0 text-[12px] tabular-nums text-text-tertiary", children: [
4198
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "shrink-0 text-[12px] tabular-nums text-text-tertiary", children: [
4115
4199
  "(",
4116
4200
  n.toLocaleString(),
4117
4201
  ")"
@@ -4119,7 +4203,7 @@ function OptionCount({ n }) {
4119
4203
  }
4120
4204
 
4121
4205
  // src/Toggle.tsx
4122
- var import_jsx_runtime40 = require("react/jsx-runtime");
4206
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4123
4207
  var SIZES2 = {
4124
4208
  sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-[18px]" },
4125
4209
  md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-[22px]" }
@@ -4127,7 +4211,7 @@ var SIZES2 = {
4127
4211
  var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
4128
4212
  function Toggle({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }) {
4129
4213
  const s = SIZES2[size];
4130
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4214
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4131
4215
  "button",
4132
4216
  {
4133
4217
  type: "button",
@@ -4145,7 +4229,7 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
4145
4229
  disabled && "cursor-not-allowed opacity-50",
4146
4230
  className
4147
4231
  ),
4148
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4232
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4149
4233
  "span",
4150
4234
  {
4151
4235
  className: cn(
@@ -4160,22 +4244,22 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
4160
4244
  }
4161
4245
 
4162
4246
  // src/AISpark.tsx
4163
- var import_react18 = require("react");
4247
+ var import_react19 = require("react");
4164
4248
  var import_lucide_react24 = require("lucide-react");
4165
- var import_jsx_runtime41 = require("react/jsx-runtime");
4249
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4166
4250
  function AISpark({ size = 16, className }) {
4167
- const id = (0, import_react18.useId)();
4168
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
4169
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4170
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4171
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "100%", className: "[stop-color:#9474ff] in-data-[theme=dark]:[stop-color:#a488ff]" })
4251
+ const id = (0, import_react19.useId)();
4252
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
4253
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4254
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4255
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "100%", className: "[stop-color:#9474ff] in-data-[theme=dark]:[stop-color:#a488ff]" })
4172
4256
  ] }) }) }),
4173
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.Sparkles, { size, stroke: `url(#${id})`, className, "aria-hidden": "true" })
4257
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.Sparkles, { size, stroke: `url(#${id})`, className, "aria-hidden": "true" })
4174
4258
  ] });
4175
4259
  }
4176
4260
 
4177
4261
  // src/Freshness.tsx
4178
- var import_jsx_runtime42 = require("react/jsx-runtime");
4262
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4179
4263
  var dotColor = {
4180
4264
  fresh: "bg-status-success",
4181
4265
  recent: "bg-status-warning",
@@ -4187,7 +4271,7 @@ var srLabel = {
4187
4271
  stale: "Older than a day"
4188
4272
  };
4189
4273
  function Freshness({ level }) {
4190
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4274
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4191
4275
  "span",
4192
4276
  {
4193
4277
  className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level]),
@@ -4198,47 +4282,47 @@ function Freshness({ level }) {
4198
4282
  }
4199
4283
 
4200
4284
  // src/SectionHeading.tsx
4201
- var import_jsx_runtime43 = require("react/jsx-runtime");
4285
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4202
4286
  function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className }) {
4203
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), children: [
4204
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
4205
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
4206
- description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
4287
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), children: [
4288
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0", children: [
4289
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
4290
+ description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
4207
4291
  ] }),
4208
- actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4292
+ actions && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4209
4293
  ] });
4210
4294
  }
4211
4295
 
4212
4296
  // src/PageHeader.tsx
4213
4297
  var import_lucide_react25 = require("lucide-react");
4214
- var import_jsx_runtime44 = require("react/jsx-runtime");
4298
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4215
4299
  function PageHeader({ title, description, actions, back, className }) {
4216
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4217
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0", children: [
4218
- back && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4300
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4301
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "min-w-0", children: [
4302
+ back && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4219
4303
  "a",
4220
4304
  {
4221
4305
  href: back.href ?? "#",
4222
4306
  onClick: back.onClick,
4223
4307
  className: "mb-1.5 inline-flex items-center gap-1.5 rounded-control text-micro font-semibold uppercase tracking-wider text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4224
4308
  children: [
4225
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4309
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4226
4310
  back.label
4227
4311
  ]
4228
4312
  }
4229
4313
  ),
4230
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4231
- description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4314
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4315
+ description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4232
4316
  ] }),
4233
- actions && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4317
+ actions && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4234
4318
  ] });
4235
4319
  }
4236
4320
 
4237
4321
  // src/Modal.tsx
4238
- var import_react19 = require("react");
4322
+ var import_react20 = require("react");
4239
4323
  var import_react_dom7 = require("react-dom");
4240
4324
  var import_lucide_react26 = require("lucide-react");
4241
- var import_jsx_runtime45 = require("react/jsx-runtime");
4325
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4242
4326
  var WIDTH = {
4243
4327
  sm: "max-w-110",
4244
4328
  md: "max-w-160",
@@ -4249,12 +4333,12 @@ var WIDTH = {
4249
4333
  };
4250
4334
  var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
4251
4335
  function Modal({ open, onClose, title, description, size = "md", footer, children, className }) {
4252
- const titleId = (0, import_react19.useId)();
4253
- const descId = (0, import_react19.useId)();
4254
- const panel = (0, import_react19.useRef)(null);
4255
- const close = (0, import_react19.useRef)(onClose);
4336
+ const titleId = (0, import_react20.useId)();
4337
+ const descId = (0, import_react20.useId)();
4338
+ const panel = (0, import_react20.useRef)(null);
4339
+ const close = (0, import_react20.useRef)(onClose);
4256
4340
  close.current = onClose;
4257
- (0, import_react19.useEffect)(() => {
4341
+ (0, import_react20.useEffect)(() => {
4258
4342
  if (!open) return;
4259
4343
  const opener = document.activeElement;
4260
4344
  const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE) ?? null;
@@ -4289,12 +4373,12 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4289
4373
  }, [open]);
4290
4374
  if (!open || typeof document === "undefined") return null;
4291
4375
  return (0, import_react_dom7.createPortal)(
4292
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4376
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4293
4377
  "div",
4294
4378
  {
4295
4379
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4 py-6",
4296
4380
  onMouseDown: (e) => e.target === e.currentTarget && onClose(),
4297
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4381
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4298
4382
  "div",
4299
4383
  {
4300
4384
  ref: panel,
@@ -4309,24 +4393,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4309
4393
  className
4310
4394
  ),
4311
4395
  children: [
4312
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4313
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "min-w-0 flex-1", children: [
4314
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4315
- description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4396
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4397
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "min-w-0 flex-1", children: [
4398
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4399
+ description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4316
4400
  ] }),
4317
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4401
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4318
4402
  "button",
4319
4403
  {
4320
4404
  type: "button",
4321
4405
  onClick: onClose,
4322
4406
  "aria-label": "Close",
4323
4407
  className: "-mr-1.5 -mt-1 flex size-8 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4324
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4408
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4325
4409
  }
4326
4410
  )
4327
4411
  ] }),
4328
- children && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
4329
- footer && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
4412
+ children && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
4413
+ footer && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
4330
4414
  ]
4331
4415
  }
4332
4416
  )
@@ -4337,10 +4421,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4337
4421
  }
4338
4422
 
4339
4423
  // src/EmptyState.tsx
4340
- var import_jsx_runtime46 = require("react/jsx-runtime");
4424
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4341
4425
  function EmptyState({ icon, title, description, action, size = "sm", className }) {
4342
4426
  const md = size === "md";
4343
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4427
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4344
4428
  "div",
4345
4429
  {
4346
4430
  className: cn(
@@ -4349,7 +4433,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4349
4433
  className
4350
4434
  ),
4351
4435
  children: [
4352
- icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4436
+ icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4353
4437
  "span",
4354
4438
  {
4355
4439
  "aria-hidden": "true",
@@ -4360,105 +4444,14 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4360
4444
  children: icon
4361
4445
  }
4362
4446
  ),
4363
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4364
- description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4365
- action && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4447
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4448
+ description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4449
+ action && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4366
4450
  ]
4367
4451
  }
4368
4452
  );
4369
4453
  }
4370
4454
 
4371
- // src/Tabs.tsx
4372
- var import_react20 = require("react");
4373
- var import_jsx_runtime47 = require("react/jsx-runtime");
4374
- function arrowKeys(e, row) {
4375
- if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
4376
- const items = Array.from(row.querySelectorAll("button:not([disabled])"));
4377
- const at = items.indexOf(document.activeElement);
4378
- const next = e.key === "Home" ? 0 : e.key === "End" ? items.length - 1 : (at + (e.key === "ArrowRight" ? 1 : -1) + items.length) % items.length;
4379
- e.preventDefault();
4380
- items[next]?.focus();
4381
- items[next]?.click();
4382
- }
4383
- function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest }) {
4384
- const row = (0, import_react20.useRef)(null);
4385
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4386
- "div",
4387
- {
4388
- ref: row,
4389
- role: "tablist",
4390
- "aria-label": rest["aria-label"],
4391
- onKeyDown: (e) => arrowKeys(e, row.current),
4392
- className: cn("flex gap-6 border-b border-border-default", className),
4393
- children: items.map((item) => {
4394
- const on = item.value === value;
4395
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4396
- "button",
4397
- {
4398
- type: "button",
4399
- role: "tab",
4400
- id: `${idPrefix}-tab-${item.value}`,
4401
- "aria-controls": `${idPrefix}-panel-${item.value}`,
4402
- "aria-selected": on,
4403
- tabIndex: on ? 0 : -1,
4404
- disabled: item.disabled,
4405
- onClick: () => onChange(item.value),
4406
- className: cn(
4407
- "-mb-px flex items-center gap-1.5 border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:opacity-50",
4408
- on ? "border-brand-primaryAction font-semibold text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"
4409
- ),
4410
- children: [
4411
- item.label,
4412
- item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
4413
- ]
4414
- },
4415
- item.value
4416
- );
4417
- })
4418
- }
4419
- );
4420
- }
4421
- function SegmentedControl({
4422
- options,
4423
- value,
4424
- onChange,
4425
- size = "sm",
4426
- className,
4427
- ...rest
4428
- }) {
4429
- const row = (0, import_react20.useRef)(null);
4430
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4431
- "div",
4432
- {
4433
- ref: row,
4434
- role: "radiogroup",
4435
- "aria-label": rest["aria-label"],
4436
- onKeyDown: (e) => arrowKeys(e, row.current),
4437
- className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
4438
- children: options.map((o) => {
4439
- const on = o.value === value;
4440
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4441
- "button",
4442
- {
4443
- type: "button",
4444
- role: "radio",
4445
- "aria-checked": on,
4446
- tabIndex: on ? 0 : -1,
4447
- onClick: () => onChange(o.value),
4448
- className: cn(
4449
- "rounded-full px-3 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
4450
- size === "md" ? "text-sm" : "text-xs",
4451
- on ? "bg-surface font-semibold text-text-primary shadow-raised" : "text-text-secondary hover:text-text-primary"
4452
- ),
4453
- children: o.label
4454
- },
4455
- o.value
4456
- );
4457
- })
4458
- }
4459
- );
4460
- }
4461
-
4462
4455
  // src/TextField.tsx
4463
4456
  var import_react21 = require("react");
4464
4457
  var import_jsx_runtime48 = require("react/jsx-runtime");