@mediaradar/design-components 0.54.1 → 0.55.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 +699 -686
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +670 -658
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -67,6 +67,7 @@ __export(index_exports, {
|
|
|
67
67
|
PageHeader: () => PageHeader,
|
|
68
68
|
Pager: () => Pager,
|
|
69
69
|
PieChartPlaceholder: () => PieChartPlaceholder,
|
|
70
|
+
PrimaryBadge: () => PrimaryBadge,
|
|
70
71
|
PublisherBreakdownList: () => PublisherBreakdownList,
|
|
71
72
|
QUIET_ACTION_CLASS: () => QUIET_ACTION_CLASS,
|
|
72
73
|
SearchBar: () => SearchBar,
|
|
@@ -722,10 +723,21 @@ function Delta({ value, suffix = "%", arrow = false, period, className, testIdPr
|
|
|
722
723
|
);
|
|
723
724
|
}
|
|
724
725
|
|
|
725
|
-
// src/
|
|
726
|
-
var import_react3 = require("react");
|
|
726
|
+
// src/PrimaryBadge.tsx
|
|
727
727
|
var import_lucide_react5 = require("lucide-react");
|
|
728
728
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
729
|
+
function PrimaryBadge({ label = "Primary", icon: Icon = import_lucide_react5.Check, title, className, testIdPrefix }) {
|
|
730
|
+
const badge = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { tone: "brand", className: title ? void 0 : className, testIdPrefix, children: [
|
|
731
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 11, "aria-hidden": "true" }),
|
|
732
|
+
label
|
|
733
|
+
] });
|
|
734
|
+
return title ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { title, className: cn("inline-flex shrink-0", className), children: badge }) : badge;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// src/CheckBox.tsx
|
|
738
|
+
var import_react3 = require("react");
|
|
739
|
+
var import_lucide_react6 = require("lucide-react");
|
|
740
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
729
741
|
function boxClass(on, disabled) {
|
|
730
742
|
return cn(
|
|
731
743
|
"flex size-4.5 shrink-0 items-center justify-center rounded-small border transition-colors",
|
|
@@ -734,12 +746,12 @@ function boxClass(on, disabled) {
|
|
|
734
746
|
);
|
|
735
747
|
}
|
|
736
748
|
function Glyph({ checked, indeterminate }) {
|
|
737
|
-
if (indeterminate) return /* @__PURE__ */ (0,
|
|
738
|
-
return checked ? /* @__PURE__ */ (0,
|
|
749
|
+
if (indeterminate) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Minus, { size: 13, strokeWidth: 3 });
|
|
750
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { size: 13, strokeWidth: 3 }) : null;
|
|
739
751
|
}
|
|
740
752
|
var CheckBox = (0, import_react3.forwardRef)(function CheckBox2({ checked, indeterminate, onChange, ariaLabel, disabled, stopPropagation = true, testId, testIdPrefix, title, className }, ref) {
|
|
741
753
|
const on = checked || !!indeterminate;
|
|
742
|
-
return /* @__PURE__ */ (0,
|
|
754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
743
755
|
"button",
|
|
744
756
|
{
|
|
745
757
|
ref,
|
|
@@ -764,20 +776,20 @@ var CheckBox = (0, import_react3.forwardRef)(function CheckBox2({ checked, indet
|
|
|
764
776
|
disabled && "hover:border-border-interactive",
|
|
765
777
|
className
|
|
766
778
|
),
|
|
767
|
-
children: /* @__PURE__ */ (0,
|
|
779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Glyph, { checked, indeterminate })
|
|
768
780
|
}
|
|
769
781
|
);
|
|
770
782
|
});
|
|
771
783
|
CheckBox.displayName = "CheckBox";
|
|
772
784
|
var CheckBoxBox = (0, import_react3.forwardRef)(function CheckBoxBox2({ checked, indeterminate, disabled, className, testIdPrefix }, ref) {
|
|
773
|
-
return /* @__PURE__ */ (0,
|
|
785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
774
786
|
"span",
|
|
775
787
|
{
|
|
776
788
|
ref,
|
|
777
789
|
"aria-hidden": "true",
|
|
778
790
|
"data-testid": testIdPrefix,
|
|
779
791
|
className: cn(boxClass(checked || !!indeterminate, disabled), className),
|
|
780
|
-
children: /* @__PURE__ */ (0,
|
|
792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Glyph, { checked, indeterminate })
|
|
781
793
|
}
|
|
782
794
|
);
|
|
783
795
|
});
|
|
@@ -785,8 +797,8 @@ CheckBoxBox.displayName = "CheckBoxBox";
|
|
|
785
797
|
|
|
786
798
|
// src/DateRangeFilter.tsx
|
|
787
799
|
var import_react4 = require("react");
|
|
788
|
-
var
|
|
789
|
-
var
|
|
800
|
+
var import_lucide_react7 = require("lucide-react");
|
|
801
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
790
802
|
var DEFAULT_SHORTCUTS = [
|
|
791
803
|
"Year to date",
|
|
792
804
|
"Rolling 3 months",
|
|
@@ -1075,8 +1087,8 @@ function DateRangeFilter({
|
|
|
1075
1087
|
setFlipBelow(ref.current.getBoundingClientRect().top < popRef.current.offsetHeight + 16);
|
|
1076
1088
|
}, [open, placement]);
|
|
1077
1089
|
const above = placement === "above" && !flipBelow;
|
|
1078
|
-
return /* @__PURE__ */ (0,
|
|
1079
|
-
/* @__PURE__ */ (0,
|
|
1090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1080
1092
|
"button",
|
|
1081
1093
|
{
|
|
1082
1094
|
ref: triggerRef,
|
|
@@ -1086,22 +1098,22 @@ function DateRangeFilter({
|
|
|
1086
1098
|
"aria-expanded": open,
|
|
1087
1099
|
className: chipTriggerClass(),
|
|
1088
1100
|
children: [
|
|
1089
|
-
icon && /* @__PURE__ */ (0,
|
|
1090
|
-
/* @__PURE__ */ (0,
|
|
1091
|
-
/* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1101
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
1103
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: showDates && displayDatesLine ? "text-micro leading-none text-text-tertiary" : "text-control-caption leading-none uppercase tracking-wide text-text-tertiary", children: showDates && displayDatesLine ? displayDatesLine : caption }),
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-xs leading-none font-medium text-text-primary", children: [
|
|
1093
1105
|
displayValue,
|
|
1094
|
-
compareLabel(appliedCmp) && /* @__PURE__ */ (0,
|
|
1106
|
+
compareLabel(appliedCmp) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "font-normal text-text-secondary", children: [
|
|
1095
1107
|
" \xB7 vs ",
|
|
1096
1108
|
compareLabel(appliedCmp).toLowerCase()
|
|
1097
1109
|
] })
|
|
1098
1110
|
] })
|
|
1099
1111
|
] }),
|
|
1100
|
-
/* @__PURE__ */ (0,
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.ChevronDown, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
|
|
1101
1113
|
]
|
|
1102
1114
|
}
|
|
1103
1115
|
),
|
|
1104
|
-
open && /* @__PURE__ */ (0,
|
|
1116
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1105
1117
|
"div",
|
|
1106
1118
|
{
|
|
1107
1119
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
@@ -1110,7 +1122,7 @@ function DateRangeFilter({
|
|
|
1110
1122
|
role: "dialog",
|
|
1111
1123
|
"aria-label": "Select date range",
|
|
1112
1124
|
children: [
|
|
1113
|
-
/* @__PURE__ */ (0,
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex w-44 shrink-0 flex-col gap-0.5 border-r border-border-default p-2", children: SHORTCUTS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1114
1126
|
"button",
|
|
1115
1127
|
{
|
|
1116
1128
|
type: "button",
|
|
@@ -1121,28 +1133,28 @@ function DateRangeFilter({
|
|
|
1121
1133
|
},
|
|
1122
1134
|
s
|
|
1123
1135
|
)) }),
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1127
|
-
/* @__PURE__ */ (0,
|
|
1128
|
-
/* @__PURE__ */ (0,
|
|
1136
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col p-4", children: [
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-end gap-3", children: [
|
|
1138
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "Start date", value: start ? showDate(start) : "\u2014" }),
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "pb-2.5 text-text-tertiary", children: "\u2014" }),
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { label: "End date", value: end ? showDate(end) : start ? showDate(start) : "\u2014" })
|
|
1129
1141
|
] }),
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "my-4 border-t border-border-default" }),
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
|
|
1132
1144
|
const m = addMonths(leftMonth, offset);
|
|
1133
1145
|
const grid = monthGrid(m.getFullYear(), m.getMonth());
|
|
1134
|
-
return /* @__PURE__ */ (0,
|
|
1135
|
-
/* @__PURE__ */ (0,
|
|
1136
|
-
offset === 0 ? /* @__PURE__ */ (0,
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w-63", children: [
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1148
|
+
offset === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "h-7 w-7" }),
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { id: `${monthIdBase}-m${offset}`, "aria-live": "polite", className: "text-panel-title font-semibold text-text-primary", children: [
|
|
1138
1150
|
MONTHS[m.getMonth()],
|
|
1139
1151
|
" ",
|
|
1140
1152
|
m.getFullYear()
|
|
1141
1153
|
] }),
|
|
1142
|
-
offset === 1 ? /* @__PURE__ */ (0,
|
|
1154
|
+
offset === 1 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.ChevronRight, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "h-7 w-7" })
|
|
1143
1155
|
] }),
|
|
1144
|
-
/* @__PURE__ */ (0,
|
|
1145
|
-
WEEKDAYS.map((w) => /* @__PURE__ */ (0,
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-7", role: "group", "aria-labelledby": `${monthIdBase}-m${offset}`, children: [
|
|
1157
|
+
WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { "aria-hidden": "true", className: "flex h-8 items-center justify-center text-xs font-semibold text-text-secondary", children: w }, w)),
|
|
1146
1158
|
grid.map((d, i) => {
|
|
1147
1159
|
const inMonth = d.getMonth() === m.getMonth();
|
|
1148
1160
|
const hasRange = !!(start && end);
|
|
@@ -1157,7 +1169,7 @@ function DateRangeFilter({
|
|
|
1157
1169
|
else if (end && isEnd) band = "left-0 right-1/2";
|
|
1158
1170
|
else band = "left-0 right-0";
|
|
1159
1171
|
}
|
|
1160
|
-
return /* @__PURE__ */ (0,
|
|
1172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1161
1173
|
"button",
|
|
1162
1174
|
{
|
|
1163
1175
|
type: "button",
|
|
@@ -1166,8 +1178,8 @@ function DateRangeFilter({
|
|
|
1166
1178
|
"aria-pressed": endpoint || inRange,
|
|
1167
1179
|
className: "relative flex h-9 items-center justify-center focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
1168
1180
|
children: [
|
|
1169
|
-
band && /* @__PURE__ */ (0,
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1181
|
+
band && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `absolute inset-y-1 bg-ai-tint ${band}`, "aria-hidden": "true" }),
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1171
1183
|
"span",
|
|
1172
1184
|
{
|
|
1173
1185
|
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"}`,
|
|
@@ -1182,16 +1194,16 @@ function DateRangeFilter({
|
|
|
1182
1194
|
] })
|
|
1183
1195
|
] }, offset);
|
|
1184
1196
|
}) }),
|
|
1185
|
-
compare && /* @__PURE__ */ (0,
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1197
|
+
compare && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("fieldset", { className: "mt-4 border-t border-border-default pt-4", children: [
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("legend", { className: "float-left mb-2 w-full text-xs font-medium text-text-secondary", children: "Compare to" }),
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "clear-left flex flex-col gap-1", children: compare.options.map((o) => {
|
|
1188
1200
|
const on = (cmp ?? compare.value) === o.id;
|
|
1189
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1190
1202
|
"label",
|
|
1191
1203
|
{
|
|
1192
1204
|
className: `flex cursor-pointer items-center gap-2.5 rounded-control px-2 py-1.5 text-dense transition-colors ${on ? "bg-subtle" : "hover:bg-subtle"}`,
|
|
1193
1205
|
children: [
|
|
1194
|
-
/* @__PURE__ */ (0,
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1195
1207
|
"input",
|
|
1196
1208
|
{
|
|
1197
1209
|
type: "radio",
|
|
@@ -1203,21 +1215,21 @@ function DateRangeFilter({
|
|
|
1203
1215
|
className: "h-4 w-4 accent-brand-primaryAction"
|
|
1204
1216
|
}
|
|
1205
1217
|
),
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
start && /* @__PURE__ */ (0,
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `w-44 shrink-0 ${on ? "font-semibold text-text-primary" : "text-text-secondary"}`, children: o.label }),
|
|
1219
|
+
start && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "tabular-nums text-text-tertiary", children: (formatted ? showRange : spanLabel)(...compareSpan(start, end ?? start, o.id)) })
|
|
1208
1220
|
]
|
|
1209
1221
|
},
|
|
1210
1222
|
o.id
|
|
1211
1223
|
);
|
|
1212
1224
|
}) })
|
|
1213
1225
|
] }),
|
|
1214
|
-
/* @__PURE__ */ (0,
|
|
1215
|
-
monthly && /* @__PURE__ */ (0,
|
|
1216
|
-
/* @__PURE__ */ (0,
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
1227
|
+
monthly && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "mr-auto text-xs text-text-tertiary", children: "Data is monthly, so ranges cover whole months." }),
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => {
|
|
1217
1229
|
setOpen(false);
|
|
1218
1230
|
triggerRef.current?.focus();
|
|
1219
1231
|
}, 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 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Cancel" }),
|
|
1220
|
-
/* @__PURE__ */ (0,
|
|
1232
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.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 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Apply" })
|
|
1221
1233
|
] })
|
|
1222
1234
|
] })
|
|
1223
1235
|
]
|
|
@@ -1226,19 +1238,19 @@ function DateRangeFilter({
|
|
|
1226
1238
|
] });
|
|
1227
1239
|
}
|
|
1228
1240
|
function Field({ label, value }) {
|
|
1229
|
-
return /* @__PURE__ */ (0,
|
|
1230
|
-
/* @__PURE__ */ (0,
|
|
1231
|
-
/* @__PURE__ */ (0,
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs font-medium text-text-secondary", children: label }),
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex h-10 min-w-35 items-center rounded-control border border-border-strong bg-input px-3 text-sm font-medium text-text-primary", children: value })
|
|
1232
1244
|
] });
|
|
1233
1245
|
}
|
|
1234
1246
|
function NavBtn({ children, onClick, ...rest }) {
|
|
1235
|
-
return /* @__PURE__ */ (0,
|
|
1247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", ...rest, children });
|
|
1236
1248
|
}
|
|
1237
1249
|
|
|
1238
1250
|
// src/SearchBar.tsx
|
|
1239
1251
|
var import_react5 = require("react");
|
|
1240
|
-
var
|
|
1241
|
-
var
|
|
1252
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1253
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1242
1254
|
var HEIGHT = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
1243
1255
|
var DEFAULT_SEARCH_MATCH = { mode: "anyWord", wordJoin: "Or" };
|
|
1244
1256
|
var MODE_LABEL = {
|
|
@@ -1340,7 +1352,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1340
1352
|
};
|
|
1341
1353
|
}, [open]);
|
|
1342
1354
|
const showMatch = variant === "filterable" && matchValue;
|
|
1343
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1344
1356
|
"div",
|
|
1345
1357
|
{
|
|
1346
1358
|
className: cn(
|
|
@@ -1353,8 +1365,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1353
1365
|
),
|
|
1354
1366
|
"data-testid": testIdPrefix,
|
|
1355
1367
|
children: [
|
|
1356
|
-
scope && /* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1368
|
+
scope && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScopeMenu, { scope, onOpenChange: onScopeOpenChange, testIdPrefix }),
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1358
1370
|
"div",
|
|
1359
1371
|
{
|
|
1360
1372
|
ref: codesRef,
|
|
@@ -1366,8 +1378,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1366
1378
|
}
|
|
1367
1379
|
},
|
|
1368
1380
|
children: [
|
|
1369
|
-
/* @__PURE__ */ (0,
|
|
1370
|
-
adCodeMode && adCodes.length > 0 && /* @__PURE__ */ (0,
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Search, { size: 15, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
1382
|
+
adCodeMode && adCodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1371
1383
|
"span",
|
|
1372
1384
|
{
|
|
1373
1385
|
className: cn(
|
|
@@ -1375,7 +1387,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1375
1387
|
hasMisses ? "bg-status-danger/15 text-text-danger" : "bg-subtle text-text-primary"
|
|
1376
1388
|
),
|
|
1377
1389
|
children: [
|
|
1378
|
-
/* @__PURE__ */ (0,
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1379
1391
|
"button",
|
|
1380
1392
|
{
|
|
1381
1393
|
type: "button",
|
|
@@ -1385,12 +1397,12 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1385
1397
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes`,
|
|
1386
1398
|
className: "inline-flex items-center gap-1 rounded-control focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1387
1399
|
children: [
|
|
1388
|
-
hasMisses && /* @__PURE__ */ (0,
|
|
1400
|
+
hasMisses && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.AlertCircle, { size: 13, "aria-hidden": "true" }),
|
|
1389
1401
|
hasMisses ? `${matchedCount} of ${adCodes.length} matched` : adCodes.length === 1 ? adCodes[0] : `${adCodes.length} Ad Codes`
|
|
1390
1402
|
]
|
|
1391
1403
|
}
|
|
1392
1404
|
),
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1394
1406
|
"button",
|
|
1395
1407
|
{
|
|
1396
1408
|
type: "button",
|
|
@@ -1398,13 +1410,13 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1398
1410
|
onClick: () => updateCodes([], -1),
|
|
1399
1411
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-clear`,
|
|
1400
1412
|
className: "inline-flex rounded-full p-0.5 hover:bg-surface focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1401
|
-
children: /* @__PURE__ */ (0,
|
|
1413
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.X, { size: 12, "aria-hidden": "true" })
|
|
1402
1414
|
}
|
|
1403
1415
|
)
|
|
1404
1416
|
]
|
|
1405
1417
|
}
|
|
1406
1418
|
),
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1408
1420
|
"input",
|
|
1409
1421
|
{
|
|
1410
1422
|
ref: setInput,
|
|
@@ -1425,7 +1437,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1425
1437
|
className: "min-w-0 flex-1 bg-transparent text-dense text-text-primary outline-hidden placeholder:text-text-tertiary"
|
|
1426
1438
|
}
|
|
1427
1439
|
),
|
|
1428
|
-
adCodeMode && codesOpen && adCodes.length > 0 && /* @__PURE__ */ (0,
|
|
1440
|
+
adCodeMode && codesOpen && adCodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1429
1441
|
"div",
|
|
1430
1442
|
{
|
|
1431
1443
|
ref: codesPopover,
|
|
@@ -1434,10 +1446,10 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1434
1446
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-popover`,
|
|
1435
1447
|
className: "absolute right-0 top-full z-50 mt-2 w-110 max-w-[90vw] cursor-auto rounded-card border border-border-default bg-surface p-3 shadow-overlay",
|
|
1436
1448
|
children: [
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1449
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "mb-2 text-xs font-medium text-text-secondary", children: isAdCodeMatched ? `${matchedCount} ${matchedCount === 1 ? "ad was" : "ads were"} found` : `${adCodes.length} ${adCodes.length === 1 ? "ad code" : "ad codes"}` }),
|
|
1450
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "flex max-h-50 flex-wrap gap-2 overflow-y-auto p-0.5", children: adCodes.map((code, i) => {
|
|
1439
1451
|
const missed = !!isAdCodeMatched && !isAdCodeMatched(code);
|
|
1440
|
-
return /* @__PURE__ */ (0,
|
|
1452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1441
1453
|
"li",
|
|
1442
1454
|
{
|
|
1443
1455
|
className: cn(
|
|
@@ -1446,8 +1458,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1446
1458
|
),
|
|
1447
1459
|
children: [
|
|
1448
1460
|
code,
|
|
1449
|
-
missed && /* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1461
|
+
missed && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: " (not found)" }),
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1451
1463
|
"button",
|
|
1452
1464
|
{
|
|
1453
1465
|
type: "button",
|
|
@@ -1456,7 +1468,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1456
1468
|
onClick: () => updateCodes(adCodes.filter((c) => c !== code), i),
|
|
1457
1469
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-code-remove-${slug3(code)}`,
|
|
1458
1470
|
className: "inline-flex rounded-full p-0.5 hover:bg-surface focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1459
|
-
children: /* @__PURE__ */ (0,
|
|
1471
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.X, { size: 13, "aria-hidden": "true" })
|
|
1460
1472
|
}
|
|
1461
1473
|
)
|
|
1462
1474
|
]
|
|
@@ -1464,7 +1476,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1464
1476
|
code
|
|
1465
1477
|
);
|
|
1466
1478
|
}) }),
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1468
1480
|
"button",
|
|
1469
1481
|
{
|
|
1470
1482
|
type: "button",
|
|
@@ -1477,11 +1489,11 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1477
1489
|
children: "Search"
|
|
1478
1490
|
}
|
|
1479
1491
|
) }),
|
|
1480
|
-
onDownloadAdCodes && /* @__PURE__ */ (0,
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1492
|
+
onDownloadAdCodes && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-start gap-2 rounded-control border border-border-default px-3 py-2.5 text-card-title text-text-secondary", children: [
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.AlertCircle, { size: 16, "aria-hidden": "true", className: "mt-0.5 shrink-0 text-text-tertiary" }),
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
1483
1495
|
hasMisses && "Some ad codes in your search could not be matched. ",
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1496
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1485
1497
|
"button",
|
|
1486
1498
|
{
|
|
1487
1499
|
type: "button",
|
|
@@ -1501,7 +1513,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1501
1513
|
]
|
|
1502
1514
|
}
|
|
1503
1515
|
),
|
|
1504
|
-
value && onChange && /* @__PURE__ */ (0,
|
|
1516
|
+
value && onChange && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1505
1517
|
"button",
|
|
1506
1518
|
{
|
|
1507
1519
|
type: "button",
|
|
@@ -1512,7 +1524,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1512
1524
|
"aria-label": "Clear search",
|
|
1513
1525
|
"data-testid": testIdPrefix && `${testIdPrefix}-clear`,
|
|
1514
1526
|
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-offset-1 focus-visible:outline-border-focus",
|
|
1515
|
-
children: /* @__PURE__ */ (0,
|
|
1527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.X, { size: 14, "aria-hidden": "true" })
|
|
1516
1528
|
}
|
|
1517
1529
|
),
|
|
1518
1530
|
showMatch && // border-border-default, not the bare `border-border` both source
|
|
@@ -1526,8 +1538,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1526
1538
|
// token package (insights-studio-prototype's own src/index.css;
|
|
1527
1539
|
// mr-clientapps' own tailwind.config.ts `colors.border.DEFAULT`) --
|
|
1528
1540
|
// an alias this shared component can't rely on existing.
|
|
1529
|
-
/* @__PURE__ */ (0,
|
|
1530
|
-
/* @__PURE__ */ (0,
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative shrink-0 border-l border-border-default", ref, children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1531
1543
|
"button",
|
|
1532
1544
|
{
|
|
1533
1545
|
type: "button",
|
|
@@ -1538,8 +1550,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1538
1550
|
className: "flex h-full items-center gap-1 px-2.5 text-dense font-medium text-text-primary transition-colors hover:bg-subtle",
|
|
1539
1551
|
children: [
|
|
1540
1552
|
matchValue.mode === "anyWord" ? `${MODE_LABEL.anyWord} (${matchValue.wordJoin})` : MODE_LABEL[matchValue.mode],
|
|
1541
|
-
/* @__PURE__ */ (0,
|
|
1542
|
-
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1554
|
+
import_lucide_react8.ChevronDown,
|
|
1543
1555
|
{
|
|
1544
1556
|
size: 14,
|
|
1545
1557
|
"aria-hidden": "true",
|
|
@@ -1549,25 +1561,25 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1549
1561
|
]
|
|
1550
1562
|
}
|
|
1551
1563
|
),
|
|
1552
|
-
open && /* @__PURE__ */ (0,
|
|
1564
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1553
1565
|
"div",
|
|
1554
1566
|
{
|
|
1555
1567
|
role: "dialog",
|
|
1556
1568
|
"aria-label": "Search match type",
|
|
1557
1569
|
"data-testid": testIdPrefix && `${testIdPrefix}-mode-popover`,
|
|
1558
1570
|
className: "absolute right-0 top-full mt-2 z-50 w-100 rounded-card border border-border-default bg-surface p-3 shadow-overlay",
|
|
1559
|
-
children: /* @__PURE__ */ (0,
|
|
1560
|
-
/* @__PURE__ */ (0,
|
|
1571
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1561
1573
|
ModeRow,
|
|
1562
1574
|
{
|
|
1563
1575
|
title: "Any Word Text Search",
|
|
1564
1576
|
selected: matchValue.mode === "anyWord",
|
|
1565
1577
|
onSelect: () => onMatchChange?.({ mode: "anyWord", wordJoin: matchValue.wordJoin }),
|
|
1566
1578
|
testId: testIdPrefix && `${testIdPrefix}-mode-anyWord`,
|
|
1567
|
-
description: /* @__PURE__ */ (0,
|
|
1579
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: "Find creatives that contain your keyword(s) using an \u201COr\u201D (match any) or \u201CAnd\u201D (match all) conditional in any order." }),
|
|
1568
1580
|
infoText: "The Or/And choice applies only when Any Word is the active search mode.",
|
|
1569
|
-
extra: /* @__PURE__ */ (0,
|
|
1570
|
-
/* @__PURE__ */ (0,
|
|
1581
|
+
extra: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-3", children: [
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1571
1583
|
RadioOption,
|
|
1572
1584
|
{
|
|
1573
1585
|
label: "Or",
|
|
@@ -1576,7 +1588,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1576
1588
|
testId: testIdPrefix && `${testIdPrefix}-word-join-or`
|
|
1577
1589
|
}
|
|
1578
1590
|
),
|
|
1579
|
-
/* @__PURE__ */ (0,
|
|
1591
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1580
1592
|
RadioOption,
|
|
1581
1593
|
{
|
|
1582
1594
|
label: "And",
|
|
@@ -1588,8 +1600,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1588
1600
|
] })
|
|
1589
1601
|
}
|
|
1590
1602
|
),
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {}),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1593
1605
|
ModeRow,
|
|
1594
1606
|
{
|
|
1595
1607
|
title: "Exact Match Text Search",
|
|
@@ -1600,8 +1612,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1600
1612
|
infoText: "Keywords are matched as a single contiguous phrase, in the order you typed them."
|
|
1601
1613
|
}
|
|
1602
1614
|
),
|
|
1603
|
-
/* @__PURE__ */ (0,
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {}),
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1605
1617
|
ModeRow,
|
|
1606
1618
|
{
|
|
1607
1619
|
title: "Contextual Search",
|
|
@@ -1613,8 +1625,8 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1613
1625
|
infoText: "Uses semantic matching, so results can include related terms even when the exact keyword isn't present."
|
|
1614
1626
|
}
|
|
1615
1627
|
),
|
|
1616
|
-
/* @__PURE__ */ (0,
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {}),
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1618
1630
|
ModeRow,
|
|
1619
1631
|
{
|
|
1620
1632
|
title: "Ad Code Search",
|
|
@@ -1635,7 +1647,7 @@ var SearchBar = (0, import_react5.forwardRef)(function SearchBar2({
|
|
|
1635
1647
|
});
|
|
1636
1648
|
SearchBar.displayName = "SearchBar";
|
|
1637
1649
|
function Divider() {
|
|
1638
|
-
return /* @__PURE__ */ (0,
|
|
1650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "my-2.5 border-t border-border-default", "aria-hidden": "true" });
|
|
1639
1651
|
}
|
|
1640
1652
|
function ModeRow({
|
|
1641
1653
|
title,
|
|
@@ -1648,16 +1660,16 @@ function ModeRow({
|
|
|
1648
1660
|
testId
|
|
1649
1661
|
}) {
|
|
1650
1662
|
const descId = (0, import_react5.useId)();
|
|
1651
|
-
return /* @__PURE__ */ (0,
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1652
1664
|
"div",
|
|
1653
1665
|
{
|
|
1654
1666
|
onClick: onSelect,
|
|
1655
1667
|
className: "flex cursor-pointer flex-col items-stretch gap-1 rounded-control p-1.5 text-left transition-colors hover:bg-subtle",
|
|
1656
1668
|
children: [
|
|
1657
|
-
/* @__PURE__ */ (0,
|
|
1658
|
-
/* @__PURE__ */ (0,
|
|
1659
|
-
/* @__PURE__ */ (0,
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1669
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1661
1673
|
"button",
|
|
1662
1674
|
{
|
|
1663
1675
|
type: "button",
|
|
@@ -1673,14 +1685,14 @@ function ModeRow({
|
|
|
1673
1685
|
children: title
|
|
1674
1686
|
}
|
|
1675
1687
|
),
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RowInfoTip, { text: infoText })
|
|
1677
1689
|
] }),
|
|
1678
|
-
badge && /* @__PURE__ */ (0,
|
|
1690
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Badge, { kind: "category", children: badge }),
|
|
1679
1691
|
extra
|
|
1680
1692
|
] }),
|
|
1681
|
-
selected && /* @__PURE__ */ (0,
|
|
1693
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
|
|
1682
1694
|
] }),
|
|
1683
|
-
/* @__PURE__ */ (0,
|
|
1695
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { id: descId, className: "block text-xs leading-snug text-text-secondary", children: description })
|
|
1684
1696
|
]
|
|
1685
1697
|
}
|
|
1686
1698
|
);
|
|
@@ -1691,7 +1703,7 @@ function RadioOption({
|
|
|
1691
1703
|
onSelect,
|
|
1692
1704
|
testId
|
|
1693
1705
|
}) {
|
|
1694
|
-
return /* @__PURE__ */ (0,
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1695
1707
|
"button",
|
|
1696
1708
|
{
|
|
1697
1709
|
type: "button",
|
|
@@ -1704,14 +1716,14 @@ function RadioOption({
|
|
|
1704
1716
|
"aria-checked": checked,
|
|
1705
1717
|
className: "flex items-center gap-1.5 text-dense font-medium text-text-primary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
1706
1718
|
children: [
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1708
1720
|
"span",
|
|
1709
1721
|
{
|
|
1710
1722
|
className: cn(
|
|
1711
1723
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
|
|
1712
1724
|
checked ? "border-brand-primaryAction" : "border-border-interactive"
|
|
1713
1725
|
),
|
|
1714
|
-
children: checked && /* @__PURE__ */ (0,
|
|
1726
|
+
children: checked && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "h-2 w-2 rounded-full bg-brand-primaryAction" })
|
|
1715
1727
|
}
|
|
1716
1728
|
),
|
|
1717
1729
|
label
|
|
@@ -1731,8 +1743,8 @@ function RowInfoTip({ text }) {
|
|
|
1731
1743
|
window.addEventListener("mousedown", onDown);
|
|
1732
1744
|
return () => window.removeEventListener("mousedown", onDown);
|
|
1733
1745
|
}, [open]);
|
|
1734
|
-
return /* @__PURE__ */ (0,
|
|
1735
|
-
/* @__PURE__ */ (0,
|
|
1746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "relative inline-flex shrink-0 items-center", ref, children: [
|
|
1747
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1736
1748
|
"button",
|
|
1737
1749
|
{
|
|
1738
1750
|
type: "button",
|
|
@@ -1744,10 +1756,10 @@ function RowInfoTip({ text }) {
|
|
|
1744
1756
|
"aria-expanded": open,
|
|
1745
1757
|
"aria-describedby": id,
|
|
1746
1758
|
className: "-m-1.5 inline-flex size-6 items-center justify-center rounded-control text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1747
|
-
children: /* @__PURE__ */ (0,
|
|
1759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.AlertCircle, { size: 13, "aria-hidden": "true" })
|
|
1748
1760
|
}
|
|
1749
1761
|
),
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1751
1763
|
"span",
|
|
1752
1764
|
{
|
|
1753
1765
|
id,
|
|
@@ -1802,8 +1814,8 @@ function ScopeMenu({
|
|
|
1802
1814
|
close(false);
|
|
1803
1815
|
}
|
|
1804
1816
|
};
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative flex shrink-0 border-r border-border-default", ref, children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1807
1819
|
"button",
|
|
1808
1820
|
{
|
|
1809
1821
|
ref: trigger,
|
|
@@ -1817,8 +1829,8 @@ function ScopeMenu({
|
|
|
1817
1829
|
className: "flex h-full items-center gap-1.5 rounded-l-control px-2.5 text-dense font-semibold text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
1818
1830
|
children: [
|
|
1819
1831
|
scope.value,
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1821
|
-
|
|
1832
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1833
|
+
import_lucide_react8.ChevronDown,
|
|
1822
1834
|
{
|
|
1823
1835
|
size: 13,
|
|
1824
1836
|
"aria-hidden": "true",
|
|
@@ -1828,7 +1840,7 @@ function ScopeMenu({
|
|
|
1828
1840
|
]
|
|
1829
1841
|
}
|
|
1830
1842
|
),
|
|
1831
|
-
open && /* @__PURE__ */ (0,
|
|
1843
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1832
1844
|
"div",
|
|
1833
1845
|
{
|
|
1834
1846
|
ref: list,
|
|
@@ -1839,13 +1851,13 @@ function ScopeMenu({
|
|
|
1839
1851
|
"data-testid": testIdPrefix && `${testIdPrefix}-scope-popover`,
|
|
1840
1852
|
className: "absolute left-0 top-[calc(100%+6px)] z-50 min-w-50 max-w-72 rounded-card border border-border-default bg-surface py-1 shadow-overlay",
|
|
1841
1853
|
children: [
|
|
1842
|
-
/* @__PURE__ */ (0,
|
|
1843
|
-
/* @__PURE__ */ (0,
|
|
1844
|
-
scope.info && /* @__PURE__ */ (0,
|
|
1854
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 pb-1.5 pt-1", "aria-hidden": "true", children: [
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: scope.label }),
|
|
1856
|
+
scope.info && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "mt-0.5 text-xs text-text-secondary", children: scope.info })
|
|
1845
1857
|
] }),
|
|
1846
1858
|
scope.options.map((o) => {
|
|
1847
1859
|
const sel = o === scope.value;
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1849
1861
|
"button",
|
|
1850
1862
|
{
|
|
1851
1863
|
type: "button",
|
|
@@ -1862,7 +1874,7 @@ function ScopeMenu({
|
|
|
1862
1874
|
sel ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
1863
1875
|
),
|
|
1864
1876
|
children: [
|
|
1865
|
-
/* @__PURE__ */ (0,
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Check, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-brand-primaryAction", !sel && "invisible") }),
|
|
1866
1878
|
o
|
|
1867
1879
|
]
|
|
1868
1880
|
},
|
|
@@ -1877,8 +1889,8 @@ function ScopeMenu({
|
|
|
1877
1889
|
|
|
1878
1890
|
// src/SectionRail.tsx
|
|
1879
1891
|
var import_react6 = require("react");
|
|
1880
|
-
var
|
|
1881
|
-
var
|
|
1892
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1893
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1882
1894
|
function SectionRail({
|
|
1883
1895
|
title,
|
|
1884
1896
|
titleSerif,
|
|
@@ -1893,20 +1905,20 @@ function SectionRail({
|
|
|
1893
1905
|
const scroll = (direction) => {
|
|
1894
1906
|
scrollRef.current?.scrollBy({ left: direction * 320, behavior: "smooth" });
|
|
1895
1907
|
};
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
1898
|
-
/* @__PURE__ */ (0,
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
1908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
1909
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
|
|
1910
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1911
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1900
1912
|
"h2",
|
|
1901
1913
|
{
|
|
1902
1914
|
className: titleSerif ? "font-serif text-xl font-normal tracking-tight text-text-primary" : "text-xl font-medium tracking-tight text-text-primary",
|
|
1903
1915
|
children: title
|
|
1904
1916
|
}
|
|
1905
1917
|
),
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1 text-sm text-text-secondary", children: subtitle })
|
|
1907
1919
|
] }),
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
1909
|
-
viewAllLabel && viewAllHref && /* @__PURE__ */ (0,
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1921
|
+
viewAllLabel && viewAllHref && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1910
1922
|
"a",
|
|
1911
1923
|
{
|
|
1912
1924
|
href: viewAllHref,
|
|
@@ -1917,29 +1929,29 @@ function SectionRail({
|
|
|
1917
1929
|
]
|
|
1918
1930
|
}
|
|
1919
1931
|
),
|
|
1920
|
-
/* @__PURE__ */ (0,
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1921
1933
|
"button",
|
|
1922
1934
|
{
|
|
1923
1935
|
type: "button",
|
|
1924
1936
|
onClick: () => scroll(-1),
|
|
1925
1937
|
"aria-label": "Previous",
|
|
1926
1938
|
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus sm:flex lg:hidden",
|
|
1927
|
-
children: /* @__PURE__ */ (0,
|
|
1939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.ChevronLeft, { size: 16 })
|
|
1928
1940
|
}
|
|
1929
1941
|
),
|
|
1930
|
-
/* @__PURE__ */ (0,
|
|
1942
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1931
1943
|
"button",
|
|
1932
1944
|
{
|
|
1933
1945
|
type: "button",
|
|
1934
1946
|
onClick: () => scroll(1),
|
|
1935
1947
|
"aria-label": "Next",
|
|
1936
1948
|
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus sm:flex lg:hidden",
|
|
1937
|
-
children: /* @__PURE__ */ (0,
|
|
1949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.ChevronRight, { size: 16 })
|
|
1938
1950
|
}
|
|
1939
1951
|
)
|
|
1940
1952
|
] })
|
|
1941
1953
|
] }),
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1943
1955
|
"div",
|
|
1944
1956
|
{
|
|
1945
1957
|
ref: scrollRef,
|
|
@@ -1952,8 +1964,8 @@ function SectionRail({
|
|
|
1952
1964
|
|
|
1953
1965
|
// src/DataScopeFilter.tsx
|
|
1954
1966
|
var import_react7 = require("react");
|
|
1955
|
-
var
|
|
1956
|
-
var
|
|
1967
|
+
var import_lucide_react10 = require("lucide-react");
|
|
1968
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1957
1969
|
var FINAL_ONLY_TEXT = "Trims time periods to data that has finalized across the selected media formats. Some formats (e.g. Network TV and Cinema) finalize later, so the most recent periods may still change. Turn on for stable, report-ready numbers.";
|
|
1958
1970
|
function DataScopeFilter({ value, onChange, align = "right", className, testIdPrefix }) {
|
|
1959
1971
|
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
@@ -1976,8 +1988,8 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1976
1988
|
onChange(v);
|
|
1977
1989
|
setOpen(false);
|
|
1978
1990
|
};
|
|
1979
|
-
return /* @__PURE__ */ (0,
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
1991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1981
1993
|
"button",
|
|
1982
1994
|
{
|
|
1983
1995
|
type: "button",
|
|
@@ -1986,9 +1998,9 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1986
1998
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
1987
1999
|
className: chipTriggerClass(),
|
|
1988
2000
|
children: [
|
|
1989
|
-
/* @__PURE__ */ (0,
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
|
|
2001
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChipContent, { caption: "Data", value: display }),
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2003
|
+
import_lucide_react10.ChevronDown,
|
|
1992
2004
|
{
|
|
1993
2005
|
size: 14,
|
|
1994
2006
|
"aria-hidden": "true",
|
|
@@ -1998,7 +2010,7 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1998
2010
|
]
|
|
1999
2011
|
}
|
|
2000
2012
|
),
|
|
2001
|
-
open && /* @__PURE__ */ (0,
|
|
2013
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2002
2014
|
"div",
|
|
2003
2015
|
{
|
|
2004
2016
|
role: "group",
|
|
@@ -2009,8 +2021,8 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
2009
2021
|
align === "right" ? "right-0" : "left-0"
|
|
2010
2022
|
),
|
|
2011
2023
|
children: [
|
|
2012
|
-
/* @__PURE__ */ (0,
|
|
2013
|
-
/* @__PURE__ */ (0,
|
|
2024
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Option, { label: "All", selected: !value, onClick: () => choose(false) }),
|
|
2025
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Option, { label: "Final only", selected: value, onClick: () => choose(true), hint: FINAL_ONLY_TEXT })
|
|
2014
2026
|
]
|
|
2015
2027
|
}
|
|
2016
2028
|
)
|
|
@@ -2022,7 +2034,7 @@ function Option({
|
|
|
2022
2034
|
onClick,
|
|
2023
2035
|
hint
|
|
2024
2036
|
}) {
|
|
2025
|
-
const option = /* @__PURE__ */ (0,
|
|
2037
|
+
const option = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2026
2038
|
"button",
|
|
2027
2039
|
{
|
|
2028
2040
|
type: "button",
|
|
@@ -2034,33 +2046,33 @@ function Option({
|
|
|
2034
2046
|
selected ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
2035
2047
|
),
|
|
2036
2048
|
children: [
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react10.Check, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-brand-primaryAction", !selected && "invisible") }),
|
|
2038
2050
|
label
|
|
2039
2051
|
]
|
|
2040
2052
|
}
|
|
2041
2053
|
);
|
|
2042
2054
|
if (!hint) return option;
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2 pr-2.5", children: [
|
|
2044
2056
|
option,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(InfoTip, { text: hint, trigger: "hover", label: `About ${label}` })
|
|
2046
2058
|
] });
|
|
2047
2059
|
}
|
|
2048
2060
|
|
|
2049
2061
|
// src/SelectFilter.tsx
|
|
2050
2062
|
var import_react8 = require("react");
|
|
2051
2063
|
var import_react_dom2 = require("react-dom");
|
|
2052
|
-
var
|
|
2064
|
+
var import_lucide_react11 = require("lucide-react");
|
|
2053
2065
|
|
|
2054
2066
|
// src/MenuStatus.tsx
|
|
2055
|
-
var
|
|
2067
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2056
2068
|
var ROW_WIDTHS = ["w-3/4", "w-1/2", "w-4/5", "w-3/5"];
|
|
2057
2069
|
function MenuLoading() {
|
|
2058
|
-
return /* @__PURE__ */ (0,
|
|
2070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { role: "status", "aria-label": "Loading options", className: "p-1", children: ROW_WIDTHS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex h-9 items-center px-2", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `inline-block h-3 ${w} animate-pulse rounded-full bg-subtle`, "aria-hidden": "true" }) }, w)) });
|
|
2059
2071
|
}
|
|
2060
2072
|
function MenuError({ onRetry }) {
|
|
2061
|
-
return /* @__PURE__ */ (0,
|
|
2073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { role: "alert", className: "px-3 py-5 text-center text-dense text-text-secondary", children: [
|
|
2062
2074
|
"Couldn't load options.",
|
|
2063
|
-
onRetry && /* @__PURE__ */ (0,
|
|
2075
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2064
2076
|
"button",
|
|
2065
2077
|
{
|
|
2066
2078
|
type: "button",
|
|
@@ -2073,12 +2085,12 @@ function MenuError({ onRetry }) {
|
|
|
2073
2085
|
}
|
|
2074
2086
|
|
|
2075
2087
|
// src/SelectFilter.tsx
|
|
2076
|
-
var
|
|
2088
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2077
2089
|
function slug4(value) {
|
|
2078
2090
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
2079
2091
|
}
|
|
2080
2092
|
function OptionIcon({ children }) {
|
|
2081
|
-
return /* @__PURE__ */ (0,
|
|
2093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2082
2094
|
"span",
|
|
2083
2095
|
{
|
|
2084
2096
|
"aria-hidden": "true",
|
|
@@ -2144,20 +2156,20 @@ function SelectFilter({
|
|
|
2144
2156
|
window.removeEventListener("scroll", reposition, true);
|
|
2145
2157
|
};
|
|
2146
2158
|
}, [open, close, reposition]);
|
|
2147
|
-
const valueContent = renderIcon ? /* @__PURE__ */ (0,
|
|
2148
|
-
/* @__PURE__ */ (0,
|
|
2159
|
+
const valueContent = renderIcon ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(OptionIcon, { children: renderIcon(value) }),
|
|
2149
2161
|
value
|
|
2150
2162
|
] }) : value;
|
|
2151
|
-
const triggerValue = sm && inlineCaption ? /* @__PURE__ */ (0,
|
|
2152
|
-
/* @__PURE__ */ (0,
|
|
2163
|
+
const triggerValue = sm && inlineCaption ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "font-normal text-text-secondary", children: [
|
|
2153
2165
|
caption,
|
|
2154
2166
|
":"
|
|
2155
2167
|
] }),
|
|
2156
2168
|
" ",
|
|
2157
2169
|
valueContent
|
|
2158
2170
|
] }) : valueContent;
|
|
2159
|
-
return /* @__PURE__ */ (0,
|
|
2160
|
-
/* @__PURE__ */ (0,
|
|
2171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, "data-testid": testIdPrefix, children: [
|
|
2172
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2161
2173
|
"button",
|
|
2162
2174
|
{
|
|
2163
2175
|
type: "button",
|
|
@@ -2174,9 +2186,9 @@ function SelectFilter({
|
|
|
2174
2186
|
className
|
|
2175
2187
|
),
|
|
2176
2188
|
children: [
|
|
2177
|
-
sm ? triggerValue : /* @__PURE__ */ (0,
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2179
|
-
|
|
2189
|
+
sm ? triggerValue : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChipContent, { caption, value: triggerValue }),
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2191
|
+
import_lucide_react11.ChevronDown,
|
|
2180
2192
|
{
|
|
2181
2193
|
size: 14,
|
|
2182
2194
|
"aria-hidden": "true",
|
|
@@ -2187,7 +2199,7 @@ function SelectFilter({
|
|
|
2187
2199
|
}
|
|
2188
2200
|
),
|
|
2189
2201
|
open && pos && (0, import_react_dom2.createPortal)(
|
|
2190
|
-
/* @__PURE__ */ (0,
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2191
2203
|
"div",
|
|
2192
2204
|
{
|
|
2193
2205
|
ref: popoverRef,
|
|
@@ -2199,9 +2211,9 @@ function SelectFilter({
|
|
|
2199
2211
|
),
|
|
2200
2212
|
role: loading || error ? "group" : "listbox",
|
|
2201
2213
|
"aria-label": caption,
|
|
2202
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
2214
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "max-h-70 overflow-y-auto p-1", children: options.map((o) => {
|
|
2203
2215
|
const selected = o === value;
|
|
2204
|
-
return /* @__PURE__ */ (0,
|
|
2216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2205
2217
|
"button",
|
|
2206
2218
|
{
|
|
2207
2219
|
type: "button",
|
|
@@ -2214,9 +2226,9 @@ function SelectFilter({
|
|
|
2214
2226
|
},
|
|
2215
2227
|
className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
2216
2228
|
children: [
|
|
2217
|
-
/* @__PURE__ */ (0,
|
|
2218
|
-
renderIcon && /* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react11.Check, { size: 15, strokeWidth: 3 }) }),
|
|
2230
|
+
renderIcon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(OptionIcon, { children: renderIcon(o) }),
|
|
2231
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2220
2232
|
"span",
|
|
2221
2233
|
{
|
|
2222
2234
|
className: cn("flex-1 text-sm", selected ? "font-semibold text-text-primary" : "text-text-primary"),
|
|
@@ -2237,10 +2249,10 @@ function SelectFilter({
|
|
|
2237
2249
|
|
|
2238
2250
|
// src/Card.tsx
|
|
2239
2251
|
var import_react9 = require("react");
|
|
2240
|
-
var
|
|
2252
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2241
2253
|
var Card = (0, import_react9.forwardRef)(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, info, variant = "default", action, className, testIdPrefix, children, ...rest }, ref) {
|
|
2242
2254
|
const chart = variant === "chart";
|
|
2243
|
-
return /* @__PURE__ */ (0,
|
|
2255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2244
2256
|
"article",
|
|
2245
2257
|
{
|
|
2246
2258
|
ref,
|
|
@@ -2253,18 +2265,18 @@ var Card = (0, import_react9.forwardRef)(function Card2({ staticCard, title, tit
|
|
|
2253
2265
|
),
|
|
2254
2266
|
"data-testid": testIdPrefix,
|
|
2255
2267
|
...rest,
|
|
2256
|
-
children: title ? /* @__PURE__ */ (0,
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2258
|
-
/* @__PURE__ */ (0,
|
|
2259
|
-
/* @__PURE__ */ (0,
|
|
2260
|
-
/* @__PURE__ */ (0,
|
|
2261
|
-
info && /* @__PURE__ */ (0,
|
|
2268
|
+
children: title ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "min-w-0", children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
|
|
2273
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
|
|
2262
2274
|
] }),
|
|
2263
|
-
subtitle && /* @__PURE__ */ (0,
|
|
2275
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
2264
2276
|
] }),
|
|
2265
|
-
action && /* @__PURE__ */ (0,
|
|
2277
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
2266
2278
|
] }),
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2279
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children })
|
|
2268
2280
|
] }) : children
|
|
2269
2281
|
}
|
|
2270
2282
|
);
|
|
@@ -2272,9 +2284,9 @@ var Card = (0, import_react9.forwardRef)(function Card2({ staticCard, title, tit
|
|
|
2272
2284
|
|
|
2273
2285
|
// src/StatStrip.tsx
|
|
2274
2286
|
var import_react10 = require("react");
|
|
2275
|
-
var
|
|
2287
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2276
2288
|
var StatStrip = (0, import_react10.forwardRef)(
|
|
2277
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2289
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2278
2290
|
"div",
|
|
2279
2291
|
{
|
|
2280
2292
|
ref,
|
|
@@ -2292,32 +2304,32 @@ var StatStrip = (0, import_react10.forwardRef)(
|
|
|
2292
2304
|
);
|
|
2293
2305
|
StatStrip.displayName = "StatStrip";
|
|
2294
2306
|
function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
|
|
2295
|
-
return /* @__PURE__ */ (0,
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2297
|
-
icon && /* @__PURE__ */ (0,
|
|
2307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
|
|
2309
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
|
|
2298
2310
|
label,
|
|
2299
|
-
info && /* @__PURE__ */ (0,
|
|
2311
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
|
|
2300
2312
|
] }),
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2302
|
-
/* @__PURE__ */ (0,
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
|
|
2303
2315
|
value,
|
|
2304
|
-
unit && /* @__PURE__ */ (0,
|
|
2316
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
|
|
2305
2317
|
" ",
|
|
2306
2318
|
unit
|
|
2307
2319
|
] })
|
|
2308
2320
|
] }),
|
|
2309
|
-
change && /* @__PURE__ */ (0,
|
|
2321
|
+
change && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-card-title font-medium", children: change })
|
|
2310
2322
|
] }),
|
|
2311
|
-
note && /* @__PURE__ */ (0,
|
|
2312
|
-
children && /* @__PURE__ */ (0,
|
|
2323
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs text-text-tertiary", children: note }),
|
|
2324
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-xs text-text-secondary", children })
|
|
2313
2325
|
] });
|
|
2314
2326
|
}
|
|
2315
2327
|
|
|
2316
2328
|
// src/ChartLegend.tsx
|
|
2317
2329
|
var import_react11 = require("react");
|
|
2318
|
-
var
|
|
2330
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2319
2331
|
var ChartLegend = (0, import_react11.forwardRef)(
|
|
2320
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2332
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2321
2333
|
"ul",
|
|
2322
2334
|
{
|
|
2323
2335
|
ref,
|
|
@@ -2337,8 +2349,8 @@ var MARK = {
|
|
|
2337
2349
|
};
|
|
2338
2350
|
function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
|
|
2339
2351
|
const dashed = mark === "dashed";
|
|
2340
|
-
return /* @__PURE__ */ (0,
|
|
2341
|
-
/* @__PURE__ */ (0,
|
|
2352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2342
2354
|
"span",
|
|
2343
2355
|
{
|
|
2344
2356
|
"aria-hidden": "true",
|
|
@@ -2352,7 +2364,7 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2352
2364
|
style: color ? dashed ? { borderColor: color } : { background: color } : void 0
|
|
2353
2365
|
}
|
|
2354
2366
|
),
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2367
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
|
|
2356
2368
|
children,
|
|
2357
2369
|
you && " (you)"
|
|
2358
2370
|
] })
|
|
@@ -2360,30 +2372,30 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2360
2372
|
}
|
|
2361
2373
|
|
|
2362
2374
|
// src/BarList.tsx
|
|
2363
|
-
var
|
|
2375
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2364
2376
|
var COL_WIDTH = ["w-16", "w-13"];
|
|
2365
2377
|
function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
|
|
2366
2378
|
if (!rows.length) {
|
|
2367
|
-
return empty ? /* @__PURE__ */ (0,
|
|
2379
|
+
return empty ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
|
|
2368
2380
|
}
|
|
2369
2381
|
const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
|
|
2370
2382
|
const full = !!columns?.length;
|
|
2371
2383
|
const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
-
full && /* @__PURE__ */ (0,
|
|
2374
|
-
/* @__PURE__ */ (0,
|
|
2375
|
-
columns.map((c, i) => /* @__PURE__ */ (0,
|
|
2384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
|
|
2385
|
+
full && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex-1" }),
|
|
2387
|
+
columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
|
|
2376
2388
|
] }),
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2378
|
-
/* @__PURE__ */ (0,
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("li", { className: "py-2", children: [
|
|
2390
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
|
|
2380
2392
|
r.label,
|
|
2381
|
-
r.note && /* @__PURE__ */ (0,
|
|
2393
|
+
r.note && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "font-normal text-text-tertiary", children: [
|
|
2382
2394
|
" \xB7 ",
|
|
2383
2395
|
r.note
|
|
2384
2396
|
] })
|
|
2385
2397
|
] }),
|
|
2386
|
-
r.values?.map((v, i) => /* @__PURE__ */ (0,
|
|
2398
|
+
r.values?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2387
2399
|
"span",
|
|
2388
2400
|
{
|
|
2389
2401
|
className: cn(
|
|
@@ -2392,7 +2404,7 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2392
2404
|
colClass(i)
|
|
2393
2405
|
),
|
|
2394
2406
|
children: [
|
|
2395
|
-
full && /* @__PURE__ */ (0,
|
|
2407
|
+
full && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "sr-only", children: [
|
|
2396
2408
|
columns[i],
|
|
2397
2409
|
": "
|
|
2398
2410
|
] }),
|
|
@@ -2402,15 +2414,15 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2402
2414
|
i
|
|
2403
2415
|
))
|
|
2404
2416
|
] }),
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2406
|
-
/* @__PURE__ */ (0,
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2407
2419
|
"div",
|
|
2408
2420
|
{
|
|
2409
2421
|
className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
|
|
2410
2422
|
style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
|
|
2411
2423
|
}
|
|
2412
2424
|
),
|
|
2413
|
-
r.tick !== void 0 && /* @__PURE__ */ (0,
|
|
2425
|
+
r.tick !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2414
2426
|
"span",
|
|
2415
2427
|
{
|
|
2416
2428
|
className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
|
|
@@ -2418,14 +2430,14 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2418
2430
|
}
|
|
2419
2431
|
)
|
|
2420
2432
|
] }),
|
|
2421
|
-
r.tickLabel && /* @__PURE__ */ (0,
|
|
2433
|
+
r.tickLabel && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: r.tickLabel })
|
|
2422
2434
|
] }, r.key)) })
|
|
2423
2435
|
] });
|
|
2424
2436
|
}
|
|
2425
2437
|
|
|
2426
2438
|
// src/NoResultsEmptyState.tsx
|
|
2427
|
-
var
|
|
2428
|
-
var
|
|
2439
|
+
var import_lucide_react12 = require("lucide-react");
|
|
2440
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2429
2441
|
var NO_RESULTS_TITLE = "No results match your filters";
|
|
2430
2442
|
var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
|
|
2431
2443
|
function noResultsBody(workspaceName) {
|
|
@@ -2448,12 +2460,12 @@ function NoResultsEmptyState({
|
|
|
2448
2460
|
const showClear = hasFilters !== false && Boolean(onClearFilters);
|
|
2449
2461
|
const showEdit = Boolean(onEditFilters);
|
|
2450
2462
|
const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
|
|
2451
|
-
return /* @__PURE__ */ (0,
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2454
|
-
/* @__PURE__ */ (0,
|
|
2455
|
-
hasActions && /* @__PURE__ */ (0,
|
|
2456
|
-
showClear && /* @__PURE__ */ (0,
|
|
2463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react12.FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2466
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2467
|
+
hasActions && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2468
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2457
2469
|
"button",
|
|
2458
2470
|
{
|
|
2459
2471
|
type: "button",
|
|
@@ -2463,7 +2475,7 @@ function NoResultsEmptyState({
|
|
|
2463
2475
|
children: "Clear all filters"
|
|
2464
2476
|
}
|
|
2465
2477
|
),
|
|
2466
|
-
showEdit && /* @__PURE__ */ (0,
|
|
2478
|
+
showEdit && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2467
2479
|
"button",
|
|
2468
2480
|
{
|
|
2469
2481
|
type: "button",
|
|
@@ -2473,7 +2485,7 @@ function NoResultsEmptyState({
|
|
|
2473
2485
|
children: "Edit filters"
|
|
2474
2486
|
}
|
|
2475
2487
|
),
|
|
2476
|
-
actions?.map((action, i) => /* @__PURE__ */ (0,
|
|
2488
|
+
actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2477
2489
|
"button",
|
|
2478
2490
|
{
|
|
2479
2491
|
type: "button",
|
|
@@ -2489,10 +2501,10 @@ function NoResultsEmptyState({
|
|
|
2489
2501
|
|
|
2490
2502
|
// src/WorkspaceSelectedCard.tsx
|
|
2491
2503
|
var import_react12 = require("react");
|
|
2492
|
-
var
|
|
2493
|
-
var
|
|
2504
|
+
var import_lucide_react13 = require("lucide-react");
|
|
2505
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2494
2506
|
function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
2495
|
-
return /* @__PURE__ */ (0,
|
|
2507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2496
2508
|
"aside",
|
|
2497
2509
|
{
|
|
2498
2510
|
className: cn(
|
|
@@ -2500,7 +2512,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
|
2500
2512
|
className
|
|
2501
2513
|
),
|
|
2502
2514
|
"data-testid": testIdPrefix,
|
|
2503
|
-
children: /* @__PURE__ */ (0,
|
|
2515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
|
|
2504
2516
|
}
|
|
2505
2517
|
);
|
|
2506
2518
|
}
|
|
@@ -2519,8 +2531,8 @@ function SummaryGroupItem({
|
|
|
2519
2531
|
else if (expandCount === 0) setOpen(false);
|
|
2520
2532
|
wasEmpty.current = expandCount === 0;
|
|
2521
2533
|
}, [expandCount]);
|
|
2522
|
-
return /* @__PURE__ */ (0,
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2524
2536
|
"button",
|
|
2525
2537
|
{
|
|
2526
2538
|
type: "button",
|
|
@@ -2529,45 +2541,45 @@ function SummaryGroupItem({
|
|
|
2529
2541
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2530
2542
|
className: "flex w-full min-w-0 items-center gap-2 text-left focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
2531
2543
|
children: [
|
|
2532
|
-
/* @__PURE__ */ (0,
|
|
2533
|
-
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2545
|
+
import_lucide_react13.ChevronDown,
|
|
2534
2546
|
{
|
|
2535
2547
|
size: 14,
|
|
2536
2548
|
"aria-hidden": "true",
|
|
2537
2549
|
className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
|
|
2538
2550
|
}
|
|
2539
2551
|
),
|
|
2540
|
-
/* @__PURE__ */ (0,
|
|
2541
|
-
/* @__PURE__ */ (0,
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
|
|
2542
2554
|
]
|
|
2543
2555
|
}
|
|
2544
2556
|
),
|
|
2545
|
-
open && /* @__PURE__ */ (0,
|
|
2546
|
-
ownCount > 0 && /* @__PURE__ */ (0,
|
|
2547
|
-
group.items.map((item) => /* @__PURE__ */ (0,
|
|
2557
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
|
|
2558
|
+
ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
2559
|
+
group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2548
2560
|
"div",
|
|
2549
2561
|
{
|
|
2550
2562
|
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
2551
2563
|
children: [
|
|
2552
|
-
/* @__PURE__ */ (0,
|
|
2553
|
-
/* @__PURE__ */ (0,
|
|
2554
|
-
item.meta && /* @__PURE__ */ (0,
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
|
|
2566
|
+
item.meta && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
|
|
2555
2567
|
] }),
|
|
2556
|
-
/* @__PURE__ */ (0,
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2557
2569
|
"button",
|
|
2558
2570
|
{
|
|
2559
2571
|
type: "button",
|
|
2560
2572
|
"aria-label": `Remove ${item.name}`,
|
|
2561
2573
|
onClick: () => group.onRemove(item.id),
|
|
2562
2574
|
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-control text-text-secondary hover:bg-subtle hover:text-text-danger focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
2563
|
-
children: /* @__PURE__ */ (0,
|
|
2575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react13.X, { size: 12, "aria-hidden": "true" })
|
|
2564
2576
|
}
|
|
2565
2577
|
)
|
|
2566
2578
|
]
|
|
2567
2579
|
},
|
|
2568
2580
|
item.id
|
|
2569
2581
|
)),
|
|
2570
|
-
/* @__PURE__ */ (0,
|
|
2582
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2571
2583
|
"button",
|
|
2572
2584
|
{
|
|
2573
2585
|
type: "button",
|
|
@@ -2578,13 +2590,13 @@ function SummaryGroupItem({
|
|
|
2578
2590
|
}
|
|
2579
2591
|
)
|
|
2580
2592
|
] }),
|
|
2581
|
-
group.subGroups?.map((sg) => /* @__PURE__ */ (0,
|
|
2593
|
+
group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
|
|
2582
2594
|
] }) })
|
|
2583
2595
|
] });
|
|
2584
2596
|
}
|
|
2585
2597
|
|
|
2586
2598
|
// src/chart-placeholder-shared.tsx
|
|
2587
|
-
var
|
|
2599
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2588
2600
|
var GRID_ROWS = [0, 25, 50, 75, 100];
|
|
2589
2601
|
var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
|
|
2590
2602
|
var Y_AXIS_W = 48;
|
|
@@ -2598,9 +2610,9 @@ function AxisFrame({
|
|
|
2598
2610
|
testIdPrefix
|
|
2599
2611
|
}) {
|
|
2600
2612
|
const gutter = xTicks > 0 ? X_AXIS_H : 0;
|
|
2601
|
-
return /* @__PURE__ */ (0,
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
2603
|
-
GRID_ROWS.map((pct) => /* @__PURE__ */ (0,
|
|
2613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative h-full w-full", children: [
|
|
2614
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
|
|
2615
|
+
GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2604
2616
|
"div",
|
|
2605
2617
|
{
|
|
2606
2618
|
className: "absolute inset-x-0 border-t border-dashed",
|
|
@@ -2608,9 +2620,9 @@ function AxisFrame({
|
|
|
2608
2620
|
},
|
|
2609
2621
|
pct
|
|
2610
2622
|
)),
|
|
2611
|
-
/* @__PURE__ */ (0,
|
|
2623
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0", children })
|
|
2612
2624
|
] }),
|
|
2613
|
-
/* @__PURE__ */ (0,
|
|
2625
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2614
2626
|
"div",
|
|
2615
2627
|
{
|
|
2616
2628
|
className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
|
|
@@ -2618,27 +2630,27 @@ function AxisFrame({
|
|
|
2618
2630
|
},
|
|
2619
2631
|
pct
|
|
2620
2632
|
)) }),
|
|
2621
|
-
xTicks > 0 && /* @__PURE__ */ (0,
|
|
2633
|
+
xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2622
2634
|
"div",
|
|
2623
2635
|
{
|
|
2624
2636
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2625
2637
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2626
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0,
|
|
2638
|
+
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
|
|
2627
2639
|
}
|
|
2628
2640
|
)
|
|
2629
2641
|
] }) });
|
|
2630
2642
|
}
|
|
2631
2643
|
function BlankLegend({ rows, reverse = false }) {
|
|
2632
|
-
return /* @__PURE__ */ (0,
|
|
2644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2633
2645
|
"ul",
|
|
2634
2646
|
{
|
|
2635
2647
|
className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
|
|
2636
2648
|
role: "presentation",
|
|
2637
2649
|
"aria-hidden": "true",
|
|
2638
|
-
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0,
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2641
|
-
/* @__PURE__ */ (0,
|
|
2650
|
+
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
|
|
2651
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
2652
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
|
|
2653
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2642
2654
|
"span",
|
|
2643
2655
|
{
|
|
2644
2656
|
className: "h-2 rounded-xs bg-subtle",
|
|
@@ -2646,21 +2658,21 @@ function BlankLegend({ rows, reverse = false }) {
|
|
|
2646
2658
|
}
|
|
2647
2659
|
)
|
|
2648
2660
|
] }),
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2661
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
|
|
2650
2662
|
] }, i))
|
|
2651
2663
|
}
|
|
2652
2664
|
);
|
|
2653
2665
|
}
|
|
2654
2666
|
|
|
2655
2667
|
// src/BarChartPlaceholder.tsx
|
|
2656
|
-
var
|
|
2668
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2657
2669
|
var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
|
|
2658
2670
|
function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
|
|
2660
2672
|
}
|
|
2661
2673
|
|
|
2662
2674
|
// src/LineChartPlaceholder.tsx
|
|
2663
|
-
var
|
|
2675
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2664
2676
|
var LINE_SERIES = [
|
|
2665
2677
|
[58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
|
|
2666
2678
|
[74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
|
|
@@ -2670,9 +2682,9 @@ var LINE_SERIES = [
|
|
|
2670
2682
|
var LINE_FORECAST_FROM = 7;
|
|
2671
2683
|
function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
2672
2684
|
const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
|
|
2673
|
-
return /* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("g", { children: [
|
|
2687
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2676
2688
|
"polyline",
|
|
2677
2689
|
{
|
|
2678
2690
|
points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
|
|
@@ -2684,7 +2696,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2684
2696
|
strokeLinejoin: "round"
|
|
2685
2697
|
}
|
|
2686
2698
|
),
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2699
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2688
2700
|
"polyline",
|
|
2689
2701
|
{
|
|
2690
2702
|
points: toPath(pts, LINE_FORECAST_FROM, pts.length),
|
|
@@ -2699,7 +2711,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2699
2711
|
)
|
|
2700
2712
|
] }, s)) }),
|
|
2701
2713
|
LINE_SERIES.map(
|
|
2702
|
-
(pts, s) => pts.map((y, i) => /* @__PURE__ */ (0,
|
|
2714
|
+
(pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2703
2715
|
"div",
|
|
2704
2716
|
{
|
|
2705
2717
|
className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
@@ -2716,16 +2728,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2716
2728
|
}
|
|
2717
2729
|
|
|
2718
2730
|
// src/PieChartPlaceholder.tsx
|
|
2719
|
-
var
|
|
2731
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2720
2732
|
var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
|
|
2721
2733
|
function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
|
|
2722
2734
|
const r = 45;
|
|
2723
|
-
return /* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2725
|
-
/* @__PURE__ */ (0,
|
|
2735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
|
|
2737
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
|
|
2726
2738
|
PIE_SEAMS.map((deg) => {
|
|
2727
2739
|
const rad = (deg - 90) * Math.PI / 180;
|
|
2728
|
-
return /* @__PURE__ */ (0,
|
|
2740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2729
2741
|
"line",
|
|
2730
2742
|
{
|
|
2731
2743
|
x1: "50",
|
|
@@ -2739,12 +2751,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
|
|
|
2739
2751
|
);
|
|
2740
2752
|
})
|
|
2741
2753
|
] }) }),
|
|
2742
|
-
/* @__PURE__ */ (0,
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BlankLegend, { rows: legendRows })
|
|
2743
2755
|
] });
|
|
2744
2756
|
}
|
|
2745
2757
|
|
|
2746
2758
|
// src/StackedColumnPlaceholder.tsx
|
|
2747
|
-
var
|
|
2759
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2748
2760
|
var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
|
|
2749
2761
|
function columnBands(count) {
|
|
2750
2762
|
const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
|
|
@@ -2759,7 +2771,7 @@ function StackedColumnPlaceholder({
|
|
|
2759
2771
|
className,
|
|
2760
2772
|
testIdPrefix
|
|
2761
2773
|
}) {
|
|
2762
|
-
const column = /* @__PURE__ */ (0,
|
|
2774
|
+
const column = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2763
2775
|
"div",
|
|
2764
2776
|
{
|
|
2765
2777
|
style: {
|
|
@@ -2771,16 +2783,16 @@ function StackedColumnPlaceholder({
|
|
|
2771
2783
|
},
|
|
2772
2784
|
i
|
|
2773
2785
|
)) });
|
|
2774
|
-
return /* @__PURE__ */ (0,
|
|
2775
|
-
axis ? /* @__PURE__ */ (0,
|
|
2776
|
-
/* @__PURE__ */ (0,
|
|
2786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2787
|
+
axis ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-stretch py-1", children: column }),
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
|
|
2777
2789
|
] });
|
|
2778
2790
|
}
|
|
2779
2791
|
|
|
2780
2792
|
// src/Tooltip.tsx
|
|
2781
2793
|
var import_react13 = require("react");
|
|
2782
2794
|
var import_react_dom3 = require("react-dom");
|
|
2783
|
-
var
|
|
2795
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2784
2796
|
function addDescribedBy(el, id) {
|
|
2785
2797
|
const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
|
|
2786
2798
|
if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
|
|
@@ -2966,7 +2978,7 @@ function Tooltip({
|
|
|
2966
2978
|
}
|
|
2967
2979
|
}
|
|
2968
2980
|
const floating = anchor != null && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
|
|
2969
|
-
/* @__PURE__ */ (0,
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2970
2982
|
"span",
|
|
2971
2983
|
{
|
|
2972
2984
|
ref: boxRef,
|
|
@@ -2997,7 +3009,7 @@ function Tooltip({
|
|
|
2997
3009
|
document.body
|
|
2998
3010
|
) : null;
|
|
2999
3011
|
if (anchorRef) return floating;
|
|
3000
|
-
return /* @__PURE__ */ (0,
|
|
3012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3001
3013
|
"span",
|
|
3002
3014
|
{
|
|
3003
3015
|
ref,
|
|
@@ -3019,28 +3031,28 @@ function Tooltip({
|
|
|
3019
3031
|
}
|
|
3020
3032
|
|
|
3021
3033
|
// src/AdvertiserNoResults.tsx
|
|
3022
|
-
var
|
|
3034
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3023
3035
|
function AdvertiserNoResults({
|
|
3024
3036
|
query,
|
|
3025
3037
|
hint = "Try checking your spelling or searching for a broader brand name.",
|
|
3026
3038
|
className,
|
|
3027
3039
|
testIdPrefix
|
|
3028
3040
|
}) {
|
|
3029
|
-
return /* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
3031
3043
|
"No results found for \u201C",
|
|
3032
3044
|
query,
|
|
3033
3045
|
"\u201D"
|
|
3034
3046
|
] }),
|
|
3035
|
-
/* @__PURE__ */ (0,
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
3036
3048
|
] });
|
|
3037
3049
|
}
|
|
3038
3050
|
|
|
3039
3051
|
// src/SelectAllVisible.tsx
|
|
3040
|
-
var
|
|
3041
|
-
var
|
|
3052
|
+
var import_lucide_react14 = require("lucide-react");
|
|
3053
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3042
3054
|
function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
|
|
3043
|
-
return /* @__PURE__ */ (0,
|
|
3055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3044
3056
|
"button",
|
|
3045
3057
|
{
|
|
3046
3058
|
type: "button",
|
|
@@ -3051,7 +3063,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
3051
3063
|
className
|
|
3052
3064
|
),
|
|
3053
3065
|
children: [
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ListChecks, { size: 14, "aria-hidden": "true" }),
|
|
3055
3067
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
3056
3068
|
]
|
|
3057
3069
|
}
|
|
@@ -3059,12 +3071,12 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
3059
3071
|
}
|
|
3060
3072
|
|
|
3061
3073
|
// src/SelectedSection.tsx
|
|
3062
|
-
var
|
|
3063
|
-
var
|
|
3074
|
+
var import_lucide_react15 = require("lucide-react");
|
|
3075
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3064
3076
|
function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
|
|
3065
3077
|
if (count === 0) return null;
|
|
3066
|
-
return /* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3068
3080
|
"button",
|
|
3069
3081
|
{
|
|
3070
3082
|
type: "button",
|
|
@@ -3073,25 +3085,25 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
|
|
|
3073
3085
|
"aria-expanded": open,
|
|
3074
3086
|
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 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
3075
3087
|
children: [
|
|
3076
|
-
/* @__PURE__ */ (0,
|
|
3088
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
|
|
3077
3089
|
"Selected (",
|
|
3078
3090
|
count,
|
|
3079
3091
|
")"
|
|
3080
3092
|
]
|
|
3081
3093
|
}
|
|
3082
3094
|
),
|
|
3083
|
-
open && /* @__PURE__ */ (0,
|
|
3095
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex flex-col gap-0.5", children })
|
|
3084
3096
|
] });
|
|
3085
3097
|
}
|
|
3086
3098
|
|
|
3087
3099
|
// src/SelectionPicker.tsx
|
|
3088
3100
|
var import_react15 = require("react");
|
|
3089
3101
|
var import_react_dom4 = require("react-dom");
|
|
3090
|
-
var
|
|
3102
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3091
3103
|
|
|
3092
3104
|
// src/Tabs.tsx
|
|
3093
3105
|
var import_react14 = require("react");
|
|
3094
|
-
var
|
|
3106
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3095
3107
|
function arrowKeys(e, row) {
|
|
3096
3108
|
if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
|
|
3097
3109
|
const items = Array.from(row.querySelectorAll("button:not([disabled])"));
|
|
@@ -3103,7 +3115,7 @@ function arrowKeys(e, row) {
|
|
|
3103
3115
|
}
|
|
3104
3116
|
function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
|
|
3105
3117
|
const row = (0, import_react14.useRef)(null);
|
|
3106
|
-
return /* @__PURE__ */ (0,
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3107
3119
|
"div",
|
|
3108
3120
|
{
|
|
3109
3121
|
ref: row,
|
|
@@ -3114,7 +3126,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3114
3126
|
className: cn("flex gap-6 border-b border-border-default", className),
|
|
3115
3127
|
children: items.map((item) => {
|
|
3116
3128
|
const on = item.value === value;
|
|
3117
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3118
3130
|
"button",
|
|
3119
3131
|
{
|
|
3120
3132
|
type: "button",
|
|
@@ -3132,7 +3144,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3132
3144
|
),
|
|
3133
3145
|
children: [
|
|
3134
3146
|
item.label,
|
|
3135
|
-
item.count !== void 0 && /* @__PURE__ */ (0,
|
|
3147
|
+
item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
|
|
3136
3148
|
]
|
|
3137
3149
|
},
|
|
3138
3150
|
item.value
|
|
@@ -3151,7 +3163,7 @@ function SegmentedControl({
|
|
|
3151
3163
|
...rest
|
|
3152
3164
|
}) {
|
|
3153
3165
|
const row = (0, import_react14.useRef)(null);
|
|
3154
|
-
return /* @__PURE__ */ (0,
|
|
3166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3155
3167
|
"div",
|
|
3156
3168
|
{
|
|
3157
3169
|
ref: row,
|
|
@@ -3162,7 +3174,7 @@ function SegmentedControl({
|
|
|
3162
3174
|
className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
|
|
3163
3175
|
children: options.map((o) => {
|
|
3164
3176
|
const on = o.value === value;
|
|
3165
|
-
return /* @__PURE__ */ (0,
|
|
3177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3166
3178
|
"button",
|
|
3167
3179
|
{
|
|
3168
3180
|
type: "button",
|
|
@@ -3186,7 +3198,7 @@ function SegmentedControl({
|
|
|
3186
3198
|
}
|
|
3187
3199
|
|
|
3188
3200
|
// src/SelectionPicker.tsx
|
|
3189
|
-
var
|
|
3201
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3190
3202
|
function slug5(value) {
|
|
3191
3203
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
3192
3204
|
}
|
|
@@ -3279,12 +3291,12 @@ function SelectionPicker({
|
|
|
3279
3291
|
}
|
|
3280
3292
|
};
|
|
3281
3293
|
const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
|
|
3282
|
-
return /* @__PURE__ */ (0,
|
|
3283
|
-
helper && /* @__PURE__ */ (0,
|
|
3284
|
-
/* @__PURE__ */ (0,
|
|
3285
|
-
/* @__PURE__ */ (0,
|
|
3294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
3295
|
+
helper && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-secondary", children: helper }),
|
|
3297
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
|
|
3286
3298
|
] }),
|
|
3287
|
-
hasAccountLists && /* @__PURE__ */ (0,
|
|
3299
|
+
hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3288
3300
|
SegmentedControl,
|
|
3289
3301
|
{
|
|
3290
3302
|
"aria-label": "Add from",
|
|
@@ -3297,11 +3309,11 @@ function SelectionPicker({
|
|
|
3297
3309
|
]
|
|
3298
3310
|
}
|
|
3299
3311
|
),
|
|
3300
|
-
source === "search" && /* @__PURE__ */ (0,
|
|
3301
|
-
/* @__PURE__ */ (0,
|
|
3302
|
-
/* @__PURE__ */ (0,
|
|
3303
|
-
/* @__PURE__ */ (0,
|
|
3304
|
-
/* @__PURE__ */ (0,
|
|
3312
|
+
source === "search" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex h-8 min-w-50 flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3316
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3305
3317
|
"input",
|
|
3306
3318
|
{
|
|
3307
3319
|
value: query,
|
|
@@ -3317,7 +3329,7 @@ function SelectionPicker({
|
|
|
3317
3329
|
}
|
|
3318
3330
|
)
|
|
3319
3331
|
] }),
|
|
3320
|
-
filters.map((f) => /* @__PURE__ */ (0,
|
|
3332
|
+
filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3321
3333
|
FilterDropdown,
|
|
3322
3334
|
{
|
|
3323
3335
|
filter: f,
|
|
@@ -3329,14 +3341,14 @@ function SelectionPicker({
|
|
|
3329
3341
|
)),
|
|
3330
3342
|
toolbarExtra
|
|
3331
3343
|
] }),
|
|
3332
|
-
!hasSearched ? /* @__PURE__ */ (0,
|
|
3333
|
-
/* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3344
|
+
!hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3345
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3346
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
3347
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
|
|
3337
3349
|
] })
|
|
3338
|
-
] }) : /* @__PURE__ */ (0,
|
|
3339
|
-
/* @__PURE__ */ (0,
|
|
3350
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
|
|
3351
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3340
3352
|
"div",
|
|
3341
3353
|
{
|
|
3342
3354
|
className: cn(
|
|
@@ -3344,7 +3356,7 @@ function SelectionPicker({
|
|
|
3344
3356
|
rowGridCols
|
|
3345
3357
|
),
|
|
3346
3358
|
children: [
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3359
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3348
3360
|
CheckBox,
|
|
3349
3361
|
{
|
|
3350
3362
|
checked: allSelected,
|
|
@@ -3355,18 +3367,18 @@ function SelectionPicker({
|
|
|
3355
3367
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
|
|
3356
3368
|
}
|
|
3357
3369
|
),
|
|
3358
|
-
/* @__PURE__ */ (0,
|
|
3359
|
-
showInfoColumn && /* @__PURE__ */ (0,
|
|
3370
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
|
|
3371
|
+
showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-right", children: "Info" })
|
|
3360
3372
|
]
|
|
3361
3373
|
}
|
|
3362
3374
|
),
|
|
3363
|
-
/* @__PURE__ */ (0,
|
|
3375
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
|
|
3364
3376
|
const isSel = selectedIds.has(row.id);
|
|
3365
3377
|
const isLocked = lockedIds?.has(row.id) ?? false;
|
|
3366
3378
|
const kids = getChildren?.(row);
|
|
3367
3379
|
const isOpen = expanded.has(row.id);
|
|
3368
|
-
return /* @__PURE__ */ (0,
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
|
|
3381
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3370
3382
|
"div",
|
|
3371
3383
|
{
|
|
3372
3384
|
onClick: isLocked ? void 0 : () => toggleRow(row),
|
|
@@ -3379,7 +3391,7 @@ function SelectionPicker({
|
|
|
3379
3391
|
!isLocked && isSel && "opacity-70"
|
|
3380
3392
|
),
|
|
3381
3393
|
children: [
|
|
3382
|
-
isLocked ? /* @__PURE__ */ (0,
|
|
3394
|
+
isLocked ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3383
3395
|
CheckBox,
|
|
3384
3396
|
{
|
|
3385
3397
|
checked: isSel,
|
|
@@ -3388,8 +3400,8 @@ function SelectionPicker({
|
|
|
3388
3400
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
|
|
3389
3401
|
}
|
|
3390
3402
|
),
|
|
3391
|
-
/* @__PURE__ */ (0,
|
|
3392
|
-
showInfoColumn && /* @__PURE__ */ (0,
|
|
3403
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
|
|
3404
|
+
showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3393
3405
|
"button",
|
|
3394
3406
|
{
|
|
3395
3407
|
type: "button",
|
|
@@ -3403,28 +3415,28 @@ function SelectionPicker({
|
|
|
3403
3415
|
});
|
|
3404
3416
|
},
|
|
3405
3417
|
className: "flex h-7 w-7 items-center justify-center rounded-control text-text-secondary hover:bg-canvas hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3406
|
-
children: /* @__PURE__ */ (0,
|
|
3418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.ChevronRight, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3407
3419
|
}
|
|
3408
|
-
) : /* @__PURE__ */ (0,
|
|
3420
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3409
3421
|
"span",
|
|
3410
3422
|
{
|
|
3411
3423
|
className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
|
|
3412
3424
|
title: "No additional details",
|
|
3413
|
-
children: /* @__PURE__ */ (0,
|
|
3425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Info, { size: 14 })
|
|
3414
3426
|
}
|
|
3415
3427
|
) })
|
|
3416
3428
|
]
|
|
3417
3429
|
}
|
|
3418
3430
|
),
|
|
3419
|
-
isOpen && kids && /* @__PURE__ */ (0,
|
|
3431
|
+
isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
|
|
3420
3432
|
const kidSel = selectedIds.has(kid.id);
|
|
3421
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3422
3434
|
"div",
|
|
3423
3435
|
{
|
|
3424
3436
|
className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
|
|
3425
3437
|
children: [
|
|
3426
|
-
/* @__PURE__ */ (0,
|
|
3427
|
-
/* @__PURE__ */ (0,
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3428
3440
|
"button",
|
|
3429
3441
|
{
|
|
3430
3442
|
type: "button",
|
|
@@ -3435,7 +3447,7 @@ function SelectionPicker({
|
|
|
3435
3447
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3436
3448
|
),
|
|
3437
3449
|
children: [
|
|
3438
|
-
kidSel ? /* @__PURE__ */ (0,
|
|
3450
|
+
kidSel ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Plus, { size: 13 }),
|
|
3439
3451
|
kidSel ? "Added" : "Add"
|
|
3440
3452
|
]
|
|
3441
3453
|
}
|
|
@@ -3447,7 +3459,7 @@ function SelectionPicker({
|
|
|
3447
3459
|
}) })
|
|
3448
3460
|
] }, row.id);
|
|
3449
3461
|
}) }),
|
|
3450
|
-
!loading && !error && hasMore && /* @__PURE__ */ (0,
|
|
3462
|
+
!loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3451
3463
|
"button",
|
|
3452
3464
|
{
|
|
3453
3465
|
type: "button",
|
|
@@ -3456,19 +3468,19 @@ function SelectionPicker({
|
|
|
3456
3468
|
"data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
|
|
3457
3469
|
className: "flex w-full items-center justify-center gap-2 border-t border-border-default px-2 py-1.5 text-dense text-brand-primaryAction transition-colors hover:bg-subtle disabled:opacity-50 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
3458
3470
|
children: [
|
|
3459
|
-
loadingMore ? /* @__PURE__ */ (0,
|
|
3471
|
+
loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
|
|
3460
3472
|
loadingMore ? "Loading\u2026" : "Load more"
|
|
3461
3473
|
]
|
|
3462
3474
|
}
|
|
3463
3475
|
)
|
|
3464
3476
|
] })
|
|
3465
3477
|
] }),
|
|
3466
|
-
source === "lists" && /* @__PURE__ */ (0,
|
|
3467
|
-
/* @__PURE__ */ (0,
|
|
3468
|
-
accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0,
|
|
3469
|
-
/* @__PURE__ */ (0,
|
|
3478
|
+
source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3479
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
|
|
3480
|
+
accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
|
|
3470
3482
|
const on = (selectedListIds ?? []).includes(list.id);
|
|
3471
|
-
return /* @__PURE__ */ (0,
|
|
3483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3472
3484
|
"button",
|
|
3473
3485
|
{
|
|
3474
3486
|
type: "button",
|
|
@@ -3480,19 +3492,19 @@ function SelectionPicker({
|
|
|
3480
3492
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3481
3493
|
),
|
|
3482
3494
|
children: [
|
|
3483
|
-
/* @__PURE__ */ (0,
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3484
3496
|
"span",
|
|
3485
3497
|
{
|
|
3486
3498
|
className: cn(
|
|
3487
3499
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
3488
3500
|
on ? "text-brand-primaryAction" : "text-text-secondary"
|
|
3489
3501
|
),
|
|
3490
|
-
children: on ? /* @__PURE__ */ (0,
|
|
3502
|
+
children: on ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Plus, { size: 16 })
|
|
3491
3503
|
}
|
|
3492
3504
|
),
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3495
|
-
/* @__PURE__ */ (0,
|
|
3505
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
3506
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "block truncate text-xs text-text-secondary", children: [
|
|
3496
3508
|
list.count,
|
|
3497
3509
|
" accounts \xB7 ",
|
|
3498
3510
|
list.entityTypes.join(", "),
|
|
@@ -3500,13 +3512,13 @@ function SelectionPicker({
|
|
|
3500
3512
|
formatListDate(list.updatedAt)
|
|
3501
3513
|
] })
|
|
3502
3514
|
] }),
|
|
3503
|
-
/* @__PURE__ */ (0,
|
|
3515
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
|
|
3504
3516
|
]
|
|
3505
3517
|
},
|
|
3506
3518
|
list.id
|
|
3507
3519
|
);
|
|
3508
3520
|
}) }),
|
|
3509
|
-
/* @__PURE__ */ (0,
|
|
3521
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3510
3522
|
"p",
|
|
3511
3523
|
{
|
|
3512
3524
|
className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
|
|
@@ -3518,11 +3530,11 @@ function SelectionPicker({
|
|
|
3518
3530
|
]
|
|
3519
3531
|
}
|
|
3520
3532
|
)
|
|
3521
|
-
] }) : /* @__PURE__ */ (0,
|
|
3522
|
-
/* @__PURE__ */ (0,
|
|
3523
|
-
/* @__PURE__ */ (0,
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3533
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3535
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
3536
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
|
|
3537
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
|
|
3526
3538
|
] })
|
|
3527
3539
|
] })
|
|
3528
3540
|
] })
|
|
@@ -3554,7 +3566,7 @@ function ScrollFade({ className, children }) {
|
|
|
3554
3566
|
[sync]
|
|
3555
3567
|
);
|
|
3556
3568
|
const mask = edges.top || edges.bottom ? `linear-gradient(to bottom, transparent 0, #000 ${edges.top ? EDGE_FADE : 0}px, #000 calc(100% - ${edges.bottom ? EDGE_FADE : 0}px), transparent 100%)` : void 0;
|
|
3557
|
-
return /* @__PURE__ */ (0,
|
|
3569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
|
|
3558
3570
|
}
|
|
3559
3571
|
function formatListDate(iso) {
|
|
3560
3572
|
try {
|
|
@@ -3604,8 +3616,8 @@ function FilterDropdown({
|
|
|
3604
3616
|
const count = active.size;
|
|
3605
3617
|
const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
|
|
3606
3618
|
const filterSlug = slug5(filter.label);
|
|
3607
|
-
return /* @__PURE__ */ (0,
|
|
3608
|
-
/* @__PURE__ */ (0,
|
|
3619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "relative", children: [
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3609
3621
|
"button",
|
|
3610
3622
|
{
|
|
3611
3623
|
ref: btnRef,
|
|
@@ -3616,12 +3628,12 @@ function FilterDropdown({
|
|
|
3616
3628
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-dense font-medium text-text-secondary transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3617
3629
|
children: [
|
|
3618
3630
|
label,
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3631
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
3620
3632
|
]
|
|
3621
3633
|
}
|
|
3622
3634
|
),
|
|
3623
3635
|
open && pos && (0, import_react_dom4.createPortal)(
|
|
3624
|
-
/* @__PURE__ */ (0,
|
|
3636
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3625
3637
|
"div",
|
|
3626
3638
|
{
|
|
3627
3639
|
ref: menuRef,
|
|
@@ -3630,9 +3642,9 @@ function FilterDropdown({
|
|
|
3630
3642
|
style: { top: pos.top, left: pos.left },
|
|
3631
3643
|
className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
3632
3644
|
children: [
|
|
3633
|
-
searchable && /* @__PURE__ */ (0,
|
|
3634
|
-
/* @__PURE__ */ (0,
|
|
3635
|
-
/* @__PURE__ */ (0,
|
|
3645
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime31.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: [
|
|
3646
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
3647
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3636
3648
|
"input",
|
|
3637
3649
|
{
|
|
3638
3650
|
autoFocus: true,
|
|
@@ -3643,14 +3655,14 @@ function FilterDropdown({
|
|
|
3643
3655
|
}
|
|
3644
3656
|
)
|
|
3645
3657
|
] }),
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
3658
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
|
|
3647
3659
|
const on = active.has(opt);
|
|
3648
|
-
return /* @__PURE__ */ (0,
|
|
3660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3649
3661
|
"label",
|
|
3650
3662
|
{
|
|
3651
3663
|
className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
|
|
3652
3664
|
children: [
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3654
3666
|
CheckBox,
|
|
3655
3667
|
{
|
|
3656
3668
|
checked: on,
|
|
@@ -3681,7 +3693,7 @@ function gridForColumns(columns) {
|
|
|
3681
3693
|
|
|
3682
3694
|
// src/PublisherBreakdownList.tsx
|
|
3683
3695
|
var import_react16 = require("react");
|
|
3684
|
-
var
|
|
3696
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3685
3697
|
var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
|
|
3686
3698
|
function priorYearAmt(spendN, yoy) {
|
|
3687
3699
|
if (yoy === "NEW" || yoy <= -100) return null;
|
|
@@ -3693,7 +3705,7 @@ function initials(name) {
|
|
|
3693
3705
|
return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
|
|
3694
3706
|
}
|
|
3695
3707
|
function Monogram({ name, size = 28 }) {
|
|
3696
|
-
return /* @__PURE__ */ (0,
|
|
3708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3697
3709
|
"span",
|
|
3698
3710
|
{
|
|
3699
3711
|
"aria-hidden": "true",
|
|
@@ -3704,12 +3716,12 @@ function Monogram({ name, size = 28 }) {
|
|
|
3704
3716
|
);
|
|
3705
3717
|
}
|
|
3706
3718
|
function BreakdownTag({ children }) {
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
3719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.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 });
|
|
3708
3720
|
}
|
|
3709
3721
|
function DelayedTip({ label, children }) {
|
|
3710
|
-
return /* @__PURE__ */ (0,
|
|
3722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
3711
3723
|
children,
|
|
3712
|
-
/* @__PURE__ */ (0,
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3713
3725
|
"span",
|
|
3714
3726
|
{
|
|
3715
3727
|
role: "tooltip",
|
|
@@ -3723,22 +3735,22 @@ var COL_CURRENT = 76;
|
|
|
3723
3735
|
var COL_PREVIOUS = 76;
|
|
3724
3736
|
var COL_YOY = 44;
|
|
3725
3737
|
function MetricListHeader({ className }) {
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3727
|
-
/* @__PURE__ */ (0,
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
3730
|
-
/* @__PURE__ */ (0,
|
|
3731
|
-
/* @__PURE__ */ (0,
|
|
3738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex-1" }),
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3741
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
|
|
3732
3744
|
] })
|
|
3733
3745
|
] });
|
|
3734
3746
|
}
|
|
3735
3747
|
function MetricCells({ spendN, yoy }) {
|
|
3736
3748
|
const prior = priorYearAmt(spendN, yoy);
|
|
3737
3749
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3738
|
-
return /* @__PURE__ */ (0,
|
|
3739
|
-
/* @__PURE__ */ (0,
|
|
3740
|
-
/* @__PURE__ */ (0,
|
|
3741
|
-
/* @__PURE__ */ (0,
|
|
3750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
3752
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
3753
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime32.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_runtime32.jsxs)("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
|
|
3742
3754
|
up ? "+" : "\u2212",
|
|
3743
3755
|
Math.abs(yoy),
|
|
3744
3756
|
"%"
|
|
@@ -3757,35 +3769,35 @@ function PublisherBreakdownList({
|
|
|
3757
3769
|
const [showAll, setShowAll] = (0, import_react16.useState)(false);
|
|
3758
3770
|
const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
|
|
3759
3771
|
const rowPad = padded ? "px-5" : "";
|
|
3760
|
-
return /* @__PURE__ */ (0,
|
|
3761
|
-
/* @__PURE__ */ (0,
|
|
3762
|
-
/* @__PURE__ */ (0,
|
|
3763
|
-
visible.map((p) => /* @__PURE__ */ (0,
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3765
|
-
renderLogo ? renderLogo(p) : /* @__PURE__ */ (0,
|
|
3766
|
-
/* @__PURE__ */ (0,
|
|
3767
|
-
/* @__PURE__ */ (0,
|
|
3768
|
-
/* @__PURE__ */ (0,
|
|
3769
|
-
p.tags.map((t) => /* @__PURE__ */ (0,
|
|
3772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3773
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col", children: [
|
|
3774
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MetricListHeader, { className: rowPad }),
|
|
3775
|
+
visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
3777
|
+
renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Monogram, { name: p.brand, size: 28 }),
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0", children: [
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
3781
|
+
p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BreakdownTag, { children: t }, t))
|
|
3770
3782
|
] }),
|
|
3771
|
-
/* @__PURE__ */ (0,
|
|
3783
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
|
|
3772
3784
|
] })
|
|
3773
3785
|
] }),
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3775
3787
|
] }, p.brand))
|
|
3776
3788
|
] }),
|
|
3777
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0,
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
3789
|
+
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { href: viewAllHref, className: "text-xs font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
|
|
3779
3791
|
"Showing ",
|
|
3780
3792
|
visible.length,
|
|
3781
3793
|
" of ",
|
|
3782
3794
|
rows.length
|
|
3783
3795
|
] }),
|
|
3784
|
-
!showAll ? /* @__PURE__ */ (0,
|
|
3796
|
+
!showAll ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: [
|
|
3785
3797
|
"See all (",
|
|
3786
3798
|
rows.length - defaultVisibleCount,
|
|
3787
3799
|
" more)"
|
|
3788
|
-
] }) : /* @__PURE__ */ (0,
|
|
3800
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Show less" })
|
|
3789
3801
|
] }))
|
|
3790
3802
|
] });
|
|
3791
3803
|
}
|
|
@@ -3794,8 +3806,8 @@ function PublisherBreakdownList({
|
|
|
3794
3806
|
var import_react17 = require("react");
|
|
3795
3807
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
3796
3808
|
var import_class_variance_authority = require("class-variance-authority");
|
|
3797
|
-
var
|
|
3798
|
-
var
|
|
3809
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3810
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3799
3811
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
3800
3812
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3801
3813
|
{
|
|
@@ -3866,10 +3878,10 @@ var Button = (0, import_react17.forwardRef)(
|
|
|
3866
3878
|
...props
|
|
3867
3879
|
};
|
|
3868
3880
|
if (asChild) {
|
|
3869
|
-
return /* @__PURE__ */ (0,
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_slot.Slot, { ref, ...shared, children });
|
|
3870
3882
|
}
|
|
3871
|
-
return /* @__PURE__ */ (0,
|
|
3872
|
-
loading && /* @__PURE__ */ (0,
|
|
3883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { ref, ...shared, children: [
|
|
3884
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
3873
3885
|
children
|
|
3874
3886
|
] });
|
|
3875
3887
|
}
|
|
@@ -3877,7 +3889,7 @@ var Button = (0, import_react17.forwardRef)(
|
|
|
3877
3889
|
Button.displayName = "Button";
|
|
3878
3890
|
|
|
3879
3891
|
// src/FilterDropdownFooter.tsx
|
|
3880
|
-
var
|
|
3892
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3881
3893
|
function FilterDropdownFooter({
|
|
3882
3894
|
onClear,
|
|
3883
3895
|
onApply,
|
|
@@ -3886,7 +3898,7 @@ function FilterDropdownFooter({
|
|
|
3886
3898
|
className,
|
|
3887
3899
|
testIdPrefix
|
|
3888
3900
|
}) {
|
|
3889
|
-
return /* @__PURE__ */ (0,
|
|
3901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3890
3902
|
"div",
|
|
3891
3903
|
{
|
|
3892
3904
|
className: cn(
|
|
@@ -3896,8 +3908,8 @@ function FilterDropdownFooter({
|
|
|
3896
3908
|
),
|
|
3897
3909
|
"data-testid": testIdPrefix,
|
|
3898
3910
|
children: [
|
|
3899
|
-
onClear && /* @__PURE__ */ (0,
|
|
3900
|
-
/* @__PURE__ */ (0,
|
|
3911
|
+
onClear && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
|
|
3912
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
|
|
3901
3913
|
]
|
|
3902
3914
|
}
|
|
3903
3915
|
);
|
|
@@ -3906,7 +3918,7 @@ function FilterDropdownFooter({
|
|
|
3906
3918
|
// src/NameListModal.tsx
|
|
3907
3919
|
var import_react18 = require("react");
|
|
3908
3920
|
var import_react_dom5 = require("react-dom");
|
|
3909
|
-
var
|
|
3921
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3910
3922
|
function NameListModal({
|
|
3911
3923
|
title,
|
|
3912
3924
|
initialName,
|
|
@@ -3960,12 +3972,12 @@ function NameListModal({
|
|
|
3960
3972
|
// bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
|
|
3961
3973
|
// No in-data-[theme=dark] override needed any more -- the token redefines
|
|
3962
3974
|
// itself under that attribute in dark.css, so one class covers both themes.
|
|
3963
|
-
/* @__PURE__ */ (0,
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3964
3976
|
"div",
|
|
3965
3977
|
{
|
|
3966
3978
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
|
|
3967
3979
|
onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
|
|
3968
|
-
children: /* @__PURE__ */ (0,
|
|
3980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3969
3981
|
"div",
|
|
3970
3982
|
{
|
|
3971
3983
|
ref: dialogRef,
|
|
@@ -3976,10 +3988,10 @@ function NameListModal({
|
|
|
3976
3988
|
"data-testid": testIdPrefix,
|
|
3977
3989
|
className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
|
|
3978
3990
|
children: [
|
|
3979
|
-
/* @__PURE__ */ (0,
|
|
3980
|
-
/* @__PURE__ */ (0,
|
|
3981
|
-
/* @__PURE__ */ (0,
|
|
3982
|
-
/* @__PURE__ */ (0,
|
|
3991
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
3992
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
3993
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3983
3995
|
"input",
|
|
3984
3996
|
{
|
|
3985
3997
|
id: fieldId,
|
|
@@ -3991,13 +4003,13 @@ function NameListModal({
|
|
|
3991
4003
|
}
|
|
3992
4004
|
)
|
|
3993
4005
|
] }),
|
|
3994
|
-
options && options.length > 0 && /* @__PURE__ */ (0,
|
|
3995
|
-
/* @__PURE__ */ (0,
|
|
4006
|
+
options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
|
|
4007
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
3996
4008
|
o.label
|
|
3997
4009
|
] }, o.key)) }),
|
|
3998
|
-
/* @__PURE__ */ (0,
|
|
3999
|
-
/* @__PURE__ */ (0,
|
|
4000
|
-
/* @__PURE__ */ (0,
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
4012
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
|
|
4001
4013
|
] })
|
|
4002
4014
|
]
|
|
4003
4015
|
}
|
|
@@ -4009,12 +4021,12 @@ function NameListModal({
|
|
|
4009
4021
|
}
|
|
4010
4022
|
|
|
4011
4023
|
// src/FilterChipBar.tsx
|
|
4012
|
-
var
|
|
4013
|
-
var
|
|
4024
|
+
var import_lucide_react18 = require("lucide-react");
|
|
4025
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4014
4026
|
function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
|
|
4015
4027
|
if (chips.length === 0) return null;
|
|
4016
|
-
return /* @__PURE__ */ (0,
|
|
4017
|
-
chips.map((c) => /* @__PURE__ */ (0,
|
|
4028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
|
|
4029
|
+
chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4018
4030
|
Chip,
|
|
4019
4031
|
{
|
|
4020
4032
|
label: c.label,
|
|
@@ -4024,7 +4036,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
4024
4036
|
},
|
|
4025
4037
|
c.key
|
|
4026
4038
|
)),
|
|
4027
|
-
/* @__PURE__ */ (0,
|
|
4039
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4028
4040
|
"button",
|
|
4029
4041
|
{
|
|
4030
4042
|
type: "button",
|
|
@@ -4041,8 +4053,8 @@ function Chip({
|
|
|
4041
4053
|
parked,
|
|
4042
4054
|
onRemove
|
|
4043
4055
|
}) {
|
|
4044
|
-
return /* @__PURE__ */ (0,
|
|
4045
|
-
/* @__PURE__ */ (0,
|
|
4056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "group relative inline-flex", children: [
|
|
4057
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
4046
4058
|
"span",
|
|
4047
4059
|
{
|
|
4048
4060
|
className: cn(
|
|
@@ -4054,22 +4066,22 @@ function Chip({
|
|
|
4054
4066
|
) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
|
|
4055
4067
|
),
|
|
4056
4068
|
children: [
|
|
4057
|
-
parked && /* @__PURE__ */ (0,
|
|
4069
|
+
parked && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react18.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
4058
4070
|
label,
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
4071
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4060
4072
|
"button",
|
|
4061
4073
|
{
|
|
4062
4074
|
type: "button",
|
|
4063
4075
|
onClick: onRemove,
|
|
4064
4076
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
4065
4077
|
className: "rounded-full text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
4066
|
-
children: /* @__PURE__ */ (0,
|
|
4078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react18.X, { size: 12 })
|
|
4067
4079
|
}
|
|
4068
4080
|
)
|
|
4069
4081
|
]
|
|
4070
4082
|
}
|
|
4071
4083
|
),
|
|
4072
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4073
4085
|
"span",
|
|
4074
4086
|
{
|
|
4075
4087
|
role: "tooltip",
|
|
@@ -4082,8 +4094,8 @@ function Chip({
|
|
|
4082
4094
|
|
|
4083
4095
|
// src/SortButton.tsx
|
|
4084
4096
|
var import_react19 = require("react");
|
|
4085
|
-
var
|
|
4086
|
-
var
|
|
4097
|
+
var import_lucide_react19 = require("lucide-react");
|
|
4098
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4087
4099
|
var ALIGN = {
|
|
4088
4100
|
left: "justify-start text-left",
|
|
4089
4101
|
center: "justify-center text-center",
|
|
@@ -4101,9 +4113,9 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4101
4113
|
className,
|
|
4102
4114
|
testIdPrefix
|
|
4103
4115
|
}, ref) {
|
|
4104
|
-
if (!sortable) return /* @__PURE__ */ (0,
|
|
4116
|
+
if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: cn("inline-flex", ALIGN[align], className), children: label });
|
|
4105
4117
|
const active = !disabled && sort.key === sortKey;
|
|
4106
|
-
return /* @__PURE__ */ (0,
|
|
4118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4107
4119
|
"button",
|
|
4108
4120
|
{
|
|
4109
4121
|
ref,
|
|
@@ -4134,8 +4146,8 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4134
4146
|
),
|
|
4135
4147
|
children: [
|
|
4136
4148
|
label,
|
|
4137
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0,
|
|
4138
|
-
|
|
4149
|
+
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react19.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react19.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4150
|
+
import_lucide_react19.ArrowUpDown,
|
|
4139
4151
|
{
|
|
4140
4152
|
size: 12,
|
|
4141
4153
|
"aria-hidden": "true",
|
|
@@ -4164,8 +4176,8 @@ function ariaSortFor(sort, key) {
|
|
|
4164
4176
|
}
|
|
4165
4177
|
|
|
4166
4178
|
// src/Pager.tsx
|
|
4167
|
-
var
|
|
4168
|
-
var
|
|
4179
|
+
var import_lucide_react20 = require("lucide-react");
|
|
4180
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4169
4181
|
function pageWindow(current, total) {
|
|
4170
4182
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
4171
4183
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -4181,8 +4193,8 @@ function pageWindow(current, total) {
|
|
|
4181
4193
|
}
|
|
4182
4194
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
4183
4195
|
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 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus";
|
|
4184
|
-
return /* @__PURE__ */ (0,
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4186
4198
|
"button",
|
|
4187
4199
|
{
|
|
4188
4200
|
type: "button",
|
|
@@ -4190,11 +4202,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4190
4202
|
disabled: disabled || page === 1,
|
|
4191
4203
|
"aria-label": "Previous page",
|
|
4192
4204
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4193
|
-
children: /* @__PURE__ */ (0,
|
|
4205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.ChevronLeft, { size: 16 })
|
|
4194
4206
|
}
|
|
4195
4207
|
),
|
|
4196
4208
|
pageWindow(page, totalPages).map(
|
|
4197
|
-
(p) => typeof p === "string" ? /* @__PURE__ */ (0,
|
|
4209
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4198
4210
|
"button",
|
|
4199
4211
|
{
|
|
4200
4212
|
type: "button",
|
|
@@ -4210,7 +4222,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4210
4222
|
p
|
|
4211
4223
|
)
|
|
4212
4224
|
),
|
|
4213
|
-
/* @__PURE__ */ (0,
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4214
4226
|
"button",
|
|
4215
4227
|
{
|
|
4216
4228
|
type: "button",
|
|
@@ -4218,14 +4230,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4218
4230
|
disabled: disabled || page === totalPages,
|
|
4219
4231
|
"aria-label": "Next page",
|
|
4220
4232
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4221
|
-
children: /* @__PURE__ */ (0,
|
|
4233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.ChevronRight, { size: 16 })
|
|
4222
4234
|
}
|
|
4223
4235
|
)
|
|
4224
4236
|
] });
|
|
4225
4237
|
}
|
|
4226
4238
|
|
|
4227
4239
|
// src/WorkspaceAvatar.tsx
|
|
4228
|
-
var
|
|
4240
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4229
4241
|
function workspaceInitials(name) {
|
|
4230
4242
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
4231
4243
|
if (words.length === 0) return "\xB7";
|
|
@@ -4244,7 +4256,7 @@ var SIZES = {
|
|
|
4244
4256
|
lg: "h-11 w-11 text-panel-title"
|
|
4245
4257
|
};
|
|
4246
4258
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
4247
|
-
return /* @__PURE__ */ (0,
|
|
4259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4248
4260
|
"span",
|
|
4249
4261
|
{
|
|
4250
4262
|
"aria-hidden": "true",
|
|
@@ -4262,12 +4274,12 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
4262
4274
|
// src/Toast.tsx
|
|
4263
4275
|
var import_react20 = require("react");
|
|
4264
4276
|
var import_react_dom6 = require("react-dom");
|
|
4265
|
-
var
|
|
4266
|
-
var
|
|
4277
|
+
var import_lucide_react21 = require("lucide-react");
|
|
4278
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4267
4279
|
var ICON = {
|
|
4268
4280
|
neutral: null,
|
|
4269
|
-
success: /* @__PURE__ */ (0,
|
|
4270
|
-
warning: /* @__PURE__ */ (0,
|
|
4281
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react21.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
|
|
4282
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react21.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
|
|
4271
4283
|
};
|
|
4272
4284
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4273
4285
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
@@ -4283,7 +4295,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4283
4295
|
return () => window.clearTimeout(t);
|
|
4284
4296
|
}, [message, ms, paused]);
|
|
4285
4297
|
return (0, import_react_dom6.createPortal)(
|
|
4286
|
-
/* @__PURE__ */ (0,
|
|
4298
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4287
4299
|
"div",
|
|
4288
4300
|
{
|
|
4289
4301
|
role: "status",
|
|
@@ -4301,7 +4313,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4301
4313
|
children: [
|
|
4302
4314
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4303
4315
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4304
|
-
/* @__PURE__ */ (0,
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4305
4317
|
"span",
|
|
4306
4318
|
{
|
|
4307
4319
|
className: cn(
|
|
@@ -4311,8 +4323,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4311
4323
|
children: ICON[tone]
|
|
4312
4324
|
}
|
|
4313
4325
|
),
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4315
|
-
action && /* @__PURE__ */ (0,
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "min-w-0", children: message }),
|
|
4327
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4316
4328
|
"button",
|
|
4317
4329
|
{
|
|
4318
4330
|
type: "button",
|
|
@@ -4334,14 +4346,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4334
4346
|
}
|
|
4335
4347
|
|
|
4336
4348
|
// src/Tag.tsx
|
|
4337
|
-
var
|
|
4349
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4338
4350
|
function Tag({ children, className, testIdPrefix }) {
|
|
4339
|
-
return /* @__PURE__ */ (0,
|
|
4351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4340
4352
|
}
|
|
4341
4353
|
|
|
4342
4354
|
// src/TablePagination.tsx
|
|
4343
|
-
var
|
|
4344
|
-
var
|
|
4355
|
+
var import_lucide_react22 = require("lucide-react");
|
|
4356
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4345
4357
|
function TablePagination({
|
|
4346
4358
|
page,
|
|
4347
4359
|
perPage,
|
|
@@ -4361,7 +4373,7 @@ function TablePagination({
|
|
|
4361
4373
|
const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-dense transition-colors focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus";
|
|
4362
4374
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4363
4375
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4364
|
-
const range = /* @__PURE__ */ (0,
|
|
4376
|
+
const range = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4365
4377
|
rangeStart.toLocaleString(),
|
|
4366
4378
|
" \u2013 ",
|
|
4367
4379
|
rangeEnd.toLocaleString(),
|
|
@@ -4370,13 +4382,13 @@ function TablePagination({
|
|
|
4370
4382
|
" ",
|
|
4371
4383
|
itemLabel
|
|
4372
4384
|
] });
|
|
4373
|
-
return /* @__PURE__ */ (0,
|
|
4374
|
-
/* @__PURE__ */ (0,
|
|
4385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4375
4387
|
"div",
|
|
4376
4388
|
{
|
|
4377
4389
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4378
4390
|
children: [
|
|
4379
|
-
/* @__PURE__ */ (0,
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4380
4392
|
SelectFilter,
|
|
4381
4393
|
{
|
|
4382
4394
|
size: "sm",
|
|
@@ -4392,8 +4404,8 @@ function TablePagination({
|
|
|
4392
4404
|
]
|
|
4393
4405
|
}
|
|
4394
4406
|
),
|
|
4395
|
-
/* @__PURE__ */ (0,
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4407
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4408
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4397
4409
|
"button",
|
|
4398
4410
|
{
|
|
4399
4411
|
type: "button",
|
|
@@ -4402,10 +4414,10 @@ function TablePagination({
|
|
|
4402
4414
|
"aria-label": "First page",
|
|
4403
4415
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4404
4416
|
className: stepBtn,
|
|
4405
|
-
children: /* @__PURE__ */ (0,
|
|
4417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4406
4418
|
}
|
|
4407
4419
|
),
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
4420
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4409
4421
|
"button",
|
|
4410
4422
|
{
|
|
4411
4423
|
type: "button",
|
|
@@ -4414,11 +4426,11 @@ function TablePagination({
|
|
|
4414
4426
|
"aria-label": "Previous page",
|
|
4415
4427
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4416
4428
|
className: stepBtn,
|
|
4417
|
-
children: /* @__PURE__ */ (0,
|
|
4429
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronLeft, { size: 16, "aria-hidden": "true" })
|
|
4418
4430
|
}
|
|
4419
4431
|
),
|
|
4420
4432
|
pageWindow(current, totalPages).map(
|
|
4421
|
-
(p) => typeof p === "string" ? /* @__PURE__ */ (0,
|
|
4433
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4422
4434
|
"button",
|
|
4423
4435
|
{
|
|
4424
4436
|
type: "button",
|
|
@@ -4436,7 +4448,7 @@ function TablePagination({
|
|
|
4436
4448
|
p
|
|
4437
4449
|
)
|
|
4438
4450
|
),
|
|
4439
|
-
/* @__PURE__ */ (0,
|
|
4451
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4440
4452
|
"button",
|
|
4441
4453
|
{
|
|
4442
4454
|
type: "button",
|
|
@@ -4445,10 +4457,10 @@ function TablePagination({
|
|
|
4445
4457
|
"aria-label": "Next page",
|
|
4446
4458
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4447
4459
|
className: stepBtn,
|
|
4448
|
-
children: /* @__PURE__ */ (0,
|
|
4460
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronRight, { size: 16, "aria-hidden": "true" })
|
|
4449
4461
|
}
|
|
4450
4462
|
),
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4463
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4452
4464
|
"button",
|
|
4453
4465
|
{
|
|
4454
4466
|
type: "button",
|
|
@@ -4457,7 +4469,7 @@ function TablePagination({
|
|
|
4457
4469
|
"aria-label": "Last page",
|
|
4458
4470
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4459
4471
|
className: stepBtn,
|
|
4460
|
-
children: /* @__PURE__ */ (0,
|
|
4472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4461
4473
|
}
|
|
4462
4474
|
)
|
|
4463
4475
|
] }),
|
|
@@ -4467,8 +4479,8 @@ function TablePagination({
|
|
|
4467
4479
|
|
|
4468
4480
|
// src/DateRangePicker.tsx
|
|
4469
4481
|
var import_react21 = require("react");
|
|
4470
|
-
var
|
|
4471
|
-
var
|
|
4482
|
+
var import_lucide_react23 = require("lucide-react");
|
|
4483
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4472
4484
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4473
4485
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4474
4486
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4506,7 +4518,7 @@ function spanLabel2(label, today, formatDate, formatRange) {
|
|
|
4506
4518
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4507
4519
|
}
|
|
4508
4520
|
function MiniSelect({ value, onChange, options }) {
|
|
4509
|
-
return /* @__PURE__ */ (0,
|
|
4521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4510
4522
|
"select",
|
|
4511
4523
|
{
|
|
4512
4524
|
value: String(value),
|
|
@@ -4515,7 +4527,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4515
4527
|
if (opt) onChange(opt.value);
|
|
4516
4528
|
},
|
|
4517
4529
|
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",
|
|
4518
|
-
children: options.map((o) => /* @__PURE__ */ (0,
|
|
4530
|
+
children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4519
4531
|
}
|
|
4520
4532
|
);
|
|
4521
4533
|
}
|
|
@@ -4580,8 +4592,8 @@ function DateRangePicker({
|
|
|
4580
4592
|
if (showFooter) setDraft(label);
|
|
4581
4593
|
else commit(label);
|
|
4582
4594
|
};
|
|
4583
|
-
return /* @__PURE__ */ (0,
|
|
4584
|
-
/* @__PURE__ */ (0,
|
|
4595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4596
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4585
4597
|
"button",
|
|
4586
4598
|
{
|
|
4587
4599
|
type: "button",
|
|
@@ -4590,16 +4602,16 @@ function DateRangePicker({
|
|
|
4590
4602
|
"aria-haspopup": "listbox",
|
|
4591
4603
|
className: chipTriggerClass(),
|
|
4592
4604
|
children: [
|
|
4593
|
-
/* @__PURE__ */ (0,
|
|
4594
|
-
/* @__PURE__ */ (0,
|
|
4595
|
-
/* @__PURE__ */ (0,
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate, formatRange) }),
|
|
4607
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
|
|
4596
4608
|
] }),
|
|
4597
|
-
/* @__PURE__ */ (0,
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react23.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4598
4610
|
]
|
|
4599
4611
|
}
|
|
4600
4612
|
),
|
|
4601
|
-
open && /* @__PURE__ */ (0,
|
|
4602
|
-
presets.map((p) => /* @__PURE__ */ (0,
|
|
4613
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("absolute top-full mt-2 z-30 w-70 overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
|
|
4614
|
+
presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4603
4615
|
"button",
|
|
4604
4616
|
{
|
|
4605
4617
|
type: "button",
|
|
@@ -4609,26 +4621,26 @@ function DateRangePicker({
|
|
|
4609
4621
|
},
|
|
4610
4622
|
p
|
|
4611
4623
|
)),
|
|
4612
|
-
/* @__PURE__ */ (0,
|
|
4613
|
-
/* @__PURE__ */ (0,
|
|
4614
|
-
/* @__PURE__ */ (0,
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4616
4628
|
"From",
|
|
4617
|
-
/* @__PURE__ */ (0,
|
|
4618
|
-
granularity === "month" && /* @__PURE__ */ (0,
|
|
4619
|
-
granularity === "quarter" && /* @__PURE__ */ (0,
|
|
4620
|
-
/* @__PURE__ */ (0,
|
|
4629
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "flex gap-1", children: [
|
|
4630
|
+
granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4631
|
+
granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4632
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4621
4633
|
] })
|
|
4622
4634
|
] }),
|
|
4623
|
-
/* @__PURE__ */ (0,
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4624
4636
|
"To",
|
|
4625
|
-
/* @__PURE__ */ (0,
|
|
4626
|
-
granularity === "month" && /* @__PURE__ */ (0,
|
|
4627
|
-
granularity === "quarter" && /* @__PURE__ */ (0,
|
|
4628
|
-
/* @__PURE__ */ (0,
|
|
4637
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "flex gap-1", children: [
|
|
4638
|
+
granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4639
|
+
granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4640
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4629
4641
|
] })
|
|
4630
4642
|
] }),
|
|
4631
|
-
/* @__PURE__ */ (0,
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4632
4644
|
"button",
|
|
4633
4645
|
{
|
|
4634
4646
|
type: "button",
|
|
@@ -4640,15 +4652,15 @@ function DateRangePicker({
|
|
|
4640
4652
|
)
|
|
4641
4653
|
] })
|
|
4642
4654
|
] }),
|
|
4643
|
-
showFooter && /* @__PURE__ */ (0,
|
|
4655
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4644
4656
|
] })
|
|
4645
4657
|
] });
|
|
4646
4658
|
}
|
|
4647
4659
|
|
|
4648
4660
|
// src/MultiSelectFilter.tsx
|
|
4649
4661
|
var import_react22 = require("react");
|
|
4650
|
-
var
|
|
4651
|
-
var
|
|
4662
|
+
var import_lucide_react24 = require("lucide-react");
|
|
4663
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4652
4664
|
var SEARCH_AFTER = 8;
|
|
4653
4665
|
function MultiSelectFilter({
|
|
4654
4666
|
caption,
|
|
@@ -4746,9 +4758,9 @@ function MultiSelectFilter({
|
|
|
4746
4758
|
const shown = open && !showFooter ? draft : selected;
|
|
4747
4759
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4748
4760
|
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4749
|
-
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0,
|
|
4750
|
-
/* @__PURE__ */ (0,
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
4761
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-col", children: [
|
|
4762
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }),
|
|
4763
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4752
4764
|
] }) : label;
|
|
4753
4765
|
const ql = q.trim().toLowerCase();
|
|
4754
4766
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4759,8 +4771,8 @@ function MultiSelectFilter({
|
|
|
4759
4771
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4760
4772
|
return kids.length ? { ...g, children: kids } : null;
|
|
4761
4773
|
}).filter((g) => g !== null) : [];
|
|
4762
|
-
return /* @__PURE__ */ (0,
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
4774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4764
4776
|
"button",
|
|
4765
4777
|
{
|
|
4766
4778
|
type: "button",
|
|
@@ -4769,9 +4781,9 @@ function MultiSelectFilter({
|
|
|
4769
4781
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4770
4782
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4771
4783
|
children: [
|
|
4772
|
-
/* @__PURE__ */ (0,
|
|
4773
|
-
/* @__PURE__ */ (0,
|
|
4774
|
-
|
|
4784
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChipContent, { caption, value, icon }),
|
|
4785
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4786
|
+
import_lucide_react24.ChevronDown,
|
|
4775
4787
|
{
|
|
4776
4788
|
size: 14,
|
|
4777
4789
|
"aria-hidden": "true",
|
|
@@ -4781,7 +4793,7 @@ function MultiSelectFilter({
|
|
|
4781
4793
|
]
|
|
4782
4794
|
}
|
|
4783
4795
|
),
|
|
4784
|
-
open && /* @__PURE__ */ (0,
|
|
4796
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4785
4797
|
"div",
|
|
4786
4798
|
{
|
|
4787
4799
|
className: cn(
|
|
@@ -4792,10 +4804,10 @@ function MultiSelectFilter({
|
|
|
4792
4804
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4793
4805
|
role: "dialog",
|
|
4794
4806
|
"aria-label": caption,
|
|
4795
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
4796
|
-
showSearch && /* @__PURE__ */ (0,
|
|
4797
|
-
/* @__PURE__ */ (0,
|
|
4798
|
-
/* @__PURE__ */ (0,
|
|
4807
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
4808
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.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: [
|
|
4809
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react24.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4799
4811
|
"input",
|
|
4800
4812
|
{
|
|
4801
4813
|
type: "text",
|
|
@@ -4805,37 +4817,37 @@ function MultiSelectFilter({
|
|
|
4805
4817
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4806
4818
|
}
|
|
4807
4819
|
),
|
|
4808
|
-
q && /* @__PURE__ */ (0,
|
|
4820
|
+
q && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react24.X, { size: 13 }) })
|
|
4809
4821
|
] }) }),
|
|
4810
|
-
/* @__PURE__ */ (0,
|
|
4822
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4811
4823
|
groups ? visibleGroups.map((g) => {
|
|
4812
4824
|
const state = groupState(g);
|
|
4813
|
-
return /* @__PURE__ */ (0,
|
|
4814
|
-
/* @__PURE__ */ (0,
|
|
4825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4815
4827
|
"button",
|
|
4816
4828
|
{
|
|
4817
4829
|
type: "button",
|
|
4818
4830
|
onClick: () => toggleGroup(g),
|
|
4819
4831
|
className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
4820
4832
|
children: [
|
|
4821
|
-
/* @__PURE__ */ (0,
|
|
4822
|
-
/* @__PURE__ */ (0,
|
|
4823
|
-
counts && /* @__PURE__ */ (0,
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
4834
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
4835
|
+
counts && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionCount, { n: countFor(g.id) })
|
|
4824
4836
|
]
|
|
4825
4837
|
}
|
|
4826
4838
|
),
|
|
4827
4839
|
g.children.map((c) => {
|
|
4828
4840
|
const checked = draft.includes(c.id);
|
|
4829
|
-
return /* @__PURE__ */ (0,
|
|
4841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4830
4842
|
"button",
|
|
4831
4843
|
{
|
|
4832
4844
|
type: "button",
|
|
4833
4845
|
onClick: () => toggle(c.id),
|
|
4834
4846
|
className: "flex w-full items-center gap-2.5 rounded-control py-2 pl-9 pr-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
4835
4847
|
children: [
|
|
4836
|
-
/* @__PURE__ */ (0,
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4838
|
-
counts && /* @__PURE__ */ (0,
|
|
4848
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckBoxBox, { checked }),
|
|
4849
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
4850
|
+
counts && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionCount, { n: countFor(c.id) })
|
|
4839
4851
|
]
|
|
4840
4852
|
},
|
|
4841
4853
|
c.id
|
|
@@ -4844,25 +4856,25 @@ function MultiSelectFilter({
|
|
|
4844
4856
|
] }, g.id);
|
|
4845
4857
|
}) : items.map((o) => {
|
|
4846
4858
|
const checked = draft.includes(o.id);
|
|
4847
|
-
return /* @__PURE__ */ (0,
|
|
4859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4848
4860
|
"button",
|
|
4849
4861
|
{
|
|
4850
4862
|
type: "button",
|
|
4851
4863
|
onClick: () => toggle(o.id),
|
|
4852
4864
|
className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
4853
4865
|
children: [
|
|
4854
|
-
/* @__PURE__ */ (0,
|
|
4855
|
-
/* @__PURE__ */ (0,
|
|
4856
|
-
counts && /* @__PURE__ */ (0,
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckBoxBox, { checked }),
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
4868
|
+
counts && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionCount, { n: countFor(o.id) })
|
|
4857
4869
|
]
|
|
4858
4870
|
},
|
|
4859
4871
|
o.id
|
|
4860
4872
|
);
|
|
4861
4873
|
}),
|
|
4862
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0,
|
|
4874
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4863
4875
|
] }),
|
|
4864
|
-
note && /* @__PURE__ */ (0,
|
|
4865
|
-
showFooter ? /* @__PURE__ */ (0,
|
|
4876
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4877
|
+
showFooter ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4866
4878
|
"button",
|
|
4867
4879
|
{
|
|
4868
4880
|
type: "button",
|
|
@@ -4880,7 +4892,7 @@ function MultiSelectFilter({
|
|
|
4880
4892
|
] });
|
|
4881
4893
|
}
|
|
4882
4894
|
function OptionCount({ n }) {
|
|
4883
|
-
return /* @__PURE__ */ (0,
|
|
4895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4884
4896
|
"(",
|
|
4885
4897
|
n.toLocaleString(),
|
|
4886
4898
|
")"
|
|
@@ -4889,7 +4901,7 @@ function OptionCount({ n }) {
|
|
|
4889
4901
|
|
|
4890
4902
|
// src/Toggle.tsx
|
|
4891
4903
|
var import_react23 = require("react");
|
|
4892
|
-
var
|
|
4904
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4893
4905
|
var SIZES2 = {
|
|
4894
4906
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4895
4907
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
@@ -4897,7 +4909,7 @@ var SIZES2 = {
|
|
|
4897
4909
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4898
4910
|
var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4899
4911
|
const s = SIZES2[size];
|
|
4900
|
-
return /* @__PURE__ */ (0,
|
|
4912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4901
4913
|
"button",
|
|
4902
4914
|
{
|
|
4903
4915
|
ref,
|
|
@@ -4916,7 +4928,7 @@ var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange
|
|
|
4916
4928
|
disabled && "cursor-not-allowed opacity-50",
|
|
4917
4929
|
className
|
|
4918
4930
|
),
|
|
4919
|
-
children: /* @__PURE__ */ (0,
|
|
4931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4920
4932
|
"span",
|
|
4921
4933
|
{
|
|
4922
4934
|
className: cn(
|
|
@@ -4933,21 +4945,21 @@ Toggle.displayName = "Toggle";
|
|
|
4933
4945
|
|
|
4934
4946
|
// src/AISpark.tsx
|
|
4935
4947
|
var import_react24 = require("react");
|
|
4936
|
-
var
|
|
4937
|
-
var
|
|
4948
|
+
var import_lucide_react25 = require("lucide-react");
|
|
4949
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4938
4950
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4939
4951
|
const id = (0, import_react24.useId)();
|
|
4940
|
-
return /* @__PURE__ */ (0,
|
|
4941
|
-
/* @__PURE__ */ (0,
|
|
4942
|
-
/* @__PURE__ */ (0,
|
|
4943
|
-
/* @__PURE__ */ (0,
|
|
4952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
4953
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
4954
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
4955
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4944
4956
|
] }) }) }),
|
|
4945
|
-
/* @__PURE__ */ (0,
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react25.Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4946
4958
|
] });
|
|
4947
4959
|
}
|
|
4948
4960
|
|
|
4949
4961
|
// src/Freshness.tsx
|
|
4950
|
-
var
|
|
4962
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4951
4963
|
var dotColor = {
|
|
4952
4964
|
fresh: "bg-status-success",
|
|
4953
4965
|
recent: "bg-status-warning",
|
|
@@ -4959,7 +4971,7 @@ var srLabel = {
|
|
|
4959
4971
|
stale: "Older than a day"
|
|
4960
4972
|
};
|
|
4961
4973
|
function Freshness({ level, className, testIdPrefix }) {
|
|
4962
|
-
return /* @__PURE__ */ (0,
|
|
4974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4963
4975
|
"span",
|
|
4964
4976
|
{
|
|
4965
4977
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -4971,50 +4983,50 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
4971
4983
|
}
|
|
4972
4984
|
|
|
4973
4985
|
// src/SectionHeading.tsx
|
|
4974
|
-
var
|
|
4986
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4975
4987
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
4976
|
-
return /* @__PURE__ */ (0,
|
|
4977
|
-
/* @__PURE__ */ (0,
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
4979
|
-
description && /* @__PURE__ */ (0,
|
|
4988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "min-w-0", children: [
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4991
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
|
|
4980
4992
|
] }),
|
|
4981
|
-
actions && /* @__PURE__ */ (0,
|
|
4993
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4982
4994
|
] });
|
|
4983
4995
|
}
|
|
4984
4996
|
|
|
4985
4997
|
// src/PageHeader.tsx
|
|
4986
|
-
var
|
|
4987
|
-
var
|
|
4998
|
+
var import_lucide_react26 = require("lucide-react");
|
|
4999
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4988
5000
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
4989
|
-
return /* @__PURE__ */ (0,
|
|
4990
|
-
/* @__PURE__ */ (0,
|
|
4991
|
-
back && /* @__PURE__ */ (0,
|
|
5001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
|
|
5002
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
5003
|
+
back && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4992
5004
|
"a",
|
|
4993
5005
|
{
|
|
4994
5006
|
href: back.href ?? "#",
|
|
4995
5007
|
onClick: back.onClick,
|
|
4996
5008
|
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-1 focus-visible:outline-border-focus",
|
|
4997
5009
|
children: [
|
|
4998
|
-
/* @__PURE__ */ (0,
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4999
5011
|
back.label
|
|
5000
5012
|
]
|
|
5001
5013
|
}
|
|
5002
5014
|
),
|
|
5003
|
-
meta ? /* @__PURE__ */ (0,
|
|
5004
|
-
/* @__PURE__ */ (0,
|
|
5015
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
5005
5017
|
meta
|
|
5006
|
-
] }) : /* @__PURE__ */ (0,
|
|
5007
|
-
description && /* @__PURE__ */ (0,
|
|
5018
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
5019
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
|
|
5008
5020
|
] }),
|
|
5009
|
-
actions && /* @__PURE__ */ (0,
|
|
5021
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
5010
5022
|
] });
|
|
5011
5023
|
}
|
|
5012
5024
|
|
|
5013
5025
|
// src/Modal.tsx
|
|
5014
5026
|
var import_react25 = require("react");
|
|
5015
5027
|
var import_react_dom7 = require("react-dom");
|
|
5016
|
-
var
|
|
5017
|
-
var
|
|
5028
|
+
var import_lucide_react27 = require("lucide-react");
|
|
5029
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5018
5030
|
var WIDTH = {
|
|
5019
5031
|
sm: "max-w-110",
|
|
5020
5032
|
md: "max-w-160",
|
|
@@ -5078,7 +5090,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5078
5090
|
}, [open, mounted]);
|
|
5079
5091
|
if (!mounted || typeof document === "undefined") return null;
|
|
5080
5092
|
return (0, import_react_dom7.createPortal)(
|
|
5081
|
-
/* @__PURE__ */ (0,
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5082
5094
|
"div",
|
|
5083
5095
|
{
|
|
5084
5096
|
className: cn(
|
|
@@ -5086,7 +5098,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5086
5098
|
shown ? "opacity-100" : "opacity-0"
|
|
5087
5099
|
),
|
|
5088
5100
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
5089
|
-
children: /* @__PURE__ */ (0,
|
|
5101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
5090
5102
|
"div",
|
|
5091
5103
|
{
|
|
5092
5104
|
ref: panel,
|
|
@@ -5104,24 +5116,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5104
5116
|
className
|
|
5105
5117
|
),
|
|
5106
5118
|
children: [
|
|
5107
|
-
/* @__PURE__ */ (0,
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
5109
|
-
/* @__PURE__ */ (0,
|
|
5110
|
-
description && /* @__PURE__ */ (0,
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5122
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5111
5123
|
] }),
|
|
5112
|
-
/* @__PURE__ */ (0,
|
|
5124
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5113
5125
|
"button",
|
|
5114
5126
|
{
|
|
5115
5127
|
type: "button",
|
|
5116
5128
|
onClick: onClose,
|
|
5117
5129
|
"aria-label": "Close",
|
|
5118
5130
|
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-1 focus-visible:outline-border-focus",
|
|
5119
|
-
children: /* @__PURE__ */ (0,
|
|
5131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react27.X, { size: 16, "aria-hidden": "true" })
|
|
5120
5132
|
}
|
|
5121
5133
|
)
|
|
5122
5134
|
] }),
|
|
5123
|
-
children && /* @__PURE__ */ (0,
|
|
5124
|
-
footer && /* @__PURE__ */ (0,
|
|
5135
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
|
|
5136
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime50.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 })
|
|
5125
5137
|
]
|
|
5126
5138
|
}
|
|
5127
5139
|
)
|
|
@@ -5132,10 +5144,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5132
5144
|
}
|
|
5133
5145
|
|
|
5134
5146
|
// src/EmptyState.tsx
|
|
5135
|
-
var
|
|
5147
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5136
5148
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
5137
5149
|
const md = size === "md";
|
|
5138
|
-
return /* @__PURE__ */ (0,
|
|
5150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5139
5151
|
"div",
|
|
5140
5152
|
{
|
|
5141
5153
|
className: cn(
|
|
@@ -5145,7 +5157,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5145
5157
|
),
|
|
5146
5158
|
"data-testid": testIdPrefix,
|
|
5147
5159
|
children: [
|
|
5148
|
-
icon && /* @__PURE__ */ (0,
|
|
5160
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5149
5161
|
"span",
|
|
5150
5162
|
{
|
|
5151
5163
|
"aria-hidden": "true",
|
|
@@ -5156,9 +5168,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5156
5168
|
children: icon
|
|
5157
5169
|
}
|
|
5158
5170
|
),
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5160
|
-
description && /* @__PURE__ */ (0,
|
|
5161
|
-
action && /* @__PURE__ */ (0,
|
|
5171
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
|
|
5172
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
|
|
5173
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
|
|
5162
5174
|
]
|
|
5163
5175
|
}
|
|
5164
5176
|
);
|
|
@@ -5166,7 +5178,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5166
5178
|
|
|
5167
5179
|
// src/TextField.tsx
|
|
5168
5180
|
var import_react26 = require("react");
|
|
5169
|
-
var
|
|
5181
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5170
5182
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
5171
5183
|
var TextField = (0, import_react26.forwardRef)(
|
|
5172
5184
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
@@ -5174,9 +5186,9 @@ var TextField = (0, import_react26.forwardRef)(
|
|
|
5174
5186
|
const fieldId = id ?? auto;
|
|
5175
5187
|
const noteId = `${fieldId}-note`;
|
|
5176
5188
|
const note = error ?? hint;
|
|
5177
|
-
return /* @__PURE__ */ (0,
|
|
5178
|
-
label && /* @__PURE__ */ (0,
|
|
5179
|
-
/* @__PURE__ */ (0,
|
|
5189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
|
|
5190
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
|
|
5191
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
5180
5192
|
"div",
|
|
5181
5193
|
{
|
|
5182
5194
|
className: cn(
|
|
@@ -5186,8 +5198,8 @@ var TextField = (0, import_react26.forwardRef)(
|
|
|
5186
5198
|
disabled && "opacity-50"
|
|
5187
5199
|
),
|
|
5188
5200
|
children: [
|
|
5189
|
-
icon && /* @__PURE__ */ (0,
|
|
5190
|
-
/* @__PURE__ */ (0,
|
|
5201
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5202
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5191
5203
|
"input",
|
|
5192
5204
|
{
|
|
5193
5205
|
ref,
|
|
@@ -5202,7 +5214,7 @@ var TextField = (0, import_react26.forwardRef)(
|
|
|
5202
5214
|
]
|
|
5203
5215
|
}
|
|
5204
5216
|
),
|
|
5205
|
-
note && /* @__PURE__ */ (0,
|
|
5217
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
5206
5218
|
] });
|
|
5207
5219
|
}
|
|
5208
5220
|
);
|
|
@@ -5211,8 +5223,8 @@ TextField.displayName = "TextField";
|
|
|
5211
5223
|
// src/Drawer.tsx
|
|
5212
5224
|
var import_react27 = require("react");
|
|
5213
5225
|
var import_react_dom8 = require("react-dom");
|
|
5214
|
-
var
|
|
5215
|
-
var
|
|
5226
|
+
var import_lucide_react28 = require("lucide-react");
|
|
5227
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5216
5228
|
var WIDTH2 = {
|
|
5217
5229
|
sm: "max-w-110",
|
|
5218
5230
|
md: "max-w-160",
|
|
@@ -5273,8 +5285,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5273
5285
|
}, [open, mounted]);
|
|
5274
5286
|
if (!mounted || typeof document === "undefined") return null;
|
|
5275
5287
|
return (0, import_react_dom8.createPortal)(
|
|
5276
|
-
/* @__PURE__ */ (0,
|
|
5277
|
-
/* @__PURE__ */ (0,
|
|
5288
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fixed inset-0 z-modal", children: [
|
|
5289
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5278
5290
|
"div",
|
|
5279
5291
|
{
|
|
5280
5292
|
"aria-hidden": "true",
|
|
@@ -5288,7 +5300,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5288
5300
|
)
|
|
5289
5301
|
}
|
|
5290
5302
|
),
|
|
5291
|
-
/* @__PURE__ */ (0,
|
|
5303
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5292
5304
|
"div",
|
|
5293
5305
|
{
|
|
5294
5306
|
ref: panel,
|
|
@@ -5305,24 +5317,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5305
5317
|
className
|
|
5306
5318
|
),
|
|
5307
5319
|
children: [
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5309
|
-
/* @__PURE__ */ (0,
|
|
5310
|
-
/* @__PURE__ */ (0,
|
|
5311
|
-
description && /* @__PURE__ */ (0,
|
|
5320
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5321
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5323
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5312
5324
|
] }),
|
|
5313
|
-
/* @__PURE__ */ (0,
|
|
5325
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5314
5326
|
"button",
|
|
5315
5327
|
{
|
|
5316
5328
|
type: "button",
|
|
5317
5329
|
onClick: onClose,
|
|
5318
5330
|
"aria-label": "Close",
|
|
5319
5331
|
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-1 focus-visible:outline-border-focus",
|
|
5320
|
-
children: /* @__PURE__ */ (0,
|
|
5332
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.X, { size: 16, "aria-hidden": "true" })
|
|
5321
5333
|
}
|
|
5322
5334
|
)
|
|
5323
5335
|
] }),
|
|
5324
|
-
/* @__PURE__ */ (0,
|
|
5325
|
-
footer && /* @__PURE__ */ (0,
|
|
5336
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { "data-drawer-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
|
|
5337
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5326
5338
|
]
|
|
5327
5339
|
}
|
|
5328
5340
|
)
|
|
@@ -5333,7 +5345,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5333
5345
|
|
|
5334
5346
|
// src/DataTable.tsx
|
|
5335
5347
|
var import_react28 = require("react");
|
|
5336
|
-
var
|
|
5348
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5337
5349
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5338
5350
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5339
5351
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
@@ -5366,20 +5378,20 @@ function DataTable({
|
|
|
5366
5378
|
const col = columns.find((c) => c.key === key);
|
|
5367
5379
|
onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
|
|
5368
5380
|
};
|
|
5369
|
-
return /* @__PURE__ */ (0,
|
|
5381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5370
5382
|
"div",
|
|
5371
5383
|
{
|
|
5372
5384
|
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
|
|
5373
5385
|
"data-testid": testIdPrefix,
|
|
5374
5386
|
children: [
|
|
5375
|
-
title && /* @__PURE__ */ (0,
|
|
5376
|
-
/* @__PURE__ */ (0,
|
|
5377
|
-
/* @__PURE__ */ (0,
|
|
5378
|
-
subtitle && /* @__PURE__ */ (0,
|
|
5387
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0", children: [
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
|
|
5390
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
|
|
5379
5391
|
] }),
|
|
5380
|
-
action && /* @__PURE__ */ (0,
|
|
5392
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "shrink-0", children: action })
|
|
5381
5393
|
] }),
|
|
5382
|
-
/* @__PURE__ */ (0,
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5383
5395
|
"table",
|
|
5384
5396
|
{
|
|
5385
5397
|
"aria-labelledby": title ? titleId : void 0,
|
|
@@ -5387,13 +5399,13 @@ function DataTable({
|
|
|
5387
5399
|
"aria-busy": loading || void 0,
|
|
5388
5400
|
className: "w-full border-collapse text-left",
|
|
5389
5401
|
children: [
|
|
5390
|
-
/* @__PURE__ */ (0,
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5391
5403
|
"th",
|
|
5392
5404
|
{
|
|
5393
5405
|
scope: "col",
|
|
5394
5406
|
"aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
|
|
5395
5407
|
className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5396
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */ (0,
|
|
5408
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5397
5409
|
SortButton,
|
|
5398
5410
|
{
|
|
5399
5411
|
label: c.label,
|
|
@@ -5407,7 +5419,7 @@ function DataTable({
|
|
|
5407
5419
|
},
|
|
5408
5420
|
c.key
|
|
5409
5421
|
)) }) }),
|
|
5410
|
-
/* @__PURE__ */ (0,
|
|
5422
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5411
5423
|
"span",
|
|
5412
5424
|
{
|
|
5413
5425
|
className: cn(
|
|
@@ -5415,7 +5427,7 @@ function DataTable({
|
|
|
5415
5427
|
c.numeric ? "w-12" : "w-2/3"
|
|
5416
5428
|
)
|
|
5417
5429
|
}
|
|
5418
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0,
|
|
5430
|
+
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5419
5431
|
"td",
|
|
5420
5432
|
{
|
|
5421
5433
|
className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
|
|
@@ -5426,14 +5438,14 @@ function DataTable({
|
|
|
5426
5438
|
]
|
|
5427
5439
|
}
|
|
5428
5440
|
) }),
|
|
5429
|
-
footer && /* @__PURE__ */ (0,
|
|
5441
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
5430
5442
|
]
|
|
5431
5443
|
}
|
|
5432
5444
|
);
|
|
5433
5445
|
}
|
|
5434
5446
|
|
|
5435
5447
|
// src/MediaLabel.tsx
|
|
5436
|
-
var
|
|
5448
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5437
5449
|
var FILL = {
|
|
5438
5450
|
TV: "bg-media-tv",
|
|
5439
5451
|
CTV: "bg-media-ctv",
|
|
@@ -5444,7 +5456,7 @@ var FILL = {
|
|
|
5444
5456
|
Magazine: "bg-media-magazine"
|
|
5445
5457
|
};
|
|
5446
5458
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5447
|
-
return /* @__PURE__ */ (0,
|
|
5459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5448
5460
|
"span",
|
|
5449
5461
|
{
|
|
5450
5462
|
className: cn(
|
|
@@ -5460,9 +5472,9 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5460
5472
|
|
|
5461
5473
|
// src/SuggestionChip.tsx
|
|
5462
5474
|
var import_react29 = require("react");
|
|
5463
|
-
var
|
|
5475
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5464
5476
|
var SuggestionChip = (0, import_react29.forwardRef)(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5465
|
-
return /* @__PURE__ */ (0,
|
|
5477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5466
5478
|
"button",
|
|
5467
5479
|
{
|
|
5468
5480
|
ref,
|
|
@@ -5473,7 +5485,7 @@ var SuggestionChip = (0, import_react29.forwardRef)(function SuggestionChip2({ c
|
|
|
5473
5485
|
"inline-flex h-8 max-w-full items-center rounded-full border border-border-default bg-surface px-3 text-sm text-text-primary transition-colors duration-(--mr-motion-duration-interactive) ease-interactive hover:border-border-strong hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5474
5486
|
className
|
|
5475
5487
|
),
|
|
5476
|
-
children: /* @__PURE__ */ (0,
|
|
5488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "truncate", children })
|
|
5477
5489
|
}
|
|
5478
5490
|
);
|
|
5479
5491
|
});
|
|
@@ -5481,10 +5493,10 @@ SuggestionChip.displayName = "SuggestionChip";
|
|
|
5481
5493
|
|
|
5482
5494
|
// src/ToggleChip.tsx
|
|
5483
5495
|
var import_react30 = require("react");
|
|
5484
|
-
var
|
|
5485
|
-
var
|
|
5496
|
+
var import_lucide_react29 = require("lucide-react");
|
|
5497
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5486
5498
|
var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5487
|
-
return /* @__PURE__ */ (0,
|
|
5499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5488
5500
|
"button",
|
|
5489
5501
|
{
|
|
5490
5502
|
ref,
|
|
@@ -5502,7 +5514,7 @@ var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected,
|
|
|
5502
5514
|
className
|
|
5503
5515
|
),
|
|
5504
5516
|
children: [
|
|
5505
|
-
selected && /* @__PURE__ */ (0,
|
|
5517
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react29.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5506
5518
|
children
|
|
5507
5519
|
]
|
|
5508
5520
|
}
|
|
@@ -5512,8 +5524,8 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
5512
5524
|
|
|
5513
5525
|
// src/CopyButton.tsx
|
|
5514
5526
|
var import_react31 = require("react");
|
|
5515
|
-
var
|
|
5516
|
-
var
|
|
5527
|
+
var import_lucide_react30 = require("lucide-react");
|
|
5528
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5517
5529
|
var CONFIRM_MS = 2e3;
|
|
5518
5530
|
var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5519
5531
|
const [copied, setCopied] = (0, import_react31.useState)(false);
|
|
@@ -5530,8 +5542,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5530
5542
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5531
5543
|
};
|
|
5532
5544
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5533
|
-
const icon = copied ? /* @__PURE__ */ (0,
|
|
5534
|
-
return /* @__PURE__ */ (0,
|
|
5545
|
+
const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react30.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react30.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
5546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5535
5547
|
Button,
|
|
5536
5548
|
{
|
|
5537
5549
|
ref,
|
|
@@ -5545,8 +5557,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5545
5557
|
className: cn(!copied && "text-text-secondary", className),
|
|
5546
5558
|
children: [
|
|
5547
5559
|
icon,
|
|
5548
|
-
label && /* @__PURE__ */ (0,
|
|
5549
|
-
/* @__PURE__ */ (0,
|
|
5560
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: copied ? "Copied" : label }),
|
|
5561
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5550
5562
|
]
|
|
5551
5563
|
}
|
|
5552
5564
|
);
|
|
@@ -5554,8 +5566,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5554
5566
|
CopyButton.displayName = "CopyButton";
|
|
5555
5567
|
|
|
5556
5568
|
// src/InlineMessage.tsx
|
|
5557
|
-
var
|
|
5558
|
-
var
|
|
5569
|
+
var import_lucide_react31 = require("lucide-react");
|
|
5570
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5559
5571
|
var BOX = {
|
|
5560
5572
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5561
5573
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5569,30 +5581,30 @@ var ICON_INK = {
|
|
|
5569
5581
|
warning: "text-text-warning",
|
|
5570
5582
|
danger: "text-text-danger"
|
|
5571
5583
|
};
|
|
5572
|
-
var ICON2 = { info:
|
|
5584
|
+
var ICON2 = { info: import_lucide_react31.Info, success: import_lucide_react31.CheckCircle2, warning: import_lucide_react31.AlertTriangle, danger: import_lucide_react31.XCircle };
|
|
5573
5585
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5574
5586
|
const Icon = ICON2[tone];
|
|
5575
|
-
return /* @__PURE__ */ (0,
|
|
5587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5576
5588
|
"div",
|
|
5577
5589
|
{
|
|
5578
5590
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5579
5591
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5580
5592
|
"data-testid": testIdPrefix,
|
|
5581
5593
|
children: [
|
|
5582
|
-
/* @__PURE__ */ (0,
|
|
5583
|
-
/* @__PURE__ */ (0,
|
|
5584
|
-
/* @__PURE__ */ (0,
|
|
5585
|
-
children && /* @__PURE__ */ (0,
|
|
5586
|
-
actions && /* @__PURE__ */ (0,
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
|
|
5597
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
5598
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
5587
5599
|
] }),
|
|
5588
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
5600
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5589
5601
|
"button",
|
|
5590
5602
|
{
|
|
5591
5603
|
type: "button",
|
|
5592
5604
|
onClick: onDismiss,
|
|
5593
5605
|
"aria-label": "Dismiss",
|
|
5594
5606
|
className: "-mr-1 -mt-0.5 flex size-6 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-1 focus-visible:outline-border-focus",
|
|
5595
|
-
children: /* @__PURE__ */ (0,
|
|
5607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react31.X, { size: 14, "aria-hidden": "true" })
|
|
5596
5608
|
}
|
|
5597
5609
|
)
|
|
5598
5610
|
]
|
|
@@ -5602,8 +5614,8 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5602
5614
|
|
|
5603
5615
|
// src/FilterDrawer.tsx
|
|
5604
5616
|
var import_react32 = require("react");
|
|
5605
|
-
var
|
|
5606
|
-
var
|
|
5617
|
+
var import_lucide_react32 = require("lucide-react");
|
|
5618
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5607
5619
|
var SLIDE_MS = 200;
|
|
5608
5620
|
function reducedMotion() {
|
|
5609
5621
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5665,8 +5677,8 @@ function FilterDrawer({
|
|
|
5665
5677
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5666
5678
|
const panel = (v, rows = true) => {
|
|
5667
5679
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5668
|
-
if (s) return /* @__PURE__ */ (0,
|
|
5669
|
-
return /* @__PURE__ */ (0,
|
|
5680
|
+
if (s) return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
5681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("li", { className: "border-b border-border-default", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5670
5682
|
"button",
|
|
5671
5683
|
{
|
|
5672
5684
|
ref: rows ? (el) => {
|
|
@@ -5678,7 +5690,7 @@ function FilterDrawer({
|
|
|
5678
5690
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5679
5691
|
className: "flex w-full items-center gap-3 px-5 py-3.5 text-left transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
5680
5692
|
children: [
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
5693
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5682
5694
|
x.icon,
|
|
5683
5695
|
{
|
|
5684
5696
|
size: 17,
|
|
@@ -5686,22 +5698,22 @@ function FilterDrawer({
|
|
|
5686
5698
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5687
5699
|
}
|
|
5688
5700
|
),
|
|
5689
|
-
/* @__PURE__ */ (0,
|
|
5690
|
-
x.badge && /* @__PURE__ */ (0,
|
|
5691
|
-
/* @__PURE__ */ (0,
|
|
5701
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
5702
|
+
x.badge && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Badge, { tone: "brand", children: x.badge }),
|
|
5703
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react32.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5692
5704
|
]
|
|
5693
5705
|
}
|
|
5694
5706
|
) }, x.id)) });
|
|
5695
5707
|
};
|
|
5696
|
-
return /* @__PURE__ */ (0,
|
|
5708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5697
5709
|
Drawer,
|
|
5698
5710
|
{
|
|
5699
5711
|
open,
|
|
5700
5712
|
onClose,
|
|
5701
5713
|
size,
|
|
5702
5714
|
testIdPrefix,
|
|
5703
|
-
title: focused ? /* @__PURE__ */ (0,
|
|
5704
|
-
/* @__PURE__ */ (0,
|
|
5715
|
+
title: focused ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
5716
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5705
5717
|
"button",
|
|
5706
5718
|
{
|
|
5707
5719
|
ref: backRef,
|
|
@@ -5710,23 +5722,23 @@ function FilterDrawer({
|
|
|
5710
5722
|
"aria-label": "Back to all filters",
|
|
5711
5723
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5712
5724
|
className: "-ml-1.5 rounded-control p-1 text-text-secondary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5713
|
-
children: /* @__PURE__ */ (0,
|
|
5725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react32.ChevronLeft, { size: 18, "aria-hidden": "true" })
|
|
5714
5726
|
}
|
|
5715
5727
|
),
|
|
5716
5728
|
focused.label,
|
|
5717
|
-
focused.info && /* @__PURE__ */ (0,
|
|
5718
|
-
] }) : /* @__PURE__ */ (0,
|
|
5729
|
+
focused.info && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(InfoTip, { text: focused.info, label: `About ${focused.label}` })
|
|
5730
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "flex items-center gap-2.5", children: [
|
|
5719
5731
|
"Filters",
|
|
5720
|
-
activeCount > 0 && /* @__PURE__ */ (0,
|
|
5732
|
+
activeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5721
5733
|
] }),
|
|
5722
5734
|
footer: focused ? (
|
|
5723
5735
|
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5724
|
-
/* @__PURE__ */ (0,
|
|
5725
|
-
) : /* @__PURE__ */ (0,
|
|
5726
|
-
/* @__PURE__ */ (0,
|
|
5727
|
-
/* @__PURE__ */ (0,
|
|
5728
|
-
/* @__PURE__ */ (0,
|
|
5729
|
-
/* @__PURE__ */ (0,
|
|
5736
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
|
|
5737
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
5738
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
5739
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5740
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
5741
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5730
5742
|
Button,
|
|
5731
5743
|
{
|
|
5732
5744
|
variant: "primary",
|
|
@@ -5740,8 +5752,8 @@ function FilterDrawer({
|
|
|
5740
5752
|
)
|
|
5741
5753
|
] })
|
|
5742
5754
|
] }),
|
|
5743
|
-
children: /* @__PURE__ */ (0,
|
|
5744
|
-
/* @__PURE__ */ (0,
|
|
5755
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
5756
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5745
5757
|
"div",
|
|
5746
5758
|
{
|
|
5747
5759
|
style: { transform: incoming },
|
|
@@ -5750,7 +5762,7 @@ function FilterDrawer({
|
|
|
5750
5762
|
},
|
|
5751
5763
|
view ?? "__list"
|
|
5752
5764
|
),
|
|
5753
|
-
leaving && /* @__PURE__ */ (0,
|
|
5765
|
+
leaving && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5754
5766
|
"div",
|
|
5755
5767
|
{
|
|
5756
5768
|
"aria-hidden": "true",
|
|
@@ -5767,10 +5779,10 @@ function FilterDrawer({
|
|
|
5767
5779
|
|
|
5768
5780
|
// src/AllFiltersButton.tsx
|
|
5769
5781
|
var import_react33 = require("react");
|
|
5770
|
-
var
|
|
5771
|
-
var
|
|
5782
|
+
var import_lucide_react33 = require("lucide-react");
|
|
5783
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5772
5784
|
var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5773
|
-
return /* @__PURE__ */ (0,
|
|
5785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5774
5786
|
"button",
|
|
5775
5787
|
{
|
|
5776
5788
|
ref,
|
|
@@ -5782,9 +5794,9 @@ var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2
|
|
|
5782
5794
|
className: cn(chipTriggerClass(), className),
|
|
5783
5795
|
...rest,
|
|
5784
5796
|
children: [
|
|
5785
|
-
/* @__PURE__ */ (0,
|
|
5786
|
-
/* @__PURE__ */ (0,
|
|
5787
|
-
count > 0 && /* @__PURE__ */ (0,
|
|
5797
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react33.SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
5798
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
5799
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
5788
5800
|
]
|
|
5789
5801
|
}
|
|
5790
5802
|
);
|
|
@@ -5793,8 +5805,8 @@ var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2
|
|
|
5793
5805
|
// src/Menu.tsx
|
|
5794
5806
|
var import_react34 = require("react");
|
|
5795
5807
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
5796
|
-
var
|
|
5797
|
-
var
|
|
5808
|
+
var import_lucide_react34 = require("lucide-react");
|
|
5809
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5798
5810
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5799
5811
|
function moveFocus(e) {
|
|
5800
5812
|
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -5807,7 +5819,7 @@ function moveFocus(e) {
|
|
|
5807
5819
|
rows[next].focus();
|
|
5808
5820
|
}
|
|
5809
5821
|
var Menu = (0, import_react34.forwardRef)(
|
|
5810
|
-
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5822
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5811
5823
|
"div",
|
|
5812
5824
|
{
|
|
5813
5825
|
ref,
|
|
@@ -5828,20 +5840,20 @@ var MenuItem = (0, import_react34.forwardRef)(
|
|
|
5828
5840
|
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5829
5841
|
const Comp = asChild ? import_react_slot2.Slot : "button";
|
|
5830
5842
|
const radio = checked !== void 0;
|
|
5831
|
-
const body = /* @__PURE__ */ (0,
|
|
5832
|
-
icon && /* @__PURE__ */ (0,
|
|
5843
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
5844
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
5833
5845
|
asChild ? (
|
|
5834
5846
|
// The link's own text lands here; the link becomes the row.
|
|
5835
|
-
/* @__PURE__ */ (0,
|
|
5836
|
-
) : /* @__PURE__ */ (0,
|
|
5837
|
-
/* @__PURE__ */ (0,
|
|
5838
|
-
description && /* @__PURE__ */ (0,
|
|
5847
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react_slot2.Slottable, { children })
|
|
5848
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
5849
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "block truncate", children }),
|
|
5850
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5839
5851
|
] }),
|
|
5840
|
-
trailing && /* @__PURE__ */ (0,
|
|
5841
|
-
radio && checked && /* @__PURE__ */ (0,
|
|
5842
|
-
submenu && /* @__PURE__ */ (0,
|
|
5852
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
5853
|
+
radio && checked && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react34.Check, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
5854
|
+
submenu && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react34.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5843
5855
|
] });
|
|
5844
|
-
return /* @__PURE__ */ (0,
|
|
5856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5845
5857
|
Comp,
|
|
5846
5858
|
{
|
|
5847
5859
|
ref,
|
|
@@ -5868,7 +5880,7 @@ var MenuItem = (0, import_react34.forwardRef)(
|
|
|
5868
5880
|
);
|
|
5869
5881
|
MenuItem.displayName = "MenuItem";
|
|
5870
5882
|
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5871
|
-
return /* @__PURE__ */ (0,
|
|
5883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5872
5884
|
"div",
|
|
5873
5885
|
{
|
|
5874
5886
|
role: "presentation",
|
|
@@ -5879,7 +5891,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
|
|
|
5879
5891
|
);
|
|
5880
5892
|
}
|
|
5881
5893
|
function MenuSeparator({ className, testIdPrefix }) {
|
|
5882
|
-
return /* @__PURE__ */ (0,
|
|
5894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5883
5895
|
}
|
|
5884
5896
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5885
5897
|
0 && (module.exports = {
|
|
@@ -5929,6 +5941,7 @@ function MenuSeparator({ className, testIdPrefix }) {
|
|
|
5929
5941
|
PageHeader,
|
|
5930
5942
|
Pager,
|
|
5931
5943
|
PieChartPlaceholder,
|
|
5944
|
+
PrimaryBadge,
|
|
5932
5945
|
PublisherBreakdownList,
|
|
5933
5946
|
QUIET_ACTION_CLASS,
|
|
5934
5947
|
SearchBar,
|