@mediaradar/design-components 0.58.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 +1110 -817
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +241 -29
- package/dist/index.d.ts +241 -29
- package/dist/index.js +1037 -755
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2147,45 +2147,268 @@ function SelectFilter({
|
|
|
2147
2147
|
}
|
|
2148
2148
|
|
|
2149
2149
|
// src/Card.tsx
|
|
2150
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
2151
|
+
|
|
2152
|
+
// src/Skeleton.tsx
|
|
2153
|
+
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
2154
|
+
|
|
2155
|
+
// src/Button.tsx
|
|
2150
2156
|
import { forwardRef as forwardRef3 } from "react";
|
|
2157
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2158
|
+
import { cva } from "class-variance-authority";
|
|
2159
|
+
import { Loader2 } from "lucide-react";
|
|
2151
2160
|
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2152
|
-
var
|
|
2161
|
+
var buttonVariants = cva(
|
|
2162
|
+
"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",
|
|
2163
|
+
{
|
|
2164
|
+
variants: {
|
|
2165
|
+
variant: {
|
|
2166
|
+
primary: "bg-brand-primaryAction text-brand-onprimary hover:brightness-110",
|
|
2167
|
+
// border-strong, not border-interactive. The interactive token is #6b6358
|
|
2168
|
+
// -- 5.9:1 against the surface, nearly as dark as body text -- which is
|
|
2169
|
+
// right for an input the eye must find in a form, and far too heavy for
|
|
2170
|
+
// a button sitting beside other buttons. It reads heaviest on icon-only,
|
|
2171
|
+
// where there is least fill inside the line to balance it.
|
|
2172
|
+
secondary: "bg-surface text-text-primary border border-border-strong hover:bg-subtle hover:border-border-interactive",
|
|
2173
|
+
ghost: "text-text-primary hover:bg-subtle",
|
|
2174
|
+
danger: "bg-status-danger text-status-onstatus hover:brightness-110",
|
|
2175
|
+
// Quiet destructive: neutral at rest, red only on hover. This is what
|
|
2176
|
+
// the product actually reaches for -- nearly every hand-rolled
|
|
2177
|
+
// destructive control is an icon that reddens on hover, while filled
|
|
2178
|
+
// `danger` is right only for the confirm button in a dialog the user
|
|
2179
|
+
// already opened.
|
|
2180
|
+
dangerGhost: "text-text-secondary hover:bg-subtle hover:text-text-danger",
|
|
2181
|
+
link: "text-text-link underline-offset-4 hover:underline px-0"
|
|
2182
|
+
},
|
|
2183
|
+
// Type scales with the box. One size across all three left xs cramped --
|
|
2184
|
+
// 14px inside a 24px box leaves five pixels above and below, so the label
|
|
2185
|
+
// fills the button instead of sitting in it.
|
|
2186
|
+
size: {
|
|
2187
|
+
xs: "h-6 px-2 text-xs",
|
|
2188
|
+
sm: "h-8 px-3 text-sm",
|
|
2189
|
+
md: "h-10 px-4 text-sm",
|
|
2190
|
+
// 44, the filter row's height, so a button at the end of a row of
|
|
2191
|
+
// filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
|
|
2192
|
+
lg: "h-11 px-5 text-sm"
|
|
2193
|
+
},
|
|
2194
|
+
// Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
|
|
2195
|
+
// be one dimension, so an icon button never lined up with the labelled
|
|
2196
|
+
// buttons beside it in a toolbar. As a shape it squares the box at
|
|
2197
|
+
// whichever height you picked.
|
|
2198
|
+
iconOnly: {
|
|
2199
|
+
true: "p-0",
|
|
2200
|
+
false: ""
|
|
2201
|
+
}
|
|
2202
|
+
},
|
|
2203
|
+
compoundVariants: [
|
|
2204
|
+
{ size: "xs", iconOnly: true, class: "w-6" },
|
|
2205
|
+
{ size: "sm", iconOnly: true, class: "w-8" },
|
|
2206
|
+
{ size: "md", iconOnly: true, class: "w-10" },
|
|
2207
|
+
{ size: "lg", iconOnly: true, class: "w-11" },
|
|
2208
|
+
// A boxed button is a target you aim at, so its label carries the weight
|
|
2209
|
+
// of one. `link` sits inline in a sentence, where semibold reads as
|
|
2210
|
+
// emphasis on the words rather than as a control.
|
|
2211
|
+
{ variant: ["primary", "secondary", "ghost", "danger", "dangerGhost"], class: "font-semibold" },
|
|
2212
|
+
{ variant: "link", class: "font-medium h-auto p-0" }
|
|
2213
|
+
],
|
|
2214
|
+
defaultVariants: {
|
|
2215
|
+
variant: "primary",
|
|
2216
|
+
size: "md",
|
|
2217
|
+
iconOnly: false
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
);
|
|
2221
|
+
var Button = forwardRef3(
|
|
2222
|
+
({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
|
|
2223
|
+
const shared = {
|
|
2224
|
+
className: cn(buttonVariants({ variant, size, iconOnly, className })),
|
|
2225
|
+
"data-testid": testIdPrefix,
|
|
2226
|
+
disabled: disabled || loading,
|
|
2227
|
+
"aria-busy": loading || void 0,
|
|
2228
|
+
...props
|
|
2229
|
+
};
|
|
2230
|
+
if (asChild) {
|
|
2231
|
+
return /* @__PURE__ */ jsx15(Slot, { ref, ...shared, children });
|
|
2232
|
+
}
|
|
2233
|
+
return /* @__PURE__ */ jsxs14("button", { ref, ...shared, children: [
|
|
2234
|
+
loading && /* @__PURE__ */ jsx15(Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
2235
|
+
children
|
|
2236
|
+
] });
|
|
2237
|
+
}
|
|
2238
|
+
);
|
|
2239
|
+
Button.displayName = "Button";
|
|
2240
|
+
|
|
2241
|
+
// src/Skeleton.tsx
|
|
2242
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2243
|
+
var STYLE_ID = "mrLoadingStyle";
|
|
2244
|
+
var CSS = `
|
|
2245
|
+
[data-mr-skeleton]{position:relative;overflow:hidden}
|
|
2246
|
+
[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}
|
|
2247
|
+
[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}
|
|
2248
|
+
@keyframes mr-shimmer{100%{transform:translateX(100%)}}
|
|
2249
|
+
@keyframes mr-refresh{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
|
|
2250
|
+
@media (prefers-reduced-motion:reduce){[data-mr-skeleton]::after{animation:none;display:none}[data-mr-refresh-line]{animation:none;width:100%;opacity:.5}}
|
|
2251
|
+
`;
|
|
2252
|
+
function useLoadingStyle() {
|
|
2253
|
+
useEffect7(() => {
|
|
2254
|
+
if (typeof document === "undefined" || document.getElementById(STYLE_ID)) return;
|
|
2255
|
+
const el = document.createElement("style");
|
|
2256
|
+
el.id = STYLE_ID;
|
|
2257
|
+
el.textContent = CSS;
|
|
2258
|
+
document.head.append(el);
|
|
2259
|
+
}, []);
|
|
2260
|
+
}
|
|
2261
|
+
function useDelayedLoading(loading, delay = 300, min = 500) {
|
|
2262
|
+
const [show, setShow] = useState7(false);
|
|
2263
|
+
const [shownAt, setShownAt] = useState7(0);
|
|
2264
|
+
useEffect7(() => {
|
|
2265
|
+
if (loading && !show) {
|
|
2266
|
+
const t = setTimeout(() => {
|
|
2267
|
+
setShow(true);
|
|
2268
|
+
setShownAt(Date.now());
|
|
2269
|
+
}, delay);
|
|
2270
|
+
return () => clearTimeout(t);
|
|
2271
|
+
}
|
|
2272
|
+
if (!loading && show) {
|
|
2273
|
+
const t = setTimeout(() => setShow(false), Math.max(0, min - (Date.now() - shownAt)));
|
|
2274
|
+
return () => clearTimeout(t);
|
|
2275
|
+
}
|
|
2276
|
+
return void 0;
|
|
2277
|
+
}, [loading, show, shownAt, delay, min]);
|
|
2278
|
+
return show;
|
|
2279
|
+
}
|
|
2280
|
+
var SHAPE = { line: "h-3 rounded-pill", block: "rounded-control", circle: "rounded-full" };
|
|
2281
|
+
function Skeleton({ shape = "line", className, style, testIdPrefix }) {
|
|
2282
|
+
useLoadingStyle();
|
|
2283
|
+
return /* @__PURE__ */ jsx16(
|
|
2284
|
+
"span",
|
|
2285
|
+
{
|
|
2286
|
+
"aria-hidden": "true",
|
|
2287
|
+
"data-mr-skeleton": "",
|
|
2288
|
+
"data-testid": testIdPrefix,
|
|
2289
|
+
className: cn("block bg-subtle", SHAPE[shape], className),
|
|
2290
|
+
style
|
|
2291
|
+
}
|
|
2292
|
+
);
|
|
2293
|
+
}
|
|
2294
|
+
function SkeletonLines({ lines = 3, className }) {
|
|
2295
|
+
return /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", className: cn("flex flex-col gap-2", className), children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx16(Skeleton, { className: i === lines - 1 ? "w-2/3" : "w-full" }, i)) });
|
|
2296
|
+
}
|
|
2297
|
+
function ChartSkeleton({ className }) {
|
|
2298
|
+
const bars = [55, 80, 40, 95, 70, 60, 85];
|
|
2299
|
+
return /* @__PURE__ */ jsxs15("span", { "aria-hidden": "true", className: cn("flex h-48 flex-col gap-2", className), children: [
|
|
2300
|
+
/* @__PURE__ */ jsx16("span", { className: "flex flex-1 items-end gap-3", children: bars.map((h, i) => /* @__PURE__ */ jsx16(Skeleton, { shape: "block", className: "flex-1", style: { height: `${h}%` } }, i)) }),
|
|
2301
|
+
/* @__PURE__ */ jsx16("span", { className: "flex gap-3", children: bars.map((_, i) => /* @__PURE__ */ jsx16(Skeleton, { className: "h-2 flex-1" }, i)) })
|
|
2302
|
+
] });
|
|
2303
|
+
}
|
|
2304
|
+
function StatStripSkeleton({ tiles = 3, className }) {
|
|
2305
|
+
return /* @__PURE__ */ jsx16(
|
|
2306
|
+
"span",
|
|
2307
|
+
{
|
|
2308
|
+
"aria-hidden": "true",
|
|
2309
|
+
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),
|
|
2310
|
+
children: Array.from({ length: tiles }, (_, i) => /* @__PURE__ */ jsxs15("span", { className: "flex flex-col gap-2 px-5 py-3", children: [
|
|
2311
|
+
/* @__PURE__ */ jsx16(Skeleton, { className: "h-2 w-20" }),
|
|
2312
|
+
/* @__PURE__ */ jsx16(Skeleton, { className: "h-6 w-24" }),
|
|
2313
|
+
/* @__PURE__ */ jsx16(Skeleton, { className: "h-2 w-28" })
|
|
2314
|
+
] }, i))
|
|
2315
|
+
}
|
|
2316
|
+
);
|
|
2317
|
+
}
|
|
2318
|
+
function LongWait({ loading, onRetry, hint = "Large date ranges take longer.", className }) {
|
|
2319
|
+
const [stage, setStage] = useState7(0);
|
|
2320
|
+
useEffect7(() => {
|
|
2321
|
+
setStage(0);
|
|
2322
|
+
if (!loading) return void 0;
|
|
2323
|
+
const a = setTimeout(() => setStage(1), 5e3);
|
|
2324
|
+
const b = setTimeout(() => setStage(2), 3e4);
|
|
2325
|
+
return () => {
|
|
2326
|
+
clearTimeout(a);
|
|
2327
|
+
clearTimeout(b);
|
|
2328
|
+
};
|
|
2329
|
+
}, [loading]);
|
|
2330
|
+
if (!loading || stage === 0) return null;
|
|
2331
|
+
return /* @__PURE__ */ jsxs15("p", { role: "status", className: cn("mt-3 flex items-center gap-2 text-xs text-text-tertiary", className), children: [
|
|
2332
|
+
stage === 1 ? `Still loading. ${hint}` : "This is taking longer than usual.",
|
|
2333
|
+
stage === 2 && onRetry && /* @__PURE__ */ jsx16(Button, { variant: "link", size: "sm", onClick: onRetry, children: "Retry" })
|
|
2334
|
+
] });
|
|
2335
|
+
}
|
|
2336
|
+
function LoadError({ onRetry, children = "Couldn't load this." }) {
|
|
2337
|
+
return /* @__PURE__ */ jsxs15("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: [
|
|
2338
|
+
/* @__PURE__ */ jsx16("span", { children }),
|
|
2339
|
+
onRetry && /* @__PURE__ */ jsx16(Button, { variant: "secondary", size: "sm", onClick: onRetry, children: "Try again" })
|
|
2340
|
+
] });
|
|
2341
|
+
}
|
|
2342
|
+
function RefreshLine() {
|
|
2343
|
+
useLoadingStyle();
|
|
2344
|
+
return /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-x-0 top-0 h-0.5 overflow-hidden", children: /* @__PURE__ */ jsx16("span", { "data-mr-refresh-line": "" }) });
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
// src/Card.tsx
|
|
2348
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2349
|
+
var Card = forwardRef4(function Card2({
|
|
2350
|
+
staticCard,
|
|
2351
|
+
title,
|
|
2352
|
+
titleAs: TitleTag = "h3",
|
|
2353
|
+
subtitle,
|
|
2354
|
+
info,
|
|
2355
|
+
variant = "default",
|
|
2356
|
+
action,
|
|
2357
|
+
className,
|
|
2358
|
+
testIdPrefix,
|
|
2359
|
+
children,
|
|
2360
|
+
loading = false,
|
|
2361
|
+
skeleton,
|
|
2362
|
+
refreshing = false,
|
|
2363
|
+
error = false,
|
|
2364
|
+
onRetry,
|
|
2365
|
+
...rest
|
|
2366
|
+
}, ref) {
|
|
2153
2367
|
const chart = variant === "chart";
|
|
2154
|
-
|
|
2368
|
+
const showSkeleton = useDelayedLoading(loading);
|
|
2369
|
+
const body = error ? /* @__PURE__ */ jsx17("div", { className: "flex min-h-48 flex-1 flex-col", children: /* @__PURE__ */ jsx17(LoadError, { onRetry }) }) : loading ? /* @__PURE__ */ jsxs16("div", { className: "flex min-h-48 flex-1 flex-col", children: [
|
|
2370
|
+
showSkeleton && (skeleton ?? /* @__PURE__ */ jsx17(ChartSkeleton, {})),
|
|
2371
|
+
/* @__PURE__ */ jsx17(LongWait, { loading, onRetry })
|
|
2372
|
+
] }) : refreshing ? /* @__PURE__ */ jsx17("div", { className: "flex flex-1 flex-col opacity-50 transition-opacity motion-reduce:transition-none", children }) : children;
|
|
2373
|
+
return /* @__PURE__ */ jsxs16(
|
|
2155
2374
|
"article",
|
|
2156
2375
|
{
|
|
2157
2376
|
ref,
|
|
2158
2377
|
className: cn(
|
|
2159
|
-
"flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
|
|
2378
|
+
"relative flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
|
|
2160
2379
|
!chart && "shadow-raised",
|
|
2161
2380
|
// Interactive hover: deeper drop shadow only -- no elevation/transform.
|
|
2162
2381
|
!staticCard && !chart && "group transition-shadow hover:shadow-overlay",
|
|
2163
2382
|
className
|
|
2164
2383
|
),
|
|
2165
2384
|
"data-testid": testIdPrefix,
|
|
2385
|
+
"aria-busy": loading || refreshing || void 0,
|
|
2166
2386
|
...rest,
|
|
2167
|
-
children:
|
|
2168
|
-
/* @__PURE__ */
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2387
|
+
children: [
|
|
2388
|
+
refreshing && !loading && !error && /* @__PURE__ */ jsx17(RefreshLine, {}),
|
|
2389
|
+
title ? /* @__PURE__ */ jsxs16("div", { className: "flex flex-1 flex-col p-card-padding", children: [
|
|
2390
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2391
|
+
/* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
|
|
2392
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5", children: [
|
|
2393
|
+
/* @__PURE__ */ jsx17(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
|
|
2394
|
+
info && /* @__PURE__ */ jsx17(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
|
|
2395
|
+
] }),
|
|
2396
|
+
subtitle && /* @__PURE__ */ jsx17("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
2173
2397
|
] }),
|
|
2174
|
-
|
|
2398
|
+
action && /* @__PURE__ */ jsx17("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
2175
2399
|
] }),
|
|
2176
|
-
|
|
2177
|
-
] })
|
|
2178
|
-
|
|
2179
|
-
] }) : children
|
|
2400
|
+
/* @__PURE__ */ jsx17("div", { className: "mt-4 flex flex-1 flex-col", children: body })
|
|
2401
|
+
] }) : body
|
|
2402
|
+
]
|
|
2180
2403
|
}
|
|
2181
2404
|
);
|
|
2182
2405
|
});
|
|
2183
2406
|
|
|
2184
2407
|
// src/StatStrip.tsx
|
|
2185
|
-
import { forwardRef as
|
|
2186
|
-
import { jsx as
|
|
2187
|
-
var StatStrip =
|
|
2188
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */
|
|
2408
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
2409
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2410
|
+
var StatStrip = forwardRef5(
|
|
2411
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
2189
2412
|
"div",
|
|
2190
2413
|
{
|
|
2191
2414
|
ref,
|
|
@@ -2203,32 +2426,32 @@ var StatStrip = forwardRef4(
|
|
|
2203
2426
|
);
|
|
2204
2427
|
StatStrip.displayName = "StatStrip";
|
|
2205
2428
|
function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
|
|
2206
|
-
return /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
icon && /* @__PURE__ */
|
|
2429
|
+
return /* @__PURE__ */ jsxs17("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
|
|
2430
|
+
/* @__PURE__ */ jsxs17("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
|
|
2431
|
+
icon && /* @__PURE__ */ jsx18("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
|
|
2209
2432
|
label,
|
|
2210
|
-
info && /* @__PURE__ */
|
|
2433
|
+
info && /* @__PURE__ */ jsx18(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
|
|
2211
2434
|
] }),
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ jsxs17("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
|
|
2436
|
+
/* @__PURE__ */ jsxs17("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
|
|
2214
2437
|
value,
|
|
2215
|
-
unit && /* @__PURE__ */
|
|
2438
|
+
unit && /* @__PURE__ */ jsxs17("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
|
|
2216
2439
|
" ",
|
|
2217
2440
|
unit
|
|
2218
2441
|
] })
|
|
2219
2442
|
] }),
|
|
2220
|
-
change && /* @__PURE__ */
|
|
2443
|
+
change && /* @__PURE__ */ jsx18("span", { className: "text-card-title font-medium", children: change })
|
|
2221
2444
|
] }),
|
|
2222
|
-
note && /* @__PURE__ */
|
|
2223
|
-
children && /* @__PURE__ */
|
|
2445
|
+
note && /* @__PURE__ */ jsx18("span", { className: "text-xs text-text-tertiary", children: note }),
|
|
2446
|
+
children && /* @__PURE__ */ jsx18("div", { className: "text-xs text-text-secondary", children })
|
|
2224
2447
|
] });
|
|
2225
2448
|
}
|
|
2226
2449
|
|
|
2227
2450
|
// src/ChartLegend.tsx
|
|
2228
|
-
import { forwardRef as
|
|
2229
|
-
import { jsx as
|
|
2230
|
-
var ChartLegend =
|
|
2231
|
-
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */
|
|
2451
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
2452
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2453
|
+
var ChartLegend = forwardRef6(
|
|
2454
|
+
({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
2232
2455
|
"ul",
|
|
2233
2456
|
{
|
|
2234
2457
|
ref,
|
|
@@ -2248,8 +2471,8 @@ var MARK = {
|
|
|
2248
2471
|
};
|
|
2249
2472
|
function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
|
|
2250
2473
|
const dashed = mark === "dashed";
|
|
2251
|
-
return /* @__PURE__ */
|
|
2252
|
-
/* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ jsxs18("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
|
|
2475
|
+
/* @__PURE__ */ jsx19(
|
|
2253
2476
|
"span",
|
|
2254
2477
|
{
|
|
2255
2478
|
"aria-hidden": "true",
|
|
@@ -2263,7 +2486,7 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2263
2486
|
style: color ? dashed ? { borderColor: color } : { background: color } : void 0
|
|
2264
2487
|
}
|
|
2265
2488
|
),
|
|
2266
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsxs18("span", { children: [
|
|
2267
2490
|
children,
|
|
2268
2491
|
you && " (you)"
|
|
2269
2492
|
] })
|
|
@@ -2271,30 +2494,30 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
|
|
|
2271
2494
|
}
|
|
2272
2495
|
|
|
2273
2496
|
// src/BarList.tsx
|
|
2274
|
-
import { jsx as
|
|
2497
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2275
2498
|
var COL_WIDTH = ["w-16", "w-13"];
|
|
2276
2499
|
function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
|
|
2277
2500
|
if (!rows.length) {
|
|
2278
|
-
return empty ? /* @__PURE__ */
|
|
2501
|
+
return empty ? /* @__PURE__ */ jsx20("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
|
|
2279
2502
|
}
|
|
2280
2503
|
const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
|
|
2281
2504
|
const full = !!columns?.length;
|
|
2282
2505
|
const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
|
|
2283
|
-
return /* @__PURE__ */
|
|
2284
|
-
full && /* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2286
|
-
columns.map((c, i) => /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsxs19("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
|
|
2507
|
+
full && /* @__PURE__ */ jsxs19("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
|
|
2508
|
+
/* @__PURE__ */ jsx20("span", { className: "flex-1" }),
|
|
2509
|
+
columns.map((c, i) => /* @__PURE__ */ jsx20("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
|
|
2287
2510
|
] }),
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx20("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ jsxs19("li", { className: "py-2", children: [
|
|
2512
|
+
/* @__PURE__ */ jsxs19("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
2513
|
+
/* @__PURE__ */ jsxs19("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
|
|
2291
2514
|
r.label,
|
|
2292
|
-
r.note && /* @__PURE__ */
|
|
2515
|
+
r.note && /* @__PURE__ */ jsxs19("span", { className: "font-normal text-text-tertiary", children: [
|
|
2293
2516
|
" \xB7 ",
|
|
2294
2517
|
r.note
|
|
2295
2518
|
] })
|
|
2296
2519
|
] }),
|
|
2297
|
-
r.values?.map((v, i) => /* @__PURE__ */
|
|
2520
|
+
r.values?.map((v, i) => /* @__PURE__ */ jsxs19(
|
|
2298
2521
|
"span",
|
|
2299
2522
|
{
|
|
2300
2523
|
className: cn(
|
|
@@ -2303,7 +2526,7 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2303
2526
|
colClass(i)
|
|
2304
2527
|
),
|
|
2305
2528
|
children: [
|
|
2306
|
-
full && /* @__PURE__ */
|
|
2529
|
+
full && /* @__PURE__ */ jsxs19("span", { className: "sr-only", children: [
|
|
2307
2530
|
columns[i],
|
|
2308
2531
|
": "
|
|
2309
2532
|
] }),
|
|
@@ -2313,15 +2536,15 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2313
2536
|
i
|
|
2314
2537
|
))
|
|
2315
2538
|
] }),
|
|
2316
|
-
/* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ jsxs19("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
|
|
2540
|
+
/* @__PURE__ */ jsx20(
|
|
2318
2541
|
"div",
|
|
2319
2542
|
{
|
|
2320
2543
|
className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
|
|
2321
2544
|
style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
|
|
2322
2545
|
}
|
|
2323
2546
|
),
|
|
2324
|
-
r.tick !== void 0 && /* @__PURE__ */
|
|
2547
|
+
r.tick !== void 0 && /* @__PURE__ */ jsx20(
|
|
2325
2548
|
"span",
|
|
2326
2549
|
{
|
|
2327
2550
|
className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
|
|
@@ -2329,14 +2552,14 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
|
|
|
2329
2552
|
}
|
|
2330
2553
|
)
|
|
2331
2554
|
] }),
|
|
2332
|
-
r.tickLabel && /* @__PURE__ */
|
|
2555
|
+
r.tickLabel && /* @__PURE__ */ jsx20("span", { className: "sr-only", children: r.tickLabel })
|
|
2333
2556
|
] }, r.key)) })
|
|
2334
2557
|
] });
|
|
2335
2558
|
}
|
|
2336
2559
|
|
|
2337
2560
|
// src/NoResultsEmptyState.tsx
|
|
2338
2561
|
import { FilterX } from "lucide-react";
|
|
2339
|
-
import { jsx as
|
|
2562
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2340
2563
|
var NO_RESULTS_TITLE = "No results match your filters";
|
|
2341
2564
|
var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
|
|
2342
2565
|
function noResultsBody(workspaceName) {
|
|
@@ -2359,12 +2582,12 @@ function NoResultsEmptyState({
|
|
|
2359
2582
|
const showClear = hasFilters !== false && Boolean(onClearFilters);
|
|
2360
2583
|
const showEdit = Boolean(onEditFilters);
|
|
2361
2584
|
const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
|
|
2362
|
-
return /* @__PURE__ */
|
|
2363
|
-
/* @__PURE__ */
|
|
2364
|
-
/* @__PURE__ */
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
hasActions && /* @__PURE__ */
|
|
2367
|
-
showClear && /* @__PURE__ */
|
|
2585
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2586
|
+
/* @__PURE__ */ jsx21("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ jsx21(FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2587
|
+
/* @__PURE__ */ jsx21("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2588
|
+
/* @__PURE__ */ jsx21("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2589
|
+
hasActions && /* @__PURE__ */ jsxs20("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2590
|
+
showClear && /* @__PURE__ */ jsx21(
|
|
2368
2591
|
"button",
|
|
2369
2592
|
{
|
|
2370
2593
|
type: "button",
|
|
@@ -2374,7 +2597,7 @@ function NoResultsEmptyState({
|
|
|
2374
2597
|
children: "Clear all filters"
|
|
2375
2598
|
}
|
|
2376
2599
|
),
|
|
2377
|
-
showEdit && /* @__PURE__ */
|
|
2600
|
+
showEdit && /* @__PURE__ */ jsx21(
|
|
2378
2601
|
"button",
|
|
2379
2602
|
{
|
|
2380
2603
|
type: "button",
|
|
@@ -2384,7 +2607,7 @@ function NoResultsEmptyState({
|
|
|
2384
2607
|
children: "Edit filters"
|
|
2385
2608
|
}
|
|
2386
2609
|
),
|
|
2387
|
-
actions?.map((action, i) => /* @__PURE__ */
|
|
2610
|
+
actions?.map((action, i) => /* @__PURE__ */ jsx21(
|
|
2388
2611
|
"button",
|
|
2389
2612
|
{
|
|
2390
2613
|
type: "button",
|
|
@@ -2399,11 +2622,11 @@ function NoResultsEmptyState({
|
|
|
2399
2622
|
}
|
|
2400
2623
|
|
|
2401
2624
|
// src/WorkspaceSelectedCard.tsx
|
|
2402
|
-
import { useEffect as
|
|
2625
|
+
import { useEffect as useEffect8, useRef as useRef8, useState as useState8 } from "react";
|
|
2403
2626
|
import { ChevronDown as ChevronDown6, X as X3 } from "lucide-react";
|
|
2404
|
-
import { jsx as
|
|
2627
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2405
2628
|
function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
2406
|
-
return /* @__PURE__ */
|
|
2629
|
+
return /* @__PURE__ */ jsx22(
|
|
2407
2630
|
"aside",
|
|
2408
2631
|
{
|
|
2409
2632
|
className: cn(
|
|
@@ -2411,7 +2634,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
|
|
|
2411
2634
|
className
|
|
2412
2635
|
),
|
|
2413
2636
|
"data-testid": testIdPrefix,
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2637
|
+
children: /* @__PURE__ */ jsx22("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ jsx22(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
|
|
2415
2638
|
}
|
|
2416
2639
|
);
|
|
2417
2640
|
}
|
|
@@ -2423,15 +2646,15 @@ function SummaryGroupItem({
|
|
|
2423
2646
|
const ownCount = group.items.length;
|
|
2424
2647
|
const subCount = (group.subGroups ?? []).reduce((n, sg) => n + sg.items.length, 0);
|
|
2425
2648
|
const expandCount = ownCount + subCount;
|
|
2426
|
-
const [open, setOpen] =
|
|
2649
|
+
const [open, setOpen] = useState8(expandCount > 0);
|
|
2427
2650
|
const wasEmpty = useRef8(expandCount === 0);
|
|
2428
|
-
|
|
2651
|
+
useEffect8(() => {
|
|
2429
2652
|
if (wasEmpty.current && expandCount > 0) setOpen(true);
|
|
2430
2653
|
else if (expandCount === 0) setOpen(false);
|
|
2431
2654
|
wasEmpty.current = expandCount === 0;
|
|
2432
2655
|
}, [expandCount]);
|
|
2433
|
-
return /* @__PURE__ */
|
|
2434
|
-
/* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ jsxs21("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
|
|
2657
|
+
/* @__PURE__ */ jsxs21(
|
|
2435
2658
|
"button",
|
|
2436
2659
|
{
|
|
2437
2660
|
type: "button",
|
|
@@ -2440,7 +2663,7 @@ function SummaryGroupItem({
|
|
|
2440
2663
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2441
2664
|
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",
|
|
2442
2665
|
children: [
|
|
2443
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsx22(
|
|
2444
2667
|
ChevronDown6,
|
|
2445
2668
|
{
|
|
2446
2669
|
size: 14,
|
|
@@ -2448,37 +2671,37 @@ function SummaryGroupItem({
|
|
|
2448
2671
|
className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
|
|
2449
2672
|
}
|
|
2450
2673
|
),
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
/* @__PURE__ */
|
|
2674
|
+
/* @__PURE__ */ jsx22("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
|
|
2675
|
+
/* @__PURE__ */ jsx22("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
|
|
2453
2676
|
]
|
|
2454
2677
|
}
|
|
2455
2678
|
),
|
|
2456
|
-
open && /* @__PURE__ */
|
|
2457
|
-
ownCount > 0 && /* @__PURE__ */
|
|
2458
|
-
group.items.map((item) => /* @__PURE__ */
|
|
2679
|
+
open && /* @__PURE__ */ jsx22("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ jsx22("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-2.5", children: [
|
|
2680
|
+
ownCount > 0 && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1.5", children: [
|
|
2681
|
+
group.items.map((item) => /* @__PURE__ */ jsxs21(
|
|
2459
2682
|
"div",
|
|
2460
2683
|
{
|
|
2461
2684
|
className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
|
|
2462
2685
|
children: [
|
|
2463
|
-
/* @__PURE__ */
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
item.meta && /* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ jsxs21("span", { className: "min-w-0 flex-1", children: [
|
|
2687
|
+
/* @__PURE__ */ jsx22("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
|
|
2688
|
+
item.meta && /* @__PURE__ */ jsx22("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
|
|
2466
2689
|
] }),
|
|
2467
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx22(
|
|
2468
2691
|
"button",
|
|
2469
2692
|
{
|
|
2470
2693
|
type: "button",
|
|
2471
2694
|
"aria-label": `Remove ${item.name}`,
|
|
2472
2695
|
onClick: () => group.onRemove(item.id),
|
|
2473
2696
|
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",
|
|
2474
|
-
children: /* @__PURE__ */
|
|
2697
|
+
children: /* @__PURE__ */ jsx22(X3, { size: 12, "aria-hidden": "true" })
|
|
2475
2698
|
}
|
|
2476
2699
|
)
|
|
2477
2700
|
]
|
|
2478
2701
|
},
|
|
2479
2702
|
item.id
|
|
2480
2703
|
)),
|
|
2481
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ jsx22(
|
|
2482
2705
|
"button",
|
|
2483
2706
|
{
|
|
2484
2707
|
type: "button",
|
|
@@ -2489,13 +2712,13 @@ function SummaryGroupItem({
|
|
|
2489
2712
|
}
|
|
2490
2713
|
)
|
|
2491
2714
|
] }),
|
|
2492
|
-
group.subGroups?.map((sg) => /* @__PURE__ */
|
|
2715
|
+
group.subGroups?.map((sg) => /* @__PURE__ */ jsx22(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
|
|
2493
2716
|
] }) })
|
|
2494
2717
|
] });
|
|
2495
2718
|
}
|
|
2496
2719
|
|
|
2497
2720
|
// src/chart-placeholder-shared.tsx
|
|
2498
|
-
import { jsx as
|
|
2721
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2499
2722
|
var GRID_ROWS = [0, 25, 50, 75, 100];
|
|
2500
2723
|
var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
|
|
2501
2724
|
var Y_AXIS_W = 48;
|
|
@@ -2509,9 +2732,9 @@ function AxisFrame({
|
|
|
2509
2732
|
testIdPrefix
|
|
2510
2733
|
}) {
|
|
2511
2734
|
const gutter = xTicks > 0 ? X_AXIS_H : 0;
|
|
2512
|
-
return /* @__PURE__ */
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
GRID_ROWS.map((pct) => /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ jsx23("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ jsxs22("div", { className: "relative h-full w-full", children: [
|
|
2736
|
+
/* @__PURE__ */ jsxs22("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
|
|
2737
|
+
GRID_ROWS.map((pct) => /* @__PURE__ */ jsx23(
|
|
2515
2738
|
"div",
|
|
2516
2739
|
{
|
|
2517
2740
|
className: "absolute inset-x-0 border-t border-dashed",
|
|
@@ -2519,9 +2742,9 @@ function AxisFrame({
|
|
|
2519
2742
|
},
|
|
2520
2743
|
pct
|
|
2521
2744
|
)),
|
|
2522
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ jsx23("div", { className: "absolute inset-0", children })
|
|
2523
2746
|
] }),
|
|
2524
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx23("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ jsx23(
|
|
2525
2748
|
"div",
|
|
2526
2749
|
{
|
|
2527
2750
|
className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
|
|
@@ -2529,27 +2752,27 @@ function AxisFrame({
|
|
|
2529
2752
|
},
|
|
2530
2753
|
pct
|
|
2531
2754
|
)) }),
|
|
2532
|
-
xTicks > 0 && /* @__PURE__ */
|
|
2755
|
+
xTicks > 0 && /* @__PURE__ */ jsx23(
|
|
2533
2756
|
"div",
|
|
2534
2757
|
{
|
|
2535
2758
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2536
2759
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2537
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */
|
|
2760
|
+
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ jsx23("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx23("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
|
|
2538
2761
|
}
|
|
2539
2762
|
)
|
|
2540
2763
|
] }) });
|
|
2541
2764
|
}
|
|
2542
2765
|
function BlankLegend({ rows, reverse = false }) {
|
|
2543
|
-
return /* @__PURE__ */
|
|
2766
|
+
return /* @__PURE__ */ jsx23(
|
|
2544
2767
|
"ul",
|
|
2545
2768
|
{
|
|
2546
2769
|
className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
|
|
2547
2770
|
role: "presentation",
|
|
2548
2771
|
"aria-hidden": "true",
|
|
2549
|
-
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */
|
|
2772
|
+
children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs22("li", { className: "flex items-center justify-between gap-2", children: [
|
|
2773
|
+
/* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1.5", children: [
|
|
2774
|
+
/* @__PURE__ */ jsx23("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
|
|
2775
|
+
/* @__PURE__ */ jsx23(
|
|
2553
2776
|
"span",
|
|
2554
2777
|
{
|
|
2555
2778
|
className: "h-2 rounded-xs bg-subtle",
|
|
@@ -2557,21 +2780,21 @@ function BlankLegend({ rows, reverse = false }) {
|
|
|
2557
2780
|
}
|
|
2558
2781
|
)
|
|
2559
2782
|
] }),
|
|
2560
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsx23("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
|
|
2561
2784
|
] }, i))
|
|
2562
2785
|
}
|
|
2563
2786
|
);
|
|
2564
2787
|
}
|
|
2565
2788
|
|
|
2566
2789
|
// src/BarChartPlaceholder.tsx
|
|
2567
|
-
import { jsx as
|
|
2790
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2568
2791
|
var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
|
|
2569
2792
|
function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
|
|
2570
|
-
return /* @__PURE__ */
|
|
2793
|
+
return /* @__PURE__ */ jsx24(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ jsx24("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ jsx24("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
|
|
2571
2794
|
}
|
|
2572
2795
|
|
|
2573
2796
|
// src/LineChartPlaceholder.tsx
|
|
2574
|
-
import { jsx as
|
|
2797
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2575
2798
|
var LINE_SERIES = [
|
|
2576
2799
|
[58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
|
|
2577
2800
|
[74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
|
|
@@ -2581,9 +2804,9 @@ var LINE_SERIES = [
|
|
|
2581
2804
|
var LINE_FORECAST_FROM = 7;
|
|
2582
2805
|
function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
2583
2806
|
const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
|
|
2584
|
-
return /* @__PURE__ */
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2807
|
+
return /* @__PURE__ */ jsxs23(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
|
|
2808
|
+
/* @__PURE__ */ jsx25("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ jsxs23("g", { children: [
|
|
2809
|
+
/* @__PURE__ */ jsx25(
|
|
2587
2810
|
"polyline",
|
|
2588
2811
|
{
|
|
2589
2812
|
points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
|
|
@@ -2595,7 +2818,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2595
2818
|
strokeLinejoin: "round"
|
|
2596
2819
|
}
|
|
2597
2820
|
),
|
|
2598
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsx25(
|
|
2599
2822
|
"polyline",
|
|
2600
2823
|
{
|
|
2601
2824
|
points: toPath(pts, LINE_FORECAST_FROM, pts.length),
|
|
@@ -2610,7 +2833,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2610
2833
|
)
|
|
2611
2834
|
] }, s)) }),
|
|
2612
2835
|
LINE_SERIES.map(
|
|
2613
|
-
(pts, s) => pts.map((y, i) => /* @__PURE__ */
|
|
2836
|
+
(pts, s) => pts.map((y, i) => /* @__PURE__ */ jsx25(
|
|
2614
2837
|
"div",
|
|
2615
2838
|
{
|
|
2616
2839
|
className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
@@ -2627,16 +2850,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
|
|
|
2627
2850
|
}
|
|
2628
2851
|
|
|
2629
2852
|
// src/PieChartPlaceholder.tsx
|
|
2630
|
-
import { jsx as
|
|
2853
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2631
2854
|
var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
|
|
2632
2855
|
function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
|
|
2633
2856
|
const r = 45;
|
|
2634
|
-
return /* @__PURE__ */
|
|
2635
|
-
/* @__PURE__ */
|
|
2636
|
-
/* @__PURE__ */
|
|
2857
|
+
return /* @__PURE__ */ jsxs24("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2858
|
+
/* @__PURE__ */ jsx26("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ jsxs24("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
|
|
2859
|
+
/* @__PURE__ */ jsx26("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
|
|
2637
2860
|
PIE_SEAMS.map((deg) => {
|
|
2638
2861
|
const rad = (deg - 90) * Math.PI / 180;
|
|
2639
|
-
return /* @__PURE__ */
|
|
2862
|
+
return /* @__PURE__ */ jsx26(
|
|
2640
2863
|
"line",
|
|
2641
2864
|
{
|
|
2642
2865
|
x1: "50",
|
|
@@ -2650,12 +2873,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
|
|
|
2650
2873
|
);
|
|
2651
2874
|
})
|
|
2652
2875
|
] }) }),
|
|
2653
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ jsx26(BlankLegend, { rows: legendRows })
|
|
2654
2877
|
] });
|
|
2655
2878
|
}
|
|
2656
2879
|
|
|
2657
2880
|
// src/StackedColumnPlaceholder.tsx
|
|
2658
|
-
import { jsx as
|
|
2881
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2659
2882
|
var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
|
|
2660
2883
|
function columnBands(count) {
|
|
2661
2884
|
const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
|
|
@@ -2670,7 +2893,7 @@ function StackedColumnPlaceholder({
|
|
|
2670
2893
|
className,
|
|
2671
2894
|
testIdPrefix
|
|
2672
2895
|
}) {
|
|
2673
|
-
const column = /* @__PURE__ */
|
|
2896
|
+
const column = /* @__PURE__ */ jsx27("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ jsx27(
|
|
2674
2897
|
"div",
|
|
2675
2898
|
{
|
|
2676
2899
|
style: {
|
|
@@ -2682,16 +2905,16 @@ function StackedColumnPlaceholder({
|
|
|
2682
2905
|
},
|
|
2683
2906
|
i
|
|
2684
2907
|
)) });
|
|
2685
|
-
return /* @__PURE__ */
|
|
2686
|
-
axis ? /* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
2908
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
|
|
2909
|
+
axis ? /* @__PURE__ */ jsx27("div", { style: { width: "55%" }, children: /* @__PURE__ */ jsx27(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ jsx27("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ jsx27("div", { className: "flex items-stretch py-1", children: column }),
|
|
2910
|
+
/* @__PURE__ */ jsx27(BlankLegend, { rows: legendRows, reverse: !axis })
|
|
2688
2911
|
] });
|
|
2689
2912
|
}
|
|
2690
2913
|
|
|
2691
2914
|
// src/Tooltip.tsx
|
|
2692
|
-
import { useEffect as
|
|
2915
|
+
import { useEffect as useEffect9, useId as useId4, useLayoutEffect as useLayoutEffect4, useRef as useRef9, useState as useState9 } from "react";
|
|
2693
2916
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2694
|
-
import { jsx as
|
|
2917
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2695
2918
|
function addDescribedBy(el, id) {
|
|
2696
2919
|
const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
|
|
2697
2920
|
if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
|
|
@@ -2727,14 +2950,14 @@ function Tooltip({
|
|
|
2727
2950
|
variant = "surface",
|
|
2728
2951
|
testIdPrefix
|
|
2729
2952
|
}) {
|
|
2730
|
-
const [anchor, setAnchor] =
|
|
2731
|
-
const [boxWidth, setBoxWidth] =
|
|
2953
|
+
const [anchor, setAnchor] = useState9(null);
|
|
2954
|
+
const [boxWidth, setBoxWidth] = useState9(null);
|
|
2732
2955
|
const ref = useRef9(null);
|
|
2733
2956
|
const boxRef = useRef9(null);
|
|
2734
2957
|
const hideTimer = useRef9(null);
|
|
2735
2958
|
const showTimer = useRef9(null);
|
|
2736
2959
|
const exitTimer = useRef9(null);
|
|
2737
|
-
const [shown, setShown] =
|
|
2960
|
+
const [shown, setShown] = useState9(false);
|
|
2738
2961
|
const openRef = useRef9(false);
|
|
2739
2962
|
const mountedRef = useRef9(false);
|
|
2740
2963
|
const id = useId4();
|
|
@@ -2757,7 +2980,7 @@ function Tooltip({
|
|
|
2757
2980
|
exitTimer.current = null;
|
|
2758
2981
|
}
|
|
2759
2982
|
};
|
|
2760
|
-
|
|
2983
|
+
useEffect9(
|
|
2761
2984
|
() => () => {
|
|
2762
2985
|
clearHideTimer();
|
|
2763
2986
|
clearShowTimer();
|
|
@@ -2831,7 +3054,7 @@ function Tooltip({
|
|
|
2831
3054
|
clearHideTimer();
|
|
2832
3055
|
hideTimer.current = setTimeout(hideNow, 120);
|
|
2833
3056
|
};
|
|
2834
|
-
|
|
3057
|
+
useEffect9(() => {
|
|
2835
3058
|
if (!anchorRef) return;
|
|
2836
3059
|
const el = anchorRef.current;
|
|
2837
3060
|
if (!el) return;
|
|
@@ -2846,7 +3069,7 @@ function Tooltip({
|
|
|
2846
3069
|
el.removeEventListener("blur", hide);
|
|
2847
3070
|
};
|
|
2848
3071
|
}, [anchorRef, placement, delay]);
|
|
2849
|
-
|
|
3072
|
+
useEffect9(() => {
|
|
2850
3073
|
if (!anchor) return;
|
|
2851
3074
|
const onKey = (e) => e.key === "Escape" && hideNow();
|
|
2852
3075
|
window.addEventListener("keydown", onKey);
|
|
@@ -2877,7 +3100,7 @@ function Tooltip({
|
|
|
2877
3100
|
}
|
|
2878
3101
|
}
|
|
2879
3102
|
const floating = anchor != null && typeof document !== "undefined" ? createPortal3(
|
|
2880
|
-
/* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ jsx28(
|
|
2881
3104
|
"span",
|
|
2882
3105
|
{
|
|
2883
3106
|
ref: boxRef,
|
|
@@ -2908,7 +3131,7 @@ function Tooltip({
|
|
|
2908
3131
|
document.body
|
|
2909
3132
|
) : null;
|
|
2910
3133
|
if (anchorRef) return floating;
|
|
2911
|
-
return /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ jsxs26(
|
|
2912
3135
|
"span",
|
|
2913
3136
|
{
|
|
2914
3137
|
ref,
|
|
@@ -2930,28 +3153,28 @@ function Tooltip({
|
|
|
2930
3153
|
}
|
|
2931
3154
|
|
|
2932
3155
|
// src/AdvertiserNoResults.tsx
|
|
2933
|
-
import { jsx as
|
|
3156
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2934
3157
|
function AdvertiserNoResults({
|
|
2935
3158
|
query,
|
|
2936
3159
|
hint = "Try checking your spelling or searching for a broader brand name.",
|
|
2937
3160
|
className,
|
|
2938
3161
|
testIdPrefix
|
|
2939
3162
|
}) {
|
|
2940
|
-
return /* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ jsxs27("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
|
|
3164
|
+
/* @__PURE__ */ jsxs27("p", { className: "text-dense font-medium text-text-primary", children: [
|
|
2942
3165
|
"No results found for \u201C",
|
|
2943
3166
|
query,
|
|
2944
3167
|
"\u201D"
|
|
2945
3168
|
] }),
|
|
2946
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx29("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
|
|
2947
3170
|
] });
|
|
2948
3171
|
}
|
|
2949
3172
|
|
|
2950
3173
|
// src/SelectAllVisible.tsx
|
|
2951
3174
|
import { ListChecks as ListChecks2 } from "lucide-react";
|
|
2952
|
-
import { jsx as
|
|
3175
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2953
3176
|
function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
|
|
2954
|
-
return /* @__PURE__ */
|
|
3177
|
+
return /* @__PURE__ */ jsxs28(
|
|
2955
3178
|
"button",
|
|
2956
3179
|
{
|
|
2957
3180
|
type: "button",
|
|
@@ -2962,7 +3185,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2962
3185
|
className
|
|
2963
3186
|
),
|
|
2964
3187
|
children: [
|
|
2965
|
-
/* @__PURE__ */
|
|
3188
|
+
/* @__PURE__ */ jsx30(ListChecks2, { size: 14, "aria-hidden": "true" }),
|
|
2966
3189
|
allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
|
|
2967
3190
|
]
|
|
2968
3191
|
}
|
|
@@ -2971,11 +3194,11 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
|
|
|
2971
3194
|
|
|
2972
3195
|
// src/SelectedSection.tsx
|
|
2973
3196
|
import { ChevronDown as ChevronDown7 } from "lucide-react";
|
|
2974
|
-
import { jsx as
|
|
3197
|
+
import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2975
3198
|
function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
|
|
2976
3199
|
if (count === 0) return null;
|
|
2977
|
-
return /* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
3200
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3201
|
+
/* @__PURE__ */ jsxs29(
|
|
2979
3202
|
"button",
|
|
2980
3203
|
{
|
|
2981
3204
|
type: "button",
|
|
@@ -2984,25 +3207,25 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
|
|
|
2984
3207
|
"aria-expanded": open,
|
|
2985
3208
|
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",
|
|
2986
3209
|
children: [
|
|
2987
|
-
/* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ jsx31(ChevronDown7, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
|
|
2988
3211
|
"Selected (",
|
|
2989
3212
|
count,
|
|
2990
3213
|
")"
|
|
2991
3214
|
]
|
|
2992
3215
|
}
|
|
2993
3216
|
),
|
|
2994
|
-
open && /* @__PURE__ */
|
|
3217
|
+
open && /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-0.5", children })
|
|
2995
3218
|
] });
|
|
2996
3219
|
}
|
|
2997
3220
|
|
|
2998
3221
|
// src/SelectionPicker.tsx
|
|
2999
|
-
import { useCallback as useCallback3, useEffect as
|
|
3222
|
+
import { useCallback as useCallback3, useEffect as useEffect10, useLayoutEffect as useLayoutEffect5, useMemo as useMemo3, useRef as useRef11, useState as useState10 } from "react";
|
|
3000
3223
|
import { createPortal as createPortal4 } from "react-dom";
|
|
3001
|
-
import { Search as Search4, Plus as Plus2, Info as Info2, ChevronRight as ChevronRight3, ChevronDown as ChevronDown8, Check as Check7, List, Loader2 } from "lucide-react";
|
|
3224
|
+
import { Search as Search4, Plus as Plus2, Info as Info2, ChevronRight as ChevronRight3, ChevronDown as ChevronDown8, Check as Check7, List, Loader2 as Loader22 } from "lucide-react";
|
|
3002
3225
|
|
|
3003
3226
|
// src/Tabs.tsx
|
|
3004
3227
|
import { useRef as useRef10 } from "react";
|
|
3005
|
-
import { jsx as
|
|
3228
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3006
3229
|
function arrowKeys(e, row) {
|
|
3007
3230
|
if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
|
|
3008
3231
|
const items = Array.from(row.querySelectorAll("button:not([disabled])"));
|
|
@@ -3014,7 +3237,7 @@ function arrowKeys(e, row) {
|
|
|
3014
3237
|
}
|
|
3015
3238
|
function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
|
|
3016
3239
|
const row = useRef10(null);
|
|
3017
|
-
return /* @__PURE__ */
|
|
3240
|
+
return /* @__PURE__ */ jsx32(
|
|
3018
3241
|
"div",
|
|
3019
3242
|
{
|
|
3020
3243
|
ref: row,
|
|
@@ -3025,7 +3248,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3025
3248
|
className: cn("flex gap-6 border-b border-border-default", className),
|
|
3026
3249
|
children: items.map((item) => {
|
|
3027
3250
|
const on = item.value === value;
|
|
3028
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ jsxs30(
|
|
3029
3252
|
"button",
|
|
3030
3253
|
{
|
|
3031
3254
|
type: "button",
|
|
@@ -3043,7 +3266,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
3043
3266
|
),
|
|
3044
3267
|
children: [
|
|
3045
3268
|
item.label,
|
|
3046
|
-
item.count !== void 0 && /* @__PURE__ */
|
|
3269
|
+
item.count !== void 0 && /* @__PURE__ */ jsx32("span", { className: "text-xs text-text-tertiary", children: item.count })
|
|
3047
3270
|
]
|
|
3048
3271
|
},
|
|
3049
3272
|
item.value
|
|
@@ -3062,7 +3285,7 @@ function SegmentedControl({
|
|
|
3062
3285
|
...rest
|
|
3063
3286
|
}) {
|
|
3064
3287
|
const row = useRef10(null);
|
|
3065
|
-
return /* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ jsx32(
|
|
3066
3289
|
"div",
|
|
3067
3290
|
{
|
|
3068
3291
|
ref: row,
|
|
@@ -3073,7 +3296,7 @@ function SegmentedControl({
|
|
|
3073
3296
|
className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
|
|
3074
3297
|
children: options.map((o) => {
|
|
3075
3298
|
const on = o.value === value;
|
|
3076
|
-
return /* @__PURE__ */
|
|
3299
|
+
return /* @__PURE__ */ jsx32(
|
|
3077
3300
|
"button",
|
|
3078
3301
|
{
|
|
3079
3302
|
type: "button",
|
|
@@ -3097,7 +3320,7 @@ function SegmentedControl({
|
|
|
3097
3320
|
}
|
|
3098
3321
|
|
|
3099
3322
|
// src/SelectionPicker.tsx
|
|
3100
|
-
import { Fragment as Fragment3, jsx as
|
|
3323
|
+
import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3101
3324
|
function slug5(value) {
|
|
3102
3325
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
3103
3326
|
}
|
|
@@ -3131,14 +3354,14 @@ function SelectionPicker({
|
|
|
3131
3354
|
testIdPrefix
|
|
3132
3355
|
}) {
|
|
3133
3356
|
const hasAccountLists = !!accountLists;
|
|
3134
|
-
const [source, setSource] =
|
|
3135
|
-
const [query, setQuery] =
|
|
3136
|
-
const [activeFilters, setActiveFilters] =
|
|
3357
|
+
const [source, setSource] = useState10("search");
|
|
3358
|
+
const [query, setQuery] = useState10("");
|
|
3359
|
+
const [activeFilters, setActiveFilters] = useState10(() => {
|
|
3137
3360
|
const init = {};
|
|
3138
3361
|
if (defaultFilters) for (const [label, opts] of Object.entries(defaultFilters)) init[label] = new Set(opts);
|
|
3139
3362
|
return init;
|
|
3140
3363
|
});
|
|
3141
|
-
const [expanded, setExpanded] =
|
|
3364
|
+
const [expanded, setExpanded] = useState10(/* @__PURE__ */ new Set());
|
|
3142
3365
|
const selectedIds = useMemo3(() => new Set(selected.map((s) => s.id)), [selected]);
|
|
3143
3366
|
const toggleFilter = (label, opt) => {
|
|
3144
3367
|
setActiveFilters((prev) => {
|
|
@@ -3190,12 +3413,12 @@ function SelectionPicker({
|
|
|
3190
3413
|
}
|
|
3191
3414
|
};
|
|
3192
3415
|
const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
|
|
3193
|
-
return /* @__PURE__ */
|
|
3194
|
-
helper && /* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3196
|
-
/* @__PURE__ */
|
|
3416
|
+
return /* @__PURE__ */ jsxs31("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
|
|
3417
|
+
helper && /* @__PURE__ */ jsxs31(Fragment3, { children: [
|
|
3418
|
+
/* @__PURE__ */ jsx33("p", { className: "text-dense text-text-secondary", children: helper }),
|
|
3419
|
+
/* @__PURE__ */ jsx33("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
|
|
3197
3420
|
] }),
|
|
3198
|
-
hasAccountLists && /* @__PURE__ */
|
|
3421
|
+
hasAccountLists && /* @__PURE__ */ jsx33(
|
|
3199
3422
|
SegmentedControl,
|
|
3200
3423
|
{
|
|
3201
3424
|
"aria-label": "Add from",
|
|
@@ -3208,11 +3431,11 @@ function SelectionPicker({
|
|
|
3208
3431
|
]
|
|
3209
3432
|
}
|
|
3210
3433
|
),
|
|
3211
|
-
source === "search" && /* @__PURE__ */
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
3214
|
-
/* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3434
|
+
source === "search" && /* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3435
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3436
|
+
/* @__PURE__ */ jsxs31("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: [
|
|
3437
|
+
/* @__PURE__ */ jsx33(Search4, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3438
|
+
/* @__PURE__ */ jsx33(
|
|
3216
3439
|
"input",
|
|
3217
3440
|
{
|
|
3218
3441
|
value: query,
|
|
@@ -3228,7 +3451,7 @@ function SelectionPicker({
|
|
|
3228
3451
|
}
|
|
3229
3452
|
)
|
|
3230
3453
|
] }),
|
|
3231
|
-
filters.map((f) => /* @__PURE__ */
|
|
3454
|
+
filters.map((f) => /* @__PURE__ */ jsx33(
|
|
3232
3455
|
FilterDropdown,
|
|
3233
3456
|
{
|
|
3234
3457
|
filter: f,
|
|
@@ -3240,14 +3463,14 @@ function SelectionPicker({
|
|
|
3240
3463
|
)),
|
|
3241
3464
|
toolbarExtra
|
|
3242
3465
|
] }),
|
|
3243
|
-
!hasSearched ? /* @__PURE__ */
|
|
3244
|
-
/* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
/* @__PURE__ */
|
|
3466
|
+
!hasSearched ? /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3467
|
+
/* @__PURE__ */ jsx33("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ jsx33(Search4, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3468
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
|
|
3469
|
+
/* @__PURE__ */ jsx33("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
|
|
3470
|
+
/* @__PURE__ */ jsx33("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
|
|
3248
3471
|
] })
|
|
3249
|
-
] }) : /* @__PURE__ */
|
|
3250
|
-
/* @__PURE__ */
|
|
3472
|
+
] }) : /* @__PURE__ */ jsxs31("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
|
|
3473
|
+
/* @__PURE__ */ jsxs31(
|
|
3251
3474
|
"div",
|
|
3252
3475
|
{
|
|
3253
3476
|
className: cn(
|
|
@@ -3255,7 +3478,7 @@ function SelectionPicker({
|
|
|
3255
3478
|
rowGridCols
|
|
3256
3479
|
),
|
|
3257
3480
|
children: [
|
|
3258
|
-
/* @__PURE__ */
|
|
3481
|
+
/* @__PURE__ */ jsx33(
|
|
3259
3482
|
CheckBox,
|
|
3260
3483
|
{
|
|
3261
3484
|
checked: allSelected,
|
|
@@ -3266,18 +3489,18 @@ function SelectionPicker({
|
|
|
3266
3489
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
|
|
3267
3490
|
}
|
|
3268
3491
|
),
|
|
3269
|
-
/* @__PURE__ */
|
|
3270
|
-
showInfoColumn && /* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsx33("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ jsx33("span", { className: c.className, children: c.header }, c.key)) }),
|
|
3493
|
+
showInfoColumn && /* @__PURE__ */ jsx33("span", { className: "text-right", children: "Info" })
|
|
3271
3494
|
]
|
|
3272
3495
|
}
|
|
3273
3496
|
),
|
|
3274
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ jsx33("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ jsx33(Loader22, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ jsx33("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ jsx33("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) => {
|
|
3275
3498
|
const isSel = selectedIds.has(row.id);
|
|
3276
3499
|
const isLocked = lockedIds?.has(row.id) ?? false;
|
|
3277
3500
|
const kids = getChildren?.(row);
|
|
3278
3501
|
const isOpen = expanded.has(row.id);
|
|
3279
|
-
return /* @__PURE__ */
|
|
3280
|
-
/* @__PURE__ */
|
|
3502
|
+
return /* @__PURE__ */ jsxs31("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
|
|
3503
|
+
/* @__PURE__ */ jsxs31(
|
|
3281
3504
|
"div",
|
|
3282
3505
|
{
|
|
3283
3506
|
onClick: isLocked ? void 0 : () => toggleRow(row),
|
|
@@ -3290,7 +3513,7 @@ function SelectionPicker({
|
|
|
3290
3513
|
!isLocked && isSel && "opacity-70"
|
|
3291
3514
|
),
|
|
3292
3515
|
children: [
|
|
3293
|
-
isLocked ? /* @__PURE__ */
|
|
3516
|
+
isLocked ? /* @__PURE__ */ jsx33("span", { "aria-hidden": "true" }) : /* @__PURE__ */ jsx33(
|
|
3294
3517
|
CheckBox,
|
|
3295
3518
|
{
|
|
3296
3519
|
checked: isSel,
|
|
@@ -3299,8 +3522,8 @@ function SelectionPicker({
|
|
|
3299
3522
|
testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
|
|
3300
3523
|
}
|
|
3301
3524
|
),
|
|
3302
|
-
/* @__PURE__ */
|
|
3303
|
-
showInfoColumn && /* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ jsx33("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ jsx33("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
|
|
3526
|
+
showInfoColumn && /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ jsx33(
|
|
3304
3527
|
"button",
|
|
3305
3528
|
{
|
|
3306
3529
|
type: "button",
|
|
@@ -3314,28 +3537,28 @@ function SelectionPicker({
|
|
|
3314
3537
|
});
|
|
3315
3538
|
},
|
|
3316
3539
|
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",
|
|
3317
|
-
children: /* @__PURE__ */
|
|
3540
|
+
children: /* @__PURE__ */ jsx33(ChevronRight3, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3318
3541
|
}
|
|
3319
|
-
) : /* @__PURE__ */
|
|
3542
|
+
) : /* @__PURE__ */ jsx33(
|
|
3320
3543
|
"span",
|
|
3321
3544
|
{
|
|
3322
3545
|
className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
|
|
3323
3546
|
title: "No additional details",
|
|
3324
|
-
children: /* @__PURE__ */
|
|
3547
|
+
children: /* @__PURE__ */ jsx33(Info2, { size: 14 })
|
|
3325
3548
|
}
|
|
3326
3549
|
) })
|
|
3327
3550
|
]
|
|
3328
3551
|
}
|
|
3329
3552
|
),
|
|
3330
|
-
isOpen && kids && /* @__PURE__ */
|
|
3553
|
+
isOpen && kids && /* @__PURE__ */ jsx33("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
|
|
3331
3554
|
const kidSel = selectedIds.has(kid.id);
|
|
3332
|
-
return /* @__PURE__ */
|
|
3555
|
+
return /* @__PURE__ */ jsxs31(
|
|
3333
3556
|
"div",
|
|
3334
3557
|
{
|
|
3335
3558
|
className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
|
|
3336
3559
|
children: [
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3560
|
+
/* @__PURE__ */ jsx33("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
|
|
3561
|
+
/* @__PURE__ */ jsxs31(
|
|
3339
3562
|
"button",
|
|
3340
3563
|
{
|
|
3341
3564
|
type: "button",
|
|
@@ -3346,7 +3569,7 @@ function SelectionPicker({
|
|
|
3346
3569
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3347
3570
|
),
|
|
3348
3571
|
children: [
|
|
3349
|
-
kidSel ? /* @__PURE__ */
|
|
3572
|
+
kidSel ? /* @__PURE__ */ jsx33(Check7, { size: 13 }) : /* @__PURE__ */ jsx33(Plus2, { size: 13 }),
|
|
3350
3573
|
kidSel ? "Added" : "Add"
|
|
3351
3574
|
]
|
|
3352
3575
|
}
|
|
@@ -3358,7 +3581,7 @@ function SelectionPicker({
|
|
|
3358
3581
|
}) })
|
|
3359
3582
|
] }, row.id);
|
|
3360
3583
|
}) }),
|
|
3361
|
-
!loading && !error && hasMore && /* @__PURE__ */
|
|
3584
|
+
!loading && !error && hasMore && /* @__PURE__ */ jsxs31(
|
|
3362
3585
|
"button",
|
|
3363
3586
|
{
|
|
3364
3587
|
type: "button",
|
|
@@ -3367,19 +3590,19 @@ function SelectionPicker({
|
|
|
3367
3590
|
"data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
|
|
3368
3591
|
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",
|
|
3369
3592
|
children: [
|
|
3370
|
-
loadingMore ? /* @__PURE__ */
|
|
3593
|
+
loadingMore ? /* @__PURE__ */ jsx33(Loader22, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
|
|
3371
3594
|
loadingMore ? "Loading\u2026" : "Load more"
|
|
3372
3595
|
]
|
|
3373
3596
|
}
|
|
3374
3597
|
)
|
|
3375
3598
|
] })
|
|
3376
3599
|
] }),
|
|
3377
|
-
source === "lists" && /* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3379
|
-
accountLists && accountLists.length > 0 ? /* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3600
|
+
source === "lists" && /* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
3601
|
+
/* @__PURE__ */ jsx33("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." }),
|
|
3602
|
+
accountLists && accountLists.length > 0 ? /* @__PURE__ */ jsxs31(Fragment3, { children: [
|
|
3603
|
+
/* @__PURE__ */ jsx33(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
|
|
3381
3604
|
const on = (selectedListIds ?? []).includes(list.id);
|
|
3382
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ jsxs31(
|
|
3383
3606
|
"button",
|
|
3384
3607
|
{
|
|
3385
3608
|
type: "button",
|
|
@@ -3391,19 +3614,19 @@ function SelectionPicker({
|
|
|
3391
3614
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3392
3615
|
),
|
|
3393
3616
|
children: [
|
|
3394
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsx33(
|
|
3395
3618
|
"span",
|
|
3396
3619
|
{
|
|
3397
3620
|
className: cn(
|
|
3398
3621
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
|
|
3399
3622
|
on ? "text-brand-primaryAction" : "text-text-secondary"
|
|
3400
3623
|
),
|
|
3401
|
-
children: on ? /* @__PURE__ */
|
|
3624
|
+
children: on ? /* @__PURE__ */ jsx33(Check7, { size: 16 }) : /* @__PURE__ */ jsx33(Plus2, { size: 16 })
|
|
3402
3625
|
}
|
|
3403
3626
|
),
|
|
3404
|
-
/* @__PURE__ */
|
|
3405
|
-
/* @__PURE__ */
|
|
3406
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsxs31("span", { className: "min-w-0 flex-1", children: [
|
|
3628
|
+
/* @__PURE__ */ jsx33("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsx33("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
|
|
3629
|
+
/* @__PURE__ */ jsxs31("span", { className: "block truncate text-xs text-text-secondary", children: [
|
|
3407
3630
|
list.count,
|
|
3408
3631
|
" accounts \xB7 ",
|
|
3409
3632
|
list.entityTypes.join(", "),
|
|
@@ -3411,13 +3634,13 @@ function SelectionPicker({
|
|
|
3411
3634
|
formatListDate(list.updatedAt)
|
|
3412
3635
|
] })
|
|
3413
3636
|
] }),
|
|
3414
|
-
/* @__PURE__ */
|
|
3637
|
+
/* @__PURE__ */ jsx33("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
|
|
3415
3638
|
]
|
|
3416
3639
|
},
|
|
3417
3640
|
list.id
|
|
3418
3641
|
);
|
|
3419
3642
|
}) }),
|
|
3420
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ jsxs31(
|
|
3421
3644
|
"p",
|
|
3422
3645
|
{
|
|
3423
3646
|
className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
|
|
@@ -3429,11 +3652,11 @@ function SelectionPicker({
|
|
|
3429
3652
|
]
|
|
3430
3653
|
}
|
|
3431
3654
|
)
|
|
3432
|
-
] }) : /* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
3655
|
+
] }) : /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
|
|
3656
|
+
/* @__PURE__ */ jsx33("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ jsx33(List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
|
|
3657
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
|
|
3658
|
+
/* @__PURE__ */ jsx33("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
|
|
3659
|
+
/* @__PURE__ */ jsx33("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
|
|
3437
3660
|
] })
|
|
3438
3661
|
] })
|
|
3439
3662
|
] })
|
|
@@ -3442,7 +3665,7 @@ function SelectionPicker({
|
|
|
3442
3665
|
var EDGE_FADE = 44;
|
|
3443
3666
|
function ScrollFade({ className, children }) {
|
|
3444
3667
|
const elRef = useRef11(null);
|
|
3445
|
-
const [edges, setEdges] =
|
|
3668
|
+
const [edges, setEdges] = useState10({ top: false, bottom: false });
|
|
3446
3669
|
const sync = useCallback3(() => {
|
|
3447
3670
|
const el = elRef.current;
|
|
3448
3671
|
if (!el) return;
|
|
@@ -3465,7 +3688,7 @@ function ScrollFade({ className, children }) {
|
|
|
3465
3688
|
[sync]
|
|
3466
3689
|
);
|
|
3467
3690
|
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;
|
|
3468
|
-
return /* @__PURE__ */
|
|
3691
|
+
return /* @__PURE__ */ jsx33("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
|
|
3469
3692
|
}
|
|
3470
3693
|
function formatListDate(iso) {
|
|
3471
3694
|
try {
|
|
@@ -3480,11 +3703,11 @@ function FilterDropdown({
|
|
|
3480
3703
|
onToggle,
|
|
3481
3704
|
testIdPrefix
|
|
3482
3705
|
}) {
|
|
3483
|
-
const [open, setOpen] =
|
|
3484
|
-
const [q, setQ] =
|
|
3706
|
+
const [open, setOpen] = useState10(false);
|
|
3707
|
+
const [q, setQ] = useState10("");
|
|
3485
3708
|
const btnRef = useRef11(null);
|
|
3486
3709
|
const menuRef = useRef11(null);
|
|
3487
|
-
const [pos, setPos] =
|
|
3710
|
+
const [pos, setPos] = useState10(null);
|
|
3488
3711
|
const searchable = filter.options.length > 8;
|
|
3489
3712
|
const shownOptions = searchable && q.trim() ? filter.options.filter((o) => o.toLowerCase().includes(q.trim().toLowerCase())) : filter.options;
|
|
3490
3713
|
useLayoutEffect5(() => {
|
|
@@ -3492,7 +3715,7 @@ function FilterDropdown({
|
|
|
3492
3715
|
const r = btnRef.current.getBoundingClientRect();
|
|
3493
3716
|
setPos({ top: r.bottom + 6, left: r.left });
|
|
3494
3717
|
}, [open]);
|
|
3495
|
-
|
|
3718
|
+
useEffect10(() => {
|
|
3496
3719
|
if (!open) {
|
|
3497
3720
|
setQ("");
|
|
3498
3721
|
return;
|
|
@@ -3515,8 +3738,8 @@ function FilterDropdown({
|
|
|
3515
3738
|
const count = active.size;
|
|
3516
3739
|
const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
|
|
3517
3740
|
const filterSlug = slug5(filter.label);
|
|
3518
|
-
return /* @__PURE__ */
|
|
3519
|
-
/* @__PURE__ */
|
|
3741
|
+
return /* @__PURE__ */ jsxs31("div", { className: "relative", children: [
|
|
3742
|
+
/* @__PURE__ */ jsxs31(
|
|
3520
3743
|
"button",
|
|
3521
3744
|
{
|
|
3522
3745
|
ref: btnRef,
|
|
@@ -3527,12 +3750,12 @@ function FilterDropdown({
|
|
|
3527
3750
|
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",
|
|
3528
3751
|
children: [
|
|
3529
3752
|
label,
|
|
3530
|
-
/* @__PURE__ */
|
|
3753
|
+
/* @__PURE__ */ jsx33(ChevronDown8, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
3531
3754
|
]
|
|
3532
3755
|
}
|
|
3533
3756
|
),
|
|
3534
3757
|
open && pos && createPortal4(
|
|
3535
|
-
/* @__PURE__ */
|
|
3758
|
+
/* @__PURE__ */ jsxs31(
|
|
3536
3759
|
"div",
|
|
3537
3760
|
{
|
|
3538
3761
|
ref: menuRef,
|
|
@@ -3541,9 +3764,9 @@ function FilterDropdown({
|
|
|
3541
3764
|
style: { top: pos.top, left: pos.left },
|
|
3542
3765
|
className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
3543
3766
|
children: [
|
|
3544
|
-
searchable && /* @__PURE__ */
|
|
3545
|
-
/* @__PURE__ */
|
|
3546
|
-
/* @__PURE__ */
|
|
3767
|
+
searchable && /* @__PURE__ */ jsxs31("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
|
|
3768
|
+
/* @__PURE__ */ jsx33(Search4, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
3769
|
+
/* @__PURE__ */ jsx33(
|
|
3547
3770
|
"input",
|
|
3548
3771
|
{
|
|
3549
3772
|
autoFocus: true,
|
|
@@ -3554,14 +3777,14 @@ function FilterDropdown({
|
|
|
3554
3777
|
}
|
|
3555
3778
|
)
|
|
3556
3779
|
] }),
|
|
3557
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsx33("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ jsx33("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
|
|
3558
3781
|
const on = active.has(opt);
|
|
3559
|
-
return /* @__PURE__ */
|
|
3782
|
+
return /* @__PURE__ */ jsxs31(
|
|
3560
3783
|
"label",
|
|
3561
3784
|
{
|
|
3562
3785
|
className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
|
|
3563
3786
|
children: [
|
|
3564
|
-
/* @__PURE__ */
|
|
3787
|
+
/* @__PURE__ */ jsx33(
|
|
3565
3788
|
CheckBox,
|
|
3566
3789
|
{
|
|
3567
3790
|
checked: on,
|
|
@@ -3591,8 +3814,8 @@ function gridForColumns(columns) {
|
|
|
3591
3814
|
}
|
|
3592
3815
|
|
|
3593
3816
|
// src/PublisherBreakdownList.tsx
|
|
3594
|
-
import { useState as
|
|
3595
|
-
import { jsx as
|
|
3817
|
+
import { useState as useState11 } from "react";
|
|
3818
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3596
3819
|
var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
|
|
3597
3820
|
function priorYearAmt(spendN, yoy) {
|
|
3598
3821
|
if (yoy === "NEW" || yoy <= -100) return null;
|
|
@@ -3604,7 +3827,7 @@ function initials(name) {
|
|
|
3604
3827
|
return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
|
|
3605
3828
|
}
|
|
3606
3829
|
function Monogram({ name, size = 28 }) {
|
|
3607
|
-
return /* @__PURE__ */
|
|
3830
|
+
return /* @__PURE__ */ jsx34(
|
|
3608
3831
|
"span",
|
|
3609
3832
|
{
|
|
3610
3833
|
"aria-hidden": "true",
|
|
@@ -3615,12 +3838,12 @@ function Monogram({ name, size = 28 }) {
|
|
|
3615
3838
|
);
|
|
3616
3839
|
}
|
|
3617
3840
|
function BreakdownTag({ children }) {
|
|
3618
|
-
return /* @__PURE__ */
|
|
3841
|
+
return /* @__PURE__ */ jsx34("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 });
|
|
3619
3842
|
}
|
|
3620
3843
|
function DelayedTip({ label, children }) {
|
|
3621
|
-
return /* @__PURE__ */
|
|
3844
|
+
return /* @__PURE__ */ jsxs32("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
|
|
3622
3845
|
children,
|
|
3623
|
-
/* @__PURE__ */
|
|
3846
|
+
/* @__PURE__ */ jsx34(
|
|
3624
3847
|
"span",
|
|
3625
3848
|
{
|
|
3626
3849
|
role: "tooltip",
|
|
@@ -3634,22 +3857,22 @@ var COL_CURRENT = 76;
|
|
|
3634
3857
|
var COL_PREVIOUS = 76;
|
|
3635
3858
|
var COL_YOY = 44;
|
|
3636
3859
|
function MetricListHeader({ className }) {
|
|
3637
|
-
return /* @__PURE__ */
|
|
3638
|
-
/* @__PURE__ */
|
|
3639
|
-
/* @__PURE__ */
|
|
3640
|
-
/* @__PURE__ */
|
|
3641
|
-
/* @__PURE__ */
|
|
3642
|
-
/* @__PURE__ */
|
|
3860
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
|
|
3861
|
+
/* @__PURE__ */ jsx34("span", { className: "flex-1" }),
|
|
3862
|
+
/* @__PURE__ */ jsxs32("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3863
|
+
/* @__PURE__ */ jsx34("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
|
|
3864
|
+
/* @__PURE__ */ jsx34(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ jsx34("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
|
|
3865
|
+
/* @__PURE__ */ jsx34(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ jsx34("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
|
|
3643
3866
|
] })
|
|
3644
3867
|
] });
|
|
3645
3868
|
}
|
|
3646
3869
|
function MetricCells({ spendN, yoy }) {
|
|
3647
3870
|
const prior = priorYearAmt(spendN, yoy);
|
|
3648
3871
|
const up = yoy !== "NEW" && yoy >= 0;
|
|
3649
|
-
return /* @__PURE__ */
|
|
3650
|
-
/* @__PURE__ */
|
|
3651
|
-
/* @__PURE__ */
|
|
3652
|
-
/* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ jsxs32("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
|
|
3873
|
+
/* @__PURE__ */ jsx34("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
|
|
3874
|
+
/* @__PURE__ */ jsx34("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
|
|
3875
|
+
/* @__PURE__ */ jsx34("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ jsx34("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ jsxs32("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
|
|
3653
3876
|
up ? "+" : "\u2212",
|
|
3654
3877
|
Math.abs(yoy),
|
|
3655
3878
|
"%"
|
|
@@ -3665,130 +3888,44 @@ function PublisherBreakdownList({
|
|
|
3665
3888
|
className,
|
|
3666
3889
|
testIdPrefix
|
|
3667
3890
|
}) {
|
|
3668
|
-
const [showAll, setShowAll] =
|
|
3891
|
+
const [showAll, setShowAll] = useState11(false);
|
|
3669
3892
|
const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
|
|
3670
3893
|
const rowPad = padded ? "px-5" : "";
|
|
3671
|
-
return /* @__PURE__ */
|
|
3672
|
-
/* @__PURE__ */
|
|
3673
|
-
/* @__PURE__ */
|
|
3674
|
-
visible.map((p) => /* @__PURE__ */
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
renderLogo ? renderLogo(p) : /* @__PURE__ */
|
|
3677
|
-
/* @__PURE__ */
|
|
3678
|
-
/* @__PURE__ */
|
|
3679
|
-
/* @__PURE__ */
|
|
3680
|
-
p.tags.map((t) => /* @__PURE__ */
|
|
3894
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
|
|
3895
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col", children: [
|
|
3896
|
+
/* @__PURE__ */ jsx34(MetricListHeader, { className: rowPad }),
|
|
3897
|
+
visible.map((p) => /* @__PURE__ */ jsxs32("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: [
|
|
3898
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
3899
|
+
renderLogo ? renderLogo(p) : /* @__PURE__ */ jsx34(Monogram, { name: p.brand, size: 28 }),
|
|
3900
|
+
/* @__PURE__ */ jsxs32("div", { className: "min-w-0", children: [
|
|
3901
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3902
|
+
/* @__PURE__ */ jsx34("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
|
|
3903
|
+
p.tags.map((t) => /* @__PURE__ */ jsx34(BreakdownTag, { children: t }, t))
|
|
3681
3904
|
] }),
|
|
3682
|
-
/* @__PURE__ */
|
|
3905
|
+
/* @__PURE__ */ jsx34("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
|
|
3683
3906
|
] })
|
|
3684
3907
|
] }),
|
|
3685
|
-
/* @__PURE__ */
|
|
3908
|
+
/* @__PURE__ */ jsx34(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3686
3909
|
] }, p.brand))
|
|
3687
3910
|
] }),
|
|
3688
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */
|
|
3689
|
-
/* @__PURE__ */
|
|
3911
|
+
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ jsx34("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ jsx34("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__ */ jsxs32("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
|
|
3912
|
+
/* @__PURE__ */ jsxs32("span", { children: [
|
|
3690
3913
|
"Showing ",
|
|
3691
3914
|
visible.length,
|
|
3692
3915
|
" of ",
|
|
3693
3916
|
rows.length
|
|
3694
3917
|
] }),
|
|
3695
|
-
!showAll ? /* @__PURE__ */
|
|
3918
|
+
!showAll ? /* @__PURE__ */ jsxs32("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: [
|
|
3696
3919
|
"See all (",
|
|
3697
3920
|
rows.length - defaultVisibleCount,
|
|
3698
3921
|
" more)"
|
|
3699
|
-
] }) : /* @__PURE__ */
|
|
3922
|
+
] }) : /* @__PURE__ */ jsx34("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" })
|
|
3700
3923
|
] }))
|
|
3701
3924
|
] });
|
|
3702
3925
|
}
|
|
3703
3926
|
|
|
3704
|
-
// src/Button.tsx
|
|
3705
|
-
import { forwardRef as forwardRef6 } from "react";
|
|
3706
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3707
|
-
import { cva } from "class-variance-authority";
|
|
3708
|
-
import { Loader2 as Loader22 } from "lucide-react";
|
|
3709
|
-
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3710
|
-
var buttonVariants = cva(
|
|
3711
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3712
|
-
{
|
|
3713
|
-
variants: {
|
|
3714
|
-
variant: {
|
|
3715
|
-
primary: "bg-brand-primaryAction text-brand-onprimary hover:brightness-110",
|
|
3716
|
-
// border-strong, not border-interactive. The interactive token is #6b6358
|
|
3717
|
-
// -- 5.9:1 against the surface, nearly as dark as body text -- which is
|
|
3718
|
-
// right for an input the eye must find in a form, and far too heavy for
|
|
3719
|
-
// a button sitting beside other buttons. It reads heaviest on icon-only,
|
|
3720
|
-
// where there is least fill inside the line to balance it.
|
|
3721
|
-
secondary: "bg-surface text-text-primary border border-border-strong hover:bg-subtle hover:border-border-interactive",
|
|
3722
|
-
ghost: "text-text-primary hover:bg-subtle",
|
|
3723
|
-
danger: "bg-status-danger text-status-onstatus hover:brightness-110",
|
|
3724
|
-
// Quiet destructive: neutral at rest, red only on hover. This is what
|
|
3725
|
-
// the product actually reaches for -- nearly every hand-rolled
|
|
3726
|
-
// destructive control is an icon that reddens on hover, while filled
|
|
3727
|
-
// `danger` is right only for the confirm button in a dialog the user
|
|
3728
|
-
// already opened.
|
|
3729
|
-
dangerGhost: "text-text-secondary hover:bg-subtle hover:text-text-danger",
|
|
3730
|
-
link: "text-text-link underline-offset-4 hover:underline px-0"
|
|
3731
|
-
},
|
|
3732
|
-
// Type scales with the box. One size across all three left xs cramped --
|
|
3733
|
-
// 14px inside a 24px box leaves five pixels above and below, so the label
|
|
3734
|
-
// fills the button instead of sitting in it.
|
|
3735
|
-
size: {
|
|
3736
|
-
xs: "h-6 px-2 text-xs",
|
|
3737
|
-
sm: "h-8 px-3 text-sm",
|
|
3738
|
-
md: "h-10 px-4 text-sm",
|
|
3739
|
-
// 44, the filter row's height, so a button at the end of a row of
|
|
3740
|
-
// filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
|
|
3741
|
-
lg: "h-11 px-5 text-sm"
|
|
3742
|
-
},
|
|
3743
|
-
// Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
|
|
3744
|
-
// be one dimension, so an icon button never lined up with the labelled
|
|
3745
|
-
// buttons beside it in a toolbar. As a shape it squares the box at
|
|
3746
|
-
// whichever height you picked.
|
|
3747
|
-
iconOnly: {
|
|
3748
|
-
true: "p-0",
|
|
3749
|
-
false: ""
|
|
3750
|
-
}
|
|
3751
|
-
},
|
|
3752
|
-
compoundVariants: [
|
|
3753
|
-
{ size: "xs", iconOnly: true, class: "w-6" },
|
|
3754
|
-
{ size: "sm", iconOnly: true, class: "w-8" },
|
|
3755
|
-
{ size: "md", iconOnly: true, class: "w-10" },
|
|
3756
|
-
{ size: "lg", iconOnly: true, class: "w-11" },
|
|
3757
|
-
// A boxed button is a target you aim at, so its label carries the weight
|
|
3758
|
-
// of one. `link` sits inline in a sentence, where semibold reads as
|
|
3759
|
-
// emphasis on the words rather than as a control.
|
|
3760
|
-
{ variant: ["primary", "secondary", "ghost", "danger", "dangerGhost"], class: "font-semibold" },
|
|
3761
|
-
{ variant: "link", class: "font-medium h-auto p-0" }
|
|
3762
|
-
],
|
|
3763
|
-
defaultVariants: {
|
|
3764
|
-
variant: "primary",
|
|
3765
|
-
size: "md",
|
|
3766
|
-
iconOnly: false
|
|
3767
|
-
}
|
|
3768
|
-
}
|
|
3769
|
-
);
|
|
3770
|
-
var Button = forwardRef6(
|
|
3771
|
-
({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
|
|
3772
|
-
const shared = {
|
|
3773
|
-
className: cn(buttonVariants({ variant, size, iconOnly, className })),
|
|
3774
|
-
"data-testid": testIdPrefix,
|
|
3775
|
-
disabled: disabled || loading,
|
|
3776
|
-
"aria-busy": loading || void 0,
|
|
3777
|
-
...props
|
|
3778
|
-
};
|
|
3779
|
-
if (asChild) {
|
|
3780
|
-
return /* @__PURE__ */ jsx33(Slot, { ref, ...shared, children });
|
|
3781
|
-
}
|
|
3782
|
-
return /* @__PURE__ */ jsxs31("button", { ref, ...shared, children: [
|
|
3783
|
-
loading && /* @__PURE__ */ jsx33(Loader22, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
|
|
3784
|
-
children
|
|
3785
|
-
] });
|
|
3786
|
-
}
|
|
3787
|
-
);
|
|
3788
|
-
Button.displayName = "Button";
|
|
3789
|
-
|
|
3790
3927
|
// src/FilterDropdownFooter.tsx
|
|
3791
|
-
import { jsx as
|
|
3928
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3792
3929
|
function FilterDropdownFooter({
|
|
3793
3930
|
onClear,
|
|
3794
3931
|
onApply,
|
|
@@ -3797,7 +3934,7 @@ function FilterDropdownFooter({
|
|
|
3797
3934
|
className,
|
|
3798
3935
|
testIdPrefix
|
|
3799
3936
|
}) {
|
|
3800
|
-
return /* @__PURE__ */
|
|
3937
|
+
return /* @__PURE__ */ jsxs33(
|
|
3801
3938
|
"div",
|
|
3802
3939
|
{
|
|
3803
3940
|
className: cn(
|
|
@@ -3807,17 +3944,17 @@ function FilterDropdownFooter({
|
|
|
3807
3944
|
),
|
|
3808
3945
|
"data-testid": testIdPrefix,
|
|
3809
3946
|
children: [
|
|
3810
|
-
onClear && /* @__PURE__ */
|
|
3811
|
-
/* @__PURE__ */
|
|
3947
|
+
onClear && /* @__PURE__ */ jsx35(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
|
|
3948
|
+
/* @__PURE__ */ jsx35(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
|
|
3812
3949
|
]
|
|
3813
3950
|
}
|
|
3814
3951
|
);
|
|
3815
3952
|
}
|
|
3816
3953
|
|
|
3817
3954
|
// src/NameListModal.tsx
|
|
3818
|
-
import { useEffect as
|
|
3955
|
+
import { useEffect as useEffect11, useId as useId5, useRef as useRef12, useState as useState12 } from "react";
|
|
3819
3956
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3820
|
-
import { jsx as
|
|
3957
|
+
import { jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3821
3958
|
function NameListModal({
|
|
3822
3959
|
title,
|
|
3823
3960
|
initialName,
|
|
@@ -3830,21 +3967,21 @@ function NameListModal({
|
|
|
3830
3967
|
className,
|
|
3831
3968
|
testIdPrefix
|
|
3832
3969
|
}) {
|
|
3833
|
-
const [name, setName] =
|
|
3834
|
-
const [checked, setChecked] =
|
|
3970
|
+
const [name, setName] = useState12(initialName);
|
|
3971
|
+
const [checked, setChecked] = useState12(
|
|
3835
3972
|
() => Object.fromEntries((options ?? []).map((o) => [o.key, !!o.initial]))
|
|
3836
3973
|
);
|
|
3837
3974
|
const toggle = (key) => setChecked((c) => ({ ...c, [key]: !c[key] }));
|
|
3838
3975
|
const dialogRef = useRef12(null);
|
|
3839
3976
|
const titleId = useId5();
|
|
3840
3977
|
const fieldId = useId5();
|
|
3841
|
-
|
|
3978
|
+
useEffect11(() => {
|
|
3842
3979
|
const onKey = (e) => e.key === "Escape" && onCancel();
|
|
3843
3980
|
window.addEventListener("keydown", onKey);
|
|
3844
3981
|
return () => window.removeEventListener("keydown", onKey);
|
|
3845
3982
|
}, [onCancel]);
|
|
3846
|
-
const [opener] =
|
|
3847
|
-
|
|
3983
|
+
const [opener] = useState12(() => typeof document === "undefined" ? null : document.activeElement);
|
|
3984
|
+
useEffect11(
|
|
3848
3985
|
() => () => {
|
|
3849
3986
|
const active = document.activeElement;
|
|
3850
3987
|
if (!active || active === document.body) opener?.focus?.();
|
|
@@ -3871,12 +4008,12 @@ function NameListModal({
|
|
|
3871
4008
|
// bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
|
|
3872
4009
|
// No in-data-[theme=dark] override needed any more -- the token redefines
|
|
3873
4010
|
// itself under that attribute in dark.css, so one class covers both themes.
|
|
3874
|
-
/* @__PURE__ */
|
|
4011
|
+
/* @__PURE__ */ jsx36(
|
|
3875
4012
|
"div",
|
|
3876
4013
|
{
|
|
3877
4014
|
className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
|
|
3878
4015
|
onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
|
|
3879
|
-
children: /* @__PURE__ */
|
|
4016
|
+
children: /* @__PURE__ */ jsxs34(
|
|
3880
4017
|
"div",
|
|
3881
4018
|
{
|
|
3882
4019
|
ref: dialogRef,
|
|
@@ -3887,10 +4024,10 @@ function NameListModal({
|
|
|
3887
4024
|
"data-testid": testIdPrefix,
|
|
3888
4025
|
className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
|
|
3889
4026
|
children: [
|
|
3890
|
-
/* @__PURE__ */
|
|
3891
|
-
/* @__PURE__ */
|
|
3892
|
-
/* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
4027
|
+
/* @__PURE__ */ jsx36("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4028
|
+
/* @__PURE__ */ jsxs34("div", { className: "mt-4 flex flex-col gap-1.5", children: [
|
|
4029
|
+
/* @__PURE__ */ jsx36("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
|
|
4030
|
+
/* @__PURE__ */ jsx36(
|
|
3894
4031
|
"input",
|
|
3895
4032
|
{
|
|
3896
4033
|
id: fieldId,
|
|
@@ -3902,13 +4039,13 @@ function NameListModal({
|
|
|
3902
4039
|
}
|
|
3903
4040
|
)
|
|
3904
4041
|
] }),
|
|
3905
|
-
options && options.length > 0 && /* @__PURE__ */
|
|
3906
|
-
/* @__PURE__ */
|
|
4042
|
+
options && options.length > 0 && /* @__PURE__ */ jsx36("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ jsxs34("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
|
|
4043
|
+
/* @__PURE__ */ jsx36(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
|
|
3907
4044
|
o.label
|
|
3908
4045
|
] }, o.key)) }),
|
|
3909
|
-
/* @__PURE__ */
|
|
3910
|
-
/* @__PURE__ */
|
|
3911
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__PURE__ */ jsxs34("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
|
|
4047
|
+
/* @__PURE__ */ jsx36(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
|
|
4048
|
+
/* @__PURE__ */ jsx36(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
|
|
3912
4049
|
] })
|
|
3913
4050
|
]
|
|
3914
4051
|
}
|
|
@@ -3921,11 +4058,11 @@ function NameListModal({
|
|
|
3921
4058
|
|
|
3922
4059
|
// src/FilterChipBar.tsx
|
|
3923
4060
|
import { CircleSlash, X as X4 } from "lucide-react";
|
|
3924
|
-
import { jsx as
|
|
4061
|
+
import { jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3925
4062
|
function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
|
|
3926
4063
|
if (chips.length === 0) return null;
|
|
3927
|
-
return /* @__PURE__ */
|
|
3928
|
-
chips.map((c) => /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsxs35("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
|
|
4065
|
+
chips.map((c) => /* @__PURE__ */ jsx37(
|
|
3929
4066
|
Chip,
|
|
3930
4067
|
{
|
|
3931
4068
|
label: c.label,
|
|
@@ -3935,7 +4072,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
3935
4072
|
},
|
|
3936
4073
|
c.key
|
|
3937
4074
|
)),
|
|
3938
|
-
/* @__PURE__ */
|
|
4075
|
+
/* @__PURE__ */ jsx37(
|
|
3939
4076
|
"button",
|
|
3940
4077
|
{
|
|
3941
4078
|
type: "button",
|
|
@@ -3952,8 +4089,8 @@ function Chip({
|
|
|
3952
4089
|
parked,
|
|
3953
4090
|
onRemove
|
|
3954
4091
|
}) {
|
|
3955
|
-
return /* @__PURE__ */
|
|
3956
|
-
/* @__PURE__ */
|
|
4092
|
+
return /* @__PURE__ */ jsxs35("span", { className: "group relative inline-flex", children: [
|
|
4093
|
+
/* @__PURE__ */ jsxs35(
|
|
3957
4094
|
"span",
|
|
3958
4095
|
{
|
|
3959
4096
|
className: cn(
|
|
@@ -3965,22 +4102,22 @@ function Chip({
|
|
|
3965
4102
|
) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
|
|
3966
4103
|
),
|
|
3967
4104
|
children: [
|
|
3968
|
-
parked && /* @__PURE__ */
|
|
4105
|
+
parked && /* @__PURE__ */ jsx37(CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
|
|
3969
4106
|
label,
|
|
3970
|
-
/* @__PURE__ */
|
|
4107
|
+
/* @__PURE__ */ jsx37(
|
|
3971
4108
|
"button",
|
|
3972
4109
|
{
|
|
3973
4110
|
type: "button",
|
|
3974
4111
|
onClick: onRemove,
|
|
3975
4112
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
3976
4113
|
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",
|
|
3977
|
-
children: /* @__PURE__ */
|
|
4114
|
+
children: /* @__PURE__ */ jsx37(X4, { size: 12 })
|
|
3978
4115
|
}
|
|
3979
4116
|
)
|
|
3980
4117
|
]
|
|
3981
4118
|
}
|
|
3982
4119
|
),
|
|
3983
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx37(
|
|
3984
4121
|
"span",
|
|
3985
4122
|
{
|
|
3986
4123
|
role: "tooltip",
|
|
@@ -3992,9 +4129,9 @@ function Chip({
|
|
|
3992
4129
|
}
|
|
3993
4130
|
|
|
3994
4131
|
// src/SortButton.tsx
|
|
3995
|
-
import { forwardRef as forwardRef7 } from "react";
|
|
4132
|
+
import { forwardRef as forwardRef7, useImperativeHandle, useRef as useRef13 } from "react";
|
|
3996
4133
|
import { ArrowUp, ArrowDown, ArrowUpDown } from "lucide-react";
|
|
3997
|
-
import { jsx as
|
|
4134
|
+
import { Fragment as Fragment4, jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3998
4135
|
var ALIGN = {
|
|
3999
4136
|
left: "justify-start text-left",
|
|
4000
4137
|
center: "justify-center text-center",
|
|
@@ -4009,15 +4146,22 @@ var SortButton = forwardRef7(
|
|
|
4009
4146
|
disabled = false,
|
|
4010
4147
|
sortable = true,
|
|
4011
4148
|
align = "left",
|
|
4149
|
+
description,
|
|
4012
4150
|
className,
|
|
4013
4151
|
testIdPrefix
|
|
4014
4152
|
}, ref) {
|
|
4015
|
-
|
|
4153
|
+
const own = useRef13(null);
|
|
4154
|
+
useImperativeHandle(ref, () => own.current);
|
|
4155
|
+
const text = description ? /* @__PURE__ */ jsx38("span", { className: DESCRIBED, children: label }) : label;
|
|
4156
|
+
if (!sortable) {
|
|
4157
|
+
const plain = /* @__PURE__ */ jsx38("span", { className: cn("inline-flex", ALIGN[align], className), children: text });
|
|
4158
|
+
return description ? /* @__PURE__ */ jsx38(HeaderTip, { description, children: plain }) : plain;
|
|
4159
|
+
}
|
|
4016
4160
|
const active = !disabled && sort.key === sortKey;
|
|
4017
|
-
|
|
4161
|
+
const button = /* @__PURE__ */ jsxs36(
|
|
4018
4162
|
"button",
|
|
4019
4163
|
{
|
|
4020
|
-
ref,
|
|
4164
|
+
ref: own,
|
|
4021
4165
|
type: "button",
|
|
4022
4166
|
disabled,
|
|
4023
4167
|
onClick: () => onSort(sortKey),
|
|
@@ -4044,27 +4188,35 @@ var SortButton = forwardRef7(
|
|
|
4044
4188
|
className
|
|
4045
4189
|
),
|
|
4046
4190
|
children: [
|
|
4047
|
-
|
|
4048
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */
|
|
4191
|
+
text,
|
|
4192
|
+
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ jsx38(ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ jsx38(ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ jsx38(
|
|
4049
4193
|
ArrowUpDown,
|
|
4050
4194
|
{
|
|
4051
4195
|
size: 12,
|
|
4052
4196
|
"aria-hidden": "true",
|
|
4053
|
-
className: "shrink-0 text-text-tertiary opacity-
|
|
4197
|
+
className: "shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 group-hover/head:opacity-100 pointer-coarse:opacity-50"
|
|
4054
4198
|
}
|
|
4055
4199
|
))
|
|
4056
4200
|
]
|
|
4057
4201
|
}
|
|
4058
4202
|
);
|
|
4203
|
+
return /* @__PURE__ */ jsxs36(Fragment4, { children: [
|
|
4204
|
+
button,
|
|
4205
|
+
description && /* @__PURE__ */ jsx38(Tooltip, { anchorRef: own, label: description, delay: 300, placement: "top" })
|
|
4206
|
+
] });
|
|
4059
4207
|
}
|
|
4060
4208
|
);
|
|
4061
4209
|
SortButton.displayName = "SortButton";
|
|
4210
|
+
var DESCRIBED = "underline decoration-dotted decoration-1 decoration-text-tertiary underline-offset-4";
|
|
4211
|
+
function HeaderTip({ description, children }) {
|
|
4212
|
+
return /* @__PURE__ */ jsx38(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__ */ jsx38("span", { tabIndex: 0, children }) });
|
|
4213
|
+
}
|
|
4062
4214
|
|
|
4063
4215
|
// src/tableSort.ts
|
|
4064
|
-
function cycleSort(current, key, firstDir = "desc") {
|
|
4216
|
+
function cycleSort(current, key, firstDir = "desc", fallback = null) {
|
|
4065
4217
|
if (!current || current.key !== key) return { key, dir: firstDir };
|
|
4066
4218
|
if (current.dir === firstDir) return { key, dir: firstDir === "desc" ? "asc" : "desc" };
|
|
4067
|
-
return
|
|
4219
|
+
return fallback && fallback.key === key ? { key, dir: firstDir } : fallback;
|
|
4068
4220
|
}
|
|
4069
4221
|
function sortProp(sort) {
|
|
4070
4222
|
return sort ?? { key: null, dir: "desc" };
|
|
@@ -4076,7 +4228,7 @@ function ariaSortFor(sort, key) {
|
|
|
4076
4228
|
|
|
4077
4229
|
// src/Pager.tsx
|
|
4078
4230
|
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight4 } from "lucide-react";
|
|
4079
|
-
import { jsx as
|
|
4231
|
+
import { jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4080
4232
|
function pageWindow(current, total) {
|
|
4081
4233
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
4082
4234
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -4092,8 +4244,8 @@ function pageWindow(current, total) {
|
|
|
4092
4244
|
}
|
|
4093
4245
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
4094
4246
|
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";
|
|
4095
|
-
return /* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4247
|
+
return /* @__PURE__ */ jsxs37("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4248
|
+
/* @__PURE__ */ jsx39(
|
|
4097
4249
|
"button",
|
|
4098
4250
|
{
|
|
4099
4251
|
type: "button",
|
|
@@ -4101,11 +4253,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4101
4253
|
disabled: disabled || page === 1,
|
|
4102
4254
|
"aria-label": "Previous page",
|
|
4103
4255
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4104
|
-
children: /* @__PURE__ */
|
|
4256
|
+
children: /* @__PURE__ */ jsx39(ChevronLeft3, { size: 16 })
|
|
4105
4257
|
}
|
|
4106
4258
|
),
|
|
4107
4259
|
pageWindow(page, totalPages).map(
|
|
4108
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4260
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx39("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx39(
|
|
4109
4261
|
"button",
|
|
4110
4262
|
{
|
|
4111
4263
|
type: "button",
|
|
@@ -4121,7 +4273,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4121
4273
|
p
|
|
4122
4274
|
)
|
|
4123
4275
|
),
|
|
4124
|
-
/* @__PURE__ */
|
|
4276
|
+
/* @__PURE__ */ jsx39(
|
|
4125
4277
|
"button",
|
|
4126
4278
|
{
|
|
4127
4279
|
type: "button",
|
|
@@ -4129,14 +4281,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4129
4281
|
disabled: disabled || page === totalPages,
|
|
4130
4282
|
"aria-label": "Next page",
|
|
4131
4283
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4132
|
-
children: /* @__PURE__ */
|
|
4284
|
+
children: /* @__PURE__ */ jsx39(ChevronRight4, { size: 16 })
|
|
4133
4285
|
}
|
|
4134
4286
|
)
|
|
4135
4287
|
] });
|
|
4136
4288
|
}
|
|
4137
4289
|
|
|
4138
4290
|
// src/WorkspaceAvatar.tsx
|
|
4139
|
-
import { jsx as
|
|
4291
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
4140
4292
|
function workspaceInitials(name) {
|
|
4141
4293
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
4142
4294
|
if (words.length === 0) return "\xB7";
|
|
@@ -4155,7 +4307,7 @@ var SIZES = {
|
|
|
4155
4307
|
lg: "h-11 w-11 text-panel-title"
|
|
4156
4308
|
};
|
|
4157
4309
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
4158
|
-
return /* @__PURE__ */
|
|
4310
|
+
return /* @__PURE__ */ jsx40(
|
|
4159
4311
|
"span",
|
|
4160
4312
|
{
|
|
4161
4313
|
"aria-hidden": "true",
|
|
@@ -4171,20 +4323,20 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
4171
4323
|
}
|
|
4172
4324
|
|
|
4173
4325
|
// src/Toast.tsx
|
|
4174
|
-
import { useEffect as
|
|
4326
|
+
import { useEffect as useEffect12, useRef as useRef14, useState as useState13 } from "react";
|
|
4175
4327
|
import { createPortal as createPortal6 } from "react-dom";
|
|
4176
4328
|
import { AlertTriangle, Check as Check8 } from "lucide-react";
|
|
4177
|
-
import { jsx as
|
|
4329
|
+
import { jsx as jsx41, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4178
4330
|
var ICON = {
|
|
4179
4331
|
neutral: null,
|
|
4180
|
-
success: /* @__PURE__ */
|
|
4181
|
-
warning: /* @__PURE__ */
|
|
4332
|
+
success: /* @__PURE__ */ jsx41(Check8, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
|
|
4333
|
+
warning: /* @__PURE__ */ jsx41(AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
|
|
4182
4334
|
};
|
|
4183
4335
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4184
4336
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
4185
|
-
const [paused, setPaused] =
|
|
4186
|
-
const closed =
|
|
4187
|
-
|
|
4337
|
+
const [paused, setPaused] = useState13(false);
|
|
4338
|
+
const closed = useRef14(false);
|
|
4339
|
+
useEffect12(() => {
|
|
4188
4340
|
if (paused) return;
|
|
4189
4341
|
const t = window.setTimeout(() => {
|
|
4190
4342
|
if (closed.current) return;
|
|
@@ -4194,7 +4346,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4194
4346
|
return () => window.clearTimeout(t);
|
|
4195
4347
|
}, [message, ms, paused]);
|
|
4196
4348
|
return createPortal6(
|
|
4197
|
-
/* @__PURE__ */
|
|
4349
|
+
/* @__PURE__ */ jsxs38(
|
|
4198
4350
|
"div",
|
|
4199
4351
|
{
|
|
4200
4352
|
role: "status",
|
|
@@ -4212,7 +4364,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4212
4364
|
children: [
|
|
4213
4365
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4214
4366
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4215
|
-
/* @__PURE__ */
|
|
4367
|
+
/* @__PURE__ */ jsx41(
|
|
4216
4368
|
"span",
|
|
4217
4369
|
{
|
|
4218
4370
|
className: cn(
|
|
@@ -4222,8 +4374,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4222
4374
|
children: ICON[tone]
|
|
4223
4375
|
}
|
|
4224
4376
|
),
|
|
4225
|
-
/* @__PURE__ */
|
|
4226
|
-
action && /* @__PURE__ */
|
|
4377
|
+
/* @__PURE__ */ jsx41("span", { className: "min-w-0", children: message }),
|
|
4378
|
+
action && /* @__PURE__ */ jsx41(
|
|
4227
4379
|
"button",
|
|
4228
4380
|
{
|
|
4229
4381
|
type: "button",
|
|
@@ -4245,14 +4397,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4245
4397
|
}
|
|
4246
4398
|
|
|
4247
4399
|
// src/Tag.tsx
|
|
4248
|
-
import { jsx as
|
|
4400
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4249
4401
|
function Tag({ children, className, testIdPrefix }) {
|
|
4250
|
-
return /* @__PURE__ */
|
|
4402
|
+
return /* @__PURE__ */ jsx42(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4251
4403
|
}
|
|
4252
4404
|
|
|
4253
4405
|
// src/TablePagination.tsx
|
|
4254
4406
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
4255
|
-
import { jsx as
|
|
4407
|
+
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4256
4408
|
function TablePagination({
|
|
4257
4409
|
page,
|
|
4258
4410
|
perPage,
|
|
@@ -4272,7 +4424,7 @@ function TablePagination({
|
|
|
4272
4424
|
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";
|
|
4273
4425
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4274
4426
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4275
|
-
const range = /* @__PURE__ */
|
|
4427
|
+
const range = /* @__PURE__ */ jsxs39("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4276
4428
|
rangeStart.toLocaleString(),
|
|
4277
4429
|
" \u2013 ",
|
|
4278
4430
|
rangeEnd.toLocaleString(),
|
|
@@ -4281,13 +4433,13 @@ function TablePagination({
|
|
|
4281
4433
|
" ",
|
|
4282
4434
|
itemLabel
|
|
4283
4435
|
] });
|
|
4284
|
-
return /* @__PURE__ */
|
|
4285
|
-
/* @__PURE__ */
|
|
4436
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
4437
|
+
/* @__PURE__ */ jsxs39(
|
|
4286
4438
|
"div",
|
|
4287
4439
|
{
|
|
4288
4440
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4289
4441
|
children: [
|
|
4290
|
-
/* @__PURE__ */
|
|
4442
|
+
/* @__PURE__ */ jsx43(
|
|
4291
4443
|
SelectFilter,
|
|
4292
4444
|
{
|
|
4293
4445
|
size: "sm",
|
|
@@ -4303,8 +4455,8 @@ function TablePagination({
|
|
|
4303
4455
|
]
|
|
4304
4456
|
}
|
|
4305
4457
|
),
|
|
4306
|
-
/* @__PURE__ */
|
|
4307
|
-
/* @__PURE__ */
|
|
4458
|
+
/* @__PURE__ */ jsxs39("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4459
|
+
/* @__PURE__ */ jsx43(
|
|
4308
4460
|
"button",
|
|
4309
4461
|
{
|
|
4310
4462
|
type: "button",
|
|
@@ -4313,10 +4465,10 @@ function TablePagination({
|
|
|
4313
4465
|
"aria-label": "First page",
|
|
4314
4466
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4315
4467
|
className: stepBtn,
|
|
4316
|
-
children: /* @__PURE__ */
|
|
4468
|
+
children: /* @__PURE__ */ jsx43(ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4317
4469
|
}
|
|
4318
4470
|
),
|
|
4319
|
-
/* @__PURE__ */
|
|
4471
|
+
/* @__PURE__ */ jsx43(
|
|
4320
4472
|
"button",
|
|
4321
4473
|
{
|
|
4322
4474
|
type: "button",
|
|
@@ -4325,11 +4477,11 @@ function TablePagination({
|
|
|
4325
4477
|
"aria-label": "Previous page",
|
|
4326
4478
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4327
4479
|
className: stepBtn,
|
|
4328
|
-
children: /* @__PURE__ */
|
|
4480
|
+
children: /* @__PURE__ */ jsx43(ChevronLeft4, { size: 16, "aria-hidden": "true" })
|
|
4329
4481
|
}
|
|
4330
4482
|
),
|
|
4331
4483
|
pageWindow(current, totalPages).map(
|
|
4332
|
-
(p) => typeof p === "string" ? /* @__PURE__ */
|
|
4484
|
+
(p) => typeof p === "string" ? /* @__PURE__ */ jsx43("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ jsx43(
|
|
4333
4485
|
"button",
|
|
4334
4486
|
{
|
|
4335
4487
|
type: "button",
|
|
@@ -4347,7 +4499,7 @@ function TablePagination({
|
|
|
4347
4499
|
p
|
|
4348
4500
|
)
|
|
4349
4501
|
),
|
|
4350
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsx43(
|
|
4351
4503
|
"button",
|
|
4352
4504
|
{
|
|
4353
4505
|
type: "button",
|
|
@@ -4356,10 +4508,10 @@ function TablePagination({
|
|
|
4356
4508
|
"aria-label": "Next page",
|
|
4357
4509
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4358
4510
|
className: stepBtn,
|
|
4359
|
-
children: /* @__PURE__ */
|
|
4511
|
+
children: /* @__PURE__ */ jsx43(ChevronRight5, { size: 16, "aria-hidden": "true" })
|
|
4360
4512
|
}
|
|
4361
4513
|
),
|
|
4362
|
-
/* @__PURE__ */
|
|
4514
|
+
/* @__PURE__ */ jsx43(
|
|
4363
4515
|
"button",
|
|
4364
4516
|
{
|
|
4365
4517
|
type: "button",
|
|
@@ -4368,7 +4520,7 @@ function TablePagination({
|
|
|
4368
4520
|
"aria-label": "Last page",
|
|
4369
4521
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4370
4522
|
className: stepBtn,
|
|
4371
|
-
children: /* @__PURE__ */
|
|
4523
|
+
children: /* @__PURE__ */ jsx43(ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4372
4524
|
}
|
|
4373
4525
|
)
|
|
4374
4526
|
] }),
|
|
@@ -4377,9 +4529,9 @@ function TablePagination({
|
|
|
4377
4529
|
}
|
|
4378
4530
|
|
|
4379
4531
|
// src/DateRangePicker.tsx
|
|
4380
|
-
import { useEffect as
|
|
4532
|
+
import { useEffect as useEffect13, useMemo as useMemo4, useRef as useRef15, useState as useState14 } from "react";
|
|
4381
4533
|
import { ChevronDown as ChevronDown9 } from "lucide-react";
|
|
4382
|
-
import { jsx as
|
|
4534
|
+
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4383
4535
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4384
4536
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4385
4537
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4417,7 +4569,7 @@ function spanLabel2(label, today, formatDate2, formatRange) {
|
|
|
4417
4569
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4418
4570
|
}
|
|
4419
4571
|
function MiniSelect({ value, onChange, options }) {
|
|
4420
|
-
return /* @__PURE__ */
|
|
4572
|
+
return /* @__PURE__ */ jsx44(
|
|
4421
4573
|
"select",
|
|
4422
4574
|
{
|
|
4423
4575
|
value: String(value),
|
|
@@ -4426,7 +4578,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4426
4578
|
if (opt) onChange(opt.value);
|
|
4427
4579
|
},
|
|
4428
4580
|
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",
|
|
4429
|
-
children: options.map((o) => /* @__PURE__ */
|
|
4581
|
+
children: options.map((o) => /* @__PURE__ */ jsx44("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4430
4582
|
}
|
|
4431
4583
|
);
|
|
4432
4584
|
}
|
|
@@ -4447,17 +4599,17 @@ function DateRangePicker({
|
|
|
4447
4599
|
}) {
|
|
4448
4600
|
const end = useMemo4(() => today ?? startOfToday(), [today]);
|
|
4449
4601
|
const yearOptions = years ?? [3, 2, 1, 0].map((n) => end.getFullYear() - n);
|
|
4450
|
-
const [open, setOpen] =
|
|
4451
|
-
const [value, setValue] =
|
|
4452
|
-
const [draft, setDraft] =
|
|
4453
|
-
const ref =
|
|
4454
|
-
const [fromMo, setFromMo] =
|
|
4455
|
-
const [fromYr, setFromYr] =
|
|
4456
|
-
const [toMo, setToMo] =
|
|
4457
|
-
const [toYr, setToYr] =
|
|
4458
|
-
const [fromQ, setFromQ] =
|
|
4459
|
-
const [toQ, setToQ] =
|
|
4460
|
-
|
|
4602
|
+
const [open, setOpen] = useState14(false);
|
|
4603
|
+
const [value, setValue] = useState14(defaultValue);
|
|
4604
|
+
const [draft, setDraft] = useState14(defaultValue);
|
|
4605
|
+
const ref = useRef15(null);
|
|
4606
|
+
const [fromMo, setFromMo] = useState14(end.getMonth());
|
|
4607
|
+
const [fromYr, setFromYr] = useState14(end.getFullYear() - 1);
|
|
4608
|
+
const [toMo, setToMo] = useState14(end.getMonth());
|
|
4609
|
+
const [toYr, setToYr] = useState14(end.getFullYear());
|
|
4610
|
+
const [fromQ, setFromQ] = useState14(Math.floor(end.getMonth() / 3));
|
|
4611
|
+
const [toQ, setToQ] = useState14(Math.floor(end.getMonth() / 3));
|
|
4612
|
+
useEffect13(() => {
|
|
4461
4613
|
const [s, e] = resolveRange(value, end);
|
|
4462
4614
|
onRangeChange?.(s, e);
|
|
4463
4615
|
}, [value]);
|
|
@@ -4465,7 +4617,7 @@ function DateRangePicker({
|
|
|
4465
4617
|
if (!open) setDraft(value);
|
|
4466
4618
|
setOpen((o) => !o);
|
|
4467
4619
|
};
|
|
4468
|
-
|
|
4620
|
+
useEffect13(() => {
|
|
4469
4621
|
if (!open) return;
|
|
4470
4622
|
const onDown = (e) => {
|
|
4471
4623
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
@@ -4491,8 +4643,8 @@ function DateRangePicker({
|
|
|
4491
4643
|
if (showFooter) setDraft(label);
|
|
4492
4644
|
else commit(label);
|
|
4493
4645
|
};
|
|
4494
|
-
return /* @__PURE__ */
|
|
4495
|
-
/* @__PURE__ */
|
|
4646
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4647
|
+
/* @__PURE__ */ jsxs40(
|
|
4496
4648
|
"button",
|
|
4497
4649
|
{
|
|
4498
4650
|
type: "button",
|
|
@@ -4501,16 +4653,16 @@ function DateRangePicker({
|
|
|
4501
4653
|
"aria-haspopup": "listbox",
|
|
4502
4654
|
className: chipTriggerClass(),
|
|
4503
4655
|
children: [
|
|
4504
|
-
/* @__PURE__ */
|
|
4505
|
-
/* @__PURE__ */
|
|
4506
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsxs40("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
|
|
4657
|
+
/* @__PURE__ */ jsx44("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate2, formatRange) }),
|
|
4658
|
+
/* @__PURE__ */ jsx44("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
|
|
4507
4659
|
] }),
|
|
4508
|
-
/* @__PURE__ */
|
|
4660
|
+
/* @__PURE__ */ jsx44(ChevronDown9, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4509
4661
|
]
|
|
4510
4662
|
}
|
|
4511
4663
|
),
|
|
4512
|
-
open && /* @__PURE__ */
|
|
4513
|
-
presets.map((p) => /* @__PURE__ */
|
|
4664
|
+
open && /* @__PURE__ */ jsxs40("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: [
|
|
4665
|
+
presets.map((p) => /* @__PURE__ */ jsx44(
|
|
4514
4666
|
"button",
|
|
4515
4667
|
{
|
|
4516
4668
|
type: "button",
|
|
@@ -4520,26 +4672,26 @@ function DateRangePicker({
|
|
|
4520
4672
|
},
|
|
4521
4673
|
p
|
|
4522
4674
|
)),
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
/* @__PURE__ */
|
|
4525
|
-
/* @__PURE__ */
|
|
4526
|
-
/* @__PURE__ */
|
|
4675
|
+
/* @__PURE__ */ jsxs40("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
|
|
4676
|
+
/* @__PURE__ */ jsx44("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
|
|
4677
|
+
/* @__PURE__ */ jsxs40("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
4678
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4527
4679
|
"From",
|
|
4528
|
-
/* @__PURE__ */
|
|
4529
|
-
granularity === "month" && /* @__PURE__ */
|
|
4530
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4531
|
-
/* @__PURE__ */
|
|
4680
|
+
/* @__PURE__ */ jsxs40("span", { className: "flex gap-1", children: [
|
|
4681
|
+
granularity === "month" && /* @__PURE__ */ jsx44(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4682
|
+
granularity === "quarter" && /* @__PURE__ */ jsx44(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4683
|
+
/* @__PURE__ */ jsx44(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4532
4684
|
] })
|
|
4533
4685
|
] }),
|
|
4534
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4535
4687
|
"To",
|
|
4536
|
-
/* @__PURE__ */
|
|
4537
|
-
granularity === "month" && /* @__PURE__ */
|
|
4538
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4539
|
-
/* @__PURE__ */
|
|
4688
|
+
/* @__PURE__ */ jsxs40("span", { className: "flex gap-1", children: [
|
|
4689
|
+
granularity === "month" && /* @__PURE__ */ jsx44(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
|
|
4690
|
+
granularity === "quarter" && /* @__PURE__ */ jsx44(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
|
|
4691
|
+
/* @__PURE__ */ jsx44(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
|
|
4540
4692
|
] })
|
|
4541
4693
|
] }),
|
|
4542
|
-
/* @__PURE__ */
|
|
4694
|
+
/* @__PURE__ */ jsx44(
|
|
4543
4695
|
"button",
|
|
4544
4696
|
{
|
|
4545
4697
|
type: "button",
|
|
@@ -4551,15 +4703,15 @@ function DateRangePicker({
|
|
|
4551
4703
|
)
|
|
4552
4704
|
] })
|
|
4553
4705
|
] }),
|
|
4554
|
-
showFooter && /* @__PURE__ */
|
|
4706
|
+
showFooter && /* @__PURE__ */ jsx44(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4555
4707
|
] })
|
|
4556
4708
|
] });
|
|
4557
4709
|
}
|
|
4558
4710
|
|
|
4559
4711
|
// src/MultiSelectFilter.tsx
|
|
4560
|
-
import { useCallback as useCallback4, useEffect as
|
|
4712
|
+
import { useCallback as useCallback4, useEffect as useEffect14, useRef as useRef16, useState as useState15 } from "react";
|
|
4561
4713
|
import { ChevronDown as ChevronDown10, Search as Search5, X as X5 } from "lucide-react";
|
|
4562
|
-
import { Fragment as
|
|
4714
|
+
import { Fragment as Fragment5, jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4563
4715
|
var SEARCH_AFTER = 8;
|
|
4564
4716
|
function MultiSelectFilter({
|
|
4565
4717
|
caption,
|
|
@@ -4593,10 +4745,10 @@ function MultiSelectFilter({
|
|
|
4593
4745
|
const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
|
|
4594
4746
|
const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
|
|
4595
4747
|
const showSearch = searchable ?? leafOptions.length > SEARCH_AFTER;
|
|
4596
|
-
const [open, setOpen] =
|
|
4597
|
-
const [q, setQ] =
|
|
4598
|
-
const [draft, setDraft] =
|
|
4599
|
-
const ref =
|
|
4748
|
+
const [open, setOpen] = useState15(false);
|
|
4749
|
+
const [q, setQ] = useState15("");
|
|
4750
|
+
const [draft, setDraft] = useState15(selected);
|
|
4751
|
+
const ref = useRef16(null);
|
|
4600
4752
|
const close = useCallback4(() => {
|
|
4601
4753
|
setOpen(false);
|
|
4602
4754
|
setQ("");
|
|
@@ -4620,7 +4772,7 @@ function MultiSelectFilter({
|
|
|
4620
4772
|
setOpen(false);
|
|
4621
4773
|
setQ("");
|
|
4622
4774
|
};
|
|
4623
|
-
|
|
4775
|
+
useEffect14(() => {
|
|
4624
4776
|
if (!open) return;
|
|
4625
4777
|
const onKey = (e) => e.key === "Escape" && close();
|
|
4626
4778
|
const onClick = (e) => {
|
|
@@ -4657,9 +4809,9 @@ function MultiSelectFilter({
|
|
|
4657
4809
|
const shown = open && !showFooter ? draft : selected;
|
|
4658
4810
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4659
4811
|
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4660
|
-
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4662
|
-
/* @__PURE__ */
|
|
4812
|
+
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ jsxs41("span", { className: "flex flex-col", children: [
|
|
4813
|
+
/* @__PURE__ */ jsx45("span", { children: label }),
|
|
4814
|
+
/* @__PURE__ */ jsx45("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
|
|
4663
4815
|
] }) : label;
|
|
4664
4816
|
const ql = q.trim().toLowerCase();
|
|
4665
4817
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4670,8 +4822,8 @@ function MultiSelectFilter({
|
|
|
4670
4822
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4671
4823
|
return kids.length ? { ...g, children: kids } : null;
|
|
4672
4824
|
}).filter((g) => g !== null) : [];
|
|
4673
|
-
return /* @__PURE__ */
|
|
4674
|
-
/* @__PURE__ */
|
|
4825
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4826
|
+
/* @__PURE__ */ jsxs41(
|
|
4675
4827
|
"button",
|
|
4676
4828
|
{
|
|
4677
4829
|
type: "button",
|
|
@@ -4680,8 +4832,8 @@ function MultiSelectFilter({
|
|
|
4680
4832
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4681
4833
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4682
4834
|
children: [
|
|
4683
|
-
/* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
4835
|
+
/* @__PURE__ */ jsx45(ChipContent, { caption, value, icon }),
|
|
4836
|
+
/* @__PURE__ */ jsx45(
|
|
4685
4837
|
ChevronDown10,
|
|
4686
4838
|
{
|
|
4687
4839
|
size: 14,
|
|
@@ -4692,7 +4844,7 @@ function MultiSelectFilter({
|
|
|
4692
4844
|
]
|
|
4693
4845
|
}
|
|
4694
4846
|
),
|
|
4695
|
-
open && /* @__PURE__ */
|
|
4847
|
+
open && /* @__PURE__ */ jsx45(
|
|
4696
4848
|
"div",
|
|
4697
4849
|
{
|
|
4698
4850
|
className: cn(
|
|
@@ -4703,10 +4855,10 @@ function MultiSelectFilter({
|
|
|
4703
4855
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4704
4856
|
role: "dialog",
|
|
4705
4857
|
"aria-label": caption,
|
|
4706
|
-
children: loading ? /* @__PURE__ */
|
|
4707
|
-
showSearch && /* @__PURE__ */
|
|
4708
|
-
/* @__PURE__ */
|
|
4709
|
-
/* @__PURE__ */
|
|
4858
|
+
children: loading ? /* @__PURE__ */ jsx45(MenuLoading, {}) : error ? /* @__PURE__ */ jsx45(MenuError, { onRetry }) : /* @__PURE__ */ jsxs41(Fragment5, { children: [
|
|
4859
|
+
showSearch && /* @__PURE__ */ jsx45("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs41("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: [
|
|
4860
|
+
/* @__PURE__ */ jsx45(Search5, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4861
|
+
/* @__PURE__ */ jsx45(
|
|
4710
4862
|
"input",
|
|
4711
4863
|
{
|
|
4712
4864
|
type: "text",
|
|
@@ -4716,37 +4868,37 @@ function MultiSelectFilter({
|
|
|
4716
4868
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4717
4869
|
}
|
|
4718
4870
|
),
|
|
4719
|
-
q && /* @__PURE__ */
|
|
4871
|
+
q && /* @__PURE__ */ jsx45("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__ */ jsx45(X5, { size: 13 }) })
|
|
4720
4872
|
] }) }),
|
|
4721
|
-
/* @__PURE__ */
|
|
4873
|
+
/* @__PURE__ */ jsxs41("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4722
4874
|
groups ? visibleGroups.map((g) => {
|
|
4723
4875
|
const state = groupState(g);
|
|
4724
|
-
return /* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ jsxs41("div", { children: [
|
|
4877
|
+
/* @__PURE__ */ jsxs41(
|
|
4726
4878
|
"button",
|
|
4727
4879
|
{
|
|
4728
4880
|
type: "button",
|
|
4729
4881
|
onClick: () => toggleGroup(g),
|
|
4730
4882
|
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",
|
|
4731
4883
|
children: [
|
|
4732
|
-
/* @__PURE__ */
|
|
4733
|
-
/* @__PURE__ */
|
|
4734
|
-
counts && /* @__PURE__ */
|
|
4884
|
+
/* @__PURE__ */ jsx45(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
|
|
4885
|
+
/* @__PURE__ */ jsx45("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
|
|
4886
|
+
counts && /* @__PURE__ */ jsx45(OptionCount, { n: countFor(g.id) })
|
|
4735
4887
|
]
|
|
4736
4888
|
}
|
|
4737
4889
|
),
|
|
4738
4890
|
g.children.map((c) => {
|
|
4739
4891
|
const checked = draft.includes(c.id);
|
|
4740
|
-
return /* @__PURE__ */
|
|
4892
|
+
return /* @__PURE__ */ jsxs41(
|
|
4741
4893
|
"button",
|
|
4742
4894
|
{
|
|
4743
4895
|
type: "button",
|
|
4744
4896
|
onClick: () => toggle(c.id),
|
|
4745
4897
|
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",
|
|
4746
4898
|
children: [
|
|
4747
|
-
/* @__PURE__ */
|
|
4748
|
-
/* @__PURE__ */
|
|
4749
|
-
counts && /* @__PURE__ */
|
|
4899
|
+
/* @__PURE__ */ jsx45(CheckBoxBox, { checked }),
|
|
4900
|
+
/* @__PURE__ */ jsx45("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
|
|
4901
|
+
counts && /* @__PURE__ */ jsx45(OptionCount, { n: countFor(c.id) })
|
|
4750
4902
|
]
|
|
4751
4903
|
},
|
|
4752
4904
|
c.id
|
|
@@ -4755,25 +4907,25 @@ function MultiSelectFilter({
|
|
|
4755
4907
|
] }, g.id);
|
|
4756
4908
|
}) : items.map((o) => {
|
|
4757
4909
|
const checked = draft.includes(o.id);
|
|
4758
|
-
return /* @__PURE__ */
|
|
4910
|
+
return /* @__PURE__ */ jsxs41(
|
|
4759
4911
|
"button",
|
|
4760
4912
|
{
|
|
4761
4913
|
type: "button",
|
|
4762
4914
|
onClick: () => toggle(o.id),
|
|
4763
4915
|
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",
|
|
4764
4916
|
children: [
|
|
4765
|
-
/* @__PURE__ */
|
|
4766
|
-
/* @__PURE__ */
|
|
4767
|
-
counts && /* @__PURE__ */
|
|
4917
|
+
/* @__PURE__ */ jsx45(CheckBoxBox, { checked }),
|
|
4918
|
+
/* @__PURE__ */ jsx45("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
|
|
4919
|
+
counts && /* @__PURE__ */ jsx45(OptionCount, { n: countFor(o.id) })
|
|
4768
4920
|
]
|
|
4769
4921
|
},
|
|
4770
4922
|
o.id
|
|
4771
4923
|
);
|
|
4772
4924
|
}),
|
|
4773
|
-
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */
|
|
4925
|
+
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ jsx45("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4774
4926
|
] }),
|
|
4775
|
-
note && /* @__PURE__ */
|
|
4776
|
-
showFooter ? /* @__PURE__ */
|
|
4927
|
+
note && /* @__PURE__ */ jsx45("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4928
|
+
showFooter ? /* @__PURE__ */ jsx45(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ jsx45("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ jsxs41(
|
|
4777
4929
|
"button",
|
|
4778
4930
|
{
|
|
4779
4931
|
type: "button",
|
|
@@ -4791,7 +4943,7 @@ function MultiSelectFilter({
|
|
|
4791
4943
|
] });
|
|
4792
4944
|
}
|
|
4793
4945
|
function OptionCount({ n }) {
|
|
4794
|
-
return /* @__PURE__ */
|
|
4946
|
+
return /* @__PURE__ */ jsxs41("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4795
4947
|
"(",
|
|
4796
4948
|
n.toLocaleString(),
|
|
4797
4949
|
")"
|
|
@@ -4800,7 +4952,7 @@ function OptionCount({ n }) {
|
|
|
4800
4952
|
|
|
4801
4953
|
// src/Toggle.tsx
|
|
4802
4954
|
import { forwardRef as forwardRef8 } from "react";
|
|
4803
|
-
import { jsx as
|
|
4955
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4804
4956
|
var SIZES2 = {
|
|
4805
4957
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4806
4958
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
@@ -4808,7 +4960,7 @@ var SIZES2 = {
|
|
|
4808
4960
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4809
4961
|
var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4810
4962
|
const s = SIZES2[size];
|
|
4811
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ jsx46(
|
|
4812
4964
|
"button",
|
|
4813
4965
|
{
|
|
4814
4966
|
ref,
|
|
@@ -4827,7 +4979,7 @@ var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md
|
|
|
4827
4979
|
disabled && "cursor-not-allowed opacity-50",
|
|
4828
4980
|
className
|
|
4829
4981
|
),
|
|
4830
|
-
children: /* @__PURE__ */
|
|
4982
|
+
children: /* @__PURE__ */ jsx46(
|
|
4831
4983
|
"span",
|
|
4832
4984
|
{
|
|
4833
4985
|
className: cn(
|
|
@@ -4845,20 +4997,20 @@ Toggle.displayName = "Toggle";
|
|
|
4845
4997
|
// src/AISpark.tsx
|
|
4846
4998
|
import { useId as useId6 } from "react";
|
|
4847
4999
|
import { Sparkles } from "lucide-react";
|
|
4848
|
-
import { Fragment as
|
|
5000
|
+
import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4849
5001
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4850
5002
|
const id = useId6();
|
|
4851
|
-
return /* @__PURE__ */
|
|
4852
|
-
/* @__PURE__ */
|
|
4853
|
-
/* @__PURE__ */
|
|
4854
|
-
/* @__PURE__ */
|
|
5003
|
+
return /* @__PURE__ */ jsxs42(Fragment6, { children: [
|
|
5004
|
+
/* @__PURE__ */ jsx47("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ jsx47("defs", { children: /* @__PURE__ */ jsxs42("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
5005
|
+
/* @__PURE__ */ jsx47("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
5006
|
+
/* @__PURE__ */ jsx47("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4855
5007
|
] }) }) }),
|
|
4856
|
-
/* @__PURE__ */
|
|
5008
|
+
/* @__PURE__ */ jsx47(Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4857
5009
|
] });
|
|
4858
5010
|
}
|
|
4859
5011
|
|
|
4860
5012
|
// src/Freshness.tsx
|
|
4861
|
-
import { jsx as
|
|
5013
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4862
5014
|
var dotColor = {
|
|
4863
5015
|
fresh: "bg-status-success",
|
|
4864
5016
|
recent: "bg-status-warning",
|
|
@@ -4870,7 +5022,7 @@ var srLabel = {
|
|
|
4870
5022
|
stale: "Older than a day"
|
|
4871
5023
|
};
|
|
4872
5024
|
function Freshness({ level, className, testIdPrefix }) {
|
|
4873
|
-
return /* @__PURE__ */
|
|
5025
|
+
return /* @__PURE__ */ jsx48(
|
|
4874
5026
|
"span",
|
|
4875
5027
|
{
|
|
4876
5028
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -4882,50 +5034,50 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
4882
5034
|
}
|
|
4883
5035
|
|
|
4884
5036
|
// src/SectionHeading.tsx
|
|
4885
|
-
import { jsx as
|
|
5037
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4886
5038
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
4887
|
-
return /* @__PURE__ */
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
/* @__PURE__ */
|
|
4890
|
-
description && /* @__PURE__ */
|
|
5039
|
+
return /* @__PURE__ */ jsxs43("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
|
|
5040
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0", children: [
|
|
5041
|
+
/* @__PURE__ */ jsx49(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5042
|
+
description && /* @__PURE__ */ jsx49("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
|
|
4891
5043
|
] }),
|
|
4892
|
-
actions && /* @__PURE__ */
|
|
5044
|
+
actions && /* @__PURE__ */ jsx49("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4893
5045
|
] });
|
|
4894
5046
|
}
|
|
4895
5047
|
|
|
4896
5048
|
// src/PageHeader.tsx
|
|
4897
5049
|
import { ArrowLeft } from "lucide-react";
|
|
4898
|
-
import { jsx as
|
|
5050
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4899
5051
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
4900
|
-
return /* @__PURE__ */
|
|
4901
|
-
/* @__PURE__ */
|
|
4902
|
-
back && /* @__PURE__ */
|
|
5052
|
+
return /* @__PURE__ */ jsxs44("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
|
|
5053
|
+
/* @__PURE__ */ jsxs44("div", { className: "min-w-0", children: [
|
|
5054
|
+
back && /* @__PURE__ */ jsxs44(
|
|
4903
5055
|
"a",
|
|
4904
5056
|
{
|
|
4905
5057
|
href: back.href ?? "#",
|
|
4906
5058
|
onClick: back.onClick,
|
|
4907
5059
|
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",
|
|
4908
5060
|
children: [
|
|
4909
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ jsx50(ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4910
5062
|
back.label
|
|
4911
5063
|
]
|
|
4912
5064
|
}
|
|
4913
5065
|
),
|
|
4914
|
-
meta ? /* @__PURE__ */
|
|
4915
|
-
/* @__PURE__ */
|
|
5066
|
+
meta ? /* @__PURE__ */ jsxs44("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
|
|
5067
|
+
/* @__PURE__ */ jsx50("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
4916
5068
|
meta
|
|
4917
|
-
] }) : /* @__PURE__ */
|
|
4918
|
-
description && /* @__PURE__ */
|
|
5069
|
+
] }) : /* @__PURE__ */ jsx50("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
|
|
5070
|
+
description && /* @__PURE__ */ jsx50("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
|
|
4919
5071
|
] }),
|
|
4920
|
-
actions && /* @__PURE__ */
|
|
5072
|
+
actions && /* @__PURE__ */ jsx50("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4921
5073
|
] });
|
|
4922
5074
|
}
|
|
4923
5075
|
|
|
4924
5076
|
// src/Modal.tsx
|
|
4925
|
-
import { useEffect as
|
|
5077
|
+
import { useEffect as useEffect15, useId as useId7, useRef as useRef17, useState as useState16 } from "react";
|
|
4926
5078
|
import { createPortal as createPortal7 } from "react-dom";
|
|
4927
5079
|
import { X as X6 } from "lucide-react";
|
|
4928
|
-
import { jsx as
|
|
5080
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4929
5081
|
var WIDTH = {
|
|
4930
5082
|
sm: "max-w-110",
|
|
4931
5083
|
md: "max-w-160",
|
|
@@ -4939,12 +5091,12 @@ var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:
|
|
|
4939
5091
|
function Modal({ open, onClose, title, description, size = "md", footer, children, className, testIdPrefix }) {
|
|
4940
5092
|
const titleId = useId7();
|
|
4941
5093
|
const descId = useId7();
|
|
4942
|
-
const panel =
|
|
4943
|
-
const close =
|
|
5094
|
+
const panel = useRef17(null);
|
|
5095
|
+
const close = useRef17(onClose);
|
|
4944
5096
|
close.current = onClose;
|
|
4945
|
-
const [mounted, setMounted] =
|
|
4946
|
-
const [shown, setShown] =
|
|
4947
|
-
|
|
5097
|
+
const [mounted, setMounted] = useState16(open);
|
|
5098
|
+
const [shown, setShown] = useState16(false);
|
|
5099
|
+
useEffect15(() => {
|
|
4948
5100
|
if (open) {
|
|
4949
5101
|
setMounted(true);
|
|
4950
5102
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
@@ -4954,7 +5106,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4954
5106
|
const t = setTimeout(() => setMounted(false), EXIT_MS);
|
|
4955
5107
|
return () => clearTimeout(t);
|
|
4956
5108
|
}, [open]);
|
|
4957
|
-
|
|
5109
|
+
useEffect15(() => {
|
|
4958
5110
|
if (!open || !mounted) return;
|
|
4959
5111
|
const opener = document.activeElement;
|
|
4960
5112
|
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE) ?? null;
|
|
@@ -4989,7 +5141,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4989
5141
|
}, [open, mounted]);
|
|
4990
5142
|
if (!mounted || typeof document === "undefined") return null;
|
|
4991
5143
|
return createPortal7(
|
|
4992
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ jsx51(
|
|
4993
5145
|
"div",
|
|
4994
5146
|
{
|
|
4995
5147
|
className: cn(
|
|
@@ -4997,7 +5149,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4997
5149
|
shown ? "opacity-100" : "opacity-0"
|
|
4998
5150
|
),
|
|
4999
5151
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
5000
|
-
children: /* @__PURE__ */
|
|
5152
|
+
children: /* @__PURE__ */ jsxs45(
|
|
5001
5153
|
"div",
|
|
5002
5154
|
{
|
|
5003
5155
|
ref: panel,
|
|
@@ -5015,24 +5167,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5015
5167
|
className
|
|
5016
5168
|
),
|
|
5017
5169
|
children: [
|
|
5018
|
-
/* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5020
|
-
/* @__PURE__ */
|
|
5021
|
-
description && /* @__PURE__ */
|
|
5170
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5171
|
+
/* @__PURE__ */ jsxs45("div", { className: "min-w-0 flex-1", children: [
|
|
5172
|
+
/* @__PURE__ */ jsx51("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5173
|
+
description && /* @__PURE__ */ jsx51("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5022
5174
|
] }),
|
|
5023
|
-
/* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsx51(
|
|
5024
5176
|
"button",
|
|
5025
5177
|
{
|
|
5026
5178
|
type: "button",
|
|
5027
5179
|
onClick: onClose,
|
|
5028
5180
|
"aria-label": "Close",
|
|
5029
5181
|
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",
|
|
5030
|
-
children: /* @__PURE__ */
|
|
5182
|
+
children: /* @__PURE__ */ jsx51(X6, { size: 16, "aria-hidden": "true" })
|
|
5031
5183
|
}
|
|
5032
5184
|
)
|
|
5033
5185
|
] }),
|
|
5034
|
-
children && /* @__PURE__ */
|
|
5035
|
-
footer && /* @__PURE__ */
|
|
5186
|
+
children && /* @__PURE__ */ jsx51("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 }),
|
|
5187
|
+
footer && /* @__PURE__ */ jsx51("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5036
5188
|
]
|
|
5037
5189
|
}
|
|
5038
5190
|
)
|
|
@@ -5043,10 +5195,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5043
5195
|
}
|
|
5044
5196
|
|
|
5045
5197
|
// src/EmptyState.tsx
|
|
5046
|
-
import { jsx as
|
|
5198
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5047
5199
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
5048
5200
|
const md = size === "md";
|
|
5049
|
-
return /* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ jsxs46(
|
|
5050
5202
|
"div",
|
|
5051
5203
|
{
|
|
5052
5204
|
className: cn(
|
|
@@ -5056,7 +5208,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5056
5208
|
),
|
|
5057
5209
|
"data-testid": testIdPrefix,
|
|
5058
5210
|
children: [
|
|
5059
|
-
icon && /* @__PURE__ */
|
|
5211
|
+
icon && /* @__PURE__ */ jsx52(
|
|
5060
5212
|
"span",
|
|
5061
5213
|
{
|
|
5062
5214
|
"aria-hidden": "true",
|
|
@@ -5067,9 +5219,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5067
5219
|
children: icon
|
|
5068
5220
|
}
|
|
5069
5221
|
),
|
|
5070
|
-
/* @__PURE__ */
|
|
5071
|
-
description && /* @__PURE__ */
|
|
5072
|
-
action && /* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsx52("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
|
|
5223
|
+
description && /* @__PURE__ */ jsx52("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
|
|
5224
|
+
action && /* @__PURE__ */ jsx52("div", { className: md ? "mt-3" : "mt-2", children: action })
|
|
5073
5225
|
]
|
|
5074
5226
|
}
|
|
5075
5227
|
);
|
|
@@ -5077,7 +5229,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5077
5229
|
|
|
5078
5230
|
// src/TextField.tsx
|
|
5079
5231
|
import { forwardRef as forwardRef9, useId as useId8 } from "react";
|
|
5080
|
-
import { jsx as
|
|
5232
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5081
5233
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
5082
5234
|
var TextField = forwardRef9(
|
|
5083
5235
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
@@ -5085,9 +5237,9 @@ var TextField = forwardRef9(
|
|
|
5085
5237
|
const fieldId = id ?? auto;
|
|
5086
5238
|
const noteId = `${fieldId}-note`;
|
|
5087
5239
|
const note = error ?? hint;
|
|
5088
|
-
return /* @__PURE__ */
|
|
5089
|
-
label && /* @__PURE__ */
|
|
5090
|
-
/* @__PURE__ */
|
|
5240
|
+
return /* @__PURE__ */ jsxs47("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
|
|
5241
|
+
label && /* @__PURE__ */ jsx53("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
|
|
5242
|
+
/* @__PURE__ */ jsxs47(
|
|
5091
5243
|
"div",
|
|
5092
5244
|
{
|
|
5093
5245
|
className: cn(
|
|
@@ -5097,8 +5249,8 @@ var TextField = forwardRef9(
|
|
|
5097
5249
|
disabled && "opacity-50"
|
|
5098
5250
|
),
|
|
5099
5251
|
children: [
|
|
5100
|
-
icon && /* @__PURE__ */
|
|
5101
|
-
/* @__PURE__ */
|
|
5252
|
+
icon && /* @__PURE__ */ jsx53("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5253
|
+
/* @__PURE__ */ jsx53(
|
|
5102
5254
|
"input",
|
|
5103
5255
|
{
|
|
5104
5256
|
ref,
|
|
@@ -5113,17 +5265,17 @@ var TextField = forwardRef9(
|
|
|
5113
5265
|
]
|
|
5114
5266
|
}
|
|
5115
5267
|
),
|
|
5116
|
-
note && /* @__PURE__ */
|
|
5268
|
+
note && /* @__PURE__ */ jsx53("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
5117
5269
|
] });
|
|
5118
5270
|
}
|
|
5119
5271
|
);
|
|
5120
5272
|
TextField.displayName = "TextField";
|
|
5121
5273
|
|
|
5122
5274
|
// src/Drawer.tsx
|
|
5123
|
-
import { useEffect as
|
|
5275
|
+
import { useEffect as useEffect16, useId as useId9, useRef as useRef18, useState as useState17 } from "react";
|
|
5124
5276
|
import { createPortal as createPortal8 } from "react-dom";
|
|
5125
5277
|
import { X as X7 } from "lucide-react";
|
|
5126
|
-
import { jsx as
|
|
5278
|
+
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5127
5279
|
var WIDTH2 = {
|
|
5128
5280
|
sm: "max-w-110",
|
|
5129
5281
|
md: "max-w-160",
|
|
@@ -5134,12 +5286,12 @@ var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select
|
|
|
5134
5286
|
function Drawer({ open, onClose, title, description, size = "sm", footer, children, className, testIdPrefix }) {
|
|
5135
5287
|
const titleId = useId9();
|
|
5136
5288
|
const descId = useId9();
|
|
5137
|
-
const panel =
|
|
5138
|
-
const close =
|
|
5289
|
+
const panel = useRef18(null);
|
|
5290
|
+
const close = useRef18(onClose);
|
|
5139
5291
|
close.current = onClose;
|
|
5140
|
-
const [mounted, setMounted] =
|
|
5141
|
-
const [shown, setShown] =
|
|
5142
|
-
|
|
5292
|
+
const [mounted, setMounted] = useState17(open);
|
|
5293
|
+
const [shown, setShown] = useState17(false);
|
|
5294
|
+
useEffect16(() => {
|
|
5143
5295
|
if (open) {
|
|
5144
5296
|
setMounted(true);
|
|
5145
5297
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
@@ -5149,7 +5301,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5149
5301
|
const t = setTimeout(() => setMounted(false), EXIT_MS2);
|
|
5150
5302
|
return () => clearTimeout(t);
|
|
5151
5303
|
}, [open]);
|
|
5152
|
-
|
|
5304
|
+
useEffect16(() => {
|
|
5153
5305
|
if (!open || !mounted) return;
|
|
5154
5306
|
const opener = document.activeElement;
|
|
5155
5307
|
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE2) ?? null;
|
|
@@ -5184,8 +5336,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5184
5336
|
}, [open, mounted]);
|
|
5185
5337
|
if (!mounted || typeof document === "undefined") return null;
|
|
5186
5338
|
return createPortal8(
|
|
5187
|
-
/* @__PURE__ */
|
|
5188
|
-
/* @__PURE__ */
|
|
5339
|
+
/* @__PURE__ */ jsxs48("div", { className: "fixed inset-0 z-modal", children: [
|
|
5340
|
+
/* @__PURE__ */ jsx54(
|
|
5189
5341
|
"div",
|
|
5190
5342
|
{
|
|
5191
5343
|
"aria-hidden": "true",
|
|
@@ -5199,7 +5351,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5199
5351
|
)
|
|
5200
5352
|
}
|
|
5201
5353
|
),
|
|
5202
|
-
/* @__PURE__ */
|
|
5354
|
+
/* @__PURE__ */ jsxs48(
|
|
5203
5355
|
"div",
|
|
5204
5356
|
{
|
|
5205
5357
|
ref: panel,
|
|
@@ -5216,24 +5368,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5216
5368
|
className
|
|
5217
5369
|
),
|
|
5218
5370
|
children: [
|
|
5219
|
-
/* @__PURE__ */
|
|
5220
|
-
/* @__PURE__ */
|
|
5221
|
-
/* @__PURE__ */
|
|
5222
|
-
description && /* @__PURE__ */
|
|
5371
|
+
/* @__PURE__ */ jsxs48("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
|
|
5372
|
+
/* @__PURE__ */ jsxs48("div", { className: "min-w-0 flex-1", children: [
|
|
5373
|
+
/* @__PURE__ */ jsx54("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
5374
|
+
description && /* @__PURE__ */ jsx54("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
5223
5375
|
] }),
|
|
5224
|
-
/* @__PURE__ */
|
|
5376
|
+
/* @__PURE__ */ jsx54(
|
|
5225
5377
|
"button",
|
|
5226
5378
|
{
|
|
5227
5379
|
type: "button",
|
|
5228
5380
|
onClick: onClose,
|
|
5229
5381
|
"aria-label": "Close",
|
|
5230
5382
|
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",
|
|
5231
|
-
children: /* @__PURE__ */
|
|
5383
|
+
children: /* @__PURE__ */ jsx54(X7, { size: 16, "aria-hidden": "true" })
|
|
5232
5384
|
}
|
|
5233
5385
|
)
|
|
5234
5386
|
] }),
|
|
5235
|
-
/* @__PURE__ */
|
|
5236
|
-
footer && /* @__PURE__ */
|
|
5387
|
+
/* @__PURE__ */ jsx54("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 }),
|
|
5388
|
+
footer && /* @__PURE__ */ jsx54("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
5237
5389
|
]
|
|
5238
5390
|
}
|
|
5239
5391
|
)
|
|
@@ -5243,12 +5395,90 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5243
5395
|
}
|
|
5244
5396
|
|
|
5245
5397
|
// src/DataTable.tsx
|
|
5246
|
-
import { useId as useId10 } from "react";
|
|
5247
|
-
import {
|
|
5398
|
+
import { Fragment as Fragment7, useEffect as useEffect17, useId as useId10, useState as useState18 } from "react";
|
|
5399
|
+
import { ChevronRight as ChevronRight6 } from "lucide-react";
|
|
5400
|
+
|
|
5401
|
+
// src/numbers.ts
|
|
5402
|
+
var US = { units: ["K", "M", "B", "T"] };
|
|
5403
|
+
var STYLES = {
|
|
5404
|
+
"en-US": US,
|
|
5405
|
+
"en-CA": US,
|
|
5406
|
+
"en-GB": { units: ["k", "m", "bn", "tn"] }
|
|
5407
|
+
};
|
|
5408
|
+
var styleFor = (language) => STYLES[language ?? "en-US"] ?? US;
|
|
5409
|
+
var NO_VALUE = "\u2014";
|
|
5410
|
+
var MINUS = "\u2212";
|
|
5411
|
+
var SHORTEN_FROM = 1e4;
|
|
5412
|
+
var isMissing = (v) => v === null || v === void 0 || Number.isNaN(v);
|
|
5413
|
+
var withCommas = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
5414
|
+
function shortAbs(abs, style) {
|
|
5415
|
+
if (abs < SHORTEN_FROM) return withCommas(abs);
|
|
5416
|
+
let tier = Math.min(Math.floor(Math.log10(abs) / 3), 4);
|
|
5417
|
+
let scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
|
|
5418
|
+
if (scaled >= 1e3 && tier < 4) {
|
|
5419
|
+
tier += 1;
|
|
5420
|
+
scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
|
|
5421
|
+
}
|
|
5422
|
+
const text = Number.isInteger(scaled) ? withCommas(scaled) : scaled.toFixed(1);
|
|
5423
|
+
return `${text}${style.units[tier - 1]}`;
|
|
5424
|
+
}
|
|
5425
|
+
function symbol(opts) {
|
|
5426
|
+
const currency = opts.currency ?? "USD";
|
|
5427
|
+
if (currency === "GBP") return "\xA3";
|
|
5428
|
+
if (currency === "EUR") return "\u20AC";
|
|
5429
|
+
if (opts.mixedDollars) return currency === "CAD" ? "CA$" : "US$";
|
|
5430
|
+
return "$";
|
|
5431
|
+
}
|
|
5432
|
+
var sign = (v) => v < 0 ? MINUS : "";
|
|
5433
|
+
function formatCount(value, opts = {}) {
|
|
5434
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5435
|
+
return sign(value) + shortAbs(Math.abs(value), styleFor(opts.language));
|
|
5436
|
+
}
|
|
5437
|
+
function formatCountFull(value) {
|
|
5438
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5439
|
+
return sign(value) + withCommas(Math.abs(value));
|
|
5440
|
+
}
|
|
5441
|
+
function formatMoney(value, opts = {}) {
|
|
5442
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5443
|
+
return sign(value) + symbol(opts) + shortAbs(Math.abs(value), styleFor(opts.language));
|
|
5444
|
+
}
|
|
5445
|
+
function formatMoneyFull(value, opts = {}) {
|
|
5446
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5447
|
+
return sign(value) + symbol(opts) + withCommas(Math.abs(value));
|
|
5448
|
+
}
|
|
5449
|
+
function formatPercent(value, _opts = {}) {
|
|
5450
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5451
|
+
const abs = Math.abs(value);
|
|
5452
|
+
if (abs > 0 && abs < 0.05) return `${value < 0 ? MINUS : ""}<0.1%`;
|
|
5453
|
+
const text = (Math.round(abs * 10) / 10).toFixed(1);
|
|
5454
|
+
return text === "0.0" ? "0.0%" : `${sign(value)}${text}%`;
|
|
5455
|
+
}
|
|
5456
|
+
|
|
5457
|
+
// src/DataTable.tsx
|
|
5458
|
+
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5248
5459
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5249
5460
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5250
5461
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
5251
5462
|
var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
|
|
5463
|
+
var OWN_CLICK = "a, button, input, select, textarea, label, summary, [role='button'], [role='checkbox'], [role='menuitem'], [role='switch'], [role='tab'], [contenteditable='true']";
|
|
5464
|
+
function NoValue({ reason = "No data" }) {
|
|
5465
|
+
return /* @__PURE__ */ jsxs49(Tooltip, { label: reason, delay: 300, className: "text-text-tertiary", children: [
|
|
5466
|
+
/* @__PURE__ */ jsx55("span", { "aria-hidden": "true", children: NO_VALUE }),
|
|
5467
|
+
/* @__PURE__ */ jsx55("span", { className: "sr-only", children: reason })
|
|
5468
|
+
] });
|
|
5469
|
+
}
|
|
5470
|
+
function TableLink({ className, ...props }) {
|
|
5471
|
+
return /* @__PURE__ */ jsx55(
|
|
5472
|
+
"a",
|
|
5473
|
+
{
|
|
5474
|
+
...props,
|
|
5475
|
+
className: cn(
|
|
5476
|
+
"rounded-xs text-inherit decoration-1 underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5477
|
+
className
|
|
5478
|
+
)
|
|
5479
|
+
}
|
|
5480
|
+
);
|
|
5481
|
+
}
|
|
5252
5482
|
function DataTable({
|
|
5253
5483
|
columns,
|
|
5254
5484
|
rows,
|
|
@@ -5256,11 +5486,19 @@ function DataTable({
|
|
|
5256
5486
|
title,
|
|
5257
5487
|
subtitle,
|
|
5258
5488
|
action,
|
|
5489
|
+
variant = "default",
|
|
5490
|
+
titleAs = "h2",
|
|
5259
5491
|
sort = null,
|
|
5260
5492
|
onSortChange,
|
|
5493
|
+
defaultSort = null,
|
|
5494
|
+
renderExpanded,
|
|
5495
|
+
canExpand,
|
|
5496
|
+
rowLabel,
|
|
5261
5497
|
density = "default",
|
|
5262
5498
|
loading = false,
|
|
5263
5499
|
loadingRows = 5,
|
|
5500
|
+
refreshing = false,
|
|
5501
|
+
onRetry,
|
|
5264
5502
|
empty,
|
|
5265
5503
|
maxHeight,
|
|
5266
5504
|
footer,
|
|
@@ -5269,82 +5507,158 @@ function DataTable({
|
|
|
5269
5507
|
...rest
|
|
5270
5508
|
}) {
|
|
5271
5509
|
const titleId = useId10();
|
|
5510
|
+
const showSkeleton = useDelayedLoading(loading);
|
|
5272
5511
|
const head = HEAD_PAD[density];
|
|
5273
5512
|
const pad2 = CELL_PAD[density];
|
|
5274
|
-
const
|
|
5275
|
-
const
|
|
5513
|
+
const right = (c) => c.numeric || c.rank;
|
|
5514
|
+
const align = (c) => right(c) ? "text-right" : "text-left";
|
|
5515
|
+
const width = (c) => c.rank ? "w-12" : WIDTH3[c.width ?? (c.numeric ? "md" : "fill")];
|
|
5516
|
+
const shown = sort ?? defaultSort;
|
|
5276
5517
|
const onSort = (key) => {
|
|
5277
5518
|
const col = columns.find((c) => c.key === key);
|
|
5278
|
-
onSortChange?.(cycleSort(
|
|
5519
|
+
onSortChange?.(cycleSort(shown, key, col?.firstDir ?? (right(col) ? "desc" : "asc"), defaultSort));
|
|
5279
5520
|
};
|
|
5280
|
-
|
|
5521
|
+
const [open, setOpen] = useState18(() => /* @__PURE__ */ new Set());
|
|
5522
|
+
const visibleKeys = rows.map(rowKey).join("|");
|
|
5523
|
+
useEffect17(() => setOpen(/* @__PURE__ */ new Set()), [shown?.key, shown?.dir, visibleKeys]);
|
|
5524
|
+
const expandable = (row) => !!renderExpanded && (canExpand ? canExpand(row) : true);
|
|
5525
|
+
const anyExpandable = !!renderExpanded && rows.some(expandable);
|
|
5526
|
+
const toggle = (key) => setOpen((prev) => {
|
|
5527
|
+
const next = new Set(prev);
|
|
5528
|
+
if (next.has(key)) next.delete(key);
|
|
5529
|
+
else next.add(key);
|
|
5530
|
+
return next;
|
|
5531
|
+
});
|
|
5532
|
+
const onRowClick = (e, key) => {
|
|
5533
|
+
if (e.target.closest(OWN_CLICK)) return;
|
|
5534
|
+
if (window.getSelection?.()?.toString()) return;
|
|
5535
|
+
toggle(key);
|
|
5536
|
+
};
|
|
5537
|
+
const span = columns.length + (anyExpandable ? 1 : 0);
|
|
5538
|
+
const renderCell = (c, row) => {
|
|
5539
|
+
const v = c.cell(row);
|
|
5540
|
+
return v === null || v === void 0 || v === "" ? /* @__PURE__ */ jsx55(NoValue, { reason: c.missing }) : v;
|
|
5541
|
+
};
|
|
5542
|
+
const inside = variant === "chart";
|
|
5543
|
+
const frame = /* @__PURE__ */ jsxs49(
|
|
5281
5544
|
"div",
|
|
5282
5545
|
{
|
|
5283
|
-
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
|
|
5546
|
+
className: cn("relative flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
|
|
5284
5547
|
"data-testid": testIdPrefix,
|
|
5285
5548
|
children: [
|
|
5286
|
-
title && /* @__PURE__ */
|
|
5287
|
-
/* @__PURE__ */
|
|
5288
|
-
/* @__PURE__ */
|
|
5289
|
-
subtitle && /* @__PURE__ */
|
|
5549
|
+
title && inside && /* @__PURE__ */ jsxs49("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5550
|
+
/* @__PURE__ */ jsxs49("div", { className: "min-w-0", children: [
|
|
5551
|
+
/* @__PURE__ */ jsx55("h3", { id: titleId, className: "text-panel-title font-semibold text-text-primary", children: title }),
|
|
5552
|
+
subtitle && /* @__PURE__ */ jsx55("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
5290
5553
|
] }),
|
|
5291
|
-
action && /* @__PURE__ */
|
|
5554
|
+
action && /* @__PURE__ */ jsx55("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
5292
5555
|
] }),
|
|
5293
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsx55("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ jsxs49(
|
|
5294
5557
|
"table",
|
|
5295
5558
|
{
|
|
5296
5559
|
"aria-labelledby": title ? titleId : void 0,
|
|
5297
5560
|
"aria-label": title ? void 0 : rest["aria-label"],
|
|
5298
|
-
"aria-busy": loading || void 0,
|
|
5561
|
+
"aria-busy": loading || refreshing || void 0,
|
|
5299
5562
|
className: "w-full border-collapse text-left",
|
|
5300
5563
|
children: [
|
|
5301
|
-
/* @__PURE__ */
|
|
5302
|
-
"th",
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5564
|
+
/* @__PURE__ */ jsx55("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ jsxs49("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: [
|
|
5565
|
+
anyExpandable && /* @__PURE__ */ jsx55("th", { scope: "col", className: cn("w-10 border-b border-border-default", head), children: /* @__PURE__ */ jsx55("span", { className: "sr-only", children: "Details" }) }),
|
|
5566
|
+
columns.map((c) => /* @__PURE__ */ jsx55(
|
|
5567
|
+
"th",
|
|
5568
|
+
{
|
|
5569
|
+
scope: "col",
|
|
5570
|
+
"aria-sort": c.sortable ? ariaSortFor(shown, c.key) : void 0,
|
|
5571
|
+
className: cn("group/head whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5572
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ jsx55(
|
|
5573
|
+
SortButton,
|
|
5574
|
+
{
|
|
5575
|
+
label: c.label,
|
|
5576
|
+
sortKey: c.key,
|
|
5577
|
+
align: right(c) ? "right" : "left",
|
|
5578
|
+
sort: sortProp(shown),
|
|
5579
|
+
onSort,
|
|
5580
|
+
description: c.info,
|
|
5581
|
+
testIdPrefix
|
|
5582
|
+
}
|
|
5583
|
+
) : c.info ? /* @__PURE__ */ jsx55(SortButton, { label: c.label, sortKey: c.key, sortable: false, sort: sortProp(shown), onSort: () => {
|
|
5584
|
+
}, description: c.info, align: right(c) ? "right" : "left" }) : c.label
|
|
5585
|
+
},
|
|
5586
|
+
c.key
|
|
5587
|
+
))
|
|
5588
|
+
] }) }),
|
|
5589
|
+
/* @__PURE__ */ jsx55("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__ */ jsxs49("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: [
|
|
5590
|
+
anyExpandable && /* @__PURE__ */ jsx55("td", { className: cn("border-b border-border-default", pad2) }),
|
|
5591
|
+
columns.map((c) => /* @__PURE__ */ jsx55("td", { className: cn("border-b border-border-default", pad2, align(c)), children: showSkeleton ? /* @__PURE__ */ jsx55(Skeleton, { className: cn("inline-block", right(c) ? "w-12" : "w-2/3") }) : /* @__PURE__ */ jsx55("span", { className: "inline-block h-3" }) }, c.key))
|
|
5592
|
+
] }, i)) : rows.length === 0 ? /* @__PURE__ */ jsx55("tr", { children: /* @__PURE__ */ jsx55("td", { colSpan: span, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ jsx55(NoResultsEmptyState, {}) }) }) : rows.map((row, index) => {
|
|
5593
|
+
const key = rowKey(row);
|
|
5594
|
+
const canOpen = expandable(row);
|
|
5595
|
+
const isOpen = canOpen && open.has(key);
|
|
5596
|
+
const panelId = `${titleId}-row-${index}`;
|
|
5597
|
+
return /* @__PURE__ */ jsxs49(Fragment7, { children: [
|
|
5598
|
+
/* @__PURE__ */ jsxs49(
|
|
5599
|
+
"tr",
|
|
5309
5600
|
{
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5601
|
+
onClick: canOpen ? (e) => onRowClick(e, key) : void 0,
|
|
5602
|
+
className: cn("hover:bg-subtle [&:last-child>td]:border-b-0", canOpen && "cursor-pointer", isOpen && "bg-subtle"),
|
|
5603
|
+
children: [
|
|
5604
|
+
anyExpandable && /* @__PURE__ */ jsx55("td", { className: cn("border-b border-border-default pr-0", pad2, isOpen && "border-b-0"), children: canOpen && /* @__PURE__ */ jsx55(
|
|
5605
|
+
"button",
|
|
5606
|
+
{
|
|
5607
|
+
type: "button",
|
|
5608
|
+
"aria-expanded": isOpen,
|
|
5609
|
+
"aria-controls": isOpen ? panelId : void 0,
|
|
5610
|
+
"aria-label": `${isOpen ? "Hide" : "Show"} details${rowLabel ? ` for ${rowLabel(row)}` : ""}`,
|
|
5611
|
+
onClick: () => toggle(key),
|
|
5612
|
+
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",
|
|
5613
|
+
children: /* @__PURE__ */ jsx55(
|
|
5614
|
+
ChevronRight6,
|
|
5615
|
+
{
|
|
5616
|
+
size: 16,
|
|
5617
|
+
"aria-hidden": "true",
|
|
5618
|
+
className: cn("transition-transform motion-reduce:transition-none", isOpen && "rotate-90")
|
|
5619
|
+
}
|
|
5620
|
+
)
|
|
5621
|
+
}
|
|
5622
|
+
) }),
|
|
5623
|
+
columns.map((c) => /* @__PURE__ */ jsx55(
|
|
5624
|
+
"td",
|
|
5625
|
+
{
|
|
5626
|
+
className: cn(
|
|
5627
|
+
"border-b border-border-default",
|
|
5628
|
+
pad2,
|
|
5629
|
+
align(c),
|
|
5630
|
+
right(c) && "tabular-nums",
|
|
5631
|
+
c.rank && "text-text-tertiary",
|
|
5632
|
+
isOpen && "border-b-0"
|
|
5633
|
+
),
|
|
5634
|
+
children: renderCell(c, row)
|
|
5635
|
+
},
|
|
5636
|
+
c.key
|
|
5637
|
+
))
|
|
5638
|
+
]
|
|
5316
5639
|
}
|
|
5317
|
-
)
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
/* @__PURE__ */ jsx54("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ jsx54("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ jsx54("td", { className: cn("border-b border-border-default", pad2, align(c)), children: /* @__PURE__ */ jsx54(
|
|
5322
|
-
"span",
|
|
5323
|
-
{
|
|
5324
|
-
className: cn(
|
|
5325
|
-
"inline-block h-3 animate-pulse rounded-full bg-subtle",
|
|
5326
|
-
c.numeric ? "w-12" : "w-2/3"
|
|
5327
|
-
)
|
|
5328
|
-
}
|
|
5329
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ jsx54("tr", { children: /* @__PURE__ */ jsx54("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ jsx54(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ jsx54("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ jsx54(
|
|
5330
|
-
"td",
|
|
5331
|
-
{
|
|
5332
|
-
className: cn("border-b border-border-default", pad2, align(c), c.numeric && "tabular-nums"),
|
|
5333
|
-
children: c.cell(row)
|
|
5334
|
-
},
|
|
5335
|
-
c.key
|
|
5336
|
-
)) }, rowKey(row))) })
|
|
5640
|
+
),
|
|
5641
|
+
isOpen && /* @__PURE__ */ jsx55("tr", { className: "[&:last-child>td]:border-b-0", children: /* @__PURE__ */ jsx55("td", { id: panelId, colSpan: span, className: "border-b border-border-default bg-subtle px-4 pb-4 pl-14", children: renderExpanded(row) }) })
|
|
5642
|
+
] }, key);
|
|
5643
|
+
}) })
|
|
5337
5644
|
]
|
|
5338
5645
|
}
|
|
5339
5646
|
) }),
|
|
5340
|
-
|
|
5647
|
+
refreshing && !loading && /* @__PURE__ */ jsx55(RefreshLine, {}),
|
|
5648
|
+
/* @__PURE__ */ jsx55(LongWait, { loading, onRetry, className: "mb-3 px-4" }),
|
|
5649
|
+
footer && /* @__PURE__ */ jsx55("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
5341
5650
|
]
|
|
5342
5651
|
}
|
|
5343
5652
|
);
|
|
5653
|
+
if (!title || inside) return frame;
|
|
5654
|
+
return /* @__PURE__ */ jsxs49("section", { "aria-labelledby": titleId, className: cn("flex w-full flex-col gap-3", className), children: [
|
|
5655
|
+
/* @__PURE__ */ jsx55(SectionHeading, { id: titleId, as: titleAs, title, description: subtitle, actions: action }),
|
|
5656
|
+
frame
|
|
5657
|
+
] });
|
|
5344
5658
|
}
|
|
5345
5659
|
|
|
5346
5660
|
// src/MediaLabel.tsx
|
|
5347
|
-
import { jsx as
|
|
5661
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5348
5662
|
var FILL = {
|
|
5349
5663
|
TV: "bg-media-tv",
|
|
5350
5664
|
CTV: "bg-media-ctv",
|
|
@@ -5355,7 +5669,7 @@ var FILL = {
|
|
|
5355
5669
|
Magazine: "bg-media-magazine"
|
|
5356
5670
|
};
|
|
5357
5671
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5358
|
-
return /* @__PURE__ */
|
|
5672
|
+
return /* @__PURE__ */ jsx56(
|
|
5359
5673
|
"span",
|
|
5360
5674
|
{
|
|
5361
5675
|
className: cn(
|
|
@@ -5371,9 +5685,9 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5371
5685
|
|
|
5372
5686
|
// src/SuggestionChip.tsx
|
|
5373
5687
|
import { forwardRef as forwardRef10 } from "react";
|
|
5374
|
-
import { jsx as
|
|
5688
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5375
5689
|
var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5376
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx57(
|
|
5377
5691
|
"button",
|
|
5378
5692
|
{
|
|
5379
5693
|
ref,
|
|
@@ -5384,7 +5698,7 @@ var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className
|
|
|
5384
5698
|
"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",
|
|
5385
5699
|
className
|
|
5386
5700
|
),
|
|
5387
|
-
children: /* @__PURE__ */
|
|
5701
|
+
children: /* @__PURE__ */ jsx57("span", { className: "truncate", children })
|
|
5388
5702
|
}
|
|
5389
5703
|
);
|
|
5390
5704
|
});
|
|
@@ -5393,9 +5707,9 @@ SuggestionChip.displayName = "SuggestionChip";
|
|
|
5393
5707
|
// src/ToggleChip.tsx
|
|
5394
5708
|
import { forwardRef as forwardRef11 } from "react";
|
|
5395
5709
|
import { Check as Check9 } from "lucide-react";
|
|
5396
|
-
import { jsx as
|
|
5710
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5397
5711
|
var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5398
|
-
return /* @__PURE__ */
|
|
5712
|
+
return /* @__PURE__ */ jsxs50(
|
|
5399
5713
|
"button",
|
|
5400
5714
|
{
|
|
5401
5715
|
ref,
|
|
@@ -5413,7 +5727,7 @@ var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, childre
|
|
|
5413
5727
|
className
|
|
5414
5728
|
),
|
|
5415
5729
|
children: [
|
|
5416
|
-
selected && /* @__PURE__ */
|
|
5730
|
+
selected && /* @__PURE__ */ jsx58(Check9, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5417
5731
|
children
|
|
5418
5732
|
]
|
|
5419
5733
|
}
|
|
@@ -5422,14 +5736,14 @@ var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, childre
|
|
|
5422
5736
|
ToggleChip.displayName = "ToggleChip";
|
|
5423
5737
|
|
|
5424
5738
|
// src/CopyButton.tsx
|
|
5425
|
-
import { forwardRef as forwardRef12, useEffect as
|
|
5739
|
+
import { forwardRef as forwardRef12, useEffect as useEffect18, useRef as useRef19, useState as useState19 } from "react";
|
|
5426
5740
|
import { Check as Check10, Copy } from "lucide-react";
|
|
5427
|
-
import { jsx as
|
|
5741
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5428
5742
|
var CONFIRM_MS = 2e3;
|
|
5429
5743
|
var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5430
|
-
const [copied, setCopied] =
|
|
5431
|
-
const timer =
|
|
5432
|
-
|
|
5744
|
+
const [copied, setCopied] = useState19(false);
|
|
5745
|
+
const timer = useRef19(void 0);
|
|
5746
|
+
useEffect18(() => () => clearTimeout(timer.current), []);
|
|
5433
5747
|
const copy = async () => {
|
|
5434
5748
|
try {
|
|
5435
5749
|
await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
|
|
@@ -5441,8 +5755,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5441
5755
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5442
5756
|
};
|
|
5443
5757
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5444
|
-
const icon = copied ? /* @__PURE__ */
|
|
5445
|
-
return /* @__PURE__ */
|
|
5758
|
+
const icon = copied ? /* @__PURE__ */ jsx59(Check10, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ jsx59(Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
5759
|
+
return /* @__PURE__ */ jsxs51(
|
|
5446
5760
|
Button,
|
|
5447
5761
|
{
|
|
5448
5762
|
ref,
|
|
@@ -5456,8 +5770,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5456
5770
|
className: cn(!copied && "text-text-secondary", className),
|
|
5457
5771
|
children: [
|
|
5458
5772
|
icon,
|
|
5459
|
-
label && /* @__PURE__ */
|
|
5460
|
-
/* @__PURE__ */
|
|
5773
|
+
label && /* @__PURE__ */ jsx59("span", { children: copied ? "Copied" : label }),
|
|
5774
|
+
/* @__PURE__ */ jsx59("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5461
5775
|
]
|
|
5462
5776
|
}
|
|
5463
5777
|
);
|
|
@@ -5466,7 +5780,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
5466
5780
|
|
|
5467
5781
|
// src/InlineMessage.tsx
|
|
5468
5782
|
import { AlertTriangle as AlertTriangle2, CheckCircle2, Info as Info3, X as X8, XCircle } from "lucide-react";
|
|
5469
|
-
import { jsx as
|
|
5783
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5470
5784
|
var BOX = {
|
|
5471
5785
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5472
5786
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5483,27 +5797,27 @@ var ICON_INK = {
|
|
|
5483
5797
|
var ICON2 = { info: Info3, success: CheckCircle2, warning: AlertTriangle2, danger: XCircle };
|
|
5484
5798
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5485
5799
|
const Icon = ICON2[tone];
|
|
5486
|
-
return /* @__PURE__ */
|
|
5800
|
+
return /* @__PURE__ */ jsxs52(
|
|
5487
5801
|
"div",
|
|
5488
5802
|
{
|
|
5489
5803
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5490
5804
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5491
5805
|
"data-testid": testIdPrefix,
|
|
5492
5806
|
children: [
|
|
5493
|
-
/* @__PURE__ */
|
|
5494
|
-
/* @__PURE__ */
|
|
5495
|
-
/* @__PURE__ */
|
|
5496
|
-
children && /* @__PURE__ */
|
|
5497
|
-
actions && /* @__PURE__ */
|
|
5807
|
+
/* @__PURE__ */ jsx60(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
5808
|
+
/* @__PURE__ */ jsxs52("div", { className: "min-w-0 flex-1", children: [
|
|
5809
|
+
/* @__PURE__ */ jsx60("p", { className: "font-semibold text-text-primary", children: title }),
|
|
5810
|
+
children && /* @__PURE__ */ jsx60("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
5811
|
+
actions && /* @__PURE__ */ jsx60("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
5498
5812
|
] }),
|
|
5499
|
-
onDismiss && /* @__PURE__ */
|
|
5813
|
+
onDismiss && /* @__PURE__ */ jsx60(
|
|
5500
5814
|
"button",
|
|
5501
5815
|
{
|
|
5502
5816
|
type: "button",
|
|
5503
5817
|
onClick: onDismiss,
|
|
5504
5818
|
"aria-label": "Dismiss",
|
|
5505
5819
|
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",
|
|
5506
|
-
children: /* @__PURE__ */
|
|
5820
|
+
children: /* @__PURE__ */ jsx60(X8, { size: 14, "aria-hidden": "true" })
|
|
5507
5821
|
}
|
|
5508
5822
|
)
|
|
5509
5823
|
]
|
|
@@ -5512,9 +5826,9 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5512
5826
|
}
|
|
5513
5827
|
|
|
5514
5828
|
// src/FilterDrawer.tsx
|
|
5515
|
-
import { useEffect as
|
|
5516
|
-
import { ChevronLeft as ChevronLeft5, ChevronRight as
|
|
5517
|
-
import { jsx as
|
|
5829
|
+
import { useEffect as useEffect19, useLayoutEffect as useLayoutEffect6, useRef as useRef20, useState as useState20 } from "react";
|
|
5830
|
+
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
5831
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5518
5832
|
var SLIDE_MS = 200;
|
|
5519
5833
|
function reducedMotion() {
|
|
5520
5834
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5532,10 +5846,10 @@ function FilterDrawer({
|
|
|
5532
5846
|
size = "sm",
|
|
5533
5847
|
testIdPrefix
|
|
5534
5848
|
}) {
|
|
5535
|
-
const [view, setViewState] =
|
|
5536
|
-
const [leaving, setLeaving] =
|
|
5537
|
-
const [phase, setPhase] =
|
|
5538
|
-
const [wasOpen, setWasOpen] =
|
|
5849
|
+
const [view, setViewState] = useState20(focus);
|
|
5850
|
+
const [leaving, setLeaving] = useState20(null);
|
|
5851
|
+
const [phase, setPhase] = useState20("run");
|
|
5852
|
+
const [wasOpen, setWasOpen] = useState20(open);
|
|
5539
5853
|
if (open !== wasOpen) {
|
|
5540
5854
|
setWasOpen(open);
|
|
5541
5855
|
if (open) {
|
|
@@ -5555,15 +5869,15 @@ function FilterDrawer({
|
|
|
5555
5869
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setPhase("run")));
|
|
5556
5870
|
return () => cancelAnimationFrame(raf);
|
|
5557
5871
|
}, [phase]);
|
|
5558
|
-
|
|
5872
|
+
useEffect19(() => {
|
|
5559
5873
|
if (!leaving || phase !== "run") return;
|
|
5560
5874
|
const t = setTimeout(() => setLeaving(null), SLIDE_MS);
|
|
5561
5875
|
return () => clearTimeout(t);
|
|
5562
5876
|
}, [leaving, phase]);
|
|
5563
|
-
const backRef =
|
|
5564
|
-
const rowRefs =
|
|
5565
|
-
const lastView =
|
|
5566
|
-
|
|
5877
|
+
const backRef = useRef20(null);
|
|
5878
|
+
const rowRefs = useRef20(/* @__PURE__ */ new Map());
|
|
5879
|
+
const lastView = useRef20(null);
|
|
5880
|
+
useEffect19(() => {
|
|
5567
5881
|
if (!open) return;
|
|
5568
5882
|
if (view) backRef.current?.focus();
|
|
5569
5883
|
else if (lastView.current) rowRefs.current.get(lastView.current)?.focus();
|
|
@@ -5576,8 +5890,8 @@ function FilterDrawer({
|
|
|
5576
5890
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5577
5891
|
const panel = (v, rows = true) => {
|
|
5578
5892
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5579
|
-
if (s) return /* @__PURE__ */
|
|
5580
|
-
return /* @__PURE__ */
|
|
5893
|
+
if (s) return /* @__PURE__ */ jsx61("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
5894
|
+
return /* @__PURE__ */ jsx61("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ jsx61("li", { className: "border-b border-border-default", children: /* @__PURE__ */ jsxs53(
|
|
5581
5895
|
"button",
|
|
5582
5896
|
{
|
|
5583
5897
|
ref: rows ? (el) => {
|
|
@@ -5589,7 +5903,7 @@ function FilterDrawer({
|
|
|
5589
5903
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5590
5904
|
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",
|
|
5591
5905
|
children: [
|
|
5592
|
-
/* @__PURE__ */
|
|
5906
|
+
/* @__PURE__ */ jsx61(
|
|
5593
5907
|
x.icon,
|
|
5594
5908
|
{
|
|
5595
5909
|
size: 17,
|
|
@@ -5597,22 +5911,22 @@ function FilterDrawer({
|
|
|
5597
5911
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5598
5912
|
}
|
|
5599
5913
|
),
|
|
5600
|
-
/* @__PURE__ */
|
|
5601
|
-
x.badge && /* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
5914
|
+
/* @__PURE__ */ jsx61("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
5915
|
+
x.badge && /* @__PURE__ */ jsx61(Badge, { tone: "brand", children: x.badge }),
|
|
5916
|
+
/* @__PURE__ */ jsx61(ChevronRight7, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5603
5917
|
]
|
|
5604
5918
|
}
|
|
5605
5919
|
) }, x.id)) });
|
|
5606
5920
|
};
|
|
5607
|
-
return /* @__PURE__ */
|
|
5921
|
+
return /* @__PURE__ */ jsx61(
|
|
5608
5922
|
Drawer,
|
|
5609
5923
|
{
|
|
5610
5924
|
open,
|
|
5611
5925
|
onClose,
|
|
5612
5926
|
size,
|
|
5613
5927
|
testIdPrefix,
|
|
5614
|
-
title: focused ? /* @__PURE__ */
|
|
5615
|
-
/* @__PURE__ */
|
|
5928
|
+
title: focused ? /* @__PURE__ */ jsxs53("span", { className: "flex items-center gap-1.5", children: [
|
|
5929
|
+
/* @__PURE__ */ jsx61(
|
|
5616
5930
|
"button",
|
|
5617
5931
|
{
|
|
5618
5932
|
ref: backRef,
|
|
@@ -5621,23 +5935,23 @@ function FilterDrawer({
|
|
|
5621
5935
|
"aria-label": "Back to all filters",
|
|
5622
5936
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5623
5937
|
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",
|
|
5624
|
-
children: /* @__PURE__ */
|
|
5938
|
+
children: /* @__PURE__ */ jsx61(ChevronLeft5, { size: 18, "aria-hidden": "true" })
|
|
5625
5939
|
}
|
|
5626
5940
|
),
|
|
5627
5941
|
focused.label,
|
|
5628
|
-
focused.info && /* @__PURE__ */
|
|
5629
|
-
] }) : /* @__PURE__ */
|
|
5942
|
+
focused.info && /* @__PURE__ */ jsx61(InfoTip, { text: focused.info, label: `About ${focused.label}` })
|
|
5943
|
+
] }) : /* @__PURE__ */ jsxs53("span", { className: "flex items-center gap-2.5", children: [
|
|
5630
5944
|
"Filters",
|
|
5631
|
-
activeCount > 0 && /* @__PURE__ */
|
|
5945
|
+
activeCount > 0 && /* @__PURE__ */ jsx61(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5632
5946
|
] }),
|
|
5633
5947
|
footer: focused ? (
|
|
5634
5948
|
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5635
|
-
/* @__PURE__ */
|
|
5636
|
-
) : /* @__PURE__ */
|
|
5637
|
-
/* @__PURE__ */
|
|
5638
|
-
/* @__PURE__ */
|
|
5639
|
-
/* @__PURE__ */
|
|
5640
|
-
/* @__PURE__ */
|
|
5949
|
+
/* @__PURE__ */ jsx61("div", { className: "flex w-full items-center", children: /* @__PURE__ */ jsx61(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
|
|
5950
|
+
) : /* @__PURE__ */ jsxs53("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
5951
|
+
/* @__PURE__ */ jsx61(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
5952
|
+
/* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-2", children: [
|
|
5953
|
+
/* @__PURE__ */ jsx61(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
5954
|
+
/* @__PURE__ */ jsx61(
|
|
5641
5955
|
Button,
|
|
5642
5956
|
{
|
|
5643
5957
|
variant: "primary",
|
|
@@ -5651,8 +5965,8 @@ function FilterDrawer({
|
|
|
5651
5965
|
)
|
|
5652
5966
|
] })
|
|
5653
5967
|
] }),
|
|
5654
|
-
children: /* @__PURE__ */
|
|
5655
|
-
/* @__PURE__ */
|
|
5968
|
+
children: /* @__PURE__ */ jsxs53("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
5969
|
+
/* @__PURE__ */ jsx61(
|
|
5656
5970
|
"div",
|
|
5657
5971
|
{
|
|
5658
5972
|
style: { transform: incoming },
|
|
@@ -5661,7 +5975,7 @@ function FilterDrawer({
|
|
|
5661
5975
|
},
|
|
5662
5976
|
view ?? "__list"
|
|
5663
5977
|
),
|
|
5664
|
-
leaving && /* @__PURE__ */
|
|
5978
|
+
leaving && /* @__PURE__ */ jsx61(
|
|
5665
5979
|
"div",
|
|
5666
5980
|
{
|
|
5667
5981
|
"aria-hidden": "true",
|
|
@@ -5679,9 +5993,9 @@ function FilterDrawer({
|
|
|
5679
5993
|
// src/AllFiltersButton.tsx
|
|
5680
5994
|
import { forwardRef as forwardRef13 } from "react";
|
|
5681
5995
|
import { SlidersHorizontal } from "lucide-react";
|
|
5682
|
-
import { jsx as
|
|
5996
|
+
import { jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5683
5997
|
var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5684
|
-
return /* @__PURE__ */
|
|
5998
|
+
return /* @__PURE__ */ jsxs54(
|
|
5685
5999
|
"button",
|
|
5686
6000
|
{
|
|
5687
6001
|
ref,
|
|
@@ -5693,9 +6007,9 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5693
6007
|
className: cn(chipTriggerClass(), className),
|
|
5694
6008
|
...rest,
|
|
5695
6009
|
children: [
|
|
5696
|
-
/* @__PURE__ */
|
|
5697
|
-
/* @__PURE__ */
|
|
5698
|
-
count > 0 && /* @__PURE__ */
|
|
6010
|
+
/* @__PURE__ */ jsx62(SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
6011
|
+
/* @__PURE__ */ jsx62("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
6012
|
+
count > 0 && /* @__PURE__ */ jsx62(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
5699
6013
|
]
|
|
5700
6014
|
}
|
|
5701
6015
|
);
|
|
@@ -5704,8 +6018,8 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5704
6018
|
// src/Menu.tsx
|
|
5705
6019
|
import { forwardRef as forwardRef14 } from "react";
|
|
5706
6020
|
import { Slot as Slot2, Slottable } from "@radix-ui/react-slot";
|
|
5707
|
-
import { Check as Check11, ChevronRight as
|
|
5708
|
-
import { Fragment as
|
|
6021
|
+
import { Check as Check11, ChevronRight as ChevronRight8 } from "lucide-react";
|
|
6022
|
+
import { Fragment as Fragment8, jsx as jsx63, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5709
6023
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5710
6024
|
function moveFocus(e) {
|
|
5711
6025
|
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -5718,7 +6032,7 @@ function moveFocus(e) {
|
|
|
5718
6032
|
rows[next].focus();
|
|
5719
6033
|
}
|
|
5720
6034
|
var Menu = forwardRef14(
|
|
5721
|
-
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */
|
|
6035
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
5722
6036
|
"div",
|
|
5723
6037
|
{
|
|
5724
6038
|
ref,
|
|
@@ -5739,20 +6053,20 @@ var MenuItem = forwardRef14(
|
|
|
5739
6053
|
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5740
6054
|
const Comp = asChild ? Slot2 : "button";
|
|
5741
6055
|
const radio = checked !== void 0;
|
|
5742
|
-
const body = /* @__PURE__ */
|
|
5743
|
-
icon && /* @__PURE__ */
|
|
6056
|
+
const body = /* @__PURE__ */ jsxs55(Fragment8, { children: [
|
|
6057
|
+
icon && /* @__PURE__ */ jsx63("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
5744
6058
|
asChild ? (
|
|
5745
6059
|
// The link's own text lands here; the link becomes the row.
|
|
5746
|
-
/* @__PURE__ */
|
|
5747
|
-
) : /* @__PURE__ */
|
|
5748
|
-
/* @__PURE__ */
|
|
5749
|
-
description && /* @__PURE__ */
|
|
6060
|
+
/* @__PURE__ */ jsx63(Slottable, { children })
|
|
6061
|
+
) : /* @__PURE__ */ jsxs55("span", { className: "min-w-0 flex-1", children: [
|
|
6062
|
+
/* @__PURE__ */ jsx63("span", { className: "block truncate", children }),
|
|
6063
|
+
description && /* @__PURE__ */ jsx63("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5750
6064
|
] }),
|
|
5751
|
-
trailing && /* @__PURE__ */
|
|
5752
|
-
radio && checked && /* @__PURE__ */
|
|
5753
|
-
submenu && /* @__PURE__ */
|
|
6065
|
+
trailing && /* @__PURE__ */ jsx63("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
6066
|
+
radio && checked && /* @__PURE__ */ jsx63(Check11, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
6067
|
+
submenu && /* @__PURE__ */ jsx63(ChevronRight8, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5754
6068
|
] });
|
|
5755
|
-
return /* @__PURE__ */
|
|
6069
|
+
return /* @__PURE__ */ jsx63(
|
|
5756
6070
|
Comp,
|
|
5757
6071
|
{
|
|
5758
6072
|
ref,
|
|
@@ -5779,7 +6093,7 @@ var MenuItem = forwardRef14(
|
|
|
5779
6093
|
);
|
|
5780
6094
|
MenuItem.displayName = "MenuItem";
|
|
5781
6095
|
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5782
|
-
return /* @__PURE__ */
|
|
6096
|
+
return /* @__PURE__ */ jsx63(
|
|
5783
6097
|
"div",
|
|
5784
6098
|
{
|
|
5785
6099
|
role: "presentation",
|
|
@@ -5790,7 +6104,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
|
|
|
5790
6104
|
);
|
|
5791
6105
|
}
|
|
5792
6106
|
function MenuSeparator({ className, testIdPrefix }) {
|
|
5793
|
-
return /* @__PURE__ */
|
|
6107
|
+
return /* @__PURE__ */ jsx63("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5794
6108
|
}
|
|
5795
6109
|
|
|
5796
6110
|
// src/dates.ts
|
|
@@ -5903,60 +6217,17 @@ function defaultDateOrder(country) {
|
|
|
5903
6217
|
return c === "US" || c === "CA" || c === "" ? "mdy" : "dmy";
|
|
5904
6218
|
}
|
|
5905
6219
|
|
|
5906
|
-
// src/
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
"
|
|
5911
|
-
|
|
5912
|
-
};
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
var isMissing = (v) => v === null || v === void 0 || Number.isNaN(v);
|
|
5918
|
-
var withCommas = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
5919
|
-
function shortAbs(abs, style) {
|
|
5920
|
-
if (abs < SHORTEN_FROM) return withCommas(abs);
|
|
5921
|
-
let tier = Math.min(Math.floor(Math.log10(abs) / 3), 4);
|
|
5922
|
-
let scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
|
|
5923
|
-
if (scaled >= 1e3 && tier < 4) {
|
|
5924
|
-
tier += 1;
|
|
5925
|
-
scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
|
|
5926
|
-
}
|
|
5927
|
-
const text = Number.isInteger(scaled) ? withCommas(scaled) : scaled.toFixed(1);
|
|
5928
|
-
return `${text}${style.units[tier - 1]}`;
|
|
5929
|
-
}
|
|
5930
|
-
function symbol(opts) {
|
|
5931
|
-
const currency = opts.currency ?? "USD";
|
|
5932
|
-
if (currency === "GBP") return "\xA3";
|
|
5933
|
-
if (currency === "EUR") return "\u20AC";
|
|
5934
|
-
if (opts.mixedDollars) return currency === "CAD" ? "CA$" : "US$";
|
|
5935
|
-
return "$";
|
|
5936
|
-
}
|
|
5937
|
-
var sign = (v) => v < 0 ? MINUS : "";
|
|
5938
|
-
function formatCount(value, opts = {}) {
|
|
5939
|
-
if (isMissing(value)) return NO_VALUE;
|
|
5940
|
-
return sign(value) + shortAbs(Math.abs(value), styleFor(opts.language));
|
|
5941
|
-
}
|
|
5942
|
-
function formatCountFull(value) {
|
|
5943
|
-
if (isMissing(value)) return NO_VALUE;
|
|
5944
|
-
return sign(value) + withCommas(Math.abs(value));
|
|
5945
|
-
}
|
|
5946
|
-
function formatMoney(value, opts = {}) {
|
|
5947
|
-
if (isMissing(value)) return NO_VALUE;
|
|
5948
|
-
return sign(value) + symbol(opts) + shortAbs(Math.abs(value), styleFor(opts.language));
|
|
5949
|
-
}
|
|
5950
|
-
function formatMoneyFull(value, opts = {}) {
|
|
5951
|
-
if (isMissing(value)) return NO_VALUE;
|
|
5952
|
-
return sign(value) + symbol(opts) + withCommas(Math.abs(value));
|
|
5953
|
-
}
|
|
5954
|
-
function formatPercent(value, _opts = {}) {
|
|
5955
|
-
if (isMissing(value)) return NO_VALUE;
|
|
5956
|
-
const abs = Math.abs(value);
|
|
5957
|
-
if (abs > 0 && abs < 0.05) return `${value < 0 ? MINUS : ""}<0.1%`;
|
|
5958
|
-
const text = (Math.round(abs * 10) / 10).toFixed(1);
|
|
5959
|
-
return text === "0.0" ? "0.0%" : `${sign(value)}${text}%`;
|
|
6220
|
+
// src/Figure.tsx
|
|
6221
|
+
import { Fragment as Fragment9, jsx as jsx64, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6222
|
+
function Figure({ value, kind = "money", missing, ...opts }) {
|
|
6223
|
+
if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */ jsx64(NoValue, { reason: missing });
|
|
6224
|
+
const short = kind === "money" ? formatMoney(value, opts) : formatCount(value, opts);
|
|
6225
|
+
const full = kind === "money" ? formatMoneyFull(value, opts) : formatCountFull(value);
|
|
6226
|
+
if (short === full) return /* @__PURE__ */ jsx64(Fragment9, { children: short });
|
|
6227
|
+
return /* @__PURE__ */ jsxs56(Tooltip, { label: full, delay: 300, children: [
|
|
6228
|
+
/* @__PURE__ */ jsx64("span", { "aria-hidden": "true", children: short }),
|
|
6229
|
+
/* @__PURE__ */ jsx64("span", { className: "sr-only", children: full })
|
|
6230
|
+
] });
|
|
5960
6231
|
}
|
|
5961
6232
|
export {
|
|
5962
6233
|
AISpark,
|
|
@@ -5970,6 +6241,7 @@ export {
|
|
|
5970
6241
|
Button,
|
|
5971
6242
|
Card,
|
|
5972
6243
|
ChartLegend,
|
|
6244
|
+
ChartSkeleton,
|
|
5973
6245
|
CheckBox,
|
|
5974
6246
|
CheckBoxBox,
|
|
5975
6247
|
ChipContent,
|
|
@@ -5982,6 +6254,7 @@ export {
|
|
|
5982
6254
|
Delta,
|
|
5983
6255
|
Drawer,
|
|
5984
6256
|
EmptyState,
|
|
6257
|
+
Figure,
|
|
5985
6258
|
FilterChipBar,
|
|
5986
6259
|
FilterDrawer,
|
|
5987
6260
|
FilterDropdownFooter,
|
|
@@ -5990,6 +6263,8 @@ export {
|
|
|
5990
6263
|
InlineMessage,
|
|
5991
6264
|
LegendItem,
|
|
5992
6265
|
LineChartPlaceholder,
|
|
6266
|
+
LoadError,
|
|
6267
|
+
LongWait,
|
|
5993
6268
|
MediaLabel,
|
|
5994
6269
|
Menu,
|
|
5995
6270
|
MenuItem,
|
|
@@ -6002,6 +6277,7 @@ export {
|
|
|
6002
6277
|
NO_VALUE,
|
|
6003
6278
|
NameListModal,
|
|
6004
6279
|
NoResultsEmptyState,
|
|
6280
|
+
NoValue,
|
|
6005
6281
|
PRIMARY_ACTION_CLASS,
|
|
6006
6282
|
PageHeader,
|
|
6007
6283
|
Pager,
|
|
@@ -6009,6 +6285,7 @@ export {
|
|
|
6009
6285
|
PrimaryBadge,
|
|
6010
6286
|
PublisherBreakdownList,
|
|
6011
6287
|
QUIET_ACTION_CLASS,
|
|
6288
|
+
RefreshLine,
|
|
6012
6289
|
SearchBar,
|
|
6013
6290
|
SectionHeading,
|
|
6014
6291
|
SectionRail,
|
|
@@ -6017,11 +6294,15 @@ export {
|
|
|
6017
6294
|
SelectFilter,
|
|
6018
6295
|
SelectedSection,
|
|
6019
6296
|
SelectionPicker,
|
|
6297
|
+
Skeleton,
|
|
6298
|
+
SkeletonLines,
|
|
6020
6299
|
SortButton,
|
|
6021
6300
|
StackedColumnPlaceholder,
|
|
6022
6301
|
StatStrip,
|
|
6302
|
+
StatStripSkeleton,
|
|
6023
6303
|
StatTile,
|
|
6024
6304
|
SuggestionChip,
|
|
6305
|
+
TableLink,
|
|
6025
6306
|
TablePagination,
|
|
6026
6307
|
Tabs,
|
|
6027
6308
|
Tag,
|
|
@@ -6055,6 +6336,7 @@ export {
|
|
|
6055
6336
|
formatWeek,
|
|
6056
6337
|
noResultsBody,
|
|
6057
6338
|
resolveRange,
|
|
6058
|
-
sortProp
|
|
6339
|
+
sortProp,
|
|
6340
|
+
useDelayedLoading
|
|
6059
6341
|
};
|
|
6060
6342
|
//# sourceMappingURL=index.js.map
|