@burojs/ui-shadcn 0.4.0 → 0.5.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 (137) 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-CX2PBu6l.js +63 -0
  11. package/dist/candidates-gate-CX2PBu6l.js.map +1 -0
  12. package/dist/candidates-gate-DiFI52r7.cjs +70 -0
  13. package/dist/candidates-gate-DiFI52r7.cjs.map +1 -0
  14. package/dist/candidates-relation-picker-CBsVcnPR.js +82 -0
  15. package/dist/candidates-relation-picker-CBsVcnPR.js.map +1 -0
  16. package/dist/candidates-relation-picker-Dd_GVLlu.cjs +84 -0
  17. package/dist/candidates-relation-picker-Dd_GVLlu.cjs.map +1 -0
  18. package/dist/check-confirm-dialog-BRByTFpg.cjs +1534 -0
  19. package/dist/check-confirm-dialog-BRByTFpg.cjs.map +1 -0
  20. package/dist/check-confirm-dialog-CkaVTPT9.js +1232 -0
  21. package/dist/check-confirm-dialog-CkaVTPT9.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-B3mZFL-K.cjs +1761 -0
  27. package/dist/filter-builder-B3mZFL-K.cjs.map +1 -0
  28. package/dist/filter-builder-DOnaXNfP.js +1605 -0
  29. package/dist/filter-builder-DOnaXNfP.js.map +1 -0
  30. package/dist/flow-runtime-B6zOHYqI.cjs +255 -0
  31. package/dist/flow-runtime-B6zOHYqI.cjs.map +1 -0
  32. package/dist/flow-runtime-D8h99FSg.js +252 -0
  33. package/dist/flow-runtime-D8h99FSg.js.map +1 -0
  34. package/dist/flow-screen-CX05b3G9.cjs +705 -0
  35. package/dist/flow-screen-CX05b3G9.cjs.map +1 -0
  36. package/dist/flow-screen-CmbARSqg.js +701 -0
  37. package/dist/flow-screen-CmbARSqg.js.map +1 -0
  38. package/dist/index.cjs +2825 -11912
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +1612 -1862
  41. package/dist/index.d.ts +1700 -1950
  42. package/dist/index.js +2498 -11605
  43. package/dist/index.js.map +1 -1
  44. package/dist/inline-flow-host-B7U1OJUe.cjs +112 -0
  45. package/dist/inline-flow-host-B7U1OJUe.cjs.map +1 -0
  46. package/dist/inline-flow-host-C3H2UpSA.js +112 -0
  47. package/dist/inline-flow-host-C3H2UpSA.js.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/lazy-relation-picker-dialog-2oxnA6IR.js +14 -0
  57. package/dist/lazy-relation-picker-dialog-2oxnA6IR.js.map +1 -0
  58. package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs +19 -0
  59. package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs.map +1 -0
  60. package/dist/markdown/index.cjs +1 -1
  61. package/dist/markdown/index.js +1 -1
  62. package/dist/page-flow-route-CQ7HsbBm.cjs +277 -0
  63. package/dist/page-flow-route-CQ7HsbBm.cjs.map +1 -0
  64. package/dist/page-flow-route-CyXSvXSE.js +277 -0
  65. package/dist/page-flow-route-CyXSvXSE.js.map +1 -0
  66. package/dist/peek-filter-CnqHwTMU.cjs +51 -0
  67. package/dist/peek-filter-CnqHwTMU.cjs.map +1 -0
  68. package/dist/peek-filter-ErLfO153.js +28 -0
  69. package/dist/peek-filter-ErLfO153.js.map +1 -0
  70. package/dist/place-node--GdsP688.js +7315 -0
  71. package/dist/place-node--GdsP688.js.map +1 -0
  72. package/dist/place-node-SIp4XYQH.cjs +7833 -0
  73. package/dist/place-node-SIp4XYQH.cjs.map +1 -0
  74. package/dist/related-list-cards-B6x9HQQp.js +42 -0
  75. package/dist/related-list-cards-B6x9HQQp.js.map +1 -0
  76. package/dist/related-list-cards-nxuODlIA.cjs +42 -0
  77. package/dist/related-list-cards-nxuODlIA.cjs.map +1 -0
  78. package/dist/related-list-timeline-BYJKEbmA.cjs +142 -0
  79. package/dist/related-list-timeline-BYJKEbmA.cjs.map +1 -0
  80. package/dist/related-list-timeline-DEdfd-rr.js +142 -0
  81. package/dist/related-list-timeline-DEdfd-rr.js.map +1 -0
  82. package/dist/related-rows-B4levHcR.js +186 -0
  83. package/dist/related-rows-B4levHcR.js.map +1 -0
  84. package/dist/related-rows-zh5f_4QR.cjs +209 -0
  85. package/dist/related-rows-zh5f_4QR.cjs.map +1 -0
  86. package/dist/relation-create-BOaUe12G.cjs +362 -0
  87. package/dist/relation-create-BOaUe12G.cjs.map +1 -0
  88. package/dist/relation-create-Bg-eEJLs.js +337 -0
  89. package/dist/relation-create-Bg-eEJLs.js.map +1 -0
  90. package/dist/relation-many-picker-B-NCEUgX.cjs +465 -0
  91. package/dist/relation-many-picker-B-NCEUgX.cjs.map +1 -0
  92. package/dist/relation-many-picker-gdAOD-qK.js +464 -0
  93. package/dist/relation-many-picker-gdAOD-qK.js.map +1 -0
  94. package/dist/relation-picker-BAY77ivO.js +462 -0
  95. package/dist/relation-picker-BAY77ivO.js.map +1 -0
  96. package/dist/relation-picker-Da_uhFvA.cjs +479 -0
  97. package/dist/relation-picker-Da_uhFvA.cjs.map +1 -0
  98. package/dist/relation-picker-dialog-M0pQaWlp.cjs +300 -0
  99. package/dist/relation-picker-dialog-M0pQaWlp.cjs.map +1 -0
  100. package/dist/relation-picker-dialog-hA9rYrZB.js +299 -0
  101. package/dist/relation-picker-dialog-hA9rYrZB.js.map +1 -0
  102. package/dist/resource-page-router-OSQyRA5b.cjs +1779 -0
  103. package/dist/resource-page-router-OSQyRA5b.cjs.map +1 -0
  104. package/dist/resource-page-router-T4vS5gbJ.js +1582 -0
  105. package/dist/resource-page-router-T4vS5gbJ.js.map +1 -0
  106. package/dist/{rich-text-IDFvyvRE.js → rich-text-DFerywgz.js} +7 -4
  107. package/dist/{rich-text-IDFvyvRE.js.map → rich-text-DFerywgz.js.map} +1 -1
  108. package/dist/{rich-text-lndbYqzR.cjs → rich-text-vTyVjDoa.cjs} +25 -22
  109. package/dist/{rich-text-lndbYqzR.cjs.map → rich-text-vTyVjDoa.cjs.map} +1 -1
  110. package/dist/search-access-B7G5oR8n.cjs +812 -0
  111. package/dist/search-access-B7G5oR8n.cjs.map +1 -0
  112. package/dist/search-access-CURsWn-U.js +669 -0
  113. package/dist/search-access-CURsWn-U.js.map +1 -0
  114. package/dist/shell-BPlk8hEa.js +205 -0
  115. package/dist/shell-BPlk8hEa.js.map +1 -0
  116. package/dist/shell-DxhlsPwm.cjs +271 -0
  117. package/dist/shell-DxhlsPwm.cjs.map +1 -0
  118. package/dist/skeleton-U2noefj5.js +13 -0
  119. package/dist/skeleton-U2noefj5.js.map +1 -0
  120. package/dist/skeleton-_1gP7wan.cjs +18 -0
  121. package/dist/skeleton-_1gP7wan.cjs.map +1 -0
  122. package/dist/styles.css +241 -9
  123. package/dist/toaster-C7CiYA4Z.cjs +248 -0
  124. package/dist/toaster-C7CiYA4Z.cjs.map +1 -0
  125. package/dist/toaster-CfCRLgR-.js +164 -0
  126. package/dist/toaster-CfCRLgR-.js.map +1 -0
  127. package/dist/use-dialog-filter-state-BBCC0OEK.cjs +92 -0
  128. package/dist/use-dialog-filter-state-BBCC0OEK.cjs.map +1 -0
  129. package/dist/use-dialog-filter-state-BDcgS5Oz.js +87 -0
  130. package/dist/use-dialog-filter-state-BDcgS5Oz.js.map +1 -0
  131. package/dist/{use-theme-BwPWinB2.cjs → use-theme-DFlpXils.cjs} +12 -1
  132. package/dist/use-theme-DFlpXils.cjs.map +1 -0
  133. package/dist/{use-theme-IHmtrhEt.js → use-theme-dnE3Od3I.js} +7 -2
  134. package/dist/use-theme-dnE3Od3I.js.map +1 -0
  135. package/package.json +16 -14
  136. package/dist/use-theme-BwPWinB2.cjs.map +0 -1
  137. package/dist/use-theme-IHmtrhEt.js.map +0 -1
@@ -0,0 +1,1534 @@
1
+ const require_use_theme = require("./use-theme-DFlpXils.cjs");
2
+ const require_toaster = require("./toaster-C7CiYA4Z.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-B6zOHYqI.cjs")));
274
+ const loadFlowScreen = retrying(() => Promise.resolve().then(() => require("./flow-screen-CX05b3G9.cjs")));
275
+ const loadPageFlowRoute = retrying(() => Promise.resolve().then(() => require("./page-flow-route-CQ7HsbBm.cjs")));
276
+ const loadInlineFlowHost = retrying(() => Promise.resolve().then(() => require("./inline-flow-host-B7U1OJUe.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
+ if (caps.has(`${own}.label`)) return caps.t(`${own}.label`);
828
+ if (caps.has(own)) return caps.t(own);
829
+ if (action.label != null) return action.label;
830
+ if (caps.has(`${raw}.label`)) return caps.t(`${raw}.label`);
831
+ if (caps.has(raw)) return caps.t(raw);
832
+ const camel = `actions.${camelizeActionName(actionName)}`;
833
+ if (caps.has(camel)) return caps.t(camel);
834
+ return (0, _burojs_core.humanizeKey)(actionName);
835
+ }
836
+ function findAction(actions, name) {
837
+ if (!Array.isArray(actions)) return void 0;
838
+ return actions.find((a) => "name" in a && a.name === name);
839
+ }
840
+ function actionResourceHandle(resource) {
841
+ return {
842
+ kind: "resource",
843
+ ref: (0, _burojs_core.normalizeEntityRef)(resource)
844
+ };
845
+ }
846
+ function ActionButton(props) {
847
+ const def = (0, _burojs_react.useApp)().registry.get(props.resource);
848
+ const scope = props.scope ?? "row";
849
+ const availability = (0, _burojs_react.useAvailabilityResolver)(props.resource, (0, _burojs_react.modeForSurface)(scope))(props.actionName, props.record);
850
+ const action = findAction(def?.actions?.item, props.actionName) ?? findAction(def?.actions?.resource, props.actionName);
851
+ if (!action) return null;
852
+ if ((0, _burojs_core_internal.isFlowAction)(action)) return (0, react_jsx_runtime.jsx)(FlowActionButton, { ...props });
853
+ if (availability.state === "absent" || availability.state === "hidden") return null;
854
+ if (!actionWhenHolds(action, props.record)) return null;
855
+ if (action.kind === "link") return (0, react_jsx_runtime.jsx)(LinkActionButton, {
856
+ ...props,
857
+ action,
858
+ availability
859
+ });
860
+ if (action.kind === "modal") return (0, react_jsx_runtime.jsx)(ModalActionButton, {
861
+ ...props,
862
+ action,
863
+ availability
864
+ });
865
+ return null;
866
+ }
867
+ function actionWhenHolds(action, record) {
868
+ const when = action.when;
869
+ if (when === void 0) return true;
870
+ return (0, _burojs_core_internal.evaluateCondition)(when, record === void 0 ? {} : { record: {
871
+ status: "ready",
872
+ value: record,
873
+ refreshing: false
874
+ } }, { mode: "show" }) === true;
875
+ }
876
+ function presentModalAction(args) {
877
+ const { present, action, resource, actionName, record, recordId, label } = args;
878
+ const result = present({
879
+ block: action.block,
880
+ props: action.props ?? {},
881
+ resource,
882
+ record,
883
+ host: action.host === "sheet" ? "sheet" : "dialog",
884
+ ...typeof label === "string" ? { label } : {},
885
+ activation: { surface: {
886
+ type: "item",
887
+ resource: (0, _burojs_core.normalizeEntityRef)(resource),
888
+ recordId,
889
+ record
890
+ } }
891
+ });
892
+ if (!result.ok) console.error(`[buro/ui-shadcn] modal action "${actionName}" failed to open block "${action.block.namespace}:${action.block.id}": ${result.code}`);
893
+ }
894
+ function makeTestId(scope, resource, actionName, recordId, tid) {
895
+ if (scope === "row") return tid.listRowAction(resource, recordId, actionName);
896
+ if (scope === "list" && recordId === "") return tid.listFlow(resource, actionName);
897
+ return tid.formAction(resource, scope, actionName);
898
+ }
899
+ const reportedDeadRoutes = new Set();
900
+ function deadRecordRoute(registry, action, to) {
901
+ if ((0, _burojs_core.isBuiltinItemAction)(action) || to === null || typeof to !== "object") return null;
902
+ const target = to;
903
+ if (typeof target.resource !== "string") return null;
904
+ if (target.action !== "show" && target.action !== "edit" && target.action !== "create") return null;
905
+ let def;
906
+ try {
907
+ def = registry.get(target.resource);
908
+ } catch {
909
+ return null;
910
+ }
911
+ if (def === void 0 || (0, _burojs_core.hasRecordPage)(def, target.action)) return null;
912
+ return {
913
+ resource: target.resource,
914
+ action: target.action
915
+ };
916
+ }
917
+ function reportDeadRecordRoute(name, resource, action) {
918
+ if (process.env.NODE_ENV === "production") return;
919
+ const key = `${name}\u0000${resource}\u0000${action}`;
920
+ if (reportedDeadRoutes.has(key)) return;
921
+ reportedDeadRoutes.add(key);
922
+ console.error(`[burojs] The action "${name}" links to ${resource}'s ${action} page, and ${resource} has none (views.show.page: false).`);
923
+ }
924
+ function LinkActionButton({ resource, actionName, record, scope = "row", variant, size, density, className, children, asMenuItem, action, availability }) {
925
+ const tid = (0, _burojs_react.useTestIds)();
926
+ const app = (0, _burojs_react.useApp)();
927
+ const toBrowser = useToBrowserHref();
928
+ const safeRecord = record ?? { id: "" };
929
+ const isDestructive = action.variant === "destructive";
930
+ const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
931
+ const recordId = record?.id ?? "";
932
+ const testid = makeTestId(scope, resource, actionName, recordId, tid);
933
+ const label = useResolvedLabel(action, actionName, children, resource);
934
+ const editRoute = useBuiltinEditRoute(action, resource, recordId);
935
+ const to = typeof action.to === "function" ? action.to((0, _burojs_react.buildDI)(actionResourceHandle(resource), safeRecord)) : action.to;
936
+ const href = (0, _burojs_react.resolveRoute)(to, app.registry);
937
+ const target = action.target ?? "_self";
938
+ const deadPage = deadRecordRoute(app.registry, action, to);
939
+ const deadResource = deadPage?.resource;
940
+ const deadAction = deadPage?.action;
941
+ (0, react.useEffect)(() => {
942
+ if (deadResource !== void 0 && deadAction !== void 0) reportDeadRecordRoute(actionName, deadResource, deadAction);
943
+ }, [
944
+ deadResource,
945
+ deadAction,
946
+ actionName
947
+ ]);
948
+ const rel = target === "_blank" ? "noopener noreferrer" : void 0;
949
+ const RouterLink = require_toaster.useLinkComponent();
950
+ const Anchor = target === "_blank" || isExternalHref(href) ? "a" : RouterLink;
951
+ const anchorHref = target === "_blank" ? toBrowser(href) : href;
952
+ if (editRoute.kind === "none") return null;
953
+ if (availability.state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
954
+ reason: availability.reason,
955
+ label,
956
+ icon: resolveActionIcon(action, actionName),
957
+ testid,
958
+ size,
959
+ variant: buttonVariant,
960
+ className,
961
+ asMenuItem,
962
+ resource,
963
+ density,
964
+ actionName,
965
+ surface: scope
966
+ });
967
+ if (editRoute.kind === "quick") {
968
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
969
+ "data-testid": testid,
970
+ onSelect: () => editRoute.open(),
971
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
972
+ icon: resolveActionIcon(action, actionName),
973
+ label
974
+ })
975
+ });
976
+ const quickChrome = resolveControlChrome({
977
+ density: density ?? "regular",
978
+ icon: resolveActionIcon(action, actionName),
979
+ label,
980
+ actionName,
981
+ surface: scope
982
+ });
983
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
984
+ type: "button",
985
+ variant: buttonVariant,
986
+ size: quickChrome.size,
987
+ "aria-label": quickChrome.ariaLabel,
988
+ className: require_use_theme.cn(quickChrome.className, className),
989
+ "data-testid": testid,
990
+ onClick: (e) => {
991
+ e.stopPropagation();
992
+ editRoute.open();
993
+ },
994
+ children: quickChrome.content
995
+ }), label, quickChrome.compact);
996
+ }
997
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
998
+ asChild: true,
999
+ className: require_use_theme.cn(isDestructive && DESTRUCTIVE_ITEM),
1000
+ children: (0, react_jsx_runtime.jsx)(Anchor, {
1001
+ href: anchorHref,
1002
+ target,
1003
+ rel,
1004
+ "data-testid": testid,
1005
+ onClick: (e) => e.stopPropagation(),
1006
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
1007
+ icon: resolveActionIcon(action, actionName),
1008
+ label
1009
+ })
1010
+ })
1011
+ });
1012
+ const chrome = resolveControlChrome({
1013
+ density: density ?? "regular",
1014
+ icon: resolveActionIcon(action, actionName),
1015
+ label,
1016
+ actionName,
1017
+ surface: scope
1018
+ });
1019
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
1020
+ asChild: true,
1021
+ variant: buttonVariant,
1022
+ size: chrome.size,
1023
+ "aria-label": chrome.ariaLabel,
1024
+ className: require_use_theme.cn(chrome.className, className),
1025
+ children: (0, react_jsx_runtime.jsx)(Anchor, {
1026
+ href: anchorHref,
1027
+ target,
1028
+ rel,
1029
+ "data-testid": testid,
1030
+ onClick: (e) => e.stopPropagation(),
1031
+ children: chrome.content
1032
+ })
1033
+ }), label, chrome.compact);
1034
+ }
1035
+ function ModalActionButton({ resource, actionName, record, scope = "row", variant, size, density, className, children, asMenuItem, action, availability }) {
1036
+ const tid = (0, _burojs_react.useTestIds)();
1037
+ const present = (0, _burojs_react.usePresentBlock)();
1038
+ const safeRecord = record ?? { id: "" };
1039
+ const isDestructive = action.variant === "destructive";
1040
+ const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
1041
+ const recordId = record?.id ?? "";
1042
+ const testid = makeTestId(scope, resource, actionName, recordId, tid);
1043
+ const label = useResolvedLabel(action, actionName, children, resource);
1044
+ if (availability.state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
1045
+ reason: availability.reason,
1046
+ label,
1047
+ icon: resolveActionIcon(action, actionName),
1048
+ testid,
1049
+ size,
1050
+ variant: buttonVariant,
1051
+ className,
1052
+ asMenuItem,
1053
+ resource,
1054
+ density,
1055
+ actionName,
1056
+ surface: scope
1057
+ });
1058
+ function openModal() {
1059
+ presentModalAction({
1060
+ present,
1061
+ action,
1062
+ resource,
1063
+ actionName,
1064
+ record: safeRecord,
1065
+ recordId,
1066
+ label
1067
+ });
1068
+ }
1069
+ if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
1070
+ "data-testid": testid,
1071
+ className: require_use_theme.cn(isDestructive && DESTRUCTIVE_ITEM),
1072
+ onSelect: openModal,
1073
+ children: (0, react_jsx_runtime.jsx)(ActionInner, {
1074
+ icon: resolveActionIcon(action, actionName),
1075
+ label
1076
+ })
1077
+ });
1078
+ const chrome = resolveControlChrome({
1079
+ density: density ?? "regular",
1080
+ icon: resolveActionIcon(action, actionName),
1081
+ label,
1082
+ actionName,
1083
+ surface: scope
1084
+ });
1085
+ return withActionTooltip((0, react_jsx_runtime.jsx)(require_button.Button, {
1086
+ type: "button",
1087
+ variant: buttonVariant,
1088
+ size: chrome.size,
1089
+ "aria-label": chrome.ariaLabel,
1090
+ "data-testid": testid,
1091
+ onClick: (e) => {
1092
+ e.stopPropagation();
1093
+ openModal();
1094
+ },
1095
+ className: require_use_theme.cn(chrome.className, className),
1096
+ children: chrome.content
1097
+ }), label, chrome.compact);
1098
+ }
1099
+ //#endregion
1100
+ //#region src/checks/check-confirm-dialog.tsx
1101
+ function translateOrFallback(t, key, fallback, params, resource) {
1102
+ const translated = t(key, {
1103
+ params,
1104
+ ...resource === void 0 ? {} : { resource }
1105
+ });
1106
+ return translated === key ? fallback : translated;
1107
+ }
1108
+ function issueText(issue, t, resource) {
1109
+ const declared = typeof issue.message.default === "string" ? issue.message.default : issue.message.key;
1110
+ if (issue.params?.resolved === true) return declared;
1111
+ return translateOrFallback(t, issue.message.key, declared, issue.params, resource);
1112
+ }
1113
+ function checkIdOf(issue, index) {
1114
+ const id = issue.params?.checkId;
1115
+ return typeof id === "string" ? id : `${index}`;
1116
+ }
1117
+ const SEVERITY_CLASSNAME = {
1118
+ error: "text-destructive",
1119
+ warning: "text-warning-emphasis",
1120
+ info: "text-muted-foreground"
1121
+ };
1122
+ function ChecksList({ issues, testid, onRowClick, resource }) {
1123
+ const t = (0, _burojs_react.useOptionalT)();
1124
+ return issues.map((issue, index) => {
1125
+ const checkId = checkIdOf(issue, index);
1126
+ const anchor = issue.path[0];
1127
+ const anchorable = typeof anchor === "string";
1128
+ const text = issueText(issue, t, resource);
1129
+ const className = require_use_theme.cn("text-sm", SEVERITY_CLASSNAME[issue.severity]);
1130
+ return anchorable ? (0, react_jsx_runtime.jsx)("li", { children: (0, react_jsx_runtime.jsx)("button", {
1131
+ type: "button",
1132
+ "data-testid": `${testid}:item:${checkId}`,
1133
+ className: require_use_theme.cn(className, "text-left underline-offset-2 hover:underline"),
1134
+ onClick: () => onRowClick(anchor),
1135
+ children: text
1136
+ }) }, `${checkId}-${index}`) : (0, react_jsx_runtime.jsx)("li", {
1137
+ "data-testid": `${testid}:item:${checkId}`,
1138
+ className,
1139
+ children: text
1140
+ }, `${checkId}-${index}`);
1141
+ });
1142
+ }
1143
+ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel, tone }) {
1144
+ const t = (0, _burojs_react.useOptionalT)();
1145
+ const { resource, open, busy, header, blockers, confirmable, proceed, cancel } = state;
1146
+ const blocked = blockers.length > 0;
1147
+ const bound = resource === void 0 ? {} : { resource };
1148
+ const heading = title ?? t("checks.dialogTitle", {
1149
+ defaultValue: "Please review",
1150
+ ...bound
1151
+ });
1152
+ const restoreFocusRef = (0, react.useRef)(null);
1153
+ (0, react.useEffect)(() => {
1154
+ if (typeof document === "undefined") return;
1155
+ if (open) {
1156
+ const active = document.activeElement;
1157
+ if (active instanceof HTMLElement && active !== document.body) restoreFocusRef.current = active;
1158
+ return;
1159
+ }
1160
+ const target = restoreFocusRef.current;
1161
+ restoreFocusRef.current = null;
1162
+ if (!target || !document.contains(target)) return;
1163
+ const id = requestAnimationFrame(() => target.focus());
1164
+ return () => cancelAnimationFrame(id);
1165
+ }, [open]);
1166
+ const onRowClick = (field) => {
1167
+ onAnchorFocus?.(field);
1168
+ cancel();
1169
+ };
1170
+ return (0, react_jsx_runtime.jsx)(require_dialog.Dialog, {
1171
+ open,
1172
+ onOpenChange: (next) => {
1173
+ if (!next) cancel();
1174
+ },
1175
+ children: (0, react_jsx_runtime.jsxs)(require_dialog.DialogContent, {
1176
+ "data-testid": `${testid}:dialog`,
1177
+ className: "flex max-h-[85vh] flex-col overflow-hidden",
1178
+ children: [
1179
+ (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, {
1180
+ className: "sr-only",
1181
+ children: heading
1182
+ })] }),
1183
+ (0, react_jsx_runtime.jsxs)("ul", {
1184
+ className: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-contain",
1185
+ children: [
1186
+ blocked && (0, react_jsx_runtime.jsx)("li", {
1187
+ className: "text-xs font-semibold uppercase tracking-wider text-destructive",
1188
+ children: t("checks.blocked", {
1189
+ defaultValue: "Cannot continue",
1190
+ ...bound
1191
+ })
1192
+ }),
1193
+ (0, react_jsx_runtime.jsx)(ChecksList, {
1194
+ issues: blockers,
1195
+ testid,
1196
+ onRowClick,
1197
+ resource
1198
+ }),
1199
+ (0, react_jsx_runtime.jsx)(ChecksList, {
1200
+ issues: confirmable,
1201
+ testid,
1202
+ onRowClick,
1203
+ resource
1204
+ })
1205
+ ]
1206
+ }),
1207
+ (0, react_jsx_runtime.jsxs)(require_dialog.DialogFooter, { children: [(0, react_jsx_runtime.jsx)(require_button.Button, {
1208
+ type: "button",
1209
+ variant: "outline",
1210
+ onClick: cancel,
1211
+ "data-testid": `${testid}:cancel`,
1212
+ disabled: busy,
1213
+ children: t("checks.back", {
1214
+ defaultValue: "Go back",
1215
+ ...bound
1216
+ })
1217
+ }), !blocked && (0, react_jsx_runtime.jsx)(require_button.Button, {
1218
+ type: "button",
1219
+ variant: tone === "destructive" ? "destructive" : "default",
1220
+ onClick: proceed,
1221
+ "data-testid": `${testid}:proceed`,
1222
+ disabled: busy,
1223
+ children: proceedLabel ?? t("checks.proceed", {
1224
+ defaultValue: "Continue anyway",
1225
+ ...bound
1226
+ })
1227
+ })] })
1228
+ ]
1229
+ })
1230
+ });
1231
+ }
1232
+ //#endregion
1233
+ Object.defineProperty(exports, "ActionButton", {
1234
+ enumerable: true,
1235
+ get: function() {
1236
+ return ActionButton;
1237
+ }
1238
+ });
1239
+ Object.defineProperty(exports, "ActionInner", {
1240
+ enumerable: true,
1241
+ get: function() {
1242
+ return ActionInner;
1243
+ }
1244
+ });
1245
+ Object.defineProperty(exports, "CheckConfirmDialog", {
1246
+ enumerable: true,
1247
+ get: function() {
1248
+ return CheckConfirmDialog;
1249
+ }
1250
+ });
1251
+ Object.defineProperty(exports, "DisabledAction", {
1252
+ enumerable: true,
1253
+ get: function() {
1254
+ return DisabledAction;
1255
+ }
1256
+ });
1257
+ Object.defineProperty(exports, "DocInfo", {
1258
+ enumerable: true,
1259
+ get: function() {
1260
+ return DocInfo;
1261
+ }
1262
+ });
1263
+ Object.defineProperty(exports, "DropdownMenu", {
1264
+ enumerable: true,
1265
+ get: function() {
1266
+ return DropdownMenu;
1267
+ }
1268
+ });
1269
+ Object.defineProperty(exports, "DropdownMenuCheckboxItem", {
1270
+ enumerable: true,
1271
+ get: function() {
1272
+ return DropdownMenuCheckboxItem;
1273
+ }
1274
+ });
1275
+ Object.defineProperty(exports, "DropdownMenuContent", {
1276
+ enumerable: true,
1277
+ get: function() {
1278
+ return DropdownMenuContent;
1279
+ }
1280
+ });
1281
+ Object.defineProperty(exports, "DropdownMenuGroup", {
1282
+ enumerable: true,
1283
+ get: function() {
1284
+ return DropdownMenuGroup;
1285
+ }
1286
+ });
1287
+ Object.defineProperty(exports, "DropdownMenuItem", {
1288
+ enumerable: true,
1289
+ get: function() {
1290
+ return DropdownMenuItem;
1291
+ }
1292
+ });
1293
+ Object.defineProperty(exports, "DropdownMenuLabel", {
1294
+ enumerable: true,
1295
+ get: function() {
1296
+ return DropdownMenuLabel;
1297
+ }
1298
+ });
1299
+ Object.defineProperty(exports, "DropdownMenuPortal", {
1300
+ enumerable: true,
1301
+ get: function() {
1302
+ return DropdownMenuPortal;
1303
+ }
1304
+ });
1305
+ Object.defineProperty(exports, "DropdownMenuRadioGroup", {
1306
+ enumerable: true,
1307
+ get: function() {
1308
+ return DropdownMenuRadioGroup;
1309
+ }
1310
+ });
1311
+ Object.defineProperty(exports, "DropdownMenuRadioItem", {
1312
+ enumerable: true,
1313
+ get: function() {
1314
+ return DropdownMenuRadioItem;
1315
+ }
1316
+ });
1317
+ Object.defineProperty(exports, "DropdownMenuSeparator", {
1318
+ enumerable: true,
1319
+ get: function() {
1320
+ return DropdownMenuSeparator;
1321
+ }
1322
+ });
1323
+ Object.defineProperty(exports, "DropdownMenuShortcut", {
1324
+ enumerable: true,
1325
+ get: function() {
1326
+ return DropdownMenuShortcut;
1327
+ }
1328
+ });
1329
+ Object.defineProperty(exports, "DropdownMenuSub", {
1330
+ enumerable: true,
1331
+ get: function() {
1332
+ return DropdownMenuSub;
1333
+ }
1334
+ });
1335
+ Object.defineProperty(exports, "DropdownMenuSubContent", {
1336
+ enumerable: true,
1337
+ get: function() {
1338
+ return DropdownMenuSubContent;
1339
+ }
1340
+ });
1341
+ Object.defineProperty(exports, "DropdownMenuSubTrigger", {
1342
+ enumerable: true,
1343
+ get: function() {
1344
+ return DropdownMenuSubTrigger;
1345
+ }
1346
+ });
1347
+ Object.defineProperty(exports, "DropdownMenuTrigger", {
1348
+ enumerable: true,
1349
+ get: function() {
1350
+ return DropdownMenuTrigger;
1351
+ }
1352
+ });
1353
+ Object.defineProperty(exports, "FlowActionButton", {
1354
+ enumerable: true,
1355
+ get: function() {
1356
+ return FlowActionButton;
1357
+ }
1358
+ });
1359
+ Object.defineProperty(exports, "FlowBoundary", {
1360
+ enumerable: true,
1361
+ get: function() {
1362
+ return FlowBoundary;
1363
+ }
1364
+ });
1365
+ Object.defineProperty(exports, "FlowLoadFailed", {
1366
+ enumerable: true,
1367
+ get: function() {
1368
+ return FlowLoadFailed;
1369
+ }
1370
+ });
1371
+ Object.defineProperty(exports, "FlowMenuItem", {
1372
+ enumerable: true,
1373
+ get: function() {
1374
+ return FlowMenuItem;
1375
+ }
1376
+ });
1377
+ Object.defineProperty(exports, "Icon", {
1378
+ enumerable: true,
1379
+ get: function() {
1380
+ return Icon;
1381
+ }
1382
+ });
1383
+ Object.defineProperty(exports, "RuntimeAppFlowRunner", {
1384
+ enumerable: true,
1385
+ get: function() {
1386
+ return RuntimeAppFlowRunner;
1387
+ }
1388
+ });
1389
+ Object.defineProperty(exports, "RuntimeBulkFlowRunner", {
1390
+ enumerable: true,
1391
+ get: function() {
1392
+ return RuntimeBulkFlowRunner;
1393
+ }
1394
+ });
1395
+ Object.defineProperty(exports, "RuntimeFlowRunner", {
1396
+ enumerable: true,
1397
+ get: function() {
1398
+ return RuntimeFlowRunner;
1399
+ }
1400
+ });
1401
+ Object.defineProperty(exports, "Tooltip", {
1402
+ enumerable: true,
1403
+ get: function() {
1404
+ return Tooltip;
1405
+ }
1406
+ });
1407
+ Object.defineProperty(exports, "TooltipContent", {
1408
+ enumerable: true,
1409
+ get: function() {
1410
+ return TooltipContent;
1411
+ }
1412
+ });
1413
+ Object.defineProperty(exports, "TooltipProvider", {
1414
+ enumerable: true,
1415
+ get: function() {
1416
+ return TooltipProvider;
1417
+ }
1418
+ });
1419
+ Object.defineProperty(exports, "TooltipTrigger", {
1420
+ enumerable: true,
1421
+ get: function() {
1422
+ return TooltipTrigger;
1423
+ }
1424
+ });
1425
+ Object.defineProperty(exports, "canonicalResourceName", {
1426
+ enumerable: true,
1427
+ get: function() {
1428
+ return canonicalResourceName;
1429
+ }
1430
+ });
1431
+ Object.defineProperty(exports, "hasIcon", {
1432
+ enumerable: true,
1433
+ get: function() {
1434
+ return hasIcon;
1435
+ }
1436
+ });
1437
+ Object.defineProperty(exports, "isExternalHref", {
1438
+ enumerable: true,
1439
+ get: function() {
1440
+ return isExternalHref;
1441
+ }
1442
+ });
1443
+ Object.defineProperty(exports, "listSlot", {
1444
+ enumerable: true,
1445
+ get: function() {
1446
+ return listSlot;
1447
+ }
1448
+ });
1449
+ Object.defineProperty(exports, "loadBulkSummary", {
1450
+ enumerable: true,
1451
+ get: function() {
1452
+ return loadBulkSummary;
1453
+ }
1454
+ });
1455
+ Object.defineProperty(exports, "loadFailedText", {
1456
+ enumerable: true,
1457
+ get: function() {
1458
+ return loadFailedText;
1459
+ }
1460
+ });
1461
+ Object.defineProperty(exports, "loadFlowScreen", {
1462
+ enumerable: true,
1463
+ get: function() {
1464
+ return loadFlowScreen;
1465
+ }
1466
+ });
1467
+ Object.defineProperty(exports, "loadInlineFlowHost", {
1468
+ enumerable: true,
1469
+ get: function() {
1470
+ return loadInlineFlowHost;
1471
+ }
1472
+ });
1473
+ Object.defineProperty(exports, "loadPageFlowRoute", {
1474
+ enumerable: true,
1475
+ get: function() {
1476
+ return loadPageFlowRoute;
1477
+ }
1478
+ });
1479
+ Object.defineProperty(exports, "makeTestId", {
1480
+ enumerable: true,
1481
+ get: function() {
1482
+ return makeTestId;
1483
+ }
1484
+ });
1485
+ Object.defineProperty(exports, "openExternal", {
1486
+ enumerable: true,
1487
+ get: function() {
1488
+ return openExternal;
1489
+ }
1490
+ });
1491
+ Object.defineProperty(exports, "preloadFlowRuntime", {
1492
+ enumerable: true,
1493
+ get: function() {
1494
+ return preloadFlowRuntime;
1495
+ }
1496
+ });
1497
+ Object.defineProperty(exports, "registerIcons", {
1498
+ enumerable: true,
1499
+ get: function() {
1500
+ return registerIcons;
1501
+ }
1502
+ });
1503
+ Object.defineProperty(exports, "text", {
1504
+ enumerable: true,
1505
+ get: function() {
1506
+ return text;
1507
+ }
1508
+ });
1509
+ Object.defineProperty(exports, "useFlowChrome", {
1510
+ enumerable: true,
1511
+ get: function() {
1512
+ return useFlowChrome;
1513
+ }
1514
+ });
1515
+ Object.defineProperty(exports, "useListSlot", {
1516
+ enumerable: true,
1517
+ get: function() {
1518
+ return useListSlot;
1519
+ }
1520
+ });
1521
+ Object.defineProperty(exports, "useLoaded", {
1522
+ enumerable: true,
1523
+ get: function() {
1524
+ return useLoaded;
1525
+ }
1526
+ });
1527
+ Object.defineProperty(exports, "useToBrowserHref", {
1528
+ enumerable: true,
1529
+ get: function() {
1530
+ return useToBrowserHref;
1531
+ }
1532
+ });
1533
+
1534
+ //# sourceMappingURL=check-confirm-dialog-BRByTFpg.cjs.map