@mediaradar/design-components 0.32.0 → 0.33.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/index.cjs +172 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -18
- package/dist/index.d.ts +100 -18
- package/dist/index.js +169 -45
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,7 @@ __export(index_exports, {
|
|
|
39
39
|
DateRangeFilter: () => DateRangeFilter,
|
|
40
40
|
DateRangePicker: () => DateRangePicker,
|
|
41
41
|
Delta: () => Delta,
|
|
42
|
+
Drawer: () => Drawer,
|
|
42
43
|
EmptyState: () => EmptyState,
|
|
43
44
|
FilterChipBar: () => FilterChipBar,
|
|
44
45
|
FilterDropdownFooter: () => FilterDropdownFooter,
|
|
@@ -4201,7 +4202,8 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
|
|
|
4201
4202
|
(0, import_react19.useEffect)(() => {
|
|
4202
4203
|
if (!open) return;
|
|
4203
4204
|
const opener = document.activeElement;
|
|
4204
|
-
const
|
|
4205
|
+
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE) ?? null;
|
|
4206
|
+
const first = firstIn("[data-modal-body]") ?? firstIn("[data-modal-footer]");
|
|
4205
4207
|
(first ?? panel.current)?.focus();
|
|
4206
4208
|
const overflow = document.body.style.overflow;
|
|
4207
4209
|
document.body.style.overflow = "hidden";
|
|
@@ -4446,10 +4448,132 @@ var TextField = (0, import_react21.forwardRef)(
|
|
|
4446
4448
|
);
|
|
4447
4449
|
TextField.displayName = "TextField";
|
|
4448
4450
|
|
|
4449
|
-
// src/
|
|
4451
|
+
// src/Drawer.tsx
|
|
4450
4452
|
var import_react22 = require("react");
|
|
4453
|
+
var import_react_dom8 = require("react-dom");
|
|
4454
|
+
var import_lucide_react27 = require("lucide-react");
|
|
4451
4455
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4452
|
-
var WIDTH2 = {
|
|
4456
|
+
var WIDTH2 = {
|
|
4457
|
+
sm: "max-w-110",
|
|
4458
|
+
md: "max-w-160",
|
|
4459
|
+
lg: "max-w-230"
|
|
4460
|
+
};
|
|
4461
|
+
var EXIT_MS = 200;
|
|
4462
|
+
var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
4463
|
+
function Drawer({ open, onClose, title, description, size = "sm", footer, children, className }) {
|
|
4464
|
+
const titleId = (0, import_react22.useId)();
|
|
4465
|
+
const descId = (0, import_react22.useId)();
|
|
4466
|
+
const panel = (0, import_react22.useRef)(null);
|
|
4467
|
+
const close = (0, import_react22.useRef)(onClose);
|
|
4468
|
+
close.current = onClose;
|
|
4469
|
+
const [mounted, setMounted] = (0, import_react22.useState)(open);
|
|
4470
|
+
const [shown, setShown] = (0, import_react22.useState)(false);
|
|
4471
|
+
(0, import_react22.useEffect)(() => {
|
|
4472
|
+
if (open) {
|
|
4473
|
+
setMounted(true);
|
|
4474
|
+
const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
|
|
4475
|
+
return () => cancelAnimationFrame(raf);
|
|
4476
|
+
}
|
|
4477
|
+
setShown(false);
|
|
4478
|
+
const t = setTimeout(() => setMounted(false), EXIT_MS);
|
|
4479
|
+
return () => clearTimeout(t);
|
|
4480
|
+
}, [open]);
|
|
4481
|
+
(0, import_react22.useEffect)(() => {
|
|
4482
|
+
if (!open || !mounted) return;
|
|
4483
|
+
const opener = document.activeElement;
|
|
4484
|
+
const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE2) ?? null;
|
|
4485
|
+
const first = firstIn("[data-drawer-body]") ?? firstIn("[data-drawer-footer]");
|
|
4486
|
+
(first ?? panel.current)?.focus({ preventScroll: true });
|
|
4487
|
+
const overflow = document.body.style.overflow;
|
|
4488
|
+
document.body.style.overflow = "hidden";
|
|
4489
|
+
const onKey = (e) => {
|
|
4490
|
+
if (e.key === "Escape") {
|
|
4491
|
+
e.stopPropagation();
|
|
4492
|
+
close.current();
|
|
4493
|
+
return;
|
|
4494
|
+
}
|
|
4495
|
+
if (e.key !== "Tab" || !panel.current) return;
|
|
4496
|
+
const items = Array.from(panel.current.querySelectorAll(FOCUSABLE2));
|
|
4497
|
+
if (items.length === 0) return;
|
|
4498
|
+
const [head, tail] = [items[0], items[items.length - 1]];
|
|
4499
|
+
if (e.shiftKey && document.activeElement === head) {
|
|
4500
|
+
e.preventDefault();
|
|
4501
|
+
tail.focus();
|
|
4502
|
+
} else if (!e.shiftKey && document.activeElement === tail) {
|
|
4503
|
+
e.preventDefault();
|
|
4504
|
+
head.focus();
|
|
4505
|
+
}
|
|
4506
|
+
};
|
|
4507
|
+
document.addEventListener("keydown", onKey);
|
|
4508
|
+
return () => {
|
|
4509
|
+
document.removeEventListener("keydown", onKey);
|
|
4510
|
+
document.body.style.overflow = overflow;
|
|
4511
|
+
opener?.focus?.();
|
|
4512
|
+
};
|
|
4513
|
+
}, [open, mounted]);
|
|
4514
|
+
if (!mounted || typeof document === "undefined") return null;
|
|
4515
|
+
return (0, import_react_dom8.createPortal)(
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "fixed inset-0 z-modal", children: [
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4518
|
+
"div",
|
|
4519
|
+
{
|
|
4520
|
+
"aria-hidden": "true",
|
|
4521
|
+
onMouseDown: (e) => {
|
|
4522
|
+
e.preventDefault();
|
|
4523
|
+
onClose();
|
|
4524
|
+
},
|
|
4525
|
+
className: cn(
|
|
4526
|
+
"absolute inset-0 bg-scrim transition-opacity duration-(--mr-motion-duration-interactive) ease-interactive motion-reduce:transition-none",
|
|
4527
|
+
shown ? "opacity-100" : "opacity-0"
|
|
4528
|
+
)
|
|
4529
|
+
}
|
|
4530
|
+
),
|
|
4531
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4532
|
+
"div",
|
|
4533
|
+
{
|
|
4534
|
+
ref: panel,
|
|
4535
|
+
role: "dialog",
|
|
4536
|
+
"aria-modal": "true",
|
|
4537
|
+
"aria-labelledby": titleId,
|
|
4538
|
+
"aria-describedby": description ? descId : void 0,
|
|
4539
|
+
tabIndex: -1,
|
|
4540
|
+
className: cn(
|
|
4541
|
+
"absolute inset-y-0 right-0 flex w-full flex-col border-l border-border-default bg-surface shadow-overlay outline-hidden transition-transform duration-(--mr-motion-duration-interactive) ease-interactive motion-reduce:transition-none",
|
|
4542
|
+
shown ? "translate-x-0" : "translate-x-full",
|
|
4543
|
+
WIDTH2[size],
|
|
4544
|
+
className
|
|
4545
|
+
),
|
|
4546
|
+
children: [
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
|
|
4550
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
|
|
4551
|
+
] }),
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4553
|
+
"button",
|
|
4554
|
+
{
|
|
4555
|
+
type: "button",
|
|
4556
|
+
onClick: onClose,
|
|
4557
|
+
"aria-label": "Close",
|
|
4558
|
+
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-2 focus-visible:outline-border-focus",
|
|
4559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react27.X, { size: 16, "aria-hidden": "true" })
|
|
4560
|
+
}
|
|
4561
|
+
)
|
|
4562
|
+
] }),
|
|
4563
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { "data-drawer-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
|
|
4564
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
|
|
4565
|
+
]
|
|
4566
|
+
}
|
|
4567
|
+
)
|
|
4568
|
+
] }),
|
|
4569
|
+
document.body
|
|
4570
|
+
);
|
|
4571
|
+
}
|
|
4572
|
+
|
|
4573
|
+
// src/DataTable.tsx
|
|
4574
|
+
var import_react23 = require("react");
|
|
4575
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4576
|
+
var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
|
|
4453
4577
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
4454
4578
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
4455
4579
|
var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
|
|
@@ -4471,24 +4595,24 @@ function DataTable({
|
|
|
4471
4595
|
className,
|
|
4472
4596
|
...rest
|
|
4473
4597
|
}) {
|
|
4474
|
-
const titleId = (0,
|
|
4598
|
+
const titleId = (0, import_react23.useId)();
|
|
4475
4599
|
const head = HEAD_PAD[density];
|
|
4476
4600
|
const pad = CELL_PAD[density];
|
|
4477
4601
|
const align = (c) => c.numeric ? "text-right" : "text-left";
|
|
4478
|
-
const width = (c) =>
|
|
4602
|
+
const width = (c) => WIDTH3[c.width ?? (c.numeric ? "md" : "fill")];
|
|
4479
4603
|
const onSort = (key) => {
|
|
4480
4604
|
const col = columns.find((c) => c.key === key);
|
|
4481
4605
|
onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
|
|
4482
4606
|
};
|
|
4483
|
-
return /* @__PURE__ */ (0,
|
|
4484
|
-
title && /* @__PURE__ */ (0,
|
|
4485
|
-
/* @__PURE__ */ (0,
|
|
4486
|
-
/* @__PURE__ */ (0,
|
|
4487
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className), children: [
|
|
4608
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "min-w-0", children: [
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
|
|
4611
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
|
|
4488
4612
|
] }),
|
|
4489
|
-
action && /* @__PURE__ */ (0,
|
|
4613
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "shrink-0", children: action })
|
|
4490
4614
|
] }),
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4615
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4492
4616
|
"table",
|
|
4493
4617
|
{
|
|
4494
4618
|
"aria-labelledby": title ? titleId : void 0,
|
|
@@ -4496,13 +4620,13 @@ function DataTable({
|
|
|
4496
4620
|
"aria-busy": loading || void 0,
|
|
4497
4621
|
className: "w-full border-collapse text-left",
|
|
4498
4622
|
children: [
|
|
4499
|
-
/* @__PURE__ */ (0,
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4500
4624
|
"th",
|
|
4501
4625
|
{
|
|
4502
4626
|
scope: "col",
|
|
4503
4627
|
"aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
|
|
4504
4628
|
className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
4505
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */ (0,
|
|
4629
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4506
4630
|
SortButton,
|
|
4507
4631
|
{
|
|
4508
4632
|
label: c.label,
|
|
@@ -4515,7 +4639,7 @@ function DataTable({
|
|
|
4515
4639
|
},
|
|
4516
4640
|
c.key
|
|
4517
4641
|
)) }) }),
|
|
4518
|
-
/* @__PURE__ */ (0,
|
|
4642
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4519
4643
|
"span",
|
|
4520
4644
|
{
|
|
4521
4645
|
className: cn(
|
|
@@ -4523,7 +4647,7 @@ function DataTable({
|
|
|
4523
4647
|
c.numeric ? "w-12" : "w-2/3"
|
|
4524
4648
|
)
|
|
4525
4649
|
}
|
|
4526
|
-
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0,
|
|
4650
|
+
) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4527
4651
|
"td",
|
|
4528
4652
|
{
|
|
4529
4653
|
className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
|
|
@@ -4534,12 +4658,12 @@ function DataTable({
|
|
|
4534
4658
|
]
|
|
4535
4659
|
}
|
|
4536
4660
|
) }),
|
|
4537
|
-
footer && /* @__PURE__ */ (0,
|
|
4661
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
4538
4662
|
] });
|
|
4539
4663
|
}
|
|
4540
4664
|
|
|
4541
4665
|
// src/MediaLabel.tsx
|
|
4542
|
-
var
|
|
4666
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4543
4667
|
var FILL = {
|
|
4544
4668
|
TV: "bg-media-tv",
|
|
4545
4669
|
CTV: "bg-media-ctv",
|
|
@@ -4550,7 +4674,7 @@ var FILL = {
|
|
|
4550
4674
|
Magazine: "bg-media-magazine"
|
|
4551
4675
|
};
|
|
4552
4676
|
function MediaLabel({ type, className }) {
|
|
4553
|
-
return /* @__PURE__ */ (0,
|
|
4677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4554
4678
|
"span",
|
|
4555
4679
|
{
|
|
4556
4680
|
className: cn(
|
|
@@ -4564,9 +4688,9 @@ function MediaLabel({ type, className }) {
|
|
|
4564
4688
|
}
|
|
4565
4689
|
|
|
4566
4690
|
// src/SuggestionChip.tsx
|
|
4567
|
-
var
|
|
4691
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4568
4692
|
function SuggestionChip({ children, className, type = "button", ...props }) {
|
|
4569
|
-
return /* @__PURE__ */ (0,
|
|
4693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4570
4694
|
"button",
|
|
4571
4695
|
{
|
|
4572
4696
|
type,
|
|
@@ -4575,16 +4699,16 @@ function SuggestionChip({ children, className, type = "button", ...props }) {
|
|
|
4575
4699
|
"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-2 focus-visible:outline-border-focus",
|
|
4576
4700
|
className
|
|
4577
4701
|
),
|
|
4578
|
-
children: /* @__PURE__ */ (0,
|
|
4702
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "truncate", children })
|
|
4579
4703
|
}
|
|
4580
4704
|
);
|
|
4581
4705
|
}
|
|
4582
4706
|
|
|
4583
4707
|
// src/ToggleChip.tsx
|
|
4584
|
-
var
|
|
4585
|
-
var
|
|
4708
|
+
var import_lucide_react28 = require("lucide-react");
|
|
4709
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4586
4710
|
function ToggleChip({ selected, onChange, children, className, type = "button", onClick, ...props }) {
|
|
4587
|
-
return /* @__PURE__ */ (0,
|
|
4711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4588
4712
|
"button",
|
|
4589
4713
|
{
|
|
4590
4714
|
type,
|
|
@@ -4600,7 +4724,7 @@ function ToggleChip({ selected, onChange, children, className, type = "button",
|
|
|
4600
4724
|
className
|
|
4601
4725
|
),
|
|
4602
4726
|
children: [
|
|
4603
|
-
selected && /* @__PURE__ */ (0,
|
|
4727
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
|
|
4604
4728
|
children
|
|
4605
4729
|
]
|
|
4606
4730
|
}
|
|
@@ -4608,14 +4732,14 @@ function ToggleChip({ selected, onChange, children, className, type = "button",
|
|
|
4608
4732
|
}
|
|
4609
4733
|
|
|
4610
4734
|
// src/CopyButton.tsx
|
|
4611
|
-
var
|
|
4612
|
-
var
|
|
4613
|
-
var
|
|
4735
|
+
var import_react24 = require("react");
|
|
4736
|
+
var import_lucide_react29 = require("lucide-react");
|
|
4737
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4614
4738
|
var CONFIRM_MS = 2e3;
|
|
4615
4739
|
function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", className }) {
|
|
4616
|
-
const [copied, setCopied] = (0,
|
|
4617
|
-
const timer = (0,
|
|
4618
|
-
(0,
|
|
4740
|
+
const [copied, setCopied] = (0, import_react24.useState)(false);
|
|
4741
|
+
const timer = (0, import_react24.useRef)(void 0);
|
|
4742
|
+
(0, import_react24.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
4619
4743
|
const copy = async () => {
|
|
4620
4744
|
try {
|
|
4621
4745
|
await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
|
|
@@ -4627,8 +4751,8 @@ function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", classN
|
|
|
4627
4751
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
4628
4752
|
};
|
|
4629
4753
|
const iconSize = size === "xs" ? 13 : 15;
|
|
4630
|
-
const icon = copied ? /* @__PURE__ */ (0,
|
|
4631
|
-
return /* @__PURE__ */ (0,
|
|
4754
|
+
const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
|
|
4755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4632
4756
|
Button,
|
|
4633
4757
|
{
|
|
4634
4758
|
type: "button",
|
|
@@ -4640,16 +4764,16 @@ function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", classN
|
|
|
4640
4764
|
className: cn(!copied && "text-text-secondary", className),
|
|
4641
4765
|
children: [
|
|
4642
4766
|
icon,
|
|
4643
|
-
label && /* @__PURE__ */ (0,
|
|
4644
|
-
/* @__PURE__ */ (0,
|
|
4767
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: copied ? "Copied" : label }),
|
|
4768
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
|
|
4645
4769
|
]
|
|
4646
4770
|
}
|
|
4647
4771
|
);
|
|
4648
4772
|
}
|
|
4649
4773
|
|
|
4650
4774
|
// src/InlineMessage.tsx
|
|
4651
|
-
var
|
|
4652
|
-
var
|
|
4775
|
+
var import_lucide_react30 = require("lucide-react");
|
|
4776
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4653
4777
|
var BOX = {
|
|
4654
4778
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
4655
4779
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -4663,29 +4787,29 @@ var ICON_INK = {
|
|
|
4663
4787
|
warning: "text-text-warning",
|
|
4664
4788
|
danger: "text-text-danger"
|
|
4665
4789
|
};
|
|
4666
|
-
var ICON2 = { info:
|
|
4790
|
+
var ICON2 = { info: import_lucide_react30.Info, success: import_lucide_react30.CheckCircle2, warning: import_lucide_react30.AlertTriangle, danger: import_lucide_react30.XCircle };
|
|
4667
4791
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className }) {
|
|
4668
4792
|
const Icon = ICON2[tone];
|
|
4669
|
-
return /* @__PURE__ */ (0,
|
|
4793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4670
4794
|
"div",
|
|
4671
4795
|
{
|
|
4672
4796
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
4673
4797
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
4674
4798
|
children: [
|
|
4675
|
-
/* @__PURE__ */ (0,
|
|
4676
|
-
/* @__PURE__ */ (0,
|
|
4677
|
-
/* @__PURE__ */ (0,
|
|
4678
|
-
children && /* @__PURE__ */ (0,
|
|
4679
|
-
actions && /* @__PURE__ */ (0,
|
|
4799
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
4801
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
|
|
4802
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
|
|
4803
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
|
|
4680
4804
|
] }),
|
|
4681
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
4805
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4682
4806
|
"button",
|
|
4683
4807
|
{
|
|
4684
4808
|
type: "button",
|
|
4685
4809
|
onClick: onDismiss,
|
|
4686
4810
|
"aria-label": "Dismiss",
|
|
4687
4811
|
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",
|
|
4688
|
-
children: /* @__PURE__ */ (0,
|
|
4812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react30.X, { size: 14, "aria-hidden": "true" })
|
|
4689
4813
|
}
|
|
4690
4814
|
)
|
|
4691
4815
|
]
|
|
@@ -4712,6 +4836,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
4712
4836
|
DateRangeFilter,
|
|
4713
4837
|
DateRangePicker,
|
|
4714
4838
|
Delta,
|
|
4839
|
+
Drawer,
|
|
4715
4840
|
EmptyState,
|
|
4716
4841
|
FilterChipBar,
|
|
4717
4842
|
FilterDropdownFooter,
|