@mediaradar/design-components 0.32.1 → 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 +170 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -1
- package/dist/index.d.ts +71 -1
- package/dist/index.js +167 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,
|
|
@@ -4447,10 +4448,132 @@ var TextField = (0, import_react21.forwardRef)(
|
|
|
4447
4448
|
);
|
|
4448
4449
|
TextField.displayName = "TextField";
|
|
4449
4450
|
|
|
4450
|
-
// src/
|
|
4451
|
+
// src/Drawer.tsx
|
|
4451
4452
|
var import_react22 = require("react");
|
|
4453
|
+
var import_react_dom8 = require("react-dom");
|
|
4454
|
+
var import_lucide_react27 = require("lucide-react");
|
|
4452
4455
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4453
|
-
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" };
|
|
4454
4577
|
var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
|
|
4455
4578
|
var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
|
|
4456
4579
|
var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
|
|
@@ -4472,24 +4595,24 @@ function DataTable({
|
|
|
4472
4595
|
className,
|
|
4473
4596
|
...rest
|
|
4474
4597
|
}) {
|
|
4475
|
-
const titleId = (0,
|
|
4598
|
+
const titleId = (0, import_react23.useId)();
|
|
4476
4599
|
const head = HEAD_PAD[density];
|
|
4477
4600
|
const pad = CELL_PAD[density];
|
|
4478
4601
|
const align = (c) => c.numeric ? "text-right" : "text-left";
|
|
4479
|
-
const width = (c) =>
|
|
4602
|
+
const width = (c) => WIDTH3[c.width ?? (c.numeric ? "md" : "fill")];
|
|
4480
4603
|
const onSort = (key) => {
|
|
4481
4604
|
const col = columns.find((c) => c.key === key);
|
|
4482
4605
|
onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
|
|
4483
4606
|
};
|
|
4484
|
-
return /* @__PURE__ */ (0,
|
|
4485
|
-
title && /* @__PURE__ */ (0,
|
|
4486
|
-
/* @__PURE__ */ (0,
|
|
4487
|
-
/* @__PURE__ */ (0,
|
|
4488
|
-
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 })
|
|
4489
4612
|
] }),
|
|
4490
|
-
action && /* @__PURE__ */ (0,
|
|
4613
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "shrink-0", children: action })
|
|
4491
4614
|
] }),
|
|
4492
|
-
/* @__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)(
|
|
4493
4616
|
"table",
|
|
4494
4617
|
{
|
|
4495
4618
|
"aria-labelledby": title ? titleId : void 0,
|
|
@@ -4497,13 +4620,13 @@ function DataTable({
|
|
|
4497
4620
|
"aria-busy": loading || void 0,
|
|
4498
4621
|
className: "w-full border-collapse text-left",
|
|
4499
4622
|
children: [
|
|
4500
|
-
/* @__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)(
|
|
4501
4624
|
"th",
|
|
4502
4625
|
{
|
|
4503
4626
|
scope: "col",
|
|
4504
4627
|
"aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
|
|
4505
4628
|
className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
|
|
4506
|
-
children: c.sortable && onSortChange ? /* @__PURE__ */ (0,
|
|
4629
|
+
children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4507
4630
|
SortButton,
|
|
4508
4631
|
{
|
|
4509
4632
|
label: c.label,
|
|
@@ -4516,7 +4639,7 @@ function DataTable({
|
|
|
4516
4639
|
},
|
|
4517
4640
|
c.key
|
|
4518
4641
|
)) }) }),
|
|
4519
|
-
/* @__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)(
|
|
4520
4643
|
"span",
|
|
4521
4644
|
{
|
|
4522
4645
|
className: cn(
|
|
@@ -4524,7 +4647,7 @@ function DataTable({
|
|
|
4524
4647
|
c.numeric ? "w-12" : "w-2/3"
|
|
4525
4648
|
)
|
|
4526
4649
|
}
|
|
4527
|
-
) }, 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)(
|
|
4528
4651
|
"td",
|
|
4529
4652
|
{
|
|
4530
4653
|
className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
|
|
@@ -4535,12 +4658,12 @@ function DataTable({
|
|
|
4535
4658
|
]
|
|
4536
4659
|
}
|
|
4537
4660
|
) }),
|
|
4538
|
-
footer && /* @__PURE__ */ (0,
|
|
4661
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
|
|
4539
4662
|
] });
|
|
4540
4663
|
}
|
|
4541
4664
|
|
|
4542
4665
|
// src/MediaLabel.tsx
|
|
4543
|
-
var
|
|
4666
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4544
4667
|
var FILL = {
|
|
4545
4668
|
TV: "bg-media-tv",
|
|
4546
4669
|
CTV: "bg-media-ctv",
|
|
@@ -4551,7 +4674,7 @@ var FILL = {
|
|
|
4551
4674
|
Magazine: "bg-media-magazine"
|
|
4552
4675
|
};
|
|
4553
4676
|
function MediaLabel({ type, className }) {
|
|
4554
|
-
return /* @__PURE__ */ (0,
|
|
4677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4555
4678
|
"span",
|
|
4556
4679
|
{
|
|
4557
4680
|
className: cn(
|
|
@@ -4565,9 +4688,9 @@ function MediaLabel({ type, className }) {
|
|
|
4565
4688
|
}
|
|
4566
4689
|
|
|
4567
4690
|
// src/SuggestionChip.tsx
|
|
4568
|
-
var
|
|
4691
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4569
4692
|
function SuggestionChip({ children, className, type = "button", ...props }) {
|
|
4570
|
-
return /* @__PURE__ */ (0,
|
|
4693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4571
4694
|
"button",
|
|
4572
4695
|
{
|
|
4573
4696
|
type,
|
|
@@ -4576,16 +4699,16 @@ function SuggestionChip({ children, className, type = "button", ...props }) {
|
|
|
4576
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",
|
|
4577
4700
|
className
|
|
4578
4701
|
),
|
|
4579
|
-
children: /* @__PURE__ */ (0,
|
|
4702
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "truncate", children })
|
|
4580
4703
|
}
|
|
4581
4704
|
);
|
|
4582
4705
|
}
|
|
4583
4706
|
|
|
4584
4707
|
// src/ToggleChip.tsx
|
|
4585
|
-
var
|
|
4586
|
-
var
|
|
4708
|
+
var import_lucide_react28 = require("lucide-react");
|
|
4709
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4587
4710
|
function ToggleChip({ selected, onChange, children, className, type = "button", onClick, ...props }) {
|
|
4588
|
-
return /* @__PURE__ */ (0,
|
|
4711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4589
4712
|
"button",
|
|
4590
4713
|
{
|
|
4591
4714
|
type,
|
|
@@ -4601,7 +4724,7 @@ function ToggleChip({ selected, onChange, children, className, type = "button",
|
|
|
4601
4724
|
className
|
|
4602
4725
|
),
|
|
4603
4726
|
children: [
|
|
4604
|
-
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" }),
|
|
4605
4728
|
children
|
|
4606
4729
|
]
|
|
4607
4730
|
}
|
|
@@ -4609,14 +4732,14 @@ function ToggleChip({ selected, onChange, children, className, type = "button",
|
|
|
4609
4732
|
}
|
|
4610
4733
|
|
|
4611
4734
|
// src/CopyButton.tsx
|
|
4612
|
-
var
|
|
4613
|
-
var
|
|
4614
|
-
var
|
|
4735
|
+
var import_react24 = require("react");
|
|
4736
|
+
var import_lucide_react29 = require("lucide-react");
|
|
4737
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4615
4738
|
var CONFIRM_MS = 2e3;
|
|
4616
4739
|
function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", className }) {
|
|
4617
|
-
const [copied, setCopied] = (0,
|
|
4618
|
-
const timer = (0,
|
|
4619
|
-
(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), []);
|
|
4620
4743
|
const copy = async () => {
|
|
4621
4744
|
try {
|
|
4622
4745
|
await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
|
|
@@ -4628,8 +4751,8 @@ function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", classN
|
|
|
4628
4751
|
timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
|
|
4629
4752
|
};
|
|
4630
4753
|
const iconSize = size === "xs" ? 13 : 15;
|
|
4631
|
-
const icon = copied ? /* @__PURE__ */ (0,
|
|
4632
|
-
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)(
|
|
4633
4756
|
Button,
|
|
4634
4757
|
{
|
|
4635
4758
|
type: "button",
|
|
@@ -4641,16 +4764,16 @@ function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", classN
|
|
|
4641
4764
|
className: cn(!copied && "text-text-secondary", className),
|
|
4642
4765
|
children: [
|
|
4643
4766
|
icon,
|
|
4644
|
-
label && /* @__PURE__ */ (0,
|
|
4645
|
-
/* @__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" : "" })
|
|
4646
4769
|
]
|
|
4647
4770
|
}
|
|
4648
4771
|
);
|
|
4649
4772
|
}
|
|
4650
4773
|
|
|
4651
4774
|
// src/InlineMessage.tsx
|
|
4652
|
-
var
|
|
4653
|
-
var
|
|
4775
|
+
var import_lucide_react30 = require("lucide-react");
|
|
4776
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4654
4777
|
var BOX = {
|
|
4655
4778
|
info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
|
|
4656
4779
|
success: "border-status-success/40 bg-status-success/10",
|
|
@@ -4664,29 +4787,29 @@ var ICON_INK = {
|
|
|
4664
4787
|
warning: "text-text-warning",
|
|
4665
4788
|
danger: "text-text-danger"
|
|
4666
4789
|
};
|
|
4667
|
-
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 };
|
|
4668
4791
|
function InlineMessage({ tone = "info", title, children, actions, onDismiss, className }) {
|
|
4669
4792
|
const Icon = ICON2[tone];
|
|
4670
|
-
return /* @__PURE__ */ (0,
|
|
4793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4671
4794
|
"div",
|
|
4672
4795
|
{
|
|
4673
4796
|
role: tone === "warning" || tone === "danger" ? "alert" : "status",
|
|
4674
4797
|
className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
|
|
4675
4798
|
children: [
|
|
4676
|
-
/* @__PURE__ */ (0,
|
|
4677
|
-
/* @__PURE__ */ (0,
|
|
4678
|
-
/* @__PURE__ */ (0,
|
|
4679
|
-
children && /* @__PURE__ */ (0,
|
|
4680
|
-
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 })
|
|
4681
4804
|
] }),
|
|
4682
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
4805
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4683
4806
|
"button",
|
|
4684
4807
|
{
|
|
4685
4808
|
type: "button",
|
|
4686
4809
|
onClick: onDismiss,
|
|
4687
4810
|
"aria-label": "Dismiss",
|
|
4688
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",
|
|
4689
|
-
children: /* @__PURE__ */ (0,
|
|
4812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react30.X, { size: 14, "aria-hidden": "true" })
|
|
4690
4813
|
}
|
|
4691
4814
|
)
|
|
4692
4815
|
]
|
|
@@ -4713,6 +4836,7 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
|
|
|
4713
4836
|
DateRangeFilter,
|
|
4714
4837
|
DateRangePicker,
|
|
4715
4838
|
Delta,
|
|
4839
|
+
Drawer,
|
|
4716
4840
|
EmptyState,
|
|
4717
4841
|
FilterChipBar,
|
|
4718
4842
|
FilterDropdownFooter,
|