@bayonai/mui-design 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +108 -7
  3. package/dist/cjs/actions/ActionMenu.js +36 -0
  4. package/dist/cjs/actions/DialogActionButtons.js +33 -0
  5. package/dist/cjs/actions/LoadingIconButton.js +10 -0
  6. package/dist/cjs/actions/StickyActionFooter.js +27 -0
  7. package/dist/cjs/actions/StickySubmitButton.js +10 -0
  8. package/dist/cjs/actions/index.js +18 -0
  9. package/dist/cjs/drawers/BottomDrawer.js +43 -0
  10. package/dist/cjs/drawers/MobileBottomDrawer.js +102 -0
  11. package/dist/cjs/drawers/MobileBottomDrawerHeader.js +36 -0
  12. package/dist/cjs/drawers/ResponsiveDrawer.js +22 -0
  13. package/dist/cjs/drawers/drawerAppearance.js +10 -0
  14. package/dist/cjs/drawers/index.js +17 -0
  15. package/dist/cjs/drawers/useVisualViewportBottomInset.js +33 -0
  16. package/dist/cjs/feedback/StatusNotice.js +62 -0
  17. package/dist/cjs/feedback/index.js +7 -0
  18. package/dist/cjs/links/LinkAddressPreview.js +80 -0
  19. package/dist/cjs/links/index.js +9 -0
  20. package/dist/cjs/links/useLinkAddressPreview.js +152 -0
  21. package/dist/cjs/pending/PendingChangesDialogShell.js +16 -0
  22. package/dist/cjs/pending/PendingChangesDialogView.js +126 -0
  23. package/dist/cjs/pending/PendingChangesIndicatorView.js +27 -0
  24. package/dist/cjs/pending/index.js +9 -0
  25. package/dist/cjs/pending/types.js +2 -0
  26. package/dist/cjs/providers/BayonThemeProvider.js +51 -11
  27. package/dist/cjs/sections/ExpandableSectionToggle.js +32 -0
  28. package/dist/cjs/sections/index.js +7 -0
  29. package/dist/cjs/swipe/SwipeActionRow.js +123 -0
  30. package/dist/cjs/swipe/index.js +8 -0
  31. package/dist/cjs/toasts/ActionToast.js +12 -0
  32. package/dist/cjs/toasts/Toast.js +55 -0
  33. package/dist/cjs/toasts/index.js +12 -0
  34. package/dist/cjs/toasts/useUpwardToastDismiss.js +73 -0
  35. package/dist/cjs/uploads/CameraCaptureDialog.js +187 -0
  36. package/dist/cjs/uploads/FileRow.js +23 -0
  37. package/dist/cjs/uploads/FileSwipeActionRow.js +11 -0
  38. package/dist/cjs/uploads/FileThumbnail.js +104 -0
  39. package/dist/cjs/uploads/FileUpload.js +98 -0
  40. package/dist/cjs/uploads/FileViewer.js +151 -0
  41. package/dist/cjs/uploads/ImageCropDialog.js +215 -0
  42. package/dist/cjs/uploads/UploadProgressRing.js +32 -0
  43. package/dist/cjs/uploads/cameraCropPresentation.js +12 -0
  44. package/dist/cjs/uploads/index.js +20 -0
  45. package/dist/esm/actions/ActionMenu.js +30 -0
  46. package/dist/esm/actions/DialogActionButtons.js +24 -0
  47. package/dist/esm/actions/LoadingIconButton.js +7 -0
  48. package/dist/esm/actions/StickyActionFooter.js +24 -0
  49. package/dist/esm/actions/StickySubmitButton.js +7 -0
  50. package/dist/esm/actions/index.js +7 -0
  51. package/dist/esm/drawers/BottomDrawer.js +37 -0
  52. package/dist/esm/drawers/MobileBottomDrawer.js +95 -0
  53. package/dist/esm/drawers/MobileBottomDrawerHeader.js +30 -0
  54. package/dist/esm/drawers/ResponsiveDrawer.js +19 -0
  55. package/dist/esm/drawers/drawerAppearance.js +7 -0
  56. package/dist/esm/drawers/index.js +7 -0
  57. package/dist/esm/drawers/useVisualViewportBottomInset.js +29 -0
  58. package/dist/esm/feedback/StatusNotice.js +56 -0
  59. package/dist/esm/feedback/index.js +3 -0
  60. package/dist/esm/links/LinkAddressPreview.js +74 -0
  61. package/dist/esm/links/index.js +4 -0
  62. package/dist/esm/links/useLinkAddressPreview.js +149 -0
  63. package/dist/esm/pending/PendingChangesDialogShell.js +10 -0
  64. package/dist/esm/pending/PendingChangesDialogView.js +120 -0
  65. package/dist/esm/pending/PendingChangesIndicatorView.js +21 -0
  66. package/dist/esm/pending/index.js +4 -0
  67. package/dist/esm/pending/types.js +1 -0
  68. package/dist/esm/providers/BayonThemeProvider.js +51 -11
  69. package/dist/esm/sections/ExpandableSectionToggle.js +26 -0
  70. package/dist/esm/sections/index.js +3 -0
  71. package/dist/esm/swipe/SwipeActionRow.js +116 -0
  72. package/dist/esm/swipe/index.js +3 -0
  73. package/dist/esm/toasts/ActionToast.js +9 -0
  74. package/dist/esm/toasts/Toast.js +52 -0
  75. package/dist/esm/toasts/index.js +5 -0
  76. package/dist/esm/toasts/useUpwardToastDismiss.js +69 -0
  77. package/dist/esm/uploads/CameraCaptureDialog.js +181 -0
  78. package/dist/esm/uploads/FileRow.js +17 -0
  79. package/dist/esm/uploads/FileSwipeActionRow.js +7 -0
  80. package/dist/esm/uploads/FileThumbnail.js +98 -0
  81. package/dist/esm/uploads/FileUpload.js +92 -0
  82. package/dist/esm/uploads/FileViewer.js +145 -0
  83. package/dist/esm/uploads/ImageCropDialog.js +212 -0
  84. package/dist/esm/uploads/UploadProgressRing.js +29 -0
  85. package/dist/esm/uploads/cameraCropPresentation.js +5 -0
  86. package/dist/esm/uploads/index.js +9 -0
  87. package/dist/types/actions/ActionMenu.d.ts +24 -0
  88. package/dist/types/actions/DialogActionButtons.d.ts +22 -0
  89. package/dist/types/actions/LoadingIconButton.d.ts +11 -0
  90. package/dist/types/actions/StickyActionFooter.d.ts +14 -0
  91. package/dist/types/actions/StickySubmitButton.d.ts +10 -0
  92. package/dist/types/actions/index.d.ts +5 -0
  93. package/dist/types/drawers/BottomDrawer.d.ts +16 -0
  94. package/dist/types/drawers/MobileBottomDrawer.d.ts +20 -0
  95. package/dist/types/drawers/MobileBottomDrawerHeader.d.ts +11 -0
  96. package/dist/types/drawers/ResponsiveDrawer.d.ts +25 -0
  97. package/dist/types/drawers/drawerAppearance.d.ts +8 -0
  98. package/dist/types/drawers/index.d.ts +6 -0
  99. package/dist/types/drawers/useVisualViewportBottomInset.d.ts +6 -0
  100. package/dist/types/feedback/StatusNotice.d.ts +13 -0
  101. package/dist/types/feedback/index.d.ts +1 -0
  102. package/dist/types/links/LinkAddressPreview.d.ts +19 -0
  103. package/dist/types/links/index.d.ts +3 -0
  104. package/dist/types/links/useLinkAddressPreview.d.ts +24 -0
  105. package/dist/types/pending/PendingChangesDialogShell.d.ts +2 -0
  106. package/dist/types/pending/PendingChangesDialogView.d.ts +2 -0
  107. package/dist/types/pending/PendingChangesIndicatorView.d.ts +10 -0
  108. package/dist/types/pending/index.d.ts +3 -0
  109. package/dist/types/pending/types.d.ts +48 -0
  110. package/dist/types/sections/ExpandableSectionToggle.d.ts +12 -0
  111. package/dist/types/sections/index.d.ts +2 -0
  112. package/dist/types/swipe/SwipeActionRow.d.ts +8 -0
  113. package/dist/types/swipe/index.d.ts +1 -0
  114. package/dist/types/toasts/ActionToast.d.ts +11 -0
  115. package/dist/types/toasts/Toast.d.ts +16 -0
  116. package/dist/types/toasts/index.d.ts +5 -0
  117. package/dist/types/toasts/useUpwardToastDismiss.d.ts +15 -0
  118. package/dist/types/uploads/CameraCaptureDialog.d.ts +22 -0
  119. package/dist/types/uploads/FileRow.d.ts +10 -0
  120. package/dist/types/uploads/FileSwipeActionRow.d.ts +1 -0
  121. package/dist/types/uploads/FileThumbnail.d.ts +5 -0
  122. package/dist/types/uploads/FileUpload.d.ts +26 -0
  123. package/dist/types/uploads/FileViewer.d.ts +9 -0
  124. package/dist/types/uploads/ImageCropDialog.d.ts +26 -0
  125. package/dist/types/uploads/UploadProgressRing.d.ts +24 -0
  126. package/dist/types/uploads/cameraCropPresentation.d.ts +2 -0
  127. package/dist/types/uploads/index.d.ts +10 -0
  128. package/docs/camera-crop-contract.md +50 -0
  129. package/docs/uploads-contract.md +40 -0
  130. package/package.json +110 -48
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.FileUpload = FileUpload;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const hooks_1 = require("@bayonai/file-uploads/hooks");
10
+ const AddRounded_1 = __importDefault(require("@mui/icons-material/AddRounded"));
11
+ const AttachFileRounded_1 = __importDefault(require("@mui/icons-material/AttachFileRounded"));
12
+ const material_1 = require("@mui/material");
13
+ const react_1 = require("react");
14
+ function FileUpload({ attachments, canUpload = true, onUploadAttachment, label, accept, errorMessage, renderFile, renderViewer, RowShell, FieldIcon, colors, }) {
15
+ const inputRef = (0, react_1.useRef)(null);
16
+ const [previewAttachment, setPreviewAttachment] = (0, react_1.useState)(null);
17
+ const [uploadError, setUploadError] = (0, react_1.useState)(null);
18
+ const { busy: uploading, tryStart, finish } = (0, hooks_1.useUploadLock)();
19
+ const countLabel = attachments.length
20
+ ? `${attachments.length} attached file${attachments.length === 1 ? "" : "s"}`
21
+ : canUpload
22
+ ? "Add a file"
23
+ : "No files";
24
+ if (!canUpload && attachments.length === 0) {
25
+ return null;
26
+ }
27
+ async function handleFileChange(fileList) {
28
+ if (!canUpload)
29
+ return;
30
+ const file = fileList === null || fileList === void 0 ? void 0 : fileList[0];
31
+ if (!file) {
32
+ return;
33
+ }
34
+ if (!tryStart())
35
+ return;
36
+ setUploadError(null);
37
+ try {
38
+ await onUploadAttachment(file);
39
+ }
40
+ catch (error) {
41
+ console.error("[AttachmentSection] Attachment upload failed.", {
42
+ error,
43
+ fileName: file.name,
44
+ });
45
+ setUploadError(errorMessage(error));
46
+ }
47
+ finally {
48
+ finish();
49
+ if (inputRef.current) {
50
+ inputRef.current.value = "";
51
+ }
52
+ }
53
+ }
54
+ function openFilePicker() {
55
+ var _a;
56
+ if (!canUpload || uploading)
57
+ return;
58
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
59
+ }
60
+ function handlePreviewAttachment(attachment) {
61
+ setUploadError(null);
62
+ setPreviewAttachment(attachment);
63
+ }
64
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)(RowShell, { hasBottomBorder: attachments.length === 0, children: [(0, jsx_runtime_1.jsx)(FieldIcon, { ariaLabel: `Add a file to ${label}`, onClick: canUpload && !uploading ? openFilePicker : undefined, children: (0, jsx_runtime_1.jsx)(AttachFileRounded_1.default, {}) }), canUpload && uploading ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { "aria-label": "Uploading attachment", size: 16, sx: { color: "primary.main" } })) : null, canUpload ? ((0, jsx_runtime_1.jsx)(material_1.ButtonBase, { "aria-label": `Add a file to ${label}`, component: "button", disabled: uploading, onClick: openFilePicker, sx: {
65
+ color: colors.text,
66
+ display: "block",
67
+ flex: 1,
68
+ fontSize: 13,
69
+ minWidth: 0,
70
+ overflow: "hidden",
71
+ textAlign: "left",
72
+ textOverflow: "ellipsis",
73
+ transition: `color ${colors.transition}`,
74
+ whiteSpace: "nowrap",
75
+ "&:hover": { color: "text.primary" },
76
+ "&.Mui-disabled": {
77
+ color: colors.text,
78
+ },
79
+ }, children: uploading ? "Uploading file..." : countLabel })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { noWrap: true, sx: {
80
+ color: colors.text,
81
+ flex: 1,
82
+ fontSize: 13,
83
+ }, children: countLabel })), canUpload ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": `Upload attachment to ${label}`, disabled: uploading, onClick: openFilePicker, size: "small", sx: { color: colors.text }, children: (0, jsx_runtime_1.jsx)(AddRounded_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { accept: accept, component: "input", onChange: (event) => void handleFileChange(event.target.files), ref: inputRef, sx: { display: "none" }, type: "file" })] })) : null] }), canUpload && uploading ? ((0, jsx_runtime_1.jsx)(material_1.LinearProgress, { "aria-label": "Attachment upload progress", "data-component": "attachment-upload-progress", sx: {
84
+ bottom: 0,
85
+ height: 2,
86
+ left: 0,
87
+ position: "absolute",
88
+ right: 0,
89
+ } })) : null] }), attachments.length ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": true, sx: {
90
+ borderTop: 1,
91
+ borderColor: colors.divider,
92
+ mx: "10%",
93
+ } }), (0, jsx_runtime_1.jsx)(material_1.Stack, { sx: {
94
+ borderBottom: 1,
95
+ borderColor: colors.divider,
96
+ py: 0.5,
97
+ }, children: attachments.map((attachment) => ((0, jsx_runtime_1.jsx)(material_1.Box, { children: renderFile(attachment, handlePreviewAttachment) }, attachment.id))) })] })) : null, uploadError ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "error", sx: { fontSize: 12, px: 1.5, py: 0.75 }, children: uploadError })) : null, renderViewer(previewAttachment, () => setPreviewAttachment(null))] }));
98
+ }
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.FileViewer = FileViewer;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = require("react");
10
+ const CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
11
+ const DownloadRounded_1 = __importDefault(require("@mui/icons-material/DownloadRounded"));
12
+ const material_1 = require("@mui/material");
13
+ const react_2 = require("react");
14
+ const rasterImageTypes = new Set([
15
+ "image/jpeg",
16
+ "image/png",
17
+ "image/gif",
18
+ "image/webp",
19
+ ]);
20
+ function getPreviewKind(contentType) {
21
+ if (rasterImageTypes.has(contentType))
22
+ return "image";
23
+ if (contentType === "application/pdf")
24
+ return "pdf";
25
+ if (contentType.startsWith("text/") || contentType === "application/json") {
26
+ return "text";
27
+ }
28
+ if (contentType.startsWith("audio/"))
29
+ return "audio";
30
+ if (contentType.startsWith("video/"))
31
+ return "video";
32
+ return null;
33
+ }
34
+ function FileViewer(props) {
35
+ const { attachment } = props;
36
+ const fileKey = attachment
37
+ ? `${attachment.id}/${attachment.blobUrl}`
38
+ : "closed";
39
+ // Product decision: file-specific loading and error state belongs to the
40
+ // viewer. Consumers may replace the selected file without coordinating a
41
+ // React key or clearing state from the previous selection.
42
+ return (0, react_1.createElement)(FileViewerState, { ...props, key: fileKey });
43
+ }
44
+ function FileViewerState({ attachment, onClose, loadFile, onDownload, }) {
45
+ const [downloadError, setDownloadError] = (0, react_2.useState)(null);
46
+ const [downloading, setDownloading] = (0, react_2.useState)(false);
47
+ async function download() {
48
+ if (!attachment || downloading)
49
+ return;
50
+ setDownloading(true);
51
+ setDownloadError(null);
52
+ try {
53
+ await onDownload(attachment);
54
+ }
55
+ catch (error) {
56
+ console.error("[FileViewer] Download failed.", {
57
+ fileId: attachment.id,
58
+ error,
59
+ });
60
+ setDownloadError("Could not download this file. Check your connection and try downloading again.");
61
+ }
62
+ finally {
63
+ setDownloading(false);
64
+ }
65
+ }
66
+ const previewKind = attachment
67
+ ? getPreviewKind(attachment.contentType)
68
+ : null;
69
+ return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { fullWidth: true, maxWidth: "md", onClose: onClose, open: Boolean(attachment), children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { sx: { pr: 6 }, children: [attachment === null || attachment === void 0 ? void 0 : attachment.fileName, (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": "Close attachment preview", onClick: onClose, sx: { position: "absolute", right: 8, top: 8 }, children: (0, jsx_runtime_1.jsx)(CloseRounded_1.default, {}) })] }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { dividers: true, sx: { minHeight: 240 }, children: attachment ? ((0, jsx_runtime_1.jsx)(AttachmentViewerContent, { attachment: attachment, loadFile: loadFile, previewKind: previewKind })) : null }), downloadError ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { role: "alert", color: "error", sx: { px: 3 }, children: downloadError })) : null, (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: attachment ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": "Download attachment", disabled: downloading, onClick: () => void download(), children: (0, jsx_runtime_1.jsx)(DownloadRounded_1.default, {}) })) : null })] }));
70
+ }
71
+ function AttachmentViewerContent({ attachment, previewKind, loadFile, }) {
72
+ if (!previewKind) {
73
+ return ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.secondary", children: "This file type can\u2019t be displayed here. Download it to open it in a compatible app." }));
74
+ }
75
+ return ((0, jsx_runtime_1.jsx)(LoadableAttachmentPreview, { attachment: attachment, previewKind: previewKind, loadFile: loadFile }));
76
+ }
77
+ function LoadableAttachmentPreview({ attachment, previewKind, loadFile, }) {
78
+ const [error, setError] = (0, react_2.useState)(null);
79
+ const [loading, setLoading] = (0, react_2.useState)(true);
80
+ const [previewUrl, setPreviewUrl] = (0, react_2.useState)(null);
81
+ const [text, setText] = (0, react_2.useState)(null);
82
+ function handleMediaDecodeError() {
83
+ console.error("[FileViewer] Browser could not decode the file preview.", {
84
+ contentType: attachment.contentType,
85
+ fileId: attachment.id,
86
+ previewKind,
87
+ });
88
+ setError("Unable to display this file. You can download it instead.");
89
+ }
90
+ (0, react_2.useEffect)(() => {
91
+ let objectUrl = null;
92
+ let cancelled = false;
93
+ const controller = new AbortController();
94
+ void (async () => {
95
+ try {
96
+ const blob = attachment.blobUrl.startsWith("blob:")
97
+ ? await fetch(attachment.blobUrl).then((response) => response.blob())
98
+ : await loadFile(attachment, controller.signal);
99
+ if (cancelled)
100
+ return;
101
+ if (previewKind === "text") {
102
+ const content = await blob.text();
103
+ if (!cancelled)
104
+ setText(content);
105
+ return;
106
+ }
107
+ objectUrl = attachment.blobUrl.startsWith("blob:")
108
+ ? attachment.blobUrl
109
+ : URL.createObjectURL(new Blob([blob], { type: attachment.contentType }));
110
+ setPreviewUrl(objectUrl);
111
+ }
112
+ catch (caughtError) {
113
+ if (!cancelled) {
114
+ console.error("[FileViewer] Unable to load the file preview.", {
115
+ contentType: attachment.contentType,
116
+ error: caughtError,
117
+ fileId: attachment.id,
118
+ });
119
+ setError("Unable to display this file. You can download it instead.");
120
+ }
121
+ }
122
+ finally {
123
+ if (!cancelled)
124
+ setLoading(false);
125
+ }
126
+ })();
127
+ return () => {
128
+ cancelled = true;
129
+ controller.abort();
130
+ if (objectUrl && !attachment.blobUrl.startsWith("blob:")) {
131
+ URL.revokeObjectURL(objectUrl);
132
+ }
133
+ };
134
+ }, [attachment, previewKind, loadFile]);
135
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: "grid", minHeight: 200, placeItems: "center" }, children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { "aria-label": "Loading attachment preview" }) })) : error ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "error", role: "alert", children: error })) : previewKind === "image" ? ((0, jsx_runtime_1.jsx)(material_1.Box, { alt: attachment.fileName, component: "img", onError: handleMediaDecodeError, src: previewUrl !== null && previewUrl !== void 0 ? previewUrl : undefined, sx: {
136
+ display: "block",
137
+ maxHeight: "65vh",
138
+ maxWidth: "100%",
139
+ mx: "auto",
140
+ } })) : previewKind === "pdf" ? ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "iframe", referrerPolicy: "no-referrer",
141
+ // Product decision: PDFs are collaborator-controlled active-format
142
+ // documents. Keep their browsing context opaque and block scripts,
143
+ // forms, popups and top-level navigation while retaining preview.
144
+ sandbox: "", src: previewUrl !== null && previewUrl !== void 0 ? previewUrl : undefined, title: "Attachment preview", sx: { border: 0, height: "65vh", width: "100%" } })) : previewKind === "text" ? ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "pre", sx: {
145
+ fontFamily: "monospace",
146
+ fontSize: 13,
147
+ m: 0,
148
+ overflow: "auto",
149
+ whiteSpace: "pre-wrap",
150
+ }, children: text })) : previewKind === "audio" ? ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "audio", controls: true, onError: handleMediaDecodeError, src: previewUrl !== null && previewUrl !== void 0 ? previewUrl : undefined, sx: { width: "100%" } })) : ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "video", controls: true, onError: handleMediaDecodeError, src: previewUrl !== null && previewUrl !== void 0 ? previewUrl : undefined, sx: { maxHeight: "65vh", maxWidth: "100%", width: "100%" } })) }));
151
+ }
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImageCropDialog = ImageCropDialog;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const material_1 = require("@mui/material");
8
+ const cameraCropPresentation_js_1 = require("./cameraCropPresentation.js");
9
+ const cameraCropPresentation_js_2 = require("./cameraCropPresentation.js");
10
+ const file_uploads_1 = require("@bayonai/file-uploads");
11
+ const DEFAULT_LABELS = {
12
+ title: "Crop photo",
13
+ close: "Close crop photo",
14
+ preview: "Photo crop preview",
15
+ confirm: "Use photo",
16
+ opening: "Opening photo…",
17
+ instruction: "Drag to position your photo",
18
+ zoom: "Zoom",
19
+ horizontal: "Horizontal position",
20
+ vertical: "Vertical position",
21
+ decodeError: "This photo could not be opened. Close this window and choose a JPEG, PNG or WebP photo.",
22
+ previewError: "The photo preview is unavailable. Close this window and choose a different photo.",
23
+ };
24
+ /** Emits orientation-correct decoded-pixel coordinates; the host persists them. */
25
+ function ImageCropDialog({ file, busy, error, onClose, onConfirm, labels, previewShape = "circle", previewWidth = "min(100%, 280px, 35dvh)", }) {
26
+ const copy = { ...DEFAULT_LABELS, ...labels };
27
+ const copyRef = (0, react_1.useRef)(copy);
28
+ // Publish copy after commit so abandoned renders cannot change async feedback.
29
+ (0, react_1.useEffect)(() => {
30
+ copyRef.current = copy;
31
+ });
32
+ const titleId = (0, react_1.useId)();
33
+ const [decodedImage, setDecodedImage] = (0, react_1.useState)(null);
34
+ const bitmap = (decodedImage === null || decodedImage === void 0 ? void 0 : decodedImage.file) === file ? decodedImage.bitmap : null;
35
+ const [ownedDecodeError, setOwnedDecodeError] = (0, react_1.useState)(null);
36
+ const decodeError = (ownedDecodeError === null || ownedDecodeError === void 0 ? void 0 : ownedDecodeError.file) === file ? ownedDecodeError.message : null;
37
+ const [ownedFraming, setOwnedFraming] = (0, react_1.useState)(null);
38
+ const framing = (ownedFraming === null || ownedFraming === void 0 ? void 0 : ownedFraming.file) === file ? ownedFraming.framing : file_uploads_1.INITIAL_CROP_FRAMING;
39
+ function setFraming(update) {
40
+ setOwnedFraming((previous) => ({
41
+ file,
42
+ framing: update((previous === null || previous === void 0 ? void 0 : previous.file) === file ? previous.framing : file_uploads_1.INITIAL_CROP_FRAMING),
43
+ }));
44
+ }
45
+ const canvas = (0, react_1.useRef)(null);
46
+ const drag = (0, react_1.useRef)(null);
47
+ const submitting = (0, react_1.useRef)(false);
48
+ (0, react_1.useEffect)(() => {
49
+ let active = true;
50
+ let decoded;
51
+ async function decode() {
52
+ try {
53
+ if (typeof createImageBitmap !== "function")
54
+ throw new Error("Browser image decoding is unavailable.");
55
+ decoded = await createImageBitmap(file, {
56
+ imageOrientation: "from-image",
57
+ });
58
+ if (!active) {
59
+ decoded.close();
60
+ return;
61
+ }
62
+ if (!(decoded.width > 0 && decoded.height > 0))
63
+ throw new Error("Decoded photo dimensions are empty.");
64
+ setDecodedImage({ file, bitmap: decoded });
65
+ }
66
+ catch (error) {
67
+ if (!active)
68
+ return;
69
+ console.error("[ImageCropDialog] Could not decode selected photo.", {
70
+ error,
71
+ fileType: file.type,
72
+ });
73
+ setOwnedDecodeError({
74
+ file,
75
+ message: copyRef.current.decodeError,
76
+ });
77
+ }
78
+ }
79
+ void decode();
80
+ return () => {
81
+ active = false;
82
+ drag.current = null;
83
+ decoded === null || decoded === void 0 ? void 0 : decoded.close();
84
+ };
85
+ }, [file]);
86
+ const crop = bitmap ? (0, file_uploads_1.getSquareImageCrop)(bitmap, framing) : null;
87
+ (0, react_1.useEffect)(() => {
88
+ if (!bitmap || !canvas.current)
89
+ return;
90
+ const previewCrop = (0, file_uploads_1.getSquareImageCrop)(bitmap, framing);
91
+ const frame = requestAnimationFrame(() => {
92
+ var _a;
93
+ try {
94
+ const context = (_a = canvas.current) === null || _a === void 0 ? void 0 : _a.getContext("2d");
95
+ if (!context)
96
+ throw new Error("Canvas preview is unavailable.");
97
+ context.clearRect(0, 0, 512, 512);
98
+ context.drawImage(bitmap, previewCrop.x, previewCrop.y, previewCrop.width, previewCrop.height, 0, 0, 512, 512);
99
+ }
100
+ catch (error) {
101
+ console.error("[ImageCropDialog] Could not render selected crop.", {
102
+ error,
103
+ });
104
+ setOwnedDecodeError({
105
+ file,
106
+ message: copyRef.current.previewError,
107
+ });
108
+ }
109
+ });
110
+ return () => cancelAnimationFrame(frame);
111
+ }, [bitmap, framing, file]);
112
+ function endDrag(event) {
113
+ var _a;
114
+ if (((_a = drag.current) === null || _a === void 0 ? void 0 : _a.id) !== event.pointerId)
115
+ return;
116
+ drag.current = null;
117
+ if (event.currentTarget.hasPointerCapture(event.pointerId))
118
+ event.currentTarget.releasePointerCapture(event.pointerId);
119
+ }
120
+ async function confirm() {
121
+ if (busy || submitting.current || !crop || decodeError)
122
+ return;
123
+ submitting.current = true;
124
+ try {
125
+ await onConfirm(crop);
126
+ }
127
+ finally {
128
+ submitting.current = false;
129
+ }
130
+ }
131
+ const disabled = busy || !bitmap || Boolean(decodeError);
132
+ return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: true, fullWidth: true, maxWidth: "xs", onClose: () => {
133
+ if (!busy && !submitting.current)
134
+ onClose();
135
+ }, "aria-labelledby": titleId, onKeyDown: (event) => {
136
+ if (event.key === "Enter") {
137
+ if (!(event.target instanceof HTMLButtonElement))
138
+ event.preventDefault();
139
+ event.stopPropagation();
140
+ }
141
+ }, slotProps: {
142
+ paper: {
143
+ sx: {
144
+ maxHeight: "calc(100dvh - 32px)",
145
+ m: 2,
146
+ width: "calc(100% - 32px)",
147
+ },
148
+ },
149
+ }, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { id: titleId, sx: { pr: 7 }, children: [copy.title, (0, jsx_runtime_1.jsx)(cameraCropPresentation_js_1.DialogCloseButton, { label: copy.close, disabled: busy, onClose: () => {
150
+ if (!submitting.current)
151
+ onClose();
152
+ } })] }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 1.5, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { role: "img", "aria-label": copy.preview, sx: {
153
+ aspectRatio: "1",
154
+ // Keep framing controls near the preview on short viewports;
155
+ // pointer coordinates still use this element's actual bounds.
156
+ width: previewWidth,
157
+ alignSelf: "center",
158
+ flexShrink: 0,
159
+ position: "relative",
160
+ overflow: "hidden",
161
+ borderRadius: 1,
162
+ bgcolor: "action.hover",
163
+ touchAction: "none",
164
+ cursor: disabled ? "default" : "grab",
165
+ }, onPointerDown: (event) => {
166
+ if (disabled || !event.isPrimary)
167
+ return;
168
+ event.currentTarget.setPointerCapture(event.pointerId);
169
+ drag.current = {
170
+ id: event.pointerId,
171
+ x: event.clientX,
172
+ y: event.clientY,
173
+ };
174
+ }, onPointerMove: (event) => {
175
+ const previous = drag.current;
176
+ if (disabled ||
177
+ !bitmap ||
178
+ !previous ||
179
+ previous.id !== event.pointerId)
180
+ return;
181
+ const size = event.currentTarget.getBoundingClientRect().width;
182
+ setFraming((value) => (0, file_uploads_1.panSquareImageCrop)(bitmap, value, event.clientX - previous.x, event.clientY - previous.y, size));
183
+ drag.current = {
184
+ id: event.pointerId,
185
+ x: event.clientX,
186
+ y: event.clientY,
187
+ };
188
+ }, onPointerUp: endDrag, onPointerCancel: endDrag, onLostPointerCapture: () => {
189
+ drag.current = null;
190
+ }, children: [(0, jsx_runtime_1.jsx)("canvas", { ref: canvas, width: 512, height: 512, "aria-hidden": "true", style: { display: "block", width: "100%", height: "100%" } }), (0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": true, sx: {
191
+ position: "absolute",
192
+ inset: 0,
193
+ borderRadius: previewShape === "circle" ? "50%" : 0,
194
+ border: "2px solid",
195
+ borderColor: "common.white",
196
+ boxShadow: "0 0 0 100vmax rgba(0,0,0,0.45)",
197
+ pointerEvents: "none",
198
+ } })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: !bitmap && !decodeError ? copy.opening : copy.instruction }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
199
+ display: "grid",
200
+ gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
201
+ columnGap: 2,
202
+ }, children: [
203
+ [copy.zoom, "zoom", 1, 4, 0.01],
204
+ [copy.horizontal, "horizontal", 0, 100, 1],
205
+ [copy.vertical, "vertical", 0, 100, 1],
206
+ ].map(([label, key, min, max, step]) => ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
207
+ minWidth: 0,
208
+ display: "flex",
209
+ flexDirection: "column",
210
+ gridColumn: key === "zoom" ? "1 / -1" : undefined,
211
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { id: `${titleId}-${key}`, variant: "body2", sx: { flex: 1, overflowWrap: "anywhere" }, children: label }), (0, jsx_runtime_1.jsx)(material_1.Slider, { "aria-label": label, "aria-labelledby": `${titleId}-${key}`, min: min, max: max, step: step, value: framing[key], disabled: disabled, onChange: (_event, value) => {
212
+ if (typeof value === "number")
213
+ setFraming((previous) => ({ ...previous, [key]: value }));
214
+ } })] }, key))) }), decodeError || error ? ((0, jsx_runtime_1.jsx)(cameraCropPresentation_js_2.StatusNotice, { tone: "error", message: decodeError !== null && decodeError !== void 0 ? decodeError : error })) : null] }) }), (0, jsx_runtime_1.jsx)(cameraCropPresentation_js_1.DialogActionButtons, { confirmLabel: copy.confirm, confirmDisabled: disabled, confirmIcon: busy ? (0, jsx_runtime_1.jsx)(cameraCropPresentation_js_1.DialogActionProgress, {}) : undefined, onConfirm: () => void confirm() })] }));
215
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.UploadProgressRing = UploadProgressRing;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const material_1 = require("@mui/material");
7
+ /**
8
+ * Presents determinate upload progress at the object being changed.
9
+ *
10
+ * Product decision: progress belongs with a compact upload target rather than
11
+ * in a separate status row. The host owns file selection, upload lifecycle,
12
+ * validation, errors, and disabled interaction; this primitive only renders
13
+ * the accessible visual state around its child.
14
+ */
15
+ function UploadProgressRing({ children, progress, progressLabel, size = 88, sx, thickness = 3, }) {
16
+ const isUploading = progress !== null;
17
+ const normalizedProgress = Math.min(100, Math.max(0, progress !== null && progress !== void 0 ? progress : 0));
18
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { "aria-busy": isUploading || undefined, "data-component": "upload-progress-ring", sx: {
19
+ alignItems: "center",
20
+ display: "inline-flex",
21
+ height: size,
22
+ justifyContent: "center",
23
+ position: "relative",
24
+ width: size,
25
+ ...sx,
26
+ }, children: [children, isUploading ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { "aria-label": progressLabel, size: size, sx: {
27
+ left: 0,
28
+ pointerEvents: "none",
29
+ position: "absolute",
30
+ top: 0,
31
+ }, thickness: thickness, value: normalizedProgress, variant: "determinate" })) : null] }));
32
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.StatusNotice = exports.DialogCloseButton = exports.DialogActionProgress = exports.DialogActionButtons = void 0;
5
+ // Product decision: camera/crop retain their shared host-theme presentation;
6
+ // delegate to the canonical actions/feedback bodies instead of copying them.
7
+ var DialogActionButtons_js_1 = require("../actions/DialogActionButtons.js");
8
+ Object.defineProperty(exports, "DialogActionButtons", { enumerable: true, get: function () { return DialogActionButtons_js_1.DialogActionButtons; } });
9
+ Object.defineProperty(exports, "DialogActionProgress", { enumerable: true, get: function () { return DialogActionButtons_js_1.DialogActionProgress; } });
10
+ Object.defineProperty(exports, "DialogCloseButton", { enumerable: true, get: function () { return DialogActionButtons_js_1.DialogCloseButton; } });
11
+ var StatusNotice_js_1 = require("../feedback/StatusNotice.js");
12
+ Object.defineProperty(exports, "StatusNotice", { enumerable: true, get: function () { return StatusNotice_js_1.StatusNotice; } });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImageCropDialog = exports.CameraCaptureDialog = exports.useUploadLock = exports.UploadProgressRing = exports.FileViewer = exports.FileThumbnail = exports.FileRow = exports.FileUpload = void 0;
5
+ var FileUpload_js_1 = require("./FileUpload.js");
6
+ Object.defineProperty(exports, "FileUpload", { enumerable: true, get: function () { return FileUpload_js_1.FileUpload; } });
7
+ var FileRow_js_1 = require("./FileRow.js");
8
+ Object.defineProperty(exports, "FileRow", { enumerable: true, get: function () { return FileRow_js_1.FileRow; } });
9
+ var FileThumbnail_js_1 = require("./FileThumbnail.js");
10
+ Object.defineProperty(exports, "FileThumbnail", { enumerable: true, get: function () { return FileThumbnail_js_1.FileThumbnail; } });
11
+ var FileViewer_js_1 = require("./FileViewer.js");
12
+ Object.defineProperty(exports, "FileViewer", { enumerable: true, get: function () { return FileViewer_js_1.FileViewer; } });
13
+ var UploadProgressRing_js_1 = require("./UploadProgressRing.js");
14
+ Object.defineProperty(exports, "UploadProgressRing", { enumerable: true, get: function () { return UploadProgressRing_js_1.UploadProgressRing; } });
15
+ var hooks_1 = require("@bayonai/file-uploads/hooks");
16
+ Object.defineProperty(exports, "useUploadLock", { enumerable: true, get: function () { return hooks_1.useUploadLock; } });
17
+ var CameraCaptureDialog_js_1 = require("./CameraCaptureDialog.js");
18
+ Object.defineProperty(exports, "CameraCaptureDialog", { enumerable: true, get: function () { return CameraCaptureDialog_js_1.CameraCaptureDialog; } });
19
+ var ImageCropDialog_js_1 = require("./ImageCropDialog.js");
20
+ Object.defineProperty(exports, "ImageCropDialog", { enumerable: true, get: function () { return ImageCropDialog_js_1.ImageCropDialog; } });
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
4
+ import { Box, ListItemIcon, ListSubheader, Menu, MenuItem, Tooltip, } from "@mui/material";
5
+ import { Fragment, useId, useState } from "react";
6
+ import { LoadingIconButton } from "./LoadingIconButton.js";
7
+ /** A compact, grouped action menu with an optional in-flight trigger state. */
8
+ export function ActionMenu({ actionColorSx, actions, buttonSx, containerSx, disabled = false, label = "Actions", loading = false, loadingLabel = `${label} loading`, size = "small", }) {
9
+ const menuId = useId();
10
+ const [anchorElement, setAnchorElement] = useState(null);
11
+ const open = Boolean(anchorElement);
12
+ function handleAction(action) {
13
+ setAnchorElement(null);
14
+ action.onClick();
15
+ }
16
+ return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: loading ? loadingLabel : label, children: _jsx(Box, { component: "span", sx: containerSx, children: _jsx(LoadingIconButton, { "aria-controls": open ? menuId : undefined, "aria-expanded": open ? "true" : undefined, "aria-haspopup": "menu", "aria-label": label, disabled: disabled, loading: loading, loadingLabel: loadingLabel, onClick: (event) => setAnchorElement(event.currentTarget), size: size, sx: buttonSx, children: _jsx(MoreHorizIcon, { fontSize: size === "large" ? "medium" : "small" }) }) }) }), _jsx(Menu, { anchorEl: anchorElement, anchorOrigin: { horizontal: "right", vertical: "bottom" }, disableScrollLock: true, id: menuId, onClose: () => setAnchorElement(null), open: open, transformOrigin: { horizontal: "right", vertical: "top" }, children: actions.map((action, index) => {
17
+ var _a, _b, _c, _d;
18
+ return (_jsxs(Fragment, { children: [action.section &&
19
+ action.section !== ((_a = actions[index - 1]) === null || _a === void 0 ? void 0 : _a.section) ? (_jsx(ListSubheader, { children: action.section })) : null, _jsxs(MenuItem, { disabled: action.disabled, onClick: () => handleAction(action), sx: (_c = actionColorSx === null || actionColorSx === void 0 ? void 0 : actionColorSx[(_b = action.color) !== null && _b !== void 0 ? _b : "default"]) !== null && _c !== void 0 ? _c : getDefaultActionColorSx(action.color), children: [action.icon ? _jsx(ListItemIcon, { children: action.icon }) : null, action.label] })] }, `${(_d = action.section) !== null && _d !== void 0 ? _d : "default"}:${action.label}`));
20
+ }) })] }));
21
+ }
22
+ function getDefaultActionColorSx(color) {
23
+ if (color === "primary")
24
+ return { color: "primary.main" };
25
+ if (color === "secondary")
26
+ return { color: "secondary.main" };
27
+ if (color === "error")
28
+ return { color: "error.main" };
29
+ return undefined;
30
+ }
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import CheckIcon from "@mui/icons-material/Check";
4
+ import CloseIcon from "@mui/icons-material/Close";
5
+ import { CircularProgress, DialogActions, IconButton, Stack, Tooltip, } from "@mui/material";
6
+ // Product decision: concise decisions/info fit content above a readable 320px floor.
7
+ // Keep MUI's readable maxWidth/viewport cap; forms and previews own their sizing.
8
+ export const compactDialogPaperSx = {
9
+ width: "fit-content",
10
+ // Preserve MUI's 32px margins even when the viewport is narrower than the floor.
11
+ minWidth: "min(320px, calc(100% - 64px))",
12
+ overflowWrap: "anywhere",
13
+ };
14
+ /** Keeps the modal's primary decision compact and explicitly labelled. */
15
+ export function DialogActionButtons({ confirmColor = "success", confirmDisabled = false, confirmIcon, confirmLabel, confirmType = "button", onConfirm, sx, }) {
16
+ return (_jsx(DialogActions, { sx: sx, children: _jsx(Stack, { direction: "row", spacing: 1, children: _jsx(Tooltip, { title: confirmLabel, children: _jsx("span", { children: _jsx(IconButton, { "aria-label": confirmLabel, color: confirmColor, disabled: confirmDisabled, onClick: confirmType === "submit" ? undefined : onConfirm, type: confirmType, children: confirmIcon !== null && confirmIcon !== void 0 ? confirmIcon : _jsx(CheckIcon, {}) }) }) }) }) }));
17
+ }
18
+ export function DialogActionProgress() {
19
+ return _jsx(CircularProgress, { color: "inherit", size: 20 });
20
+ }
21
+ export function DialogCloseButton({ disabled = false, label = "Close", onClose, sx, }) {
22
+ // Product decision: dismissible dialogs have one close action in the title's top-right corner.
23
+ return (_jsx(Stack, { sx: { position: "absolute", right: 16, top: 16, ...sx }, children: _jsx(Tooltip, { title: label, children: _jsx("span", { children: _jsx(IconButton, { "aria-label": label, disabled: disabled, onClick: onClose, size: "small", type: "button", children: _jsx(CloseIcon, { fontSize: "small" }) }) }) }) }));
24
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { CircularProgress, IconButton, } from "@mui/material";
4
+ /** Keeps an icon action's footprint while making an in-flight request visible. */
5
+ export function LoadingIconButton({ "aria-label": ariaLabel, children, disabled, loading = false, loadingLabel, spinnerSize = 20, ...props }) {
6
+ return (_jsx(IconButton, { ...props, "aria-busy": loading || undefined, "aria-label": loading ? loadingLabel : ariaLabel, disabled: disabled || loading, children: loading ? (_jsx(CircularProgress, { "aria-label": loadingLabel, color: "inherit", size: spinnerSize })) : (children) }));
7
+ }
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Box } from "@mui/material";
4
+ /**
5
+ * Keeps the final actions of a long, scrollable form in view.
6
+ *
7
+ * Product decision: this component owns local sticky positioning and neutral
8
+ * footer chrome only. The host owns its scroll container, any edge-to-edge
9
+ * bleed required by a padded surface, action layout, and form submission.
10
+ */
11
+ export function StickyActionFooter({ children, sx }) {
12
+ return (_jsx(Box, { component: "footer", "data-component": "sticky-action-footer", sx: {
13
+ backgroundColor: "background.paper",
14
+ borderColor: "divider",
15
+ borderTop: 1,
16
+ bottom: 0,
17
+ mt: 1,
18
+ p: 2,
19
+ position: "sticky",
20
+ // Local stacking keeps the footer above fields without escaping its form.
21
+ zIndex: 1,
22
+ ...sx,
23
+ }, children: children }));
24
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Button, } from "@mui/material";
4
+ import { StickyActionFooter } from "./StickyActionFooter.js";
5
+ export function StickySubmitButton({ buttonSx, disabled = false, footerSx, label = "Save", loading = false, variant = "contained", }) {
6
+ return (_jsx(StickyActionFooter, { sx: footerSx, children: _jsx(Button, { color: "secondary", disabled: disabled, fullWidth: true, loading: loading, sx: { minHeight: 44, ...buttonSx }, type: "submit", variant: variant, children: label }) }));
7
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ // TL-M249: preserve the established MUI presentation under its owning package.
3
+ export { ActionMenu, } from "./ActionMenu.js";
4
+ export { LoadingIconButton, } from "./LoadingIconButton.js";
5
+ export { StickyActionFooter, } from "./StickyActionFooter.js";
6
+ export { StickySubmitButton, } from "./StickySubmitButton.js";
7
+ export { compactDialogPaperSx, DialogActionButtons, DialogActionProgress, DialogCloseButton, } from "./DialogActionButtons.js";