@platned/ui 1.0.0 → 1.1.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/README.md +30 -7
- package/dist/blocks-charts.cjs +1 -0
- package/dist/blocks-charts.cjs.map +1 -1
- package/dist/blocks-charts.js +2 -0
- package/dist/blocks-charts.js.map +1 -1
- package/dist/blocks.cjs +274 -182
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.d.cts +56 -2
- package/dist/blocks.d.ts +56 -2
- package/dist/blocks.js +272 -165
- package/dist/blocks.js.map +1 -1
- package/dist/chart.cjs +1 -0
- package/dist/chart.cjs.map +1 -1
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +2 -1
- package/dist/chart.js.map +1 -1
- package/dist/{chunk-327NSKZW.js → chunk-6BJ3OMUZ.js} +4 -3
- package/dist/{chunk-327NSKZW.js.map → chunk-6BJ3OMUZ.js.map} +1 -1
- package/dist/{chunk-GJJWRZ4B.js → chunk-7RXFHQL5.js} +4 -3
- package/dist/{chunk-GJJWRZ4B.js.map → chunk-7RXFHQL5.js.map} +1 -1
- package/dist/{chunk-2L5XAYNK.js → chunk-MJC4A7I4.js} +3 -1
- package/dist/{chunk-2L5XAYNK.js.map → chunk-MJC4A7I4.js.map} +1 -1
- package/dist/{chunk-WGCAQEZ4.js → chunk-QYFD7KIK.js} +3 -2
- package/dist/{chunk-WGCAQEZ4.js.map → chunk-QYFD7KIK.js.map} +1 -1
- package/dist/code-block-highlight.cjs +1 -0
- package/dist/code-block-highlight.cjs.map +1 -1
- package/dist/code-block-highlight.js +4 -3
- package/dist/code-block-highlight.js.map +1 -1
- package/dist/data-table.cjs +1 -0
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.js +4 -3
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +7322 -3906
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +198 -5
- package/dist/index.js +5916 -2507
- package/dist/index.js.map +1 -1
- package/dist/map.cjs +1 -0
- package/dist/map.cjs.map +1 -1
- package/dist/map.js +6 -0
- package/dist/map.js.map +1 -1
- package/package.json +2 -7
package/dist/blocks.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
// src/blocks/app-shell.tsx
|
|
2
4
|
import { useMemo, useState as useState2 } from "react";
|
|
3
5
|
import { ChevronsUpDownIcon, MenuIcon, MoreHorizontalIcon as MoreHorizontalIcon3, SearchIcon } from "lucide-react";
|
|
@@ -45,7 +47,12 @@ import {
|
|
|
45
47
|
Button,
|
|
46
48
|
DropdownMenu,
|
|
47
49
|
DropdownMenuItem,
|
|
50
|
+
DropdownMenuRadioGroup,
|
|
51
|
+
DropdownMenuRadioItem,
|
|
48
52
|
DropdownMenuSeparator,
|
|
53
|
+
DropdownMenuSub,
|
|
54
|
+
DropdownMenuSubContent,
|
|
55
|
+
DropdownMenuSubTrigger,
|
|
49
56
|
cn
|
|
50
57
|
} from "./index.js";
|
|
51
58
|
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -73,23 +80,34 @@ function MenuItems({
|
|
|
73
80
|
Link = PlainLink,
|
|
74
81
|
can
|
|
75
82
|
}) {
|
|
76
|
-
const
|
|
83
|
+
const allowed = (item) => !item.permission || !can || can(item.permission);
|
|
84
|
+
const visible = items.filter(
|
|
85
|
+
(item) => allowed(item) && (!item.items || item.items.some(allowed))
|
|
86
|
+
);
|
|
77
87
|
return /* @__PURE__ */ jsx(Fragment2, { children: visible.map((item, index) => {
|
|
78
88
|
const content = /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
79
89
|
resolveIcon(item.icon, icons),
|
|
80
90
|
item.label
|
|
81
91
|
] });
|
|
92
|
+
const variant = item.destructive ? "destructive" : "default";
|
|
93
|
+
let entry;
|
|
94
|
+
if (item.items) {
|
|
95
|
+
const choices = item.value !== void 0;
|
|
96
|
+
entry = /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(DropdownMenuSubTrigger, { children: content }),
|
|
98
|
+
/* @__PURE__ */ jsx(DropdownMenuSubContent, { children: choices ? /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: item.value, onValueChange: (value) => item.onValueChange?.(value), children: item.items.filter(allowed).map((choice) => /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: choice.value ?? choice.label, children: [
|
|
99
|
+
resolveIcon(choice.icon, icons),
|
|
100
|
+
choice.label
|
|
101
|
+
] }, choice.value ?? choice.label)) }) : /* @__PURE__ */ jsx(MenuItems, { items: item.items, icons, Link, can }) })
|
|
102
|
+
] });
|
|
103
|
+
} else if (item.href) {
|
|
104
|
+
entry = /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, variant, shortcut: item.shortcut, children: /* @__PURE__ */ jsx(Link, { href: item.href, children: content }) });
|
|
105
|
+
} else {
|
|
106
|
+
entry = /* @__PURE__ */ jsx(DropdownMenuItem, { variant, shortcut: item.shortcut, onSelect: () => item.onSelect?.(), children: content });
|
|
107
|
+
}
|
|
82
108
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
109
|
item.separator && index > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
84
|
-
|
|
85
|
-
DropdownMenuItem,
|
|
86
|
-
{
|
|
87
|
-
variant: item.destructive ? "destructive" : "default",
|
|
88
|
-
shortcut: item.shortcut,
|
|
89
|
-
onSelect: () => item.onSelect?.(),
|
|
90
|
-
children: content
|
|
91
|
-
}
|
|
92
|
-
)
|
|
110
|
+
entry
|
|
93
111
|
] }, `${item.label}-${index}`);
|
|
94
112
|
}) });
|
|
95
113
|
}
|
|
@@ -651,6 +669,7 @@ function AppShell({
|
|
|
651
669
|
breadcrumbs,
|
|
652
670
|
actions,
|
|
653
671
|
search,
|
|
672
|
+
page: pageMode = "padded",
|
|
654
673
|
defaultCollapsed = false,
|
|
655
674
|
children,
|
|
656
675
|
className
|
|
@@ -797,7 +816,8 @@ function AppShell({
|
|
|
797
816
|
crumbs,
|
|
798
817
|
/* @__PURE__ */ jsx3("div", { className: "ms-auto flex items-center gap-2", children: /* @__PURE__ */ jsx3(Search, { search }) })
|
|
799
818
|
] });
|
|
800
|
-
const
|
|
819
|
+
const fill = pageMode === "fill";
|
|
820
|
+
const page = fill ? /* @__PURE__ */ jsx3("div", { "data-slot": "app-shell-page", className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children }) : /* @__PURE__ */ jsxs3("div", { "data-slot": "app-shell-page", className: "flex flex-1 flex-col gap-6 p-4 md:p-6", children: [
|
|
801
821
|
/* @__PURE__ */ jsx3(PageTitle, { title: pageTitle, description, actions: actionNodes }),
|
|
802
822
|
children
|
|
803
823
|
] });
|
|
@@ -826,6 +846,7 @@ function AppShell({
|
|
|
826
846
|
user,
|
|
827
847
|
can,
|
|
828
848
|
search,
|
|
849
|
+
fill,
|
|
829
850
|
crumbs,
|
|
830
851
|
title: pageTitle,
|
|
831
852
|
description,
|
|
@@ -872,7 +893,7 @@ function AppShell({
|
|
|
872
893
|
style: variant === "nested" ? { "--sidebar-width": "22rem" } : void 0,
|
|
873
894
|
children: [
|
|
874
895
|
side === "left" && sidebarNode,
|
|
875
|
-
/* @__PURE__ */ jsxs3(SidebarInset, { children: [
|
|
896
|
+
/* @__PURE__ */ jsxs3(SidebarInset, { className: fill ? "h-svh overflow-hidden" : void 0, children: [
|
|
876
897
|
header,
|
|
877
898
|
page
|
|
878
899
|
] }),
|
|
@@ -891,6 +912,7 @@ function TopNavShell({
|
|
|
891
912
|
user,
|
|
892
913
|
can,
|
|
893
914
|
search,
|
|
915
|
+
fill,
|
|
894
916
|
crumbs,
|
|
895
917
|
title,
|
|
896
918
|
description,
|
|
@@ -921,7 +943,7 @@ function TopNavShell({
|
|
|
921
943
|
item.id ?? item.to ?? item.label
|
|
922
944
|
);
|
|
923
945
|
};
|
|
924
|
-
return /* @__PURE__ */ jsxs3("div", { className: cn3("flex
|
|
946
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn3("flex flex-col bg-background", fill ? "h-svh overflow-hidden" : "min-h-svh", className), children: [
|
|
925
947
|
/* @__PURE__ */ jsxs3("header", { className: "sticky top-0 z-sticky flex h-14 items-center gap-4 border-b bg-background/95 px-4 backdrop-blur md:px-6", children: [
|
|
926
948
|
/* @__PURE__ */ jsx3(
|
|
927
949
|
Drawer,
|
|
@@ -954,7 +976,7 @@ function TopNavShell({
|
|
|
954
976
|
)
|
|
955
977
|
] })
|
|
956
978
|
] }),
|
|
957
|
-
/* @__PURE__ */ jsxs3("main", { className: "mx-auto flex w-full max-w-7xl flex-1 flex-col gap-6 p-4 md:p-6", children: [
|
|
979
|
+
fill ? /* @__PURE__ */ jsx3("main", { "data-slot": "app-shell-page", className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children }) : /* @__PURE__ */ jsxs3("main", { "data-slot": "app-shell-page", className: "mx-auto flex w-full max-w-7xl flex-1 flex-col gap-6 p-4 md:p-6", children: [
|
|
958
980
|
crumbs,
|
|
959
981
|
/* @__PURE__ */ jsx3(PageTitle, { title, description, actions }),
|
|
960
982
|
children
|
|
@@ -7610,8 +7632,92 @@ function BannerAction({
|
|
|
7610
7632
|
);
|
|
7611
7633
|
}
|
|
7612
7634
|
|
|
7635
|
+
// src/blocks/shortcuts-dialog.tsx
|
|
7636
|
+
import { Fragment as Fragment15, useEffect as useEffect10, useState as useState20, useSyncExternalStore } from "react";
|
|
7637
|
+
import {
|
|
7638
|
+
Dialog as Dialog3,
|
|
7639
|
+
DialogContent as DialogContent2,
|
|
7640
|
+
DialogDescription as DialogDescription2,
|
|
7641
|
+
DialogHeader,
|
|
7642
|
+
DialogTitle as DialogTitle2,
|
|
7643
|
+
DialogTrigger as DialogTrigger2,
|
|
7644
|
+
Kbd,
|
|
7645
|
+
KbdGroup,
|
|
7646
|
+
ScrollArea as ScrollArea6
|
|
7647
|
+
} from "./index.js";
|
|
7648
|
+
import { Fragment as Fragment16, jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7649
|
+
var APPLE_KEYS = { Mod: "\u2318", Alt: "\u2325", Shift: "\u21E7", Ctrl: "\u2303", Enter: "\u21A9" };
|
|
7650
|
+
var OTHER_KEYS = { Mod: "Ctrl" };
|
|
7651
|
+
var keyName = (key, apple) => key === "Mod" ? apple ? "Command" : "Control" : key === "Alt" && apple ? "Option" : key;
|
|
7652
|
+
var subscribeNever = () => () => {
|
|
7653
|
+
};
|
|
7654
|
+
var isApple = () => /Mac|iPhone|iPad/.test(navigator.userAgent);
|
|
7655
|
+
function isEditable(target) {
|
|
7656
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
7657
|
+
return target.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName);
|
|
7658
|
+
}
|
|
7659
|
+
function Combo({ keys, apple }) {
|
|
7660
|
+
const shown = keys.map((key) => (apple ? APPLE_KEYS : OTHER_KEYS)[key] ?? key);
|
|
7661
|
+
return /* @__PURE__ */ jsxs22(Fragment16, { children: [
|
|
7662
|
+
/* @__PURE__ */ jsx25(KbdGroup, { "aria-hidden": true, children: shown.map((key, i) => /* @__PURE__ */ jsx25(Kbd, { children: key }, `${key}-${i}`)) }),
|
|
7663
|
+
/* @__PURE__ */ jsx25("span", { className: "sr-only", children: keys.map((key) => keyName(key, apple)).join(" + ") })
|
|
7664
|
+
] });
|
|
7665
|
+
}
|
|
7666
|
+
function ShortcutsDialog({
|
|
7667
|
+
groups,
|
|
7668
|
+
title = "Keyboard shortcuts",
|
|
7669
|
+
description,
|
|
7670
|
+
hotkey = "?",
|
|
7671
|
+
open,
|
|
7672
|
+
defaultOpen = false,
|
|
7673
|
+
onOpenChange,
|
|
7674
|
+
trigger,
|
|
7675
|
+
modal
|
|
7676
|
+
}) {
|
|
7677
|
+
const [ownOpen, setOwnOpen] = useState20(defaultOpen);
|
|
7678
|
+
const isOpen = open ?? ownOpen;
|
|
7679
|
+
const setOpen = (next) => {
|
|
7680
|
+
if (open === void 0) setOwnOpen(next);
|
|
7681
|
+
onOpenChange?.(next);
|
|
7682
|
+
};
|
|
7683
|
+
const apple = useSyncExternalStore(subscribeNever, isApple, () => false);
|
|
7684
|
+
useEffect10(() => {
|
|
7685
|
+
if (!hotkey) return;
|
|
7686
|
+
const onKeyDown = (event) => {
|
|
7687
|
+
if (event.key !== hotkey || event.ctrlKey || event.metaKey || event.altKey || isEditable(event.target)) return;
|
|
7688
|
+
event.preventDefault();
|
|
7689
|
+
if (open === void 0) setOwnOpen(true);
|
|
7690
|
+
onOpenChange?.(true);
|
|
7691
|
+
};
|
|
7692
|
+
document.addEventListener("keydown", onKeyDown);
|
|
7693
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
7694
|
+
}, [hotkey, open, onOpenChange]);
|
|
7695
|
+
return /* @__PURE__ */ jsxs22(Dialog3, { open: isOpen, onOpenChange: setOpen, modal, children: [
|
|
7696
|
+
trigger && /* @__PURE__ */ jsx25(DialogTrigger2, { asChild: true, children: trigger }),
|
|
7697
|
+
/* @__PURE__ */ jsxs22(DialogContent2, { "data-slot": "shortcuts-dialog", className: "sm:max-w-lg", children: [
|
|
7698
|
+
/* @__PURE__ */ jsxs22(DialogHeader, { children: [
|
|
7699
|
+
/* @__PURE__ */ jsx25(DialogTitle2, { children: title }),
|
|
7700
|
+
description && /* @__PURE__ */ jsx25(DialogDescription2, { children: description })
|
|
7701
|
+
] }),
|
|
7702
|
+
/* @__PURE__ */ jsx25(ScrollArea6, { className: "-mx-4 max-h-[60vh] px-4", children: /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-5", children: groups.map((group) => /* @__PURE__ */ jsxs22("section", { "aria-label": group.title, className: "flex flex-col gap-1", children: [
|
|
7703
|
+
/* @__PURE__ */ jsx25("h3", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: group.title }),
|
|
7704
|
+
/* @__PURE__ */ jsx25("dl", { className: "divide-y", children: group.shortcuts.map((shortcut) => /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between gap-4 py-2 text-sm", children: [
|
|
7705
|
+
/* @__PURE__ */ jsx25("dt", { children: shortcut.label }),
|
|
7706
|
+
/* @__PURE__ */ jsxs22("dd", { className: "flex shrink-0 items-center gap-1.5 text-muted-foreground", children: [
|
|
7707
|
+
/* @__PURE__ */ jsx25(Combo, { keys: shortcut.keys, apple }),
|
|
7708
|
+
shortcut.alt && /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
7709
|
+
/* @__PURE__ */ jsx25("span", { className: "text-xs", children: "or" }),
|
|
7710
|
+
/* @__PURE__ */ jsx25(Combo, { keys: shortcut.alt, apple })
|
|
7711
|
+
] })
|
|
7712
|
+
] })
|
|
7713
|
+
] }, shortcut.label)) })
|
|
7714
|
+
] }, group.title)) }) })
|
|
7715
|
+
] })
|
|
7716
|
+
] });
|
|
7717
|
+
}
|
|
7718
|
+
|
|
7613
7719
|
// src/blocks/confirm-dialog.tsx
|
|
7614
|
-
import { useEffect as
|
|
7720
|
+
import { useEffect as useEffect11, useId as useId3, useRef as useRef11, useState as useState21 } from "react";
|
|
7615
7721
|
import { CircleAlertIcon as CircleAlertIcon2, CircleCheckIcon, CircleIcon, CircleMinusIcon, InfoIcon, TriangleAlertIcon } from "lucide-react";
|
|
7616
7722
|
import {
|
|
7617
7723
|
Alert as Alert2,
|
|
@@ -7620,37 +7726,37 @@ import {
|
|
|
7620
7726
|
AlertDialogMedia,
|
|
7621
7727
|
Button as Button12,
|
|
7622
7728
|
Checkbox as Checkbox3,
|
|
7623
|
-
Dialog as
|
|
7729
|
+
Dialog as Dialog4,
|
|
7624
7730
|
DialogClose,
|
|
7625
|
-
DialogContent as
|
|
7626
|
-
DialogDescription as
|
|
7627
|
-
DialogTitle as
|
|
7628
|
-
DialogTrigger as
|
|
7731
|
+
DialogContent as DialogContent3,
|
|
7732
|
+
DialogDescription as DialogDescription3,
|
|
7733
|
+
DialogTitle as DialogTitle3,
|
|
7734
|
+
DialogTrigger as DialogTrigger3,
|
|
7629
7735
|
Field as Field3,
|
|
7630
7736
|
FieldDescription as FieldDescription2,
|
|
7631
7737
|
FieldError as FieldError3,
|
|
7632
7738
|
FieldLabel as FieldLabel3,
|
|
7633
7739
|
FieldLegend as FieldLegend3,
|
|
7634
7740
|
FieldSet as FieldSet3,
|
|
7635
|
-
ScrollArea as
|
|
7741
|
+
ScrollArea as ScrollArea7,
|
|
7636
7742
|
Spinner,
|
|
7637
7743
|
Textarea as Textarea4,
|
|
7638
7744
|
cn as cn19
|
|
7639
7745
|
} from "./index.js";
|
|
7640
|
-
import { Fragment as
|
|
7746
|
+
import { Fragment as Fragment17, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
7641
7747
|
var TONE_ICON = {
|
|
7642
7748
|
default: null,
|
|
7643
|
-
destructive: /* @__PURE__ */
|
|
7644
|
-
success: /* @__PURE__ */
|
|
7645
|
-
warning: /* @__PURE__ */
|
|
7646
|
-
info: /* @__PURE__ */
|
|
7749
|
+
destructive: /* @__PURE__ */ jsx26(CircleAlertIcon2, {}),
|
|
7750
|
+
success: /* @__PURE__ */ jsx26(CircleCheckIcon, {}),
|
|
7751
|
+
warning: /* @__PURE__ */ jsx26(TriangleAlertIcon, {}),
|
|
7752
|
+
info: /* @__PURE__ */ jsx26(InfoIcon, {})
|
|
7647
7753
|
};
|
|
7648
7754
|
var SUMMARY_ICON = {
|
|
7649
|
-
success: /* @__PURE__ */
|
|
7650
|
-
warning: /* @__PURE__ */
|
|
7651
|
-
error: /* @__PURE__ */
|
|
7652
|
-
neutral: /* @__PURE__ */
|
|
7653
|
-
skipped: /* @__PURE__ */
|
|
7755
|
+
success: /* @__PURE__ */ jsx26(CircleCheckIcon, { "aria-hidden": true, className: "size-4 text-success" }),
|
|
7756
|
+
warning: /* @__PURE__ */ jsx26(TriangleAlertIcon, { "aria-hidden": true, className: "size-4 text-warning" }),
|
|
7757
|
+
error: /* @__PURE__ */ jsx26(CircleAlertIcon2, { "aria-hidden": true, className: "size-4 text-destructive" }),
|
|
7758
|
+
neutral: /* @__PURE__ */ jsx26(CircleIcon, { "aria-hidden": true, className: "size-4 text-muted-foreground" }),
|
|
7759
|
+
skipped: /* @__PURE__ */ jsx26(CircleMinusIcon, { "aria-hidden": true, className: "size-4 text-muted-foreground" })
|
|
7654
7760
|
};
|
|
7655
7761
|
var SUMMARY_LABEL = {
|
|
7656
7762
|
success: "Passed",
|
|
@@ -7688,14 +7794,14 @@ function ConfirmDialog({
|
|
|
7688
7794
|
modal = true,
|
|
7689
7795
|
linkComponent: Link = PlainLink
|
|
7690
7796
|
}) {
|
|
7691
|
-
const [innerOpen, setInnerOpen] =
|
|
7797
|
+
const [innerOpen, setInnerOpen] = useState21(defaultOpen);
|
|
7692
7798
|
const open = openProp ?? innerOpen;
|
|
7693
|
-
const [note, setNote] =
|
|
7694
|
-
const [checked, setChecked] =
|
|
7695
|
-
const [touched, setTouched] =
|
|
7696
|
-
const [busy, setBusy] =
|
|
7697
|
-
const [error, setError] =
|
|
7698
|
-
const [check, setCheck] =
|
|
7799
|
+
const [note, setNote] = useState21("");
|
|
7800
|
+
const [checked, setChecked] = useState21(checklist?.defaultChecked ?? []);
|
|
7801
|
+
const [touched, setTouched] = useState21(false);
|
|
7802
|
+
const [busy, setBusy] = useState21(false);
|
|
7803
|
+
const [error, setError] = useState21();
|
|
7804
|
+
const [check, setCheck] = useState21({ state: "idle" });
|
|
7699
7805
|
const blockersRef = useRef11(blockers);
|
|
7700
7806
|
blockersRef.current = blockers;
|
|
7701
7807
|
const ids = useId3();
|
|
@@ -7705,7 +7811,7 @@ function ConfirmDialog({
|
|
|
7705
7811
|
if (openProp === void 0) setInnerOpen(next);
|
|
7706
7812
|
onOpenChange?.(next);
|
|
7707
7813
|
};
|
|
7708
|
-
|
|
7814
|
+
useEffect11(() => {
|
|
7709
7815
|
if (!open) return;
|
|
7710
7816
|
setNote("");
|
|
7711
7817
|
setChecked(checklist?.defaultChecked ?? []);
|
|
@@ -7764,10 +7870,10 @@ function ConfirmDialog({
|
|
|
7764
7870
|
}
|
|
7765
7871
|
setOpen(false);
|
|
7766
7872
|
};
|
|
7767
|
-
return /* @__PURE__ */
|
|
7768
|
-
trigger && /* @__PURE__ */
|
|
7769
|
-
/* @__PURE__ */
|
|
7770
|
-
|
|
7873
|
+
return /* @__PURE__ */ jsxs23(Dialog4, { open, onOpenChange: setOpen, modal, children: [
|
|
7874
|
+
trigger && /* @__PURE__ */ jsx26(DialogTrigger3, { asChild: true, children: trigger }),
|
|
7875
|
+
/* @__PURE__ */ jsxs23(
|
|
7876
|
+
DialogContent3,
|
|
7771
7877
|
{
|
|
7772
7878
|
role: "alertdialog",
|
|
7773
7879
|
"data-slot": "confirm-dialog",
|
|
@@ -7779,52 +7885,52 @@ function ConfirmDialog({
|
|
|
7779
7885
|
onPointerDownOutside: (event) => event.preventDefault(),
|
|
7780
7886
|
onInteractOutside: (event) => event.preventDefault(),
|
|
7781
7887
|
children: [
|
|
7782
|
-
/* @__PURE__ */
|
|
7783
|
-
glyph && /* @__PURE__ */
|
|
7784
|
-
/* @__PURE__ */
|
|
7785
|
-
description !== void 0 && /* @__PURE__ */
|
|
7888
|
+
/* @__PURE__ */ jsxs23(AlertDialogHeader, { className: "sm:has-data-[slot=alert-dialog-media]:grid-cols-[auto_1fr]", children: [
|
|
7889
|
+
glyph && /* @__PURE__ */ jsx26(AlertDialogMedia, { tone: blocked ? "warning" : tone, children: glyph }),
|
|
7890
|
+
/* @__PURE__ */ jsx26(DialogTitle3, { className: "leading-normal sm:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", children: title }),
|
|
7891
|
+
description !== void 0 && /* @__PURE__ */ jsx26(DialogDescription3, { className: "text-balance md:text-pretty", children: description })
|
|
7786
7892
|
] }),
|
|
7787
|
-
checking && /* @__PURE__ */
|
|
7788
|
-
/* @__PURE__ */
|
|
7893
|
+
checking && /* @__PURE__ */ jsxs23("div", { role: "status", className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
7894
|
+
/* @__PURE__ */ jsx26(Spinner, { className: "size-4" }),
|
|
7789
7895
|
checkingLabel
|
|
7790
7896
|
] }),
|
|
7791
|
-
check.state === "error" && /* @__PURE__ */
|
|
7792
|
-
blocked && /* @__PURE__ */
|
|
7793
|
-
/* @__PURE__ */
|
|
7794
|
-
/* @__PURE__ */
|
|
7795
|
-
blockedDescription && /* @__PURE__ */
|
|
7897
|
+
check.state === "error" && /* @__PURE__ */ jsx26(Alert2, { variant: "destructive", title: "Couldn't check", description: check.message }),
|
|
7898
|
+
blocked && /* @__PURE__ */ jsxs23("div", { "data-slot": "confirm-dialog-blockers", className: "flex flex-col gap-2 text-sm", children: [
|
|
7899
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
7900
|
+
/* @__PURE__ */ jsx26("p", { className: "font-medium", children: blockedTitle }),
|
|
7901
|
+
blockedDescription && /* @__PURE__ */ jsx26("p", { className: "text-muted-foreground", children: blockedDescription })
|
|
7796
7902
|
] }),
|
|
7797
|
-
/* @__PURE__ */
|
|
7798
|
-
blocker.href ? /* @__PURE__ */
|
|
7903
|
+
/* @__PURE__ */ jsx26(ScrollArea7, { className: "max-h-48 rounded-lg border", children: /* @__PURE__ */ jsx26("ul", { className: "divide-y", children: check.blockers.map((blocker) => /* @__PURE__ */ jsxs23("li", { className: "flex flex-col gap-0.5 px-3 py-2", children: [
|
|
7904
|
+
blocker.href ? /* @__PURE__ */ jsx26(
|
|
7799
7905
|
Link,
|
|
7800
7906
|
{
|
|
7801
7907
|
href: blocker.href,
|
|
7802
7908
|
className: "w-fit rounded-sm font-medium underline-offset-4 outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
7803
7909
|
children: blocker.label
|
|
7804
7910
|
}
|
|
7805
|
-
) : /* @__PURE__ */
|
|
7806
|
-
blocker.description && /* @__PURE__ */
|
|
7911
|
+
) : /* @__PURE__ */ jsx26("span", { className: "font-medium", children: blocker.label }),
|
|
7912
|
+
blocker.description && /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", children: blocker.description })
|
|
7807
7913
|
] }, blocker.id ?? blocker.label)) }) })
|
|
7808
7914
|
] }),
|
|
7809
|
-
!blocked && !checking && check.state !== "error" && /* @__PURE__ */
|
|
7810
|
-
summary && /* @__PURE__ */
|
|
7811
|
-
summary.label && /* @__PURE__ */
|
|
7812
|
-
/* @__PURE__ */
|
|
7915
|
+
!blocked && !checking && check.state !== "error" && /* @__PURE__ */ jsxs23(Fragment17, { children: [
|
|
7916
|
+
summary && /* @__PURE__ */ jsxs23("div", { "data-slot": "confirm-dialog-summary", className: "flex flex-col gap-2 text-sm", children: [
|
|
7917
|
+
summary.label && /* @__PURE__ */ jsx26("p", { className: "font-medium", children: summary.label }),
|
|
7918
|
+
/* @__PURE__ */ jsx26("ul", { className: "flex flex-col divide-y rounded-lg border", children: summary.items.map((item) => {
|
|
7813
7919
|
const state = item.state ?? "neutral";
|
|
7814
|
-
return /* @__PURE__ */
|
|
7920
|
+
return /* @__PURE__ */ jsxs23("li", { className: "flex items-center gap-2 px-3 py-2", children: [
|
|
7815
7921
|
SUMMARY_ICON[state],
|
|
7816
|
-
SUMMARY_LABEL[state] && /* @__PURE__ */
|
|
7922
|
+
SUMMARY_LABEL[state] && /* @__PURE__ */ jsxs23("span", { className: "sr-only", children: [
|
|
7817
7923
|
SUMMARY_LABEL[state],
|
|
7818
7924
|
":"
|
|
7819
7925
|
] }),
|
|
7820
|
-
/* @__PURE__ */
|
|
7821
|
-
item.value !== void 0 && /* @__PURE__ */
|
|
7926
|
+
/* @__PURE__ */ jsx26("span", { className: cn19("min-w-0 flex-1", state === "skipped" && "text-muted-foreground"), children: item.label }),
|
|
7927
|
+
item.value !== void 0 && /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground tabular-nums", children: item.value })
|
|
7822
7928
|
] }, item.label);
|
|
7823
7929
|
}) })
|
|
7824
7930
|
] }),
|
|
7825
|
-
checklist && /* @__PURE__ */
|
|
7826
|
-
/* @__PURE__ */
|
|
7827
|
-
/* @__PURE__ */
|
|
7931
|
+
checklist && /* @__PURE__ */ jsxs23(FieldSet3, { children: [
|
|
7932
|
+
/* @__PURE__ */ jsx26(FieldLegend3, { variant: "label", children: checklist.label ?? "Options" }),
|
|
7933
|
+
/* @__PURE__ */ jsx26("div", { className: "flex flex-col gap-3", children: options.map((option) => /* @__PURE__ */ jsx26(
|
|
7828
7934
|
Checkbox3,
|
|
7829
7935
|
{
|
|
7830
7936
|
label: option.label,
|
|
@@ -7836,14 +7942,14 @@ function ConfirmDialog({
|
|
|
7836
7942
|
},
|
|
7837
7943
|
option.value
|
|
7838
7944
|
)) }),
|
|
7839
|
-
touched && checklistError && /* @__PURE__ */
|
|
7945
|
+
touched && checklistError && /* @__PURE__ */ jsx26(FieldError3, { children: checklistError })
|
|
7840
7946
|
] }),
|
|
7841
|
-
reasonConfig && /* @__PURE__ */
|
|
7842
|
-
/* @__PURE__ */
|
|
7947
|
+
reasonConfig && /* @__PURE__ */ jsxs23(Field3, { required: reasonConfig.required, id: `${ids}-reason`, children: [
|
|
7948
|
+
/* @__PURE__ */ jsxs23(FieldLabel3, { children: [
|
|
7843
7949
|
reasonLabel,
|
|
7844
|
-
!reasonConfig.required && /* @__PURE__ */
|
|
7950
|
+
!reasonConfig.required && /* @__PURE__ */ jsx26("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
7845
7951
|
] }),
|
|
7846
|
-
/* @__PURE__ */
|
|
7952
|
+
/* @__PURE__ */ jsx26(
|
|
7847
7953
|
Textarea4,
|
|
7848
7954
|
{
|
|
7849
7955
|
value: note,
|
|
@@ -7853,15 +7959,15 @@ function ConfirmDialog({
|
|
|
7853
7959
|
onChange: (event) => setNote(event.target.value)
|
|
7854
7960
|
}
|
|
7855
7961
|
),
|
|
7856
|
-
reasonConfig.description && /* @__PURE__ */
|
|
7857
|
-
/* @__PURE__ */
|
|
7962
|
+
reasonConfig.description && /* @__PURE__ */ jsx26(FieldDescription2, { children: reasonConfig.description }),
|
|
7963
|
+
/* @__PURE__ */ jsx26(FieldError3, { children: touched ? reasonError : void 0 })
|
|
7858
7964
|
] }),
|
|
7859
7965
|
children,
|
|
7860
|
-
error && /* @__PURE__ */
|
|
7966
|
+
error && /* @__PURE__ */ jsx26(Alert2, { variant: "destructive", description: error })
|
|
7861
7967
|
] }),
|
|
7862
|
-
/* @__PURE__ */
|
|
7863
|
-
/* @__PURE__ */
|
|
7864
|
-
!blocked && check.state !== "error" && /* @__PURE__ */
|
|
7968
|
+
/* @__PURE__ */ jsxs23(AlertDialogFooter, { children: [
|
|
7969
|
+
/* @__PURE__ */ jsx26(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx26(Button12, { ref: cancelRef, variant: "outline", disabled: busy, children: blocked || check.state === "error" ? "Close" : cancelLabel }) }),
|
|
7970
|
+
!blocked && check.state !== "error" && /* @__PURE__ */ jsx26(
|
|
7865
7971
|
Button12,
|
|
7866
7972
|
{
|
|
7867
7973
|
variant,
|
|
@@ -7883,16 +7989,16 @@ function ConfirmDialog({
|
|
|
7883
7989
|
import { XIcon as XIcon2 } from "lucide-react";
|
|
7884
7990
|
import {
|
|
7885
7991
|
Button as Button13,
|
|
7886
|
-
Dialog as
|
|
7992
|
+
Dialog as Dialog5,
|
|
7887
7993
|
DialogClose as DialogClose2,
|
|
7888
|
-
DialogContent as
|
|
7889
|
-
DialogDescription as
|
|
7890
|
-
DialogTitle as
|
|
7891
|
-
DialogTrigger as
|
|
7892
|
-
ScrollArea as
|
|
7994
|
+
DialogContent as DialogContent4,
|
|
7995
|
+
DialogDescription as DialogDescription4,
|
|
7996
|
+
DialogTitle as DialogTitle4,
|
|
7997
|
+
DialogTrigger as DialogTrigger4,
|
|
7998
|
+
ScrollArea as ScrollArea8,
|
|
7893
7999
|
cn as cn20
|
|
7894
8000
|
} from "./index.js";
|
|
7895
|
-
import { jsx as
|
|
8001
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7896
8002
|
var WIDTH = {
|
|
7897
8003
|
md: "max-w-3xl",
|
|
7898
8004
|
lg: "max-w-5xl",
|
|
@@ -7919,10 +8025,10 @@ function FullscreenDialog({
|
|
|
7919
8025
|
can,
|
|
7920
8026
|
className
|
|
7921
8027
|
}) {
|
|
7922
|
-
return /* @__PURE__ */
|
|
7923
|
-
trigger && /* @__PURE__ */
|
|
7924
|
-
/* @__PURE__ */
|
|
7925
|
-
|
|
8028
|
+
return /* @__PURE__ */ jsxs24(Dialog5, { open, defaultOpen, onOpenChange, modal, children: [
|
|
8029
|
+
trigger && /* @__PURE__ */ jsx27(DialogTrigger4, { asChild: true, children: trigger }),
|
|
8030
|
+
/* @__PURE__ */ jsxs24(
|
|
8031
|
+
DialogContent4,
|
|
7926
8032
|
{
|
|
7927
8033
|
"data-slot": "fullscreen-dialog",
|
|
7928
8034
|
showCloseButton: false,
|
|
@@ -7932,26 +8038,26 @@ function FullscreenDialog({
|
|
|
7932
8038
|
className
|
|
7933
8039
|
),
|
|
7934
8040
|
children: [
|
|
7935
|
-
/* @__PURE__ */
|
|
7936
|
-
/* @__PURE__ */
|
|
7937
|
-
/* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
7939
|
-
description !== void 0 && /* @__PURE__ */
|
|
8041
|
+
/* @__PURE__ */ jsxs24("div", { "data-slot": "fullscreen-dialog-bar", className: "flex shrink-0 items-center gap-3 border-b px-4 py-3", children: [
|
|
8042
|
+
/* @__PURE__ */ jsx27(DialogClose2, { asChild: true, children: /* @__PURE__ */ jsx27(Button13, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, children: /* @__PURE__ */ jsx27(XIcon2, {}) }) }),
|
|
8043
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
8044
|
+
/* @__PURE__ */ jsx27(DialogTitle4, { className: "truncate text-base font-medium", children: title }),
|
|
8045
|
+
description !== void 0 && /* @__PURE__ */ jsx27(DialogDescription4, { className: "truncate text-sm text-muted-foreground", children: description })
|
|
7940
8046
|
] }),
|
|
7941
|
-
actions && actions.length > 0 && /* @__PURE__ */
|
|
8047
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx27(Actions, { actions, onAction, icons, Link, can })
|
|
7942
8048
|
] }),
|
|
7943
|
-
/* @__PURE__ */
|
|
7944
|
-
/* @__PURE__ */
|
|
7945
|
-
aside && /* @__PURE__ */
|
|
8049
|
+
/* @__PURE__ */ jsxs24("div", { className: cn20("flex min-h-0 flex-1 flex-col", aside && "lg:flex-row"), children: [
|
|
8050
|
+
/* @__PURE__ */ jsx27(ScrollArea8, { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx27("div", { className: cn20("mx-auto w-full p-4 sm:p-6", WIDTH[width]), children }) }),
|
|
8051
|
+
aside && /* @__PURE__ */ jsx27(
|
|
7946
8052
|
"aside",
|
|
7947
8053
|
{
|
|
7948
8054
|
"data-slot": "fullscreen-dialog-aside",
|
|
7949
8055
|
className: "shrink-0 border-t lg:w-80 lg:border-t-0 lg:border-s",
|
|
7950
|
-
children: /* @__PURE__ */
|
|
8056
|
+
children: /* @__PURE__ */ jsx27(ScrollArea8, { className: "h-full max-h-[40dvh] lg:max-h-none", children: /* @__PURE__ */ jsx27("div", { className: "p-4 sm:p-6", children: aside }) })
|
|
7951
8057
|
}
|
|
7952
8058
|
)
|
|
7953
8059
|
] }),
|
|
7954
|
-
footer !== void 0 && /* @__PURE__ */
|
|
8060
|
+
footer !== void 0 && /* @__PURE__ */ jsx27("div", { "data-slot": "fullscreen-dialog-footer", className: "flex shrink-0 flex-wrap items-center justify-end gap-2 border-t bg-muted/50 px-4 py-3", children: footer })
|
|
7955
8061
|
]
|
|
7956
8062
|
}
|
|
7957
8063
|
)
|
|
@@ -7961,7 +8067,7 @@ function FullscreenDialog({
|
|
|
7961
8067
|
// src/blocks/person-card.tsx
|
|
7962
8068
|
import { MailIcon, PhoneIcon } from "lucide-react";
|
|
7963
8069
|
import { CardDescription as CardDescription4, CardHeader as CardHeader4, CardTitle as CardTitle4, Value as Value5, cn as cn21, humanize as humanize6 } from "./index.js";
|
|
7964
|
-
import { jsx as
|
|
8070
|
+
import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7965
8071
|
var COVER = {
|
|
7966
8072
|
muted: "bg-muted",
|
|
7967
8073
|
brand: "bg-gradient-brand-w-e",
|
|
@@ -7980,7 +8086,7 @@ function PersonCard({
|
|
|
7980
8086
|
can,
|
|
7981
8087
|
className
|
|
7982
8088
|
}) {
|
|
7983
|
-
const name = person.href ? /* @__PURE__ */
|
|
8089
|
+
const name = person.href ? /* @__PURE__ */ jsx28(
|
|
7984
8090
|
Link,
|
|
7985
8091
|
{
|
|
7986
8092
|
href: person.href,
|
|
@@ -7989,71 +8095,71 @@ function PersonCard({
|
|
|
7989
8095
|
}
|
|
7990
8096
|
) : person.name;
|
|
7991
8097
|
const visibleFields = fields ?? [];
|
|
7992
|
-
const actionBar = actions && actions.length > 0 ? /* @__PURE__ */
|
|
8098
|
+
const actionBar = actions && actions.length > 0 ? /* @__PURE__ */ jsx28(Actions, { actions, onAction: (id) => onAction?.(id, person), icons, Link, can, menuLabel: `Actions for ${person.name}` }) : null;
|
|
7993
8099
|
if (layout === "compact") {
|
|
7994
|
-
return /* @__PURE__ */
|
|
7995
|
-
/* @__PURE__ */
|
|
7996
|
-
/* @__PURE__ */
|
|
7997
|
-
/* @__PURE__ */
|
|
7998
|
-
(person.role || person.email) && /* @__PURE__ */
|
|
8100
|
+
return /* @__PURE__ */ jsxs25("div", { "data-slot": "person-card", "data-layout": "compact", className: cn21("flex min-w-0 items-center gap-3", className), children: [
|
|
8101
|
+
/* @__PURE__ */ jsx28(PersonAvatar, { name: person.name, image: person.image, presence: person.presence }),
|
|
8102
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 flex-col text-sm", children: [
|
|
8103
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate font-medium", children: name }),
|
|
8104
|
+
(person.role || person.email) && /* @__PURE__ */ jsx28("span", { className: "truncate text-muted-foreground", children: person.role ?? person.email })
|
|
7999
8105
|
] }),
|
|
8000
|
-
actionBar && /* @__PURE__ */
|
|
8106
|
+
actionBar && /* @__PURE__ */ jsx28("div", { className: "ms-auto", children: actionBar })
|
|
8001
8107
|
] });
|
|
8002
8108
|
}
|
|
8003
8109
|
if (layout === "row") {
|
|
8004
|
-
return /* @__PURE__ */
|
|
8110
|
+
return /* @__PURE__ */ jsxs25(
|
|
8005
8111
|
"div",
|
|
8006
8112
|
{
|
|
8007
8113
|
"data-slot": "person-card",
|
|
8008
8114
|
"data-layout": "row",
|
|
8009
8115
|
className: cn21("flex flex-wrap items-center gap-x-4 gap-y-2 text-sm sm:flex-nowrap", className),
|
|
8010
8116
|
children: [
|
|
8011
|
-
/* @__PURE__ */
|
|
8012
|
-
/* @__PURE__ */
|
|
8013
|
-
/* @__PURE__ */
|
|
8014
|
-
/* @__PURE__ */
|
|
8015
|
-
person.email && /* @__PURE__ */
|
|
8117
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
8118
|
+
/* @__PURE__ */ jsx28(PersonAvatar, { name: person.name, image: person.image, presence: person.presence }),
|
|
8119
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 flex-col", children: [
|
|
8120
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate font-medium", children: name }),
|
|
8121
|
+
person.email && /* @__PURE__ */ jsx28("span", { className: "truncate text-muted-foreground", children: person.email })
|
|
8016
8122
|
] })
|
|
8017
8123
|
] }),
|
|
8018
|
-
person.role && /* @__PURE__ */
|
|
8019
|
-
visibleFields.map((field) => /* @__PURE__ */
|
|
8020
|
-
person.status && /* @__PURE__ */
|
|
8021
|
-
actionBar && /* @__PURE__ */
|
|
8124
|
+
person.role && /* @__PURE__ */ jsx28("span", { className: "w-32 shrink-0 truncate text-muted-foreground max-sm:hidden", children: person.role }),
|
|
8125
|
+
visibleFields.map((field) => /* @__PURE__ */ jsx28("span", { className: "w-28 shrink-0 truncate max-md:hidden", children: /* @__PURE__ */ jsx28(Value5, { row: person, field }) }, String(field.key))),
|
|
8126
|
+
person.status && /* @__PURE__ */ jsx28("span", { className: "shrink-0", children: /* @__PURE__ */ jsx28(BadgeView, { badge: person.status }) }),
|
|
8127
|
+
actionBar && /* @__PURE__ */ jsx28("div", { className: "shrink-0", children: actionBar })
|
|
8022
8128
|
]
|
|
8023
8129
|
}
|
|
8024
8130
|
);
|
|
8025
8131
|
}
|
|
8026
|
-
const statList = stats && stats.length > 0 && /* @__PURE__ */
|
|
8132
|
+
const statList = stats && stats.length > 0 && /* @__PURE__ */ jsx28(
|
|
8027
8133
|
"dl",
|
|
8028
8134
|
{
|
|
8029
8135
|
className: "grid divide-x rounded-lg border",
|
|
8030
8136
|
style: { gridTemplateColumns: `repeat(${stats.length}, minmax(0, 1fr))` },
|
|
8031
8137
|
children: stats.map((stat) => {
|
|
8032
8138
|
const label = stat.label ?? ("key" in stat ? humanize6(String(stat.key)) : "");
|
|
8033
|
-
return /* @__PURE__ */
|
|
8034
|
-
/* @__PURE__ */
|
|
8035
|
-
/* @__PURE__ */
|
|
8139
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col-reverse items-center gap-0.5 px-2 py-2.5 text-center", children: [
|
|
8140
|
+
/* @__PURE__ */ jsx28("dt", { className: "text-xs text-muted-foreground", children: label }),
|
|
8141
|
+
/* @__PURE__ */ jsx28("dd", { className: "text-base font-semibold tabular-nums", children: "key" in stat ? /* @__PURE__ */ jsx28(Value5, { row: person, field: stat }) : stat.value })
|
|
8036
8142
|
] }, label);
|
|
8037
8143
|
})
|
|
8038
8144
|
}
|
|
8039
8145
|
);
|
|
8040
|
-
const contact = (person.email || person.phone) && /* @__PURE__ */
|
|
8041
|
-
person.email && /* @__PURE__ */
|
|
8042
|
-
/* @__PURE__ */
|
|
8043
|
-
/* @__PURE__ */
|
|
8146
|
+
const contact = (person.email || person.phone) && /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-1 text-sm text-muted-foreground", children: [
|
|
8147
|
+
person.email && /* @__PURE__ */ jsxs25("a", { href: `mailto:${person.email}`, className: "inline-flex min-w-0 items-center gap-2 rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50", children: [
|
|
8148
|
+
/* @__PURE__ */ jsx28(MailIcon, { "aria-hidden": true, className: "size-4 shrink-0" }),
|
|
8149
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate", children: person.email })
|
|
8044
8150
|
] }),
|
|
8045
|
-
person.phone && /* @__PURE__ */
|
|
8046
|
-
/* @__PURE__ */
|
|
8151
|
+
person.phone && /* @__PURE__ */ jsxs25("a", { href: `tel:${person.phone}`, className: "inline-flex items-center gap-2 rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50", children: [
|
|
8152
|
+
/* @__PURE__ */ jsx28(PhoneIcon, { "aria-hidden": true, className: "size-4 shrink-0" }),
|
|
8047
8153
|
person.phone
|
|
8048
8154
|
] })
|
|
8049
8155
|
] });
|
|
8050
|
-
const fieldList = visibleFields.length > 0 && /* @__PURE__ */
|
|
8051
|
-
/* @__PURE__ */
|
|
8052
|
-
/* @__PURE__ */
|
|
8156
|
+
const fieldList = visibleFields.length > 0 && /* @__PURE__ */ jsx28("dl", { className: "flex flex-col gap-2 text-sm", children: visibleFields.map((field) => /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between gap-4", children: [
|
|
8157
|
+
/* @__PURE__ */ jsx28("dt", { className: "text-muted-foreground", children: field.label ?? humanize6(String(field.key)) }),
|
|
8158
|
+
/* @__PURE__ */ jsx28("dd", { className: "min-w-0 truncate text-end font-medium", children: /* @__PURE__ */ jsx28(Value5, { row: person, field }) })
|
|
8053
8159
|
] }, String(field.key))) });
|
|
8054
8160
|
if (layout === "header") {
|
|
8055
8161
|
const band2 = cover ?? "muted";
|
|
8056
|
-
return /* @__PURE__ */
|
|
8162
|
+
return /* @__PURE__ */ jsxs25(
|
|
8057
8163
|
"section",
|
|
8058
8164
|
{
|
|
8059
8165
|
"data-slot": "person-card",
|
|
@@ -8061,10 +8167,10 @@ function PersonCard({
|
|
|
8061
8167
|
"aria-label": person.name,
|
|
8062
8168
|
className: cn21("overflow-hidden rounded-xl bg-card text-card-foreground ring-1 ring-foreground/10", className),
|
|
8063
8169
|
children: [
|
|
8064
|
-
band2 !== "none" && /* @__PURE__ */
|
|
8065
|
-
/* @__PURE__ */
|
|
8066
|
-
/* @__PURE__ */
|
|
8067
|
-
/* @__PURE__ */
|
|
8170
|
+
band2 !== "none" && /* @__PURE__ */ jsx28("div", { "aria-hidden": true, className: cn21("h-24 sm:h-32", COVER[band2]) }),
|
|
8171
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-4 px-4 pb-4 sm:px-6 sm:pb-6", children: [
|
|
8172
|
+
/* @__PURE__ */ jsxs25("div", { className: cn21("flex flex-wrap items-end justify-between gap-4", band2 === "none" ? "pt-6" : "-mt-10 sm:-mt-12"), children: [
|
|
8173
|
+
/* @__PURE__ */ jsx28(
|
|
8068
8174
|
PersonAvatar,
|
|
8069
8175
|
{
|
|
8070
8176
|
name: person.name,
|
|
@@ -8079,18 +8185,18 @@ function PersonCard({
|
|
|
8079
8185
|
),
|
|
8080
8186
|
actionBar
|
|
8081
8187
|
] }),
|
|
8082
|
-
/* @__PURE__ */
|
|
8083
|
-
/* @__PURE__ */
|
|
8084
|
-
/* @__PURE__ */
|
|
8085
|
-
person.status && /* @__PURE__ */
|
|
8188
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
8189
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
8190
|
+
/* @__PURE__ */ jsx28("h1", { className: "text-2xl font-semibold tracking-tight", children: person.name }),
|
|
8191
|
+
person.status && /* @__PURE__ */ jsx28(BadgeView, { badge: person.status })
|
|
8086
8192
|
] }),
|
|
8087
|
-
person.role && /* @__PURE__ */
|
|
8193
|
+
person.role && /* @__PURE__ */ jsx28("p", { className: "text-sm text-muted-foreground", children: person.role })
|
|
8088
8194
|
] }),
|
|
8089
|
-
(contact || fieldList) && /* @__PURE__ */
|
|
8195
|
+
(contact || fieldList) && /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-4 sm:flex-row sm:gap-10", children: [
|
|
8090
8196
|
contact,
|
|
8091
|
-
visibleFields.length > 0 && /* @__PURE__ */
|
|
8092
|
-
/* @__PURE__ */
|
|
8093
|
-
/* @__PURE__ */
|
|
8197
|
+
visibleFields.length > 0 && /* @__PURE__ */ jsx28("ul", { className: "flex flex-wrap gap-x-6 gap-y-1 text-sm", children: visibleFields.map((field) => /* @__PURE__ */ jsxs25("li", { className: "flex flex-col", children: [
|
|
8198
|
+
/* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: field.label ?? humanize6(String(field.key)) }),
|
|
8199
|
+
/* @__PURE__ */ jsx28("span", { className: "font-medium", children: /* @__PURE__ */ jsx28(Value5, { row: person, field }) })
|
|
8094
8200
|
] }, String(field.key))) })
|
|
8095
8201
|
] }),
|
|
8096
8202
|
statList
|
|
@@ -8100,7 +8206,7 @@ function PersonCard({
|
|
|
8100
8206
|
);
|
|
8101
8207
|
}
|
|
8102
8208
|
const band = cover ?? "none";
|
|
8103
|
-
return /* @__PURE__ */
|
|
8209
|
+
return /* @__PURE__ */ jsxs25(
|
|
8104
8210
|
"section",
|
|
8105
8211
|
{
|
|
8106
8212
|
"data-slot": "person-card",
|
|
@@ -8108,9 +8214,9 @@ function PersonCard({
|
|
|
8108
8214
|
"aria-label": person.name,
|
|
8109
8215
|
className: cn21("flex flex-col overflow-hidden rounded-xl bg-card text-sm text-card-foreground ring-1 ring-foreground/10", className),
|
|
8110
8216
|
children: [
|
|
8111
|
-
band !== "none" && /* @__PURE__ */
|
|
8112
|
-
/* @__PURE__ */
|
|
8113
|
-
/* @__PURE__ */
|
|
8217
|
+
band !== "none" && /* @__PURE__ */ jsx28("div", { "aria-hidden": true, className: cn21("h-16", COVER[band]) }),
|
|
8218
|
+
/* @__PURE__ */ jsxs25(CardHeader4, { className: cn21("flex flex-col items-center gap-2 px-4 text-center", band === "none" ? "pt-6" : "-mt-8"), children: [
|
|
8219
|
+
/* @__PURE__ */ jsx28(
|
|
8114
8220
|
PersonAvatar,
|
|
8115
8221
|
{
|
|
8116
8222
|
name: person.name,
|
|
@@ -8120,18 +8226,18 @@ function PersonCard({
|
|
|
8120
8226
|
className: cn21("size-16! [&_[data-slot=avatar-fallback]]:text-lg", band !== "none" && "ring-4 ring-card")
|
|
8121
8227
|
}
|
|
8122
8228
|
),
|
|
8123
|
-
/* @__PURE__ */
|
|
8124
|
-
/* @__PURE__ */
|
|
8125
|
-
person.role && /* @__PURE__ */
|
|
8229
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-col items-center gap-0.5", children: [
|
|
8230
|
+
/* @__PURE__ */ jsx28(CardTitle4, { as: "h3", children: name }),
|
|
8231
|
+
person.role && /* @__PURE__ */ jsx28(CardDescription4, { children: person.role })
|
|
8126
8232
|
] }),
|
|
8127
|
-
person.status && /* @__PURE__ */
|
|
8233
|
+
person.status && /* @__PURE__ */ jsx28(BadgeView, { badge: person.status })
|
|
8128
8234
|
] }),
|
|
8129
|
-
/* @__PURE__ */
|
|
8235
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-1 flex-col gap-4 p-4", children: [
|
|
8130
8236
|
contact,
|
|
8131
8237
|
fieldList,
|
|
8132
8238
|
statList
|
|
8133
8239
|
] }),
|
|
8134
|
-
actionBar && /* @__PURE__ */
|
|
8240
|
+
actionBar && /* @__PURE__ */ jsx28("div", { className: "mt-auto border-t bg-muted/50 p-3 [&_[data-slot=actions]]:flex-nowrap [&_[data-slot=actions]>button:not([aria-haspopup])]:flex-1 [&_[data-slot=actions]>a]:flex-1", children: actionBar })
|
|
8135
8241
|
]
|
|
8136
8242
|
}
|
|
8137
8243
|
);
|
|
@@ -8155,21 +8261,21 @@ function PersonCards({
|
|
|
8155
8261
|
...view
|
|
8156
8262
|
}) {
|
|
8157
8263
|
if (layout === "card") {
|
|
8158
|
-
return /* @__PURE__ */
|
|
8264
|
+
return /* @__PURE__ */ jsx28("div", { "data-slot": "person-cards", className: cn21("grid gap-4", GRID[columns], className), children: people.map((person) => /* @__PURE__ */ jsx28(PersonCard, { person, layout: "card", ...view }, getId(person))) });
|
|
8159
8265
|
}
|
|
8160
|
-
return /* @__PURE__ */
|
|
8266
|
+
return /* @__PURE__ */ jsxs25(
|
|
8161
8267
|
"section",
|
|
8162
8268
|
{
|
|
8163
8269
|
"data-slot": "person-cards",
|
|
8164
8270
|
"aria-label": title,
|
|
8165
8271
|
className: cn21("flex flex-col gap-4 rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)]", className),
|
|
8166
8272
|
children: [
|
|
8167
|
-
(title || description || headerActions?.length) && /* @__PURE__ */
|
|
8168
|
-
title && /* @__PURE__ */
|
|
8169
|
-
description && /* @__PURE__ */
|
|
8170
|
-
headerActions && headerActions.length > 0 && /* @__PURE__ */
|
|
8273
|
+
(title || description || headerActions?.length) && /* @__PURE__ */ jsxs25(CardHeader4, { children: [
|
|
8274
|
+
title && /* @__PURE__ */ jsx28(CardTitle4, { as: "h2", children: title }),
|
|
8275
|
+
description && /* @__PURE__ */ jsx28(CardDescription4, { children: description }),
|
|
8276
|
+
headerActions && headerActions.length > 0 && /* @__PURE__ */ jsx28("div", { "data-slot": "card-action", className: "col-start-2 row-span-2 row-start-1 self-start justify-self-end", children: /* @__PURE__ */ jsx28(Actions, { actions: headerActions, onAction: onHeaderAction, icons: view.icons, Link: view.linkComponent, can: view.can }) })
|
|
8171
8277
|
] }),
|
|
8172
|
-
people.length === 0 ? /* @__PURE__ */
|
|
8278
|
+
people.length === 0 ? /* @__PURE__ */ jsx28("p", { className: "px-4 py-6 text-center text-muted-foreground", children: emptyText }) : /* @__PURE__ */ jsx28("ul", { className: "flex flex-col divide-y border-t", children: people.map((person) => /* @__PURE__ */ jsx28("li", { className: "px-4 py-3", children: /* @__PURE__ */ jsx28(PersonCard, { person, layout, ...view }) }, getId(person))) })
|
|
8173
8279
|
]
|
|
8174
8280
|
}
|
|
8175
8281
|
);
|
|
@@ -8198,6 +8304,7 @@ export {
|
|
|
8198
8304
|
RankedList,
|
|
8199
8305
|
RecordPage,
|
|
8200
8306
|
SettingsDialog,
|
|
8307
|
+
ShortcutsDialog,
|
|
8201
8308
|
StatCard,
|
|
8202
8309
|
StatCards,
|
|
8203
8310
|
TIER_COLUMNS,
|