@mediaradar/design-components 0.20.0 → 0.22.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
@@ -37,11 +37,13 @@ __export(index_exports, {
37
37
  DateRangeFilter: () => DateRangeFilter,
38
38
  DateRangePicker: () => DateRangePicker,
39
39
  Delta: () => Delta,
40
+ EmptyState: () => EmptyState,
40
41
  FilterChipBar: () => FilterChipBar,
41
42
  FilterDropdownFooter: () => FilterDropdownFooter,
42
43
  Freshness: () => Freshness,
43
44
  InfoTip: () => InfoTip,
44
45
  LineChartPlaceholder: () => LineChartPlaceholder,
46
+ Modal: () => Modal,
45
47
  MultiSelectFilter: () => MultiSelectFilter,
46
48
  NO_RESULTS_BODY: () => NO_RESULTS_BODY,
47
49
  NO_RESULTS_TITLE: () => NO_RESULTS_TITLE,
@@ -56,6 +58,7 @@ __export(index_exports, {
56
58
  SearchBar: () => SearchBar,
57
59
  SectionHeading: () => SectionHeading,
58
60
  SectionRail: () => SectionRail,
61
+ SegmentedControl: () => SegmentedControl,
59
62
  SelectAllVisible: () => SelectAllVisible,
60
63
  SelectFilter: () => SelectFilter,
61
64
  SelectedSection: () => SelectedSection,
@@ -63,7 +66,9 @@ __export(index_exports, {
63
66
  SortButton: () => SortButton,
64
67
  StackedColumnPlaceholder: () => StackedColumnPlaceholder,
65
68
  TablePagination: () => TablePagination,
69
+ Tabs: () => Tabs,
66
70
  Tag: () => Tag,
71
+ TextField: () => TextField,
67
72
  Toast: () => Toast,
68
73
  Toggle: () => Toggle,
69
74
  Tooltip: () => Tooltip,
@@ -312,7 +317,7 @@ function AdvertiserQuickFilter({
312
317
  "aria-label": caption,
313
318
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
314
319
  children: [
315
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:border-border-focus focus-within:ring-2 focus-within:ring-border-focus/30", children: [
320
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.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: [
316
321
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
317
322
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
318
323
  "input",
@@ -991,6 +996,7 @@ function NavBtn({ children, onClick, ...rest }) {
991
996
  var import_react4 = require("react");
992
997
  var import_lucide_react7 = require("lucide-react");
993
998
  var import_jsx_runtime8 = require("react/jsx-runtime");
999
+ var HEIGHT = { sm: "h-8", md: "h-10", lg: "h-11" };
994
1000
  var DEFAULT_SEARCH_MATCH = { mode: "anyWord", wordJoin: "Or" };
995
1001
  var MODE_LABEL = {
996
1002
  anyWord: "Any Word",
@@ -1006,6 +1012,7 @@ function SearchBar({
1006
1012
  value,
1007
1013
  onChange,
1008
1014
  variant = "default",
1015
+ size = "lg",
1009
1016
  matchValue,
1010
1017
  onMatchChange,
1011
1018
  className,
@@ -1013,6 +1020,7 @@ function SearchBar({
1013
1020
  }) {
1014
1021
  const [open, setOpen] = (0, import_react4.useState)(false);
1015
1022
  const ref = (0, import_react4.useRef)(null);
1023
+ const input = (0, import_react4.useRef)(null);
1016
1024
  (0, import_react4.useEffect)(() => {
1017
1025
  if (!open) return;
1018
1026
  const onKey = (e) => e.key === "Escape" && setOpen(false);
@@ -1031,7 +1039,8 @@ function SearchBar({
1031
1039
  "div",
1032
1040
  {
1033
1041
  className: cx2(
1034
- "flex h-11 min-w-[200px] flex-1 items-stretch rounded-control border border-border-strong bg-input",
1042
+ "flex min-w-[200px] flex-1 items-stretch rounded-control border border-border-strong bg-input focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus",
1043
+ HEIGHT[size],
1035
1044
  className
1036
1045
  ),
1037
1046
  children: [
@@ -1040,16 +1049,31 @@ function SearchBar({
1040
1049
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1041
1050
  "input",
1042
1051
  {
1052
+ ref: input,
1043
1053
  type: "text",
1044
1054
  value,
1045
1055
  onChange: (e) => onChange?.(e.target.value),
1046
1056
  placeholder,
1047
1057
  "aria-label": placeholder,
1048
1058
  "data-testid": testIdPrefix && `${testIdPrefix}-search`,
1049
- className: "min-w-0 flex-1 bg-transparent text-[13px] text-text-primary outline-hidden placeholder:text-text-tertiary"
1059
+ className: "min-w-0 flex-1 bg-transparent text-dense text-text-primary outline-hidden placeholder:text-text-tertiary"
1050
1060
  }
1051
1061
  )
1052
1062
  ] }),
1063
+ value && onChange && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1064
+ "button",
1065
+ {
1066
+ type: "button",
1067
+ onClick: () => {
1068
+ onChange("");
1069
+ input.current?.focus();
1070
+ },
1071
+ "aria-label": "Clear search",
1072
+ "data-testid": testIdPrefix && `${testIdPrefix}-clear`,
1073
+ className: "mr-1.5 flex size-6 shrink-0 items-center justify-center self-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-border-focus",
1074
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.X, { size: 14, "aria-hidden": "true" })
1075
+ }
1076
+ ),
1053
1077
  showMatch && // border-border-default, not the bare `border-border` both source
1054
1078
  // implementations used -- confirmed by actually compiling against
1055
1079
  // @mediaradar/design-tokens' real published theme.css (not assumed):
@@ -2401,7 +2425,7 @@ function SelectionPicker({
2401
2425
  }) }),
2402
2426
  source === "search" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2403
2427
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-9 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3", children: [
2428
+ /* @__PURE__ */ (0, import_jsx_runtime24.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: [
2405
2429
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2406
2430
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2407
2431
  "input",
@@ -2715,7 +2739,7 @@ function FilterDropdown({
2715
2739
  onClick: () => setOpen((v) => !v),
2716
2740
  "aria-expanded": open,
2717
2741
  "data-testid": testIdPrefix && `${testIdPrefix}-filter-${filterSlug}`,
2718
- className: "inline-flex h-9 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",
2742
+ 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",
2719
2743
  children: [
2720
2744
  label,
2721
2745
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
@@ -2921,7 +2945,10 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
2921
2945
  size: {
2922
2946
  xs: "h-6 px-2 text-xs",
2923
2947
  sm: "h-8 px-3 text-sm",
2924
- md: "h-10 px-4 text-sm"
2948
+ md: "h-10 px-4 text-sm",
2949
+ // 44, the filter row's height, so a button at the end of a row of
2950
+ // filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
2951
+ lg: "h-11 px-5 text-sm"
2925
2952
  },
2926
2953
  // Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
2927
2954
  // be one dimension, so an icon button never lined up with the labelled
@@ -2936,6 +2963,7 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
2936
2963
  { size: "xs", iconOnly: true, class: "w-6" },
2937
2964
  { size: "sm", iconOnly: true, class: "w-8" },
2938
2965
  { size: "md", iconOnly: true, class: "w-10" },
2966
+ { size: "lg", iconOnly: true, class: "w-11" },
2939
2967
  // A boxed button is a target you aim at, so its label carries the weight
2940
2968
  // of one. `link` sits inline in a sentence, where semibold reads as
2941
2969
  // emphasis on the words rather than as a control.
@@ -3049,7 +3077,7 @@ function NameListModal({
3049
3077
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3050
3078
  "div",
3051
3079
  {
3052
- className: "fixed inset-0 z-70 flex items-center justify-center bg-scrim px-4",
3080
+ className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
3053
3081
  onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
3054
3082
  children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3055
3083
  "div",
@@ -3059,7 +3087,7 @@ function NameListModal({
3059
3087
  "aria-modal": "true",
3060
3088
  "aria-labelledby": titleId,
3061
3089
  onKeyDown: trapTab,
3062
- className: "w-full max-w-[420px] rounded-card border border-border-default bg-surface p-5 shadow-overlay",
3090
+ className: "w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay",
3063
3091
  children: [
3064
3092
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3065
3093
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
@@ -3072,7 +3100,7 @@ function NameListModal({
3072
3100
  value: name,
3073
3101
  onChange: (e) => setName(e.target.value),
3074
3102
  placeholder,
3075
- className: "h-10 rounded-control border border-border-strong bg-input px-3 text-sm outline-hidden focus:border-brand-primaryAction"
3103
+ className: "h-10 rounded-control border border-border-strong bg-input px-3 text-dense focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus"
3076
3104
  }
3077
3105
  )
3078
3106
  ] }),
@@ -3273,17 +3301,17 @@ function pageWindow(current, total) {
3273
3301
  }
3274
3302
  return out;
3275
3303
  }
3276
- function Pager({ page, totalPages, onPage }) {
3277
- const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors";
3304
+ function Pager({ page, totalPages, onPage, disabled = false }) {
3305
+ 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";
3278
3306
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-1", children: [
3279
3307
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3280
3308
  "button",
3281
3309
  {
3282
3310
  type: "button",
3283
3311
  onClick: () => onPage(page - 1),
3284
- disabled: page === 1,
3312
+ disabled: disabled || page === 1,
3285
3313
  "aria-label": "Previous page",
3286
- className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary disabled:pointer-events-none disabled:opacity-30"),
3314
+ className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3287
3315
  children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3288
3316
  }
3289
3317
  ),
@@ -3293,6 +3321,7 @@ function Pager({ page, totalPages, onPage }) {
3293
3321
  {
3294
3322
  type: "button",
3295
3323
  onClick: () => onPage(p),
3324
+ disabled,
3296
3325
  "aria-current": p === page ? "page" : void 0,
3297
3326
  className: cn(
3298
3327
  btn,
@@ -3308,9 +3337,9 @@ function Pager({ page, totalPages, onPage }) {
3308
3337
  {
3309
3338
  type: "button",
3310
3339
  onClick: () => onPage(page + 1),
3311
- disabled: page === totalPages,
3340
+ disabled: disabled || page === totalPages,
3312
3341
  "aria-label": "Next page",
3313
- className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary disabled:pointer-events-none disabled:opacity-30"),
3342
+ className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3314
3343
  children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3315
3344
  }
3316
3345
  )
@@ -3454,6 +3483,7 @@ function TablePagination({
3454
3483
  onPerPageChange,
3455
3484
  perPageOptions = [25, 50, 100],
3456
3485
  itemLabel = "results",
3486
+ disabled = false,
3457
3487
  className,
3458
3488
  testIdPrefix
3459
3489
  }) {
@@ -3462,21 +3492,32 @@ function TablePagination({
3462
3492
  const rangeStart = totalItems === 0 ? 0 : (current - 1) * perPage + 1;
3463
3493
  const rangeEnd = Math.min(current * perPage, totalItems);
3464
3494
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors";
3465
- const stepBtn = cn(
3466
- btn,
3467
- "text-text-secondary hover:bg-subtle hover:text-text-primary disabled:pointer-events-none disabled:opacity-30"
3468
- );
3495
+ const off = "disabled:pointer-events-none disabled:opacity-30";
3496
+ const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
3497
+ const range = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-[13px] text-text-tertiary tabular-nums", children: [
3498
+ rangeStart.toLocaleString(),
3499
+ " \u2013 ",
3500
+ rangeEnd.toLocaleString(),
3501
+ " of ",
3502
+ totalItems.toLocaleString(),
3503
+ " ",
3504
+ itemLabel
3505
+ ] });
3469
3506
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3470
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-2 text-[13px] text-text-secondary", children: [
3507
+ onPerPageChange ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-2 text-[13px] text-text-secondary", children: [
3471
3508
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "relative", children: [
3472
3509
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3473
3510
  "select",
3474
3511
  {
3475
3512
  value: perPage,
3476
3513
  onChange: (e) => onPerPageChange(Number(e.target.value)),
3514
+ disabled,
3477
3515
  "aria-label": "Items per page",
3478
3516
  "data-testid": testIdPrefix && `${testIdPrefix}-per-page`,
3479
- className: "appearance-none rounded-control border border-border-strong bg-input py-1 pl-2.5 pr-7 text-[13px] font-medium text-text-primary focus:outline focus:outline-2 focus:outline-border-focus",
3517
+ className: cn(
3518
+ "appearance-none rounded-control border border-border-strong bg-input py-1 pl-2.5 pr-7 text-[13px] font-medium text-text-primary focus:outline focus:outline-2 focus:outline-border-focus",
3519
+ off
3520
+ ),
3480
3521
  children: perPageOptions.map((n) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: n, children: n }, n))
3481
3522
  }
3482
3523
  ),
@@ -3490,14 +3531,14 @@ function TablePagination({
3490
3531
  )
3491
3532
  ] }),
3492
3533
  "items per page"
3493
- ] }),
3534
+ ] }) : range,
3494
3535
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3495
3536
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3496
3537
  "button",
3497
3538
  {
3498
3539
  type: "button",
3499
3540
  onClick: () => onPageChange(1),
3500
- disabled: current === 1,
3541
+ disabled: disabled || current === 1,
3501
3542
  "aria-label": "First page",
3502
3543
  "data-testid": testIdPrefix && `${testIdPrefix}-first`,
3503
3544
  className: stepBtn,
@@ -3509,7 +3550,7 @@ function TablePagination({
3509
3550
  {
3510
3551
  type: "button",
3511
3552
  onClick: () => onPageChange(current - 1),
3512
- disabled: current === 1,
3553
+ disabled: disabled || current === 1,
3513
3554
  "aria-label": "Previous page",
3514
3555
  "data-testid": testIdPrefix && `${testIdPrefix}-prev`,
3515
3556
  className: stepBtn,
@@ -3523,9 +3564,11 @@ function TablePagination({
3523
3564
  type: "button",
3524
3565
  "data-testid": testIdPrefix && `${testIdPrefix}-page-${p}`,
3525
3566
  onClick: () => onPageChange(p),
3567
+ disabled,
3526
3568
  "aria-current": p === current ? "page" : void 0,
3527
3569
  className: cn(
3528
3570
  btn,
3571
+ off,
3529
3572
  p === current ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3530
3573
  ),
3531
3574
  children: p
@@ -3538,7 +3581,7 @@ function TablePagination({
3538
3581
  {
3539
3582
  type: "button",
3540
3583
  onClick: () => onPageChange(current + 1),
3541
- disabled: current === totalPages,
3584
+ disabled: disabled || current === totalPages,
3542
3585
  "aria-label": "Next page",
3543
3586
  "data-testid": testIdPrefix && `${testIdPrefix}-next`,
3544
3587
  className: stepBtn,
@@ -3550,7 +3593,7 @@ function TablePagination({
3550
3593
  {
3551
3594
  type: "button",
3552
3595
  onClick: () => onPageChange(totalPages),
3553
- disabled: current === totalPages,
3596
+ disabled: disabled || current === totalPages,
3554
3597
  "aria-label": "Last page",
3555
3598
  "data-testid": testIdPrefix && `${testIdPrefix}-last`,
3556
3599
  className: stepBtn,
@@ -3558,15 +3601,7 @@ function TablePagination({
3558
3601
  }
3559
3602
  )
3560
3603
  ] }),
3561
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-[13px] text-text-tertiary tabular-nums", children: [
3562
- rangeStart.toLocaleString(),
3563
- " \u2013 ",
3564
- rangeEnd.toLocaleString(),
3565
- " of ",
3566
- totalItems.toLocaleString(),
3567
- " ",
3568
- itemLabel
3569
- ] })
3604
+ onPerPageChange && range
3570
3605
  ] });
3571
3606
  }
3572
3607
 
@@ -3617,7 +3652,7 @@ function MiniSelect({ value, onChange, options }) {
3617
3652
  const opt = options.find((o) => String(o.value) === e.target.value);
3618
3653
  if (opt) onChange(opt.value);
3619
3654
  },
3620
- className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-[12px] text-text-primary outline-hidden focus:border-border-focus",
3655
+ 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",
3621
3656
  children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3622
3657
  }
3623
3658
  );
@@ -3870,7 +3905,7 @@ function MultiSelectFilter({
3870
3905
  role: "dialog",
3871
3906
  "aria-label": caption,
3872
3907
  children: [
3873
- searchable && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
3908
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.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: [
3874
3909
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
3875
3910
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3876
3911
  "input",
@@ -4080,16 +4115,294 @@ function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, clas
4080
4115
  }
4081
4116
 
4082
4117
  // src/PageHeader.tsx
4118
+ var import_lucide_react25 = require("lucide-react");
4083
4119
  var import_jsx_runtime43 = require("react/jsx-runtime");
4084
- function PageHeader({ title, description, actions, className }) {
4120
+ function PageHeader({ title, description, actions, back, className }) {
4085
4121
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4086
4122
  /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
4123
+ back && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4124
+ "a",
4125
+ {
4126
+ href: back.href ?? "#",
4127
+ onClick: back.onClick,
4128
+ 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",
4129
+ children: [
4130
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4131
+ back.label
4132
+ ]
4133
+ }
4134
+ ),
4087
4135
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4088
4136
  description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4089
4137
  ] }),
4090
4138
  actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4091
4139
  ] });
4092
4140
  }
4141
+
4142
+ // src/Modal.tsx
4143
+ var import_react19 = require("react");
4144
+ var import_react_dom7 = require("react-dom");
4145
+ var import_lucide_react26 = require("lucide-react");
4146
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4147
+ var WIDTH = {
4148
+ sm: "max-w-110",
4149
+ md: "max-w-160",
4150
+ lg: "max-w-220"
4151
+ };
4152
+ var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
4153
+ function Modal({ open, onClose, title, description, size = "md", footer, children, className }) {
4154
+ const titleId = (0, import_react19.useId)();
4155
+ const descId = (0, import_react19.useId)();
4156
+ const panel = (0, import_react19.useRef)(null);
4157
+ const close = (0, import_react19.useRef)(onClose);
4158
+ close.current = onClose;
4159
+ (0, import_react19.useEffect)(() => {
4160
+ if (!open) return;
4161
+ const opener = document.activeElement;
4162
+ const first = panel.current?.querySelector(`[data-modal-body] :is(${FOCUSABLE})`) ?? panel.current?.querySelector(`[data-modal-footer] :is(${FOCUSABLE})`);
4163
+ (first ?? panel.current)?.focus();
4164
+ const overflow = document.body.style.overflow;
4165
+ document.body.style.overflow = "hidden";
4166
+ const onKey = (e) => {
4167
+ if (e.key === "Escape") {
4168
+ e.stopPropagation();
4169
+ close.current();
4170
+ return;
4171
+ }
4172
+ if (e.key !== "Tab" || !panel.current) return;
4173
+ const items = Array.from(panel.current.querySelectorAll(FOCUSABLE));
4174
+ if (items.length === 0) return;
4175
+ const [head, tail] = [items[0], items[items.length - 1]];
4176
+ if (e.shiftKey && document.activeElement === head) {
4177
+ e.preventDefault();
4178
+ tail.focus();
4179
+ } else if (!e.shiftKey && document.activeElement === tail) {
4180
+ e.preventDefault();
4181
+ head.focus();
4182
+ }
4183
+ };
4184
+ document.addEventListener("keydown", onKey);
4185
+ return () => {
4186
+ document.removeEventListener("keydown", onKey);
4187
+ document.body.style.overflow = overflow;
4188
+ opener?.focus?.();
4189
+ };
4190
+ }, [open]);
4191
+ if (!open || typeof document === "undefined") return null;
4192
+ return (0, import_react_dom7.createPortal)(
4193
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4194
+ "div",
4195
+ {
4196
+ className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4 py-6",
4197
+ onMouseDown: (e) => e.target === e.currentTarget && onClose(),
4198
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4199
+ "div",
4200
+ {
4201
+ ref: panel,
4202
+ role: "dialog",
4203
+ "aria-modal": "true",
4204
+ "aria-labelledby": titleId,
4205
+ "aria-describedby": description ? descId : void 0,
4206
+ tabIndex: -1,
4207
+ className: cn(
4208
+ "flex max-h-full w-full flex-col rounded-card border border-border-default bg-surface shadow-overlay outline-hidden",
4209
+ WIDTH[size],
4210
+ className
4211
+ ),
4212
+ children: [
4213
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4214
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0 flex-1", children: [
4215
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4216
+ description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4217
+ ] }),
4218
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4219
+ "button",
4220
+ {
4221
+ type: "button",
4222
+ onClick: onClose,
4223
+ "aria-label": "Close",
4224
+ 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",
4225
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4226
+ }
4227
+ )
4228
+ ] }),
4229
+ children && /* @__PURE__ */ (0, import_jsx_runtime44.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 }),
4230
+ footer && /* @__PURE__ */ (0, import_jsx_runtime44.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 })
4231
+ ]
4232
+ }
4233
+ )
4234
+ }
4235
+ ),
4236
+ document.body
4237
+ );
4238
+ }
4239
+
4240
+ // src/EmptyState.tsx
4241
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4242
+ function EmptyState({ icon, title, description, action, size = "sm", className }) {
4243
+ const md = size === "md";
4244
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4245
+ "div",
4246
+ {
4247
+ className: cn(
4248
+ "flex flex-col items-center text-center",
4249
+ md ? "gap-2 px-6 py-16" : "gap-1.5 px-4 py-8",
4250
+ className
4251
+ ),
4252
+ children: [
4253
+ icon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4254
+ "span",
4255
+ {
4256
+ "aria-hidden": "true",
4257
+ className: cn(
4258
+ "flex items-center justify-center text-text-tertiary",
4259
+ md && "mb-1 size-11 rounded-full bg-subtle"
4260
+ ),
4261
+ children: icon
4262
+ }
4263
+ ),
4264
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4265
+ description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4266
+ action && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4267
+ ]
4268
+ }
4269
+ );
4270
+ }
4271
+
4272
+ // src/Tabs.tsx
4273
+ var import_react20 = require("react");
4274
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4275
+ function arrowKeys(e, row) {
4276
+ if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
4277
+ const items = Array.from(row.querySelectorAll("button:not([disabled])"));
4278
+ const at = items.indexOf(document.activeElement);
4279
+ const next = e.key === "Home" ? 0 : e.key === "End" ? items.length - 1 : (at + (e.key === "ArrowRight" ? 1 : -1) + items.length) % items.length;
4280
+ e.preventDefault();
4281
+ items[next]?.focus();
4282
+ items[next]?.click();
4283
+ }
4284
+ function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest }) {
4285
+ const row = (0, import_react20.useRef)(null);
4286
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4287
+ "div",
4288
+ {
4289
+ ref: row,
4290
+ role: "tablist",
4291
+ "aria-label": rest["aria-label"],
4292
+ onKeyDown: (e) => arrowKeys(e, row.current),
4293
+ className: cn("flex gap-6 border-b border-border-default", className),
4294
+ children: items.map((item) => {
4295
+ const on = item.value === value;
4296
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4297
+ "button",
4298
+ {
4299
+ type: "button",
4300
+ role: "tab",
4301
+ id: `${idPrefix}-tab-${item.value}`,
4302
+ "aria-controls": `${idPrefix}-panel-${item.value}`,
4303
+ "aria-selected": on,
4304
+ tabIndex: on ? 0 : -1,
4305
+ disabled: item.disabled,
4306
+ onClick: () => onChange(item.value),
4307
+ className: cn(
4308
+ "-mb-px flex items-center gap-1.5 rounded-control 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",
4309
+ on ? "border-brand-primaryAction font-semibold text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"
4310
+ ),
4311
+ children: [
4312
+ item.label,
4313
+ item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
4314
+ ]
4315
+ },
4316
+ item.value
4317
+ );
4318
+ })
4319
+ }
4320
+ );
4321
+ }
4322
+ function SegmentedControl({
4323
+ options,
4324
+ value,
4325
+ onChange,
4326
+ size = "sm",
4327
+ className,
4328
+ ...rest
4329
+ }) {
4330
+ const row = (0, import_react20.useRef)(null);
4331
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4332
+ "div",
4333
+ {
4334
+ ref: row,
4335
+ role: "radiogroup",
4336
+ "aria-label": rest["aria-label"],
4337
+ onKeyDown: (e) => arrowKeys(e, row.current),
4338
+ className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
4339
+ children: options.map((o) => {
4340
+ const on = o.value === value;
4341
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4342
+ "button",
4343
+ {
4344
+ type: "button",
4345
+ role: "radio",
4346
+ "aria-checked": on,
4347
+ tabIndex: on ? 0 : -1,
4348
+ onClick: () => onChange(o.value),
4349
+ className: cn(
4350
+ "rounded-full px-3 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
4351
+ size === "md" ? "text-sm" : "text-xs",
4352
+ on ? "bg-surface font-semibold text-text-primary shadow-raised" : "text-text-secondary hover:text-text-primary"
4353
+ ),
4354
+ children: o.label
4355
+ },
4356
+ o.value
4357
+ );
4358
+ })
4359
+ }
4360
+ );
4361
+ }
4362
+
4363
+ // src/TextField.tsx
4364
+ var import_react21 = require("react");
4365
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4366
+ var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
4367
+ var TextField = (0, import_react21.forwardRef)(
4368
+ ({ label, hint, error, size = "md", icon, className, id, disabled, ...props }, ref) => {
4369
+ const auto = (0, import_react21.useId)();
4370
+ const fieldId = id ?? auto;
4371
+ const noteId = `${fieldId}-note`;
4372
+ const note = error ?? hint;
4373
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), children: [
4374
+ label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
4375
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4376
+ "div",
4377
+ {
4378
+ className: cn(
4379
+ "flex items-center gap-2 rounded-control border bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus",
4380
+ HEIGHT2[size],
4381
+ error ? "border-status-danger" : "border-border-strong",
4382
+ disabled && "opacity-50"
4383
+ ),
4384
+ children: [
4385
+ icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
4386
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4387
+ "input",
4388
+ {
4389
+ ref,
4390
+ id: fieldId,
4391
+ disabled,
4392
+ "aria-invalid": error ? true : void 0,
4393
+ "aria-describedby": note ? noteId : void 0,
4394
+ className: "min-w-0 flex-1 bg-transparent text-dense text-text-primary outline-hidden placeholder:text-text-tertiary",
4395
+ ...props
4396
+ }
4397
+ )
4398
+ ]
4399
+ }
4400
+ ),
4401
+ note && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
4402
+ ] });
4403
+ }
4404
+ );
4405
+ TextField.displayName = "TextField";
4093
4406
  // Annotate the CommonJS export names for ESM import in node:
4094
4407
  0 && (module.exports = {
4095
4408
  AISpark,
@@ -4108,11 +4421,13 @@ function PageHeader({ title, description, actions, className }) {
4108
4421
  DateRangeFilter,
4109
4422
  DateRangePicker,
4110
4423
  Delta,
4424
+ EmptyState,
4111
4425
  FilterChipBar,
4112
4426
  FilterDropdownFooter,
4113
4427
  Freshness,
4114
4428
  InfoTip,
4115
4429
  LineChartPlaceholder,
4430
+ Modal,
4116
4431
  MultiSelectFilter,
4117
4432
  NO_RESULTS_BODY,
4118
4433
  NO_RESULTS_TITLE,
@@ -4127,6 +4442,7 @@ function PageHeader({ title, description, actions, className }) {
4127
4442
  SearchBar,
4128
4443
  SectionHeading,
4129
4444
  SectionRail,
4445
+ SegmentedControl,
4130
4446
  SelectAllVisible,
4131
4447
  SelectFilter,
4132
4448
  SelectedSection,
@@ -4134,7 +4450,9 @@ function PageHeader({ title, description, actions, className }) {
4134
4450
  SortButton,
4135
4451
  StackedColumnPlaceholder,
4136
4452
  TablePagination,
4453
+ Tabs,
4137
4454
  Tag,
4455
+ TextField,
4138
4456
  Toast,
4139
4457
  Toggle,
4140
4458
  Tooltip,