@mediaradar/design-components 0.50.1 → 0.54.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 +5 -1
- package/dist/index.cjs +867 -582
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +341 -24
- package/dist/index.d.ts +341 -24
- package/dist/index.js +746 -470
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -224,6 +224,12 @@ function AdvertiserQuickFilter({
|
|
|
224
224
|
setOpen(false);
|
|
225
225
|
setQ("");
|
|
226
226
|
};
|
|
227
|
+
const clearAll = () => {
|
|
228
|
+
setDraft(clearValue);
|
|
229
|
+
onChange(clearValue);
|
|
230
|
+
setOpen(false);
|
|
231
|
+
setQ("");
|
|
232
|
+
};
|
|
227
233
|
useEffect2(() => {
|
|
228
234
|
if (!open) return;
|
|
229
235
|
inputRef.current?.focus();
|
|
@@ -301,7 +307,7 @@ function AdvertiserQuickFilter({
|
|
|
301
307
|
"div",
|
|
302
308
|
{
|
|
303
309
|
className: cn(
|
|
304
|
-
"absolute top-
|
|
310
|
+
"absolute top-full mt-2 z-30 flex w-72 flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
|
|
305
311
|
align === "right" ? "right-0" : "left-0"
|
|
306
312
|
),
|
|
307
313
|
role: "dialog",
|
|
@@ -335,7 +341,7 @@ function AdvertiserQuickFilter({
|
|
|
335
341
|
}
|
|
336
342
|
)
|
|
337
343
|
] }) }),
|
|
338
|
-
/* @__PURE__ */ jsxs4("div", { className: "max-h-
|
|
344
|
+
/* @__PURE__ */ jsxs4("div", { className: "max-h-75 overflow-y-auto p-1", children: [
|
|
339
345
|
selectedOptions.length > 0 && /* @__PURE__ */ jsxs4("div", { className: "mb-1 border-b border-border-default pb-1", children: [
|
|
340
346
|
/* @__PURE__ */ jsxs4(
|
|
341
347
|
"button",
|
|
@@ -429,7 +435,7 @@ function AdvertiserQuickFilter({
|
|
|
429
435
|
{
|
|
430
436
|
type: "button",
|
|
431
437
|
"data-testid": testIdPrefix && `${testIdPrefix}-clear-all`,
|
|
432
|
-
onClick:
|
|
438
|
+
onClick: clearAll,
|
|
433
439
|
disabled: draft.length === 0,
|
|
434
440
|
className: "text-dense font-medium text-text-secondary transition-colors hover:text-text-primary disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
435
441
|
children: "Clear all"
|
|
@@ -492,7 +498,7 @@ function OptionRow({
|
|
|
492
498
|
className: cn(
|
|
493
499
|
// scroll-my-1: Tab scrolls the list just far enough to show the box,
|
|
494
500
|
// which would leave its 3px ring cut off at the list's edge.
|
|
495
|
-
"flex h-
|
|
501
|
+
"flex h-4.5 w-4.5 shrink-0 scroll-my-1 items-center justify-center rounded-small border transition-colors",
|
|
496
502
|
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
497
503
|
checked ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-surface hover:border-brand-primaryAction"
|
|
498
504
|
),
|
|
@@ -554,7 +560,7 @@ var KIND = {
|
|
|
554
560
|
// Square-ish and centred, with a floor width so a 1-digit and a 3-digit
|
|
555
561
|
// count are the same shape, and lining figures so the width does not shift
|
|
556
562
|
// as the number changes.
|
|
557
|
-
count: "h-
|
|
563
|
+
count: "h-4.5 min-w-4.5 justify-center px-1.5 tabular-nums",
|
|
558
564
|
// The only kind that shouts. Caps need the letterspacing -- caps set tight
|
|
559
565
|
// are harder to read than the sentence case they replaced.
|
|
560
566
|
eyebrow: "px-2.5 py-1 uppercase tracking-wider",
|
|
@@ -998,7 +1004,7 @@ function DateRangeFilter({
|
|
|
998
1004
|
{
|
|
999
1005
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
1000
1006
|
ref: popRef,
|
|
1001
|
-
className: `absolute z-30 flex overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay ${placement === "right" ? "bottom-0 left-full ml-2" : `${above ? "bottom-full mb-2" : "top-
|
|
1007
|
+
className: `absolute z-30 flex overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay ${placement === "right" ? "bottom-0 left-full ml-2" : `${above ? "bottom-full mb-2" : "top-full mt-2"} ${align === "right" ? "right-0" : "left-0"}`}`,
|
|
1002
1008
|
role: "dialog",
|
|
1003
1009
|
"aria-label": "Select date range",
|
|
1004
1010
|
children: [
|
|
@@ -1023,7 +1029,7 @@ function DateRangeFilter({
|
|
|
1023
1029
|
/* @__PURE__ */ jsx8("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
|
|
1024
1030
|
const m = addMonths(leftMonth, offset);
|
|
1025
1031
|
const grid = monthGrid(m.getFullYear(), m.getMonth());
|
|
1026
|
-
return /* @__PURE__ */ jsxs7("div", { className: "w-
|
|
1032
|
+
return /* @__PURE__ */ jsxs7("div", { className: "w-63", children: [
|
|
1027
1033
|
/* @__PURE__ */ jsxs7("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1028
1034
|
offset === 0 ? /* @__PURE__ */ jsx8(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ jsx8(ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ jsx8("span", { className: "h-7 w-7" }),
|
|
1029
1035
|
/* @__PURE__ */ jsxs7("span", { id: `${monthIdBase}-m${offset}`, "aria-live": "polite", className: "text-panel-title font-semibold text-text-primary", children: [
|
|
@@ -1058,7 +1064,7 @@ function DateRangeFilter({
|
|
|
1058
1064
|
"aria-pressed": endpoint || inRange,
|
|
1059
1065
|
className: "relative flex h-9 items-center justify-center focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
1060
1066
|
children: [
|
|
1061
|
-
band && /* @__PURE__ */ jsx8("span", { className: `absolute inset-y-
|
|
1067
|
+
band && /* @__PURE__ */ jsx8("span", { className: `absolute inset-y-1 bg-ai-tint ${band}`, "aria-hidden": "true" }),
|
|
1062
1068
|
/* @__PURE__ */ jsx8(
|
|
1063
1069
|
"span",
|
|
1064
1070
|
{
|
|
@@ -1120,7 +1126,7 @@ function DateRangeFilter({
|
|
|
1120
1126
|
function Field({ label, value }) {
|
|
1121
1127
|
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1.5", children: [
|
|
1122
1128
|
/* @__PURE__ */ jsx8("span", { className: "text-xs font-medium text-text-secondary", children: label }),
|
|
1123
|
-
/* @__PURE__ */ jsx8("div", { className: "flex h-10 min-w-
|
|
1129
|
+
/* @__PURE__ */ jsx8("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 })
|
|
1124
1130
|
] });
|
|
1125
1131
|
}
|
|
1126
1132
|
function NavBtn({ children, onClick, ...rest }) {
|
|
@@ -1239,7 +1245,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1239
1245
|
// flex-auto, not flex-1: flex-1's 0% basis took the height away in a
|
|
1240
1246
|
// column (a filter panel's stack), squashing the sm box from 32px to
|
|
1241
1247
|
// its text's 22px. auto keeps the h-8/10/11 and still fills a row.
|
|
1242
|
-
"relative flex min-w-
|
|
1248
|
+
"relative flex min-w-50 flex-auto items-stretch rounded-control border border-border-strong bg-input focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus",
|
|
1243
1249
|
HEIGHT[size],
|
|
1244
1250
|
className
|
|
1245
1251
|
),
|
|
@@ -1447,7 +1453,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1447
1453
|
role: "dialog",
|
|
1448
1454
|
"aria-label": "Search match type",
|
|
1449
1455
|
"data-testid": testIdPrefix && `${testIdPrefix}-mode-popover`,
|
|
1450
|
-
className: "absolute right-0 top-
|
|
1456
|
+
className: "absolute right-0 top-full mt-2 z-50 w-100 rounded-card border border-border-default bg-surface p-3 shadow-overlay",
|
|
1451
1457
|
children: /* @__PURE__ */ jsxs8("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
|
|
1452
1458
|
/* @__PURE__ */ jsx9(
|
|
1453
1459
|
ModeRow,
|
|
@@ -1644,7 +1650,7 @@ function RowInfoTip({ text }) {
|
|
|
1644
1650
|
{
|
|
1645
1651
|
id,
|
|
1646
1652
|
hidden: !open,
|
|
1647
|
-
className: "absolute left-0 top-
|
|
1653
|
+
className: "absolute left-0 top-full mt-1.5 z-40 w-55 rounded-control border border-border-default bg-surface px-2.5 py-1.5 text-xs font-normal leading-snug text-text-secondary shadow-overlay",
|
|
1648
1654
|
children: text
|
|
1649
1655
|
}
|
|
1650
1656
|
)
|
|
@@ -1897,7 +1903,7 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1897
1903
|
"aria-label": "Data",
|
|
1898
1904
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
1899
1905
|
className: cn(
|
|
1900
|
-
"absolute top-
|
|
1906
|
+
"absolute top-full mt-2 z-30 min-w-55 overflow-hidden rounded-card border border-border-default bg-surface p-1 shadow-overlay",
|
|
1901
1907
|
align === "right" ? "right-0" : "left-0"
|
|
1902
1908
|
),
|
|
1903
1909
|
children: [
|
|
@@ -2091,7 +2097,7 @@ function SelectFilter({
|
|
|
2091
2097
|
),
|
|
2092
2098
|
role: loading || error ? "group" : "listbox",
|
|
2093
2099
|
"aria-label": caption,
|
|
2094
|
-
children: loading ? /* @__PURE__ */ jsx13(MenuLoading, {}) : error ? /* @__PURE__ */ jsx13(MenuError, { onRetry }) : /* @__PURE__ */ jsx13("div", { className: "max-h-
|
|
2100
|
+
children: loading ? /* @__PURE__ */ jsx13(MenuLoading, {}) : error ? /* @__PURE__ */ jsx13(MenuError, { onRetry }) : /* @__PURE__ */ jsx13("div", { className: "max-h-70 overflow-y-auto p-1", children: options.map((o) => {
|
|
2095
2101
|
const selected = o === value;
|
|
2096
2102
|
return /* @__PURE__ */ jsxs12(
|
|
2097
2103
|
"button",
|
|
@@ -2130,23 +2136,28 @@ function SelectFilter({
|
|
|
2130
2136
|
// src/Card.tsx
|
|
2131
2137
|
import { forwardRef as forwardRef3 } from "react";
|
|
2132
2138
|
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2133
|
-
var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, action, className, testIdPrefix, children, ...rest }, ref) {
|
|
2139
|
+
var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, info, variant = "default", action, className, testIdPrefix, children, ...rest }, ref) {
|
|
2140
|
+
const chart = variant === "chart";
|
|
2134
2141
|
return /* @__PURE__ */ jsx14(
|
|
2135
2142
|
"article",
|
|
2136
2143
|
{
|
|
2137
2144
|
ref,
|
|
2138
2145
|
className: cn(
|
|
2139
|
-
"flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface
|
|
2146
|
+
"flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
|
|
2147
|
+
!chart && "shadow-raised",
|
|
2140
2148
|
// Interactive hover: deeper drop shadow only -- no elevation/transform.
|
|
2141
|
-
!staticCard && "group transition-shadow hover:shadow-overlay",
|
|
2149
|
+
!staticCard && !chart && "group transition-shadow hover:shadow-overlay",
|
|
2142
2150
|
className
|
|
2143
2151
|
),
|
|
2144
2152
|
"data-testid": testIdPrefix,
|
|
2145
2153
|
...rest,
|
|
2146
2154
|
children: title ? /* @__PURE__ */ jsxs13("div", { className: "flex flex-1 flex-col p-card-padding", children: [
|
|
2147
2155
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2148
|
-
/* @__PURE__ */ jsxs13("div", { children: [
|
|
2149
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
|
|
2157
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5", children: [
|
|
2158
|
+
/* @__PURE__ */ jsx14(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
|
|
2159
|
+
info && /* @__PURE__ */ jsx14(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
|
|
2160
|
+
] }),
|
|
2150
2161
|
subtitle && /* @__PURE__ */ jsx14("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
2151
2162
|
] }),
|
|
2152
2163
|
action && /* @__PURE__ */ jsx14("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
@@ -2157,9 +2168,162 @@ var Card = forwardRef3(function Card2({ staticCard, title, titleAs: TitleTag = "
|
|
|
2157
2168
|
);
|
|
2158
2169
|
});
|
|
2159
2170
|
|
|
2171
|
+
// src/StatStrip.tsx
|
|
2172
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
2173
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2174
|
+
var StatStrip = forwardRef4(
|
|
2175
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
2176
|
+
"div",
|
|
2177
|
+
{
|
|
2178
|
+
ref,
|
|
2179
|
+
role: "group",
|
|
2180
|
+
"data-testid": testIdPrefix,
|
|
2181
|
+
className: cn(
|
|
2182
|
+
"grid divide-y divide-border-default rounded-card border border-border-default bg-surface",
|
|
2183
|
+
"sm:auto-cols-fr sm:grid-flow-col sm:divide-x sm:divide-y-0",
|
|
2184
|
+
className
|
|
2185
|
+
),
|
|
2186
|
+
...props,
|
|
2187
|
+
children
|
|
2188
|
+
}
|
|
2189
|
+
)
|
|
2190
|
+
);
|
|
2191
|
+
StatStrip.displayName = "StatStrip";
|
|
2192
|
+
function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
|
|
2193
|
+
return /* @__PURE__ */ jsxs14("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
|
|
2194
|
+
/* @__PURE__ */ jsxs14("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
|
|
2195
|
+
icon && /* @__PURE__ */ jsx15("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
|
|
2196
|
+
label,
|
|
2197
|
+
info && /* @__PURE__ */ jsx15(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
|
|
2198
|
+
] }),
|
|
2199
|
+
/* @__PURE__ */ jsxs14("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
|
|
2200
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
|
|
2201
|
+
value,
|
|
2202
|
+
unit && /* @__PURE__ */ jsxs14("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
|
|
2203
|
+
" ",
|
|
2204
|
+
unit
|
|
2205
|
+
] })
|
|
2206
|
+
] }),
|
|
2207
|
+
change && /* @__PURE__ */ jsx15("span", { className: "text-card-title font-medium", children: change })
|
|
2208
|
+
] }),
|
|
2209
|
+
note && /* @__PURE__ */ jsx15("span", { className: "text-xs text-text-tertiary", children: note }),
|
|
2210
|
+
children && /* @__PURE__ */ jsx15("div", { className: "text-xs text-text-secondary", children })
|
|
2211
|
+
] });
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
// src/ChartLegend.tsx
|
|
2215
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
2216
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2217
|
+
var ChartLegend = forwardRef5(
|
|
2218
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
2219
|
+
"ul",
|
|
2220
|
+
{
|
|
2221
|
+
ref,
|
|
2222
|
+
"data-testid": testIdPrefix,
|
|
2223
|
+
className: cn("flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-tertiary", className),
|
|
2224
|
+
...props,
|
|
2225
|
+
children
|
|
2226
|
+
}
|
|
2227
|
+
)
|
|
2228
|
+
);
|
|
2229
|
+
ChartLegend.displayName = "ChartLegend";
|
|
2230
|
+
var MARK = {
|
|
2231
|
+
dot: "size-2 rounded-pill",
|
|
2232
|
+
square: "size-2.5 rounded-xs",
|
|
2233
|
+
line: "h-px w-4 rounded-pill",
|
|
2234
|
+
dashed: "w-4 border-t border-dashed"
|
|
2235
|
+
};
|
|
2236
|
+
function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
|
|
2237
|
+
const dashed = mark === "dashed";
|
|
2238
|
+
return /* @__PURE__ */ jsxs15("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
|
|
2239
|
+
/* @__PURE__ */ jsx16(
|
|
2240
|
+
"span",
|
|
2241
|
+
{
|
|
2242
|
+
"aria-hidden": "true",
|
|
2243
|
+
className: cn(
|
|
2244
|
+
"shrink-0",
|
|
2245
|
+
MARK[mark],
|
|
2246
|
+
you && mark === "line" && "h-0.75",
|
|
2247
|
+
you && mark === "dot" && "size-2.5",
|
|
2248
|
+
!color && (dashed ? "border-text-tertiary" : "bg-text-tertiary")
|
|
2249
|
+
),
|
|
2250
|
+
style: color ? dashed ? { borderColor: color } : { background: color } : void 0
|
|
2251
|
+
}
|
|
2252
|
+
),
|
|
2253
|
+
/* @__PURE__ */ jsxs15("span", { children: [
|
|
2254
|
+
children,
|
|
2255
|
+
you && " (you)"
|
|
2256
|
+
] })
|
|
2257
|
+
] });
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
// src/BarList.tsx
|
|
2261
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2262
|
+
var COL_WIDTH = ["w-16", "w-13"];
|
|
2263
|
+
function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
|
|
2264
|
+
if (!rows.length) {
|
|
2265
|
+
return empty ? /* @__PURE__ */ jsx17("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
|
|
2266
|
+
}
|
|
2267
|
+
const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
|
|
2268
|
+
const full = !!columns?.length;
|
|
2269
|
+
const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
|
|
2270
|
+
return /* @__PURE__ */ jsxs16("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
|
|
2271
|
+
full && /* @__PURE__ */ jsxs16("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
|
|
2272
|
+
/* @__PURE__ */ jsx17("span", { className: "flex-1" }),
|
|
2273
|
+
columns.map((c, i) => /* @__PURE__ */ jsx17("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
|
|
2274
|
+
] }),
|
|
2275
|
+
/* @__PURE__ */ jsx17("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ jsxs16("li", { className: "py-2", children: [
|
|
2276
|
+
/* @__PURE__ */ jsxs16("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
2277
|
+
/* @__PURE__ */ jsxs16("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
|
|
2278
|
+
r.label,
|
|
2279
|
+
r.note && /* @__PURE__ */ jsxs16("span", { className: "font-normal text-text-tertiary", children: [
|
|
2280
|
+
" \xB7 ",
|
|
2281
|
+
r.note
|
|
2282
|
+
] })
|
|
2283
|
+
] }),
|
|
2284
|
+
r.values?.map((v, i) => /* @__PURE__ */ jsxs16(
|
|
2285
|
+
"span",
|
|
2286
|
+
{
|
|
2287
|
+
className: cn(
|
|
2288
|
+
"shrink-0 whitespace-nowrap text-right text-xs tabular-nums",
|
|
2289
|
+
full && i === 0 ? "font-semibold text-text-primary" : "text-text-secondary",
|
|
2290
|
+
colClass(i)
|
|
2291
|
+
),
|
|
2292
|
+
children: [
|
|
2293
|
+
full && /* @__PURE__ */ jsxs16("span", { className: "sr-only", children: [
|
|
2294
|
+
columns[i],
|
|
2295
|
+
": "
|
|
2296
|
+
] }),
|
|
2297
|
+
v
|
|
2298
|
+
]
|
|
2299
|
+
},
|
|
2300
|
+
i
|
|
2301
|
+
))
|
|
2302
|
+
] }),
|
|
2303
|
+
/* @__PURE__ */ jsxs16("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
|
|
2304
|
+
/* @__PURE__ */ jsx17(
|
|
2305
|
+
"div",
|
|
2306
|
+
{
|
|
2307
|
+
className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
|
|
2308
|
+
style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
|
|
2309
|
+
}
|
|
2310
|
+
),
|
|
2311
|
+
r.tick !== void 0 && /* @__PURE__ */ jsx17(
|
|
2312
|
+
"span",
|
|
2313
|
+
{
|
|
2314
|
+
className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
|
|
2315
|
+
style: { left: `${r.tick / max * 100}%` }
|
|
2316
|
+
}
|
|
2317
|
+
)
|
|
2318
|
+
] }),
|
|
2319
|
+
r.tickLabel && /* @__PURE__ */ jsx17("span", { className: "sr-only", children: r.tickLabel })
|
|
2320
|
+
] }, r.key)) })
|
|
2321
|
+
] });
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2160
2324
|
// src/NoResultsEmptyState.tsx
|
|
2161
2325
|
import { FilterX } from "lucide-react";
|
|
2162
|
-
import { jsx as
|
|
2326
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2163
2327
|
var NO_RESULTS_TITLE = "No results match your filters";
|
|
2164
2328
|
var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
|
|
2165
2329
|
function noResultsBody(workspaceName) {
|
|
@@ -2182,12 +2346,12 @@ function NoResultsEmptyState({
|
|
|
2182
2346
|
const showClear = hasFilters !== false && Boolean(onClearFilters);
|
|
2183
2347
|
const showEdit = Boolean(onEditFilters);
|
|
2184
2348
|
const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
|
|
2185
|
-
return /* @__PURE__ */
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
hasActions && /* @__PURE__ */
|
|
2190
|
-
showClear && /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2350
|
+
/* @__PURE__ */ jsx18("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ jsx18(FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2351
|
+
/* @__PURE__ */ jsx18("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2352
|
+
/* @__PURE__ */ jsx18("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2353
|
+
hasActions && /* @__PURE__ */ jsxs17("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2354
|
+
showClear && /* @__PURE__ */ jsx18(
|
|
2191
2355
|
"button",
|
|
2192
2356
|
{
|
|
2193
2357
|
type: "button",
|
|
@@ -2197,7 +2361,7 @@ function NoResultsEmptyState({
|
|
|
2197
2361
|
children: "Clear all filters"
|
|
2198
2362
|
}
|
|
2199
2363
|
),
|
|
2200
|
-
showEdit && /* @__PURE__ */
|
|
2364
|
+
showEdit && /* @__PURE__ */ jsx18(
|
|
2201
2365
|
"button",
|
|
2202
2366
|
{
|
|
2203
2367
|
type: "button",
|
|
@@ -2207,7 +2371,7 @@ function NoResultsEmptyState({
|
|
|
2207
2371
|
children: "Edit filters"
|
|
2208
2372
|
}
|
|
2209
2373
|
),
|
|
2210
|
-
actions?.map((action, i) => /* @__PURE__ */
|
|
2374
|
+
actions?.map((action, i) => /* @__PURE__ */ jsx18(
|
|
2211
2375
|
"button",
|
|
2212
2376
|
{
|
|
2213
2377
|
type: "button",
|
|
@@ -2224,9 +2388,9 @@ function NoResultsEmptyState({
|
|
|
2224
2388
|
// src/WorkspaceSelectedCard.tsx
|
|
2225
2389
|
import { useEffect as useEffect7, useRef as useRef8, useState as useState7 } from "react";
|
|
2226
2390
|
import { ChevronDown as ChevronDown6, X as X3 } from "lucide-react";
|
|
2227
|
-
import { jsx as
|
|
2391
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2228
2392
|
function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
2229
|
-
return /* @__PURE__ */
|
|
2393
|
+
return /* @__PURE__ */ jsx19(
|
|
2230
2394
|
"aside",
|
|
2231
2395
|
{
|
|
2232
2396
|
className: cn(
|
|
@@ -2234,7 +2398,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
|
2234
2398
|
className
|
|
2235
2399
|
),
|
|
2236
2400
|
"data-testid": testIdPrefix,
|
|
2237
|
-
children: /* @__PURE__ */
|
|
2401
|
+
children: /* @__PURE__ */ jsx19("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ jsx19(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
|
|
2238
2402
|
}
|
|
2239
2403
|
);
|
|
2240
2404
|
}
|
|
@@ -2253,8 +2417,8 @@ function SummaryGroupItem({
|
|
|
2253
2417
|
else if (expandCount === 0) setOpen(false);
|
|
2254
2418
|
wasEmpty.current = expandCount === 0;
|
|
2255
2419
|
}, [expandCount]);
|
|
2256
|
-
return /* @__PURE__ */
|
|
2257
|
-
/* @__PURE__ */
|
|
2420
|
+
return /* @__PURE__ */ jsxs18("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
|
|
2421
|
+
/* @__PURE__ */ jsxs18(
|
|
2258
2422
|
"button",
|
|
2259
2423
|
{
|
|
2260
2424
|
type: "button",
|
|
@@ -2263,7 +2427,7 @@ function SummaryGroupItem({
|
|
|
2263
2427
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2264
2428
|
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",
|
|
2265
2429
|
children: [
|
|
2266
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ jsx19(
|
|
2267
2431
|
ChevronDown6,
|
|
2268
2432
|
{
|
|
2269
2433
|
size: 14,
|
|
@@ -2271,37 +2435,37 @@ function SummaryGroupItem({
|
|
|
2271
2435
|
className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
|
|
2272
2436
|
}
|
|
2273
2437
|
),
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ jsx19("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
|
|
2439
|
+
/* @__PURE__ */ jsx19("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
|
|
2276
2440
|
]
|
|
2277
2441
|
}
|
|
2278
2442
|
),
|
|
2279
|
-
open && /* @__PURE__ */
|
|
2280
|
-
ownCount > 0 && /* @__PURE__ */
|
|
2281
|
-
group.items.map((item) => /* @__PURE__ */
|
|
2443
|
+
open && /* @__PURE__ */ jsx19("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ jsx19("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2.5", children: [
|
|
2444
|
+
ownCount > 0 && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1.5", children: [
|
|
2445
|
+
group.items.map((item) => /* @__PURE__ */ jsxs18(
|
|
2282
2446
|
"div",
|
|
2283
2447
|
{
|
|
2284
2448
|
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
2285
2449
|
children: [
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
item.meta && /* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ jsxs18("span", { className: "min-w-0 flex-1", children: [
|
|
2451
|
+
/* @__PURE__ */ jsx19("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
|
|
2452
|
+
item.meta && /* @__PURE__ */ jsx19("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
|
|
2289
2453
|
] }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2454
|
+
/* @__PURE__ */ jsx19(
|
|
2291
2455
|
"button",
|
|
2292
2456
|
{
|
|
2293
2457
|
type: "button",
|
|
2294
2458
|
"aria-label": `Remove ${item.name}`,
|
|
2295
2459
|
onClick: () => group.onRemove(item.id),
|
|
2296
2460
|
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",
|
|
2297
|
-
children: /* @__PURE__ */
|
|
2461
|
+
children: /* @__PURE__ */ jsx19(X3, { size: 12, "aria-hidden": "true" })
|
|
2298
2462
|
}
|
|
2299
2463
|
)
|
|
2300
2464
|
]
|
|
2301
2465
|
},
|
|
2302
2466
|
item.id
|
|
2303
2467
|
)),
|
|
2304
|
-
/* @__PURE__ */
|
|
2468
|
+
/* @__PURE__ */ jsx19(
|
|
2305
2469
|
"button",
|
|
2306
2470
|
{
|
|
2307
2471
|
type: "button",
|
|
@@ -2312,13 +2476,13 @@ function SummaryGroupItem({
|
|
|
2312
2476
|
}
|
|
2313
2477
|
)
|
|
2314
2478
|
] }),
|
|
2315
|
-
group.subGroups?.map((sg) => /* @__PURE__ */
|
|
2479
|
+
group.subGroups?.map((sg) => /* @__PURE__ */ jsx19(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
|
|
2316
2480
|
] }) })
|
|
2317
2481
|
] });
|
|
2318
2482
|
}
|
|
2319
2483
|
|
|
2320
2484
|
// src/chart-placeholder-shared.tsx
|
|
2321
|
-
import { jsx as
|
|
2485
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2322
2486
|
var GRID_ROWS = [0, 25, 50, 75, 100];
|
|
2323
2487
|
var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
|
|
2324
2488
|
var Y_AXIS_W = 48;
|
|
@@ -2332,9 +2496,9 @@ function AxisFrame({
|
|
|
2332
2496
|
testIdPrefix
|
|
2333
2497
|
}) {
|
|
2334
2498
|
const gutter = xTicks > 0 ? X_AXIS_H : 0;
|
|
2335
|
-
return /* @__PURE__ */
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
GRID_ROWS.map((pct) => /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsx20("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ jsxs19("div", { className: "relative h-full w-full", children: [
|
|
2500
|
+
/* @__PURE__ */ jsxs19("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
|
|
2501
|
+
GRID_ROWS.map((pct) => /* @__PURE__ */ jsx20(
|
|
2338
2502
|
"div",
|
|
2339
2503
|
{
|
|
2340
2504
|
className: "absolute inset-x-0 border-t border-dashed",
|
|
@@ -2342,9 +2506,9 @@ function AxisFrame({
|
|
|
2342
2506
|
},
|
|
2343
2507
|
pct
|
|
2344
2508
|
)),
|
|
2345
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ jsx20("div", { className: "absolute inset-0", children })
|
|
2346
2510
|
] }),
|
|
2347
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx20("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ jsx20(
|
|
2348
2512
|
"div",
|
|
2349
2513
|
{
|
|
2350
2514
|
className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
|
|
@@ -2352,27 +2516,27 @@ function AxisFrame({
|
|
|
2352
2516
|
},
|
|
2353
2517
|
pct
|
|
2354
2518
|
)) }),
|
|
2355
|
-
xTicks > 0 && /* @__PURE__ */
|
|
2519
|
+
xTicks > 0 && /* @__PURE__ */ jsx20(
|
|
2356
2520
|
"div",
|
|
2357
2521
|
{
|
|
2358
2522
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2359
2523
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2360
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */
|
|
2524
|
+
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ jsx20("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx20("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
|
|
2361
2525
|
}
|
|
2362
2526
|
)
|
|
2363
2527
|
] }) });
|
|
2364
2528
|
}
|
|
2365
2529
|
function BlankLegend({ rows, reverse = false }) {
|
|
2366
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx20(
|
|
2367
2531
|
"ul",
|
|
2368
2532
|
{
|
|
2369
2533
|
className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
|
|
2370
2534
|
role: "presentation",
|
|
2371
2535
|
"aria-hidden": "true",
|
|
2372
|
-
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
/* @__PURE__ */
|
|
2536
|
+
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs19("li", { className: "flex items-center justify-between gap-2", children: [
|
|
2537
|
+
/* @__PURE__ */ jsxs19("span", { className: "flex items-center gap-1.5", children: [
|
|
2538
|
+
/* @__PURE__ */ jsx20("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
|
|
2539
|
+
/* @__PURE__ */ jsx20(
|
|
2376
2540
|
"span",
|
|
2377
2541
|
{
|
|
2378
2542
|
className: "h-2 rounded-xs bg-subtle",
|
|
@@ -2380,21 +2544,21 @@ function BlankLegend({ rows, reverse = false }) {
|
|
|
2380
2544
|
}
|
|
2381
2545
|
)
|
|
2382
2546
|
] }),
|
|
2383
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsx20("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
|
|
2384
2548
|
] }, i))
|
|
2385
2549
|
}
|
|
2386
2550
|
);
|
|
2387
2551
|
}
|
|
2388
2552
|
|
|
2389
2553
|
// src/BarChartPlaceholder.tsx
|
|
2390
|
-
import { jsx as
|
|
2554
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2391
2555
|
var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
|
|
2392
2556
|
function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
|
|
2393
|
-
return /* @__PURE__ */
|
|
2557
|
+
return /* @__PURE__ */ jsx21(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ jsx21("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ jsx21("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
|
|
2394
2558
|
}
|
|
2395
2559
|
|
|
2396
2560
|
// src/LineChartPlaceholder.tsx
|
|
2397
|
-
import { jsx as
|
|
2561
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2398
2562
|
var LINE_SERIES = [
|
|
2399
2563
|
[58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
|
|
2400
2564
|
[74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
|
|
@@ -2404,9 +2568,9 @@ var LINE_SERIES = [
|
|
|
2404
2568
|
var LINE_FORECAST_FROM = 7;
|
|
2405
2569
|
function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
2406
2570
|
const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
|
|
2407
|
-
return /* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsxs20(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
|
|
2572
|
+
/* @__PURE__ */ jsx22("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ jsxs20("g", { children: [
|
|
2573
|
+
/* @__PURE__ */ jsx22(
|
|
2410
2574
|
"polyline",
|
|
2411
2575
|
{
|
|
2412
2576
|
points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
|
|
@@ -2418,7 +2582,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2418
2582
|
strokeLinejoin: "round"
|
|
2419
2583
|
}
|
|
2420
2584
|
),
|
|
2421
|
-
/* @__PURE__ */
|
|
2585
|
+
/* @__PURE__ */ jsx22(
|
|
2422
2586
|
"polyline",
|
|
2423
2587
|
{
|
|
2424
2588
|
points: toPath(pts, LINE_FORECAST_FROM, pts.length),
|
|
@@ -2433,7 +2597,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2433
2597
|
)
|
|
2434
2598
|
] }, s)) }),
|
|
2435
2599
|
LINE_SERIES.map(
|
|
2436
|
-
(pts, s) => pts.map((y, i) => /* @__PURE__ */
|
|
2600
|
+
(pts, s) => pts.map((y, i) => /* @__PURE__ */ jsx22(
|
|
2437
2601
|
"div",
|
|
2438
2602
|
{
|
|
2439
2603
|
className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
@@ -2450,16 +2614,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2450
2614
|
}
|
|
2451
2615
|
|
|
2452
2616
|
// src/PieChartPlaceholder.tsx
|
|
2453
|
-
import { jsx as
|
|
2617
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2454
2618
|
var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
|
|
2455
2619
|
function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
|
|
2456
2620
|
const r = 45;
|
|
2457
|
-
return /* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2621
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2622
|
+
/* @__PURE__ */ jsx23("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ jsxs21("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
|
|
2623
|
+
/* @__PURE__ */ jsx23("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
|
|
2460
2624
|
PIE_SEAMS.map((deg) => {
|
|
2461
2625
|
const rad = (deg - 90) * Math.PI / 180;
|
|
2462
|
-
return /* @__PURE__ */
|
|
2626
|
+
return /* @__PURE__ */ jsx23(
|
|
2463
2627
|
"line",
|
|
2464
2628
|
{
|
|
2465
2629
|
x1: "50",
|
|
@@ -2473,12 +2637,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
|
|
|
2473
2637
|
);
|
|
2474
2638
|
})
|
|
2475
2639
|
] }) }),
|
|
2476
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ jsx23(BlankLegend, { rows: legendRows })
|
|
2477
2641
|
] });
|
|
2478
2642
|
}
|
|
2479
2643
|
|
|
2480
2644
|
// src/StackedColumnPlaceholder.tsx
|
|
2481
|
-
import { jsx as
|
|
2645
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2482
2646
|
var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
|
|
2483
2647
|
function columnBands(count) {
|
|
2484
2648
|
const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
|
|
@@ -2493,7 +2657,7 @@ function StackedColumnPlaceholder({
|
|
|
2493
2657
|
className,
|
|
2494
2658
|
testIdPrefix
|
|
2495
2659
|
}) {
|
|
2496
|
-
const column = /* @__PURE__ */
|
|
2660
|
+
const column = /* @__PURE__ */ jsx24("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ jsx24(
|
|
2497
2661
|
"div",
|
|
2498
2662
|
{
|
|
2499
2663
|
style: {
|
|
@@ -2505,16 +2669,16 @@ function StackedColumnPlaceholder({
|
|
|
2505
2669
|
},
|
|
2506
2670
|
i
|
|
2507
2671
|
)) });
|
|
2508
|
-
return /* @__PURE__ */
|
|
2509
|
-
axis ? /* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2672
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2673
|
+
axis ? /* @__PURE__ */ jsx24("div", { style: { width: "55%" }, children: /* @__PURE__ */ jsx24(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ jsx24("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ jsx24("div", { className: "flex items-stretch py-1", children: column }),
|
|
2674
|
+
/* @__PURE__ */ jsx24(BlankLegend, { rows: legendRows, reverse: !axis })
|
|
2511
2675
|
] });
|
|
2512
2676
|
}
|
|
2513
2677
|
|
|
2514
2678
|
// src/Tooltip.tsx
|
|
2515
2679
|
import { useEffect as useEffect8, useId as useId4, useLayoutEffect as useLayoutEffect4, useRef as useRef9, useState as useState8 } from "react";
|
|
2516
2680
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2517
|
-
import { jsx as
|
|
2681
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2518
2682
|
function addDescribedBy(el, id) {
|
|
2519
2683
|
const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
|
|
2520
2684
|
if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
|
|
@@ -2700,7 +2864,7 @@ function Tooltip({
|
|
|
2700
2864
|
}
|
|
2701
2865
|
}
|
|
2702
2866
|
const floating = anchor != null && typeof document !== "undefined" ? createPortal3(
|
|
2703
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ jsx25(
|
|
2704
2868
|
"span",
|
|
2705
2869
|
{
|
|
2706
2870
|
ref: boxRef,
|
|
@@ -2731,7 +2895,7 @@ function Tooltip({
|
|
|
2731
2895
|
document.body
|
|
2732
2896
|
) : null;
|
|
2733
2897
|
if (anchorRef) return floating;
|
|
2734
|
-
return /* @__PURE__ */
|
|
2898
|
+
return /* @__PURE__ */ jsxs23(
|
|
2735
2899
|
"span",
|
|
2736
2900
|
{
|
|
2737
2901
|
ref,
|
|
@@ -2753,28 +2917,28 @@ function Tooltip({
|
|
|
2753
2917
|
}
|
|
2754
2918
|
|
|
2755
2919
|
// src/AdvertiserNoResults.tsx
|
|
2756
|
-
import { jsx as
|
|
2920
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2757
2921
|
function AdvertiserNoResults({
|
|
2758
2922
|
query,
|
|
2759
2923
|
hint = "Try checking your spelling or searching for a broader brand name.",
|
|
2760
2924
|
className,
|
|
2761
2925
|
testIdPrefix
|
|
2762
2926
|
}) {
|
|
2763
|
-
return /* @__PURE__ */
|
|
2764
|
-
/* @__PURE__ */
|
|
2927
|
+
return /* @__PURE__ */ jsxs24("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2928
|
+
/* @__PURE__ */ jsxs24("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
2765
2929
|
"No results found for \u201C",
|
|
2766
2930
|
query,
|
|
2767
2931
|
"\u201D"
|
|
2768
2932
|
] }),
|
|
2769
|
-
/* @__PURE__ */
|
|
2933
|
+
/* @__PURE__ */ jsx26("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
2770
2934
|
] });
|
|
2771
2935
|
}
|
|
2772
2936
|
|
|
2773
2937
|
// src/SelectAllVisible.tsx
|
|
2774
2938
|
import { ListChecks as ListChecks2 } from "lucide-react";
|
|
2775
|
-
import { jsx as
|
|
2939
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2776
2940
|
function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
|
|
2777
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ jsxs25(
|
|
2778
2942
|
"button",
|
|
2779
2943
|
{
|
|
2780
2944
|
type: "button",
|
|
@@ -2785,7 +2949,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2785
2949
|
className
|
|
2786
2950
|
),
|
|
2787
2951
|
children: [
|
|
2788
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ jsx27(ListChecks2, { size: 14, "aria-hidden": "true" }),
|
|
2789
2953
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
2790
2954
|
]
|
|
2791
2955
|
}
|
|
@@ -2794,11 +2958,11 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2794
2958
|
|
|
2795
2959
|
// src/SelectedSection.tsx
|
|
2796
2960
|
import { ChevronDown as ChevronDown7 } from "lucide-react";
|
|
2797
|
-
import { jsx as
|
|
2961
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2798
2962
|
function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
|
|
2799
2963
|
if (count === 0) return null;
|
|
2800
|
-
return /* @__PURE__ */
|
|
2801
|
-
/* @__PURE__ */
|
|
2964
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
2965
|
+
/* @__PURE__ */ jsxs26(
|
|
2802
2966
|
"button",
|
|
2803
2967
|
{
|
|
2804
2968
|
type: "button",
|
|
@@ -2807,14 +2971,14 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
|
|
|
2807
2971
|
"aria-expanded": open,
|
|
2808
2972
|
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",
|
|
2809
2973
|
children: [
|
|
2810
|
-
/* @__PURE__ */
|
|
2974
|
+
/* @__PURE__ */ jsx28(ChevronDown7, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
|
|
2811
2975
|
"Selected (",
|
|
2812
2976
|
count,
|
|
2813
2977
|
")"
|
|
2814
2978
|
]
|
|
2815
2979
|
}
|
|
2816
2980
|
),
|
|
2817
|
-
open && /* @__PURE__ */
|
|
2981
|
+
open && /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-0.5", children })
|
|
2818
2982
|
] });
|
|
2819
2983
|
}
|
|
2820
2984
|
|
|
@@ -2825,7 +2989,7 @@ import { Search as Search4, Plus as Plus2, Info as Info2, ChevronRight as Chevro
|
|
|
2825
2989
|
|
|
2826
2990
|
// src/Tabs.tsx
|
|
2827
2991
|
import { useRef as useRef10 } from "react";
|
|
2828
|
-
import { jsx as
|
|
2992
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2829
2993
|
function arrowKeys(e, row) {
|
|
2830
2994
|
if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
|
|
2831
2995
|
const items = Array.from(row.querySelectorAll("button:not([disabled])"));
|
|
@@ -2837,7 +3001,7 @@ function arrowKeys(e, row) {
|
|
|
2837
3001
|
}
|
|
2838
3002
|
function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
|
|
2839
3003
|
const row = useRef10(null);
|
|
2840
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ jsx29(
|
|
2841
3005
|
"div",
|
|
2842
3006
|
{
|
|
2843
3007
|
ref: row,
|
|
@@ -2848,7 +3012,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
2848
3012
|
className: cn("flex gap-6 border-b border-border-default", className),
|
|
2849
3013
|
children: items.map((item) => {
|
|
2850
3014
|
const on = item.value === value;
|
|
2851
|
-
return /* @__PURE__ */
|
|
3015
|
+
return /* @__PURE__ */ jsxs27(
|
|
2852
3016
|
"button",
|
|
2853
3017
|
{
|
|
2854
3018
|
type: "button",
|
|
@@ -2866,7 +3030,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
2866
3030
|
),
|
|
2867
3031
|
children: [
|
|
2868
3032
|
item.label,
|
|
2869
|
-
item.count !== void 0 && /* @__PURE__ */
|
|
3033
|
+
item.count !== void 0 && /* @__PURE__ */ jsx29("span", { className: "text-xs text-text-tertiary", children: item.count })
|
|
2870
3034
|
]
|
|
2871
3035
|
},
|
|
2872
3036
|
item.value
|
|
@@ -2885,7 +3049,7 @@ function SegmentedControl({
|
|
|
2885
3049
|
...rest
|
|
2886
3050
|
}) {
|
|
2887
3051
|
const row = useRef10(null);
|
|
2888
|
-
return /* @__PURE__ */
|
|
3052
|
+
return /* @__PURE__ */ jsx29(
|
|
2889
3053
|
"div",
|
|
2890
3054
|
{
|
|
2891
3055
|
ref: row,
|
|
@@ -2896,7 +3060,7 @@ function SegmentedControl({
|
|
|
2896
3060
|
className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
|
|
2897
3061
|
children: options.map((o) => {
|
|
2898
3062
|
const on = o.value === value;
|
|
2899
|
-
return /* @__PURE__ */
|
|
3063
|
+
return /* @__PURE__ */ jsx29(
|
|
2900
3064
|
"button",
|
|
2901
3065
|
{
|
|
2902
3066
|
type: "button",
|
|
@@ -2920,7 +3084,7 @@ function SegmentedControl({
|
|
|
2920
3084
|
}
|
|
2921
3085
|
|
|
2922
3086
|
// src/SelectionPicker.tsx
|
|
2923
|
-
import { Fragment as Fragment3, jsx as
|
|
3087
|
+
import { Fragment as Fragment3, jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2924
3088
|
function slug5(value) {
|
|
2925
3089
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
2926
3090
|
}
|
|
@@ -3013,12 +3177,12 @@ function SelectionPicker({
|
|
|
3013
3177
|
}
|
|
3014
3178
|
};
|
|
3015
3179
|
const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
|
|
3016
|
-
return /* @__PURE__ */
|
|
3017
|
-
helper && /* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3180
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
3181
|
+
helper && /* @__PURE__ */ jsxs28(Fragment3, { children: [
|
|
3182
|
+
/* @__PURE__ */ jsx30("p", { className: "text-dense text-text-secondary", children: helper }),
|
|
3183
|
+
/* @__PURE__ */ jsx30("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
|
|
3020
3184
|
] }),
|
|
3021
|
-
hasAccountLists && /* @__PURE__ */
|
|
3185
|
+
hasAccountLists && /* @__PURE__ */ jsx30(
|
|
3022
3186
|
SegmentedControl,
|
|
3023
3187
|
{
|
|
3024
3188
|
"aria-label": "Add from",
|
|
@@ -3031,11 +3195,11 @@ function SelectionPicker({
|
|
|
3031
3195
|
]
|
|
3032
3196
|
}
|
|
3033
3197
|
),
|
|
3034
|
-
source === "search" && /* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
3037
|
-
/* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3198
|
+
source === "search" && /* @__PURE__ */ jsxs28("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3199
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3200
|
+
/* @__PURE__ */ jsxs28("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: [
|
|
3201
|
+
/* @__PURE__ */ jsx30(Search4, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3202
|
+
/* @__PURE__ */ jsx30(
|
|
3039
3203
|
"input",
|
|
3040
3204
|
{
|
|
3041
3205
|
value: query,
|
|
@@ -3051,7 +3215,7 @@ function SelectionPicker({
|
|
|
3051
3215
|
}
|
|
3052
3216
|
)
|
|
3053
3217
|
] }),
|
|
3054
|
-
filters.map((f) => /* @__PURE__ */
|
|
3218
|
+
filters.map((f) => /* @__PURE__ */ jsx30(
|
|
3055
3219
|
FilterDropdown,
|
|
3056
3220
|
{
|
|
3057
3221
|
filter: f,
|
|
@@ -3063,14 +3227,14 @@ function SelectionPicker({
|
|
|
3063
3227
|
)),
|
|
3064
3228
|
toolbarExtra
|
|
3065
3229
|
] }),
|
|
3066
|
-
!hasSearched ? /* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3069
|
-
/* @__PURE__ */
|
|
3070
|
-
/* @__PURE__ */
|
|
3230
|
+
!hasSearched ? /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3231
|
+
/* @__PURE__ */ jsx30("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ jsx30(Search4, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3232
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-1", children: [
|
|
3233
|
+
/* @__PURE__ */ jsx30("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
|
|
3234
|
+
/* @__PURE__ */ jsx30("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
|
|
3071
3235
|
] })
|
|
3072
|
-
] }) : /* @__PURE__ */
|
|
3073
|
-
/* @__PURE__ */
|
|
3236
|
+
] }) : /* @__PURE__ */ jsxs28("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
|
|
3237
|
+
/* @__PURE__ */ jsxs28(
|
|
3074
3238
|
"div",
|
|
3075
3239
|
{
|
|
3076
3240
|
className: cn(
|
|
@@ -3078,7 +3242,7 @@ function SelectionPicker({
|
|
|
3078
3242
|
rowGridCols
|
|
3079
3243
|
),
|
|
3080
3244
|
children: [
|
|
3081
|
-
/* @__PURE__ */
|
|
3245
|
+
/* @__PURE__ */ jsx30(
|
|
3082
3246
|
CheckBox,
|
|
3083
3247
|
{
|
|
3084
3248
|
checked: allSelected,
|
|
@@ -3089,18 +3253,18 @@ function SelectionPicker({
|
|
|
3089
3253
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
|
|
3090
3254
|
}
|
|
3091
3255
|
),
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
showInfoColumn && /* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsx30("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ jsx30("span", { className: c.className, children: c.header }, c.key)) }),
|
|
3257
|
+
showInfoColumn && /* @__PURE__ */ jsx30("span", { className: "text-right", children: "Info" })
|
|
3094
3258
|
]
|
|
3095
3259
|
}
|
|
3096
3260
|
),
|
|
3097
|
-
/* @__PURE__ */
|
|
3261
|
+
/* @__PURE__ */ jsx30("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ jsx30("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ jsx30(Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ jsx30("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ jsx30("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) => {
|
|
3098
3262
|
const isSel = selectedIds.has(row.id);
|
|
3099
3263
|
const isLocked = lockedIds?.has(row.id) ?? false;
|
|
3100
3264
|
const kids = getChildren?.(row);
|
|
3101
3265
|
const isOpen = expanded.has(row.id);
|
|
3102
|
-
return /* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsxs28("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
|
|
3267
|
+
/* @__PURE__ */ jsxs28(
|
|
3104
3268
|
"div",
|
|
3105
3269
|
{
|
|
3106
3270
|
onClick: isLocked ? void 0 : () => toggleRow(row),
|
|
@@ -3113,7 +3277,7 @@ function SelectionPicker({
|
|
|
3113
3277
|
!isLocked && isSel && "opacity-70"
|
|
3114
3278
|
),
|
|
3115
3279
|
children: [
|
|
3116
|
-
isLocked ? /* @__PURE__ */
|
|
3280
|
+
isLocked ? /* @__PURE__ */ jsx30("span", { "aria-hidden": "true" }) : /* @__PURE__ */ jsx30(
|
|
3117
3281
|
CheckBox,
|
|
3118
3282
|
{
|
|
3119
3283
|
checked: isSel,
|
|
@@ -3122,8 +3286,8 @@ function SelectionPicker({
|
|
|
3122
3286
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
|
|
3123
3287
|
}
|
|
3124
3288
|
),
|
|
3125
|
-
/* @__PURE__ */
|
|
3126
|
-
showInfoColumn && /* @__PURE__ */
|
|
3289
|
+
/* @__PURE__ */ jsx30("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ jsx30("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
|
|
3290
|
+
showInfoColumn && /* @__PURE__ */ jsx30("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ jsx30(
|
|
3127
3291
|
"button",
|
|
3128
3292
|
{
|
|
3129
3293
|
type: "button",
|
|
@@ -3137,28 +3301,28 @@ function SelectionPicker({
|
|
|
3137
3301
|
});
|
|
3138
3302
|
},
|
|
3139
3303
|
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",
|
|
3140
|
-
children: /* @__PURE__ */
|
|
3304
|
+
children: /* @__PURE__ */ jsx30(ChevronRight3, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3141
3305
|
}
|
|
3142
|
-
) : /* @__PURE__ */
|
|
3306
|
+
) : /* @__PURE__ */ jsx30(
|
|
3143
3307
|
"span",
|
|
3144
3308
|
{
|
|
3145
3309
|
className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
|
|
3146
3310
|
title: "No additional details",
|
|
3147
|
-
children: /* @__PURE__ */
|
|
3311
|
+
children: /* @__PURE__ */ jsx30(Info2, { size: 14 })
|
|
3148
3312
|
}
|
|
3149
3313
|
) })
|
|
3150
3314
|
]
|
|
3151
3315
|
}
|
|
3152
3316
|
),
|
|
3153
|
-
isOpen && kids && /* @__PURE__ */
|
|
3317
|
+
isOpen && kids && /* @__PURE__ */ jsx30("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
|
|
3154
3318
|
const kidSel = selectedIds.has(kid.id);
|
|
3155
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ jsxs28(
|
|
3156
3320
|
"div",
|
|
3157
3321
|
{
|
|
3158
3322
|
className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
|
|
3159
3323
|
children: [
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3324
|
+
/* @__PURE__ */ jsx30("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
|
|
3325
|
+
/* @__PURE__ */ jsxs28(
|
|
3162
3326
|
"button",
|
|
3163
3327
|
{
|
|
3164
3328
|
type: "button",
|
|
@@ -3169,7 +3333,7 @@ function SelectionPicker({
|
|
|
3169
3333
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3170
3334
|
),
|
|
3171
3335
|
children: [
|
|
3172
|
-
kidSel ? /* @__PURE__ */
|
|
3336
|
+
kidSel ? /* @__PURE__ */ jsx30(Check6, { size: 13 }) : /* @__PURE__ */ jsx30(Plus2, { size: 13 }),
|
|
3173
3337
|
kidSel ? "Added" : "Add"
|
|
3174
3338
|
]
|
|
3175
3339
|
}
|
|
@@ -3181,7 +3345,7 @@ function SelectionPicker({
|
|
|
3181
3345
|
}) })
|
|
3182
3346
|
] }, row.id);
|
|
3183
3347
|
}) }),
|
|
3184
|
-
!loading && !error && hasMore && /* @__PURE__ */
|
|
3348
|
+
!loading && !error && hasMore && /* @__PURE__ */ jsxs28(
|
|
3185
3349
|
"button",
|
|
3186
3350
|
{
|
|
3187
3351
|
type: "button",
|
|
@@ -3190,19 +3354,19 @@ function SelectionPicker({
|
|
|
3190
3354
|
"data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
|
|
3191
3355
|
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",
|
|
3192
3356
|
children: [
|
|
3193
|
-
loadingMore ? /* @__PURE__ */
|
|
3357
|
+
loadingMore ? /* @__PURE__ */ jsx30(Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
|
|
3194
3358
|
loadingMore ? "Loading\u2026" : "Load more"
|
|
3195
3359
|
]
|
|
3196
3360
|
}
|
|
3197
3361
|
)
|
|
3198
3362
|
] })
|
|
3199
3363
|
] }),
|
|
3200
|
-
source === "lists" && /* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
accountLists && accountLists.length > 0 ? /* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3364
|
+
source === "lists" && /* @__PURE__ */ jsxs28("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3365
|
+
/* @__PURE__ */ jsx30("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." }),
|
|
3366
|
+
accountLists && accountLists.length > 0 ? /* @__PURE__ */ jsxs28(Fragment3, { children: [
|
|
3367
|
+
/* @__PURE__ */ jsx30(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
|
|
3204
3368
|
const on = (selectedListIds ?? []).includes(list.id);
|
|
3205
|
-
return /* @__PURE__ */
|
|
3369
|
+
return /* @__PURE__ */ jsxs28(
|
|
3206
3370
|
"button",
|
|
3207
3371
|
{
|
|
3208
3372
|
type: "button",
|
|
@@ -3214,19 +3378,19 @@ function SelectionPicker({
|
|
|
3214
3378
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3215
3379
|
),
|
|
3216
3380
|
children: [
|
|
3217
|
-
/* @__PURE__ */
|
|
3381
|
+
/* @__PURE__ */ jsx30(
|
|
3218
3382
|
"span",
|
|
3219
3383
|
{
|
|
3220
3384
|
className: cn(
|
|
3221
3385
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
3222
3386
|
on ? "text-brand-primaryAction" : "text-text-secondary"
|
|
3223
3387
|
),
|
|
3224
|
-
children: on ? /* @__PURE__ */
|
|
3388
|
+
children: on ? /* @__PURE__ */ jsx30(Check6, { size: 16 }) : /* @__PURE__ */ jsx30(Plus2, { size: 16 })
|
|
3225
3389
|
}
|
|
3226
3390
|
),
|
|
3227
|
-
/* @__PURE__ */
|
|
3228
|
-
/* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3391
|
+
/* @__PURE__ */ jsxs28("span", { className: "min-w-0 flex-1", children: [
|
|
3392
|
+
/* @__PURE__ */ jsx30("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsx30("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
|
|
3393
|
+
/* @__PURE__ */ jsxs28("span", { className: "block truncate text-xs text-text-secondary", children: [
|
|
3230
3394
|
list.count,
|
|
3231
3395
|
" accounts \xB7 ",
|
|
3232
3396
|
list.entityTypes.join(", "),
|
|
@@ -3234,13 +3398,13 @@ function SelectionPicker({
|
|
|
3234
3398
|
formatListDate(list.updatedAt)
|
|
3235
3399
|
] })
|
|
3236
3400
|
] }),
|
|
3237
|
-
/* @__PURE__ */
|
|
3401
|
+
/* @__PURE__ */ jsx30("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
|
|
3238
3402
|
]
|
|
3239
3403
|
},
|
|
3240
3404
|
list.id
|
|
3241
3405
|
);
|
|
3242
3406
|
}) }),
|
|
3243
|
-
/* @__PURE__ */
|
|
3407
|
+
/* @__PURE__ */ jsxs28(
|
|
3244
3408
|
"p",
|
|
3245
3409
|
{
|
|
3246
3410
|
className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
|
|
@@ -3252,11 +3416,11 @@ function SelectionPicker({
|
|
|
3252
3416
|
]
|
|
3253
3417
|
}
|
|
3254
3418
|
)
|
|
3255
|
-
] }) : /* @__PURE__ */
|
|
3256
|
-
/* @__PURE__ */
|
|
3257
|
-
/* @__PURE__ */
|
|
3258
|
-
/* @__PURE__ */
|
|
3259
|
-
/* @__PURE__ */
|
|
3419
|
+
] }) : /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3420
|
+
/* @__PURE__ */ jsx30("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ jsx30(List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3421
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-1", children: [
|
|
3422
|
+
/* @__PURE__ */ jsx30("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
|
|
3423
|
+
/* @__PURE__ */ jsx30("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
|
|
3260
3424
|
] })
|
|
3261
3425
|
] })
|
|
3262
3426
|
] })
|
|
@@ -3288,7 +3452,7 @@ function ScrollFade({ className, children }) {
|
|
|
3288
3452
|
[sync]
|
|
3289
3453
|
);
|
|
3290
3454
|
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;
|
|
3291
|
-
return /* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ jsx30("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
|
|
3292
3456
|
}
|
|
3293
3457
|
function formatListDate(iso) {
|
|
3294
3458
|
try {
|
|
@@ -3338,8 +3502,8 @@ function FilterDropdown({
|
|
|
3338
3502
|
const count = active.size;
|
|
3339
3503
|
const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
|
|
3340
3504
|
const filterSlug = slug5(filter.label);
|
|
3341
|
-
return /* @__PURE__ */
|
|
3342
|
-
/* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
|
|
3506
|
+
/* @__PURE__ */ jsxs28(
|
|
3343
3507
|
"button",
|
|
3344
3508
|
{
|
|
3345
3509
|
ref: btnRef,
|
|
@@ -3350,12 +3514,12 @@ function FilterDropdown({
|
|
|
3350
3514
|
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",
|
|
3351
3515
|
children: [
|
|
3352
3516
|
label,
|
|
3353
|
-
/* @__PURE__ */
|
|
3517
|
+
/* @__PURE__ */ jsx30(ChevronDown8, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
3354
3518
|
]
|
|
3355
3519
|
}
|
|
3356
3520
|
),
|
|
3357
3521
|
open && pos && createPortal4(
|
|
3358
|
-
/* @__PURE__ */
|
|
3522
|
+
/* @__PURE__ */ jsxs28(
|
|
3359
3523
|
"div",
|
|
3360
3524
|
{
|
|
3361
3525
|
ref: menuRef,
|
|
@@ -3364,9 +3528,9 @@ function FilterDropdown({
|
|
|
3364
3528
|
style: { top: pos.top, left: pos.left },
|
|
3365
3529
|
className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
3366
3530
|
children: [
|
|
3367
|
-
searchable && /* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3369
|
-
/* @__PURE__ */
|
|
3531
|
+
searchable && /* @__PURE__ */ jsxs28("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
|
|
3532
|
+
/* @__PURE__ */ jsx30(Search4, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
3533
|
+
/* @__PURE__ */ jsx30(
|
|
3370
3534
|
"input",
|
|
3371
3535
|
{
|
|
3372
3536
|
autoFocus: true,
|
|
@@ -3377,14 +3541,14 @@ function FilterDropdown({
|
|
|
3377
3541
|
}
|
|
3378
3542
|
)
|
|
3379
3543
|
] }),
|
|
3380
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsx30("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ jsx30("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
|
|
3381
3545
|
const on = active.has(opt);
|
|
3382
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsxs28(
|
|
3383
3547
|
"label",
|
|
3384
3548
|
{
|
|
3385
3549
|
className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
|
|
3386
3550
|
children: [
|
|
3387
|
-
/* @__PURE__ */
|
|
3551
|
+
/* @__PURE__ */ jsx30(
|
|
3388
3552
|
CheckBox,
|
|
3389
3553
|
{
|
|
3390
3554
|
checked: on,
|
|
@@ -3415,7 +3579,7 @@ function gridForColumns(columns) {
|
|
|
3415
3579
|
|
|
3416
3580
|
// src/PublisherBreakdownList.tsx
|
|
3417
3581
|
import { useState as useState10 } from "react";
|
|
3418
|
-
import { jsx as
|
|
3582
|
+
import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3419
3583
|
var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
|
|
3420
3584
|
function priorYearAmt(spendN, yoy) {
|
|
3421
3585
|
if (yoy === "NEW" || yoy <= -100) return null;
|
|
@@ -3427,27 +3591,27 @@ function initials(name) {
|
|
|
3427
3591
|
return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
|
|
3428
3592
|
}
|
|
3429
3593
|
function Monogram({ name, size = 28 }) {
|
|
3430
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ jsx31(
|
|
3431
3595
|
"span",
|
|
3432
3596
|
{
|
|
3433
3597
|
"aria-hidden": "true",
|
|
3434
|
-
className: "flex shrink-0 items-center justify-center rounded-
|
|
3598
|
+
className: "flex shrink-0 items-center justify-center rounded-control bg-subtle font-bold leading-none text-text-secondary",
|
|
3435
3599
|
style: { width: size, height: size, fontSize: Math.round(size * 0.36) },
|
|
3436
3600
|
children: initials(name)
|
|
3437
3601
|
}
|
|
3438
3602
|
);
|
|
3439
3603
|
}
|
|
3440
3604
|
function BreakdownTag({ children }) {
|
|
3441
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ jsx31("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 });
|
|
3442
3606
|
}
|
|
3443
3607
|
function DelayedTip({ label, children }) {
|
|
3444
|
-
return /* @__PURE__ */
|
|
3608
|
+
return /* @__PURE__ */ jsxs29("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
3445
3609
|
children,
|
|
3446
|
-
/* @__PURE__ */
|
|
3610
|
+
/* @__PURE__ */ jsx31(
|
|
3447
3611
|
"span",
|
|
3448
3612
|
{
|
|
3449
3613
|
role: "tooltip",
|
|
3450
|
-
className: "pointer-events-none invisible absolute bottom-
|
|
3614
|
+
className: "pointer-events-none invisible absolute bottom-full mb-1.5 left-1/2 z-40 w-40 -translate-x-1/2 rounded-control border border-border-default bg-surface px-2 py-1.5 text-center text-micro font-medium leading-snug text-text-secondary opacity-0 shadow-overlay transition-[opacity,visibility] delay-1000 duration-150 group-hover/dt:visible group-hover/dt:opacity-100 group-focus/dt:visible group-focus/dt:opacity-100",
|
|
3451
3615
|
children: label
|
|
3452
3616
|
}
|
|
3453
3617
|
)
|
|
@@ -3457,22 +3621,22 @@ var COL_CURRENT = 76;
|
|
|
3457
3621
|
var COL_PREVIOUS = 76;
|
|
3458
3622
|
var COL_YOY = 44;
|
|
3459
3623
|
function MetricListHeader({ className }) {
|
|
3460
|
-
return /* @__PURE__ */
|
|
3461
|
-
/* @__PURE__ */
|
|
3462
|
-
/* @__PURE__ */
|
|
3463
|
-
/* @__PURE__ */
|
|
3464
|
-
/* @__PURE__ */
|
|
3465
|
-
/* @__PURE__ */
|
|
3624
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
|
|
3625
|
+
/* @__PURE__ */ jsx31("span", { className: "flex-1" }),
|
|
3626
|
+
/* @__PURE__ */ jsxs29("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3627
|
+
/* @__PURE__ */ jsx31("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3628
|
+
/* @__PURE__ */ jsx31(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ jsx31("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
|
|
3629
|
+
/* @__PURE__ */ jsx31(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ jsx31("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
|
|
3466
3630
|
] })
|
|
3467
3631
|
] });
|
|
3468
3632
|
}
|
|
3469
3633
|
function MetricCells({ spendN, yoy }) {
|
|
3470
3634
|
const prior = priorYearAmt(spendN, yoy);
|
|
3471
3635
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3472
|
-
return /* @__PURE__ */
|
|
3473
|
-
/* @__PURE__ */
|
|
3474
|
-
/* @__PURE__ */
|
|
3475
|
-
/* @__PURE__ */
|
|
3636
|
+
return /* @__PURE__ */ jsxs29("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3637
|
+
/* @__PURE__ */ jsx31("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
3638
|
+
/* @__PURE__ */ jsx31("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
3639
|
+
/* @__PURE__ */ jsx31("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ jsx31("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ jsxs29("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
|
|
3476
3640
|
up ? "+" : "\u2212",
|
|
3477
3641
|
Math.abs(yoy),
|
|
3478
3642
|
"%"
|
|
@@ -3491,45 +3655,45 @@ function PublisherBreakdownList({
|
|
|
3491
3655
|
const [showAll, setShowAll] = useState10(false);
|
|
3492
3656
|
const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
|
|
3493
3657
|
const rowPad = padded ? "px-5" : "";
|
|
3494
|
-
return /* @__PURE__ */
|
|
3495
|
-
/* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
visible.map((p) => /* @__PURE__ */
|
|
3498
|
-
/* @__PURE__ */
|
|
3499
|
-
renderLogo ? renderLogo(p) : /* @__PURE__ */
|
|
3500
|
-
/* @__PURE__ */
|
|
3501
|
-
/* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
p.tags.map((t) => /* @__PURE__ */
|
|
3658
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3659
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col", children: [
|
|
3660
|
+
/* @__PURE__ */ jsx31(MetricListHeader, { className: rowPad }),
|
|
3661
|
+
visible.map((p) => /* @__PURE__ */ jsxs29("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: [
|
|
3662
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
3663
|
+
renderLogo ? renderLogo(p) : /* @__PURE__ */ jsx31(Monogram, { name: p.brand, size: 28 }),
|
|
3664
|
+
/* @__PURE__ */ jsxs29("div", { className: "min-w-0", children: [
|
|
3665
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3666
|
+
/* @__PURE__ */ jsx31("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
3667
|
+
p.tags.map((t) => /* @__PURE__ */ jsx31(BreakdownTag, { children: t }, t))
|
|
3504
3668
|
] }),
|
|
3505
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ jsx31("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
|
|
3506
3670
|
] })
|
|
3507
3671
|
] }),
|
|
3508
|
-
/* @__PURE__ */
|
|
3672
|
+
/* @__PURE__ */ jsx31(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3509
3673
|
] }, p.brand))
|
|
3510
3674
|
] }),
|
|
3511
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */
|
|
3512
|
-
/* @__PURE__ */
|
|
3675
|
+
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ jsx31("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ jsx31("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__ */ jsxs29("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
|
|
3676
|
+
/* @__PURE__ */ jsxs29("span", { children: [
|
|
3513
3677
|
"Showing ",
|
|
3514
3678
|
visible.length,
|
|
3515
3679
|
" of ",
|
|
3516
3680
|
rows.length
|
|
3517
3681
|
] }),
|
|
3518
|
-
!showAll ? /* @__PURE__ */
|
|
3682
|
+
!showAll ? /* @__PURE__ */ jsxs29("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: [
|
|
3519
3683
|
"See all (",
|
|
3520
3684
|
rows.length - defaultVisibleCount,
|
|
3521
3685
|
" more)"
|
|
3522
|
-
] }) : /* @__PURE__ */
|
|
3686
|
+
] }) : /* @__PURE__ */ jsx31("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" })
|
|
3523
3687
|
] }))
|
|
3524
3688
|
] });
|
|
3525
3689
|
}
|
|
3526
3690
|
|
|
3527
3691
|
// src/Button.tsx
|
|
3528
|
-
import { forwardRef as
|
|
3692
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
3529
3693
|
import { Slot } from "@radix-ui/react-slot";
|
|
3530
3694
|
import { cva } from "class-variance-authority";
|
|
3531
3695
|
import { Loader2 as Loader22 } from "lucide-react";
|
|
3532
|
-
import { jsx as
|
|
3696
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3533
3697
|
var buttonVariants = cva(
|
|
3534
3698
|
"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",
|
|
3535
3699
|
{
|
|
@@ -3590,7 +3754,7 @@ var buttonVariants = cva(
|
|
|
3590
3754
|
}
|
|
3591
3755
|
}
|
|
3592
3756
|
);
|
|
3593
|
-
var Button =
|
|
3757
|
+
var Button = forwardRef6(
|
|
3594
3758
|
({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
|
|
3595
3759
|
const shared = {
|
|
3596
3760
|
className: cn(buttonVariants({ variant, size, iconOnly, className })),
|
|
@@ -3600,10 +3764,10 @@ var Button = forwardRef4(
|
|
|
3600
3764
|
...props
|
|
3601
3765
|
};
|
|
3602
3766
|
if (asChild) {
|
|
3603
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ jsx32(Slot, { ref, ...shared, children });
|
|
3604
3768
|
}
|
|
3605
|
-
return /* @__PURE__ */
|
|
3606
|
-
loading && /* @__PURE__ */
|
|
3769
|
+
return /* @__PURE__ */ jsxs30("button", { ref, ...shared, children: [
|
|
3770
|
+
loading && /* @__PURE__ */ jsx32(Loader22, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
3607
3771
|
children
|
|
3608
3772
|
] });
|
|
3609
3773
|
}
|
|
@@ -3611,7 +3775,7 @@ var Button = forwardRef4(
|
|
|
3611
3775
|
Button.displayName = "Button";
|
|
3612
3776
|
|
|
3613
3777
|
// src/FilterDropdownFooter.tsx
|
|
3614
|
-
import { jsx as
|
|
3778
|
+
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3615
3779
|
function FilterDropdownFooter({
|
|
3616
3780
|
onClear,
|
|
3617
3781
|
onApply,
|
|
@@ -3620,7 +3784,7 @@ function FilterDropdownFooter({
|
|
|
3620
3784
|
className,
|
|
3621
3785
|
testIdPrefix
|
|
3622
3786
|
}) {
|
|
3623
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ jsxs31(
|
|
3624
3788
|
"div",
|
|
3625
3789
|
{
|
|
3626
3790
|
className: cn(
|
|
@@ -3630,8 +3794,8 @@ function FilterDropdownFooter({
|
|
|
3630
3794
|
),
|
|
3631
3795
|
"data-testid": testIdPrefix,
|
|
3632
3796
|
children: [
|
|
3633
|
-
onClear && /* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
3797
|
+
onClear && /* @__PURE__ */ jsx33(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
|
|
3798
|
+
/* @__PURE__ */ jsx33(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
|
|
3635
3799
|
]
|
|
3636
3800
|
}
|
|
3637
3801
|
);
|
|
@@ -3640,7 +3804,7 @@ function FilterDropdownFooter({
|
|
|
3640
3804
|
// src/NameListModal.tsx
|
|
3641
3805
|
import { useEffect as useEffect10, useId as useId5, useRef as useRef12, useState as useState11 } from "react";
|
|
3642
3806
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3643
|
-
import { jsx as
|
|
3807
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3644
3808
|
function NameListModal({
|
|
3645
3809
|
title,
|
|
3646
3810
|
initialName,
|
|
@@ -3694,12 +3858,12 @@ function NameListModal({
|
|
|
3694
3858
|
// bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
|
|
3695
3859
|
// No in-data-[theme=dark] override needed any more -- the token redefines
|
|
3696
3860
|
// itself under that attribute in dark.css, so one class covers both themes.
|
|
3697
|
-
/* @__PURE__ */
|
|
3861
|
+
/* @__PURE__ */ jsx34(
|
|
3698
3862
|
"div",
|
|
3699
3863
|
{
|
|
3700
3864
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
|
|
3701
3865
|
onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
|
|
3702
|
-
children: /* @__PURE__ */
|
|
3866
|
+
children: /* @__PURE__ */ jsxs32(
|
|
3703
3867
|
"div",
|
|
3704
3868
|
{
|
|
3705
3869
|
ref: dialogRef,
|
|
@@ -3710,10 +3874,10 @@ function NameListModal({
|
|
|
3710
3874
|
"data-testid": testIdPrefix,
|
|
3711
3875
|
className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
|
|
3712
3876
|
children: [
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ jsx34("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
3878
|
+
/* @__PURE__ */ jsxs32("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
3879
|
+
/* @__PURE__ */ jsx34("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
3880
|
+
/* @__PURE__ */ jsx34(
|
|
3717
3881
|
"input",
|
|
3718
3882
|
{
|
|
3719
3883
|
id: fieldId,
|
|
@@ -3725,13 +3889,13 @@ function NameListModal({
|
|
|
3725
3889
|
}
|
|
3726
3890
|
)
|
|
3727
3891
|
] }),
|
|
3728
|
-
options && options.length > 0 && /* @__PURE__ */
|
|
3729
|
-
/* @__PURE__ */
|
|
3892
|
+
options && options.length > 0 && /* @__PURE__ */ jsx34("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ jsxs32("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
|
|
3893
|
+
/* @__PURE__ */ jsx34(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
3730
3894
|
o.label
|
|
3731
3895
|
] }, o.key)) }),
|
|
3732
|
-
/* @__PURE__ */
|
|
3733
|
-
/* @__PURE__ */
|
|
3734
|
-
/* @__PURE__ */
|
|
3896
|
+
/* @__PURE__ */ jsxs32("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
|
|
3897
|
+
/* @__PURE__ */ jsx34(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
3898
|
+
/* @__PURE__ */ jsx34(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
|
|
3735
3899
|
] })
|
|
3736
3900
|
]
|
|
3737
3901
|
}
|
|
@@ -3744,11 +3908,11 @@ function NameListModal({
|
|
|
3744
3908
|
|
|
3745
3909
|
// src/FilterChipBar.tsx
|
|
3746
3910
|
import { CircleSlash, X as X4 } from "lucide-react";
|
|
3747
|
-
import { jsx as
|
|
3911
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3748
3912
|
function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
|
|
3749
3913
|
if (chips.length === 0) return null;
|
|
3750
|
-
return /* @__PURE__ */
|
|
3751
|
-
chips.map((c) => /* @__PURE__ */
|
|
3914
|
+
return /* @__PURE__ */ jsxs33("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
|
|
3915
|
+
chips.map((c) => /* @__PURE__ */ jsx35(
|
|
3752
3916
|
Chip,
|
|
3753
3917
|
{
|
|
3754
3918
|
label: c.label,
|
|
@@ -3758,7 +3922,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
3758
3922
|
},
|
|
3759
3923
|
c.key
|
|
3760
3924
|
)),
|
|
3761
|
-
/* @__PURE__ */
|
|
3925
|
+
/* @__PURE__ */ jsx35(
|
|
3762
3926
|
"button",
|
|
3763
3927
|
{
|
|
3764
3928
|
type: "button",
|
|
@@ -3775,8 +3939,8 @@ function Chip({
|
|
|
3775
3939
|
parked,
|
|
3776
3940
|
onRemove
|
|
3777
3941
|
}) {
|
|
3778
|
-
return /* @__PURE__ */
|
|
3779
|
-
/* @__PURE__ */
|
|
3942
|
+
return /* @__PURE__ */ jsxs33("span", { className: "group relative inline-flex", children: [
|
|
3943
|
+
/* @__PURE__ */ jsxs33(
|
|
3780
3944
|
"span",
|
|
3781
3945
|
{
|
|
3782
3946
|
className: cn(
|
|
@@ -3788,22 +3952,22 @@ function Chip({
|
|
|
3788
3952
|
) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
|
|
3789
3953
|
),
|
|
3790
3954
|
children: [
|
|
3791
|
-
parked && /* @__PURE__ */
|
|
3955
|
+
parked && /* @__PURE__ */ jsx35(CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
3792
3956
|
label,
|
|
3793
|
-
/* @__PURE__ */
|
|
3957
|
+
/* @__PURE__ */ jsx35(
|
|
3794
3958
|
"button",
|
|
3795
3959
|
{
|
|
3796
3960
|
type: "button",
|
|
3797
3961
|
onClick: onRemove,
|
|
3798
3962
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
3799
3963
|
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",
|
|
3800
|
-
children: /* @__PURE__ */
|
|
3964
|
+
children: /* @__PURE__ */ jsx35(X4, { size: 12 })
|
|
3801
3965
|
}
|
|
3802
3966
|
)
|
|
3803
3967
|
]
|
|
3804
3968
|
}
|
|
3805
3969
|
),
|
|
3806
|
-
/* @__PURE__ */
|
|
3970
|
+
/* @__PURE__ */ jsx35(
|
|
3807
3971
|
"span",
|
|
3808
3972
|
{
|
|
3809
3973
|
role: "tooltip",
|
|
@@ -3815,15 +3979,15 @@ function Chip({
|
|
|
3815
3979
|
}
|
|
3816
3980
|
|
|
3817
3981
|
// src/SortButton.tsx
|
|
3818
|
-
import { forwardRef as
|
|
3982
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
3819
3983
|
import { ArrowUp, ArrowDown, ArrowUpDown } from "lucide-react";
|
|
3820
|
-
import { jsx as
|
|
3984
|
+
import { jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3821
3985
|
var ALIGN = {
|
|
3822
3986
|
left: "justify-start text-left",
|
|
3823
3987
|
center: "justify-center text-center",
|
|
3824
3988
|
right: "justify-end text-right"
|
|
3825
3989
|
};
|
|
3826
|
-
var SortButton =
|
|
3990
|
+
var SortButton = forwardRef7(
|
|
3827
3991
|
function SortButton2({
|
|
3828
3992
|
label,
|
|
3829
3993
|
sortKey,
|
|
@@ -3835,9 +3999,9 @@ var SortButton = forwardRef5(
|
|
|
3835
3999
|
className,
|
|
3836
4000
|
testIdPrefix
|
|
3837
4001
|
}, ref) {
|
|
3838
|
-
if (!sortable) return /* @__PURE__ */
|
|
4002
|
+
if (!sortable) return /* @__PURE__ */ jsx36("span", { className: cn("inline-flex", ALIGN[align], className), children: label });
|
|
3839
4003
|
const active = !disabled && sort.key === sortKey;
|
|
3840
|
-
return /* @__PURE__ */
|
|
4004
|
+
return /* @__PURE__ */ jsxs34(
|
|
3841
4005
|
"button",
|
|
3842
4006
|
{
|
|
3843
4007
|
ref,
|
|
@@ -3868,7 +4032,7 @@ var SortButton = forwardRef5(
|
|
|
3868
4032
|
),
|
|
3869
4033
|
children: [
|
|
3870
4034
|
label,
|
|
3871
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */
|
|
4035
|
+
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ jsx36(ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ jsx36(ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ jsx36(
|
|
3872
4036
|
ArrowUpDown,
|
|
3873
4037
|
{
|
|
3874
4038
|
size: 12,
|
|
@@ -3899,7 +4063,7 @@ function ariaSortFor(sort, key) {
|
|
|
3899
4063
|
|
|
3900
4064
|
// src/Pager.tsx
|
|
3901
4065
|
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight4 } from "lucide-react";
|
|
3902
|
-
import { jsx as
|
|
4066
|
+
import { jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3903
4067
|
function pageWindow(current, total) {
|
|
3904
4068
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
3905
4069
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -3915,8 +4079,8 @@ function pageWindow(current, total) {
|
|
|
3915
4079
|
}
|
|
3916
4080
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
3917
4081
|
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";
|
|
3918
|
-
return /* @__PURE__ */
|
|
3919
|
-
/* @__PURE__ */
|
|
4082
|
+
return /* @__PURE__ */ jsxs35("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4083
|
+
/* @__PURE__ */ jsx37(
|
|
3920
4084
|
"button",
|
|
3921
4085
|
{
|
|
3922
4086
|
type: "button",
|
|
@@ -3924,11 +4088,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
3924
4088
|
disabled: disabled || page === 1,
|
|
3925
4089
|
"aria-label": "Previous page",
|
|
3926
4090
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
3927
|
-
children: /* @__PURE__ */
|
|
4091
|
+
children: /* @__PURE__ */ jsx37(ChevronLeft3, { size: 16 })
|
|
3928
4092
|
}
|
|
3929
4093
|
),
|
|
3930
4094
|
pageWindow(page, totalPages).map(
|
|
3931
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4095
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx37("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx37(
|
|
3932
4096
|
"button",
|
|
3933
4097
|
{
|
|
3934
4098
|
type: "button",
|
|
@@ -3944,7 +4108,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
3944
4108
|
p
|
|
3945
4109
|
)
|
|
3946
4110
|
),
|
|
3947
|
-
/* @__PURE__ */
|
|
4111
|
+
/* @__PURE__ */ jsx37(
|
|
3948
4112
|
"button",
|
|
3949
4113
|
{
|
|
3950
4114
|
type: "button",
|
|
@@ -3952,14 +4116,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
3952
4116
|
disabled: disabled || page === totalPages,
|
|
3953
4117
|
"aria-label": "Next page",
|
|
3954
4118
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
3955
|
-
children: /* @__PURE__ */
|
|
4119
|
+
children: /* @__PURE__ */ jsx37(ChevronRight4, { size: 16 })
|
|
3956
4120
|
}
|
|
3957
4121
|
)
|
|
3958
4122
|
] });
|
|
3959
4123
|
}
|
|
3960
4124
|
|
|
3961
4125
|
// src/WorkspaceAvatar.tsx
|
|
3962
|
-
import { jsx as
|
|
4126
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3963
4127
|
function workspaceInitials(name) {
|
|
3964
4128
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
3965
4129
|
if (words.length === 0) return "\xB7";
|
|
@@ -3978,7 +4142,7 @@ var SIZES = {
|
|
|
3978
4142
|
lg: "h-11 w-11 text-panel-title"
|
|
3979
4143
|
};
|
|
3980
4144
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
3981
|
-
return /* @__PURE__ */
|
|
4145
|
+
return /* @__PURE__ */ jsx38(
|
|
3982
4146
|
"span",
|
|
3983
4147
|
{
|
|
3984
4148
|
"aria-hidden": "true",
|
|
@@ -3997,11 +4161,11 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
3997
4161
|
import { useEffect as useEffect11, useRef as useRef13, useState as useState12 } from "react";
|
|
3998
4162
|
import { createPortal as createPortal6 } from "react-dom";
|
|
3999
4163
|
import { AlertTriangle, Check as Check7 } from "lucide-react";
|
|
4000
|
-
import { jsx as
|
|
4164
|
+
import { jsx as jsx39, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4001
4165
|
var ICON = {
|
|
4002
4166
|
neutral: null,
|
|
4003
|
-
success: /* @__PURE__ */
|
|
4004
|
-
warning: /* @__PURE__ */
|
|
4167
|
+
success: /* @__PURE__ */ jsx39(Check7, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
|
|
4168
|
+
warning: /* @__PURE__ */ jsx39(AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
|
|
4005
4169
|
};
|
|
4006
4170
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4007
4171
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
@@ -4017,7 +4181,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4017
4181
|
return () => window.clearTimeout(t);
|
|
4018
4182
|
}, [message, ms, paused]);
|
|
4019
4183
|
return createPortal6(
|
|
4020
|
-
/* @__PURE__ */
|
|
4184
|
+
/* @__PURE__ */ jsxs36(
|
|
4021
4185
|
"div",
|
|
4022
4186
|
{
|
|
4023
4187
|
role: "status",
|
|
@@ -4035,7 +4199,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4035
4199
|
children: [
|
|
4036
4200
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4037
4201
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4038
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ jsx39(
|
|
4039
4203
|
"span",
|
|
4040
4204
|
{
|
|
4041
4205
|
className: cn(
|
|
@@ -4045,8 +4209,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4045
4209
|
children: ICON[tone]
|
|
4046
4210
|
}
|
|
4047
4211
|
),
|
|
4048
|
-
/* @__PURE__ */
|
|
4049
|
-
action && /* @__PURE__ */
|
|
4212
|
+
/* @__PURE__ */ jsx39("span", { className: "min-w-0", children: message }),
|
|
4213
|
+
action && /* @__PURE__ */ jsx39(
|
|
4050
4214
|
"button",
|
|
4051
4215
|
{
|
|
4052
4216
|
type: "button",
|
|
@@ -4068,14 +4232,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4068
4232
|
}
|
|
4069
4233
|
|
|
4070
4234
|
// src/Tag.tsx
|
|
4071
|
-
import { jsx as
|
|
4235
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
4072
4236
|
function Tag({ children, className, testIdPrefix }) {
|
|
4073
|
-
return /* @__PURE__ */
|
|
4237
|
+
return /* @__PURE__ */ jsx40(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4074
4238
|
}
|
|
4075
4239
|
|
|
4076
4240
|
// src/TablePagination.tsx
|
|
4077
4241
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
4078
|
-
import { jsx as
|
|
4242
|
+
import { jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4079
4243
|
function TablePagination({
|
|
4080
4244
|
page,
|
|
4081
4245
|
perPage,
|
|
@@ -4095,7 +4259,7 @@ function TablePagination({
|
|
|
4095
4259
|
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";
|
|
4096
4260
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4097
4261
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4098
|
-
const range = /* @__PURE__ */
|
|
4262
|
+
const range = /* @__PURE__ */ jsxs37("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4099
4263
|
rangeStart.toLocaleString(),
|
|
4100
4264
|
" \u2013 ",
|
|
4101
4265
|
rangeEnd.toLocaleString(),
|
|
@@ -4104,13 +4268,13 @@ function TablePagination({
|
|
|
4104
4268
|
" ",
|
|
4105
4269
|
itemLabel
|
|
4106
4270
|
] });
|
|
4107
|
-
return /* @__PURE__ */
|
|
4108
|
-
/* @__PURE__ */
|
|
4271
|
+
return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4272
|
+
/* @__PURE__ */ jsxs37(
|
|
4109
4273
|
"div",
|
|
4110
4274
|
{
|
|
4111
4275
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4112
4276
|
children: [
|
|
4113
|
-
/* @__PURE__ */
|
|
4277
|
+
/* @__PURE__ */ jsx41(
|
|
4114
4278
|
SelectFilter,
|
|
4115
4279
|
{
|
|
4116
4280
|
size: "sm",
|
|
@@ -4126,8 +4290,8 @@ function TablePagination({
|
|
|
4126
4290
|
]
|
|
4127
4291
|
}
|
|
4128
4292
|
),
|
|
4129
|
-
/* @__PURE__ */
|
|
4130
|
-
/* @__PURE__ */
|
|
4293
|
+
/* @__PURE__ */ jsxs37("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4294
|
+
/* @__PURE__ */ jsx41(
|
|
4131
4295
|
"button",
|
|
4132
4296
|
{
|
|
4133
4297
|
type: "button",
|
|
@@ -4136,10 +4300,10 @@ function TablePagination({
|
|
|
4136
4300
|
"aria-label": "First page",
|
|
4137
4301
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4138
4302
|
className: stepBtn,
|
|
4139
|
-
children: /* @__PURE__ */
|
|
4303
|
+
children: /* @__PURE__ */ jsx41(ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4140
4304
|
}
|
|
4141
4305
|
),
|
|
4142
|
-
/* @__PURE__ */
|
|
4306
|
+
/* @__PURE__ */ jsx41(
|
|
4143
4307
|
"button",
|
|
4144
4308
|
{
|
|
4145
4309
|
type: "button",
|
|
@@ -4148,11 +4312,11 @@ function TablePagination({
|
|
|
4148
4312
|
"aria-label": "Previous page",
|
|
4149
4313
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4150
4314
|
className: stepBtn,
|
|
4151
|
-
children: /* @__PURE__ */
|
|
4315
|
+
children: /* @__PURE__ */ jsx41(ChevronLeft4, { size: 16, "aria-hidden": "true" })
|
|
4152
4316
|
}
|
|
4153
4317
|
),
|
|
4154
4318
|
pageWindow(current, totalPages).map(
|
|
4155
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4319
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx41("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx41(
|
|
4156
4320
|
"button",
|
|
4157
4321
|
{
|
|
4158
4322
|
type: "button",
|
|
@@ -4170,7 +4334,7 @@ function TablePagination({
|
|
|
4170
4334
|
p
|
|
4171
4335
|
)
|
|
4172
4336
|
),
|
|
4173
|
-
/* @__PURE__ */
|
|
4337
|
+
/* @__PURE__ */ jsx41(
|
|
4174
4338
|
"button",
|
|
4175
4339
|
{
|
|
4176
4340
|
type: "button",
|
|
@@ -4179,10 +4343,10 @@ function TablePagination({
|
|
|
4179
4343
|
"aria-label": "Next page",
|
|
4180
4344
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4181
4345
|
className: stepBtn,
|
|
4182
|
-
children: /* @__PURE__ */
|
|
4346
|
+
children: /* @__PURE__ */ jsx41(ChevronRight5, { size: 16, "aria-hidden": "true" })
|
|
4183
4347
|
}
|
|
4184
4348
|
),
|
|
4185
|
-
/* @__PURE__ */
|
|
4349
|
+
/* @__PURE__ */ jsx41(
|
|
4186
4350
|
"button",
|
|
4187
4351
|
{
|
|
4188
4352
|
type: "button",
|
|
@@ -4191,7 +4355,7 @@ function TablePagination({
|
|
|
4191
4355
|
"aria-label": "Last page",
|
|
4192
4356
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4193
4357
|
className: stepBtn,
|
|
4194
|
-
children: /* @__PURE__ */
|
|
4358
|
+
children: /* @__PURE__ */ jsx41(ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4195
4359
|
}
|
|
4196
4360
|
)
|
|
4197
4361
|
] }),
|
|
@@ -4202,7 +4366,7 @@ function TablePagination({
|
|
|
4202
4366
|
// src/DateRangePicker.tsx
|
|
4203
4367
|
import { useEffect as useEffect12, useMemo as useMemo4, useRef as useRef14, useState as useState13 } from "react";
|
|
4204
4368
|
import { ChevronDown as ChevronDown9 } from "lucide-react";
|
|
4205
|
-
import { jsx as
|
|
4369
|
+
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4206
4370
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4207
4371
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4208
4372
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4240,7 +4404,7 @@ function spanLabel2(label, today, formatDate, formatRange) {
|
|
|
4240
4404
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4241
4405
|
}
|
|
4242
4406
|
function MiniSelect({ value, onChange, options }) {
|
|
4243
|
-
return /* @__PURE__ */
|
|
4407
|
+
return /* @__PURE__ */ jsx42(
|
|
4244
4408
|
"select",
|
|
4245
4409
|
{
|
|
4246
4410
|
value: String(value),
|
|
@@ -4249,7 +4413,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4249
4413
|
if (opt) onChange(opt.value);
|
|
4250
4414
|
},
|
|
4251
4415
|
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",
|
|
4252
|
-
children: options.map((o) => /* @__PURE__ */
|
|
4416
|
+
children: options.map((o) => /* @__PURE__ */ jsx42("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4253
4417
|
}
|
|
4254
4418
|
);
|
|
4255
4419
|
}
|
|
@@ -4314,8 +4478,8 @@ function DateRangePicker({
|
|
|
4314
4478
|
if (showFooter) setDraft(label);
|
|
4315
4479
|
else commit(label);
|
|
4316
4480
|
};
|
|
4317
|
-
return /* @__PURE__ */
|
|
4318
|
-
/* @__PURE__ */
|
|
4481
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4482
|
+
/* @__PURE__ */ jsxs38(
|
|
4319
4483
|
"button",
|
|
4320
4484
|
{
|
|
4321
4485
|
type: "button",
|
|
@@ -4324,16 +4488,16 @@ function DateRangePicker({
|
|
|
4324
4488
|
"aria-haspopup": "listbox",
|
|
4325
4489
|
className: chipTriggerClass(),
|
|
4326
4490
|
children: [
|
|
4327
|
-
/* @__PURE__ */
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4491
|
+
/* @__PURE__ */ jsxs38("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4492
|
+
/* @__PURE__ */ jsx42("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate, formatRange) }),
|
|
4493
|
+
/* @__PURE__ */ jsx42("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
|
|
4330
4494
|
] }),
|
|
4331
|
-
/* @__PURE__ */
|
|
4495
|
+
/* @__PURE__ */ jsx42(ChevronDown9, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4332
4496
|
]
|
|
4333
4497
|
}
|
|
4334
4498
|
),
|
|
4335
|
-
open && /* @__PURE__ */
|
|
4336
|
-
presets.map((p) => /* @__PURE__ */
|
|
4499
|
+
open && /* @__PURE__ */ jsxs38("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: [
|
|
4500
|
+
presets.map((p) => /* @__PURE__ */ jsx42(
|
|
4337
4501
|
"button",
|
|
4338
4502
|
{
|
|
4339
4503
|
type: "button",
|
|
@@ -4343,26 +4507,26 @@ function DateRangePicker({
|
|
|
4343
4507
|
},
|
|
4344
4508
|
p
|
|
4345
4509
|
)),
|
|
4346
|
-
/* @__PURE__ */
|
|
4347
|
-
/* @__PURE__ */
|
|
4348
|
-
/* @__PURE__ */
|
|
4349
|
-
/* @__PURE__ */
|
|
4510
|
+
/* @__PURE__ */ jsxs38("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4511
|
+
/* @__PURE__ */ jsx42("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4512
|
+
/* @__PURE__ */ jsxs38("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4513
|
+
/* @__PURE__ */ jsxs38("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4350
4514
|
"From",
|
|
4351
|
-
/* @__PURE__ */
|
|
4352
|
-
granularity === "month" && /* @__PURE__ */
|
|
4353
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4354
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ jsxs38("span", { className: "flex gap-1", children: [
|
|
4516
|
+
granularity === "month" && /* @__PURE__ */ jsx42(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4517
|
+
granularity === "quarter" && /* @__PURE__ */ jsx42(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4518
|
+
/* @__PURE__ */ jsx42(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4355
4519
|
] })
|
|
4356
4520
|
] }),
|
|
4357
|
-
/* @__PURE__ */
|
|
4521
|
+
/* @__PURE__ */ jsxs38("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4358
4522
|
"To",
|
|
4359
|
-
/* @__PURE__ */
|
|
4360
|
-
granularity === "month" && /* @__PURE__ */
|
|
4361
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4362
|
-
/* @__PURE__ */
|
|
4523
|
+
/* @__PURE__ */ jsxs38("span", { className: "flex gap-1", children: [
|
|
4524
|
+
granularity === "month" && /* @__PURE__ */ jsx42(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4525
|
+
granularity === "quarter" && /* @__PURE__ */ jsx42(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4526
|
+
/* @__PURE__ */ jsx42(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4363
4527
|
] })
|
|
4364
4528
|
] }),
|
|
4365
|
-
/* @__PURE__ */
|
|
4529
|
+
/* @__PURE__ */ jsx42(
|
|
4366
4530
|
"button",
|
|
4367
4531
|
{
|
|
4368
4532
|
type: "button",
|
|
@@ -4374,7 +4538,7 @@ function DateRangePicker({
|
|
|
4374
4538
|
)
|
|
4375
4539
|
] })
|
|
4376
4540
|
] }),
|
|
4377
|
-
showFooter && /* @__PURE__ */
|
|
4541
|
+
showFooter && /* @__PURE__ */ jsx42(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4378
4542
|
] })
|
|
4379
4543
|
] });
|
|
4380
4544
|
}
|
|
@@ -4382,7 +4546,8 @@ function DateRangePicker({
|
|
|
4382
4546
|
// src/MultiSelectFilter.tsx
|
|
4383
4547
|
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef15, useState as useState14 } from "react";
|
|
4384
4548
|
import { ChevronDown as ChevronDown10, Search as Search5, X as X5 } from "lucide-react";
|
|
4385
|
-
import { Fragment as Fragment4, jsx as
|
|
4549
|
+
import { Fragment as Fragment4, jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4550
|
+
var SEARCH_AFTER = 8;
|
|
4386
4551
|
function MultiSelectFilter({
|
|
4387
4552
|
caption,
|
|
4388
4553
|
options = [],
|
|
@@ -4392,7 +4557,7 @@ function MultiSelectFilter({
|
|
|
4392
4557
|
selected,
|
|
4393
4558
|
onChange,
|
|
4394
4559
|
allLabel = "All",
|
|
4395
|
-
searchable
|
|
4560
|
+
searchable,
|
|
4396
4561
|
searchPlaceholder,
|
|
4397
4562
|
align = "left",
|
|
4398
4563
|
fullIsAll = false,
|
|
@@ -4414,6 +4579,7 @@ function MultiSelectFilter({
|
|
|
4414
4579
|
}) {
|
|
4415
4580
|
const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
|
|
4416
4581
|
const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
|
|
4582
|
+
const showSearch = searchable ?? leafOptions.length > SEARCH_AFTER;
|
|
4417
4583
|
const [open, setOpen] = useState14(false);
|
|
4418
4584
|
const [q, setQ] = useState14("");
|
|
4419
4585
|
const [draft, setDraft] = useState14(selected);
|
|
@@ -4435,6 +4601,12 @@ function MultiSelectFilter({
|
|
|
4435
4601
|
setOpen(false);
|
|
4436
4602
|
setQ("");
|
|
4437
4603
|
};
|
|
4604
|
+
const clearAll = () => {
|
|
4605
|
+
setDraft(clearValue);
|
|
4606
|
+
onChange(clearValue);
|
|
4607
|
+
setOpen(false);
|
|
4608
|
+
setQ("");
|
|
4609
|
+
};
|
|
4438
4610
|
useEffect13(() => {
|
|
4439
4611
|
if (!open) return;
|
|
4440
4612
|
const onKey = (e) => e.key === "Escape" && close();
|
|
@@ -4472,9 +4644,9 @@ function MultiSelectFilter({
|
|
|
4472
4644
|
const shown = open && !showFooter ? draft : selected;
|
|
4473
4645
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4474
4646
|
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4475
|
-
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */
|
|
4476
|
-
/* @__PURE__ */
|
|
4477
|
-
/* @__PURE__ */
|
|
4647
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ jsxs39("span", { className: "flex flex-col", children: [
|
|
4648
|
+
/* @__PURE__ */ jsx43("span", { children: label }),
|
|
4649
|
+
/* @__PURE__ */ jsx43("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4478
4650
|
] }) : label;
|
|
4479
4651
|
const ql = q.trim().toLowerCase();
|
|
4480
4652
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4485,8 +4657,8 @@ function MultiSelectFilter({
|
|
|
4485
4657
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4486
4658
|
return kids.length ? { ...g, children: kids } : null;
|
|
4487
4659
|
}).filter((g) => g !== null) : [];
|
|
4488
|
-
return /* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */
|
|
4660
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4661
|
+
/* @__PURE__ */ jsxs39(
|
|
4490
4662
|
"button",
|
|
4491
4663
|
{
|
|
4492
4664
|
type: "button",
|
|
@@ -4495,8 +4667,8 @@ function MultiSelectFilter({
|
|
|
4495
4667
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4496
4668
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4497
4669
|
children: [
|
|
4498
|
-
/* @__PURE__ */
|
|
4499
|
-
/* @__PURE__ */
|
|
4670
|
+
/* @__PURE__ */ jsx43(ChipContent, { caption, value, icon }),
|
|
4671
|
+
/* @__PURE__ */ jsx43(
|
|
4500
4672
|
ChevronDown10,
|
|
4501
4673
|
{
|
|
4502
4674
|
size: 14,
|
|
@@ -4507,21 +4679,21 @@ function MultiSelectFilter({
|
|
|
4507
4679
|
]
|
|
4508
4680
|
}
|
|
4509
4681
|
),
|
|
4510
|
-
open && /* @__PURE__ */
|
|
4682
|
+
open && /* @__PURE__ */ jsx43(
|
|
4511
4683
|
"div",
|
|
4512
4684
|
{
|
|
4513
4685
|
className: cn(
|
|
4514
|
-
"absolute top-
|
|
4686
|
+
"absolute top-full mt-2 z-30 flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
|
|
4515
4687
|
menuWidthClass,
|
|
4516
4688
|
align === "right" ? "right-0" : "left-0"
|
|
4517
4689
|
),
|
|
4518
4690
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4519
4691
|
role: "dialog",
|
|
4520
4692
|
"aria-label": caption,
|
|
4521
|
-
children: loading ? /* @__PURE__ */
|
|
4522
|
-
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
/* @__PURE__ */
|
|
4693
|
+
children: loading ? /* @__PURE__ */ jsx43(MenuLoading, {}) : error ? /* @__PURE__ */ jsx43(MenuError, { onRetry }) : /* @__PURE__ */ jsxs39(Fragment4, { children: [
|
|
4694
|
+
showSearch && /* @__PURE__ */ jsx43("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs39("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: [
|
|
4695
|
+
/* @__PURE__ */ jsx43(Search5, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4696
|
+
/* @__PURE__ */ jsx43(
|
|
4525
4697
|
"input",
|
|
4526
4698
|
{
|
|
4527
4699
|
type: "text",
|
|
@@ -4531,37 +4703,37 @@ function MultiSelectFilter({
|
|
|
4531
4703
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4532
4704
|
}
|
|
4533
4705
|
),
|
|
4534
|
-
q && /* @__PURE__ */
|
|
4706
|
+
q && /* @__PURE__ */ jsx43("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__ */ jsx43(X5, { size: 13 }) })
|
|
4535
4707
|
] }) }),
|
|
4536
|
-
/* @__PURE__ */
|
|
4708
|
+
/* @__PURE__ */ jsxs39("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4537
4709
|
groups ? visibleGroups.map((g) => {
|
|
4538
4710
|
const state = groupState(g);
|
|
4539
|
-
return /* @__PURE__ */
|
|
4540
|
-
/* @__PURE__ */
|
|
4711
|
+
return /* @__PURE__ */ jsxs39("div", { children: [
|
|
4712
|
+
/* @__PURE__ */ jsxs39(
|
|
4541
4713
|
"button",
|
|
4542
4714
|
{
|
|
4543
4715
|
type: "button",
|
|
4544
4716
|
onClick: () => toggleGroup(g),
|
|
4545
4717
|
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",
|
|
4546
4718
|
children: [
|
|
4547
|
-
/* @__PURE__ */
|
|
4548
|
-
/* @__PURE__ */
|
|
4549
|
-
counts && /* @__PURE__ */
|
|
4719
|
+
/* @__PURE__ */ jsx43(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
4720
|
+
/* @__PURE__ */ jsx43("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
4721
|
+
counts && /* @__PURE__ */ jsx43(OptionCount, { n: countFor(g.id) })
|
|
4550
4722
|
]
|
|
4551
4723
|
}
|
|
4552
4724
|
),
|
|
4553
4725
|
g.children.map((c) => {
|
|
4554
4726
|
const checked = draft.includes(c.id);
|
|
4555
|
-
return /* @__PURE__ */
|
|
4727
|
+
return /* @__PURE__ */ jsxs39(
|
|
4556
4728
|
"button",
|
|
4557
4729
|
{
|
|
4558
4730
|
type: "button",
|
|
4559
4731
|
onClick: () => toggle(c.id),
|
|
4560
4732
|
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",
|
|
4561
4733
|
children: [
|
|
4562
|
-
/* @__PURE__ */
|
|
4563
|
-
/* @__PURE__ */
|
|
4564
|
-
counts && /* @__PURE__ */
|
|
4734
|
+
/* @__PURE__ */ jsx43(CheckBoxBox, { checked }),
|
|
4735
|
+
/* @__PURE__ */ jsx43("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
4736
|
+
counts && /* @__PURE__ */ jsx43(OptionCount, { n: countFor(c.id) })
|
|
4565
4737
|
]
|
|
4566
4738
|
},
|
|
4567
4739
|
c.id
|
|
@@ -4570,25 +4742,25 @@ function MultiSelectFilter({
|
|
|
4570
4742
|
] }, g.id);
|
|
4571
4743
|
}) : items.map((o) => {
|
|
4572
4744
|
const checked = draft.includes(o.id);
|
|
4573
|
-
return /* @__PURE__ */
|
|
4745
|
+
return /* @__PURE__ */ jsxs39(
|
|
4574
4746
|
"button",
|
|
4575
4747
|
{
|
|
4576
4748
|
type: "button",
|
|
4577
4749
|
onClick: () => toggle(o.id),
|
|
4578
4750
|
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",
|
|
4579
4751
|
children: [
|
|
4580
|
-
/* @__PURE__ */
|
|
4581
|
-
/* @__PURE__ */
|
|
4582
|
-
counts && /* @__PURE__ */
|
|
4752
|
+
/* @__PURE__ */ jsx43(CheckBoxBox, { checked }),
|
|
4753
|
+
/* @__PURE__ */ jsx43("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
4754
|
+
counts && /* @__PURE__ */ jsx43(OptionCount, { n: countFor(o.id) })
|
|
4583
4755
|
]
|
|
4584
4756
|
},
|
|
4585
4757
|
o.id
|
|
4586
4758
|
);
|
|
4587
4759
|
}),
|
|
4588
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */
|
|
4760
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ jsx43("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4589
4761
|
] }),
|
|
4590
|
-
note && /* @__PURE__ */
|
|
4591
|
-
showFooter ? /* @__PURE__ */
|
|
4762
|
+
note && /* @__PURE__ */ jsx43("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4763
|
+
showFooter ? /* @__PURE__ */ jsx43(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ jsx43("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ jsxs39(
|
|
4592
4764
|
"button",
|
|
4593
4765
|
{
|
|
4594
4766
|
type: "button",
|
|
@@ -4606,7 +4778,7 @@ function MultiSelectFilter({
|
|
|
4606
4778
|
] });
|
|
4607
4779
|
}
|
|
4608
4780
|
function OptionCount({ n }) {
|
|
4609
|
-
return /* @__PURE__ */
|
|
4781
|
+
return /* @__PURE__ */ jsxs39("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4610
4782
|
"(",
|
|
4611
4783
|
n.toLocaleString(),
|
|
4612
4784
|
")"
|
|
@@ -4614,16 +4786,16 @@ function OptionCount({ n }) {
|
|
|
4614
4786
|
}
|
|
4615
4787
|
|
|
4616
4788
|
// src/Toggle.tsx
|
|
4617
|
-
import { forwardRef as
|
|
4618
|
-
import { jsx as
|
|
4789
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
4790
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4619
4791
|
var SIZES2 = {
|
|
4620
|
-
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-
|
|
4621
|
-
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-
|
|
4792
|
+
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4793
|
+
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
4622
4794
|
};
|
|
4623
4795
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4624
|
-
var Toggle =
|
|
4796
|
+
var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4625
4797
|
const s = SIZES2[size];
|
|
4626
|
-
return /* @__PURE__ */
|
|
4798
|
+
return /* @__PURE__ */ jsx44(
|
|
4627
4799
|
"button",
|
|
4628
4800
|
{
|
|
4629
4801
|
ref,
|
|
@@ -4642,7 +4814,7 @@ var Toggle = forwardRef6(function Toggle2({ checked, onChange, label, size = "md
|
|
|
4642
4814
|
disabled && "cursor-not-allowed opacity-50",
|
|
4643
4815
|
className
|
|
4644
4816
|
),
|
|
4645
|
-
children: /* @__PURE__ */
|
|
4817
|
+
children: /* @__PURE__ */ jsx44(
|
|
4646
4818
|
"span",
|
|
4647
4819
|
{
|
|
4648
4820
|
className: cn(
|
|
@@ -4660,20 +4832,20 @@ Toggle.displayName = "Toggle";
|
|
|
4660
4832
|
// src/AISpark.tsx
|
|
4661
4833
|
import { useId as useId6 } from "react";
|
|
4662
4834
|
import { Sparkles } from "lucide-react";
|
|
4663
|
-
import { Fragment as Fragment5, jsx as
|
|
4835
|
+
import { Fragment as Fragment5, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4664
4836
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4665
4837
|
const id = useId6();
|
|
4666
|
-
return /* @__PURE__ */
|
|
4667
|
-
/* @__PURE__ */
|
|
4668
|
-
/* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4838
|
+
return /* @__PURE__ */ jsxs40(Fragment5, { children: [
|
|
4839
|
+
/* @__PURE__ */ jsx45("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ jsx45("defs", { children: /* @__PURE__ */ jsxs40("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
4840
|
+
/* @__PURE__ */ jsx45("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
4841
|
+
/* @__PURE__ */ jsx45("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4670
4842
|
] }) }) }),
|
|
4671
|
-
/* @__PURE__ */
|
|
4843
|
+
/* @__PURE__ */ jsx45(Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4672
4844
|
] });
|
|
4673
4845
|
}
|
|
4674
4846
|
|
|
4675
4847
|
// src/Freshness.tsx
|
|
4676
|
-
import { jsx as
|
|
4848
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4677
4849
|
var dotColor = {
|
|
4678
4850
|
fresh: "bg-status-success",
|
|
4679
4851
|
recent: "bg-status-warning",
|
|
@@ -4685,7 +4857,7 @@ var srLabel = {
|
|
|
4685
4857
|
stale: "Older than a day"
|
|
4686
4858
|
};
|
|
4687
4859
|
function Freshness({ level, className, testIdPrefix }) {
|
|
4688
|
-
return /* @__PURE__ */
|
|
4860
|
+
return /* @__PURE__ */ jsx46(
|
|
4689
4861
|
"span",
|
|
4690
4862
|
{
|
|
4691
4863
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -4697,42 +4869,42 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
4697
4869
|
}
|
|
4698
4870
|
|
|
4699
4871
|
// src/SectionHeading.tsx
|
|
4700
|
-
import { jsx as
|
|
4872
|
+
import { jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4701
4873
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
4702
|
-
return /* @__PURE__ */
|
|
4703
|
-
/* @__PURE__ */
|
|
4704
|
-
/* @__PURE__ */
|
|
4705
|
-
description && /* @__PURE__ */
|
|
4874
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4875
|
+
/* @__PURE__ */ jsxs41("div", { className: "min-w-0", children: [
|
|
4876
|
+
/* @__PURE__ */ jsx47(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4877
|
+
description && /* @__PURE__ */ jsx47("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
|
|
4706
4878
|
] }),
|
|
4707
|
-
actions && /* @__PURE__ */
|
|
4879
|
+
actions && /* @__PURE__ */ jsx47("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4708
4880
|
] });
|
|
4709
4881
|
}
|
|
4710
4882
|
|
|
4711
4883
|
// src/PageHeader.tsx
|
|
4712
4884
|
import { ArrowLeft } from "lucide-react";
|
|
4713
|
-
import { jsx as
|
|
4885
|
+
import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4714
4886
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
4715
|
-
return /* @__PURE__ */
|
|
4716
|
-
/* @__PURE__ */
|
|
4717
|
-
back && /* @__PURE__ */
|
|
4887
|
+
return /* @__PURE__ */ jsxs42("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
|
|
4888
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0", children: [
|
|
4889
|
+
back && /* @__PURE__ */ jsxs42(
|
|
4718
4890
|
"a",
|
|
4719
4891
|
{
|
|
4720
4892
|
href: back.href ?? "#",
|
|
4721
4893
|
onClick: back.onClick,
|
|
4722
4894
|
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",
|
|
4723
4895
|
children: [
|
|
4724
|
-
/* @__PURE__ */
|
|
4896
|
+
/* @__PURE__ */ jsx48(ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4725
4897
|
back.label
|
|
4726
4898
|
]
|
|
4727
4899
|
}
|
|
4728
4900
|
),
|
|
4729
|
-
meta ? /* @__PURE__ */
|
|
4730
|
-
/* @__PURE__ */
|
|
4901
|
+
meta ? /* @__PURE__ */ jsxs42("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
|
|
4902
|
+
/* @__PURE__ */ jsx48("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4731
4903
|
meta
|
|
4732
|
-
] }) : /* @__PURE__ */
|
|
4733
|
-
description && /* @__PURE__ */
|
|
4904
|
+
] }) : /* @__PURE__ */ jsx48("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4905
|
+
description && /* @__PURE__ */ jsx48("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
|
|
4734
4906
|
] }),
|
|
4735
|
-
actions && /* @__PURE__ */
|
|
4907
|
+
actions && /* @__PURE__ */ jsx48("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4736
4908
|
] });
|
|
4737
4909
|
}
|
|
4738
4910
|
|
|
@@ -4740,7 +4912,7 @@ function PageHeader({ title, description, actions, meta, back, className, testId
|
|
|
4740
4912
|
import { useEffect as useEffect14, useId as useId7, useRef as useRef16 } from "react";
|
|
4741
4913
|
import { createPortal as createPortal7 } from "react-dom";
|
|
4742
4914
|
import { X as X6 } from "lucide-react";
|
|
4743
|
-
import { jsx as
|
|
4915
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4744
4916
|
var WIDTH = {
|
|
4745
4917
|
sm: "max-w-110",
|
|
4746
4918
|
md: "max-w-160",
|
|
@@ -4791,12 +4963,12 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4791
4963
|
}, [open]);
|
|
4792
4964
|
if (!open || typeof document === "undefined") return null;
|
|
4793
4965
|
return createPortal7(
|
|
4794
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ jsx49(
|
|
4795
4967
|
"div",
|
|
4796
4968
|
{
|
|
4797
4969
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4 py-6",
|
|
4798
4970
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
4799
|
-
children: /* @__PURE__ */
|
|
4971
|
+
children: /* @__PURE__ */ jsxs43(
|
|
4800
4972
|
"div",
|
|
4801
4973
|
{
|
|
4802
4974
|
ref: panel,
|
|
@@ -4812,24 +4984,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4812
4984
|
className
|
|
4813
4985
|
),
|
|
4814
4986
|
children: [
|
|
4815
|
-
/* @__PURE__ */
|
|
4816
|
-
/* @__PURE__ */
|
|
4817
|
-
/* @__PURE__ */
|
|
4818
|
-
description && /* @__PURE__ */
|
|
4987
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
|
|
4988
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0 flex-1", children: [
|
|
4989
|
+
/* @__PURE__ */ jsx49("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4990
|
+
description && /* @__PURE__ */ jsx49("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
4819
4991
|
] }),
|
|
4820
|
-
/* @__PURE__ */
|
|
4992
|
+
/* @__PURE__ */ jsx49(
|
|
4821
4993
|
"button",
|
|
4822
4994
|
{
|
|
4823
4995
|
type: "button",
|
|
4824
4996
|
onClick: onClose,
|
|
4825
4997
|
"aria-label": "Close",
|
|
4826
4998
|
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",
|
|
4827
|
-
children: /* @__PURE__ */
|
|
4999
|
+
children: /* @__PURE__ */ jsx49(X6, { size: 16, "aria-hidden": "true" })
|
|
4828
5000
|
}
|
|
4829
5001
|
)
|
|
4830
5002
|
] }),
|
|
4831
|
-
children && /* @__PURE__ */
|
|
4832
|
-
footer && /* @__PURE__ */
|
|
5003
|
+
children && /* @__PURE__ */ jsx49("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
|
|
5004
|
+
footer && /* @__PURE__ */ jsx49("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
4833
5005
|
]
|
|
4834
5006
|
}
|
|
4835
5007
|
)
|
|
@@ -4840,10 +5012,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4840
5012
|
}
|
|
4841
5013
|
|
|
4842
5014
|
// src/EmptyState.tsx
|
|
4843
|
-
import { jsx as
|
|
5015
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4844
5016
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
4845
5017
|
const md = size === "md";
|
|
4846
|
-
return /* @__PURE__ */
|
|
5018
|
+
return /* @__PURE__ */ jsxs44(
|
|
4847
5019
|
"div",
|
|
4848
5020
|
{
|
|
4849
5021
|
className: cn(
|
|
@@ -4853,7 +5025,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
4853
5025
|
),
|
|
4854
5026
|
"data-testid": testIdPrefix,
|
|
4855
5027
|
children: [
|
|
4856
|
-
icon && /* @__PURE__ */
|
|
5028
|
+
icon && /* @__PURE__ */ jsx50(
|
|
4857
5029
|
"span",
|
|
4858
5030
|
{
|
|
4859
5031
|
"aria-hidden": "true",
|
|
@@ -4864,27 +5036,27 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
4864
5036
|
children: icon
|
|
4865
5037
|
}
|
|
4866
5038
|
),
|
|
4867
|
-
/* @__PURE__ */
|
|
4868
|
-
description && /* @__PURE__ */
|
|
4869
|
-
action && /* @__PURE__ */
|
|
5039
|
+
/* @__PURE__ */ jsx50("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
|
|
5040
|
+
description && /* @__PURE__ */ jsx50("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
|
|
5041
|
+
action && /* @__PURE__ */ jsx50("div", { className: md ? "mt-3" : "mt-2", children: action })
|
|
4870
5042
|
]
|
|
4871
5043
|
}
|
|
4872
5044
|
);
|
|
4873
5045
|
}
|
|
4874
5046
|
|
|
4875
5047
|
// src/TextField.tsx
|
|
4876
|
-
import { forwardRef as
|
|
4877
|
-
import { jsx as
|
|
5048
|
+
import { forwardRef as forwardRef9, useId as useId8 } from "react";
|
|
5049
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4878
5050
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
4879
|
-
var TextField =
|
|
5051
|
+
var TextField = forwardRef9(
|
|
4880
5052
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
4881
5053
|
const auto = useId8();
|
|
4882
5054
|
const fieldId = id ?? auto;
|
|
4883
5055
|
const noteId = `${fieldId}-note`;
|
|
4884
5056
|
const note = error ?? hint;
|
|
4885
|
-
return /* @__PURE__ */
|
|
4886
|
-
label && /* @__PURE__ */
|
|
4887
|
-
/* @__PURE__ */
|
|
5057
|
+
return /* @__PURE__ */ jsxs45("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
|
|
5058
|
+
label && /* @__PURE__ */ jsx51("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
|
|
5059
|
+
/* @__PURE__ */ jsxs45(
|
|
4888
5060
|
"div",
|
|
4889
5061
|
{
|
|
4890
5062
|
className: cn(
|
|
@@ -4894,8 +5066,8 @@ var TextField = forwardRef7(
|
|
|
4894
5066
|
disabled && "opacity-50"
|
|
4895
5067
|
),
|
|
4896
5068
|
children: [
|
|
4897
|
-
icon && /* @__PURE__ */
|
|
4898
|
-
/* @__PURE__ */
|
|
5069
|
+
icon && /* @__PURE__ */ jsx51("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5070
|
+
/* @__PURE__ */ jsx51(
|
|
4899
5071
|
"input",
|
|
4900
5072
|
{
|
|
4901
5073
|
ref,
|
|
@@ -4910,7 +5082,7 @@ var TextField = forwardRef7(
|
|
|
4910
5082
|
]
|
|
4911
5083
|
}
|
|
4912
5084
|
),
|
|
4913
|
-
note && /* @__PURE__ */
|
|
5085
|
+
note && /* @__PURE__ */ jsx51("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
4914
5086
|
] });
|
|
4915
5087
|
}
|
|
4916
5088
|
);
|
|
@@ -4920,7 +5092,7 @@ TextField.displayName = "TextField";
|
|
|
4920
5092
|
import { useEffect as useEffect15, useId as useId9, useRef as useRef17, useState as useState15 } from "react";
|
|
4921
5093
|
import { createPortal as createPortal8 } from "react-dom";
|
|
4922
5094
|
import { X as X7 } from "lucide-react";
|
|
4923
|
-
import { jsx as
|
|
5095
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4924
5096
|
var WIDTH2 = {
|
|
4925
5097
|
sm: "max-w-110",
|
|
4926
5098
|
md: "max-w-160",
|
|
@@ -4981,8 +5153,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
4981
5153
|
}, [open, mounted]);
|
|
4982
5154
|
if (!mounted || typeof document === "undefined") return null;
|
|
4983
5155
|
return createPortal8(
|
|
4984
|
-
/* @__PURE__ */
|
|
4985
|
-
/* @__PURE__ */
|
|
5156
|
+
/* @__PURE__ */ jsxs46("div", { className: "fixed inset-0 z-modal", children: [
|
|
5157
|
+
/* @__PURE__ */ jsx52(
|
|
4986
5158
|
"div",
|
|
4987
5159
|
{
|
|
4988
5160
|
"aria-hidden": "true",
|
|
@@ -4996,7 +5168,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
4996
5168
|
)
|
|
4997
5169
|
}
|
|
4998
5170
|
),
|
|
4999
|
-
/* @__PURE__ */
|
|
5171
|
+
/* @__PURE__ */ jsxs46(
|
|
5000
5172
|
"div",
|
|
5001
5173
|
{
|
|
5002
5174
|
ref: panel,
|
|
@@ -5013,24 +5185,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5013
5185
|
className
|
|
5014
5186
|
),
|
|
5015
5187
|
children: [
|
|
5016
|
-
/* @__PURE__ */
|
|
5017
|
-
/* @__PURE__ */
|
|
5018
|
-
/* @__PURE__ */
|
|
5019
|
-
description && /* @__PURE__ */
|
|
5188
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
|
|
5189
|
+
/* @__PURE__ */ jsxs46("div", { className: "min-w-0 flex-1", children: [
|
|
5190
|
+
/* @__PURE__ */ jsx52("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5191
|
+
description && /* @__PURE__ */ jsx52("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5020
5192
|
] }),
|
|
5021
|
-
/* @__PURE__ */
|
|
5193
|
+
/* @__PURE__ */ jsx52(
|
|
5022
5194
|
"button",
|
|
5023
5195
|
{
|
|
5024
5196
|
type: "button",
|
|
5025
5197
|
onClick: onClose,
|
|
5026
5198
|
"aria-label": "Close",
|
|
5027
5199
|
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",
|
|
5028
|
-
children: /* @__PURE__ */
|
|
5200
|
+
children: /* @__PURE__ */ jsx52(X7, { size: 16, "aria-hidden": "true" })
|
|
5029
5201
|
}
|
|
5030
5202
|
)
|
|
5031
5203
|
] }),
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
footer && /* @__PURE__ */
|
|
5204
|
+
/* @__PURE__ */ jsx52("div", { "data-drawer-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
|
|
5205
|
+
footer && /* @__PURE__ */ jsx52("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5034
5206
|
]
|
|
5035
5207
|
}
|
|
5036
5208
|
)
|
|
@@ -5041,7 +5213,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5041
5213
|
|
|
5042
5214
|
// src/DataTable.tsx
|
|
5043
5215
|
import { useId as useId10 } from "react";
|
|
5044
|
-
import { jsx as
|
|
5216
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5045
5217
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5046
5218
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5047
5219
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
@@ -5074,20 +5246,20 @@ function DataTable({
|
|
|
5074
5246
|
const col = columns.find((c) => c.key === key);
|
|
5075
5247
|
onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
|
|
5076
5248
|
};
|
|
5077
|
-
return /* @__PURE__ */
|
|
5249
|
+
return /* @__PURE__ */ jsxs47(
|
|
5078
5250
|
"div",
|
|
5079
5251
|
{
|
|
5080
5252
|
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
|
|
5081
5253
|
"data-testid": testIdPrefix,
|
|
5082
5254
|
children: [
|
|
5083
|
-
title && /* @__PURE__ */
|
|
5084
|
-
/* @__PURE__ */
|
|
5085
|
-
/* @__PURE__ */
|
|
5086
|
-
subtitle && /* @__PURE__ */
|
|
5255
|
+
title && /* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5256
|
+
/* @__PURE__ */ jsxs47("div", { className: "min-w-0", children: [
|
|
5257
|
+
/* @__PURE__ */ jsx53("h3", { id: titleId, className: "text-style-card-title", children: title }),
|
|
5258
|
+
subtitle && /* @__PURE__ */ jsx53("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
|
|
5087
5259
|
] }),
|
|
5088
|
-
action && /* @__PURE__ */
|
|
5260
|
+
action && /* @__PURE__ */ jsx53("div", { className: "shrink-0", children: action })
|
|
5089
5261
|
] }),
|
|
5090
|
-
/* @__PURE__ */
|
|
5262
|
+
/* @__PURE__ */ jsx53("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ jsxs47(
|
|
5091
5263
|
"table",
|
|
5092
5264
|
{
|
|
5093
5265
|
"aria-labelledby": title ? titleId : void 0,
|
|
@@ -5095,13 +5267,13 @@ function DataTable({
|
|
|
5095
5267
|
"aria-busy": loading || void 0,
|
|
5096
5268
|
className: "w-full border-collapse text-left",
|
|
5097
5269
|
children: [
|
|
5098
|
-
/* @__PURE__ */
|
|
5270
|
+
/* @__PURE__ */ jsx53("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ jsx53("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ jsx53(
|
|
5099
5271
|
"th",
|
|
5100
5272
|
{
|
|
5101
5273
|
scope: "col",
|
|
5102
5274
|
"aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
|
|
5103
5275
|
className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5104
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */
|
|
5276
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ jsx53(
|
|
5105
5277
|
SortButton,
|
|
5106
5278
|
{
|
|
5107
5279
|
label: c.label,
|
|
@@ -5115,7 +5287,7 @@ function DataTable({
|
|
|
5115
5287
|
},
|
|
5116
5288
|
c.key
|
|
5117
5289
|
)) }) }),
|
|
5118
|
-
/* @__PURE__ */
|
|
5290
|
+
/* @__PURE__ */ jsx53("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ jsx53("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ jsx53("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ jsx53(
|
|
5119
5291
|
"span",
|
|
5120
5292
|
{
|
|
5121
5293
|
className: cn(
|
|
@@ -5123,7 +5295,7 @@ function DataTable({
|
|
|
5123
5295
|
c.numeric ? "w-12" : "w-2/3"
|
|
5124
5296
|
)
|
|
5125
5297
|
}
|
|
5126
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */
|
|
5298
|
+
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ jsx53("tr", { children: /* @__PURE__ */ jsx53("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ jsx53(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ jsx53("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ jsx53(
|
|
5127
5299
|
"td",
|
|
5128
5300
|
{
|
|
5129
5301
|
className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
|
|
@@ -5134,14 +5306,14 @@ function DataTable({
|
|
|
5134
5306
|
]
|
|
5135
5307
|
}
|
|
5136
5308
|
) }),
|
|
5137
|
-
footer && /* @__PURE__ */
|
|
5309
|
+
footer && /* @__PURE__ */ jsx53("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
5138
5310
|
]
|
|
5139
5311
|
}
|
|
5140
5312
|
);
|
|
5141
5313
|
}
|
|
5142
5314
|
|
|
5143
5315
|
// src/MediaLabel.tsx
|
|
5144
|
-
import { jsx as
|
|
5316
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
5145
5317
|
var FILL = {
|
|
5146
5318
|
TV: "bg-media-tv",
|
|
5147
5319
|
CTV: "bg-media-ctv",
|
|
@@ -5152,7 +5324,7 @@ var FILL = {
|
|
|
5152
5324
|
Magazine: "bg-media-magazine"
|
|
5153
5325
|
};
|
|
5154
5326
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5155
|
-
return /* @__PURE__ */
|
|
5327
|
+
return /* @__PURE__ */ jsx54(
|
|
5156
5328
|
"span",
|
|
5157
5329
|
{
|
|
5158
5330
|
className: cn(
|
|
@@ -5167,10 +5339,10 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5167
5339
|
}
|
|
5168
5340
|
|
|
5169
5341
|
// src/SuggestionChip.tsx
|
|
5170
|
-
import { forwardRef as
|
|
5171
|
-
import { jsx as
|
|
5172
|
-
var SuggestionChip =
|
|
5173
|
-
return /* @__PURE__ */
|
|
5342
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
5343
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
5344
|
+
var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5345
|
+
return /* @__PURE__ */ jsx55(
|
|
5174
5346
|
"button",
|
|
5175
5347
|
{
|
|
5176
5348
|
ref,
|
|
@@ -5181,18 +5353,18 @@ var SuggestionChip = forwardRef8(function SuggestionChip2({ children, className,
|
|
|
5181
5353
|
"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",
|
|
5182
5354
|
className
|
|
5183
5355
|
),
|
|
5184
|
-
children: /* @__PURE__ */
|
|
5356
|
+
children: /* @__PURE__ */ jsx55("span", { className: "truncate", children })
|
|
5185
5357
|
}
|
|
5186
5358
|
);
|
|
5187
5359
|
});
|
|
5188
5360
|
SuggestionChip.displayName = "SuggestionChip";
|
|
5189
5361
|
|
|
5190
5362
|
// src/ToggleChip.tsx
|
|
5191
|
-
import { forwardRef as
|
|
5363
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
5192
5364
|
import { Check as Check8 } from "lucide-react";
|
|
5193
|
-
import { jsx as
|
|
5194
|
-
var ToggleChip =
|
|
5195
|
-
return /* @__PURE__ */
|
|
5365
|
+
import { jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5366
|
+
var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5367
|
+
return /* @__PURE__ */ jsxs48(
|
|
5196
5368
|
"button",
|
|
5197
5369
|
{
|
|
5198
5370
|
ref,
|
|
@@ -5210,7 +5382,7 @@ var ToggleChip = forwardRef9(function ToggleChip2({ selected, onChange, children
|
|
|
5210
5382
|
className
|
|
5211
5383
|
),
|
|
5212
5384
|
children: [
|
|
5213
|
-
selected && /* @__PURE__ */
|
|
5385
|
+
selected && /* @__PURE__ */ jsx56(Check8, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5214
5386
|
children
|
|
5215
5387
|
]
|
|
5216
5388
|
}
|
|
@@ -5219,11 +5391,11 @@ var ToggleChip = forwardRef9(function ToggleChip2({ selected, onChange, children
|
|
|
5219
5391
|
ToggleChip.displayName = "ToggleChip";
|
|
5220
5392
|
|
|
5221
5393
|
// src/CopyButton.tsx
|
|
5222
|
-
import { forwardRef as
|
|
5394
|
+
import { forwardRef as forwardRef12, useEffect as useEffect16, useRef as useRef18, useState as useState16 } from "react";
|
|
5223
5395
|
import { Check as Check9, Copy } from "lucide-react";
|
|
5224
|
-
import { jsx as
|
|
5396
|
+
import { jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5225
5397
|
var CONFIRM_MS = 2e3;
|
|
5226
|
-
var CopyButton =
|
|
5398
|
+
var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5227
5399
|
const [copied, setCopied] = useState16(false);
|
|
5228
5400
|
const timer = useRef18(void 0);
|
|
5229
5401
|
useEffect16(() => () => clearTimeout(timer.current), []);
|
|
@@ -5238,8 +5410,8 @@ var CopyButton = forwardRef10(function CopyButton2({ value, label, "aria-label":
|
|
|
5238
5410
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5239
5411
|
};
|
|
5240
5412
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5241
|
-
const icon = copied ? /* @__PURE__ */
|
|
5242
|
-
return /* @__PURE__ */
|
|
5413
|
+
const icon = copied ? /* @__PURE__ */ jsx57(Check9, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ jsx57(Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
5414
|
+
return /* @__PURE__ */ jsxs49(
|
|
5243
5415
|
Button,
|
|
5244
5416
|
{
|
|
5245
5417
|
ref,
|
|
@@ -5253,8 +5425,8 @@ var CopyButton = forwardRef10(function CopyButton2({ value, label, "aria-label":
|
|
|
5253
5425
|
className: cn(!copied && "text-text-secondary", className),
|
|
5254
5426
|
children: [
|
|
5255
5427
|
icon,
|
|
5256
|
-
label && /* @__PURE__ */
|
|
5257
|
-
/* @__PURE__ */
|
|
5428
|
+
label && /* @__PURE__ */ jsx57("span", { children: copied ? "Copied" : label }),
|
|
5429
|
+
/* @__PURE__ */ jsx57("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5258
5430
|
]
|
|
5259
5431
|
}
|
|
5260
5432
|
);
|
|
@@ -5263,7 +5435,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
5263
5435
|
|
|
5264
5436
|
// src/InlineMessage.tsx
|
|
5265
5437
|
import { AlertTriangle as AlertTriangle2, CheckCircle2, Info as Info3, X as X8, XCircle } from "lucide-react";
|
|
5266
|
-
import { jsx as
|
|
5438
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5267
5439
|
var BOX = {
|
|
5268
5440
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5269
5441
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5280,27 +5452,27 @@ var ICON_INK = {
|
|
|
5280
5452
|
var ICON2 = { info: Info3, success: CheckCircle2, warning: AlertTriangle2, danger: XCircle };
|
|
5281
5453
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5282
5454
|
const Icon = ICON2[tone];
|
|
5283
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ jsxs50(
|
|
5284
5456
|
"div",
|
|
5285
5457
|
{
|
|
5286
5458
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5287
5459
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5288
5460
|
"data-testid": testIdPrefix,
|
|
5289
5461
|
children: [
|
|
5290
|
-
/* @__PURE__ */
|
|
5291
|
-
/* @__PURE__ */
|
|
5292
|
-
/* @__PURE__ */
|
|
5293
|
-
children && /* @__PURE__ */
|
|
5294
|
-
actions && /* @__PURE__ */
|
|
5462
|
+
/* @__PURE__ */ jsx58(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
5463
|
+
/* @__PURE__ */ jsxs50("div", { className: "min-w-0 flex-1", children: [
|
|
5464
|
+
/* @__PURE__ */ jsx58("p", { className: "font-semibold text-text-primary", children: title }),
|
|
5465
|
+
children && /* @__PURE__ */ jsx58("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
5466
|
+
actions && /* @__PURE__ */ jsx58("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
5295
5467
|
] }),
|
|
5296
|
-
onDismiss && /* @__PURE__ */
|
|
5468
|
+
onDismiss && /* @__PURE__ */ jsx58(
|
|
5297
5469
|
"button",
|
|
5298
5470
|
{
|
|
5299
5471
|
type: "button",
|
|
5300
5472
|
onClick: onDismiss,
|
|
5301
5473
|
"aria-label": "Dismiss",
|
|
5302
5474
|
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",
|
|
5303
|
-
children: /* @__PURE__ */
|
|
5475
|
+
children: /* @__PURE__ */ jsx58(X8, { size: 14, "aria-hidden": "true" })
|
|
5304
5476
|
}
|
|
5305
5477
|
)
|
|
5306
5478
|
]
|
|
@@ -5311,7 +5483,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5311
5483
|
// src/FilterDrawer.tsx
|
|
5312
5484
|
import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect6, useRef as useRef19, useState as useState17 } from "react";
|
|
5313
5485
|
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight6 } from "lucide-react";
|
|
5314
|
-
import { jsx as
|
|
5486
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5315
5487
|
var SLIDE_MS = 200;
|
|
5316
5488
|
function reducedMotion() {
|
|
5317
5489
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5373,8 +5545,8 @@ function FilterDrawer({
|
|
|
5373
5545
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5374
5546
|
const panel = (v, rows = true) => {
|
|
5375
5547
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5376
|
-
if (s) return /* @__PURE__ */
|
|
5377
|
-
return /* @__PURE__ */
|
|
5548
|
+
if (s) return /* @__PURE__ */ jsx59("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
5549
|
+
return /* @__PURE__ */ jsx59("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ jsx59("li", { className: "border-b border-border-default", children: /* @__PURE__ */ jsxs51(
|
|
5378
5550
|
"button",
|
|
5379
5551
|
{
|
|
5380
5552
|
ref: rows ? (el) => {
|
|
@@ -5386,7 +5558,7 @@ function FilterDrawer({
|
|
|
5386
5558
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5387
5559
|
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",
|
|
5388
5560
|
children: [
|
|
5389
|
-
/* @__PURE__ */
|
|
5561
|
+
/* @__PURE__ */ jsx59(
|
|
5390
5562
|
x.icon,
|
|
5391
5563
|
{
|
|
5392
5564
|
size: 17,
|
|
@@ -5394,22 +5566,22 @@ function FilterDrawer({
|
|
|
5394
5566
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5395
5567
|
}
|
|
5396
5568
|
),
|
|
5397
|
-
/* @__PURE__ */
|
|
5398
|
-
x.badge && /* @__PURE__ */
|
|
5399
|
-
/* @__PURE__ */
|
|
5569
|
+
/* @__PURE__ */ jsx59("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
5570
|
+
x.badge && /* @__PURE__ */ jsx59(Badge, { tone: "brand", children: x.badge }),
|
|
5571
|
+
/* @__PURE__ */ jsx59(ChevronRight6, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5400
5572
|
]
|
|
5401
5573
|
}
|
|
5402
5574
|
) }, x.id)) });
|
|
5403
5575
|
};
|
|
5404
|
-
return /* @__PURE__ */
|
|
5576
|
+
return /* @__PURE__ */ jsx59(
|
|
5405
5577
|
Drawer,
|
|
5406
5578
|
{
|
|
5407
5579
|
open,
|
|
5408
5580
|
onClose,
|
|
5409
5581
|
size,
|
|
5410
5582
|
testIdPrefix,
|
|
5411
|
-
title: focused ? /* @__PURE__ */
|
|
5412
|
-
/* @__PURE__ */
|
|
5583
|
+
title: focused ? /* @__PURE__ */ jsxs51("span", { className: "flex items-center gap-1.5", children: [
|
|
5584
|
+
/* @__PURE__ */ jsx59(
|
|
5413
5585
|
"button",
|
|
5414
5586
|
{
|
|
5415
5587
|
ref: backRef,
|
|
@@ -5418,20 +5590,23 @@ function FilterDrawer({
|
|
|
5418
5590
|
"aria-label": "Back to all filters",
|
|
5419
5591
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5420
5592
|
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",
|
|
5421
|
-
children: /* @__PURE__ */
|
|
5593
|
+
children: /* @__PURE__ */ jsx59(ChevronLeft5, { size: 18, "aria-hidden": "true" })
|
|
5422
5594
|
}
|
|
5423
5595
|
),
|
|
5424
5596
|
focused.label,
|
|
5425
|
-
focused.info && /* @__PURE__ */
|
|
5426
|
-
] }) : /* @__PURE__ */
|
|
5597
|
+
focused.info && /* @__PURE__ */ jsx59(InfoTip, { text: focused.info, label: `About ${focused.label}` })
|
|
5598
|
+
] }) : /* @__PURE__ */ jsxs51("span", { className: "flex items-center gap-2.5", children: [
|
|
5427
5599
|
"Filters",
|
|
5428
|
-
activeCount > 0 && /* @__PURE__ */
|
|
5600
|
+
activeCount > 0 && /* @__PURE__ */ jsx59(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5429
5601
|
] }),
|
|
5430
|
-
footer:
|
|
5431
|
-
|
|
5432
|
-
/* @__PURE__ */
|
|
5433
|
-
|
|
5434
|
-
|
|
5602
|
+
footer: focused ? (
|
|
5603
|
+
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5604
|
+
/* @__PURE__ */ jsx59("div", { className: "flex w-full items-center", children: /* @__PURE__ */ jsx59(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
|
|
5605
|
+
) : /* @__PURE__ */ jsxs51("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
5606
|
+
/* @__PURE__ */ jsx59(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
5607
|
+
/* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-2", children: [
|
|
5608
|
+
/* @__PURE__ */ jsx59(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
5609
|
+
/* @__PURE__ */ jsx59(
|
|
5435
5610
|
Button,
|
|
5436
5611
|
{
|
|
5437
5612
|
variant: "primary",
|
|
@@ -5440,13 +5615,13 @@ function FilterDrawer({
|
|
|
5440
5615
|
onApply();
|
|
5441
5616
|
onClose();
|
|
5442
5617
|
},
|
|
5443
|
-
children: "
|
|
5618
|
+
children: "See results"
|
|
5444
5619
|
}
|
|
5445
5620
|
)
|
|
5446
5621
|
] })
|
|
5447
5622
|
] }),
|
|
5448
|
-
children: /* @__PURE__ */
|
|
5449
|
-
/* @__PURE__ */
|
|
5623
|
+
children: /* @__PURE__ */ jsxs51("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
5624
|
+
/* @__PURE__ */ jsx59(
|
|
5450
5625
|
"div",
|
|
5451
5626
|
{
|
|
5452
5627
|
style: { transform: incoming },
|
|
@@ -5455,7 +5630,7 @@ function FilterDrawer({
|
|
|
5455
5630
|
},
|
|
5456
5631
|
view ?? "__list"
|
|
5457
5632
|
),
|
|
5458
|
-
leaving && /* @__PURE__ */
|
|
5633
|
+
leaving && /* @__PURE__ */ jsx59(
|
|
5459
5634
|
"div",
|
|
5460
5635
|
{
|
|
5461
5636
|
"aria-hidden": "true",
|
|
@@ -5471,11 +5646,11 @@ function FilterDrawer({
|
|
|
5471
5646
|
}
|
|
5472
5647
|
|
|
5473
5648
|
// src/AllFiltersButton.tsx
|
|
5474
|
-
import { forwardRef as
|
|
5649
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
5475
5650
|
import { SlidersHorizontal } from "lucide-react";
|
|
5476
|
-
import { jsx as
|
|
5477
|
-
var AllFiltersButton =
|
|
5478
|
-
return /* @__PURE__ */
|
|
5651
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5652
|
+
var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5653
|
+
return /* @__PURE__ */ jsxs52(
|
|
5479
5654
|
"button",
|
|
5480
5655
|
{
|
|
5481
5656
|
ref,
|
|
@@ -5487,13 +5662,105 @@ var AllFiltersButton = forwardRef11(function AllFiltersButton2({ count = 0, open
|
|
|
5487
5662
|
className: cn(chipTriggerClass(), className),
|
|
5488
5663
|
...rest,
|
|
5489
5664
|
children: [
|
|
5490
|
-
/* @__PURE__ */
|
|
5491
|
-
/* @__PURE__ */
|
|
5492
|
-
count > 0 && /* @__PURE__ */
|
|
5665
|
+
/* @__PURE__ */ jsx60(SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
5666
|
+
/* @__PURE__ */ jsx60("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
5667
|
+
count > 0 && /* @__PURE__ */ jsx60(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
5493
5668
|
]
|
|
5494
5669
|
}
|
|
5495
5670
|
);
|
|
5496
5671
|
});
|
|
5672
|
+
|
|
5673
|
+
// src/Menu.tsx
|
|
5674
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
5675
|
+
import { Slot as Slot2, Slottable } from "@radix-ui/react-slot";
|
|
5676
|
+
import { Check as Check10, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
5677
|
+
import { Fragment as Fragment6, jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5678
|
+
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5679
|
+
function moveFocus(e) {
|
|
5680
|
+
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
5681
|
+
if (!keys.includes(e.key)) return;
|
|
5682
|
+
const rows = Array.from(e.currentTarget.querySelectorAll(ROW_SELECTOR));
|
|
5683
|
+
if (!rows.length) return;
|
|
5684
|
+
e.preventDefault();
|
|
5685
|
+
const i = rows.indexOf(document.activeElement);
|
|
5686
|
+
const next = e.key === "Home" ? 0 : e.key === "End" ? rows.length - 1 : e.key === "ArrowDown" ? (i + 1) % rows.length : (i - 1 + rows.length) % rows.length;
|
|
5687
|
+
rows[next].focus();
|
|
5688
|
+
}
|
|
5689
|
+
var Menu = forwardRef14(
|
|
5690
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ jsx61(
|
|
5691
|
+
"div",
|
|
5692
|
+
{
|
|
5693
|
+
ref,
|
|
5694
|
+
role: "menu",
|
|
5695
|
+
"data-testid": testIdPrefix,
|
|
5696
|
+
onKeyDown: (e) => {
|
|
5697
|
+
moveFocus(e);
|
|
5698
|
+
onKeyDown?.(e);
|
|
5699
|
+
},
|
|
5700
|
+
className: cn("flex flex-col p-1", className),
|
|
5701
|
+
...props,
|
|
5702
|
+
children
|
|
5703
|
+
}
|
|
5704
|
+
)
|
|
5705
|
+
);
|
|
5706
|
+
Menu.displayName = "Menu";
|
|
5707
|
+
var MenuItem = forwardRef14(
|
|
5708
|
+
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5709
|
+
const Comp = asChild ? Slot2 : "button";
|
|
5710
|
+
const radio = checked !== void 0;
|
|
5711
|
+
const body = /* @__PURE__ */ jsxs53(Fragment6, { children: [
|
|
5712
|
+
icon && /* @__PURE__ */ jsx61("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
5713
|
+
asChild ? (
|
|
5714
|
+
// The link's own text lands here; the link becomes the row.
|
|
5715
|
+
/* @__PURE__ */ jsx61(Slottable, { children })
|
|
5716
|
+
) : /* @__PURE__ */ jsxs53("span", { className: "min-w-0 flex-1", children: [
|
|
5717
|
+
/* @__PURE__ */ jsx61("span", { className: "block truncate", children }),
|
|
5718
|
+
description && /* @__PURE__ */ jsx61("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5719
|
+
] }),
|
|
5720
|
+
trailing && /* @__PURE__ */ jsx61("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
5721
|
+
radio && checked && /* @__PURE__ */ jsx61(Check10, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
5722
|
+
submenu && /* @__PURE__ */ jsx61(ChevronRight7, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5723
|
+
] });
|
|
5724
|
+
return /* @__PURE__ */ jsx61(
|
|
5725
|
+
Comp,
|
|
5726
|
+
{
|
|
5727
|
+
ref,
|
|
5728
|
+
type: asChild ? void 0 : "button",
|
|
5729
|
+
role: radio ? "menuitemradio" : "menuitem",
|
|
5730
|
+
"aria-checked": radio ? checked : void 0,
|
|
5731
|
+
"aria-haspopup": submenu ? "menu" : void 0,
|
|
5732
|
+
"aria-disabled": disabled || void 0,
|
|
5733
|
+
disabled: asChild ? void 0 : disabled,
|
|
5734
|
+
tabIndex: -1,
|
|
5735
|
+
"data-testid": testIdPrefix,
|
|
5736
|
+
className: cn(
|
|
5737
|
+
"flex min-h-9 w-full items-center gap-2.5 rounded-control px-3 py-1.5 text-left text-sm transition-colors",
|
|
5738
|
+
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
5739
|
+
danger ? "text-text-danger" : "text-text-primary",
|
|
5740
|
+
disabled ? "cursor-not-allowed opacity-40" : "hover:bg-subtle focus-visible:bg-subtle",
|
|
5741
|
+
className
|
|
5742
|
+
),
|
|
5743
|
+
...props,
|
|
5744
|
+
children: body
|
|
5745
|
+
}
|
|
5746
|
+
);
|
|
5747
|
+
}
|
|
5748
|
+
);
|
|
5749
|
+
MenuItem.displayName = "MenuItem";
|
|
5750
|
+
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5751
|
+
return /* @__PURE__ */ jsx61(
|
|
5752
|
+
"div",
|
|
5753
|
+
{
|
|
5754
|
+
role: "presentation",
|
|
5755
|
+
"data-testid": testIdPrefix,
|
|
5756
|
+
className: cn("px-3 pb-1 pt-2 text-micro font-semibold uppercase tracking-wide text-text-tertiary", className),
|
|
5757
|
+
children
|
|
5758
|
+
}
|
|
5759
|
+
);
|
|
5760
|
+
}
|
|
5761
|
+
function MenuSeparator({ className, testIdPrefix }) {
|
|
5762
|
+
return /* @__PURE__ */ jsx61("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5763
|
+
}
|
|
5497
5764
|
export {
|
|
5498
5765
|
AISpark,
|
|
5499
5766
|
AdvertiserNoResults,
|
|
@@ -5502,8 +5769,10 @@ export {
|
|
|
5502
5769
|
AllFiltersButton,
|
|
5503
5770
|
Badge,
|
|
5504
5771
|
BarChartPlaceholder,
|
|
5772
|
+
BarList,
|
|
5505
5773
|
Button,
|
|
5506
5774
|
Card,
|
|
5775
|
+
ChartLegend,
|
|
5507
5776
|
CheckBox,
|
|
5508
5777
|
CheckBoxBox,
|
|
5509
5778
|
ChipContent,
|
|
@@ -5522,8 +5791,13 @@ export {
|
|
|
5522
5791
|
Freshness,
|
|
5523
5792
|
InfoTip,
|
|
5524
5793
|
InlineMessage,
|
|
5794
|
+
LegendItem,
|
|
5525
5795
|
LineChartPlaceholder,
|
|
5526
5796
|
MediaLabel,
|
|
5797
|
+
Menu,
|
|
5798
|
+
MenuItem,
|
|
5799
|
+
MenuLabel,
|
|
5800
|
+
MenuSeparator,
|
|
5527
5801
|
Modal,
|
|
5528
5802
|
MultiSelectFilter,
|
|
5529
5803
|
NO_RESULTS_BODY,
|
|
@@ -5546,6 +5820,8 @@ export {
|
|
|
5546
5820
|
SelectionPicker,
|
|
5547
5821
|
SortButton,
|
|
5548
5822
|
StackedColumnPlaceholder,
|
|
5823
|
+
StatStrip,
|
|
5824
|
+
StatTile,
|
|
5549
5825
|
SuggestionChip,
|
|
5550
5826
|
TablePagination,
|
|
5551
5827
|
Tabs,
|