@mediaradar/design-components 0.43.0 → 0.45.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/approved-components.json +1 -1
- package/dist/index.cjs +94 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -15
- package/dist/index.d.ts +41 -15
- package/dist/index.js +94 -73
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -174,7 +174,7 @@ function InfoTip({ text, size = 11, label = "More information", trigger = "click
|
|
|
174
174
|
onMouseEnter: trigger === "hover" ? cancelClose : void 0,
|
|
175
175
|
onMouseLeave: trigger === "hover" ? closeSoon : void 0,
|
|
176
176
|
style: { position: "fixed", top: pos.top, left: pos.left, width: pos.width },
|
|
177
|
-
className: "z-[90] rounded-control border border-border-default bg-surface px-3 py-2 text-
|
|
177
|
+
className: "z-[90] rounded-control border border-border-default bg-surface px-3 py-2 text-xs font-normal not-italic normal-case leading-relaxed tracking-normal text-text-secondary shadow-overlay",
|
|
178
178
|
children: text
|
|
179
179
|
}
|
|
180
180
|
),
|
|
@@ -193,7 +193,7 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
|
193
193
|
function AdvertiserSearchPrompt({ label = "an advertiser name" }) {
|
|
194
194
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-8 text-center", children: [
|
|
195
195
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Search, { size: 16, "aria-hidden": "true" }) }),
|
|
196
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { className: "text-
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { className: "text-xs leading-snug text-text-tertiary", children: [
|
|
197
197
|
"Start typing ",
|
|
198
198
|
label,
|
|
199
199
|
" to filter."
|
|
@@ -228,7 +228,7 @@ function chipTriggerClass(_variant = "box") {
|
|
|
228
228
|
function ChipContent({ caption, value, icon }) {
|
|
229
229
|
const stack = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
230
230
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
|
|
231
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-xs font-medium text-text-primary", children: value })
|
|
232
232
|
] });
|
|
233
233
|
if (icon) {
|
|
234
234
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
@@ -401,7 +401,7 @@ function AdvertiserQuickFilter({
|
|
|
401
401
|
placeholder: searchPlaceholder,
|
|
402
402
|
"aria-label": searchPlaceholder,
|
|
403
403
|
"data-testid": testIdPrefix && `${testIdPrefix}-search`,
|
|
404
|
-
className: "h-full min-w-0 flex-1 bg-transparent text-
|
|
404
|
+
className: "h-full min-w-0 flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
405
405
|
}
|
|
406
406
|
),
|
|
407
407
|
q && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -424,7 +424,7 @@ function AdvertiserQuickFilter({
|
|
|
424
424
|
"data-testid": testIdPrefix && `${testIdPrefix}-selected-toggle`,
|
|
425
425
|
onClick: () => setSelectedOpen((v) => !v),
|
|
426
426
|
"aria-expanded": selectedOpen,
|
|
427
|
-
className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-
|
|
427
|
+
className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-micro font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary",
|
|
428
428
|
children: [
|
|
429
429
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
430
430
|
import_lucide_react3.ChevronDown,
|
|
@@ -456,12 +456,12 @@ function AdvertiserQuickFilter({
|
|
|
456
456
|
remaining > 0 ? `, showing ${results.length}` : ""
|
|
457
457
|
] }),
|
|
458
458
|
!ql && !prepopulate ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AdvertiserSearchPrompt, { label: promptLabel }) : !ql && results.length === 0 ? null : results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
460
460
|
"No results found for \u201C",
|
|
461
461
|
q.trim(),
|
|
462
462
|
"\u201D"
|
|
463
463
|
] }),
|
|
464
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-
|
|
464
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-xs leading-snug text-text-tertiary", children: noResultsHint })
|
|
465
465
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref: resultsRef, children: [
|
|
466
466
|
results.length > SELECT_ALL_THRESHOLD && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
467
467
|
"button",
|
|
@@ -469,7 +469,7 @@ function AdvertiserQuickFilter({
|
|
|
469
469
|
type: "button",
|
|
470
470
|
"data-testid": testIdPrefix && `${testIdPrefix}-select-all-visible`,
|
|
471
471
|
onClick: toggleAllVisible,
|
|
472
|
-
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-
|
|
472
|
+
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-xs font-semibold text-text-link transition-colors hover:bg-subtle",
|
|
473
473
|
children: [
|
|
474
474
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.ListChecks, { size: 14, "aria-hidden": "true" }),
|
|
475
475
|
allVisibleSelected ? `Deselect ${results.length} visible` : `Select all ${results.length} visible`
|
|
@@ -511,7 +511,7 @@ function AdvertiserQuickFilter({
|
|
|
511
511
|
"data-testid": testIdPrefix && `${testIdPrefix}-clear-all`,
|
|
512
512
|
onClick: () => setDraft(clearValue),
|
|
513
513
|
disabled: draft.length === 0,
|
|
514
|
-
className: "text-
|
|
514
|
+
className: "text-dense font-medium text-text-secondary transition-colors hover:text-text-primary disabled:opacity-40",
|
|
515
515
|
children: "Clear all"
|
|
516
516
|
}
|
|
517
517
|
),
|
|
@@ -521,12 +521,12 @@ function AdvertiserQuickFilter({
|
|
|
521
521
|
type: "button",
|
|
522
522
|
"data-testid": testIdPrefix && `${testIdPrefix}-apply`,
|
|
523
523
|
onClick: apply,
|
|
524
|
-
className: "rounded-control bg-brand-primaryAction px-5 py-2 text-
|
|
524
|
+
className: "rounded-control bg-brand-primaryAction px-5 py-2 text-dense font-semibold text-brand-onprimary transition hover:brightness-110",
|
|
525
525
|
children: "Apply"
|
|
526
526
|
}
|
|
527
527
|
)
|
|
528
528
|
] }) : draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default p-2", children: [
|
|
529
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "text-
|
|
529
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "text-micro text-text-tertiary", children: [
|
|
530
530
|
draft.length,
|
|
531
531
|
" selected"
|
|
532
532
|
] }),
|
|
@@ -535,7 +535,7 @@ function AdvertiserQuickFilter({
|
|
|
535
535
|
{
|
|
536
536
|
type: "button",
|
|
537
537
|
onClick: () => setDraft([]),
|
|
538
|
-
className: "text-
|
|
538
|
+
className: "text-xs font-medium text-text-link hover:underline",
|
|
539
539
|
children: clearLabel
|
|
540
540
|
}
|
|
541
541
|
)
|
|
@@ -577,7 +577,7 @@ function OptionRow({
|
|
|
577
577
|
children: checked && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.Check, { size: 13, strokeWidth: 3 })
|
|
578
578
|
}
|
|
579
579
|
),
|
|
580
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 text-
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: label })
|
|
581
581
|
]
|
|
582
582
|
}
|
|
583
583
|
);
|
|
@@ -1034,8 +1034,8 @@ function DateRangeFilter({
|
|
|
1034
1034
|
children: [
|
|
1035
1035
|
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
|
|
1036
1036
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
1037
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: showDates && displayDatesLine ? "text-
|
|
1038
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "text-
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: showDates && displayDatesLine ? "text-micro text-text-tertiary" : "text-control-caption uppercase tracking-wide text-text-tertiary", children: showDates && displayDatesLine ? displayDatesLine : caption }),
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "text-xs font-medium text-text-primary", children: [
|
|
1039
1039
|
displayValue,
|
|
1040
1040
|
compareLabel(appliedCmp) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "font-normal text-text-secondary", children: [
|
|
1041
1041
|
" \xB7 vs ",
|
|
@@ -1062,7 +1062,7 @@ function DateRangeFilter({
|
|
|
1062
1062
|
type: "button",
|
|
1063
1063
|
"data-testid": testIdPrefix && `${testIdPrefix}-option-${slug2(s)}`,
|
|
1064
1064
|
onClick: () => choosePreset(s),
|
|
1065
|
-
className: `rounded-control px-3 py-2 text-left text-
|
|
1065
|
+
className: `rounded-control px-3 py-2 text-left text-dense font-medium transition-colors ${shortcut === s ? "bg-subtle text-text-primary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"}`,
|
|
1066
1066
|
children: s
|
|
1067
1067
|
},
|
|
1068
1068
|
s
|
|
@@ -1088,7 +1088,7 @@ function DateRangeFilter({
|
|
|
1088
1088
|
offset === 1 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronRight, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-7 w-7" })
|
|
1089
1089
|
] }),
|
|
1090
1090
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-cols-7", children: [
|
|
1091
|
-
WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-8 items-center justify-center text-
|
|
1091
|
+
WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-8 items-center justify-center text-xs font-semibold text-text-secondary", children: w }, w)),
|
|
1092
1092
|
grid.map((d, i) => {
|
|
1093
1093
|
const inMonth = d.getMonth() === m.getMonth();
|
|
1094
1094
|
const hasRange = !!(start && end);
|
|
@@ -1108,7 +1108,7 @@ function DateRangeFilter({
|
|
|
1108
1108
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1109
1109
|
"span",
|
|
1110
1110
|
{
|
|
1111
|
-
className: `relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-
|
|
1111
|
+
className: `relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-dense tabular-nums ${endpoint ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : inMonth ? "text-text-primary hover:bg-subtle" : "text-text-tertiary"}`,
|
|
1112
1112
|
children: d.getDate()
|
|
1113
1113
|
}
|
|
1114
1114
|
)
|
|
@@ -1148,8 +1148,8 @@ function DateRangeFilter({
|
|
|
1148
1148
|
] }),
|
|
1149
1149
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
1150
1150
|
monthly && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mr-auto text-xs text-text-tertiary", children: "Data is monthly, so ranges cover whole months." }),
|
|
1151
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => setOpen(false), className: "rounded-control border border-border-default bg-surface px-5 py-2 text-
|
|
1152
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, disabled: !canApply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-
|
|
1151
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => setOpen(false), className: "rounded-control border border-border-default bg-surface px-5 py-2 text-dense font-semibold text-text-primary transition-colors hover:bg-subtle", children: "Cancel" }),
|
|
1152
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, disabled: !canApply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-dense font-semibold text-brand-onprimary transition-[filter] hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50", children: "Apply" })
|
|
1153
1153
|
] })
|
|
1154
1154
|
] })
|
|
1155
1155
|
]
|
|
@@ -1159,8 +1159,8 @@ function DateRangeFilter({
|
|
|
1159
1159
|
}
|
|
1160
1160
|
function Field({ label, value }) {
|
|
1161
1161
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
1162
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-
|
|
1163
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-xs font-medium text-text-secondary", children: label }),
|
|
1163
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-sm font-medium text-text-primary", children: value })
|
|
1164
1164
|
] });
|
|
1165
1165
|
}
|
|
1166
1166
|
function NavBtn({ children, onClick, ...rest }) {
|
|
@@ -1458,7 +1458,7 @@ function SearchBar({
|
|
|
1458
1458
|
onClick: () => setOpen((o) => !o),
|
|
1459
1459
|
"aria-expanded": open,
|
|
1460
1460
|
"aria-haspopup": "dialog",
|
|
1461
|
-
className: "flex h-full items-center gap-1 px-2.5 text-
|
|
1461
|
+
className: "flex h-full items-center gap-1 px-2.5 text-dense font-medium text-text-primary transition-colors hover:bg-subtle",
|
|
1462
1462
|
children: [
|
|
1463
1463
|
matchValue.mode === "anyWord" ? `${MODE_LABEL.anyWord} (${matchValue.wordJoin})` : MODE_LABEL[matchValue.mode],
|
|
1464
1464
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1591,7 +1591,7 @@ function ModeRow({
|
|
|
1591
1591
|
e.stopPropagation();
|
|
1592
1592
|
onSelect();
|
|
1593
1593
|
},
|
|
1594
|
-
className: "rounded-control text-left text-
|
|
1594
|
+
className: "rounded-control text-left text-sm font-semibold text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1595
1595
|
children: title
|
|
1596
1596
|
}
|
|
1597
1597
|
),
|
|
@@ -1624,7 +1624,7 @@ function RadioOption({
|
|
|
1624
1624
|
},
|
|
1625
1625
|
role: "radio",
|
|
1626
1626
|
"aria-checked": checked,
|
|
1627
|
-
className: "flex items-center gap-1.5 text-
|
|
1627
|
+
className: "flex items-center gap-1.5 text-dense font-medium text-text-primary",
|
|
1628
1628
|
children: [
|
|
1629
1629
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1630
1630
|
"span",
|
|
@@ -1834,7 +1834,7 @@ function Option({
|
|
|
1834
1834
|
"aria-pressed": selected,
|
|
1835
1835
|
onClick,
|
|
1836
1836
|
className: cx3(
|
|
1837
|
-
"flex items-center gap-2 rounded-control px-2.5 py-2 text-left text-
|
|
1837
|
+
"flex items-center gap-2 rounded-control px-2.5 py-2 text-left text-dense transition-colors hover:bg-subtle",
|
|
1838
1838
|
hint ? "flex-1" : "w-full",
|
|
1839
1839
|
selected ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
1840
1840
|
),
|
|
@@ -1908,6 +1908,7 @@ function SelectFilter({
|
|
|
1908
1908
|
error = false,
|
|
1909
1909
|
onRetry,
|
|
1910
1910
|
size = "md",
|
|
1911
|
+
inlineCaption = false,
|
|
1911
1912
|
disabled = false,
|
|
1912
1913
|
renderIcon
|
|
1913
1914
|
}) {
|
|
@@ -1922,7 +1923,11 @@ function SelectFilter({
|
|
|
1922
1923
|
const r = ref.current.getBoundingClientRect();
|
|
1923
1924
|
const h = Math.min(options.length * 36 + 8, 288);
|
|
1924
1925
|
const above = r.bottom + 8 + h > window.innerHeight && r.top - 8 - h > 0;
|
|
1925
|
-
setPos({
|
|
1926
|
+
setPos({
|
|
1927
|
+
top: above ? r.top - 8 - h : r.bottom + 8,
|
|
1928
|
+
...align === "right" ? { right: document.documentElement.clientWidth - r.right } : { left: r.left },
|
|
1929
|
+
width: r.width
|
|
1930
|
+
});
|
|
1926
1931
|
}, [align, options.length]);
|
|
1927
1932
|
(0, import_react7.useLayoutEffect)(() => {
|
|
1928
1933
|
if (!open) return;
|
|
@@ -1947,10 +1952,18 @@ function SelectFilter({
|
|
|
1947
1952
|
window.removeEventListener("scroll", reposition, true);
|
|
1948
1953
|
};
|
|
1949
1954
|
}, [open, close, reposition]);
|
|
1950
|
-
const
|
|
1955
|
+
const valueContent = renderIcon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
1951
1956
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OptionIcon, { children: renderIcon(value) }),
|
|
1952
1957
|
value
|
|
1953
1958
|
] }) : value;
|
|
1959
|
+
const triggerValue = sm && inlineCaption ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
1960
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "font-normal text-text-secondary", children: [
|
|
1961
|
+
caption,
|
|
1962
|
+
":"
|
|
1963
|
+
] }),
|
|
1964
|
+
" ",
|
|
1965
|
+
valueContent
|
|
1966
|
+
] }) : valueContent;
|
|
1954
1967
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cx4("relative", fullWidth && "w-full"), ref, children: [
|
|
1955
1968
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1956
1969
|
"button",
|
|
@@ -1960,7 +1973,7 @@ function SelectFilter({
|
|
|
1960
1973
|
onClick: () => setOpen((o) => !o),
|
|
1961
1974
|
"aria-expanded": open,
|
|
1962
1975
|
"aria-haspopup": "listbox",
|
|
1963
|
-
"aria-label": sm ? caption : void 0,
|
|
1976
|
+
"aria-label": sm && !inlineCaption ? caption : void 0,
|
|
1964
1977
|
disabled,
|
|
1965
1978
|
className: cx4(
|
|
1966
1979
|
sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus" : chipTriggerClass(),
|
|
@@ -1987,10 +2000,10 @@ function SelectFilter({
|
|
|
1987
2000
|
{
|
|
1988
2001
|
ref: popoverRef,
|
|
1989
2002
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
1990
|
-
style: { position: "fixed", top: pos.top, left: pos.left, width: fullWidth ? pos.width : void 0 },
|
|
2003
|
+
style: { position: "fixed", top: pos.top, left: pos.left, right: pos.right, width: fullWidth ? pos.width : void 0 },
|
|
1991
2004
|
className: cx4(
|
|
1992
2005
|
"z-[65] flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
|
|
1993
|
-
!fullWidth && (sm ? "w-28" : "w-56")
|
|
2006
|
+
!fullWidth && (sm ? "w-max min-w-28 max-w-72" : "w-56")
|
|
1994
2007
|
),
|
|
1995
2008
|
role: loading || error ? "group" : "listbox",
|
|
1996
2009
|
"aria-label": caption,
|
|
@@ -2014,7 +2027,7 @@ function SelectFilter({
|
|
|
2014
2027
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2015
2028
|
"span",
|
|
2016
2029
|
{
|
|
2017
|
-
className: cx4("flex-1 text-
|
|
2030
|
+
className: cx4("flex-1 text-sm", selected ? "font-semibold text-text-primary" : "text-text-primary"),
|
|
2018
2031
|
children: o
|
|
2019
2032
|
}
|
|
2020
2033
|
)
|
|
@@ -2067,8 +2080,8 @@ var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other,
|
|
|
2067
2080
|
function noResultsBody(workspaceName) {
|
|
2068
2081
|
return workspaceName ? `Nothing in the \u201C${workspaceName}\u201D workspace matches. ${NO_RESULTS_BODY}` : NO_RESULTS_BODY;
|
|
2069
2082
|
}
|
|
2070
|
-
var PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-
|
|
2071
|
-
var QUIET_ACTION_CLASS = "rounded-control text-
|
|
2083
|
+
var PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90";
|
|
2084
|
+
var QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-text-link transition-colors hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus";
|
|
2072
2085
|
function NoResultsEmptyState({
|
|
2073
2086
|
title = NO_RESULTS_TITLE,
|
|
2074
2087
|
body,
|
|
@@ -2086,7 +2099,7 @@ function NoResultsEmptyState({
|
|
|
2086
2099
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 text-center", "data-testid": testIdPrefix, children: [
|
|
2087
2100
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react11.FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2088
2101
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2089
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "max-w-[420px] text-
|
|
2102
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "max-w-[420px] text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2090
2103
|
hasActions && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2091
2104
|
showClear && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2092
2105
|
"button",
|
|
@@ -2651,12 +2664,12 @@ function AdvertiserNoResults({
|
|
|
2651
2664
|
hint = "Try checking your spelling or searching for a broader brand name."
|
|
2652
2665
|
}) {
|
|
2653
2666
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
|
|
2654
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "text-
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
2655
2668
|
"No results found for \u201C",
|
|
2656
2669
|
query,
|
|
2657
2670
|
"\u201D"
|
|
2658
2671
|
] }),
|
|
2659
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-
|
|
2672
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
2660
2673
|
] });
|
|
2661
2674
|
}
|
|
2662
2675
|
|
|
@@ -2670,7 +2683,7 @@ function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
|
|
|
2670
2683
|
type: "button",
|
|
2671
2684
|
"data-testid": testIdPrefix && `${testIdPrefix}-select-all-visible`,
|
|
2672
2685
|
onClick: onToggle,
|
|
2673
|
-
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-
|
|
2686
|
+
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-xs font-semibold text-text-link transition-colors hover:bg-subtle",
|
|
2674
2687
|
children: [
|
|
2675
2688
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.ListChecks, { size: 14, "aria-hidden": "true" }),
|
|
2676
2689
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
@@ -2695,7 +2708,7 @@ function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
|
|
|
2695
2708
|
"data-testid": testIdPrefix && `${testIdPrefix}-selected-toggle`,
|
|
2696
2709
|
onClick: onToggle,
|
|
2697
2710
|
"aria-expanded": open,
|
|
2698
|
-
className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-
|
|
2711
|
+
className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-micro font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary",
|
|
2699
2712
|
children: [
|
|
2700
2713
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.ChevronDown, { size: 13, "aria-hidden": "true", className: cx7("transition-transform", !open && "-rotate-90") }),
|
|
2701
2714
|
"Selected (",
|
|
@@ -3329,7 +3342,7 @@ function Monogram({ name, size = 28 }) {
|
|
|
3329
3342
|
);
|
|
3330
3343
|
}
|
|
3331
3344
|
function BreakdownTag({ children }) {
|
|
3332
|
-
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-
|
|
3345
|
+
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-micro font-medium text-text-secondary", children });
|
|
3333
3346
|
}
|
|
3334
3347
|
function DelayedTip({ label, children }) {
|
|
3335
3348
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
@@ -3338,7 +3351,7 @@ function DelayedTip({ label, children }) {
|
|
|
3338
3351
|
"span",
|
|
3339
3352
|
{
|
|
3340
3353
|
role: "tooltip",
|
|
3341
|
-
className: "pointer-events-none invisible absolute bottom-[calc(100%+6px)] left-1/2 z-40 w-[160px] -translate-x-1/2 rounded-control border border-border-default bg-surface px-2 py-1.5 text-center text-
|
|
3354
|
+
className: "pointer-events-none invisible absolute bottom-[calc(100%+6px)] left-1/2 z-40 w-[160px] -translate-x-1/2 rounded-control border border-border-default bg-surface px-2 py-1.5 text-center text-micro font-medium leading-snug text-text-secondary opacity-0 shadow-overlay transition-[opacity,visibility] delay-1000 duration-150 group-hover/dt:visible group-hover/dt:opacity-100 group-focus/dt:visible group-focus/dt:opacity-100",
|
|
3342
3355
|
children: label
|
|
3343
3356
|
}
|
|
3344
3357
|
)
|
|
@@ -3351,9 +3364,9 @@ function MetricListHeader({ className }) {
|
|
|
3351
3364
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
|
|
3352
3365
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "flex-1" }),
|
|
3353
3366
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3354
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-
|
|
3355
|
-
/* @__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-
|
|
3356
|
-
/* @__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-
|
|
3367
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3368
|
+
/* @__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-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
|
|
3369
|
+
/* @__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-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
|
|
3357
3370
|
] })
|
|
3358
3371
|
] });
|
|
3359
3372
|
}
|
|
@@ -3361,9 +3374,9 @@ function MetricCells({ spendN, yoy }) {
|
|
|
3361
3374
|
const prior = priorYearAmt(spendN, yoy);
|
|
3362
3375
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3363
3376
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3364
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-
|
|
3365
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-
|
|
3366
|
-
/* @__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-
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
3379
|
+
/* @__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-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
|
|
3367
3380
|
up ? "+" : "\u2212",
|
|
3368
3381
|
Math.abs(yoy),
|
|
3369
3382
|
"%"
|
|
@@ -3382,7 +3395,7 @@ function PublisherBreakdownList({ rows, defaultVisibleCount = 10, padded = true,
|
|
|
3382
3395
|
renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Monogram, { name: p.brand, size: 28 }),
|
|
3383
3396
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "min-w-0", children: [
|
|
3384
3397
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3385
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-
|
|
3398
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
3386
3399
|
p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BreakdownTag, { children: t }, t))
|
|
3387
3400
|
] }),
|
|
3388
3401
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
|
|
@@ -3391,7 +3404,7 @@ function PublisherBreakdownList({ rows, defaultVisibleCount = 10, padded = true,
|
|
|
3391
3404
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3392
3405
|
] }, p.brand))
|
|
3393
3406
|
] }),
|
|
3394
|
-
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-
|
|
3407
|
+
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-xs 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-xs text-text-tertiary", rowPad), children: [
|
|
3395
3408
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
|
|
3396
3409
|
"Showing ",
|
|
3397
3410
|
visible.length,
|
|
@@ -3585,9 +3598,9 @@ function NameListModal({
|
|
|
3585
3598
|
onKeyDown: trapTab,
|
|
3586
3599
|
className: "w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay",
|
|
3587
3600
|
children: [
|
|
3588
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { id: titleId, className: "text-
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
3589
3602
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
3590
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: fieldId, className: "text-
|
|
3603
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
3591
3604
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3592
3605
|
"input",
|
|
3593
3606
|
{
|
|
@@ -3600,7 +3613,7 @@ function NameListModal({
|
|
|
3600
3613
|
}
|
|
3601
3614
|
)
|
|
3602
3615
|
] }),
|
|
3603
|
-
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-
|
|
3616
|
+
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-dense text-text-primary", children: [
|
|
3604
3617
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
3605
3618
|
o.label
|
|
3606
3619
|
] }, o.key)) }),
|
|
@@ -3633,7 +3646,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
|
|
|
3633
3646
|
},
|
|
3634
3647
|
c.key
|
|
3635
3648
|
)),
|
|
3636
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-xs font-medium text-text-link hover:underline", children: "Clear all" })
|
|
3637
3650
|
] });
|
|
3638
3651
|
}
|
|
3639
3652
|
function Chip({
|
|
@@ -3647,7 +3660,7 @@ function Chip({
|
|
|
3647
3660
|
"span",
|
|
3648
3661
|
{
|
|
3649
3662
|
className: cn(
|
|
3650
|
-
"flex items-center gap-1 rounded-full px-2.5 py-1 text-
|
|
3663
|
+
"flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium ring-1 transition-colors",
|
|
3651
3664
|
parked ? (
|
|
3652
3665
|
// No fill, dashed edge, muted label: reads as "held, not acting on
|
|
3653
3666
|
// anything" against the solid applied chips beside it.
|
|
@@ -3674,7 +3687,7 @@ function Chip({
|
|
|
3674
3687
|
"span",
|
|
3675
3688
|
{
|
|
3676
3689
|
role: "tooltip",
|
|
3677
|
-
className: "pointer-events-none absolute bottom-full left-1/2 z-20 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded-md bg-text-primary px-2 py-1 text-
|
|
3690
|
+
className: "pointer-events-none absolute bottom-full left-1/2 z-20 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded-md bg-text-primary px-2 py-1 text-micro font-medium text-surface opacity-0 shadow-raised transition-opacity duration-150 group-hover:opacity-100",
|
|
3678
3691
|
children: parked ? "Not in this workspace" : groupLabel
|
|
3679
3692
|
}
|
|
3680
3693
|
)
|
|
@@ -3774,7 +3787,7 @@ function pageWindow(current, total) {
|
|
|
3774
3787
|
return out;
|
|
3775
3788
|
}
|
|
3776
3789
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination" }) {
|
|
3777
|
-
const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-
|
|
3790
|
+
const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-dense transition-colors disabled:pointer-events-none disabled:opacity-30";
|
|
3778
3791
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
|
|
3779
3792
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3780
3793
|
"button",
|
|
@@ -3788,7 +3801,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
3788
3801
|
}
|
|
3789
3802
|
),
|
|
3790
3803
|
pageWindow(page, totalPages).map(
|
|
3791
|
-
(p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-1 text-
|
|
3804
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3792
3805
|
"button",
|
|
3793
3806
|
{
|
|
3794
3807
|
type: "button",
|
|
@@ -4105,7 +4118,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4105
4118
|
const opt = options.find((o) => String(o.value) === e.target.value);
|
|
4106
4119
|
if (opt) onChange(opt.value);
|
|
4107
4120
|
},
|
|
4108
|
-
className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-
|
|
4121
|
+
className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-xs text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
4109
4122
|
children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4110
4123
|
}
|
|
4111
4124
|
);
|
|
@@ -4181,7 +4194,7 @@ function DateRangePicker({
|
|
|
4181
4194
|
children: [
|
|
4182
4195
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4183
4196
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel2(value, end, formatDate, formatRange) }),
|
|
4184
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-xs font-medium text-text-primary", children: value })
|
|
4185
4198
|
] }),
|
|
4186
4199
|
/* @__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") })
|
|
4187
4200
|
]
|
|
@@ -4193,15 +4206,15 @@ function DateRangePicker({
|
|
|
4193
4206
|
{
|
|
4194
4207
|
type: "button",
|
|
4195
4208
|
onClick: () => showFooter ? setDraft(p) : commit(p),
|
|
4196
|
-
className: cn("block w-full px-3 py-2 text-left text-
|
|
4209
|
+
className: cn("block w-full px-3 py-2 text-left text-dense transition-colors hover:bg-subtle", (showFooter ? draft : value) === p ? "font-semibold text-brand-primaryAction" : "text-text-secondary"),
|
|
4197
4210
|
children: p
|
|
4198
4211
|
},
|
|
4199
4212
|
p
|
|
4200
4213
|
)),
|
|
4201
4214
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4202
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-
|
|
4215
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4203
4216
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4204
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "flex items-center justify-between gap-2 text-
|
|
4217
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4205
4218
|
"From",
|
|
4206
4219
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex gap-1", children: [
|
|
4207
4220
|
granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
@@ -4209,7 +4222,7 @@ function DateRangePicker({
|
|
|
4209
4222
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4210
4223
|
] })
|
|
4211
4224
|
] }),
|
|
4212
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "flex items-center justify-between gap-2 text-
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4213
4226
|
"To",
|
|
4214
4227
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex gap-1", children: [
|
|
4215
4228
|
granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
@@ -4223,7 +4236,7 @@ function DateRangePicker({
|
|
|
4223
4236
|
type: "button",
|
|
4224
4237
|
onClick: applyCustom,
|
|
4225
4238
|
disabled: !valid,
|
|
4226
|
-
className: "self-start text-
|
|
4239
|
+
className: "self-start text-dense font-semibold text-brand-primaryAction transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-40",
|
|
4227
4240
|
children: showFooter ? "Use custom range" : "Apply"
|
|
4228
4241
|
}
|
|
4229
4242
|
)
|
|
@@ -4260,7 +4273,10 @@ function MultiSelectFilter({
|
|
|
4260
4273
|
fullWidth = false,
|
|
4261
4274
|
loading = false,
|
|
4262
4275
|
error = false,
|
|
4263
|
-
onRetry
|
|
4276
|
+
onRetry,
|
|
4277
|
+
valueLabel,
|
|
4278
|
+
hints,
|
|
4279
|
+
note
|
|
4264
4280
|
}) {
|
|
4265
4281
|
const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
|
|
4266
4282
|
const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
|
|
@@ -4321,7 +4337,11 @@ function MultiSelectFilter({
|
|
|
4321
4337
|
};
|
|
4322
4338
|
const shown = open && !showFooter ? draft : selected;
|
|
4323
4339
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4324
|
-
const value = isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected
|
|
4340
|
+
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4341
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex flex-col", children: [
|
|
4342
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: label }),
|
|
4343
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4344
|
+
] }) : label;
|
|
4325
4345
|
const ql = q.trim().toLowerCase();
|
|
4326
4346
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
4327
4347
|
const visibleGroups = groups ? groups.map((g) => {
|
|
@@ -4372,7 +4392,7 @@ function MultiSelectFilter({
|
|
|
4372
4392
|
value: q,
|
|
4373
4393
|
onChange: (e) => setQ(e.target.value),
|
|
4374
4394
|
placeholder: searchPlaceholder ?? `Search ${caption.toLowerCase()}`,
|
|
4375
|
-
className: "h-full flex-1 bg-transparent text-
|
|
4395
|
+
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4376
4396
|
}
|
|
4377
4397
|
),
|
|
4378
4398
|
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 }) })
|
|
@@ -4389,7 +4409,7 @@ function MultiSelectFilter({
|
|
|
4389
4409
|
className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
|
|
4390
4410
|
children: [
|
|
4391
4411
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
4392
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: cn("flex-1 text-
|
|
4412
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
4393
4413
|
counts && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionCount, { n: countFor(g.id) })
|
|
4394
4414
|
]
|
|
4395
4415
|
}
|
|
@@ -4404,7 +4424,7 @@ function MultiSelectFilter({
|
|
|
4404
4424
|
className: "flex w-full items-center gap-2.5 rounded-control py-2 pl-9 pr-2 text-left transition-colors hover:bg-subtle",
|
|
4405
4425
|
children: [
|
|
4406
4426
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckBoxBox, { checked }),
|
|
4407
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex-1 text-
|
|
4427
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
4408
4428
|
counts && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionCount, { n: countFor(c.id) })
|
|
4409
4429
|
]
|
|
4410
4430
|
},
|
|
@@ -4422,21 +4442,22 @@ function MultiSelectFilter({
|
|
|
4422
4442
|
className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
|
|
4423
4443
|
children: [
|
|
4424
4444
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckBoxBox, { checked }),
|
|
4425
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex-1 text-
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
4426
4446
|
counts && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionCount, { n: countFor(o.id) })
|
|
4427
4447
|
]
|
|
4428
4448
|
},
|
|
4429
4449
|
o.id
|
|
4430
4450
|
);
|
|
4431
4451
|
}),
|
|
4432
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "py-6 text-center text-
|
|
4452
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4433
4453
|
] }),
|
|
4454
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4434
4455
|
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)(
|
|
4435
4456
|
"button",
|
|
4436
4457
|
{
|
|
4437
4458
|
type: "button",
|
|
4438
4459
|
onClick: () => setDraft([]),
|
|
4439
|
-
className: "text-
|
|
4460
|
+
className: "text-xs font-medium text-text-link hover:underline",
|
|
4440
4461
|
children: [
|
|
4441
4462
|
"Clear ",
|
|
4442
4463
|
caption.toLowerCase()
|
|
@@ -4449,7 +4470,7 @@ function MultiSelectFilter({
|
|
|
4449
4470
|
] });
|
|
4450
4471
|
}
|
|
4451
4472
|
function OptionCount({ n }) {
|
|
4452
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "shrink-0 text-
|
|
4473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4453
4474
|
"(",
|
|
4454
4475
|
n.toLocaleString(),
|
|
4455
4476
|
")"
|