@burojs/ui-shadcn 0.6.0 → 0.8.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-2HLgz7Il.cjs +169 -0
- package/dist/bulk-summary-2HLgz7Il.cjs.map +1 -0
- package/dist/bulk-summary-D6A0ua21.js +169 -0
- package/dist/bulk-summary-D6A0ua21.js.map +1 -0
- package/dist/{candidates-relation-picker-Cy0rTxvI.cjs → candidates-relation-picker-C47mF260.cjs} +4 -4
- package/dist/{candidates-relation-picker-Cy0rTxvI.cjs.map → candidates-relation-picker-C47mF260.cjs.map} +1 -1
- package/dist/{candidates-relation-picker-B116Bmqi.js → candidates-relation-picker-CGXItMN0.js} +3 -3
- package/dist/{candidates-relation-picker-B116Bmqi.js.map → candidates-relation-picker-CGXItMN0.js.map} +1 -1
- package/dist/{check-confirm-dialog--gPFnEeg.cjs → check-confirm-dialog-BT04Mieo.cjs} +475 -107
- package/dist/check-confirm-dialog-BT04Mieo.cjs.map +1 -0
- package/dist/{check-confirm-dialog-bRT8lt0d.js → check-confirm-dialog-CtiRzOAt.js} +391 -108
- package/dist/check-confirm-dialog-CtiRzOAt.js.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-nXqtM_h4.cjs → filter-builder-ByGhxLf_.cjs} +1021 -154
- package/dist/filter-builder-ByGhxLf_.cjs.map +1 -0
- package/dist/{filter-builder-Bhn-dhZV.js → filter-builder-z3Axzf9Y.js} +929 -140
- package/dist/filter-builder-z3Axzf9Y.js.map +1 -0
- package/dist/{flow-runtime-D3avVH0I.cjs → flow-runtime-BVFjMU5-.cjs} +64 -29
- package/dist/flow-runtime-BVFjMU5-.cjs.map +1 -0
- package/dist/{flow-runtime-s6lkRPKF.js → flow-runtime-DrUWyTS0.js} +65 -30
- package/dist/flow-runtime-DrUWyTS0.js.map +1 -0
- package/dist/{flow-screen-CCvgDI9G.js → flow-screen-3fk6J33y.js} +130 -87
- package/dist/flow-screen-3fk6J33y.js.map +1 -0
- package/dist/{flow-screen-Ci_Sik4Y.cjs → flow-screen-6y5E_HT6.cjs} +130 -87
- package/dist/flow-screen-6y5E_HT6.cjs.map +1 -0
- package/dist/index.cjs +1186 -950
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +631 -322
- package/dist/index.d.ts +631 -322
- package/dist/index.js +1100 -870
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-DV1et3c6.cjs → inline-flow-host-C4KmZIYE.cjs} +5 -5
- package/dist/inline-flow-host-C4KmZIYE.cjs.map +1 -0
- package/dist/{inline-flow-host-B6FI0ctQ.js → inline-flow-host-YnnvWjdU.js} +5 -5
- package/dist/inline-flow-host-YnnvWjdU.js.map +1 -0
- package/dist/{candidates-gate-D33jXLHO.cjs → lazy-relation-picker-dialog-BAKBRn3V.cjs} +10 -10
- package/dist/lazy-relation-picker-dialog-BAKBRn3V.cjs.map +1 -0
- package/dist/{candidates-gate-Bb70LPAy.js → lazy-relation-picker-dialog-DN4bvQfg.js} +11 -11
- package/dist/lazy-relation-picker-dialog-DN4bvQfg.js.map +1 -0
- package/dist/{page-flow-route-i3ZfJ1sd.js → page-flow-route-CtEfqAvU.js} +35 -23
- package/dist/page-flow-route-CtEfqAvU.js.map +1 -0
- package/dist/{page-flow-route-hdnULWqd.cjs → page-flow-route-DEjAxHe3.cjs} +42 -30
- package/dist/page-flow-route-DEjAxHe3.cjs.map +1 -0
- package/dist/{place-node-NraNYKPx.js → place-node-BdxT-30h.js} +1980 -1041
- package/dist/place-node-BdxT-30h.js.map +1 -0
- package/dist/{place-node-C5SmIAYU.cjs → place-node-Bhl8B3fF.cjs} +2038 -1087
- package/dist/place-node-Bhl8B3fF.cjs.map +1 -0
- package/dist/{related-list-cards-CFq3meUn.cjs → related-list-cards-Bc_vfCE_.cjs} +9 -4
- package/dist/{related-list-cards-CFq3meUn.cjs.map → related-list-cards-Bc_vfCE_.cjs.map} +1 -1
- package/dist/{related-list-cards-BWZ9GfOG.js → related-list-cards-BvkD5OcC.js} +9 -4
- package/dist/{related-list-cards-BWZ9GfOG.js.map → related-list-cards-BvkD5OcC.js.map} +1 -1
- package/dist/related-list-timeline-DCrwN9oO.js +167 -0
- package/dist/related-list-timeline-DCrwN9oO.js.map +1 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs +167 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs.map +1 -0
- package/dist/{related-rows-ea43qhhy.cjs → related-rows-BW9Jr07T.cjs} +27 -16
- package/dist/related-rows-BW9Jr07T.cjs.map +1 -0
- package/dist/{related-rows-o0_t-Yce.js → related-rows-CPE-9FFr.js} +25 -14
- package/dist/related-rows-CPE-9FFr.js.map +1 -0
- package/dist/{search-access-CPPmfuvy.js → relation-create-C43cdPQt.js} +595 -13
- package/dist/relation-create-C43cdPQt.js.map +1 -0
- package/dist/{search-access-Dugvttlg.cjs → relation-create-DDEYcKfw.cjs} +633 -14
- package/dist/relation-create-DDEYcKfw.cjs.map +1 -0
- package/dist/{relation-many-picker-bvkjkv-k.js → relation-many-picker-BlrGRwMV.js} +210 -104
- package/dist/relation-many-picker-BlrGRwMV.js.map +1 -0
- package/dist/{relation-many-picker-C8zFEjwd.cjs → relation-many-picker-Br-zBHxT.cjs} +218 -112
- package/dist/relation-many-picker-Br-zBHxT.cjs.map +1 -0
- package/dist/{relation-picker-gag0qSR5.cjs → relation-picker-ADjxI_TI.cjs} +36 -73
- package/dist/relation-picker-ADjxI_TI.cjs.map +1 -0
- package/dist/{relation-picker-dialog-B6nIiJBf.js → relation-picker-dialog-CyKliBkN.js} +134 -36
- package/dist/relation-picker-dialog-CyKliBkN.js.map +1 -0
- package/dist/{relation-picker-dialog-0IzkjmiA.cjs → relation-picker-dialog-DimVQF9Y.cjs} +133 -35
- package/dist/relation-picker-dialog-DimVQF9Y.cjs.map +1 -0
- package/dist/{relation-picker-Z0ZJJ5uS.js → relation-picker-x7P5HKie.js} +30 -61
- package/dist/relation-picker-x7P5HKie.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-3RUf9d1j.js → resource-page-router-BRpUnhay.js} +634 -264
- package/dist/resource-page-router-BRpUnhay.js.map +1 -0
- package/dist/{resource-page-router-PXfMW9nh.cjs → resource-page-router-qEd2xb55.cjs} +694 -312
- package/dist/resource-page-router-qEd2xb55.cjs.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-Cr51X7bz.cjs → toaster-BbByOytP.cjs} +60 -15
- package/dist/toaster-BbByOytP.cjs.map +1 -0
- package/dist/{toaster-C02XbB9r.js → toaster-Ct_YHGs6.js} +43 -16
- package/dist/toaster-Ct_YHGs6.js.map +1 -0
- package/dist/{use-dialog-filter-state-C--oMAZG.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-Dhe8PcB5.cjs → use-dialog-filter-state-tNvqAAjh.cjs} +6 -5
- package/dist/use-dialog-filter-state-tNvqAAjh.cjs.map +1 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs +70 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs.map +1 -0
- package/dist/use-record-subtitle-gIaCGgbI.js +53 -0
- package/dist/use-record-subtitle-gIaCGgbI.js.map +1 -0
- 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-Bb70LPAy.js.map +0 -1
- package/dist/candidates-gate-D33jXLHO.cjs.map +0 -1
- package/dist/check-confirm-dialog--gPFnEeg.cjs.map +0 -1
- package/dist/check-confirm-dialog-bRT8lt0d.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-Bhn-dhZV.js.map +0 -1
- package/dist/filter-builder-nXqtM_h4.cjs.map +0 -1
- package/dist/flow-runtime-D3avVH0I.cjs.map +0 -1
- package/dist/flow-runtime-s6lkRPKF.js.map +0 -1
- package/dist/flow-screen-CCvgDI9G.js.map +0 -1
- package/dist/flow-screen-Ci_Sik4Y.cjs.map +0 -1
- package/dist/inline-flow-host-B6FI0ctQ.js.map +0 -1
- package/dist/inline-flow-host-DV1et3c6.cjs.map +0 -1
- package/dist/page-flow-route-hdnULWqd.cjs.map +0 -1
- package/dist/page-flow-route-i3ZfJ1sd.js.map +0 -1
- package/dist/place-node-C5SmIAYU.cjs.map +0 -1
- package/dist/place-node-NraNYKPx.js.map +0 -1
- package/dist/related-list-timeline-CCzl71aA.cjs +0 -142
- package/dist/related-list-timeline-CCzl71aA.cjs.map +0 -1
- package/dist/related-list-timeline-yrPsjA3F.js +0 -142
- package/dist/related-list-timeline-yrPsjA3F.js.map +0 -1
- package/dist/related-rows-ea43qhhy.cjs.map +0 -1
- package/dist/related-rows-o0_t-Yce.js.map +0 -1
- package/dist/relation-create-IA40t1hi.cjs +0 -364
- package/dist/relation-create-IA40t1hi.cjs.map +0 -1
- package/dist/relation-create-h6F9B4C4.js +0 -339
- package/dist/relation-create-h6F9B4C4.js.map +0 -1
- package/dist/relation-many-picker-C8zFEjwd.cjs.map +0 -1
- package/dist/relation-many-picker-bvkjkv-k.js.map +0 -1
- package/dist/relation-picker-Z0ZJJ5uS.js.map +0 -1
- package/dist/relation-picker-dialog-0IzkjmiA.cjs.map +0 -1
- package/dist/relation-picker-dialog-B6nIiJBf.js.map +0 -1
- package/dist/relation-picker-gag0qSR5.cjs.map +0 -1
- package/dist/resource-page-router-3RUf9d1j.js.map +0 -1
- package/dist/resource-page-router-PXfMW9nh.cjs.map +0 -1
- package/dist/search-access-CPPmfuvy.js.map +0 -1
- package/dist/search-access-Dugvttlg.cjs.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-C02XbB9r.js.map +0 -1
- package/dist/toaster-Cr51X7bz.cjs.map +0 -1
- package/dist/use-dialog-filter-state-C--oMAZG.js.map +0 -1
- package/dist/use-dialog-filter-state-Dhe8PcB5.cjs.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-BVFjMU5-.cjs")));
|
|
496
|
+
const loadFlowScreen = retrying(() => Promise.resolve().then(() => require("./flow-screen-6y5E_HT6.cjs")));
|
|
497
|
+
const loadPageFlowRoute = retrying(() => Promise.resolve().then(() => require("./page-flow-route-DEjAxHe3.cjs")));
|
|
498
|
+
const loadInlineFlowHost = retrying(() => Promise.resolve().then(() => require("./inline-flow-host-C4KmZIYE.cjs")));
|
|
499
|
+
const loadBulkSummary = retrying(() => Promise.resolve().then(() => require("./bulk-summary-2HLgz7Il.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({
|
|
@@ -844,36 +1123,41 @@ function actionResourceHandle(resource) {
|
|
|
844
1123
|
ref: (0, _burojs_core.normalizeEntityRef)(resource)
|
|
845
1124
|
};
|
|
846
1125
|
}
|
|
847
|
-
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
|
+
};
|
|
848
1132
|
const def = (0, _burojs_react.useApp)().registry.get(props.resource);
|
|
849
1133
|
const scope = props.scope ?? "row";
|
|
850
|
-
const
|
|
851
|
-
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
|
+
});
|
|
852
1143
|
if (!action) return null;
|
|
853
1144
|
if ((0, _burojs_core_internal.isFlowAction)(action)) return (0, react_jsx_runtime.jsx)(FlowActionButton, { ...props });
|
|
854
1145
|
if (availability.state === "absent" || availability.state === "hidden") return null;
|
|
855
|
-
if (!actionWhenHolds(action,
|
|
1146
|
+
if (!(0, _burojs_core_internal.actionWhenHolds)(action, (0, _burojs_core_internal.actionWhenSources)(whenSources, sources))) return null;
|
|
856
1147
|
if (action.kind === "link") return (0, react_jsx_runtime.jsx)(LinkActionButton, {
|
|
857
1148
|
...props,
|
|
1149
|
+
record,
|
|
858
1150
|
action,
|
|
859
1151
|
availability
|
|
860
1152
|
});
|
|
861
1153
|
if (action.kind === "modal") return (0, react_jsx_runtime.jsx)(ModalActionButton, {
|
|
862
1154
|
...props,
|
|
1155
|
+
record,
|
|
863
1156
|
action,
|
|
864
1157
|
availability
|
|
865
1158
|
});
|
|
866
1159
|
return null;
|
|
867
1160
|
}
|
|
868
|
-
function actionWhenHolds(action, record) {
|
|
869
|
-
const when = action.when;
|
|
870
|
-
if (when === void 0) return true;
|
|
871
|
-
return (0, _burojs_core_internal.evaluateCondition)(when, record === void 0 ? {} : { record: {
|
|
872
|
-
status: "ready",
|
|
873
|
-
value: record,
|
|
874
|
-
refreshing: false
|
|
875
|
-
} }, { mode: "show" }) === true;
|
|
876
|
-
}
|
|
877
1161
|
function presentModalAction(args) {
|
|
878
1162
|
const { present, action, resource, actionName, record, recordId, label } = args;
|
|
879
1163
|
const result = present({
|
|
@@ -901,17 +1185,20 @@ const reportedDeadRoutes = new Set();
|
|
|
901
1185
|
function deadRecordRoute(registry, action, to) {
|
|
902
1186
|
if ((0, _burojs_core.isBuiltinItemAction)(action) || to === null || typeof to !== "object") return null;
|
|
903
1187
|
const target = to;
|
|
904
|
-
if (typeof target.resource !== "string") return null;
|
|
905
1188
|
if (target.action !== "show" && target.action !== "edit" && target.action !== "create") return null;
|
|
1189
|
+
let resource;
|
|
906
1190
|
let def;
|
|
907
1191
|
try {
|
|
908
|
-
|
|
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);
|
|
909
1196
|
} catch {
|
|
910
1197
|
return null;
|
|
911
1198
|
}
|
|
912
1199
|
if (def === void 0 || (0, _burojs_core.hasRecordPage)(def, target.action)) return null;
|
|
913
1200
|
return {
|
|
914
|
-
resource
|
|
1201
|
+
resource,
|
|
915
1202
|
action: target.action
|
|
916
1203
|
};
|
|
917
1204
|
}
|
|
@@ -929,7 +1216,7 @@ function LinkActionButton({ resource, actionName, record, scope = "row", variant
|
|
|
929
1216
|
const safeRecord = record ?? { id: "" };
|
|
930
1217
|
const isDestructive = action.variant === "destructive";
|
|
931
1218
|
const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
|
|
932
|
-
const recordId = record
|
|
1219
|
+
const recordId = String((0, _burojs_react.recordKeyOf)(app.registry.get(resource), record) ?? "");
|
|
933
1220
|
const testid = makeTestId(scope, resource, actionName, recordId, tid);
|
|
934
1221
|
const label = useResolvedLabel(action, actionName, children, resource);
|
|
935
1222
|
const editRoute = useBuiltinEditRoute(action, resource, recordId);
|
|
@@ -1035,11 +1322,12 @@ function LinkActionButton({ resource, actionName, record, scope = "row", variant
|
|
|
1035
1322
|
}
|
|
1036
1323
|
function ModalActionButton({ resource, actionName, record, scope = "row", variant, size, density, className, children, asMenuItem, action, availability }) {
|
|
1037
1324
|
const tid = (0, _burojs_react.useTestIds)();
|
|
1325
|
+
const app = (0, _burojs_react.useApp)();
|
|
1038
1326
|
const present = (0, _burojs_react.usePresentBlock)();
|
|
1039
1327
|
const safeRecord = record ?? { id: "" };
|
|
1040
1328
|
const isDestructive = action.variant === "destructive";
|
|
1041
1329
|
const buttonVariant = variant ?? (isDestructive ? "destructive" : "outline");
|
|
1042
|
-
const recordId = record
|
|
1330
|
+
const recordId = String((0, _burojs_react.recordKeyOf)(app.registry.get(resource), record) ?? "");
|
|
1043
1331
|
const testid = makeTestId(scope, resource, actionName, recordId, tid);
|
|
1044
1332
|
const label = useResolvedLabel(action, actionName, children, resource);
|
|
1045
1333
|
if (availability.state === "disabled") return (0, react_jsx_runtime.jsx)(DisabledAction, {
|
|
@@ -1099,33 +1387,41 @@ function ModalActionButton({ resource, actionName, record, scope = "row", varian
|
|
|
1099
1387
|
}
|
|
1100
1388
|
//#endregion
|
|
1101
1389
|
//#region src/checks/check-confirm-dialog.tsx
|
|
1102
|
-
function
|
|
1103
|
-
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 ?? "",
|
|
1104
1398
|
params,
|
|
1105
1399
|
...resource === void 0 ? {} : { resource }
|
|
1106
1400
|
});
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
const ownCheck = typeof checkId === "string" && issue.message.key === `checks.${checkId}`;
|
|
1113
|
-
const declared = typeof issue.message.default === "string" ? issue.message.default : ownCheck ? void 0 : issue.message.key;
|
|
1114
|
-
if (issue.params?.resolved === true) return declared ?? issue.message.key;
|
|
1115
|
-
if (!ownCheck) return translateOrFallback(t, issue.message.key, declared ?? "", params, resource);
|
|
1116
|
-
const miss = "\0";
|
|
1117
|
-
const bundled = [`${issue.message.key}.message`, issue.message.key].map((key) => translateOrFallback(t, key, miss, params, resource)).find((text) => text !== miss);
|
|
1118
|
-
if (bundled !== void 0) return bundled;
|
|
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
|
+
});
|
|
1119
1406
|
if (declared !== void 0) return declared;
|
|
1407
|
+
if (issue.check?.constraint !== void 0) {
|
|
1408
|
+
const text = (0, _burojs_core.constraintText)(issue.check.constraint, String(params?.limit ?? ""));
|
|
1409
|
+
return t(text.key, {
|
|
1410
|
+
defaultValue: text.defaultValue,
|
|
1411
|
+
params
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1120
1414
|
const name = String(params?.name ?? checkId);
|
|
1121
|
-
return
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1415
|
+
return t(_burojs_core.FRAMEWORK_TEXT_KEYS.checkFailed, {
|
|
1416
|
+
defaultValue: (0, _burojs_core.checkFailedDefault)(name),
|
|
1417
|
+
params: {
|
|
1418
|
+
...params,
|
|
1419
|
+
name
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1125
1422
|
}
|
|
1126
1423
|
function checkIdOf(issue, index) {
|
|
1127
|
-
|
|
1128
|
-
return typeof id === "string" ? id : `${index}`;
|
|
1424
|
+
return issue.check?.id ?? `${index}`;
|
|
1129
1425
|
}
|
|
1130
1426
|
const SEVERITY_CLASSNAME = {
|
|
1131
1427
|
error: "text-destructive",
|
|
@@ -1134,11 +1430,12 @@ const SEVERITY_CLASSNAME = {
|
|
|
1134
1430
|
};
|
|
1135
1431
|
function ChecksList({ issues, testid, onRowClick, resource }) {
|
|
1136
1432
|
const t = (0, _burojs_react.useOptionalT)();
|
|
1433
|
+
const caps = (0, _burojs_react.useI18nCaps)(resource);
|
|
1137
1434
|
return issues.map((issue, index) => {
|
|
1138
1435
|
const checkId = checkIdOf(issue, index);
|
|
1139
1436
|
const anchor = issue.path[0];
|
|
1140
1437
|
const anchorable = typeof anchor === "string";
|
|
1141
|
-
const text = issueText(issue, t, resource);
|
|
1438
|
+
const text = issueText(issue, t, caps, resource);
|
|
1142
1439
|
const className = require_use_theme.cn("text-sm", SEVERITY_CLASSNAME[issue.severity]);
|
|
1143
1440
|
return anchorable ? (0, react_jsx_runtime.jsx)("li", { children: (0, react_jsx_runtime.jsx)("button", {
|
|
1144
1441
|
type: "button",
|
|
@@ -1153,15 +1450,11 @@ function ChecksList({ issues, testid, onRowClick, resource }) {
|
|
|
1153
1450
|
}, `${checkId}-${index}`);
|
|
1154
1451
|
});
|
|
1155
1452
|
}
|
|
1156
|
-
function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel, tone }) {
|
|
1157
|
-
const
|
|
1453
|
+
function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel, cancelLabel, tone }) {
|
|
1454
|
+
const chromeT = (0, _burojs_react.useChromeT)();
|
|
1158
1455
|
const { resource, open, busy, header, blockers, confirmable, proceed, cancel } = state;
|
|
1159
1456
|
const blocked = blockers.length > 0;
|
|
1160
|
-
const
|
|
1161
|
-
const heading = title ?? t("checks.dialogTitle", {
|
|
1162
|
-
defaultValue: "Please review",
|
|
1163
|
-
...bound
|
|
1164
|
-
});
|
|
1457
|
+
const heading = title ?? chromeT("checks.dialogTitle", { defaultValue: "Please review" });
|
|
1165
1458
|
const restoreFocusRef = (0, react.useRef)(null);
|
|
1166
1459
|
(0, react.useEffect)(() => {
|
|
1167
1460
|
if (typeof document === "undefined") return;
|
|
@@ -1198,10 +1491,7 @@ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel,
|
|
|
1198
1491
|
children: [
|
|
1199
1492
|
blocked && (0, react_jsx_runtime.jsx)("li", {
|
|
1200
1493
|
className: "text-xs font-semibold uppercase tracking-wider text-destructive",
|
|
1201
|
-
children:
|
|
1202
|
-
defaultValue: "Cannot continue",
|
|
1203
|
-
...bound
|
|
1204
|
-
})
|
|
1494
|
+
children: chromeT("checks.blocked", { defaultValue: "Cannot continue" })
|
|
1205
1495
|
}),
|
|
1206
1496
|
(0, react_jsx_runtime.jsx)(ChecksList, {
|
|
1207
1497
|
issues: blockers,
|
|
@@ -1223,20 +1513,14 @@ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel,
|
|
|
1223
1513
|
onClick: cancel,
|
|
1224
1514
|
"data-testid": `${testid}:cancel`,
|
|
1225
1515
|
disabled: busy,
|
|
1226
|
-
children:
|
|
1227
|
-
defaultValue: "Go back",
|
|
1228
|
-
...bound
|
|
1229
|
-
})
|
|
1516
|
+
children: cancelLabel ?? chromeT("checks.back", { defaultValue: "Go back" })
|
|
1230
1517
|
}), !blocked && (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
1231
1518
|
type: "button",
|
|
1232
1519
|
variant: tone === "destructive" ? "destructive" : "default",
|
|
1233
1520
|
onClick: proceed,
|
|
1234
1521
|
"data-testid": `${testid}:proceed`,
|
|
1235
1522
|
disabled: busy,
|
|
1236
|
-
children: proceedLabel ??
|
|
1237
|
-
defaultValue: "Continue anyway",
|
|
1238
|
-
...bound
|
|
1239
|
-
})
|
|
1523
|
+
children: proceedLabel ?? chromeT("checks.proceed", { defaultValue: "Continue anyway" })
|
|
1240
1524
|
})] })
|
|
1241
1525
|
]
|
|
1242
1526
|
})
|
|
@@ -1261,6 +1545,12 @@ Object.defineProperty(exports, "CheckConfirmDialog", {
|
|
|
1261
1545
|
return CheckConfirmDialog;
|
|
1262
1546
|
}
|
|
1263
1547
|
});
|
|
1548
|
+
Object.defineProperty(exports, "DialogPresentationShell", {
|
|
1549
|
+
enumerable: true,
|
|
1550
|
+
get: function() {
|
|
1551
|
+
return DialogPresentationShell;
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1264
1554
|
Object.defineProperty(exports, "DisabledAction", {
|
|
1265
1555
|
enumerable: true,
|
|
1266
1556
|
get: function() {
|
|
@@ -1393,6 +1683,18 @@ Object.defineProperty(exports, "Icon", {
|
|
|
1393
1683
|
return Icon;
|
|
1394
1684
|
}
|
|
1395
1685
|
});
|
|
1686
|
+
Object.defineProperty(exports, "OwnTitleContext", {
|
|
1687
|
+
enumerable: true,
|
|
1688
|
+
get: function() {
|
|
1689
|
+
return OwnTitleContext;
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
Object.defineProperty(exports, "OwnTitleHeading", {
|
|
1693
|
+
enumerable: true,
|
|
1694
|
+
get: function() {
|
|
1695
|
+
return OwnTitleHeading;
|
|
1696
|
+
}
|
|
1697
|
+
});
|
|
1396
1698
|
Object.defineProperty(exports, "RuntimeAppFlowRunner", {
|
|
1397
1699
|
enumerable: true,
|
|
1398
1700
|
get: function() {
|
|
@@ -1411,6 +1713,60 @@ Object.defineProperty(exports, "RuntimeFlowRunner", {
|
|
|
1411
1713
|
return RuntimeFlowRunner;
|
|
1412
1714
|
}
|
|
1413
1715
|
});
|
|
1716
|
+
Object.defineProperty(exports, "Sheet", {
|
|
1717
|
+
enumerable: true,
|
|
1718
|
+
get: function() {
|
|
1719
|
+
return Sheet;
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
Object.defineProperty(exports, "SheetClose", {
|
|
1723
|
+
enumerable: true,
|
|
1724
|
+
get: function() {
|
|
1725
|
+
return SheetClose;
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
Object.defineProperty(exports, "SheetContent", {
|
|
1729
|
+
enumerable: true,
|
|
1730
|
+
get: function() {
|
|
1731
|
+
return SheetContent;
|
|
1732
|
+
}
|
|
1733
|
+
});
|
|
1734
|
+
Object.defineProperty(exports, "SheetDescription", {
|
|
1735
|
+
enumerable: true,
|
|
1736
|
+
get: function() {
|
|
1737
|
+
return SheetDescription;
|
|
1738
|
+
}
|
|
1739
|
+
});
|
|
1740
|
+
Object.defineProperty(exports, "SheetFooter", {
|
|
1741
|
+
enumerable: true,
|
|
1742
|
+
get: function() {
|
|
1743
|
+
return SheetFooter;
|
|
1744
|
+
}
|
|
1745
|
+
});
|
|
1746
|
+
Object.defineProperty(exports, "SheetHeader", {
|
|
1747
|
+
enumerable: true,
|
|
1748
|
+
get: function() {
|
|
1749
|
+
return SheetHeader;
|
|
1750
|
+
}
|
|
1751
|
+
});
|
|
1752
|
+
Object.defineProperty(exports, "SheetPresentationShell", {
|
|
1753
|
+
enumerable: true,
|
|
1754
|
+
get: function() {
|
|
1755
|
+
return SheetPresentationShell;
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
Object.defineProperty(exports, "SheetTitle", {
|
|
1759
|
+
enumerable: true,
|
|
1760
|
+
get: function() {
|
|
1761
|
+
return SheetTitle;
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
Object.defineProperty(exports, "SheetTrigger", {
|
|
1765
|
+
enumerable: true,
|
|
1766
|
+
get: function() {
|
|
1767
|
+
return SheetTrigger;
|
|
1768
|
+
}
|
|
1769
|
+
});
|
|
1414
1770
|
Object.defineProperty(exports, "Tooltip", {
|
|
1415
1771
|
enumerable: true,
|
|
1416
1772
|
get: function() {
|
|
@@ -1507,16 +1863,16 @@ Object.defineProperty(exports, "preloadFlowRuntime", {
|
|
|
1507
1863
|
return preloadFlowRuntime;
|
|
1508
1864
|
}
|
|
1509
1865
|
});
|
|
1510
|
-
Object.defineProperty(exports, "
|
|
1866
|
+
Object.defineProperty(exports, "reasonText", {
|
|
1511
1867
|
enumerable: true,
|
|
1512
1868
|
get: function() {
|
|
1513
|
-
return
|
|
1869
|
+
return reasonText;
|
|
1514
1870
|
}
|
|
1515
1871
|
});
|
|
1516
|
-
Object.defineProperty(exports, "
|
|
1872
|
+
Object.defineProperty(exports, "registerIcons", {
|
|
1517
1873
|
enumerable: true,
|
|
1518
1874
|
get: function() {
|
|
1519
|
-
return
|
|
1875
|
+
return registerIcons;
|
|
1520
1876
|
}
|
|
1521
1877
|
});
|
|
1522
1878
|
Object.defineProperty(exports, "useFlowChrome", {
|
|
@@ -1525,6 +1881,18 @@ Object.defineProperty(exports, "useFlowChrome", {
|
|
|
1525
1881
|
return useFlowChrome;
|
|
1526
1882
|
}
|
|
1527
1883
|
});
|
|
1884
|
+
Object.defineProperty(exports, "useFlowDialogTexts", {
|
|
1885
|
+
enumerable: true,
|
|
1886
|
+
get: function() {
|
|
1887
|
+
return useFlowDialogTexts;
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
Object.defineProperty(exports, "useFocusOnMount", {
|
|
1891
|
+
enumerable: true,
|
|
1892
|
+
get: function() {
|
|
1893
|
+
return useFocusOnMount;
|
|
1894
|
+
}
|
|
1895
|
+
});
|
|
1528
1896
|
Object.defineProperty(exports, "useListSlot", {
|
|
1529
1897
|
enumerable: true,
|
|
1530
1898
|
get: function() {
|
|
@@ -1544,4 +1912,4 @@ Object.defineProperty(exports, "useToBrowserHref", {
|
|
|
1544
1912
|
}
|
|
1545
1913
|
});
|
|
1546
1914
|
|
|
1547
|
-
//# sourceMappingURL=check-confirm-dialog
|
|
1915
|
+
//# sourceMappingURL=check-confirm-dialog-BT04Mieo.cjs.map
|