@mediaradar/design-components 0.57.0 → 0.59.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 +276 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +188 -29
- package/dist/index.d.ts +188 -29
- package/dist/index.js +291 -89
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/scripts/tailwind-coverage.mjs +3 -1
package/dist/index.cjs
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
Delta: () => Delta,
|
|
45
45
|
Drawer: () => Drawer,
|
|
46
46
|
EmptyState: () => EmptyState,
|
|
47
|
+
Figure: () => Figure,
|
|
47
48
|
FilterChipBar: () => FilterChipBar,
|
|
48
49
|
FilterDrawer: () => FilterDrawer,
|
|
49
50
|
FilterDropdownFooter: () => FilterDropdownFooter,
|
|
@@ -61,8 +62,10 @@ __export(index_exports, {
|
|
|
61
62
|
MultiSelectFilter: () => MultiSelectFilter,
|
|
62
63
|
NO_RESULTS_BODY: () => NO_RESULTS_BODY,
|
|
63
64
|
NO_RESULTS_TITLE: () => NO_RESULTS_TITLE,
|
|
65
|
+
NO_VALUE: () => NO_VALUE,
|
|
64
66
|
NameListModal: () => NameListModal,
|
|
65
67
|
NoResultsEmptyState: () => NoResultsEmptyState,
|
|
68
|
+
NoValue: () => NoValue,
|
|
66
69
|
PRIMARY_ACTION_CLASS: () => PRIMARY_ACTION_CLASS,
|
|
67
70
|
PageHeader: () => PageHeader,
|
|
68
71
|
Pager: () => Pager,
|
|
@@ -83,6 +86,7 @@ __export(index_exports, {
|
|
|
83
86
|
StatStrip: () => StatStrip,
|
|
84
87
|
StatTile: () => StatTile,
|
|
85
88
|
SuggestionChip: () => SuggestionChip,
|
|
89
|
+
TableLink: () => TableLink,
|
|
86
90
|
TablePagination: () => TablePagination,
|
|
87
91
|
Tabs: () => Tabs,
|
|
88
92
|
Tag: () => Tag,
|
|
@@ -98,13 +102,18 @@ __export(index_exports, {
|
|
|
98
102
|
chipTriggerClass: () => chipTriggerClass,
|
|
99
103
|
cycleSort: () => cycleSort,
|
|
100
104
|
defaultDateOrder: () => defaultDateOrder,
|
|
105
|
+
formatCount: () => formatCount,
|
|
106
|
+
formatCountFull: () => formatCountFull,
|
|
101
107
|
formatDate: () => formatDate,
|
|
102
108
|
formatDateRange: () => formatDateRange,
|
|
103
109
|
formatDateTime: () => formatDateTime,
|
|
104
110
|
formatIsoDate: () => formatIsoDate,
|
|
111
|
+
formatMoney: () => formatMoney,
|
|
112
|
+
formatMoneyFull: () => formatMoneyFull,
|
|
105
113
|
formatMonth: () => formatMonth,
|
|
106
114
|
formatMonthAxis: () => formatMonthAxis,
|
|
107
115
|
formatOpenRange: () => formatOpenRange,
|
|
116
|
+
formatPercent: () => formatPercent,
|
|
108
117
|
formatQuarter: () => formatQuarter,
|
|
109
118
|
formatRelative: () => formatRelative,
|
|
110
119
|
formatTime: () => formatTime,
|
|
@@ -4124,15 +4133,22 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4124
4133
|
disabled = false,
|
|
4125
4134
|
sortable = true,
|
|
4126
4135
|
align = "left",
|
|
4136
|
+
description,
|
|
4127
4137
|
className,
|
|
4128
4138
|
testIdPrefix
|
|
4129
4139
|
}, ref) {
|
|
4130
|
-
|
|
4140
|
+
const own = (0, import_react19.useRef)(null);
|
|
4141
|
+
(0, import_react19.useImperativeHandle)(ref, () => own.current);
|
|
4142
|
+
const text = description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: DESCRIBED, children: label }) : label;
|
|
4143
|
+
if (!sortable) {
|
|
4144
|
+
const plain = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: cn("inline-flex", ALIGN[align], className), children: text });
|
|
4145
|
+
return description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(HeaderTip, { description, children: plain }) : plain;
|
|
4146
|
+
}
|
|
4131
4147
|
const active = !disabled && sort.key === sortKey;
|
|
4132
|
-
|
|
4148
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4133
4149
|
"button",
|
|
4134
4150
|
{
|
|
4135
|
-
ref,
|
|
4151
|
+
ref: own,
|
|
4136
4152
|
type: "button",
|
|
4137
4153
|
disabled,
|
|
4138
4154
|
onClick: () => onSort(sortKey),
|
|
@@ -4159,27 +4175,35 @@ var SortButton = (0, import_react19.forwardRef)(
|
|
|
4159
4175
|
className
|
|
4160
4176
|
),
|
|
4161
4177
|
children: [
|
|
4162
|
-
|
|
4178
|
+
text,
|
|
4163
4179
|
!disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react19.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react19.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4164
4180
|
import_lucide_react19.ArrowUpDown,
|
|
4165
4181
|
{
|
|
4166
4182
|
size: 12,
|
|
4167
4183
|
"aria-hidden": "true",
|
|
4168
|
-
className: "shrink-0 text-text-tertiary opacity-
|
|
4184
|
+
className: "shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 group-hover/head:opacity-100 pointer-coarse:opacity-50"
|
|
4169
4185
|
}
|
|
4170
4186
|
))
|
|
4171
4187
|
]
|
|
4172
4188
|
}
|
|
4173
4189
|
);
|
|
4190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
4191
|
+
button,
|
|
4192
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tooltip, { anchorRef: own, label: description, delay: 300, placement: "top" })
|
|
4193
|
+
] });
|
|
4174
4194
|
}
|
|
4175
4195
|
);
|
|
4176
4196
|
SortButton.displayName = "SortButton";
|
|
4197
|
+
var DESCRIBED = "underline decoration-dotted decoration-1 decoration-text-tertiary underline-offset-4";
|
|
4198
|
+
function HeaderTip({ description, children }) {
|
|
4199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tooltip, { label: description, delay: 300, className: "inline-flex rounded-xs focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { tabIndex: 0, children }) });
|
|
4200
|
+
}
|
|
4177
4201
|
|
|
4178
4202
|
// src/tableSort.ts
|
|
4179
|
-
function cycleSort(current, key, firstDir = "desc") {
|
|
4203
|
+
function cycleSort(current, key, firstDir = "desc", fallback = null) {
|
|
4180
4204
|
if (!current || current.key !== key) return { key, dir: firstDir };
|
|
4181
4205
|
if (current.dir === firstDir) return { key, dir: firstDir === "desc" ? "asc" : "desc" };
|
|
4182
|
-
return
|
|
4206
|
+
return fallback && fallback.key === key ? { key, dir: firstDir } : fallback;
|
|
4183
4207
|
}
|
|
4184
4208
|
function sortProp(sort) {
|
|
4185
4209
|
return sort ?? { key: null, dir: "desc" };
|
|
@@ -5359,11 +5383,89 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
|
|
|
5359
5383
|
|
|
5360
5384
|
// src/DataTable.tsx
|
|
5361
5385
|
var import_react28 = require("react");
|
|
5386
|
+
var import_lucide_react29 = require("lucide-react");
|
|
5387
|
+
|
|
5388
|
+
// src/numbers.ts
|
|
5389
|
+
var US = { units: ["K", "M", "B", "T"] };
|
|
5390
|
+
var STYLES = {
|
|
5391
|
+
"en-US": US,
|
|
5392
|
+
"en-CA": US,
|
|
5393
|
+
"en-GB": { units: ["k", "m", "bn", "tn"] }
|
|
5394
|
+
};
|
|
5395
|
+
var styleFor = (language) => STYLES[language ?? "en-US"] ?? US;
|
|
5396
|
+
var NO_VALUE = "\u2014";
|
|
5397
|
+
var MINUS = "\u2212";
|
|
5398
|
+
var SHORTEN_FROM = 1e4;
|
|
5399
|
+
var isMissing = (v) => v === null || v === void 0 || Number.isNaN(v);
|
|
5400
|
+
var withCommas = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
5401
|
+
function shortAbs(abs, style) {
|
|
5402
|
+
if (abs < SHORTEN_FROM) return withCommas(abs);
|
|
5403
|
+
let tier = Math.min(Math.floor(Math.log10(abs) / 3), 4);
|
|
5404
|
+
let scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
|
|
5405
|
+
if (scaled >= 1e3 && tier < 4) {
|
|
5406
|
+
tier += 1;
|
|
5407
|
+
scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
|
|
5408
|
+
}
|
|
5409
|
+
const text = Number.isInteger(scaled) ? withCommas(scaled) : scaled.toFixed(1);
|
|
5410
|
+
return `${text}${style.units[tier - 1]}`;
|
|
5411
|
+
}
|
|
5412
|
+
function symbol(opts) {
|
|
5413
|
+
const currency = opts.currency ?? "USD";
|
|
5414
|
+
if (currency === "GBP") return "\xA3";
|
|
5415
|
+
if (currency === "EUR") return "\u20AC";
|
|
5416
|
+
if (opts.mixedDollars) return currency === "CAD" ? "CA$" : "US$";
|
|
5417
|
+
return "$";
|
|
5418
|
+
}
|
|
5419
|
+
var sign = (v) => v < 0 ? MINUS : "";
|
|
5420
|
+
function formatCount(value, opts = {}) {
|
|
5421
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5422
|
+
return sign(value) + shortAbs(Math.abs(value), styleFor(opts.language));
|
|
5423
|
+
}
|
|
5424
|
+
function formatCountFull(value) {
|
|
5425
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5426
|
+
return sign(value) + withCommas(Math.abs(value));
|
|
5427
|
+
}
|
|
5428
|
+
function formatMoney(value, opts = {}) {
|
|
5429
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5430
|
+
return sign(value) + symbol(opts) + shortAbs(Math.abs(value), styleFor(opts.language));
|
|
5431
|
+
}
|
|
5432
|
+
function formatMoneyFull(value, opts = {}) {
|
|
5433
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5434
|
+
return sign(value) + symbol(opts) + withCommas(Math.abs(value));
|
|
5435
|
+
}
|
|
5436
|
+
function formatPercent(value, _opts = {}) {
|
|
5437
|
+
if (isMissing(value)) return NO_VALUE;
|
|
5438
|
+
const abs = Math.abs(value);
|
|
5439
|
+
if (abs > 0 && abs < 0.05) return `${value < 0 ? MINUS : ""}<0.1%`;
|
|
5440
|
+
const text = (Math.round(abs * 10) / 10).toFixed(1);
|
|
5441
|
+
return text === "0.0" ? "0.0%" : `${sign(value)}${text}%`;
|
|
5442
|
+
}
|
|
5443
|
+
|
|
5444
|
+
// src/DataTable.tsx
|
|
5362
5445
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5363
5446
|
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
5364
5447
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
5365
5448
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
5366
5449
|
var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
|
|
5450
|
+
var OWN_CLICK = "a, button, input, select, textarea, label, summary, [role='button'], [role='checkbox'], [role='menuitem'], [role='switch'], [role='tab'], [contenteditable='true']";
|
|
5451
|
+
function NoValue({ reason = "No data" }) {
|
|
5452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { label: reason, delay: 300, className: "text-text-tertiary", children: [
|
|
5453
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": "true", children: NO_VALUE }),
|
|
5454
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "sr-only", children: reason })
|
|
5455
|
+
] });
|
|
5456
|
+
}
|
|
5457
|
+
function TableLink({ className, ...props }) {
|
|
5458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5459
|
+
"a",
|
|
5460
|
+
{
|
|
5461
|
+
...props,
|
|
5462
|
+
className: cn(
|
|
5463
|
+
"rounded-xs text-inherit decoration-1 underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5464
|
+
className
|
|
5465
|
+
)
|
|
5466
|
+
}
|
|
5467
|
+
);
|
|
5468
|
+
}
|
|
5367
5469
|
function DataTable({
|
|
5368
5470
|
columns,
|
|
5369
5471
|
rows,
|
|
@@ -5371,8 +5473,14 @@ function DataTable({
|
|
|
5371
5473
|
title,
|
|
5372
5474
|
subtitle,
|
|
5373
5475
|
action,
|
|
5476
|
+
variant = "default",
|
|
5477
|
+
titleAs = "h2",
|
|
5374
5478
|
sort = null,
|
|
5375
5479
|
onSortChange,
|
|
5480
|
+
defaultSort = null,
|
|
5481
|
+
renderExpanded,
|
|
5482
|
+
canExpand,
|
|
5483
|
+
rowLabel,
|
|
5376
5484
|
density = "default",
|
|
5377
5485
|
loading = false,
|
|
5378
5486
|
loadingRows = 5,
|
|
@@ -5386,24 +5494,48 @@ function DataTable({
|
|
|
5386
5494
|
const titleId = (0, import_react28.useId)();
|
|
5387
5495
|
const head = HEAD_PAD[density];
|
|
5388
5496
|
const pad2 = CELL_PAD[density];
|
|
5389
|
-
const
|
|
5390
|
-
const
|
|
5497
|
+
const right = (c) => c.numeric || c.rank;
|
|
5498
|
+
const align = (c) => right(c) ? "text-right" : "text-left";
|
|
5499
|
+
const width = (c) => c.rank ? "w-12" : WIDTH3[c.width ?? (c.numeric ? "md" : "fill")];
|
|
5500
|
+
const shown = sort ?? defaultSort;
|
|
5391
5501
|
const onSort = (key) => {
|
|
5392
5502
|
const col = columns.find((c) => c.key === key);
|
|
5393
|
-
onSortChange?.(cycleSort(
|
|
5503
|
+
onSortChange?.(cycleSort(shown, key, col?.firstDir ?? (right(col) ? "desc" : "asc"), defaultSort));
|
|
5394
5504
|
};
|
|
5395
|
-
|
|
5505
|
+
const [open, setOpen] = (0, import_react28.useState)(() => /* @__PURE__ */ new Set());
|
|
5506
|
+
const visibleKeys = rows.map(rowKey).join("|");
|
|
5507
|
+
(0, import_react28.useEffect)(() => setOpen(/* @__PURE__ */ new Set()), [shown?.key, shown?.dir, visibleKeys]);
|
|
5508
|
+
const expandable = (row) => !!renderExpanded && (canExpand ? canExpand(row) : true);
|
|
5509
|
+
const anyExpandable = !!renderExpanded && rows.some(expandable);
|
|
5510
|
+
const toggle = (key) => setOpen((prev) => {
|
|
5511
|
+
const next = new Set(prev);
|
|
5512
|
+
if (next.has(key)) next.delete(key);
|
|
5513
|
+
else next.add(key);
|
|
5514
|
+
return next;
|
|
5515
|
+
});
|
|
5516
|
+
const onRowClick = (e, key) => {
|
|
5517
|
+
if (e.target.closest(OWN_CLICK)) return;
|
|
5518
|
+
if (window.getSelection?.()?.toString()) return;
|
|
5519
|
+
toggle(key);
|
|
5520
|
+
};
|
|
5521
|
+
const span = columns.length + (anyExpandable ? 1 : 0);
|
|
5522
|
+
const renderCell = (c, row) => {
|
|
5523
|
+
const v = c.cell(row);
|
|
5524
|
+
return v === null || v === void 0 || v === "" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NoValue, { reason: c.missing }) : v;
|
|
5525
|
+
};
|
|
5526
|
+
const inside = variant === "chart";
|
|
5527
|
+
const frame = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5396
5528
|
"div",
|
|
5397
5529
|
{
|
|
5398
|
-
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
|
|
5530
|
+
className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
|
|
5399
5531
|
"data-testid": testIdPrefix,
|
|
5400
5532
|
children: [
|
|
5401
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5533
|
+
title && inside && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
5402
5534
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0", children: [
|
|
5403
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { id: titleId, className: "text-
|
|
5404
|
-
subtitle && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
|
|
5535
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { id: titleId, className: "text-panel-title font-semibold text-text-primary", children: title }),
|
|
5536
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
|
|
5405
5537
|
] }),
|
|
5406
|
-
action && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "shrink-0", children: action })
|
|
5538
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
|
|
5407
5539
|
] }),
|
|
5408
5540
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5409
5541
|
"table",
|
|
@@ -5413,42 +5545,94 @@ function DataTable({
|
|
|
5413
5545
|
"aria-busy": loading || void 0,
|
|
5414
5546
|
className: "w-full border-collapse text-left",
|
|
5415
5547
|
children: [
|
|
5416
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime54.
|
|
5417
|
-
"th",
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5548
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: [
|
|
5549
|
+
anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("th", { scope: "col", className: cn("w-10 border-b border-border-default", head), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "sr-only", children: "Details" }) }),
|
|
5550
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5551
|
+
"th",
|
|
5552
|
+
{
|
|
5553
|
+
scope: "col",
|
|
5554
|
+
"aria-sort": c.sortable ? ariaSortFor(shown, c.key) : void 0,
|
|
5555
|
+
className: cn("group/head whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
5556
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5557
|
+
SortButton,
|
|
5558
|
+
{
|
|
5559
|
+
label: c.label,
|
|
5560
|
+
sortKey: c.key,
|
|
5561
|
+
align: right(c) ? "right" : "left",
|
|
5562
|
+
sort: sortProp(shown),
|
|
5563
|
+
onSort,
|
|
5564
|
+
description: c.info,
|
|
5565
|
+
testIdPrefix
|
|
5566
|
+
}
|
|
5567
|
+
) : c.info ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SortButton, { label: c.label, sortKey: c.key, sortable: false, sort: sortProp(shown), onSort: () => {
|
|
5568
|
+
}, description: c.info, align: right(c) ? "right" : "left" }) : c.label
|
|
5569
|
+
},
|
|
5570
|
+
c.key
|
|
5571
|
+
))
|
|
5572
|
+
] }) }),
|
|
5573
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: [
|
|
5574
|
+
anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: cn("border-b border-border-default", pad2) }),
|
|
5575
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: cn("border-b border-border-default", pad2, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5576
|
+
"span",
|
|
5577
|
+
{
|
|
5578
|
+
className: cn(
|
|
5579
|
+
"inline-block h-3 animate-pulse rounded-full bg-subtle",
|
|
5580
|
+
c.numeric ? "w-12" : "w-2/3"
|
|
5581
|
+
)
|
|
5582
|
+
}
|
|
5583
|
+
) }, c.key))
|
|
5584
|
+
] }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { colSpan: span, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row, index) => {
|
|
5585
|
+
const key = rowKey(row);
|
|
5586
|
+
const canOpen = expandable(row);
|
|
5587
|
+
const isOpen = canOpen && open.has(key);
|
|
5588
|
+
const panelId = `${titleId}-row-${index}`;
|
|
5589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react28.Fragment, { children: [
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5591
|
+
"tr",
|
|
5424
5592
|
{
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5593
|
+
onClick: canOpen ? (e) => onRowClick(e, key) : void 0,
|
|
5594
|
+
className: cn("hover:bg-subtle [&:last-child>td]:border-b-0", canOpen && "cursor-pointer", isOpen && "bg-subtle"),
|
|
5595
|
+
children: [
|
|
5596
|
+
anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: cn("border-b border-border-default pr-0", pad2, isOpen && "border-b-0"), children: canOpen && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5597
|
+
"button",
|
|
5598
|
+
{
|
|
5599
|
+
type: "button",
|
|
5600
|
+
"aria-expanded": isOpen,
|
|
5601
|
+
"aria-controls": isOpen ? panelId : void 0,
|
|
5602
|
+
"aria-label": `${isOpen ? "Hide" : "Show"} details${rowLabel ? ` for ${rowLabel(row)}` : ""}`,
|
|
5603
|
+
onClick: () => toggle(key),
|
|
5604
|
+
className: "flex size-6 items-center justify-center rounded-control text-text-tertiary hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
|
|
5605
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5606
|
+
import_lucide_react29.ChevronRight,
|
|
5607
|
+
{
|
|
5608
|
+
size: 16,
|
|
5609
|
+
"aria-hidden": "true",
|
|
5610
|
+
className: cn("transition-transform motion-reduce:transition-none", isOpen && "rotate-90")
|
|
5611
|
+
}
|
|
5612
|
+
)
|
|
5613
|
+
}
|
|
5614
|
+
) }),
|
|
5615
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5616
|
+
"td",
|
|
5617
|
+
{
|
|
5618
|
+
className: cn(
|
|
5619
|
+
"border-b border-border-default",
|
|
5620
|
+
pad2,
|
|
5621
|
+
align(c),
|
|
5622
|
+
right(c) && "tabular-nums",
|
|
5623
|
+
c.rank && "text-text-tertiary",
|
|
5624
|
+
isOpen && "border-b-0"
|
|
5625
|
+
),
|
|
5626
|
+
children: renderCell(c, row)
|
|
5627
|
+
},
|
|
5628
|
+
c.key
|
|
5629
|
+
))
|
|
5630
|
+
]
|
|
5431
5631
|
}
|
|
5432
|
-
)
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: cn("border-b border-border-default", pad2, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5437
|
-
"span",
|
|
5438
|
-
{
|
|
5439
|
-
className: cn(
|
|
5440
|
-
"inline-block h-3 animate-pulse rounded-full bg-subtle",
|
|
5441
|
-
c.numeric ? "w-12" : "w-2/3"
|
|
5442
|
-
)
|
|
5443
|
-
}
|
|
5444
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5445
|
-
"td",
|
|
5446
|
-
{
|
|
5447
|
-
className: cn("border-b border-border-default", pad2, align(c), c.numeric && "tabular-nums"),
|
|
5448
|
-
children: c.cell(row)
|
|
5449
|
-
},
|
|
5450
|
-
c.key
|
|
5451
|
-
)) }, rowKey(row))) })
|
|
5632
|
+
),
|
|
5633
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "[&:last-child>td]:border-b-0", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { id: panelId, colSpan: span, className: "border-b border-border-default bg-subtle px-4 pb-4 pl-14", children: renderExpanded(row) }) })
|
|
5634
|
+
] }, key);
|
|
5635
|
+
}) })
|
|
5452
5636
|
]
|
|
5453
5637
|
}
|
|
5454
5638
|
) }),
|
|
@@ -5456,6 +5640,11 @@ function DataTable({
|
|
|
5456
5640
|
]
|
|
5457
5641
|
}
|
|
5458
5642
|
);
|
|
5643
|
+
if (!title || inside) return frame;
|
|
5644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("section", { "aria-labelledby": titleId, className: cn("flex w-full flex-col gap-3", className), children: [
|
|
5645
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SectionHeading, { id: titleId, as: titleAs, title, description: subtitle, actions: action }),
|
|
5646
|
+
frame
|
|
5647
|
+
] });
|
|
5459
5648
|
}
|
|
5460
5649
|
|
|
5461
5650
|
// src/MediaLabel.tsx
|
|
@@ -5507,7 +5696,7 @@ SuggestionChip.displayName = "SuggestionChip";
|
|
|
5507
5696
|
|
|
5508
5697
|
// src/ToggleChip.tsx
|
|
5509
5698
|
var import_react30 = require("react");
|
|
5510
|
-
var
|
|
5699
|
+
var import_lucide_react30 = require("lucide-react");
|
|
5511
5700
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5512
5701
|
var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
|
|
5513
5702
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
@@ -5528,7 +5717,7 @@ var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected,
|
|
|
5528
5717
|
className
|
|
5529
5718
|
),
|
|
5530
5719
|
children: [
|
|
5531
|
-
selected && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5720
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react30.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
5532
5721
|
children
|
|
5533
5722
|
]
|
|
5534
5723
|
}
|
|
@@ -5538,7 +5727,7 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
5538
5727
|
|
|
5539
5728
|
// src/CopyButton.tsx
|
|
5540
5729
|
var import_react31 = require("react");
|
|
5541
|
-
var
|
|
5730
|
+
var import_lucide_react31 = require("lucide-react");
|
|
5542
5731
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5543
5732
|
var CONFIRM_MS = 2e3;
|
|
5544
5733
|
var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
|
|
@@ -5556,7 +5745,7 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5556
5745
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
5557
5746
|
};
|
|
5558
5747
|
const iconSize = size === "xs" ? 13 : 15;
|
|
5559
|
-
const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5748
|
+
const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react31.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react31.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
5560
5749
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5561
5750
|
Button,
|
|
5562
5751
|
{
|
|
@@ -5580,7 +5769,7 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
|
|
|
5580
5769
|
CopyButton.displayName = "CopyButton";
|
|
5581
5770
|
|
|
5582
5771
|
// src/InlineMessage.tsx
|
|
5583
|
-
var
|
|
5772
|
+
var import_lucide_react32 = require("lucide-react");
|
|
5584
5773
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5585
5774
|
var BOX = {
|
|
5586
5775
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
@@ -5595,7 +5784,7 @@ var ICON_INK = {
|
|
|
5595
5784
|
warning: "text-text-warning",
|
|
5596
5785
|
danger: "text-text-danger"
|
|
5597
5786
|
};
|
|
5598
|
-
var ICON2 = { info:
|
|
5787
|
+
var ICON2 = { info: import_lucide_react32.Info, success: import_lucide_react32.CheckCircle2, warning: import_lucide_react32.AlertTriangle, danger: import_lucide_react32.XCircle };
|
|
5599
5788
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
|
|
5600
5789
|
const Icon = ICON2[tone];
|
|
5601
5790
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
@@ -5618,7 +5807,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5618
5807
|
onClick: onDismiss,
|
|
5619
5808
|
"aria-label": "Dismiss",
|
|
5620
5809
|
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",
|
|
5621
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5810
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react32.X, { size: 14, "aria-hidden": "true" })
|
|
5622
5811
|
}
|
|
5623
5812
|
)
|
|
5624
5813
|
]
|
|
@@ -5628,7 +5817,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
5628
5817
|
|
|
5629
5818
|
// src/FilterDrawer.tsx
|
|
5630
5819
|
var import_react32 = require("react");
|
|
5631
|
-
var
|
|
5820
|
+
var import_lucide_react33 = require("lucide-react");
|
|
5632
5821
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5633
5822
|
var SLIDE_MS = 200;
|
|
5634
5823
|
function reducedMotion() {
|
|
@@ -5714,7 +5903,7 @@ function FilterDrawer({
|
|
|
5714
5903
|
),
|
|
5715
5904
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
|
|
5716
5905
|
x.badge && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Badge, { tone: "brand", children: x.badge }),
|
|
5717
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5906
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react33.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5718
5907
|
]
|
|
5719
5908
|
}
|
|
5720
5909
|
) }, x.id)) });
|
|
@@ -5736,7 +5925,7 @@ function FilterDrawer({
|
|
|
5736
5925
|
"aria-label": "Back to all filters",
|
|
5737
5926
|
"data-testid": testIdPrefix && `${testIdPrefix}-back`,
|
|
5738
5927
|
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",
|
|
5739
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react33.ChevronLeft, { size: 18, "aria-hidden": "true" })
|
|
5740
5929
|
}
|
|
5741
5930
|
),
|
|
5742
5931
|
focused.label,
|
|
@@ -5793,7 +5982,7 @@ function FilterDrawer({
|
|
|
5793
5982
|
|
|
5794
5983
|
// src/AllFiltersButton.tsx
|
|
5795
5984
|
var import_react33 = require("react");
|
|
5796
|
-
var
|
|
5985
|
+
var import_lucide_react34 = require("lucide-react");
|
|
5797
5986
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5798
5987
|
var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
|
|
5799
5988
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
@@ -5808,7 +5997,7 @@ var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2
|
|
|
5808
5997
|
className: cn(chipTriggerClass(), className),
|
|
5809
5998
|
...rest,
|
|
5810
5999
|
children: [
|
|
5811
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6000
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react34.SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
|
|
5812
6001
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
|
|
5813
6002
|
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brandSolid", kind: "count", children: count })
|
|
5814
6003
|
]
|
|
@@ -5819,7 +6008,7 @@ var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2
|
|
|
5819
6008
|
// src/Menu.tsx
|
|
5820
6009
|
var import_react34 = require("react");
|
|
5821
6010
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
5822
|
-
var
|
|
6011
|
+
var import_lucide_react35 = require("lucide-react");
|
|
5823
6012
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5824
6013
|
var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
|
|
5825
6014
|
function moveFocus(e) {
|
|
@@ -5864,8 +6053,8 @@ var MenuItem = (0, import_react34.forwardRef)(
|
|
|
5864
6053
|
description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "block truncate text-xs text-text-tertiary", children: description })
|
|
5865
6054
|
] }),
|
|
5866
6055
|
trailing && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
|
|
5867
|
-
radio && checked && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5868
|
-
submenu && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6056
|
+
radio && checked && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react35.Check, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
|
|
6057
|
+
submenu && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react35.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
|
|
5869
6058
|
] });
|
|
5870
6059
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5871
6060
|
Comp,
|
|
@@ -6017,6 +6206,19 @@ function defaultDateOrder(country) {
|
|
|
6017
6206
|
const c = (country ?? "").toUpperCase();
|
|
6018
6207
|
return c === "US" || c === "CA" || c === "" ? "mdy" : "dmy";
|
|
6019
6208
|
}
|
|
6209
|
+
|
|
6210
|
+
// src/Figure.tsx
|
|
6211
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6212
|
+
function Figure({ value, kind = "money", missing, ...opts }) {
|
|
6213
|
+
if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(NoValue, { reason: missing });
|
|
6214
|
+
const short = kind === "money" ? formatMoney(value, opts) : formatCount(value, opts);
|
|
6215
|
+
const full = kind === "money" ? formatMoneyFull(value, opts) : formatCountFull(value);
|
|
6216
|
+
if (short === full) return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: short });
|
|
6217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Tooltip, { label: full, delay: 300, children: [
|
|
6218
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { "aria-hidden": "true", children: short }),
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "sr-only", children: full })
|
|
6220
|
+
] });
|
|
6221
|
+
}
|
|
6020
6222
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6021
6223
|
0 && (module.exports = {
|
|
6022
6224
|
AISpark,
|
|
@@ -6042,6 +6244,7 @@ function defaultDateOrder(country) {
|
|
|
6042
6244
|
Delta,
|
|
6043
6245
|
Drawer,
|
|
6044
6246
|
EmptyState,
|
|
6247
|
+
Figure,
|
|
6045
6248
|
FilterChipBar,
|
|
6046
6249
|
FilterDrawer,
|
|
6047
6250
|
FilterDropdownFooter,
|
|
@@ -6059,8 +6262,10 @@ function defaultDateOrder(country) {
|
|
|
6059
6262
|
MultiSelectFilter,
|
|
6060
6263
|
NO_RESULTS_BODY,
|
|
6061
6264
|
NO_RESULTS_TITLE,
|
|
6265
|
+
NO_VALUE,
|
|
6062
6266
|
NameListModal,
|
|
6063
6267
|
NoResultsEmptyState,
|
|
6268
|
+
NoValue,
|
|
6064
6269
|
PRIMARY_ACTION_CLASS,
|
|
6065
6270
|
PageHeader,
|
|
6066
6271
|
Pager,
|
|
@@ -6081,6 +6286,7 @@ function defaultDateOrder(country) {
|
|
|
6081
6286
|
StatStrip,
|
|
6082
6287
|
StatTile,
|
|
6083
6288
|
SuggestionChip,
|
|
6289
|
+
TableLink,
|
|
6084
6290
|
TablePagination,
|
|
6085
6291
|
Tabs,
|
|
6086
6292
|
Tag,
|
|
@@ -6096,13 +6302,18 @@ function defaultDateOrder(country) {
|
|
|
6096
6302
|
chipTriggerClass,
|
|
6097
6303
|
cycleSort,
|
|
6098
6304
|
defaultDateOrder,
|
|
6305
|
+
formatCount,
|
|
6306
|
+
formatCountFull,
|
|
6099
6307
|
formatDate,
|
|
6100
6308
|
formatDateRange,
|
|
6101
6309
|
formatDateTime,
|
|
6102
6310
|
formatIsoDate,
|
|
6311
|
+
formatMoney,
|
|
6312
|
+
formatMoneyFull,
|
|
6103
6313
|
formatMonth,
|
|
6104
6314
|
formatMonthAxis,
|
|
6105
6315
|
formatOpenRange,
|
|
6316
|
+
formatPercent,
|
|
6106
6317
|
formatQuarter,
|
|
6107
6318
|
formatRelative,
|
|
6108
6319
|
formatTime,
|