@burdenoff/microfe-eventfullymanaged 2026.1110.9 → 2026.1110.11

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.
@@ -23,6 +23,12 @@ export interface ActionMenuProps {
23
23
  onDelete?: () => void | Promise<void>;
24
24
  /** Name shown inside the delete confirmation ("Delete \"Acme Corp\"?"). */
25
25
  entityName?: string;
26
+ /**
27
+ * Extra sentence appended to the confirm dialog body, after the standard
28
+ * "cannot be undone" copy — for a caveat specific to this delete (e.g. a
29
+ * credential that also needs revoking at the provider).
30
+ */
31
+ confirmNote?: string;
26
32
  /** Label for the danger item + confirm button. Defaults to "Delete". */
27
33
  deleteLabel?: string;
28
34
  /** Additional items inserted before the Delete action. */
@@ -40,4 +46,4 @@ export interface ActionMenuProps {
40
46
  *
41
47
  * Safe inside clickable cards: the trigger and content stop click propagation.
42
48
  */
43
- export declare function ActionMenu({ ariaLabel, onView, onEdit, onDelete, entityName, deleteLabel, extraItems, align, trigger, }: ActionMenuProps): import('react').JSX.Element | null;
49
+ export declare function ActionMenu({ ariaLabel, onView, onEdit, onDelete, entityName, confirmNote, deleteLabel, extraItems, align, trigger, }: ActionMenuProps): import('react').JSX.Element | null;
@@ -5,16 +5,16 @@ import { AlertDialog as u, AlertDialogAction as d, AlertDialogCancel as f, Alert
5
5
  import { useExclusiveMenu as w } from "@burdenoff/fe-libs/shared/hooks";
6
6
  // src/eventfullymanaged/components/ActionMenu.tsx
7
7
  var T = "text-status-error-text focus:text-status-error-text";
8
- function E({ ariaLabel: E, onView: D, onEdit: O, onDelete: k, entityName: A, deleteLabel: j = "Delete", extraItems: M = [], align: N = "end", trigger: P }) {
9
- let F = t(), [I, L] = n(!1), [R, z] = n(!1), [B, V] = n(!1), H = e(() => L(!1), []);
10
- w(F, I, H);
11
- let U = async () => {
8
+ function E({ ariaLabel: E, onView: D, onEdit: O, onDelete: k, entityName: A, confirmNote: j, deleteLabel: M = "Delete", extraItems: N = [], align: P = "end", trigger: F }) {
9
+ let I = t(), [L, R] = n(!1), [z, B] = n(!1), [V, H] = n(!1), U = e(() => R(!1), []);
10
+ w(I, L, U);
11
+ let W = async () => {
12
12
  if (k) try {
13
- V(!0), await k(), z(!1);
13
+ H(!0), await k(), B(!1);
14
14
  } catch {} finally {
15
- V(!1);
15
+ H(!1);
16
16
  }
17
- }, W = P ?? /* @__PURE__ */ i("button", {
17
+ }, G = F ?? /* @__PURE__ */ i("button", {
18
18
  type: "button",
19
19
  className: "inline-flex size-9 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus max-md:size-11",
20
20
  "aria-label": E,
@@ -23,16 +23,16 @@ function E({ ariaLabel: E, onView: D, onEdit: O, onDelete: k, entityName: A, del
23
23
  "aria-hidden": "true"
24
24
  })
25
25
  });
26
- return D || O || M.length > 0 || k ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a(v, {
27
- open: I,
28
- onOpenChange: L,
26
+ return D || O || N.length > 0 || k ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a(v, {
27
+ open: L,
28
+ onOpenChange: R,
29
29
  children: [/* @__PURE__ */ i(S, {
30
30
  asChild: !0,
31
31
  onClick: (e) => e.stopPropagation(),
32
32
  onKeyDown: (e) => e.stopPropagation(),
33
- children: W
33
+ children: G
34
34
  }), /* @__PURE__ */ a(y, {
35
- align: N,
35
+ align: P,
36
36
  className: "min-w-44",
37
37
  onClick: (e) => e.stopPropagation(),
38
38
  onKeyDown: (e) => e.stopPropagation(),
@@ -53,7 +53,7 @@ function E({ ariaLabel: E, onView: D, onEdit: O, onDelete: k, entityName: A, del
53
53
  "aria-hidden": "true"
54
54
  }), /* @__PURE__ */ i("span", { children: "Edit" })]
55
55
  }) : null,
56
- M.map((e) => {
56
+ N.map((e) => {
57
57
  let t = e.icon;
58
58
  return /* @__PURE__ */ a("div", {
59
59
  className: "contents",
@@ -73,36 +73,37 @@ function E({ ariaLabel: E, onView: D, onEdit: O, onDelete: k, entityName: A, del
73
73
  }),
74
74
  k ? /* @__PURE__ */ a("div", {
75
75
  className: "contents",
76
- children: [D || O || M.length > 0 ? /* @__PURE__ */ i(x, {}) : null, /* @__PURE__ */ a(b, {
76
+ children: [D || O || N.length > 0 ? /* @__PURE__ */ i(x, {}) : null, /* @__PURE__ */ a(b, {
77
77
  className: `cursor-pointer gap-2 ${T}`,
78
- onSelect: () => z(!0),
78
+ onSelect: () => B(!0),
79
79
  children: [/* @__PURE__ */ i(l, {
80
80
  className: "size-4 shrink-0",
81
81
  "aria-hidden": "true"
82
- }), /* @__PURE__ */ i("span", { children: j })]
82
+ }), /* @__PURE__ */ i("span", { children: M })]
83
83
  })]
84
84
  }) : null
85
85
  ]
86
86
  })]
87
87
  }), k ? /* @__PURE__ */ i(u, {
88
- open: R,
89
- onOpenChange: (e) => B ? void 0 : z(e),
88
+ open: z,
89
+ onOpenChange: (e) => V ? void 0 : B(e),
90
90
  children: /* @__PURE__ */ a(p, {
91
91
  onClick: (e) => e.stopPropagation(),
92
- children: [/* @__PURE__ */ a(g, { children: [/* @__PURE__ */ a(_, { children: [j, A ? ` “${A}”?` : "?"] }), /* @__PURE__ */ a(m, { children: [
92
+ children: [/* @__PURE__ */ a(g, { children: [/* @__PURE__ */ a(_, { children: [M, A ? ` “${A}”?` : "?"] }), /* @__PURE__ */ a(m, { children: [
93
93
  "This action cannot be undone. ",
94
94
  A ? `“${A}” ` : "This record ",
95
- "will be permanently removed."
95
+ "will be permanently removed.",
96
+ j ? ` ${j}` : ""
96
97
  ] })] }), /* @__PURE__ */ a(h, { children: [/* @__PURE__ */ i(f, {
97
- disabled: B,
98
+ disabled: V,
98
99
  children: "Cancel"
99
100
  }), /* @__PURE__ */ i(d, {
100
101
  onClick: (e) => {
101
- e.preventDefault(), U();
102
+ e.preventDefault(), W();
102
103
  },
103
- disabled: B,
104
+ disabled: V,
104
105
  className: C({ variant: "destructive" }),
105
- children: B ? "Deleting…" : j
106
+ children: V ? "Deleting…" : M
106
107
  })] })]
107
108
  })
108
109
  }) : null] }) : null;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionMenu.js","names":["_Fragment","DANGER_ITEM_CLASS","ActionMenu","menuId","useId","open","setOpen","useState","confirmOpen","setConfirmOpen","deleting","setDeleting","close","useCallback","handleConfirmDelete","onDelete","triggerNode","trigger","ariaLabel","MoreVertical","onView","onEdit","extraItems","Fragment","DropdownMenu","DropdownMenuTrigger","event","DropdownMenuContent","DropdownMenuItem","Eye","Pencil","Icon","item","DropdownMenuSeparator","Trash2","deleteLabel","AlertDialog","next","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","entityName","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","buttonVariants"],"sources":["../../../src/eventfullymanaged/components/ActionMenu.tsx"],"sourcesContent":["import { useCallback, useId, useState, type ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Eye, MoreVertical, Pencil, Trash2 } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n buttonVariants,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@burdenoff/fe-libs/ui';\nimport { useExclusiveMenu } from '@burdenoff/fe-libs/shared/hooks';\n\nexport interface ActionMenuItem {\n key: string;\n label: string;\n icon?: LucideIcon;\n onSelect: () => void;\n variant?: 'default' | 'danger';\n disabled?: boolean;\n separatorBefore?: boolean;\n}\n\nexport interface ActionMenuProps {\n /** Accessible name for the trigger, e.g. \"Sponsor actions\". */\n ariaLabel: string;\n /** View handler — renders the \"View\" item when provided. */\n onView?: () => void;\n /** Edit handler — renders the \"Edit\" item when provided. */\n onEdit?: () => void;\n /**\n * Delete handler — renders a danger \"Delete\" item that first opens a confirm\n * dialog. May be async; the dialog stays open until it resolves.\n */\n onDelete?: () => void | Promise<void>;\n /** Name shown inside the delete confirmation (\"Delete \\\"Acme Corp\\\"?\"). */\n entityName?: string;\n /** Label for the danger item + confirm button. Defaults to \"Delete\". */\n deleteLabel?: string;\n /** Additional items inserted before the Delete action. */\n extraItems?: ActionMenuItem[];\n align?: 'start' | 'end';\n /** Custom trigger; defaults to a kebab icon button. */\n trigger?: ReactNode;\n}\n\nconst DANGER_ITEM_CLASS = 'text-status-error-text focus:text-status-error-text';\n\n/**\n * Canonical row overflow menu (View / Edit / Delete) for EventfullyManaged list\n * pages. Built on the fe-libs Radix DropdownMenu (keyboard nav, Escape,\n * outside-click, focus return) and coordinated across the page via\n * `useExclusiveMenu`, so opening one row's menu closes any other. Delete routes\n * through an AlertDialog confirm before the destructive handler fires.\n *\n * Safe inside clickable cards: the trigger and content stop click propagation.\n */\nexport function ActionMenu({\n ariaLabel,\n onView,\n onEdit,\n onDelete,\n entityName,\n deleteLabel = 'Delete',\n extraItems = [],\n align = 'end',\n trigger,\n}: ActionMenuProps) {\n const menuId = useId();\n const [open, setOpen] = useState(false);\n const [confirmOpen, setConfirmOpen] = useState(false);\n const [deleting, setDeleting] = useState(false);\n\n const close = useCallback(() => setOpen(false), []);\n // Close this menu whenever another exclusive menu on the page opens.\n useExclusiveMenu(menuId, open, close);\n\n const handleConfirmDelete = async () => {\n if (!onDelete) {\n return;\n }\n try {\n setDeleting(true);\n await onDelete();\n setConfirmOpen(false);\n } catch {\n // The handler surfaces its own error (toast); keep the dialog open so the\n // user can retry or cancel rather than silently dismissing.\n } finally {\n setDeleting(false);\n }\n };\n\n const triggerNode = trigger ?? (\n <button\n type=\"button\"\n className=\"inline-flex size-9 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus max-md:size-11\"\n aria-label={ariaLabel}\n >\n <MoreVertical className=\"size-4\" aria-hidden=\"true\" />\n </button>\n );\n\n const hasAnyItem = Boolean(onView || onEdit || extraItems.length > 0 || onDelete);\n if (!hasAnyItem) {\n return null;\n }\n\n return (\n <>\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n asChild\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {triggerNode}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align={align}\n className=\"min-w-44\"\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {onView ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onView()}>\n <Eye className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>View</span>\n </DropdownMenuItem>\n ) : null}\n {onEdit ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onEdit()}>\n <Pencil className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>Edit</span>\n </DropdownMenuItem>\n ) : null}\n {extraItems.map((item) => {\n const Icon = item.icon;\n return (\n <div key={item.key} className=\"contents\">\n {item.separatorBefore ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n disabled={item.disabled}\n onSelect={() => item.onSelect()}\n className={`cursor-pointer gap-2 ${item.variant === 'danger' ? DANGER_ITEM_CLASS : ''}`}\n >\n {Icon ? <Icon className=\"size-4 shrink-0\" aria-hidden=\"true\" /> : null}\n <span className=\"min-w-0 truncate\">{item.label}</span>\n </DropdownMenuItem>\n </div>\n );\n })}\n {onDelete ? (\n <div className=\"contents\">\n {onView || onEdit || extraItems.length > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n className={`cursor-pointer gap-2 ${DANGER_ITEM_CLASS}`}\n onSelect={() => setConfirmOpen(true)}\n >\n <Trash2 className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{deleteLabel}</span>\n </DropdownMenuItem>\n </div>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n\n {onDelete ? (\n <AlertDialog open={confirmOpen} onOpenChange={(next) => (deleting ? undefined : setConfirmOpen(next))}>\n <AlertDialogContent onClick={(event) => event.stopPropagation()}>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {deleteLabel}\n {entityName ? ` “${entityName}”?` : '?'}\n </AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. {entityName ? `“${entityName}” ` : 'This record '}\n will be permanently removed.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={deleting}>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={(event) => {\n event.preventDefault();\n void handleConfirmDelete();\n }}\n disabled={deleting}\n className={buttonVariants({ variant: 'destructive' })}\n >\n {deleting ? 'Deleting…' : deleteLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;AAsDA,IAAMC,IAAoB;AAW1B,SAAgBC,EAAW,EACzB,cACA,WACA,WACA,aACA,eACA,iBAAc,UACd,gBAAa,CAAC,GACd,WAAQ,OACR,cACkB;CAClB,IAAMC,IAASC,EAAM,GACf,CAACC,GAAMC,KAAWC,EAAS,EAAK,GAChC,CAACC,GAAaC,KAAkBF,EAAS,EAAK,GAC9C,CAACG,GAAUC,KAAeJ,EAAS,EAAK,GAExCK,IAAQC,QAAkBP,EAAQ,EAAK,GAAG,CAAC,CAAC;CAElD,EAAiBH,GAAQE,GAAMO,CAAK;CAEpC,IAAME,IAAsB,YAAY;EACtC,IAAKC,GAGL,IAAI;GAGF,AAFAJ,EAAY,EAAI,GAChB,MAAMI,EAAS,GACfN,EAAe,EAAK;EACtB,QAAQ,CAGR,UAAU;GACR,EAAY,EAAK;EACnB;CACF,GAEMO,IAAcC,KAClB,kBAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,cAAYC;EAEZ,UAAA,kBAACC,GAAD;GAAc,WAAU;GAAS,eAAY;EAAQ,CAAA;CAC/C,C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AK,GAUV;IAET,CAAC;IACAjB,IACC,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACGK,KAAUC,KAAUC,EAAW,SAAS,IAAI,kBAACW,GAAD,CAAwB,CAAA,IAAI,MACzE,kBAACL,GAAD;MACE,WAAW,wBAAwB3B;MACnC,gBAAgBQ,EAAe,EAAI;MAFrC,UAAA,CAIE,kBAACyB,GAAD;OAAQ,WAAU;OAAkB,eAAY;MAAQ,CAAA,GACxD,kBAAC,QAAD,EAAA,UAAOC,EAAkB,CAAA,CACT;KACf,CAAA,CAAA;IACH,CAAA,IAAA;GACe;EACT,CAAA,CAAA;CAEb,CAAA,GAAApB,IACC,kBAACqB,GAAD;EAAa,MAAM5B;EAAa,eAAe,MAAUE,IAAW,KAAA,IAAYD,EAAe4B,CAAI;EACjG,UAAA,kBAACC,GAAD;GAAoB,UAAU,MAAUZ,EAAM,gBAAgB;GAA9D,UAAA,CACE,kBAACa,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA,CACGL,GACAM,IAAa,KAAKA,EAAW,MAAM,GACpB,EAAA,CAAA,GAClB,kBAACC,GAAD,EAAA,UAAA;IAAwB;IACSD,IAAa,IAAIA,EAAW,MAAM;IAAe;GAE1D,EAAA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACE,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;IAAmB,UAAUlC;IAAU,UAAA;GAAyB,CAAA,GAChE,kBAACmC,GAAD;IACE,UAAU,MAAU;KAElB,AADAnB,EAAM,eAAe,GACrBZ,EAAyB;IAC3B;IACA,UAAUJ;IACV,WAAWoC,EAAe,EAAE,SAAS,cAAc,CAAC;IAEnD,UAAApC,IAAW,cAAcyB;GACT,CAAA,CACF,EAAA,CAAA,CACD;;CACT,CAAA,IACX,IACJ,EAAA,CAAA,IA3FK;AA6FX"}
1
+ {"version":3,"file":"ActionMenu.js","names":["_Fragment","DANGER_ITEM_CLASS","ActionMenu","menuId","useId","open","setOpen","useState","confirmOpen","setConfirmOpen","deleting","setDeleting","close","useCallback","handleConfirmDelete","onDelete","triggerNode","trigger","ariaLabel","MoreVertical","onView","onEdit","extraItems","Fragment","DropdownMenu","DropdownMenuTrigger","event","DropdownMenuContent","DropdownMenuItem","Eye","Pencil","Icon","item","DropdownMenuSeparator","Trash2","deleteLabel","AlertDialog","next","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","entityName","AlertDialogDescription","confirmNote","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","buttonVariants"],"sources":["../../../src/eventfullymanaged/components/ActionMenu.tsx"],"sourcesContent":["import { useCallback, useId, useState, type ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Eye, MoreVertical, Pencil, Trash2 } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n buttonVariants,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@burdenoff/fe-libs/ui';\nimport { useExclusiveMenu } from '@burdenoff/fe-libs/shared/hooks';\n\nexport interface ActionMenuItem {\n key: string;\n label: string;\n icon?: LucideIcon;\n onSelect: () => void;\n variant?: 'default' | 'danger';\n disabled?: boolean;\n separatorBefore?: boolean;\n}\n\nexport interface ActionMenuProps {\n /** Accessible name for the trigger, e.g. \"Sponsor actions\". */\n ariaLabel: string;\n /** View handler — renders the \"View\" item when provided. */\n onView?: () => void;\n /** Edit handler — renders the \"Edit\" item when provided. */\n onEdit?: () => void;\n /**\n * Delete handler — renders a danger \"Delete\" item that first opens a confirm\n * dialog. May be async; the dialog stays open until it resolves.\n */\n onDelete?: () => void | Promise<void>;\n /** Name shown inside the delete confirmation (\"Delete \\\"Acme Corp\\\"?\"). */\n entityName?: string;\n /**\n * Extra sentence appended to the confirm dialog body, after the standard\n * \"cannot be undone\" copy — for a caveat specific to this delete (e.g. a\n * credential that also needs revoking at the provider).\n */\n confirmNote?: string;\n /** Label for the danger item + confirm button. Defaults to \"Delete\". */\n deleteLabel?: string;\n /** Additional items inserted before the Delete action. */\n extraItems?: ActionMenuItem[];\n align?: 'start' | 'end';\n /** Custom trigger; defaults to a kebab icon button. */\n trigger?: ReactNode;\n}\n\nconst DANGER_ITEM_CLASS = 'text-status-error-text focus:text-status-error-text';\n\n/**\n * Canonical row overflow menu (View / Edit / Delete) for EventfullyManaged list\n * pages. Built on the fe-libs Radix DropdownMenu (keyboard nav, Escape,\n * outside-click, focus return) and coordinated across the page via\n * `useExclusiveMenu`, so opening one row's menu closes any other. Delete routes\n * through an AlertDialog confirm before the destructive handler fires.\n *\n * Safe inside clickable cards: the trigger and content stop click propagation.\n */\nexport function ActionMenu({\n ariaLabel,\n onView,\n onEdit,\n onDelete,\n entityName,\n confirmNote,\n deleteLabel = 'Delete',\n extraItems = [],\n align = 'end',\n trigger,\n}: ActionMenuProps) {\n const menuId = useId();\n const [open, setOpen] = useState(false);\n const [confirmOpen, setConfirmOpen] = useState(false);\n const [deleting, setDeleting] = useState(false);\n\n const close = useCallback(() => setOpen(false), []);\n // Close this menu whenever another exclusive menu on the page opens.\n useExclusiveMenu(menuId, open, close);\n\n const handleConfirmDelete = async () => {\n if (!onDelete) {\n return;\n }\n try {\n setDeleting(true);\n await onDelete();\n setConfirmOpen(false);\n } catch {\n // The handler surfaces its own error (toast); keep the dialog open so the\n // user can retry or cancel rather than silently dismissing.\n } finally {\n setDeleting(false);\n }\n };\n\n const triggerNode = trigger ?? (\n <button\n type=\"button\"\n className=\"inline-flex size-9 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus max-md:size-11\"\n aria-label={ariaLabel}\n >\n <MoreVertical className=\"size-4\" aria-hidden=\"true\" />\n </button>\n );\n\n const hasAnyItem = Boolean(onView || onEdit || extraItems.length > 0 || onDelete);\n if (!hasAnyItem) {\n return null;\n }\n\n return (\n <>\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n asChild\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {triggerNode}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align={align}\n className=\"min-w-44\"\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {onView ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onView()}>\n <Eye className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>View</span>\n </DropdownMenuItem>\n ) : null}\n {onEdit ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onEdit()}>\n <Pencil className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>Edit</span>\n </DropdownMenuItem>\n ) : null}\n {extraItems.map((item) => {\n const Icon = item.icon;\n return (\n <div key={item.key} className=\"contents\">\n {item.separatorBefore ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n disabled={item.disabled}\n onSelect={() => item.onSelect()}\n className={`cursor-pointer gap-2 ${item.variant === 'danger' ? DANGER_ITEM_CLASS : ''}`}\n >\n {Icon ? <Icon className=\"size-4 shrink-0\" aria-hidden=\"true\" /> : null}\n <span className=\"min-w-0 truncate\">{item.label}</span>\n </DropdownMenuItem>\n </div>\n );\n })}\n {onDelete ? (\n <div className=\"contents\">\n {onView || onEdit || extraItems.length > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n className={`cursor-pointer gap-2 ${DANGER_ITEM_CLASS}`}\n onSelect={() => setConfirmOpen(true)}\n >\n <Trash2 className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{deleteLabel}</span>\n </DropdownMenuItem>\n </div>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n\n {onDelete ? (\n <AlertDialog open={confirmOpen} onOpenChange={(next) => (deleting ? undefined : setConfirmOpen(next))}>\n <AlertDialogContent onClick={(event) => event.stopPropagation()}>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {deleteLabel}\n {entityName ? ` “${entityName}”?` : '?'}\n </AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. {entityName ? `“${entityName}” ` : 'This record '}\n will be permanently removed.\n {confirmNote ? ` ${confirmNote}` : ''}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={deleting}>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={(event) => {\n event.preventDefault();\n void handleConfirmDelete();\n }}\n disabled={deleting}\n className={buttonVariants({ variant: 'destructive' })}\n >\n {deleting ? 'Deleting…' : deleteLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;AA4DA,IAAMC,IAAoB;AAW1B,SAAgBC,EAAW,EACzB,cACA,WACA,WACA,aACA,eACA,gBACA,iBAAc,UACd,gBAAa,CAAC,GACd,WAAQ,OACR,cACkB;CAClB,IAAMC,IAASC,EAAM,GACf,CAACC,GAAMC,KAAWC,EAAS,EAAK,GAChC,CAACC,GAAaC,KAAkBF,EAAS,EAAK,GAC9C,CAACG,GAAUC,KAAeJ,EAAS,EAAK,GAExCK,IAAQC,QAAkBP,EAAQ,EAAK,GAAG,CAAC,CAAC;CAElD,EAAiBH,GAAQE,GAAMO,CAAK;CAEpC,IAAME,IAAsB,YAAY;EACtC,IAAKC,GAGL,IAAI;GAGF,AAFAJ,EAAY,EAAI,GAChB,MAAMI,EAAS,GACfN,EAAe,EAAK;EACtB,QAAQ,CAGR,UAAU;GACR,EAAY,EAAK;EACnB;CACF,GAEMO,IAAcC,KAClB,kBAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,cAAYC;EAEZ,UAAA,kBAACC,GAAD;GAAc,WAAU;GAAS,eAAY;EAAQ,CAAA;CAC/C,CAAA;CAQV,OAL2BC,KAA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