@mediaradar/design-components 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approved-components.json +1 -1
- package/dist/index.cjs +909 -759
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -3
- package/dist/index.d.ts +87 -3
- package/dist/index.js +830 -688
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ __export(index_exports, {
|
|
|
32
32
|
Button: () => Button,
|
|
33
33
|
Card: () => Card,
|
|
34
34
|
ChartLegend: () => ChartLegend,
|
|
35
|
+
ChartSkeleton: () => ChartSkeleton,
|
|
35
36
|
CheckBox: () => CheckBox,
|
|
36
37
|
CheckBoxBox: () => CheckBoxBox,
|
|
37
38
|
ChipContent: () => ChipContent,
|
|
@@ -53,6 +54,8 @@ __export(index_exports, {
|
|
|
53
54
|
InlineMessage: () => InlineMessage,
|
|
54
55
|
LegendItem: () => LegendItem,
|
|
55
56
|
LineChartPlaceholder: () => LineChartPlaceholder,
|
|
57
|
+
LoadError: () => LoadError,
|
|
58
|
+
LongWait: () => LongWait,
|
|
56
59
|
MediaLabel: () => MediaLabel,
|
|
57
60
|
Menu: () => Menu,
|
|
58
61
|
MenuItem: () => MenuItem,
|
|
@@ -73,6 +76,7 @@ __export(index_exports, {
|
|
|
73
76
|
PrimaryBadge: () => PrimaryBadge,
|
|
74
77
|
PublisherBreakdownList: () => PublisherBreakdownList,
|
|
75
78
|
QUIET_ACTION_CLASS: () => QUIET_ACTION_CLASS,
|
|
79
|
+
RefreshLine: () => RefreshLine,
|
|
76
80
|
SearchBar: () => SearchBar,
|
|
77
81
|
SectionHeading: () => SectionHeading,
|
|
78
82
|
SectionRail: () => SectionRail,
|
|
@@ -81,9 +85,12 @@ __export(index_exports, {
|
|
|
81
85
|
SelectFilter: () => SelectFilter,
|
|
82
86
|
SelectedSection: () => SelectedSection,
|
|
83
87
|
SelectionPicker: () => SelectionPicker,
|
|
88
|
+
Skeleton: () => Skeleton,
|
|
89
|
+
SkeletonLines: () => SkeletonLines,
|
|
84
90
|
SortButton: () => SortButton,
|
|
85
91
|
StackedColumnPlaceholder: () => StackedColumnPlaceholder,
|
|
86
92
|
StatStrip: () => StatStrip,
|
|
93
|
+
StatStripSkeleton: () => StatStripSkeleton,
|
|
87
94
|
StatTile: () => StatTile,
|
|
88
95
|
SuggestionChip: () => SuggestionChip,
|
|
89
96
|
TableLink: () => TableLink,
|
|
@@ -120,7 +127,8 @@ __export(index_exports, {
|
|
|
120
127
|
formatWeek: () => formatWeek,
|
|
121
128
|
noResultsBody: () => noResultsBody,
|
|
122
129
|
resolveRange: () => resolveRange,
|
|
123
|
-
sortProp: () => sortProp
|
|
130
|
+
sortProp: () => sortProp,
|
|
131
|
+
useDelayedLoading: () => useDelayedLoading
|
|
124
132
|
});
|
|
125
133
|
module.exports = __toCommonJS(index_exports);
|
|
126
134
|
|
|
@@ -2271,45 +2279,268 @@ function SelectFilter({
|
|
|
2271
2279
|
}
|
|
2272
2280
|
|
|
2273
2281
|
// src/Card.tsx
|
|
2282
|
+
var import_react11 = require("react");
|
|
2283
|
+
|
|
2284
|
+
// src/Skeleton.tsx
|
|
2285
|
+
var import_react10 = require("react");
|
|
2286
|
+
|
|
2287
|
+
// src/Button.tsx
|
|
2274
2288
|
var import_react9 = require("react");
|
|
2289
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
2290
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
2291
|
+
var import_lucide_react12 = require("lucide-react");
|
|
2275
2292
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2276
|
-
var
|
|
2293
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
2294
|
+
"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",
|
|
2295
|
+
{
|
|
2296
|
+
variants: {
|
|
2297
|
+
variant: {
|
|
2298
|
+
primary: "bg-brand-primaryAction text-brand-onprimary hover:brightness-110",
|
|
2299
|
+
// border-strong, not border-interactive. The interactive token is #6b6358
|
|
2300
|
+
// -- 5.9:1 against the surface, nearly as dark as body text -- which is
|
|
2301
|
+
// right for an input the eye must find in a form, and far too heavy for
|
|
2302
|
+
// a button sitting beside other buttons. It reads heaviest on icon-only,
|
|
2303
|
+
// where there is least fill inside the line to balance it.
|
|
2304
|
+
secondary: "bg-surface text-text-primary border border-border-strong hover:bg-subtle hover:border-border-interactive",
|
|
2305
|
+
ghost: "text-text-primary hover:bg-subtle",
|
|
2306
|
+
danger: "bg-status-danger text-status-onstatus hover:brightness-110",
|
|
2307
|
+
// Quiet destructive: neutral at rest, red only on hover. This is what
|
|
2308
|
+
// the product actually reaches for -- nearly every hand-rolled
|
|
2309
|
+
// destructive control is an icon that reddens on hover, while filled
|
|
2310
|
+
// `danger` is right only for the confirm button in a dialog the user
|
|
2311
|
+
// already opened.
|
|
2312
|
+
dangerGhost: "text-text-secondary hover:bg-subtle hover:text-text-danger",
|
|
2313
|
+
link: "text-text-link underline-offset-4 hover:underline px-0"
|
|
2314
|
+
},
|
|
2315
|
+
// Type scales with the box. One size across all three left xs cramped --
|
|
2316
|
+
// 14px inside a 24px box leaves five pixels above and below, so the label
|
|
2317
|
+
// fills the button instead of sitting in it.
|
|
2318
|
+
size: {
|
|
2319
|
+
xs: "h-6 px-2 text-xs",
|
|
2320
|
+
sm: "h-8 px-3 text-sm",
|
|
2321
|
+
md: "h-10 px-4 text-sm",
|
|
2322
|
+
// 44, the filter row's height, so a button at the end of a row of
|
|
2323
|
+
// filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
|
|
2324
|
+
lg: "h-11 px-5 text-sm"
|
|
2325
|
+
},
|
|
2326
|
+
// Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
|
|
2327
|
+
// be one dimension, so an icon button never lined up with the labelled
|
|
2328
|
+
// buttons beside it in a toolbar. As a shape it squares the box at
|
|
2329
|
+
// whichever height you picked.
|
|
2330
|
+
iconOnly: {
|
|
2331
|
+
true: "p-0",
|
|
2332
|
+
false: ""
|
|
2333
|
+
}
|
|
2334
|
+
},
|
|
2335
|
+
compoundVariants: [
|
|
2336
|
+
{ size: "xs", iconOnly: true, class: "w-6" },
|
|
2337
|
+
{ size: "sm", iconOnly: true, class: "w-8" },
|
|
2338
|
+
{ size: "md", iconOnly: true, class: "w-10" },
|
|
2339
|
+
{ size: "lg", iconOnly: true, class: "w-11" },
|
|
2340
|
+
// A boxed button is a target you aim at, so its label carries the weight
|
|
2341
|
+
// of one. `link` sits inline in a sentence, where semibold reads as
|
|
2342
|
+
// emphasis on the words rather than as a control.
|
|
2343
|
+
{ variant: ["primary", "secondary", "ghost", "danger", "dangerGhost"], class: "font-semibold" },
|
|
2344
|
+
{ variant: "link", class: "font-medium h-auto p-0" }
|
|
2345
|
+
],
|
|
2346
|
+
defaultVariants: {
|
|
2347
|
+
variant: "primary",
|
|
2348
|
+
size: "md",
|
|
2349
|
+
iconOnly: false
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
var Button = (0, import_react9.forwardRef)(
|
|
2354
|
+
({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
|
|
2355
|
+
const shared = {
|
|
2356
|
+
className: cn(buttonVariants({ variant, size, iconOnly, className })),
|
|
2357
|
+
"data-testid": testIdPrefix,
|
|
2358
|
+
disabled: disabled || loading,
|
|
2359
|
+
"aria-busy": loading || void 0,
|
|
2360
|
+
...props
|
|
2361
|
+
};
|
|
2362
|
+
if (asChild) {
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_slot.Slot, { ref, ...shared, children });
|
|
2364
|
+
}
|
|
2365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { ref, ...shared, children: [
|
|
2366
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react12.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
2367
|
+
children
|
|
2368
|
+
] });
|
|
2369
|
+
}
|
|
2370
|
+
);
|
|
2371
|
+
Button.displayName = "Button";
|
|
2372
|
+
|
|
2373
|
+
// src/Skeleton.tsx
|
|
2374
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2375
|
+
var STYLE_ID = "mrLoadingStyle";
|
|
2376
|
+
var CSS = `
|
|
2377
|
+
[data-mr-skeleton]{position:relative;overflow:hidden}
|
|
2378
|
+
[data-mr-skeleton]::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--mr-color-surface) 70%,transparent),transparent);animation:mr-shimmer 1.5s ease-in-out infinite}
|
|
2379
|
+
[data-mr-refresh-line]{position:absolute;inset:0 auto auto 0;height:2px;width:40%;background:var(--mr-color-brand-primary-action);animation:mr-refresh 1.2s ease-in-out infinite}
|
|
2380
|
+
@keyframes mr-shimmer{100%{transform:translateX(100%)}}
|
|
2381
|
+
@keyframes mr-refresh{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
|
|
2382
|
+
@media (prefers-reduced-motion:reduce){[data-mr-skeleton]::after{animation:none;display:none}[data-mr-refresh-line]{animation:none;width:100%;opacity:.5}}
|
|
2383
|
+
`;
|
|
2384
|
+
function useLoadingStyle() {
|
|
2385
|
+
(0, import_react10.useEffect)(() => {
|
|
2386
|
+
if (typeof document === "undefined" || document.getElementById(STYLE_ID)) return;
|
|
2387
|
+
const el = document.createElement("style");
|
|
2388
|
+
el.id = STYLE_ID;
|
|
2389
|
+
el.textContent = CSS;
|
|
2390
|
+
document.head.append(el);
|
|
2391
|
+
}, []);
|
|
2392
|
+
}
|
|
2393
|
+
function useDelayedLoading(loading, delay = 300, min = 500) {
|
|
2394
|
+
const [show, setShow] = (0, import_react10.useState)(false);
|
|
2395
|
+
const [shownAt, setShownAt] = (0, import_react10.useState)(0);
|
|
2396
|
+
(0, import_react10.useEffect)(() => {
|
|
2397
|
+
if (loading && !show) {
|
|
2398
|
+
const t = setTimeout(() => {
|
|
2399
|
+
setShow(true);
|
|
2400
|
+
setShownAt(Date.now());
|
|
2401
|
+
}, delay);
|
|
2402
|
+
return () => clearTimeout(t);
|
|
2403
|
+
}
|
|
2404
|
+
if (!loading && show) {
|
|
2405
|
+
const t = setTimeout(() => setShow(false), Math.max(0, min - (Date.now() - shownAt)));
|
|
2406
|
+
return () => clearTimeout(t);
|
|
2407
|
+
}
|
|
2408
|
+
return void 0;
|
|
2409
|
+
}, [loading, show, shownAt, delay, min]);
|
|
2410
|
+
return show;
|
|
2411
|
+
}
|
|
2412
|
+
var SHAPE = { line: "h-3 rounded-pill", block: "rounded-control", circle: "rounded-full" };
|
|
2413
|
+
function Skeleton({ shape = "line", className, style, testIdPrefix }) {
|
|
2414
|
+
useLoadingStyle();
|
|
2415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2416
|
+
"span",
|
|
2417
|
+
{
|
|
2418
|
+
"aria-hidden": "true",
|
|
2419
|
+
"data-mr-skeleton": "",
|
|
2420
|
+
"data-testid": testIdPrefix,
|
|
2421
|
+
className: cn("block bg-subtle", SHAPE[shape], className),
|
|
2422
|
+
style
|
|
2423
|
+
}
|
|
2424
|
+
);
|
|
2425
|
+
}
|
|
2426
|
+
function SkeletonLines({ lines = 3, className }) {
|
|
2427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: cn("flex flex-col gap-2", className), children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: i === lines - 1 ? "w-2/3" : "w-full" }, i)) });
|
|
2428
|
+
}
|
|
2429
|
+
function ChartSkeleton({ className }) {
|
|
2430
|
+
const bars = [55, 80, 40, 95, 70, 60, 85];
|
|
2431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { "aria-hidden": "true", className: cn("flex h-48 flex-col gap-2", className), children: [
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex flex-1 items-end gap-3", children: bars.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { shape: "block", className: "flex-1", style: { height: `${h}%` } }, i)) }),
|
|
2433
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex gap-3", children: bars.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-2 flex-1" }, i)) })
|
|
2434
|
+
] });
|
|
2435
|
+
}
|
|
2436
|
+
function StatStripSkeleton({ tiles = 3, className }) {
|
|
2437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2438
|
+
"span",
|
|
2439
|
+
{
|
|
2440
|
+
"aria-hidden": "true",
|
|
2441
|
+
className: cn("grid divide-y divide-border-default rounded-card border border-border-default bg-surface sm:auto-cols-fr sm:grid-flow-col sm:divide-x sm:divide-y-0", className),
|
|
2442
|
+
children: Array.from({ length: tiles }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex flex-col gap-2 px-5 py-3", children: [
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-2 w-20" }),
|
|
2444
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-6 w-24" }),
|
|
2445
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-2 w-28" })
|
|
2446
|
+
] }, i))
|
|
2447
|
+
}
|
|
2448
|
+
);
|
|
2449
|
+
}
|
|
2450
|
+
function LongWait({ loading, onRetry, hint = "Large date ranges take longer.", className }) {
|
|
2451
|
+
const [stage, setStage] = (0, import_react10.useState)(0);
|
|
2452
|
+
(0, import_react10.useEffect)(() => {
|
|
2453
|
+
setStage(0);
|
|
2454
|
+
if (!loading) return void 0;
|
|
2455
|
+
const a = setTimeout(() => setStage(1), 5e3);
|
|
2456
|
+
const b = setTimeout(() => setStage(2), 3e4);
|
|
2457
|
+
return () => {
|
|
2458
|
+
clearTimeout(a);
|
|
2459
|
+
clearTimeout(b);
|
|
2460
|
+
};
|
|
2461
|
+
}, [loading]);
|
|
2462
|
+
if (!loading || stage === 0) return null;
|
|
2463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { role: "status", className: cn("mt-3 flex items-center gap-2 text-xs text-text-tertiary", className), children: [
|
|
2464
|
+
stage === 1 ? `Still loading. ${hint}` : "This is taking longer than usual.",
|
|
2465
|
+
stage === 2 && onRetry && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "link", size: "sm", onClick: onRetry, children: "Retry" })
|
|
2466
|
+
] });
|
|
2467
|
+
}
|
|
2468
|
+
function LoadError({ onRetry, children = "Couldn't load this." }) {
|
|
2469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { role: "alert", className: "flex flex-1 flex-col items-center justify-center gap-2 py-8 text-center text-dense text-text-secondary", children: [
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children }),
|
|
2471
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "secondary", size: "sm", onClick: onRetry, children: "Try again" })
|
|
2472
|
+
] });
|
|
2473
|
+
}
|
|
2474
|
+
function RefreshLine() {
|
|
2475
|
+
useLoadingStyle();
|
|
2476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-x-0 top-0 h-0.5 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "data-mr-refresh-line": "" }) });
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
// src/Card.tsx
|
|
2480
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2481
|
+
var Card = (0, import_react11.forwardRef)(function Card2({
|
|
2482
|
+
staticCard,
|
|
2483
|
+
title,
|
|
2484
|
+
titleAs: TitleTag = "h3",
|
|
2485
|
+
subtitle,
|
|
2486
|
+
info,
|
|
2487
|
+
variant = "default",
|
|
2488
|
+
action,
|
|
2489
|
+
className,
|
|
2490
|
+
testIdPrefix,
|
|
2491
|
+
children,
|
|
2492
|
+
loading = false,
|
|
2493
|
+
skeleton,
|
|
2494
|
+
refreshing = false,
|
|
2495
|
+
error = false,
|
|
2496
|
+
onRetry,
|
|
2497
|
+
...rest
|
|
2498
|
+
}, ref) {
|
|
2277
2499
|
const chart = variant === "chart";
|
|
2278
|
-
|
|
2500
|
+
const showSkeleton = useDelayedLoading(loading);
|
|
2501
|
+
const body = error ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex min-h-48 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoadError, { onRetry }) }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex min-h-48 flex-1 flex-col", children: [
|
|
2502
|
+
showSkeleton && (skeleton ?? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChartSkeleton, {})),
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LongWait, { loading, onRetry })
|
|
2504
|
+
] }) : refreshing ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-1 flex-col opacity-50 transition-opacity motion-reduce:transition-none", children }) : children;
|
|
2505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2279
2506
|
"article",
|
|
2280
2507
|
{
|
|
2281
2508
|
ref,
|
|
2282
2509
|
className: cn(
|
|
2283
|
-
"flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
|
|
2510
|
+
"relative flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
|
|
2284
2511
|
!chart && "shadow-raised",
|
|
2285
2512
|
// Interactive hover: deeper drop shadow only -- no elevation/transform.
|
|
2286
2513
|
!staticCard && !chart && "group transition-shadow hover:shadow-overlay",
|
|
2287
2514
|
className
|
|
2288
2515
|
),
|
|
2289
2516
|
"data-testid": testIdPrefix,
|
|
2517
|
+
"aria-busy": loading || refreshing || void 0,
|
|
2290
2518
|
...rest,
|
|
2291
|
-
children:
|
|
2292
|
-
/* @__PURE__ */ (0,
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2519
|
+
children: [
|
|
2520
|
+
refreshing && !loading && !error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(RefreshLine, {}),
|
|
2521
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0", children: [
|
|
2524
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
|
|
2526
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
|
|
2527
|
+
] }),
|
|
2528
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
2297
2529
|
] }),
|
|
2298
|
-
|
|
2530
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
2299
2531
|
] }),
|
|
2300
|
-
|
|
2301
|
-
] })
|
|
2302
|
-
|
|
2303
|
-
] }) : children
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children: body })
|
|
2533
|
+
] }) : body
|
|
2534
|
+
]
|
|
2304
2535
|
}
|
|
2305
2536
|
);
|
|
2306
2537
|
});
|
|
2307
2538
|
|
|
2308
2539
|
// src/StatStrip.tsx
|
|
2309
|
-
var
|
|
2310
|
-
var
|
|
2311
|
-
var StatStrip = (0,
|
|
2312
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2540
|
+
var import_react12 = require("react");
|
|
2541
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2542
|
+
var StatStrip = (0, import_react12.forwardRef)(
|
|
2543
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2313
2544
|
"div",
|
|
2314
2545
|
{
|
|
2315
2546
|
ref,
|
|
@@ -2327,32 +2558,32 @@ var StatStrip = (0, import_react10.forwardRef)(
|
|
|
2327
2558
|
);
|
|
2328
2559
|
StatStrip.displayName = "StatStrip";
|
|
2329
2560
|
function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
2332
|
-
icon && /* @__PURE__ */ (0,
|
|
2561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
|
|
2562
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
|
|
2563
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
|
|
2333
2564
|
label,
|
|
2334
|
-
info && /* @__PURE__ */ (0,
|
|
2565
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
|
|
2335
2566
|
] }),
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2337
|
-
/* @__PURE__ */ (0,
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
|
|
2338
2569
|
value,
|
|
2339
|
-
unit && /* @__PURE__ */ (0,
|
|
2570
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
|
|
2340
2571
|
" ",
|
|
2341
2572
|
unit
|
|
2342
2573
|
] })
|
|
2343
2574
|
] }),
|
|
2344
|
-
change && /* @__PURE__ */ (0,
|
|
2575
|
+
change && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-card-title font-medium", children: change })
|
|
2345
2576
|
] }),
|
|
2346
|
-
note && /* @__PURE__ */ (0,
|
|
2347
|
-
children && /* @__PURE__ */ (0,
|
|
2577
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-text-tertiary", children: note }),
|
|
2578
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-xs text-text-secondary", children })
|
|
2348
2579
|
] });
|
|
2349
2580
|
}
|
|
2350
2581
|
|
|
2351
2582
|
// src/ChartLegend.tsx
|
|
2352
|
-
var
|
|
2353
|
-
var
|
|
2354
|
-
var ChartLegend = (0,
|
|
2355
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2583
|
+
var import_react13 = require("react");
|
|
2584
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2585
|
+
var ChartLegend = (0, import_react13.forwardRef)(
|
|
2586
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2356
2587
|
"ul",
|
|
2357
2588
|
{
|
|
2358
2589
|
ref,
|
|
@@ -2372,8 +2603,8 @@ var MARK = {
|
|
|
2372
2603
|
};
|
|
2373
2604
|
function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
|
|
2374
2605
|
const dashed = mark === "dashed";
|
|
2375
|
-
return /* @__PURE__ */ (0,
|
|
2376
|
-
/* @__PURE__ */ (0,
|
|
2606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
|
|
2607
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2377
2608
|
"span",
|
|
2378
2609
|
{
|
|
2379
2610
|
"aria-hidden": "true",
|
|
@@ -2387,7 +2618,7 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2387
2618
|
style: color ? dashed ? { borderColor: color } : { background: color } : void 0
|
|
2388
2619
|
}
|
|
2389
2620
|
),
|
|
2390
|
-
/* @__PURE__ */ (0,
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
|
|
2391
2622
|
children,
|
|
2392
2623
|
you && " (you)"
|
|
2393
2624
|
] })
|
|
@@ -2395,30 +2626,30 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2395
2626
|
}
|
|
2396
2627
|
|
|
2397
2628
|
// src/BarList.tsx
|
|
2398
|
-
var
|
|
2629
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2399
2630
|
var COL_WIDTH = ["w-16", "w-13"];
|
|
2400
2631
|
function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
|
|
2401
2632
|
if (!rows.length) {
|
|
2402
|
-
return empty ? /* @__PURE__ */ (0,
|
|
2633
|
+
return empty ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
|
|
2403
2634
|
}
|
|
2404
2635
|
const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
|
|
2405
2636
|
const full = !!columns?.length;
|
|
2406
2637
|
const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
|
|
2407
|
-
return /* @__PURE__ */ (0,
|
|
2408
|
-
full && /* @__PURE__ */ (0,
|
|
2409
|
-
/* @__PURE__ */ (0,
|
|
2410
|
-
columns.map((c, i) => /* @__PURE__ */ (0,
|
|
2638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
|
|
2639
|
+
full && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
|
|
2640
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex-1" }),
|
|
2641
|
+
columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
|
|
2411
2642
|
] }),
|
|
2412
|
-
/* @__PURE__ */ (0,
|
|
2413
|
-
/* @__PURE__ */ (0,
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2643
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("li", { className: "py-2", children: [
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
2645
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
|
|
2415
2646
|
r.label,
|
|
2416
|
-
r.note && /* @__PURE__ */ (0,
|
|
2647
|
+
r.note && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "font-normal text-text-tertiary", children: [
|
|
2417
2648
|
" \xB7 ",
|
|
2418
2649
|
r.note
|
|
2419
2650
|
] })
|
|
2420
2651
|
] }),
|
|
2421
|
-
r.values?.map((v, i) => /* @__PURE__ */ (0,
|
|
2652
|
+
r.values?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2422
2653
|
"span",
|
|
2423
2654
|
{
|
|
2424
2655
|
className: cn(
|
|
@@ -2427,7 +2658,7 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2427
2658
|
colClass(i)
|
|
2428
2659
|
),
|
|
2429
2660
|
children: [
|
|
2430
|
-
full && /* @__PURE__ */ (0,
|
|
2661
|
+
full && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "sr-only", children: [
|
|
2431
2662
|
columns[i],
|
|
2432
2663
|
": "
|
|
2433
2664
|
] }),
|
|
@@ -2437,15 +2668,15 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2437
2668
|
i
|
|
2438
2669
|
))
|
|
2439
2670
|
] }),
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2441
|
-
/* @__PURE__ */ (0,
|
|
2671
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
|
|
2672
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2442
2673
|
"div",
|
|
2443
2674
|
{
|
|
2444
2675
|
className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
|
|
2445
2676
|
style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
|
|
2446
2677
|
}
|
|
2447
2678
|
),
|
|
2448
|
-
r.tick !== void 0 && /* @__PURE__ */ (0,
|
|
2679
|
+
r.tick !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2449
2680
|
"span",
|
|
2450
2681
|
{
|
|
2451
2682
|
className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
|
|
@@ -2453,14 +2684,14 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2453
2684
|
}
|
|
2454
2685
|
)
|
|
2455
2686
|
] }),
|
|
2456
|
-
r.tickLabel && /* @__PURE__ */ (0,
|
|
2687
|
+
r.tickLabel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: r.tickLabel })
|
|
2457
2688
|
] }, r.key)) })
|
|
2458
2689
|
] });
|
|
2459
2690
|
}
|
|
2460
2691
|
|
|
2461
2692
|
// src/NoResultsEmptyState.tsx
|
|
2462
|
-
var
|
|
2463
|
-
var
|
|
2693
|
+
var import_lucide_react13 = require("lucide-react");
|
|
2694
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2464
2695
|
var NO_RESULTS_TITLE = "No results match your filters";
|
|
2465
2696
|
var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
|
|
2466
2697
|
function noResultsBody(workspaceName) {
|
|
@@ -2483,12 +2714,12 @@ function NoResultsEmptyState({
|
|
|
2483
2714
|
const showClear = hasFilters !== false && Boolean(onClearFilters);
|
|
2484
2715
|
const showEdit = Boolean(onEditFilters);
|
|
2485
2716
|
const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
|
|
2486
|
-
return /* @__PURE__ */ (0,
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2490
|
-
hasActions && /* @__PURE__ */ (0,
|
|
2491
|
-
showClear && /* @__PURE__ */ (0,
|
|
2717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2721
|
+
hasActions && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2722
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2492
2723
|
"button",
|
|
2493
2724
|
{
|
|
2494
2725
|
type: "button",
|
|
@@ -2498,7 +2729,7 @@ function NoResultsEmptyState({
|
|
|
2498
2729
|
children: "Clear all filters"
|
|
2499
2730
|
}
|
|
2500
2731
|
),
|
|
2501
|
-
showEdit && /* @__PURE__ */ (0,
|
|
2732
|
+
showEdit && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2502
2733
|
"button",
|
|
2503
2734
|
{
|
|
2504
2735
|
type: "button",
|
|
@@ -2508,7 +2739,7 @@ function NoResultsEmptyState({
|
|
|
2508
2739
|
children: "Edit filters"
|
|
2509
2740
|
}
|
|
2510
2741
|
),
|
|
2511
|
-
actions?.map((action, i) => /* @__PURE__ */ (0,
|
|
2742
|
+
actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2512
2743
|
"button",
|
|
2513
2744
|
{
|
|
2514
2745
|
type: "button",
|
|
@@ -2523,11 +2754,11 @@ function NoResultsEmptyState({
|
|
|
2523
2754
|
}
|
|
2524
2755
|
|
|
2525
2756
|
// src/WorkspaceSelectedCard.tsx
|
|
2526
|
-
var
|
|
2527
|
-
var
|
|
2528
|
-
var
|
|
2757
|
+
var import_react14 = require("react");
|
|
2758
|
+
var import_lucide_react14 = require("lucide-react");
|
|
2759
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2529
2760
|
function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
2530
|
-
return /* @__PURE__ */ (0,
|
|
2761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2531
2762
|
"aside",
|
|
2532
2763
|
{
|
|
2533
2764
|
className: cn(
|
|
@@ -2535,7 +2766,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
|
2535
2766
|
className
|
|
2536
2767
|
),
|
|
2537
2768
|
"data-testid": testIdPrefix,
|
|
2538
|
-
children: /* @__PURE__ */ (0,
|
|
2769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
|
|
2539
2770
|
}
|
|
2540
2771
|
);
|
|
2541
2772
|
}
|
|
@@ -2547,15 +2778,15 @@ function SummaryGroupItem({
|
|
|
2547
2778
|
const ownCount = group.items.length;
|
|
2548
2779
|
const subCount = (group.subGroups ?? []).reduce((n, sg) => n + sg.items.length, 0);
|
|
2549
2780
|
const expandCount = ownCount + subCount;
|
|
2550
|
-
const [open, setOpen] = (0,
|
|
2551
|
-
const wasEmpty = (0,
|
|
2552
|
-
(0,
|
|
2781
|
+
const [open, setOpen] = (0, import_react14.useState)(expandCount > 0);
|
|
2782
|
+
const wasEmpty = (0, import_react14.useRef)(expandCount === 0);
|
|
2783
|
+
(0, import_react14.useEffect)(() => {
|
|
2553
2784
|
if (wasEmpty.current && expandCount > 0) setOpen(true);
|
|
2554
2785
|
else if (expandCount === 0) setOpen(false);
|
|
2555
2786
|
wasEmpty.current = expandCount === 0;
|
|
2556
2787
|
}, [expandCount]);
|
|
2557
|
-
return /* @__PURE__ */ (0,
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2559
2790
|
"button",
|
|
2560
2791
|
{
|
|
2561
2792
|
type: "button",
|
|
@@ -2564,45 +2795,45 @@ function SummaryGroupItem({
|
|
|
2564
2795
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2565
2796
|
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",
|
|
2566
2797
|
children: [
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2799
|
+
import_lucide_react14.ChevronDown,
|
|
2569
2800
|
{
|
|
2570
2801
|
size: 14,
|
|
2571
2802
|
"aria-hidden": "true",
|
|
2572
2803
|
className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
|
|
2573
2804
|
}
|
|
2574
2805
|
),
|
|
2575
|
-
/* @__PURE__ */ (0,
|
|
2576
|
-
/* @__PURE__ */ (0,
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
|
|
2577
2808
|
]
|
|
2578
2809
|
}
|
|
2579
2810
|
),
|
|
2580
|
-
open && /* @__PURE__ */ (0,
|
|
2581
|
-
ownCount > 0 && /* @__PURE__ */ (0,
|
|
2582
|
-
group.items.map((item) => /* @__PURE__ */ (0,
|
|
2811
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
|
|
2812
|
+
ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
2813
|
+
group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2583
2814
|
"div",
|
|
2584
2815
|
{
|
|
2585
2816
|
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
2586
2817
|
children: [
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2589
|
-
item.meta && /* @__PURE__ */ (0,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
|
|
2820
|
+
item.meta && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
|
|
2590
2821
|
] }),
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2592
2823
|
"button",
|
|
2593
2824
|
{
|
|
2594
2825
|
type: "button",
|
|
2595
2826
|
"aria-label": `Remove ${item.name}`,
|
|
2596
2827
|
onClick: () => group.onRemove(item.id),
|
|
2597
2828
|
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",
|
|
2598
|
-
children: /* @__PURE__ */ (0,
|
|
2829
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.X, { size: 12, "aria-hidden": "true" })
|
|
2599
2830
|
}
|
|
2600
2831
|
)
|
|
2601
2832
|
]
|
|
2602
2833
|
},
|
|
2603
2834
|
item.id
|
|
2604
2835
|
)),
|
|
2605
|
-
/* @__PURE__ */ (0,
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2606
2837
|
"button",
|
|
2607
2838
|
{
|
|
2608
2839
|
type: "button",
|
|
@@ -2613,13 +2844,13 @@ function SummaryGroupItem({
|
|
|
2613
2844
|
}
|
|
2614
2845
|
)
|
|
2615
2846
|
] }),
|
|
2616
|
-
group.subGroups?.map((sg) => /* @__PURE__ */ (0,
|
|
2847
|
+
group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
|
|
2617
2848
|
] }) })
|
|
2618
2849
|
] });
|
|
2619
2850
|
}
|
|
2620
2851
|
|
|
2621
2852
|
// src/chart-placeholder-shared.tsx
|
|
2622
|
-
var
|
|
2853
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2623
2854
|
var GRID_ROWS = [0, 25, 50, 75, 100];
|
|
2624
2855
|
var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
|
|
2625
2856
|
var Y_AXIS_W = 48;
|
|
@@ -2633,9 +2864,9 @@ function AxisFrame({
|
|
|
2633
2864
|
testIdPrefix
|
|
2634
2865
|
}) {
|
|
2635
2866
|
const gutter = xTicks > 0 ? X_AXIS_H : 0;
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2638
|
-
GRID_ROWS.map((pct) => /* @__PURE__ */ (0,
|
|
2867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative h-full w-full", children: [
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
|
|
2869
|
+
GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2639
2870
|
"div",
|
|
2640
2871
|
{
|
|
2641
2872
|
className: "absolute inset-x-0 border-t border-dashed",
|
|
@@ -2643,9 +2874,9 @@ function AxisFrame({
|
|
|
2643
2874
|
},
|
|
2644
2875
|
pct
|
|
2645
2876
|
)),
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute inset-0", children })
|
|
2647
2878
|
] }),
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2649
2880
|
"div",
|
|
2650
2881
|
{
|
|
2651
2882
|
className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
|
|
@@ -2653,27 +2884,27 @@ function AxisFrame({
|
|
|
2653
2884
|
},
|
|
2654
2885
|
pct
|
|
2655
2886
|
)) }),
|
|
2656
|
-
xTicks > 0 && /* @__PURE__ */ (0,
|
|
2887
|
+
xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2657
2888
|
"div",
|
|
2658
2889
|
{
|
|
2659
2890
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2660
2891
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2661
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0,
|
|
2892
|
+
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
|
|
2662
2893
|
}
|
|
2663
2894
|
)
|
|
2664
2895
|
] }) });
|
|
2665
2896
|
}
|
|
2666
2897
|
function BlankLegend({ rows, reverse = false }) {
|
|
2667
|
-
return /* @__PURE__ */ (0,
|
|
2898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2668
2899
|
"ul",
|
|
2669
2900
|
{
|
|
2670
2901
|
className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
|
|
2671
2902
|
role: "presentation",
|
|
2672
2903
|
"aria-hidden": "true",
|
|
2673
|
-
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2676
|
-
/* @__PURE__ */ (0,
|
|
2904
|
+
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
2906
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2677
2908
|
"span",
|
|
2678
2909
|
{
|
|
2679
2910
|
className: "h-2 rounded-xs bg-subtle",
|
|
@@ -2681,21 +2912,21 @@ function BlankLegend({ rows, reverse = false }) {
|
|
|
2681
2912
|
}
|
|
2682
2913
|
)
|
|
2683
2914
|
] }),
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
|
|
2685
2916
|
] }, i))
|
|
2686
2917
|
}
|
|
2687
2918
|
);
|
|
2688
2919
|
}
|
|
2689
2920
|
|
|
2690
2921
|
// src/BarChartPlaceholder.tsx
|
|
2691
|
-
var
|
|
2922
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2692
2923
|
var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
|
|
2693
2924
|
function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
|
|
2694
|
-
return /* @__PURE__ */ (0,
|
|
2925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
|
|
2695
2926
|
}
|
|
2696
2927
|
|
|
2697
2928
|
// src/LineChartPlaceholder.tsx
|
|
2698
|
-
var
|
|
2929
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2699
2930
|
var LINE_SERIES = [
|
|
2700
2931
|
[58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
|
|
2701
2932
|
[74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
|
|
@@ -2705,9 +2936,9 @@ var LINE_SERIES = [
|
|
|
2705
2936
|
var LINE_FORECAST_FROM = 7;
|
|
2706
2937
|
function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
2707
2938
|
const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
|
|
2708
|
-
return /* @__PURE__ */ (0,
|
|
2709
|
-
/* @__PURE__ */ (0,
|
|
2710
|
-
/* @__PURE__ */ (0,
|
|
2939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
|
|
2940
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("g", { children: [
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2711
2942
|
"polyline",
|
|
2712
2943
|
{
|
|
2713
2944
|
points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
|
|
@@ -2719,7 +2950,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2719
2950
|
strokeLinejoin: "round"
|
|
2720
2951
|
}
|
|
2721
2952
|
),
|
|
2722
|
-
/* @__PURE__ */ (0,
|
|
2953
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2723
2954
|
"polyline",
|
|
2724
2955
|
{
|
|
2725
2956
|
points: toPath(pts, LINE_FORECAST_FROM, pts.length),
|
|
@@ -2734,7 +2965,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2734
2965
|
)
|
|
2735
2966
|
] }, s)) }),
|
|
2736
2967
|
LINE_SERIES.map(
|
|
2737
|
-
(pts, s) => pts.map((y, i) => /* @__PURE__ */ (0,
|
|
2968
|
+
(pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2738
2969
|
"div",
|
|
2739
2970
|
{
|
|
2740
2971
|
className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
@@ -2751,16 +2982,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2751
2982
|
}
|
|
2752
2983
|
|
|
2753
2984
|
// src/PieChartPlaceholder.tsx
|
|
2754
|
-
var
|
|
2985
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2755
2986
|
var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
|
|
2756
2987
|
function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
|
|
2757
2988
|
const r = 45;
|
|
2758
|
-
return /* @__PURE__ */ (0,
|
|
2759
|
-
/* @__PURE__ */ (0,
|
|
2760
|
-
/* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2990
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
|
|
2991
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
|
|
2761
2992
|
PIE_SEAMS.map((deg) => {
|
|
2762
2993
|
const rad = (deg - 90) * Math.PI / 180;
|
|
2763
|
-
return /* @__PURE__ */ (0,
|
|
2994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2764
2995
|
"line",
|
|
2765
2996
|
{
|
|
2766
2997
|
x1: "50",
|
|
@@ -2774,12 +3005,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
|
|
|
2774
3005
|
);
|
|
2775
3006
|
})
|
|
2776
3007
|
] }) }),
|
|
2777
|
-
/* @__PURE__ */ (0,
|
|
3008
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BlankLegend, { rows: legendRows })
|
|
2778
3009
|
] });
|
|
2779
3010
|
}
|
|
2780
3011
|
|
|
2781
3012
|
// src/StackedColumnPlaceholder.tsx
|
|
2782
|
-
var
|
|
3013
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2783
3014
|
var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
|
|
2784
3015
|
function columnBands(count) {
|
|
2785
3016
|
const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
|
|
@@ -2794,7 +3025,7 @@ function StackedColumnPlaceholder({
|
|
|
2794
3025
|
className,
|
|
2795
3026
|
testIdPrefix
|
|
2796
3027
|
}) {
|
|
2797
|
-
const column = /* @__PURE__ */ (0,
|
|
3028
|
+
const column = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2798
3029
|
"div",
|
|
2799
3030
|
{
|
|
2800
3031
|
style: {
|
|
@@ -2806,16 +3037,16 @@ function StackedColumnPlaceholder({
|
|
|
2806
3037
|
},
|
|
2807
3038
|
i
|
|
2808
3039
|
)) });
|
|
2809
|
-
return /* @__PURE__ */ (0,
|
|
2810
|
-
axis ? /* @__PURE__ */ (0,
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
3040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
3041
|
+
axis ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-stretch py-1", children: column }),
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
|
|
2812
3043
|
] });
|
|
2813
3044
|
}
|
|
2814
3045
|
|
|
2815
3046
|
// src/Tooltip.tsx
|
|
2816
|
-
var
|
|
3047
|
+
var import_react15 = require("react");
|
|
2817
3048
|
var import_react_dom3 = require("react-dom");
|
|
2818
|
-
var
|
|
3049
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2819
3050
|
function addDescribedBy(el, id) {
|
|
2820
3051
|
const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
|
|
2821
3052
|
if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
|
|
@@ -2851,18 +3082,18 @@ function Tooltip({
|
|
|
2851
3082
|
variant = "surface",
|
|
2852
3083
|
testIdPrefix
|
|
2853
3084
|
}) {
|
|
2854
|
-
const [anchor, setAnchor] = (0,
|
|
2855
|
-
const [boxWidth, setBoxWidth] = (0,
|
|
2856
|
-
const ref = (0,
|
|
2857
|
-
const boxRef = (0,
|
|
2858
|
-
const hideTimer = (0,
|
|
2859
|
-
const showTimer = (0,
|
|
2860
|
-
const exitTimer = (0,
|
|
2861
|
-
const [shown, setShown] = (0,
|
|
2862
|
-
const openRef = (0,
|
|
2863
|
-
const mountedRef = (0,
|
|
2864
|
-
const id = (0,
|
|
2865
|
-
const describedRef = (0,
|
|
3085
|
+
const [anchor, setAnchor] = (0, import_react15.useState)(null);
|
|
3086
|
+
const [boxWidth, setBoxWidth] = (0, import_react15.useState)(null);
|
|
3087
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3088
|
+
const boxRef = (0, import_react15.useRef)(null);
|
|
3089
|
+
const hideTimer = (0, import_react15.useRef)(null);
|
|
3090
|
+
const showTimer = (0, import_react15.useRef)(null);
|
|
3091
|
+
const exitTimer = (0, import_react15.useRef)(null);
|
|
3092
|
+
const [shown, setShown] = (0, import_react15.useState)(false);
|
|
3093
|
+
const openRef = (0, import_react15.useRef)(false);
|
|
3094
|
+
const mountedRef = (0, import_react15.useRef)(false);
|
|
3095
|
+
const id = (0, import_react15.useId)();
|
|
3096
|
+
const describedRef = (0, import_react15.useRef)(null);
|
|
2866
3097
|
const clearHideTimer = () => {
|
|
2867
3098
|
if (hideTimer.current) {
|
|
2868
3099
|
clearTimeout(hideTimer.current);
|
|
@@ -2881,7 +3112,7 @@ function Tooltip({
|
|
|
2881
3112
|
exitTimer.current = null;
|
|
2882
3113
|
}
|
|
2883
3114
|
};
|
|
2884
|
-
(0,
|
|
3115
|
+
(0, import_react15.useEffect)(
|
|
2885
3116
|
() => () => {
|
|
2886
3117
|
clearHideTimer();
|
|
2887
3118
|
clearShowTimer();
|
|
@@ -2955,7 +3186,7 @@ function Tooltip({
|
|
|
2955
3186
|
clearHideTimer();
|
|
2956
3187
|
hideTimer.current = setTimeout(hideNow, 120);
|
|
2957
3188
|
};
|
|
2958
|
-
(0,
|
|
3189
|
+
(0, import_react15.useEffect)(() => {
|
|
2959
3190
|
if (!anchorRef) return;
|
|
2960
3191
|
const el = anchorRef.current;
|
|
2961
3192
|
if (!el) return;
|
|
@@ -2970,13 +3201,13 @@ function Tooltip({
|
|
|
2970
3201
|
el.removeEventListener("blur", hide);
|
|
2971
3202
|
};
|
|
2972
3203
|
}, [anchorRef, placement, delay]);
|
|
2973
|
-
(0,
|
|
3204
|
+
(0, import_react15.useEffect)(() => {
|
|
2974
3205
|
if (!anchor) return;
|
|
2975
3206
|
const onKey = (e) => e.key === "Escape" && hideNow();
|
|
2976
3207
|
window.addEventListener("keydown", onKey);
|
|
2977
3208
|
return () => window.removeEventListener("keydown", onKey);
|
|
2978
3209
|
}, [anchor]);
|
|
2979
|
-
(0,
|
|
3210
|
+
(0, import_react15.useLayoutEffect)(() => {
|
|
2980
3211
|
if (!anchor) return;
|
|
2981
3212
|
const el = boxRef.current;
|
|
2982
3213
|
if (!el) return;
|
|
@@ -3001,7 +3232,7 @@ function Tooltip({
|
|
|
3001
3232
|
}
|
|
3002
3233
|
}
|
|
3003
3234
|
const floating = anchor != null && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
|
|
3004
|
-
/* @__PURE__ */ (0,
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3005
3236
|
"span",
|
|
3006
3237
|
{
|
|
3007
3238
|
ref: boxRef,
|
|
@@ -3032,7 +3263,7 @@ function Tooltip({
|
|
|
3032
3263
|
document.body
|
|
3033
3264
|
) : null;
|
|
3034
3265
|
if (anchorRef) return floating;
|
|
3035
|
-
return /* @__PURE__ */ (0,
|
|
3266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3036
3267
|
"span",
|
|
3037
3268
|
{
|
|
3038
3269
|
ref,
|
|
@@ -3054,28 +3285,28 @@ function Tooltip({
|
|
|
3054
3285
|
}
|
|
3055
3286
|
|
|
3056
3287
|
// src/AdvertiserNoResults.tsx
|
|
3057
|
-
var
|
|
3288
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3058
3289
|
function AdvertiserNoResults({
|
|
3059
3290
|
query,
|
|
3060
3291
|
hint = "Try checking your spelling or searching for a broader brand name.",
|
|
3061
3292
|
className,
|
|
3062
3293
|
testIdPrefix
|
|
3063
3294
|
}) {
|
|
3064
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
3066
3297
|
"No results found for \u201C",
|
|
3067
3298
|
query,
|
|
3068
3299
|
"\u201D"
|
|
3069
3300
|
] }),
|
|
3070
|
-
/* @__PURE__ */ (0,
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
3071
3302
|
] });
|
|
3072
3303
|
}
|
|
3073
3304
|
|
|
3074
3305
|
// src/SelectAllVisible.tsx
|
|
3075
|
-
var
|
|
3076
|
-
var
|
|
3306
|
+
var import_lucide_react15 = require("lucide-react");
|
|
3307
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3077
3308
|
function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
|
|
3078
|
-
return /* @__PURE__ */ (0,
|
|
3309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3079
3310
|
"button",
|
|
3080
3311
|
{
|
|
3081
3312
|
type: "button",
|
|
@@ -3086,7 +3317,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
3086
3317
|
className
|
|
3087
3318
|
),
|
|
3088
3319
|
children: [
|
|
3089
|
-
/* @__PURE__ */ (0,
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.ListChecks, { size: 14, "aria-hidden": "true" }),
|
|
3090
3321
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
3091
3322
|
]
|
|
3092
3323
|
}
|
|
@@ -3094,12 +3325,12 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
3094
3325
|
}
|
|
3095
3326
|
|
|
3096
3327
|
// src/SelectedSection.tsx
|
|
3097
|
-
var
|
|
3098
|
-
var
|
|
3328
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3329
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3099
3330
|
function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
|
|
3100
3331
|
if (count === 0) return null;
|
|
3101
|
-
return /* @__PURE__ */ (0,
|
|
3102
|
-
/* @__PURE__ */ (0,
|
|
3332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3333
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3103
3334
|
"button",
|
|
3104
3335
|
{
|
|
3105
3336
|
type: "button",
|
|
@@ -3108,25 +3339,25 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
|
|
|
3108
3339
|
"aria-expanded": open,
|
|
3109
3340
|
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",
|
|
3110
3341
|
children: [
|
|
3111
|
-
/* @__PURE__ */ (0,
|
|
3342
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
|
|
3112
3343
|
"Selected (",
|
|
3113
3344
|
count,
|
|
3114
3345
|
")"
|
|
3115
3346
|
]
|
|
3116
3347
|
}
|
|
3117
3348
|
),
|
|
3118
|
-
open && /* @__PURE__ */ (0,
|
|
3349
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col gap-0.5", children })
|
|
3119
3350
|
] });
|
|
3120
3351
|
}
|
|
3121
3352
|
|
|
3122
3353
|
// src/SelectionPicker.tsx
|
|
3123
|
-
var
|
|
3354
|
+
var import_react17 = require("react");
|
|
3124
3355
|
var import_react_dom4 = require("react-dom");
|
|
3125
|
-
var
|
|
3356
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3126
3357
|
|
|
3127
3358
|
// src/Tabs.tsx
|
|
3128
|
-
var
|
|
3129
|
-
var
|
|
3359
|
+
var import_react16 = require("react");
|
|
3360
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3130
3361
|
function arrowKeys(e, row) {
|
|
3131
3362
|
if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
|
|
3132
3363
|
const items = Array.from(row.querySelectorAll("button:not([disabled])"));
|
|
@@ -3137,8 +3368,8 @@ function arrowKeys(e, row) {
|
|
|
3137
3368
|
items[next]?.click();
|
|
3138
3369
|
}
|
|
3139
3370
|
function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
|
|
3140
|
-
const row = (0,
|
|
3141
|
-
return /* @__PURE__ */ (0,
|
|
3371
|
+
const row = (0, import_react16.useRef)(null);
|
|
3372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3142
3373
|
"div",
|
|
3143
3374
|
{
|
|
3144
3375
|
ref: row,
|
|
@@ -3149,7 +3380,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3149
3380
|
className: cn("flex gap-6 border-b border-border-default", className),
|
|
3150
3381
|
children: items.map((item) => {
|
|
3151
3382
|
const on = item.value === value;
|
|
3152
|
-
return /* @__PURE__ */ (0,
|
|
3383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3153
3384
|
"button",
|
|
3154
3385
|
{
|
|
3155
3386
|
type: "button",
|
|
@@ -3167,7 +3398,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3167
3398
|
),
|
|
3168
3399
|
children: [
|
|
3169
3400
|
item.label,
|
|
3170
|
-
item.count !== void 0 && /* @__PURE__ */ (0,
|
|
3401
|
+
item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
|
|
3171
3402
|
]
|
|
3172
3403
|
},
|
|
3173
3404
|
item.value
|
|
@@ -3185,8 +3416,8 @@ function SegmentedControl({
|
|
|
3185
3416
|
testIdPrefix,
|
|
3186
3417
|
...rest
|
|
3187
3418
|
}) {
|
|
3188
|
-
const row = (0,
|
|
3189
|
-
return /* @__PURE__ */ (0,
|
|
3419
|
+
const row = (0, import_react16.useRef)(null);
|
|
3420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3190
3421
|
"div",
|
|
3191
3422
|
{
|
|
3192
3423
|
ref: row,
|
|
@@ -3197,7 +3428,7 @@ function SegmentedControl({
|
|
|
3197
3428
|
className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
|
|
3198
3429
|
children: options.map((o) => {
|
|
3199
3430
|
const on = o.value === value;
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3201
3432
|
"button",
|
|
3202
3433
|
{
|
|
3203
3434
|
type: "button",
|
|
@@ -3221,7 +3452,7 @@ function SegmentedControl({
|
|
|
3221
3452
|
}
|
|
3222
3453
|
|
|
3223
3454
|
// src/SelectionPicker.tsx
|
|
3224
|
-
var
|
|
3455
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3225
3456
|
function slug5(value) {
|
|
3226
3457
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
3227
3458
|
}
|
|
@@ -3255,15 +3486,15 @@ function SelectionPicker({
|
|
|
3255
3486
|
testIdPrefix
|
|
3256
3487
|
}) {
|
|
3257
3488
|
const hasAccountLists = !!accountLists;
|
|
3258
|
-
const [source, setSource] = (0,
|
|
3259
|
-
const [query, setQuery] = (0,
|
|
3260
|
-
const [activeFilters, setActiveFilters] = (0,
|
|
3489
|
+
const [source, setSource] = (0, import_react17.useState)("search");
|
|
3490
|
+
const [query, setQuery] = (0, import_react17.useState)("");
|
|
3491
|
+
const [activeFilters, setActiveFilters] = (0, import_react17.useState)(() => {
|
|
3261
3492
|
const init = {};
|
|
3262
3493
|
if (defaultFilters) for (const [label, opts] of Object.entries(defaultFilters)) init[label] = new Set(opts);
|
|
3263
3494
|
return init;
|
|
3264
3495
|
});
|
|
3265
|
-
const [expanded, setExpanded] = (0,
|
|
3266
|
-
const selectedIds = (0,
|
|
3496
|
+
const [expanded, setExpanded] = (0, import_react17.useState)(/* @__PURE__ */ new Set());
|
|
3497
|
+
const selectedIds = (0, import_react17.useMemo)(() => new Set(selected.map((s) => s.id)), [selected]);
|
|
3267
3498
|
const toggleFilter = (label, opt) => {
|
|
3268
3499
|
setActiveFilters((prev) => {
|
|
3269
3500
|
const next = { ...prev };
|
|
@@ -3275,7 +3506,7 @@ function SelectionPicker({
|
|
|
3275
3506
|
};
|
|
3276
3507
|
const activeFilterCount = filters.reduce((n, f) => n + (activeFilters[f.label]?.size ?? 0), 0);
|
|
3277
3508
|
const hasSearched = showResultsWithoutSearch || query.trim().length > 0 || !requireQuery && activeFilterCount > 0;
|
|
3278
|
-
const filteredCatalog = (0,
|
|
3509
|
+
const filteredCatalog = (0, import_react17.useMemo)(() => {
|
|
3279
3510
|
if (!hasSearched || results !== void 0) return [];
|
|
3280
3511
|
const q = query.trim().toLowerCase();
|
|
3281
3512
|
return catalog.filter((row) => {
|
|
@@ -3314,12 +3545,12 @@ function SelectionPicker({
|
|
|
3314
3545
|
}
|
|
3315
3546
|
};
|
|
3316
3547
|
const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
|
|
3317
|
-
return /* @__PURE__ */ (0,
|
|
3318
|
-
helper && /* @__PURE__ */ (0,
|
|
3319
|
-
/* @__PURE__ */ (0,
|
|
3320
|
-
/* @__PURE__ */ (0,
|
|
3548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
3549
|
+
helper && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-secondary", children: helper }),
|
|
3551
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
|
|
3321
3552
|
] }),
|
|
3322
|
-
hasAccountLists && /* @__PURE__ */ (0,
|
|
3553
|
+
hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3323
3554
|
SegmentedControl,
|
|
3324
3555
|
{
|
|
3325
3556
|
"aria-label": "Add from",
|
|
@@ -3332,11 +3563,11 @@ function SelectionPicker({
|
|
|
3332
3563
|
]
|
|
3333
3564
|
}
|
|
3334
3565
|
),
|
|
3335
|
-
source === "search" && /* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3337
|
-
/* @__PURE__ */ (0,
|
|
3338
|
-
/* @__PURE__ */ (0,
|
|
3339
|
-
/* @__PURE__ */ (0,
|
|
3566
|
+
source === "search" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3568
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex h-8 min-w-50 flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
|
|
3569
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3340
3571
|
"input",
|
|
3341
3572
|
{
|
|
3342
3573
|
value: query,
|
|
@@ -3352,7 +3583,7 @@ function SelectionPicker({
|
|
|
3352
3583
|
}
|
|
3353
3584
|
)
|
|
3354
3585
|
] }),
|
|
3355
|
-
filters.map((f) => /* @__PURE__ */ (0,
|
|
3586
|
+
filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3356
3587
|
FilterDropdown,
|
|
3357
3588
|
{
|
|
3358
3589
|
filter: f,
|
|
@@ -3364,14 +3595,14 @@ function SelectionPicker({
|
|
|
3364
3595
|
)),
|
|
3365
3596
|
toolbarExtra
|
|
3366
3597
|
] }),
|
|
3367
|
-
!hasSearched ? /* @__PURE__ */ (0,
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3370
|
-
/* @__PURE__ */ (0,
|
|
3371
|
-
/* @__PURE__ */ (0,
|
|
3598
|
+
!hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3600
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
|
|
3602
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
|
|
3372
3603
|
] })
|
|
3373
|
-
] }) : /* @__PURE__ */ (0,
|
|
3374
|
-
/* @__PURE__ */ (0,
|
|
3604
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3375
3606
|
"div",
|
|
3376
3607
|
{
|
|
3377
3608
|
className: cn(
|
|
@@ -3379,7 +3610,7 @@ function SelectionPicker({
|
|
|
3379
3610
|
rowGridCols
|
|
3380
3611
|
),
|
|
3381
3612
|
children: [
|
|
3382
|
-
/* @__PURE__ */ (0,
|
|
3613
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3383
3614
|
CheckBox,
|
|
3384
3615
|
{
|
|
3385
3616
|
checked: allSelected,
|
|
@@ -3390,18 +3621,18 @@ function SelectionPicker({
|
|
|
3390
3621
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
|
|
3391
3622
|
}
|
|
3392
3623
|
),
|
|
3393
|
-
/* @__PURE__ */ (0,
|
|
3394
|
-
showInfoColumn && /* @__PURE__ */ (0,
|
|
3624
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
|
|
3625
|
+
showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-right", children: "Info" })
|
|
3395
3626
|
]
|
|
3396
3627
|
}
|
|
3397
3628
|
),
|
|
3398
|
-
/* @__PURE__ */ (0,
|
|
3629
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
|
|
3399
3630
|
const isSel = selectedIds.has(row.id);
|
|
3400
3631
|
const isLocked = lockedIds?.has(row.id) ?? false;
|
|
3401
3632
|
const kids = getChildren?.(row);
|
|
3402
3633
|
const isOpen = expanded.has(row.id);
|
|
3403
|
-
return /* @__PURE__ */ (0,
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
|
|
3635
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3405
3636
|
"div",
|
|
3406
3637
|
{
|
|
3407
3638
|
onClick: isLocked ? void 0 : () => toggleRow(row),
|
|
@@ -3414,7 +3645,7 @@ function SelectionPicker({
|
|
|
3414
3645
|
!isLocked && isSel && "opacity-70"
|
|
3415
3646
|
),
|
|
3416
3647
|
children: [
|
|
3417
|
-
isLocked ? /* @__PURE__ */ (0,
|
|
3648
|
+
isLocked ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3418
3649
|
CheckBox,
|
|
3419
3650
|
{
|
|
3420
3651
|
checked: isSel,
|
|
@@ -3423,8 +3654,8 @@ function SelectionPicker({
|
|
|
3423
3654
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
|
|
3424
3655
|
}
|
|
3425
3656
|
),
|
|
3426
|
-
/* @__PURE__ */ (0,
|
|
3427
|
-
showInfoColumn && /* @__PURE__ */ (0,
|
|
3657
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
|
|
3658
|
+
showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3428
3659
|
"button",
|
|
3429
3660
|
{
|
|
3430
3661
|
type: "button",
|
|
@@ -3438,28 +3669,28 @@ function SelectionPicker({
|
|
|
3438
3669
|
});
|
|
3439
3670
|
},
|
|
3440
3671
|
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",
|
|
3441
|
-
children: /* @__PURE__ */ (0,
|
|
3672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronRight, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3442
3673
|
}
|
|
3443
|
-
) : /* @__PURE__ */ (0,
|
|
3674
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3444
3675
|
"span",
|
|
3445
3676
|
{
|
|
3446
3677
|
className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
|
|
3447
3678
|
title: "No additional details",
|
|
3448
|
-
children: /* @__PURE__ */ (0,
|
|
3679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Info, { size: 14 })
|
|
3449
3680
|
}
|
|
3450
3681
|
) })
|
|
3451
3682
|
]
|
|
3452
3683
|
}
|
|
3453
3684
|
),
|
|
3454
|
-
isOpen && kids && /* @__PURE__ */ (0,
|
|
3685
|
+
isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
|
|
3455
3686
|
const kidSel = selectedIds.has(kid.id);
|
|
3456
|
-
return /* @__PURE__ */ (0,
|
|
3687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3457
3688
|
"div",
|
|
3458
3689
|
{
|
|
3459
3690
|
className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
|
|
3460
3691
|
children: [
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3462
|
-
/* @__PURE__ */ (0,
|
|
3692
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
|
|
3693
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3463
3694
|
"button",
|
|
3464
3695
|
{
|
|
3465
3696
|
type: "button",
|
|
@@ -3470,7 +3701,7 @@ function SelectionPicker({
|
|
|
3470
3701
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3471
3702
|
),
|
|
3472
3703
|
children: [
|
|
3473
|
-
kidSel ? /* @__PURE__ */ (0,
|
|
3704
|
+
kidSel ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Plus, { size: 13 }),
|
|
3474
3705
|
kidSel ? "Added" : "Add"
|
|
3475
3706
|
]
|
|
3476
3707
|
}
|
|
@@ -3482,7 +3713,7 @@ function SelectionPicker({
|
|
|
3482
3713
|
}) })
|
|
3483
3714
|
] }, row.id);
|
|
3484
3715
|
}) }),
|
|
3485
|
-
!loading && !error && hasMore && /* @__PURE__ */ (0,
|
|
3716
|
+
!loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3486
3717
|
"button",
|
|
3487
3718
|
{
|
|
3488
3719
|
type: "button",
|
|
@@ -3491,19 +3722,19 @@ function SelectionPicker({
|
|
|
3491
3722
|
"data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
|
|
3492
3723
|
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",
|
|
3493
3724
|
children: [
|
|
3494
|
-
loadingMore ? /* @__PURE__ */ (0,
|
|
3725
|
+
loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
|
|
3495
3726
|
loadingMore ? "Loading\u2026" : "Load more"
|
|
3496
3727
|
]
|
|
3497
3728
|
}
|
|
3498
3729
|
)
|
|
3499
3730
|
] })
|
|
3500
3731
|
] }),
|
|
3501
|
-
source === "lists" && /* @__PURE__ */ (0,
|
|
3502
|
-
/* @__PURE__ */ (0,
|
|
3503
|
-
accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0,
|
|
3504
|
-
/* @__PURE__ */ (0,
|
|
3732
|
+
source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
|
|
3734
|
+
accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
|
|
3505
3736
|
const on = (selectedListIds ?? []).includes(list.id);
|
|
3506
|
-
return /* @__PURE__ */ (0,
|
|
3737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3507
3738
|
"button",
|
|
3508
3739
|
{
|
|
3509
3740
|
type: "button",
|
|
@@ -3515,19 +3746,19 @@ function SelectionPicker({
|
|
|
3515
3746
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3516
3747
|
),
|
|
3517
3748
|
children: [
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
3749
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3519
3750
|
"span",
|
|
3520
3751
|
{
|
|
3521
3752
|
className: cn(
|
|
3522
3753
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
3523
3754
|
on ? "text-brand-primaryAction" : "text-text-secondary"
|
|
3524
3755
|
),
|
|
3525
|
-
children: on ? /* @__PURE__ */ (0,
|
|
3756
|
+
children: on ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Plus, { size: 16 })
|
|
3526
3757
|
}
|
|
3527
3758
|
),
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3529
|
-
/* @__PURE__ */ (0,
|
|
3530
|
-
/* @__PURE__ */ (0,
|
|
3759
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
3760
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
|
|
3761
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "block truncate text-xs text-text-secondary", children: [
|
|
3531
3762
|
list.count,
|
|
3532
3763
|
" accounts \xB7 ",
|
|
3533
3764
|
list.entityTypes.join(", "),
|
|
@@ -3535,13 +3766,13 @@ function SelectionPicker({
|
|
|
3535
3766
|
formatListDate(list.updatedAt)
|
|
3536
3767
|
] })
|
|
3537
3768
|
] }),
|
|
3538
|
-
/* @__PURE__ */ (0,
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
|
|
3539
3770
|
]
|
|
3540
3771
|
},
|
|
3541
3772
|
list.id
|
|
3542
3773
|
);
|
|
3543
3774
|
}) }),
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3775
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3545
3776
|
"p",
|
|
3546
3777
|
{
|
|
3547
3778
|
className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
|
|
@@ -3553,11 +3784,11 @@ function SelectionPicker({
|
|
|
3553
3784
|
]
|
|
3554
3785
|
}
|
|
3555
3786
|
)
|
|
3556
|
-
] }) : /* @__PURE__ */ (0,
|
|
3557
|
-
/* @__PURE__ */ (0,
|
|
3558
|
-
/* @__PURE__ */ (0,
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
3560
|
-
/* @__PURE__ */ (0,
|
|
3787
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3788
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3789
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
|
|
3561
3792
|
] })
|
|
3562
3793
|
] })
|
|
3563
3794
|
] })
|
|
@@ -3565,16 +3796,16 @@ function SelectionPicker({
|
|
|
3565
3796
|
}
|
|
3566
3797
|
var EDGE_FADE = 44;
|
|
3567
3798
|
function ScrollFade({ className, children }) {
|
|
3568
|
-
const elRef = (0,
|
|
3569
|
-
const [edges, setEdges] = (0,
|
|
3570
|
-
const sync = (0,
|
|
3799
|
+
const elRef = (0, import_react17.useRef)(null);
|
|
3800
|
+
const [edges, setEdges] = (0, import_react17.useState)({ top: false, bottom: false });
|
|
3801
|
+
const sync = (0, import_react17.useCallback)(() => {
|
|
3571
3802
|
const el = elRef.current;
|
|
3572
3803
|
if (!el) return;
|
|
3573
3804
|
const top = el.scrollTop > 2;
|
|
3574
3805
|
const bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 2;
|
|
3575
3806
|
setEdges((prev) => prev.top === top && prev.bottom === bottom ? prev : { top, bottom });
|
|
3576
3807
|
}, []);
|
|
3577
|
-
const attach = (0,
|
|
3808
|
+
const attach = (0, import_react17.useCallback)(
|
|
3578
3809
|
(el) => {
|
|
3579
3810
|
elRef.current = el;
|
|
3580
3811
|
if (!el) return;
|
|
@@ -3589,7 +3820,7 @@ function ScrollFade({ className, children }) {
|
|
|
3589
3820
|
[sync]
|
|
3590
3821
|
);
|
|
3591
3822
|
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;
|
|
3592
|
-
return /* @__PURE__ */ (0,
|
|
3823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
|
|
3593
3824
|
}
|
|
3594
3825
|
function formatListDate(iso) {
|
|
3595
3826
|
try {
|
|
@@ -3604,19 +3835,19 @@ function FilterDropdown({
|
|
|
3604
3835
|
onToggle,
|
|
3605
3836
|
testIdPrefix
|
|
3606
3837
|
}) {
|
|
3607
|
-
const [open, setOpen] = (0,
|
|
3608
|
-
const [q, setQ] = (0,
|
|
3609
|
-
const btnRef = (0,
|
|
3610
|
-
const menuRef = (0,
|
|
3611
|
-
const [pos, setPos] = (0,
|
|
3838
|
+
const [open, setOpen] = (0, import_react17.useState)(false);
|
|
3839
|
+
const [q, setQ] = (0, import_react17.useState)("");
|
|
3840
|
+
const btnRef = (0, import_react17.useRef)(null);
|
|
3841
|
+
const menuRef = (0, import_react17.useRef)(null);
|
|
3842
|
+
const [pos, setPos] = (0, import_react17.useState)(null);
|
|
3612
3843
|
const searchable = filter.options.length > 8;
|
|
3613
3844
|
const shownOptions = searchable && q.trim() ? filter.options.filter((o) => o.toLowerCase().includes(q.trim().toLowerCase())) : filter.options;
|
|
3614
|
-
(0,
|
|
3845
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
3615
3846
|
if (!open || !btnRef.current) return;
|
|
3616
3847
|
const r = btnRef.current.getBoundingClientRect();
|
|
3617
3848
|
setPos({ top: r.bottom + 6, left: r.left });
|
|
3618
3849
|
}, [open]);
|
|
3619
|
-
(0,
|
|
3850
|
+
(0, import_react17.useEffect)(() => {
|
|
3620
3851
|
if (!open) {
|
|
3621
3852
|
setQ("");
|
|
3622
3853
|
return;
|
|
@@ -3639,8 +3870,8 @@ function FilterDropdown({
|
|
|
3639
3870
|
const count = active.size;
|
|
3640
3871
|
const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
|
|
3641
3872
|
const filterSlug = slug5(filter.label);
|
|
3642
|
-
return /* @__PURE__ */ (0,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
3874
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3644
3875
|
"button",
|
|
3645
3876
|
{
|
|
3646
3877
|
ref: btnRef,
|
|
@@ -3651,12 +3882,12 @@ function FilterDropdown({
|
|
|
3651
3882
|
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",
|
|
3652
3883
|
children: [
|
|
3653
3884
|
label,
|
|
3654
|
-
/* @__PURE__ */ (0,
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
3655
3886
|
]
|
|
3656
3887
|
}
|
|
3657
3888
|
),
|
|
3658
3889
|
open && pos && (0, import_react_dom4.createPortal)(
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
3890
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3660
3891
|
"div",
|
|
3661
3892
|
{
|
|
3662
3893
|
ref: menuRef,
|
|
@@ -3665,9 +3896,9 @@ function FilterDropdown({
|
|
|
3665
3896
|
style: { top: pos.top, left: pos.left },
|
|
3666
3897
|
className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
3667
3898
|
children: [
|
|
3668
|
-
searchable && /* @__PURE__ */ (0,
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
3899
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
|
|
3900
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
3901
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3671
3902
|
"input",
|
|
3672
3903
|
{
|
|
3673
3904
|
autoFocus: true,
|
|
@@ -3678,14 +3909,14 @@ function FilterDropdown({
|
|
|
3678
3909
|
}
|
|
3679
3910
|
)
|
|
3680
3911
|
] }),
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3912
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
|
|
3682
3913
|
const on = active.has(opt);
|
|
3683
|
-
return /* @__PURE__ */ (0,
|
|
3914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3684
3915
|
"label",
|
|
3685
3916
|
{
|
|
3686
3917
|
className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
|
|
3687
3918
|
children: [
|
|
3688
|
-
/* @__PURE__ */ (0,
|
|
3919
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3689
3920
|
CheckBox,
|
|
3690
3921
|
{
|
|
3691
3922
|
checked: on,
|
|
@@ -3715,8 +3946,8 @@ function gridForColumns(columns) {
|
|
|
3715
3946
|
}
|
|
3716
3947
|
|
|
3717
3948
|
// src/PublisherBreakdownList.tsx
|
|
3718
|
-
var
|
|
3719
|
-
var
|
|
3949
|
+
var import_react18 = require("react");
|
|
3950
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3720
3951
|
var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
|
|
3721
3952
|
function priorYearAmt(spendN, yoy) {
|
|
3722
3953
|
if (yoy === "NEW" || yoy <= -100) return null;
|
|
@@ -3728,7 +3959,7 @@ function initials(name) {
|
|
|
3728
3959
|
return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
|
|
3729
3960
|
}
|
|
3730
3961
|
function Monogram({ name, size = 28 }) {
|
|
3731
|
-
return /* @__PURE__ */ (0,
|
|
3962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3732
3963
|
"span",
|
|
3733
3964
|
{
|
|
3734
3965
|
"aria-hidden": "true",
|
|
@@ -3739,12 +3970,12 @@ function Monogram({ name, size = 28 }) {
|
|
|
3739
3970
|
);
|
|
3740
3971
|
}
|
|
3741
3972
|
function BreakdownTag({ children }) {
|
|
3742
|
-
return /* @__PURE__ */ (0,
|
|
3973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-micro font-medium text-text-secondary", children });
|
|
3743
3974
|
}
|
|
3744
3975
|
function DelayedTip({ label, children }) {
|
|
3745
|
-
return /* @__PURE__ */ (0,
|
|
3976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
3746
3977
|
children,
|
|
3747
|
-
/* @__PURE__ */ (0,
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3748
3979
|
"span",
|
|
3749
3980
|
{
|
|
3750
3981
|
role: "tooltip",
|
|
@@ -3758,22 +3989,22 @@ var COL_CURRENT = 76;
|
|
|
3758
3989
|
var COL_PREVIOUS = 76;
|
|
3759
3990
|
var COL_YOY = 44;
|
|
3760
3991
|
function MetricListHeader({ className }) {
|
|
3761
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
-
/* @__PURE__ */ (0,
|
|
3763
|
-
/* @__PURE__ */ (0,
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3765
|
-
/* @__PURE__ */ (0,
|
|
3766
|
-
/* @__PURE__ */ (0,
|
|
3992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
|
|
3993
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex-1" }),
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3995
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3996
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
|
|
3997
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
|
|
3767
3998
|
] })
|
|
3768
3999
|
] });
|
|
3769
4000
|
}
|
|
3770
4001
|
function MetricCells({ spendN, yoy }) {
|
|
3771
4002
|
const prior = priorYearAmt(spendN, yoy);
|
|
3772
4003
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3773
|
-
return /* @__PURE__ */ (0,
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
3776
|
-
/* @__PURE__ */ (0,
|
|
4004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
4006
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
4007
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
|
|
3777
4008
|
up ? "+" : "\u2212",
|
|
3778
4009
|
Math.abs(yoy),
|
|
3779
4010
|
"%"
|
|
@@ -3789,130 +4020,44 @@ function PublisherBreakdownList({
|
|
|
3789
4020
|
className,
|
|
3790
4021
|
testIdPrefix
|
|
3791
4022
|
}) {
|
|
3792
|
-
const [showAll, setShowAll] = (0,
|
|
4023
|
+
const [showAll, setShowAll] = (0, import_react18.useState)(false);
|
|
3793
4024
|
const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
|
|
3794
4025
|
const rowPad = padded ? "px-5" : "";
|
|
3795
|
-
return /* @__PURE__ */ (0,
|
|
3796
|
-
/* @__PURE__ */ (0,
|
|
3797
|
-
/* @__PURE__ */ (0,
|
|
3798
|
-
visible.map((p) => /* @__PURE__ */ (0,
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
3800
|
-
renderLogo ? renderLogo(p) : /* @__PURE__ */ (0,
|
|
3801
|
-
/* @__PURE__ */ (0,
|
|
3802
|
-
/* @__PURE__ */ (0,
|
|
3803
|
-
/* @__PURE__ */ (0,
|
|
3804
|
-
p.tags.map((t) => /* @__PURE__ */ (0,
|
|
4026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
4027
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", children: [
|
|
4028
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MetricListHeader, { className: rowPad }),
|
|
4029
|
+
visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
4031
|
+
renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Monogram, { name: p.brand, size: 28 }),
|
|
4032
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "min-w-0", children: [
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
4034
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
4035
|
+
p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BreakdownTag, { children: t }, t))
|
|
3805
4036
|
] }),
|
|
3806
|
-
/* @__PURE__ */ (0,
|
|
4037
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
|
|
3807
4038
|
] })
|
|
3808
4039
|
] }),
|
|
3809
|
-
/* @__PURE__ */ (0,
|
|
4040
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3810
4041
|
] }, p.brand))
|
|
3811
4042
|
] }),
|
|
3812
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0,
|
|
3813
|
-
/* @__PURE__ */ (0,
|
|
4043
|
+
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { href: viewAllHref, className: "text-xs font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
|
|
4044
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
3814
4045
|
"Showing ",
|
|
3815
4046
|
visible.length,
|
|
3816
4047
|
" of ",
|
|
3817
4048
|
rows.length
|
|
3818
4049
|
] }),
|
|
3819
|
-
!showAll ? /* @__PURE__ */ (0,
|
|
4050
|
+
!showAll ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: [
|
|
3820
4051
|
"See all (",
|
|
3821
4052
|
rows.length - defaultVisibleCount,
|
|
3822
4053
|
" more)"
|
|
3823
|
-
] }) : /* @__PURE__ */ (0,
|
|
4054
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Show less" })
|
|
3824
4055
|
] }))
|
|
3825
4056
|
] });
|
|
3826
4057
|
}
|
|
3827
4058
|
|
|
3828
|
-
// src/Button.tsx
|
|
3829
|
-
var import_react17 = require("react");
|
|
3830
|
-
var import_react_slot = require("@radix-ui/react-slot");
|
|
3831
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
3832
|
-
var import_lucide_react17 = require("lucide-react");
|
|
3833
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3834
|
-
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
3835
|
-
"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",
|
|
3836
|
-
{
|
|
3837
|
-
variants: {
|
|
3838
|
-
variant: {
|
|
3839
|
-
primary: "bg-brand-primaryAction text-brand-onprimary hover:brightness-110",
|
|
3840
|
-
// border-strong, not border-interactive. The interactive token is #6b6358
|
|
3841
|
-
// -- 5.9:1 against the surface, nearly as dark as body text -- which is
|
|
3842
|
-
// right for an input the eye must find in a form, and far too heavy for
|
|
3843
|
-
// a button sitting beside other buttons. It reads heaviest on icon-only,
|
|
3844
|
-
// where there is least fill inside the line to balance it.
|
|
3845
|
-
secondary: "bg-surface text-text-primary border border-border-strong hover:bg-subtle hover:border-border-interactive",
|
|
3846
|
-
ghost: "text-text-primary hover:bg-subtle",
|
|
3847
|
-
danger: "bg-status-danger text-status-onstatus hover:brightness-110",
|
|
3848
|
-
// Quiet destructive: neutral at rest, red only on hover. This is what
|
|
3849
|
-
// the product actually reaches for -- nearly every hand-rolled
|
|
3850
|
-
// destructive control is an icon that reddens on hover, while filled
|
|
3851
|
-
// `danger` is right only for the confirm button in a dialog the user
|
|
3852
|
-
// already opened.
|
|
3853
|
-
dangerGhost: "text-text-secondary hover:bg-subtle hover:text-text-danger",
|
|
3854
|
-
link: "text-text-link underline-offset-4 hover:underline px-0"
|
|
3855
|
-
},
|
|
3856
|
-
// Type scales with the box. One size across all three left xs cramped --
|
|
3857
|
-
// 14px inside a 24px box leaves five pixels above and below, so the label
|
|
3858
|
-
// fills the button instead of sitting in it.
|
|
3859
|
-
size: {
|
|
3860
|
-
xs: "h-6 px-2 text-xs",
|
|
3861
|
-
sm: "h-8 px-3 text-sm",
|
|
3862
|
-
md: "h-10 px-4 text-sm",
|
|
3863
|
-
// 44, the filter row's height, so a button at the end of a row of
|
|
3864
|
-
// filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
|
|
3865
|
-
lg: "h-11 px-5 text-sm"
|
|
3866
|
-
},
|
|
3867
|
-
// Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
|
|
3868
|
-
// be one dimension, so an icon button never lined up with the labelled
|
|
3869
|
-
// buttons beside it in a toolbar. As a shape it squares the box at
|
|
3870
|
-
// whichever height you picked.
|
|
3871
|
-
iconOnly: {
|
|
3872
|
-
true: "p-0",
|
|
3873
|
-
false: ""
|
|
3874
|
-
}
|
|
3875
|
-
},
|
|
3876
|
-
compoundVariants: [
|
|
3877
|
-
{ size: "xs", iconOnly: true, class: "w-6" },
|
|
3878
|
-
{ size: "sm", iconOnly: true, class: "w-8" },
|
|
3879
|
-
{ size: "md", iconOnly: true, class: "w-10" },
|
|
3880
|
-
{ size: "lg", iconOnly: true, class: "w-11" },
|
|
3881
|
-
// A boxed button is a target you aim at, so its label carries the weight
|
|
3882
|
-
// of one. `link` sits inline in a sentence, where semibold reads as
|
|
3883
|
-
// emphasis on the words rather than as a control.
|
|
3884
|
-
{ variant: ["primary", "secondary", "ghost", "danger", "dangerGhost"], class: "font-semibold" },
|
|
3885
|
-
{ variant: "link", class: "font-medium h-auto p-0" }
|
|
3886
|
-
],
|
|
3887
|
-
defaultVariants: {
|
|
3888
|
-
variant: "primary",
|
|
3889
|
-
size: "md",
|
|
3890
|
-
iconOnly: false
|
|
3891
|
-
}
|
|
3892
|
-
}
|
|
3893
|
-
);
|
|
3894
|
-
var Button = (0, import_react17.forwardRef)(
|
|
3895
|
-
({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
|
|
3896
|
-
const shared = {
|
|
3897
|
-
className: cn(buttonVariants({ variant, size, iconOnly, className })),
|
|
3898
|
-
"data-testid": testIdPrefix,
|
|
3899
|
-
disabled: disabled || loading,
|
|
3900
|
-
"aria-busy": loading || void 0,
|
|
3901
|
-
...props
|
|
3902
|
-
};
|
|
3903
|
-
if (asChild) {
|
|
3904
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_slot.Slot, { ref, ...shared, children });
|
|
3905
|
-
}
|
|
3906
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { ref, ...shared, children: [
|
|
3907
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
3908
|
-
children
|
|
3909
|
-
] });
|
|
3910
|
-
}
|
|
3911
|
-
);
|
|
3912
|
-
Button.displayName = "Button";
|
|
3913
|
-
|
|
3914
4059
|
// src/FilterDropdownFooter.tsx
|
|
3915
|
-
var
|
|
4060
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3916
4061
|
function FilterDropdownFooter({
|
|
3917
4062
|
onClear,
|
|
3918
4063
|
onApply,
|
|
@@ -3921,7 +4066,7 @@ function FilterDropdownFooter({
|
|
|
3921
4066
|
className,
|
|
3922
4067
|
testIdPrefix
|
|
3923
4068
|
}) {
|
|
3924
|
-
return /* @__PURE__ */ (0,
|
|
4069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3925
4070
|
"div",
|
|
3926
4071
|
{
|
|
3927
4072
|
className: cn(
|
|
@@ -3931,17 +4076,17 @@ function FilterDropdownFooter({
|
|
|
3931
4076
|
),
|
|
3932
4077
|
"data-testid": testIdPrefix,
|
|
3933
4078
|
children: [
|
|
3934
|
-
onClear && /* @__PURE__ */ (0,
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
4079
|
+
onClear && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
|
|
3936
4081
|
]
|
|
3937
4082
|
}
|
|
3938
4083
|
);
|
|
3939
4084
|
}
|
|
3940
4085
|
|
|
3941
4086
|
// src/NameListModal.tsx
|
|
3942
|
-
var
|
|
4087
|
+
var import_react19 = require("react");
|
|
3943
4088
|
var import_react_dom5 = require("react-dom");
|
|
3944
|
-
var
|
|
4089
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3945
4090
|
function NameListModal({
|
|
3946
4091
|
title,
|
|
3947
4092
|
initialName,
|
|
@@ -3954,21 +4099,21 @@ function NameListModal({
|
|
|
3954
4099
|
className,
|
|
3955
4100
|
testIdPrefix
|
|
3956
4101
|
}) {
|
|
3957
|
-
const [name, setName] = (0,
|
|
3958
|
-
const [checked, setChecked] = (0,
|
|
4102
|
+
const [name, setName] = (0, import_react19.useState)(initialName);
|
|
4103
|
+
const [checked, setChecked] = (0, import_react19.useState)(
|
|
3959
4104
|
() => Object.fromEntries((options ?? []).map((o) => [o.key, !!o.initial]))
|
|
3960
4105
|
);
|
|
3961
4106
|
const toggle = (key) => setChecked((c) => ({ ...c, [key]: !c[key] }));
|
|
3962
|
-
const dialogRef = (0,
|
|
3963
|
-
const titleId = (0,
|
|
3964
|
-
const fieldId = (0,
|
|
3965
|
-
(0,
|
|
4107
|
+
const dialogRef = (0, import_react19.useRef)(null);
|
|
4108
|
+
const titleId = (0, import_react19.useId)();
|
|
4109
|
+
const fieldId = (0, import_react19.useId)();
|
|
4110
|
+
(0, import_react19.useEffect)(() => {
|
|
3966
4111
|
const onKey = (e) => e.key === "Escape" && onCancel();
|
|
3967
4112
|
window.addEventListener("keydown", onKey);
|
|
3968
4113
|
return () => window.removeEventListener("keydown", onKey);
|
|
3969
4114
|
}, [onCancel]);
|
|
3970
|
-
const [opener] = (0,
|
|
3971
|
-
(0,
|
|
4115
|
+
const [opener] = (0, import_react19.useState)(() => typeof document === "undefined" ? null : document.activeElement);
|
|
4116
|
+
(0, import_react19.useEffect)(
|
|
3972
4117
|
() => () => {
|
|
3973
4118
|
const active = document.activeElement;
|
|
3974
4119
|
if (!active || active === document.body) opener?.focus?.();
|
|
@@ -3995,12 +4140,12 @@ function NameListModal({
|
|
|
3995
4140
|
// bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
|
|
3996
4141
|
// No in-data-[theme=dark] override needed any more -- the token redefines
|
|
3997
4142
|
// itself under that attribute in dark.css, so one class covers both themes.
|
|
3998
|
-
/* @__PURE__ */ (0,
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3999
4144
|
"div",
|
|
4000
4145
|
{
|
|
4001
4146
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
|
|
4002
4147
|
onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
|
|
4003
|
-
children: /* @__PURE__ */ (0,
|
|
4148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
4004
4149
|
"div",
|
|
4005
4150
|
{
|
|
4006
4151
|
ref: dialogRef,
|
|
@@ -4011,10 +4156,10 @@ function NameListModal({
|
|
|
4011
4156
|
"data-testid": testIdPrefix,
|
|
4012
4157
|
className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
|
|
4013
4158
|
children: [
|
|
4014
|
-
/* @__PURE__ */ (0,
|
|
4015
|
-
/* @__PURE__ */ (0,
|
|
4016
|
-
/* @__PURE__ */ (0,
|
|
4017
|
-
/* @__PURE__ */ (0,
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4018
4163
|
"input",
|
|
4019
4164
|
{
|
|
4020
4165
|
id: fieldId,
|
|
@@ -4026,13 +4171,13 @@ function NameListModal({
|
|
|
4026
4171
|
}
|
|
4027
4172
|
)
|
|
4028
4173
|
] }),
|
|
4029
|
-
options && options.length > 0 && /* @__PURE__ */ (0,
|
|
4030
|
-
/* @__PURE__ */ (0,
|
|
4174
|
+
options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
4031
4176
|
o.label
|
|
4032
4177
|
] }, o.key)) }),
|
|
4033
|
-
/* @__PURE__ */ (0,
|
|
4034
|
-
/* @__PURE__ */ (0,
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
4180
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
|
|
4036
4181
|
] })
|
|
4037
4182
|
]
|
|
4038
4183
|
}
|
|
@@ -4045,11 +4190,11 @@ function NameListModal({
|
|
|
4045
4190
|
|
|
4046
4191
|
// src/FilterChipBar.tsx
|
|
4047
4192
|
var import_lucide_react18 = require("lucide-react");
|
|
4048
|
-
var
|
|
4193
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4049
4194
|
function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
|
|
4050
4195
|
if (chips.length === 0) return null;
|
|
4051
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
-
chips.map((c) => /* @__PURE__ */ (0,
|
|
4196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
|
|
4197
|
+
chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4053
4198
|
Chip,
|
|
4054
4199
|
{
|
|
4055
4200
|
label: c.label,
|
|
@@ -4059,7 +4204,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
4059
4204
|
},
|
|
4060
4205
|
c.key
|
|
4061
4206
|
)),
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4207
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4063
4208
|
"button",
|
|
4064
4209
|
{
|
|
4065
4210
|
type: "button",
|
|
@@ -4076,8 +4221,8 @@ function Chip({
|
|
|
4076
4221
|
parked,
|
|
4077
4222
|
onRemove
|
|
4078
4223
|
}) {
|
|
4079
|
-
return /* @__PURE__ */ (0,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "group relative inline-flex", children: [
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4081
4226
|
"span",
|
|
4082
4227
|
{
|
|
4083
4228
|
className: cn(
|
|
@@ -4089,22 +4234,22 @@ function Chip({
|
|
|
4089
4234
|
) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
|
|
4090
4235
|
),
|
|
4091
4236
|
children: [
|
|
4092
|
-
parked && /* @__PURE__ */ (0,
|
|
4237
|
+
parked && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
4093
4238
|
label,
|
|
4094
|
-
/* @__PURE__ */ (0,
|
|
4239
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4095
4240
|
"button",
|
|
4096
4241
|
{
|
|
4097
4242
|
type: "button",
|
|
4098
4243
|
onClick: onRemove,
|
|
4099
4244
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
4100
4245
|
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",
|
|
4101
|
-
children: /* @__PURE__ */ (0,
|
|
4246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.X, { size: 12 })
|
|
4102
4247
|
}
|
|
4103
4248
|
)
|
|
4104
4249
|
]
|
|
4105
4250
|
}
|
|
4106
4251
|
),
|
|
4107
|
-
/* @__PURE__ */ (0,
|
|
4252
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4108
4253
|
"span",
|
|
4109
4254
|
{
|
|
4110
4255
|
role: "tooltip",
|
|
@@ -4116,15 +4261,15 @@ function Chip({
|
|
|
4116
4261
|
}
|
|
4117
4262
|
|
|
4118
4263
|
// src/SortButton.tsx
|
|
4119
|
-
var
|
|
4264
|
+
var import_react20 = require("react");
|
|
4120
4265
|
var import_lucide_react19 = require("lucide-react");
|
|
4121
|
-
var
|
|
4266
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4122
4267
|
var ALIGN = {
|
|
4123
4268
|
left: "justify-start text-left",
|
|
4124
4269
|
center: "justify-center text-center",
|
|
4125
4270
|
right: "justify-end text-right"
|
|
4126
4271
|
};
|
|
4127
|
-
var SortButton = (0,
|
|
4272
|
+
var SortButton = (0, import_react20.forwardRef)(
|
|
4128
4273
|
function SortButton2({
|
|
4129
4274
|
label,
|
|
4130
4275
|
sortKey,
|
|
@@ -4137,15 +4282,15 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4137
4282
|
className,
|
|
4138
4283
|
testIdPrefix
|
|
4139
4284
|
}, ref) {
|
|
4140
|
-
const own = (0,
|
|
4141
|
-
(0,
|
|
4142
|
-
const text = description ? /* @__PURE__ */ (0,
|
|
4285
|
+
const own = (0, import_react20.useRef)(null);
|
|
4286
|
+
(0, import_react20.useImperativeHandle)(ref, () => own.current);
|
|
4287
|
+
const text = description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: DESCRIBED, children: label }) : label;
|
|
4143
4288
|
if (!sortable) {
|
|
4144
|
-
const plain = /* @__PURE__ */ (0,
|
|
4145
|
-
return description ? /* @__PURE__ */ (0,
|
|
4289
|
+
const plain = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("inline-flex", ALIGN[align], className), children: text });
|
|
4290
|
+
return description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(HeaderTip, { description, children: plain }) : plain;
|
|
4146
4291
|
}
|
|
4147
4292
|
const active = !disabled && sort.key === sortKey;
|
|
4148
|
-
const button = /* @__PURE__ */ (0,
|
|
4293
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4149
4294
|
"button",
|
|
4150
4295
|
{
|
|
4151
4296
|
ref: own,
|
|
@@ -4176,7 +4321,7 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4176
4321
|
),
|
|
4177
4322
|
children: [
|
|
4178
4323
|
text,
|
|
4179
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0,
|
|
4324
|
+
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react19.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react19.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4180
4325
|
import_lucide_react19.ArrowUpDown,
|
|
4181
4326
|
{
|
|
4182
4327
|
size: 12,
|
|
@@ -4187,16 +4332,16 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4187
4332
|
]
|
|
4188
4333
|
}
|
|
4189
4334
|
);
|
|
4190
|
-
return /* @__PURE__ */ (0,
|
|
4335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
4191
4336
|
button,
|
|
4192
|
-
description && /* @__PURE__ */ (0,
|
|
4337
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tooltip, { anchorRef: own, label: description, delay: 300, placement: "top" })
|
|
4193
4338
|
] });
|
|
4194
4339
|
}
|
|
4195
4340
|
);
|
|
4196
4341
|
SortButton.displayName = "SortButton";
|
|
4197
4342
|
var DESCRIBED = "underline decoration-dotted decoration-1 decoration-text-tertiary underline-offset-4";
|
|
4198
4343
|
function HeaderTip({ description, children }) {
|
|
4199
|
-
return /* @__PURE__ */ (0,
|
|
4344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tooltip, { label: description, delay: 300, className: "inline-flex rounded-xs focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { tabIndex: 0, children }) });
|
|
4200
4345
|
}
|
|
4201
4346
|
|
|
4202
4347
|
// src/tableSort.ts
|
|
@@ -4215,7 +4360,7 @@ function ariaSortFor(sort, key) {
|
|
|
4215
4360
|
|
|
4216
4361
|
// src/Pager.tsx
|
|
4217
4362
|
var import_lucide_react20 = require("lucide-react");
|
|
4218
|
-
var
|
|
4363
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4219
4364
|
function pageWindow(current, total) {
|
|
4220
4365
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
4221
4366
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -4231,8 +4376,8 @@ function pageWindow(current, total) {
|
|
|
4231
4376
|
}
|
|
4232
4377
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
4233
4378
|
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";
|
|
4234
|
-
return /* @__PURE__ */ (0,
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
4379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4380
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4236
4381
|
"button",
|
|
4237
4382
|
{
|
|
4238
4383
|
type: "button",
|
|
@@ -4240,11 +4385,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4240
4385
|
disabled: disabled || page === 1,
|
|
4241
4386
|
"aria-label": "Previous page",
|
|
4242
4387
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4243
|
-
children: /* @__PURE__ */ (0,
|
|
4388
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.ChevronLeft, { size: 16 })
|
|
4244
4389
|
}
|
|
4245
4390
|
),
|
|
4246
4391
|
pageWindow(page, totalPages).map(
|
|
4247
|
-
(p) => typeof p === "string" ? /* @__PURE__ */ (0,
|
|
4392
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4248
4393
|
"button",
|
|
4249
4394
|
{
|
|
4250
4395
|
type: "button",
|
|
@@ -4260,7 +4405,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4260
4405
|
p
|
|
4261
4406
|
)
|
|
4262
4407
|
),
|
|
4263
|
-
/* @__PURE__ */ (0,
|
|
4408
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4264
4409
|
"button",
|
|
4265
4410
|
{
|
|
4266
4411
|
type: "button",
|
|
@@ -4268,14 +4413,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4268
4413
|
disabled: disabled || page === totalPages,
|
|
4269
4414
|
"aria-label": "Next page",
|
|
4270
4415
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4271
|
-
children: /* @__PURE__ */ (0,
|
|
4416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.ChevronRight, { size: 16 })
|
|
4272
4417
|
}
|
|
4273
4418
|
)
|
|
4274
4419
|
] });
|
|
4275
4420
|
}
|
|
4276
4421
|
|
|
4277
4422
|
// src/WorkspaceAvatar.tsx
|
|
4278
|
-
var
|
|
4423
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4279
4424
|
function workspaceInitials(name) {
|
|
4280
4425
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
4281
4426
|
if (words.length === 0) return "\xB7";
|
|
@@ -4294,7 +4439,7 @@ var SIZES = {
|
|
|
4294
4439
|
lg: "h-11 w-11 text-panel-title"
|
|
4295
4440
|
};
|
|
4296
4441
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
4297
|
-
return /* @__PURE__ */ (0,
|
|
4442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4298
4443
|
"span",
|
|
4299
4444
|
{
|
|
4300
4445
|
"aria-hidden": "true",
|
|
@@ -4310,20 +4455,20 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
4310
4455
|
}
|
|
4311
4456
|
|
|
4312
4457
|
// src/Toast.tsx
|
|
4313
|
-
var
|
|
4458
|
+
var import_react21 = require("react");
|
|
4314
4459
|
var import_react_dom6 = require("react-dom");
|
|
4315
4460
|
var import_lucide_react21 = require("lucide-react");
|
|
4316
|
-
var
|
|
4461
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4317
4462
|
var ICON = {
|
|
4318
4463
|
neutral: null,
|
|
4319
|
-
success: /* @__PURE__ */ (0,
|
|
4320
|
-
warning: /* @__PURE__ */ (0,
|
|
4464
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react21.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
|
|
4465
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react21.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
|
|
4321
4466
|
};
|
|
4322
4467
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4323
4468
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
4324
|
-
const [paused, setPaused] = (0,
|
|
4325
|
-
const closed = (0,
|
|
4326
|
-
(0,
|
|
4469
|
+
const [paused, setPaused] = (0, import_react21.useState)(false);
|
|
4470
|
+
const closed = (0, import_react21.useRef)(false);
|
|
4471
|
+
(0, import_react21.useEffect)(() => {
|
|
4327
4472
|
if (paused) return;
|
|
4328
4473
|
const t = window.setTimeout(() => {
|
|
4329
4474
|
if (closed.current) return;
|
|
@@ -4333,7 +4478,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4333
4478
|
return () => window.clearTimeout(t);
|
|
4334
4479
|
}, [message, ms, paused]);
|
|
4335
4480
|
return (0, import_react_dom6.createPortal)(
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4481
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
4337
4482
|
"div",
|
|
4338
4483
|
{
|
|
4339
4484
|
role: "status",
|
|
@@ -4351,7 +4496,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4351
4496
|
children: [
|
|
4352
4497
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4353
4498
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4354
|
-
/* @__PURE__ */ (0,
|
|
4499
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4355
4500
|
"span",
|
|
4356
4501
|
{
|
|
4357
4502
|
className: cn(
|
|
@@ -4361,8 +4506,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4361
4506
|
children: ICON[tone]
|
|
4362
4507
|
}
|
|
4363
4508
|
),
|
|
4364
|
-
/* @__PURE__ */ (0,
|
|
4365
|
-
action && /* @__PURE__ */ (0,
|
|
4509
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "min-w-0", children: message }),
|
|
4510
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4366
4511
|
"button",
|
|
4367
4512
|
{
|
|
4368
4513
|
type: "button",
|
|
@@ -4384,14 +4529,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4384
4529
|
}
|
|
4385
4530
|
|
|
4386
4531
|
// src/Tag.tsx
|
|
4387
|
-
var
|
|
4532
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4388
4533
|
function Tag({ children, className, testIdPrefix }) {
|
|
4389
|
-
return /* @__PURE__ */ (0,
|
|
4534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4390
4535
|
}
|
|
4391
4536
|
|
|
4392
4537
|
// src/TablePagination.tsx
|
|
4393
4538
|
var import_lucide_react22 = require("lucide-react");
|
|
4394
|
-
var
|
|
4539
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4395
4540
|
function TablePagination({
|
|
4396
4541
|
page,
|
|
4397
4542
|
perPage,
|
|
@@ -4411,7 +4556,7 @@ function TablePagination({
|
|
|
4411
4556
|
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";
|
|
4412
4557
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4413
4558
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4414
|
-
const range = /* @__PURE__ */ (0,
|
|
4559
|
+
const range = /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4415
4560
|
rangeStart.toLocaleString(),
|
|
4416
4561
|
" \u2013 ",
|
|
4417
4562
|
rangeEnd.toLocaleString(),
|
|
@@ -4420,13 +4565,13 @@ function TablePagination({
|
|
|
4420
4565
|
" ",
|
|
4421
4566
|
itemLabel
|
|
4422
4567
|
] });
|
|
4423
|
-
return /* @__PURE__ */ (0,
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4425
4570
|
"div",
|
|
4426
4571
|
{
|
|
4427
4572
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4428
4573
|
children: [
|
|
4429
|
-
/* @__PURE__ */ (0,
|
|
4574
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4430
4575
|
SelectFilter,
|
|
4431
4576
|
{
|
|
4432
4577
|
size: "sm",
|
|
@@ -4442,8 +4587,8 @@ function TablePagination({
|
|
|
4442
4587
|
]
|
|
4443
4588
|
}
|
|
4444
4589
|
),
|
|
4445
|
-
/* @__PURE__ */ (0,
|
|
4446
|
-
/* @__PURE__ */ (0,
|
|
4590
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4591
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4447
4592
|
"button",
|
|
4448
4593
|
{
|
|
4449
4594
|
type: "button",
|
|
@@ -4452,10 +4597,10 @@ function TablePagination({
|
|
|
4452
4597
|
"aria-label": "First page",
|
|
4453
4598
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4454
4599
|
className: stepBtn,
|
|
4455
|
-
children: /* @__PURE__ */ (0,
|
|
4600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4456
4601
|
}
|
|
4457
4602
|
),
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4459
4604
|
"button",
|
|
4460
4605
|
{
|
|
4461
4606
|
type: "button",
|
|
@@ -4464,11 +4609,11 @@ function TablePagination({
|
|
|
4464
4609
|
"aria-label": "Previous page",
|
|
4465
4610
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4466
4611
|
className: stepBtn,
|
|
4467
|
-
children: /* @__PURE__ */ (0,
|
|
4612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronLeft, { size: 16, "aria-hidden": "true" })
|
|
4468
4613
|
}
|
|
4469
4614
|
),
|
|
4470
4615
|
pageWindow(current, totalPages).map(
|
|
4471
|
-
(p) => typeof p === "string" ? /* @__PURE__ */ (0,
|
|
4616
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4472
4617
|
"button",
|
|
4473
4618
|
{
|
|
4474
4619
|
type: "button",
|
|
@@ -4486,7 +4631,7 @@ function TablePagination({
|
|
|
4486
4631
|
p
|
|
4487
4632
|
)
|
|
4488
4633
|
),
|
|
4489
|
-
/* @__PURE__ */ (0,
|
|
4634
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4490
4635
|
"button",
|
|
4491
4636
|
{
|
|
4492
4637
|
type: "button",
|
|
@@ -4495,10 +4640,10 @@ function TablePagination({
|
|
|
4495
4640
|
"aria-label": "Next page",
|
|
4496
4641
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4497
4642
|
className: stepBtn,
|
|
4498
|
-
children: /* @__PURE__ */ (0,
|
|
4643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronRight, { size: 16, "aria-hidden": "true" })
|
|
4499
4644
|
}
|
|
4500
4645
|
),
|
|
4501
|
-
/* @__PURE__ */ (0,
|
|
4646
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4502
4647
|
"button",
|
|
4503
4648
|
{
|
|
4504
4649
|
type: "button",
|
|
@@ -4507,7 +4652,7 @@ function TablePagination({
|
|
|
4507
4652
|
"aria-label": "Last page",
|
|
4508
4653
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4509
4654
|
className: stepBtn,
|
|
4510
|
-
children: /* @__PURE__ */ (0,
|
|
4655
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4511
4656
|
}
|
|
4512
4657
|
)
|
|
4513
4658
|
] }),
|
|
@@ -4516,9 +4661,9 @@ function TablePagination({
|
|
|
4516
4661
|
}
|
|
4517
4662
|
|
|
4518
4663
|
// src/DateRangePicker.tsx
|
|
4519
|
-
var
|
|
4664
|
+
var import_react22 = require("react");
|
|
4520
4665
|
var import_lucide_react23 = require("lucide-react");
|
|
4521
|
-
var
|
|
4666
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4522
4667
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4523
4668
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4524
4669
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4556,7 +4701,7 @@ function spanLabel2(label, today, formatDate2, formatRange) {
|
|
|
4556
4701
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4557
4702
|
}
|
|
4558
4703
|
function MiniSelect({ value, onChange, options }) {
|
|
4559
|
-
return /* @__PURE__ */ (0,
|
|
4704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4560
4705
|
"select",
|
|
4561
4706
|
{
|
|
4562
4707
|
value: String(value),
|
|
@@ -4565,7 +4710,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4565
4710
|
if (opt) onChange(opt.value);
|
|
4566
4711
|
},
|
|
4567
4712
|
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",
|
|
4568
|
-
children: options.map((o) => /* @__PURE__ */ (0,
|
|
4713
|
+
children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4569
4714
|
}
|
|
4570
4715
|
);
|
|
4571
4716
|
}
|
|
@@ -4584,19 +4729,19 @@ function DateRangePicker({
|
|
|
4584
4729
|
className,
|
|
4585
4730
|
testIdPrefix
|
|
4586
4731
|
}) {
|
|
4587
|
-
const end = (0,
|
|
4732
|
+
const end = (0, import_react22.useMemo)(() => today ?? startOfToday(), [today]);
|
|
4588
4733
|
const yearOptions = years ?? [3, 2, 1, 0].map((n) => end.getFullYear() - n);
|
|
4589
|
-
const [open, setOpen] = (0,
|
|
4590
|
-
const [value, setValue] = (0,
|
|
4591
|
-
const [draft, setDraft] = (0,
|
|
4592
|
-
const ref = (0,
|
|
4593
|
-
const [fromMo, setFromMo] = (0,
|
|
4594
|
-
const [fromYr, setFromYr] = (0,
|
|
4595
|
-
const [toMo, setToMo] = (0,
|
|
4596
|
-
const [toYr, setToYr] = (0,
|
|
4597
|
-
const [fromQ, setFromQ] = (0,
|
|
4598
|
-
const [toQ, setToQ] = (0,
|
|
4599
|
-
(0,
|
|
4734
|
+
const [open, setOpen] = (0, import_react22.useState)(false);
|
|
4735
|
+
const [value, setValue] = (0, import_react22.useState)(defaultValue);
|
|
4736
|
+
const [draft, setDraft] = (0, import_react22.useState)(defaultValue);
|
|
4737
|
+
const ref = (0, import_react22.useRef)(null);
|
|
4738
|
+
const [fromMo, setFromMo] = (0, import_react22.useState)(end.getMonth());
|
|
4739
|
+
const [fromYr, setFromYr] = (0, import_react22.useState)(end.getFullYear() - 1);
|
|
4740
|
+
const [toMo, setToMo] = (0, import_react22.useState)(end.getMonth());
|
|
4741
|
+
const [toYr, setToYr] = (0, import_react22.useState)(end.getFullYear());
|
|
4742
|
+
const [fromQ, setFromQ] = (0, import_react22.useState)(Math.floor(end.getMonth() / 3));
|
|
4743
|
+
const [toQ, setToQ] = (0, import_react22.useState)(Math.floor(end.getMonth() / 3));
|
|
4744
|
+
(0, import_react22.useEffect)(() => {
|
|
4600
4745
|
const [s, e] = resolveRange(value, end);
|
|
4601
4746
|
onRangeChange?.(s, e);
|
|
4602
4747
|
}, [value]);
|
|
@@ -4604,7 +4749,7 @@ function DateRangePicker({
|
|
|
4604
4749
|
if (!open) setDraft(value);
|
|
4605
4750
|
setOpen((o) => !o);
|
|
4606
4751
|
};
|
|
4607
|
-
(0,
|
|
4752
|
+
(0, import_react22.useEffect)(() => {
|
|
4608
4753
|
if (!open) return;
|
|
4609
4754
|
const onDown = (e) => {
|
|
4610
4755
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
@@ -4630,8 +4775,8 @@ function DateRangePicker({
|
|
|
4630
4775
|
if (showFooter) setDraft(label);
|
|
4631
4776
|
else commit(label);
|
|
4632
4777
|
};
|
|
4633
|
-
return /* @__PURE__ */ (0,
|
|
4634
|
-
/* @__PURE__ */ (0,
|
|
4778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4779
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4635
4780
|
"button",
|
|
4636
4781
|
{
|
|
4637
4782
|
type: "button",
|
|
@@ -4640,16 +4785,16 @@ function DateRangePicker({
|
|
|
4640
4785
|
"aria-haspopup": "listbox",
|
|
4641
4786
|
className: chipTriggerClass(),
|
|
4642
4787
|
children: [
|
|
4643
|
-
/* @__PURE__ */ (0,
|
|
4644
|
-
/* @__PURE__ */ (0,
|
|
4645
|
-
/* @__PURE__ */ (0,
|
|
4788
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4789
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate2, formatRange) }),
|
|
4790
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
|
|
4646
4791
|
] }),
|
|
4647
|
-
/* @__PURE__ */ (0,
|
|
4792
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react23.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4648
4793
|
]
|
|
4649
4794
|
}
|
|
4650
4795
|
),
|
|
4651
|
-
open && /* @__PURE__ */ (0,
|
|
4652
|
-
presets.map((p) => /* @__PURE__ */ (0,
|
|
4796
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("absolute top-full mt-2 z-30 w-70 overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
|
|
4797
|
+
presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4653
4798
|
"button",
|
|
4654
4799
|
{
|
|
4655
4800
|
type: "button",
|
|
@@ -4659,26 +4804,26 @@ function DateRangePicker({
|
|
|
4659
4804
|
},
|
|
4660
4805
|
p
|
|
4661
4806
|
)),
|
|
4662
|
-
/* @__PURE__ */ (0,
|
|
4663
|
-
/* @__PURE__ */ (0,
|
|
4664
|
-
/* @__PURE__ */ (0,
|
|
4665
|
-
/* @__PURE__ */ (0,
|
|
4807
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4808
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4809
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4666
4811
|
"From",
|
|
4667
|
-
/* @__PURE__ */ (0,
|
|
4668
|
-
granularity === "month" && /* @__PURE__ */ (0,
|
|
4669
|
-
granularity === "quarter" && /* @__PURE__ */ (0,
|
|
4670
|
-
/* @__PURE__ */ (0,
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex gap-1", children: [
|
|
4813
|
+
granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4814
|
+
granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4815
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4671
4816
|
] })
|
|
4672
4817
|
] }),
|
|
4673
|
-
/* @__PURE__ */ (0,
|
|
4818
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4674
4819
|
"To",
|
|
4675
|
-
/* @__PURE__ */ (0,
|
|
4676
|
-
granularity === "month" && /* @__PURE__ */ (0,
|
|
4677
|
-
granularity === "quarter" && /* @__PURE__ */ (0,
|
|
4678
|
-
/* @__PURE__ */ (0,
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex gap-1", children: [
|
|
4821
|
+
granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4822
|
+
granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4823
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4679
4824
|
] })
|
|
4680
4825
|
] }),
|
|
4681
|
-
/* @__PURE__ */ (0,
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4682
4827
|
"button",
|
|
4683
4828
|
{
|
|
4684
4829
|
type: "button",
|
|
@@ -4690,15 +4835,15 @@ function DateRangePicker({
|
|
|
4690
4835
|
)
|
|
4691
4836
|
] })
|
|
4692
4837
|
] }),
|
|
4693
|
-
showFooter && /* @__PURE__ */ (0,
|
|
4838
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4694
4839
|
] })
|
|
4695
4840
|
] });
|
|
4696
4841
|
}
|
|
4697
4842
|
|
|
4698
4843
|
// src/MultiSelectFilter.tsx
|
|
4699
|
-
var
|
|
4844
|
+
var import_react23 = require("react");
|
|
4700
4845
|
var import_lucide_react24 = require("lucide-react");
|
|
4701
|
-
var
|
|
4846
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4702
4847
|
var SEARCH_AFTER = 8;
|
|
4703
4848
|
function MultiSelectFilter({
|
|
4704
4849
|
caption,
|
|
@@ -4732,11 +4877,11 @@ function MultiSelectFilter({
|
|
|
4732
4877
|
const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
|
|
4733
4878
|
const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
|
|
4734
4879
|
const showSearch = searchable ?? leafOptions.length > SEARCH_AFTER;
|
|
4735
|
-
const [open, setOpen] = (0,
|
|
4736
|
-
const [q, setQ] = (0,
|
|
4737
|
-
const [draft, setDraft] = (0,
|
|
4738
|
-
const ref = (0,
|
|
4739
|
-
const close = (0,
|
|
4880
|
+
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
4881
|
+
const [q, setQ] = (0, import_react23.useState)("");
|
|
4882
|
+
const [draft, setDraft] = (0, import_react23.useState)(selected);
|
|
4883
|
+
const ref = (0, import_react23.useRef)(null);
|
|
4884
|
+
const close = (0, import_react23.useCallback)(() => {
|
|
4740
4885
|
setOpen(false);
|
|
4741
4886
|
setQ("");
|
|
4742
4887
|
if (showFooter) return;
|
|
@@ -4759,7 +4904,7 @@ function MultiSelectFilter({
|
|
|
4759
4904
|
setOpen(false);
|
|
4760
4905
|
setQ("");
|
|
4761
4906
|
};
|
|
4762
|
-
(0,
|
|
4907
|
+
(0, import_react23.useEffect)(() => {
|
|
4763
4908
|
if (!open) return;
|
|
4764
4909
|
const onKey = (e) => e.key === "Escape" && close();
|
|
4765
4910
|
const onClick = (e) => {
|
|
@@ -4796,9 +4941,9 @@ function MultiSelectFilter({
|
|
|
4796
4941
|
const shown = open && !showFooter ? draft : selected;
|
|
4797
4942
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4798
4943
|
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4799
|
-
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0,
|
|
4800
|
-
/* @__PURE__ */ (0,
|
|
4801
|
-
/* @__PURE__ */ (0,
|
|
4944
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "flex flex-col", children: [
|
|
4945
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: label }),
|
|
4946
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4802
4947
|
] }) : label;
|
|
4803
4948
|
const ql = q.trim().toLowerCase();
|
|
4804
4949
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4809,8 +4954,8 @@ function MultiSelectFilter({
|
|
|
4809
4954
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4810
4955
|
return kids.length ? { ...g, children: kids } : null;
|
|
4811
4956
|
}).filter((g) => g !== null) : [];
|
|
4812
|
-
return /* @__PURE__ */ (0,
|
|
4813
|
-
/* @__PURE__ */ (0,
|
|
4957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4958
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4814
4959
|
"button",
|
|
4815
4960
|
{
|
|
4816
4961
|
type: "button",
|
|
@@ -4819,8 +4964,8 @@ function MultiSelectFilter({
|
|
|
4819
4964
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4820
4965
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4821
4966
|
children: [
|
|
4822
|
-
/* @__PURE__ */ (0,
|
|
4823
|
-
/* @__PURE__ */ (0,
|
|
4967
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ChipContent, { caption, value, icon }),
|
|
4968
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4824
4969
|
import_lucide_react24.ChevronDown,
|
|
4825
4970
|
{
|
|
4826
4971
|
size: 14,
|
|
@@ -4831,7 +4976,7 @@ function MultiSelectFilter({
|
|
|
4831
4976
|
]
|
|
4832
4977
|
}
|
|
4833
4978
|
),
|
|
4834
|
-
open && /* @__PURE__ */ (0,
|
|
4979
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4835
4980
|
"div",
|
|
4836
4981
|
{
|
|
4837
4982
|
className: cn(
|
|
@@ -4842,10 +4987,10 @@ function MultiSelectFilter({
|
|
|
4842
4987
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4843
4988
|
role: "dialog",
|
|
4844
4989
|
"aria-label": caption,
|
|
4845
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
4846
|
-
showSearch && /* @__PURE__ */ (0,
|
|
4847
|
-
/* @__PURE__ */ (0,
|
|
4848
|
-
/* @__PURE__ */ (0,
|
|
4990
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
4991
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4993
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4849
4994
|
"input",
|
|
4850
4995
|
{
|
|
4851
4996
|
type: "text",
|
|
@@ -4855,37 +5000,37 @@ function MultiSelectFilter({
|
|
|
4855
5000
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4856
5001
|
}
|
|
4857
5002
|
),
|
|
4858
|
-
q && /* @__PURE__ */ (0,
|
|
5003
|
+
q && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.X, { size: 13 }) })
|
|
4859
5004
|
] }) }),
|
|
4860
|
-
/* @__PURE__ */ (0,
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4861
5006
|
groups ? visibleGroups.map((g) => {
|
|
4862
5007
|
const state = groupState(g);
|
|
4863
|
-
return /* @__PURE__ */ (0,
|
|
4864
|
-
/* @__PURE__ */ (0,
|
|
5008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
|
|
5009
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4865
5010
|
"button",
|
|
4866
5011
|
{
|
|
4867
5012
|
type: "button",
|
|
4868
5013
|
onClick: () => toggleGroup(g),
|
|
4869
5014
|
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",
|
|
4870
5015
|
children: [
|
|
4871
|
-
/* @__PURE__ */ (0,
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4873
|
-
counts && /* @__PURE__ */ (0,
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
5018
|
+
counts && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionCount, { n: countFor(g.id) })
|
|
4874
5019
|
]
|
|
4875
5020
|
}
|
|
4876
5021
|
),
|
|
4877
5022
|
g.children.map((c) => {
|
|
4878
5023
|
const checked = draft.includes(c.id);
|
|
4879
|
-
return /* @__PURE__ */ (0,
|
|
5024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4880
5025
|
"button",
|
|
4881
5026
|
{
|
|
4882
5027
|
type: "button",
|
|
4883
5028
|
onClick: () => toggle(c.id),
|
|
4884
5029
|
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",
|
|
4885
5030
|
children: [
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4887
|
-
/* @__PURE__ */ (0,
|
|
4888
|
-
counts && /* @__PURE__ */ (0,
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckBoxBox, { checked }),
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
5033
|
+
counts && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionCount, { n: countFor(c.id) })
|
|
4889
5034
|
]
|
|
4890
5035
|
},
|
|
4891
5036
|
c.id
|
|
@@ -4894,25 +5039,25 @@ function MultiSelectFilter({
|
|
|
4894
5039
|
] }, g.id);
|
|
4895
5040
|
}) : items.map((o) => {
|
|
4896
5041
|
const checked = draft.includes(o.id);
|
|
4897
|
-
return /* @__PURE__ */ (0,
|
|
5042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4898
5043
|
"button",
|
|
4899
5044
|
{
|
|
4900
5045
|
type: "button",
|
|
4901
5046
|
onClick: () => toggle(o.id),
|
|
4902
5047
|
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",
|
|
4903
5048
|
children: [
|
|
4904
|
-
/* @__PURE__ */ (0,
|
|
4905
|
-
/* @__PURE__ */ (0,
|
|
4906
|
-
counts && /* @__PURE__ */ (0,
|
|
5049
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckBoxBox, { checked }),
|
|
5050
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
5051
|
+
counts && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionCount, { n: countFor(o.id) })
|
|
4907
5052
|
]
|
|
4908
5053
|
},
|
|
4909
5054
|
o.id
|
|
4910
5055
|
);
|
|
4911
5056
|
}),
|
|
4912
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0,
|
|
5057
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4913
5058
|
] }),
|
|
4914
|
-
note && /* @__PURE__ */ (0,
|
|
4915
|
-
showFooter ? /* @__PURE__ */ (0,
|
|
5059
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
5060
|
+
showFooter ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4916
5061
|
"button",
|
|
4917
5062
|
{
|
|
4918
5063
|
type: "button",
|
|
@@ -4930,7 +5075,7 @@ function MultiSelectFilter({
|
|
|
4930
5075
|
] });
|
|
4931
5076
|
}
|
|
4932
5077
|
function OptionCount({ n }) {
|
|
4933
|
-
return /* @__PURE__ */ (0,
|
|
5078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4934
5079
|
"(",
|
|
4935
5080
|
n.toLocaleString(),
|
|
4936
5081
|
")"
|
|
@@ -4938,16 +5083,16 @@ function OptionCount({ n }) {
|
|
|
4938
5083
|
}
|
|
4939
5084
|
|
|
4940
5085
|
// src/Toggle.tsx
|
|
4941
|
-
var
|
|
4942
|
-
var
|
|
5086
|
+
var import_react24 = require("react");
|
|
5087
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4943
5088
|
var SIZES2 = {
|
|
4944
5089
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4945
5090
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
4946
5091
|
};
|
|
4947
5092
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4948
|
-
var Toggle = (0,
|
|
5093
|
+
var Toggle = (0, import_react24.forwardRef)(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4949
5094
|
const s = SIZES2[size];
|
|
4950
|
-
return /* @__PURE__ */ (0,
|
|
5095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4951
5096
|
"button",
|
|
4952
5097
|
{
|
|
4953
5098
|
ref,
|
|
@@ -4966,7 +5111,7 @@ var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange
|
|
|
4966
5111
|
disabled && "cursor-not-allowed opacity-50",
|
|
4967
5112
|
className
|
|
4968
5113
|
),
|
|
4969
|
-
children: /* @__PURE__ */ (0,
|
|
5114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4970
5115
|
"span",
|
|
4971
5116
|
{
|
|
4972
5117
|
className: cn(
|
|
@@ -4982,22 +5127,22 @@ var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange
|
|
|
4982
5127
|
Toggle.displayName = "Toggle";
|
|
4983
5128
|
|
|
4984
5129
|
// src/AISpark.tsx
|
|
4985
|
-
var
|
|
5130
|
+
var import_react25 = require("react");
|
|
4986
5131
|
var import_lucide_react25 = require("lucide-react");
|
|
4987
|
-
var
|
|
5132
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4988
5133
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4989
|
-
const id = (0,
|
|
4990
|
-
return /* @__PURE__ */ (0,
|
|
4991
|
-
/* @__PURE__ */ (0,
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
4993
|
-
/* @__PURE__ */ (0,
|
|
5134
|
+
const id = (0, import_react25.useId)();
|
|
5135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
5136
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
5137
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
5138
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4994
5139
|
] }) }) }),
|
|
4995
|
-
/* @__PURE__ */ (0,
|
|
5140
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react25.Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4996
5141
|
] });
|
|
4997
5142
|
}
|
|
4998
5143
|
|
|
4999
5144
|
// src/Freshness.tsx
|
|
5000
|
-
var
|
|
5145
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5001
5146
|
var dotColor = {
|
|
5002
5147
|
fresh: "bg-status-success",
|
|
5003
5148
|
recent: "bg-status-warning",
|
|
@@ -5009,7 +5154,7 @@ var srLabel = {
|
|
|
5009
5154
|
stale: "Older than a day"
|
|
5010
5155
|
};
|
|
5011
5156
|
function Freshness({ level, className, testIdPrefix }) {
|
|
5012
|
-
return /* @__PURE__ */ (0,
|
|
5157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5013
5158
|
"span",
|
|
5014
5159
|
{
|
|
5015
5160
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -5021,50 +5166,50 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
5021
5166
|
}
|
|
5022
5167
|
|
|
5023
5168
|
// src/SectionHeading.tsx
|
|
5024
|
-
var
|
|
5169
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5025
5170
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
5026
|
-
return /* @__PURE__ */ (0,
|
|
5027
|
-
/* @__PURE__ */ (0,
|
|
5028
|
-
/* @__PURE__ */ (0,
|
|
5029
|
-
description && /* @__PURE__ */ (0,
|
|
5171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
5172
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5174
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
|
|
5030
5175
|
] }),
|
|
5031
|
-
actions && /* @__PURE__ */ (0,
|
|
5176
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
5032
5177
|
] });
|
|
5033
5178
|
}
|
|
5034
5179
|
|
|
5035
5180
|
// src/PageHeader.tsx
|
|
5036
5181
|
var import_lucide_react26 = require("lucide-react");
|
|
5037
|
-
var
|
|
5182
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5038
5183
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
5039
|
-
return /* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5041
|
-
back && /* @__PURE__ */ (0,
|
|
5184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
|
|
5185
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "min-w-0", children: [
|
|
5186
|
+
back && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
5042
5187
|
"a",
|
|
5043
5188
|
{
|
|
5044
5189
|
href: back.href ?? "#",
|
|
5045
5190
|
onClick: back.onClick,
|
|
5046
5191
|
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",
|
|
5047
5192
|
children: [
|
|
5048
|
-
/* @__PURE__ */ (0,
|
|
5193
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react26.ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
5049
5194
|
back.label
|
|
5050
5195
|
]
|
|
5051
5196
|
}
|
|
5052
5197
|
),
|
|
5053
|
-
meta ? /* @__PURE__ */ (0,
|
|
5054
|
-
/* @__PURE__ */ (0,
|
|
5198
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
|
|
5199
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
5055
5200
|
meta
|
|
5056
|
-
] }) : /* @__PURE__ */ (0,
|
|
5057
|
-
description && /* @__PURE__ */ (0,
|
|
5201
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
5202
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
|
|
5058
5203
|
] }),
|
|
5059
|
-
actions && /* @__PURE__ */ (0,
|
|
5204
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
5060
5205
|
] });
|
|
5061
5206
|
}
|
|
5062
5207
|
|
|
5063
5208
|
// src/Modal.tsx
|
|
5064
|
-
var
|
|
5209
|
+
var import_react26 = require("react");
|
|
5065
5210
|
var import_react_dom7 = require("react-dom");
|
|
5066
5211
|
var import_lucide_react27 = require("lucide-react");
|
|
5067
|
-
var
|
|
5212
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5068
5213
|
var WIDTH = {
|
|
5069
5214
|
sm: "max-w-110",
|
|
5070
5215
|
md: "max-w-160",
|
|
@@ -5076,14 +5221,14 @@ var WIDTH = {
|
|
|
5076
5221
|
var EXIT_MS = 200;
|
|
5077
5222
|
var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
5078
5223
|
function Modal({ open, onClose, title, description, size = "md", footer, children, className, testIdPrefix }) {
|
|
5079
|
-
const titleId = (0,
|
|
5080
|
-
const descId = (0,
|
|
5081
|
-
const panel = (0,
|
|
5082
|
-
const close = (0,
|
|
5224
|
+
const titleId = (0, import_react26.useId)();
|
|
5225
|
+
const descId = (0, import_react26.useId)();
|
|
5226
|
+
const panel = (0, import_react26.useRef)(null);
|
|
5227
|
+
const close = (0, import_react26.useRef)(onClose);
|
|
5083
5228
|
close.current = onClose;
|
|
5084
|
-
const [mounted, setMounted] = (0,
|
|
5085
|
-
const [shown, setShown] = (0,
|
|
5086
|
-
(0,
|
|
5229
|
+
const [mounted, setMounted] = (0, import_react26.useState)(open);
|
|
5230
|
+
const [shown, setShown] = (0, import_react26.useState)(false);
|
|
5231
|
+
(0, import_react26.useEffect)(() => {
|
|
5087
5232
|
if (open) {
|
|
5088
5233
|
setMounted(true);
|
|
5089
5234
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
@@ -5093,7 +5238,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5093
5238
|
const t = setTimeout(() => setMounted(false), EXIT_MS);
|
|
5094
5239
|
return () => clearTimeout(t);
|
|
5095
5240
|
}, [open]);
|
|
5096
|
-
(0,
|
|
5241
|
+
(0, import_react26.useEffect)(() => {
|
|
5097
5242
|
if (!open || !mounted) return;
|
|
5098
5243
|
const opener = document.activeElement;
|
|
5099
5244
|
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE) ?? null;
|
|
@@ -5128,7 +5273,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5128
5273
|
}, [open, mounted]);
|
|
5129
5274
|
if (!mounted || typeof document === "undefined") return null;
|
|
5130
5275
|
return (0, import_react_dom7.createPortal)(
|
|
5131
|
-
/* @__PURE__ */ (0,
|
|
5276
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5132
5277
|
"div",
|
|
5133
5278
|
{
|
|
5134
5279
|
className: cn(
|
|
@@ -5136,7 +5281,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5136
5281
|
shown ? "opacity-100" : "opacity-0"
|
|
5137
5282
|
),
|
|
5138
5283
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
5139
|
-
children: /* @__PURE__ */ (0,
|
|
5284
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5140
5285
|
"div",
|
|
5141
5286
|
{
|
|
5142
5287
|
ref: panel,
|
|
@@ -5154,24 +5299,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5154
5299
|
className
|
|
5155
5300
|
),
|
|
5156
5301
|
children: [
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5160
|
-
description && /* @__PURE__ */ (0,
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5303
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5304
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5305
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5161
5306
|
] }),
|
|
5162
|
-
/* @__PURE__ */ (0,
|
|
5307
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5163
5308
|
"button",
|
|
5164
5309
|
{
|
|
5165
5310
|
type: "button",
|
|
5166
5311
|
onClick: onClose,
|
|
5167
5312
|
"aria-label": "Close",
|
|
5168
5313
|
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",
|
|
5169
|
-
children: /* @__PURE__ */ (0,
|
|
5314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.X, { size: 16, "aria-hidden": "true" })
|
|
5170
5315
|
}
|
|
5171
5316
|
)
|
|
5172
5317
|
] }),
|
|
5173
|
-
children && /* @__PURE__ */ (0,
|
|
5174
|
-
footer && /* @__PURE__ */ (0,
|
|
5318
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
|
|
5319
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5175
5320
|
]
|
|
5176
5321
|
}
|
|
5177
5322
|
)
|
|
@@ -5182,10 +5327,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5182
5327
|
}
|
|
5183
5328
|
|
|
5184
5329
|
// src/EmptyState.tsx
|
|
5185
|
-
var
|
|
5330
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5186
5331
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
5187
5332
|
const md = size === "md";
|
|
5188
|
-
return /* @__PURE__ */ (0,
|
|
5333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
5189
5334
|
"div",
|
|
5190
5335
|
{
|
|
5191
5336
|
className: cn(
|
|
@@ -5195,7 +5340,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5195
5340
|
),
|
|
5196
5341
|
"data-testid": testIdPrefix,
|
|
5197
5342
|
children: [
|
|
5198
|
-
icon && /* @__PURE__ */ (0,
|
|
5343
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5199
5344
|
"span",
|
|
5200
5345
|
{
|
|
5201
5346
|
"aria-hidden": "true",
|
|
@@ -5206,27 +5351,27 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5206
5351
|
children: icon
|
|
5207
5352
|
}
|
|
5208
5353
|
),
|
|
5209
|
-
/* @__PURE__ */ (0,
|
|
5210
|
-
description && /* @__PURE__ */ (0,
|
|
5211
|
-
action && /* @__PURE__ */ (0,
|
|
5354
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
|
|
5355
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
|
|
5356
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
|
|
5212
5357
|
]
|
|
5213
5358
|
}
|
|
5214
5359
|
);
|
|
5215
5360
|
}
|
|
5216
5361
|
|
|
5217
5362
|
// src/TextField.tsx
|
|
5218
|
-
var
|
|
5219
|
-
var
|
|
5363
|
+
var import_react27 = require("react");
|
|
5364
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5220
5365
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
5221
|
-
var TextField = (0,
|
|
5366
|
+
var TextField = (0, import_react27.forwardRef)(
|
|
5222
5367
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
5223
|
-
const auto = (0,
|
|
5368
|
+
const auto = (0, import_react27.useId)();
|
|
5224
5369
|
const fieldId = id ?? auto;
|
|
5225
5370
|
const noteId = `${fieldId}-note`;
|
|
5226
5371
|
const note = error ?? hint;
|
|
5227
|
-
return /* @__PURE__ */ (0,
|
|
5228
|
-
label && /* @__PURE__ */ (0,
|
|
5229
|
-
/* @__PURE__ */ (0,
|
|
5372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
|
|
5373
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
|
|
5374
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5230
5375
|
"div",
|
|
5231
5376
|
{
|
|
5232
5377
|
className: cn(
|
|
@@ -5236,8 +5381,8 @@ var TextField = (0, import_react26.forwardRef)(
|
|
|
5236
5381
|
disabled && "opacity-50"
|
|
5237
5382
|
),
|
|
5238
5383
|
children: [
|
|
5239
|
-
icon && /* @__PURE__ */ (0,
|
|
5240
|
-
/* @__PURE__ */ (0,
|
|
5384
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5385
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5241
5386
|
"input",
|
|
5242
5387
|
{
|
|
5243
5388
|
ref,
|
|
@@ -5252,17 +5397,17 @@ var TextField = (0, import_react26.forwardRef)(
|
|
|
5252
5397
|
]
|
|
5253
5398
|
}
|
|
5254
5399
|
),
|
|
5255
|
-
note && /* @__PURE__ */ (0,
|
|
5400
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
5256
5401
|
] });
|
|
5257
5402
|
}
|
|
5258
5403
|
);
|
|
5259
5404
|
TextField.displayName = "TextField";
|
|
5260
5405
|
|
|
5261
5406
|
// src/Drawer.tsx
|
|
5262
|
-
var
|
|
5407
|
+
var import_react28 = require("react");
|
|
5263
5408
|
var import_react_dom8 = require("react-dom");
|
|
5264
5409
|
var import_lucide_react28 = require("lucide-react");
|
|
5265
|
-
var
|
|
5410
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5266
5411
|
var WIDTH2 = {
|
|
5267
5412
|
sm: "max-w-110",
|
|
5268
5413
|
md: "max-w-160",
|
|
@@ -5271,14 +5416,14 @@ var WIDTH2 = {
|
|
|
5271
5416
|
var EXIT_MS2 = 200;
|
|
5272
5417
|
var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
5273
5418
|
function Drawer({ open, onClose, title, description, size = "sm", footer, children, className, testIdPrefix }) {
|
|
5274
|
-
const titleId = (0,
|
|
5275
|
-
const descId = (0,
|
|
5276
|
-
const panel = (0,
|
|
5277
|
-
const close = (0,
|
|
5419
|
+
const titleId = (0, import_react28.useId)();
|
|
5420
|
+
const descId = (0, import_react28.useId)();
|
|
5421
|
+
const panel = (0, import_react28.useRef)(null);
|
|
5422
|
+
const close = (0, import_react28.useRef)(onClose);
|
|
5278
5423
|
close.current = onClose;
|
|
5279
|
-
const [mounted, setMounted] = (0,
|
|
5280
|
-
const [shown, setShown] = (0,
|
|
5281
|
-
(0,
|
|
5424
|
+
const [mounted, setMounted] = (0, import_react28.useState)(open);
|
|
5425
|
+
const [shown, setShown] = (0, import_react28.useState)(false);
|
|
5426
|
+
(0, import_react28.useEffect)(() => {
|
|
5282
5427
|
if (open) {
|
|
5283
5428
|
setMounted(true);
|
|
5284
5429
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
@@ -5288,7 +5433,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5288
5433
|
const t = setTimeout(() => setMounted(false), EXIT_MS2);
|
|
5289
5434
|
return () => clearTimeout(t);
|
|
5290
5435
|
}, [open]);
|
|
5291
|
-
(0,
|
|
5436
|
+
(0, import_react28.useEffect)(() => {
|
|
5292
5437
|
if (!open || !mounted) return;
|
|
5293
5438
|
const opener = document.activeElement;
|
|
5294
5439
|
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE2) ?? null;
|
|
@@ -5323,8 +5468,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5323
5468
|
}, [open, mounted]);
|
|
5324
5469
|
if (!mounted || typeof document === "undefined") return null;
|
|
5325
5470
|
return (0, import_react_dom8.createPortal)(
|
|
5326
|
-
/* @__PURE__ */ (0,
|
|
5327
|
-
/* @__PURE__ */ (0,
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fixed inset-0 z-modal", children: [
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5328
5473
|
"div",
|
|
5329
5474
|
{
|
|
5330
5475
|
"aria-hidden": "true",
|
|
@@ -5338,7 +5483,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5338
5483
|
)
|
|
5339
5484
|
}
|
|
5340
5485
|
),
|
|
5341
|
-
/* @__PURE__ */ (0,
|
|
5486
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5342
5487
|
"div",
|
|
5343
5488
|
{
|
|
5344
5489
|
ref: panel,
|
|
@@ -5355,24 +5500,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5355
5500
|
className
|
|
5356
5501
|
),
|
|
5357
5502
|
children: [
|
|
5358
|
-
/* @__PURE__ */ (0,
|
|
5359
|
-
/* @__PURE__ */ (0,
|
|
5360
|
-
/* @__PURE__ */ (0,
|
|
5361
|
-
description && /* @__PURE__ */ (0,
|
|
5503
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5504
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5505
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5506
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5362
5507
|
] }),
|
|
5363
|
-
/* @__PURE__ */ (0,
|
|
5508
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5364
5509
|
"button",
|
|
5365
5510
|
{
|
|
5366
5511
|
type: "button",
|
|
5367
5512
|
onClick: onClose,
|
|
5368
5513
|
"aria-label": "Close",
|
|
5369
5514
|
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",
|
|
5370
|
-
children: /* @__PURE__ */ (0,
|
|
5515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react28.X, { size: 16, "aria-hidden": "true" })
|
|
5371
5516
|
}
|
|
5372
5517
|
)
|
|
5373
5518
|
] }),
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5375
|
-
footer && /* @__PURE__ */ (0,
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { "data-drawer-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
|
|
5520
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5376
5521
|
]
|
|
5377
5522
|
}
|
|
5378
5523
|
)
|
|
@@ -5382,7 +5527,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5382
5527
|
}
|
|
5383
5528
|
|
|
5384
5529
|
// src/DataTable.tsx
|
|
5385
|
-
var
|
|
5530
|
+
var import_react29 = require("react");
|
|
5386
5531
|
var import_lucide_react29 = require("lucide-react");
|
|
5387
5532
|
|
|
5388
5533
|
// src/numbers.ts
|
|
@@ -5442,20 +5587,20 @@ function formatPercent(value, _opts = {}) {
|
|
|
5442
5587
|
}
|
|
5443
5588
|
|
|
5444
5589
|
// src/DataTable.tsx
|
|
5445
|
-
var
|
|
5590
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5446
5591
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5447
5592
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5448
5593
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
5449
5594
|
var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
|
|
5450
5595
|
var OWN_CLICK = "a, button, input, select, textarea, label, summary, [role='button'], [role='checkbox'], [role='menuitem'], [role='switch'], [role='tab'], [contenteditable='true']";
|
|
5451
5596
|
function NoValue({ reason = "No data" }) {
|
|
5452
|
-
return /* @__PURE__ */ (0,
|
|
5453
|
-
/* @__PURE__ */ (0,
|
|
5454
|
-
/* @__PURE__ */ (0,
|
|
5597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { label: reason, delay: 300, className: "text-text-tertiary", children: [
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": "true", children: NO_VALUE }),
|
|
5599
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: reason })
|
|
5455
5600
|
] });
|
|
5456
5601
|
}
|
|
5457
5602
|
function TableLink({ className, ...props }) {
|
|
5458
|
-
return /* @__PURE__ */ (0,
|
|
5603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5459
5604
|
"a",
|
|
5460
5605
|
{
|
|
5461
5606
|
...props,
|
|
@@ -5484,6 +5629,8 @@ function DataTable({
|
|
|
5484
5629
|
density = "default",
|
|
5485
5630
|
loading = false,
|
|
5486
5631
|
loadingRows = 5,
|
|
5632
|
+
refreshing = false,
|
|
5633
|
+
onRetry,
|
|
5487
5634
|
empty,
|
|
5488
5635
|
maxHeight,
|
|
5489
5636
|
footer,
|
|
@@ -5491,7 +5638,8 @@ function DataTable({
|
|
|
5491
5638
|
testIdPrefix,
|
|
5492
5639
|
...rest
|
|
5493
5640
|
}) {
|
|
5494
|
-
const titleId = (0,
|
|
5641
|
+
const titleId = (0, import_react29.useId)();
|
|
5642
|
+
const showSkeleton = useDelayedLoading(loading);
|
|
5495
5643
|
const head = HEAD_PAD[density];
|
|
5496
5644
|
const pad2 = CELL_PAD[density];
|
|
5497
5645
|
const right = (c) => c.numeric || c.rank;
|
|
@@ -5502,9 +5650,9 @@ function DataTable({
|
|
|
5502
5650
|
const col = columns.find((c) => c.key === key);
|
|
5503
5651
|
onSortChange?.(cycleSort(shown, key, col?.firstDir ?? (right(col) ? "desc" : "asc"), defaultSort));
|
|
5504
5652
|
};
|
|
5505
|
-
const [open, setOpen] = (0,
|
|
5653
|
+
const [open, setOpen] = (0, import_react29.useState)(() => /* @__PURE__ */ new Set());
|
|
5506
5654
|
const visibleKeys = rows.map(rowKey).join("|");
|
|
5507
|
-
(0,
|
|
5655
|
+
(0, import_react29.useEffect)(() => setOpen(/* @__PURE__ */ new Set()), [shown?.key, shown?.dir, visibleKeys]);
|
|
5508
5656
|
const expandable = (row) => !!renderExpanded && (canExpand ? canExpand(row) : true);
|
|
5509
5657
|
const anyExpandable = !!renderExpanded && rows.some(expandable);
|
|
5510
5658
|
const toggle = (key) => setOpen((prev) => {
|
|
@@ -5521,39 +5669,39 @@ function DataTable({
|
|
|
5521
5669
|
const span = columns.length + (anyExpandable ? 1 : 0);
|
|
5522
5670
|
const renderCell = (c, row) => {
|
|
5523
5671
|
const v = c.cell(row);
|
|
5524
|
-
return v === null || v === void 0 || v === "" ? /* @__PURE__ */ (0,
|
|
5672
|
+
return v === null || v === void 0 || v === "" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(NoValue, { reason: c.missing }) : v;
|
|
5525
5673
|
};
|
|
5526
5674
|
const inside = variant === "chart";
|
|
5527
|
-
const frame = /* @__PURE__ */ (0,
|
|
5675
|
+
const frame = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
5528
5676
|
"div",
|
|
5529
5677
|
{
|
|
5530
|
-
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
|
|
5678
|
+
className: cn("relative flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
|
|
5531
5679
|
"data-testid": testIdPrefix,
|
|
5532
5680
|
children: [
|
|
5533
|
-
title && inside && /* @__PURE__ */ (0,
|
|
5534
|
-
/* @__PURE__ */ (0,
|
|
5535
|
-
/* @__PURE__ */ (0,
|
|
5536
|
-
subtitle && /* @__PURE__ */ (0,
|
|
5681
|
+
title && inside && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5682
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0", children: [
|
|
5683
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h3", { id: titleId, className: "text-panel-title font-semibold text-text-primary", children: title }),
|
|
5684
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
5537
5685
|
] }),
|
|
5538
|
-
action && /* @__PURE__ */ (0,
|
|
5686
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
5539
5687
|
] }),
|
|
5540
|
-
/* @__PURE__ */ (0,
|
|
5688
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
5541
5689
|
"table",
|
|
5542
5690
|
{
|
|
5543
5691
|
"aria-labelledby": title ? titleId : void 0,
|
|
5544
5692
|
"aria-label": title ? void 0 : rest["aria-label"],
|
|
5545
|
-
"aria-busy": loading || void 0,
|
|
5693
|
+
"aria-busy": loading || refreshing || void 0,
|
|
5546
5694
|
className: "w-full border-collapse text-left",
|
|
5547
5695
|
children: [
|
|
5548
|
-
/* @__PURE__ */ (0,
|
|
5549
|
-
anyExpandable && /* @__PURE__ */ (0,
|
|
5550
|
-
columns.map((c) => /* @__PURE__ */ (0,
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: [
|
|
5697
|
+
anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("th", { scope: "col", className: cn("w-10 border-b border-border-default", head), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "Details" }) }),
|
|
5698
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5551
5699
|
"th",
|
|
5552
5700
|
{
|
|
5553
5701
|
scope: "col",
|
|
5554
5702
|
"aria-sort": c.sortable ? ariaSortFor(shown, c.key) : void 0,
|
|
5555
5703
|
className: cn("group/head whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5556
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */ (0,
|
|
5704
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5557
5705
|
SortButton,
|
|
5558
5706
|
{
|
|
5559
5707
|
label: c.label,
|
|
@@ -5564,36 +5712,28 @@ function DataTable({
|
|
|
5564
5712
|
description: c.info,
|
|
5565
5713
|
testIdPrefix
|
|
5566
5714
|
}
|
|
5567
|
-
) : c.info ? /* @__PURE__ */ (0,
|
|
5715
|
+
) : c.info ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SortButton, { label: c.label, sortKey: c.key, sortable: false, sort: sortProp(shown), onSort: () => {
|
|
5568
5716
|
}, description: c.info, align: right(c) ? "right" : "left" }) : c.label
|
|
5569
5717
|
},
|
|
5570
5718
|
c.key
|
|
5571
5719
|
))
|
|
5572
5720
|
] }) }),
|
|
5573
|
-
/* @__PURE__ */ (0,
|
|
5574
|
-
anyExpandable && /* @__PURE__ */ (0,
|
|
5575
|
-
columns.map((c) => /* @__PURE__ */ (0,
|
|
5576
|
-
|
|
5577
|
-
{
|
|
5578
|
-
className: cn(
|
|
5579
|
-
"inline-block h-3 animate-pulse rounded-full bg-subtle",
|
|
5580
|
-
c.numeric ? "w-12" : "w-2/3"
|
|
5581
|
-
)
|
|
5582
|
-
}
|
|
5583
|
-
) }, c.key))
|
|
5584
|
-
] }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { colSpan: span, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row, index) => {
|
|
5721
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tbody", { className: cn("text-dense text-text-primary", refreshing && !loading && "opacity-50 transition-opacity motion-reduce:transition-none"), children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: [
|
|
5722
|
+
anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { className: cn("border-b border-border-default", pad2) }),
|
|
5723
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { className: cn("border-b border-border-default", pad2, align(c)), children: showSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { className: cn("inline-block", right(c) ? "w-12" : "w-2/3") }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-block h-3" }) }, c.key))
|
|
5724
|
+
] }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { colSpan: span, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row, index) => {
|
|
5585
5725
|
const key = rowKey(row);
|
|
5586
5726
|
const canOpen = expandable(row);
|
|
5587
5727
|
const isOpen = canOpen && open.has(key);
|
|
5588
5728
|
const panelId = `${titleId}-row-${index}`;
|
|
5589
|
-
return /* @__PURE__ */ (0,
|
|
5590
|
-
/* @__PURE__ */ (0,
|
|
5729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react29.Fragment, { children: [
|
|
5730
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
5591
5731
|
"tr",
|
|
5592
5732
|
{
|
|
5593
5733
|
onClick: canOpen ? (e) => onRowClick(e, key) : void 0,
|
|
5594
5734
|
className: cn("hover:bg-subtle [&:last-child>td]:border-b-0", canOpen && "cursor-pointer", isOpen && "bg-subtle"),
|
|
5595
5735
|
children: [
|
|
5596
|
-
anyExpandable && /* @__PURE__ */ (0,
|
|
5736
|
+
anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { className: cn("border-b border-border-default pr-0", pad2, isOpen && "border-b-0"), children: canOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5597
5737
|
"button",
|
|
5598
5738
|
{
|
|
5599
5739
|
type: "button",
|
|
@@ -5602,7 +5742,7 @@ function DataTable({
|
|
|
5602
5742
|
"aria-label": `${isOpen ? "Hide" : "Show"} details${rowLabel ? ` for ${rowLabel(row)}` : ""}`,
|
|
5603
5743
|
onClick: () => toggle(key),
|
|
5604
5744
|
className: "flex size-6 items-center justify-center rounded-control text-text-tertiary hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5605
|
-
children: /* @__PURE__ */ (0,
|
|
5745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5606
5746
|
import_lucide_react29.ChevronRight,
|
|
5607
5747
|
{
|
|
5608
5748
|
size: 16,
|
|
@@ -5612,7 +5752,7 @@ function DataTable({
|
|
|
5612
5752
|
)
|
|
5613
5753
|
}
|
|
5614
5754
|
) }),
|
|
5615
|
-
columns.map((c) => /* @__PURE__ */ (0,
|
|
5755
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5616
5756
|
"td",
|
|
5617
5757
|
{
|
|
5618
5758
|
className: cn(
|
|
@@ -5630,25 +5770,27 @@ function DataTable({
|
|
|
5630
5770
|
]
|
|
5631
5771
|
}
|
|
5632
5772
|
),
|
|
5633
|
-
isOpen && /* @__PURE__ */ (0,
|
|
5773
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { className: "[&:last-child>td]:border-b-0", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { id: panelId, colSpan: span, className: "border-b border-border-default bg-subtle px-4 pb-4 pl-14", children: renderExpanded(row) }) })
|
|
5634
5774
|
] }, key);
|
|
5635
5775
|
}) })
|
|
5636
5776
|
]
|
|
5637
5777
|
}
|
|
5638
5778
|
) }),
|
|
5639
|
-
|
|
5779
|
+
refreshing && !loading && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RefreshLine, {}),
|
|
5780
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LongWait, { loading, onRetry, className: "mb-3 px-4" }),
|
|
5781
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
5640
5782
|
]
|
|
5641
5783
|
}
|
|
5642
5784
|
);
|
|
5643
5785
|
if (!title || inside) return frame;
|
|
5644
|
-
return /* @__PURE__ */ (0,
|
|
5645
|
-
/* @__PURE__ */ (0,
|
|
5786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { "aria-labelledby": titleId, className: cn("flex w-full flex-col gap-3", className), children: [
|
|
5787
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SectionHeading, { id: titleId, as: titleAs, title, description: subtitle, actions: action }),
|
|
5646
5788
|
frame
|
|
5647
5789
|
] });
|
|
5648
5790
|
}
|
|
5649
5791
|
|
|
5650
5792
|
// src/MediaLabel.tsx
|
|
5651
|
-
var
|
|
5793
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5652
5794
|
var FILL = {
|
|
5653
5795
|
TV: "bg-media-tv",
|
|
5654
5796
|
CTV: "bg-media-ctv",
|
|
@@ -5659,7 +5801,7 @@ var FILL = {
|
|
|
5659
5801
|
Magazine: "bg-media-magazine"
|
|
5660
5802
|
};
|
|
5661
5803
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5662
|
-
return /* @__PURE__ */ (0,
|
|
5804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5663
5805
|
"span",
|
|
5664
5806
|
{
|
|
5665
5807
|
className: cn(
|
|
@@ -5674,10 +5816,10 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5674
5816
|
}
|
|
5675
5817
|
|
|
5676
5818
|
// src/SuggestionChip.tsx
|
|
5677
|
-
var
|
|
5678
|
-
var
|
|
5679
|
-
var SuggestionChip = (0,
|
|
5680
|
-
return /* @__PURE__ */ (0,
|
|
5819
|
+
var import_react30 = require("react");
|
|
5820
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5821
|
+
var SuggestionChip = (0, import_react30.forwardRef)(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5681
5823
|
"button",
|
|
5682
5824
|
{
|
|
5683
5825
|
ref,
|
|
@@ -5688,18 +5830,18 @@ var SuggestionChip = (0, import_react29.forwardRef)(function SuggestionChip2({ c
|
|
|
5688
5830
|
"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",
|
|
5689
5831
|
className
|
|
5690
5832
|
),
|
|
5691
|
-
children: /* @__PURE__ */ (0,
|
|
5833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "truncate", children })
|
|
5692
5834
|
}
|
|
5693
5835
|
);
|
|
5694
5836
|
});
|
|
5695
5837
|
SuggestionChip.displayName = "SuggestionChip";
|
|
5696
5838
|
|
|
5697
5839
|
// src/ToggleChip.tsx
|
|
5698
|
-
var
|
|
5840
|
+
var import_react31 = require("react");
|
|
5699
5841
|
var import_lucide_react30 = require("lucide-react");
|
|
5700
|
-
var
|
|
5701
|
-
var ToggleChip = (0,
|
|
5702
|
-
return /* @__PURE__ */ (0,
|
|
5842
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5843
|
+
var ToggleChip = (0, import_react31.forwardRef)(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5703
5845
|
"button",
|
|
5704
5846
|
{
|
|
5705
5847
|
ref,
|
|
@@ -5717,7 +5859,7 @@ var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected,
|
|
|
5717
5859
|
className
|
|
5718
5860
|
),
|
|
5719
5861
|
children: [
|
|
5720
|
-
selected && /* @__PURE__ */ (0,
|
|
5862
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react30.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5721
5863
|
children
|
|
5722
5864
|
]
|
|
5723
5865
|
}
|
|
@@ -5726,14 +5868,14 @@ var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected,
|
|
|
5726
5868
|
ToggleChip.displayName = "ToggleChip";
|
|
5727
5869
|
|
|
5728
5870
|
// src/CopyButton.tsx
|
|
5729
|
-
var
|
|
5871
|
+
var import_react32 = require("react");
|
|
5730
5872
|
var import_lucide_react31 = require("lucide-react");
|
|
5731
|
-
var
|
|
5873
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5732
5874
|
var CONFIRM_MS = 2e3;
|
|
5733
|
-
var CopyButton = (0,
|
|
5734
|
-
const [copied, setCopied] = (0,
|
|
5735
|
-
const timer = (0,
|
|
5736
|
-
(0,
|
|
5875
|
+
var CopyButton = (0, import_react32.forwardRef)(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5876
|
+
const [copied, setCopied] = (0, import_react32.useState)(false);
|
|
5877
|
+
const timer = (0, import_react32.useRef)(void 0);
|
|
5878
|
+
(0, import_react32.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
5737
5879
|
const copy = async () => {
|
|
5738
5880
|
try {
|
|
5739
5881
|
await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
|
|
@@ -5745,8 +5887,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5745
5887
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5746
5888
|
};
|
|
5747
5889
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5748
|
-
const icon = copied ? /* @__PURE__ */ (0,
|
|
5749
|
-
return /* @__PURE__ */ (0,
|
|
5890
|
+
const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react31.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react31.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
5891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5750
5892
|
Button,
|
|
5751
5893
|
{
|
|
5752
5894
|
ref,
|
|
@@ -5760,8 +5902,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5760
5902
|
className: cn(!copied && "text-text-secondary", className),
|
|
5761
5903
|
children: [
|
|
5762
5904
|
icon,
|
|
5763
|
-
label && /* @__PURE__ */ (0,
|
|
5764
|
-
/* @__PURE__ */ (0,
|
|
5905
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: copied ? "Copied" : label }),
|
|
5906
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5765
5907
|
]
|
|
5766
5908
|
}
|
|
5767
5909
|
);
|
|
@@ -5770,7 +5912,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
5770
5912
|
|
|
5771
5913
|
// src/InlineMessage.tsx
|
|
5772
5914
|
var import_lucide_react32 = require("lucide-react");
|
|
5773
|
-
var
|
|
5915
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5774
5916
|
var BOX = {
|
|
5775
5917
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5776
5918
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5787,27 +5929,27 @@ var ICON_INK = {
|
|
|
5787
5929
|
var ICON2 = { info: import_lucide_react32.Info, success: import_lucide_react32.CheckCircle2, warning: import_lucide_react32.AlertTriangle, danger: import_lucide_react32.XCircle };
|
|
5788
5930
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5789
5931
|
const Icon = ICON2[tone];
|
|
5790
|
-
return /* @__PURE__ */ (0,
|
|
5932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5791
5933
|
"div",
|
|
5792
5934
|
{
|
|
5793
5935
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5794
5936
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5795
5937
|
"data-testid": testIdPrefix,
|
|
5796
5938
|
children: [
|
|
5797
|
-
/* @__PURE__ */ (0,
|
|
5798
|
-
/* @__PURE__ */ (0,
|
|
5799
|
-
/* @__PURE__ */ (0,
|
|
5800
|
-
children && /* @__PURE__ */ (0,
|
|
5801
|
-
actions && /* @__PURE__ */ (0,
|
|
5939
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
5940
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5941
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
|
|
5942
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
5943
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
5802
5944
|
] }),
|
|
5803
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
5945
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5804
5946
|
"button",
|
|
5805
5947
|
{
|
|
5806
5948
|
type: "button",
|
|
5807
5949
|
onClick: onDismiss,
|
|
5808
5950
|
"aria-label": "Dismiss",
|
|
5809
5951
|
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",
|
|
5810
|
-
children: /* @__PURE__ */ (0,
|
|
5952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react32.X, { size: 14, "aria-hidden": "true" })
|
|
5811
5953
|
}
|
|
5812
5954
|
)
|
|
5813
5955
|
]
|
|
@@ -5816,9 +5958,9 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5816
5958
|
}
|
|
5817
5959
|
|
|
5818
5960
|
// src/FilterDrawer.tsx
|
|
5819
|
-
var
|
|
5961
|
+
var import_react33 = require("react");
|
|
5820
5962
|
var import_lucide_react33 = require("lucide-react");
|
|
5821
|
-
var
|
|
5963
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5822
5964
|
var SLIDE_MS = 200;
|
|
5823
5965
|
function reducedMotion() {
|
|
5824
5966
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5836,10 +5978,10 @@ function FilterDrawer({
|
|
|
5836
5978
|
size = "sm",
|
|
5837
5979
|
testIdPrefix
|
|
5838
5980
|
}) {
|
|
5839
|
-
const [view, setViewState] = (0,
|
|
5840
|
-
const [leaving, setLeaving] = (0,
|
|
5841
|
-
const [phase, setPhase] = (0,
|
|
5842
|
-
const [wasOpen, setWasOpen] = (0,
|
|
5981
|
+
const [view, setViewState] = (0, import_react33.useState)(focus);
|
|
5982
|
+
const [leaving, setLeaving] = (0, import_react33.useState)(null);
|
|
5983
|
+
const [phase, setPhase] = (0, import_react33.useState)("run");
|
|
5984
|
+
const [wasOpen, setWasOpen] = (0, import_react33.useState)(open);
|
|
5843
5985
|
if (open !== wasOpen) {
|
|
5844
5986
|
setWasOpen(open);
|
|
5845
5987
|
if (open) {
|
|
@@ -5854,20 +5996,20 @@ function FilterDrawer({
|
|
|
5854
5996
|
}
|
|
5855
5997
|
setViewState(next);
|
|
5856
5998
|
};
|
|
5857
|
-
(0,
|
|
5999
|
+
(0, import_react33.useLayoutEffect)(() => {
|
|
5858
6000
|
if (phase !== "start") return;
|
|
5859
6001
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setPhase("run")));
|
|
5860
6002
|
return () => cancelAnimationFrame(raf);
|
|
5861
6003
|
}, [phase]);
|
|
5862
|
-
(0,
|
|
6004
|
+
(0, import_react33.useEffect)(() => {
|
|
5863
6005
|
if (!leaving || phase !== "run") return;
|
|
5864
6006
|
const t = setTimeout(() => setLeaving(null), SLIDE_MS);
|
|
5865
6007
|
return () => clearTimeout(t);
|
|
5866
6008
|
}, [leaving, phase]);
|
|
5867
|
-
const backRef = (0,
|
|
5868
|
-
const rowRefs = (0,
|
|
5869
|
-
const lastView = (0,
|
|
5870
|
-
(0,
|
|
6009
|
+
const backRef = (0, import_react33.useRef)(null);
|
|
6010
|
+
const rowRefs = (0, import_react33.useRef)(/* @__PURE__ */ new Map());
|
|
6011
|
+
const lastView = (0, import_react33.useRef)(null);
|
|
6012
|
+
(0, import_react33.useEffect)(() => {
|
|
5871
6013
|
if (!open) return;
|
|
5872
6014
|
if (view) backRef.current?.focus();
|
|
5873
6015
|
else if (lastView.current) rowRefs.current.get(lastView.current)?.focus();
|
|
@@ -5880,8 +6022,8 @@ function FilterDrawer({
|
|
|
5880
6022
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5881
6023
|
const panel = (v, rows = true) => {
|
|
5882
6024
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5883
|
-
if (s) return /* @__PURE__ */ (0,
|
|
5884
|
-
return /* @__PURE__ */ (0,
|
|
6025
|
+
if (s) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
6026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("li", { className: "border-b border-border-default", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5885
6027
|
"button",
|
|
5886
6028
|
{
|
|
5887
6029
|
ref: rows ? (el) => {
|
|
@@ -5893,7 +6035,7 @@ function FilterDrawer({
|
|
|
5893
6035
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5894
6036
|
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",
|
|
5895
6037
|
children: [
|
|
5896
|
-
/* @__PURE__ */ (0,
|
|
6038
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5897
6039
|
x.icon,
|
|
5898
6040
|
{
|
|
5899
6041
|
size: 17,
|
|
@@ -5901,22 +6043,22 @@ function FilterDrawer({
|
|
|
5901
6043
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5902
6044
|
}
|
|
5903
6045
|
),
|
|
5904
|
-
/* @__PURE__ */ (0,
|
|
5905
|
-
x.badge && /* @__PURE__ */ (0,
|
|
5906
|
-
/* @__PURE__ */ (0,
|
|
6046
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
6047
|
+
x.badge && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brand", children: x.badge }),
|
|
6048
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react33.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5907
6049
|
]
|
|
5908
6050
|
}
|
|
5909
6051
|
) }, x.id)) });
|
|
5910
6052
|
};
|
|
5911
|
-
return /* @__PURE__ */ (0,
|
|
6053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5912
6054
|
Drawer,
|
|
5913
6055
|
{
|
|
5914
6056
|
open,
|
|
5915
6057
|
onClose,
|
|
5916
6058
|
size,
|
|
5917
6059
|
testIdPrefix,
|
|
5918
|
-
title: focused ? /* @__PURE__ */ (0,
|
|
5919
|
-
/* @__PURE__ */ (0,
|
|
6060
|
+
title: focused ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
6061
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5920
6062
|
"button",
|
|
5921
6063
|
{
|
|
5922
6064
|
ref: backRef,
|
|
@@ -5925,23 +6067,23 @@ function FilterDrawer({
|
|
|
5925
6067
|
"aria-label": "Back to all filters",
|
|
5926
6068
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5927
6069
|
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",
|
|
5928
|
-
children: /* @__PURE__ */ (0,
|
|
6070
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react33.ChevronLeft, { size: 18, "aria-hidden": "true" })
|
|
5929
6071
|
}
|
|
5930
6072
|
),
|
|
5931
6073
|
focused.label,
|
|
5932
|
-
focused.info && /* @__PURE__ */ (0,
|
|
5933
|
-
] }) : /* @__PURE__ */ (0,
|
|
6074
|
+
focused.info && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(InfoTip, { text: focused.info, label: `About ${focused.label}` })
|
|
6075
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex items-center gap-2.5", children: [
|
|
5934
6076
|
"Filters",
|
|
5935
|
-
activeCount > 0 && /* @__PURE__ */ (0,
|
|
6077
|
+
activeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5936
6078
|
] }),
|
|
5937
6079
|
footer: focused ? (
|
|
5938
6080
|
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5939
|
-
/* @__PURE__ */ (0,
|
|
5940
|
-
) : /* @__PURE__ */ (0,
|
|
5941
|
-
/* @__PURE__ */ (0,
|
|
5942
|
-
/* @__PURE__ */ (0,
|
|
5943
|
-
/* @__PURE__ */ (0,
|
|
5944
|
-
/* @__PURE__ */ (0,
|
|
6081
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
|
|
6082
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
6083
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
6084
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6085
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
6086
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5945
6087
|
Button,
|
|
5946
6088
|
{
|
|
5947
6089
|
variant: "primary",
|
|
@@ -5955,8 +6097,8 @@ function FilterDrawer({
|
|
|
5955
6097
|
)
|
|
5956
6098
|
] })
|
|
5957
6099
|
] }),
|
|
5958
|
-
children: /* @__PURE__ */ (0,
|
|
5959
|
-
/* @__PURE__ */ (0,
|
|
6100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
6101
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5960
6102
|
"div",
|
|
5961
6103
|
{
|
|
5962
6104
|
style: { transform: incoming },
|
|
@@ -5965,7 +6107,7 @@ function FilterDrawer({
|
|
|
5965
6107
|
},
|
|
5966
6108
|
view ?? "__list"
|
|
5967
6109
|
),
|
|
5968
|
-
leaving && /* @__PURE__ */ (0,
|
|
6110
|
+
leaving && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5969
6111
|
"div",
|
|
5970
6112
|
{
|
|
5971
6113
|
"aria-hidden": "true",
|
|
@@ -5981,11 +6123,11 @@ function FilterDrawer({
|
|
|
5981
6123
|
}
|
|
5982
6124
|
|
|
5983
6125
|
// src/AllFiltersButton.tsx
|
|
5984
|
-
var
|
|
6126
|
+
var import_react34 = require("react");
|
|
5985
6127
|
var import_lucide_react34 = require("lucide-react");
|
|
5986
|
-
var
|
|
5987
|
-
var AllFiltersButton = (0,
|
|
5988
|
-
return /* @__PURE__ */ (0,
|
|
6128
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6129
|
+
var AllFiltersButton = (0, import_react34.forwardRef)(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
6130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
5989
6131
|
"button",
|
|
5990
6132
|
{
|
|
5991
6133
|
ref,
|
|
@@ -5997,19 +6139,19 @@ var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2
|
|
|
5997
6139
|
className: cn(chipTriggerClass(), className),
|
|
5998
6140
|
...rest,
|
|
5999
6141
|
children: [
|
|
6000
|
-
/* @__PURE__ */ (0,
|
|
6001
|
-
/* @__PURE__ */ (0,
|
|
6002
|
-
count > 0 && /* @__PURE__ */ (0,
|
|
6142
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react34.SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
6144
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
6003
6145
|
]
|
|
6004
6146
|
}
|
|
6005
6147
|
);
|
|
6006
6148
|
});
|
|
6007
6149
|
|
|
6008
6150
|
// src/Menu.tsx
|
|
6009
|
-
var
|
|
6151
|
+
var import_react35 = require("react");
|
|
6010
6152
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
6011
6153
|
var import_lucide_react35 = require("lucide-react");
|
|
6012
|
-
var
|
|
6154
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6013
6155
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
6014
6156
|
function moveFocus(e) {
|
|
6015
6157
|
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -6021,8 +6163,8 @@ function moveFocus(e) {
|
|
|
6021
6163
|
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;
|
|
6022
6164
|
rows[next].focus();
|
|
6023
6165
|
}
|
|
6024
|
-
var Menu = (0,
|
|
6025
|
-
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6166
|
+
var Menu = (0, import_react35.forwardRef)(
|
|
6167
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6026
6168
|
"div",
|
|
6027
6169
|
{
|
|
6028
6170
|
ref,
|
|
@@ -6039,24 +6181,24 @@ var Menu = (0, import_react34.forwardRef)(
|
|
|
6039
6181
|
)
|
|
6040
6182
|
);
|
|
6041
6183
|
Menu.displayName = "Menu";
|
|
6042
|
-
var MenuItem = (0,
|
|
6184
|
+
var MenuItem = (0, import_react35.forwardRef)(
|
|
6043
6185
|
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
6044
6186
|
const Comp = asChild ? import_react_slot2.Slot : "button";
|
|
6045
6187
|
const radio = checked !== void 0;
|
|
6046
|
-
const body = /* @__PURE__ */ (0,
|
|
6047
|
-
icon && /* @__PURE__ */ (0,
|
|
6188
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
6189
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
6048
6190
|
asChild ? (
|
|
6049
6191
|
// The link's own text lands here; the link becomes the row.
|
|
6050
|
-
/* @__PURE__ */ (0,
|
|
6051
|
-
) : /* @__PURE__ */ (0,
|
|
6052
|
-
/* @__PURE__ */ (0,
|
|
6053
|
-
description && /* @__PURE__ */ (0,
|
|
6192
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_slot2.Slottable, { children })
|
|
6193
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
6194
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "block truncate", children }),
|
|
6195
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
6054
6196
|
] }),
|
|
6055
|
-
trailing && /* @__PURE__ */ (0,
|
|
6056
|
-
radio && checked && /* @__PURE__ */ (0,
|
|
6057
|
-
submenu && /* @__PURE__ */ (0,
|
|
6197
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
6198
|
+
radio && checked && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react35.Check, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
6199
|
+
submenu && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react35.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
6058
6200
|
] });
|
|
6059
|
-
return /* @__PURE__ */ (0,
|
|
6201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6060
6202
|
Comp,
|
|
6061
6203
|
{
|
|
6062
6204
|
ref,
|
|
@@ -6083,7 +6225,7 @@ var MenuItem = (0, import_react34.forwardRef)(
|
|
|
6083
6225
|
);
|
|
6084
6226
|
MenuItem.displayName = "MenuItem";
|
|
6085
6227
|
function MenuLabel({ className, testIdPrefix, children }) {
|
|
6086
|
-
return /* @__PURE__ */ (0,
|
|
6228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6087
6229
|
"div",
|
|
6088
6230
|
{
|
|
6089
6231
|
role: "presentation",
|
|
@@ -6094,7 +6236,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
|
|
|
6094
6236
|
);
|
|
6095
6237
|
}
|
|
6096
6238
|
function MenuSeparator({ className, testIdPrefix }) {
|
|
6097
|
-
return /* @__PURE__ */ (0,
|
|
6239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
6098
6240
|
}
|
|
6099
6241
|
|
|
6100
6242
|
// src/dates.ts
|
|
@@ -6208,15 +6350,15 @@ function defaultDateOrder(country) {
|
|
|
6208
6350
|
}
|
|
6209
6351
|
|
|
6210
6352
|
// src/Figure.tsx
|
|
6211
|
-
var
|
|
6353
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6212
6354
|
function Figure({ value, kind = "money", missing, ...opts }) {
|
|
6213
|
-
if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */ (0,
|
|
6355
|
+
if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(NoValue, { reason: missing });
|
|
6214
6356
|
const short = kind === "money" ? formatMoney(value, opts) : formatCount(value, opts);
|
|
6215
6357
|
const full = kind === "money" ? formatMoneyFull(value, opts) : formatCountFull(value);
|
|
6216
|
-
if (short === full) return /* @__PURE__ */ (0,
|
|
6217
|
-
return /* @__PURE__ */ (0,
|
|
6218
|
-
/* @__PURE__ */ (0,
|
|
6219
|
-
/* @__PURE__ */ (0,
|
|
6358
|
+
if (short === full) return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: short });
|
|
6359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Tooltip, { label: full, delay: 300, children: [
|
|
6360
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { "aria-hidden": "true", children: short }),
|
|
6361
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: full })
|
|
6220
6362
|
] });
|
|
6221
6363
|
}
|
|
6222
6364
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -6232,6 +6374,7 @@ function Figure({ value, kind = "money", missing, ...opts }) {
|
|
|
6232
6374
|
Button,
|
|
6233
6375
|
Card,
|
|
6234
6376
|
ChartLegend,
|
|
6377
|
+
ChartSkeleton,
|
|
6235
6378
|
CheckBox,
|
|
6236
6379
|
CheckBoxBox,
|
|
6237
6380
|
ChipContent,
|
|
@@ -6253,6 +6396,8 @@ function Figure({ value, kind = "money", missing, ...opts }) {
|
|
|
6253
6396
|
InlineMessage,
|
|
6254
6397
|
LegendItem,
|
|
6255
6398
|
LineChartPlaceholder,
|
|
6399
|
+
LoadError,
|
|
6400
|
+
LongWait,
|
|
6256
6401
|
MediaLabel,
|
|
6257
6402
|
Menu,
|
|
6258
6403
|
MenuItem,
|
|
@@ -6273,6 +6418,7 @@ function Figure({ value, kind = "money", missing, ...opts }) {
|
|
|
6273
6418
|
PrimaryBadge,
|
|
6274
6419
|
PublisherBreakdownList,
|
|
6275
6420
|
QUIET_ACTION_CLASS,
|
|
6421
|
+
RefreshLine,
|
|
6276
6422
|
SearchBar,
|
|
6277
6423
|
SectionHeading,
|
|
6278
6424
|
SectionRail,
|
|
@@ -6281,9 +6427,12 @@ function Figure({ value, kind = "money", missing, ...opts }) {
|
|
|
6281
6427
|
SelectFilter,
|
|
6282
6428
|
SelectedSection,
|
|
6283
6429
|
SelectionPicker,
|
|
6430
|
+
Skeleton,
|
|
6431
|
+
SkeletonLines,
|
|
6284
6432
|
SortButton,
|
|
6285
6433
|
StackedColumnPlaceholder,
|
|
6286
6434
|
StatStrip,
|
|
6435
|
+
StatStripSkeleton,
|
|
6287
6436
|
StatTile,
|
|
6288
6437
|
SuggestionChip,
|
|
6289
6438
|
TableLink,
|
|
@@ -6320,6 +6469,7 @@ function Figure({ value, kind = "money", missing, ...opts }) {
|
|
|
6320
6469
|
formatWeek,
|
|
6321
6470
|
noResultsBody,
|
|
6322
6471
|
resolveRange,
|
|
6323
|
-
sortProp
|
|
6472
|
+
sortProp,
|
|
6473
|
+
useDelayedLoading
|
|
6324
6474
|
});
|
|
6325
6475
|
//# sourceMappingURL=index.cjs.map
|