@mediaradar/design-components 0.18.5 → 0.18.7

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
@@ -77,7 +77,7 @@ __export(index_exports, {
77
77
  module.exports = __toCommonJS(index_exports);
78
78
 
79
79
  // <define:__FONT_SIZE_KEYS__>
80
- var define_FONT_SIZE_KEYS_default = ["control-caption", "micro", "xs", "card-title", "dense", "sm", "panel-title", "base", "md", "lg", "xl", "h1"];
80
+ var define_FONT_SIZE_KEYS_default = ["control-caption", "badge", "micro", "xs", "card-title", "dense", "sm", "panel-title", "base", "md", "lg", "xl", "h1"];
81
81
 
82
82
  // src/InfoTip.tsx
83
83
  var import_react = require("react");
@@ -284,7 +284,7 @@ function AdvertiserQuickFilter({
284
284
  children: [
285
285
  icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
286
286
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
287
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[10px] uppercase tracking-wide text-text-tertiary", children: caption }),
287
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
288
288
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
289
289
  ] }),
290
290
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -309,7 +309,7 @@ function AdvertiserQuickFilter({
309
309
  "aria-label": caption,
310
310
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
311
311
  children: [
312
- /* @__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-default bg-input px-2.5 focus-within:border-border-focus focus-within:ring-2 focus-within:ring-border-focus/30", children: [
312
+ /* @__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: [
313
313
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
314
314
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
315
315
  "input",
@@ -879,7 +879,7 @@ function DateRangeFilter({
879
879
  children: [
880
880
  icon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
881
881
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
882
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: showDates ? "text-[11px] text-text-tertiary" : "text-[10px] uppercase tracking-wide text-text-tertiary", children: showDates ? displayDatesLine : caption }),
882
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: showDates ? "text-[11px] text-text-tertiary" : "text-control-caption uppercase tracking-wide text-text-tertiary", children: showDates ? displayDatesLine : caption }),
883
883
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: displayValue })
884
884
  ] }),
885
885
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronDown, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
@@ -968,7 +968,7 @@ function DateRangeFilter({
968
968
  function Field({ label, value }) {
969
969
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
970
970
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-[12px] font-medium text-text-secondary", children: label }),
971
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-default bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
971
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
972
972
  ] });
973
973
  }
974
974
  function NavBtn({ children, onClick, ...rest }) {
@@ -1191,7 +1191,7 @@ function ModeRow({
1191
1191
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: title }),
1192
1192
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RowInfoTip, { text: infoText })
1193
1193
  ] }),
1194
- badge && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rounded-full bg-subtle px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-text-secondary", children: badge }),
1194
+ badge && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rounded-full bg-subtle px-2 py-0.5 text-badge font-semibold uppercase tracking-wide text-text-secondary", children: badge }),
1195
1195
  extra
1196
1196
  ] }),
1197
1197
  selected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
@@ -1388,7 +1388,7 @@ function DataScopeFilter({ value, onChange, align = "right" }) {
1388
1388
  className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1389
1389
  children: [
1390
1390
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1391
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[10px] uppercase tracking-wide text-text-tertiary", children: "Data" }),
1391
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: "Data" }),
1392
1392
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: display })
1393
1393
  ] }),
1394
1394
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -1520,7 +1520,7 @@ function SelectFilter({
1520
1520
  ),
1521
1521
  children: [
1522
1522
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1523
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[10px] uppercase tracking-wide text-text-tertiary", children: caption }),
1523
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
1524
1524
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
1525
1525
  ] }),
1526
1526
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
@@ -2389,7 +2389,7 @@ function SelectionPicker({
2389
2389
  }) }),
2390
2390
  source === "search" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2391
2391
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2392
- /* @__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-default bg-input px-3", children: [
2392
+ /* @__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: [
2393
2393
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2394
2394
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2395
2395
  "input",
@@ -2703,7 +2703,7 @@ function FilterDropdown({
2703
2703
  onClick: () => setOpen((v) => !v),
2704
2704
  "aria-expanded": open,
2705
2705
  "data-testid": testIdPrefix && `${testIdPrefix}-filter-${filterSlug}`,
2706
- className: "inline-flex h-9 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-default bg-input px-3 text-[13px] font-medium text-text-secondary transition-colors hover:bg-subtle",
2706
+ 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",
2707
2707
  children: [
2708
2708
  label,
2709
2709
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
@@ -2720,7 +2720,7 @@ function FilterDropdown({
2720
2720
  style: { top: pos.top, left: pos.left },
2721
2721
  className: "fixed z-[80] min-w-[220px] rounded-card border border-border-default bg-surface p-2 shadow-overlay",
2722
2722
  children: [
2723
- searchable && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-default bg-input px-2.5", children: [
2723
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime24.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: [
2724
2724
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
2725
2725
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2726
2726
  "input",
@@ -2831,7 +2831,7 @@ function MetricCells({ spendN, yoy }) {
2831
2831
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2832
2832
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
2833
2833
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
2834
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-micro font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
2834
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime25.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_runtime25.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
2835
2835
  up ? "+" : "\u2212",
2836
2836
  Math.abs(yoy),
2837
2837
  "%"
@@ -3060,7 +3060,7 @@ function NameListModal({
3060
3060
  value: name,
3061
3061
  onChange: (e) => setName(e.target.value),
3062
3062
  placeholder,
3063
- className: "h-10 rounded-control border border-border-default bg-input px-3 text-sm outline-hidden focus:border-brand-primaryAction"
3063
+ className: "h-10 rounded-control border border-border-strong bg-input px-3 text-sm outline-hidden focus:border-brand-primaryAction"
3064
3064
  }
3065
3065
  )
3066
3066
  ] }),
@@ -3083,18 +3083,17 @@ function NameListModal({
3083
3083
 
3084
3084
  // src/ChipTrigger.tsx
3085
3085
  var import_jsx_runtime29 = require("react/jsx-runtime");
3086
- function chipTriggerClass(variant = "box") {
3086
+ function chipTriggerClass(_variant = "box") {
3087
3087
  return cn(
3088
- "flex h-11 items-center gap-2 rounded-control border bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
3089
- // Both variants sit on the input fill. `inline` carries the darker stroke
3090
- // so it still reads as a control against the warm canvas with no boxed
3091
- // shell behind it.
3092
- variant === "inline" ? "border-border-strong" : "border-border-default"
3088
+ "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
3089
+ // One stroke for every trigger: a `box` chip on the lighter default
3090
+ // border sat beside SelectFilter's darker one in the same row and read as
3091
+ // a different kind of control. The variant no longer changes anything.
3093
3092
  );
3094
3093
  }
3095
3094
  function ChipContent({ caption, value, icon }) {
3096
3095
  const stack = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3097
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-[10px] uppercase tracking-wide text-text-tertiary", children: caption }),
3096
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
3098
3097
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3099
3098
  ] });
3100
3099
  if (icon) {
@@ -3318,9 +3317,11 @@ var SIZES = {
3318
3317
  /** Matches a 15px lucide icon exactly, so a workspace name in a menu row
3319
3318
  * left-aligns with labels in icon-led rows above and below it. */
3320
3319
  xs: "h-[15px] w-[15px] rounded-[4px] text-[8px] tracking-tight",
3320
+ /** 10px, not text-control-caption: that step is for dropdown captions.
3321
+ * Two initials need to sit inside the 24px circle, a step below md. */
3321
3322
  sm: "h-6 w-6 text-[10px]",
3322
- md: "h-7 w-7 text-[11px]",
3323
- lg: "h-11 w-11 text-[15px]"
3323
+ md: "h-7 w-7 text-micro",
3324
+ lg: "h-11 w-11 text-panel-title"
3324
3325
  };
3325
3326
  function WorkspaceAvatar({ name, size = "md" }) {
3326
3327
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
@@ -3390,7 +3391,7 @@ function TablePagination({
3390
3391
  onChange: (e) => onPerPageChange(Number(e.target.value)),
3391
3392
  "aria-label": "Items per page",
3392
3393
  "data-testid": testIdPrefix && `${testIdPrefix}-per-page`,
3393
- className: "appearance-none rounded-control border border-border-default 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",
3394
+ 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",
3394
3395
  children: perPageOptions.map((n) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: n, children: n }, n))
3395
3396
  }
3396
3397
  ),
@@ -3531,7 +3532,7 @@ function MiniSelect({ value, onChange, options }) {
3531
3532
  const opt = options.find((o) => String(o.value) === e.target.value);
3532
3533
  if (opt) onChange(opt.value);
3533
3534
  },
3534
- className: "rounded-control border border-border-default bg-input px-1.5 py-1 text-[12px] text-text-primary outline-hidden focus:border-border-focus",
3535
+ 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",
3535
3536
  children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3536
3537
  }
3537
3538
  );
@@ -3604,7 +3605,7 @@ function DateRangePicker({
3604
3605
  className: chipTriggerClass(),
3605
3606
  children: [
3606
3607
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3607
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-[10px] text-text-tertiary", children: spanLabel(value, end) }),
3608
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel(value, end) }),
3608
3609
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3609
3610
  ] }),
3610
3611
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
@@ -3784,7 +3785,7 @@ function MultiSelectFilter({
3784
3785
  role: "dialog",
3785
3786
  "aria-label": caption,
3786
3787
  children: [
3787
- searchable && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-default bg-input px-2.5", children: [
3788
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
3788
3789
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
3789
3790
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3790
3791
  "input",