@mediaradar/design-components 0.54.1 → 0.56.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 +704 -689
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -2
- package/dist/index.d.ts +48 -2
- package/dist/index.js +675 -661
- 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",
|
|
@@ -1999,10 +2010,12 @@ function SelectFilter({
|
|
|
1999
2010
|
onRetry,
|
|
2000
2011
|
size = "md",
|
|
2001
2012
|
inlineCaption = false,
|
|
2013
|
+
hideCaption = false,
|
|
2002
2014
|
disabled = false,
|
|
2003
2015
|
renderIcon
|
|
2004
2016
|
}) {
|
|
2005
2017
|
const sm = size === "sm";
|
|
2018
|
+
const bare = !sm && hideCaption;
|
|
2006
2019
|
const [open, setOpen] = useState6(false);
|
|
2007
2020
|
const [pos, setPos] = useState6(null);
|
|
2008
2021
|
const ref = useRef7(null);
|
|
@@ -2042,20 +2055,20 @@ function SelectFilter({
|
|
|
2042
2055
|
window.removeEventListener("scroll", reposition, true);
|
|
2043
2056
|
};
|
|
2044
2057
|
}, [open, close, reposition]);
|
|
2045
|
-
const valueContent = renderIcon ? /* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2058
|
+
const valueContent = renderIcon ? /* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-1.5", children: [
|
|
2059
|
+
/* @__PURE__ */ jsx14(OptionIcon, { children: renderIcon(value) }),
|
|
2047
2060
|
value
|
|
2048
2061
|
] }) : value;
|
|
2049
|
-
const triggerValue = sm && inlineCaption ? /* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2062
|
+
const triggerValue = sm && inlineCaption ? /* @__PURE__ */ jsxs13("span", { children: [
|
|
2063
|
+
/* @__PURE__ */ jsxs13("span", { className: "font-normal text-text-secondary", children: [
|
|
2051
2064
|
caption,
|
|
2052
2065
|
":"
|
|
2053
2066
|
] }),
|
|
2054
2067
|
" ",
|
|
2055
2068
|
valueContent
|
|
2056
2069
|
] }) : valueContent;
|
|
2057
|
-
return /* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2070
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("relative", fullWidth && "w-full"), ref, "data-testid": testIdPrefix, children: [
|
|
2071
|
+
/* @__PURE__ */ jsxs13(
|
|
2059
2072
|
"button",
|
|
2060
2073
|
{
|
|
2061
2074
|
type: "button",
|
|
@@ -2063,17 +2076,17 @@ function SelectFilter({
|
|
|
2063
2076
|
onClick: () => setOpen((o) => !o),
|
|
2064
2077
|
"aria-expanded": open,
|
|
2065
2078
|
"aria-haspopup": "listbox",
|
|
2066
|
-
"aria-label": sm && !inlineCaption ? caption : void 0,
|
|
2079
|
+
"aria-label": sm && !inlineCaption || bare ? caption : void 0,
|
|
2067
2080
|
disabled,
|
|
2068
2081
|
className: cn(
|
|
2069
|
-
sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus" : chipTriggerClass(),
|
|
2082
|
+
sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus" : bare ? "flex h-10 items-center gap-2 rounded-control border border-border-strong bg-input pl-3 pr-2.5 text-sm font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus" : chipTriggerClass(),
|
|
2070
2083
|
"disabled:pointer-events-none disabled:opacity-40",
|
|
2071
2084
|
fullWidth && "w-full justify-between",
|
|
2072
2085
|
className
|
|
2073
2086
|
),
|
|
2074
2087
|
children: [
|
|
2075
|
-
sm ? triggerValue : /* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2088
|
+
sm || bare ? triggerValue : /* @__PURE__ */ jsx14(ChipContent, { caption, value: triggerValue }),
|
|
2089
|
+
/* @__PURE__ */ jsx14(
|
|
2077
2090
|
ChevronDown5,
|
|
2078
2091
|
{
|
|
2079
2092
|
size: 14,
|
|
@@ -2085,7 +2098,7 @@ function SelectFilter({
|
|
|
2085
2098
|
}
|
|
2086
2099
|
),
|
|
2087
2100
|
open && pos && createPortal2(
|
|
2088
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ jsx14(
|
|
2089
2102
|
"div",
|
|
2090
2103
|
{
|
|
2091
2104
|
ref: popoverRef,
|
|
@@ -2097,9 +2110,9 @@ function SelectFilter({
|
|
|
2097
2110
|
),
|
|
2098
2111
|
role: loading || error ? "group" : "listbox",
|
|
2099
2112
|
"aria-label": caption,
|
|
2100
|
-
children: loading ? /* @__PURE__ */
|
|
2113
|
+
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
2114
|
const selected = o === value;
|
|
2102
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsxs13(
|
|
2103
2116
|
"button",
|
|
2104
2117
|
{
|
|
2105
2118
|
type: "button",
|
|
@@ -2112,9 +2125,9 @@ function SelectFilter({
|
|
|
2112
2125
|
},
|
|
2113
2126
|
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
2127
|
children: [
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
renderIcon && /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__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 }) }),
|
|
2129
|
+
renderIcon && /* @__PURE__ */ jsx14(OptionIcon, { children: renderIcon(o) }),
|
|
2130
|
+
/* @__PURE__ */ jsx14(
|
|
2118
2131
|
"span",
|
|
2119
2132
|
{
|
|
2120
2133
|
className: cn("flex-1 text-sm", selected ? "font-semibold text-text-primary" : "text-text-primary"),
|
|
@@ -2135,10 +2148,10 @@ function SelectFilter({
|
|
|
2135
2148
|
|
|
2136
2149
|
// src/Card.tsx
|
|
2137
2150
|
import { forwardRef as forwardRef3 } from "react";
|
|
2138
|
-
import { jsx as
|
|
2151
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2139
2152
|
var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, info, variant = "default", action, className, testIdPrefix, children, ...rest }, ref) {
|
|
2140
2153
|
const chart = variant === "chart";
|
|
2141
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ jsx15(
|
|
2142
2155
|
"article",
|
|
2143
2156
|
{
|
|
2144
2157
|
ref,
|
|
@@ -2151,18 +2164,18 @@ var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "
|
|
|
2151
2164
|
),
|
|
2152
2165
|
"data-testid": testIdPrefix,
|
|
2153
2166
|
...rest,
|
|
2154
|
-
children: title ? /* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
info && /* @__PURE__ */
|
|
2167
|
+
children: title ? /* @__PURE__ */ jsxs14("div", { className: "flex flex-1 flex-col p-card-padding", children: [
|
|
2168
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2169
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
2170
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5", children: [
|
|
2171
|
+
/* @__PURE__ */ jsx15(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
|
|
2172
|
+
info && /* @__PURE__ */ jsx15(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
|
|
2160
2173
|
] }),
|
|
2161
|
-
subtitle && /* @__PURE__ */
|
|
2174
|
+
subtitle && /* @__PURE__ */ jsx15("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
2162
2175
|
] }),
|
|
2163
|
-
action && /* @__PURE__ */
|
|
2176
|
+
action && /* @__PURE__ */ jsx15("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
2164
2177
|
] }),
|
|
2165
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-4 flex flex-1 flex-col", children })
|
|
2166
2179
|
] }) : children
|
|
2167
2180
|
}
|
|
2168
2181
|
);
|
|
@@ -2170,9 +2183,9 @@ var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "
|
|
|
2170
2183
|
|
|
2171
2184
|
// src/StatStrip.tsx
|
|
2172
2185
|
import { forwardRef as forwardRef4 } from "react";
|
|
2173
|
-
import { jsx as
|
|
2186
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2174
2187
|
var StatStrip = forwardRef4(
|
|
2175
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */
|
|
2188
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
2176
2189
|
"div",
|
|
2177
2190
|
{
|
|
2178
2191
|
ref,
|
|
@@ -2190,32 +2203,32 @@ var StatStrip = forwardRef4(
|
|
|
2190
2203
|
);
|
|
2191
2204
|
StatStrip.displayName = "StatStrip";
|
|
2192
2205
|
function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
icon && /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ jsxs15("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
|
|
2207
|
+
/* @__PURE__ */ jsxs15("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
|
|
2208
|
+
icon && /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
|
|
2196
2209
|
label,
|
|
2197
|
-
info && /* @__PURE__ */
|
|
2210
|
+
info && /* @__PURE__ */ jsx16(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
|
|
2198
2211
|
] }),
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2212
|
+
/* @__PURE__ */ jsxs15("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
|
|
2213
|
+
/* @__PURE__ */ jsxs15("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
|
|
2201
2214
|
value,
|
|
2202
|
-
unit && /* @__PURE__ */
|
|
2215
|
+
unit && /* @__PURE__ */ jsxs15("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
|
|
2203
2216
|
" ",
|
|
2204
2217
|
unit
|
|
2205
2218
|
] })
|
|
2206
2219
|
] }),
|
|
2207
|
-
change && /* @__PURE__ */
|
|
2220
|
+
change && /* @__PURE__ */ jsx16("span", { className: "text-card-title font-medium", children: change })
|
|
2208
2221
|
] }),
|
|
2209
|
-
note && /* @__PURE__ */
|
|
2210
|
-
children && /* @__PURE__ */
|
|
2222
|
+
note && /* @__PURE__ */ jsx16("span", { className: "text-xs text-text-tertiary", children: note }),
|
|
2223
|
+
children && /* @__PURE__ */ jsx16("div", { className: "text-xs text-text-secondary", children })
|
|
2211
2224
|
] });
|
|
2212
2225
|
}
|
|
2213
2226
|
|
|
2214
2227
|
// src/ChartLegend.tsx
|
|
2215
2228
|
import { forwardRef as forwardRef5 } from "react";
|
|
2216
|
-
import { jsx as
|
|
2229
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2217
2230
|
var ChartLegend = forwardRef5(
|
|
2218
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */
|
|
2231
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2219
2232
|
"ul",
|
|
2220
2233
|
{
|
|
2221
2234
|
ref,
|
|
@@ -2235,8 +2248,8 @@ var MARK = {
|
|
|
2235
2248
|
};
|
|
2236
2249
|
function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
|
|
2237
2250
|
const dashed = mark === "dashed";
|
|
2238
|
-
return /* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsxs16("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
|
|
2252
|
+
/* @__PURE__ */ jsx17(
|
|
2240
2253
|
"span",
|
|
2241
2254
|
{
|
|
2242
2255
|
"aria-hidden": "true",
|
|
@@ -2250,7 +2263,7 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2250
2263
|
style: color ? dashed ? { borderColor: color } : { background: color } : void 0
|
|
2251
2264
|
}
|
|
2252
2265
|
),
|
|
2253
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
2254
2267
|
children,
|
|
2255
2268
|
you && " (you)"
|
|
2256
2269
|
] })
|
|
@@ -2258,30 +2271,30 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2258
2271
|
}
|
|
2259
2272
|
|
|
2260
2273
|
// src/BarList.tsx
|
|
2261
|
-
import { jsx as
|
|
2274
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2262
2275
|
var COL_WIDTH = ["w-16", "w-13"];
|
|
2263
2276
|
function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
|
|
2264
2277
|
if (!rows.length) {
|
|
2265
|
-
return empty ? /* @__PURE__ */
|
|
2278
|
+
return empty ? /* @__PURE__ */ jsx18("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
|
|
2266
2279
|
}
|
|
2267
2280
|
const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
|
|
2268
2281
|
const full = !!columns?.length;
|
|
2269
2282
|
const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
|
|
2270
|
-
return /* @__PURE__ */
|
|
2271
|
-
full && /* @__PURE__ */
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
columns.map((c, i) => /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ jsxs17("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
|
|
2284
|
+
full && /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
|
|
2285
|
+
/* @__PURE__ */ jsx18("span", { className: "flex-1" }),
|
|
2286
|
+
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
2287
|
] }),
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
/* @__PURE__ */
|
|
2277
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ jsx18("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ jsxs17("li", { className: "py-2", children: [
|
|
2289
|
+
/* @__PURE__ */ jsxs17("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
2290
|
+
/* @__PURE__ */ jsxs17("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
|
|
2278
2291
|
r.label,
|
|
2279
|
-
r.note && /* @__PURE__ */
|
|
2292
|
+
r.note && /* @__PURE__ */ jsxs17("span", { className: "font-normal text-text-tertiary", children: [
|
|
2280
2293
|
" \xB7 ",
|
|
2281
2294
|
r.note
|
|
2282
2295
|
] })
|
|
2283
2296
|
] }),
|
|
2284
|
-
r.values?.map((v, i) => /* @__PURE__ */
|
|
2297
|
+
r.values?.map((v, i) => /* @__PURE__ */ jsxs17(
|
|
2285
2298
|
"span",
|
|
2286
2299
|
{
|
|
2287
2300
|
className: cn(
|
|
@@ -2290,7 +2303,7 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2290
2303
|
colClass(i)
|
|
2291
2304
|
),
|
|
2292
2305
|
children: [
|
|
2293
|
-
full && /* @__PURE__ */
|
|
2306
|
+
full && /* @__PURE__ */ jsxs17("span", { className: "sr-only", children: [
|
|
2294
2307
|
columns[i],
|
|
2295
2308
|
": "
|
|
2296
2309
|
] }),
|
|
@@ -2300,15 +2313,15 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2300
2313
|
i
|
|
2301
2314
|
))
|
|
2302
2315
|
] }),
|
|
2303
|
-
/* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
|
|
2317
|
+
/* @__PURE__ */ jsx18(
|
|
2305
2318
|
"div",
|
|
2306
2319
|
{
|
|
2307
2320
|
className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
|
|
2308
2321
|
style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
|
|
2309
2322
|
}
|
|
2310
2323
|
),
|
|
2311
|
-
r.tick !== void 0 && /* @__PURE__ */
|
|
2324
|
+
r.tick !== void 0 && /* @__PURE__ */ jsx18(
|
|
2312
2325
|
"span",
|
|
2313
2326
|
{
|
|
2314
2327
|
className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
|
|
@@ -2316,14 +2329,14 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2316
2329
|
}
|
|
2317
2330
|
)
|
|
2318
2331
|
] }),
|
|
2319
|
-
r.tickLabel && /* @__PURE__ */
|
|
2332
|
+
r.tickLabel && /* @__PURE__ */ jsx18("span", { className: "sr-only", children: r.tickLabel })
|
|
2320
2333
|
] }, r.key)) })
|
|
2321
2334
|
] });
|
|
2322
2335
|
}
|
|
2323
2336
|
|
|
2324
2337
|
// src/NoResultsEmptyState.tsx
|
|
2325
2338
|
import { FilterX } from "lucide-react";
|
|
2326
|
-
import { jsx as
|
|
2339
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2327
2340
|
var NO_RESULTS_TITLE = "No results match your filters";
|
|
2328
2341
|
var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
|
|
2329
2342
|
function noResultsBody(workspaceName) {
|
|
@@ -2346,12 +2359,12 @@ function NoResultsEmptyState({
|
|
|
2346
2359
|
const showClear = hasFilters !== false && Boolean(onClearFilters);
|
|
2347
2360
|
const showEdit = Boolean(onEditFilters);
|
|
2348
2361
|
const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
|
|
2349
|
-
return /* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
hasActions && /* @__PURE__ */
|
|
2354
|
-
showClear && /* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2363
|
+
/* @__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" }) }),
|
|
2364
|
+
/* @__PURE__ */ jsx19("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2365
|
+
/* @__PURE__ */ jsx19("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2366
|
+
hasActions && /* @__PURE__ */ jsxs18("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2367
|
+
showClear && /* @__PURE__ */ jsx19(
|
|
2355
2368
|
"button",
|
|
2356
2369
|
{
|
|
2357
2370
|
type: "button",
|
|
@@ -2361,7 +2374,7 @@ function NoResultsEmptyState({
|
|
|
2361
2374
|
children: "Clear all filters"
|
|
2362
2375
|
}
|
|
2363
2376
|
),
|
|
2364
|
-
showEdit && /* @__PURE__ */
|
|
2377
|
+
showEdit && /* @__PURE__ */ jsx19(
|
|
2365
2378
|
"button",
|
|
2366
2379
|
{
|
|
2367
2380
|
type: "button",
|
|
@@ -2371,7 +2384,7 @@ function NoResultsEmptyState({
|
|
|
2371
2384
|
children: "Edit filters"
|
|
2372
2385
|
}
|
|
2373
2386
|
),
|
|
2374
|
-
actions?.map((action, i) => /* @__PURE__ */
|
|
2387
|
+
actions?.map((action, i) => /* @__PURE__ */ jsx19(
|
|
2375
2388
|
"button",
|
|
2376
2389
|
{
|
|
2377
2390
|
type: "button",
|
|
@@ -2388,9 +2401,9 @@ function NoResultsEmptyState({
|
|
|
2388
2401
|
// src/WorkspaceSelectedCard.tsx
|
|
2389
2402
|
import { useEffect as useEffect7, useRef as useRef8, useState as useState7 } from "react";
|
|
2390
2403
|
import { ChevronDown as ChevronDown6, X as X3 } from "lucide-react";
|
|
2391
|
-
import { jsx as
|
|
2404
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2392
2405
|
function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
2393
|
-
return /* @__PURE__ */
|
|
2406
|
+
return /* @__PURE__ */ jsx20(
|
|
2394
2407
|
"aside",
|
|
2395
2408
|
{
|
|
2396
2409
|
className: cn(
|
|
@@ -2398,7 +2411,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
|
2398
2411
|
className
|
|
2399
2412
|
),
|
|
2400
2413
|
"data-testid": testIdPrefix,
|
|
2401
|
-
children: /* @__PURE__ */
|
|
2414
|
+
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
2415
|
}
|
|
2403
2416
|
);
|
|
2404
2417
|
}
|
|
@@ -2417,8 +2430,8 @@ function SummaryGroupItem({
|
|
|
2417
2430
|
else if (expandCount === 0) setOpen(false);
|
|
2418
2431
|
wasEmpty.current = expandCount === 0;
|
|
2419
2432
|
}, [expandCount]);
|
|
2420
|
-
return /* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ jsxs19("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
|
|
2434
|
+
/* @__PURE__ */ jsxs19(
|
|
2422
2435
|
"button",
|
|
2423
2436
|
{
|
|
2424
2437
|
type: "button",
|
|
@@ -2427,7 +2440,7 @@ function SummaryGroupItem({
|
|
|
2427
2440
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2428
2441
|
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
2442
|
children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ jsx20(
|
|
2431
2444
|
ChevronDown6,
|
|
2432
2445
|
{
|
|
2433
2446
|
size: 14,
|
|
@@ -2435,37 +2448,37 @@ function SummaryGroupItem({
|
|
|
2435
2448
|
className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
|
|
2436
2449
|
}
|
|
2437
2450
|
),
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ jsx20("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
|
|
2452
|
+
/* @__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
2453
|
]
|
|
2441
2454
|
}
|
|
2442
2455
|
),
|
|
2443
|
-
open && /* @__PURE__ */
|
|
2444
|
-
ownCount > 0 && /* @__PURE__ */
|
|
2445
|
-
group.items.map((item) => /* @__PURE__ */
|
|
2456
|
+
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: [
|
|
2457
|
+
ownCount > 0 && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1.5", children: [
|
|
2458
|
+
group.items.map((item) => /* @__PURE__ */ jsxs19(
|
|
2446
2459
|
"div",
|
|
2447
2460
|
{
|
|
2448
2461
|
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
2449
2462
|
children: [
|
|
2450
|
-
/* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
item.meta && /* @__PURE__ */
|
|
2463
|
+
/* @__PURE__ */ jsxs19("span", { className: "min-w-0 flex-1", children: [
|
|
2464
|
+
/* @__PURE__ */ jsx20("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
|
|
2465
|
+
item.meta && /* @__PURE__ */ jsx20("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
|
|
2453
2466
|
] }),
|
|
2454
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsx20(
|
|
2455
2468
|
"button",
|
|
2456
2469
|
{
|
|
2457
2470
|
type: "button",
|
|
2458
2471
|
"aria-label": `Remove ${item.name}`,
|
|
2459
2472
|
onClick: () => group.onRemove(item.id),
|
|
2460
2473
|
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__ */
|
|
2474
|
+
children: /* @__PURE__ */ jsx20(X3, { size: 12, "aria-hidden": "true" })
|
|
2462
2475
|
}
|
|
2463
2476
|
)
|
|
2464
2477
|
]
|
|
2465
2478
|
},
|
|
2466
2479
|
item.id
|
|
2467
2480
|
)),
|
|
2468
|
-
/* @__PURE__ */
|
|
2481
|
+
/* @__PURE__ */ jsx20(
|
|
2469
2482
|
"button",
|
|
2470
2483
|
{
|
|
2471
2484
|
type: "button",
|
|
@@ -2476,13 +2489,13 @@ function SummaryGroupItem({
|
|
|
2476
2489
|
}
|
|
2477
2490
|
)
|
|
2478
2491
|
] }),
|
|
2479
|
-
group.subGroups?.map((sg) => /* @__PURE__ */
|
|
2492
|
+
group.subGroups?.map((sg) => /* @__PURE__ */ jsx20(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
|
|
2480
2493
|
] }) })
|
|
2481
2494
|
] });
|
|
2482
2495
|
}
|
|
2483
2496
|
|
|
2484
2497
|
// src/chart-placeholder-shared.tsx
|
|
2485
|
-
import { jsx as
|
|
2498
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2486
2499
|
var GRID_ROWS = [0, 25, 50, 75, 100];
|
|
2487
2500
|
var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
|
|
2488
2501
|
var Y_AXIS_W = 48;
|
|
@@ -2496,9 +2509,9 @@ function AxisFrame({
|
|
|
2496
2509
|
testIdPrefix
|
|
2497
2510
|
}) {
|
|
2498
2511
|
const gutter = xTicks > 0 ? X_AXIS_H : 0;
|
|
2499
|
-
return /* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
GRID_ROWS.map((pct) => /* @__PURE__ */
|
|
2512
|
+
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: [
|
|
2513
|
+
/* @__PURE__ */ jsxs20("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
|
|
2514
|
+
GRID_ROWS.map((pct) => /* @__PURE__ */ jsx21(
|
|
2502
2515
|
"div",
|
|
2503
2516
|
{
|
|
2504
2517
|
className: "absolute inset-x-0 border-t border-dashed",
|
|
@@ -2506,9 +2519,9 @@ function AxisFrame({
|
|
|
2506
2519
|
},
|
|
2507
2520
|
pct
|
|
2508
2521
|
)),
|
|
2509
|
-
/* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ jsx21("div", { className: "absolute inset-0", children })
|
|
2510
2523
|
] }),
|
|
2511
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__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
2525
|
"div",
|
|
2513
2526
|
{
|
|
2514
2527
|
className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
|
|
@@ -2516,27 +2529,27 @@ function AxisFrame({
|
|
|
2516
2529
|
},
|
|
2517
2530
|
pct
|
|
2518
2531
|
)) }),
|
|
2519
|
-
xTicks > 0 && /* @__PURE__ */
|
|
2532
|
+
xTicks > 0 && /* @__PURE__ */ jsx21(
|
|
2520
2533
|
"div",
|
|
2521
2534
|
{
|
|
2522
2535
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2523
2536
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2524
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */
|
|
2537
|
+
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
2538
|
}
|
|
2526
2539
|
)
|
|
2527
2540
|
] }) });
|
|
2528
2541
|
}
|
|
2529
2542
|
function BlankLegend({ rows, reverse = false }) {
|
|
2530
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ jsx21(
|
|
2531
2544
|
"ul",
|
|
2532
2545
|
{
|
|
2533
2546
|
className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
|
|
2534
2547
|
role: "presentation",
|
|
2535
2548
|
"aria-hidden": "true",
|
|
2536
|
-
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2549
|
+
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs20("li", { className: "flex items-center justify-between gap-2", children: [
|
|
2550
|
+
/* @__PURE__ */ jsxs20("span", { className: "flex items-center gap-1.5", children: [
|
|
2551
|
+
/* @__PURE__ */ jsx21("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
|
|
2552
|
+
/* @__PURE__ */ jsx21(
|
|
2540
2553
|
"span",
|
|
2541
2554
|
{
|
|
2542
2555
|
className: "h-2 rounded-xs bg-subtle",
|
|
@@ -2544,21 +2557,21 @@ function BlankLegend({ rows, reverse = false }) {
|
|
|
2544
2557
|
}
|
|
2545
2558
|
)
|
|
2546
2559
|
] }),
|
|
2547
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ jsx21("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
|
|
2548
2561
|
] }, i))
|
|
2549
2562
|
}
|
|
2550
2563
|
);
|
|
2551
2564
|
}
|
|
2552
2565
|
|
|
2553
2566
|
// src/BarChartPlaceholder.tsx
|
|
2554
|
-
import { jsx as
|
|
2567
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2555
2568
|
var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
|
|
2556
2569
|
function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
|
|
2557
|
-
return /* @__PURE__ */
|
|
2570
|
+
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
2571
|
}
|
|
2559
2572
|
|
|
2560
2573
|
// src/LineChartPlaceholder.tsx
|
|
2561
|
-
import { jsx as
|
|
2574
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2562
2575
|
var LINE_SERIES = [
|
|
2563
2576
|
[58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
|
|
2564
2577
|
[74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
|
|
@@ -2568,9 +2581,9 @@ var LINE_SERIES = [
|
|
|
2568
2581
|
var LINE_FORECAST_FROM = 7;
|
|
2569
2582
|
function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
2570
2583
|
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__ */
|
|
2584
|
+
return /* @__PURE__ */ jsxs21(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
|
|
2585
|
+
/* @__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: [
|
|
2586
|
+
/* @__PURE__ */ jsx23(
|
|
2574
2587
|
"polyline",
|
|
2575
2588
|
{
|
|
2576
2589
|
points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
|
|
@@ -2582,7 +2595,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2582
2595
|
strokeLinejoin: "round"
|
|
2583
2596
|
}
|
|
2584
2597
|
),
|
|
2585
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ jsx23(
|
|
2586
2599
|
"polyline",
|
|
2587
2600
|
{
|
|
2588
2601
|
points: toPath(pts, LINE_FORECAST_FROM, pts.length),
|
|
@@ -2597,7 +2610,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2597
2610
|
)
|
|
2598
2611
|
] }, s)) }),
|
|
2599
2612
|
LINE_SERIES.map(
|
|
2600
|
-
(pts, s) => pts.map((y, i) => /* @__PURE__ */
|
|
2613
|
+
(pts, s) => pts.map((y, i) => /* @__PURE__ */ jsx23(
|
|
2601
2614
|
"div",
|
|
2602
2615
|
{
|
|
2603
2616
|
className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
@@ -2614,16 +2627,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2614
2627
|
}
|
|
2615
2628
|
|
|
2616
2629
|
// src/PieChartPlaceholder.tsx
|
|
2617
|
-
import { jsx as
|
|
2630
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2618
2631
|
var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
|
|
2619
2632
|
function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
|
|
2620
2633
|
const r = 45;
|
|
2621
|
-
return /* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */
|
|
2634
|
+
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: [
|
|
2635
|
+
/* @__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: [
|
|
2636
|
+
/* @__PURE__ */ jsx24("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
|
|
2624
2637
|
PIE_SEAMS.map((deg) => {
|
|
2625
2638
|
const rad = (deg - 90) * Math.PI / 180;
|
|
2626
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ jsx24(
|
|
2627
2640
|
"line",
|
|
2628
2641
|
{
|
|
2629
2642
|
x1: "50",
|
|
@@ -2637,12 +2650,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
|
|
|
2637
2650
|
);
|
|
2638
2651
|
})
|
|
2639
2652
|
] }) }),
|
|
2640
|
-
/* @__PURE__ */
|
|
2653
|
+
/* @__PURE__ */ jsx24(BlankLegend, { rows: legendRows })
|
|
2641
2654
|
] });
|
|
2642
2655
|
}
|
|
2643
2656
|
|
|
2644
2657
|
// src/StackedColumnPlaceholder.tsx
|
|
2645
|
-
import { jsx as
|
|
2658
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2646
2659
|
var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
|
|
2647
2660
|
function columnBands(count) {
|
|
2648
2661
|
const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
|
|
@@ -2657,7 +2670,7 @@ function StackedColumnPlaceholder({
|
|
|
2657
2670
|
className,
|
|
2658
2671
|
testIdPrefix
|
|
2659
2672
|
}) {
|
|
2660
|
-
const column = /* @__PURE__ */
|
|
2673
|
+
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
2674
|
"div",
|
|
2662
2675
|
{
|
|
2663
2676
|
style: {
|
|
@@ -2669,16 +2682,16 @@ function StackedColumnPlaceholder({
|
|
|
2669
2682
|
},
|
|
2670
2683
|
i
|
|
2671
2684
|
)) });
|
|
2672
|
-
return /* @__PURE__ */
|
|
2673
|
-
axis ? /* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2685
|
+
return /* @__PURE__ */ jsxs23("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2686
|
+
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 }),
|
|
2687
|
+
/* @__PURE__ */ jsx25(BlankLegend, { rows: legendRows, reverse: !axis })
|
|
2675
2688
|
] });
|
|
2676
2689
|
}
|
|
2677
2690
|
|
|
2678
2691
|
// src/Tooltip.tsx
|
|
2679
2692
|
import { useEffect as useEffect8, useId as useId4, useLayoutEffect as useLayoutEffect4, useRef as useRef9, useState as useState8 } from "react";
|
|
2680
2693
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2681
|
-
import { jsx as
|
|
2694
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2682
2695
|
function addDescribedBy(el, id) {
|
|
2683
2696
|
const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
|
|
2684
2697
|
if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
|
|
@@ -2864,7 +2877,7 @@ function Tooltip({
|
|
|
2864
2877
|
}
|
|
2865
2878
|
}
|
|
2866
2879
|
const floating = anchor != null && typeof document !== "undefined" ? createPortal3(
|
|
2867
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ jsx26(
|
|
2868
2881
|
"span",
|
|
2869
2882
|
{
|
|
2870
2883
|
ref: boxRef,
|
|
@@ -2895,7 +2908,7 @@ function Tooltip({
|
|
|
2895
2908
|
document.body
|
|
2896
2909
|
) : null;
|
|
2897
2910
|
if (anchorRef) return floating;
|
|
2898
|
-
return /* @__PURE__ */
|
|
2911
|
+
return /* @__PURE__ */ jsxs24(
|
|
2899
2912
|
"span",
|
|
2900
2913
|
{
|
|
2901
2914
|
ref,
|
|
@@ -2917,28 +2930,28 @@ function Tooltip({
|
|
|
2917
2930
|
}
|
|
2918
2931
|
|
|
2919
2932
|
// src/AdvertiserNoResults.tsx
|
|
2920
|
-
import { jsx as
|
|
2933
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2921
2934
|
function AdvertiserNoResults({
|
|
2922
2935
|
query,
|
|
2923
2936
|
hint = "Try checking your spelling or searching for a broader brand name.",
|
|
2924
2937
|
className,
|
|
2925
2938
|
testIdPrefix
|
|
2926
2939
|
}) {
|
|
2927
|
-
return /* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
2940
|
+
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: [
|
|
2941
|
+
/* @__PURE__ */ jsxs25("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
2929
2942
|
"No results found for \u201C",
|
|
2930
2943
|
query,
|
|
2931
2944
|
"\u201D"
|
|
2932
2945
|
] }),
|
|
2933
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ jsx27("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
2934
2947
|
] });
|
|
2935
2948
|
}
|
|
2936
2949
|
|
|
2937
2950
|
// src/SelectAllVisible.tsx
|
|
2938
2951
|
import { ListChecks as ListChecks2 } from "lucide-react";
|
|
2939
|
-
import { jsx as
|
|
2952
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2940
2953
|
function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
|
|
2941
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ jsxs26(
|
|
2942
2955
|
"button",
|
|
2943
2956
|
{
|
|
2944
2957
|
type: "button",
|
|
@@ -2949,7 +2962,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2949
2962
|
className
|
|
2950
2963
|
),
|
|
2951
2964
|
children: [
|
|
2952
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx28(ListChecks2, { size: 14, "aria-hidden": "true" }),
|
|
2953
2966
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
2954
2967
|
]
|
|
2955
2968
|
}
|
|
@@ -2958,11 +2971,11 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2958
2971
|
|
|
2959
2972
|
// src/SelectedSection.tsx
|
|
2960
2973
|
import { ChevronDown as ChevronDown7 } from "lucide-react";
|
|
2961
|
-
import { jsx as
|
|
2974
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2962
2975
|
function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
|
|
2963
2976
|
if (count === 0) return null;
|
|
2964
|
-
return /* @__PURE__ */
|
|
2965
|
-
/* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ jsxs27("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
2978
|
+
/* @__PURE__ */ jsxs27(
|
|
2966
2979
|
"button",
|
|
2967
2980
|
{
|
|
2968
2981
|
type: "button",
|
|
@@ -2971,25 +2984,25 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
|
|
|
2971
2984
|
"aria-expanded": open,
|
|
2972
2985
|
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
2986
|
children: [
|
|
2974
|
-
/* @__PURE__ */
|
|
2987
|
+
/* @__PURE__ */ jsx29(ChevronDown7, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
|
|
2975
2988
|
"Selected (",
|
|
2976
2989
|
count,
|
|
2977
2990
|
")"
|
|
2978
2991
|
]
|
|
2979
2992
|
}
|
|
2980
2993
|
),
|
|
2981
|
-
open && /* @__PURE__ */
|
|
2994
|
+
open && /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-0.5", children })
|
|
2982
2995
|
] });
|
|
2983
2996
|
}
|
|
2984
2997
|
|
|
2985
2998
|
// src/SelectionPicker.tsx
|
|
2986
2999
|
import { useCallback as useCallback3, useEffect as useEffect9, useLayoutEffect as useLayoutEffect5, useMemo as useMemo3, useRef as useRef11, useState as useState9 } from "react";
|
|
2987
3000
|
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
|
|
3001
|
+
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
3002
|
|
|
2990
3003
|
// src/Tabs.tsx
|
|
2991
3004
|
import { useRef as useRef10 } from "react";
|
|
2992
|
-
import { jsx as
|
|
3005
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2993
3006
|
function arrowKeys(e, row) {
|
|
2994
3007
|
if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
|
|
2995
3008
|
const items = Array.from(row.querySelectorAll("button:not([disabled])"));
|
|
@@ -3001,7 +3014,7 @@ function arrowKeys(e, row) {
|
|
|
3001
3014
|
}
|
|
3002
3015
|
function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
|
|
3003
3016
|
const row = useRef10(null);
|
|
3004
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ jsx30(
|
|
3005
3018
|
"div",
|
|
3006
3019
|
{
|
|
3007
3020
|
ref: row,
|
|
@@ -3012,7 +3025,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3012
3025
|
className: cn("flex gap-6 border-b border-border-default", className),
|
|
3013
3026
|
children: items.map((item) => {
|
|
3014
3027
|
const on = item.value === value;
|
|
3015
|
-
return /* @__PURE__ */
|
|
3028
|
+
return /* @__PURE__ */ jsxs28(
|
|
3016
3029
|
"button",
|
|
3017
3030
|
{
|
|
3018
3031
|
type: "button",
|
|
@@ -3030,7 +3043,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3030
3043
|
),
|
|
3031
3044
|
children: [
|
|
3032
3045
|
item.label,
|
|
3033
|
-
item.count !== void 0 && /* @__PURE__ */
|
|
3046
|
+
item.count !== void 0 && /* @__PURE__ */ jsx30("span", { className: "text-xs text-text-tertiary", children: item.count })
|
|
3034
3047
|
]
|
|
3035
3048
|
},
|
|
3036
3049
|
item.value
|
|
@@ -3049,7 +3062,7 @@ function SegmentedControl({
|
|
|
3049
3062
|
...rest
|
|
3050
3063
|
}) {
|
|
3051
3064
|
const row = useRef10(null);
|
|
3052
|
-
return /* @__PURE__ */
|
|
3065
|
+
return /* @__PURE__ */ jsx30(
|
|
3053
3066
|
"div",
|
|
3054
3067
|
{
|
|
3055
3068
|
ref: row,
|
|
@@ -3060,7 +3073,7 @@ function SegmentedControl({
|
|
|
3060
3073
|
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
3074
|
children: options.map((o) => {
|
|
3062
3075
|
const on = o.value === value;
|
|
3063
|
-
return /* @__PURE__ */
|
|
3076
|
+
return /* @__PURE__ */ jsx30(
|
|
3064
3077
|
"button",
|
|
3065
3078
|
{
|
|
3066
3079
|
type: "button",
|
|
@@ -3084,7 +3097,7 @@ function SegmentedControl({
|
|
|
3084
3097
|
}
|
|
3085
3098
|
|
|
3086
3099
|
// src/SelectionPicker.tsx
|
|
3087
|
-
import { Fragment as Fragment3, jsx as
|
|
3100
|
+
import { Fragment as Fragment3, jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3088
3101
|
function slug5(value) {
|
|
3089
3102
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
3090
3103
|
}
|
|
@@ -3177,12 +3190,12 @@ function SelectionPicker({
|
|
|
3177
3190
|
}
|
|
3178
3191
|
};
|
|
3179
3192
|
const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
|
|
3180
|
-
return /* @__PURE__ */
|
|
3181
|
-
helper && /* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3183
|
-
/* @__PURE__ */
|
|
3193
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
3194
|
+
helper && /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
3195
|
+
/* @__PURE__ */ jsx31("p", { className: "text-dense text-text-secondary", children: helper }),
|
|
3196
|
+
/* @__PURE__ */ jsx31("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
|
|
3184
3197
|
] }),
|
|
3185
|
-
hasAccountLists && /* @__PURE__ */
|
|
3198
|
+
hasAccountLists && /* @__PURE__ */ jsx31(
|
|
3186
3199
|
SegmentedControl,
|
|
3187
3200
|
{
|
|
3188
3201
|
"aria-label": "Add from",
|
|
@@ -3195,11 +3208,11 @@ function SelectionPicker({
|
|
|
3195
3208
|
]
|
|
3196
3209
|
}
|
|
3197
3210
|
),
|
|
3198
|
-
source === "search" && /* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3211
|
+
source === "search" && /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3212
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3213
|
+
/* @__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: [
|
|
3214
|
+
/* @__PURE__ */ jsx31(Search4, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3215
|
+
/* @__PURE__ */ jsx31(
|
|
3203
3216
|
"input",
|
|
3204
3217
|
{
|
|
3205
3218
|
value: query,
|
|
@@ -3215,7 +3228,7 @@ function SelectionPicker({
|
|
|
3215
3228
|
}
|
|
3216
3229
|
)
|
|
3217
3230
|
] }),
|
|
3218
|
-
filters.map((f) => /* @__PURE__ */
|
|
3231
|
+
filters.map((f) => /* @__PURE__ */ jsx31(
|
|
3219
3232
|
FilterDropdown,
|
|
3220
3233
|
{
|
|
3221
3234
|
filter: f,
|
|
@@ -3227,14 +3240,14 @@ function SelectionPicker({
|
|
|
3227
3240
|
)),
|
|
3228
3241
|
toolbarExtra
|
|
3229
3242
|
] }),
|
|
3230
|
-
!hasSearched ? /* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3243
|
+
!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: [
|
|
3244
|
+
/* @__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" }) }),
|
|
3245
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-1", children: [
|
|
3246
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
|
|
3247
|
+
/* @__PURE__ */ jsx31("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
|
|
3235
3248
|
] })
|
|
3236
|
-
] }) : /* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3249
|
+
] }) : /* @__PURE__ */ jsxs29("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
|
|
3250
|
+
/* @__PURE__ */ jsxs29(
|
|
3238
3251
|
"div",
|
|
3239
3252
|
{
|
|
3240
3253
|
className: cn(
|
|
@@ -3242,7 +3255,7 @@ function SelectionPicker({
|
|
|
3242
3255
|
rowGridCols
|
|
3243
3256
|
),
|
|
3244
3257
|
children: [
|
|
3245
|
-
/* @__PURE__ */
|
|
3258
|
+
/* @__PURE__ */ jsx31(
|
|
3246
3259
|
CheckBox,
|
|
3247
3260
|
{
|
|
3248
3261
|
checked: allSelected,
|
|
@@ -3253,18 +3266,18 @@ function SelectionPicker({
|
|
|
3253
3266
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
|
|
3254
3267
|
}
|
|
3255
3268
|
),
|
|
3256
|
-
/* @__PURE__ */
|
|
3257
|
-
showInfoColumn && /* @__PURE__ */
|
|
3269
|
+
/* @__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)) }),
|
|
3270
|
+
showInfoColumn && /* @__PURE__ */ jsx31("span", { className: "text-right", children: "Info" })
|
|
3258
3271
|
]
|
|
3259
3272
|
}
|
|
3260
3273
|
),
|
|
3261
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__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
3275
|
const isSel = selectedIds.has(row.id);
|
|
3263
3276
|
const isLocked = lockedIds?.has(row.id) ?? false;
|
|
3264
3277
|
const kids = getChildren?.(row);
|
|
3265
3278
|
const isOpen = expanded.has(row.id);
|
|
3266
|
-
return /* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3279
|
+
return /* @__PURE__ */ jsxs29("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
|
|
3280
|
+
/* @__PURE__ */ jsxs29(
|
|
3268
3281
|
"div",
|
|
3269
3282
|
{
|
|
3270
3283
|
onClick: isLocked ? void 0 : () => toggleRow(row),
|
|
@@ -3277,7 +3290,7 @@ function SelectionPicker({
|
|
|
3277
3290
|
!isLocked && isSel && "opacity-70"
|
|
3278
3291
|
),
|
|
3279
3292
|
children: [
|
|
3280
|
-
isLocked ? /* @__PURE__ */
|
|
3293
|
+
isLocked ? /* @__PURE__ */ jsx31("span", { "aria-hidden": "true" }) : /* @__PURE__ */ jsx31(
|
|
3281
3294
|
CheckBox,
|
|
3282
3295
|
{
|
|
3283
3296
|
checked: isSel,
|
|
@@ -3286,8 +3299,8 @@ function SelectionPicker({
|
|
|
3286
3299
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
|
|
3287
3300
|
}
|
|
3288
3301
|
),
|
|
3289
|
-
/* @__PURE__ */
|
|
3290
|
-
showInfoColumn && /* @__PURE__ */
|
|
3302
|
+
/* @__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)) }),
|
|
3303
|
+
showInfoColumn && /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ jsx31(
|
|
3291
3304
|
"button",
|
|
3292
3305
|
{
|
|
3293
3306
|
type: "button",
|
|
@@ -3301,28 +3314,28 @@ function SelectionPicker({
|
|
|
3301
3314
|
});
|
|
3302
3315
|
},
|
|
3303
3316
|
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__ */
|
|
3317
|
+
children: /* @__PURE__ */ jsx31(ChevronRight3, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3305
3318
|
}
|
|
3306
|
-
) : /* @__PURE__ */
|
|
3319
|
+
) : /* @__PURE__ */ jsx31(
|
|
3307
3320
|
"span",
|
|
3308
3321
|
{
|
|
3309
3322
|
className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
|
|
3310
3323
|
title: "No additional details",
|
|
3311
|
-
children: /* @__PURE__ */
|
|
3324
|
+
children: /* @__PURE__ */ jsx31(Info2, { size: 14 })
|
|
3312
3325
|
}
|
|
3313
3326
|
) })
|
|
3314
3327
|
]
|
|
3315
3328
|
}
|
|
3316
3329
|
),
|
|
3317
|
-
isOpen && kids && /* @__PURE__ */
|
|
3330
|
+
isOpen && kids && /* @__PURE__ */ jsx31("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
|
|
3318
3331
|
const kidSel = selectedIds.has(kid.id);
|
|
3319
|
-
return /* @__PURE__ */
|
|
3332
|
+
return /* @__PURE__ */ jsxs29(
|
|
3320
3333
|
"div",
|
|
3321
3334
|
{
|
|
3322
3335
|
className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
|
|
3323
3336
|
children: [
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
|
|
3338
|
+
/* @__PURE__ */ jsxs29(
|
|
3326
3339
|
"button",
|
|
3327
3340
|
{
|
|
3328
3341
|
type: "button",
|
|
@@ -3333,7 +3346,7 @@ function SelectionPicker({
|
|
|
3333
3346
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3334
3347
|
),
|
|
3335
3348
|
children: [
|
|
3336
|
-
kidSel ? /* @__PURE__ */
|
|
3349
|
+
kidSel ? /* @__PURE__ */ jsx31(Check7, { size: 13 }) : /* @__PURE__ */ jsx31(Plus2, { size: 13 }),
|
|
3337
3350
|
kidSel ? "Added" : "Add"
|
|
3338
3351
|
]
|
|
3339
3352
|
}
|
|
@@ -3345,7 +3358,7 @@ function SelectionPicker({
|
|
|
3345
3358
|
}) })
|
|
3346
3359
|
] }, row.id);
|
|
3347
3360
|
}) }),
|
|
3348
|
-
!loading && !error && hasMore && /* @__PURE__ */
|
|
3361
|
+
!loading && !error && hasMore && /* @__PURE__ */ jsxs29(
|
|
3349
3362
|
"button",
|
|
3350
3363
|
{
|
|
3351
3364
|
type: "button",
|
|
@@ -3354,19 +3367,19 @@ function SelectionPicker({
|
|
|
3354
3367
|
"data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
|
|
3355
3368
|
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
3369
|
children: [
|
|
3357
|
-
loadingMore ? /* @__PURE__ */
|
|
3370
|
+
loadingMore ? /* @__PURE__ */ jsx31(Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
|
|
3358
3371
|
loadingMore ? "Loading\u2026" : "Load more"
|
|
3359
3372
|
]
|
|
3360
3373
|
}
|
|
3361
3374
|
)
|
|
3362
3375
|
] })
|
|
3363
3376
|
] }),
|
|
3364
|
-
source === "lists" && /* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
accountLists && accountLists.length > 0 ? /* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3377
|
+
source === "lists" && /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3378
|
+
/* @__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." }),
|
|
3379
|
+
accountLists && accountLists.length > 0 ? /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
3380
|
+
/* @__PURE__ */ jsx31(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
|
|
3368
3381
|
const on = (selectedListIds ?? []).includes(list.id);
|
|
3369
|
-
return /* @__PURE__ */
|
|
3382
|
+
return /* @__PURE__ */ jsxs29(
|
|
3370
3383
|
"button",
|
|
3371
3384
|
{
|
|
3372
3385
|
type: "button",
|
|
@@ -3378,19 +3391,19 @@ function SelectionPicker({
|
|
|
3378
3391
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3379
3392
|
),
|
|
3380
3393
|
children: [
|
|
3381
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsx31(
|
|
3382
3395
|
"span",
|
|
3383
3396
|
{
|
|
3384
3397
|
className: cn(
|
|
3385
3398
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
3386
3399
|
on ? "text-brand-primaryAction" : "text-text-secondary"
|
|
3387
3400
|
),
|
|
3388
|
-
children: on ? /* @__PURE__ */
|
|
3401
|
+
children: on ? /* @__PURE__ */ jsx31(Check7, { size: 16 }) : /* @__PURE__ */ jsx31(Plus2, { size: 16 })
|
|
3389
3402
|
}
|
|
3390
3403
|
),
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ jsxs29("span", { className: "min-w-0 flex-1", children: [
|
|
3405
|
+
/* @__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 }) }),
|
|
3406
|
+
/* @__PURE__ */ jsxs29("span", { className: "block truncate text-xs text-text-secondary", children: [
|
|
3394
3407
|
list.count,
|
|
3395
3408
|
" accounts \xB7 ",
|
|
3396
3409
|
list.entityTypes.join(", "),
|
|
@@ -3398,13 +3411,13 @@ function SelectionPicker({
|
|
|
3398
3411
|
formatListDate(list.updatedAt)
|
|
3399
3412
|
] })
|
|
3400
3413
|
] }),
|
|
3401
|
-
/* @__PURE__ */
|
|
3414
|
+
/* @__PURE__ */ jsx31("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
|
|
3402
3415
|
]
|
|
3403
3416
|
},
|
|
3404
3417
|
list.id
|
|
3405
3418
|
);
|
|
3406
3419
|
}) }),
|
|
3407
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsxs29(
|
|
3408
3421
|
"p",
|
|
3409
3422
|
{
|
|
3410
3423
|
className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
|
|
@@ -3416,11 +3429,11 @@ function SelectionPicker({
|
|
|
3416
3429
|
]
|
|
3417
3430
|
}
|
|
3418
3431
|
)
|
|
3419
|
-
] }) : /* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__PURE__ */
|
|
3432
|
+
] }) : /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3433
|
+
/* @__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" }) }),
|
|
3434
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-1", children: [
|
|
3435
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
|
|
3436
|
+
/* @__PURE__ */ jsx31("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
|
|
3424
3437
|
] })
|
|
3425
3438
|
] })
|
|
3426
3439
|
] })
|
|
@@ -3452,7 +3465,7 @@ function ScrollFade({ className, children }) {
|
|
|
3452
3465
|
[sync]
|
|
3453
3466
|
);
|
|
3454
3467
|
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__ */
|
|
3468
|
+
return /* @__PURE__ */ jsx31("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
|
|
3456
3469
|
}
|
|
3457
3470
|
function formatListDate(iso) {
|
|
3458
3471
|
try {
|
|
@@ -3502,8 +3515,8 @@ function FilterDropdown({
|
|
|
3502
3515
|
const count = active.size;
|
|
3503
3516
|
const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
|
|
3504
3517
|
const filterSlug = slug5(filter.label);
|
|
3505
|
-
return /* @__PURE__ */
|
|
3506
|
-
/* @__PURE__ */
|
|
3518
|
+
return /* @__PURE__ */ jsxs29("div", { className: "relative", children: [
|
|
3519
|
+
/* @__PURE__ */ jsxs29(
|
|
3507
3520
|
"button",
|
|
3508
3521
|
{
|
|
3509
3522
|
ref: btnRef,
|
|
@@ -3514,12 +3527,12 @@ function FilterDropdown({
|
|
|
3514
3527
|
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
3528
|
children: [
|
|
3516
3529
|
label,
|
|
3517
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx31(ChevronDown8, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
3518
3531
|
]
|
|
3519
3532
|
}
|
|
3520
3533
|
),
|
|
3521
3534
|
open && pos && createPortal4(
|
|
3522
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsxs29(
|
|
3523
3536
|
"div",
|
|
3524
3537
|
{
|
|
3525
3538
|
ref: menuRef,
|
|
@@ -3528,9 +3541,9 @@ function FilterDropdown({
|
|
|
3528
3541
|
style: { top: pos.top, left: pos.left },
|
|
3529
3542
|
className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
3530
3543
|
children: [
|
|
3531
|
-
searchable && /* @__PURE__ */
|
|
3532
|
-
/* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
3544
|
+
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: [
|
|
3545
|
+
/* @__PURE__ */ jsx31(Search4, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
3546
|
+
/* @__PURE__ */ jsx31(
|
|
3534
3547
|
"input",
|
|
3535
3548
|
{
|
|
3536
3549
|
autoFocus: true,
|
|
@@ -3541,14 +3554,14 @@ function FilterDropdown({
|
|
|
3541
3554
|
}
|
|
3542
3555
|
)
|
|
3543
3556
|
] }),
|
|
3544
|
-
/* @__PURE__ */
|
|
3557
|
+
/* @__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
3558
|
const on = active.has(opt);
|
|
3546
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsxs29(
|
|
3547
3560
|
"label",
|
|
3548
3561
|
{
|
|
3549
3562
|
className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
|
|
3550
3563
|
children: [
|
|
3551
|
-
/* @__PURE__ */
|
|
3564
|
+
/* @__PURE__ */ jsx31(
|
|
3552
3565
|
CheckBox,
|
|
3553
3566
|
{
|
|
3554
3567
|
checked: on,
|
|
@@ -3579,7 +3592,7 @@ function gridForColumns(columns) {
|
|
|
3579
3592
|
|
|
3580
3593
|
// src/PublisherBreakdownList.tsx
|
|
3581
3594
|
import { useState as useState10 } from "react";
|
|
3582
|
-
import { jsx as
|
|
3595
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3583
3596
|
var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
|
|
3584
3597
|
function priorYearAmt(spendN, yoy) {
|
|
3585
3598
|
if (yoy === "NEW" || yoy <= -100) return null;
|
|
@@ -3591,7 +3604,7 @@ function initials(name) {
|
|
|
3591
3604
|
return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
|
|
3592
3605
|
}
|
|
3593
3606
|
function Monogram({ name, size = 28 }) {
|
|
3594
|
-
return /* @__PURE__ */
|
|
3607
|
+
return /* @__PURE__ */ jsx32(
|
|
3595
3608
|
"span",
|
|
3596
3609
|
{
|
|
3597
3610
|
"aria-hidden": "true",
|
|
@@ -3602,12 +3615,12 @@ function Monogram({ name, size = 28 }) {
|
|
|
3602
3615
|
);
|
|
3603
3616
|
}
|
|
3604
3617
|
function BreakdownTag({ children }) {
|
|
3605
|
-
return /* @__PURE__ */
|
|
3618
|
+
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
3619
|
}
|
|
3607
3620
|
function DelayedTip({ label, children }) {
|
|
3608
|
-
return /* @__PURE__ */
|
|
3621
|
+
return /* @__PURE__ */ jsxs30("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
3609
3622
|
children,
|
|
3610
|
-
/* @__PURE__ */
|
|
3623
|
+
/* @__PURE__ */ jsx32(
|
|
3611
3624
|
"span",
|
|
3612
3625
|
{
|
|
3613
3626
|
role: "tooltip",
|
|
@@ -3621,22 +3634,22 @@ var COL_CURRENT = 76;
|
|
|
3621
3634
|
var COL_PREVIOUS = 76;
|
|
3622
3635
|
var COL_YOY = 44;
|
|
3623
3636
|
function MetricListHeader({ className }) {
|
|
3624
|
-
return /* @__PURE__ */
|
|
3625
|
-
/* @__PURE__ */
|
|
3626
|
-
/* @__PURE__ */
|
|
3627
|
-
/* @__PURE__ */
|
|
3628
|
-
/* @__PURE__ */
|
|
3629
|
-
/* @__PURE__ */
|
|
3637
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
|
|
3638
|
+
/* @__PURE__ */ jsx32("span", { className: "flex-1" }),
|
|
3639
|
+
/* @__PURE__ */ jsxs30("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3640
|
+
/* @__PURE__ */ jsx32("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3641
|
+
/* @__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" }) }),
|
|
3642
|
+
/* @__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
3643
|
] })
|
|
3631
3644
|
] });
|
|
3632
3645
|
}
|
|
3633
3646
|
function MetricCells({ spendN, yoy }) {
|
|
3634
3647
|
const prior = priorYearAmt(spendN, yoy);
|
|
3635
3648
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3636
|
-
return /* @__PURE__ */
|
|
3637
|
-
/* @__PURE__ */
|
|
3638
|
-
/* @__PURE__ */
|
|
3639
|
-
/* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ jsxs30("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3650
|
+
/* @__PURE__ */ jsx32("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
3651
|
+
/* @__PURE__ */ jsx32("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
3652
|
+
/* @__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
3653
|
up ? "+" : "\u2212",
|
|
3641
3654
|
Math.abs(yoy),
|
|
3642
3655
|
"%"
|
|
@@ -3655,35 +3668,35 @@ function PublisherBreakdownList({
|
|
|
3655
3668
|
const [showAll, setShowAll] = useState10(false);
|
|
3656
3669
|
const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
|
|
3657
3670
|
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__ */
|
|
3671
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3672
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-col", children: [
|
|
3673
|
+
/* @__PURE__ */ jsx32(MetricListHeader, { className: rowPad }),
|
|
3674
|
+
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: [
|
|
3675
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
3676
|
+
renderLogo ? renderLogo(p) : /* @__PURE__ */ jsx32(Monogram, { name: p.brand, size: 28 }),
|
|
3677
|
+
/* @__PURE__ */ jsxs30("div", { className: "min-w-0", children: [
|
|
3678
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3679
|
+
/* @__PURE__ */ jsx32("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
3680
|
+
p.tags.map((t) => /* @__PURE__ */ jsx32(BreakdownTag, { children: t }, t))
|
|
3668
3681
|
] }),
|
|
3669
|
-
/* @__PURE__ */
|
|
3682
|
+
/* @__PURE__ */ jsx32("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
|
|
3670
3683
|
] })
|
|
3671
3684
|
] }),
|
|
3672
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx32(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3673
3686
|
] }, p.brand))
|
|
3674
3687
|
] }),
|
|
3675
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */
|
|
3676
|
-
/* @__PURE__ */
|
|
3688
|
+
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: [
|
|
3689
|
+
/* @__PURE__ */ jsxs30("span", { children: [
|
|
3677
3690
|
"Showing ",
|
|
3678
3691
|
visible.length,
|
|
3679
3692
|
" of ",
|
|
3680
3693
|
rows.length
|
|
3681
3694
|
] }),
|
|
3682
|
-
!showAll ? /* @__PURE__ */
|
|
3695
|
+
!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
3696
|
"See all (",
|
|
3684
3697
|
rows.length - defaultVisibleCount,
|
|
3685
3698
|
" more)"
|
|
3686
|
-
] }) : /* @__PURE__ */
|
|
3699
|
+
] }) : /* @__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
3700
|
] }))
|
|
3688
3701
|
] });
|
|
3689
3702
|
}
|
|
@@ -3693,7 +3706,7 @@ import { forwardRef as forwardRef6 } from "react";
|
|
|
3693
3706
|
import { Slot } from "@radix-ui/react-slot";
|
|
3694
3707
|
import { cva } from "class-variance-authority";
|
|
3695
3708
|
import { Loader2 as Loader22 } from "lucide-react";
|
|
3696
|
-
import { jsx as
|
|
3709
|
+
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3697
3710
|
var buttonVariants = cva(
|
|
3698
3711
|
"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
3712
|
{
|
|
@@ -3764,10 +3777,10 @@ var Button = forwardRef6(
|
|
|
3764
3777
|
...props
|
|
3765
3778
|
};
|
|
3766
3779
|
if (asChild) {
|
|
3767
|
-
return /* @__PURE__ */
|
|
3780
|
+
return /* @__PURE__ */ jsx33(Slot, { ref, ...shared, children });
|
|
3768
3781
|
}
|
|
3769
|
-
return /* @__PURE__ */
|
|
3770
|
-
loading && /* @__PURE__ */
|
|
3782
|
+
return /* @__PURE__ */ jsxs31("button", { ref, ...shared, children: [
|
|
3783
|
+
loading && /* @__PURE__ */ jsx33(Loader22, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
3771
3784
|
children
|
|
3772
3785
|
] });
|
|
3773
3786
|
}
|
|
@@ -3775,7 +3788,7 @@ var Button = forwardRef6(
|
|
|
3775
3788
|
Button.displayName = "Button";
|
|
3776
3789
|
|
|
3777
3790
|
// src/FilterDropdownFooter.tsx
|
|
3778
|
-
import { jsx as
|
|
3791
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3779
3792
|
function FilterDropdownFooter({
|
|
3780
3793
|
onClear,
|
|
3781
3794
|
onApply,
|
|
@@ -3784,7 +3797,7 @@ function FilterDropdownFooter({
|
|
|
3784
3797
|
className,
|
|
3785
3798
|
testIdPrefix
|
|
3786
3799
|
}) {
|
|
3787
|
-
return /* @__PURE__ */
|
|
3800
|
+
return /* @__PURE__ */ jsxs32(
|
|
3788
3801
|
"div",
|
|
3789
3802
|
{
|
|
3790
3803
|
className: cn(
|
|
@@ -3794,8 +3807,8 @@ function FilterDropdownFooter({
|
|
|
3794
3807
|
),
|
|
3795
3808
|
"data-testid": testIdPrefix,
|
|
3796
3809
|
children: [
|
|
3797
|
-
onClear && /* @__PURE__ */
|
|
3798
|
-
/* @__PURE__ */
|
|
3810
|
+
onClear && /* @__PURE__ */ jsx34(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
|
|
3811
|
+
/* @__PURE__ */ jsx34(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
|
|
3799
3812
|
]
|
|
3800
3813
|
}
|
|
3801
3814
|
);
|
|
@@ -3804,7 +3817,7 @@ function FilterDropdownFooter({
|
|
|
3804
3817
|
// src/NameListModal.tsx
|
|
3805
3818
|
import { useEffect as useEffect10, useId as useId5, useRef as useRef12, useState as useState11 } from "react";
|
|
3806
3819
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3807
|
-
import { jsx as
|
|
3820
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3808
3821
|
function NameListModal({
|
|
3809
3822
|
title,
|
|
3810
3823
|
initialName,
|
|
@@ -3858,12 +3871,12 @@ function NameListModal({
|
|
|
3858
3871
|
// bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
|
|
3859
3872
|
// No in-data-[theme=dark] override needed any more -- the token redefines
|
|
3860
3873
|
// itself under that attribute in dark.css, so one class covers both themes.
|
|
3861
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ jsx35(
|
|
3862
3875
|
"div",
|
|
3863
3876
|
{
|
|
3864
3877
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
|
|
3865
3878
|
onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
|
|
3866
|
-
children: /* @__PURE__ */
|
|
3879
|
+
children: /* @__PURE__ */ jsxs33(
|
|
3867
3880
|
"div",
|
|
3868
3881
|
{
|
|
3869
3882
|
ref: dialogRef,
|
|
@@ -3874,10 +3887,10 @@ function NameListModal({
|
|
|
3874
3887
|
"data-testid": testIdPrefix,
|
|
3875
3888
|
className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
|
|
3876
3889
|
children: [
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
/* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */
|
|
3880
|
-
/* @__PURE__ */
|
|
3890
|
+
/* @__PURE__ */ jsx35("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
3891
|
+
/* @__PURE__ */ jsxs33("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
3892
|
+
/* @__PURE__ */ jsx35("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
3893
|
+
/* @__PURE__ */ jsx35(
|
|
3881
3894
|
"input",
|
|
3882
3895
|
{
|
|
3883
3896
|
id: fieldId,
|
|
@@ -3889,13 +3902,13 @@ function NameListModal({
|
|
|
3889
3902
|
}
|
|
3890
3903
|
)
|
|
3891
3904
|
] }),
|
|
3892
|
-
options && options.length > 0 && /* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
3905
|
+
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: [
|
|
3906
|
+
/* @__PURE__ */ jsx35(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
3894
3907
|
o.label
|
|
3895
3908
|
] }, o.key)) }),
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
/* @__PURE__ */
|
|
3909
|
+
/* @__PURE__ */ jsxs33("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
|
|
3910
|
+
/* @__PURE__ */ jsx35(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
3911
|
+
/* @__PURE__ */ jsx35(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
|
|
3899
3912
|
] })
|
|
3900
3913
|
]
|
|
3901
3914
|
}
|
|
@@ -3908,11 +3921,11 @@ function NameListModal({
|
|
|
3908
3921
|
|
|
3909
3922
|
// src/FilterChipBar.tsx
|
|
3910
3923
|
import { CircleSlash, X as X4 } from "lucide-react";
|
|
3911
|
-
import { jsx as
|
|
3924
|
+
import { jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3912
3925
|
function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
|
|
3913
3926
|
if (chips.length === 0) return null;
|
|
3914
|
-
return /* @__PURE__ */
|
|
3915
|
-
chips.map((c) => /* @__PURE__ */
|
|
3927
|
+
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: [
|
|
3928
|
+
chips.map((c) => /* @__PURE__ */ jsx36(
|
|
3916
3929
|
Chip,
|
|
3917
3930
|
{
|
|
3918
3931
|
label: c.label,
|
|
@@ -3922,7 +3935,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
3922
3935
|
},
|
|
3923
3936
|
c.key
|
|
3924
3937
|
)),
|
|
3925
|
-
/* @__PURE__ */
|
|
3938
|
+
/* @__PURE__ */ jsx36(
|
|
3926
3939
|
"button",
|
|
3927
3940
|
{
|
|
3928
3941
|
type: "button",
|
|
@@ -3939,8 +3952,8 @@ function Chip({
|
|
|
3939
3952
|
parked,
|
|
3940
3953
|
onRemove
|
|
3941
3954
|
}) {
|
|
3942
|
-
return /* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
3955
|
+
return /* @__PURE__ */ jsxs34("span", { className: "group relative inline-flex", children: [
|
|
3956
|
+
/* @__PURE__ */ jsxs34(
|
|
3944
3957
|
"span",
|
|
3945
3958
|
{
|
|
3946
3959
|
className: cn(
|
|
@@ -3952,22 +3965,22 @@ function Chip({
|
|
|
3952
3965
|
) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
|
|
3953
3966
|
),
|
|
3954
3967
|
children: [
|
|
3955
|
-
parked && /* @__PURE__ */
|
|
3968
|
+
parked && /* @__PURE__ */ jsx36(CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
3956
3969
|
label,
|
|
3957
|
-
/* @__PURE__ */
|
|
3970
|
+
/* @__PURE__ */ jsx36(
|
|
3958
3971
|
"button",
|
|
3959
3972
|
{
|
|
3960
3973
|
type: "button",
|
|
3961
3974
|
onClick: onRemove,
|
|
3962
3975
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
3963
3976
|
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__ */
|
|
3977
|
+
children: /* @__PURE__ */ jsx36(X4, { size: 12 })
|
|
3965
3978
|
}
|
|
3966
3979
|
)
|
|
3967
3980
|
]
|
|
3968
3981
|
}
|
|
3969
3982
|
),
|
|
3970
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ jsx36(
|
|
3971
3984
|
"span",
|
|
3972
3985
|
{
|
|
3973
3986
|
role: "tooltip",
|
|
@@ -3981,7 +3994,7 @@ function Chip({
|
|
|
3981
3994
|
// src/SortButton.tsx
|
|
3982
3995
|
import { forwardRef as forwardRef7 } from "react";
|
|
3983
3996
|
import { ArrowUp, ArrowDown, ArrowUpDown } from "lucide-react";
|
|
3984
|
-
import { jsx as
|
|
3997
|
+
import { jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3985
3998
|
var ALIGN = {
|
|
3986
3999
|
left: "justify-start text-left",
|
|
3987
4000
|
center: "justify-center text-center",
|
|
@@ -3999,9 +4012,9 @@ var SortButton = forwardRef7(
|
|
|
3999
4012
|
className,
|
|
4000
4013
|
testIdPrefix
|
|
4001
4014
|
}, ref) {
|
|
4002
|
-
if (!sortable) return /* @__PURE__ */
|
|
4015
|
+
if (!sortable) return /* @__PURE__ */ jsx37("span", { className: cn("inline-flex", ALIGN[align], className), children: label });
|
|
4003
4016
|
const active = !disabled && sort.key === sortKey;
|
|
4004
|
-
return /* @__PURE__ */
|
|
4017
|
+
return /* @__PURE__ */ jsxs35(
|
|
4005
4018
|
"button",
|
|
4006
4019
|
{
|
|
4007
4020
|
ref,
|
|
@@ -4032,7 +4045,7 @@ var SortButton = forwardRef7(
|
|
|
4032
4045
|
),
|
|
4033
4046
|
children: [
|
|
4034
4047
|
label,
|
|
4035
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */
|
|
4048
|
+
!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
4049
|
ArrowUpDown,
|
|
4037
4050
|
{
|
|
4038
4051
|
size: 12,
|
|
@@ -4063,7 +4076,7 @@ function ariaSortFor(sort, key) {
|
|
|
4063
4076
|
|
|
4064
4077
|
// src/Pager.tsx
|
|
4065
4078
|
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight4 } from "lucide-react";
|
|
4066
|
-
import { jsx as
|
|
4079
|
+
import { jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4067
4080
|
function pageWindow(current, total) {
|
|
4068
4081
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
4069
4082
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -4079,8 +4092,8 @@ function pageWindow(current, total) {
|
|
|
4079
4092
|
}
|
|
4080
4093
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
4081
4094
|
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__ */
|
|
4095
|
+
return /* @__PURE__ */ jsxs36("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4096
|
+
/* @__PURE__ */ jsx38(
|
|
4084
4097
|
"button",
|
|
4085
4098
|
{
|
|
4086
4099
|
type: "button",
|
|
@@ -4088,11 +4101,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4088
4101
|
disabled: disabled || page === 1,
|
|
4089
4102
|
"aria-label": "Previous page",
|
|
4090
4103
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4091
|
-
children: /* @__PURE__ */
|
|
4104
|
+
children: /* @__PURE__ */ jsx38(ChevronLeft3, { size: 16 })
|
|
4092
4105
|
}
|
|
4093
4106
|
),
|
|
4094
4107
|
pageWindow(page, totalPages).map(
|
|
4095
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4108
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx38("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx38(
|
|
4096
4109
|
"button",
|
|
4097
4110
|
{
|
|
4098
4111
|
type: "button",
|
|
@@ -4108,7 +4121,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4108
4121
|
p
|
|
4109
4122
|
)
|
|
4110
4123
|
),
|
|
4111
|
-
/* @__PURE__ */
|
|
4124
|
+
/* @__PURE__ */ jsx38(
|
|
4112
4125
|
"button",
|
|
4113
4126
|
{
|
|
4114
4127
|
type: "button",
|
|
@@ -4116,14 +4129,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4116
4129
|
disabled: disabled || page === totalPages,
|
|
4117
4130
|
"aria-label": "Next page",
|
|
4118
4131
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4119
|
-
children: /* @__PURE__ */
|
|
4132
|
+
children: /* @__PURE__ */ jsx38(ChevronRight4, { size: 16 })
|
|
4120
4133
|
}
|
|
4121
4134
|
)
|
|
4122
4135
|
] });
|
|
4123
4136
|
}
|
|
4124
4137
|
|
|
4125
4138
|
// src/WorkspaceAvatar.tsx
|
|
4126
|
-
import { jsx as
|
|
4139
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4127
4140
|
function workspaceInitials(name) {
|
|
4128
4141
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
4129
4142
|
if (words.length === 0) return "\xB7";
|
|
@@ -4142,7 +4155,7 @@ var SIZES = {
|
|
|
4142
4155
|
lg: "h-11 w-11 text-panel-title"
|
|
4143
4156
|
};
|
|
4144
4157
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
4145
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ jsx39(
|
|
4146
4159
|
"span",
|
|
4147
4160
|
{
|
|
4148
4161
|
"aria-hidden": "true",
|
|
@@ -4160,12 +4173,12 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
4160
4173
|
// src/Toast.tsx
|
|
4161
4174
|
import { useEffect as useEffect11, useRef as useRef13, useState as useState12 } from "react";
|
|
4162
4175
|
import { createPortal as createPortal6 } from "react-dom";
|
|
4163
|
-
import { AlertTriangle, Check as
|
|
4164
|
-
import { jsx as
|
|
4176
|
+
import { AlertTriangle, Check as Check8 } from "lucide-react";
|
|
4177
|
+
import { jsx as jsx40, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4165
4178
|
var ICON = {
|
|
4166
4179
|
neutral: null,
|
|
4167
|
-
success: /* @__PURE__ */
|
|
4168
|
-
warning: /* @__PURE__ */
|
|
4180
|
+
success: /* @__PURE__ */ jsx40(Check8, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
|
|
4181
|
+
warning: /* @__PURE__ */ jsx40(AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
|
|
4169
4182
|
};
|
|
4170
4183
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4171
4184
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
@@ -4181,7 +4194,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4181
4194
|
return () => window.clearTimeout(t);
|
|
4182
4195
|
}, [message, ms, paused]);
|
|
4183
4196
|
return createPortal6(
|
|
4184
|
-
/* @__PURE__ */
|
|
4197
|
+
/* @__PURE__ */ jsxs37(
|
|
4185
4198
|
"div",
|
|
4186
4199
|
{
|
|
4187
4200
|
role: "status",
|
|
@@ -4199,7 +4212,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4199
4212
|
children: [
|
|
4200
4213
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4201
4214
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4202
|
-
/* @__PURE__ */
|
|
4215
|
+
/* @__PURE__ */ jsx40(
|
|
4203
4216
|
"span",
|
|
4204
4217
|
{
|
|
4205
4218
|
className: cn(
|
|
@@ -4209,8 +4222,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4209
4222
|
children: ICON[tone]
|
|
4210
4223
|
}
|
|
4211
4224
|
),
|
|
4212
|
-
/* @__PURE__ */
|
|
4213
|
-
action && /* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ jsx40("span", { className: "min-w-0", children: message }),
|
|
4226
|
+
action && /* @__PURE__ */ jsx40(
|
|
4214
4227
|
"button",
|
|
4215
4228
|
{
|
|
4216
4229
|
type: "button",
|
|
@@ -4232,14 +4245,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4232
4245
|
}
|
|
4233
4246
|
|
|
4234
4247
|
// src/Tag.tsx
|
|
4235
|
-
import { jsx as
|
|
4248
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4236
4249
|
function Tag({ children, className, testIdPrefix }) {
|
|
4237
|
-
return /* @__PURE__ */
|
|
4250
|
+
return /* @__PURE__ */ jsx41(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4238
4251
|
}
|
|
4239
4252
|
|
|
4240
4253
|
// src/TablePagination.tsx
|
|
4241
4254
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
4242
|
-
import { jsx as
|
|
4255
|
+
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4243
4256
|
function TablePagination({
|
|
4244
4257
|
page,
|
|
4245
4258
|
perPage,
|
|
@@ -4259,7 +4272,7 @@ function TablePagination({
|
|
|
4259
4272
|
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
4273
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4261
4274
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4262
|
-
const range = /* @__PURE__ */
|
|
4275
|
+
const range = /* @__PURE__ */ jsxs38("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4263
4276
|
rangeStart.toLocaleString(),
|
|
4264
4277
|
" \u2013 ",
|
|
4265
4278
|
rangeEnd.toLocaleString(),
|
|
@@ -4268,13 +4281,13 @@ function TablePagination({
|
|
|
4268
4281
|
" ",
|
|
4269
4282
|
itemLabel
|
|
4270
4283
|
] });
|
|
4271
|
-
return /* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4285
|
+
/* @__PURE__ */ jsxs38(
|
|
4273
4286
|
"div",
|
|
4274
4287
|
{
|
|
4275
4288
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4276
4289
|
children: [
|
|
4277
|
-
/* @__PURE__ */
|
|
4290
|
+
/* @__PURE__ */ jsx42(
|
|
4278
4291
|
SelectFilter,
|
|
4279
4292
|
{
|
|
4280
4293
|
size: "sm",
|
|
@@ -4290,8 +4303,8 @@ function TablePagination({
|
|
|
4290
4303
|
]
|
|
4291
4304
|
}
|
|
4292
4305
|
),
|
|
4293
|
-
/* @__PURE__ */
|
|
4294
|
-
/* @__PURE__ */
|
|
4306
|
+
/* @__PURE__ */ jsxs38("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4307
|
+
/* @__PURE__ */ jsx42(
|
|
4295
4308
|
"button",
|
|
4296
4309
|
{
|
|
4297
4310
|
type: "button",
|
|
@@ -4300,10 +4313,10 @@ function TablePagination({
|
|
|
4300
4313
|
"aria-label": "First page",
|
|
4301
4314
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4302
4315
|
className: stepBtn,
|
|
4303
|
-
children: /* @__PURE__ */
|
|
4316
|
+
children: /* @__PURE__ */ jsx42(ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4304
4317
|
}
|
|
4305
4318
|
),
|
|
4306
|
-
/* @__PURE__ */
|
|
4319
|
+
/* @__PURE__ */ jsx42(
|
|
4307
4320
|
"button",
|
|
4308
4321
|
{
|
|
4309
4322
|
type: "button",
|
|
@@ -4312,11 +4325,11 @@ function TablePagination({
|
|
|
4312
4325
|
"aria-label": "Previous page",
|
|
4313
4326
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4314
4327
|
className: stepBtn,
|
|
4315
|
-
children: /* @__PURE__ */
|
|
4328
|
+
children: /* @__PURE__ */ jsx42(ChevronLeft4, { size: 16, "aria-hidden": "true" })
|
|
4316
4329
|
}
|
|
4317
4330
|
),
|
|
4318
4331
|
pageWindow(current, totalPages).map(
|
|
4319
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4332
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx42("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx42(
|
|
4320
4333
|
"button",
|
|
4321
4334
|
{
|
|
4322
4335
|
type: "button",
|
|
@@ -4334,7 +4347,7 @@ function TablePagination({
|
|
|
4334
4347
|
p
|
|
4335
4348
|
)
|
|
4336
4349
|
),
|
|
4337
|
-
/* @__PURE__ */
|
|
4350
|
+
/* @__PURE__ */ jsx42(
|
|
4338
4351
|
"button",
|
|
4339
4352
|
{
|
|
4340
4353
|
type: "button",
|
|
@@ -4343,10 +4356,10 @@ function TablePagination({
|
|
|
4343
4356
|
"aria-label": "Next page",
|
|
4344
4357
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4345
4358
|
className: stepBtn,
|
|
4346
|
-
children: /* @__PURE__ */
|
|
4359
|
+
children: /* @__PURE__ */ jsx42(ChevronRight5, { size: 16, "aria-hidden": "true" })
|
|
4347
4360
|
}
|
|
4348
4361
|
),
|
|
4349
|
-
/* @__PURE__ */
|
|
4362
|
+
/* @__PURE__ */ jsx42(
|
|
4350
4363
|
"button",
|
|
4351
4364
|
{
|
|
4352
4365
|
type: "button",
|
|
@@ -4355,7 +4368,7 @@ function TablePagination({
|
|
|
4355
4368
|
"aria-label": "Last page",
|
|
4356
4369
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4357
4370
|
className: stepBtn,
|
|
4358
|
-
children: /* @__PURE__ */
|
|
4371
|
+
children: /* @__PURE__ */ jsx42(ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4359
4372
|
}
|
|
4360
4373
|
)
|
|
4361
4374
|
] }),
|
|
@@ -4366,7 +4379,7 @@ function TablePagination({
|
|
|
4366
4379
|
// src/DateRangePicker.tsx
|
|
4367
4380
|
import { useEffect as useEffect12, useMemo as useMemo4, useRef as useRef14, useState as useState13 } from "react";
|
|
4368
4381
|
import { ChevronDown as ChevronDown9 } from "lucide-react";
|
|
4369
|
-
import { jsx as
|
|
4382
|
+
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4370
4383
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4371
4384
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4372
4385
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4404,7 +4417,7 @@ function spanLabel2(label, today, formatDate, formatRange) {
|
|
|
4404
4417
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4405
4418
|
}
|
|
4406
4419
|
function MiniSelect({ value, onChange, options }) {
|
|
4407
|
-
return /* @__PURE__ */
|
|
4420
|
+
return /* @__PURE__ */ jsx43(
|
|
4408
4421
|
"select",
|
|
4409
4422
|
{
|
|
4410
4423
|
value: String(value),
|
|
@@ -4413,7 +4426,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4413
4426
|
if (opt) onChange(opt.value);
|
|
4414
4427
|
},
|
|
4415
4428
|
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__ */
|
|
4429
|
+
children: options.map((o) => /* @__PURE__ */ jsx43("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4417
4430
|
}
|
|
4418
4431
|
);
|
|
4419
4432
|
}
|
|
@@ -4478,8 +4491,8 @@ function DateRangePicker({
|
|
|
4478
4491
|
if (showFooter) setDraft(label);
|
|
4479
4492
|
else commit(label);
|
|
4480
4493
|
};
|
|
4481
|
-
return /* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
4494
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4495
|
+
/* @__PURE__ */ jsxs39(
|
|
4483
4496
|
"button",
|
|
4484
4497
|
{
|
|
4485
4498
|
type: "button",
|
|
@@ -4488,16 +4501,16 @@ function DateRangePicker({
|
|
|
4488
4501
|
"aria-haspopup": "listbox",
|
|
4489
4502
|
className: chipTriggerClass(),
|
|
4490
4503
|
children: [
|
|
4491
|
-
/* @__PURE__ */
|
|
4492
|
-
/* @__PURE__ */
|
|
4493
|
-
/* @__PURE__ */
|
|
4504
|
+
/* @__PURE__ */ jsxs39("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4505
|
+
/* @__PURE__ */ jsx43("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate, formatRange) }),
|
|
4506
|
+
/* @__PURE__ */ jsx43("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
|
|
4494
4507
|
] }),
|
|
4495
|
-
/* @__PURE__ */
|
|
4508
|
+
/* @__PURE__ */ jsx43(ChevronDown9, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4496
4509
|
]
|
|
4497
4510
|
}
|
|
4498
4511
|
),
|
|
4499
|
-
open && /* @__PURE__ */
|
|
4500
|
-
presets.map((p) => /* @__PURE__ */
|
|
4512
|
+
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: [
|
|
4513
|
+
presets.map((p) => /* @__PURE__ */ jsx43(
|
|
4501
4514
|
"button",
|
|
4502
4515
|
{
|
|
4503
4516
|
type: "button",
|
|
@@ -4507,26 +4520,26 @@ function DateRangePicker({
|
|
|
4507
4520
|
},
|
|
4508
4521
|
p
|
|
4509
4522
|
)),
|
|
4510
|
-
/* @__PURE__ */
|
|
4511
|
-
/* @__PURE__ */
|
|
4512
|
-
/* @__PURE__ */
|
|
4513
|
-
/* @__PURE__ */
|
|
4523
|
+
/* @__PURE__ */ jsxs39("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4524
|
+
/* @__PURE__ */ jsx43("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4525
|
+
/* @__PURE__ */ jsxs39("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4526
|
+
/* @__PURE__ */ jsxs39("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4514
4527
|
"From",
|
|
4515
|
-
/* @__PURE__ */
|
|
4516
|
-
granularity === "month" && /* @__PURE__ */
|
|
4517
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4518
|
-
/* @__PURE__ */
|
|
4528
|
+
/* @__PURE__ */ jsxs39("span", { className: "flex gap-1", children: [
|
|
4529
|
+
granularity === "month" && /* @__PURE__ */ jsx43(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4530
|
+
granularity === "quarter" && /* @__PURE__ */ jsx43(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4531
|
+
/* @__PURE__ */ jsx43(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4519
4532
|
] })
|
|
4520
4533
|
] }),
|
|
4521
|
-
/* @__PURE__ */
|
|
4534
|
+
/* @__PURE__ */ jsxs39("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4522
4535
|
"To",
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
granularity === "month" && /* @__PURE__ */
|
|
4525
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4526
|
-
/* @__PURE__ */
|
|
4536
|
+
/* @__PURE__ */ jsxs39("span", { className: "flex gap-1", children: [
|
|
4537
|
+
granularity === "month" && /* @__PURE__ */ jsx43(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4538
|
+
granularity === "quarter" && /* @__PURE__ */ jsx43(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4539
|
+
/* @__PURE__ */ jsx43(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4527
4540
|
] })
|
|
4528
4541
|
] }),
|
|
4529
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx43(
|
|
4530
4543
|
"button",
|
|
4531
4544
|
{
|
|
4532
4545
|
type: "button",
|
|
@@ -4538,7 +4551,7 @@ function DateRangePicker({
|
|
|
4538
4551
|
)
|
|
4539
4552
|
] })
|
|
4540
4553
|
] }),
|
|
4541
|
-
showFooter && /* @__PURE__ */
|
|
4554
|
+
showFooter && /* @__PURE__ */ jsx43(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4542
4555
|
] })
|
|
4543
4556
|
] });
|
|
4544
4557
|
}
|
|
@@ -4546,7 +4559,7 @@ function DateRangePicker({
|
|
|
4546
4559
|
// src/MultiSelectFilter.tsx
|
|
4547
4560
|
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef15, useState as useState14 } from "react";
|
|
4548
4561
|
import { ChevronDown as ChevronDown10, Search as Search5, X as X5 } from "lucide-react";
|
|
4549
|
-
import { Fragment as Fragment4, jsx as
|
|
4562
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4550
4563
|
var SEARCH_AFTER = 8;
|
|
4551
4564
|
function MultiSelectFilter({
|
|
4552
4565
|
caption,
|
|
@@ -4644,9 +4657,9 @@ function MultiSelectFilter({
|
|
|
4644
4657
|
const shown = open && !showFooter ? draft : selected;
|
|
4645
4658
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4646
4659
|
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__ */
|
|
4660
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ jsxs40("span", { className: "flex flex-col", children: [
|
|
4661
|
+
/* @__PURE__ */ jsx44("span", { children: label }),
|
|
4662
|
+
/* @__PURE__ */ jsx44("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4650
4663
|
] }) : label;
|
|
4651
4664
|
const ql = q.trim().toLowerCase();
|
|
4652
4665
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4657,8 +4670,8 @@ function MultiSelectFilter({
|
|
|
4657
4670
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4658
4671
|
return kids.length ? { ...g, children: kids } : null;
|
|
4659
4672
|
}).filter((g) => g !== null) : [];
|
|
4660
|
-
return /* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4673
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4674
|
+
/* @__PURE__ */ jsxs40(
|
|
4662
4675
|
"button",
|
|
4663
4676
|
{
|
|
4664
4677
|
type: "button",
|
|
@@ -4667,8 +4680,8 @@ function MultiSelectFilter({
|
|
|
4667
4680
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4668
4681
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4669
4682
|
children: [
|
|
4670
|
-
/* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4683
|
+
/* @__PURE__ */ jsx44(ChipContent, { caption, value, icon }),
|
|
4684
|
+
/* @__PURE__ */ jsx44(
|
|
4672
4685
|
ChevronDown10,
|
|
4673
4686
|
{
|
|
4674
4687
|
size: 14,
|
|
@@ -4679,7 +4692,7 @@ function MultiSelectFilter({
|
|
|
4679
4692
|
]
|
|
4680
4693
|
}
|
|
4681
4694
|
),
|
|
4682
|
-
open && /* @__PURE__ */
|
|
4695
|
+
open && /* @__PURE__ */ jsx44(
|
|
4683
4696
|
"div",
|
|
4684
4697
|
{
|
|
4685
4698
|
className: cn(
|
|
@@ -4690,10 +4703,10 @@ function MultiSelectFilter({
|
|
|
4690
4703
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4691
4704
|
role: "dialog",
|
|
4692
4705
|
"aria-label": caption,
|
|
4693
|
-
children: loading ? /* @__PURE__ */
|
|
4694
|
-
showSearch && /* @__PURE__ */
|
|
4695
|
-
/* @__PURE__ */
|
|
4696
|
-
/* @__PURE__ */
|
|
4706
|
+
children: loading ? /* @__PURE__ */ jsx44(MenuLoading, {}) : error ? /* @__PURE__ */ jsx44(MenuError, { onRetry }) : /* @__PURE__ */ jsxs40(Fragment4, { children: [
|
|
4707
|
+
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: [
|
|
4708
|
+
/* @__PURE__ */ jsx44(Search5, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4709
|
+
/* @__PURE__ */ jsx44(
|
|
4697
4710
|
"input",
|
|
4698
4711
|
{
|
|
4699
4712
|
type: "text",
|
|
@@ -4703,37 +4716,37 @@ function MultiSelectFilter({
|
|
|
4703
4716
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4704
4717
|
}
|
|
4705
4718
|
),
|
|
4706
|
-
q && /* @__PURE__ */
|
|
4719
|
+
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
4720
|
] }) }),
|
|
4708
|
-
/* @__PURE__ */
|
|
4721
|
+
/* @__PURE__ */ jsxs40("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4709
4722
|
groups ? visibleGroups.map((g) => {
|
|
4710
4723
|
const state = groupState(g);
|
|
4711
|
-
return /* @__PURE__ */
|
|
4712
|
-
/* @__PURE__ */
|
|
4724
|
+
return /* @__PURE__ */ jsxs40("div", { children: [
|
|
4725
|
+
/* @__PURE__ */ jsxs40(
|
|
4713
4726
|
"button",
|
|
4714
4727
|
{
|
|
4715
4728
|
type: "button",
|
|
4716
4729
|
onClick: () => toggleGroup(g),
|
|
4717
4730
|
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
4731
|
children: [
|
|
4719
|
-
/* @__PURE__ */
|
|
4720
|
-
/* @__PURE__ */
|
|
4721
|
-
counts && /* @__PURE__ */
|
|
4732
|
+
/* @__PURE__ */ jsx44(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
4733
|
+
/* @__PURE__ */ jsx44("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
4734
|
+
counts && /* @__PURE__ */ jsx44(OptionCount, { n: countFor(g.id) })
|
|
4722
4735
|
]
|
|
4723
4736
|
}
|
|
4724
4737
|
),
|
|
4725
4738
|
g.children.map((c) => {
|
|
4726
4739
|
const checked = draft.includes(c.id);
|
|
4727
|
-
return /* @__PURE__ */
|
|
4740
|
+
return /* @__PURE__ */ jsxs40(
|
|
4728
4741
|
"button",
|
|
4729
4742
|
{
|
|
4730
4743
|
type: "button",
|
|
4731
4744
|
onClick: () => toggle(c.id),
|
|
4732
4745
|
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
4746
|
children: [
|
|
4734
|
-
/* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
4736
|
-
counts && /* @__PURE__ */
|
|
4747
|
+
/* @__PURE__ */ jsx44(CheckBoxBox, { checked }),
|
|
4748
|
+
/* @__PURE__ */ jsx44("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
4749
|
+
counts && /* @__PURE__ */ jsx44(OptionCount, { n: countFor(c.id) })
|
|
4737
4750
|
]
|
|
4738
4751
|
},
|
|
4739
4752
|
c.id
|
|
@@ -4742,25 +4755,25 @@ function MultiSelectFilter({
|
|
|
4742
4755
|
] }, g.id);
|
|
4743
4756
|
}) : items.map((o) => {
|
|
4744
4757
|
const checked = draft.includes(o.id);
|
|
4745
|
-
return /* @__PURE__ */
|
|
4758
|
+
return /* @__PURE__ */ jsxs40(
|
|
4746
4759
|
"button",
|
|
4747
4760
|
{
|
|
4748
4761
|
type: "button",
|
|
4749
4762
|
onClick: () => toggle(o.id),
|
|
4750
4763
|
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
4764
|
children: [
|
|
4752
|
-
/* @__PURE__ */
|
|
4753
|
-
/* @__PURE__ */
|
|
4754
|
-
counts && /* @__PURE__ */
|
|
4765
|
+
/* @__PURE__ */ jsx44(CheckBoxBox, { checked }),
|
|
4766
|
+
/* @__PURE__ */ jsx44("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
4767
|
+
counts && /* @__PURE__ */ jsx44(OptionCount, { n: countFor(o.id) })
|
|
4755
4768
|
]
|
|
4756
4769
|
},
|
|
4757
4770
|
o.id
|
|
4758
4771
|
);
|
|
4759
4772
|
}),
|
|
4760
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */
|
|
4773
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ jsx44("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4761
4774
|
] }),
|
|
4762
|
-
note && /* @__PURE__ */
|
|
4763
|
-
showFooter ? /* @__PURE__ */
|
|
4775
|
+
note && /* @__PURE__ */ jsx44("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4776
|
+
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
4777
|
"button",
|
|
4765
4778
|
{
|
|
4766
4779
|
type: "button",
|
|
@@ -4778,7 +4791,7 @@ function MultiSelectFilter({
|
|
|
4778
4791
|
] });
|
|
4779
4792
|
}
|
|
4780
4793
|
function OptionCount({ n }) {
|
|
4781
|
-
return /* @__PURE__ */
|
|
4794
|
+
return /* @__PURE__ */ jsxs40("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4782
4795
|
"(",
|
|
4783
4796
|
n.toLocaleString(),
|
|
4784
4797
|
")"
|
|
@@ -4787,7 +4800,7 @@ function OptionCount({ n }) {
|
|
|
4787
4800
|
|
|
4788
4801
|
// src/Toggle.tsx
|
|
4789
4802
|
import { forwardRef as forwardRef8 } from "react";
|
|
4790
|
-
import { jsx as
|
|
4803
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4791
4804
|
var SIZES2 = {
|
|
4792
4805
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4793
4806
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
@@ -4795,7 +4808,7 @@ var SIZES2 = {
|
|
|
4795
4808
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4796
4809
|
var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4797
4810
|
const s = SIZES2[size];
|
|
4798
|
-
return /* @__PURE__ */
|
|
4811
|
+
return /* @__PURE__ */ jsx45(
|
|
4799
4812
|
"button",
|
|
4800
4813
|
{
|
|
4801
4814
|
ref,
|
|
@@ -4814,7 +4827,7 @@ var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md
|
|
|
4814
4827
|
disabled && "cursor-not-allowed opacity-50",
|
|
4815
4828
|
className
|
|
4816
4829
|
),
|
|
4817
|
-
children: /* @__PURE__ */
|
|
4830
|
+
children: /* @__PURE__ */ jsx45(
|
|
4818
4831
|
"span",
|
|
4819
4832
|
{
|
|
4820
4833
|
className: cn(
|
|
@@ -4832,20 +4845,20 @@ Toggle.displayName = "Toggle";
|
|
|
4832
4845
|
// src/AISpark.tsx
|
|
4833
4846
|
import { useId as useId6 } from "react";
|
|
4834
4847
|
import { Sparkles } from "lucide-react";
|
|
4835
|
-
import { Fragment as Fragment5, jsx as
|
|
4848
|
+
import { Fragment as Fragment5, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4836
4849
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4837
4850
|
const id = useId6();
|
|
4838
|
-
return /* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
/* @__PURE__ */
|
|
4841
|
-
/* @__PURE__ */
|
|
4851
|
+
return /* @__PURE__ */ jsxs41(Fragment5, { children: [
|
|
4852
|
+
/* @__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: [
|
|
4853
|
+
/* @__PURE__ */ jsx46("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
4854
|
+
/* @__PURE__ */ jsx46("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4842
4855
|
] }) }) }),
|
|
4843
|
-
/* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsx46(Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4844
4857
|
] });
|
|
4845
4858
|
}
|
|
4846
4859
|
|
|
4847
4860
|
// src/Freshness.tsx
|
|
4848
|
-
import { jsx as
|
|
4861
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4849
4862
|
var dotColor = {
|
|
4850
4863
|
fresh: "bg-status-success",
|
|
4851
4864
|
recent: "bg-status-warning",
|
|
@@ -4857,7 +4870,7 @@ var srLabel = {
|
|
|
4857
4870
|
stale: "Older than a day"
|
|
4858
4871
|
};
|
|
4859
4872
|
function Freshness({ level, className, testIdPrefix }) {
|
|
4860
|
-
return /* @__PURE__ */
|
|
4873
|
+
return /* @__PURE__ */ jsx47(
|
|
4861
4874
|
"span",
|
|
4862
4875
|
{
|
|
4863
4876
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -4869,42 +4882,42 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
4869
4882
|
}
|
|
4870
4883
|
|
|
4871
4884
|
// src/SectionHeading.tsx
|
|
4872
|
-
import { jsx as
|
|
4885
|
+
import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4873
4886
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
4874
|
-
return /* @__PURE__ */
|
|
4875
|
-
/* @__PURE__ */
|
|
4876
|
-
/* @__PURE__ */
|
|
4877
|
-
description && /* @__PURE__ */
|
|
4887
|
+
return /* @__PURE__ */ jsxs42("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4888
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0", children: [
|
|
4889
|
+
/* @__PURE__ */ jsx48(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4890
|
+
description && /* @__PURE__ */ jsx48("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
|
|
4878
4891
|
] }),
|
|
4879
|
-
actions && /* @__PURE__ */
|
|
4892
|
+
actions && /* @__PURE__ */ jsx48("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4880
4893
|
] });
|
|
4881
4894
|
}
|
|
4882
4895
|
|
|
4883
4896
|
// src/PageHeader.tsx
|
|
4884
4897
|
import { ArrowLeft } from "lucide-react";
|
|
4885
|
-
import { jsx as
|
|
4898
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4886
4899
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
4887
|
-
return /* @__PURE__ */
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
back && /* @__PURE__ */
|
|
4900
|
+
return /* @__PURE__ */ jsxs43("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
|
|
4901
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0", children: [
|
|
4902
|
+
back && /* @__PURE__ */ jsxs43(
|
|
4890
4903
|
"a",
|
|
4891
4904
|
{
|
|
4892
4905
|
href: back.href ?? "#",
|
|
4893
4906
|
onClick: back.onClick,
|
|
4894
4907
|
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
4908
|
children: [
|
|
4896
|
-
/* @__PURE__ */
|
|
4909
|
+
/* @__PURE__ */ jsx49(ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4897
4910
|
back.label
|
|
4898
4911
|
]
|
|
4899
4912
|
}
|
|
4900
4913
|
),
|
|
4901
|
-
meta ? /* @__PURE__ */
|
|
4902
|
-
/* @__PURE__ */
|
|
4914
|
+
meta ? /* @__PURE__ */ jsxs43("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
|
|
4915
|
+
/* @__PURE__ */ jsx49("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4903
4916
|
meta
|
|
4904
|
-
] }) : /* @__PURE__ */
|
|
4905
|
-
description && /* @__PURE__ */
|
|
4917
|
+
] }) : /* @__PURE__ */ jsx49("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4918
|
+
description && /* @__PURE__ */ jsx49("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
|
|
4906
4919
|
] }),
|
|
4907
|
-
actions && /* @__PURE__ */
|
|
4920
|
+
actions && /* @__PURE__ */ jsx49("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4908
4921
|
] });
|
|
4909
4922
|
}
|
|
4910
4923
|
|
|
@@ -4912,7 +4925,7 @@ function PageHeader({ title, description, actions, meta, back, className, testId
|
|
|
4912
4925
|
import { useEffect as useEffect14, useId as useId7, useRef as useRef16, useState as useState15 } from "react";
|
|
4913
4926
|
import { createPortal as createPortal7 } from "react-dom";
|
|
4914
4927
|
import { X as X6 } from "lucide-react";
|
|
4915
|
-
import { jsx as
|
|
4928
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4916
4929
|
var WIDTH = {
|
|
4917
4930
|
sm: "max-w-110",
|
|
4918
4931
|
md: "max-w-160",
|
|
@@ -4976,7 +4989,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4976
4989
|
}, [open, mounted]);
|
|
4977
4990
|
if (!mounted || typeof document === "undefined") return null;
|
|
4978
4991
|
return createPortal7(
|
|
4979
|
-
/* @__PURE__ */
|
|
4992
|
+
/* @__PURE__ */ jsx50(
|
|
4980
4993
|
"div",
|
|
4981
4994
|
{
|
|
4982
4995
|
className: cn(
|
|
@@ -4984,7 +4997,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4984
4997
|
shown ? "opacity-100" : "opacity-0"
|
|
4985
4998
|
),
|
|
4986
4999
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
4987
|
-
children: /* @__PURE__ */
|
|
5000
|
+
children: /* @__PURE__ */ jsxs44(
|
|
4988
5001
|
"div",
|
|
4989
5002
|
{
|
|
4990
5003
|
ref: panel,
|
|
@@ -5002,24 +5015,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5002
5015
|
className
|
|
5003
5016
|
),
|
|
5004
5017
|
children: [
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
/* @__PURE__ */
|
|
5007
|
-
/* @__PURE__ */
|
|
5008
|
-
description && /* @__PURE__ */
|
|
5018
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5019
|
+
/* @__PURE__ */ jsxs44("div", { className: "min-w-0 flex-1", children: [
|
|
5020
|
+
/* @__PURE__ */ jsx50("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5021
|
+
description && /* @__PURE__ */ jsx50("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5009
5022
|
] }),
|
|
5010
|
-
/* @__PURE__ */
|
|
5023
|
+
/* @__PURE__ */ jsx50(
|
|
5011
5024
|
"button",
|
|
5012
5025
|
{
|
|
5013
5026
|
type: "button",
|
|
5014
5027
|
onClick: onClose,
|
|
5015
5028
|
"aria-label": "Close",
|
|
5016
5029
|
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__ */
|
|
5030
|
+
children: /* @__PURE__ */ jsx50(X6, { size: 16, "aria-hidden": "true" })
|
|
5018
5031
|
}
|
|
5019
5032
|
)
|
|
5020
5033
|
] }),
|
|
5021
|
-
children && /* @__PURE__ */
|
|
5022
|
-
footer && /* @__PURE__ */
|
|
5034
|
+
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 }),
|
|
5035
|
+
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
5036
|
]
|
|
5024
5037
|
}
|
|
5025
5038
|
)
|
|
@@ -5030,10 +5043,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5030
5043
|
}
|
|
5031
5044
|
|
|
5032
5045
|
// src/EmptyState.tsx
|
|
5033
|
-
import { jsx as
|
|
5046
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
5034
5047
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
5035
5048
|
const md = size === "md";
|
|
5036
|
-
return /* @__PURE__ */
|
|
5049
|
+
return /* @__PURE__ */ jsxs45(
|
|
5037
5050
|
"div",
|
|
5038
5051
|
{
|
|
5039
5052
|
className: cn(
|
|
@@ -5043,7 +5056,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5043
5056
|
),
|
|
5044
5057
|
"data-testid": testIdPrefix,
|
|
5045
5058
|
children: [
|
|
5046
|
-
icon && /* @__PURE__ */
|
|
5059
|
+
icon && /* @__PURE__ */ jsx51(
|
|
5047
5060
|
"span",
|
|
5048
5061
|
{
|
|
5049
5062
|
"aria-hidden": "true",
|
|
@@ -5054,9 +5067,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5054
5067
|
children: icon
|
|
5055
5068
|
}
|
|
5056
5069
|
),
|
|
5057
|
-
/* @__PURE__ */
|
|
5058
|
-
description && /* @__PURE__ */
|
|
5059
|
-
action && /* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ jsx51("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
|
|
5071
|
+
description && /* @__PURE__ */ jsx51("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
|
|
5072
|
+
action && /* @__PURE__ */ jsx51("div", { className: md ? "mt-3" : "mt-2", children: action })
|
|
5060
5073
|
]
|
|
5061
5074
|
}
|
|
5062
5075
|
);
|
|
@@ -5064,7 +5077,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5064
5077
|
|
|
5065
5078
|
// src/TextField.tsx
|
|
5066
5079
|
import { forwardRef as forwardRef9, useId as useId8 } from "react";
|
|
5067
|
-
import { jsx as
|
|
5080
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5068
5081
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
5069
5082
|
var TextField = forwardRef9(
|
|
5070
5083
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
@@ -5072,9 +5085,9 @@ var TextField = forwardRef9(
|
|
|
5072
5085
|
const fieldId = id ?? auto;
|
|
5073
5086
|
const noteId = `${fieldId}-note`;
|
|
5074
5087
|
const note = error ?? hint;
|
|
5075
|
-
return /* @__PURE__ */
|
|
5076
|
-
label && /* @__PURE__ */
|
|
5077
|
-
/* @__PURE__ */
|
|
5088
|
+
return /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
|
|
5089
|
+
label && /* @__PURE__ */ jsx52("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
|
|
5090
|
+
/* @__PURE__ */ jsxs46(
|
|
5078
5091
|
"div",
|
|
5079
5092
|
{
|
|
5080
5093
|
className: cn(
|
|
@@ -5084,8 +5097,8 @@ var TextField = forwardRef9(
|
|
|
5084
5097
|
disabled && "opacity-50"
|
|
5085
5098
|
),
|
|
5086
5099
|
children: [
|
|
5087
|
-
icon && /* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5100
|
+
icon && /* @__PURE__ */ jsx52("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5101
|
+
/* @__PURE__ */ jsx52(
|
|
5089
5102
|
"input",
|
|
5090
5103
|
{
|
|
5091
5104
|
ref,
|
|
@@ -5100,7 +5113,7 @@ var TextField = forwardRef9(
|
|
|
5100
5113
|
]
|
|
5101
5114
|
}
|
|
5102
5115
|
),
|
|
5103
|
-
note && /* @__PURE__ */
|
|
5116
|
+
note && /* @__PURE__ */ jsx52("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
5104
5117
|
] });
|
|
5105
5118
|
}
|
|
5106
5119
|
);
|
|
@@ -5110,7 +5123,7 @@ TextField.displayName = "TextField";
|
|
|
5110
5123
|
import { useEffect as useEffect15, useId as useId9, useRef as useRef17, useState as useState16 } from "react";
|
|
5111
5124
|
import { createPortal as createPortal8 } from "react-dom";
|
|
5112
5125
|
import { X as X7 } from "lucide-react";
|
|
5113
|
-
import { jsx as
|
|
5126
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5114
5127
|
var WIDTH2 = {
|
|
5115
5128
|
sm: "max-w-110",
|
|
5116
5129
|
md: "max-w-160",
|
|
@@ -5171,8 +5184,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5171
5184
|
}, [open, mounted]);
|
|
5172
5185
|
if (!mounted || typeof document === "undefined") return null;
|
|
5173
5186
|
return createPortal8(
|
|
5174
|
-
/* @__PURE__ */
|
|
5175
|
-
/* @__PURE__ */
|
|
5187
|
+
/* @__PURE__ */ jsxs47("div", { className: "fixed inset-0 z-modal", children: [
|
|
5188
|
+
/* @__PURE__ */ jsx53(
|
|
5176
5189
|
"div",
|
|
5177
5190
|
{
|
|
5178
5191
|
"aria-hidden": "true",
|
|
@@ -5186,7 +5199,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5186
5199
|
)
|
|
5187
5200
|
}
|
|
5188
5201
|
),
|
|
5189
|
-
/* @__PURE__ */
|
|
5202
|
+
/* @__PURE__ */ jsxs47(
|
|
5190
5203
|
"div",
|
|
5191
5204
|
{
|
|
5192
5205
|
ref: panel,
|
|
@@ -5203,24 +5216,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5203
5216
|
className
|
|
5204
5217
|
),
|
|
5205
5218
|
children: [
|
|
5206
|
-
/* @__PURE__ */
|
|
5207
|
-
/* @__PURE__ */
|
|
5208
|
-
/* @__PURE__ */
|
|
5209
|
-
description && /* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5220
|
+
/* @__PURE__ */ jsxs47("div", { className: "min-w-0 flex-1", children: [
|
|
5221
|
+
/* @__PURE__ */ jsx53("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5222
|
+
description && /* @__PURE__ */ jsx53("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5210
5223
|
] }),
|
|
5211
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ jsx53(
|
|
5212
5225
|
"button",
|
|
5213
5226
|
{
|
|
5214
5227
|
type: "button",
|
|
5215
5228
|
onClick: onClose,
|
|
5216
5229
|
"aria-label": "Close",
|
|
5217
5230
|
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__ */
|
|
5231
|
+
children: /* @__PURE__ */ jsx53(X7, { size: 16, "aria-hidden": "true" })
|
|
5219
5232
|
}
|
|
5220
5233
|
)
|
|
5221
5234
|
] }),
|
|
5222
|
-
/* @__PURE__ */
|
|
5223
|
-
footer && /* @__PURE__ */
|
|
5235
|
+
/* @__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 }),
|
|
5236
|
+
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
5237
|
]
|
|
5225
5238
|
}
|
|
5226
5239
|
)
|
|
@@ -5231,7 +5244,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5231
5244
|
|
|
5232
5245
|
// src/DataTable.tsx
|
|
5233
5246
|
import { useId as useId10 } from "react";
|
|
5234
|
-
import { jsx as
|
|
5247
|
+
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5235
5248
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5236
5249
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5237
5250
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
@@ -5264,20 +5277,20 @@ function DataTable({
|
|
|
5264
5277
|
const col = columns.find((c) => c.key === key);
|
|
5265
5278
|
onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
|
|
5266
5279
|
};
|
|
5267
|
-
return /* @__PURE__ */
|
|
5280
|
+
return /* @__PURE__ */ jsxs48(
|
|
5268
5281
|
"div",
|
|
5269
5282
|
{
|
|
5270
5283
|
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
|
|
5271
5284
|
"data-testid": testIdPrefix,
|
|
5272
5285
|
children: [
|
|
5273
|
-
title && /* @__PURE__ */
|
|
5274
|
-
/* @__PURE__ */
|
|
5275
|
-
/* @__PURE__ */
|
|
5276
|
-
subtitle && /* @__PURE__ */
|
|
5286
|
+
title && /* @__PURE__ */ jsxs48("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5287
|
+
/* @__PURE__ */ jsxs48("div", { className: "min-w-0", children: [
|
|
5288
|
+
/* @__PURE__ */ jsx54("h3", { id: titleId, className: "text-style-card-title", children: title }),
|
|
5289
|
+
subtitle && /* @__PURE__ */ jsx54("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
|
|
5277
5290
|
] }),
|
|
5278
|
-
action && /* @__PURE__ */
|
|
5291
|
+
action && /* @__PURE__ */ jsx54("div", { className: "shrink-0", children: action })
|
|
5279
5292
|
] }),
|
|
5280
|
-
/* @__PURE__ */
|
|
5293
|
+
/* @__PURE__ */ jsx54("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ jsxs48(
|
|
5281
5294
|
"table",
|
|
5282
5295
|
{
|
|
5283
5296
|
"aria-labelledby": title ? titleId : void 0,
|
|
@@ -5285,13 +5298,13 @@ function DataTable({
|
|
|
5285
5298
|
"aria-busy": loading || void 0,
|
|
5286
5299
|
className: "w-full border-collapse text-left",
|
|
5287
5300
|
children: [
|
|
5288
|
-
/* @__PURE__ */
|
|
5301
|
+
/* @__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
5302
|
"th",
|
|
5290
5303
|
{
|
|
5291
5304
|
scope: "col",
|
|
5292
5305
|
"aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
|
|
5293
|
-
className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5294
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */
|
|
5306
|
+
className: cn("whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5307
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ jsx54(
|
|
5295
5308
|
SortButton,
|
|
5296
5309
|
{
|
|
5297
5310
|
label: c.label,
|
|
@@ -5305,7 +5318,7 @@ function DataTable({
|
|
|
5305
5318
|
},
|
|
5306
5319
|
c.key
|
|
5307
5320
|
)) }) }),
|
|
5308
|
-
/* @__PURE__ */
|
|
5321
|
+
/* @__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
5322
|
"span",
|
|
5310
5323
|
{
|
|
5311
5324
|
className: cn(
|
|
@@ -5313,7 +5326,7 @@ function DataTable({
|
|
|
5313
5326
|
c.numeric ? "w-12" : "w-2/3"
|
|
5314
5327
|
)
|
|
5315
5328
|
}
|
|
5316
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */
|
|
5329
|
+
) }, 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
5330
|
"td",
|
|
5318
5331
|
{
|
|
5319
5332
|
className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
|
|
@@ -5324,14 +5337,14 @@ function DataTable({
|
|
|
5324
5337
|
]
|
|
5325
5338
|
}
|
|
5326
5339
|
) }),
|
|
5327
|
-
footer && /* @__PURE__ */
|
|
5340
|
+
footer && /* @__PURE__ */ jsx54("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
5328
5341
|
]
|
|
5329
5342
|
}
|
|
5330
5343
|
);
|
|
5331
5344
|
}
|
|
5332
5345
|
|
|
5333
5346
|
// src/MediaLabel.tsx
|
|
5334
|
-
import { jsx as
|
|
5347
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
5335
5348
|
var FILL = {
|
|
5336
5349
|
TV: "bg-media-tv",
|
|
5337
5350
|
CTV: "bg-media-ctv",
|
|
@@ -5342,7 +5355,7 @@ var FILL = {
|
|
|
5342
5355
|
Magazine: "bg-media-magazine"
|
|
5343
5356
|
};
|
|
5344
5357
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5345
|
-
return /* @__PURE__ */
|
|
5358
|
+
return /* @__PURE__ */ jsx55(
|
|
5346
5359
|
"span",
|
|
5347
5360
|
{
|
|
5348
5361
|
className: cn(
|
|
@@ -5358,9 +5371,9 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5358
5371
|
|
|
5359
5372
|
// src/SuggestionChip.tsx
|
|
5360
5373
|
import { forwardRef as forwardRef10 } from "react";
|
|
5361
|
-
import { jsx as
|
|
5374
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5362
5375
|
var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5363
|
-
return /* @__PURE__ */
|
|
5376
|
+
return /* @__PURE__ */ jsx56(
|
|
5364
5377
|
"button",
|
|
5365
5378
|
{
|
|
5366
5379
|
ref,
|
|
@@ -5371,7 +5384,7 @@ var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className
|
|
|
5371
5384
|
"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
5385
|
className
|
|
5373
5386
|
),
|
|
5374
|
-
children: /* @__PURE__ */
|
|
5387
|
+
children: /* @__PURE__ */ jsx56("span", { className: "truncate", children })
|
|
5375
5388
|
}
|
|
5376
5389
|
);
|
|
5377
5390
|
});
|
|
@@ -5379,10 +5392,10 @@ SuggestionChip.displayName = "SuggestionChip";
|
|
|
5379
5392
|
|
|
5380
5393
|
// src/ToggleChip.tsx
|
|
5381
5394
|
import { forwardRef as forwardRef11 } from "react";
|
|
5382
|
-
import { Check as
|
|
5383
|
-
import { jsx as
|
|
5395
|
+
import { Check as Check9 } from "lucide-react";
|
|
5396
|
+
import { jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5384
5397
|
var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5385
|
-
return /* @__PURE__ */
|
|
5398
|
+
return /* @__PURE__ */ jsxs49(
|
|
5386
5399
|
"button",
|
|
5387
5400
|
{
|
|
5388
5401
|
ref,
|
|
@@ -5400,7 +5413,7 @@ var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, childre
|
|
|
5400
5413
|
className
|
|
5401
5414
|
),
|
|
5402
5415
|
children: [
|
|
5403
|
-
selected && /* @__PURE__ */
|
|
5416
|
+
selected && /* @__PURE__ */ jsx57(Check9, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5404
5417
|
children
|
|
5405
5418
|
]
|
|
5406
5419
|
}
|
|
@@ -5410,8 +5423,8 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
5410
5423
|
|
|
5411
5424
|
// src/CopyButton.tsx
|
|
5412
5425
|
import { forwardRef as forwardRef12, useEffect as useEffect16, useRef as useRef18, useState as useState17 } from "react";
|
|
5413
|
-
import { Check as
|
|
5414
|
-
import { jsx as
|
|
5426
|
+
import { Check as Check10, Copy } from "lucide-react";
|
|
5427
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5415
5428
|
var CONFIRM_MS = 2e3;
|
|
5416
5429
|
var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5417
5430
|
const [copied, setCopied] = useState17(false);
|
|
@@ -5428,8 +5441,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5428
5441
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5429
5442
|
};
|
|
5430
5443
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5431
|
-
const icon = copied ? /* @__PURE__ */
|
|
5432
|
-
return /* @__PURE__ */
|
|
5444
|
+
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" });
|
|
5445
|
+
return /* @__PURE__ */ jsxs50(
|
|
5433
5446
|
Button,
|
|
5434
5447
|
{
|
|
5435
5448
|
ref,
|
|
@@ -5443,8 +5456,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5443
5456
|
className: cn(!copied && "text-text-secondary", className),
|
|
5444
5457
|
children: [
|
|
5445
5458
|
icon,
|
|
5446
|
-
label && /* @__PURE__ */
|
|
5447
|
-
/* @__PURE__ */
|
|
5459
|
+
label && /* @__PURE__ */ jsx58("span", { children: copied ? "Copied" : label }),
|
|
5460
|
+
/* @__PURE__ */ jsx58("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5448
5461
|
]
|
|
5449
5462
|
}
|
|
5450
5463
|
);
|
|
@@ -5453,7 +5466,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
5453
5466
|
|
|
5454
5467
|
// src/InlineMessage.tsx
|
|
5455
5468
|
import { AlertTriangle as AlertTriangle2, CheckCircle2, Info as Info3, X as X8, XCircle } from "lucide-react";
|
|
5456
|
-
import { jsx as
|
|
5469
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5457
5470
|
var BOX = {
|
|
5458
5471
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5459
5472
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5470,27 +5483,27 @@ var ICON_INK = {
|
|
|
5470
5483
|
var ICON2 = { info: Info3, success: CheckCircle2, warning: AlertTriangle2, danger: XCircle };
|
|
5471
5484
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5472
5485
|
const Icon = ICON2[tone];
|
|
5473
|
-
return /* @__PURE__ */
|
|
5486
|
+
return /* @__PURE__ */ jsxs51(
|
|
5474
5487
|
"div",
|
|
5475
5488
|
{
|
|
5476
5489
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5477
5490
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5478
5491
|
"data-testid": testIdPrefix,
|
|
5479
5492
|
children: [
|
|
5480
|
-
/* @__PURE__ */
|
|
5481
|
-
/* @__PURE__ */
|
|
5482
|
-
/* @__PURE__ */
|
|
5483
|
-
children && /* @__PURE__ */
|
|
5484
|
-
actions && /* @__PURE__ */
|
|
5493
|
+
/* @__PURE__ */ jsx59(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
5494
|
+
/* @__PURE__ */ jsxs51("div", { className: "min-w-0 flex-1", children: [
|
|
5495
|
+
/* @__PURE__ */ jsx59("p", { className: "font-semibold text-text-primary", children: title }),
|
|
5496
|
+
children && /* @__PURE__ */ jsx59("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
5497
|
+
actions && /* @__PURE__ */ jsx59("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
5485
5498
|
] }),
|
|
5486
|
-
onDismiss && /* @__PURE__ */
|
|
5499
|
+
onDismiss && /* @__PURE__ */ jsx59(
|
|
5487
5500
|
"button",
|
|
5488
5501
|
{
|
|
5489
5502
|
type: "button",
|
|
5490
5503
|
onClick: onDismiss,
|
|
5491
5504
|
"aria-label": "Dismiss",
|
|
5492
5505
|
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__ */
|
|
5506
|
+
children: /* @__PURE__ */ jsx59(X8, { size: 14, "aria-hidden": "true" })
|
|
5494
5507
|
}
|
|
5495
5508
|
)
|
|
5496
5509
|
]
|
|
@@ -5501,7 +5514,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5501
5514
|
// src/FilterDrawer.tsx
|
|
5502
5515
|
import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect6, useRef as useRef19, useState as useState18 } from "react";
|
|
5503
5516
|
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight6 } from "lucide-react";
|
|
5504
|
-
import { jsx as
|
|
5517
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5505
5518
|
var SLIDE_MS = 200;
|
|
5506
5519
|
function reducedMotion() {
|
|
5507
5520
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5563,8 +5576,8 @@ function FilterDrawer({
|
|
|
5563
5576
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5564
5577
|
const panel = (v, rows = true) => {
|
|
5565
5578
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5566
|
-
if (s) return /* @__PURE__ */
|
|
5567
|
-
return /* @__PURE__ */
|
|
5579
|
+
if (s) return /* @__PURE__ */ jsx60("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
5580
|
+
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
5581
|
"button",
|
|
5569
5582
|
{
|
|
5570
5583
|
ref: rows ? (el) => {
|
|
@@ -5576,7 +5589,7 @@ function FilterDrawer({
|
|
|
5576
5589
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5577
5590
|
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
5591
|
children: [
|
|
5579
|
-
/* @__PURE__ */
|
|
5592
|
+
/* @__PURE__ */ jsx60(
|
|
5580
5593
|
x.icon,
|
|
5581
5594
|
{
|
|
5582
5595
|
size: 17,
|
|
@@ -5584,22 +5597,22 @@ function FilterDrawer({
|
|
|
5584
5597
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5585
5598
|
}
|
|
5586
5599
|
),
|
|
5587
|
-
/* @__PURE__ */
|
|
5588
|
-
x.badge && /* @__PURE__ */
|
|
5589
|
-
/* @__PURE__ */
|
|
5600
|
+
/* @__PURE__ */ jsx60("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
5601
|
+
x.badge && /* @__PURE__ */ jsx60(Badge, { tone: "brand", children: x.badge }),
|
|
5602
|
+
/* @__PURE__ */ jsx60(ChevronRight6, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5590
5603
|
]
|
|
5591
5604
|
}
|
|
5592
5605
|
) }, x.id)) });
|
|
5593
5606
|
};
|
|
5594
|
-
return /* @__PURE__ */
|
|
5607
|
+
return /* @__PURE__ */ jsx60(
|
|
5595
5608
|
Drawer,
|
|
5596
5609
|
{
|
|
5597
5610
|
open,
|
|
5598
5611
|
onClose,
|
|
5599
5612
|
size,
|
|
5600
5613
|
testIdPrefix,
|
|
5601
|
-
title: focused ? /* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
5614
|
+
title: focused ? /* @__PURE__ */ jsxs52("span", { className: "flex items-center gap-1.5", children: [
|
|
5615
|
+
/* @__PURE__ */ jsx60(
|
|
5603
5616
|
"button",
|
|
5604
5617
|
{
|
|
5605
5618
|
ref: backRef,
|
|
@@ -5608,23 +5621,23 @@ function FilterDrawer({
|
|
|
5608
5621
|
"aria-label": "Back to all filters",
|
|
5609
5622
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5610
5623
|
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__ */
|
|
5624
|
+
children: /* @__PURE__ */ jsx60(ChevronLeft5, { size: 18, "aria-hidden": "true" })
|
|
5612
5625
|
}
|
|
5613
5626
|
),
|
|
5614
5627
|
focused.label,
|
|
5615
|
-
focused.info && /* @__PURE__ */
|
|
5616
|
-
] }) : /* @__PURE__ */
|
|
5628
|
+
focused.info && /* @__PURE__ */ jsx60(InfoTip, { text: focused.info, label: `About ${focused.label}` })
|
|
5629
|
+
] }) : /* @__PURE__ */ jsxs52("span", { className: "flex items-center gap-2.5", children: [
|
|
5617
5630
|
"Filters",
|
|
5618
|
-
activeCount > 0 && /* @__PURE__ */
|
|
5631
|
+
activeCount > 0 && /* @__PURE__ */ jsx60(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5619
5632
|
] }),
|
|
5620
5633
|
footer: focused ? (
|
|
5621
5634
|
// 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__ */
|
|
5635
|
+
/* @__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" }) })
|
|
5636
|
+
) : /* @__PURE__ */ jsxs52("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
5637
|
+
/* @__PURE__ */ jsx60(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
5638
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-2", children: [
|
|
5639
|
+
/* @__PURE__ */ jsx60(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
5640
|
+
/* @__PURE__ */ jsx60(
|
|
5628
5641
|
Button,
|
|
5629
5642
|
{
|
|
5630
5643
|
variant: "primary",
|
|
@@ -5638,8 +5651,8 @@ function FilterDrawer({
|
|
|
5638
5651
|
)
|
|
5639
5652
|
] })
|
|
5640
5653
|
] }),
|
|
5641
|
-
children: /* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5654
|
+
children: /* @__PURE__ */ jsxs52("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
5655
|
+
/* @__PURE__ */ jsx60(
|
|
5643
5656
|
"div",
|
|
5644
5657
|
{
|
|
5645
5658
|
style: { transform: incoming },
|
|
@@ -5648,7 +5661,7 @@ function FilterDrawer({
|
|
|
5648
5661
|
},
|
|
5649
5662
|
view ?? "__list"
|
|
5650
5663
|
),
|
|
5651
|
-
leaving && /* @__PURE__ */
|
|
5664
|
+
leaving && /* @__PURE__ */ jsx60(
|
|
5652
5665
|
"div",
|
|
5653
5666
|
{
|
|
5654
5667
|
"aria-hidden": "true",
|
|
@@ -5666,9 +5679,9 @@ function FilterDrawer({
|
|
|
5666
5679
|
// src/AllFiltersButton.tsx
|
|
5667
5680
|
import { forwardRef as forwardRef13 } from "react";
|
|
5668
5681
|
import { SlidersHorizontal } from "lucide-react";
|
|
5669
|
-
import { jsx as
|
|
5682
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5670
5683
|
var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5671
|
-
return /* @__PURE__ */
|
|
5684
|
+
return /* @__PURE__ */ jsxs53(
|
|
5672
5685
|
"button",
|
|
5673
5686
|
{
|
|
5674
5687
|
ref,
|
|
@@ -5680,9 +5693,9 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5680
5693
|
className: cn(chipTriggerClass(), className),
|
|
5681
5694
|
...rest,
|
|
5682
5695
|
children: [
|
|
5683
|
-
/* @__PURE__ */
|
|
5684
|
-
/* @__PURE__ */
|
|
5685
|
-
count > 0 && /* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ jsx61(SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
5697
|
+
/* @__PURE__ */ jsx61("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
5698
|
+
count > 0 && /* @__PURE__ */ jsx61(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
5686
5699
|
]
|
|
5687
5700
|
}
|
|
5688
5701
|
);
|
|
@@ -5691,8 +5704,8 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5691
5704
|
// src/Menu.tsx
|
|
5692
5705
|
import { forwardRef as forwardRef14 } from "react";
|
|
5693
5706
|
import { Slot as Slot2, Slottable } from "@radix-ui/react-slot";
|
|
5694
|
-
import { Check as
|
|
5695
|
-
import { Fragment as Fragment6, jsx as
|
|
5707
|
+
import { Check as Check11, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
5708
|
+
import { Fragment as Fragment6, jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5696
5709
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5697
5710
|
function moveFocus(e) {
|
|
5698
5711
|
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -5705,7 +5718,7 @@ function moveFocus(e) {
|
|
|
5705
5718
|
rows[next].focus();
|
|
5706
5719
|
}
|
|
5707
5720
|
var Menu = forwardRef14(
|
|
5708
|
-
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */
|
|
5721
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ jsx62(
|
|
5709
5722
|
"div",
|
|
5710
5723
|
{
|
|
5711
5724
|
ref,
|
|
@@ -5726,20 +5739,20 @@ var MenuItem = forwardRef14(
|
|
|
5726
5739
|
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5727
5740
|
const Comp = asChild ? Slot2 : "button";
|
|
5728
5741
|
const radio = checked !== void 0;
|
|
5729
|
-
const body = /* @__PURE__ */
|
|
5730
|
-
icon && /* @__PURE__ */
|
|
5742
|
+
const body = /* @__PURE__ */ jsxs54(Fragment6, { children: [
|
|
5743
|
+
icon && /* @__PURE__ */ jsx62("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
5731
5744
|
asChild ? (
|
|
5732
5745
|
// The link's own text lands here; the link becomes the row.
|
|
5733
|
-
/* @__PURE__ */
|
|
5734
|
-
) : /* @__PURE__ */
|
|
5735
|
-
/* @__PURE__ */
|
|
5736
|
-
description && /* @__PURE__ */
|
|
5746
|
+
/* @__PURE__ */ jsx62(Slottable, { children })
|
|
5747
|
+
) : /* @__PURE__ */ jsxs54("span", { className: "min-w-0 flex-1", children: [
|
|
5748
|
+
/* @__PURE__ */ jsx62("span", { className: "block truncate", children }),
|
|
5749
|
+
description && /* @__PURE__ */ jsx62("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5737
5750
|
] }),
|
|
5738
|
-
trailing && /* @__PURE__ */
|
|
5739
|
-
radio && checked && /* @__PURE__ */
|
|
5740
|
-
submenu && /* @__PURE__ */
|
|
5751
|
+
trailing && /* @__PURE__ */ jsx62("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
5752
|
+
radio && checked && /* @__PURE__ */ jsx62(Check11, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
5753
|
+
submenu && /* @__PURE__ */ jsx62(ChevronRight7, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5741
5754
|
] });
|
|
5742
|
-
return /* @__PURE__ */
|
|
5755
|
+
return /* @__PURE__ */ jsx62(
|
|
5743
5756
|
Comp,
|
|
5744
5757
|
{
|
|
5745
5758
|
ref,
|
|
@@ -5766,7 +5779,7 @@ var MenuItem = forwardRef14(
|
|
|
5766
5779
|
);
|
|
5767
5780
|
MenuItem.displayName = "MenuItem";
|
|
5768
5781
|
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5769
|
-
return /* @__PURE__ */
|
|
5782
|
+
return /* @__PURE__ */ jsx62(
|
|
5770
5783
|
"div",
|
|
5771
5784
|
{
|
|
5772
5785
|
role: "presentation",
|
|
@@ -5777,7 +5790,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
|
|
|
5777
5790
|
);
|
|
5778
5791
|
}
|
|
5779
5792
|
function MenuSeparator({ className, testIdPrefix }) {
|
|
5780
|
-
return /* @__PURE__ */
|
|
5793
|
+
return /* @__PURE__ */ jsx62("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5781
5794
|
}
|
|
5782
5795
|
export {
|
|
5783
5796
|
AISpark,
|
|
@@ -5826,6 +5839,7 @@ export {
|
|
|
5826
5839
|
PageHeader,
|
|
5827
5840
|
Pager,
|
|
5828
5841
|
PieChartPlaceholder,
|
|
5842
|
+
PrimaryBadge,
|
|
5829
5843
|
PublisherBreakdownList,
|
|
5830
5844
|
QUIET_ACTION_CLASS,
|
|
5831
5845
|
SearchBar,
|