@mediaradar/design-components 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approved-components.json +1 -1
- package/dist/index.cjs +909 -759
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -3
- package/dist/index.d.ts +87 -3
- package/dist/index.js +830 -688
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.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",
|
|
@@ -3994,7 +4131,7 @@ function Chip({
|
|
|
3994
4131
|
// src/SortButton.tsx
|
|
3995
4132
|
import { forwardRef as forwardRef7, useImperativeHandle, useRef as useRef13 } from "react";
|
|
3996
4133
|
import { ArrowUp, ArrowDown, ArrowUpDown } from "lucide-react";
|
|
3997
|
-
import { Fragment as Fragment4, 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",
|
|
@@ -4015,13 +4152,13 @@ var SortButton = forwardRef7(
|
|
|
4015
4152
|
}, ref) {
|
|
4016
4153
|
const own = useRef13(null);
|
|
4017
4154
|
useImperativeHandle(ref, () => own.current);
|
|
4018
|
-
const text = description ? /* @__PURE__ */
|
|
4155
|
+
const text = description ? /* @__PURE__ */ jsx38("span", { className: DESCRIBED, children: label }) : label;
|
|
4019
4156
|
if (!sortable) {
|
|
4020
|
-
const plain = /* @__PURE__ */
|
|
4021
|
-
return description ? /* @__PURE__ */
|
|
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;
|
|
4022
4159
|
}
|
|
4023
4160
|
const active = !disabled && sort.key === sortKey;
|
|
4024
|
-
const button = /* @__PURE__ */
|
|
4161
|
+
const button = /* @__PURE__ */ jsxs36(
|
|
4025
4162
|
"button",
|
|
4026
4163
|
{
|
|
4027
4164
|
ref: own,
|
|
@@ -4052,7 +4189,7 @@ var SortButton = forwardRef7(
|
|
|
4052
4189
|
),
|
|
4053
4190
|
children: [
|
|
4054
4191
|
text,
|
|
4055
|
-
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */
|
|
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(
|
|
4056
4193
|
ArrowUpDown,
|
|
4057
4194
|
{
|
|
4058
4195
|
size: 12,
|
|
@@ -4063,16 +4200,16 @@ var SortButton = forwardRef7(
|
|
|
4063
4200
|
]
|
|
4064
4201
|
}
|
|
4065
4202
|
);
|
|
4066
|
-
return /* @__PURE__ */
|
|
4203
|
+
return /* @__PURE__ */ jsxs36(Fragment4, { children: [
|
|
4067
4204
|
button,
|
|
4068
|
-
description && /* @__PURE__ */
|
|
4205
|
+
description && /* @__PURE__ */ jsx38(Tooltip, { anchorRef: own, label: description, delay: 300, placement: "top" })
|
|
4069
4206
|
] });
|
|
4070
4207
|
}
|
|
4071
4208
|
);
|
|
4072
4209
|
SortButton.displayName = "SortButton";
|
|
4073
4210
|
var DESCRIBED = "underline decoration-dotted decoration-1 decoration-text-tertiary underline-offset-4";
|
|
4074
4211
|
function HeaderTip({ description, children }) {
|
|
4075
|
-
return /* @__PURE__ */
|
|
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 }) });
|
|
4076
4213
|
}
|
|
4077
4214
|
|
|
4078
4215
|
// src/tableSort.ts
|
|
@@ -4091,7 +4228,7 @@ function ariaSortFor(sort, key) {
|
|
|
4091
4228
|
|
|
4092
4229
|
// src/Pager.tsx
|
|
4093
4230
|
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight4 } from "lucide-react";
|
|
4094
|
-
import { jsx as
|
|
4231
|
+
import { jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4095
4232
|
function pageWindow(current, total) {
|
|
4096
4233
|
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
4097
4234
|
const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
|
|
@@ -4107,8 +4244,8 @@ function pageWindow(current, total) {
|
|
|
4107
4244
|
}
|
|
4108
4245
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
4109
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";
|
|
4110
|
-
return /* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4247
|
+
return /* @__PURE__ */ jsxs37("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
4248
|
+
/* @__PURE__ */ jsx39(
|
|
4112
4249
|
"button",
|
|
4113
4250
|
{
|
|
4114
4251
|
type: "button",
|
|
@@ -4116,11 +4253,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4116
4253
|
disabled: disabled || page === 1,
|
|
4117
4254
|
"aria-label": "Previous page",
|
|
4118
4255
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4119
|
-
children: /* @__PURE__ */
|
|
4256
|
+
children: /* @__PURE__ */ jsx39(ChevronLeft3, { size: 16 })
|
|
4120
4257
|
}
|
|
4121
4258
|
),
|
|
4122
4259
|
pageWindow(page, totalPages).map(
|
|
4123
|
-
(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(
|
|
4124
4261
|
"button",
|
|
4125
4262
|
{
|
|
4126
4263
|
type: "button",
|
|
@@ -4136,7 +4273,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4136
4273
|
p
|
|
4137
4274
|
)
|
|
4138
4275
|
),
|
|
4139
|
-
/* @__PURE__ */
|
|
4276
|
+
/* @__PURE__ */ jsx39(
|
|
4140
4277
|
"button",
|
|
4141
4278
|
{
|
|
4142
4279
|
type: "button",
|
|
@@ -4144,14 +4281,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
|
|
|
4144
4281
|
disabled: disabled || page === totalPages,
|
|
4145
4282
|
"aria-label": "Next page",
|
|
4146
4283
|
className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
|
|
4147
|
-
children: /* @__PURE__ */
|
|
4284
|
+
children: /* @__PURE__ */ jsx39(ChevronRight4, { size: 16 })
|
|
4148
4285
|
}
|
|
4149
4286
|
)
|
|
4150
4287
|
] });
|
|
4151
4288
|
}
|
|
4152
4289
|
|
|
4153
4290
|
// src/WorkspaceAvatar.tsx
|
|
4154
|
-
import { jsx as
|
|
4291
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
4155
4292
|
function workspaceInitials(name) {
|
|
4156
4293
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
4157
4294
|
if (words.length === 0) return "\xB7";
|
|
@@ -4170,7 +4307,7 @@ var SIZES = {
|
|
|
4170
4307
|
lg: "h-11 w-11 text-panel-title"
|
|
4171
4308
|
};
|
|
4172
4309
|
function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
4173
|
-
return /* @__PURE__ */
|
|
4310
|
+
return /* @__PURE__ */ jsx40(
|
|
4174
4311
|
"span",
|
|
4175
4312
|
{
|
|
4176
4313
|
"aria-hidden": "true",
|
|
@@ -4186,20 +4323,20 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
|
|
|
4186
4323
|
}
|
|
4187
4324
|
|
|
4188
4325
|
// src/Toast.tsx
|
|
4189
|
-
import { useEffect as
|
|
4326
|
+
import { useEffect as useEffect12, useRef as useRef14, useState as useState13 } from "react";
|
|
4190
4327
|
import { createPortal as createPortal6 } from "react-dom";
|
|
4191
4328
|
import { AlertTriangle, Check as Check8 } from "lucide-react";
|
|
4192
|
-
import { jsx as
|
|
4329
|
+
import { jsx as jsx41, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4193
4330
|
var ICON = {
|
|
4194
4331
|
neutral: null,
|
|
4195
|
-
success: /* @__PURE__ */
|
|
4196
|
-
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" })
|
|
4197
4334
|
};
|
|
4198
4335
|
function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
|
|
4199
4336
|
const ms = duration ?? (action ? 1e4 : 5e3);
|
|
4200
|
-
const [paused, setPaused] =
|
|
4337
|
+
const [paused, setPaused] = useState13(false);
|
|
4201
4338
|
const closed = useRef14(false);
|
|
4202
|
-
|
|
4339
|
+
useEffect12(() => {
|
|
4203
4340
|
if (paused) return;
|
|
4204
4341
|
const t = window.setTimeout(() => {
|
|
4205
4342
|
if (closed.current) return;
|
|
@@ -4209,7 +4346,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4209
4346
|
return () => window.clearTimeout(t);
|
|
4210
4347
|
}, [message, ms, paused]);
|
|
4211
4348
|
return createPortal6(
|
|
4212
|
-
/* @__PURE__ */
|
|
4349
|
+
/* @__PURE__ */ jsxs38(
|
|
4213
4350
|
"div",
|
|
4214
4351
|
{
|
|
4215
4352
|
role: "status",
|
|
@@ -4227,7 +4364,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4227
4364
|
children: [
|
|
4228
4365
|
ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
|
|
4229
4366
|
// for the page, and on the toast's flipped surface amber drops to 2:1.
|
|
4230
|
-
/* @__PURE__ */
|
|
4367
|
+
/* @__PURE__ */ jsx41(
|
|
4231
4368
|
"span",
|
|
4232
4369
|
{
|
|
4233
4370
|
className: cn(
|
|
@@ -4237,8 +4374,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4237
4374
|
children: ICON[tone]
|
|
4238
4375
|
}
|
|
4239
4376
|
),
|
|
4240
|
-
/* @__PURE__ */
|
|
4241
|
-
action && /* @__PURE__ */
|
|
4377
|
+
/* @__PURE__ */ jsx41("span", { className: "min-w-0", children: message }),
|
|
4378
|
+
action && /* @__PURE__ */ jsx41(
|
|
4242
4379
|
"button",
|
|
4243
4380
|
{
|
|
4244
4381
|
type: "button",
|
|
@@ -4260,14 +4397,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4260
4397
|
}
|
|
4261
4398
|
|
|
4262
4399
|
// src/Tag.tsx
|
|
4263
|
-
import { jsx as
|
|
4400
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4264
4401
|
function Tag({ children, className, testIdPrefix }) {
|
|
4265
|
-
return /* @__PURE__ */
|
|
4402
|
+
return /* @__PURE__ */ jsx42(Badge, { kind: "category", className, testIdPrefix, children });
|
|
4266
4403
|
}
|
|
4267
4404
|
|
|
4268
4405
|
// src/TablePagination.tsx
|
|
4269
4406
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
4270
|
-
import { jsx as
|
|
4407
|
+
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4271
4408
|
function TablePagination({
|
|
4272
4409
|
page,
|
|
4273
4410
|
perPage,
|
|
@@ -4287,7 +4424,7 @@ function TablePagination({
|
|
|
4287
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";
|
|
4288
4425
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4289
4426
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4290
|
-
const range = /* @__PURE__ */
|
|
4427
|
+
const range = /* @__PURE__ */ jsxs39("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
4291
4428
|
rangeStart.toLocaleString(),
|
|
4292
4429
|
" \u2013 ",
|
|
4293
4430
|
rangeEnd.toLocaleString(),
|
|
@@ -4296,13 +4433,13 @@ function TablePagination({
|
|
|
4296
4433
|
" ",
|
|
4297
4434
|
itemLabel
|
|
4298
4435
|
] });
|
|
4299
|
-
return /* @__PURE__ */
|
|
4300
|
-
/* @__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(
|
|
4301
4438
|
"div",
|
|
4302
4439
|
{
|
|
4303
4440
|
className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
|
|
4304
4441
|
children: [
|
|
4305
|
-
/* @__PURE__ */
|
|
4442
|
+
/* @__PURE__ */ jsx43(
|
|
4306
4443
|
SelectFilter,
|
|
4307
4444
|
{
|
|
4308
4445
|
size: "sm",
|
|
@@ -4318,8 +4455,8 @@ function TablePagination({
|
|
|
4318
4455
|
]
|
|
4319
4456
|
}
|
|
4320
4457
|
),
|
|
4321
|
-
/* @__PURE__ */
|
|
4322
|
-
/* @__PURE__ */
|
|
4458
|
+
/* @__PURE__ */ jsxs39("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
|
|
4459
|
+
/* @__PURE__ */ jsx43(
|
|
4323
4460
|
"button",
|
|
4324
4461
|
{
|
|
4325
4462
|
type: "button",
|
|
@@ -4328,10 +4465,10 @@ function TablePagination({
|
|
|
4328
4465
|
"aria-label": "First page",
|
|
4329
4466
|
"data-testid": testIdPrefix && `${testIdPrefix}-first`,
|
|
4330
4467
|
className: stepBtn,
|
|
4331
|
-
children: /* @__PURE__ */
|
|
4468
|
+
children: /* @__PURE__ */ jsx43(ChevronFirst, { size: 16, "aria-hidden": "true" })
|
|
4332
4469
|
}
|
|
4333
4470
|
),
|
|
4334
|
-
/* @__PURE__ */
|
|
4471
|
+
/* @__PURE__ */ jsx43(
|
|
4335
4472
|
"button",
|
|
4336
4473
|
{
|
|
4337
4474
|
type: "button",
|
|
@@ -4340,11 +4477,11 @@ function TablePagination({
|
|
|
4340
4477
|
"aria-label": "Previous page",
|
|
4341
4478
|
"data-testid": testIdPrefix && `${testIdPrefix}-prev`,
|
|
4342
4479
|
className: stepBtn,
|
|
4343
|
-
children: /* @__PURE__ */
|
|
4480
|
+
children: /* @__PURE__ */ jsx43(ChevronLeft4, { size: 16, "aria-hidden": "true" })
|
|
4344
4481
|
}
|
|
4345
4482
|
),
|
|
4346
4483
|
pageWindow(current, totalPages).map(
|
|
4347
|
-
(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(
|
|
4348
4485
|
"button",
|
|
4349
4486
|
{
|
|
4350
4487
|
type: "button",
|
|
@@ -4362,7 +4499,7 @@ function TablePagination({
|
|
|
4362
4499
|
p
|
|
4363
4500
|
)
|
|
4364
4501
|
),
|
|
4365
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsx43(
|
|
4366
4503
|
"button",
|
|
4367
4504
|
{
|
|
4368
4505
|
type: "button",
|
|
@@ -4371,10 +4508,10 @@ function TablePagination({
|
|
|
4371
4508
|
"aria-label": "Next page",
|
|
4372
4509
|
"data-testid": testIdPrefix && `${testIdPrefix}-next`,
|
|
4373
4510
|
className: stepBtn,
|
|
4374
|
-
children: /* @__PURE__ */
|
|
4511
|
+
children: /* @__PURE__ */ jsx43(ChevronRight5, { size: 16, "aria-hidden": "true" })
|
|
4375
4512
|
}
|
|
4376
4513
|
),
|
|
4377
|
-
/* @__PURE__ */
|
|
4514
|
+
/* @__PURE__ */ jsx43(
|
|
4378
4515
|
"button",
|
|
4379
4516
|
{
|
|
4380
4517
|
type: "button",
|
|
@@ -4383,7 +4520,7 @@ function TablePagination({
|
|
|
4383
4520
|
"aria-label": "Last page",
|
|
4384
4521
|
"data-testid": testIdPrefix && `${testIdPrefix}-last`,
|
|
4385
4522
|
className: stepBtn,
|
|
4386
|
-
children: /* @__PURE__ */
|
|
4523
|
+
children: /* @__PURE__ */ jsx43(ChevronLast, { size: 16, "aria-hidden": "true" })
|
|
4387
4524
|
}
|
|
4388
4525
|
)
|
|
4389
4526
|
] }),
|
|
@@ -4392,9 +4529,9 @@ function TablePagination({
|
|
|
4392
4529
|
}
|
|
4393
4530
|
|
|
4394
4531
|
// src/DateRangePicker.tsx
|
|
4395
|
-
import { useEffect as
|
|
4532
|
+
import { useEffect as useEffect13, useMemo as useMemo4, useRef as useRef15, useState as useState14 } from "react";
|
|
4396
4533
|
import { ChevronDown as ChevronDown9 } from "lucide-react";
|
|
4397
|
-
import { jsx as
|
|
4534
|
+
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4398
4535
|
var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4399
4536
|
var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
|
|
4400
4537
|
var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
|
|
@@ -4432,7 +4569,7 @@ function spanLabel2(label, today, formatDate2, formatRange) {
|
|
|
4432
4569
|
return `${f(s)} \u2013 ${f(e)}`;
|
|
4433
4570
|
}
|
|
4434
4571
|
function MiniSelect({ value, onChange, options }) {
|
|
4435
|
-
return /* @__PURE__ */
|
|
4572
|
+
return /* @__PURE__ */ jsx44(
|
|
4436
4573
|
"select",
|
|
4437
4574
|
{
|
|
4438
4575
|
value: String(value),
|
|
@@ -4441,7 +4578,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
4441
4578
|
if (opt) onChange(opt.value);
|
|
4442
4579
|
},
|
|
4443
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",
|
|
4444
|
-
children: options.map((o) => /* @__PURE__ */
|
|
4581
|
+
children: options.map((o) => /* @__PURE__ */ jsx44("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
4445
4582
|
}
|
|
4446
4583
|
);
|
|
4447
4584
|
}
|
|
@@ -4462,17 +4599,17 @@ function DateRangePicker({
|
|
|
4462
4599
|
}) {
|
|
4463
4600
|
const end = useMemo4(() => today ?? startOfToday(), [today]);
|
|
4464
4601
|
const yearOptions = years ?? [3, 2, 1, 0].map((n) => end.getFullYear() - n);
|
|
4465
|
-
const [open, setOpen] =
|
|
4466
|
-
const [value, setValue] =
|
|
4467
|
-
const [draft, setDraft] =
|
|
4602
|
+
const [open, setOpen] = useState14(false);
|
|
4603
|
+
const [value, setValue] = useState14(defaultValue);
|
|
4604
|
+
const [draft, setDraft] = useState14(defaultValue);
|
|
4468
4605
|
const ref = useRef15(null);
|
|
4469
|
-
const [fromMo, setFromMo] =
|
|
4470
|
-
const [fromYr, setFromYr] =
|
|
4471
|
-
const [toMo, setToMo] =
|
|
4472
|
-
const [toYr, setToYr] =
|
|
4473
|
-
const [fromQ, setFromQ] =
|
|
4474
|
-
const [toQ, setToQ] =
|
|
4475
|
-
|
|
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(() => {
|
|
4476
4613
|
const [s, e] = resolveRange(value, end);
|
|
4477
4614
|
onRangeChange?.(s, e);
|
|
4478
4615
|
}, [value]);
|
|
@@ -4480,7 +4617,7 @@ function DateRangePicker({
|
|
|
4480
4617
|
if (!open) setDraft(value);
|
|
4481
4618
|
setOpen((o) => !o);
|
|
4482
4619
|
};
|
|
4483
|
-
|
|
4620
|
+
useEffect13(() => {
|
|
4484
4621
|
if (!open) return;
|
|
4485
4622
|
const onDown = (e) => {
|
|
4486
4623
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
@@ -4506,8 +4643,8 @@ function DateRangePicker({
|
|
|
4506
4643
|
if (showFooter) setDraft(label);
|
|
4507
4644
|
else commit(label);
|
|
4508
4645
|
};
|
|
4509
|
-
return /* @__PURE__ */
|
|
4510
|
-
/* @__PURE__ */
|
|
4646
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
|
|
4647
|
+
/* @__PURE__ */ jsxs40(
|
|
4511
4648
|
"button",
|
|
4512
4649
|
{
|
|
4513
4650
|
type: "button",
|
|
@@ -4516,16 +4653,16 @@ function DateRangePicker({
|
|
|
4516
4653
|
"aria-haspopup": "listbox",
|
|
4517
4654
|
className: chipTriggerClass(),
|
|
4518
4655
|
children: [
|
|
4519
|
-
/* @__PURE__ */
|
|
4520
|
-
/* @__PURE__ */
|
|
4521
|
-
/* @__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 })
|
|
4522
4659
|
] }),
|
|
4523
|
-
/* @__PURE__ */
|
|
4660
|
+
/* @__PURE__ */ jsx44(ChevronDown9, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
|
|
4524
4661
|
]
|
|
4525
4662
|
}
|
|
4526
4663
|
),
|
|
4527
|
-
open && /* @__PURE__ */
|
|
4528
|
-
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(
|
|
4529
4666
|
"button",
|
|
4530
4667
|
{
|
|
4531
4668
|
type: "button",
|
|
@@ -4535,26 +4672,26 @@ function DateRangePicker({
|
|
|
4535
4672
|
},
|
|
4536
4673
|
p
|
|
4537
4674
|
)),
|
|
4538
|
-
/* @__PURE__ */
|
|
4539
|
-
/* @__PURE__ */
|
|
4540
|
-
/* @__PURE__ */
|
|
4541
|
-
/* @__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: [
|
|
4542
4679
|
"From",
|
|
4543
|
-
/* @__PURE__ */
|
|
4544
|
-
granularity === "month" && /* @__PURE__ */
|
|
4545
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4546
|
-
/* @__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 })) })
|
|
4547
4684
|
] })
|
|
4548
4685
|
] }),
|
|
4549
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
|
|
4550
4687
|
"To",
|
|
4551
|
-
/* @__PURE__ */
|
|
4552
|
-
granularity === "month" && /* @__PURE__ */
|
|
4553
|
-
granularity === "quarter" && /* @__PURE__ */
|
|
4554
|
-
/* @__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 })) })
|
|
4555
4692
|
] })
|
|
4556
4693
|
] }),
|
|
4557
|
-
/* @__PURE__ */
|
|
4694
|
+
/* @__PURE__ */ jsx44(
|
|
4558
4695
|
"button",
|
|
4559
4696
|
{
|
|
4560
4697
|
type: "button",
|
|
@@ -4566,15 +4703,15 @@ function DateRangePicker({
|
|
|
4566
4703
|
)
|
|
4567
4704
|
] })
|
|
4568
4705
|
] }),
|
|
4569
|
-
showFooter && /* @__PURE__ */
|
|
4706
|
+
showFooter && /* @__PURE__ */ jsx44(FilterDropdownFooter, { onApply: () => commit(draft) })
|
|
4570
4707
|
] })
|
|
4571
4708
|
] });
|
|
4572
4709
|
}
|
|
4573
4710
|
|
|
4574
4711
|
// src/MultiSelectFilter.tsx
|
|
4575
|
-
import { useCallback as useCallback4, useEffect as
|
|
4712
|
+
import { useCallback as useCallback4, useEffect as useEffect14, useRef as useRef16, useState as useState15 } from "react";
|
|
4576
4713
|
import { ChevronDown as ChevronDown10, Search as Search5, X as X5 } from "lucide-react";
|
|
4577
|
-
import { Fragment as Fragment5, jsx as
|
|
4714
|
+
import { Fragment as Fragment5, jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4578
4715
|
var SEARCH_AFTER = 8;
|
|
4579
4716
|
function MultiSelectFilter({
|
|
4580
4717
|
caption,
|
|
@@ -4608,9 +4745,9 @@ function MultiSelectFilter({
|
|
|
4608
4745
|
const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
|
|
4609
4746
|
const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
|
|
4610
4747
|
const showSearch = searchable ?? leafOptions.length > SEARCH_AFTER;
|
|
4611
|
-
const [open, setOpen] =
|
|
4612
|
-
const [q, setQ] =
|
|
4613
|
-
const [draft, setDraft] =
|
|
4748
|
+
const [open, setOpen] = useState15(false);
|
|
4749
|
+
const [q, setQ] = useState15("");
|
|
4750
|
+
const [draft, setDraft] = useState15(selected);
|
|
4614
4751
|
const ref = useRef16(null);
|
|
4615
4752
|
const close = useCallback4(() => {
|
|
4616
4753
|
setOpen(false);
|
|
@@ -4635,7 +4772,7 @@ function MultiSelectFilter({
|
|
|
4635
4772
|
setOpen(false);
|
|
4636
4773
|
setQ("");
|
|
4637
4774
|
};
|
|
4638
|
-
|
|
4775
|
+
useEffect14(() => {
|
|
4639
4776
|
if (!open) return;
|
|
4640
4777
|
const onKey = (e) => e.key === "Escape" && close();
|
|
4641
4778
|
const onClick = (e) => {
|
|
@@ -4672,9 +4809,9 @@ function MultiSelectFilter({
|
|
|
4672
4809
|
const shown = open && !showFooter ? draft : selected;
|
|
4673
4810
|
const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
|
|
4674
4811
|
const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
|
|
4675
|
-
const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */
|
|
4676
|
-
/* @__PURE__ */
|
|
4677
|
-
/* @__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] })
|
|
4678
4815
|
] }) : label;
|
|
4679
4816
|
const ql = q.trim().toLowerCase();
|
|
4680
4817
|
const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
|
|
@@ -4685,8 +4822,8 @@ function MultiSelectFilter({
|
|
|
4685
4822
|
const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
|
|
4686
4823
|
return kids.length ? { ...g, children: kids } : null;
|
|
4687
4824
|
}).filter((g) => g !== null) : [];
|
|
4688
|
-
return /* @__PURE__ */
|
|
4689
|
-
/* @__PURE__ */
|
|
4825
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
|
|
4826
|
+
/* @__PURE__ */ jsxs41(
|
|
4690
4827
|
"button",
|
|
4691
4828
|
{
|
|
4692
4829
|
type: "button",
|
|
@@ -4695,8 +4832,8 @@ function MultiSelectFilter({
|
|
|
4695
4832
|
"data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
|
|
4696
4833
|
className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
|
|
4697
4834
|
children: [
|
|
4698
|
-
/* @__PURE__ */
|
|
4699
|
-
/* @__PURE__ */
|
|
4835
|
+
/* @__PURE__ */ jsx45(ChipContent, { caption, value, icon }),
|
|
4836
|
+
/* @__PURE__ */ jsx45(
|
|
4700
4837
|
ChevronDown10,
|
|
4701
4838
|
{
|
|
4702
4839
|
size: 14,
|
|
@@ -4707,7 +4844,7 @@ function MultiSelectFilter({
|
|
|
4707
4844
|
]
|
|
4708
4845
|
}
|
|
4709
4846
|
),
|
|
4710
|
-
open && /* @__PURE__ */
|
|
4847
|
+
open && /* @__PURE__ */ jsx45(
|
|
4711
4848
|
"div",
|
|
4712
4849
|
{
|
|
4713
4850
|
className: cn(
|
|
@@ -4718,10 +4855,10 @@ function MultiSelectFilter({
|
|
|
4718
4855
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
4719
4856
|
role: "dialog",
|
|
4720
4857
|
"aria-label": caption,
|
|
4721
|
-
children: loading ? /* @__PURE__ */
|
|
4722
|
-
showSearch && /* @__PURE__ */
|
|
4723
|
-
/* @__PURE__ */
|
|
4724
|
-
/* @__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(
|
|
4725
4862
|
"input",
|
|
4726
4863
|
{
|
|
4727
4864
|
type: "text",
|
|
@@ -4731,37 +4868,37 @@ function MultiSelectFilter({
|
|
|
4731
4868
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4732
4869
|
}
|
|
4733
4870
|
),
|
|
4734
|
-
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 }) })
|
|
4735
4872
|
] }) }),
|
|
4736
|
-
/* @__PURE__ */
|
|
4873
|
+
/* @__PURE__ */ jsxs41("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4737
4874
|
groups ? visibleGroups.map((g) => {
|
|
4738
4875
|
const state = groupState(g);
|
|
4739
|
-
return /* @__PURE__ */
|
|
4740
|
-
/* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ jsxs41("div", { children: [
|
|
4877
|
+
/* @__PURE__ */ jsxs41(
|
|
4741
4878
|
"button",
|
|
4742
4879
|
{
|
|
4743
4880
|
type: "button",
|
|
4744
4881
|
onClick: () => toggleGroup(g),
|
|
4745
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",
|
|
4746
4883
|
children: [
|
|
4747
|
-
/* @__PURE__ */
|
|
4748
|
-
/* @__PURE__ */
|
|
4749
|
-
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) })
|
|
4750
4887
|
]
|
|
4751
4888
|
}
|
|
4752
4889
|
),
|
|
4753
4890
|
g.children.map((c) => {
|
|
4754
4891
|
const checked = draft.includes(c.id);
|
|
4755
|
-
return /* @__PURE__ */
|
|
4892
|
+
return /* @__PURE__ */ jsxs41(
|
|
4756
4893
|
"button",
|
|
4757
4894
|
{
|
|
4758
4895
|
type: "button",
|
|
4759
4896
|
onClick: () => toggle(c.id),
|
|
4760
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",
|
|
4761
4898
|
children: [
|
|
4762
|
-
/* @__PURE__ */
|
|
4763
|
-
/* @__PURE__ */
|
|
4764
|
-
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) })
|
|
4765
4902
|
]
|
|
4766
4903
|
},
|
|
4767
4904
|
c.id
|
|
@@ -4770,25 +4907,25 @@ function MultiSelectFilter({
|
|
|
4770
4907
|
] }, g.id);
|
|
4771
4908
|
}) : items.map((o) => {
|
|
4772
4909
|
const checked = draft.includes(o.id);
|
|
4773
|
-
return /* @__PURE__ */
|
|
4910
|
+
return /* @__PURE__ */ jsxs41(
|
|
4774
4911
|
"button",
|
|
4775
4912
|
{
|
|
4776
4913
|
type: "button",
|
|
4777
4914
|
onClick: () => toggle(o.id),
|
|
4778
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",
|
|
4779
4916
|
children: [
|
|
4780
|
-
/* @__PURE__ */
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
-
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) })
|
|
4783
4920
|
]
|
|
4784
4921
|
},
|
|
4785
4922
|
o.id
|
|
4786
4923
|
);
|
|
4787
4924
|
}),
|
|
4788
|
-
(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." })
|
|
4789
4926
|
] }),
|
|
4790
|
-
note && /* @__PURE__ */
|
|
4791
|
-
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(
|
|
4792
4929
|
"button",
|
|
4793
4930
|
{
|
|
4794
4931
|
type: "button",
|
|
@@ -4806,7 +4943,7 @@ function MultiSelectFilter({
|
|
|
4806
4943
|
] });
|
|
4807
4944
|
}
|
|
4808
4945
|
function OptionCount({ n }) {
|
|
4809
|
-
return /* @__PURE__ */
|
|
4946
|
+
return /* @__PURE__ */ jsxs41("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
|
|
4810
4947
|
"(",
|
|
4811
4948
|
n.toLocaleString(),
|
|
4812
4949
|
")"
|
|
@@ -4815,7 +4952,7 @@ function OptionCount({ n }) {
|
|
|
4815
4952
|
|
|
4816
4953
|
// src/Toggle.tsx
|
|
4817
4954
|
import { forwardRef as forwardRef8 } from "react";
|
|
4818
|
-
import { jsx as
|
|
4955
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4819
4956
|
var SIZES2 = {
|
|
4820
4957
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4821
4958
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
@@ -4823,7 +4960,7 @@ var SIZES2 = {
|
|
|
4823
4960
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4824
4961
|
var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
4825
4962
|
const s = SIZES2[size];
|
|
4826
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ jsx46(
|
|
4827
4964
|
"button",
|
|
4828
4965
|
{
|
|
4829
4966
|
ref,
|
|
@@ -4842,7 +4979,7 @@ var Toggle = forwardRef8(function Toggle2({ checked, onChange, label, size = "md
|
|
|
4842
4979
|
disabled && "cursor-not-allowed opacity-50",
|
|
4843
4980
|
className
|
|
4844
4981
|
),
|
|
4845
|
-
children: /* @__PURE__ */
|
|
4982
|
+
children: /* @__PURE__ */ jsx46(
|
|
4846
4983
|
"span",
|
|
4847
4984
|
{
|
|
4848
4985
|
className: cn(
|
|
@@ -4860,20 +4997,20 @@ Toggle.displayName = "Toggle";
|
|
|
4860
4997
|
// src/AISpark.tsx
|
|
4861
4998
|
import { useId as useId6 } from "react";
|
|
4862
4999
|
import { Sparkles } from "lucide-react";
|
|
4863
|
-
import { Fragment as Fragment6, jsx as
|
|
5000
|
+
import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4864
5001
|
function AISpark({ size = 16, className, testIdPrefix }) {
|
|
4865
5002
|
const id = useId6();
|
|
4866
|
-
return /* @__PURE__ */
|
|
4867
|
-
/* @__PURE__ */
|
|
4868
|
-
/* @__PURE__ */
|
|
4869
|
-
/* @__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)" })
|
|
4870
5007
|
] }) }) }),
|
|
4871
|
-
/* @__PURE__ */
|
|
5008
|
+
/* @__PURE__ */ jsx47(Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4872
5009
|
] });
|
|
4873
5010
|
}
|
|
4874
5011
|
|
|
4875
5012
|
// src/Freshness.tsx
|
|
4876
|
-
import { jsx as
|
|
5013
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4877
5014
|
var dotColor = {
|
|
4878
5015
|
fresh: "bg-status-success",
|
|
4879
5016
|
recent: "bg-status-warning",
|
|
@@ -4885,7 +5022,7 @@ var srLabel = {
|
|
|
4885
5022
|
stale: "Older than a day"
|
|
4886
5023
|
};
|
|
4887
5024
|
function Freshness({ level, className, testIdPrefix }) {
|
|
4888
|
-
return /* @__PURE__ */
|
|
5025
|
+
return /* @__PURE__ */ jsx48(
|
|
4889
5026
|
"span",
|
|
4890
5027
|
{
|
|
4891
5028
|
className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
|
|
@@ -4897,50 +5034,50 @@ function Freshness({ level, className, testIdPrefix }) {
|
|
|
4897
5034
|
}
|
|
4898
5035
|
|
|
4899
5036
|
// src/SectionHeading.tsx
|
|
4900
|
-
import { jsx as
|
|
5037
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4901
5038
|
function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
|
|
4902
|
-
return /* @__PURE__ */
|
|
4903
|
-
/* @__PURE__ */
|
|
4904
|
-
/* @__PURE__ */
|
|
4905
|
-
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 })
|
|
4906
5043
|
] }),
|
|
4907
|
-
actions && /* @__PURE__ */
|
|
5044
|
+
actions && /* @__PURE__ */ jsx49("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4908
5045
|
] });
|
|
4909
5046
|
}
|
|
4910
5047
|
|
|
4911
5048
|
// src/PageHeader.tsx
|
|
4912
5049
|
import { ArrowLeft } from "lucide-react";
|
|
4913
|
-
import { jsx as
|
|
5050
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4914
5051
|
function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
|
|
4915
|
-
return /* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4917
|
-
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(
|
|
4918
5055
|
"a",
|
|
4919
5056
|
{
|
|
4920
5057
|
href: back.href ?? "#",
|
|
4921
5058
|
onClick: back.onClick,
|
|
4922
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",
|
|
4923
5060
|
children: [
|
|
4924
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ jsx50(ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4925
5062
|
back.label
|
|
4926
5063
|
]
|
|
4927
5064
|
}
|
|
4928
5065
|
),
|
|
4929
|
-
meta ? /* @__PURE__ */
|
|
4930
|
-
/* @__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 }),
|
|
4931
5068
|
meta
|
|
4932
|
-
] }) : /* @__PURE__ */
|
|
4933
|
-
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 })
|
|
4934
5071
|
] }),
|
|
4935
|
-
actions && /* @__PURE__ */
|
|
5072
|
+
actions && /* @__PURE__ */ jsx50("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
4936
5073
|
] });
|
|
4937
5074
|
}
|
|
4938
5075
|
|
|
4939
5076
|
// src/Modal.tsx
|
|
4940
|
-
import { useEffect as
|
|
5077
|
+
import { useEffect as useEffect15, useId as useId7, useRef as useRef17, useState as useState16 } from "react";
|
|
4941
5078
|
import { createPortal as createPortal7 } from "react-dom";
|
|
4942
5079
|
import { X as X6 } from "lucide-react";
|
|
4943
|
-
import { jsx as
|
|
5080
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4944
5081
|
var WIDTH = {
|
|
4945
5082
|
sm: "max-w-110",
|
|
4946
5083
|
md: "max-w-160",
|
|
@@ -4957,9 +5094,9 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4957
5094
|
const panel = useRef17(null);
|
|
4958
5095
|
const close = useRef17(onClose);
|
|
4959
5096
|
close.current = onClose;
|
|
4960
|
-
const [mounted, setMounted] =
|
|
4961
|
-
const [shown, setShown] =
|
|
4962
|
-
|
|
5097
|
+
const [mounted, setMounted] = useState16(open);
|
|
5098
|
+
const [shown, setShown] = useState16(false);
|
|
5099
|
+
useEffect15(() => {
|
|
4963
5100
|
if (open) {
|
|
4964
5101
|
setMounted(true);
|
|
4965
5102
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
@@ -4969,7 +5106,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4969
5106
|
const t = setTimeout(() => setMounted(false), EXIT_MS);
|
|
4970
5107
|
return () => clearTimeout(t);
|
|
4971
5108
|
}, [open]);
|
|
4972
|
-
|
|
5109
|
+
useEffect15(() => {
|
|
4973
5110
|
if (!open || !mounted) return;
|
|
4974
5111
|
const opener = document.activeElement;
|
|
4975
5112
|
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE) ?? null;
|
|
@@ -5004,7 +5141,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5004
5141
|
}, [open, mounted]);
|
|
5005
5142
|
if (!mounted || typeof document === "undefined") return null;
|
|
5006
5143
|
return createPortal7(
|
|
5007
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ jsx51(
|
|
5008
5145
|
"div",
|
|
5009
5146
|
{
|
|
5010
5147
|
className: cn(
|
|
@@ -5012,7 +5149,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5012
5149
|
shown ? "opacity-100" : "opacity-0"
|
|
5013
5150
|
),
|
|
5014
5151
|
onMouseDown: (e) => e.target === e.currentTarget && onClose(),
|
|
5015
|
-
children: /* @__PURE__ */
|
|
5152
|
+
children: /* @__PURE__ */ jsxs45(
|
|
5016
5153
|
"div",
|
|
5017
5154
|
{
|
|
5018
5155
|
ref: panel,
|
|
@@ -5030,24 +5167,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5030
5167
|
className
|
|
5031
5168
|
),
|
|
5032
5169
|
children: [
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
/* @__PURE__ */
|
|
5035
|
-
/* @__PURE__ */
|
|
5036
|
-
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 })
|
|
5037
5174
|
] }),
|
|
5038
|
-
/* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsx51(
|
|
5039
5176
|
"button",
|
|
5040
5177
|
{
|
|
5041
5178
|
type: "button",
|
|
5042
5179
|
onClick: onClose,
|
|
5043
5180
|
"aria-label": "Close",
|
|
5044
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",
|
|
5045
|
-
children: /* @__PURE__ */
|
|
5182
|
+
children: /* @__PURE__ */ jsx51(X6, { size: 16, "aria-hidden": "true" })
|
|
5046
5183
|
}
|
|
5047
5184
|
)
|
|
5048
5185
|
] }),
|
|
5049
|
-
children && /* @__PURE__ */
|
|
5050
|
-
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 })
|
|
5051
5188
|
]
|
|
5052
5189
|
}
|
|
5053
5190
|
)
|
|
@@ -5058,10 +5195,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
5058
5195
|
}
|
|
5059
5196
|
|
|
5060
5197
|
// src/EmptyState.tsx
|
|
5061
|
-
import { jsx as
|
|
5198
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5062
5199
|
function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
|
|
5063
5200
|
const md = size === "md";
|
|
5064
|
-
return /* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ jsxs46(
|
|
5065
5202
|
"div",
|
|
5066
5203
|
{
|
|
5067
5204
|
className: cn(
|
|
@@ -5071,7 +5208,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5071
5208
|
),
|
|
5072
5209
|
"data-testid": testIdPrefix,
|
|
5073
5210
|
children: [
|
|
5074
|
-
icon && /* @__PURE__ */
|
|
5211
|
+
icon && /* @__PURE__ */ jsx52(
|
|
5075
5212
|
"span",
|
|
5076
5213
|
{
|
|
5077
5214
|
"aria-hidden": "true",
|
|
@@ -5082,9 +5219,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5082
5219
|
children: icon
|
|
5083
5220
|
}
|
|
5084
5221
|
),
|
|
5085
|
-
/* @__PURE__ */
|
|
5086
|
-
description && /* @__PURE__ */
|
|
5087
|
-
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 })
|
|
5088
5225
|
]
|
|
5089
5226
|
}
|
|
5090
5227
|
);
|
|
@@ -5092,7 +5229,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
|
|
|
5092
5229
|
|
|
5093
5230
|
// src/TextField.tsx
|
|
5094
5231
|
import { forwardRef as forwardRef9, useId as useId8 } from "react";
|
|
5095
|
-
import { jsx as
|
|
5232
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5096
5233
|
var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
|
|
5097
5234
|
var TextField = forwardRef9(
|
|
5098
5235
|
({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
|
|
@@ -5100,9 +5237,9 @@ var TextField = forwardRef9(
|
|
|
5100
5237
|
const fieldId = id ?? auto;
|
|
5101
5238
|
const noteId = `${fieldId}-note`;
|
|
5102
5239
|
const note = error ?? hint;
|
|
5103
|
-
return /* @__PURE__ */
|
|
5104
|
-
label && /* @__PURE__ */
|
|
5105
|
-
/* @__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(
|
|
5106
5243
|
"div",
|
|
5107
5244
|
{
|
|
5108
5245
|
className: cn(
|
|
@@ -5112,8 +5249,8 @@ var TextField = forwardRef9(
|
|
|
5112
5249
|
disabled && "opacity-50"
|
|
5113
5250
|
),
|
|
5114
5251
|
children: [
|
|
5115
|
-
icon && /* @__PURE__ */
|
|
5116
|
-
/* @__PURE__ */
|
|
5252
|
+
icon && /* @__PURE__ */ jsx53("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
|
|
5253
|
+
/* @__PURE__ */ jsx53(
|
|
5117
5254
|
"input",
|
|
5118
5255
|
{
|
|
5119
5256
|
ref,
|
|
@@ -5128,17 +5265,17 @@ var TextField = forwardRef9(
|
|
|
5128
5265
|
]
|
|
5129
5266
|
}
|
|
5130
5267
|
),
|
|
5131
|
-
note && /* @__PURE__ */
|
|
5268
|
+
note && /* @__PURE__ */ jsx53("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
|
|
5132
5269
|
] });
|
|
5133
5270
|
}
|
|
5134
5271
|
);
|
|
5135
5272
|
TextField.displayName = "TextField";
|
|
5136
5273
|
|
|
5137
5274
|
// src/Drawer.tsx
|
|
5138
|
-
import { useEffect as
|
|
5275
|
+
import { useEffect as useEffect16, useId as useId9, useRef as useRef18, useState as useState17 } from "react";
|
|
5139
5276
|
import { createPortal as createPortal8 } from "react-dom";
|
|
5140
5277
|
import { X as X7 } from "lucide-react";
|
|
5141
|
-
import { jsx as
|
|
5278
|
+
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5142
5279
|
var WIDTH2 = {
|
|
5143
5280
|
sm: "max-w-110",
|
|
5144
5281
|
md: "max-w-160",
|
|
@@ -5152,9 +5289,9 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5152
5289
|
const panel = useRef18(null);
|
|
5153
5290
|
const close = useRef18(onClose);
|
|
5154
5291
|
close.current = onClose;
|
|
5155
|
-
const [mounted, setMounted] =
|
|
5156
|
-
const [shown, setShown] =
|
|
5157
|
-
|
|
5292
|
+
const [mounted, setMounted] = useState17(open);
|
|
5293
|
+
const [shown, setShown] = useState17(false);
|
|
5294
|
+
useEffect16(() => {
|
|
5158
5295
|
if (open) {
|
|
5159
5296
|
setMounted(true);
|
|
5160
5297
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
@@ -5164,7 +5301,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5164
5301
|
const t = setTimeout(() => setMounted(false), EXIT_MS2);
|
|
5165
5302
|
return () => clearTimeout(t);
|
|
5166
5303
|
}, [open]);
|
|
5167
|
-
|
|
5304
|
+
useEffect16(() => {
|
|
5168
5305
|
if (!open || !mounted) return;
|
|
5169
5306
|
const opener = document.activeElement;
|
|
5170
5307
|
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE2) ?? null;
|
|
@@ -5199,8 +5336,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5199
5336
|
}, [open, mounted]);
|
|
5200
5337
|
if (!mounted || typeof document === "undefined") return null;
|
|
5201
5338
|
return createPortal8(
|
|
5202
|
-
/* @__PURE__ */
|
|
5203
|
-
/* @__PURE__ */
|
|
5339
|
+
/* @__PURE__ */ jsxs48("div", { className: "fixed inset-0 z-modal", children: [
|
|
5340
|
+
/* @__PURE__ */ jsx54(
|
|
5204
5341
|
"div",
|
|
5205
5342
|
{
|
|
5206
5343
|
"aria-hidden": "true",
|
|
@@ -5214,7 +5351,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5214
5351
|
)
|
|
5215
5352
|
}
|
|
5216
5353
|
),
|
|
5217
|
-
/* @__PURE__ */
|
|
5354
|
+
/* @__PURE__ */ jsxs48(
|
|
5218
5355
|
"div",
|
|
5219
5356
|
{
|
|
5220
5357
|
ref: panel,
|
|
@@ -5231,24 +5368,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5231
5368
|
className
|
|
5232
5369
|
),
|
|
5233
5370
|
children: [
|
|
5234
|
-
/* @__PURE__ */
|
|
5235
|
-
/* @__PURE__ */
|
|
5236
|
-
/* @__PURE__ */
|
|
5237
|
-
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 })
|
|
5238
5375
|
] }),
|
|
5239
|
-
/* @__PURE__ */
|
|
5376
|
+
/* @__PURE__ */ jsx54(
|
|
5240
5377
|
"button",
|
|
5241
5378
|
{
|
|
5242
5379
|
type: "button",
|
|
5243
5380
|
onClick: onClose,
|
|
5244
5381
|
"aria-label": "Close",
|
|
5245
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",
|
|
5246
|
-
children: /* @__PURE__ */
|
|
5383
|
+
children: /* @__PURE__ */ jsx54(X7, { size: 16, "aria-hidden": "true" })
|
|
5247
5384
|
}
|
|
5248
5385
|
)
|
|
5249
5386
|
] }),
|
|
5250
|
-
/* @__PURE__ */
|
|
5251
|
-
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 })
|
|
5252
5389
|
]
|
|
5253
5390
|
}
|
|
5254
5391
|
)
|
|
@@ -5258,7 +5395,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5258
5395
|
}
|
|
5259
5396
|
|
|
5260
5397
|
// src/DataTable.tsx
|
|
5261
|
-
import { Fragment as Fragment7, useEffect as
|
|
5398
|
+
import { Fragment as Fragment7, useEffect as useEffect17, useId as useId10, useState as useState18 } from "react";
|
|
5262
5399
|
import { ChevronRight as ChevronRight6 } from "lucide-react";
|
|
5263
5400
|
|
|
5264
5401
|
// src/numbers.ts
|
|
@@ -5318,20 +5455,20 @@ function formatPercent(value, _opts = {}) {
|
|
|
5318
5455
|
}
|
|
5319
5456
|
|
|
5320
5457
|
// src/DataTable.tsx
|
|
5321
|
-
import { jsx as
|
|
5458
|
+
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5322
5459
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5323
5460
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5324
5461
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
5325
5462
|
var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
|
|
5326
5463
|
var OWN_CLICK = "a, button, input, select, textarea, label, summary, [role='button'], [role='checkbox'], [role='menuitem'], [role='switch'], [role='tab'], [contenteditable='true']";
|
|
5327
5464
|
function NoValue({ reason = "No data" }) {
|
|
5328
|
-
return /* @__PURE__ */
|
|
5329
|
-
/* @__PURE__ */
|
|
5330
|
-
/* @__PURE__ */
|
|
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 })
|
|
5331
5468
|
] });
|
|
5332
5469
|
}
|
|
5333
5470
|
function TableLink({ className, ...props }) {
|
|
5334
|
-
return /* @__PURE__ */
|
|
5471
|
+
return /* @__PURE__ */ jsx55(
|
|
5335
5472
|
"a",
|
|
5336
5473
|
{
|
|
5337
5474
|
...props,
|
|
@@ -5360,6 +5497,8 @@ function DataTable({
|
|
|
5360
5497
|
density = "default",
|
|
5361
5498
|
loading = false,
|
|
5362
5499
|
loadingRows = 5,
|
|
5500
|
+
refreshing = false,
|
|
5501
|
+
onRetry,
|
|
5363
5502
|
empty,
|
|
5364
5503
|
maxHeight,
|
|
5365
5504
|
footer,
|
|
@@ -5368,6 +5507,7 @@ function DataTable({
|
|
|
5368
5507
|
...rest
|
|
5369
5508
|
}) {
|
|
5370
5509
|
const titleId = useId10();
|
|
5510
|
+
const showSkeleton = useDelayedLoading(loading);
|
|
5371
5511
|
const head = HEAD_PAD[density];
|
|
5372
5512
|
const pad2 = CELL_PAD[density];
|
|
5373
5513
|
const right = (c) => c.numeric || c.rank;
|
|
@@ -5378,9 +5518,9 @@ function DataTable({
|
|
|
5378
5518
|
const col = columns.find((c) => c.key === key);
|
|
5379
5519
|
onSortChange?.(cycleSort(shown, key, col?.firstDir ?? (right(col) ? "desc" : "asc"), defaultSort));
|
|
5380
5520
|
};
|
|
5381
|
-
const [open, setOpen] =
|
|
5521
|
+
const [open, setOpen] = useState18(() => /* @__PURE__ */ new Set());
|
|
5382
5522
|
const visibleKeys = rows.map(rowKey).join("|");
|
|
5383
|
-
|
|
5523
|
+
useEffect17(() => setOpen(/* @__PURE__ */ new Set()), [shown?.key, shown?.dir, visibleKeys]);
|
|
5384
5524
|
const expandable = (row) => !!renderExpanded && (canExpand ? canExpand(row) : true);
|
|
5385
5525
|
const anyExpandable = !!renderExpanded && rows.some(expandable);
|
|
5386
5526
|
const toggle = (key) => setOpen((prev) => {
|
|
@@ -5397,39 +5537,39 @@ function DataTable({
|
|
|
5397
5537
|
const span = columns.length + (anyExpandable ? 1 : 0);
|
|
5398
5538
|
const renderCell = (c, row) => {
|
|
5399
5539
|
const v = c.cell(row);
|
|
5400
|
-
return v === null || v === void 0 || v === "" ? /* @__PURE__ */
|
|
5540
|
+
return v === null || v === void 0 || v === "" ? /* @__PURE__ */ jsx55(NoValue, { reason: c.missing }) : v;
|
|
5401
5541
|
};
|
|
5402
5542
|
const inside = variant === "chart";
|
|
5403
|
-
const frame = /* @__PURE__ */
|
|
5543
|
+
const frame = /* @__PURE__ */ jsxs49(
|
|
5404
5544
|
"div",
|
|
5405
5545
|
{
|
|
5406
|
-
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
|
|
5546
|
+
className: cn("relative flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
|
|
5407
5547
|
"data-testid": testIdPrefix,
|
|
5408
5548
|
children: [
|
|
5409
|
-
title && inside && /* @__PURE__ */
|
|
5410
|
-
/* @__PURE__ */
|
|
5411
|
-
/* @__PURE__ */
|
|
5412
|
-
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 })
|
|
5413
5553
|
] }),
|
|
5414
|
-
action && /* @__PURE__ */
|
|
5554
|
+
action && /* @__PURE__ */ jsx55("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
5415
5555
|
] }),
|
|
5416
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsx55("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ jsxs49(
|
|
5417
5557
|
"table",
|
|
5418
5558
|
{
|
|
5419
5559
|
"aria-labelledby": title ? titleId : void 0,
|
|
5420
5560
|
"aria-label": title ? void 0 : rest["aria-label"],
|
|
5421
|
-
"aria-busy": loading || void 0,
|
|
5561
|
+
"aria-busy": loading || refreshing || void 0,
|
|
5422
5562
|
className: "w-full border-collapse text-left",
|
|
5423
5563
|
children: [
|
|
5424
|
-
/* @__PURE__ */
|
|
5425
|
-
anyExpandable && /* @__PURE__ */
|
|
5426
|
-
columns.map((c) => /* @__PURE__ */
|
|
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(
|
|
5427
5567
|
"th",
|
|
5428
5568
|
{
|
|
5429
5569
|
scope: "col",
|
|
5430
5570
|
"aria-sort": c.sortable ? ariaSortFor(shown, c.key) : void 0,
|
|
5431
5571
|
className: cn("group/head whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5432
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */
|
|
5572
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ jsx55(
|
|
5433
5573
|
SortButton,
|
|
5434
5574
|
{
|
|
5435
5575
|
label: c.label,
|
|
@@ -5440,36 +5580,28 @@ function DataTable({
|
|
|
5440
5580
|
description: c.info,
|
|
5441
5581
|
testIdPrefix
|
|
5442
5582
|
}
|
|
5443
|
-
) : c.info ? /* @__PURE__ */
|
|
5583
|
+
) : c.info ? /* @__PURE__ */ jsx55(SortButton, { label: c.label, sortKey: c.key, sortable: false, sort: sortProp(shown), onSort: () => {
|
|
5444
5584
|
}, description: c.info, align: right(c) ? "right" : "left" }) : c.label
|
|
5445
5585
|
},
|
|
5446
5586
|
c.key
|
|
5447
5587
|
))
|
|
5448
5588
|
] }) }),
|
|
5449
|
-
/* @__PURE__ */
|
|
5450
|
-
anyExpandable && /* @__PURE__ */
|
|
5451
|
-
columns.map((c) => /* @__PURE__ */
|
|
5452
|
-
|
|
5453
|
-
{
|
|
5454
|
-
className: cn(
|
|
5455
|
-
"inline-block h-3 animate-pulse rounded-full bg-subtle",
|
|
5456
|
-
c.numeric ? "w-12" : "w-2/3"
|
|
5457
|
-
)
|
|
5458
|
-
}
|
|
5459
|
-
) }, c.key))
|
|
5460
|
-
] }, i)) : rows.length === 0 ? /* @__PURE__ */ jsx54("tr", { children: /* @__PURE__ */ jsx54("td", { colSpan: span, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ jsx54(NoResultsEmptyState, {}) }) }) : rows.map((row, index) => {
|
|
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) => {
|
|
5461
5593
|
const key = rowKey(row);
|
|
5462
5594
|
const canOpen = expandable(row);
|
|
5463
5595
|
const isOpen = canOpen && open.has(key);
|
|
5464
5596
|
const panelId = `${titleId}-row-${index}`;
|
|
5465
|
-
return /* @__PURE__ */
|
|
5466
|
-
/* @__PURE__ */
|
|
5597
|
+
return /* @__PURE__ */ jsxs49(Fragment7, { children: [
|
|
5598
|
+
/* @__PURE__ */ jsxs49(
|
|
5467
5599
|
"tr",
|
|
5468
5600
|
{
|
|
5469
5601
|
onClick: canOpen ? (e) => onRowClick(e, key) : void 0,
|
|
5470
5602
|
className: cn("hover:bg-subtle [&:last-child>td]:border-b-0", canOpen && "cursor-pointer", isOpen && "bg-subtle"),
|
|
5471
5603
|
children: [
|
|
5472
|
-
anyExpandable && /* @__PURE__ */
|
|
5604
|
+
anyExpandable && /* @__PURE__ */ jsx55("td", { className: cn("border-b border-border-default pr-0", pad2, isOpen && "border-b-0"), children: canOpen && /* @__PURE__ */ jsx55(
|
|
5473
5605
|
"button",
|
|
5474
5606
|
{
|
|
5475
5607
|
type: "button",
|
|
@@ -5478,7 +5610,7 @@ function DataTable({
|
|
|
5478
5610
|
"aria-label": `${isOpen ? "Hide" : "Show"} details${rowLabel ? ` for ${rowLabel(row)}` : ""}`,
|
|
5479
5611
|
onClick: () => toggle(key),
|
|
5480
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",
|
|
5481
|
-
children: /* @__PURE__ */
|
|
5613
|
+
children: /* @__PURE__ */ jsx55(
|
|
5482
5614
|
ChevronRight6,
|
|
5483
5615
|
{
|
|
5484
5616
|
size: 16,
|
|
@@ -5488,7 +5620,7 @@ function DataTable({
|
|
|
5488
5620
|
)
|
|
5489
5621
|
}
|
|
5490
5622
|
) }),
|
|
5491
|
-
columns.map((c) => /* @__PURE__ */
|
|
5623
|
+
columns.map((c) => /* @__PURE__ */ jsx55(
|
|
5492
5624
|
"td",
|
|
5493
5625
|
{
|
|
5494
5626
|
className: cn(
|
|
@@ -5506,25 +5638,27 @@ function DataTable({
|
|
|
5506
5638
|
]
|
|
5507
5639
|
}
|
|
5508
5640
|
),
|
|
5509
|
-
isOpen && /* @__PURE__ */
|
|
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) }) })
|
|
5510
5642
|
] }, key);
|
|
5511
5643
|
}) })
|
|
5512
5644
|
]
|
|
5513
5645
|
}
|
|
5514
5646
|
) }),
|
|
5515
|
-
|
|
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 })
|
|
5516
5650
|
]
|
|
5517
5651
|
}
|
|
5518
5652
|
);
|
|
5519
5653
|
if (!title || inside) return frame;
|
|
5520
|
-
return /* @__PURE__ */
|
|
5521
|
-
/* @__PURE__ */
|
|
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 }),
|
|
5522
5656
|
frame
|
|
5523
5657
|
] });
|
|
5524
5658
|
}
|
|
5525
5659
|
|
|
5526
5660
|
// src/MediaLabel.tsx
|
|
5527
|
-
import { jsx as
|
|
5661
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5528
5662
|
var FILL = {
|
|
5529
5663
|
TV: "bg-media-tv",
|
|
5530
5664
|
CTV: "bg-media-ctv",
|
|
@@ -5535,7 +5669,7 @@ var FILL = {
|
|
|
5535
5669
|
Magazine: "bg-media-magazine"
|
|
5536
5670
|
};
|
|
5537
5671
|
function MediaLabel({ type, className, testIdPrefix }) {
|
|
5538
|
-
return /* @__PURE__ */
|
|
5672
|
+
return /* @__PURE__ */ jsx56(
|
|
5539
5673
|
"span",
|
|
5540
5674
|
{
|
|
5541
5675
|
className: cn(
|
|
@@ -5551,9 +5685,9 @@ function MediaLabel({ type, className, testIdPrefix }) {
|
|
|
5551
5685
|
|
|
5552
5686
|
// src/SuggestionChip.tsx
|
|
5553
5687
|
import { forwardRef as forwardRef10 } from "react";
|
|
5554
|
-
import { jsx as
|
|
5688
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5555
5689
|
var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
|
|
5556
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx57(
|
|
5557
5691
|
"button",
|
|
5558
5692
|
{
|
|
5559
5693
|
ref,
|
|
@@ -5564,7 +5698,7 @@ var SuggestionChip = forwardRef10(function SuggestionChip2({ children, className
|
|
|
5564
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",
|
|
5565
5699
|
className
|
|
5566
5700
|
),
|
|
5567
|
-
children: /* @__PURE__ */
|
|
5701
|
+
children: /* @__PURE__ */ jsx57("span", { className: "truncate", children })
|
|
5568
5702
|
}
|
|
5569
5703
|
);
|
|
5570
5704
|
});
|
|
@@ -5573,9 +5707,9 @@ SuggestionChip.displayName = "SuggestionChip";
|
|
|
5573
5707
|
// src/ToggleChip.tsx
|
|
5574
5708
|
import { forwardRef as forwardRef11 } from "react";
|
|
5575
5709
|
import { Check as Check9 } from "lucide-react";
|
|
5576
|
-
import { jsx as
|
|
5710
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5577
5711
|
var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5578
|
-
return /* @__PURE__ */
|
|
5712
|
+
return /* @__PURE__ */ jsxs50(
|
|
5579
5713
|
"button",
|
|
5580
5714
|
{
|
|
5581
5715
|
ref,
|
|
@@ -5593,7 +5727,7 @@ var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, childre
|
|
|
5593
5727
|
className
|
|
5594
5728
|
),
|
|
5595
5729
|
children: [
|
|
5596
|
-
selected && /* @__PURE__ */
|
|
5730
|
+
selected && /* @__PURE__ */ jsx58(Check9, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5597
5731
|
children
|
|
5598
5732
|
]
|
|
5599
5733
|
}
|
|
@@ -5602,14 +5736,14 @@ var ToggleChip = forwardRef11(function ToggleChip2({ selected, onChange, childre
|
|
|
5602
5736
|
ToggleChip.displayName = "ToggleChip";
|
|
5603
5737
|
|
|
5604
5738
|
// src/CopyButton.tsx
|
|
5605
|
-
import { forwardRef as forwardRef12, useEffect as
|
|
5739
|
+
import { forwardRef as forwardRef12, useEffect as useEffect18, useRef as useRef19, useState as useState19 } from "react";
|
|
5606
5740
|
import { Check as Check10, Copy } from "lucide-react";
|
|
5607
|
-
import { jsx as
|
|
5741
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5608
5742
|
var CONFIRM_MS = 2e3;
|
|
5609
5743
|
var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
5610
|
-
const [copied, setCopied] =
|
|
5744
|
+
const [copied, setCopied] = useState19(false);
|
|
5611
5745
|
const timer = useRef19(void 0);
|
|
5612
|
-
|
|
5746
|
+
useEffect18(() => () => clearTimeout(timer.current), []);
|
|
5613
5747
|
const copy = async () => {
|
|
5614
5748
|
try {
|
|
5615
5749
|
await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
|
|
@@ -5621,8 +5755,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5621
5755
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5622
5756
|
};
|
|
5623
5757
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5624
|
-
const icon = copied ? /* @__PURE__ */
|
|
5625
|
-
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(
|
|
5626
5760
|
Button,
|
|
5627
5761
|
{
|
|
5628
5762
|
ref,
|
|
@@ -5636,8 +5770,8 @@ var CopyButton = forwardRef12(function CopyButton2({ value, label, "aria-label":
|
|
|
5636
5770
|
className: cn(!copied && "text-text-secondary", className),
|
|
5637
5771
|
children: [
|
|
5638
5772
|
icon,
|
|
5639
|
-
label && /* @__PURE__ */
|
|
5640
|
-
/* @__PURE__ */
|
|
5773
|
+
label && /* @__PURE__ */ jsx59("span", { children: copied ? "Copied" : label }),
|
|
5774
|
+
/* @__PURE__ */ jsx59("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
5641
5775
|
]
|
|
5642
5776
|
}
|
|
5643
5777
|
);
|
|
@@ -5646,7 +5780,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
5646
5780
|
|
|
5647
5781
|
// src/InlineMessage.tsx
|
|
5648
5782
|
import { AlertTriangle as AlertTriangle2, CheckCircle2, Info as Info3, X as X8, XCircle } from "lucide-react";
|
|
5649
|
-
import { jsx as
|
|
5783
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5650
5784
|
var BOX = {
|
|
5651
5785
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
5652
5786
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -5663,27 +5797,27 @@ var ICON_INK = {
|
|
|
5663
5797
|
var ICON2 = { info: Info3, success: CheckCircle2, warning: AlertTriangle2, danger: XCircle };
|
|
5664
5798
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5665
5799
|
const Icon = ICON2[tone];
|
|
5666
|
-
return /* @__PURE__ */
|
|
5800
|
+
return /* @__PURE__ */ jsxs52(
|
|
5667
5801
|
"div",
|
|
5668
5802
|
{
|
|
5669
5803
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
5670
5804
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
5671
5805
|
"data-testid": testIdPrefix,
|
|
5672
5806
|
children: [
|
|
5673
|
-
/* @__PURE__ */
|
|
5674
|
-
/* @__PURE__ */
|
|
5675
|
-
/* @__PURE__ */
|
|
5676
|
-
children && /* @__PURE__ */
|
|
5677
|
-
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 })
|
|
5678
5812
|
] }),
|
|
5679
|
-
onDismiss && /* @__PURE__ */
|
|
5813
|
+
onDismiss && /* @__PURE__ */ jsx60(
|
|
5680
5814
|
"button",
|
|
5681
5815
|
{
|
|
5682
5816
|
type: "button",
|
|
5683
5817
|
onClick: onDismiss,
|
|
5684
5818
|
"aria-label": "Dismiss",
|
|
5685
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",
|
|
5686
|
-
children: /* @__PURE__ */
|
|
5820
|
+
children: /* @__PURE__ */ jsx60(X8, { size: 14, "aria-hidden": "true" })
|
|
5687
5821
|
}
|
|
5688
5822
|
)
|
|
5689
5823
|
]
|
|
@@ -5692,9 +5826,9 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5692
5826
|
}
|
|
5693
5827
|
|
|
5694
5828
|
// src/FilterDrawer.tsx
|
|
5695
|
-
import { useEffect as
|
|
5829
|
+
import { useEffect as useEffect19, useLayoutEffect as useLayoutEffect6, useRef as useRef20, useState as useState20 } from "react";
|
|
5696
5830
|
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
5697
|
-
import { jsx as
|
|
5831
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5698
5832
|
var SLIDE_MS = 200;
|
|
5699
5833
|
function reducedMotion() {
|
|
5700
5834
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -5712,10 +5846,10 @@ function FilterDrawer({
|
|
|
5712
5846
|
size = "sm",
|
|
5713
5847
|
testIdPrefix
|
|
5714
5848
|
}) {
|
|
5715
|
-
const [view, setViewState] =
|
|
5716
|
-
const [leaving, setLeaving] =
|
|
5717
|
-
const [phase, setPhase] =
|
|
5718
|
-
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);
|
|
5719
5853
|
if (open !== wasOpen) {
|
|
5720
5854
|
setWasOpen(open);
|
|
5721
5855
|
if (open) {
|
|
@@ -5735,7 +5869,7 @@ function FilterDrawer({
|
|
|
5735
5869
|
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setPhase("run")));
|
|
5736
5870
|
return () => cancelAnimationFrame(raf);
|
|
5737
5871
|
}, [phase]);
|
|
5738
|
-
|
|
5872
|
+
useEffect19(() => {
|
|
5739
5873
|
if (!leaving || phase !== "run") return;
|
|
5740
5874
|
const t = setTimeout(() => setLeaving(null), SLIDE_MS);
|
|
5741
5875
|
return () => clearTimeout(t);
|
|
@@ -5743,7 +5877,7 @@ function FilterDrawer({
|
|
|
5743
5877
|
const backRef = useRef20(null);
|
|
5744
5878
|
const rowRefs = useRef20(/* @__PURE__ */ new Map());
|
|
5745
5879
|
const lastView = useRef20(null);
|
|
5746
|
-
|
|
5880
|
+
useEffect19(() => {
|
|
5747
5881
|
if (!open) return;
|
|
5748
5882
|
if (view) backRef.current?.focus();
|
|
5749
5883
|
else if (lastView.current) rowRefs.current.get(lastView.current)?.focus();
|
|
@@ -5756,8 +5890,8 @@ function FilterDrawer({
|
|
|
5756
5890
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5757
5891
|
const panel = (v, rows = true) => {
|
|
5758
5892
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5759
|
-
if (s) return /* @__PURE__ */
|
|
5760
|
-
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(
|
|
5761
5895
|
"button",
|
|
5762
5896
|
{
|
|
5763
5897
|
ref: rows ? (el) => {
|
|
@@ -5769,7 +5903,7 @@ function FilterDrawer({
|
|
|
5769
5903
|
"data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
|
|
5770
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",
|
|
5771
5905
|
children: [
|
|
5772
|
-
/* @__PURE__ */
|
|
5906
|
+
/* @__PURE__ */ jsx61(
|
|
5773
5907
|
x.icon,
|
|
5774
5908
|
{
|
|
5775
5909
|
size: 17,
|
|
@@ -5777,22 +5911,22 @@ function FilterDrawer({
|
|
|
5777
5911
|
className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
|
|
5778
5912
|
}
|
|
5779
5913
|
),
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
x.badge && /* @__PURE__ */
|
|
5782
|
-
/* @__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" })
|
|
5783
5917
|
]
|
|
5784
5918
|
}
|
|
5785
5919
|
) }, x.id)) });
|
|
5786
5920
|
};
|
|
5787
|
-
return /* @__PURE__ */
|
|
5921
|
+
return /* @__PURE__ */ jsx61(
|
|
5788
5922
|
Drawer,
|
|
5789
5923
|
{
|
|
5790
5924
|
open,
|
|
5791
5925
|
onClose,
|
|
5792
5926
|
size,
|
|
5793
5927
|
testIdPrefix,
|
|
5794
|
-
title: focused ? /* @__PURE__ */
|
|
5795
|
-
/* @__PURE__ */
|
|
5928
|
+
title: focused ? /* @__PURE__ */ jsxs53("span", { className: "flex items-center gap-1.5", children: [
|
|
5929
|
+
/* @__PURE__ */ jsx61(
|
|
5796
5930
|
"button",
|
|
5797
5931
|
{
|
|
5798
5932
|
ref: backRef,
|
|
@@ -5801,23 +5935,23 @@ function FilterDrawer({
|
|
|
5801
5935
|
"aria-label": "Back to all filters",
|
|
5802
5936
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5803
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",
|
|
5804
|
-
children: /* @__PURE__ */
|
|
5938
|
+
children: /* @__PURE__ */ jsx61(ChevronLeft5, { size: 18, "aria-hidden": "true" })
|
|
5805
5939
|
}
|
|
5806
5940
|
),
|
|
5807
5941
|
focused.label,
|
|
5808
|
-
focused.info && /* @__PURE__ */
|
|
5809
|
-
] }) : /* @__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: [
|
|
5810
5944
|
"Filters",
|
|
5811
|
-
activeCount > 0 && /* @__PURE__ */
|
|
5945
|
+
activeCount > 0 && /* @__PURE__ */ jsx61(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5812
5946
|
] }),
|
|
5813
5947
|
footer: focused ? (
|
|
5814
5948
|
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5815
|
-
/* @__PURE__ */
|
|
5816
|
-
) : /* @__PURE__ */
|
|
5817
|
-
/* @__PURE__ */
|
|
5818
|
-
/* @__PURE__ */
|
|
5819
|
-
/* @__PURE__ */
|
|
5820
|
-
/* @__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(
|
|
5821
5955
|
Button,
|
|
5822
5956
|
{
|
|
5823
5957
|
variant: "primary",
|
|
@@ -5831,8 +5965,8 @@ function FilterDrawer({
|
|
|
5831
5965
|
)
|
|
5832
5966
|
] })
|
|
5833
5967
|
] }),
|
|
5834
|
-
children: /* @__PURE__ */
|
|
5835
|
-
/* @__PURE__ */
|
|
5968
|
+
children: /* @__PURE__ */ jsxs53("div", { className: "relative -mx-5 overflow-x-clip", children: [
|
|
5969
|
+
/* @__PURE__ */ jsx61(
|
|
5836
5970
|
"div",
|
|
5837
5971
|
{
|
|
5838
5972
|
style: { transform: incoming },
|
|
@@ -5841,7 +5975,7 @@ function FilterDrawer({
|
|
|
5841
5975
|
},
|
|
5842
5976
|
view ?? "__list"
|
|
5843
5977
|
),
|
|
5844
|
-
leaving && /* @__PURE__ */
|
|
5978
|
+
leaving && /* @__PURE__ */ jsx61(
|
|
5845
5979
|
"div",
|
|
5846
5980
|
{
|
|
5847
5981
|
"aria-hidden": "true",
|
|
@@ -5859,9 +5993,9 @@ function FilterDrawer({
|
|
|
5859
5993
|
// src/AllFiltersButton.tsx
|
|
5860
5994
|
import { forwardRef as forwardRef13 } from "react";
|
|
5861
5995
|
import { SlidersHorizontal } from "lucide-react";
|
|
5862
|
-
import { jsx as
|
|
5996
|
+
import { jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5863
5997
|
var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5864
|
-
return /* @__PURE__ */
|
|
5998
|
+
return /* @__PURE__ */ jsxs54(
|
|
5865
5999
|
"button",
|
|
5866
6000
|
{
|
|
5867
6001
|
ref,
|
|
@@ -5873,9 +6007,9 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5873
6007
|
className: cn(chipTriggerClass(), className),
|
|
5874
6008
|
...rest,
|
|
5875
6009
|
children: [
|
|
5876
|
-
/* @__PURE__ */
|
|
5877
|
-
/* @__PURE__ */
|
|
5878
|
-
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 })
|
|
5879
6013
|
]
|
|
5880
6014
|
}
|
|
5881
6015
|
);
|
|
@@ -5885,7 +6019,7 @@ var AllFiltersButton = forwardRef13(function AllFiltersButton2({ count = 0, open
|
|
|
5885
6019
|
import { forwardRef as forwardRef14 } from "react";
|
|
5886
6020
|
import { Slot as Slot2, Slottable } from "@radix-ui/react-slot";
|
|
5887
6021
|
import { Check as Check11, ChevronRight as ChevronRight8 } from "lucide-react";
|
|
5888
|
-
import { Fragment as Fragment8, jsx as
|
|
6022
|
+
import { Fragment as Fragment8, jsx as jsx63, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5889
6023
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5890
6024
|
function moveFocus(e) {
|
|
5891
6025
|
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -5898,7 +6032,7 @@ function moveFocus(e) {
|
|
|
5898
6032
|
rows[next].focus();
|
|
5899
6033
|
}
|
|
5900
6034
|
var Menu = forwardRef14(
|
|
5901
|
-
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */
|
|
6035
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
5902
6036
|
"div",
|
|
5903
6037
|
{
|
|
5904
6038
|
ref,
|
|
@@ -5919,20 +6053,20 @@ var MenuItem = forwardRef14(
|
|
|
5919
6053
|
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5920
6054
|
const Comp = asChild ? Slot2 : "button";
|
|
5921
6055
|
const radio = checked !== void 0;
|
|
5922
|
-
const body = /* @__PURE__ */
|
|
5923
|
-
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 }),
|
|
5924
6058
|
asChild ? (
|
|
5925
6059
|
// The link's own text lands here; the link becomes the row.
|
|
5926
|
-
/* @__PURE__ */
|
|
5927
|
-
) : /* @__PURE__ */
|
|
5928
|
-
/* @__PURE__ */
|
|
5929
|
-
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 })
|
|
5930
6064
|
] }),
|
|
5931
|
-
trailing && /* @__PURE__ */
|
|
5932
|
-
radio && checked && /* @__PURE__ */
|
|
5933
|
-
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" })
|
|
5934
6068
|
] });
|
|
5935
|
-
return /* @__PURE__ */
|
|
6069
|
+
return /* @__PURE__ */ jsx63(
|
|
5936
6070
|
Comp,
|
|
5937
6071
|
{
|
|
5938
6072
|
ref,
|
|
@@ -5959,7 +6093,7 @@ var MenuItem = forwardRef14(
|
|
|
5959
6093
|
);
|
|
5960
6094
|
MenuItem.displayName = "MenuItem";
|
|
5961
6095
|
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5962
|
-
return /* @__PURE__ */
|
|
6096
|
+
return /* @__PURE__ */ jsx63(
|
|
5963
6097
|
"div",
|
|
5964
6098
|
{
|
|
5965
6099
|
role: "presentation",
|
|
@@ -5970,7 +6104,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
|
|
|
5970
6104
|
);
|
|
5971
6105
|
}
|
|
5972
6106
|
function MenuSeparator({ className, testIdPrefix }) {
|
|
5973
|
-
return /* @__PURE__ */
|
|
6107
|
+
return /* @__PURE__ */ jsx63("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5974
6108
|
}
|
|
5975
6109
|
|
|
5976
6110
|
// src/dates.ts
|
|
@@ -6084,15 +6218,15 @@ function defaultDateOrder(country) {
|
|
|
6084
6218
|
}
|
|
6085
6219
|
|
|
6086
6220
|
// src/Figure.tsx
|
|
6087
|
-
import { Fragment as Fragment9, jsx as
|
|
6221
|
+
import { Fragment as Fragment9, jsx as jsx64, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6088
6222
|
function Figure({ value, kind = "money", missing, ...opts }) {
|
|
6089
|
-
if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */
|
|
6223
|
+
if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */ jsx64(NoValue, { reason: missing });
|
|
6090
6224
|
const short = kind === "money" ? formatMoney(value, opts) : formatCount(value, opts);
|
|
6091
6225
|
const full = kind === "money" ? formatMoneyFull(value, opts) : formatCountFull(value);
|
|
6092
|
-
if (short === full) return /* @__PURE__ */
|
|
6093
|
-
return /* @__PURE__ */
|
|
6094
|
-
/* @__PURE__ */
|
|
6095
|
-
/* @__PURE__ */
|
|
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 })
|
|
6096
6230
|
] });
|
|
6097
6231
|
}
|
|
6098
6232
|
export {
|
|
@@ -6107,6 +6241,7 @@ export {
|
|
|
6107
6241
|
Button,
|
|
6108
6242
|
Card,
|
|
6109
6243
|
ChartLegend,
|
|
6244
|
+
ChartSkeleton,
|
|
6110
6245
|
CheckBox,
|
|
6111
6246
|
CheckBoxBox,
|
|
6112
6247
|
ChipContent,
|
|
@@ -6128,6 +6263,8 @@ export {
|
|
|
6128
6263
|
InlineMessage,
|
|
6129
6264
|
LegendItem,
|
|
6130
6265
|
LineChartPlaceholder,
|
|
6266
|
+
LoadError,
|
|
6267
|
+
LongWait,
|
|
6131
6268
|
MediaLabel,
|
|
6132
6269
|
Menu,
|
|
6133
6270
|
MenuItem,
|
|
@@ -6148,6 +6285,7 @@ export {
|
|
|
6148
6285
|
PrimaryBadge,
|
|
6149
6286
|
PublisherBreakdownList,
|
|
6150
6287
|
QUIET_ACTION_CLASS,
|
|
6288
|
+
RefreshLine,
|
|
6151
6289
|
SearchBar,
|
|
6152
6290
|
SectionHeading,
|
|
6153
6291
|
SectionRail,
|
|
@@ -6156,9 +6294,12 @@ export {
|
|
|
6156
6294
|
SelectFilter,
|
|
6157
6295
|
SelectedSection,
|
|
6158
6296
|
SelectionPicker,
|
|
6297
|
+
Skeleton,
|
|
6298
|
+
SkeletonLines,
|
|
6159
6299
|
SortButton,
|
|
6160
6300
|
StackedColumnPlaceholder,
|
|
6161
6301
|
StatStrip,
|
|
6302
|
+
StatStripSkeleton,
|
|
6162
6303
|
StatTile,
|
|
6163
6304
|
SuggestionChip,
|
|
6164
6305
|
TableLink,
|
|
@@ -6195,6 +6336,7 @@ export {
|
|
|
6195
6336
|
formatWeek,
|
|
6196
6337
|
noResultsBody,
|
|
6197
6338
|
resolveRange,
|
|
6198
|
-
sortProp
|
|
6339
|
+
sortProp,
|
|
6340
|
+
useDelayedLoading
|
|
6199
6341
|
};
|
|
6200
6342
|
//# sourceMappingURL=index.js.map
|