@mediaradar/design-components 0.50.0 → 0.53.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 +2 -1
- package/dist/index.cjs +206 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +158 -27
- package/dist/index.d.ts +158 -27
- package/dist/index.js +202 -87
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ function InfoTip({ text, size = 11, label = "More information", trigger = "click
|
|
|
88
88
|
"data-testid": testIdPrefix,
|
|
89
89
|
...hoverProps,
|
|
90
90
|
className: cn(
|
|
91
|
-
"inline-flex cursor-pointer items-center text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
91
|
+
"inline-flex cursor-pointer items-center text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
92
92
|
className
|
|
93
93
|
),
|
|
94
94
|
children: /* @__PURE__ */ jsx(Info, { size, "aria-hidden": "true" })
|
|
@@ -134,7 +134,7 @@ function AdvertiserSearchPrompt({ label = "an advertiser name", className, testI
|
|
|
134
134
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
135
135
|
function chipTriggerClass(_variant = "box") {
|
|
136
136
|
return cn(
|
|
137
|
-
"flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
|
|
137
|
+
"flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus"
|
|
138
138
|
// One stroke for every trigger: a `box` chip on the lighter default
|
|
139
139
|
// border sat beside SelectFilter's darker one in the same row and read as
|
|
140
140
|
// a different kind of control. The variant no longer changes anything.
|
|
@@ -224,6 +224,12 @@ function AdvertiserQuickFilter({
|
|
|
224
224
|
setOpen(false);
|
|
225
225
|
setQ("");
|
|
226
226
|
};
|
|
227
|
+
const clearAll = () => {
|
|
228
|
+
setDraft(clearValue);
|
|
229
|
+
onChange(clearValue);
|
|
230
|
+
setOpen(false);
|
|
231
|
+
setQ("");
|
|
232
|
+
};
|
|
227
233
|
useEffect2(() => {
|
|
228
234
|
if (!open) return;
|
|
229
235
|
inputRef.current?.focus();
|
|
@@ -301,7 +307,7 @@ function AdvertiserQuickFilter({
|
|
|
301
307
|
"div",
|
|
302
308
|
{
|
|
303
309
|
className: cn(
|
|
304
|
-
"absolute top-
|
|
310
|
+
"absolute top-full mt-2 z-30 flex w-72 flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
|
|
305
311
|
align === "right" ? "right-0" : "left-0"
|
|
306
312
|
),
|
|
307
313
|
role: "dialog",
|
|
@@ -330,12 +336,12 @@ function AdvertiserQuickFilter({
|
|
|
330
336
|
type: "button",
|
|
331
337
|
onClick: clearSearch,
|
|
332
338
|
"aria-label": "Clear search",
|
|
333
|
-
className: "shrink-0 text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-
|
|
339
|
+
className: "shrink-0 text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
334
340
|
children: /* @__PURE__ */ jsx4(X, { size: 13 })
|
|
335
341
|
}
|
|
336
342
|
)
|
|
337
343
|
] }) }),
|
|
338
|
-
/* @__PURE__ */ jsxs4("div", { className: "max-h-
|
|
344
|
+
/* @__PURE__ */ jsxs4("div", { className: "max-h-75 overflow-y-auto p-1", children: [
|
|
339
345
|
selectedOptions.length > 0 && /* @__PURE__ */ jsxs4("div", { className: "mb-1 border-b border-border-default pb-1", children: [
|
|
340
346
|
/* @__PURE__ */ jsxs4(
|
|
341
347
|
"button",
|
|
@@ -412,7 +418,7 @@ function AdvertiserQuickFilter({
|
|
|
412
418
|
type: "button",
|
|
413
419
|
"data-testid": testIdPrefix && `${testIdPrefix}-show-more`,
|
|
414
420
|
onClick: loadMore,
|
|
415
|
-
className: "flex w-full items-center gap-1.5 rounded-control px-2 py-2 text-left text-xs font-semibold text-text-link transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
421
|
+
className: "flex w-full items-center gap-1.5 rounded-control px-2 py-2 text-left text-xs font-semibold text-text-link transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
416
422
|
children: [
|
|
417
423
|
/* @__PURE__ */ jsx4(Plus, { size: 13, "aria-hidden": "true" }),
|
|
418
424
|
"Show ",
|
|
@@ -429,9 +435,9 @@ function AdvertiserQuickFilter({
|
|
|
429
435
|
{
|
|
430
436
|
type: "button",
|
|
431
437
|
"data-testid": testIdPrefix && `${testIdPrefix}-clear-all`,
|
|
432
|
-
onClick:
|
|
438
|
+
onClick: clearAll,
|
|
433
439
|
disabled: draft.length === 0,
|
|
434
|
-
className: "text-dense font-medium text-text-secondary transition-colors hover:text-text-primary disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-
|
|
440
|
+
className: "text-dense font-medium text-text-secondary transition-colors hover:text-text-primary disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
435
441
|
children: "Clear all"
|
|
436
442
|
}
|
|
437
443
|
),
|
|
@@ -441,7 +447,7 @@ function AdvertiserQuickFilter({
|
|
|
441
447
|
type: "button",
|
|
442
448
|
"data-testid": testIdPrefix && `${testIdPrefix}-apply`,
|
|
443
449
|
onClick: apply,
|
|
444
|
-
className: "rounded-control bg-brand-primaryAction px-5 py-2 text-dense font-semibold text-brand-onprimary transition hover:brightness-110 focus-visible:outline-2 focus-visible:outline-offset-
|
|
450
|
+
className: "rounded-control bg-brand-primaryAction px-5 py-2 text-dense font-semibold text-brand-onprimary transition hover:brightness-110 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
445
451
|
children: "Apply"
|
|
446
452
|
}
|
|
447
453
|
)
|
|
@@ -455,7 +461,7 @@ function AdvertiserQuickFilter({
|
|
|
455
461
|
{
|
|
456
462
|
type: "button",
|
|
457
463
|
onClick: () => setDraft([]),
|
|
458
|
-
className: "text-xs font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
464
|
+
className: "text-xs font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
459
465
|
children: clearLabel
|
|
460
466
|
}
|
|
461
467
|
)
|
|
@@ -490,8 +496,10 @@ function OptionRow({
|
|
|
490
496
|
onToggle();
|
|
491
497
|
},
|
|
492
498
|
className: cn(
|
|
493
|
-
|
|
494
|
-
|
|
499
|
+
// scroll-my-1: Tab scrolls the list just far enough to show the box,
|
|
500
|
+
// which would leave its 3px ring cut off at the list's edge.
|
|
501
|
+
"flex h-4.5 w-4.5 shrink-0 scroll-my-1 items-center justify-center rounded-small border transition-colors",
|
|
502
|
+
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
495
503
|
checked ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-surface hover:border-brand-primaryAction"
|
|
496
504
|
),
|
|
497
505
|
children: checked && /* @__PURE__ */ jsx4(Check, { size: 13, strokeWidth: 3 })
|
|
@@ -552,7 +560,7 @@ var KIND = {
|
|
|
552
560
|
// Square-ish and centred, with a floor width so a 1-digit and a 3-digit
|
|
553
561
|
// count are the same shape, and lining figures so the width does not shift
|
|
554
562
|
// as the number changes.
|
|
555
|
-
count: "h-
|
|
563
|
+
count: "h-4.5 min-w-4.5 justify-center px-1.5 tabular-nums",
|
|
556
564
|
// The only kind that shouts. Caps need the letterspacing -- caps set tight
|
|
557
565
|
// are harder to read than the sentence case they replaced.
|
|
558
566
|
eyebrow: "px-2.5 py-1 uppercase tracking-wider",
|
|
@@ -646,7 +654,7 @@ var CheckBox = forwardRef(function CheckBox2({ checked, indeterminate, onChange,
|
|
|
646
654
|
},
|
|
647
655
|
className: cn(
|
|
648
656
|
boxClass(on, disabled),
|
|
649
|
-
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
657
|
+
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
650
658
|
!on && "hover:border-brand-primaryAction",
|
|
651
659
|
// Cancels the unchecked hover-border preview when disabled -- without
|
|
652
660
|
// this, a disabled box still visually previews the "you can click
|
|
@@ -996,7 +1004,7 @@ function DateRangeFilter({
|
|
|
996
1004
|
{
|
|
997
1005
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
998
1006
|
ref: popRef,
|
|
999
|
-
className: `absolute z-30 flex overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay ${placement === "right" ? "bottom-0 left-full ml-2" : `${above ? "bottom-full mb-2" : "top-
|
|
1007
|
+
className: `absolute z-30 flex overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay ${placement === "right" ? "bottom-0 left-full ml-2" : `${above ? "bottom-full mb-2" : "top-full mt-2"} ${align === "right" ? "right-0" : "left-0"}`}`,
|
|
1000
1008
|
role: "dialog",
|
|
1001
1009
|
"aria-label": "Select date range",
|
|
1002
1010
|
children: [
|
|
@@ -1021,7 +1029,7 @@ function DateRangeFilter({
|
|
|
1021
1029
|
/* @__PURE__ */ jsx8("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
|
|
1022
1030
|
const m = addMonths(leftMonth, offset);
|
|
1023
1031
|
const grid = monthGrid(m.getFullYear(), m.getMonth());
|
|
1024
|
-
return /* @__PURE__ */ jsxs7("div", { className: "w-
|
|
1032
|
+
return /* @__PURE__ */ jsxs7("div", { className: "w-63", children: [
|
|
1025
1033
|
/* @__PURE__ */ jsxs7("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1026
1034
|
offset === 0 ? /* @__PURE__ */ jsx8(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ jsx8(ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ jsx8("span", { className: "h-7 w-7" }),
|
|
1027
1035
|
/* @__PURE__ */ jsxs7("span", { id: `${monthIdBase}-m${offset}`, "aria-live": "polite", className: "text-panel-title font-semibold text-text-primary", children: [
|
|
@@ -1056,7 +1064,7 @@ function DateRangeFilter({
|
|
|
1056
1064
|
"aria-pressed": endpoint || inRange,
|
|
1057
1065
|
className: "relative flex h-9 items-center justify-center focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
1058
1066
|
children: [
|
|
1059
|
-
band && /* @__PURE__ */ jsx8("span", { className: `absolute inset-y-
|
|
1067
|
+
band && /* @__PURE__ */ jsx8("span", { className: `absolute inset-y-1 bg-ai-tint ${band}`, "aria-hidden": "true" }),
|
|
1060
1068
|
/* @__PURE__ */ jsx8(
|
|
1061
1069
|
"span",
|
|
1062
1070
|
{
|
|
@@ -1106,8 +1114,8 @@ function DateRangeFilter({
|
|
|
1106
1114
|
/* @__PURE__ */ jsx8("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => {
|
|
1107
1115
|
setOpen(false);
|
|
1108
1116
|
triggerRef.current?.focus();
|
|
1109
|
-
}, className: "rounded-control border border-border-default bg-surface px-5 py-2 text-dense font-semibold text-text-primary transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-
|
|
1110
|
-
/* @__PURE__ */ jsx8("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, disabled: !canApply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-dense font-semibold text-brand-onprimary transition-[filter] hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-
|
|
1117
|
+
}, className: "rounded-control border border-border-default bg-surface px-5 py-2 text-dense font-semibold text-text-primary transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Cancel" }),
|
|
1118
|
+
/* @__PURE__ */ jsx8("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, disabled: !canApply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-dense font-semibold text-brand-onprimary transition-[filter] hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Apply" })
|
|
1111
1119
|
] })
|
|
1112
1120
|
] })
|
|
1113
1121
|
]
|
|
@@ -1118,11 +1126,11 @@ function DateRangeFilter({
|
|
|
1118
1126
|
function Field({ label, value }) {
|
|
1119
1127
|
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1.5", children: [
|
|
1120
1128
|
/* @__PURE__ */ jsx8("span", { className: "text-xs font-medium text-text-secondary", children: label }),
|
|
1121
|
-
/* @__PURE__ */ jsx8("div", { className: "flex h-10 min-w-
|
|
1129
|
+
/* @__PURE__ */ jsx8("div", { className: "flex h-10 min-w-35 items-center rounded-control border border-border-strong bg-input px-3 text-sm font-medium text-text-primary", children: value })
|
|
1122
1130
|
] });
|
|
1123
1131
|
}
|
|
1124
1132
|
function NavBtn({ children, onClick, ...rest }) {
|
|
1125
|
-
return /* @__PURE__ */ jsx8("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-
|
|
1133
|
+
return /* @__PURE__ */ jsx8("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", ...rest, children });
|
|
1126
1134
|
}
|
|
1127
1135
|
|
|
1128
1136
|
// src/SearchBar.tsx
|
|
@@ -1237,7 +1245,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1237
1245
|
// flex-auto, not flex-1: flex-1's 0% basis took the height away in a
|
|
1238
1246
|
// column (a filter panel's stack), squashing the sm box from 32px to
|
|
1239
1247
|
// its text's 22px. auto keeps the h-8/10/11 and still fills a row.
|
|
1240
|
-
"relative flex min-w-
|
|
1248
|
+
"relative flex min-w-50 flex-auto items-stretch rounded-control border border-border-strong bg-input focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus",
|
|
1241
1249
|
HEIGHT[size],
|
|
1242
1250
|
className
|
|
1243
1251
|
),
|
|
@@ -1273,7 +1281,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1273
1281
|
"aria-expanded": codesOpen,
|
|
1274
1282
|
"aria-haspopup": "dialog",
|
|
1275
1283
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes`,
|
|
1276
|
-
className: "inline-flex items-center gap-1 rounded-control focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1284
|
+
className: "inline-flex items-center gap-1 rounded-control focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1277
1285
|
children: [
|
|
1278
1286
|
hasMisses && /* @__PURE__ */ jsx9(AlertCircle, { size: 13, "aria-hidden": "true" }),
|
|
1279
1287
|
hasMisses ? `${matchedCount} of ${adCodes.length} matched` : adCodes.length === 1 ? adCodes[0] : `${adCodes.length} Ad Codes`
|
|
@@ -1287,7 +1295,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1287
1295
|
"aria-label": "Clear all ad codes",
|
|
1288
1296
|
onClick: () => updateCodes([], -1),
|
|
1289
1297
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-clear`,
|
|
1290
|
-
className: "inline-flex rounded-full p-0.5 hover:bg-surface focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1298
|
+
className: "inline-flex rounded-full p-0.5 hover:bg-surface focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1291
1299
|
children: /* @__PURE__ */ jsx9(X2, { size: 12, "aria-hidden": "true" })
|
|
1292
1300
|
}
|
|
1293
1301
|
)
|
|
@@ -1345,7 +1353,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1345
1353
|
"aria-label": `Remove ${code}`,
|
|
1346
1354
|
onClick: () => updateCodes(adCodes.filter((c) => c !== code), i),
|
|
1347
1355
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-code-remove-${slug3(code)}`,
|
|
1348
|
-
className: "inline-flex rounded-full p-0.5 hover:bg-surface focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1356
|
+
className: "inline-flex rounded-full p-0.5 hover:bg-surface focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1349
1357
|
children: /* @__PURE__ */ jsx9(X2, { size: 13, "aria-hidden": "true" })
|
|
1350
1358
|
}
|
|
1351
1359
|
)
|
|
@@ -1363,7 +1371,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1363
1371
|
input.current?.focus();
|
|
1364
1372
|
},
|
|
1365
1373
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-done`,
|
|
1366
|
-
className: "rounded-control bg-brand-primaryAction px-4 py-2 text-dense font-semibold text-brand-onprimary transition hover:brightness-110 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-
|
|
1374
|
+
className: "rounded-control bg-brand-primaryAction px-4 py-2 text-dense font-semibold text-brand-onprimary transition hover:brightness-110 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1367
1375
|
children: "Search"
|
|
1368
1376
|
}
|
|
1369
1377
|
) }),
|
|
@@ -1377,7 +1385,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1377
1385
|
type: "button",
|
|
1378
1386
|
onClick: () => onDownloadAdCodes(adCodes),
|
|
1379
1387
|
"data-testid": testIdPrefix && `${testIdPrefix}-ad-codes-download`,
|
|
1380
|
-
className: "font-medium text-text-link underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1388
|
+
className: "font-medium text-text-link underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1381
1389
|
children: "Download"
|
|
1382
1390
|
}
|
|
1383
1391
|
),
|
|
@@ -1401,7 +1409,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1401
1409
|
},
|
|
1402
1410
|
"aria-label": "Clear search",
|
|
1403
1411
|
"data-testid": testIdPrefix && `${testIdPrefix}-clear`,
|
|
1404
|
-
className: "mr-1.5 flex size-6 shrink-0 items-center justify-center self-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1412
|
+
className: "mr-1.5 flex size-6 shrink-0 items-center justify-center self-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1405
1413
|
children: /* @__PURE__ */ jsx9(X2, { size: 14, "aria-hidden": "true" })
|
|
1406
1414
|
}
|
|
1407
1415
|
),
|
|
@@ -1445,7 +1453,7 @@ var SearchBar = forwardRef2(function SearchBar2({
|
|
|
1445
1453
|
role: "dialog",
|
|
1446
1454
|
"aria-label": "Search match type",
|
|
1447
1455
|
"data-testid": testIdPrefix && `${testIdPrefix}-mode-popover`,
|
|
1448
|
-
className: "absolute right-0 top-
|
|
1456
|
+
className: "absolute right-0 top-full mt-2 z-50 w-100 rounded-card border border-border-default bg-surface p-3 shadow-overlay",
|
|
1449
1457
|
children: /* @__PURE__ */ jsxs8("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
|
|
1450
1458
|
/* @__PURE__ */ jsx9(
|
|
1451
1459
|
ModeRow,
|
|
@@ -1559,7 +1567,7 @@ function ModeRow({
|
|
|
1559
1567
|
e.stopPropagation();
|
|
1560
1568
|
onSelect();
|
|
1561
1569
|
},
|
|
1562
|
-
className: "rounded-control text-left text-sm font-semibold text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1570
|
+
className: "rounded-control text-left text-sm font-semibold text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1563
1571
|
children: title
|
|
1564
1572
|
}
|
|
1565
1573
|
),
|
|
@@ -1633,7 +1641,7 @@ function RowInfoTip({ text }) {
|
|
|
1633
1641
|
"aria-label": "More information",
|
|
1634
1642
|
"aria-expanded": open,
|
|
1635
1643
|
"aria-describedby": id,
|
|
1636
|
-
className: "-m-1.5 inline-flex size-6 items-center justify-center rounded-control text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1644
|
+
className: "-m-1.5 inline-flex size-6 items-center justify-center rounded-control text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1637
1645
|
children: /* @__PURE__ */ jsx9(AlertCircle, { size: 13, "aria-hidden": "true" })
|
|
1638
1646
|
}
|
|
1639
1647
|
),
|
|
@@ -1642,7 +1650,7 @@ function RowInfoTip({ text }) {
|
|
|
1642
1650
|
{
|
|
1643
1651
|
id,
|
|
1644
1652
|
hidden: !open,
|
|
1645
|
-
className: "absolute left-0 top-
|
|
1653
|
+
className: "absolute left-0 top-full mt-1.5 z-40 w-55 rounded-control border border-border-default bg-surface px-2.5 py-1.5 text-xs font-normal leading-snug text-text-secondary shadow-overlay",
|
|
1646
1654
|
children: text
|
|
1647
1655
|
}
|
|
1648
1656
|
)
|
|
@@ -1800,7 +1808,7 @@ function SectionRail({
|
|
|
1800
1808
|
"a",
|
|
1801
1809
|
{
|
|
1802
1810
|
href: viewAllHref,
|
|
1803
|
-
className: "text-sm font-medium text-text-link transition-colors hover:underline focus-visible:rounded-sm focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1811
|
+
className: "text-sm font-medium text-text-link transition-colors hover:underline focus-visible:rounded-sm focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1804
1812
|
children: [
|
|
1805
1813
|
viewAllLabel,
|
|
1806
1814
|
" \u2192"
|
|
@@ -1813,7 +1821,7 @@ function SectionRail({
|
|
|
1813
1821
|
type: "button",
|
|
1814
1822
|
onClick: () => scroll(-1),
|
|
1815
1823
|
"aria-label": "Previous",
|
|
1816
|
-
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-
|
|
1824
|
+
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus sm:flex lg:hidden",
|
|
1817
1825
|
children: /* @__PURE__ */ jsx10(ChevronLeft2, { size: 16 })
|
|
1818
1826
|
}
|
|
1819
1827
|
),
|
|
@@ -1823,7 +1831,7 @@ function SectionRail({
|
|
|
1823
1831
|
type: "button",
|
|
1824
1832
|
onClick: () => scroll(1),
|
|
1825
1833
|
"aria-label": "Next",
|
|
1826
|
-
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-
|
|
1834
|
+
className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus sm:flex lg:hidden",
|
|
1827
1835
|
children: /* @__PURE__ */ jsx10(ChevronRight2, { size: 16 })
|
|
1828
1836
|
}
|
|
1829
1837
|
)
|
|
@@ -1895,7 +1903,7 @@ function DataScopeFilter({ value, onChange, align = "right", className, testIdPr
|
|
|
1895
1903
|
"aria-label": "Data",
|
|
1896
1904
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
1897
1905
|
className: cn(
|
|
1898
|
-
"absolute top-
|
|
1906
|
+
"absolute top-full mt-2 z-30 min-w-55 overflow-hidden rounded-card border border-border-default bg-surface p-1 shadow-overlay",
|
|
1899
1907
|
align === "right" ? "right-0" : "left-0"
|
|
1900
1908
|
),
|
|
1901
1909
|
children: [
|
|
@@ -1955,7 +1963,7 @@ function MenuError({ onRetry }) {
|
|
|
1955
1963
|
{
|
|
1956
1964
|
type: "button",
|
|
1957
1965
|
onClick: onRetry,
|
|
1958
|
-
className: "mt-1.5 block w-full font-medium text-text-link hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
1966
|
+
className: "mt-1.5 block w-full font-medium text-text-link hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
1959
1967
|
children: "Try again"
|
|
1960
1968
|
}
|
|
1961
1969
|
)
|
|
@@ -2058,7 +2066,7 @@ function SelectFilter({
|
|
|
2058
2066
|
"aria-label": sm && !inlineCaption ? caption : void 0,
|
|
2059
2067
|
disabled,
|
|
2060
2068
|
className: cn(
|
|
2061
|
-
sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus" : chipTriggerClass(),
|
|
2069
|
+
sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus" : chipTriggerClass(),
|
|
2062
2070
|
"disabled:pointer-events-none disabled:opacity-40",
|
|
2063
2071
|
fullWidth && "w-full justify-between",
|
|
2064
2072
|
className
|
|
@@ -2089,7 +2097,7 @@ function SelectFilter({
|
|
|
2089
2097
|
),
|
|
2090
2098
|
role: loading || error ? "group" : "listbox",
|
|
2091
2099
|
"aria-label": caption,
|
|
2092
|
-
children: loading ? /* @__PURE__ */ jsx13(MenuLoading, {}) : error ? /* @__PURE__ */ jsx13(MenuError, { onRetry }) : /* @__PURE__ */ jsx13("div", { className: "max-h-
|
|
2100
|
+
children: loading ? /* @__PURE__ */ jsx13(MenuLoading, {}) : error ? /* @__PURE__ */ jsx13(MenuError, { onRetry }) : /* @__PURE__ */ jsx13("div", { className: "max-h-70 overflow-y-auto p-1", children: options.map((o) => {
|
|
2093
2101
|
const selected = o === value;
|
|
2094
2102
|
return /* @__PURE__ */ jsxs12(
|
|
2095
2103
|
"button",
|
|
@@ -2163,8 +2171,8 @@ var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other,
|
|
|
2163
2171
|
function noResultsBody(workspaceName) {
|
|
2164
2172
|
return workspaceName ? `Nothing in the \u201C${workspaceName}\u201D workspace matches. ${NO_RESULTS_BODY}` : NO_RESULTS_BODY;
|
|
2165
2173
|
}
|
|
2166
|
-
var PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-
|
|
2167
|
-
var QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-text-link transition-colors hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus";
|
|
2174
|
+
var PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus";
|
|
2175
|
+
var QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-text-link transition-colors hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus";
|
|
2168
2176
|
function NoResultsEmptyState({
|
|
2169
2177
|
title = NO_RESULTS_TITLE,
|
|
2170
2178
|
body,
|
|
@@ -2183,7 +2191,7 @@ function NoResultsEmptyState({
|
|
|
2183
2191
|
return /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
|
|
2184
2192
|
/* @__PURE__ */ jsx15("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ jsx15(FilterX, { size: 20, "aria-hidden": "true" }) }),
|
|
2185
2193
|
/* @__PURE__ */ jsx15("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
2186
|
-
/* @__PURE__ */ jsx15("p", { className: "max-w-
|
|
2194
|
+
/* @__PURE__ */ jsx15("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
|
|
2187
2195
|
hasActions && /* @__PURE__ */ jsxs14("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
|
|
2188
2196
|
showClear && /* @__PURE__ */ jsx15(
|
|
2189
2197
|
"button",
|
|
@@ -2259,7 +2267,7 @@ function SummaryGroupItem({
|
|
|
2259
2267
|
onClick: () => setOpen((v) => !v),
|
|
2260
2268
|
"aria-expanded": open,
|
|
2261
2269
|
"data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
|
|
2262
|
-
className: "flex w-full min-w-0 items-center gap-2 text-left focus-visible:outline-2 focus-visible:outline-offset-
|
|
2270
|
+
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",
|
|
2263
2271
|
children: [
|
|
2264
2272
|
/* @__PURE__ */ jsx16(
|
|
2265
2273
|
ChevronDown6,
|
|
@@ -2291,7 +2299,7 @@ function SummaryGroupItem({
|
|
|
2291
2299
|
type: "button",
|
|
2292
2300
|
"aria-label": `Remove ${item.name}`,
|
|
2293
2301
|
onClick: () => group.onRemove(item.id),
|
|
2294
|
-
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-
|
|
2302
|
+
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",
|
|
2295
2303
|
children: /* @__PURE__ */ jsx16(X3, { size: 12, "aria-hidden": "true" })
|
|
2296
2304
|
}
|
|
2297
2305
|
)
|
|
@@ -2305,7 +2313,7 @@ function SummaryGroupItem({
|
|
|
2305
2313
|
type: "button",
|
|
2306
2314
|
onClick: group.onRemoveAll,
|
|
2307
2315
|
"data-testid": testIdPrefix && `${testIdPrefix}-remove-all-${group.id}`,
|
|
2308
|
-
className: "mt-0.5 self-start text-micro font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
2316
|
+
className: "mt-0.5 self-start text-micro font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
2309
2317
|
children: "Remove all"
|
|
2310
2318
|
}
|
|
2311
2319
|
)
|
|
@@ -2355,7 +2363,7 @@ function AxisFrame({
|
|
|
2355
2363
|
{
|
|
2356
2364
|
className: "absolute bottom-0 right-0 flex items-center",
|
|
2357
2365
|
style: { left: Y_AXIS_W, height: X_AXIS_H },
|
|
2358
|
-
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ jsx17("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx17("div", { className: "h-2 w-full max-w-
|
|
2366
|
+
children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ jsx17("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx17("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
|
|
2359
2367
|
}
|
|
2360
2368
|
)
|
|
2361
2369
|
] }) });
|
|
@@ -2859,7 +2867,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
|
|
|
2859
2867
|
disabled: item.disabled,
|
|
2860
2868
|
onClick: () => onChange(item.value),
|
|
2861
2869
|
className: cn(
|
|
2862
|
-
"-mb-px flex items-center gap-1.5 border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-
|
|
2870
|
+
"-mb-px flex items-center gap-1.5 border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus disabled:opacity-50",
|
|
2863
2871
|
on ? "border-brand-primaryAction font-semibold text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"
|
|
2864
2872
|
),
|
|
2865
2873
|
children: [
|
|
@@ -3134,7 +3142,7 @@ function SelectionPicker({
|
|
|
3134
3142
|
return n;
|
|
3135
3143
|
});
|
|
3136
3144
|
},
|
|
3137
|
-
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-
|
|
3145
|
+
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",
|
|
3138
3146
|
children: /* @__PURE__ */ jsx27(ChevronRight3, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
|
|
3139
3147
|
}
|
|
3140
3148
|
) : /* @__PURE__ */ jsx27(
|
|
@@ -3163,7 +3171,7 @@ function SelectionPicker({
|
|
|
3163
3171
|
disabled: kidSel,
|
|
3164
3172
|
onClick: () => addRows([kid]),
|
|
3165
3173
|
className: cn(
|
|
3166
|
-
"inline-flex items-center gap-1 rounded-control px-2 py-1 text-xs font-medium focus-visible:outline-2 focus-visible:outline-offset-
|
|
3174
|
+
"inline-flex items-center gap-1 rounded-control px-2 py-1 text-xs font-medium focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3167
3175
|
kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
|
|
3168
3176
|
),
|
|
3169
3177
|
children: [
|
|
@@ -3208,7 +3216,7 @@ function SelectionPicker({
|
|
|
3208
3216
|
"aria-pressed": on,
|
|
3209
3217
|
"data-testid": testIdPrefix && `${testIdPrefix}-list-${list.id}`,
|
|
3210
3218
|
className: cn(
|
|
3211
|
-
"flex items-center gap-3 rounded-control border px-3.5 py-3 text-left transition-colors focus-visible:outline-2 focus-visible:outline-offset-
|
|
3219
|
+
"flex items-center gap-3 rounded-control border px-3.5 py-3 text-left transition-colors focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3212
3220
|
on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
|
|
3213
3221
|
),
|
|
3214
3222
|
children: [
|
|
@@ -3345,7 +3353,7 @@ function FilterDropdown({
|
|
|
3345
3353
|
onClick: () => setOpen((v) => !v),
|
|
3346
3354
|
"aria-expanded": open,
|
|
3347
3355
|
"data-testid": testIdPrefix && `${testIdPrefix}-filter-${filterSlug}`,
|
|
3348
|
-
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-
|
|
3356
|
+
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",
|
|
3349
3357
|
children: [
|
|
3350
3358
|
label,
|
|
3351
3359
|
/* @__PURE__ */ jsx27(ChevronDown8, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
|
|
@@ -3429,7 +3437,7 @@ function Monogram({ name, size = 28 }) {
|
|
|
3429
3437
|
"span",
|
|
3430
3438
|
{
|
|
3431
3439
|
"aria-hidden": "true",
|
|
3432
|
-
className: "flex shrink-0 items-center justify-center rounded-
|
|
3440
|
+
className: "flex shrink-0 items-center justify-center rounded-control bg-subtle font-bold leading-none text-text-secondary",
|
|
3433
3441
|
style: { width: size, height: size, fontSize: Math.round(size * 0.36) },
|
|
3434
3442
|
children: initials(name)
|
|
3435
3443
|
}
|
|
@@ -3445,7 +3453,7 @@ function DelayedTip({ label, children }) {
|
|
|
3445
3453
|
"span",
|
|
3446
3454
|
{
|
|
3447
3455
|
role: "tooltip",
|
|
3448
|
-
className: "pointer-events-none invisible absolute bottom-
|
|
3456
|
+
className: "pointer-events-none invisible absolute bottom-full mb-1.5 left-1/2 z-40 w-40 -translate-x-1/2 rounded-control border border-border-default bg-surface px-2 py-1.5 text-center text-micro font-medium leading-snug text-text-secondary opacity-0 shadow-overlay transition-[opacity,visibility] delay-1000 duration-150 group-hover/dt:visible group-hover/dt:opacity-100 group-focus/dt:visible group-focus/dt:opacity-100",
|
|
3449
3457
|
children: label
|
|
3450
3458
|
}
|
|
3451
3459
|
)
|
|
@@ -3506,18 +3514,18 @@ function PublisherBreakdownList({
|
|
|
3506
3514
|
/* @__PURE__ */ jsx28(MetricCells, { spendN: p.spendN, yoy: p.yoy })
|
|
3507
3515
|
] }, p.brand))
|
|
3508
3516
|
] }),
|
|
3509
|
-
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ jsx28("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ jsx28("a", { href: viewAllHref, className: "text-xs font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
3517
|
+
rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ jsx28("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ jsx28("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__ */ jsxs26("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
|
|
3510
3518
|
/* @__PURE__ */ jsxs26("span", { children: [
|
|
3511
3519
|
"Showing ",
|
|
3512
3520
|
visible.length,
|
|
3513
3521
|
" of ",
|
|
3514
3522
|
rows.length
|
|
3515
3523
|
] }),
|
|
3516
|
-
!showAll ? /* @__PURE__ */ jsxs26("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
3524
|
+
!showAll ? /* @__PURE__ */ jsxs26("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: [
|
|
3517
3525
|
"See all (",
|
|
3518
3526
|
rows.length - defaultVisibleCount,
|
|
3519
3527
|
" more)"
|
|
3520
|
-
] }) : /* @__PURE__ */ jsx28("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
3528
|
+
] }) : /* @__PURE__ */ jsx28("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" })
|
|
3521
3529
|
] }))
|
|
3522
3530
|
] });
|
|
3523
3531
|
}
|
|
@@ -3529,7 +3537,7 @@ import { cva } from "class-variance-authority";
|
|
|
3529
3537
|
import { Loader2 as Loader22 } from "lucide-react";
|
|
3530
3538
|
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3531
3539
|
var buttonVariants = cva(
|
|
3532
|
-
"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-
|
|
3540
|
+
"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",
|
|
3533
3541
|
{
|
|
3534
3542
|
variants: {
|
|
3535
3543
|
variant: {
|
|
@@ -3761,7 +3769,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
|
|
|
3761
3769
|
{
|
|
3762
3770
|
type: "button",
|
|
3763
3771
|
onClick: onClearAll,
|
|
3764
|
-
className: "ml-1 rounded-small text-xs font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
3772
|
+
className: "ml-1 rounded-small text-xs font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3765
3773
|
children: "Clear all"
|
|
3766
3774
|
}
|
|
3767
3775
|
)
|
|
@@ -3794,7 +3802,7 @@ function Chip({
|
|
|
3794
3802
|
type: "button",
|
|
3795
3803
|
onClick: onRemove,
|
|
3796
3804
|
"aria-label": `Remove ${groupLabel}: ${label}`,
|
|
3797
|
-
className: "rounded-full text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-
|
|
3805
|
+
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",
|
|
3798
3806
|
children: /* @__PURE__ */ jsx32(X4, { size: 12 })
|
|
3799
3807
|
}
|
|
3800
3808
|
)
|
|
@@ -3859,7 +3867,7 @@ var SortButton = forwardRef5(
|
|
|
3859
3867
|
// subtly tighter than the fixed headers next to them. A control
|
|
3860
3868
|
// should carry exactly the properties that do not inherit, and
|
|
3861
3869
|
// nothing more.
|
|
3862
|
-
"group inline-flex items-center gap-1 uppercase transition-colors focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-
|
|
3870
|
+
"group inline-flex items-center gap-1 uppercase transition-colors focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
3863
3871
|
ALIGN[align],
|
|
3864
3872
|
!disabled && "hover:text-text-primary",
|
|
3865
3873
|
className
|
|
@@ -3912,7 +3920,7 @@ function pageWindow(current, total) {
|
|
|
3912
3920
|
return out;
|
|
3913
3921
|
}
|
|
3914
3922
|
function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
|
|
3915
|
-
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-
|
|
3923
|
+
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";
|
|
3916
3924
|
return /* @__PURE__ */ jsxs32("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
|
|
3917
3925
|
/* @__PURE__ */ jsx34(
|
|
3918
3926
|
"button",
|
|
@@ -4054,7 +4062,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
|
|
|
4054
4062
|
action.onClick();
|
|
4055
4063
|
}
|
|
4056
4064
|
},
|
|
4057
|
-
className: "shrink-0 rounded-control px-2.5 py-1 text-sm font-semibold text-text-inverse underline-offset-2 transition-colors duration-(--mr-motion-duration-interactive) ease-interactive hover:bg-text-inverse/15 hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
4065
|
+
className: "shrink-0 rounded-control px-2.5 py-1 text-sm font-semibold text-text-inverse underline-offset-2 transition-colors duration-(--mr-motion-duration-interactive) ease-interactive hover:bg-text-inverse/15 hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
4058
4066
|
children: action.label
|
|
4059
4067
|
}
|
|
4060
4068
|
)
|
|
@@ -4090,7 +4098,7 @@ function TablePagination({
|
|
|
4090
4098
|
const current = Math.min(page, totalPages);
|
|
4091
4099
|
const rangeStart = totalItems === 0 ? 0 : (current - 1) * perPage + 1;
|
|
4092
4100
|
const rangeEnd = Math.min(current * perPage, totalItems);
|
|
4093
|
-
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-
|
|
4101
|
+
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";
|
|
4094
4102
|
const off = "disabled:pointer-events-none disabled:opacity-30";
|
|
4095
4103
|
const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
|
|
4096
4104
|
const range = /* @__PURE__ */ jsxs34("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
|
|
@@ -4330,7 +4338,7 @@ function DateRangePicker({
|
|
|
4330
4338
|
]
|
|
4331
4339
|
}
|
|
4332
4340
|
),
|
|
4333
|
-
open && /* @__PURE__ */ jsxs35("div", { className: cn("absolute top-
|
|
4341
|
+
open && /* @__PURE__ */ jsxs35("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: [
|
|
4334
4342
|
presets.map((p) => /* @__PURE__ */ jsx39(
|
|
4335
4343
|
"button",
|
|
4336
4344
|
{
|
|
@@ -4366,7 +4374,7 @@ function DateRangePicker({
|
|
|
4366
4374
|
type: "button",
|
|
4367
4375
|
onClick: applyCustom,
|
|
4368
4376
|
disabled: !valid,
|
|
4369
|
-
className: "self-start text-dense font-semibold text-brand-primaryAction transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-
|
|
4377
|
+
className: "self-start text-dense font-semibold text-brand-primaryAction transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
4370
4378
|
children: showFooter ? "Use custom range" : "Apply"
|
|
4371
4379
|
}
|
|
4372
4380
|
)
|
|
@@ -4381,6 +4389,7 @@ function DateRangePicker({
|
|
|
4381
4389
|
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef15, useState as useState14 } from "react";
|
|
4382
4390
|
import { ChevronDown as ChevronDown10, Search as Search5, X as X5 } from "lucide-react";
|
|
4383
4391
|
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4392
|
+
var SEARCH_AFTER = 8;
|
|
4384
4393
|
function MultiSelectFilter({
|
|
4385
4394
|
caption,
|
|
4386
4395
|
options = [],
|
|
@@ -4390,7 +4399,7 @@ function MultiSelectFilter({
|
|
|
4390
4399
|
selected,
|
|
4391
4400
|
onChange,
|
|
4392
4401
|
allLabel = "All",
|
|
4393
|
-
searchable
|
|
4402
|
+
searchable,
|
|
4394
4403
|
searchPlaceholder,
|
|
4395
4404
|
align = "left",
|
|
4396
4405
|
fullIsAll = false,
|
|
@@ -4412,6 +4421,7 @@ function MultiSelectFilter({
|
|
|
4412
4421
|
}) {
|
|
4413
4422
|
const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
|
|
4414
4423
|
const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
|
|
4424
|
+
const showSearch = searchable ?? leafOptions.length > SEARCH_AFTER;
|
|
4415
4425
|
const [open, setOpen] = useState14(false);
|
|
4416
4426
|
const [q, setQ] = useState14("");
|
|
4417
4427
|
const [draft, setDraft] = useState14(selected);
|
|
@@ -4433,6 +4443,12 @@ function MultiSelectFilter({
|
|
|
4433
4443
|
setOpen(false);
|
|
4434
4444
|
setQ("");
|
|
4435
4445
|
};
|
|
4446
|
+
const clearAll = () => {
|
|
4447
|
+
setDraft(clearValue);
|
|
4448
|
+
onChange(clearValue);
|
|
4449
|
+
setOpen(false);
|
|
4450
|
+
setQ("");
|
|
4451
|
+
};
|
|
4436
4452
|
useEffect13(() => {
|
|
4437
4453
|
if (!open) return;
|
|
4438
4454
|
const onKey = (e) => e.key === "Escape" && close();
|
|
@@ -4509,7 +4525,7 @@ function MultiSelectFilter({
|
|
|
4509
4525
|
"div",
|
|
4510
4526
|
{
|
|
4511
4527
|
className: cn(
|
|
4512
|
-
"absolute top-
|
|
4528
|
+
"absolute top-full mt-2 z-30 flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
|
|
4513
4529
|
menuWidthClass,
|
|
4514
4530
|
align === "right" ? "right-0" : "left-0"
|
|
4515
4531
|
),
|
|
@@ -4517,7 +4533,7 @@ function MultiSelectFilter({
|
|
|
4517
4533
|
role: "dialog",
|
|
4518
4534
|
"aria-label": caption,
|
|
4519
4535
|
children: loading ? /* @__PURE__ */ jsx40(MenuLoading, {}) : error ? /* @__PURE__ */ jsx40(MenuError, { onRetry }) : /* @__PURE__ */ jsxs36(Fragment4, { children: [
|
|
4520
|
-
|
|
4536
|
+
showSearch && /* @__PURE__ */ jsx40("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs36("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: [
|
|
4521
4537
|
/* @__PURE__ */ jsx40(Search5, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
4522
4538
|
/* @__PURE__ */ jsx40(
|
|
4523
4539
|
"input",
|
|
@@ -4529,9 +4545,9 @@ function MultiSelectFilter({
|
|
|
4529
4545
|
className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
|
|
4530
4546
|
}
|
|
4531
4547
|
),
|
|
4532
|
-
q && /* @__PURE__ */ jsx40("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-
|
|
4548
|
+
q && /* @__PURE__ */ jsx40("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__ */ jsx40(X5, { size: 13 }) })
|
|
4533
4549
|
] }) }),
|
|
4534
|
-
/* @__PURE__ */ jsxs36("div", { className: "max-h-
|
|
4550
|
+
/* @__PURE__ */ jsxs36("div", { className: "max-h-70 overflow-y-auto p-1", children: [
|
|
4535
4551
|
groups ? visibleGroups.map((g) => {
|
|
4536
4552
|
const state = groupState(g);
|
|
4537
4553
|
return /* @__PURE__ */ jsxs36("div", { children: [
|
|
@@ -4586,12 +4602,12 @@ function MultiSelectFilter({
|
|
|
4586
4602
|
(groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ jsx40("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
|
|
4587
4603
|
] }),
|
|
4588
4604
|
note && /* @__PURE__ */ jsx40("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
|
|
4589
|
-
showFooter ? /* @__PURE__ */ jsx40(FilterDropdownFooter, { onClear:
|
|
4605
|
+
showFooter ? /* @__PURE__ */ jsx40(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ jsx40("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ jsxs36(
|
|
4590
4606
|
"button",
|
|
4591
4607
|
{
|
|
4592
4608
|
type: "button",
|
|
4593
4609
|
onClick: () => setDraft([]),
|
|
4594
|
-
className: "text-xs font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-
|
|
4610
|
+
className: "text-xs font-medium text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
4595
4611
|
children: [
|
|
4596
4612
|
"Clear ",
|
|
4597
4613
|
caption.toLowerCase()
|
|
@@ -4615,8 +4631,8 @@ function OptionCount({ n }) {
|
|
|
4615
4631
|
import { forwardRef as forwardRef6 } from "react";
|
|
4616
4632
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4617
4633
|
var SIZES2 = {
|
|
4618
|
-
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-
|
|
4619
|
-
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-
|
|
4634
|
+
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
|
|
4635
|
+
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
|
|
4620
4636
|
};
|
|
4621
4637
|
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
4622
4638
|
var Toggle = forwardRef6(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
|
|
@@ -4634,7 +4650,7 @@ var Toggle = forwardRef6(function Toggle2({ checked, onChange, label, size = "md
|
|
|
4634
4650
|
onClick: () => onChange(!checked),
|
|
4635
4651
|
style: checked ? void 0 : { backgroundColor: OFF_TRACK },
|
|
4636
4652
|
className: cn(
|
|
4637
|
-
"relative inline-flex shrink-0 items-center rounded-full transition-colors focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-
|
|
4653
|
+
"relative inline-flex shrink-0 items-center rounded-full transition-colors focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
4638
4654
|
s.track,
|
|
4639
4655
|
checked && "bg-brand-primaryAction",
|
|
4640
4656
|
disabled && "cursor-not-allowed opacity-50",
|
|
@@ -4664,7 +4680,7 @@ function AISpark({ size = 16, className, testIdPrefix }) {
|
|
|
4664
4680
|
return /* @__PURE__ */ jsxs37(Fragment5, { children: [
|
|
4665
4681
|
/* @__PURE__ */ jsx42("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ jsx42("defs", { children: /* @__PURE__ */ jsxs37("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
4666
4682
|
/* @__PURE__ */ jsx42("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
|
|
4667
|
-
/* @__PURE__ */ jsx42("stop", { offset: "100%",
|
|
4683
|
+
/* @__PURE__ */ jsx42("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
|
|
4668
4684
|
] }) }) }),
|
|
4669
4685
|
/* @__PURE__ */ jsx42(Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
|
|
4670
4686
|
] });
|
|
@@ -4717,7 +4733,7 @@ function PageHeader({ title, description, actions, meta, back, className, testId
|
|
|
4717
4733
|
{
|
|
4718
4734
|
href: back.href ?? "#",
|
|
4719
4735
|
onClick: back.onClick,
|
|
4720
|
-
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-
|
|
4736
|
+
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",
|
|
4721
4737
|
children: [
|
|
4722
4738
|
/* @__PURE__ */ jsx45(ArrowLeft, { size: 13, "aria-hidden": "true" }),
|
|
4723
4739
|
back.label
|
|
@@ -4821,7 +4837,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4821
4837
|
type: "button",
|
|
4822
4838
|
onClick: onClose,
|
|
4823
4839
|
"aria-label": "Close",
|
|
4824
|
-
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-
|
|
4840
|
+
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",
|
|
4825
4841
|
children: /* @__PURE__ */ jsx46(X6, { size: 16, "aria-hidden": "true" })
|
|
4826
4842
|
}
|
|
4827
4843
|
)
|
|
@@ -5022,7 +5038,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5022
5038
|
type: "button",
|
|
5023
5039
|
onClick: onClose,
|
|
5024
5040
|
"aria-label": "Close",
|
|
5025
|
-
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-
|
|
5041
|
+
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",
|
|
5026
5042
|
children: /* @__PURE__ */ jsx49(X7, { size: 16, "aria-hidden": "true" })
|
|
5027
5043
|
}
|
|
5028
5044
|
)
|
|
@@ -5176,7 +5192,7 @@ var SuggestionChip = forwardRef8(function SuggestionChip2({ children, className,
|
|
|
5176
5192
|
"data-testid": testIdPrefix,
|
|
5177
5193
|
...props,
|
|
5178
5194
|
className: cn(
|
|
5179
|
-
"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-
|
|
5195
|
+
"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",
|
|
5180
5196
|
className
|
|
5181
5197
|
),
|
|
5182
5198
|
children: /* @__PURE__ */ jsx52("span", { className: "truncate", children })
|
|
@@ -5203,7 +5219,7 @@ var ToggleChip = forwardRef9(function ToggleChip2({ selected, onChange, children
|
|
|
5203
5219
|
if (!e.defaultPrevented) onChange(!selected);
|
|
5204
5220
|
},
|
|
5205
5221
|
className: cn(
|
|
5206
|
-
"inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 text-sm transition-colors duration-(--mr-motion-duration-interactive) ease-interactive focus-visible:outline-2 focus-visible:outline-offset-
|
|
5222
|
+
"inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 text-sm transition-colors duration-(--mr-motion-duration-interactive) ease-interactive focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5207
5223
|
selected ? "border-brand-primaryAction bg-brand-primaryAction/15 font-medium text-brand-primaryAction" : "border-border-default bg-surface text-text-primary hover:border-border-strong hover:bg-subtle",
|
|
5208
5224
|
className
|
|
5209
5225
|
),
|
|
@@ -5297,7 +5313,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5297
5313
|
type: "button",
|
|
5298
5314
|
onClick: onDismiss,
|
|
5299
5315
|
"aria-label": "Dismiss",
|
|
5300
|
-
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-border-focus",
|
|
5316
|
+
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",
|
|
5301
5317
|
children: /* @__PURE__ */ jsx55(X8, { size: 14, "aria-hidden": "true" })
|
|
5302
5318
|
}
|
|
5303
5319
|
)
|
|
@@ -5371,7 +5387,7 @@ function FilterDrawer({
|
|
|
5371
5387
|
const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
|
|
5372
5388
|
const panel = (v, rows = true) => {
|
|
5373
5389
|
const s = v ? sections.find((x) => x.id === v) : void 0;
|
|
5374
|
-
if (s) return /* @__PURE__ */ jsx56("div", { className: "px-5 pt-
|
|
5390
|
+
if (s) return /* @__PURE__ */ jsx56("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
|
|
5375
5391
|
return /* @__PURE__ */ jsx56("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ jsx56("li", { className: "border-b border-border-default", children: /* @__PURE__ */ jsxs48(
|
|
5376
5392
|
"button",
|
|
5377
5393
|
{
|
|
@@ -5415,7 +5431,7 @@ function FilterDrawer({
|
|
|
5415
5431
|
onClick: () => setView(null),
|
|
5416
5432
|
"aria-label": "Back to all filters",
|
|
5417
5433
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5418
|
-
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-border-focus",
|
|
5434
|
+
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",
|
|
5419
5435
|
children: /* @__PURE__ */ jsx56(ChevronLeft5, { size: 18, "aria-hidden": "true" })
|
|
5420
5436
|
}
|
|
5421
5437
|
),
|
|
@@ -5425,8 +5441,11 @@ function FilterDrawer({
|
|
|
5425
5441
|
"Filters",
|
|
5426
5442
|
activeCount > 0 && /* @__PURE__ */ jsx56(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
|
|
5427
5443
|
] }),
|
|
5428
|
-
footer:
|
|
5429
|
-
|
|
5444
|
+
footer: focused ? (
|
|
5445
|
+
// Picks are kept as they're made; only See results, on the list, applies them.
|
|
5446
|
+
/* @__PURE__ */ jsx56("div", { className: "flex w-full items-center", children: /* @__PURE__ */ jsx56(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
|
|
5447
|
+
) : /* @__PURE__ */ jsxs48("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
5448
|
+
/* @__PURE__ */ jsx56(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
|
|
5430
5449
|
/* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-2", children: [
|
|
5431
5450
|
/* @__PURE__ */ jsx56(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
|
|
5432
5451
|
/* @__PURE__ */ jsx56(
|
|
@@ -5438,7 +5457,7 @@ function FilterDrawer({
|
|
|
5438
5457
|
onApply();
|
|
5439
5458
|
onClose();
|
|
5440
5459
|
},
|
|
5441
|
-
children: "
|
|
5460
|
+
children: "See results"
|
|
5442
5461
|
}
|
|
5443
5462
|
)
|
|
5444
5463
|
] })
|
|
@@ -5492,6 +5511,98 @@ var AllFiltersButton = forwardRef11(function AllFiltersButton2({ count = 0, open
|
|
|
5492
5511
|
}
|
|
5493
5512
|
);
|
|
5494
5513
|
});
|
|
5514
|
+
|
|
5515
|
+
// src/Menu.tsx
|
|
5516
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
5517
|
+
import { Slot as Slot2, Slottable } from "@radix-ui/react-slot";
|
|
5518
|
+
import { Check as Check10, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
5519
|
+
import { Fragment as Fragment6, jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5520
|
+
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5521
|
+
function moveFocus(e) {
|
|
5522
|
+
const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
5523
|
+
if (!keys.includes(e.key)) return;
|
|
5524
|
+
const rows = Array.from(e.currentTarget.querySelectorAll(ROW_SELECTOR));
|
|
5525
|
+
if (!rows.length) return;
|
|
5526
|
+
e.preventDefault();
|
|
5527
|
+
const i = rows.indexOf(document.activeElement);
|
|
5528
|
+
const next = e.key === "Home" ? 0 : e.key === "End" ? rows.length - 1 : e.key === "ArrowDown" ? (i + 1) % rows.length : (i - 1 + rows.length) % rows.length;
|
|
5529
|
+
rows[next].focus();
|
|
5530
|
+
}
|
|
5531
|
+
var Menu = forwardRef12(
|
|
5532
|
+
({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ jsx58(
|
|
5533
|
+
"div",
|
|
5534
|
+
{
|
|
5535
|
+
ref,
|
|
5536
|
+
role: "menu",
|
|
5537
|
+
"data-testid": testIdPrefix,
|
|
5538
|
+
onKeyDown: (e) => {
|
|
5539
|
+
moveFocus(e);
|
|
5540
|
+
onKeyDown?.(e);
|
|
5541
|
+
},
|
|
5542
|
+
className: cn("flex flex-col p-1", className),
|
|
5543
|
+
...props,
|
|
5544
|
+
children
|
|
5545
|
+
}
|
|
5546
|
+
)
|
|
5547
|
+
);
|
|
5548
|
+
Menu.displayName = "Menu";
|
|
5549
|
+
var MenuItem = forwardRef12(
|
|
5550
|
+
({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
|
|
5551
|
+
const Comp = asChild ? Slot2 : "button";
|
|
5552
|
+
const radio = checked !== void 0;
|
|
5553
|
+
const body = /* @__PURE__ */ jsxs50(Fragment6, { children: [
|
|
5554
|
+
icon && /* @__PURE__ */ jsx58("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
|
|
5555
|
+
asChild ? (
|
|
5556
|
+
// The link's own text lands here; the link becomes the row.
|
|
5557
|
+
/* @__PURE__ */ jsx58(Slottable, { children })
|
|
5558
|
+
) : /* @__PURE__ */ jsxs50("span", { className: "min-w-0 flex-1", children: [
|
|
5559
|
+
/* @__PURE__ */ jsx58("span", { className: "block truncate", children }),
|
|
5560
|
+
description && /* @__PURE__ */ jsx58("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5561
|
+
] }),
|
|
5562
|
+
trailing && /* @__PURE__ */ jsx58("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
5563
|
+
radio && checked && /* @__PURE__ */ jsx58(Check10, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
5564
|
+
submenu && /* @__PURE__ */ jsx58(ChevronRight7, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5565
|
+
] });
|
|
5566
|
+
return /* @__PURE__ */ jsx58(
|
|
5567
|
+
Comp,
|
|
5568
|
+
{
|
|
5569
|
+
ref,
|
|
5570
|
+
type: asChild ? void 0 : "button",
|
|
5571
|
+
role: radio ? "menuitemradio" : "menuitem",
|
|
5572
|
+
"aria-checked": radio ? checked : void 0,
|
|
5573
|
+
"aria-haspopup": submenu ? "menu" : void 0,
|
|
5574
|
+
"aria-disabled": disabled || void 0,
|
|
5575
|
+
disabled: asChild ? void 0 : disabled,
|
|
5576
|
+
tabIndex: -1,
|
|
5577
|
+
"data-testid": testIdPrefix,
|
|
5578
|
+
className: cn(
|
|
5579
|
+
"flex min-h-9 w-full items-center gap-2.5 rounded-control px-3 py-1.5 text-left text-sm transition-colors",
|
|
5580
|
+
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
|
|
5581
|
+
danger ? "text-text-danger" : "text-text-primary",
|
|
5582
|
+
disabled ? "cursor-not-allowed opacity-40" : "hover:bg-subtle focus-visible:bg-subtle",
|
|
5583
|
+
className
|
|
5584
|
+
),
|
|
5585
|
+
...props,
|
|
5586
|
+
children: body
|
|
5587
|
+
}
|
|
5588
|
+
);
|
|
5589
|
+
}
|
|
5590
|
+
);
|
|
5591
|
+
MenuItem.displayName = "MenuItem";
|
|
5592
|
+
function MenuLabel({ className, testIdPrefix, children }) {
|
|
5593
|
+
return /* @__PURE__ */ jsx58(
|
|
5594
|
+
"div",
|
|
5595
|
+
{
|
|
5596
|
+
role: "presentation",
|
|
5597
|
+
"data-testid": testIdPrefix,
|
|
5598
|
+
className: cn("px-3 pb-1 pt-2 text-micro font-semibold uppercase tracking-wide text-text-tertiary", className),
|
|
5599
|
+
children
|
|
5600
|
+
}
|
|
5601
|
+
);
|
|
5602
|
+
}
|
|
5603
|
+
function MenuSeparator({ className, testIdPrefix }) {
|
|
5604
|
+
return /* @__PURE__ */ jsx58("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
|
|
5605
|
+
}
|
|
5495
5606
|
export {
|
|
5496
5607
|
AISpark,
|
|
5497
5608
|
AdvertiserNoResults,
|
|
@@ -5522,6 +5633,10 @@ export {
|
|
|
5522
5633
|
InlineMessage,
|
|
5523
5634
|
LineChartPlaceholder,
|
|
5524
5635
|
MediaLabel,
|
|
5636
|
+
Menu,
|
|
5637
|
+
MenuItem,
|
|
5638
|
+
MenuLabel,
|
|
5639
|
+
MenuSeparator,
|
|
5525
5640
|
Modal,
|
|
5526
5641
|
MultiSelectFilter,
|
|
5527
5642
|
NO_RESULTS_BODY,
|