@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.js
CHANGED
|
@@ -620,10 +620,21 @@ function Delta({ value, suffix = "%", arrow = false, period, className, testIdPr
|
|
|
620
620
|
);
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
+
// src/PrimaryBadge.tsx
|
|
624
|
+
import { Check as Check2 } from "lucide-react";
|
|
625
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
626
|
+
function PrimaryBadge({ label = "Primary", icon: Icon = Check2, title, className, testIdPrefix }) {
|
|
627
|
+
const badge = /* @__PURE__ */ jsxs7(Badge, { tone: "brand", className: title ? void 0 : className, testIdPrefix, children: [
|
|
628
|
+
Icon && /* @__PURE__ */ jsx7(Icon, { size: 11, "aria-hidden": "true" }),
|
|
629
|
+
label
|
|
630
|
+
] });
|
|
631
|
+
return title ? /* @__PURE__ */ jsx7("span", { title, className: cn("inline-flex shrink-0", className), children: badge }) : badge;
|
|
632
|
+
}
|
|
633
|
+
|
|
623
634
|
// src/CheckBox.tsx
|
|
624
635
|
import { forwardRef } from "react";
|
|
625
|
-
import { Check as
|
|
626
|
-
import { jsx as
|
|
636
|
+
import { Check as Check3, Minus } from "lucide-react";
|
|
637
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
627
638
|
function boxClass(on, disabled) {
|
|
628
639
|
return cn(
|
|
629
640
|
"flex size-4.5 shrink-0 items-center justify-center rounded-small border transition-colors",
|
|
@@ -632,12 +643,12 @@ function boxClass(on, disabled) {
|
|
|
632
643
|
);
|
|
633
644
|
}
|
|
634
645
|
function Glyph({ checked, indeterminate }) {
|
|
635
|
-
if (indeterminate) return /* @__PURE__ */
|
|
636
|
-
return checked ? /* @__PURE__ */
|
|
646
|
+
if (indeterminate) return /* @__PURE__ */ jsx8(Minus, { size: 13, strokeWidth: 3 });
|
|
647
|
+
return checked ? /* @__PURE__ */ jsx8(Check3, { size: 13, strokeWidth: 3 }) : null;
|
|
637
648
|
}
|
|
638
649
|
var CheckBox = forwardRef(function CheckBox2({ checked, indeterminate, onChange, ariaLabel, disabled, stopPropagation = true, testId, testIdPrefix, title, className }, ref) {
|
|
639
650
|
const on = checked || !!indeterminate;
|
|
640
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ jsx8(
|
|
641
652
|
"button",
|
|
642
653
|
{
|
|
643
654
|
ref,
|
|
@@ -662,20 +673,20 @@ var CheckBox = forwardRef(function CheckBox2({ checked, indeterminate, onChange,
|
|
|
662
673
|
disabled && "hover:border-border-interactive",
|
|
663
674
|
className
|
|
664
675
|
),
|
|
665
|
-
children: /* @__PURE__ */
|
|
676
|
+
children: /* @__PURE__ */ jsx8(Glyph, { checked, indeterminate })
|
|
666
677
|
}
|
|
667
678
|
);
|
|
668
679
|
});
|
|
669
680
|
CheckBox.displayName = "CheckBox";
|
|
670
681
|
var CheckBoxBox = forwardRef(function CheckBoxBox2({ checked, indeterminate, disabled, className, testIdPrefix }, ref) {
|
|
671
|
-
return /* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ jsx8(
|
|
672
683
|
"span",
|
|
673
684
|
{
|
|
674
685
|
ref,
|
|
675
686
|
"aria-hidden": "true",
|
|
676
687
|
"data-testid": testIdPrefix,
|
|
677
688
|
className: cn(boxClass(checked || !!indeterminate, disabled), className),
|
|
678
|
-
children: /* @__PURE__ */
|
|
689
|
+
children: /* @__PURE__ */ jsx8(Glyph, { checked, indeterminate })
|
|
679
690
|
}
|
|
680
691
|
);
|
|
681
692
|
});
|
|
@@ -684,7 +695,7 @@ CheckBoxBox.displayName = "CheckBoxBox";
|
|
|
684
695
|
// src/DateRangeFilter.tsx
|
|
685
696
|
import { useEffect as useEffect3, useId as useId2, useLayoutEffect, useMemo as useMemo2, useRef as useRef3, useState as useState3 } from "react";
|
|
686
697
|
import { ChevronDown as ChevronDown2, ChevronLeft, ChevronRight } from "lucide-react";
|
|
687
|
-
import { jsx as
|
|
698
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
688
699
|
var DEFAULT_SHORTCUTS = [
|
|
689
700
|
"Year to date",
|
|
690
701
|
"Rolling 3 months",
|
|
@@ -973,8 +984,8 @@ function DateRangeFilter({
|
|
|
973
984
|
setFlipBelow(ref.current.getBoundingClientRect().top < popRef.current.offsetHeight + 16);
|
|
974
985
|
}, [open, placement]);
|
|
975
986
|
const above = placement === "above" && !flipBelow;
|
|
976
|
-
return /* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
988
|
+
/* @__PURE__ */ jsxs8(
|
|
978
989
|
"button",
|
|
979
990
|
{
|
|
980
991
|
ref: triggerRef,
|
|
@@ -984,22 +995,22 @@ function DateRangeFilter({
|
|
|
984
995
|
"aria-expanded": open,
|
|
985
996
|
className: chipTriggerClass(),
|
|
986
997
|
children: [
|
|
987
|
-
icon && /* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
998
|
+
icon && /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-text-tertiary", children: icon }),
|
|
999
|
+
/* @__PURE__ */ jsxs8("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
1000
|
+
/* @__PURE__ */ jsx9("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 }),
|
|
1001
|
+
/* @__PURE__ */ jsxs8("span", { className: "text-xs leading-none font-medium text-text-primary", children: [
|
|
991
1002
|
displayValue,
|
|
992
|
-
compareLabel(appliedCmp) && /* @__PURE__ */
|
|
1003
|
+
compareLabel(appliedCmp) && /* @__PURE__ */ jsxs8("span", { className: "font-normal text-text-secondary", children: [
|
|
993
1004
|
" \xB7 vs ",
|
|
994
1005
|
compareLabel(appliedCmp).toLowerCase()
|
|
995
1006
|
] })
|
|
996
1007
|
] })
|
|
997
1008
|
] }),
|
|
998
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ jsx9(ChevronDown2, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
|
|
999
1010
|
]
|
|
1000
1011
|
}
|
|
1001
1012
|
),
|
|
1002
|
-
open && /* @__PURE__ */
|
|
1013
|
+
open && /* @__PURE__ */ jsxs8(
|
|
1003
1014
|
"div",
|
|
1004
1015
|
{
|
|
1005
1016
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
@@ -1008,7 +1019,7 @@ function DateRangeFilter({
|
|
|
1008
1019
|
role: "dialog",
|
|
1009
1020
|
"aria-label": "Select date range",
|
|
1010
1021
|
children: [
|
|
1011
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ jsx9("div", { className: "flex w-44 shrink-0 flex-col gap-0.5 border-r border-border-default p-2", children: SHORTCUTS.map((s) => /* @__PURE__ */ jsx9(
|
|
1012
1023
|
"button",
|
|
1013
1024
|
{
|
|
1014
1025
|
type: "button",
|
|
@@ -1019,28 +1030,28 @@ function DateRangeFilter({
|
|
|
1019
1030
|
},
|
|
1020
1031
|
s
|
|
1021
1032
|
)) }),
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col p-4", children: [
|
|
1034
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-end gap-3", children: [
|
|
1035
|
+
/* @__PURE__ */ jsx9(Field, { label: "Start date", value: start ? showDate(start) : "\u2014" }),
|
|
1036
|
+
/* @__PURE__ */ jsx9("span", { className: "pb-2.5 text-text-tertiary", children: "\u2014" }),
|
|
1037
|
+
/* @__PURE__ */ jsx9(Field, { label: "End date", value: end ? showDate(end) : start ? showDate(start) : "\u2014" })
|
|
1027
1038
|
] }),
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
-
/* @__PURE__ */
|
|
1039
|
+
/* @__PURE__ */ jsx9("div", { className: "my-4 border-t border-border-default" }),
|
|
1040
|
+
/* @__PURE__ */ jsx9("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
|
|
1030
1041
|
const m = addMonths(leftMonth, offset);
|
|
1031
1042
|
const grid = monthGrid(m.getFullYear(), m.getMonth());
|
|
1032
|
-
return /* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
offset === 0 ? /* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ jsxs8("div", { className: "w-63", children: [
|
|
1044
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1045
|
+
offset === 0 ? /* @__PURE__ */ jsx9(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ jsx9(ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ jsx9("span", { className: "h-7 w-7" }),
|
|
1046
|
+
/* @__PURE__ */ jsxs8("span", { id: `${monthIdBase}-m${offset}`, "aria-live": "polite", className: "text-panel-title font-semibold text-text-primary", children: [
|
|
1036
1047
|
MONTHS[m.getMonth()],
|
|
1037
1048
|
" ",
|
|
1038
1049
|
m.getFullYear()
|
|
1039
1050
|
] }),
|
|
1040
|
-
offset === 1 ? /* @__PURE__ */
|
|
1051
|
+
offset === 1 ? /* @__PURE__ */ jsx9(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ jsx9(ChevronRight, { size: 16 }) }) : /* @__PURE__ */ jsx9("span", { className: "h-7 w-7" })
|
|
1041
1052
|
] }),
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
WEEKDAYS.map((w) => /* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-7", role: "group", "aria-labelledby": `${monthIdBase}-m${offset}`, children: [
|
|
1054
|
+
WEEKDAYS.map((w) => /* @__PURE__ */ jsx9("div", { "aria-hidden": "true", className: "flex h-8 items-center justify-center text-xs font-semibold text-text-secondary", children: w }, w)),
|
|
1044
1055
|
grid.map((d, i) => {
|
|
1045
1056
|
const inMonth = d.getMonth() === m.getMonth();
|
|
1046
1057
|
const hasRange = !!(start && end);
|
|
@@ -1055,7 +1066,7 @@ function DateRangeFilter({
|
|
|
1055
1066
|
else if (end && isEnd) band = "left-0 right-1/2";
|
|
1056
1067
|
else band = "left-0 right-0";
|
|
1057
1068
|
}
|
|
1058
|
-
return /* @__PURE__ */
|
|
1069
|
+
return /* @__PURE__ */ jsxs8(
|
|
1059
1070
|
"button",
|
|
1060
1071
|
{
|
|
1061
1072
|
type: "button",
|
|
@@ -1064,8 +1075,8 @@ function DateRangeFilter({
|
|
|
1064
1075
|
"aria-pressed": endpoint || inRange,
|
|
1065
1076
|
className: "relative flex h-9 items-center justify-center focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
1066
1077
|
children: [
|
|
1067
|
-
band && /* @__PURE__ */
|
|
1068
|
-
/* @__PURE__ */
|
|
1078
|
+
band && /* @__PURE__ */ jsx9("span", { className: `absolute inset-y-1 bg-ai-tint ${band}`, "aria-hidden": "true" }),
|
|
1079
|
+
/* @__PURE__ */ jsx9(
|
|
1069
1080
|
"span",
|
|
1070
1081
|
{
|
|
1071
1082
|
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"}`,
|
|
@@ -1080,16 +1091,16 @@ function DateRangeFilter({
|
|
|
1080
1091
|
] })
|
|
1081
1092
|
] }, offset);
|
|
1082
1093
|
}) }),
|
|
1083
|
-
compare && /* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1094
|
+
compare && /* @__PURE__ */ jsxs8("fieldset", { className: "mt-4 border-t border-border-default pt-4", children: [
|
|
1095
|
+
/* @__PURE__ */ jsx9("legend", { className: "float-left mb-2 w-full text-xs font-medium text-text-secondary", children: "Compare to" }),
|
|
1096
|
+
/* @__PURE__ */ jsx9("div", { className: "clear-left flex flex-col gap-1", children: compare.options.map((o) => {
|
|
1086
1097
|
const on = (cmp ?? compare.value) === o.id;
|
|
1087
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ jsxs8(
|
|
1088
1099
|
"label",
|
|
1089
1100
|
{
|
|
1090
1101
|
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"}`,
|
|
1091
1102
|
children: [
|
|
1092
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ jsx9(
|
|
1093
1104
|
"input",
|
|
1094
1105
|
{
|
|
1095
1106
|
type: "radio",
|
|
@@ -1101,21 +1112,21 @@ function DateRangeFilter({
|
|
|
1101
1112
|
className: "h-4 w-4 accent-brand-primaryAction"
|
|
1102
1113
|
}
|
|
1103
1114
|
),
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
start && /* @__PURE__ */
|
|
1115
|
+
/* @__PURE__ */ jsx9("span", { className: `w-44 shrink-0 ${on ? "font-semibold text-text-primary" : "text-text-secondary"}`, children: o.label }),
|
|
1116
|
+
start && /* @__PURE__ */ jsx9("span", { className: "tabular-nums text-text-tertiary", children: (formatted ? showRange : spanLabel)(...compareSpan(start, end ?? start, o.id)) })
|
|
1106
1117
|
]
|
|
1107
1118
|
},
|
|
1108
1119
|
o.id
|
|
1109
1120
|
);
|
|
1110
1121
|
}) })
|
|
1111
1122
|
] }),
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
monthly && /* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
1123
|
+
/* @__PURE__ */ jsxs8("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
1124
|
+
monthly && /* @__PURE__ */ jsx9("span", { className: "mr-auto text-xs text-text-tertiary", children: "Data is monthly, so ranges cover whole months." }),
|
|
1125
|
+
/* @__PURE__ */ jsx9("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => {
|
|
1115
1126
|
setOpen(false);
|
|
1116
1127
|
triggerRef.current?.focus();
|
|
1117
1128
|
}, 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" }),
|
|
1118
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ jsx9("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" })
|
|
1119
1130
|
] })
|
|
1120
1131
|
] })
|
|
1121
1132
|
]
|
|
@@ -1124,19 +1135,19 @@ function DateRangeFilter({
|
|
|
1124
1135
|
] });
|
|
1125
1136
|
}
|
|
1126
1137
|
function Field({ label, value }) {
|
|
1127
|
-
return /* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
/* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5", children: [
|
|
1139
|
+
/* @__PURE__ */ jsx9("span", { className: "text-xs font-medium text-text-secondary", children: label }),
|
|
1140
|
+
/* @__PURE__ */ jsx9("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 })
|
|
1130
1141
|
] });
|
|
1131
1142
|
}
|
|
1132
1143
|
function NavBtn({ children, onClick, ...rest }) {
|
|
1133
|
-
return /* @__PURE__ */
|
|
1144
|
+
return /* @__PURE__ */ jsx9("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 });
|
|
1134
1145
|
}
|
|
1135
1146
|
|
|
1136
1147
|
// src/SearchBar.tsx
|
|
1137
1148
|
import { forwardRef as forwardRef2, useEffect as useEffect4, useId as useId3, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState4 } from "react";
|
|
1138
|
-
import { AlertCircle, Check as
|
|
1139
|
-
import { Fragment as Fragment2, jsx as
|
|
1149
|
+
import { AlertCircle, Check as Check4, ChevronDown as ChevronDown3, Search as Search3, X as X2 } from "lucide-react";
|
|
1150
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1140
1151
|
var HEIGHT = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
1141
1152
|
var DEFAULT_SEARCH_MATCH = { mode: "anyWord", wordJoin: "Or" };
|
|
1142
1153
|
var MODE_LABEL = {
|
|
@@ -1238,7 +1249,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1238
1249
|
};
|
|
1239
1250
|
}, [open]);
|
|
1240
1251
|
const showMatch = variant === "filterable" && matchValue;
|
|
1241
|
-
return /* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ jsxs9(
|
|
1242
1253
|
"div",
|
|
1243
1254
|
{
|
|
1244
1255
|
className: cn(
|
|
@@ -1251,8 +1262,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1251
1262
|
),
|
|
1252
1263
|
"data-testid": testIdPrefix,
|
|
1253
1264
|
children: [
|
|
1254
|
-
scope && /* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1265
|
+
scope && /* @__PURE__ */ jsx10(ScopeMenu, { scope, onOpenChange: onScopeOpenChange, testIdPrefix }),
|
|
1266
|
+
/* @__PURE__ */ jsxs9(
|
|
1256
1267
|
"div",
|
|
1257
1268
|
{
|
|
1258
1269
|
ref: codesRef,
|
|
@@ -1264,8 +1275,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1264
1275
|
}
|
|
1265
1276
|
},
|
|
1266
1277
|
children: [
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
adCodeMode && adCodes.length > 0 && /* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ jsx10(Search3, { size: 15, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
1279
|
+
adCodeMode && adCodes.length > 0 && /* @__PURE__ */ jsxs9(
|
|
1269
1280
|
"span",
|
|
1270
1281
|
{
|
|
1271
1282
|
className: cn(
|
|
@@ -1273,7 +1284,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1273
1284
|
hasMisses ? "bg-status-danger/15 text-text-danger" : "bg-subtle text-text-primary"
|
|
1274
1285
|
),
|
|
1275
1286
|
children: [
|
|
1276
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ jsxs9(
|
|
1277
1288
|
"button",
|
|
1278
1289
|
{
|
|
1279
1290
|
type: "button",
|
|
@@ -1283,12 +1294,12 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1283
1294
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes`,
|
|
1284
1295
|
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",
|
|
1285
1296
|
children: [
|
|
1286
|
-
hasMisses && /* @__PURE__ */
|
|
1297
|
+
hasMisses && /* @__PURE__ */ jsx10(AlertCircle, { size: 13, "aria-hidden": "true" }),
|
|
1287
1298
|
hasMisses ? `${matchedCount} of ${adCodes.length} matched` : adCodes.length === 1 ? adCodes[0] : `${adCodes.length} Ad Codes`
|
|
1288
1299
|
]
|
|
1289
1300
|
}
|
|
1290
1301
|
),
|
|
1291
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ jsx10(
|
|
1292
1303
|
"button",
|
|
1293
1304
|
{
|
|
1294
1305
|
type: "button",
|
|
@@ -1296,13 +1307,13 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1296
1307
|
onClick: () => updateCodes([], -1),
|
|
1297
1308
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-clear`,
|
|
1298
1309
|
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",
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1310
|
+
children: /* @__PURE__ */ jsx10(X2, { size: 12, "aria-hidden": "true" })
|
|
1300
1311
|
}
|
|
1301
1312
|
)
|
|
1302
1313
|
]
|
|
1303
1314
|
}
|
|
1304
1315
|
),
|
|
1305
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ jsx10(
|
|
1306
1317
|
"input",
|
|
1307
1318
|
{
|
|
1308
1319
|
ref: setInput,
|
|
@@ -1323,7 +1334,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1323
1334
|
className: "min-w-0 flex-1 bg-transparent text-dense text-text-primary outline-hidden placeholder:text-text-tertiary"
|
|
1324
1335
|
}
|
|
1325
1336
|
),
|
|
1326
|
-
adCodeMode && codesOpen && adCodes.length > 0 && /* @__PURE__ */
|
|
1337
|
+
adCodeMode && codesOpen && adCodes.length > 0 && /* @__PURE__ */ jsxs9(
|
|
1327
1338
|
"div",
|
|
1328
1339
|
{
|
|
1329
1340
|
ref: codesPopover,
|
|
@@ -1332,10 +1343,10 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1332
1343
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-popover`,
|
|
1333
1344
|
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",
|
|
1334
1345
|
children: [
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ jsx10("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"}` }),
|
|
1347
|
+
/* @__PURE__ */ jsx10("ul", { className: "flex max-h-50 flex-wrap gap-2 overflow-y-auto p-0.5", children: adCodes.map((code, i) => {
|
|
1337
1348
|
const missed = !!isAdCodeMatched && !isAdCodeMatched(code);
|
|
1338
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ jsxs9(
|
|
1339
1350
|
"li",
|
|
1340
1351
|
{
|
|
1341
1352
|
className: cn(
|
|
@@ -1344,8 +1355,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1344
1355
|
),
|
|
1345
1356
|
children: [
|
|
1346
1357
|
code,
|
|
1347
|
-
missed && /* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1358
|
+
missed && /* @__PURE__ */ jsx10("span", { className: "sr-only", children: " (not found)" }),
|
|
1359
|
+
/* @__PURE__ */ jsx10(
|
|
1349
1360
|
"button",
|
|
1350
1361
|
{
|
|
1351
1362
|
type: "button",
|
|
@@ -1354,7 +1365,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1354
1365
|
onClick: () => updateCodes(adCodes.filter((c) => c !== code), i),
|
|
1355
1366
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-code-remove-${slug3(code)}`,
|
|
1356
1367
|
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",
|
|
1357
|
-
children: /* @__PURE__ */
|
|
1368
|
+
children: /* @__PURE__ */ jsx10(X2, { size: 13, "aria-hidden": "true" })
|
|
1358
1369
|
}
|
|
1359
1370
|
)
|
|
1360
1371
|
]
|
|
@@ -1362,7 +1373,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1362
1373
|
code
|
|
1363
1374
|
);
|
|
1364
1375
|
}) }),
|
|
1365
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ jsx10("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ jsx10(
|
|
1366
1377
|
"button",
|
|
1367
1378
|
{
|
|
1368
1379
|
type: "button",
|
|
@@ -1375,11 +1386,11 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1375
1386
|
children: "Search"
|
|
1376
1387
|
}
|
|
1377
1388
|
) }),
|
|
1378
|
-
onDownloadAdCodes && /* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1389
|
+
onDownloadAdCodes && /* @__PURE__ */ jsxs9("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: [
|
|
1390
|
+
/* @__PURE__ */ jsx10(AlertCircle, { size: 16, "aria-hidden": "true", className: "mt-0.5 shrink-0 text-text-tertiary" }),
|
|
1391
|
+
/* @__PURE__ */ jsxs9("span", { children: [
|
|
1381
1392
|
hasMisses && "Some ad codes in your search could not be matched. ",
|
|
1382
|
-
/* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ jsx10(
|
|
1383
1394
|
"button",
|
|
1384
1395
|
{
|
|
1385
1396
|
type: "button",
|
|
@@ -1399,7 +1410,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1399
1410
|
]
|
|
1400
1411
|
}
|
|
1401
1412
|
),
|
|
1402
|
-
value && onChange && /* @__PURE__ */
|
|
1413
|
+
value && onChange && /* @__PURE__ */ jsx10(
|
|
1403
1414
|
"button",
|
|
1404
1415
|
{
|
|
1405
1416
|
type: "button",
|
|
@@ -1410,7 +1421,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1410
1421
|
"aria-label": "Clear search",
|
|
1411
1422
|
"data-testid": testIdPrefix && `${testIdPrefix}-clear`,
|
|
1412
1423
|
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",
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1424
|
+
children: /* @__PURE__ */ jsx10(X2, { size: 14, "aria-hidden": "true" })
|
|
1414
1425
|
}
|
|
1415
1426
|
),
|
|
1416
1427
|
showMatch && // border-border-default, not the bare `border-border` both source
|
|
@@ -1424,8 +1435,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1424
1435
|
// token package (insights-studio-prototype's own src/index.css;
|
|
1425
1436
|
// mr-clientapps' own tailwind.config.ts `colors.border.DEFAULT`) --
|
|
1426
1437
|
// an alias this shared component can't rely on existing.
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative shrink-0 border-l border-border-default", ref, children: [
|
|
1439
|
+
/* @__PURE__ */ jsxs9(
|
|
1429
1440
|
"button",
|
|
1430
1441
|
{
|
|
1431
1442
|
type: "button",
|
|
@@ -1436,7 +1447,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1436
1447
|
className: "flex h-full items-center gap-1 px-2.5 text-dense font-medium text-text-primary transition-colors hover:bg-subtle",
|
|
1437
1448
|
children: [
|
|
1438
1449
|
matchValue.mode === "anyWord" ? `${MODE_LABEL.anyWord} (${matchValue.wordJoin})` : MODE_LABEL[matchValue.mode],
|
|
1439
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ jsx10(
|
|
1440
1451
|
ChevronDown3,
|
|
1441
1452
|
{
|
|
1442
1453
|
size: 14,
|
|
@@ -1447,25 +1458,25 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1447
1458
|
]
|
|
1448
1459
|
}
|
|
1449
1460
|
),
|
|
1450
|
-
open && /* @__PURE__ */
|
|
1461
|
+
open && /* @__PURE__ */ jsx10(
|
|
1451
1462
|
"div",
|
|
1452
1463
|
{
|
|
1453
1464
|
role: "dialog",
|
|
1454
1465
|
"aria-label": "Search match type",
|
|
1455
1466
|
"data-testid": testIdPrefix && `${testIdPrefix}-mode-popover`,
|
|
1456
1467
|
className: "absolute right-0 top-full mt-2 z-50 w-100 rounded-card border border-border-default bg-surface p-3 shadow-overlay",
|
|
1457
|
-
children: /* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1468
|
+
children: /* @__PURE__ */ jsxs9("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
|
|
1469
|
+
/* @__PURE__ */ jsx10(
|
|
1459
1470
|
ModeRow,
|
|
1460
1471
|
{
|
|
1461
1472
|
title: "Any Word Text Search",
|
|
1462
1473
|
selected: matchValue.mode === "anyWord",
|
|
1463
1474
|
onSelect: () => onMatchChange?.({ mode: "anyWord", wordJoin: matchValue.wordJoin }),
|
|
1464
1475
|
testId: testIdPrefix && `${testIdPrefix}-mode-anyWord`,
|
|
1465
|
-
description: /* @__PURE__ */
|
|
1476
|
+
description: /* @__PURE__ */ jsx10(Fragment2, { children: "Find creatives that contain your keyword(s) using an \u201COr\u201D (match any) or \u201CAnd\u201D (match all) conditional in any order." }),
|
|
1466
1477
|
infoText: "The Or/And choice applies only when Any Word is the active search mode.",
|
|
1467
|
-
extra: /* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1478
|
+
extra: /* @__PURE__ */ jsxs9("span", { className: "flex items-center gap-3", children: [
|
|
1479
|
+
/* @__PURE__ */ jsx10(
|
|
1469
1480
|
RadioOption,
|
|
1470
1481
|
{
|
|
1471
1482
|
label: "Or",
|
|
@@ -1474,7 +1485,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1474
1485
|
testId: testIdPrefix && `${testIdPrefix}-word-join-or`
|
|
1475
1486
|
}
|
|
1476
1487
|
),
|
|
1477
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ jsx10(
|
|
1478
1489
|
RadioOption,
|
|
1479
1490
|
{
|
|
1480
1491
|
label: "And",
|
|
@@ -1486,8 +1497,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1486
1497
|
] })
|
|
1487
1498
|
}
|
|
1488
1499
|
),
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ jsx10(Divider, {}),
|
|
1501
|
+
/* @__PURE__ */ jsx10(
|
|
1491
1502
|
ModeRow,
|
|
1492
1503
|
{
|
|
1493
1504
|
title: "Exact Match Text Search",
|
|
@@ -1498,8 +1509,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1498
1509
|
infoText: "Keywords are matched as a single contiguous phrase, in the order you typed them."
|
|
1499
1510
|
}
|
|
1500
1511
|
),
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ jsx10(Divider, {}),
|
|
1513
|
+
/* @__PURE__ */ jsx10(
|
|
1503
1514
|
ModeRow,
|
|
1504
1515
|
{
|
|
1505
1516
|
title: "Contextual Search",
|
|
@@ -1511,8 +1522,8 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1511
1522
|
infoText: "Uses semantic matching, so results can include related terms even when the exact keyword isn't present."
|
|
1512
1523
|
}
|
|
1513
1524
|
),
|
|
1514
|
-
/* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ jsx10(Divider, {}),
|
|
1526
|
+
/* @__PURE__ */ jsx10(
|
|
1516
1527
|
ModeRow,
|
|
1517
1528
|
{
|
|
1518
1529
|
title: "Ad Code Search",
|
|
@@ -1533,7 +1544,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1533
1544
|
});
|
|
1534
1545
|
SearchBar.displayName = "SearchBar";
|
|
1535
1546
|
function Divider() {
|
|
1536
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ jsx10("div", { className: "my-2.5 border-t border-border-default", "aria-hidden": "true" });
|
|
1537
1548
|
}
|
|
1538
1549
|
function ModeRow({
|
|
1539
1550
|
title,
|
|
@@ -1546,16 +1557,16 @@ function ModeRow({
|
|
|
1546
1557
|
testId
|
|
1547
1558
|
}) {
|
|
1548
1559
|
const descId = useId3();
|
|
1549
|
-
return /* @__PURE__ */
|
|
1560
|
+
return /* @__PURE__ */ jsxs9(
|
|
1550
1561
|
"div",
|
|
1551
1562
|
{
|
|
1552
1563
|
onClick: onSelect,
|
|
1553
1564
|
className: "flex cursor-pointer flex-col items-stretch gap-1 rounded-control p-1.5 text-left transition-colors hover:bg-subtle",
|
|
1554
1565
|
children: [
|
|
1555
|
-
/* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1567
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
1568
|
+
/* @__PURE__ */ jsxs9("span", { className: "flex items-center gap-1", children: [
|
|
1569
|
+
/* @__PURE__ */ jsx10(
|
|
1559
1570
|
"button",
|
|
1560
1571
|
{
|
|
1561
1572
|
type: "button",
|
|
@@ -1571,14 +1582,14 @@ function ModeRow({
|
|
|
1571
1582
|
children: title
|
|
1572
1583
|
}
|
|
1573
1584
|
),
|
|
1574
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ jsx10(RowInfoTip, { text: infoText })
|
|
1575
1586
|
] }),
|
|
1576
|
-
badge && /* @__PURE__ */
|
|
1587
|
+
badge && /* @__PURE__ */ jsx10(Badge, { kind: "category", children: badge }),
|
|
1577
1588
|
extra
|
|
1578
1589
|
] }),
|
|
1579
|
-
selected && /* @__PURE__ */
|
|
1590
|
+
selected && /* @__PURE__ */ jsx10(Check4, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
|
|
1580
1591
|
] }),
|
|
1581
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ jsx10("span", { id: descId, className: "block text-xs leading-snug text-text-secondary", children: description })
|
|
1582
1593
|
]
|
|
1583
1594
|
}
|
|
1584
1595
|
);
|
|
@@ -1589,7 +1600,7 @@ function RadioOption({
|
|
|
1589
1600
|
onSelect,
|
|
1590
1601
|
testId
|
|
1591
1602
|
}) {
|
|
1592
|
-
return /* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ jsxs9(
|
|
1593
1604
|
"button",
|
|
1594
1605
|
{
|
|
1595
1606
|
type: "button",
|
|
@@ -1602,14 +1613,14 @@ function RadioOption({
|
|
|
1602
1613
|
"aria-checked": checked,
|
|
1603
1614
|
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",
|
|
1604
1615
|
children: [
|
|
1605
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ jsx10(
|
|
1606
1617
|
"span",
|
|
1607
1618
|
{
|
|
1608
1619
|
className: cn(
|
|
1609
1620
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
|
|
1610
1621
|
checked ? "border-brand-primaryAction" : "border-border-interactive"
|
|
1611
1622
|
),
|
|
1612
|
-
children: checked && /* @__PURE__ */
|
|
1623
|
+
children: checked && /* @__PURE__ */ jsx10("span", { className: "h-2 w-2 rounded-full bg-brand-primaryAction" })
|
|
1613
1624
|
}
|
|
1614
1625
|
),
|
|
1615
1626
|
label
|
|
@@ -1629,8 +1640,8 @@ function RowInfoTip({ text }) {
|
|
|
1629
1640
|
window.addEventListener("mousedown", onDown);
|
|
1630
1641
|
return () => window.removeEventListener("mousedown", onDown);
|
|
1631
1642
|
}, [open]);
|
|
1632
|
-
return /* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ jsxs9("span", { className: "relative inline-flex shrink-0 items-center", ref, children: [
|
|
1644
|
+
/* @__PURE__ */ jsx10(
|
|
1634
1645
|
"button",
|
|
1635
1646
|
{
|
|
1636
1647
|
type: "button",
|
|
@@ -1642,10 +1653,10 @@ function RowInfoTip({ text }) {
|
|
|
1642
1653
|
"aria-expanded": open,
|
|
1643
1654
|
"aria-describedby": id,
|
|
1644
1655
|
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",
|
|
1645
|
-
children: /* @__PURE__ */
|
|
1656
|
+
children: /* @__PURE__ */ jsx10(AlertCircle, { size: 13, "aria-hidden": "true" })
|
|
1646
1657
|
}
|
|
1647
1658
|
),
|
|
1648
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ jsx10(
|
|
1649
1660
|
"span",
|
|
1650
1661
|
{
|
|
1651
1662
|
id,
|
|
@@ -1700,8 +1711,8 @@ function ScopeMenu({
|
|
|
1700
1711
|
close(false);
|
|
1701
1712
|
}
|
|
1702
1713
|
};
|
|
1703
|
-
return /* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsxs9("div", { className: "relative flex shrink-0 border-r border-border-default", ref, children: [
|
|
1715
|
+
/* @__PURE__ */ jsxs9(
|
|
1705
1716
|
"button",
|
|
1706
1717
|
{
|
|
1707
1718
|
ref: trigger,
|
|
@@ -1715,7 +1726,7 @@ function ScopeMenu({
|
|
|
1715
1726
|
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",
|
|
1716
1727
|
children: [
|
|
1717
1728
|
scope.value,
|
|
1718
|
-
/* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ jsx10(
|
|
1719
1730
|
ChevronDown3,
|
|
1720
1731
|
{
|
|
1721
1732
|
size: 13,
|
|
@@ -1726,7 +1737,7 @@ function ScopeMenu({
|
|
|
1726
1737
|
]
|
|
1727
1738
|
}
|
|
1728
1739
|
),
|
|
1729
|
-
open && /* @__PURE__ */
|
|
1740
|
+
open && /* @__PURE__ */ jsxs9(
|
|
1730
1741
|
"div",
|
|
1731
1742
|
{
|
|
1732
1743
|
ref: list,
|
|
@@ -1737,13 +1748,13 @@ function ScopeMenu({
|
|
|
1737
1748
|
"data-testid": testIdPrefix && `${testIdPrefix}-scope-popover`,
|
|
1738
1749
|
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",
|
|
1739
1750
|
children: [
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
scope.info && /* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsxs9("div", { className: "px-3 pb-1.5 pt-1", "aria-hidden": "true", children: [
|
|
1752
|
+
/* @__PURE__ */ jsx10("p", { className: "text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: scope.label }),
|
|
1753
|
+
scope.info && /* @__PURE__ */ jsx10("p", { className: "mt-0.5 text-xs text-text-secondary", children: scope.info })
|
|
1743
1754
|
] }),
|
|
1744
1755
|
scope.options.map((o) => {
|
|
1745
1756
|
const sel = o === scope.value;
|
|
1746
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ jsxs9(
|
|
1747
1758
|
"button",
|
|
1748
1759
|
{
|
|
1749
1760
|
type: "button",
|
|
@@ -1760,7 +1771,7 @@ function ScopeMenu({
|
|
|
1760
1771
|
sel ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
1761
1772
|
),
|
|
1762
1773
|
children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ jsx10(Check4, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-brand-primaryAction", !sel && "invisible") }),
|
|
1764
1775
|
o
|
|
1765
1776
|
]
|
|
1766
1777
|
},
|
|
@@ -1776,7 +1787,7 @@ function ScopeMenu({
|
|
|
1776
1787
|
// src/SectionRail.tsx
|
|
1777
1788
|
import { useRef as useRef5 } from "react";
|
|
1778
1789
|
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
1779
|
-
import { jsx as
|
|
1790
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1780
1791
|
function SectionRail({
|
|
1781
1792
|
title,
|
|
1782
1793
|
titleSerif,
|
|
@@ -1791,20 +1802,20 @@ function SectionRail({
|
|
|
1791
1802
|
const scroll = (direction) => {
|
|
1792
1803
|
scrollRef.current?.scrollBy({ left: direction * 320, behavior: "smooth" });
|
|
1793
1804
|
};
|
|
1794
|
-
return /* @__PURE__ */
|
|
1795
|
-
/* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ jsxs10("section", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
1806
|
+
/* @__PURE__ */ jsxs10("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
|
|
1807
|
+
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1808
|
+
/* @__PURE__ */ jsx11(
|
|
1798
1809
|
"h2",
|
|
1799
1810
|
{
|
|
1800
1811
|
className: titleSerif ? "font-serif text-xl font-normal tracking-tight text-text-primary" : "text-xl font-medium tracking-tight text-text-primary",
|
|
1801
1812
|
children: title
|
|
1802
1813
|
}
|
|
1803
1814
|
),
|
|
1804
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ jsx11("p", { className: "mt-1 text-sm text-text-secondary", children: subtitle })
|
|
1805
1816
|
] }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
viewAllLabel && viewAllHref && /* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1818
|
+
viewAllLabel && viewAllHref && /* @__PURE__ */ jsxs10(
|
|
1808
1819
|
"a",
|
|
1809
1820
|
{
|
|
1810
1821
|
href: viewAllHref,
|
|
@@ -1815,29 +1826,29 @@ function SectionRail({
|
|
|
1815
1826
|
]
|
|
1816
1827
|
}
|
|
1817
1828
|
),
|
|
1818
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ jsx11(
|
|
1819
1830
|
"button",
|
|
1820
1831
|
{
|
|
1821
1832
|
type: "button",
|
|
1822
1833
|
onClick: () => scroll(-1),
|
|
1823
1834
|
"aria-label": "Previous",
|
|
1824
1835
|
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",
|
|
1825
|
-
children: /* @__PURE__ */
|
|
1836
|
+
children: /* @__PURE__ */ jsx11(ChevronLeft2, { size: 16 })
|
|
1826
1837
|
}
|
|
1827
1838
|
),
|
|
1828
|
-
/* @__PURE__ */
|
|
1839
|
+
/* @__PURE__ */ jsx11(
|
|
1829
1840
|
"button",
|
|
1830
1841
|
{
|
|
1831
1842
|
type: "button",
|
|
1832
1843
|
onClick: () => scroll(1),
|
|
1833
1844
|
"aria-label": "Next",
|
|
1834
1845
|
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",
|
|
1835
|
-
children: /* @__PURE__ */
|
|
1846
|
+
children: /* @__PURE__ */ jsx11(ChevronRight2, { size: 16 })
|
|
1836
1847
|
}
|
|
1837
1848
|
)
|
|
1838
1849
|
] })
|
|
1839
1850
|
] }),
|
|
1840
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ jsx11(
|
|
1841
1852
|
"div",
|
|
1842
1853
|
{
|
|
1843
1854
|
ref: scrollRef,
|
|
@@ -1850,8 +1861,8 @@ function SectionRail({
|
|
|
1850
1861
|
|
|
1851
1862
|
// src/DataScopeFilter.tsx
|
|
1852
1863
|
import { useEffect as useEffect5, useRef as useRef6, useState as useState5 } from "react";
|
|
1853
|
-
import { Check as
|
|
1854
|
-
import { jsx as
|
|
1864
|
+
import { Check as Check5, ChevronDown as ChevronDown4 } from "lucide-react";
|
|
1865
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1855
1866
|
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.";
|
|
1856
1867
|
function DataScopeFilter({ value, onChange, align = "right", className, testIdPrefix }) {
|
|
1857
1868
|
const [open, setOpen] = useState5(false);
|
|
@@ -1874,8 +1885,8 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1874
1885
|
onChange(v);
|
|
1875
1886
|
setOpen(false);
|
|
1876
1887
|
};
|
|
1877
|
-
return /* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsxs11("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
1889
|
+
/* @__PURE__ */ jsxs11(
|
|
1879
1890
|
"button",
|
|
1880
1891
|
{
|
|
1881
1892
|
type: "button",
|
|
@@ -1884,8 +1895,8 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1884
1895
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
1885
1896
|
className: chipTriggerClass(),
|
|
1886
1897
|
children: [
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ jsx12(ChipContent, { caption: "Data", value: display }),
|
|
1899
|
+
/* @__PURE__ */ jsx12(
|
|
1889
1900
|
ChevronDown4,
|
|
1890
1901
|
{
|
|
1891
1902
|
size: 14,
|
|
@@ -1896,7 +1907,7 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1896
1907
|
]
|
|
1897
1908
|
}
|
|
1898
1909
|
),
|
|
1899
|
-
open && /* @__PURE__ */
|
|
1910
|
+
open && /* @__PURE__ */ jsxs11(
|
|
1900
1911
|
"div",
|
|
1901
1912
|
{
|
|
1902
1913
|
role: "group",
|
|
@@ -1907,8 +1918,8 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1907
1918
|
align === "right" ? "right-0" : "left-0"
|
|
1908
1919
|
),
|
|
1909
1920
|
children: [
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ jsx12(Option, { label: "All", selected: !value, onClick: () => choose(false) }),
|
|
1922
|
+
/* @__PURE__ */ jsx12(Option, { label: "Final only", selected: value, onClick: () => choose(true), hint: FINAL_ONLY_TEXT })
|
|
1912
1923
|
]
|
|
1913
1924
|
}
|
|
1914
1925
|
)
|
|
@@ -1920,7 +1931,7 @@ function Option({
|
|
|
1920
1931
|
onClick,
|
|
1921
1932
|
hint
|
|
1922
1933
|
}) {
|
|
1923
|
-
const option = /* @__PURE__ */
|
|
1934
|
+
const option = /* @__PURE__ */ jsxs11(
|
|
1924
1935
|
"button",
|
|
1925
1936
|
{
|
|
1926
1937
|
type: "button",
|
|
@@ -1932,33 +1943,33 @@ function Option({
|
|
|
1932
1943
|
selected ? "font-semibold text-text-primary" : "text-text-secondary"
|
|
1933
1944
|
),
|
|
1934
1945
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ jsx12(Check5, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-brand-primaryAction", !selected && "invisible") }),
|
|
1936
1947
|
label
|
|
1937
1948
|
]
|
|
1938
1949
|
}
|
|
1939
1950
|
);
|
|
1940
1951
|
if (!hint) return option;
|
|
1941
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 pr-2.5", children: [
|
|
1942
1953
|
option,
|
|
1943
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ jsx12(InfoTip, { text: hint, trigger: "hover", label: `About ${label}` })
|
|
1944
1955
|
] });
|
|
1945
1956
|
}
|
|
1946
1957
|
|
|
1947
1958
|
// src/SelectFilter.tsx
|
|
1948
1959
|
import { useCallback as useCallback2, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState6 } from "react";
|
|
1949
1960
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1950
|
-
import { Check as
|
|
1961
|
+
import { Check as Check6, ChevronDown as ChevronDown5 } from "lucide-react";
|
|
1951
1962
|
|
|
1952
1963
|
// src/MenuStatus.tsx
|
|
1953
|
-
import { jsx as
|
|
1964
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1954
1965
|
var ROW_WIDTHS = ["w-3/4", "w-1/2", "w-4/5", "w-3/5"];
|
|
1955
1966
|
function MenuLoading() {
|
|
1956
|
-
return /* @__PURE__ */
|
|
1967
|
+
return /* @__PURE__ */ jsx13("div", { role: "status", "aria-label": "Loading options", className: "p-1", children: ROW_WIDTHS.map((w) => /* @__PURE__ */ jsx13("div", { className: "flex h-9 items-center px-2", children: /* @__PURE__ */ jsx13("span", { className: `inline-block h-3 ${w} animate-pulse rounded-full bg-subtle`, "aria-hidden": "true" }) }, w)) });
|
|
1957
1968
|
}
|
|
1958
1969
|
function MenuError({ onRetry }) {
|
|
1959
|
-
return /* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ jsxs12("div", { role: "alert", className: "px-3 py-5 text-center text-dense text-text-secondary", children: [
|
|
1960
1971
|
"Couldn't load options.",
|
|
1961
|
-
onRetry && /* @__PURE__ */
|
|
1972
|
+
onRetry && /* @__PURE__ */ jsx13(
|
|
1962
1973
|
"button",
|
|
1963
1974
|
{
|
|
1964
1975
|
type: "button",
|
|
@@ -1971,12 +1982,12 @@ function MenuError({ onRetry }) {
|
|
|
1971
1982
|
}
|
|
1972
1983
|
|
|
1973
1984
|
// src/SelectFilter.tsx
|
|
1974
|
-
import { jsx as
|
|
1985
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1975
1986
|
function slug4(value) {
|
|
1976
1987
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
1977
1988
|
}
|
|
1978
1989
|
function OptionIcon({ children }) {
|
|
1979
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ jsx14(
|
|
1980
1991
|
"span",
|
|
1981
1992
|
{
|
|
1982
1993
|
"aria-hidden": "true",
|
|
@@ -2042,20 +2053,20 @@ function SelectFilter({
|
|
|
2042
2053
|
window.removeEventListener("scroll", reposition, true);
|
|
2043
2054
|
};
|
|
2044
2055
|
}, [open, close, reposition]);
|
|
2045
|
-
const valueContent = renderIcon ? /* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2056
|
+
const valueContent = renderIcon ? /* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-1.5", children: [
|
|
2057
|
+
/* @__PURE__ */ jsx14(OptionIcon, { children: renderIcon(value) }),
|
|
2047
2058
|
value
|
|
2048
2059
|
] }) : value;
|
|
2049
|
-
const triggerValue = sm && inlineCaption ? /* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2060
|
+
const triggerValue = sm && inlineCaption ? /* @__PURE__ */ jsxs13("span", { children: [
|
|
2061
|
+
/* @__PURE__ */ jsxs13("span", { className: "font-normal text-text-secondary", children: [
|
|
2051
2062
|
caption,
|
|
2052
2063
|
":"
|
|
2053
2064
|
] }),
|
|
2054
2065
|
" ",
|
|
2055
2066
|
valueContent
|
|
2056
2067
|
] }) : valueContent;
|
|
2057
|
-
return /* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2068
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("relative", fullWidth && "w-full"), ref, "data-testid": testIdPrefix, children: [
|
|
2069
|
+
/* @__PURE__ */ jsxs13(
|
|
2059
2070
|
"button",
|
|
2060
2071
|
{
|
|
2061
2072
|
type: "button",
|
|
@@ -2072,8 +2083,8 @@ function SelectFilter({
|
|
|
2072
2083
|
className
|
|
2073
2084
|
),
|
|
2074
2085
|
children: [
|
|
2075
|
-
sm ? triggerValue : /* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2086
|
+
sm ? triggerValue : /* @__PURE__ */ jsx14(ChipContent, { caption, value: triggerValue }),
|
|
2087
|
+
/* @__PURE__ */ jsx14(
|
|
2077
2088
|
ChevronDown5,
|
|
2078
2089
|
{
|
|
2079
2090
|
size: 14,
|
|
@@ -2085,7 +2096,7 @@ function SelectFilter({
|
|
|
2085
2096
|
}
|
|
2086
2097
|
),
|
|
2087
2098
|
open && pos && createPortal2(
|
|
2088
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx14(
|
|
2089
2100
|
"div",
|
|
2090
2101
|
{
|
|
2091
2102
|
ref: popoverRef,
|
|
@@ -2097,9 +2108,9 @@ function SelectFilter({
|
|
|
2097
2108
|
),
|
|
2098
2109
|
role: loading || error ? "group" : "listbox",
|
|
2099
2110
|
"aria-label": caption,
|
|
2100
|
-
children: loading ? /* @__PURE__ */
|
|
2111
|
+
children: loading ? /* @__PURE__ */ jsx14(MenuLoading, {}) : error ? /* @__PURE__ */ jsx14(MenuError, { onRetry }) : /* @__PURE__ */ jsx14("div", { className: "max-h-70 overflow-y-auto p-1", children: options.map((o) => {
|
|
2101
2112
|
const selected = o === value;
|
|
2102
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsxs13(
|
|
2103
2114
|
"button",
|
|
2104
2115
|
{
|
|
2105
2116
|
type: "button",
|
|
@@ -2112,9 +2123,9 @@ function SelectFilter({
|
|
|
2112
2123
|
},
|
|
2113
2124
|
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",
|
|
2114
2125
|
children: [
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
renderIcon && /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2126
|
+
/* @__PURE__ */ jsx14("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ jsx14(Check6, { size: 15, strokeWidth: 3 }) }),
|
|
2127
|
+
renderIcon && /* @__PURE__ */ jsx14(OptionIcon, { children: renderIcon(o) }),
|
|
2128
|
+
/* @__PURE__ */ jsx14(
|
|
2118
2129
|
"span",
|
|
2119
2130
|
{
|
|
2120
2131
|
className: cn("flex-1 text-sm", selected ? "font-semibold text-text-primary" : "text-text-primary"),
|
|
@@ -2135,10 +2146,10 @@ function SelectFilter({
|
|
|
2135
2146
|
|
|
2136
2147
|
// src/Card.tsx
|
|
2137
2148
|
import { forwardRef as forwardRef3 } from "react";
|
|
2138
|
-
import { jsx as
|
|
2149
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2139
2150
|
var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, info, variant = "default", action, className, testIdPrefix, children, ...rest }, ref) {
|
|
2140
2151
|
const chart = variant === "chart";
|
|
2141
|
-
return /* @__PURE__ */
|
|
2152
|
+
return /* @__PURE__ */ jsx15(
|
|
2142
2153
|
"article",
|
|
2143
2154
|
{
|
|
2144
2155
|
ref,
|
|
@@ -2151,18 +2162,18 @@ var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "
|
|
|
2151
2162
|
),
|
|
2152
2163
|
"data-testid": testIdPrefix,
|
|
2153
2164
|
...rest,
|
|
2154
|
-
children: title ? /* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
info && /* @__PURE__ */
|
|
2165
|
+
children: title ? /* @__PURE__ */ jsxs14("div", { className: "flex flex-1 flex-col p-card-padding", children: [
|
|
2166
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2167
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
2168
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5", children: [
|
|
2169
|
+
/* @__PURE__ */ jsx15(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
|
|
2170
|
+
info && /* @__PURE__ */ jsx15(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
|
|
2160
2171
|
] }),
|
|
2161
|
-
subtitle && /* @__PURE__ */
|
|
2172
|
+
subtitle && /* @__PURE__ */ jsx15("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
2162
2173
|
] }),
|
|
2163
|
-
action && /* @__PURE__ */
|
|
2174
|
+
action && /* @__PURE__ */ jsx15("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
2164
2175
|
] }),
|
|
2165
|
-
/* @__PURE__ */
|
|
2176
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-4 flex flex-1 flex-col", children })
|
|
2166
2177
|
] }) : children
|
|
2167
2178
|
}
|
|
2168
2179
|
);
|
|
@@ -2170,9 +2181,9 @@ var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "
|
|
|
2170
2181
|
|
|
2171
2182
|
// src/StatStrip.tsx
|
|
2172
2183
|
import { forwardRef as forwardRef4 } from "react";
|
|
2173
|
-
import { jsx as
|
|
2184
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2174
2185
|
var StatStrip = forwardRef4(
|
|
2175
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */
|
|
2186
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
2176
2187
|
"div",
|
|
2177
2188
|
{
|
|
2178
2189
|
ref,
|
|
@@ -2190,32 +2201,32 @@ var StatStrip = forwardRef4(
|
|
|
2190
2201
|
);
|
|
2191
2202
|
StatStrip.displayName = "StatStrip";
|
|
2192
2203
|
function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
icon && /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ jsxs15("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
|
|
2205
|
+
/* @__PURE__ */ jsxs15("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
|
|
2206
|
+
icon && /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
|
|
2196
2207
|
label,
|
|
2197
|
-
info && /* @__PURE__ */
|
|
2208
|
+
info && /* @__PURE__ */ jsx16(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
|
|
2198
2209
|
] }),
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ jsxs15("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
|
|
2211
|
+
/* @__PURE__ */ jsxs15("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
|
|
2201
2212
|
value,
|
|
2202
|
-
unit && /* @__PURE__ */
|
|
2213
|
+
unit && /* @__PURE__ */ jsxs15("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
|
|
2203
2214
|
" ",
|
|
2204
2215
|
unit
|
|
2205
2216
|
] })
|
|
2206
2217
|
] }),
|
|
2207
|
-
change && /* @__PURE__ */
|
|
2218
|
+
change && /* @__PURE__ */ jsx16("span", { className: "text-card-title font-medium", children: change })
|
|
2208
2219
|
] }),
|
|
2209
|
-
note && /* @__PURE__ */
|
|
2210
|
-
children && /* @__PURE__ */
|
|
2220
|
+
note && /* @__PURE__ */ jsx16("span", { className: "text-xs text-text-tertiary", children: note }),
|
|
2221
|
+
children && /* @__PURE__ */ jsx16("div", { className: "text-xs text-text-secondary", children })
|
|
2211
2222
|
] });
|
|
2212
2223
|
}
|
|
2213
2224
|
|
|
2214
2225
|
// src/ChartLegend.tsx
|
|
2215
2226
|
import { forwardRef as forwardRef5 } from "react";
|
|
2216
|
-
import { jsx as
|
|
2227
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2217
2228
|
var ChartLegend = forwardRef5(
|
|
2218
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */
|
|
2229
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2219
2230
|
"ul",
|
|
2220
2231
|
{
|
|
2221
2232
|
ref,
|
|
@@ -2235,8 +2246,8 @@ var MARK = {
|
|
|
2235
2246
|
};
|
|
2236
2247
|
function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
|
|
2237
2248
|
const dashed = mark === "dashed";
|
|
2238
|
-
return /* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2249
|
+
return /* @__PURE__ */ jsxs16("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
|
|
2250
|
+
/* @__PURE__ */ jsx17(
|
|
2240
2251
|
"span",
|
|
2241
2252
|
{
|
|
2242
2253
|
"aria-hidden": "true",
|
|
@@ -2250,7 +2261,7 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2250
2261
|
style: color ? dashed ? { borderColor: color } : { background: color } : void 0
|
|
2251
2262
|
}
|
|
2252
2263
|
),
|
|
2253
|
-
/* @__PURE__ */
|
|
2264
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
2254
2265
|
children,
|
|
2255
2266
|
you && " (you)"
|
|
2256
2267
|
] })
|
|
@@ -2258,30 +2269,30 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2258
2269
|
}
|
|
2259
2270
|
|
|
2260
2271
|
// src/BarList.tsx
|
|
2261
|
-
import { jsx as
|
|
2272
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2262
2273
|
var COL_WIDTH = ["w-16", "w-13"];
|
|
2263
2274
|
function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
|
|
2264
2275
|
if (!rows.length) {
|
|
2265
|
-
return empty ? /* @__PURE__ */
|
|
2276
|
+
return empty ? /* @__PURE__ */ jsx18("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
|
|
2266
2277
|
}
|
|
2267
2278
|
const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
|
|
2268
2279
|
const full = !!columns?.length;
|
|
2269
2280
|
const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
|
|
2270
|
-
return /* @__PURE__ */
|
|
2271
|
-
full && /* @__PURE__ */
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
columns.map((c, i) => /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ jsxs17("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
|
|
2282
|
+
full && /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
|
|
2283
|
+
/* @__PURE__ */ jsx18("span", { className: "flex-1" }),
|
|
2284
|
+
columns.map((c, i) => /* @__PURE__ */ jsx18("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
|
|
2274
2285
|
] }),
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
/* @__PURE__ */
|
|
2277
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ jsx18("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ jsxs17("li", { className: "py-2", children: [
|
|
2287
|
+
/* @__PURE__ */ jsxs17("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
2288
|
+
/* @__PURE__ */ jsxs17("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
|
|
2278
2289
|
r.label,
|
|
2279
|
-
r.note && /* @__PURE__ */
|
|
2290
|
+
r.note && /* @__PURE__ */ jsxs17("span", { className: "font-normal text-text-tertiary", children: [
|
|
2280
2291
|
" \xB7 ",
|
|
2281
2292
|
r.note
|
|
2282
2293
|
] })
|
|
2283
2294
|
] }),
|
|
2284
|
-
r.values?.map((v, i) => /* @__PURE__ */
|
|
2295
|
+
r.values?.map((v, i) => /* @__PURE__ */ jsxs17(
|
|
2285
2296
|
"span",
|
|
2286
2297
|
{
|
|
2287
2298
|
className: cn(
|
|
@@ -2290,7 +2301,7 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2290
2301
|
colClass(i)
|
|
2291
2302
|
),
|
|
2292
2303
|
children: [
|
|
2293
|
-
full && /* @__PURE__ */
|
|
2304
|
+
full && /* @__PURE__ */ jsxs17("span", { className: "sr-only", children: [
|
|
2294
2305
|
columns[i],
|
|
2295
2306
|
": "
|
|
2296
2307
|
] }),
|
|
@@ -2300,15 +2311,15 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2300
2311
|
i
|
|
2301
2312
|
))
|
|
2302
2313
|
] }),
|
|
2303
|
-
/* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
|
|
2315
|
+
/* @__PURE__ */ jsx18(
|
|
2305
2316
|
"div",
|
|
2306
2317
|
{
|
|
2307
2318
|
className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
|
|
2308
2319
|
style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
|
|
2309
2320
|
}
|
|
2310
2321
|
),
|
|
2311
|
-
r.tick !== void 0 && /* @__PURE__ */
|
|
2322
|
+
r.tick !== void 0 && /* @__PURE__ */ jsx18(
|
|
2312
2323
|
"span",
|
|
2313
2324
|
{
|
|
2314
2325
|
className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
|
|
@@ -2316,14 +2327,14 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2316
2327
|
}
|
|
2317
2328
|
)
|
|
2318
2329
|
] }),
|
|
2319
|
-
r.tickLabel && /* @__PURE__ */
|
|
2330
|
+
r.tickLabel && /* @__PURE__ */ jsx18("span", { className: "sr-only", children: r.tickLabel })
|
|
2320
2331
|
] }, r.key)) })
|
|
2321
2332
|
] });
|
|
2322
2333
|
}
|
|
2323
2334
|
|
|
2324
2335
|
// src/NoResultsEmptyState.tsx
|
|
2325
2336
|
import { FilterX } from "lucide-react";
|
|
2326
|
-
import { jsx as
|
|
2337
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2327
2338
|
var NO_RESULTS_TITLE = "No results match your filters";
|
|
2328
2339
|
var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
|
|
2329
2340
|
function noResultsBody(workspaceName) {
|
|
@@ -2346,12 +2357,12 @@ function NoResultsEmptyState({
|
|
|
2346
2357
|
const showClear = hasFilters !== false && Boolean(onClearFilters);
|
|
2347
2358
|
const showEdit = Boolean(onEditFilters);
|
|
2348
2359
|
const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
|
|
2349
|
-
return /* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
hasActions && /* @__PURE__ */
|
|
2354
|
-
showClear && /* @__PURE__ */
|
|
2360
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2361
|
+
/* @__PURE__ */ jsx19("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ jsx19(FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2362
|
+
/* @__PURE__ */ jsx19("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2363
|
+
/* @__PURE__ */ jsx19("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2364
|
+
hasActions && /* @__PURE__ */ jsxs18("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2365
|
+
showClear && /* @__PURE__ */ jsx19(
|
|
2355
2366
|
"button",
|
|
2356
2367
|
{
|
|
2357
2368
|
type: "button",
|
|
@@ -2361,7 +2372,7 @@ function NoResultsEmptyState({
|
|
|
2361
2372
|
children: "Clear all filters"
|
|
2362
2373
|
}
|
|
2363
2374
|
),
|
|
2364
|
-
showEdit && /* @__PURE__ */
|
|
2375
|
+
showEdit && /* @__PURE__ */ jsx19(
|
|
2365
2376
|
"button",
|
|
2366
2377
|
{
|
|
2367
2378
|
type: "button",
|
|
@@ -2371,7 +2382,7 @@ function NoResultsEmptyState({
|
|
|
2371
2382
|
children: "Edit filters"
|
|
2372
2383
|
}
|
|
2373
2384
|
),
|
|
2374
|
-
actions?.map((action, i) => /* @__PURE__ */
|
|
2385
|
+
actions?.map((action, i) => /* @__PURE__ */ jsx19(
|
|
2375
2386
|
"button",
|
|
2376
2387
|
{
|
|
2377
2388
|
type: "button",
|
|
@@ -2388,9 +2399,9 @@ function NoResultsEmptyState({
|
|
|
2388
2399
|
// src/WorkspaceSelectedCard.tsx
|
|
2389
2400
|
import { useEffect as useEffect7, useRef as useRef8, useState as useState7 } from "react";
|
|
2390
2401
|
import { ChevronDown as ChevronDown6, X as X3 } from "lucide-react";
|
|
2391
|
-
import { jsx as
|
|
2402
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2392
2403
|
function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
2393
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ jsx20(
|
|
2394
2405
|
"aside",
|
|
2395
2406
|
{
|
|
2396
2407
|
className: cn(
|
|
@@ -2398,7 +2409,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
|
2398
2409
|
className
|
|
2399
2410
|
),
|
|
2400
2411
|
"data-testid": testIdPrefix,
|
|
2401
|
-
children: /* @__PURE__ */
|
|
2412
|
+
children: /* @__PURE__ */ jsx20("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ jsx20(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
|
|
2402
2413
|
}
|
|
2403
2414
|
);
|
|
2404
2415
|
}
|
|
@@ -2417,8 +2428,8 @@ function SummaryGroupItem({
|
|
|
2417
2428
|
else if (expandCount === 0) setOpen(false);
|
|
2418
2429
|
wasEmpty.current = expandCount === 0;
|
|
2419
2430
|
}, [expandCount]);
|
|
2420
|
-
return /* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2431
|
+
return /* @__PURE__ */ jsxs19("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
|
|
2432
|
+
/* @__PURE__ */ jsxs19(
|
|
2422
2433
|
"button",
|
|
2423
2434
|
{
|
|
2424
2435
|
type: "button",
|
|
@@ -2427,7 +2438,7 @@ function SummaryGroupItem({
|
|
|
2427
2438
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2428
2439
|
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",
|
|
2429
2440
|
children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2441
|
+
/* @__PURE__ */ jsx20(
|
|
2431
2442
|
ChevronDown6,
|
|
2432
2443
|
{
|
|
2433
2444
|
size: 14,
|
|
@@ -2435,37 +2446,37 @@ function SummaryGroupItem({
|
|
|
2435
2446
|
className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
|
|
2436
2447
|
}
|
|
2437
2448
|
),
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ jsx20("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
|
|
2450
|
+
/* @__PURE__ */ jsx20("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
|
|
2440
2451
|
]
|
|
2441
2452
|
}
|
|
2442
2453
|
),
|
|
2443
|
-
open && /* @__PURE__ */
|
|
2444
|
-
ownCount > 0 && /* @__PURE__ */
|
|
2445
|
-
group.items.map((item) => /* @__PURE__ */
|
|
2454
|
+
open && /* @__PURE__ */ jsx20("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ jsx20("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-2.5", children: [
|
|
2455
|
+
ownCount > 0 && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1.5", children: [
|
|
2456
|
+
group.items.map((item) => /* @__PURE__ */ jsxs19(
|
|
2446
2457
|
"div",
|
|
2447
2458
|
{
|
|
2448
2459
|
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
2449
2460
|
children: [
|
|
2450
|
-
/* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
item.meta && /* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ jsxs19("span", { className: "min-w-0 flex-1", children: [
|
|
2462
|
+
/* @__PURE__ */ jsx20("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
|
|
2463
|
+
item.meta && /* @__PURE__ */ jsx20("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
|
|
2453
2464
|
] }),
|
|
2454
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ jsx20(
|
|
2455
2466
|
"button",
|
|
2456
2467
|
{
|
|
2457
2468
|
type: "button",
|
|
2458
2469
|
"aria-label": `Remove ${item.name}`,
|
|
2459
2470
|
onClick: () => group.onRemove(item.id),
|
|
2460
2471
|
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",
|
|
2461
|
-
children: /* @__PURE__ */
|
|
2472
|
+
children: /* @__PURE__ */ jsx20(X3, { size: 12, "aria-hidden": "true" })
|
|
2462
2473
|
}
|
|
2463
2474
|
)
|
|
2464
2475
|
]
|
|
2465
2476
|
},
|
|
2466
2477
|
item.id
|
|
2467
2478
|
)),
|
|
2468
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsx20(
|
|
2469
2480
|
"button",
|
|
2470
2481
|
{
|
|
2471
2482
|
type: "button",
|
|
@@ -2476,13 +2487,13 @@ function SummaryGroupItem({
|
|
|
2476
2487
|
}
|
|
2477
2488
|
)
|
|
2478
2489
|
] }),
|
|
2479
|
-
group.subGroups?.map((sg) => /* @__PURE__ */
|
|
2490
|
+
group.subGroups?.map((sg) => /* @__PURE__ */ jsx20(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
|
|
2480
2491
|
] }) })
|
|
2481
2492
|
] });
|
|
2482
2493
|
}
|
|
2483
2494
|
|
|
2484
2495
|
// src/chart-placeholder-shared.tsx
|
|
2485
|
-
import { jsx as
|
|
2496
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2486
2497
|
var GRID_ROWS = [0, 25, 50, 75, 100];
|
|
2487
2498
|
var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
|
|
2488
2499
|
var Y_AXIS_W = 48;
|
|
@@ -2496,9 +2507,9 @@ function AxisFrame({
|
|
|
2496
2507
|
testIdPrefix
|
|
2497
2508
|
}) {
|
|
2498
2509
|
const gutter = xTicks > 0 ? X_AXIS_H : 0;
|
|
2499
|
-
return /* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
GRID_ROWS.map((pct) => /* @__PURE__ */
|
|
2510
|
+
return /* @__PURE__ */ jsx21("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ jsxs20("div", { className: "relative h-full w-full", children: [
|
|
2511
|
+
/* @__PURE__ */ jsxs20("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
|
|
2512
|
+
GRID_ROWS.map((pct) => /* @__PURE__ */ jsx21(
|
|
2502
2513
|
"div",
|
|
2503
2514
|
{
|
|
2504
2515
|
className: "absolute inset-x-0 border-t border-dashed",
|
|
@@ -2506,9 +2517,9 @@ function AxisFrame({
|
|
|
2506
2517
|
},
|
|
2507
2518
|
pct
|
|
2508
2519
|
)),
|
|
2509
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx21("div", { className: "absolute inset-0", children })
|
|
2510
2521
|
] }),
|
|
2511
|
-
/* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ jsx21("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ jsx21(
|
|
2512
2523
|
"div",
|
|
2513
2524
|
{
|
|
2514
2525
|
className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
|
|
@@ -2516,27 +2527,27 @@ function AxisFrame({
|
|
|
2516
2527
|
},
|
|
2517
2528
|
pct
|
|
2518
2529
|
)) }),
|
|
2519
|
-
xTicks > 0 && /* @__PURE__ */
|
|
2530
|
+
xTicks > 0 && /* @__PURE__ */ jsx21(
|
|
2520
2531
|
"div",
|
|
2521
2532
|
{
|
|
2522
2533
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2523
2534
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2524
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */
|
|
2535
|
+
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ jsx21("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx21("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
|
|
2525
2536
|
}
|
|
2526
2537
|
)
|
|
2527
2538
|
] }) });
|
|
2528
2539
|
}
|
|
2529
2540
|
function BlankLegend({ rows, reverse = false }) {
|
|
2530
|
-
return /* @__PURE__ */
|
|
2541
|
+
return /* @__PURE__ */ jsx21(
|
|
2531
2542
|
"ul",
|
|
2532
2543
|
{
|
|
2533
2544
|
className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
|
|
2534
2545
|
role: "presentation",
|
|
2535
2546
|
"aria-hidden": "true",
|
|
2536
|
-
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2547
|
+
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs20("li", { className: "flex items-center justify-between gap-2", children: [
|
|
2548
|
+
/* @__PURE__ */ jsxs20("span", { className: "flex items-center gap-1.5", children: [
|
|
2549
|
+
/* @__PURE__ */ jsx21("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
|
|
2550
|
+
/* @__PURE__ */ jsx21(
|
|
2540
2551
|
"span",
|
|
2541
2552
|
{
|
|
2542
2553
|
className: "h-2 rounded-xs bg-subtle",
|
|
@@ -2544,21 +2555,21 @@ function BlankLegend({ rows, reverse = false }) {
|
|
|
2544
2555
|
}
|
|
2545
2556
|
)
|
|
2546
2557
|
] }),
|
|
2547
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsx21("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
|
|
2548
2559
|
] }, i))
|
|
2549
2560
|
}
|
|
2550
2561
|
);
|
|
2551
2562
|
}
|
|
2552
2563
|
|
|
2553
2564
|
// src/BarChartPlaceholder.tsx
|
|
2554
|
-
import { jsx as
|
|
2565
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2555
2566
|
var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
|
|
2556
2567
|
function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
|
|
2557
|
-
return /* @__PURE__ */
|
|
2568
|
+
return /* @__PURE__ */ jsx22(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ jsx22("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ jsx22("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
|
|
2558
2569
|
}
|
|
2559
2570
|
|
|
2560
2571
|
// src/LineChartPlaceholder.tsx
|
|
2561
|
-
import { jsx as
|
|
2572
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2562
2573
|
var LINE_SERIES = [
|
|
2563
2574
|
[58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
|
|
2564
2575
|
[74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
|
|
@@ -2568,9 +2579,9 @@ var LINE_SERIES = [
|
|
|
2568
2579
|
var LINE_FORECAST_FROM = 7;
|
|
2569
2580
|
function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
2570
2581
|
const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
|
|
2571
|
-
return /* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2573
|
-
/* @__PURE__ */
|
|
2582
|
+
return /* @__PURE__ */ jsxs21(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
|
|
2583
|
+
/* @__PURE__ */ jsx23("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ jsxs21("g", { children: [
|
|
2584
|
+
/* @__PURE__ */ jsx23(
|
|
2574
2585
|
"polyline",
|
|
2575
2586
|
{
|
|
2576
2587
|
points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
|
|
@@ -2582,7 +2593,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2582
2593
|
strokeLinejoin: "round"
|
|
2583
2594
|
}
|
|
2584
2595
|
),
|
|
2585
|
-
/* @__PURE__ */
|
|
2596
|
+
/* @__PURE__ */ jsx23(
|
|
2586
2597
|
"polyline",
|
|
2587
2598
|
{
|
|
2588
2599
|
points: toPath(pts, LINE_FORECAST_FROM, pts.length),
|
|
@@ -2597,7 +2608,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2597
2608
|
)
|
|
2598
2609
|
] }, s)) }),
|
|
2599
2610
|
LINE_SERIES.map(
|
|
2600
|
-
(pts, s) => pts.map((y, i) => /* @__PURE__ */
|
|
2611
|
+
(pts, s) => pts.map((y, i) => /* @__PURE__ */ jsx23(
|
|
2601
2612
|
"div",
|
|
2602
2613
|
{
|
|
2603
2614
|
className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
@@ -2614,16 +2625,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2614
2625
|
}
|
|
2615
2626
|
|
|
2616
2627
|
// src/PieChartPlaceholder.tsx
|
|
2617
|
-
import { jsx as
|
|
2628
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2618
2629
|
var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
|
|
2619
2630
|
function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
|
|
2620
2631
|
const r = 45;
|
|
2621
|
-
return /* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */
|
|
2632
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2633
|
+
/* @__PURE__ */ jsx24("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ jsxs22("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
|
|
2634
|
+
/* @__PURE__ */ jsx24("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
|
|
2624
2635
|
PIE_SEAMS.map((deg) => {
|
|
2625
2636
|
const rad = (deg - 90) * Math.PI / 180;
|
|
2626
|
-
return /* @__PURE__ */
|
|
2637
|
+
return /* @__PURE__ */ jsx24(
|
|
2627
2638
|
"line",
|
|
2628
2639
|
{
|
|
2629
2640
|
x1: "50",
|
|
@@ -2637,12 +2648,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
|
|
|
2637
2648
|
);
|
|
2638
2649
|
})
|
|
2639
2650
|
] }) }),
|
|
2640
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ jsx24(BlankLegend, { rows: legendRows })
|
|
2641
2652
|
] });
|
|
2642
2653
|
}
|
|
2643
2654
|
|
|
2644
2655
|
// src/StackedColumnPlaceholder.tsx
|
|
2645
|
-
import { jsx as
|
|
2656
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2646
2657
|
var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
|
|
2647
2658
|
function columnBands(count) {
|
|
2648
2659
|
const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
|
|
@@ -2657,7 +2668,7 @@ function StackedColumnPlaceholder({
|
|
|
2657
2668
|
className,
|
|
2658
2669
|
testIdPrefix
|
|
2659
2670
|
}) {
|
|
2660
|
-
const column = /* @__PURE__ */
|
|
2671
|
+
const column = /* @__PURE__ */ jsx25("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ jsx25(
|
|
2661
2672
|
"div",
|
|
2662
2673
|
{
|
|
2663
2674
|
style: {
|
|
@@ -2669,16 +2680,16 @@ function StackedColumnPlaceholder({
|
|
|
2669
2680
|
},
|
|
2670
2681
|
i
|
|
2671
2682
|
)) });
|
|
2672
|
-
return /* @__PURE__ */
|
|
2673
|
-
axis ? /* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ jsxs23("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2684
|
+
axis ? /* @__PURE__ */ jsx25("div", { style: { width: "55%" }, children: /* @__PURE__ */ jsx25(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ jsx25("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ jsx25("div", { className: "flex items-stretch py-1", children: column }),
|
|
2685
|
+
/* @__PURE__ */ jsx25(BlankLegend, { rows: legendRows, reverse: !axis })
|
|
2675
2686
|
] });
|
|
2676
2687
|
}
|
|
2677
2688
|
|
|
2678
2689
|
// src/Tooltip.tsx
|
|
2679
2690
|
import { useEffect as useEffect8, useId as useId4, useLayoutEffect as useLayoutEffect4, useRef as useRef9, useState as useState8 } from "react";
|
|
2680
2691
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2681
|
-
import { jsx as
|
|
2692
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2682
2693
|
function addDescribedBy(el, id) {
|
|
2683
2694
|
const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
|
|
2684
2695
|
if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
|
|
@@ -2864,7 +2875,7 @@ function Tooltip({
|
|
|
2864
2875
|
}
|
|
2865
2876
|
}
|
|
2866
2877
|
const floating = anchor != null && typeof document !== "undefined" ? createPortal3(
|
|
2867
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsx26(
|
|
2868
2879
|
"span",
|
|
2869
2880
|
{
|
|
2870
2881
|
ref: boxRef,
|
|
@@ -2895,7 +2906,7 @@ function Tooltip({
|
|
|
2895
2906
|
document.body
|
|
2896
2907
|
) : null;
|
|
2897
2908
|
if (anchorRef) return floating;
|
|
2898
|
-
return /* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ jsxs24(
|
|
2899
2910
|
"span",
|
|
2900
2911
|
{
|
|
2901
2912
|
ref,
|
|
@@ -2917,28 +2928,28 @@ function Tooltip({
|
|
|
2917
2928
|
}
|
|
2918
2929
|
|
|
2919
2930
|
// src/AdvertiserNoResults.tsx
|
|
2920
|
-
import { jsx as
|
|
2931
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2921
2932
|
function AdvertiserNoResults({
|
|
2922
2933
|
query,
|
|
2923
2934
|
hint = "Try checking your spelling or searching for a broader brand name.",
|
|
2924
2935
|
className,
|
|
2925
2936
|
testIdPrefix
|
|
2926
2937
|
}) {
|
|
2927
|
-
return /* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
2938
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2939
|
+
/* @__PURE__ */ jsxs25("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
2929
2940
|
"No results found for \u201C",
|
|
2930
2941
|
query,
|
|
2931
2942
|
"\u201D"
|
|
2932
2943
|
] }),
|
|
2933
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ jsx27("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
2934
2945
|
] });
|
|
2935
2946
|
}
|
|
2936
2947
|
|
|
2937
2948
|
// src/SelectAllVisible.tsx
|
|
2938
2949
|
import { ListChecks as ListChecks2 } from "lucide-react";
|
|
2939
|
-
import { jsx as
|
|
2950
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2940
2951
|
function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
|
|
2941
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ jsxs26(
|
|
2942
2953
|
"button",
|
|
2943
2954
|
{
|
|
2944
2955
|
type: "button",
|
|
@@ -2949,7 +2960,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2949
2960
|
className
|
|
2950
2961
|
),
|
|
2951
2962
|
children: [
|
|
2952
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx28(ListChecks2, { size: 14, "aria-hidden": "true" }),
|
|
2953
2964
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
2954
2965
|
]
|
|
2955
2966
|
}
|
|
@@ -2958,11 +2969,11 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2958
2969
|
|
|
2959
2970
|
// src/SelectedSection.tsx
|
|
2960
2971
|
import { ChevronDown as ChevronDown7 } from "lucide-react";
|
|
2961
|
-
import { jsx as
|
|
2972
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2962
2973
|
function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
|
|
2963
2974
|
if (count === 0) return null;
|
|
2964
|
-
return /* @__PURE__ */
|
|
2965
|
-
/* @__PURE__ */
|
|
2975
|
+
return /* @__PURE__ */ jsxs27("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
2976
|
+
/* @__PURE__ */ jsxs27(
|
|
2966
2977
|
"button",
|
|
2967
2978
|
{
|
|
2968
2979
|
type: "button",
|
|
@@ -2971,25 +2982,25 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
|
|
|
2971
2982
|
"aria-expanded": open,
|
|
2972
2983
|
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",
|
|
2973
2984
|
children: [
|
|
2974
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx29(ChevronDown7, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
|
|
2975
2986
|
"Selected (",
|
|
2976
2987
|
count,
|
|
2977
2988
|
")"
|
|
2978
2989
|
]
|
|
2979
2990
|
}
|
|
2980
2991
|
),
|
|
2981
|
-
open && /* @__PURE__ */
|
|
2992
|
+
open && /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-0.5", children })
|
|
2982
2993
|
] });
|
|
2983
2994
|
}
|
|
2984
2995
|
|
|
2985
2996
|
// src/SelectionPicker.tsx
|
|
2986
2997
|
import { useCallback as useCallback3, useEffect as useEffect9, useLayoutEffect as useLayoutEffect5, useMemo as useMemo3, useRef as useRef11, useState as useState9 } from "react";
|
|
2987
2998
|
import { createPortal as createPortal4 } from "react-dom";
|
|
2988
|
-
import { Search as Search4, Plus as Plus2, Info as Info2, ChevronRight as ChevronRight3, ChevronDown as ChevronDown8, Check as
|
|
2999
|
+
import { Search as Search4, Plus as Plus2, Info as Info2, ChevronRight as ChevronRight3, ChevronDown as ChevronDown8, Check as Check7, List, Loader2 } from "lucide-react";
|
|
2989
3000
|
|
|
2990
3001
|
// src/Tabs.tsx
|
|
2991
3002
|
import { useRef as useRef10 } from "react";
|
|
2992
|
-
import { jsx as
|
|
3003
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2993
3004
|
function arrowKeys(e, row) {
|
|
2994
3005
|
if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
|
|
2995
3006
|
const items = Array.from(row.querySelectorAll("button:not([disabled])"));
|
|
@@ -3001,7 +3012,7 @@ function arrowKeys(e, row) {
|
|
|
3001
3012
|
}
|
|
3002
3013
|
function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
|
|
3003
3014
|
const row = useRef10(null);
|
|
3004
|
-
return /* @__PURE__ */
|
|
3015
|
+
return /* @__PURE__ */ jsx30(
|
|
3005
3016
|
"div",
|
|
3006
3017
|
{
|
|
3007
3018
|
ref: row,
|
|
@@ -3012,7 +3023,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3012
3023
|
className: cn("flex gap-6 border-b border-border-default", className),
|
|
3013
3024
|
children: items.map((item) => {
|
|
3014
3025
|
const on = item.value === value;
|
|
3015
|
-
return /* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ jsxs28(
|
|
3016
3027
|
"button",
|
|
3017
3028
|
{
|
|
3018
3029
|
type: "button",
|
|
@@ -3030,7 +3041,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3030
3041
|
),
|
|
3031
3042
|
children: [
|
|
3032
3043
|
item.label,
|
|
3033
|
-
item.count !== void 0 && /* @__PURE__ */
|
|
3044
|
+
item.count !== void 0 && /* @__PURE__ */ jsx30("span", { className: "text-xs text-text-tertiary", children: item.count })
|
|
3034
3045
|
]
|
|
3035
3046
|
},
|
|
3036
3047
|
item.value
|
|
@@ -3049,7 +3060,7 @@ function SegmentedControl({
|
|
|
3049
3060
|
...rest
|
|
3050
3061
|
}) {
|
|
3051
3062
|
const row = useRef10(null);
|
|
3052
|
-
return /* @__PURE__ */
|
|
3063
|
+
return /* @__PURE__ */ jsx30(
|
|
3053
3064
|
"div",
|
|
3054
3065
|
{
|
|
3055
3066
|
ref: row,
|
|
@@ -3060,7 +3071,7 @@ function SegmentedControl({
|
|
|
3060
3071
|
className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
|
|
3061
3072
|
children: options.map((o) => {
|
|
3062
3073
|
const on = o.value === value;
|
|
3063
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ jsx30(
|
|
3064
3075
|
"button",
|
|
3065
3076
|
{
|
|
3066
3077
|
type: "button",
|
|
@@ -3084,7 +3095,7 @@ function SegmentedControl({
|
|
|
3084
3095
|
}
|
|
3085
3096
|
|
|
3086
3097
|
// src/SelectionPicker.tsx
|
|
3087
|
-
import { Fragment as Fragment3, jsx as
|
|
3098
|
+
import { Fragment as Fragment3, jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3088
3099
|
function slug5(value) {
|
|
3089
3100
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
3090
3101
|
}
|
|
@@ -3177,12 +3188,12 @@ function SelectionPicker({
|
|
|
3177
3188
|
}
|
|
3178
3189
|
};
|
|
3179
3190
|
const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
|
|
3180
|
-
return /* @__PURE__ */
|
|
3181
|
-
helper && /* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3183
|
-
/* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
3192
|
+
helper && /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
3193
|
+
/* @__PURE__ */ jsx31("p", { className: "text-dense text-text-secondary", children: helper }),
|
|
3194
|
+
/* @__PURE__ */ jsx31("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
|
|
3184
3195
|
] }),
|
|
3185
|
-
hasAccountLists && /* @__PURE__ */
|
|
3196
|
+
hasAccountLists && /* @__PURE__ */ jsx31(
|
|
3186
3197
|
SegmentedControl,
|
|
3187
3198
|
{
|
|
3188
3199
|
"aria-label": "Add from",
|
|
@@ -3195,11 +3206,11 @@ function SelectionPicker({
|
|
|
3195
3206
|
]
|
|
3196
3207
|
}
|
|
3197
3208
|
),
|
|
3198
|
-
source === "search" && /* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3209
|
+
source === "search" && /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3210
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3211
|
+
/* @__PURE__ */ jsxs29("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: [
|
|
3212
|
+
/* @__PURE__ */ jsx31(Search4, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3213
|
+
/* @__PURE__ */ jsx31(
|
|
3203
3214
|
"input",
|
|
3204
3215
|
{
|
|
3205
3216
|
value: query,
|
|
@@ -3215,7 +3226,7 @@ function SelectionPicker({
|
|
|
3215
3226
|
}
|
|
3216
3227
|
)
|
|
3217
3228
|
] }),
|
|
3218
|
-
filters.map((f) => /* @__PURE__ */
|
|
3229
|
+
filters.map((f) => /* @__PURE__ */ jsx31(
|
|
3219
3230
|
FilterDropdown,
|
|
3220
3231
|
{
|
|
3221
3232
|
filter: f,
|
|
@@ -3227,14 +3238,14 @@ function SelectionPicker({
|
|
|
3227
3238
|
)),
|
|
3228
3239
|
toolbarExtra
|
|
3229
3240
|
] }),
|
|
3230
|
-
!hasSearched ? /* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3241
|
+
!hasSearched ? /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3242
|
+
/* @__PURE__ */ jsx31("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ jsx31(Search4, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3243
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-1", children: [
|
|
3244
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
|
|
3245
|
+
/* @__PURE__ */ jsx31("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
|
|
3235
3246
|
] })
|
|
3236
|
-
] }) : /* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3247
|
+
] }) : /* @__PURE__ */ jsxs29("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
|
|
3248
|
+
/* @__PURE__ */ jsxs29(
|
|
3238
3249
|
"div",
|
|
3239
3250
|
{
|
|
3240
3251
|
className: cn(
|
|
@@ -3242,7 +3253,7 @@ function SelectionPicker({
|
|
|
3242
3253
|
rowGridCols
|
|
3243
3254
|
),
|
|
3244
3255
|
children: [
|
|
3245
|
-
/* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsx31(
|
|
3246
3257
|
CheckBox,
|
|
3247
3258
|
{
|
|
3248
3259
|
checked: allSelected,
|
|
@@ -3253,18 +3264,18 @@ function SelectionPicker({
|
|
|
3253
3264
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
|
|
3254
3265
|
}
|
|
3255
3266
|
),
|
|
3256
|
-
/* @__PURE__ */
|
|
3257
|
-
showInfoColumn && /* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx31("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ jsx31("span", { className: c.className, children: c.header }, c.key)) }),
|
|
3268
|
+
showInfoColumn && /* @__PURE__ */ jsx31("span", { className: "text-right", children: "Info" })
|
|
3258
3269
|
]
|
|
3259
3270
|
}
|
|
3260
3271
|
),
|
|
3261
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx31("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ jsx31(Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ jsx31("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ jsx31("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) => {
|
|
3262
3273
|
const isSel = selectedIds.has(row.id);
|
|
3263
3274
|
const isLocked = lockedIds?.has(row.id) ?? false;
|
|
3264
3275
|
const kids = getChildren?.(row);
|
|
3265
3276
|
const isOpen = expanded.has(row.id);
|
|
3266
|
-
return /* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ jsxs29("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
|
|
3278
|
+
/* @__PURE__ */ jsxs29(
|
|
3268
3279
|
"div",
|
|
3269
3280
|
{
|
|
3270
3281
|
onClick: isLocked ? void 0 : () => toggleRow(row),
|
|
@@ -3277,7 +3288,7 @@ function SelectionPicker({
|
|
|
3277
3288
|
!isLocked && isSel && "opacity-70"
|
|
3278
3289
|
),
|
|
3279
3290
|
children: [
|
|
3280
|
-
isLocked ? /* @__PURE__ */
|
|
3291
|
+
isLocked ? /* @__PURE__ */ jsx31("span", { "aria-hidden": "true" }) : /* @__PURE__ */ jsx31(
|
|
3281
3292
|
CheckBox,
|
|
3282
3293
|
{
|
|
3283
3294
|
checked: isSel,
|
|
@@ -3286,8 +3297,8 @@ function SelectionPicker({
|
|
|
3286
3297
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
|
|
3287
3298
|
}
|
|
3288
3299
|
),
|
|
3289
|
-
/* @__PURE__ */
|
|
3290
|
-
showInfoColumn && /* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ jsx31("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ jsx31("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
|
|
3301
|
+
showInfoColumn && /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ jsx31(
|
|
3291
3302
|
"button",
|
|
3292
3303
|
{
|
|
3293
3304
|
type: "button",
|
|
@@ -3301,28 +3312,28 @@ function SelectionPicker({
|
|
|
3301
3312
|
});
|
|
3302
3313
|
},
|
|
3303
3314
|
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",
|
|
3304
|
-
children: /* @__PURE__ */
|
|
3315
|
+
children: /* @__PURE__ */ jsx31(ChevronRight3, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3305
3316
|
}
|
|
3306
|
-
) : /* @__PURE__ */
|
|
3317
|
+
) : /* @__PURE__ */ jsx31(
|
|
3307
3318
|
"span",
|
|
3308
3319
|
{
|
|
3309
3320
|
className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
|
|
3310
3321
|
title: "No additional details",
|
|
3311
|
-
children: /* @__PURE__ */
|
|
3322
|
+
children: /* @__PURE__ */ jsx31(Info2, { size: 14 })
|
|
3312
3323
|
}
|
|
3313
3324
|
) })
|
|
3314
3325
|
]
|
|
3315
3326
|
}
|
|
3316
3327
|
),
|
|
3317
|
-
isOpen && kids && /* @__PURE__ */
|
|
3328
|
+
isOpen && kids && /* @__PURE__ */ jsx31("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
|
|
3318
3329
|
const kidSel = selectedIds.has(kid.id);
|
|
3319
|
-
return /* @__PURE__ */
|
|
3330
|
+
return /* @__PURE__ */ jsxs29(
|
|
3320
3331
|
"div",
|
|
3321
3332
|
{
|
|
3322
3333
|
className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
|
|
3323
3334
|
children: [
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3335
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
|
|
3336
|
+
/* @__PURE__ */ jsxs29(
|
|
3326
3337
|
"button",
|
|
3327
3338
|
{
|
|
3328
3339
|
type: "button",
|
|
@@ -3333,7 +3344,7 @@ function SelectionPicker({
|
|
|
3333
3344
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3334
3345
|
),
|
|
3335
3346
|
children: [
|
|
3336
|
-
kidSel ? /* @__PURE__ */
|
|
3347
|
+
kidSel ? /* @__PURE__ */ jsx31(Check7, { size: 13 }) : /* @__PURE__ */ jsx31(Plus2, { size: 13 }),
|
|
3337
3348
|
kidSel ? "Added" : "Add"
|
|
3338
3349
|
]
|
|
3339
3350
|
}
|
|
@@ -3345,7 +3356,7 @@ function SelectionPicker({
|
|
|
3345
3356
|
}) })
|
|
3346
3357
|
] }, row.id);
|
|
3347
3358
|
}) }),
|
|
3348
|
-
!loading && !error && hasMore && /* @__PURE__ */
|
|
3359
|
+
!loading && !error && hasMore && /* @__PURE__ */ jsxs29(
|
|
3349
3360
|
"button",
|
|
3350
3361
|
{
|
|
3351
3362
|
type: "button",
|
|
@@ -3354,19 +3365,19 @@ function SelectionPicker({
|
|
|
3354
3365
|
"data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
|
|
3355
3366
|
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",
|
|
3356
3367
|
children: [
|
|
3357
|
-
loadingMore ? /* @__PURE__ */
|
|
3368
|
+
loadingMore ? /* @__PURE__ */ jsx31(Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
|
|
3358
3369
|
loadingMore ? "Loading\u2026" : "Load more"
|
|
3359
3370
|
]
|
|
3360
3371
|
}
|
|
3361
3372
|
)
|
|
3362
3373
|
] })
|
|
3363
3374
|
] }),
|
|
3364
|
-
source === "lists" && /* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
accountLists && accountLists.length > 0 ? /* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3375
|
+
source === "lists" && /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3376
|
+
/* @__PURE__ */ jsx31("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." }),
|
|
3377
|
+
accountLists && accountLists.length > 0 ? /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
3378
|
+
/* @__PURE__ */ jsx31(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
|
|
3368
3379
|
const on = (selectedListIds ?? []).includes(list.id);
|
|
3369
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ jsxs29(
|
|
3370
3381
|
"button",
|
|
3371
3382
|
{
|
|
3372
3383
|
type: "button",
|
|
@@ -3378,19 +3389,19 @@ function SelectionPicker({
|
|
|
3378
3389
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3379
3390
|
),
|
|
3380
3391
|
children: [
|
|
3381
|
-
/* @__PURE__ */
|
|
3392
|
+
/* @__PURE__ */ jsx31(
|
|
3382
3393
|
"span",
|
|
3383
3394
|
{
|
|
3384
3395
|
className: cn(
|
|
3385
3396
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
3386
3397
|
on ? "text-brand-primaryAction" : "text-text-secondary"
|
|
3387
3398
|
),
|
|
3388
|
-
children: on ? /* @__PURE__ */
|
|
3399
|
+
children: on ? /* @__PURE__ */ jsx31(Check7, { size: 16 }) : /* @__PURE__ */ jsx31(Plus2, { size: 16 })
|
|
3389
3400
|
}
|
|
3390
3401
|
),
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3402
|
+
/* @__PURE__ */ jsxs29("span", { className: "min-w-0 flex-1", children: [
|
|
3403
|
+
/* @__PURE__ */ jsx31("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsx31("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
|
|
3404
|
+
/* @__PURE__ */ jsxs29("span", { className: "block truncate text-xs text-text-secondary", children: [
|
|
3394
3405
|
list.count,
|
|
3395
3406
|
" accounts \xB7 ",
|
|
3396
3407
|
list.entityTypes.join(", "),
|
|
@@ -3398,13 +3409,13 @@ function SelectionPicker({
|
|
|
3398
3409
|
formatListDate(list.updatedAt)
|
|
3399
3410
|
] })
|
|
3400
3411
|
] }),
|
|
3401
|
-
/* @__PURE__ */
|
|
3412
|
+
/* @__PURE__ */ jsx31("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
|
|
3402
3413
|
]
|
|
3403
3414
|
},
|
|
3404
3415
|
list.id
|
|
3405
3416
|
);
|
|
3406
3417
|
}) }),
|
|
3407
|
-
/* @__PURE__ */
|
|
3418
|
+
/* @__PURE__ */ jsxs29(
|
|
3408
3419
|
"p",
|
|
3409
3420
|
{
|
|
3410
3421
|
className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
|
|
@@ -3416,11 +3427,11 @@ function SelectionPicker({
|
|
|
3416
3427
|
]
|
|
3417
3428
|
}
|
|
3418
3429
|
)
|
|
3419
|
-
] }) : /* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__PURE__ */
|
|
3430
|
+
] }) : /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3431
|
+
/* @__PURE__ */ jsx31("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ jsx31(List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3432
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-1", children: [
|
|
3433
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
|
|
3434
|
+
/* @__PURE__ */ jsx31("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
|
|
3424
3435
|
] })
|
|
3425
3436
|
] })
|
|
3426
3437
|
] })
|
|
@@ -3452,7 +3463,7 @@ function ScrollFade({ className, children }) {
|
|
|
3452
3463
|
[sync]
|
|
3453
3464
|
);
|
|
3454
3465
|
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;
|
|
3455
|
-
return /* @__PURE__ */
|
|
3466
|
+
return /* @__PURE__ */ jsx31("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
|
|
3456
3467
|
}
|
|
3457
3468
|
function formatListDate(iso) {
|
|
3458
3469
|
try {
|
|
@@ -3502,8 +3513,8 @@ function FilterDropdown({
|
|
|
3502
3513
|
const count = active.size;
|
|
3503
3514
|
const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
|
|
3504
3515
|
const filterSlug = slug5(filter.label);
|
|
3505
|
-
return /* @__PURE__ */
|
|
3506
|
-
/* @__PURE__ */
|
|
3516
|
+
return /* @__PURE__ */ jsxs29("div", { className: "relative", children: [
|
|
3517
|
+
/* @__PURE__ */ jsxs29(
|
|
3507
3518
|
"button",
|
|
3508
3519
|
{
|
|
3509
3520
|
ref: btnRef,
|
|
@@ -3514,12 +3525,12 @@ function FilterDropdown({
|
|
|
3514
3525
|
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",
|
|
3515
3526
|
children: [
|
|
3516
3527
|
label,
|
|
3517
|
-
/* @__PURE__ */
|
|
3528
|
+
/* @__PURE__ */ jsx31(ChevronDown8, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
3518
3529
|
]
|
|
3519
3530
|
}
|
|
3520
3531
|
),
|
|
3521
3532
|
open && pos && createPortal4(
|
|
3522
|
-
/* @__PURE__ */
|
|
3533
|
+
/* @__PURE__ */ jsxs29(
|
|
3523
3534
|
"div",
|
|
3524
3535
|
{
|
|
3525
3536
|
ref: menuRef,
|
|
@@ -3528,9 +3539,9 @@ function FilterDropdown({
|
|
|
3528
3539
|
style: { top: pos.top, left: pos.left },
|
|
3529
3540
|
className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
3530
3541
|
children: [
|
|
3531
|
-
searchable && /* @__PURE__ */
|
|
3532
|
-
/* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
3542
|
+
searchable && /* @__PURE__ */ jsxs29("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
|
|
3543
|
+
/* @__PURE__ */ jsx31(Search4, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
3544
|
+
/* @__PURE__ */ jsx31(
|
|
3534
3545
|
"input",
|
|
3535
3546
|
{
|
|
3536
3547
|
autoFocus: true,
|
|
@@ -3541,14 +3552,14 @@ function FilterDropdown({
|
|
|
3541
3552
|
}
|
|
3542
3553
|
)
|
|
3543
3554
|
] }),
|
|
3544
|
-
/* @__PURE__ */
|
|
3555
|
+
/* @__PURE__ */ jsx31("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ jsx31("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
|
|
3545
3556
|
const on = active.has(opt);
|
|
3546
|
-
return /* @__PURE__ */
|
|
3557
|
+
return /* @__PURE__ */ jsxs29(
|
|
3547
3558
|
"label",
|
|
3548
3559
|
{
|
|
3549
3560
|
className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
|
|
3550
3561
|
children: [
|
|
3551
|
-
/* @__PURE__ */
|
|
3562
|
+
/* @__PURE__ */ jsx31(
|
|
3552
3563
|
CheckBox,
|
|
3553
3564
|
{
|
|
3554
3565
|
checked: on,
|
|
@@ -3579,7 +3590,7 @@ function gridForColumns(columns) {
|
|
|
3579
3590
|
|
|
3580
3591
|
// src/PublisherBreakdownList.tsx
|
|
3581
3592
|
import { useState as useState10 } from "react";
|
|
3582
|
-
import { jsx as
|
|
3593
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3583
3594
|
var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
|
|
3584
3595
|
function priorYearAmt(spendN, yoy) {
|
|
3585
3596
|
if (yoy === "NEW" || yoy <= -100) return null;
|
|
@@ -3591,7 +3602,7 @@ function initials(name) {
|
|
|
3591
3602
|
return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
|
|
3592
3603
|
}
|
|
3593
3604
|
function Monogram({ name, size = 28 }) {
|
|
3594
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ jsx32(
|
|
3595
3606
|
"span",
|
|
3596
3607
|
{
|
|
3597
3608
|
"aria-hidden": "true",
|
|
@@ -3602,12 +3613,12 @@ function Monogram({ name, size = 28 }) {
|
|
|
3602
3613
|
);
|
|
3603
3614
|
}
|
|
3604
3615
|
function BreakdownTag({ children }) {
|
|
3605
|
-
return /* @__PURE__ */
|
|
3616
|
+
return /* @__PURE__ */ jsx32("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 });
|
|
3606
3617
|
}
|
|
3607
3618
|
function DelayedTip({ label, children }) {
|
|
3608
|
-
return /* @__PURE__ */
|
|
3619
|
+
return /* @__PURE__ */ jsxs30("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
3609
3620
|
children,
|
|
3610
|
-
/* @__PURE__ */
|
|
3621
|
+
/* @__PURE__ */ jsx32(
|
|
3611
3622
|
"span",
|
|
3612
3623
|
{
|
|
3613
3624
|
role: "tooltip",
|
|
@@ -3621,22 +3632,22 @@ var COL_CURRENT = 76;
|
|
|
3621
3632
|
var COL_PREVIOUS = 76;
|
|
3622
3633
|
var COL_YOY = 44;
|
|
3623
3634
|
function MetricListHeader({ className }) {
|
|
3624
|
-
return /* @__PURE__ */
|
|
3625
|
-
/* @__PURE__ */
|
|
3626
|
-
/* @__PURE__ */
|
|
3627
|
-
/* @__PURE__ */
|
|
3628
|
-
/* @__PURE__ */
|
|
3629
|
-
/* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
|
|
3636
|
+
/* @__PURE__ */ jsx32("span", { className: "flex-1" }),
|
|
3637
|
+
/* @__PURE__ */ jsxs30("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3638
|
+
/* @__PURE__ */ jsx32("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3639
|
+
/* @__PURE__ */ jsx32(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ jsx32("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
|
|
3640
|
+
/* @__PURE__ */ jsx32(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ jsx32("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
|
|
3630
3641
|
] })
|
|
3631
3642
|
] });
|
|
3632
3643
|
}
|
|
3633
3644
|
function MetricCells({ spendN, yoy }) {
|
|
3634
3645
|
const prior = priorYearAmt(spendN, yoy);
|
|
3635
3646
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3636
|
-
return /* @__PURE__ */
|
|
3637
|
-
/* @__PURE__ */
|
|
3638
|
-
/* @__PURE__ */
|
|
3639
|
-
/* @__PURE__ */
|
|
3647
|
+
return /* @__PURE__ */ jsxs30("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3648
|
+
/* @__PURE__ */ jsx32("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
3649
|
+
/* @__PURE__ */ jsx32("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
3650
|
+
/* @__PURE__ */ jsx32("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ jsx32("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ jsxs30("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
|
|
3640
3651
|
up ? "+" : "\u2212",
|
|
3641
3652
|
Math.abs(yoy),
|
|
3642
3653
|
"%"
|
|
@@ -3655,35 +3666,35 @@ function PublisherBreakdownList({
|
|
|
3655
3666
|
const [showAll, setShowAll] = useState10(false);
|
|
3656
3667
|
const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
|
|
3657
3668
|
const rowPad = padded ? "px-5" : "";
|
|
3658
|
-
return /* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
visible.map((p) => /* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3663
|
-
renderLogo ? renderLogo(p) : /* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3665
|
-
/* @__PURE__ */
|
|
3666
|
-
/* @__PURE__ */
|
|
3667
|
-
p.tags.map((t) => /* @__PURE__ */
|
|
3669
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3670
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-col", children: [
|
|
3671
|
+
/* @__PURE__ */ jsx32(MetricListHeader, { className: rowPad }),
|
|
3672
|
+
visible.map((p) => /* @__PURE__ */ jsxs30("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: [
|
|
3673
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
3674
|
+
renderLogo ? renderLogo(p) : /* @__PURE__ */ jsx32(Monogram, { name: p.brand, size: 28 }),
|
|
3675
|
+
/* @__PURE__ */ jsxs30("div", { className: "min-w-0", children: [
|
|
3676
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3677
|
+
/* @__PURE__ */ jsx32("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
3678
|
+
p.tags.map((t) => /* @__PURE__ */ jsx32(BreakdownTag, { children: t }, t))
|
|
3668
3679
|
] }),
|
|
3669
|
-
/* @__PURE__ */
|
|
3680
|
+
/* @__PURE__ */ jsx32("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
|
|
3670
3681
|
] })
|
|
3671
3682
|
] }),
|
|
3672
|
-
/* @__PURE__ */
|
|
3683
|
+
/* @__PURE__ */ jsx32(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3673
3684
|
] }, p.brand))
|
|
3674
3685
|
] }),
|
|
3675
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */
|
|
3676
|
-
/* @__PURE__ */
|
|
3686
|
+
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ jsx32("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ jsx32("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__ */ jsxs30("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
|
|
3687
|
+
/* @__PURE__ */ jsxs30("span", { children: [
|
|
3677
3688
|
"Showing ",
|
|
3678
3689
|
visible.length,
|
|
3679
3690
|
" of ",
|
|
3680
3691
|
rows.length
|
|
3681
3692
|
] }),
|
|
3682
|
-
!showAll ? /* @__PURE__ */
|
|
3693
|
+
!showAll ? /* @__PURE__ */ jsxs30("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: [
|
|
3683
3694
|
"See all (",
|
|
3684
3695
|
rows.length - defaultVisibleCount,
|
|
3685
3696
|
" more)"
|
|
3686
|
-
] }) : /* @__PURE__ */
|
|
3697
|
+
] }) : /* @__PURE__ */ jsx32("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" })
|
|
3687
3698
|
] }))
|
|
3688
3699
|
] });
|
|
3689
3700
|
}
|
|
@@ -3693,7 +3704,7 @@ import { forwardRef as forwardRef6 } from "react";
|
|
|
3693
3704
|
import { Slot } from "@radix-ui/react-slot";
|
|
3694
3705
|
import { cva } from "class-variance-authority";
|
|
3695
3706
|
import { Loader2 as Loader22 } from "lucide-react";
|
|
3696
|
-
import { jsx as
|
|
3707
|
+
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3697
3708
|
var buttonVariants = cva(
|
|
3698
3709
|
"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",
|
|
3699
3710
|
{
|
|
@@ -3764,10 +3775,10 @@ var Button = forwardRef6(
|
|
|
3764
3775
|
...props
|
|
3765
3776
|
};
|
|
3766
3777
|
if (asChild) {
|
|
3767
|
-
return /* @__PURE__ */
|
|
3778
|
+
return /* @__PURE__ */ jsx33(Slot, { ref, ...shared, children });
|
|
3768
3779
|
}
|
|
3769
|
-
return /* @__PURE__ */
|
|
3770
|
-
loading && /* @__PURE__ */
|
|
3780
|
+
return /* @__PURE__ */ jsxs31("button", { ref, ...shared, children: [
|
|
3781
|
+
loading && /* @__PURE__ */ jsx33(Loader22, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
3771
3782
|
children
|
|
3772
3783
|
] });
|
|
3773
3784
|
}
|
|
@@ -3775,7 +3786,7 @@ var Button = forwardRef6(
|
|
|
3775
3786
|
Button.displayName = "Button";
|
|
3776
3787
|
|
|
3777
3788
|
// src/FilterDropdownFooter.tsx
|
|
3778
|
-
import { jsx as
|
|
3789
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3779
3790
|
function FilterDropdownFooter({
|
|
3780
3791
|
onClear,
|
|
3781
3792
|
onApply,
|
|
@@ -3784,7 +3795,7 @@ function FilterDropdownFooter({
|
|
|
3784
3795
|
className,
|
|
3785
3796
|
testIdPrefix
|
|
3786
3797
|
}) {
|
|
3787
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ jsxs32(
|
|
3788
3799
|
"div",
|
|
3789
3800
|
{
|
|
3790
3801
|
className: cn(
|
|
@@ -3794,8 +3805,8 @@ function FilterDropdownFooter({
|
|
|
3794
3805
|
),
|
|
3795
3806
|
"data-testid": testIdPrefix,
|
|
3796
3807
|
children: [
|
|
3797
|
-
onClear && /* @__PURE__ */
|
|
3798
|
-
/* @__PURE__ */
|
|
3808
|
+
onClear && /* @__PURE__ */ jsx34(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
|
|
3809
|
+
/* @__PURE__ */ jsx34(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
|
|
3799
3810
|
]
|
|
3800
3811
|
}
|
|
3801
3812
|
);
|
|
@@ -3804,7 +3815,7 @@ function FilterDropdownFooter({
|
|
|
3804
3815
|
// src/NameListModal.tsx
|
|
3805
3816
|
import { useEffect as useEffect10, useId as useId5, useRef as useRef12, useState as useState11 } from "react";
|
|
3806
3817
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3807
|
-
import { jsx as
|
|
3818
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3808
3819
|
function NameListModal({
|
|
3809
3820
|
title,
|
|
3810
3821
|
initialName,
|
|
@@ -3858,12 +3869,12 @@ function NameListModal({
|
|
|
3858
3869
|
// bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
|
|
3859
3870
|
// No in-data-[theme=dark] override needed any more -- the token redefines
|
|
3860
3871
|
// itself under that attribute in dark.css, so one class covers both themes.
|
|
3861
|
-
/* @__PURE__ */
|
|
3872
|
+
/* @__PURE__ */ jsx35(
|
|
3862
3873
|
"div",
|
|
3863
3874
|
{
|
|
3864
3875
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
|
|
3865
3876
|
onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
|
|
3866
|
-
children: /* @__PURE__ */
|
|
3877
|
+
children: /* @__PURE__ */ jsxs33(
|
|
3867
3878
|
"div",
|
|
3868
3879
|
{
|
|
3869
3880
|
ref: dialogRef,
|
|
@@ -3874,10 +3885,10 @@ function NameListModal({
|
|
|
3874
3885
|
"data-testid": testIdPrefix,
|
|
3875
3886
|
className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
|
|
3876
3887
|
children: [
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
/* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */
|
|
3880
|
-
/* @__PURE__ */
|
|
3888
|
+
/* @__PURE__ */ jsx35("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
3889
|
+
/* @__PURE__ */ jsxs33("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
3890
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
3891
|
+
/* @__PURE__ */ jsx35(
|
|
3881
3892
|
"input",
|
|
3882
3893
|
{
|
|
3883
3894
|
id: fieldId,
|
|
@@ -3889,13 +3900,13 @@ function NameListModal({
|
|
|
3889
3900
|
}
|
|
3890
3901
|
)
|
|
3891
3902
|
] }),
|
|
3892
|
-
options && options.length > 0 && /* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
3903
|
+
options && options.length > 0 && /* @__PURE__ */ jsx35("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ jsxs33("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
|
|
3904
|
+
/* @__PURE__ */ jsx35(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
3894
3905
|
o.label
|
|
3895
3906
|
] }, o.key)) }),
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
/* @__PURE__ */
|
|
3907
|
+
/* @__PURE__ */ jsxs33("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
|
|
3908
|
+
/* @__PURE__ */ jsx35(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
3909
|
+
/* @__PURE__ */ jsx35(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
|
|
3899
3910
|
] })
|
|
3900
3911
|
]
|
|
3901
3912
|
}
|
|
@@ -3908,11 +3919,11 @@ function NameListModal({
|
|
|
3908
3919
|
|
|
3909
3920
|
// src/FilterChipBar.tsx
|
|
3910
3921
|
import { CircleSlash, X as X4 } from "lucide-react";
|
|
3911
|
-
import { jsx as
|
|
3922
|
+
import { jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3912
3923
|
function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
|
|
3913
3924
|
if (chips.length === 0) return null;
|
|
3914
|
-
return /* @__PURE__ */
|
|
3915
|
-
chips.map((c) => /* @__PURE__ */
|
|
3925
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
|
|
3926
|
+
chips.map((c) => /* @__PURE__ */ jsx36(
|
|
3916
3927
|
Chip,
|
|
3917
3928
|
{
|
|
3918
3929
|
label: c.label,
|
|
@@ -3922,7 +3933,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
3922
3933
|
},
|
|
3923
3934
|
c.key
|
|
3924
3935
|
)),
|
|
3925
|
-
/* @__PURE__ */
|
|
3936
|
+
/* @__PURE__ */ jsx36(
|
|
3926
3937
|
"button",
|
|
3927
3938
|
{
|
|
3928
3939
|
type: "button",
|
|
@@ -3939,8 +3950,8 @@ function Chip({
|
|
|
3939
3950
|
parked,
|
|
3940
3951
|
onRemove
|
|
3941
3952
|
}) {
|
|
3942
|
-
return /* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
3953
|
+
return /* @__PURE__ */ jsxs34("span", { className: "group relative inline-flex", children: [
|
|
3954
|
+
/* @__PURE__ */ jsxs34(
|
|
3944
3955
|
"span",
|
|
3945
3956
|
{
|
|
3946
3957
|
className: cn(
|
|
@@ -3952,22 +3963,22 @@ function Chip({
|
|
|
3952
3963
|
) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
|
|
3953
3964
|
),
|
|
3954
3965
|
children: [
|
|
3955
|
-
parked && /* @__PURE__ */
|
|
3966
|
+
parked && /* @__PURE__ */ jsx36(CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
3956
3967
|
label,
|
|
3957
|
-
/* @__PURE__ */
|
|
3968
|
+
/* @__PURE__ */ jsx36(
|
|
3958
3969
|
"button",
|
|
3959
3970
|
{
|
|
3960
3971
|
type: "button",
|
|
3961
3972
|
onClick: onRemove,
|
|
3962
3973
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
3963
3974
|
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",
|
|
3964
|
-
children: /* @__PURE__ */
|
|
3975
|
+
children: /* @__PURE__ */ jsx36(X4, { size: 12 })
|
|
3965
3976
|
}
|
|
3966
3977
|
)
|
|
3967
3978
|
]
|
|
3968
3979
|
}
|
|
3969
3980
|
),
|
|
3970
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ jsx36(
|
|
3971
3982
|
"span",
|
|
3972
3983
|
{
|
|
3973
3984
|
role: "tooltip",
|
|
@@ -3981,7 +3992,7 @@ function Chip({
|
|
|
3981
3992
|
// src/SortButton.tsx
|
|
3982
3993
|
import { forwardRef as forwardRef7 } from "react";
|
|
3983
3994
|
import { ArrowUp, ArrowDown, ArrowUpDown } from "lucide-react";
|
|
3984
|
-
import { jsx as
|
|
3995
|
+
import { jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3985
3996
|
var ALIGN = {
|
|
3986
3997
|
left: "justify-start text-left",
|
|
3987
3998
|
center: "justify-center text-center",
|
|
@@ -3999,9 +4010,9 @@ var SortButton = forwardRef7(
|
|
|
3999
4010
|
className,
|
|
4000
4011
|
testIdPrefix
|
|
4001
4012
|
}, ref) {
|
|
4002
|
-
if (!sortable) return /* @__PURE__ */
|
|
4013
|
+
if (!sortable) return /* @__PURE__ */ jsx37("span", { className: cn("inline-flex", ALIGN[align], className), children: label });
|
|
4003
4014
|
const active = !disabled && sort.key === sortKey;
|
|
4004
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ jsxs35(
|
|
4005
4016
|
"button",
|
|
4006
4017
|
{
|
|
4007
4018
|
ref,
|
|
@@ -4032,7 +4043,7 @@ var SortButton = forwardRef7(
|
|
|
4032
4043
|
),
|
|
4033
4044
|
children: [
|
|
4034
4045
|
label,
|
|
4035
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */
|
|
4046
|
+
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ jsx37(ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ jsx37(ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ jsx37(
|
|
4036
4047
|
ArrowUpDown,
|
|
4037
4048
|
{
|
|
4038
4049
|
size: 12,
|
|
@@ -4063,7 +4074,7 @@ function ariaSortFor(sort, key) {
|
|
|
4063
4074
|
|
|
4064
4075
|
// src/Pager.tsx
|
|
4065
4076
|
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight4 } from "lucide-react";
|
|
4066
|
-
import { jsx as
|
|
4077
|
+
import { jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4067
4078
|
function pageWindow(current, total) {
|
|
4068
4079
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
4069
4080
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -4079,8 +4090,8 @@ function pageWindow(current, total) {
|
|
|
4079
4090
|
}
|
|
4080
4091
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
4081
4092
|
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";
|
|
4082
|
-
return /* @__PURE__ */
|
|
4083
|
-
/* @__PURE__ */
|
|
4093
|
+
return /* @__PURE__ */ jsxs36("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4094
|
+
/* @__PURE__ */ jsx38(
|
|
4084
4095
|
"button",
|
|
4085
4096
|
{
|
|
4086
4097
|
type: "button",
|
|
@@ -4088,11 +4099,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4088
4099
|
disabled: disabled || page === 1,
|
|
4089
4100
|
"aria-label": "Previous page",
|
|
4090
4101
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4091
|
-
children: /* @__PURE__ */
|
|
4102
|
+
children: /* @__PURE__ */ jsx38(ChevronLeft3, { size: 16 })
|
|
4092
4103
|
}
|
|
4093
4104
|
),
|
|
4094
4105
|
pageWindow(page, totalPages).map(
|
|
4095
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4106
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx38("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx38(
|
|
4096
4107
|
"button",
|
|
4097
4108
|
{
|
|
4098
4109
|
type: "button",
|
|
@@ -4108,7 +4119,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4108
4119
|
p
|
|
4109
4120
|
)
|
|
4110
4121
|
),
|
|
4111
|
-
/* @__PURE__ */
|
|
4122
|
+
/* @__PURE__ */ jsx38(
|
|
4112
4123
|
"button",
|
|
4113
4124
|
{
|
|
4114
4125
|
type: "button",
|
|
@@ -4116,14 +4127,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4116
4127
|
disabled: disabled || page === totalPages,
|
|
4117
4128
|
"aria-label": "Next page",
|
|
4118
4129
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4119
|
-
children: /* @__PURE__ */
|
|
4130
|
+
children: /* @__PURE__ */ jsx38(ChevronRight4, { size: 16 })
|
|
4120
4131
|
}
|
|
4121
4132
|
)
|
|
4122
4133
|
] });
|
|
4123
4134
|
}
|
|
4124
4135
|
|
|
4125
4136
|
// src/WorkspaceAvatar.tsx
|
|
4126
|
-
import { jsx as
|
|
4137
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4127
4138
|
function workspaceInitials(name) {
|
|
4128
4139
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
4129
4140
|
if (words.length === 0) return "\xB7";
|
|
@@ -4142,7 +4153,7 @@ var SIZES = {
|
|
|
4142
4153
|
lg: "h-11 w-11 text-panel-title"
|
|
4143
4154
|
};
|
|
4144
4155
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
4145
|
-
return /* @__PURE__ */
|
|
4156
|
+
return /* @__PURE__ */ jsx39(
|
|
4146
4157
|
"span",
|
|
4147
4158
|
{
|
|
4148
4159
|
"aria-hidden": "true",
|
|
@@ -4160,12 +4171,12 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
4160
4171
|
// src/Toast.tsx
|
|
4161
4172
|
import { useEffect as useEffect11, useRef as useRef13, useState as useState12 } from "react";
|
|
4162
4173
|
import { createPortal as createPortal6 } from "react-dom";
|
|
4163
|
-
import { AlertTriangle, Check as
|
|
4164
|
-
import { jsx as
|
|
4174
|
+
import { AlertTriangle, Check as Check8 } from "lucide-react";
|
|
4175
|
+
import { jsx as jsx40, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4165
4176
|
var ICON = {
|
|
4166
4177
|
neutral: null,
|
|
4167
|
-
success: /* @__PURE__ */
|
|
4168
|
-
warning: /* @__PURE__ */
|
|
4178
|
+
success: /* @__PURE__ */ jsx40(Check8, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
|
|
4179
|
+
warning: /* @__PURE__ */ jsx40(AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
|
|
4169
4180
|
};
|
|
4170
4181
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4171
4182
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
@@ -4181,7 +4192,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4181
4192
|
return () => window.clearTimeout(t);
|
|
4182
4193
|
}, [message, ms, paused]);
|
|
4183
4194
|
return createPortal6(
|
|
4184
|
-
/* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ jsxs37(
|
|
4185
4196
|
"div",
|
|
4186
4197
|
{
|
|
4187
4198
|
role: "status",
|
|
@@ -4199,7 +4210,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4199
4210
|
children: [
|
|
4200
4211
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4201
4212
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4202
|
-
/* @__PURE__ */
|
|
4213
|
+
/* @__PURE__ */ jsx40(
|
|
4203
4214
|
"span",
|
|
4204
4215
|
{
|
|
4205
4216
|
className: cn(
|
|
@@ -4209,8 +4220,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4209
4220
|
children: ICON[tone]
|
|
4210
4221
|
}
|
|
4211
4222
|
),
|
|
4212
|
-
/* @__PURE__ */
|
|
4213
|
-
action && /* @__PURE__ */
|
|
4223
|
+
/* @__PURE__ */ jsx40("span", { className: "min-w-0", children: message }),
|
|
4224
|
+
action && /* @__PURE__ */ jsx40(
|
|
4214
4225
|
"button",
|
|
4215
4226
|
{
|
|
4216
4227
|
type: "button",
|
|
@@ -4232,14 +4243,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4232
4243
|
}
|
|
4233
4244
|
|
|
4234
4245
|
// src/Tag.tsx
|
|
4235
|
-
import { jsx as
|
|
4246
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4236
4247
|
function Tag({ children, className, testIdPrefix }) {
|
|
4237
|
-
return /* @__PURE__ */
|
|
4248
|
+
return /* @__PURE__ */ jsx41(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4238
4249
|
}
|
|
4239
4250
|
|
|
4240
4251
|
// src/TablePagination.tsx
|
|
4241
4252
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
4242
|
-
import { jsx as
|
|
4253
|
+
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4243
4254
|
function TablePagination({
|
|
4244
4255
|
page,
|
|
4245
4256
|
perPage,
|
|
@@ -4259,7 +4270,7 @@ function TablePagination({
|
|
|
4259
4270
|
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";
|
|
4260
4271
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4261
4272
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4262
|
-
const range = /* @__PURE__ */
|
|
4273
|
+
const range = /* @__PURE__ */ jsxs38("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4263
4274
|
rangeStart.toLocaleString(),
|
|
4264
4275
|
" \u2013 ",
|
|
4265
4276
|
rangeEnd.toLocaleString(),
|
|
@@ -4268,13 +4279,13 @@ function TablePagination({
|
|
|
4268
4279
|
" ",
|
|
4269
4280
|
itemLabel
|
|
4270
4281
|
] });
|
|
4271
|
-
return /* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4282
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4283
|
+
/* @__PURE__ */ jsxs38(
|
|
4273
4284
|
"div",
|
|
4274
4285
|
{
|
|
4275
4286
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4276
4287
|
children: [
|
|
4277
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ jsx42(
|
|
4278
4289
|
SelectFilter,
|
|
4279
4290
|
{
|
|
4280
4291
|
size: "sm",
|
|
@@ -4290,8 +4301,8 @@ function TablePagination({
|
|
|
4290
4301
|
]
|
|
4291
4302
|
}
|
|
4292
4303
|
),
|
|
4293
|
-
/* @__PURE__ */
|
|
4294
|
-
/* @__PURE__ */
|
|
4304
|
+
/* @__PURE__ */ jsxs38("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4305
|
+
/* @__PURE__ */ jsx42(
|
|
4295
4306
|
"button",
|
|
4296
4307
|
{
|
|
4297
4308
|
type: "button",
|
|
@@ -4300,10 +4311,10 @@ function TablePagination({
|
|
|
4300
4311
|
"aria-label": "First page",
|
|
4301
4312
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4302
4313
|
className: stepBtn,
|
|
4303
|
-
children: /* @__PURE__ */
|
|
4314
|
+
children: /* @__PURE__ */ jsx42(ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4304
4315
|
}
|
|
4305
4316
|
),
|
|
4306
|
-
/* @__PURE__ */
|
|
4317
|
+
/* @__PURE__ */ jsx42(
|
|
4307
4318
|
"button",
|
|
4308
4319
|
{
|
|
4309
4320
|
type: "button",
|
|
@@ -4312,11 +4323,11 @@ function TablePagination({
|
|
|
4312
4323
|
"aria-label": "Previous page",
|
|
4313
4324
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4314
4325
|
className: stepBtn,
|
|
4315
|
-
children: /* @__PURE__ */
|
|
4326
|
+
children: /* @__PURE__ */ jsx42(ChevronLeft4, { size: 16, "aria-hidden": "true" })
|
|
4316
4327
|
}
|
|
4317
4328
|
),
|
|
4318
4329
|
pageWindow(current, totalPages).map(
|
|
4319
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4330
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx42("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx42(
|
|
4320
4331
|
"button",
|
|
4321
4332
|
{
|
|
4322
4333
|
type: "button",
|
|
@@ -4334,7 +4345,7 @@ function TablePagination({
|
|
|
4334
4345
|
p
|
|
4335
4346
|
)
|
|
4336
4347
|
),
|
|
4337
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx42(
|
|
4338
4349
|
"button",
|
|
4339
4350
|
{
|
|
4340
4351
|
type: "button",
|
|
@@ -4343,10 +4354,10 @@ function TablePagination({
|
|
|
4343
4354
|
"aria-label": "Next page",
|
|
4344
4355
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4345
4356
|
className: stepBtn,
|
|
4346
|
-
children: /* @__PURE__ */
|
|
4357
|
+
children: /* @__PURE__ */ jsx42(ChevronRight5, { size: 16, "aria-hidden": "true" })
|
|
4347
4358
|
}
|
|
4348
4359
|
),
|
|
4349
|
-
/* @__PURE__ */
|
|
4360
|
+
/* @__PURE__ */ jsx42(
|
|
4350
4361
|
"button",
|
|
4351
4362
|
{
|
|
4352
4363
|
type: "button",
|
|
@@ -4355,7 +4366,7 @@ function TablePagination({
|
|
|
4355
4366
|
"aria-label": "Last page",
|
|
4356
4367
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4357
4368
|
className: stepBtn,
|
|
4358
|
-
children: /* @__PURE__ */
|
|
4369
|
+
children: /* @__PURE__ */ jsx42(ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4359
4370
|
}
|
|
4360
4371
|
)
|
|
4361
4372
|
] }),
|
|
@@ -4366,7 +4377,7 @@ function TablePagination({
|
|
|
4366
4377
|
// src/DateRangePicker.tsx
|
|
4367
4378
|
import { useEffect as useEffect12, useMemo as useMemo4, useRef as useRef14, useState as useState13 } from "react";
|
|
4368
4379
|
import { ChevronDown as ChevronDown9 } from "lucide-react";
|
|
4369
|
-
import { jsx as
|
|
4380
|
+
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4370
4381
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4371
4382
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4372
4383
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4404,7 +4415,7 @@ function spanLabel2(label, today, formatDate, formatRange) {
|
|
|
4404
4415
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4405
4416
|
}
|
|
4406
4417
|
function MiniSelect({ value, onChange, options }) {
|
|
4407
|
-
return /* @__PURE__ */
|
|
4418
|
+
return /* @__PURE__ */ jsx43(
|
|
4408
4419
|
"select",
|
|
4409
4420
|
{
|
|
4410
4421
|
value: String(value),
|
|
@@ -4413,7 +4424,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4413
4424
|
if (opt) onChange(opt.value);
|
|
4414
4425
|
},
|
|
4415
4426
|
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",
|
|
4416
|
-
children: options.map((o) => /* @__PURE__ */
|
|
4427
|
+
children: options.map((o) => /* @__PURE__ */ jsx43("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4417
4428
|
}
|
|
4418
4429
|
);
|
|
4419
4430
|
}
|
|
@@ -4478,8 +4489,8 @@ function DateRangePicker({
|
|
|
4478
4489
|
if (showFooter) setDraft(label);
|
|
4479
4490
|
else commit(label);
|
|
4480
4491
|
};
|
|
4481
|
-
return /* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
4492
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4493
|
+
/* @__PURE__ */ jsxs39(
|
|
4483
4494
|
"button",
|
|
4484
4495
|
{
|
|
4485
4496
|
type: "button",
|
|
@@ -4488,16 +4499,16 @@ function DateRangePicker({
|
|
|
4488
4499
|
"aria-haspopup": "listbox",
|
|
4489
4500
|
className: chipTriggerClass(),
|
|
4490
4501
|
children: [
|
|
4491
|
-
/* @__PURE__ */
|
|
4492
|
-
/* @__PURE__ */
|
|
4493
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsxs39("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4503
|
+
/* @__PURE__ */ jsx43("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate, formatRange) }),
|
|
4504
|
+
/* @__PURE__ */ jsx43("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
|
|
4494
4505
|
] }),
|
|
4495
|
-
/* @__PURE__ */
|
|
4506
|
+
/* @__PURE__ */ jsx43(ChevronDown9, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4496
4507
|
]
|
|
4497
4508
|
}
|
|
4498
4509
|
),
|
|
4499
|
-
open && /* @__PURE__ */
|
|
4500
|
-
presets.map((p) => /* @__PURE__ */
|
|
4510
|
+
open && /* @__PURE__ */ jsxs39("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: [
|
|
4511
|
+
presets.map((p) => /* @__PURE__ */ jsx43(
|
|
4501
4512
|
"button",
|
|
4502
4513
|
{
|
|
4503
4514
|
type: "button",
|
|
@@ -4507,26 +4518,26 @@ function DateRangePicker({
|
|
|
4507
4518
|
},
|
|
4508
4519
|
p
|
|
4509
4520
|
)),
|
|
4510
|
-
/* @__PURE__ */
|
|
4511
|
-
/* @__PURE__ */
|
|
4512
|
-
/* @__PURE__ */
|
|
4513
|
-
/* @__PURE__ */
|
|
4521
|
+
/* @__PURE__ */ jsxs39("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4522
|
+
/* @__PURE__ */ jsx43("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4523
|
+
/* @__PURE__ */ jsxs39("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4524
|
+
/* @__PURE__ */ jsxs39("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4514
4525
|
"From",
|
|
4515
|
-
/* @__PURE__ */
|
|
4516
|
-
granularity === "month" && /* @__PURE__ */
|
|
4517
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4518
|
-
/* @__PURE__ */
|
|
4526
|
+
/* @__PURE__ */ jsxs39("span", { className: "flex gap-1", children: [
|
|
4527
|
+
granularity === "month" && /* @__PURE__ */ jsx43(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4528
|
+
granularity === "quarter" && /* @__PURE__ */ jsx43(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4529
|
+
/* @__PURE__ */ jsx43(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4519
4530
|
] })
|
|
4520
4531
|
] }),
|
|
4521
|
-
/* @__PURE__ */
|
|
4532
|
+
/* @__PURE__ */ jsxs39("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4522
4533
|
"To",
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
granularity === "month" && /* @__PURE__ */
|
|
4525
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4526
|
-
/* @__PURE__ */
|
|
4534
|
+
/* @__PURE__ */ jsxs39("span", { className: "flex gap-1", children: [
|
|
4535
|
+
granularity === "month" && /* @__PURE__ */ jsx43(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4536
|
+
granularity === "quarter" && /* @__PURE__ */ jsx43(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4537
|
+
/* @__PURE__ */ jsx43(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4527
4538
|
] })
|
|
4528
4539
|
] }),
|
|
4529
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ jsx43(
|
|
4530
4541
|
"button",
|
|
4531
4542
|
{
|
|
4532
4543
|
type: "button",
|
|
@@ -4538,7 +4549,7 @@ function DateRangePicker({
|
|
|
4538
4549
|
)
|
|
4539
4550
|
] })
|
|
4540
4551
|
] }),
|
|
4541
|
-
showFooter && /* @__PURE__ */
|
|
4552
|
+
showFooter && /* @__PURE__ */ jsx43(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4542
4553
|
] })
|
|
4543
4554
|
] });
|
|
4544
4555
|
}
|
|
@@ -4546,7 +4557,7 @@ function DateRangePicker({
|
|
|
4546
4557
|
// src/MultiSelectFilter.tsx
|
|
4547
4558
|
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef15, useState as useState14 } from "react";
|
|
4548
4559
|
import { ChevronDown as ChevronDown10, Search as Search5, X as X5 } from "lucide-react";
|
|
4549
|
-
import { Fragment as Fragment4, jsx as
|
|
4560
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4550
4561
|
var SEARCH_AFTER = 8;
|
|
4551
4562
|
function MultiSelectFilter({
|
|
4552
4563
|
caption,
|
|
@@ -4644,9 +4655,9 @@ function MultiSelectFilter({
|
|
|
4644
4655
|
const shown = open && !showFooter ? draft : selected;
|
|
4645
4656
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4646
4657
|
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4647
|
-
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */
|
|
4648
|
-
/* @__PURE__ */
|
|
4649
|
-
/* @__PURE__ */
|
|
4658
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ jsxs40("span", { className: "flex flex-col", children: [
|
|
4659
|
+
/* @__PURE__ */ jsx44("span", { children: label }),
|
|
4660
|
+
/* @__PURE__ */ jsx44("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4650
4661
|
] }) : label;
|
|
4651
4662
|
const ql = q.trim().toLowerCase();
|
|
4652
4663
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4657,8 +4668,8 @@ function MultiSelectFilter({
|
|
|
4657
4668
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4658
4669
|
return kids.length ? { ...g, children: kids } : null;
|
|
4659
4670
|
}).filter((g) => g !== null) : [];
|
|
4660
|
-
return /* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4671
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4672
|
+
/* @__PURE__ */ jsxs40(
|
|
4662
4673
|
"button",
|
|
4663
4674
|
{
|
|
4664
4675
|
type: "button",
|
|
@@ -4667,8 +4678,8 @@ function MultiSelectFilter({
|
|
|
4667
4678
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4668
4679
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4669
4680
|
children: [
|
|
4670
|
-
/* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4681
|
+
/* @__PURE__ */ jsx44(ChipContent, { caption, value, icon }),
|
|
4682
|
+
/* @__PURE__ */ jsx44(
|
|
4672
4683
|
ChevronDown10,
|
|
4673
4684
|
{
|
|
4674
4685
|
size: 14,
|
|
@@ -4679,7 +4690,7 @@ function MultiSelectFilter({
|
|
|
4679
4690
|
]
|
|
4680
4691
|
}
|
|
4681
4692
|
),
|
|
4682
|
-
open && /* @__PURE__ */
|
|
4693
|
+
open && /* @__PURE__ */ jsx44(
|
|
4683
4694
|
"div",
|
|
4684
4695
|
{
|
|
4685
4696
|
className: cn(
|
|
@@ -4690,10 +4701,10 @@ function MultiSelectFilter({
|
|
|
4690
4701
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4691
4702
|
role: "dialog",
|
|
4692
4703
|
"aria-label": caption,
|
|
4693
|
-
children: loading ? /* @__PURE__ */
|
|
4694
|
-
showSearch && /* @__PURE__ */
|
|
4695
|
-
/* @__PURE__ */
|
|
4696
|
-
/* @__PURE__ */
|
|
4704
|
+
children: loading ? /* @__PURE__ */ jsx44(MenuLoading, {}) : error ? /* @__PURE__ */ jsx44(MenuError, { onRetry }) : /* @__PURE__ */ jsxs40(Fragment4, { children: [
|
|
4705
|
+
showSearch && /* @__PURE__ */ jsx44("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs40("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: [
|
|
4706
|
+
/* @__PURE__ */ jsx44(Search5, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4707
|
+
/* @__PURE__ */ jsx44(
|
|
4697
4708
|
"input",
|
|
4698
4709
|
{
|
|
4699
4710
|
type: "text",
|
|
@@ -4703,37 +4714,37 @@ function MultiSelectFilter({
|
|
|
4703
4714
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4704
4715
|
}
|
|
4705
4716
|
),
|
|
4706
|
-
q && /* @__PURE__ */
|
|
4717
|
+
q && /* @__PURE__ */ jsx44("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__ */ jsx44(X5, { size: 13 }) })
|
|
4707
4718
|
] }) }),
|
|
4708
|
-
/* @__PURE__ */
|
|
4719
|
+
/* @__PURE__ */ jsxs40("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4709
4720
|
groups ? visibleGroups.map((g) => {
|
|
4710
4721
|
const state = groupState(g);
|
|
4711
|
-
return /* @__PURE__ */
|
|
4712
|
-
/* @__PURE__ */
|
|
4722
|
+
return /* @__PURE__ */ jsxs40("div", { children: [
|
|
4723
|
+
/* @__PURE__ */ jsxs40(
|
|
4713
4724
|
"button",
|
|
4714
4725
|
{
|
|
4715
4726
|
type: "button",
|
|
4716
4727
|
onClick: () => toggleGroup(g),
|
|
4717
4728
|
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",
|
|
4718
4729
|
children: [
|
|
4719
|
-
/* @__PURE__ */
|
|
4720
|
-
/* @__PURE__ */
|
|
4721
|
-
counts && /* @__PURE__ */
|
|
4730
|
+
/* @__PURE__ */ jsx44(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
4731
|
+
/* @__PURE__ */ jsx44("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
4732
|
+
counts && /* @__PURE__ */ jsx44(OptionCount, { n: countFor(g.id) })
|
|
4722
4733
|
]
|
|
4723
4734
|
}
|
|
4724
4735
|
),
|
|
4725
4736
|
g.children.map((c) => {
|
|
4726
4737
|
const checked = draft.includes(c.id);
|
|
4727
|
-
return /* @__PURE__ */
|
|
4738
|
+
return /* @__PURE__ */ jsxs40(
|
|
4728
4739
|
"button",
|
|
4729
4740
|
{
|
|
4730
4741
|
type: "button",
|
|
4731
4742
|
onClick: () => toggle(c.id),
|
|
4732
4743
|
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",
|
|
4733
4744
|
children: [
|
|
4734
|
-
/* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
4736
|
-
counts && /* @__PURE__ */
|
|
4745
|
+
/* @__PURE__ */ jsx44(CheckBoxBox, { checked }),
|
|
4746
|
+
/* @__PURE__ */ jsx44("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
4747
|
+
counts && /* @__PURE__ */ jsx44(OptionCount, { n: countFor(c.id) })
|
|
4737
4748
|
]
|
|
4738
4749
|
},
|
|
4739
4750
|
c.id
|
|
@@ -4742,25 +4753,25 @@ function MultiSelectFilter({
|
|
|
4742
4753
|
] }, g.id);
|
|
4743
4754
|
}) : items.map((o) => {
|
|
4744
4755
|
const checked = draft.includes(o.id);
|
|
4745
|
-
return /* @__PURE__ */
|
|
4756
|
+
return /* @__PURE__ */ jsxs40(
|
|
4746
4757
|
"button",
|
|
4747
4758
|
{
|
|
4748
4759
|
type: "button",
|
|
4749
4760
|
onClick: () => toggle(o.id),
|
|
4750
4761
|
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",
|
|
4751
4762
|
children: [
|
|
4752
|
-
/* @__PURE__ */
|
|
4753
|
-
/* @__PURE__ */
|
|
4754
|
-
counts && /* @__PURE__ */
|
|
4763
|
+
/* @__PURE__ */ jsx44(CheckBoxBox, { checked }),
|
|
4764
|
+
/* @__PURE__ */ jsx44("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
4765
|
+
counts && /* @__PURE__ */ jsx44(OptionCount, { n: countFor(o.id) })
|
|
4755
4766
|
]
|
|
4756
4767
|
},
|
|
4757
4768
|
o.id
|
|
4758
4769
|
);
|
|
4759
4770
|
}),
|
|
4760
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */
|
|
4771
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ jsx44("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4761
4772
|
] }),
|
|
4762
|
-
note && /* @__PURE__ */
|
|
4763
|
-
showFooter ? /* @__PURE__ */
|
|
4773
|
+
note && /* @__PURE__ */ jsx44("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4774
|
+
showFooter ? /* @__PURE__ */ jsx44(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ jsx44("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ jsxs40(
|
|
4764
4775
|
"button",
|
|
4765
4776
|
{
|
|
4766
4777
|
type: "button",
|
|
@@ -4778,7 +4789,7 @@ function MultiSelectFilter({
|
|
|
4778
4789
|
] });
|
|
4779
4790
|
}
|
|
4780
4791
|
function OptionCount({ n }) {
|
|
4781
|
-
return /* @__PURE__ */
|
|
4792
|
+
return /* @__PURE__ */ jsxs40("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4782
4793
|
"(",
|
|
4783
4794
|
n.toLocaleString(),
|
|
4784
4795
|
")"
|
|
@@ -4787,7 +4798,7 @@ function OptionCount({ n }) {
|
|
|
4787
4798
|
|
|
4788
4799
|
// src/Toggle.tsx
|
|
4789
4800
|
import { forwardRef as forwardRef8 } from "react";
|
|
4790
|
-
import { jsx as
|
|
4801
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4791
4802
|
var SIZES2 = {
|
|
4792
4803
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4793
4804
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
@@ -4795,7 +4806,7 @@ var SIZES2 = {
|
|
|
4795
4806
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4796
4807
|
var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4797
4808
|
const s = SIZES2[size];
|
|
4798
|
-
return /* @__PURE__ */
|
|
4809
|
+
return /* @__PURE__ */ jsx45(
|
|
4799
4810
|
"button",
|
|
4800
4811
|
{
|
|
4801
4812
|
ref,
|
|
@@ -4814,7 +4825,7 @@ var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md
|
|
|
4814
4825
|
disabled && "cursor-not-allowed opacity-50",
|
|
4815
4826
|
className
|
|
4816
4827
|
),
|
|
4817
|
-
children: /* @__PURE__ */
|
|
4828
|
+
children: /* @__PURE__ */ jsx45(
|
|
4818
4829
|
"span",
|
|
4819
4830
|
{
|
|
4820
4831
|
className: cn(
|
|
@@ -4832,20 +4843,20 @@ Toggle.displayName = "Toggle";
|
|
|
4832
4843
|
// src/AISpark.tsx
|
|
4833
4844
|
import { useId as useId6 } from "react";
|
|
4834
4845
|
import { Sparkles } from "lucide-react";
|
|
4835
|
-
import { Fragment as Fragment5, jsx as
|
|
4846
|
+
import { Fragment as Fragment5, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4836
4847
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4837
4848
|
const id = useId6();
|
|
4838
|
-
return /* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
/* @__PURE__ */
|
|
4841
|
-
/* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ jsxs41(Fragment5, { children: [
|
|
4850
|
+
/* @__PURE__ */ jsx46("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ jsx46("defs", { children: /* @__PURE__ */ jsxs41("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
4851
|
+
/* @__PURE__ */ jsx46("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
4852
|
+
/* @__PURE__ */ jsx46("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4842
4853
|
] }) }) }),
|
|
4843
|
-
/* @__PURE__ */
|
|
4854
|
+
/* @__PURE__ */ jsx46(Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4844
4855
|
] });
|
|
4845
4856
|
}
|
|
4846
4857
|
|
|
4847
4858
|
// src/Freshness.tsx
|
|
4848
|
-
import { jsx as
|
|
4859
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4849
4860
|
var dotColor = {
|
|
4850
4861
|
fresh: "bg-status-success",
|
|
4851
4862
|
recent: "bg-status-warning",
|
|
@@ -4857,7 +4868,7 @@ var srLabel = {
|
|
|
4857
4868
|
stale: "Older than a day"
|
|
4858
4869
|
};
|
|
4859
4870
|
function Freshness({ level, className, testIdPrefix }) {
|
|
4860
|
-
return /* @__PURE__ */
|
|
4871
|
+
return /* @__PURE__ */ jsx47(
|
|
4861
4872
|
"span",
|
|
4862
4873
|
{
|
|
4863
4874
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -4869,42 +4880,42 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
4869
4880
|
}
|
|
4870
4881
|
|
|
4871
4882
|
// src/SectionHeading.tsx
|
|
4872
|
-
import { jsx as
|
|
4883
|
+
import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4873
4884
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
4874
|
-
return /* @__PURE__ */
|
|
4875
|
-
/* @__PURE__ */
|
|
4876
|
-
/* @__PURE__ */
|
|
4877
|
-
description && /* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ jsxs42("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4886
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0", children: [
|
|
4887
|
+
/* @__PURE__ */ jsx48(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4888
|
+
description && /* @__PURE__ */ jsx48("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
|
|
4878
4889
|
] }),
|
|
4879
|
-
actions && /* @__PURE__ */
|
|
4890
|
+
actions && /* @__PURE__ */ jsx48("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4880
4891
|
] });
|
|
4881
4892
|
}
|
|
4882
4893
|
|
|
4883
4894
|
// src/PageHeader.tsx
|
|
4884
4895
|
import { ArrowLeft } from "lucide-react";
|
|
4885
|
-
import { jsx as
|
|
4896
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4886
4897
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
4887
|
-
return /* @__PURE__ */
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
back && /* @__PURE__ */
|
|
4898
|
+
return /* @__PURE__ */ jsxs43("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
|
|
4899
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0", children: [
|
|
4900
|
+
back && /* @__PURE__ */ jsxs43(
|
|
4890
4901
|
"a",
|
|
4891
4902
|
{
|
|
4892
4903
|
href: back.href ?? "#",
|
|
4893
4904
|
onClick: back.onClick,
|
|
4894
4905
|
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",
|
|
4895
4906
|
children: [
|
|
4896
|
-
/* @__PURE__ */
|
|
4907
|
+
/* @__PURE__ */ jsx49(ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4897
4908
|
back.label
|
|
4898
4909
|
]
|
|
4899
4910
|
}
|
|
4900
4911
|
),
|
|
4901
|
-
meta ? /* @__PURE__ */
|
|
4902
|
-
/* @__PURE__ */
|
|
4912
|
+
meta ? /* @__PURE__ */ jsxs43("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
|
|
4913
|
+
/* @__PURE__ */ jsx49("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4903
4914
|
meta
|
|
4904
|
-
] }) : /* @__PURE__ */
|
|
4905
|
-
description && /* @__PURE__ */
|
|
4915
|
+
] }) : /* @__PURE__ */ jsx49("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4916
|
+
description && /* @__PURE__ */ jsx49("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
|
|
4906
4917
|
] }),
|
|
4907
|
-
actions && /* @__PURE__ */
|
|
4918
|
+
actions && /* @__PURE__ */ jsx49("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4908
4919
|
] });
|
|
4909
4920
|
}
|
|
4910
4921
|
|
|
@@ -4912,7 +4923,7 @@ function PageHeader({ title, description, actions, meta, back, className, testId
|
|
|
4912
4923
|
import { useEffect as useEffect14, useId as useId7, useRef as useRef16, useState as useState15 } from "react";
|
|
4913
4924
|
import { createPortal as createPortal7 } from "react-dom";
|
|
4914
4925
|
import { X as X6 } from "lucide-react";
|
|
4915
|
-
import { jsx as
|
|
4926
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4916
4927
|
var WIDTH = {
|
|
4917
4928
|
sm: "max-w-110",
|
|
4918
4929
|
md: "max-w-160",
|
|
@@ -4976,7 +4987,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4976
4987
|
}, [open, mounted]);
|
|
4977
4988
|
if (!mounted || typeof document === "undefined") return null;
|
|
4978
4989
|
return createPortal7(
|
|
4979
|
-
/* @__PURE__ */
|
|
4990
|
+
/* @__PURE__ */ jsx50(
|
|
4980
4991
|
"div",
|
|
4981
4992
|
{
|
|
4982
4993
|
className: cn(
|
|
@@ -4984,7 +4995,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4984
4995
|
shown ? "opacity-100" : "opacity-0"
|
|
4985
4996
|
),
|
|
4986
4997
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
4987
|
-
children: /* @__PURE__ */
|
|
4998
|
+
children: /* @__PURE__ */ jsxs44(
|
|
4988
4999
|
"div",
|
|
4989
5000
|
{
|
|
4990
5001
|
ref: panel,
|
|
@@ -5002,24 +5013,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5002
5013
|
className
|
|
5003
5014
|
),
|
|
5004
5015
|
children: [
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
/* @__PURE__ */
|
|
5007
|
-
/* @__PURE__ */
|
|
5008
|
-
description && /* @__PURE__ */
|
|
5016
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5017
|
+
/* @__PURE__ */ jsxs44("div", { className: "min-w-0 flex-1", children: [
|
|
5018
|
+
/* @__PURE__ */ jsx50("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5019
|
+
description && /* @__PURE__ */ jsx50("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5009
5020
|
] }),
|
|
5010
|
-
/* @__PURE__ */
|
|
5021
|
+
/* @__PURE__ */ jsx50(
|
|
5011
5022
|
"button",
|
|
5012
5023
|
{
|
|
5013
5024
|
type: "button",
|
|
5014
5025
|
onClick: onClose,
|
|
5015
5026
|
"aria-label": "Close",
|
|
5016
5027
|
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",
|
|
5017
|
-
children: /* @__PURE__ */
|
|
5028
|
+
children: /* @__PURE__ */ jsx50(X6, { size: 16, "aria-hidden": "true" })
|
|
5018
5029
|
}
|
|
5019
5030
|
)
|
|
5020
5031
|
] }),
|
|
5021
|
-
children && /* @__PURE__ */
|
|
5022
|
-
footer && /* @__PURE__ */
|
|
5032
|
+
children && /* @__PURE__ */ jsx50("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 }),
|
|
5033
|
+
footer && /* @__PURE__ */ jsx50("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5023
5034
|
]
|
|
5024
5035
|
}
|
|
5025
5036
|
)
|
|
@@ -5030,10 +5041,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5030
5041
|
}
|
|
5031
5042
|
|
|
5032
5043
|
// src/EmptyState.tsx
|
|
5033
|
-
import { jsx as
|
|
5044
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
5034
5045
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
5035
5046
|
const md = size === "md";
|
|
5036
|
-
return /* @__PURE__ */
|
|
5047
|
+
return /* @__PURE__ */ jsxs45(
|
|
5037
5048
|
"div",
|
|
5038
5049
|
{
|
|
5039
5050
|
className: cn(
|
|
@@ -5043,7 +5054,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5043
5054
|
),
|
|
5044
5055
|
"data-testid": testIdPrefix,
|
|
5045
5056
|
children: [
|
|
5046
|
-
icon && /* @__PURE__ */
|
|
5057
|
+
icon && /* @__PURE__ */ jsx51(
|
|
5047
5058
|
"span",
|
|
5048
5059
|
{
|
|
5049
5060
|
"aria-hidden": "true",
|
|
@@ -5054,9 +5065,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5054
5065
|
children: icon
|
|
5055
5066
|
}
|
|
5056
5067
|
),
|
|
5057
|
-
/* @__PURE__ */
|
|
5058
|
-
description && /* @__PURE__ */
|
|
5059
|
-
action && /* @__PURE__ */
|
|
5068
|
+
/* @__PURE__ */ jsx51("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
|
|
5069
|
+
description && /* @__PURE__ */ jsx51("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
|
|
5070
|
+
action && /* @__PURE__ */ jsx51("div", { className: md ? "mt-3" : "mt-2", children: action })
|
|
5060
5071
|
]
|
|
5061
5072
|
}
|
|
5062
5073
|
);
|
|
@@ -5064,7 +5075,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5064
5075
|
|
|
5065
5076
|
// src/TextField.tsx
|
|
5066
5077
|
import { forwardRef as forwardRef9, useId as useId8 } from "react";
|
|
5067
|
-
import { jsx as
|
|
5078
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5068
5079
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
5069
5080
|
var TextField = forwardRef9(
|
|
5070
5081
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
@@ -5072,9 +5083,9 @@ var TextField = forwardRef9(
|
|
|
5072
5083
|
const fieldId = id ?? auto;
|
|
5073
5084
|
const noteId = `${fieldId}-note`;
|
|
5074
5085
|
const note = error ?? hint;
|
|
5075
|
-
return /* @__PURE__ */
|
|
5076
|
-
label && /* @__PURE__ */
|
|
5077
|
-
/* @__PURE__ */
|
|
5086
|
+
return /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
|
|
5087
|
+
label && /* @__PURE__ */ jsx52("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
|
|
5088
|
+
/* @__PURE__ */ jsxs46(
|
|
5078
5089
|
"div",
|
|
5079
5090
|
{
|
|
5080
5091
|
className: cn(
|
|
@@ -5084,8 +5095,8 @@ var TextField = forwardRef9(
|
|
|
5084
5095
|
disabled && "opacity-50"
|
|
5085
5096
|
),
|
|
5086
5097
|
children: [
|
|
5087
|
-
icon && /* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5098
|
+
icon && /* @__PURE__ */ jsx52("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5099
|
+
/* @__PURE__ */ jsx52(
|
|
5089
5100
|
"input",
|
|
5090
5101
|
{
|
|
5091
5102
|
ref,
|
|
@@ -5100,7 +5111,7 @@ var TextField = forwardRef9(
|
|
|
5100
5111
|
]
|
|
5101
5112
|
}
|
|
5102
5113
|
),
|
|
5103
|
-
note && /* @__PURE__ */
|
|
5114
|
+
note && /* @__PURE__ */ jsx52("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
5104
5115
|
] });
|
|
5105
5116
|
}
|
|
5106
5117
|
);
|
|
@@ -5110,7 +5121,7 @@ TextField.displayName = "TextField";
|
|
|
5110
5121
|
import { useEffect as useEffect15, useId as useId9, useRef as useRef17, useState as useState16 } from "react";
|
|
5111
5122
|
import { createPortal as createPortal8 } from "react-dom";
|
|
5112
5123
|
import { X as X7 } from "lucide-react";
|
|
5113
|
-
import { jsx as
|
|
5124
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5114
5125
|
var WIDTH2 = {
|
|
5115
5126
|
sm: "max-w-110",
|
|
5116
5127
|
md: "max-w-160",
|
|
@@ -5171,8 +5182,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5171
5182
|
}, [open, mounted]);
|
|
5172
5183
|
if (!mounted || typeof document === "undefined") return null;
|
|
5173
5184
|
return createPortal8(
|
|
5174
|
-
/* @__PURE__ */
|
|
5175
|
-
/* @__PURE__ */
|
|
5185
|
+
/* @__PURE__ */ jsxs47("div", { className: "fixed inset-0 z-modal", children: [
|
|
5186
|
+
/* @__PURE__ */ jsx53(
|
|
5176
5187
|
"div",
|
|
5177
5188
|
{
|
|
5178
5189
|
"aria-hidden": "true",
|
|
@@ -5186,7 +5197,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5186
5197
|
)
|
|
5187
5198
|
}
|
|
5188
5199
|
),
|
|
5189
|
-
/* @__PURE__ */
|
|
5200
|
+
/* @__PURE__ */ jsxs47(
|
|
5190
5201
|
"div",
|
|
5191
5202
|
{
|
|
5192
5203
|
ref: panel,
|
|
@@ -5203,24 +5214,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5203
5214
|
className
|
|
5204
5215
|
),
|
|
5205
5216
|
children: [
|
|
5206
|
-
/* @__PURE__ */
|
|
5207
|
-
/* @__PURE__ */
|
|
5208
|
-
/* @__PURE__ */
|
|
5209
|
-
description && /* @__PURE__ */
|
|
5217
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5218
|
+
/* @__PURE__ */ jsxs47("div", { className: "min-w-0 flex-1", children: [
|
|
5219
|
+
/* @__PURE__ */ jsx53("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5220
|
+
description && /* @__PURE__ */ jsx53("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5210
5221
|
] }),
|
|
5211
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsx53(
|
|
5212
5223
|
"button",
|
|
5213
5224
|
{
|
|
5214
5225
|
type: "button",
|
|
5215
5226
|
onClick: onClose,
|
|
5216
5227
|
"aria-label": "Close",
|
|
5217
5228
|
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",
|
|
5218
|
-
children: /* @__PURE__ */
|
|
5229
|
+
children: /* @__PURE__ */ jsx53(X7, { size: 16, "aria-hidden": "true" })
|
|
5219
5230
|
}
|
|
5220
5231
|
)
|
|
5221
5232
|
] }),
|
|
5222
|
-
/* @__PURE__ */
|
|
5223
|
-
footer && /* @__PURE__ */
|
|
5233
|
+
/* @__PURE__ */ jsx53("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 }),
|
|
5234
|
+
footer && /* @__PURE__ */ jsx53("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5224
5235
|
]
|
|
5225
5236
|
}
|
|
5226
5237
|
)
|
|
@@ -5231,7 +5242,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5231
5242
|
|
|
5232
5243
|
// src/DataTable.tsx
|
|
5233
5244
|
import { useId as useId10 } from "react";
|
|
5234
|
-
import { jsx as
|
|
5245
|
+
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5235
5246
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5236
5247
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5237
5248
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
@@ -5264,20 +5275,20 @@ function DataTable({
|
|
|
5264
5275
|
const col = columns.find((c) => c.key === key);
|
|
5265
5276
|
onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
|
|
5266
5277
|
};
|
|
5267
|
-
return /* @__PURE__ */
|
|
5278
|
+
return /* @__PURE__ */ jsxs48(
|
|
5268
5279
|
"div",
|
|
5269
5280
|
{
|
|
5270
5281
|
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
|
|
5271
5282
|
"data-testid": testIdPrefix,
|
|
5272
5283
|
children: [
|
|
5273
|
-
title && /* @__PURE__ */
|
|
5274
|
-
/* @__PURE__ */
|
|
5275
|
-
/* @__PURE__ */
|
|
5276
|
-
subtitle && /* @__PURE__ */
|
|
5284
|
+
title && /* @__PURE__ */ jsxs48("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5285
|
+
/* @__PURE__ */ jsxs48("div", { className: "min-w-0", children: [
|
|
5286
|
+
/* @__PURE__ */ jsx54("h3", { id: titleId, className: "text-style-card-title", children: title }),
|
|
5287
|
+
subtitle && /* @__PURE__ */ jsx54("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
|
|
5277
5288
|
] }),
|
|
5278
|
-
action && /* @__PURE__ */
|
|
5289
|
+
action && /* @__PURE__ */ jsx54("div", { className: "shrink-0", children: action })
|
|
5279
5290
|
] }),
|
|
5280
|
-
/* @__PURE__ */
|
|
5291
|
+
/* @__PURE__ */ jsx54("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ jsxs48(
|
|
5281
5292
|
"table",
|
|
5282
5293
|
{
|
|
5283
5294
|
"aria-labelledby": title ? titleId : void 0,
|
|
@@ -5285,13 +5296,13 @@ function DataTable({
|
|
|
5285
5296
|
"aria-busy": loading || void 0,
|
|
5286
5297
|
className: "w-full border-collapse text-left",
|
|
5287
5298
|
children: [
|
|
5288
|
-
/* @__PURE__ */
|
|
5299
|
+
/* @__PURE__ */ jsx54("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ jsx54("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ jsx54(
|
|
5289
5300
|
"th",
|
|
5290
5301
|
{
|
|
5291
5302
|
scope: "col",
|
|
5292
5303
|
"aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
|
|
5293
5304
|
className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5294
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */
|
|
5305
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ jsx54(
|
|
5295
5306
|
SortButton,
|
|
5296
5307
|
{
|
|
5297
5308
|
label: c.label,
|
|
@@ -5305,7 +5316,7 @@ function DataTable({
|
|
|
5305
5316
|
},
|
|
5306
5317
|
c.key
|
|
5307
5318
|
)) }) }),
|
|
5308
|
-
/* @__PURE__ */
|
|
5319
|
+
/* @__PURE__ */ jsx54("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ jsx54("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ jsx54("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ jsx54(
|
|
5309
5320
|
"span",
|
|
5310
5321
|
{
|
|
5311
5322
|
className: cn(
|
|
@@ -5313,7 +5324,7 @@ function DataTable({
|
|
|
5313
5324
|
c.numeric ? "w-12" : "w-2/3"
|
|
5314
5325
|
)
|
|
5315
5326
|
}
|
|
5316
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */
|
|
5327
|
+
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ jsx54("tr", { children: /* @__PURE__ */ jsx54("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ jsx54(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ jsx54("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ jsx54(
|
|
5317
5328
|
"td",
|
|
5318
5329
|
{
|
|
5319
5330
|
className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
|
|
@@ -5324,14 +5335,14 @@ function DataTable({
|
|
|
5324
5335
|
]
|
|
5325
5336
|
}
|
|
5326
5337
|
) }),
|
|
5327
|
-
footer && /* @__PURE__ */
|
|
5338
|
+
footer && /* @__PURE__ */ jsx54("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
5328
5339
|
]
|
|
5329
5340
|
}
|
|
5330
5341
|
);
|
|
5331
5342
|
}
|
|
5332
5343
|
|
|
5333
5344
|
// src/MediaLabel.tsx
|
|
5334
|
-
import { jsx as
|
|
5345
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
5335
5346
|
var FILL = {
|
|
5336
5347
|
TV: "bg-media-tv",
|
|
5337
5348
|
CTV: "bg-media-ctv",
|
|
@@ -5342,7 +5353,7 @@ var FILL = {
|
|
|
5342
5353
|
Magazine: "bg-media-magazine"
|
|
5343
5354
|
};
|
|
5344
5355
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5345
|
-
return /* @__PURE__ */
|
|
5356
|
+
return /* @__PURE__ */ jsx55(
|
|
5346
5357
|
"span",
|
|
5347
5358
|
{
|
|
5348
5359
|
className: cn(
|
|
@@ -5358,9 +5369,9 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5358
5369
|
|
|
5359
5370
|
// src/SuggestionChip.tsx
|
|
5360
5371
|
import { forwardRef as forwardRef10 } from "react";
|
|
5361
|
-
import { jsx as
|
|
5372
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5362
5373
|
var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5363
|
-
return /* @__PURE__ */
|
|
5374
|
+
return /* @__PURE__ */ jsx56(
|
|
5364
5375
|
"button",
|
|
5365
5376
|
{
|
|
5366
5377
|
ref,
|
|
@@ -5371,7 +5382,7 @@ var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className
|
|
|
5371
5382
|
"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",
|
|
5372
5383
|
className
|
|
5373
5384
|
),
|
|
5374
|
-
children: /* @__PURE__ */
|
|
5385
|
+
children: /* @__PURE__ */ jsx56("span", { className: "truncate", children })
|
|
5375
5386
|
}
|
|
5376
5387
|
);
|
|
5377
5388
|
});
|
|
@@ -5379,10 +5390,10 @@ SuggestionChip.displayName = "SuggestionChip";
|
|
|
5379
5390
|
|
|
5380
5391
|
// src/ToggleChip.tsx
|
|
5381
5392
|
import { forwardRef as forwardRef11 } from "react";
|
|
5382
|
-
import { Check as
|
|
5383
|
-
import { jsx as
|
|
5393
|
+
import { Check as Check9 } from "lucide-react";
|
|
5394
|
+
import { jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5384
5395
|
var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5385
|
-
return /* @__PURE__ */
|
|
5396
|
+
return /* @__PURE__ */ jsxs49(
|
|
5386
5397
|
"button",
|
|
5387
5398
|
{
|
|
5388
5399
|
ref,
|
|
@@ -5400,7 +5411,7 @@ var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, childre
|
|
|
5400
5411
|
className
|
|
5401
5412
|
),
|
|
5402
5413
|
children: [
|
|
5403
|
-
selected && /* @__PURE__ */
|
|
5414
|
+
selected && /* @__PURE__ */ jsx57(Check9, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5404
5415
|
children
|
|
5405
5416
|
]
|
|
5406
5417
|
}
|
|
@@ -5410,8 +5421,8 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
5410
5421
|
|
|
5411
5422
|
// src/CopyButton.tsx
|
|
5412
5423
|
import { forwardRef as forwardRef12, useEffect as useEffect16, useRef as useRef18, useState as useState17 } from "react";
|
|
5413
|
-
import { Check as
|
|
5414
|
-
import { jsx as
|
|
5424
|
+
import { Check as Check10, Copy } from "lucide-react";
|
|
5425
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5415
5426
|
var CONFIRM_MS = 2e3;
|
|
5416
5427
|
var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5417
5428
|
const [copied, setCopied] = useState17(false);
|
|
@@ -5428,8 +5439,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5428
5439
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5429
5440
|
};
|
|
5430
5441
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5431
|
-
const icon = copied ? /* @__PURE__ */
|
|
5432
|
-
return /* @__PURE__ */
|
|
5442
|
+
const icon = copied ? /* @__PURE__ */ jsx58(Check10, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ jsx58(Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
5443
|
+
return /* @__PURE__ */ jsxs50(
|
|
5433
5444
|
Button,
|
|
5434
5445
|
{
|
|
5435
5446
|
ref,
|
|
@@ -5443,8 +5454,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5443
5454
|
className: cn(!copied && "text-text-secondary", className),
|
|
5444
5455
|
children: [
|
|
5445
5456
|
icon,
|
|
5446
|
-
label && /* @__PURE__ */
|
|
5447
|
-
/* @__PURE__ */
|
|
5457
|
+
label && /* @__PURE__ */ jsx58("span", { children: copied ? "Copied" : label }),
|
|
5458
|
+
/* @__PURE__ */ jsx58("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5448
5459
|
]
|
|
5449
5460
|
}
|
|
5450
5461
|
);
|
|
@@ -5453,7 +5464,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
5453
5464
|
|
|
5454
5465
|
// src/InlineMessage.tsx
|
|
5455
5466
|
import { AlertTriangle as AlertTriangle2, CheckCircle2, Info as Info3, X as X8, XCircle } from "lucide-react";
|
|
5456
|
-
import { jsx as
|
|
5467
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5457
5468
|
var BOX = {
|
|
5458
5469
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5459
5470
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5470,27 +5481,27 @@ var ICON_INK = {
|
|
|
5470
5481
|
var ICON2 = { info: Info3, success: CheckCircle2, warning: AlertTriangle2, danger: XCircle };
|
|
5471
5482
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5472
5483
|
const Icon = ICON2[tone];
|
|
5473
|
-
return /* @__PURE__ */
|
|
5484
|
+
return /* @__PURE__ */ jsxs51(
|
|
5474
5485
|
"div",
|
|
5475
5486
|
{
|
|
5476
5487
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5477
5488
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5478
5489
|
"data-testid": testIdPrefix,
|
|
5479
5490
|
children: [
|
|
5480
|
-
/* @__PURE__ */
|
|
5481
|
-
/* @__PURE__ */
|
|
5482
|
-
/* @__PURE__ */
|
|
5483
|
-
children && /* @__PURE__ */
|
|
5484
|
-
actions && /* @__PURE__ */
|
|
5491
|
+
/* @__PURE__ */ jsx59(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
5492
|
+
/* @__PURE__ */ jsxs51("div", { className: "min-w-0 flex-1", children: [
|
|
5493
|
+
/* @__PURE__ */ jsx59("p", { className: "font-semibold text-text-primary", children: title }),
|
|
5494
|
+
children && /* @__PURE__ */ jsx59("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
5495
|
+
actions && /* @__PURE__ */ jsx59("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
5485
5496
|
] }),
|
|
5486
|
-
onDismiss && /* @__PURE__ */
|
|
5497
|
+
onDismiss && /* @__PURE__ */ jsx59(
|
|
5487
5498
|
"button",
|
|
5488
5499
|
{
|
|
5489
5500
|
type: "button",
|
|
5490
5501
|
onClick: onDismiss,
|
|
5491
5502
|
"aria-label": "Dismiss",
|
|
5492
5503
|
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",
|
|
5493
|
-
children: /* @__PURE__ */
|
|
5504
|
+
children: /* @__PURE__ */ jsx59(X8, { size: 14, "aria-hidden": "true" })
|
|
5494
5505
|
}
|
|
5495
5506
|
)
|
|
5496
5507
|
]
|
|
@@ -5501,7 +5512,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5501
5512
|
// src/FilterDrawer.tsx
|
|
5502
5513
|
import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect6, useRef as useRef19, useState as useState18 } from "react";
|
|
5503
5514
|
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight6 } from "lucide-react";
|
|
5504
|
-
import { jsx as
|
|
5515
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5505
5516
|
var SLIDE_MS = 200;
|
|
5506
5517
|
function reducedMotion() {
|
|
5507
5518
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5563,8 +5574,8 @@ function FilterDrawer({
|
|
|
5563
5574
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5564
5575
|
const panel = (v, rows = true) => {
|
|
5565
5576
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5566
|
-
if (s) return /* @__PURE__ */
|
|
5567
|
-
return /* @__PURE__ */
|
|
5577
|
+
if (s) return /* @__PURE__ */ jsx60("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
5578
|
+
return /* @__PURE__ */ jsx60("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ jsx60("li", { className: "border-b border-border-default", children: /* @__PURE__ */ jsxs52(
|
|
5568
5579
|
"button",
|
|
5569
5580
|
{
|
|
5570
5581
|
ref: rows ? (el) => {
|
|
@@ -5576,7 +5587,7 @@ function FilterDrawer({
|
|
|
5576
5587
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5577
5588
|
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",
|
|
5578
5589
|
children: [
|
|
5579
|
-
/* @__PURE__ */
|
|
5590
|
+
/* @__PURE__ */ jsx60(
|
|
5580
5591
|
x.icon,
|
|
5581
5592
|
{
|
|
5582
5593
|
size: 17,
|
|
@@ -5584,22 +5595,22 @@ function FilterDrawer({
|
|
|
5584
5595
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5585
5596
|
}
|
|
5586
5597
|
),
|
|
5587
|
-
/* @__PURE__ */
|
|
5588
|
-
x.badge && /* @__PURE__ */
|
|
5589
|
-
/* @__PURE__ */
|
|
5598
|
+
/* @__PURE__ */ jsx60("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
5599
|
+
x.badge && /* @__PURE__ */ jsx60(Badge, { tone: "brand", children: x.badge }),
|
|
5600
|
+
/* @__PURE__ */ jsx60(ChevronRight6, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5590
5601
|
]
|
|
5591
5602
|
}
|
|
5592
5603
|
) }, x.id)) });
|
|
5593
5604
|
};
|
|
5594
|
-
return /* @__PURE__ */
|
|
5605
|
+
return /* @__PURE__ */ jsx60(
|
|
5595
5606
|
Drawer,
|
|
5596
5607
|
{
|
|
5597
5608
|
open,
|
|
5598
5609
|
onClose,
|
|
5599
5610
|
size,
|
|
5600
5611
|
testIdPrefix,
|
|
5601
|
-
title: focused ? /* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
5612
|
+
title: focused ? /* @__PURE__ */ jsxs52("span", { className: "flex items-center gap-1.5", children: [
|
|
5613
|
+
/* @__PURE__ */ jsx60(
|
|
5603
5614
|
"button",
|
|
5604
5615
|
{
|
|
5605
5616
|
ref: backRef,
|
|
@@ -5608,23 +5619,23 @@ function FilterDrawer({
|
|
|
5608
5619
|
"aria-label": "Back to all filters",
|
|
5609
5620
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5610
5621
|
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",
|
|
5611
|
-
children: /* @__PURE__ */
|
|
5622
|
+
children: /* @__PURE__ */ jsx60(ChevronLeft5, { size: 18, "aria-hidden": "true" })
|
|
5612
5623
|
}
|
|
5613
5624
|
),
|
|
5614
5625
|
focused.label,
|
|
5615
|
-
focused.info && /* @__PURE__ */
|
|
5616
|
-
] }) : /* @__PURE__ */
|
|
5626
|
+
focused.info && /* @__PURE__ */ jsx60(InfoTip, { text: focused.info, label: `About ${focused.label}` })
|
|
5627
|
+
] }) : /* @__PURE__ */ jsxs52("span", { className: "flex items-center gap-2.5", children: [
|
|
5617
5628
|
"Filters",
|
|
5618
|
-
activeCount > 0 && /* @__PURE__ */
|
|
5629
|
+
activeCount > 0 && /* @__PURE__ */ jsx60(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5619
5630
|
] }),
|
|
5620
5631
|
footer: focused ? (
|
|
5621
5632
|
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5622
|
-
/* @__PURE__ */
|
|
5623
|
-
) : /* @__PURE__ */
|
|
5624
|
-
/* @__PURE__ */
|
|
5625
|
-
/* @__PURE__ */
|
|
5626
|
-
/* @__PURE__ */
|
|
5627
|
-
/* @__PURE__ */
|
|
5633
|
+
/* @__PURE__ */ jsx60("div", { className: "flex w-full items-center", children: /* @__PURE__ */ jsx60(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
|
|
5634
|
+
) : /* @__PURE__ */ jsxs52("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
5635
|
+
/* @__PURE__ */ jsx60(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
5636
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-2", children: [
|
|
5637
|
+
/* @__PURE__ */ jsx60(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
5638
|
+
/* @__PURE__ */ jsx60(
|
|
5628
5639
|
Button,
|
|
5629
5640
|
{
|
|
5630
5641
|
variant: "primary",
|
|
@@ -5638,8 +5649,8 @@ function FilterDrawer({
|
|
|
5638
5649
|
)
|
|
5639
5650
|
] })
|
|
5640
5651
|
] }),
|
|
5641
|
-
children: /* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5652
|
+
children: /* @__PURE__ */ jsxs52("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
5653
|
+
/* @__PURE__ */ jsx60(
|
|
5643
5654
|
"div",
|
|
5644
5655
|
{
|
|
5645
5656
|
style: { transform: incoming },
|
|
@@ -5648,7 +5659,7 @@ function FilterDrawer({
|
|
|
5648
5659
|
},
|
|
5649
5660
|
view ?? "__list"
|
|
5650
5661
|
),
|
|
5651
|
-
leaving && /* @__PURE__ */
|
|
5662
|
+
leaving && /* @__PURE__ */ jsx60(
|
|
5652
5663
|
"div",
|
|
5653
5664
|
{
|
|
5654
5665
|
"aria-hidden": "true",
|
|
@@ -5666,9 +5677,9 @@ function FilterDrawer({
|
|
|
5666
5677
|
// src/AllFiltersButton.tsx
|
|
5667
5678
|
import { forwardRef as forwardRef13 } from "react";
|
|
5668
5679
|
import { SlidersHorizontal } from "lucide-react";
|
|
5669
|
-
import { jsx as
|
|
5680
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5670
5681
|
var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5671
|
-
return /* @__PURE__ */
|
|
5682
|
+
return /* @__PURE__ */ jsxs53(
|
|
5672
5683
|
"button",
|
|
5673
5684
|
{
|
|
5674
5685
|
ref,
|
|
@@ -5680,9 +5691,9 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5680
5691
|
className: cn(chipTriggerClass(), className),
|
|
5681
5692
|
...rest,
|
|
5682
5693
|
children: [
|
|
5683
|
-
/* @__PURE__ */
|
|
5684
|
-
/* @__PURE__ */
|
|
5685
|
-
count > 0 && /* @__PURE__ */
|
|
5694
|
+
/* @__PURE__ */ jsx61(SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
5695
|
+
/* @__PURE__ */ jsx61("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
5696
|
+
count > 0 && /* @__PURE__ */ jsx61(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
5686
5697
|
]
|
|
5687
5698
|
}
|
|
5688
5699
|
);
|
|
@@ -5691,8 +5702,8 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5691
5702
|
// src/Menu.tsx
|
|
5692
5703
|
import { forwardRef as forwardRef14 } from "react";
|
|
5693
5704
|
import { Slot as Slot2, Slottable } from "@radix-ui/react-slot";
|
|
5694
|
-
import { Check as
|
|
5695
|
-
import { Fragment as Fragment6, jsx as
|
|
5705
|
+
import { Check as Check11, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
5706
|
+
import { Fragment as Fragment6, jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5696
5707
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5697
5708
|
function moveFocus(e) {
|
|
5698
5709
|
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -5705,7 +5716,7 @@ function moveFocus(e) {
|
|
|
5705
5716
|
rows[next].focus();
|
|
5706
5717
|
}
|
|
5707
5718
|
var Menu = forwardRef14(
|
|
5708
|
-
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */
|
|
5719
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ jsx62(
|
|
5709
5720
|
"div",
|
|
5710
5721
|
{
|
|
5711
5722
|
ref,
|
|
@@ -5726,20 +5737,20 @@ var MenuItem = forwardRef14(
|
|
|
5726
5737
|
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5727
5738
|
const Comp = asChild ? Slot2 : "button";
|
|
5728
5739
|
const radio = checked !== void 0;
|
|
5729
|
-
const body = /* @__PURE__ */
|
|
5730
|
-
icon && /* @__PURE__ */
|
|
5740
|
+
const body = /* @__PURE__ */ jsxs54(Fragment6, { children: [
|
|
5741
|
+
icon && /* @__PURE__ */ jsx62("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
5731
5742
|
asChild ? (
|
|
5732
5743
|
// The link's own text lands here; the link becomes the row.
|
|
5733
|
-
/* @__PURE__ */
|
|
5734
|
-
) : /* @__PURE__ */
|
|
5735
|
-
/* @__PURE__ */
|
|
5736
|
-
description && /* @__PURE__ */
|
|
5744
|
+
/* @__PURE__ */ jsx62(Slottable, { children })
|
|
5745
|
+
) : /* @__PURE__ */ jsxs54("span", { className: "min-w-0 flex-1", children: [
|
|
5746
|
+
/* @__PURE__ */ jsx62("span", { className: "block truncate", children }),
|
|
5747
|
+
description && /* @__PURE__ */ jsx62("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5737
5748
|
] }),
|
|
5738
|
-
trailing && /* @__PURE__ */
|
|
5739
|
-
radio && checked && /* @__PURE__ */
|
|
5740
|
-
submenu && /* @__PURE__ */
|
|
5749
|
+
trailing && /* @__PURE__ */ jsx62("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
5750
|
+
radio && checked && /* @__PURE__ */ jsx62(Check11, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
5751
|
+
submenu && /* @__PURE__ */ jsx62(ChevronRight7, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5741
5752
|
] });
|
|
5742
|
-
return /* @__PURE__ */
|
|
5753
|
+
return /* @__PURE__ */ jsx62(
|
|
5743
5754
|
Comp,
|
|
5744
5755
|
{
|
|
5745
5756
|
ref,
|
|
@@ -5766,7 +5777,7 @@ var MenuItem = forwardRef14(
|
|
|
5766
5777
|
);
|
|
5767
5778
|
MenuItem.displayName = "MenuItem";
|
|
5768
5779
|
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5769
|
-
return /* @__PURE__ */
|
|
5780
|
+
return /* @__PURE__ */ jsx62(
|
|
5770
5781
|
"div",
|
|
5771
5782
|
{
|
|
5772
5783
|
role: "presentation",
|
|
@@ -5777,7 +5788,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
|
|
|
5777
5788
|
);
|
|
5778
5789
|
}
|
|
5779
5790
|
function MenuSeparator({ className, testIdPrefix }) {
|
|
5780
|
-
return /* @__PURE__ */
|
|
5791
|
+
return /* @__PURE__ */ jsx62("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5781
5792
|
}
|
|
5782
5793
|
export {
|
|
5783
5794
|
AISpark,
|
|
@@ -5826,6 +5837,7 @@ export {
|
|
|
5826
5837
|
PageHeader,
|
|
5827
5838
|
Pager,
|
|
5828
5839
|
PieChartPlaceholder,
|
|
5840
|
+
PrimaryBadge,
|
|
5829
5841
|
PublisherBreakdownList,
|
|
5830
5842
|
QUIET_ACTION_CLASS,
|
|
5831
5843
|
SearchBar,
|