@burojs/ui-shadcn 0.4.0 → 0.6.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.
Files changed (131) hide show
  1. package/README.md +22 -5
  2. package/dist/bulk-summary-CwSd6Yjb.cjs +108 -0
  3. package/dist/bulk-summary-CwSd6Yjb.cjs.map +1 -0
  4. package/dist/bulk-summary-GxMDP4bw.js +108 -0
  5. package/dist/bulk-summary-GxMDP4bw.js.map +1 -0
  6. package/dist/button-BxnnE28H.cjs +55 -0
  7. package/dist/button-BxnnE28H.cjs.map +1 -0
  8. package/dist/button-MWVeZaqj.js +44 -0
  9. package/dist/button-MWVeZaqj.js.map +1 -0
  10. package/dist/candidates-gate-Bb70LPAy.js +135 -0
  11. package/dist/candidates-gate-Bb70LPAy.js.map +1 -0
  12. package/dist/candidates-gate-D33jXLHO.cjs +153 -0
  13. package/dist/candidates-gate-D33jXLHO.cjs.map +1 -0
  14. package/dist/candidates-relation-picker-B116Bmqi.js +31 -0
  15. package/dist/candidates-relation-picker-B116Bmqi.js.map +1 -0
  16. package/dist/candidates-relation-picker-Cy0rTxvI.cjs +31 -0
  17. package/dist/candidates-relation-picker-Cy0rTxvI.cjs.map +1 -0
  18. package/dist/check-confirm-dialog--gPFnEeg.cjs +1547 -0
  19. package/dist/check-confirm-dialog--gPFnEeg.cjs.map +1 -0
  20. package/dist/check-confirm-dialog-bRT8lt0d.js +1245 -0
  21. package/dist/check-confirm-dialog-bRT8lt0d.js.map +1 -0
  22. package/dist/dialog-B_rt9S1c.js +63 -0
  23. package/dist/dialog-B_rt9S1c.js.map +1 -0
  24. package/dist/dialog-DRNUq9EA.cjs +112 -0
  25. package/dist/dialog-DRNUq9EA.cjs.map +1 -0
  26. package/dist/filter-builder-Bhn-dhZV.js +1621 -0
  27. package/dist/filter-builder-Bhn-dhZV.js.map +1 -0
  28. package/dist/filter-builder-nXqtM_h4.cjs +1789 -0
  29. package/dist/filter-builder-nXqtM_h4.cjs.map +1 -0
  30. package/dist/flow-runtime-D3avVH0I.cjs +255 -0
  31. package/dist/flow-runtime-D3avVH0I.cjs.map +1 -0
  32. package/dist/flow-runtime-s6lkRPKF.js +252 -0
  33. package/dist/flow-runtime-s6lkRPKF.js.map +1 -0
  34. package/dist/flow-screen-CCvgDI9G.js +704 -0
  35. package/dist/flow-screen-CCvgDI9G.js.map +1 -0
  36. package/dist/flow-screen-Ci_Sik4Y.cjs +708 -0
  37. package/dist/flow-screen-Ci_Sik4Y.cjs.map +1 -0
  38. package/dist/index.cjs +3420 -11986
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +1843 -2015
  41. package/dist/index.d.ts +1849 -2021
  42. package/dist/index.js +3090 -11675
  43. package/dist/index.js.map +1 -1
  44. package/dist/inline-flow-host-B6FI0ctQ.js +112 -0
  45. package/dist/inline-flow-host-B6FI0ctQ.js.map +1 -0
  46. package/dist/inline-flow-host-DV1et3c6.cjs +112 -0
  47. package/dist/inline-flow-host-DV1et3c6.cjs.map +1 -0
  48. package/dist/input-BI0czGyI.cjs +23 -0
  49. package/dist/input-BI0czGyI.cjs.map +1 -0
  50. package/dist/input-CUPStzZO.js +17 -0
  51. package/dist/input-CUPStzZO.js.map +1 -0
  52. package/dist/label-66W1qbke.js +29 -0
  53. package/dist/label-66W1qbke.js.map +1 -0
  54. package/dist/label-w6JYf2cF.cjs +36 -0
  55. package/dist/label-w6JYf2cF.cjs.map +1 -0
  56. package/dist/markdown/index.cjs +1 -1
  57. package/dist/markdown/index.d.cts +2 -3
  58. package/dist/markdown/index.d.ts +2 -3
  59. package/dist/markdown/index.js +1 -1
  60. package/dist/page-flow-route-hdnULWqd.cjs +277 -0
  61. package/dist/page-flow-route-hdnULWqd.cjs.map +1 -0
  62. package/dist/page-flow-route-i3ZfJ1sd.js +277 -0
  63. package/dist/page-flow-route-i3ZfJ1sd.js.map +1 -0
  64. package/dist/place-node-C5SmIAYU.cjs +8139 -0
  65. package/dist/place-node-C5SmIAYU.cjs.map +1 -0
  66. package/dist/place-node-NraNYKPx.js +7597 -0
  67. package/dist/place-node-NraNYKPx.js.map +1 -0
  68. package/dist/related-list-cards-BWZ9GfOG.js +42 -0
  69. package/dist/related-list-cards-BWZ9GfOG.js.map +1 -0
  70. package/dist/related-list-cards-CFq3meUn.cjs +42 -0
  71. package/dist/related-list-cards-CFq3meUn.cjs.map +1 -0
  72. package/dist/related-list-timeline-CCzl71aA.cjs +142 -0
  73. package/dist/related-list-timeline-CCzl71aA.cjs.map +1 -0
  74. package/dist/related-list-timeline-yrPsjA3F.js +142 -0
  75. package/dist/related-list-timeline-yrPsjA3F.js.map +1 -0
  76. package/dist/related-rows-ea43qhhy.cjs +208 -0
  77. package/dist/related-rows-ea43qhhy.cjs.map +1 -0
  78. package/dist/related-rows-o0_t-Yce.js +185 -0
  79. package/dist/related-rows-o0_t-Yce.js.map +1 -0
  80. package/dist/relation-create-IA40t1hi.cjs +364 -0
  81. package/dist/relation-create-IA40t1hi.cjs.map +1 -0
  82. package/dist/relation-create-h6F9B4C4.js +339 -0
  83. package/dist/relation-create-h6F9B4C4.js.map +1 -0
  84. package/dist/relation-many-picker-C8zFEjwd.cjs +467 -0
  85. package/dist/relation-many-picker-C8zFEjwd.cjs.map +1 -0
  86. package/dist/relation-many-picker-bvkjkv-k.js +466 -0
  87. package/dist/relation-many-picker-bvkjkv-k.js.map +1 -0
  88. package/dist/relation-picker-Z0ZJJ5uS.js +493 -0
  89. package/dist/relation-picker-Z0ZJJ5uS.js.map +1 -0
  90. package/dist/relation-picker-dialog-0IzkjmiA.cjs +304 -0
  91. package/dist/relation-picker-dialog-0IzkjmiA.cjs.map +1 -0
  92. package/dist/relation-picker-dialog-B6nIiJBf.js +303 -0
  93. package/dist/relation-picker-dialog-B6nIiJBf.js.map +1 -0
  94. package/dist/relation-picker-gag0qSR5.cjs +516 -0
  95. package/dist/relation-picker-gag0qSR5.cjs.map +1 -0
  96. package/dist/resource-page-router-3RUf9d1j.js +1588 -0
  97. package/dist/resource-page-router-3RUf9d1j.js.map +1 -0
  98. package/dist/resource-page-router-PXfMW9nh.cjs +1785 -0
  99. package/dist/resource-page-router-PXfMW9nh.cjs.map +1 -0
  100. package/dist/{rich-text-IDFvyvRE.js → rich-text-DFerywgz.js} +7 -4
  101. package/dist/{rich-text-IDFvyvRE.js.map → rich-text-DFerywgz.js.map} +1 -1
  102. package/dist/{rich-text-lndbYqzR.cjs → rich-text-vTyVjDoa.cjs} +25 -22
  103. package/dist/{rich-text-lndbYqzR.cjs.map → rich-text-vTyVjDoa.cjs.map} +1 -1
  104. package/dist/search-access-CPPmfuvy.js +654 -0
  105. package/dist/search-access-CPPmfuvy.js.map +1 -0
  106. package/dist/search-access-Dugvttlg.cjs +791 -0
  107. package/dist/search-access-Dugvttlg.cjs.map +1 -0
  108. package/dist/shell-BPlk8hEa.js +205 -0
  109. package/dist/shell-BPlk8hEa.js.map +1 -0
  110. package/dist/shell-DxhlsPwm.cjs +271 -0
  111. package/dist/shell-DxhlsPwm.cjs.map +1 -0
  112. package/dist/skeleton-U2noefj5.js +13 -0
  113. package/dist/skeleton-U2noefj5.js.map +1 -0
  114. package/dist/skeleton-_1gP7wan.cjs +18 -0
  115. package/dist/skeleton-_1gP7wan.cjs.map +1 -0
  116. package/dist/styles.css +241 -9
  117. package/dist/toaster-C02XbB9r.js +135 -0
  118. package/dist/toaster-C02XbB9r.js.map +1 -0
  119. package/dist/toaster-Cr51X7bz.cjs +195 -0
  120. package/dist/toaster-Cr51X7bz.cjs.map +1 -0
  121. package/dist/use-dialog-filter-state-C--oMAZG.js +87 -0
  122. package/dist/use-dialog-filter-state-C--oMAZG.js.map +1 -0
  123. package/dist/use-dialog-filter-state-Dhe8PcB5.cjs +92 -0
  124. package/dist/use-dialog-filter-state-Dhe8PcB5.cjs.map +1 -0
  125. package/dist/{use-theme-BwPWinB2.cjs → use-theme-DFlpXils.cjs} +12 -1
  126. package/dist/use-theme-DFlpXils.cjs.map +1 -0
  127. package/dist/{use-theme-IHmtrhEt.js → use-theme-dnE3Od3I.js} +7 -2
  128. package/dist/use-theme-dnE3Od3I.js.map +1 -0
  129. package/package.json +16 -14
  130. package/dist/use-theme-BwPWinB2.cjs.map +0 -1
  131. package/dist/use-theme-IHmtrhEt.js.map +0 -1
@@ -0,0 +1,1547 @@
1
+ const require_use_theme = require("./use-theme-DFlpXils.cjs");
2
+ const require_toaster = require("./toaster-Cr51X7bz.cjs");
3
+ const require_button = require("./button-BxnnE28H.cjs");
4
+ const require_dialog = require("./dialog-DRNUq9EA.cjs");
5
+ let _burojs_core = require("@burojs/core");
6
+ let _burojs_react = require("@burojs/react");
7
+ let _tabler_icons_react = require("@tabler/icons-react");
8
+ let react = require("react");
9
+ react = require_use_theme.__toESM(react, 1);
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
12
+ _radix_ui_react_tooltip = require_use_theme.__toESM(_radix_ui_react_tooltip, 1);
13
+ let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
14
+ _radix_ui_react_dropdown_menu = require_use_theme.__toESM(_radix_ui_react_dropdown_menu, 1);
15
+ let _burojs_core_internal = require("@burojs/core/internal");
16
+ let sonner = require("sonner");
17
+ //#region src/doc/doc-info.tsx
18
+ function DocInfo({ address, name, testId, className }) {
19
+ const doc = (0, _burojs_react.useDoc)(address);
20
+ const caps = (0, _burojs_react.useI18nCaps)();
21
+ const t = (0, _burojs_react.useOptionalT)();
22
+ const { openPanel } = (0, _burojs_react.useDocPanel)();
23
+ const [open, setOpen] = (0, react.useState)(false);
24
+ const see = (0, _burojs_core.resolveDocSee)(caps, address);
25
+ const { scope: articleScope, topicId: ownTopicId } = (0, _burojs_core.docAddressToArticle)(see ?? address);
26
+ const topics = (0, _burojs_react.useDocTopics)(articleScope);
27
+ const hasOwnArticle = ownTopicId === void 0 ? topics.length > 0 : topics.some((x) => x.id === ownTopicId);
28
+ if (!doc && !hasOwnArticle) return null;
29
+ const id = testId ?? `doc-info:${address}`;
30
+ const newTabNote = t("docPanel.opensInNewTab", { defaultValue: "(opens in a new tab)" });
31
+ const hasSummary = doc?.summary !== void 0;
32
+ const hasLinks = doc?.links !== void 0 && doc.links.length > 0;
33
+ return (0, react_jsx_runtime.jsxs)(require_toaster.Popover, {
34
+ open,
35
+ onOpenChange: setOpen,
36
+ children: [(0, react_jsx_runtime.jsx)(require_toaster.PopoverTrigger, {
37
+ asChild: true,
38
+ children: (0, react_jsx_runtime.jsx)("button", {
39
+ type: "button",
40
+ "aria-haspopup": "dialog",
41
+ "aria-label": t("docPanel.openFor", {
42
+ params: { name },
43
+ defaultValue: `Help: ${name}`
44
+ }),
45
+ "data-testid": id,
46
+ className: require_use_theme.cn("inline-flex size-6 min-h-[24px] min-w-[24px] shrink-0 items-center justify-center rounded-full", "text-muted-foreground", "transition-colors duration-150", "hover:bg-muted hover:text-foreground", "data-[state=open]:bg-muted data-[state=open]:text-foreground", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", className),
47
+ children: (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconInfoHexagon, {
48
+ className: "size-3.5",
49
+ "aria-hidden": "true"
50
+ })
51
+ })
52
+ }), (0, react_jsx_runtime.jsxs)(require_toaster.PopoverContent, {
53
+ role: "dialog",
54
+ "aria-label": name,
55
+ className: require_use_theme.cn("w-auto min-w-[16rem] max-w-[22rem]", "max-h-[min(24rem,60vh)] overflow-y-auto overscroll-contain", "space-y-2.5"),
56
+ "data-testid": `${id}:content`,
57
+ children: [
58
+ hasSummary && (0, react_jsx_runtime.jsx)("p", {
59
+ className: "text-[0.8125rem] leading-[1.6] text-foreground",
60
+ children: doc?.summary
61
+ }),
62
+ hasOwnArticle && (0, react_jsx_runtime.jsxs)("button", {
63
+ type: "button",
64
+ "data-testid": `${id}:more`,
65
+ onClick: () => {
66
+ setOpen(false);
67
+ openPanel(ownTopicId === void 0 ? { scopes: [articleScope] } : {
68
+ scopes: [articleScope],
69
+ topicId: ownTopicId
70
+ }, id);
71
+ },
72
+ className: require_use_theme.cn("inline-flex items-center gap-1 rounded-sm text-[0.8125rem] font-medium text-primary", "hover:underline underline-offset-2", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"),
73
+ children: [t("docPanel.readMore", { defaultValue: "Read more" }), (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconArrowRight, {
74
+ className: "size-3.5 shrink-0",
75
+ "aria-hidden": "true"
76
+ })]
77
+ }),
78
+ hasLinks && (0, react_jsx_runtime.jsx)("div", {
79
+ className: require_use_theme.cn("flex flex-col items-start gap-1.5", hasSummary && "border-t border-border/60 pt-2.5"),
80
+ children: doc?.links?.map((link) => (0, react_jsx_runtime.jsxs)("a", {
81
+ href: link.href,
82
+ target: "_blank",
83
+ rel: "noopener noreferrer",
84
+ className: require_use_theme.cn("group inline-flex max-w-full items-center gap-1 rounded-sm", "text-[0.8125rem] font-medium text-primary", "hover:underline underline-offset-2", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"),
85
+ children: [
86
+ (0, react_jsx_runtime.jsx)("span", {
87
+ className: "min-w-0 truncate",
88
+ children: link.label
89
+ }),
90
+ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconArrowUpRight, {
91
+ className: "size-3.5 shrink-0 transition-transform duration-150 group-hover:-translate-y-px group-hover:translate-x-px",
92
+ "aria-hidden": "true"
93
+ }),
94
+ (0, react_jsx_runtime.jsx)("span", {
95
+ className: "sr-only",
96
+ children: newTabNote
97
+ })
98
+ ]
99
+ }, link.href))
100
+ })
101
+ ]
102
+ })]
103
+ });
104
+ }
105
+ //#endregion
106
+ //#region src/primitives/tooltip.tsx
107
+ const TooltipProvider = _radix_ui_react_tooltip.Provider;
108
+ const Tooltip = _radix_ui_react_tooltip.Root;
109
+ const TooltipTrigger = _radix_ui_react_tooltip.Trigger;
110
+ const TooltipContent = react.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Portal, { children: (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Content, {
111
+ ref,
112
+ sideOffset,
113
+ className: require_use_theme.cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md duration-[var(--duration-overlay)] ease-[var(--ease-overlay)] animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
114
+ ...props
115
+ }) }));
116
+ TooltipContent.displayName = _radix_ui_react_tooltip.Content.displayName;
117
+ //#endregion
118
+ //#region src/primitives/dropdown-menu.tsx
119
+ const DropdownMenu = _radix_ui_react_dropdown_menu.Root;
120
+ const DropdownMenuTrigger = _radix_ui_react_dropdown_menu.Trigger;
121
+ const DropdownMenuGroup = _radix_ui_react_dropdown_menu.Group;
122
+ const DropdownMenuPortal = _radix_ui_react_dropdown_menu.Portal;
123
+ const DropdownMenuSub = _radix_ui_react_dropdown_menu.Sub;
124
+ const DropdownMenuRadioGroup = _radix_ui_react_dropdown_menu.RadioGroup;
125
+ const DropdownMenuSubTrigger = react.forwardRef(({ className, inset, children, ...props }, ref) => (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
126
+ ref,
127
+ className: require_use_theme.cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className),
128
+ ...props,
129
+ children: [children, (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronRight, { className: "ml-auto" })]
130
+ }));
131
+ DropdownMenuSubTrigger.displayName = _radix_ui_react_dropdown_menu.SubTrigger.displayName;
132
+ const DropdownMenuSubContent = react.forwardRef(({ className, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
133
+ ref,
134
+ className: require_use_theme.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg duration-[var(--duration-overlay)] ease-[var(--ease-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
135
+ ...props
136
+ }));
137
+ DropdownMenuSubContent.displayName = _radix_ui_react_dropdown_menu.SubContent.displayName;
138
+ const DropdownMenuContent = react.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
139
+ ref,
140
+ sideOffset,
141
+ className: require_use_theme.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md duration-[var(--duration-overlay)] ease-[var(--ease-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
142
+ ...props
143
+ }) }));
144
+ DropdownMenuContent.displayName = _radix_ui_react_dropdown_menu.Content.displayName;
145
+ const DropdownMenuItem = react.forwardRef(({ className, inset, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Item, {
146
+ ref,
147
+ className: require_use_theme.cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className),
148
+ ...props
149
+ }));
150
+ DropdownMenuItem.displayName = _radix_ui_react_dropdown_menu.Item.displayName;
151
+ const DropdownMenuCheckboxItem = react.forwardRef(({ className, children, checked, ...props }, ref) => (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
152
+ ref,
153
+ className: require_use_theme.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
154
+ checked,
155
+ ...props,
156
+ children: [(0, react_jsx_runtime.jsx)("span", {
157
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
158
+ children: (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, { className: "h-4 w-4" }) })
159
+ }), children]
160
+ }));
161
+ DropdownMenuCheckboxItem.displayName = _radix_ui_react_dropdown_menu.CheckboxItem.displayName;
162
+ const DropdownMenuRadioItem = react.forwardRef(({ className, children, ...props }, ref) => (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.RadioItem, {
163
+ ref,
164
+ className: require_use_theme.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
165
+ ...props,
166
+ children: [(0, react_jsx_runtime.jsx)("span", {
167
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
168
+ children: (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCircle, { className: "h-2 w-2 fill-current" }) })
169
+ }), children]
170
+ }));
171
+ DropdownMenuRadioItem.displayName = _radix_ui_react_dropdown_menu.RadioItem.displayName;
172
+ const DropdownMenuLabel = react.forwardRef(({ className, inset, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Label, {
173
+ ref,
174
+ className: require_use_theme.cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
175
+ ...props
176
+ }));
177
+ DropdownMenuLabel.displayName = _radix_ui_react_dropdown_menu.Label.displayName;
178
+ const DropdownMenuSeparator = react.forwardRef(({ className, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
179
+ ref,
180
+ className: require_use_theme.cn("-mx-1 my-1 h-px bg-muted", className),
181
+ ...props
182
+ }));
183
+ DropdownMenuSeparator.displayName = _radix_ui_react_dropdown_menu.Separator.displayName;
184
+ function DropdownMenuShortcut({ className, ...props }) {
185
+ return (0, react_jsx_runtime.jsx)("span", {
186
+ className: require_use_theme.cn("ml-auto text-xs tracking-widest opacity-60", className),
187
+ ...props
188
+ });
189
+ }
190
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
191
+ //#endregion
192
+ //#region src/primitives/icon.tsx
193
+ const REGISTRY = {
194
+ Play: _tabler_icons_react.IconPlayerPlay,
195
+ PlayCircle: _tabler_icons_react.IconCircleCaretRight,
196
+ StepForward: _tabler_icons_react.IconPlayerTrackNext,
197
+ RotateCcw: _tabler_icons_react.IconRotate,
198
+ RefreshCw: _tabler_icons_react.IconRefresh,
199
+ Ban: _tabler_icons_react.IconBan,
200
+ XCircle: _tabler_icons_react.IconCircleX,
201
+ Trash2: _tabler_icons_react.IconTrash,
202
+ Copy: _tabler_icons_react.IconCopy,
203
+ Hash: _tabler_icons_react.IconHash,
204
+ QrCode: _tabler_icons_react.IconQrcode,
205
+ Network: _tabler_icons_react.IconNetwork,
206
+ GitBranch: _tabler_icons_react.IconGitBranch,
207
+ Link: _tabler_icons_react.IconLink,
208
+ Link2: _tabler_icons_react.IconLink,
209
+ Pencil: _tabler_icons_react.IconPencil,
210
+ Plus: _tabler_icons_react.IconPlus,
211
+ Eye: _tabler_icons_react.IconEye,
212
+ ScrollText: _tabler_icons_react.IconScript,
213
+ History: _tabler_icons_react.IconHistory,
214
+ MoreHorizontal: _tabler_icons_react.IconDots,
215
+ Circle: _tabler_icons_react.IconCircle,
216
+ CircleCheck: _tabler_icons_react.IconCircleCheck,
217
+ Clock: _tabler_icons_react.IconClock,
218
+ Package: _tabler_icons_react.IconPackage,
219
+ PackagePlus: _tabler_icons_react.IconPackageImport,
220
+ PackageMinus: _tabler_icons_react.IconPackageExport,
221
+ PackageCheck: _tabler_icons_react.IconPackages,
222
+ PackageX: _tabler_icons_react.IconPackageOff,
223
+ PackageOpen: _tabler_icons_react.IconBox,
224
+ ArrowRightLeft: _tabler_icons_react.IconArrowsLeftRight,
225
+ FileText: _tabler_icons_react.IconFileText,
226
+ FileEdit: _tabler_icons_react.IconFilePencil,
227
+ FileX: _tabler_icons_react.IconFileX,
228
+ FileX2: _tabler_icons_react.IconFileOff,
229
+ Truck: _tabler_icons_react.IconTruck,
230
+ Wrench: _tabler_icons_react.IconTool,
231
+ Hammer: _tabler_icons_react.IconHammer,
232
+ Settings: _tabler_icons_react.IconSettings,
233
+ Bell: _tabler_icons_react.IconBell,
234
+ Building2: _tabler_icons_react.IconBuilding,
235
+ MapPin: _tabler_icons_react.IconMapPin,
236
+ Users: _tabler_icons_react.IconUsers,
237
+ UserPlus: _tabler_icons_react.IconUserPlus,
238
+ Boxes: _tabler_icons_react.IconBoxMultiple,
239
+ Tag: _tabler_icons_react.IconTag,
240
+ ShieldCheck: _tabler_icons_react.IconShieldCheck,
241
+ Key: _tabler_icons_react.IconKey,
242
+ KeyOff: _tabler_icons_react.IconKeyOff,
243
+ ClipboardList: _tabler_icons_react.IconClipboardList,
244
+ List: _tabler_icons_react.IconList,
245
+ Check: _tabler_icons_react.IconCheck,
246
+ X: _tabler_icons_react.IconX
247
+ };
248
+ function registerIcons(map) {
249
+ Object.assign(REGISTRY, map);
250
+ }
251
+ function hasIcon(name) {
252
+ return Object.hasOwn(REGISTRY, name);
253
+ }
254
+ function Icon({ name, className }) {
255
+ const Cmp = (name ? REGISTRY[name] : void 0) ?? _tabler_icons_react.IconCircle;
256
+ return (0, react_jsx_runtime.jsx)(Cmp, {
257
+ className: require_use_theme.cn("h-4 w-4", className),
258
+ "aria-hidden": "true"
259
+ });
260
+ }
261
+ //#endregion
262
+ //#region src/flows/load-runtime.tsx
263
+ function retrying(importer) {
264
+ let loading;
265
+ return () => {
266
+ loading ??= importer().catch((error) => {
267
+ loading = void 0;
268
+ throw error;
269
+ });
270
+ return loading;
271
+ };
272
+ }
273
+ const loadFlowRuntime = retrying(() => Promise.resolve().then(() => require("./flow-runtime-D3avVH0I.cjs")));
274
+ const loadFlowScreen = retrying(() => Promise.resolve().then(() => require("./flow-screen-Ci_Sik4Y.cjs")));
275
+ const loadPageFlowRoute = retrying(() => Promise.resolve().then(() => require("./page-flow-route-hdnULWqd.cjs")));
276
+ const loadInlineFlowHost = retrying(() => Promise.resolve().then(() => require("./inline-flow-host-DV1et3c6.cjs")));
277
+ const loadBulkSummary = retrying(() => Promise.resolve().then(() => require("./bulk-summary-CwSd6Yjb.cjs")));
278
+ function preloadFlowRuntime() {
279
+ loadFlowRuntime().catch(() => void 0);
280
+ }
281
+ function useLoaded(loader) {
282
+ const [attempt, setAttempt] = (0, react.useState)(0);
283
+ const [state, setState] = (0, react.useState)({});
284
+ (0, react.useEffect)(() => {
285
+ let live = true;
286
+ loader().then((module) => {
287
+ if (live) setState({ module });
288
+ }, (error) => {
289
+ if (live) setState({ error });
290
+ });
291
+ return () => {
292
+ live = false;
293
+ };
294
+ }, [loader, attempt]);
295
+ const retry = (0, react.useCallback)(() => {
296
+ setState({});
297
+ setAttempt((value) => value + 1);
298
+ }, []);
299
+ return {
300
+ ...state,
301
+ retry
302
+ };
303
+ }
304
+ var FlowBoundary = class extends react.Component {
305
+ state = { error: void 0 };
306
+ static getDerivedStateFromError(error) {
307
+ return { error: error ?? new Error("unknown") };
308
+ }
309
+ componentDidCatch(error, info) {
310
+ if (process.env.NODE_ENV !== "production") console.error("[burojs] A flow failed to render.", error, info.componentStack);
311
+ }
312
+ render() {
313
+ if (this.state.error !== void 0) return this.props.fallback(this.state.error, () => this.setState({ error: void 0 }));
314
+ return this.props.children;
315
+ }
316
+ };
317
+ function loadFailedText(t) {
318
+ const value = t("block.failed");
319
+ return value === "block.failed" ? "This section could not be loaded." : value;
320
+ }
321
+ function FailedRun({ onDone }) {
322
+ const t = (0, _burojs_react.useOptionalT)();
323
+ (0, react.useEffect)(() => {
324
+ (0, sonner.toast)(loadFailedText(t));
325
+ onDone();
326
+ }, [t, onDone]);
327
+ return null;
328
+ }
329
+ function RuntimeFlowRunner(props) {
330
+ const loaded = useLoaded(loadFlowRuntime);
331
+ if (loaded.error !== void 0) return (0, react_jsx_runtime.jsx)(FailedRun, { onDone: props.onClose });
332
+ if (loaded.module === void 0) return null;
333
+ const Runner = loaded.module.FlowRunner;
334
+ return (0, react_jsx_runtime.jsx)(FlowBoundary, {
335
+ fallback: () => (0, react_jsx_runtime.jsx)(FailedRun, { onDone: props.onClose }),
336
+ children: (0, react_jsx_runtime.jsx)(Runner, { ...props })
337
+ });
338
+ }
339
+ function RuntimeAppFlowRunner(props) {
340
+ const loaded = useLoaded(loadFlowRuntime);
341
+ if (loaded.error !== void 0) return (0, react_jsx_runtime.jsx)(FailedRun, { onDone: props.onClose });
342
+ if (loaded.module === void 0) return null;
343
+ const Runner = loaded.module.AppFlowRunner;
344
+ return (0, react_jsx_runtime.jsx)(FlowBoundary, {
345
+ fallback: () => (0, react_jsx_runtime.jsx)(FailedRun, { onDone: props.onClose }),
346
+ children: (0, react_jsx_runtime.jsx)(Runner, { ...props })
347
+ });
348
+ }
349
+ function RuntimeBulkFlowRunner(props) {
350
+ const loaded = useLoaded(loadFlowRuntime);
351
+ const done = (0, react.useCallback)(() => props.onFinish(Object.freeze({ outcome: "failed" }), void 0), [props.onFinish]);
352
+ if (loaded.error !== void 0) return (0, react_jsx_runtime.jsx)(FailedRun, { onDone: done });
353
+ if (loaded.module === void 0) return null;
354
+ const Runner = loaded.module.BulkFlowRunner;
355
+ return (0, react_jsx_runtime.jsx)(FlowBoundary, {
356
+ fallback: () => (0, react_jsx_runtime.jsx)(FailedRun, { onDone: done }),
357
+ children: (0, react_jsx_runtime.jsx)(Runner, { ...props })
358
+ });
359
+ }
360
+ function FlowLoadFailed({ onRetry }) {
361
+ const t = (0, _burojs_react.useOptionalT)();
362
+ const instance = (0, _burojs_react.useUIInstance)();
363
+ const retryText = t("actions.retry") === "actions.retry" ? "Retry" : t("actions.retry");
364
+ const closeText = t("flow.close") === "flow.close" ? "Close" : t("flow.close");
365
+ return (0, react_jsx_runtime.jsxs)("div", {
366
+ role: "alert",
367
+ "data-buro-flow-load": "failed",
368
+ className: "flex flex-col gap-3 text-sm",
369
+ children: [(0, react_jsx_runtime.jsx)("p", { children: loadFailedText(t) }), (0, react_jsx_runtime.jsxs)("div", {
370
+ className: "flex justify-end gap-2",
371
+ children: [(0, react_jsx_runtime.jsx)(require_button.Button, {
372
+ type: "button",
373
+ variant: "ghost",
374
+ onClick: () => instance.dismiss(),
375
+ children: closeText
376
+ }), (0, react_jsx_runtime.jsx)(require_button.Button, {
377
+ type: "button",
378
+ onClick: onRetry,
379
+ children: retryText
380
+ })]
381
+ })]
382
+ });
383
+ }
384
+ //#endregion
385
+ //#region src/actions/action-inner.tsx
386
+ function ActionInner({ icon, label }) {
387
+ return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [icon ? (0, react_jsx_runtime.jsx)(Icon, { name: icon }) : null, label] });
388
+ }
389
+ //#endregion
390
+ //#region src/actions/action-control.tsx
391
+ const warned = new Set();
392
+ function resolveControlChrome(args) {
393
+ const { density, icon, label, actionName, surface } = args;
394
+ if (density === "compact" && icon == null) {
395
+ const key = `${actionName}@${surface}`;
396
+ if (!warned.has(key)) {
397
+ warned.add(key);
398
+ console.warn(`[buro] action "${actionName}" is declared 'compact' on surface "${surface}" but has no icon; rendering it with its label instead. Give the action an \`icon\`, or declare 'regular'.`);
399
+ }
400
+ return {
401
+ compact: false,
402
+ size: "sm",
403
+ className: void 0,
404
+ ariaLabel: void 0,
405
+ content: (0, react_jsx_runtime.jsx)(ActionInner, {
406
+ icon,
407
+ label
408
+ })
409
+ };
410
+ }
411
+ if (density === "compact") return {
412
+ compact: true,
413
+ size: "icon",
414
+ className: surface === "row" ? "size-7" : "h-8 w-8",
415
+ ariaLabel: typeof label === "string" ? label : (0, _burojs_core.humanizeKey)(actionName),
416
+ content: (0, react_jsx_runtime.jsx)(Icon, { name: icon })
417
+ };
418
+ return {
419
+ compact: false,
420
+ size: "sm",
421
+ className: void 0,
422
+ ariaLabel: void 0,
423
+ content: (0, react_jsx_runtime.jsx)(ActionInner, {
424
+ icon,
425
+ label
426
+ })
427
+ };
428
+ }
429
+ function withActionTooltip(control, label, compact, reason) {
430
+ if (!compact && reason === void 0) return control;
431
+ const tooltip = (0, react_jsx_runtime.jsxs)(Tooltip, { children: [(0, react_jsx_runtime.jsx)(TooltipTrigger, {
432
+ asChild: true,
433
+ children: control
434
+ }), (0, react_jsx_runtime.jsxs)(TooltipContent, { children: [label, reason === void 0 ? null : (0, react_jsx_runtime.jsx)("span", {
435
+ className: "block opacity-80",
436
+ children: reason
437
+ })] })] });
438
+ return compact ? tooltip : (0, react_jsx_runtime.jsx)(TooltipProvider, { children: tooltip });
439
+ }
440
+ //#endregion
441
+ //#region src/flows/chrome.ts
442
+ const text = (t, key, fallback, params) => {
443
+ const value = t(key, params === void 0 ? void 0 : { params });
444
+ return value === key ? fallback : value;
445
+ };
446
+ function findDeclared(def, name) {
447
+ const actions = def?.actions ?? {};
448
+ for (const place of [
449
+ "item",
450
+ "resource",
451
+ "bulk"
452
+ ]) {
453
+ const list = actions[place];
454
+ if (!Array.isArray(list)) continue;
455
+ const found = list.find((entry) => entry.name === name);
456
+ if (found !== void 0) return found;
457
+ }
458
+ }
459
+ function useFlowChrome(resource, actionName, children) {
460
+ const app = (0, _burojs_react.useApp)();
461
+ const declared = (resource === "" ? void 0 : findDeclared(app.registry.get(resource), actionName)) ?? {};
462
+ const label = useResolvedLabel(declared, actionName, children, resource);
463
+ return {
464
+ label,
465
+ labelText: typeof label === "string" ? label : (0, _burojs_core.humanizeKey)(actionName),
466
+ icon: resolveActionIcon(declared, actionName),
467
+ destructive: declared.variant === "destructive"
468
+ };
469
+ }
470
+ //#endregion
471
+ //#region src/flows/flow-action-button.tsx
472
+ const DESTRUCTIVE_ITEM$1 = "text-destructive focus:bg-destructive/10 focus:text-destructive data-[highlighted]:text-destructive";
473
+ function FlowControl(props) {
474
+ const { state, chrome, testid, resource, actionName, scope, asMenuItem, density } = props;
475
+ const Anchor = require_toaster.useLinkComponent();
476
+ if (state === "absent") return null;
477
+ const buttonVariant = props.variant ?? (chrome.destructive ? "destructive" : "outline");
478
+ if (state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
479
+ reason: props.reason,
480
+ label: chrome.label,
481
+ icon: chrome.icon,
482
+ testid,
483
+ size: props.size,
484
+ variant: buttonVariant,
485
+ className: props.className,
486
+ asMenuItem,
487
+ resource,
488
+ density,
489
+ actionName,
490
+ surface: scope
491
+ });
492
+ const running = state === "running" || props.active === true;
493
+ const busy = state === "undecided" || state === "pending" || running;
494
+ if (props.href !== void 0 && !busy) {
495
+ if (asMenuItem === true) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
496
+ asChild: true,
497
+ className: require_use_theme.cn(chrome.destructive && DESTRUCTIVE_ITEM$1),
498
+ children: (0, react_jsx_runtime.jsx)(Anchor, {
499
+ href: props.href,
500
+ "data-testid": testid,
501
+ "data-buro-flow-state": state,
502
+ onClick: (event) => event.stopPropagation(),
503
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
504
+ icon: chrome.icon,
505
+ label: chrome.label
506
+ })
507
+ })
508
+ });
509
+ const linkChrome = resolveControlChrome({
510
+ density: density ?? "regular",
511
+ icon: chrome.icon,
512
+ label: chrome.label,
513
+ actionName,
514
+ surface: scope
515
+ });
516
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
517
+ asChild: true,
518
+ variant: buttonVariant,
519
+ size: linkChrome.size,
520
+ "aria-label": linkChrome.ariaLabel,
521
+ className: require_use_theme.cn(linkChrome.className, props.className),
522
+ children: (0, react_jsx_runtime.jsx)(Anchor, {
523
+ href: props.href,
524
+ "data-testid": testid,
525
+ "data-buro-flow-state": state,
526
+ onClick: (event) => event.stopPropagation(),
527
+ children: linkChrome.content
528
+ })
529
+ }), chrome.label, linkChrome.compact);
530
+ }
531
+ if (asMenuItem === true) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
532
+ "data-testid": testid,
533
+ "data-buro-flow-state": state,
534
+ disabled: busy,
535
+ "aria-busy": busy ? "true" : void 0,
536
+ className: require_use_theme.cn(chrome.destructive && DESTRUCTIVE_ITEM$1),
537
+ onFocus: props.onIntent,
538
+ onPointerEnter: props.onIntent,
539
+ onSelect: () => {
540
+ if (!busy) props.onRun();
541
+ },
542
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
543
+ icon: chrome.icon,
544
+ label: chrome.label
545
+ })
546
+ });
547
+ const controlChrome = resolveControlChrome({
548
+ density: density ?? "regular",
549
+ icon: chrome.icon,
550
+ label: chrome.label,
551
+ actionName,
552
+ surface: scope
553
+ });
554
+ return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [withActionTooltip((0, react_jsx_runtime.jsxs)(require_button.Button, {
555
+ type: "button",
556
+ variant: buttonVariant,
557
+ size: controlChrome.size,
558
+ "aria-label": controlChrome.ariaLabel,
559
+ "data-testid": testid,
560
+ "data-buro-flow-state": state,
561
+ disabled: busy,
562
+ "aria-busy": busy ? "true" : void 0,
563
+ onPointerEnter: props.onIntent,
564
+ onFocus: props.onIntent,
565
+ onClick: () => {
566
+ if (!busy) props.onRun();
567
+ },
568
+ className: require_use_theme.cn(controlChrome.className, props.className),
569
+ children: [running ? (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconLoader2, {
570
+ className: "h-4 w-4 animate-spin",
571
+ "aria-hidden": "true"
572
+ }) : null, controlChrome.content]
573
+ }), chrome.label, controlChrome.compact), (0, react_jsx_runtime.jsx)(DocInfo, {
574
+ address: `${resource}/actions/${actionName}`,
575
+ name: chrome.labelText,
576
+ testId: `${testid}:info`
577
+ })] });
578
+ }
579
+ function FlowActionButton(props) {
580
+ const { resource, actionName, record, scope = "row", children } = props;
581
+ const control = (0, _burojs_react.useFlowRowResolver)(resource)(actionName, record);
582
+ const chrome = useFlowChrome(resource, actionName, children);
583
+ const tid = (0, _burojs_react.useTestIds)();
584
+ const testid = makeTestId(scope, resource, actionName, record?.id ?? "", tid);
585
+ const [running, setRunning] = (0, react.useState)(false);
586
+ const runRecord = control.record ?? record;
587
+ const hosted = useHostedFlow(resource, actionName, runRecord, chrome.labelText);
588
+ const onRun = () => {
589
+ if (running) return;
590
+ if (hosted.pageHref !== void 0) return;
591
+ const closed = hosted.present();
592
+ if (closed !== null) {
593
+ setRunning(true);
594
+ closed.finally(() => setRunning(false));
595
+ return;
596
+ }
597
+ if (!hosted.hasHost) setRunning(true);
598
+ };
599
+ return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(FlowControl, {
600
+ ...props,
601
+ state: (0, _burojs_react.conjoinHostPage)(control.state, hosted.hostPage),
602
+ ...control.reason === void 0 ? {} : { reason: control.reason },
603
+ testid,
604
+ scope,
605
+ chrome,
606
+ active: running,
607
+ ...hosted.pageHref === void 0 ? {} : { href: hosted.pageHref },
608
+ onRun,
609
+ onIntent: preloadFlowRuntime
610
+ }), running && !hosted.hasHost && hosted.pageHref === void 0 ? (0, react_jsx_runtime.jsx)(RuntimeFlowRunner, {
611
+ resource,
612
+ actionName,
613
+ ...runRecord === void 0 ? {} : { record: runRecord },
614
+ scope,
615
+ onClose: () => setRunning(false)
616
+ }) : null] });
617
+ }
618
+ function useHostedFlow(resource, actionName, record, label) {
619
+ const app = (0, _burojs_react.useApp)();
620
+ const def = app.registry.get(resource);
621
+ const compiled = (0, react.useMemo)(() => {
622
+ try {
623
+ return def === void 0 ? null : (0, _burojs_core.compileFlow)(def, actionName);
624
+ } catch {
625
+ return null;
626
+ }
627
+ }, [def, actionName]);
628
+ const title = (0, _burojs_react.useProjectedTitle)(resource, record?.id, record);
629
+ const presentFlow = (0, _burojs_react.usePresentFlow)();
630
+ const hasHost = compiled?.hasHost === true;
631
+ const recordId = record?.[compiled?.idField ?? "id"] ?? record?.id;
632
+ const hostPage = (0, _burojs_react.useHostPage)(compiled?.flow.host);
633
+ const pageHref = hostPage !== void 0 ? hostPage.access === "allowed" ? hostPage.href : void 0 : compiled?.flow.host === "page" && (typeof recordId === "string" || typeof recordId === "number") && String(recordId) !== "" ? (0, _burojs_core.hrefFor)(app.registry, resource, {
634
+ action: "flow",
635
+ id: String(recordId),
636
+ flow: actionName
637
+ }) : void 0;
638
+ return {
639
+ hasHost,
640
+ pageHref,
641
+ hostPage,
642
+ present: () => !hasHost || compiled === null || pageHref !== void 0 ? null : presentFlow({
643
+ target: {
644
+ resource,
645
+ action: actionName
646
+ },
647
+ host: compiled.flow.host === "sheet" ? "sheet" : "dialog",
648
+ label,
649
+ ...record === void 0 ? {} : { record },
650
+ ...record === void 0 || title === "" ? {} : { title }
651
+ })
652
+ };
653
+ }
654
+ function FlowMenuItem(props) {
655
+ const chrome = useFlowChrome(props.resource, props.actionName);
656
+ const tid = (0, _burojs_react.useTestIds)();
657
+ const testid = makeTestId(props.scope, props.resource, props.actionName, props.record?.id ?? "", tid);
658
+ const runRecord = props.control.record ?? props.record;
659
+ const hosted = useHostedFlow(props.resource, props.actionName, runRecord, chrome.labelText);
660
+ return (0, react_jsx_runtime.jsx)(FlowControl, {
661
+ state: (0, _burojs_react.conjoinHostPage)(props.control.state, hosted.hostPage),
662
+ ...props.control.reason === void 0 ? {} : { reason: props.control.reason },
663
+ resource: props.resource,
664
+ actionName: props.actionName,
665
+ testid,
666
+ scope: props.scope,
667
+ chrome,
668
+ asMenuItem: true,
669
+ ...props.active === true ? { active: true } : {},
670
+ ...hosted.pageHref === void 0 ? {} : { href: hosted.pageHref },
671
+ onRun: () => {
672
+ if (hosted.pageHref !== void 0) return;
673
+ if (hosted.present() === null && !hosted.hasHost) props.onRun();
674
+ },
675
+ onIntent: preloadFlowRuntime
676
+ });
677
+ }
678
+ //#endregion
679
+ //#region src/lib/external-href.ts
680
+ const EXTERNAL_HREF = /^(?:https?:|mailto:)/i;
681
+ function isExternalHref(href) {
682
+ return EXTERNAL_HREF.test(href);
683
+ }
684
+ function openExternal(href) {
685
+ window.open(href, "_blank", "noopener noreferrer");
686
+ }
687
+ function toBrowserHref(appPath, currentPath) {
688
+ if (typeof window === "undefined" || isExternalHref(appPath) || !appPath.startsWith("/")) return appPath;
689
+ const here = window.location.pathname;
690
+ if (currentPath === "") return appPath;
691
+ const basename = currentPath === "/" ? here.replace(/\/$/u, "") : here.endsWith(currentPath) ? here.slice(0, here.length - currentPath.length).replace(/\/$/u, "") : void 0;
692
+ if (basename === void 0) return appPath;
693
+ if (basename === "") return appPath;
694
+ return `${basename}${appPath}`;
695
+ }
696
+ function useToBrowserHref() {
697
+ const pathname = (0, _burojs_react.useOptionalRouterAdapter)()?.pathname;
698
+ return (0, react.useCallback)((appPath) => pathname === void 0 ? appPath : toBrowserHref(appPath, pathname), [pathname]);
699
+ }
700
+ //#endregion
701
+ //#region src/list-kit/list-slots.ts
702
+ function canonicalResourceName(resource) {
703
+ return (0, _burojs_core.canonicalEntityNodeKey)({
704
+ name: resource,
705
+ ref: (0, _burojs_core.normalizeEntityRef)(resource)
706
+ });
707
+ }
708
+ function listSlot(region, resource) {
709
+ return `list.${region}.${canonicalResourceName(resource)}`;
710
+ }
711
+ function useListSlot(region, resource) {
712
+ return (0, _burojs_react.useComponent)(listSlot(region, resource));
713
+ }
714
+ //#endregion
715
+ //#region src/actions/builtin-edit-route.ts
716
+ const LINK = Object.freeze({ kind: "link" });
717
+ const NONE = Object.freeze({ kind: "none" });
718
+ function sameResource(a, b) {
719
+ try {
720
+ return canonicalResourceName(a) === canonicalResourceName(b);
721
+ } catch {
722
+ return false;
723
+ }
724
+ }
725
+ function useBuiltinEditRoute(action, resource, recordId) {
726
+ const app = (0, _burojs_react.useApp)();
727
+ const entry = (0, _burojs_react.useQuickEntry)();
728
+ const quick = (0, _burojs_react.useQuick)();
729
+ const gate = (0, _burojs_react.useEntryGate)();
730
+ if (!(0, _burojs_core.isBuiltinItemAction)(action, "edit")) return LINK;
731
+ const def = app.registry.get(resource);
732
+ if (def === void 0) return LINK;
733
+ const entries = (0, _burojs_core.recordEntries)(def);
734
+ const id = recordId === null || recordId === void 0 ? "" : String(recordId);
735
+ const top = entry?.stack.top;
736
+ if (entry !== null && top !== void 0 && top.mode === "show" && top.recordId === id && sameResource(top.resource, resource) && entries.quick.edit !== null) {
737
+ if (entries.quick.edit === entry.host) return {
738
+ kind: "quick",
739
+ open: () => {
740
+ if (gate(resource, "edit").state !== "open") return;
741
+ entry.scope.request(() => entry.stack.replaceTop({
742
+ ...top,
743
+ mode: "edit"
744
+ }));
745
+ }
746
+ };
747
+ return {
748
+ kind: "quick",
749
+ open: () => void quick.edit(resource, id)
750
+ };
751
+ }
752
+ if (entries.page.edit) return LINK;
753
+ if (entries.quick.edit === null) return NONE;
754
+ return {
755
+ kind: "quick",
756
+ open: () => void quick.edit(resource, id)
757
+ };
758
+ }
759
+ //#endregion
760
+ //#region src/actions/action-button.tsx
761
+ function DisabledAction({ reason, label, icon, testid, size, variant, className, asMenuItem, resource, density = "regular", actionName, surface }) {
762
+ const i18nCaps = (0, _burojs_react.useI18nCaps)(resource);
763
+ const text = reason ? (0, _burojs_core.resolveContentSlot)(i18nCaps, [reason], {
764
+ resource,
765
+ default: reason
766
+ }) : (0, _burojs_core.resolveContentSlot)(i18nCaps, ["availability.denied"], {
767
+ resource,
768
+ default: "This action isn't available"
769
+ });
770
+ const onClick = (e) => {
771
+ e.preventDefault();
772
+ e.stopPropagation();
773
+ (0, sonner.toast)(text);
774
+ };
775
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
776
+ "aria-disabled": "true",
777
+ "data-testid": testid,
778
+ onSelect: (e) => e.preventDefault(),
779
+ onClick,
780
+ className: "opacity-60",
781
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
782
+ icon,
783
+ label
784
+ })
785
+ });
786
+ const chrome = resolveControlChrome({
787
+ density,
788
+ icon,
789
+ label,
790
+ actionName: actionName ?? testid ?? "",
791
+ surface: surface ?? "unknown"
792
+ });
793
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
794
+ type: "button",
795
+ size: size ?? chrome.size,
796
+ variant: variant ?? "outline",
797
+ className: require_use_theme.cn(chrome.className, className),
798
+ "data-testid": testid,
799
+ "aria-disabled": "true",
800
+ "aria-label": chrome.ariaLabel,
801
+ onClick,
802
+ children: chrome.content
803
+ }), label, chrome.compact, text);
804
+ }
805
+ const DESTRUCTIVE_ITEM = "text-destructive focus:bg-destructive/10 focus:text-destructive data-[highlighted]:text-destructive";
806
+ const DEFAULT_ACTION_ICONS = {
807
+ create: "Plus",
808
+ edit: "Pencil",
809
+ delete: "Trash2",
810
+ show: "Eye",
811
+ auditLog: "ScrollText",
812
+ refresh: "RefreshCw",
813
+ copy: "Copy",
814
+ cancel: "X"
815
+ };
816
+ function resolveActionIcon(action, actionName) {
817
+ return action.icon ?? DEFAULT_ACTION_ICONS[camelizeActionName(actionName)];
818
+ }
819
+ function camelizeActionName(actionName) {
820
+ return actionName.replace(/[-_]+([a-zA-Z0-9])/g, (_m, c) => c.toUpperCase());
821
+ }
822
+ function useResolvedLabel(action, actionName, children, resource) {
823
+ const caps = (0, _burojs_react.useI18nCaps)(resource);
824
+ if (children != null) return children;
825
+ const raw = `actions.${actionName}`;
826
+ const own = `resources.${resource}.${raw}`;
827
+ const ownLabel = (0, _burojs_core.resolveContentSlot)(caps, [[`${own}.label`, own]]);
828
+ if (ownLabel !== void 0) return ownLabel;
829
+ const declared = (0, _burojs_core.declaredText)(action.kind === "flow" ? "flow" : "action", action, "label");
830
+ if (declared !== void 0) return declared;
831
+ const sharedLabel = (0, _burojs_core.resolveContentSlot)(caps, [[`${raw}.label`, raw]]);
832
+ if (sharedLabel !== void 0) return sharedLabel;
833
+ const camel = `actions.${camelizeActionName(actionName)}`;
834
+ if (caps.has(camel)) return caps.t(camel);
835
+ return (0, _burojs_core.humanizeKey)(actionName);
836
+ }
837
+ function findAction(actions, name) {
838
+ if (!Array.isArray(actions)) return void 0;
839
+ return actions.find((a) => "name" in a && a.name === name);
840
+ }
841
+ function actionResourceHandle(resource) {
842
+ return {
843
+ kind: "resource",
844
+ ref: (0, _burojs_core.normalizeEntityRef)(resource)
845
+ };
846
+ }
847
+ function ActionButton(props) {
848
+ const def = (0, _burojs_react.useApp)().registry.get(props.resource);
849
+ const scope = props.scope ?? "row";
850
+ const availability = (0, _burojs_react.useAvailabilityResolver)(props.resource, (0, _burojs_react.modeForSurface)(scope))(props.actionName, props.record);
851
+ const action = findAction(def?.actions?.item, props.actionName) ?? findAction(def?.actions?.resource, props.actionName);
852
+ if (!action) return null;
853
+ if ((0, _burojs_core_internal.isFlowAction)(action)) return (0, react_jsx_runtime.jsx)(FlowActionButton, { ...props });
854
+ if (availability.state === "absent" || availability.state === "hidden") return null;
855
+ if (!actionWhenHolds(action, props.record)) return null;
856
+ if (action.kind === "link") return (0, react_jsx_runtime.jsx)(LinkActionButton, {
857
+ ...props,
858
+ action,
859
+ availability
860
+ });
861
+ if (action.kind === "modal") return (0, react_jsx_runtime.jsx)(ModalActionButton, {
862
+ ...props,
863
+ action,
864
+ availability
865
+ });
866
+ return null;
867
+ }
868
+ function actionWhenHolds(action, record) {
869
+ const when = action.when;
870
+ if (when === void 0) return true;
871
+ return (0, _burojs_core_internal.evaluateCondition)(when, record === void 0 ? {} : { record: {
872
+ status: "ready",
873
+ value: record,
874
+ refreshing: false
875
+ } }, { mode: "show" }) === true;
876
+ }
877
+ function presentModalAction(args) {
878
+ const { present, action, resource, actionName, record, recordId, label } = args;
879
+ const result = present({
880
+ block: action.block,
881
+ props: action.props ?? {},
882
+ resource,
883
+ record,
884
+ host: action.host === "sheet" ? "sheet" : "dialog",
885
+ ...typeof label === "string" ? { label } : {},
886
+ activation: { surface: {
887
+ type: "item",
888
+ resource: (0, _burojs_core.normalizeEntityRef)(resource),
889
+ recordId,
890
+ record
891
+ } }
892
+ });
893
+ if (!result.ok) console.error(`[buro/ui-shadcn] modal action "${actionName}" failed to open block "${action.block.namespace}:${action.block.id}": ${result.code}`);
894
+ }
895
+ function makeTestId(scope, resource, actionName, recordId, tid) {
896
+ if (scope === "row") return tid.listRowAction(resource, recordId, actionName);
897
+ if (scope === "list" && recordId === "") return tid.listFlow(resource, actionName);
898
+ return tid.formAction(resource, scope, actionName);
899
+ }
900
+ const reportedDeadRoutes = new Set();
901
+ function deadRecordRoute(registry, action, to) {
902
+ if ((0, _burojs_core.isBuiltinItemAction)(action) || to === null || typeof to !== "object") return null;
903
+ const target = to;
904
+ if (typeof target.resource !== "string") return null;
905
+ if (target.action !== "show" && target.action !== "edit" && target.action !== "create") return null;
906
+ let def;
907
+ try {
908
+ def = registry.get(target.resource);
909
+ } catch {
910
+ return null;
911
+ }
912
+ if (def === void 0 || (0, _burojs_core.hasRecordPage)(def, target.action)) return null;
913
+ return {
914
+ resource: target.resource,
915
+ action: target.action
916
+ };
917
+ }
918
+ function reportDeadRecordRoute(name, resource, action) {
919
+ if (process.env.NODE_ENV === "production") return;
920
+ const key = `${name}\u0000${resource}\u0000${action}`;
921
+ if (reportedDeadRoutes.has(key)) return;
922
+ reportedDeadRoutes.add(key);
923
+ console.error(`[burojs] The action "${name}" links to ${resource}'s ${action} page, and ${resource} has none (views.show.page: false).`);
924
+ }
925
+ function LinkActionButton({ resource, actionName, record, scope = "row", variant, size, density, className, children, asMenuItem, action, availability }) {
926
+ const tid = (0, _burojs_react.useTestIds)();
927
+ const app = (0, _burojs_react.useApp)();
928
+ const toBrowser = useToBrowserHref();
929
+ const safeRecord = record ?? { id: "" };
930
+ const isDestructive = action.variant === "destructive";
931
+ const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
932
+ const recordId = record?.id ?? "";
933
+ const testid = makeTestId(scope, resource, actionName, recordId, tid);
934
+ const label = useResolvedLabel(action, actionName, children, resource);
935
+ const editRoute = useBuiltinEditRoute(action, resource, recordId);
936
+ const to = typeof action.to === "function" ? action.to((0, _burojs_react.buildDI)(actionResourceHandle(resource), safeRecord)) : action.to;
937
+ const href = (0, _burojs_react.resolveRoute)(to, app.registry);
938
+ const target = action.target ?? "_self";
939
+ const deadPage = deadRecordRoute(app.registry, action, to);
940
+ const deadResource = deadPage?.resource;
941
+ const deadAction = deadPage?.action;
942
+ (0, react.useEffect)(() => {
943
+ if (deadResource !== void 0 && deadAction !== void 0) reportDeadRecordRoute(actionName, deadResource, deadAction);
944
+ }, [
945
+ deadResource,
946
+ deadAction,
947
+ actionName
948
+ ]);
949
+ const rel = target === "_blank" ? "noopener noreferrer" : void 0;
950
+ const RouterLink = require_toaster.useLinkComponent();
951
+ const Anchor = target === "_blank" || isExternalHref(href) ? "a" : RouterLink;
952
+ const anchorHref = target === "_blank" ? toBrowser(href) : href;
953
+ if (editRoute.kind === "none") return null;
954
+ if (availability.state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
955
+ reason: availability.reason,
956
+ label,
957
+ icon: resolveActionIcon(action, actionName),
958
+ testid,
959
+ size,
960
+ variant: buttonVariant,
961
+ className,
962
+ asMenuItem,
963
+ resource,
964
+ density,
965
+ actionName,
966
+ surface: scope
967
+ });
968
+ if (editRoute.kind === "quick") {
969
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
970
+ "data-testid": testid,
971
+ onSelect: () => editRoute.open(),
972
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
973
+ icon: resolveActionIcon(action, actionName),
974
+ label
975
+ })
976
+ });
977
+ const quickChrome = resolveControlChrome({
978
+ density: density ?? "regular",
979
+ icon: resolveActionIcon(action, actionName),
980
+ label,
981
+ actionName,
982
+ surface: scope
983
+ });
984
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
985
+ type: "button",
986
+ variant: buttonVariant,
987
+ size: quickChrome.size,
988
+ "aria-label": quickChrome.ariaLabel,
989
+ className: require_use_theme.cn(quickChrome.className, className),
990
+ "data-testid": testid,
991
+ onClick: (e) => {
992
+ e.stopPropagation();
993
+ editRoute.open();
994
+ },
995
+ children: quickChrome.content
996
+ }), label, quickChrome.compact);
997
+ }
998
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
999
+ asChild: true,
1000
+ className: require_use_theme.cn(isDestructive && DESTRUCTIVE_ITEM),
1001
+ children: (0, react_jsx_runtime.jsx)(Anchor, {
1002
+ href: anchorHref,
1003
+ target,
1004
+ rel,
1005
+ "data-testid": testid,
1006
+ onClick: (e) => e.stopPropagation(),
1007
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
1008
+ icon: resolveActionIcon(action, actionName),
1009
+ label
1010
+ })
1011
+ })
1012
+ });
1013
+ const chrome = resolveControlChrome({
1014
+ density: density ?? "regular",
1015
+ icon: resolveActionIcon(action, actionName),
1016
+ label,
1017
+ actionName,
1018
+ surface: scope
1019
+ });
1020
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
1021
+ asChild: true,
1022
+ variant: buttonVariant,
1023
+ size: chrome.size,
1024
+ "aria-label": chrome.ariaLabel,
1025
+ className: require_use_theme.cn(chrome.className, className),
1026
+ children: (0, react_jsx_runtime.jsx)(Anchor, {
1027
+ href: anchorHref,
1028
+ target,
1029
+ rel,
1030
+ "data-testid": testid,
1031
+ onClick: (e) => e.stopPropagation(),
1032
+ children: chrome.content
1033
+ })
1034
+ }), label, chrome.compact);
1035
+ }
1036
+ function ModalActionButton({ resource, actionName, record, scope = "row", variant, size, density, className, children, asMenuItem, action, availability }) {
1037
+ const tid = (0, _burojs_react.useTestIds)();
1038
+ const present = (0, _burojs_react.usePresentBlock)();
1039
+ const safeRecord = record ?? { id: "" };
1040
+ const isDestructive = action.variant === "destructive";
1041
+ const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
1042
+ const recordId = record?.id ?? "";
1043
+ const testid = makeTestId(scope, resource, actionName, recordId, tid);
1044
+ const label = useResolvedLabel(action, actionName, children, resource);
1045
+ if (availability.state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
1046
+ reason: availability.reason,
1047
+ label,
1048
+ icon: resolveActionIcon(action, actionName),
1049
+ testid,
1050
+ size,
1051
+ variant: buttonVariant,
1052
+ className,
1053
+ asMenuItem,
1054
+ resource,
1055
+ density,
1056
+ actionName,
1057
+ surface: scope
1058
+ });
1059
+ function openModal() {
1060
+ presentModalAction({
1061
+ present,
1062
+ action,
1063
+ resource,
1064
+ actionName,
1065
+ record: safeRecord,
1066
+ recordId,
1067
+ label
1068
+ });
1069
+ }
1070
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
1071
+ "data-testid": testid,
1072
+ className: require_use_theme.cn(isDestructive && DESTRUCTIVE_ITEM),
1073
+ onSelect: openModal,
1074
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
1075
+ icon: resolveActionIcon(action, actionName),
1076
+ label
1077
+ })
1078
+ });
1079
+ const chrome = resolveControlChrome({
1080
+ density: density ?? "regular",
1081
+ icon: resolveActionIcon(action, actionName),
1082
+ label,
1083
+ actionName,
1084
+ surface: scope
1085
+ });
1086
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
1087
+ type: "button",
1088
+ variant: buttonVariant,
1089
+ size: chrome.size,
1090
+ "aria-label": chrome.ariaLabel,
1091
+ "data-testid": testid,
1092
+ onClick: (e) => {
1093
+ e.stopPropagation();
1094
+ openModal();
1095
+ },
1096
+ className: require_use_theme.cn(chrome.className, className),
1097
+ children: chrome.content
1098
+ }), label, chrome.compact);
1099
+ }
1100
+ //#endregion
1101
+ //#region src/checks/check-confirm-dialog.tsx
1102
+ function translateOrFallback(t, key, fallback, params, resource) {
1103
+ const translated = t(key, {
1104
+ params,
1105
+ ...resource === void 0 ? {} : { resource }
1106
+ });
1107
+ return translated === key ? fallback : translated;
1108
+ }
1109
+ function issueText(issue, t, resource) {
1110
+ const params = issue.params;
1111
+ const checkId = params?.checkId;
1112
+ const ownCheck = typeof checkId === "string" && issue.message.key === `checks.${checkId}`;
1113
+ const declared = typeof issue.message.default === "string" ? issue.message.default : ownCheck ? void 0 : issue.message.key;
1114
+ if (issue.params?.resolved === true) return declared ?? issue.message.key;
1115
+ if (!ownCheck) return translateOrFallback(t, issue.message.key, declared ?? "", params, resource);
1116
+ const miss = "\0";
1117
+ const bundled = [`${issue.message.key}.message`, issue.message.key].map((key) => translateOrFallback(t, key, miss, params, resource)).find((text) => text !== miss);
1118
+ if (bundled !== void 0) return bundled;
1119
+ if (declared !== void 0) return declared;
1120
+ const name = String(params?.name ?? checkId);
1121
+ return translateOrFallback(t, _burojs_core.FRAMEWORK_TEXT_KEYS.checkFailed, (0, _burojs_core.checkFailedDefault)(name), {
1122
+ ...params,
1123
+ name
1124
+ }, void 0);
1125
+ }
1126
+ function checkIdOf(issue, index) {
1127
+ const id = issue.params?.checkId;
1128
+ return typeof id === "string" ? id : `${index}`;
1129
+ }
1130
+ const SEVERITY_CLASSNAME = {
1131
+ error: "text-destructive",
1132
+ warning: "text-warning-emphasis",
1133
+ info: "text-muted-foreground"
1134
+ };
1135
+ function ChecksList({ issues, testid, onRowClick, resource }) {
1136
+ const t = (0, _burojs_react.useOptionalT)();
1137
+ return issues.map((issue, index) => {
1138
+ const checkId = checkIdOf(issue, index);
1139
+ const anchor = issue.path[0];
1140
+ const anchorable = typeof anchor === "string";
1141
+ const text = issueText(issue, t, resource);
1142
+ const className = require_use_theme.cn("text-sm", SEVERITY_CLASSNAME[issue.severity]);
1143
+ return anchorable ? (0, react_jsx_runtime.jsx)("li", { children: (0, react_jsx_runtime.jsx)("button", {
1144
+ type: "button",
1145
+ "data-testid": `${testid}:item:${checkId}`,
1146
+ className: require_use_theme.cn(className, "text-left underline-offset-2 hover:underline"),
1147
+ onClick: () => onRowClick(anchor),
1148
+ children: text
1149
+ }) }, `${checkId}-${index}`) : (0, react_jsx_runtime.jsx)("li", {
1150
+ "data-testid": `${testid}:item:${checkId}`,
1151
+ className,
1152
+ children: text
1153
+ }, `${checkId}-${index}`);
1154
+ });
1155
+ }
1156
+ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel, tone }) {
1157
+ const t = (0, _burojs_react.useOptionalT)();
1158
+ const { resource, open, busy, header, blockers, confirmable, proceed, cancel } = state;
1159
+ const blocked = blockers.length > 0;
1160
+ const bound = resource === void 0 ? {} : { resource };
1161
+ const heading = title ?? t("checks.dialogTitle", {
1162
+ defaultValue: "Please review",
1163
+ ...bound
1164
+ });
1165
+ const restoreFocusRef = (0, react.useRef)(null);
1166
+ (0, react.useEffect)(() => {
1167
+ if (typeof document === "undefined") return;
1168
+ if (open) {
1169
+ const active = document.activeElement;
1170
+ if (active instanceof HTMLElement && active !== document.body) restoreFocusRef.current = active;
1171
+ return;
1172
+ }
1173
+ const target = restoreFocusRef.current;
1174
+ restoreFocusRef.current = null;
1175
+ if (!target || !document.contains(target)) return;
1176
+ const id = requestAnimationFrame(() => target.focus());
1177
+ return () => cancelAnimationFrame(id);
1178
+ }, [open]);
1179
+ const onRowClick = (field) => {
1180
+ onAnchorFocus?.(field);
1181
+ cancel();
1182
+ };
1183
+ return (0, react_jsx_runtime.jsx)(require_dialog.Dialog, {
1184
+ open,
1185
+ onOpenChange: (next) => {
1186
+ if (!next) cancel();
1187
+ },
1188
+ children: (0, react_jsx_runtime.jsxs)(require_dialog.DialogContent, {
1189
+ "data-testid": `${testid}:dialog`,
1190
+ className: "flex max-h-[85vh] flex-col overflow-hidden",
1191
+ children: [
1192
+ (0, react_jsx_runtime.jsxs)(require_dialog.DialogHeader, { children: [(0, react_jsx_runtime.jsx)(require_dialog.DialogTitle, { children: heading }), header !== null ? (0, react_jsx_runtime.jsx)(require_dialog.DialogDescription, { children: header }) : (0, react_jsx_runtime.jsx)(require_dialog.DialogDescription, {
1193
+ className: "sr-only",
1194
+ children: heading
1195
+ })] }),
1196
+ (0, react_jsx_runtime.jsxs)("ul", {
1197
+ className: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-contain",
1198
+ children: [
1199
+ blocked && (0, react_jsx_runtime.jsx)("li", {
1200
+ className: "text-xs font-semibold uppercase tracking-wider text-destructive",
1201
+ children: t("checks.blocked", {
1202
+ defaultValue: "Cannot continue",
1203
+ ...bound
1204
+ })
1205
+ }),
1206
+ (0, react_jsx_runtime.jsx)(ChecksList, {
1207
+ issues: blockers,
1208
+ testid,
1209
+ onRowClick,
1210
+ resource
1211
+ }),
1212
+ (0, react_jsx_runtime.jsx)(ChecksList, {
1213
+ issues: confirmable,
1214
+ testid,
1215
+ onRowClick,
1216
+ resource
1217
+ })
1218
+ ]
1219
+ }),
1220
+ (0, react_jsx_runtime.jsxs)(require_dialog.DialogFooter, { children: [(0, react_jsx_runtime.jsx)(require_button.Button, {
1221
+ type: "button",
1222
+ variant: "outline",
1223
+ onClick: cancel,
1224
+ "data-testid": `${testid}:cancel`,
1225
+ disabled: busy,
1226
+ children: t("checks.back", {
1227
+ defaultValue: "Go back",
1228
+ ...bound
1229
+ })
1230
+ }), !blocked && (0, react_jsx_runtime.jsx)(require_button.Button, {
1231
+ type: "button",
1232
+ variant: tone === "destructive" ? "destructive" : "default",
1233
+ onClick: proceed,
1234
+ "data-testid": `${testid}:proceed`,
1235
+ disabled: busy,
1236
+ children: proceedLabel ?? t("checks.proceed", {
1237
+ defaultValue: "Continue anyway",
1238
+ ...bound
1239
+ })
1240
+ })] })
1241
+ ]
1242
+ })
1243
+ });
1244
+ }
1245
+ //#endregion
1246
+ Object.defineProperty(exports, "ActionButton", {
1247
+ enumerable: true,
1248
+ get: function() {
1249
+ return ActionButton;
1250
+ }
1251
+ });
1252
+ Object.defineProperty(exports, "ActionInner", {
1253
+ enumerable: true,
1254
+ get: function() {
1255
+ return ActionInner;
1256
+ }
1257
+ });
1258
+ Object.defineProperty(exports, "CheckConfirmDialog", {
1259
+ enumerable: true,
1260
+ get: function() {
1261
+ return CheckConfirmDialog;
1262
+ }
1263
+ });
1264
+ Object.defineProperty(exports, "DisabledAction", {
1265
+ enumerable: true,
1266
+ get: function() {
1267
+ return DisabledAction;
1268
+ }
1269
+ });
1270
+ Object.defineProperty(exports, "DocInfo", {
1271
+ enumerable: true,
1272
+ get: function() {
1273
+ return DocInfo;
1274
+ }
1275
+ });
1276
+ Object.defineProperty(exports, "DropdownMenu", {
1277
+ enumerable: true,
1278
+ get: function() {
1279
+ return DropdownMenu;
1280
+ }
1281
+ });
1282
+ Object.defineProperty(exports, "DropdownMenuCheckboxItem", {
1283
+ enumerable: true,
1284
+ get: function() {
1285
+ return DropdownMenuCheckboxItem;
1286
+ }
1287
+ });
1288
+ Object.defineProperty(exports, "DropdownMenuContent", {
1289
+ enumerable: true,
1290
+ get: function() {
1291
+ return DropdownMenuContent;
1292
+ }
1293
+ });
1294
+ Object.defineProperty(exports, "DropdownMenuGroup", {
1295
+ enumerable: true,
1296
+ get: function() {
1297
+ return DropdownMenuGroup;
1298
+ }
1299
+ });
1300
+ Object.defineProperty(exports, "DropdownMenuItem", {
1301
+ enumerable: true,
1302
+ get: function() {
1303
+ return DropdownMenuItem;
1304
+ }
1305
+ });
1306
+ Object.defineProperty(exports, "DropdownMenuLabel", {
1307
+ enumerable: true,
1308
+ get: function() {
1309
+ return DropdownMenuLabel;
1310
+ }
1311
+ });
1312
+ Object.defineProperty(exports, "DropdownMenuPortal", {
1313
+ enumerable: true,
1314
+ get: function() {
1315
+ return DropdownMenuPortal;
1316
+ }
1317
+ });
1318
+ Object.defineProperty(exports, "DropdownMenuRadioGroup", {
1319
+ enumerable: true,
1320
+ get: function() {
1321
+ return DropdownMenuRadioGroup;
1322
+ }
1323
+ });
1324
+ Object.defineProperty(exports, "DropdownMenuRadioItem", {
1325
+ enumerable: true,
1326
+ get: function() {
1327
+ return DropdownMenuRadioItem;
1328
+ }
1329
+ });
1330
+ Object.defineProperty(exports, "DropdownMenuSeparator", {
1331
+ enumerable: true,
1332
+ get: function() {
1333
+ return DropdownMenuSeparator;
1334
+ }
1335
+ });
1336
+ Object.defineProperty(exports, "DropdownMenuShortcut", {
1337
+ enumerable: true,
1338
+ get: function() {
1339
+ return DropdownMenuShortcut;
1340
+ }
1341
+ });
1342
+ Object.defineProperty(exports, "DropdownMenuSub", {
1343
+ enumerable: true,
1344
+ get: function() {
1345
+ return DropdownMenuSub;
1346
+ }
1347
+ });
1348
+ Object.defineProperty(exports, "DropdownMenuSubContent", {
1349
+ enumerable: true,
1350
+ get: function() {
1351
+ return DropdownMenuSubContent;
1352
+ }
1353
+ });
1354
+ Object.defineProperty(exports, "DropdownMenuSubTrigger", {
1355
+ enumerable: true,
1356
+ get: function() {
1357
+ return DropdownMenuSubTrigger;
1358
+ }
1359
+ });
1360
+ Object.defineProperty(exports, "DropdownMenuTrigger", {
1361
+ enumerable: true,
1362
+ get: function() {
1363
+ return DropdownMenuTrigger;
1364
+ }
1365
+ });
1366
+ Object.defineProperty(exports, "FlowActionButton", {
1367
+ enumerable: true,
1368
+ get: function() {
1369
+ return FlowActionButton;
1370
+ }
1371
+ });
1372
+ Object.defineProperty(exports, "FlowBoundary", {
1373
+ enumerable: true,
1374
+ get: function() {
1375
+ return FlowBoundary;
1376
+ }
1377
+ });
1378
+ Object.defineProperty(exports, "FlowLoadFailed", {
1379
+ enumerable: true,
1380
+ get: function() {
1381
+ return FlowLoadFailed;
1382
+ }
1383
+ });
1384
+ Object.defineProperty(exports, "FlowMenuItem", {
1385
+ enumerable: true,
1386
+ get: function() {
1387
+ return FlowMenuItem;
1388
+ }
1389
+ });
1390
+ Object.defineProperty(exports, "Icon", {
1391
+ enumerable: true,
1392
+ get: function() {
1393
+ return Icon;
1394
+ }
1395
+ });
1396
+ Object.defineProperty(exports, "RuntimeAppFlowRunner", {
1397
+ enumerable: true,
1398
+ get: function() {
1399
+ return RuntimeAppFlowRunner;
1400
+ }
1401
+ });
1402
+ Object.defineProperty(exports, "RuntimeBulkFlowRunner", {
1403
+ enumerable: true,
1404
+ get: function() {
1405
+ return RuntimeBulkFlowRunner;
1406
+ }
1407
+ });
1408
+ Object.defineProperty(exports, "RuntimeFlowRunner", {
1409
+ enumerable: true,
1410
+ get: function() {
1411
+ return RuntimeFlowRunner;
1412
+ }
1413
+ });
1414
+ Object.defineProperty(exports, "Tooltip", {
1415
+ enumerable: true,
1416
+ get: function() {
1417
+ return Tooltip;
1418
+ }
1419
+ });
1420
+ Object.defineProperty(exports, "TooltipContent", {
1421
+ enumerable: true,
1422
+ get: function() {
1423
+ return TooltipContent;
1424
+ }
1425
+ });
1426
+ Object.defineProperty(exports, "TooltipProvider", {
1427
+ enumerable: true,
1428
+ get: function() {
1429
+ return TooltipProvider;
1430
+ }
1431
+ });
1432
+ Object.defineProperty(exports, "TooltipTrigger", {
1433
+ enumerable: true,
1434
+ get: function() {
1435
+ return TooltipTrigger;
1436
+ }
1437
+ });
1438
+ Object.defineProperty(exports, "canonicalResourceName", {
1439
+ enumerable: true,
1440
+ get: function() {
1441
+ return canonicalResourceName;
1442
+ }
1443
+ });
1444
+ Object.defineProperty(exports, "hasIcon", {
1445
+ enumerable: true,
1446
+ get: function() {
1447
+ return hasIcon;
1448
+ }
1449
+ });
1450
+ Object.defineProperty(exports, "isExternalHref", {
1451
+ enumerable: true,
1452
+ get: function() {
1453
+ return isExternalHref;
1454
+ }
1455
+ });
1456
+ Object.defineProperty(exports, "listSlot", {
1457
+ enumerable: true,
1458
+ get: function() {
1459
+ return listSlot;
1460
+ }
1461
+ });
1462
+ Object.defineProperty(exports, "loadBulkSummary", {
1463
+ enumerable: true,
1464
+ get: function() {
1465
+ return loadBulkSummary;
1466
+ }
1467
+ });
1468
+ Object.defineProperty(exports, "loadFailedText", {
1469
+ enumerable: true,
1470
+ get: function() {
1471
+ return loadFailedText;
1472
+ }
1473
+ });
1474
+ Object.defineProperty(exports, "loadFlowScreen", {
1475
+ enumerable: true,
1476
+ get: function() {
1477
+ return loadFlowScreen;
1478
+ }
1479
+ });
1480
+ Object.defineProperty(exports, "loadInlineFlowHost", {
1481
+ enumerable: true,
1482
+ get: function() {
1483
+ return loadInlineFlowHost;
1484
+ }
1485
+ });
1486
+ Object.defineProperty(exports, "loadPageFlowRoute", {
1487
+ enumerable: true,
1488
+ get: function() {
1489
+ return loadPageFlowRoute;
1490
+ }
1491
+ });
1492
+ Object.defineProperty(exports, "makeTestId", {
1493
+ enumerable: true,
1494
+ get: function() {
1495
+ return makeTestId;
1496
+ }
1497
+ });
1498
+ Object.defineProperty(exports, "openExternal", {
1499
+ enumerable: true,
1500
+ get: function() {
1501
+ return openExternal;
1502
+ }
1503
+ });
1504
+ Object.defineProperty(exports, "preloadFlowRuntime", {
1505
+ enumerable: true,
1506
+ get: function() {
1507
+ return preloadFlowRuntime;
1508
+ }
1509
+ });
1510
+ Object.defineProperty(exports, "registerIcons", {
1511
+ enumerable: true,
1512
+ get: function() {
1513
+ return registerIcons;
1514
+ }
1515
+ });
1516
+ Object.defineProperty(exports, "text", {
1517
+ enumerable: true,
1518
+ get: function() {
1519
+ return text;
1520
+ }
1521
+ });
1522
+ Object.defineProperty(exports, "useFlowChrome", {
1523
+ enumerable: true,
1524
+ get: function() {
1525
+ return useFlowChrome;
1526
+ }
1527
+ });
1528
+ Object.defineProperty(exports, "useListSlot", {
1529
+ enumerable: true,
1530
+ get: function() {
1531
+ return useListSlot;
1532
+ }
1533
+ });
1534
+ Object.defineProperty(exports, "useLoaded", {
1535
+ enumerable: true,
1536
+ get: function() {
1537
+ return useLoaded;
1538
+ }
1539
+ });
1540
+ Object.defineProperty(exports, "useToBrowserHref", {
1541
+ enumerable: true,
1542
+ get: function() {
1543
+ return useToBrowserHref;
1544
+ }
1545
+ });
1546
+
1547
+ //# sourceMappingURL=check-confirm-dialog--gPFnEeg.cjs.map