@burojs/ui-shadcn 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/bulk-summary-BWSAS7k2.js +143 -0
- package/dist/bulk-summary-BWSAS7k2.js.map +1 -0
- package/dist/bulk-summary-CrEij5vq.cjs +143 -0
- package/dist/bulk-summary-CrEij5vq.cjs.map +1 -0
- package/dist/candidates-relation-picker-CS_JZ4Fd.js +31 -0
- package/dist/candidates-relation-picker-CS_JZ4Fd.js.map +1 -0
- package/dist/candidates-relation-picker-y5M6_oe4.cjs +31 -0
- package/dist/candidates-relation-picker-y5M6_oe4.cjs.map +1 -0
- package/dist/{check-confirm-dialog-CkaVTPT9.js → check-confirm-dialog-2j0gOd7x.js} +392 -103
- package/dist/check-confirm-dialog-2j0gOd7x.js.map +1 -0
- package/dist/{check-confirm-dialog-BRByTFpg.cjs → check-confirm-dialog-C-NHgMST.cjs} +476 -102
- package/dist/check-confirm-dialog-C-NHgMST.cjs.map +1 -0
- package/dist/{dialog-B_rt9S1c.js → dialog-C123sVQ8.js} +4 -4
- package/dist/dialog-C123sVQ8.js.map +1 -0
- package/dist/{dialog-DRNUq9EA.cjs → dialog-vmMdfUWs.cjs} +3 -3
- package/dist/dialog-vmMdfUWs.cjs.map +1 -0
- package/dist/{filter-builder-B3mZFL-K.cjs → filter-builder-DFu0JP-1.cjs} +959 -128
- package/dist/filter-builder-DFu0JP-1.cjs.map +1 -0
- package/dist/{filter-builder-DOnaXNfP.js → filter-builder-DaWHUZuV.js} +863 -116
- package/dist/filter-builder-DaWHUZuV.js.map +1 -0
- package/dist/{flow-runtime-B6zOHYqI.cjs → flow-runtime-BpmrIUb6.cjs} +61 -29
- package/dist/flow-runtime-BpmrIUb6.cjs.map +1 -0
- package/dist/{flow-runtime-D8h99FSg.js → flow-runtime-DyqTmK3H.js} +62 -30
- package/dist/flow-runtime-DyqTmK3H.js.map +1 -0
- package/dist/{flow-screen-CX05b3G9.cjs → flow-screen-Bcz9NF2V.cjs} +132 -88
- package/dist/flow-screen-Bcz9NF2V.cjs.map +1 -0
- package/dist/{flow-screen-CmbARSqg.js → flow-screen-DCdli6Ha.js} +132 -88
- package/dist/flow-screen-DCdli6Ha.js.map +1 -0
- package/dist/index.cjs +951 -605
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +618 -332
- package/dist/index.d.ts +618 -332
- package/dist/index.js +863 -522
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-B7U1OJUe.cjs → inline-flow-host-3vw7LzzD.cjs} +5 -5
- package/dist/inline-flow-host-3vw7LzzD.cjs.map +1 -0
- package/dist/{inline-flow-host-C3H2UpSA.js → inline-flow-host-C0rI9B7f.js} +5 -5
- package/dist/inline-flow-host-C0rI9B7f.js.map +1 -0
- package/dist/label-66W1qbke.js.map +1 -1
- package/dist/label-w6JYf2cF.cjs.map +1 -1
- package/dist/lazy-relation-picker-dialog-Bt8lrEIu.cjs +153 -0
- package/dist/lazy-relation-picker-dialog-Bt8lrEIu.cjs.map +1 -0
- package/dist/lazy-relation-picker-dialog-CAScLPb2.js +135 -0
- package/dist/lazy-relation-picker-dialog-CAScLPb2.js.map +1 -0
- package/dist/markdown/index.d.cts +2 -3
- package/dist/markdown/index.d.ts +2 -3
- package/dist/{page-flow-route-CyXSvXSE.js → page-flow-route-BHUEpn0I.js} +36 -23
- package/dist/page-flow-route-BHUEpn0I.js.map +1 -0
- package/dist/{page-flow-route-CQ7HsbBm.cjs → page-flow-route-DS8IVTVH.cjs} +41 -28
- package/dist/page-flow-route-DS8IVTVH.cjs.map +1 -0
- package/dist/{place-node-SIp4XYQH.cjs → place-node-CNb3w-c7.cjs} +2227 -999
- package/dist/place-node-CNb3w-c7.cjs.map +1 -0
- package/dist/{place-node--GdsP688.js → place-node-CfzQvh4Y.js} +2164 -984
- package/dist/place-node-CfzQvh4Y.js.map +1 -0
- package/dist/{related-list-cards-B6x9HQQp.js → related-list-cards-BIqqY69Y.js} +9 -4
- package/dist/{related-list-cards-B6x9HQQp.js.map → related-list-cards-BIqqY69Y.js.map} +1 -1
- package/dist/{related-list-cards-nxuODlIA.cjs → related-list-cards-CelMxl4q.cjs} +9 -4
- package/dist/{related-list-cards-nxuODlIA.cjs.map → related-list-cards-CelMxl4q.cjs.map} +1 -1
- package/dist/{related-list-timeline-DEdfd-rr.js → related-list-timeline-CRh7xwLD.js} +6 -7
- package/dist/related-list-timeline-CRh7xwLD.js.map +1 -0
- package/dist/{related-list-timeline-BYJKEbmA.cjs → related-list-timeline-DsLdi8sv.cjs} +5 -6
- package/dist/related-list-timeline-DsLdi8sv.cjs.map +1 -0
- package/dist/{related-rows-B4levHcR.js → related-rows--uP2iKQC.js} +27 -17
- package/dist/related-rows--uP2iKQC.js.map +1 -0
- package/dist/{related-rows-zh5f_4QR.cjs → related-rows-MPnLCmPF.cjs} +32 -22
- package/dist/related-rows-MPnLCmPF.cjs.map +1 -0
- package/dist/{search-access-CURsWn-U.js → relation-create-C43cdPQt.js} +596 -29
- package/dist/relation-create-C43cdPQt.js.map +1 -0
- package/dist/{search-access-B7G5oR8n.cjs → relation-create-DDEYcKfw.cjs} +630 -32
- package/dist/relation-create-DDEYcKfw.cjs.map +1 -0
- package/dist/{relation-many-picker-gdAOD-qK.js → relation-many-picker-BJhaEqxz.js} +210 -107
- package/dist/relation-many-picker-BJhaEqxz.js.map +1 -0
- package/dist/{relation-many-picker-B-NCEUgX.cjs → relation-many-picker-DzuGJpEl.cjs} +218 -115
- package/dist/relation-many-picker-DzuGJpEl.cjs.map +1 -0
- package/dist/{relation-picker-BAY77ivO.js → relation-picker-D-tBBZW_.js} +40 -45
- package/dist/relation-picker-D-tBBZW_.js.map +1 -0
- package/dist/{relation-picker-Da_uhFvA.cjs → relation-picker-DaIMzf2H.cjs} +45 -50
- package/dist/relation-picker-DaIMzf2H.cjs.map +1 -0
- package/dist/{relation-picker-dialog-M0pQaWlp.cjs → relation-picker-dialog-9Vg5vvR1.cjs} +142 -40
- package/dist/relation-picker-dialog-9Vg5vvR1.cjs.map +1 -0
- package/dist/{relation-picker-dialog-hA9rYrZB.js → relation-picker-dialog-DoEY8EkH.js} +143 -41
- package/dist/relation-picker-dialog-DoEY8EkH.js.map +1 -0
- package/dist/relation-select-B8Fq4o-t.js +48 -0
- package/dist/relation-select-B8Fq4o-t.js.map +1 -0
- package/dist/relation-select-Cr3CfNLy.cjs +55 -0
- package/dist/relation-select-Cr3CfNLy.cjs.map +1 -0
- package/dist/{resource-page-router-OSQyRA5b.cjs → resource-page-router-C_kGW2o_.cjs} +552 -303
- package/dist/resource-page-router-C_kGW2o_.cjs.map +1 -0
- package/dist/{resource-page-router-T4vS5gbJ.js → resource-page-router-Diw6S6TK.js} +507 -258
- package/dist/resource-page-router-Diw6S6TK.js.map +1 -0
- package/dist/{rich-text-vTyVjDoa.cjs → rich-text-C_7JCvRo.cjs} +2 -2
- package/dist/{rich-text-vTyVjDoa.cjs.map → rich-text-C_7JCvRo.cjs.map} +1 -1
- package/dist/{rich-text-DFerywgz.js → rich-text-RcPBf6hr.js} +2 -2
- package/dist/{rich-text-DFerywgz.js.map → rich-text-RcPBf6hr.js.map} +1 -1
- package/dist/success-notices-Dl3M1fZP.cjs +46 -0
- package/dist/success-notices-Dl3M1fZP.cjs.map +1 -0
- package/dist/success-notices-LDEgEkc4.js +41 -0
- package/dist/success-notices-LDEgEkc4.js.map +1 -0
- package/dist/{toaster-C7CiYA4Z.cjs → toaster-BbByOytP.cjs} +72 -80
- package/dist/toaster-BbByOytP.cjs.map +1 -0
- package/dist/{toaster-CfCRLgR-.js → toaster-Ct_YHGs6.js} +66 -68
- package/dist/toaster-Ct_YHGs6.js.map +1 -0
- package/dist/{use-dialog-filter-state-BDcgS5Oz.js → use-dialog-filter-state-B_MqzHaT.js} +5 -4
- package/dist/use-dialog-filter-state-B_MqzHaT.js.map +1 -0
- package/dist/{use-dialog-filter-state-BBCC0OEK.cjs → use-dialog-filter-state-tNvqAAjh.cjs} +6 -5
- package/dist/use-dialog-filter-state-tNvqAAjh.cjs.map +1 -0
- package/dist/use-theme-DFlpXils.cjs.map +1 -1
- package/dist/use-theme-dnE3Od3I.js.map +1 -1
- package/package.json +11 -11
- package/dist/bulk-summary-CwSd6Yjb.cjs +0 -108
- package/dist/bulk-summary-CwSd6Yjb.cjs.map +0 -1
- package/dist/bulk-summary-GxMDP4bw.js +0 -108
- package/dist/bulk-summary-GxMDP4bw.js.map +0 -1
- package/dist/candidates-gate-CX2PBu6l.js +0 -63
- package/dist/candidates-gate-CX2PBu6l.js.map +0 -1
- package/dist/candidates-gate-DiFI52r7.cjs +0 -70
- package/dist/candidates-gate-DiFI52r7.cjs.map +0 -1
- package/dist/candidates-relation-picker-CBsVcnPR.js +0 -82
- package/dist/candidates-relation-picker-CBsVcnPR.js.map +0 -1
- package/dist/candidates-relation-picker-Dd_GVLlu.cjs +0 -84
- package/dist/candidates-relation-picker-Dd_GVLlu.cjs.map +0 -1
- package/dist/check-confirm-dialog-BRByTFpg.cjs.map +0 -1
- package/dist/check-confirm-dialog-CkaVTPT9.js.map +0 -1
- package/dist/dialog-B_rt9S1c.js.map +0 -1
- package/dist/dialog-DRNUq9EA.cjs.map +0 -1
- package/dist/filter-builder-B3mZFL-K.cjs.map +0 -1
- package/dist/filter-builder-DOnaXNfP.js.map +0 -1
- package/dist/flow-runtime-B6zOHYqI.cjs.map +0 -1
- package/dist/flow-runtime-D8h99FSg.js.map +0 -1
- package/dist/flow-screen-CX05b3G9.cjs.map +0 -1
- package/dist/flow-screen-CmbARSqg.js.map +0 -1
- package/dist/inline-flow-host-B7U1OJUe.cjs.map +0 -1
- package/dist/inline-flow-host-C3H2UpSA.js.map +0 -1
- package/dist/lazy-relation-picker-dialog-2oxnA6IR.js +0 -14
- package/dist/lazy-relation-picker-dialog-2oxnA6IR.js.map +0 -1
- package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs +0 -19
- package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs.map +0 -1
- package/dist/page-flow-route-CQ7HsbBm.cjs.map +0 -1
- package/dist/page-flow-route-CyXSvXSE.js.map +0 -1
- package/dist/peek-filter-CnqHwTMU.cjs +0 -51
- package/dist/peek-filter-CnqHwTMU.cjs.map +0 -1
- package/dist/peek-filter-ErLfO153.js +0 -28
- package/dist/peek-filter-ErLfO153.js.map +0 -1
- package/dist/place-node--GdsP688.js.map +0 -1
- package/dist/place-node-SIp4XYQH.cjs.map +0 -1
- package/dist/related-list-timeline-BYJKEbmA.cjs.map +0 -1
- package/dist/related-list-timeline-DEdfd-rr.js.map +0 -1
- package/dist/related-rows-B4levHcR.js.map +0 -1
- package/dist/related-rows-zh5f_4QR.cjs.map +0 -1
- package/dist/relation-create-BOaUe12G.cjs +0 -362
- package/dist/relation-create-BOaUe12G.cjs.map +0 -1
- package/dist/relation-create-Bg-eEJLs.js +0 -337
- package/dist/relation-create-Bg-eEJLs.js.map +0 -1
- package/dist/relation-many-picker-B-NCEUgX.cjs.map +0 -1
- package/dist/relation-many-picker-gdAOD-qK.js.map +0 -1
- package/dist/relation-picker-BAY77ivO.js.map +0 -1
- package/dist/relation-picker-Da_uhFvA.cjs.map +0 -1
- package/dist/relation-picker-dialog-M0pQaWlp.cjs.map +0 -1
- package/dist/relation-picker-dialog-hA9rYrZB.js.map +0 -1
- package/dist/resource-page-router-OSQyRA5b.cjs.map +0 -1
- package/dist/resource-page-router-T4vS5gbJ.js.map +0 -1
- package/dist/search-access-B7G5oR8n.cjs.map +0 -1
- package/dist/search-access-CURsWn-U.js.map +0 -1
- package/dist/shell-BPlk8hEa.js +0 -205
- package/dist/shell-BPlk8hEa.js.map +0 -1
- package/dist/shell-DxhlsPwm.cjs +0 -271
- package/dist/shell-DxhlsPwm.cjs.map +0 -1
- package/dist/toaster-C7CiYA4Z.cjs.map +0 -1
- package/dist/toaster-CfCRLgR-.js.map +0 -1
- package/dist/use-dialog-filter-state-BBCC0OEK.cjs.map +0 -1
- package/dist/use-dialog-filter-state-BDcgS5Oz.js.map +0 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
const require_use_theme = require("./use-theme-DFlpXils.cjs");
|
|
2
|
-
const require_toaster = require("./toaster-
|
|
2
|
+
const require_toaster = require("./toaster-BbByOytP.cjs");
|
|
3
3
|
const require_button = require("./button-BxnnE28H.cjs");
|
|
4
|
-
const require_dialog = require("./dialog-
|
|
4
|
+
const require_dialog = require("./dialog-vmMdfUWs.cjs");
|
|
5
5
|
let _burojs_core = require("@burojs/core");
|
|
6
6
|
let _burojs_react = require("@burojs/react");
|
|
7
7
|
let _tabler_icons_react = require("@tabler/icons-react");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
react = require_use_theme.__toESM(react, 1);
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let class_variance_authority = require("class-variance-authority");
|
|
12
|
+
let _radix_ui_react_dialog = require("@radix-ui/react-dialog");
|
|
13
|
+
_radix_ui_react_dialog = require_use_theme.__toESM(_radix_ui_react_dialog, 1);
|
|
11
14
|
let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
|
|
12
15
|
_radix_ui_react_tooltip = require_use_theme.__toESM(_radix_ui_react_tooltip, 1);
|
|
13
16
|
let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
@@ -103,6 +106,69 @@ function DocInfo({ address, name, testId, className }) {
|
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
//#endregion
|
|
109
|
+
//#region src/primitives/sheet.tsx
|
|
110
|
+
const Sheet = _radix_ui_react_dialog.Root;
|
|
111
|
+
const SheetTrigger = _radix_ui_react_dialog.Trigger;
|
|
112
|
+
const SheetClose = _radix_ui_react_dialog.Close;
|
|
113
|
+
const SheetPortal = _radix_ui_react_dialog.Portal;
|
|
114
|
+
const SheetOverlay = react.forwardRef(({ className, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Overlay, {
|
|
115
|
+
className: require_use_theme.cn("fixed inset-0 z-50 bg-overlay/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-[var(--duration-panel)] ease-[var(--ease-overlay)]", className),
|
|
116
|
+
...props,
|
|
117
|
+
ref
|
|
118
|
+
}));
|
|
119
|
+
SheetOverlay.displayName = _radix_ui_react_dialog.Overlay.displayName;
|
|
120
|
+
const sheetVariants = (0, class_variance_authority.cva)("fixed z-50 gap-4 bg-background text-foreground p-6 shadow-lg duration-[var(--duration-panel)] ease-[var(--ease-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out", {
|
|
121
|
+
variants: { side: {
|
|
122
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
123
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
124
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
125
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
126
|
+
} },
|
|
127
|
+
defaultVariants: { side: "right" }
|
|
128
|
+
});
|
|
129
|
+
const SheetContent = react.forwardRef(({ side = "right", className, children, showClose = true, ...props }, ref) => {
|
|
130
|
+
const chromeT = (0, _burojs_react.useChromeT)();
|
|
131
|
+
return (0, react_jsx_runtime.jsxs)(SheetPortal, { children: [(0, react_jsx_runtime.jsx)(SheetOverlay, {}), (0, react_jsx_runtime.jsxs)(_radix_ui_react_dialog.Content, {
|
|
132
|
+
ref,
|
|
133
|
+
className: require_use_theme.cn(sheetVariants({ side }), className),
|
|
134
|
+
...props,
|
|
135
|
+
children: [children, showClose && (0, react_jsx_runtime.jsxs)(_radix_ui_react_dialog.Close, {
|
|
136
|
+
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",
|
|
137
|
+
children: [(0, react_jsx_runtime.jsx)(_tabler_icons_react.IconX, { className: "h-4 w-4" }), (0, react_jsx_runtime.jsx)("span", {
|
|
138
|
+
className: "sr-only",
|
|
139
|
+
children: chromeT("actions.close", { defaultValue: "Close" })
|
|
140
|
+
})]
|
|
141
|
+
})]
|
|
142
|
+
})] });
|
|
143
|
+
});
|
|
144
|
+
SheetContent.displayName = _radix_ui_react_dialog.Content.displayName;
|
|
145
|
+
function SheetHeader({ className, ...props }) {
|
|
146
|
+
return (0, react_jsx_runtime.jsx)("div", {
|
|
147
|
+
className: require_use_theme.cn("flex flex-col space-y-2 text-center sm:text-left", className),
|
|
148
|
+
...props
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
SheetHeader.displayName = "SheetHeader";
|
|
152
|
+
function SheetFooter({ className, ...props }) {
|
|
153
|
+
return (0, react_jsx_runtime.jsx)("div", {
|
|
154
|
+
className: require_use_theme.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
155
|
+
...props
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
SheetFooter.displayName = "SheetFooter";
|
|
159
|
+
const SheetTitle = react.forwardRef(({ className, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Title, {
|
|
160
|
+
ref,
|
|
161
|
+
className: require_use_theme.cn("text-lg font-semibold text-foreground", className),
|
|
162
|
+
...props
|
|
163
|
+
}));
|
|
164
|
+
SheetTitle.displayName = _radix_ui_react_dialog.Title.displayName;
|
|
165
|
+
const SheetDescription = react.forwardRef(({ className, ...props }, ref) => (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Description, {
|
|
166
|
+
ref,
|
|
167
|
+
className: require_use_theme.cn("text-sm text-muted-foreground", className),
|
|
168
|
+
...props
|
|
169
|
+
}));
|
|
170
|
+
SheetDescription.displayName = _radix_ui_react_dialog.Description.displayName;
|
|
171
|
+
//#endregion
|
|
106
172
|
//#region src/primitives/tooltip.tsx
|
|
107
173
|
const TooltipProvider = _radix_ui_react_tooltip.Provider;
|
|
108
174
|
const Tooltip = _radix_ui_react_tooltip.Root;
|
|
@@ -259,6 +325,162 @@ function Icon({ name, className }) {
|
|
|
259
325
|
});
|
|
260
326
|
}
|
|
261
327
|
//#endregion
|
|
328
|
+
//#region src/ui-presentations/shell.tsx
|
|
329
|
+
const OwnTitleContext = (0, react.createContext)(false);
|
|
330
|
+
function focusOwnHeading(event) {
|
|
331
|
+
const container = event.currentTarget;
|
|
332
|
+
if (!(container instanceof HTMLElement)) return;
|
|
333
|
+
const heading = container.querySelector("[data-buro-overlay-heading]");
|
|
334
|
+
if (!(heading instanceof HTMLElement)) return;
|
|
335
|
+
event.preventDefault();
|
|
336
|
+
heading.focus();
|
|
337
|
+
}
|
|
338
|
+
function WrappedDialogContent({ wrapper, copy, children }) {
|
|
339
|
+
return wrapper ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)(require_dialog.DialogHeader, { children: [(0, react_jsx_runtime.jsx)(require_dialog.DialogTitle, { children: copy.title }), (0, react_jsx_runtime.jsx)(require_dialog.DialogDescription, {
|
|
340
|
+
className: copy.description === void 0 ? "sr-only" : void 0,
|
|
341
|
+
children: copy.description ?? ""
|
|
342
|
+
})] }), children] }) : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
343
|
+
(0, react_jsx_runtime.jsx)(require_dialog.DialogTitle, {
|
|
344
|
+
className: "sr-only",
|
|
345
|
+
children: copy.title
|
|
346
|
+
}),
|
|
347
|
+
(0, react_jsx_runtime.jsx)(require_dialog.DialogDescription, {
|
|
348
|
+
className: "sr-only",
|
|
349
|
+
children: copy.description ?? ""
|
|
350
|
+
}),
|
|
351
|
+
children
|
|
352
|
+
] });
|
|
353
|
+
}
|
|
354
|
+
function WrappedSheetContent({ wrapper, copy, children }) {
|
|
355
|
+
return wrapper ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)(SheetHeader, { children: [(0, react_jsx_runtime.jsx)(SheetTitle, { children: copy.title }), (0, react_jsx_runtime.jsx)(SheetDescription, {
|
|
356
|
+
className: copy.description === void 0 ? "sr-only" : void 0,
|
|
357
|
+
children: copy.description ?? ""
|
|
358
|
+
})] }), children] }) : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
359
|
+
(0, react_jsx_runtime.jsx)(SheetTitle, {
|
|
360
|
+
className: "sr-only",
|
|
361
|
+
children: copy.title
|
|
362
|
+
}),
|
|
363
|
+
(0, react_jsx_runtime.jsx)(SheetDescription, {
|
|
364
|
+
className: "sr-only",
|
|
365
|
+
children: copy.description ?? ""
|
|
366
|
+
}),
|
|
367
|
+
children
|
|
368
|
+
] });
|
|
369
|
+
}
|
|
370
|
+
function useFocusRestoration() {
|
|
371
|
+
const returnFocus = (0, react.useRef)(typeof document === "undefined" || !(document.activeElement instanceof HTMLElement) ? null : document.activeElement);
|
|
372
|
+
(0, react.useEffect)(() => () => {
|
|
373
|
+
const element = returnFocus.current;
|
|
374
|
+
queueMicrotask(() => {
|
|
375
|
+
if (element?.isConnected && element !== document.body) {
|
|
376
|
+
element.focus();
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const main = document.querySelector("main");
|
|
380
|
+
if (main === null) return;
|
|
381
|
+
if (!main.hasAttribute("tabindex")) main.setAttribute("tabindex", "-1");
|
|
382
|
+
main.focus();
|
|
383
|
+
});
|
|
384
|
+
}, []);
|
|
385
|
+
}
|
|
386
|
+
function keepForPopover(event) {
|
|
387
|
+
const target = event.target;
|
|
388
|
+
if (target instanceof Element && target.closest("[data-buro-popover]") !== null) event.preventDefault();
|
|
389
|
+
}
|
|
390
|
+
const REDUCED_MOTION = "motion-reduce:animate-none motion-reduce:transition-none";
|
|
391
|
+
function DialogPresentationShell({ dismiss, wrapper, copy, ownTitle = false, children }) {
|
|
392
|
+
useFocusRestoration();
|
|
393
|
+
return (0, react_jsx_runtime.jsx)(require_dialog.Dialog, {
|
|
394
|
+
open: true,
|
|
395
|
+
onOpenChange: (open) => {
|
|
396
|
+
if (!open) dismiss();
|
|
397
|
+
},
|
|
398
|
+
children: ownTitle ? (0, react_jsx_runtime.jsx)(require_dialog.DialogContent, {
|
|
399
|
+
className: `flex max-h-[85vh] flex-col ${REDUCED_MOTION}`,
|
|
400
|
+
overlayClassName: REDUCED_MOTION,
|
|
401
|
+
showClose: wrapper,
|
|
402
|
+
"aria-describedby": void 0,
|
|
403
|
+
"aria-modal": "true",
|
|
404
|
+
onOpenAutoFocus: focusOwnHeading,
|
|
405
|
+
onPointerDownOutside: keepForPopover,
|
|
406
|
+
children: (0, react_jsx_runtime.jsx)(OwnTitleContext.Provider, {
|
|
407
|
+
value: true,
|
|
408
|
+
children
|
|
409
|
+
})
|
|
410
|
+
}) : (0, react_jsx_runtime.jsx)(require_dialog.DialogContent, {
|
|
411
|
+
className: REDUCED_MOTION,
|
|
412
|
+
overlayClassName: REDUCED_MOTION,
|
|
413
|
+
showClose: wrapper,
|
|
414
|
+
"aria-modal": "true",
|
|
415
|
+
onPointerDownOutside: keepForPopover,
|
|
416
|
+
children: (0, react_jsx_runtime.jsx)(WrappedDialogContent, {
|
|
417
|
+
wrapper,
|
|
418
|
+
copy,
|
|
419
|
+
children
|
|
420
|
+
})
|
|
421
|
+
})
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function SheetPresentationShell({ dismiss, wrapper, copy, ownTitle = false, children }) {
|
|
425
|
+
useFocusRestoration();
|
|
426
|
+
return (0, react_jsx_runtime.jsx)(Sheet, {
|
|
427
|
+
open: true,
|
|
428
|
+
onOpenChange: (open) => {
|
|
429
|
+
if (!open) dismiss();
|
|
430
|
+
},
|
|
431
|
+
children: ownTitle ? (0, react_jsx_runtime.jsx)(SheetContent, {
|
|
432
|
+
side: "right",
|
|
433
|
+
className: `flex flex-col sm:max-w-xl ${REDUCED_MOTION}`,
|
|
434
|
+
showClose: wrapper,
|
|
435
|
+
"aria-describedby": void 0,
|
|
436
|
+
"aria-modal": "true",
|
|
437
|
+
onOpenAutoFocus: focusOwnHeading,
|
|
438
|
+
onPointerDownOutside: keepForPopover,
|
|
439
|
+
children: (0, react_jsx_runtime.jsx)(OwnTitleContext.Provider, {
|
|
440
|
+
value: true,
|
|
441
|
+
children
|
|
442
|
+
})
|
|
443
|
+
}) : (0, react_jsx_runtime.jsx)(SheetContent, {
|
|
444
|
+
side: "right",
|
|
445
|
+
className: `sm:max-w-xl ${REDUCED_MOTION}`,
|
|
446
|
+
showClose: wrapper,
|
|
447
|
+
"aria-modal": "true",
|
|
448
|
+
onPointerDownOutside: keepForPopover,
|
|
449
|
+
children: (0, react_jsx_runtime.jsx)(WrappedSheetContent, {
|
|
450
|
+
wrapper,
|
|
451
|
+
copy,
|
|
452
|
+
children
|
|
453
|
+
})
|
|
454
|
+
})
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/flows/overlay-heading.tsx
|
|
459
|
+
function useFocusOnMount(ref) {
|
|
460
|
+
(0, react.useEffect)(() => {
|
|
461
|
+
const heading = ref.current;
|
|
462
|
+
if (heading === null) return;
|
|
463
|
+
const active = document.activeElement;
|
|
464
|
+
if (active === document.body || active === heading.closest("[role=\"dialog\"]")) heading.focus();
|
|
465
|
+
}, [ref]);
|
|
466
|
+
}
|
|
467
|
+
function OwnTitleHeading({ label }) {
|
|
468
|
+
const ownTitle = (0, react.useContext)(OwnTitleContext);
|
|
469
|
+
const ref = (0, react.useRef)(null);
|
|
470
|
+
useFocusOnMount(ref);
|
|
471
|
+
const heading = (0, react_jsx_runtime.jsx)("h2", {
|
|
472
|
+
ref,
|
|
473
|
+
tabIndex: -1,
|
|
474
|
+
"data-buro-overlay-heading": "",
|
|
475
|
+
className: "text-lg font-semibold",
|
|
476
|
+
children: label
|
|
477
|
+
});
|
|
478
|
+
return ownTitle ? (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Title, {
|
|
479
|
+
asChild: true,
|
|
480
|
+
children: heading
|
|
481
|
+
}) : heading;
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
262
484
|
//#region src/flows/load-runtime.tsx
|
|
263
485
|
function retrying(importer) {
|
|
264
486
|
let loading;
|
|
@@ -270,11 +492,11 @@ function retrying(importer) {
|
|
|
270
492
|
return loading;
|
|
271
493
|
};
|
|
272
494
|
}
|
|
273
|
-
const loadFlowRuntime = retrying(() => Promise.resolve().then(() => require("./flow-runtime-
|
|
274
|
-
const loadFlowScreen = retrying(() => Promise.resolve().then(() => require("./flow-screen-
|
|
275
|
-
const loadPageFlowRoute = retrying(() => Promise.resolve().then(() => require("./page-flow-route-
|
|
276
|
-
const loadInlineFlowHost = retrying(() => Promise.resolve().then(() => require("./inline-flow-host-
|
|
277
|
-
const loadBulkSummary = retrying(() => Promise.resolve().then(() => require("./bulk-summary-
|
|
495
|
+
const loadFlowRuntime = retrying(() => Promise.resolve().then(() => require("./flow-runtime-BpmrIUb6.cjs")));
|
|
496
|
+
const loadFlowScreen = retrying(() => Promise.resolve().then(() => require("./flow-screen-Bcz9NF2V.cjs")));
|
|
497
|
+
const loadPageFlowRoute = retrying(() => Promise.resolve().then(() => require("./page-flow-route-DS8IVTVH.cjs")));
|
|
498
|
+
const loadInlineFlowHost = retrying(() => Promise.resolve().then(() => require("./inline-flow-host-3vw7LzzD.cjs")));
|
|
499
|
+
const loadBulkSummary = retrying(() => Promise.resolve().then(() => require("./bulk-summary-CrEij5vq.cjs")));
|
|
278
500
|
function preloadFlowRuntime() {
|
|
279
501
|
loadFlowRuntime().catch(() => void 0);
|
|
280
502
|
}
|
|
@@ -315,8 +537,7 @@ var FlowBoundary = class extends react.Component {
|
|
|
315
537
|
}
|
|
316
538
|
};
|
|
317
539
|
function loadFailedText(t) {
|
|
318
|
-
|
|
319
|
-
return value === "block.failed" ? "This section could not be loaded." : value;
|
|
540
|
+
return t("block.failed", { defaultValue: "This section could not be loaded." });
|
|
320
541
|
}
|
|
321
542
|
function FailedRun({ onDone }) {
|
|
322
543
|
const t = (0, _burojs_react.useOptionalT)();
|
|
@@ -357,31 +578,45 @@ function RuntimeBulkFlowRunner(props) {
|
|
|
357
578
|
children: (0, react_jsx_runtime.jsx)(Runner, { ...props })
|
|
358
579
|
});
|
|
359
580
|
}
|
|
360
|
-
function FlowLoadFailed({ onRetry }) {
|
|
581
|
+
function FlowLoadFailed({ label, onRetry }) {
|
|
361
582
|
const t = (0, _burojs_react.useOptionalT)();
|
|
583
|
+
const chromeT = (0, _burojs_react.useChromeT)();
|
|
362
584
|
const instance = (0, _burojs_react.useUIInstance)();
|
|
363
|
-
const retryText =
|
|
364
|
-
const closeText = t("flow.close"
|
|
585
|
+
const retryText = chromeT("actions.retry", { defaultValue: "Retry" });
|
|
586
|
+
const closeText = t("flow.close", { defaultValue: "Close" });
|
|
365
587
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
366
588
|
role: "alert",
|
|
367
589
|
"data-buro-flow-load": "failed",
|
|
368
590
|
className: "flex flex-col gap-3 text-sm",
|
|
369
|
-
children: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
591
|
+
children: [
|
|
592
|
+
label === void 0 ? null : (0, react_jsx_runtime.jsx)(OwnTitleHeading, { label }),
|
|
593
|
+
(0, react_jsx_runtime.jsx)("p", { children: loadFailedText(t) }),
|
|
594
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
595
|
+
className: "flex justify-end gap-2",
|
|
596
|
+
children: [(0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
597
|
+
type: "button",
|
|
598
|
+
variant: "ghost",
|
|
599
|
+
onClick: () => instance.dismiss(),
|
|
600
|
+
children: closeText
|
|
601
|
+
}), (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
602
|
+
type: "button",
|
|
603
|
+
onClick: onRetry,
|
|
604
|
+
children: retryText
|
|
605
|
+
})]
|
|
606
|
+
})
|
|
607
|
+
]
|
|
382
608
|
});
|
|
383
609
|
}
|
|
384
610
|
//#endregion
|
|
611
|
+
//#region src/lib/reason-text.ts
|
|
612
|
+
function reasonText(caps, reason, resource) {
|
|
613
|
+
if (reason === "") return reason;
|
|
614
|
+
return (0, _burojs_core.resolveContentSlot)(caps, [reason], {
|
|
615
|
+
resource,
|
|
616
|
+
default: reason
|
|
617
|
+
}) ?? reason;
|
|
618
|
+
}
|
|
619
|
+
//#endregion
|
|
385
620
|
//#region src/actions/action-inner.tsx
|
|
386
621
|
function ActionInner({ icon, label }) {
|
|
387
622
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [icon ? (0, react_jsx_runtime.jsx)(Icon, { name: icon }) : null, label] });
|
|
@@ -439,10 +674,6 @@ function withActionTooltip(control, label, compact, reason) {
|
|
|
439
674
|
}
|
|
440
675
|
//#endregion
|
|
441
676
|
//#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
677
|
function findDeclared(def, name) {
|
|
447
678
|
const actions = def?.actions ?? {};
|
|
448
679
|
for (const place of [
|
|
@@ -456,15 +687,39 @@ function findDeclared(def, name) {
|
|
|
456
687
|
if (found !== void 0) return found;
|
|
457
688
|
}
|
|
458
689
|
}
|
|
690
|
+
function declaredFlow(app, resource, actionName) {
|
|
691
|
+
try {
|
|
692
|
+
return resource === "" ? app.registry.appActions.get(actionName) : findDeclared(app.registry.get(resource), actionName);
|
|
693
|
+
} catch {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
function useFlowDialogTexts(resource, actionName, labelText) {
|
|
698
|
+
const app = (0, _burojs_react.useApp)();
|
|
699
|
+
const caps = (0, _burojs_react.useI18nCaps)("");
|
|
700
|
+
const texts = declaredFlow(app, resource, actionName)?.texts;
|
|
701
|
+
const prefix = resource === "" ? `appActions.${actionName}` : `resources.${resource}.actions.${actionName}`;
|
|
702
|
+
const own = (path) => {
|
|
703
|
+
const key = `${prefix}.${path.join(".")}`;
|
|
704
|
+
return caps.has(key) ? caps.t(key) : (0, _burojs_core.textsValueAt)(texts, path);
|
|
705
|
+
};
|
|
706
|
+
return {
|
|
707
|
+
confirmTitle: own(["confirm", "title"]) ?? labelText,
|
|
708
|
+
confirmProceed: own(["confirm", "proceed"]) ?? labelText,
|
|
709
|
+
dismiss: own(["dismiss"])
|
|
710
|
+
};
|
|
711
|
+
}
|
|
459
712
|
function useFlowChrome(resource, actionName, children) {
|
|
460
713
|
const app = (0, _burojs_react.useApp)();
|
|
461
714
|
const declared = (resource === "" ? void 0 : findDeclared(app.registry.get(resource), actionName)) ?? {};
|
|
462
715
|
const label = useResolvedLabel(declared, actionName, children, resource);
|
|
716
|
+
const labelText = typeof label === "string" ? label : (0, _burojs_core.humanizeKey)(actionName);
|
|
463
717
|
return {
|
|
464
718
|
label,
|
|
465
|
-
labelText
|
|
719
|
+
labelText,
|
|
466
720
|
icon: resolveActionIcon(declared, actionName),
|
|
467
|
-
destructive: declared.variant === "destructive"
|
|
721
|
+
destructive: declared.variant === "destructive",
|
|
722
|
+
...useFlowDialogTexts(resource, actionName, labelText)
|
|
468
723
|
};
|
|
469
724
|
}
|
|
470
725
|
//#endregion
|
|
@@ -576,14 +831,19 @@ function FlowControl(props) {
|
|
|
576
831
|
testId: `${testid}:info`
|
|
577
832
|
})] });
|
|
578
833
|
}
|
|
579
|
-
function FlowActionButton(
|
|
834
|
+
function FlowActionButton(input) {
|
|
835
|
+
const props = {
|
|
836
|
+
...input,
|
|
837
|
+
resource: (0, _burojs_core.routeResourceKey)(input.resource)
|
|
838
|
+
};
|
|
580
839
|
const { resource, actionName, record, scope = "row", children } = props;
|
|
581
840
|
const control = (0, _burojs_react.useFlowRowResolver)(resource)(actionName, record);
|
|
582
841
|
const chrome = useFlowChrome(resource, actionName, children);
|
|
583
842
|
const tid = (0, _burojs_react.useTestIds)();
|
|
584
|
-
const
|
|
843
|
+
const app = (0, _burojs_react.useApp)();
|
|
844
|
+
const testid = makeTestId(scope, resource, actionName, String((0, _burojs_react.recordKeyOf)(app.registry.get(resource), record) ?? ""), tid);
|
|
585
845
|
const [running, setRunning] = (0, react.useState)(false);
|
|
586
|
-
const runRecord = control.record ?? record;
|
|
846
|
+
const runRecord = useFlowRecord(resource, actionName, control.record ?? record);
|
|
587
847
|
const hosted = useHostedFlow(resource, actionName, runRecord, chrome.labelText);
|
|
588
848
|
const onRun = () => {
|
|
589
849
|
if (running) return;
|
|
@@ -615,6 +875,17 @@ function FlowActionButton(props) {
|
|
|
615
875
|
onClose: () => setRunning(false)
|
|
616
876
|
}) : null] });
|
|
617
877
|
}
|
|
878
|
+
function useFlowRecord(resource, actionName, record) {
|
|
879
|
+
const def = (0, _burojs_react.useApp)().registry.get(resource);
|
|
880
|
+
const compiled = (0, react.useMemo)(() => {
|
|
881
|
+
try {
|
|
882
|
+
return def === void 0 ? null : (0, _burojs_core.compileFlow)(def, actionName);
|
|
883
|
+
} catch {
|
|
884
|
+
return null;
|
|
885
|
+
}
|
|
886
|
+
}, [def, actionName]);
|
|
887
|
+
return compiled === null ? void 0 : (0, _burojs_core.flowRecordOf)(compiled, record);
|
|
888
|
+
}
|
|
618
889
|
function useHostedFlow(resource, actionName, record, label) {
|
|
619
890
|
const app = (0, _burojs_react.useApp)();
|
|
620
891
|
const def = app.registry.get(resource);
|
|
@@ -625,7 +896,7 @@ function useHostedFlow(resource, actionName, record, label) {
|
|
|
625
896
|
return null;
|
|
626
897
|
}
|
|
627
898
|
}, [def, actionName]);
|
|
628
|
-
const title = (0, _burojs_react.useProjectedTitle)(resource, record
|
|
899
|
+
const title = (0, _burojs_react.useProjectedTitle)(resource, (0, _burojs_react.recordKeyOf)(def, record), record);
|
|
629
900
|
const presentFlow = (0, _burojs_react.usePresentFlow)();
|
|
630
901
|
const hasHost = compiled?.hasHost === true;
|
|
631
902
|
const recordId = record?.[compiled?.idField ?? "id"] ?? record?.id;
|
|
@@ -654,8 +925,9 @@ function useHostedFlow(resource, actionName, record, label) {
|
|
|
654
925
|
function FlowMenuItem(props) {
|
|
655
926
|
const chrome = useFlowChrome(props.resource, props.actionName);
|
|
656
927
|
const tid = (0, _burojs_react.useTestIds)();
|
|
657
|
-
const
|
|
658
|
-
const
|
|
928
|
+
const def = (0, _burojs_react.useApp)().registry.get(props.resource);
|
|
929
|
+
const testid = makeTestId(props.scope, props.resource, props.actionName, String((0, _burojs_react.recordKeyOf)(def, props.record) ?? ""), tid);
|
|
930
|
+
const runRecord = useFlowRecord(props.resource, props.actionName, props.control.record ?? props.record);
|
|
659
931
|
const hosted = useHostedFlow(props.resource, props.actionName, runRecord, chrome.labelText);
|
|
660
932
|
return (0, react_jsx_runtime.jsx)(FlowControl, {
|
|
661
933
|
state: (0, _burojs_react.conjoinHostPage)(props.control.state, hosted.hostPage),
|
|
@@ -709,7 +981,7 @@ function listSlot(region, resource) {
|
|
|
709
981
|
return `list.${region}.${canonicalResourceName(resource)}`;
|
|
710
982
|
}
|
|
711
983
|
function useListSlot(region, resource) {
|
|
712
|
-
return (0, _burojs_react.useComponent)(listSlot(region, resource));
|
|
984
|
+
return (0, _burojs_react.useComponent)(listSlot(region, (0, _burojs_core.routeResourceKey)(resource)));
|
|
713
985
|
}
|
|
714
986
|
//#endregion
|
|
715
987
|
//#region src/actions/builtin-edit-route.ts
|
|
@@ -758,12 +1030,10 @@ function useBuiltinEditRoute(action, resource, recordId) {
|
|
|
758
1030
|
}
|
|
759
1031
|
//#endregion
|
|
760
1032
|
//#region src/actions/action-button.tsx
|
|
761
|
-
function DisabledAction({ reason, label, icon, testid, size, variant, className, asMenuItem, resource, density = "regular", actionName, surface }) {
|
|
1033
|
+
function DisabledAction({ reason, label, icon, testid, size, variant, className, asMenuItem, resource: resourceInput, density = "regular", actionName, surface }) {
|
|
1034
|
+
const resource = resourceInput === void 0 ? void 0 : (0, _burojs_core.routeResourceKey)(resourceInput);
|
|
762
1035
|
const i18nCaps = (0, _burojs_react.useI18nCaps)(resource);
|
|
763
|
-
const text = reason ? (0, _burojs_core.resolveContentSlot)(i18nCaps, [
|
|
764
|
-
resource,
|
|
765
|
-
default: reason
|
|
766
|
-
}) : (0, _burojs_core.resolveContentSlot)(i18nCaps, ["availability.denied"], {
|
|
1036
|
+
const text = reason ? reasonText(i18nCaps, reason, resource) : (0, _burojs_core.resolveContentSlot)(i18nCaps, ["availability.denied"], {
|
|
767
1037
|
resource,
|
|
768
1038
|
default: "This action isn't available"
|
|
769
1039
|
});
|
|
@@ -772,15 +1042,24 @@ function DisabledAction({ reason, label, icon, testid, size, variant, className,
|
|
|
772
1042
|
e.stopPropagation();
|
|
773
1043
|
(0, sonner.toast)(text);
|
|
774
1044
|
};
|
|
1045
|
+
const reasonId = (0, react.useId)();
|
|
775
1046
|
if (asMenuItem) return (0, react_jsx_runtime.jsx)(DropdownMenuItem, {
|
|
776
1047
|
"aria-disabled": "true",
|
|
1048
|
+
"aria-describedby": reasonId,
|
|
777
1049
|
"data-testid": testid,
|
|
778
1050
|
onSelect: (e) => e.preventDefault(),
|
|
779
1051
|
onClick,
|
|
780
1052
|
className: "opacity-60",
|
|
781
1053
|
children: (0, react_jsx_runtime.jsx)(ActionInner, {
|
|
782
1054
|
icon,
|
|
783
|
-
label
|
|
1055
|
+
label: (0, react_jsx_runtime.jsxs)("span", {
|
|
1056
|
+
className: "flex min-w-0 flex-col",
|
|
1057
|
+
children: [(0, react_jsx_runtime.jsx)("span", { children: label }), (0, react_jsx_runtime.jsx)("span", {
|
|
1058
|
+
id: reasonId,
|
|
1059
|
+
className: "text-xs text-muted-foreground",
|
|
1060
|
+
children: text
|
|
1061
|
+
})]
|
|
1062
|
+
})
|
|
784
1063
|
})
|
|
785
1064
|
});
|
|
786
1065
|
const chrome = resolveControlChrome({
|
|
@@ -824,11 +1103,12 @@ function useResolvedLabel(action, actionName, children, resource) {
|
|
|
824
1103
|
if (children != null) return children;
|
|
825
1104
|
const raw = `actions.${actionName}`;
|
|
826
1105
|
const own = `resources.${resource}.${raw}`;
|
|
827
|
-
|
|
828
|
-
if (
|
|
829
|
-
|
|
830
|
-
if (
|
|
831
|
-
|
|
1106
|
+
const ownLabel = (0, _burojs_core.resolveContentSlot)(caps, [[`${own}.label`, own]]);
|
|
1107
|
+
if (ownLabel !== void 0) return ownLabel;
|
|
1108
|
+
const declared = (0, _burojs_core.declaredText)(action.kind === "flow" ? "flow" : "action", action, "label");
|
|
1109
|
+
if (declared !== void 0) return declared;
|
|
1110
|
+
const sharedLabel = (0, _burojs_core.resolveContentSlot)(caps, [[`${raw}.label`, raw]]);
|
|
1111
|
+
if (sharedLabel !== void 0) return sharedLabel;
|
|
832
1112
|
const camel = `actions.${camelizeActionName(actionName)}`;
|
|
833
1113
|
if (caps.has(camel)) return caps.t(camel);
|
|
834
1114
|
return (0, _burojs_core.humanizeKey)(actionName);
|
|
@@ -843,36 +1123,41 @@ function actionResourceHandle(resource) {
|
|
|
843
1123
|
ref: (0, _burojs_core.normalizeEntityRef)(resource)
|
|
844
1124
|
};
|
|
845
1125
|
}
|
|
846
|
-
function ActionButton(
|
|
1126
|
+
function ActionButton(input) {
|
|
1127
|
+
const { sources, ...rest } = input;
|
|
1128
|
+
const props = {
|
|
1129
|
+
...rest,
|
|
1130
|
+
resource: (0, _burojs_core.routeResourceKey)(input.resource)
|
|
1131
|
+
};
|
|
847
1132
|
const def = (0, _burojs_react.useApp)().registry.get(props.resource);
|
|
848
1133
|
const scope = props.scope ?? "row";
|
|
849
|
-
const
|
|
850
|
-
const
|
|
1134
|
+
const resolveAvailability = (0, _burojs_react.useAvailabilityResolver)(props.resource, (0, _burojs_react.modeForSurface)(scope));
|
|
1135
|
+
const itemAction = findAction(def?.actions?.item, props.actionName);
|
|
1136
|
+
const action = itemAction ?? findAction(def?.actions?.resource, props.actionName);
|
|
1137
|
+
const record = itemAction === void 0 ? void 0 : props.record;
|
|
1138
|
+
const availability = resolveAvailability(props.actionName, record);
|
|
1139
|
+
const whenSources = (0, _burojs_react.useActionWhenSources)({
|
|
1140
|
+
resource: props.resource,
|
|
1141
|
+
record
|
|
1142
|
+
});
|
|
851
1143
|
if (!action) return null;
|
|
852
1144
|
if ((0, _burojs_core_internal.isFlowAction)(action)) return (0, react_jsx_runtime.jsx)(FlowActionButton, { ...props });
|
|
853
1145
|
if (availability.state === "absent" || availability.state === "hidden") return null;
|
|
854
|
-
if (!actionWhenHolds(action,
|
|
1146
|
+
if (!(0, _burojs_core_internal.actionWhenHolds)(action, (0, _burojs_core_internal.actionWhenSources)(whenSources, sources))) return null;
|
|
855
1147
|
if (action.kind === "link") return (0, react_jsx_runtime.jsx)(LinkActionButton, {
|
|
856
1148
|
...props,
|
|
1149
|
+
record,
|
|
857
1150
|
action,
|
|
858
1151
|
availability
|
|
859
1152
|
});
|
|
860
1153
|
if (action.kind === "modal") return (0, react_jsx_runtime.jsx)(ModalActionButton, {
|
|
861
1154
|
...props,
|
|
1155
|
+
record,
|
|
862
1156
|
action,
|
|
863
1157
|
availability
|
|
864
1158
|
});
|
|
865
1159
|
return null;
|
|
866
1160
|
}
|
|
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
1161
|
function presentModalAction(args) {
|
|
877
1162
|
const { present, action, resource, actionName, record, recordId, label } = args;
|
|
878
1163
|
const result = present({
|
|
@@ -900,17 +1185,20 @@ const reportedDeadRoutes = new Set();
|
|
|
900
1185
|
function deadRecordRoute(registry, action, to) {
|
|
901
1186
|
if ((0, _burojs_core.isBuiltinItemAction)(action) || to === null || typeof to !== "object") return null;
|
|
902
1187
|
const target = to;
|
|
903
|
-
if (typeof target.resource !== "string") return null;
|
|
904
1188
|
if (target.action !== "show" && target.action !== "edit" && target.action !== "create") return null;
|
|
1189
|
+
let resource;
|
|
905
1190
|
let def;
|
|
906
1191
|
try {
|
|
907
|
-
|
|
1192
|
+
if (typeof target.resource === "string") resource = target.resource;
|
|
1193
|
+
else if (target.resource !== null && typeof target.resource === "object") resource = (0, _burojs_core.routeResourceKey)(target.resource);
|
|
1194
|
+
else return null;
|
|
1195
|
+
def = registry.get(resource);
|
|
908
1196
|
} catch {
|
|
909
1197
|
return null;
|
|
910
1198
|
}
|
|
911
1199
|
if (def === void 0 || (0, _burojs_core.hasRecordPage)(def, target.action)) return null;
|
|
912
1200
|
return {
|
|
913
|
-
resource
|
|
1201
|
+
resource,
|
|
914
1202
|
action: target.action
|
|
915
1203
|
};
|
|
916
1204
|
}
|
|
@@ -928,7 +1216,7 @@ function LinkActionButton({ resource, actionName, record, scope = "row", variant
|
|
|
928
1216
|
const safeRecord = record ?? { id: "" };
|
|
929
1217
|
const isDestructive = action.variant === "destructive";
|
|
930
1218
|
const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
|
|
931
|
-
const recordId = record
|
|
1219
|
+
const recordId = String((0, _burojs_react.recordKeyOf)(app.registry.get(resource), record) ?? "");
|
|
932
1220
|
const testid = makeTestId(scope, resource, actionName, recordId, tid);
|
|
933
1221
|
const label = useResolvedLabel(action, actionName, children, resource);
|
|
934
1222
|
const editRoute = useBuiltinEditRoute(action, resource, recordId);
|
|
@@ -1034,11 +1322,12 @@ function LinkActionButton({ resource, actionName, record, scope = "row", variant
|
|
|
1034
1322
|
}
|
|
1035
1323
|
function ModalActionButton({ resource, actionName, record, scope = "row", variant, size, density, className, children, asMenuItem, action, availability }) {
|
|
1036
1324
|
const tid = (0, _burojs_react.useTestIds)();
|
|
1325
|
+
const app = (0, _burojs_react.useApp)();
|
|
1037
1326
|
const present = (0, _burojs_react.usePresentBlock)();
|
|
1038
1327
|
const safeRecord = record ?? { id: "" };
|
|
1039
1328
|
const isDestructive = action.variant === "destructive";
|
|
1040
1329
|
const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
|
|
1041
|
-
const recordId = record
|
|
1330
|
+
const recordId = String((0, _burojs_react.recordKeyOf)(app.registry.get(resource), record) ?? "");
|
|
1042
1331
|
const testid = makeTestId(scope, resource, actionName, recordId, tid);
|
|
1043
1332
|
const label = useResolvedLabel(action, actionName, children, resource);
|
|
1044
1333
|
if (availability.state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
|
|
@@ -1098,21 +1387,34 @@ function ModalActionButton({ resource, actionName, record, scope = "row", varian
|
|
|
1098
1387
|
}
|
|
1099
1388
|
//#endregion
|
|
1100
1389
|
//#region src/checks/check-confirm-dialog.tsx
|
|
1101
|
-
function
|
|
1102
|
-
const
|
|
1390
|
+
function issueText(issue, t, caps, resource) {
|
|
1391
|
+
const params = issue.message.params;
|
|
1392
|
+
const checkId = issue.check?.id;
|
|
1393
|
+
const ownCheck = checkId !== void 0 && issue.message.key === `checks.${checkId}`;
|
|
1394
|
+
const declared = typeof issue.message.default === "string" ? issue.message.default : ownCheck ? void 0 : issue.message.key;
|
|
1395
|
+
if (issue.message.params?.resolved === true) return declared ?? issue.message.key;
|
|
1396
|
+
if (!ownCheck) return t(issue.message.key, {
|
|
1397
|
+
defaultValue: declared ?? "",
|
|
1103
1398
|
params,
|
|
1104
1399
|
...resource === void 0 ? {} : { resource }
|
|
1105
1400
|
});
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1401
|
+
const entryKey = [`${issue.message.key}.message`, issue.message.key].find((key) => caps.has(key, { resource }));
|
|
1402
|
+
if (entryKey !== void 0) return caps.t(entryKey, {
|
|
1403
|
+
resource,
|
|
1404
|
+
params
|
|
1405
|
+
});
|
|
1406
|
+
if (declared !== void 0) return declared;
|
|
1407
|
+
const name = String(params?.name ?? checkId);
|
|
1408
|
+
return t(_burojs_core.FRAMEWORK_TEXT_KEYS.checkFailed, {
|
|
1409
|
+
defaultValue: (0, _burojs_core.checkFailedDefault)(name),
|
|
1410
|
+
params: {
|
|
1411
|
+
...params,
|
|
1412
|
+
name
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1112
1415
|
}
|
|
1113
1416
|
function checkIdOf(issue, index) {
|
|
1114
|
-
|
|
1115
|
-
return typeof id === "string" ? id : `${index}`;
|
|
1417
|
+
return issue.check?.id ?? `${index}`;
|
|
1116
1418
|
}
|
|
1117
1419
|
const SEVERITY_CLASSNAME = {
|
|
1118
1420
|
error: "text-destructive",
|
|
@@ -1121,11 +1423,12 @@ const SEVERITY_CLASSNAME = {
|
|
|
1121
1423
|
};
|
|
1122
1424
|
function ChecksList({ issues, testid, onRowClick, resource }) {
|
|
1123
1425
|
const t = (0, _burojs_react.useOptionalT)();
|
|
1426
|
+
const caps = (0, _burojs_react.useI18nCaps)(resource);
|
|
1124
1427
|
return issues.map((issue, index) => {
|
|
1125
1428
|
const checkId = checkIdOf(issue, index);
|
|
1126
1429
|
const anchor = issue.path[0];
|
|
1127
1430
|
const anchorable = typeof anchor === "string";
|
|
1128
|
-
const text = issueText(issue, t, resource);
|
|
1431
|
+
const text = issueText(issue, t, caps, resource);
|
|
1129
1432
|
const className = require_use_theme.cn("text-sm", SEVERITY_CLASSNAME[issue.severity]);
|
|
1130
1433
|
return anchorable ? (0, react_jsx_runtime.jsx)("li", { children: (0, react_jsx_runtime.jsx)("button", {
|
|
1131
1434
|
type: "button",
|
|
@@ -1140,15 +1443,11 @@ function ChecksList({ issues, testid, onRowClick, resource }) {
|
|
|
1140
1443
|
}, `${checkId}-${index}`);
|
|
1141
1444
|
});
|
|
1142
1445
|
}
|
|
1143
|
-
function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel, tone }) {
|
|
1144
|
-
const
|
|
1446
|
+
function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel, cancelLabel, tone }) {
|
|
1447
|
+
const chromeT = (0, _burojs_react.useChromeT)();
|
|
1145
1448
|
const { resource, open, busy, header, blockers, confirmable, proceed, cancel } = state;
|
|
1146
1449
|
const blocked = blockers.length > 0;
|
|
1147
|
-
const
|
|
1148
|
-
const heading = title ?? t("checks.dialogTitle", {
|
|
1149
|
-
defaultValue: "Please review",
|
|
1150
|
-
...bound
|
|
1151
|
-
});
|
|
1450
|
+
const heading = title ?? chromeT("checks.dialogTitle", { defaultValue: "Please review" });
|
|
1152
1451
|
const restoreFocusRef = (0, react.useRef)(null);
|
|
1153
1452
|
(0, react.useEffect)(() => {
|
|
1154
1453
|
if (typeof document === "undefined") return;
|
|
@@ -1185,10 +1484,7 @@ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel,
|
|
|
1185
1484
|
children: [
|
|
1186
1485
|
blocked && (0, react_jsx_runtime.jsx)("li", {
|
|
1187
1486
|
className: "text-xs font-semibold uppercase tracking-wider text-destructive",
|
|
1188
|
-
children:
|
|
1189
|
-
defaultValue: "Cannot continue",
|
|
1190
|
-
...bound
|
|
1191
|
-
})
|
|
1487
|
+
children: chromeT("checks.blocked", { defaultValue: "Cannot continue" })
|
|
1192
1488
|
}),
|
|
1193
1489
|
(0, react_jsx_runtime.jsx)(ChecksList, {
|
|
1194
1490
|
issues: blockers,
|
|
@@ -1210,20 +1506,14 @@ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel,
|
|
|
1210
1506
|
onClick: cancel,
|
|
1211
1507
|
"data-testid": `${testid}:cancel`,
|
|
1212
1508
|
disabled: busy,
|
|
1213
|
-
children:
|
|
1214
|
-
defaultValue: "Go back",
|
|
1215
|
-
...bound
|
|
1216
|
-
})
|
|
1509
|
+
children: cancelLabel ?? chromeT("checks.back", { defaultValue: "Go back" })
|
|
1217
1510
|
}), !blocked && (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
1218
1511
|
type: "button",
|
|
1219
1512
|
variant: tone === "destructive" ? "destructive" : "default",
|
|
1220
1513
|
onClick: proceed,
|
|
1221
1514
|
"data-testid": `${testid}:proceed`,
|
|
1222
1515
|
disabled: busy,
|
|
1223
|
-
children: proceedLabel ??
|
|
1224
|
-
defaultValue: "Continue anyway",
|
|
1225
|
-
...bound
|
|
1226
|
-
})
|
|
1516
|
+
children: proceedLabel ?? chromeT("checks.proceed", { defaultValue: "Continue anyway" })
|
|
1227
1517
|
})] })
|
|
1228
1518
|
]
|
|
1229
1519
|
})
|
|
@@ -1248,6 +1538,12 @@ Object.defineProperty(exports, "CheckConfirmDialog", {
|
|
|
1248
1538
|
return CheckConfirmDialog;
|
|
1249
1539
|
}
|
|
1250
1540
|
});
|
|
1541
|
+
Object.defineProperty(exports, "DialogPresentationShell", {
|
|
1542
|
+
enumerable: true,
|
|
1543
|
+
get: function() {
|
|
1544
|
+
return DialogPresentationShell;
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1251
1547
|
Object.defineProperty(exports, "DisabledAction", {
|
|
1252
1548
|
enumerable: true,
|
|
1253
1549
|
get: function() {
|
|
@@ -1380,6 +1676,18 @@ Object.defineProperty(exports, "Icon", {
|
|
|
1380
1676
|
return Icon;
|
|
1381
1677
|
}
|
|
1382
1678
|
});
|
|
1679
|
+
Object.defineProperty(exports, "OwnTitleContext", {
|
|
1680
|
+
enumerable: true,
|
|
1681
|
+
get: function() {
|
|
1682
|
+
return OwnTitleContext;
|
|
1683
|
+
}
|
|
1684
|
+
});
|
|
1685
|
+
Object.defineProperty(exports, "OwnTitleHeading", {
|
|
1686
|
+
enumerable: true,
|
|
1687
|
+
get: function() {
|
|
1688
|
+
return OwnTitleHeading;
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1383
1691
|
Object.defineProperty(exports, "RuntimeAppFlowRunner", {
|
|
1384
1692
|
enumerable: true,
|
|
1385
1693
|
get: function() {
|
|
@@ -1398,6 +1706,60 @@ Object.defineProperty(exports, "RuntimeFlowRunner", {
|
|
|
1398
1706
|
return RuntimeFlowRunner;
|
|
1399
1707
|
}
|
|
1400
1708
|
});
|
|
1709
|
+
Object.defineProperty(exports, "Sheet", {
|
|
1710
|
+
enumerable: true,
|
|
1711
|
+
get: function() {
|
|
1712
|
+
return Sheet;
|
|
1713
|
+
}
|
|
1714
|
+
});
|
|
1715
|
+
Object.defineProperty(exports, "SheetClose", {
|
|
1716
|
+
enumerable: true,
|
|
1717
|
+
get: function() {
|
|
1718
|
+
return SheetClose;
|
|
1719
|
+
}
|
|
1720
|
+
});
|
|
1721
|
+
Object.defineProperty(exports, "SheetContent", {
|
|
1722
|
+
enumerable: true,
|
|
1723
|
+
get: function() {
|
|
1724
|
+
return SheetContent;
|
|
1725
|
+
}
|
|
1726
|
+
});
|
|
1727
|
+
Object.defineProperty(exports, "SheetDescription", {
|
|
1728
|
+
enumerable: true,
|
|
1729
|
+
get: function() {
|
|
1730
|
+
return SheetDescription;
|
|
1731
|
+
}
|
|
1732
|
+
});
|
|
1733
|
+
Object.defineProperty(exports, "SheetFooter", {
|
|
1734
|
+
enumerable: true,
|
|
1735
|
+
get: function() {
|
|
1736
|
+
return SheetFooter;
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
Object.defineProperty(exports, "SheetHeader", {
|
|
1740
|
+
enumerable: true,
|
|
1741
|
+
get: function() {
|
|
1742
|
+
return SheetHeader;
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1745
|
+
Object.defineProperty(exports, "SheetPresentationShell", {
|
|
1746
|
+
enumerable: true,
|
|
1747
|
+
get: function() {
|
|
1748
|
+
return SheetPresentationShell;
|
|
1749
|
+
}
|
|
1750
|
+
});
|
|
1751
|
+
Object.defineProperty(exports, "SheetTitle", {
|
|
1752
|
+
enumerable: true,
|
|
1753
|
+
get: function() {
|
|
1754
|
+
return SheetTitle;
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1757
|
+
Object.defineProperty(exports, "SheetTrigger", {
|
|
1758
|
+
enumerable: true,
|
|
1759
|
+
get: function() {
|
|
1760
|
+
return SheetTrigger;
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1401
1763
|
Object.defineProperty(exports, "Tooltip", {
|
|
1402
1764
|
enumerable: true,
|
|
1403
1765
|
get: function() {
|
|
@@ -1494,16 +1856,16 @@ Object.defineProperty(exports, "preloadFlowRuntime", {
|
|
|
1494
1856
|
return preloadFlowRuntime;
|
|
1495
1857
|
}
|
|
1496
1858
|
});
|
|
1497
|
-
Object.defineProperty(exports, "
|
|
1859
|
+
Object.defineProperty(exports, "reasonText", {
|
|
1498
1860
|
enumerable: true,
|
|
1499
1861
|
get: function() {
|
|
1500
|
-
return
|
|
1862
|
+
return reasonText;
|
|
1501
1863
|
}
|
|
1502
1864
|
});
|
|
1503
|
-
Object.defineProperty(exports, "
|
|
1865
|
+
Object.defineProperty(exports, "registerIcons", {
|
|
1504
1866
|
enumerable: true,
|
|
1505
1867
|
get: function() {
|
|
1506
|
-
return
|
|
1868
|
+
return registerIcons;
|
|
1507
1869
|
}
|
|
1508
1870
|
});
|
|
1509
1871
|
Object.defineProperty(exports, "useFlowChrome", {
|
|
@@ -1512,6 +1874,18 @@ Object.defineProperty(exports, "useFlowChrome", {
|
|
|
1512
1874
|
return useFlowChrome;
|
|
1513
1875
|
}
|
|
1514
1876
|
});
|
|
1877
|
+
Object.defineProperty(exports, "useFlowDialogTexts", {
|
|
1878
|
+
enumerable: true,
|
|
1879
|
+
get: function() {
|
|
1880
|
+
return useFlowDialogTexts;
|
|
1881
|
+
}
|
|
1882
|
+
});
|
|
1883
|
+
Object.defineProperty(exports, "useFocusOnMount", {
|
|
1884
|
+
enumerable: true,
|
|
1885
|
+
get: function() {
|
|
1886
|
+
return useFocusOnMount;
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1515
1889
|
Object.defineProperty(exports, "useListSlot", {
|
|
1516
1890
|
enumerable: true,
|
|
1517
1891
|
get: function() {
|
|
@@ -1531,4 +1905,4 @@ Object.defineProperty(exports, "useToBrowserHref", {
|
|
|
1531
1905
|
}
|
|
1532
1906
|
});
|
|
1533
1907
|
|
|
1534
|
-
//# sourceMappingURL=check-confirm-dialog-
|
|
1908
|
+
//# sourceMappingURL=check-confirm-dialog-C-NHgMST.cjs.map
|