@bayonai/mui-design 1.9.0 → 1.10.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/CHANGELOG.md +6 -0
- package/README.md +18 -0
- package/package.json +1 -1
- package/dist/cjs/actions/ActionMenu.d.ts +0 -24
- package/dist/cjs/actions/ActionMenu.js +0 -36
- package/dist/cjs/actions/DialogActionButtons.d.ts +0 -23
- package/dist/cjs/actions/DialogActionButtons.js +0 -33
- package/dist/cjs/actions/LoadingIconButton.d.ts +0 -11
- package/dist/cjs/actions/LoadingIconButton.js +0 -10
- package/dist/cjs/actions/StickyActionFooter.d.ts +0 -14
- package/dist/cjs/actions/StickyActionFooter.js +0 -27
- package/dist/cjs/actions/StickySubmitButton.d.ts +0 -10
- package/dist/cjs/actions/StickySubmitButton.js +0 -10
- package/dist/cjs/actions/index.d.ts +0 -5
- package/dist/cjs/actions/index.js +0 -18
- package/dist/cjs/client.d.ts +0 -4
- package/dist/cjs/client.js +0 -21
- package/dist/cjs/components/BayonFlowVisual.d.ts +0 -12
- package/dist/cjs/components/BayonFlowVisual.js +0 -87
- package/dist/cjs/components/BayonThemeModeToggle.d.ts +0 -6
- package/dist/cjs/components/BayonThemeModeToggle.js +0 -34
- package/dist/cjs/components/IconTooltipButton.d.ts +0 -10
- package/dist/cjs/components/IconTooltipButton.js +0 -50
- package/dist/cjs/components/panels.d.ts +0 -37
- package/dist/cjs/components/panels.js +0 -92
- package/dist/cjs/drawers/BottomDrawer.d.ts +0 -16
- package/dist/cjs/drawers/BottomDrawer.js +0 -43
- package/dist/cjs/drawers/MobileBottomDrawer.d.ts +0 -20
- package/dist/cjs/drawers/MobileBottomDrawer.js +0 -102
- package/dist/cjs/drawers/MobileBottomDrawerHeader.d.ts +0 -11
- package/dist/cjs/drawers/MobileBottomDrawerHeader.js +0 -36
- package/dist/cjs/drawers/ResponsiveDrawer.d.ts +0 -25
- package/dist/cjs/drawers/ResponsiveDrawer.js +0 -22
- package/dist/cjs/drawers/WorkspaceSidePane.d.ts +0 -29
- package/dist/cjs/drawers/WorkspaceSidePane.js +0 -222
- package/dist/cjs/drawers/WorkspaceSidePaneRoot.d.ts +0 -1
- package/dist/cjs/drawers/WorkspaceSidePaneRoot.js +0 -93
- package/dist/cjs/drawers/drawerAppearance.d.ts +0 -8
- package/dist/cjs/drawers/drawerAppearance.js +0 -10
- package/dist/cjs/drawers/index.d.ts +0 -7
- package/dist/cjs/drawers/index.js +0 -19
- package/dist/cjs/drawers/useVisualViewportBottomInset.d.ts +0 -6
- package/dist/cjs/drawers/useVisualViewportBottomInset.js +0 -33
- package/dist/cjs/drawers/workspaceSidePaneGeometry.d.ts +0 -11
- package/dist/cjs/drawers/workspaceSidePaneGeometry.js +0 -15
- package/dist/cjs/feedback/StatusNotice.d.ts +0 -13
- package/dist/cjs/feedback/StatusNotice.js +0 -62
- package/dist/cjs/feedback/index.d.ts +0 -1
- package/dist/cjs/feedback/index.js +0 -7
- package/dist/cjs/index.d.ts +0 -9
- package/dist/cjs/index.js +0 -25
- package/dist/cjs/internal/DialogChoiceTile.d.ts +0 -20
- package/dist/cjs/internal/DialogChoiceTile.js +0 -60
- package/dist/cjs/links/LinkAddressPreview.d.ts +0 -19
- package/dist/cjs/links/LinkAddressPreview.js +0 -80
- package/dist/cjs/links/index.d.ts +0 -3
- package/dist/cjs/links/index.js +0 -9
- package/dist/cjs/links/useLinkAddressPreview.d.ts +0 -26
- package/dist/cjs/links/useLinkAddressPreview.js +0 -162
- package/dist/cjs/location/GeographicLocationField.d.ts +0 -26
- package/dist/cjs/location/GeographicLocationField.js +0 -49
- package/dist/cjs/location/GoogleMapsAttribution.d.ts +0 -1
- package/dist/cjs/location/GoogleMapsAttribution.js +0 -12
- package/dist/cjs/location/MetadataFieldGroup.d.ts +0 -5
- package/dist/cjs/location/MetadataFieldGroup.js +0 -13
- package/dist/cjs/location/MetadataValueField.d.ts +0 -23
- package/dist/cjs/location/MetadataValueField.js +0 -27
- package/dist/cjs/location/SearchInputAction.d.ts +0 -9
- package/dist/cjs/location/SearchInputAction.js +0 -14
- package/dist/cjs/location/TemplateBadge.d.ts +0 -5
- package/dist/cjs/location/TemplateBadge.js +0 -9
- package/dist/cjs/location/VenueSearchDialog.d.ts +0 -33
- package/dist/cjs/location/VenueSearchDialog.js +0 -112
- package/dist/cjs/location/index.d.ts +0 -6
- package/dist/cjs/location/index.js +0 -20
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/pending/PendingChangesDialogShell.d.ts +0 -2
- package/dist/cjs/pending/PendingChangesDialogShell.js +0 -16
- package/dist/cjs/pending/PendingChangesDialogView.d.ts +0 -2
- package/dist/cjs/pending/PendingChangesDialogView.js +0 -140
- package/dist/cjs/pending/PendingChangesIndicatorView.d.ts +0 -10
- package/dist/cjs/pending/PendingChangesIndicatorView.js +0 -27
- package/dist/cjs/pending/index.d.ts +0 -3
- package/dist/cjs/pending/index.js +0 -9
- package/dist/cjs/pending/types.d.ts +0 -55
- package/dist/cjs/pending/types.js +0 -2
- package/dist/cjs/pricing/PlanUpgradeDialog.d.ts +0 -17
- package/dist/cjs/pricing/PlanUpgradeDialog.js +0 -22
- package/dist/cjs/pricing/PricingTable.d.ts +0 -28
- package/dist/cjs/pricing/PricingTable.js +0 -60
- package/dist/cjs/pricing/index.d.ts +0 -3
- package/dist/cjs/pricing/index.js +0 -8
- package/dist/cjs/providers/BayonThemeProvider.d.ts +0 -20
- package/dist/cjs/providers/BayonThemeProvider.js +0 -163
- package/dist/cjs/sections/ExpandableSectionToggle.d.ts +0 -12
- package/dist/cjs/sections/ExpandableSectionToggle.js +0 -32
- package/dist/cjs/sections/index.d.ts +0 -2
- package/dist/cjs/sections/index.js +0 -7
- package/dist/cjs/styles/pageStyles.d.ts +0 -15
- package/dist/cjs/styles/pageStyles.js +0 -103
- package/dist/cjs/swipe/SwipeActionRow.d.ts +0 -8
- package/dist/cjs/swipe/SwipeActionRow.js +0 -123
- package/dist/cjs/swipe/index.d.ts +0 -1
- package/dist/cjs/swipe/index.js +0 -8
- package/dist/cjs/theme/components.d.ts +0 -2
- package/dist/cjs/theme/components.js +0 -123
- package/dist/cjs/theme/createBayonTheme.d.ts +0 -4
- package/dist/cjs/theme/createBayonTheme.js +0 -45
- package/dist/cjs/theme/palette.d.ts +0 -146
- package/dist/cjs/theme/palette.js +0 -109
- package/dist/cjs/theme/shadows.d.ts +0 -2
- package/dist/cjs/theme/shadows.js +0 -21
- package/dist/cjs/theme/types.d.ts +0 -47
- package/dist/cjs/theme/types.js +0 -2
- package/dist/cjs/theme/typography.d.ts +0 -2
- package/dist/cjs/theme/typography.js +0 -58
- package/dist/cjs/toasts/ActionToast.d.ts +0 -11
- package/dist/cjs/toasts/ActionToast.js +0 -12
- package/dist/cjs/toasts/Toast.d.ts +0 -16
- package/dist/cjs/toasts/Toast.js +0 -55
- package/dist/cjs/toasts/index.d.ts +0 -5
- package/dist/cjs/toasts/index.js +0 -12
- package/dist/cjs/toasts/useUpwardToastDismiss.d.ts +0 -15
- package/dist/cjs/toasts/useUpwardToastDismiss.js +0 -73
- package/dist/cjs/uploads/CameraCaptureDialog.d.ts +0 -22
- package/dist/cjs/uploads/CameraCaptureDialog.js +0 -187
- package/dist/cjs/uploads/FileRow.d.ts +0 -10
- package/dist/cjs/uploads/FileRow.js +0 -23
- package/dist/cjs/uploads/FileSwipeActionRow.d.ts +0 -1
- package/dist/cjs/uploads/FileSwipeActionRow.js +0 -11
- package/dist/cjs/uploads/FileThumbnail.d.ts +0 -5
- package/dist/cjs/uploads/FileThumbnail.js +0 -104
- package/dist/cjs/uploads/FileUpload.d.ts +0 -26
- package/dist/cjs/uploads/FileUpload.js +0 -98
- package/dist/cjs/uploads/FileViewer.d.ts +0 -9
- package/dist/cjs/uploads/FileViewer.js +0 -155
- package/dist/cjs/uploads/ImageCropDialog.d.ts +0 -26
- package/dist/cjs/uploads/ImageCropDialog.js +0 -215
- package/dist/cjs/uploads/ImageInfoPanel.d.ts +0 -24
- package/dist/cjs/uploads/ImageInfoPanel.js +0 -41
- package/dist/cjs/uploads/ImageUploadQualityDialog.d.ts +0 -13
- package/dist/cjs/uploads/ImageUploadQualityDialog.js +0 -57
- package/dist/cjs/uploads/UploadProgressRing.d.ts +0 -24
- package/dist/cjs/uploads/UploadProgressRing.js +0 -32
- package/dist/cjs/uploads/cameraCropPresentation.d.ts +0 -2
- package/dist/cjs/uploads/cameraCropPresentation.js +0 -12
- package/dist/cjs/uploads/index.d.ts +0 -12
- package/dist/cjs/uploads/index.js +0 -24
- package/dist/cjs/utils/createBayonEmotionCache.d.ts +0 -1
- package/dist/cjs/utils/createBayonEmotionCache.js +0 -21
- package/dist/esm/actions/ActionMenu.js +0 -30
- package/dist/esm/actions/DialogActionButtons.js +0 -24
- package/dist/esm/actions/LoadingIconButton.js +0 -7
- package/dist/esm/actions/StickyActionFooter.js +0 -24
- package/dist/esm/actions/StickySubmitButton.js +0 -7
- package/dist/esm/actions/index.js +0 -7
- package/dist/esm/client.js +0 -5
- package/dist/esm/components/BayonFlowVisual.js +0 -81
- package/dist/esm/components/BayonThemeModeToggle.js +0 -28
- package/dist/esm/components/IconTooltipButton.js +0 -11
- package/dist/esm/components/panels.js +0 -76
- package/dist/esm/drawers/BottomDrawer.js +0 -37
- package/dist/esm/drawers/MobileBottomDrawer.js +0 -95
- package/dist/esm/drawers/MobileBottomDrawerHeader.js +0 -30
- package/dist/esm/drawers/ResponsiveDrawer.js +0 -19
- package/dist/esm/drawers/WorkspaceSidePane.js +0 -216
- package/dist/esm/drawers/WorkspaceSidePaneRoot.js +0 -90
- package/dist/esm/drawers/drawerAppearance.js +0 -7
- package/dist/esm/drawers/index.js +0 -8
- package/dist/esm/drawers/useVisualViewportBottomInset.js +0 -29
- package/dist/esm/drawers/workspaceSidePaneGeometry.js +0 -11
- package/dist/esm/feedback/StatusNotice.js +0 -56
- package/dist/esm/feedback/index.js +0 -3
- package/dist/esm/index.js +0 -9
- package/dist/esm/internal/DialogChoiceTile.js +0 -54
- package/dist/esm/links/LinkAddressPreview.js +0 -74
- package/dist/esm/links/index.js +0 -4
- package/dist/esm/links/useLinkAddressPreview.js +0 -159
- package/dist/esm/location/GeographicLocationField.js +0 -43
- package/dist/esm/location/GoogleMapsAttribution.js +0 -9
- package/dist/esm/location/MetadataFieldGroup.js +0 -9
- package/dist/esm/location/MetadataValueField.js +0 -23
- package/dist/esm/location/SearchInputAction.js +0 -8
- package/dist/esm/location/TemplateBadge.js +0 -6
- package/dist/esm/location/VenueSearchDialog.js +0 -109
- package/dist/esm/location/index.js +0 -7
- package/dist/esm/pending/PendingChangesDialogShell.js +0 -10
- package/dist/esm/pending/PendingChangesDialogView.js +0 -134
- package/dist/esm/pending/PendingChangesIndicatorView.js +0 -21
- package/dist/esm/pending/index.js +0 -4
- package/dist/esm/pending/types.js +0 -1
- package/dist/esm/pricing/PlanUpgradeDialog.js +0 -19
- package/dist/esm/pricing/PricingTable.js +0 -54
- package/dist/esm/pricing/index.js +0 -3
- package/dist/esm/providers/BayonThemeProvider.js +0 -123
- package/dist/esm/sections/ExpandableSectionToggle.js +0 -26
- package/dist/esm/sections/index.js +0 -3
- package/dist/esm/styles/pageStyles.js +0 -100
- package/dist/esm/swipe/SwipeActionRow.js +0 -116
- package/dist/esm/swipe/index.js +0 -3
- package/dist/esm/theme/components.js +0 -120
- package/dist/esm/theme/createBayonTheme.js +0 -41
- package/dist/esm/theme/palette.js +0 -106
- package/dist/esm/theme/shadows.js +0 -18
- package/dist/esm/theme/types.js +0 -1
- package/dist/esm/theme/typography.js +0 -55
- package/dist/esm/toasts/ActionToast.js +0 -9
- package/dist/esm/toasts/Toast.js +0 -52
- package/dist/esm/toasts/index.js +0 -5
- package/dist/esm/toasts/useUpwardToastDismiss.js +0 -69
- package/dist/esm/uploads/CameraCaptureDialog.js +0 -181
- package/dist/esm/uploads/FileRow.js +0 -17
- package/dist/esm/uploads/FileSwipeActionRow.js +0 -7
- package/dist/esm/uploads/FileThumbnail.js +0 -98
- package/dist/esm/uploads/FileUpload.js +0 -92
- package/dist/esm/uploads/FileViewer.js +0 -149
- package/dist/esm/uploads/ImageCropDialog.js +0 -212
- package/dist/esm/uploads/ImageInfoPanel.js +0 -35
- package/dist/esm/uploads/ImageUploadQualityDialog.js +0 -51
- package/dist/esm/uploads/UploadProgressRing.js +0 -29
- package/dist/esm/uploads/cameraCropPresentation.js +0 -5
- package/dist/esm/uploads/index.js +0 -11
- package/dist/esm/utils/createBayonEmotionCache.js +0 -15
- package/dist/types/actions/ActionMenu.d.ts +0 -24
- package/dist/types/actions/DialogActionButtons.d.ts +0 -23
- package/dist/types/actions/LoadingIconButton.d.ts +0 -11
- package/dist/types/actions/StickyActionFooter.d.ts +0 -14
- package/dist/types/actions/StickySubmitButton.d.ts +0 -10
- package/dist/types/actions/index.d.ts +0 -5
- package/dist/types/client.d.ts +0 -4
- package/dist/types/components/BayonFlowVisual.d.ts +0 -12
- package/dist/types/components/BayonThemeModeToggle.d.ts +0 -6
- package/dist/types/components/IconTooltipButton.d.ts +0 -10
- package/dist/types/components/panels.d.ts +0 -37
- package/dist/types/drawers/BottomDrawer.d.ts +0 -16
- package/dist/types/drawers/MobileBottomDrawer.d.ts +0 -20
- package/dist/types/drawers/MobileBottomDrawerHeader.d.ts +0 -11
- package/dist/types/drawers/ResponsiveDrawer.d.ts +0 -25
- package/dist/types/drawers/WorkspaceSidePane.d.ts +0 -29
- package/dist/types/drawers/WorkspaceSidePaneRoot.d.ts +0 -1
- package/dist/types/drawers/drawerAppearance.d.ts +0 -8
- package/dist/types/drawers/index.d.ts +0 -7
- package/dist/types/drawers/useVisualViewportBottomInset.d.ts +0 -6
- package/dist/types/drawers/workspaceSidePaneGeometry.d.ts +0 -11
- package/dist/types/feedback/StatusNotice.d.ts +0 -13
- package/dist/types/feedback/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -9
- package/dist/types/internal/DialogChoiceTile.d.ts +0 -20
- package/dist/types/links/LinkAddressPreview.d.ts +0 -19
- package/dist/types/links/index.d.ts +0 -3
- package/dist/types/links/useLinkAddressPreview.d.ts +0 -26
- package/dist/types/location/GeographicLocationField.d.ts +0 -26
- package/dist/types/location/GoogleMapsAttribution.d.ts +0 -1
- package/dist/types/location/MetadataFieldGroup.d.ts +0 -5
- package/dist/types/location/MetadataValueField.d.ts +0 -23
- package/dist/types/location/SearchInputAction.d.ts +0 -9
- package/dist/types/location/TemplateBadge.d.ts +0 -5
- package/dist/types/location/VenueSearchDialog.d.ts +0 -33
- package/dist/types/location/index.d.ts +0 -6
- package/dist/types/pending/PendingChangesDialogShell.d.ts +0 -2
- package/dist/types/pending/PendingChangesDialogView.d.ts +0 -2
- package/dist/types/pending/PendingChangesIndicatorView.d.ts +0 -10
- package/dist/types/pending/index.d.ts +0 -3
- package/dist/types/pending/types.d.ts +0 -55
- package/dist/types/pricing/PlanUpgradeDialog.d.ts +0 -17
- package/dist/types/pricing/PricingTable.d.ts +0 -28
- package/dist/types/pricing/index.d.ts +0 -3
- package/dist/types/providers/BayonThemeProvider.d.ts +0 -20
- package/dist/types/sections/ExpandableSectionToggle.d.ts +0 -12
- package/dist/types/sections/index.d.ts +0 -2
- package/dist/types/styles/pageStyles.d.ts +0 -15
- package/dist/types/swipe/SwipeActionRow.d.ts +0 -8
- package/dist/types/swipe/index.d.ts +0 -1
- package/dist/types/theme/components.d.ts +0 -2
- package/dist/types/theme/createBayonTheme.d.ts +0 -4
- package/dist/types/theme/palette.d.ts +0 -146
- package/dist/types/theme/shadows.d.ts +0 -2
- package/dist/types/theme/types.d.ts +0 -47
- package/dist/types/theme/typography.d.ts +0 -2
- package/dist/types/toasts/ActionToast.d.ts +0 -11
- package/dist/types/toasts/Toast.d.ts +0 -16
- package/dist/types/toasts/index.d.ts +0 -5
- package/dist/types/toasts/useUpwardToastDismiss.d.ts +0 -15
- package/dist/types/uploads/CameraCaptureDialog.d.ts +0 -22
- package/dist/types/uploads/FileRow.d.ts +0 -10
- package/dist/types/uploads/FileSwipeActionRow.d.ts +0 -1
- package/dist/types/uploads/FileThumbnail.d.ts +0 -5
- package/dist/types/uploads/FileUpload.d.ts +0 -26
- package/dist/types/uploads/FileViewer.d.ts +0 -9
- package/dist/types/uploads/ImageCropDialog.d.ts +0 -26
- package/dist/types/uploads/ImageInfoPanel.d.ts +0 -24
- package/dist/types/uploads/ImageUploadQualityDialog.d.ts +0 -13
- package/dist/types/uploads/UploadProgressRing.d.ts +0 -24
- package/dist/types/uploads/cameraCropPresentation.d.ts +0 -2
- package/dist/types/uploads/index.d.ts +0 -12
- package/dist/types/utils/createBayonEmotionCache.d.ts +0 -1
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useId, useRef, useState } from "react";
|
|
4
|
-
import { Box, Dialog, DialogContent, DialogTitle, Slider, Stack, Typography, } from "@mui/material";
|
|
5
|
-
import { DialogActionButtons, DialogActionProgress, DialogCloseButton, } from "./cameraCropPresentation.js";
|
|
6
|
-
import { StatusNotice } from "./cameraCropPresentation.js";
|
|
7
|
-
import { getSquareImageCrop, INITIAL_CROP_FRAMING, panSquareImageCrop, } from "@bayonai/file-uploads";
|
|
8
|
-
const DEFAULT_LABELS = {
|
|
9
|
-
title: "Crop photo",
|
|
10
|
-
close: "Close crop photo",
|
|
11
|
-
preview: "Photo crop preview",
|
|
12
|
-
confirm: "Use photo",
|
|
13
|
-
opening: "Opening photo…",
|
|
14
|
-
instruction: "Drag to position your photo",
|
|
15
|
-
zoom: "Zoom",
|
|
16
|
-
horizontal: "Horizontal position",
|
|
17
|
-
vertical: "Vertical position",
|
|
18
|
-
decodeError: "This photo could not be opened. Close this window and choose a JPEG, PNG or WebP photo.",
|
|
19
|
-
previewError: "The photo preview is unavailable. Close this window and choose a different photo.",
|
|
20
|
-
};
|
|
21
|
-
/** Emits orientation-correct decoded-pixel coordinates; the host persists them. */
|
|
22
|
-
export function ImageCropDialog({ file, busy, error, onClose, onConfirm, labels, previewShape = "circle", previewWidth = "min(100%, 280px, 35dvh)", }) {
|
|
23
|
-
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
24
|
-
const copyRef = useRef(copy);
|
|
25
|
-
// Publish copy after commit so abandoned renders cannot change async feedback.
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
copyRef.current = copy;
|
|
28
|
-
});
|
|
29
|
-
const titleId = useId();
|
|
30
|
-
const [decodedImage, setDecodedImage] = useState(null);
|
|
31
|
-
const bitmap = (decodedImage === null || decodedImage === void 0 ? void 0 : decodedImage.file) === file ? decodedImage.bitmap : null;
|
|
32
|
-
const [ownedDecodeError, setOwnedDecodeError] = useState(null);
|
|
33
|
-
const decodeError = (ownedDecodeError === null || ownedDecodeError === void 0 ? void 0 : ownedDecodeError.file) === file ? ownedDecodeError.message : null;
|
|
34
|
-
const [ownedFraming, setOwnedFraming] = useState(null);
|
|
35
|
-
const framing = (ownedFraming === null || ownedFraming === void 0 ? void 0 : ownedFraming.file) === file ? ownedFraming.framing : INITIAL_CROP_FRAMING;
|
|
36
|
-
function setFraming(update) {
|
|
37
|
-
setOwnedFraming((previous) => ({
|
|
38
|
-
file,
|
|
39
|
-
framing: update((previous === null || previous === void 0 ? void 0 : previous.file) === file ? previous.framing : INITIAL_CROP_FRAMING),
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
const canvas = useRef(null);
|
|
43
|
-
const drag = useRef(null);
|
|
44
|
-
const submitting = useRef(false);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
let active = true;
|
|
47
|
-
let decoded;
|
|
48
|
-
async function decode() {
|
|
49
|
-
try {
|
|
50
|
-
if (typeof createImageBitmap !== "function")
|
|
51
|
-
throw new Error("Browser image decoding is unavailable.");
|
|
52
|
-
decoded = await createImageBitmap(file, {
|
|
53
|
-
imageOrientation: "from-image",
|
|
54
|
-
});
|
|
55
|
-
if (!active) {
|
|
56
|
-
decoded.close();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (!(decoded.width > 0 && decoded.height > 0))
|
|
60
|
-
throw new Error("Decoded photo dimensions are empty.");
|
|
61
|
-
setDecodedImage({ file, bitmap: decoded });
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
if (!active)
|
|
65
|
-
return;
|
|
66
|
-
console.error("[ImageCropDialog] Could not decode selected photo.", {
|
|
67
|
-
error,
|
|
68
|
-
fileType: file.type,
|
|
69
|
-
});
|
|
70
|
-
setOwnedDecodeError({
|
|
71
|
-
file,
|
|
72
|
-
message: copyRef.current.decodeError,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
void decode();
|
|
77
|
-
return () => {
|
|
78
|
-
active = false;
|
|
79
|
-
drag.current = null;
|
|
80
|
-
decoded === null || decoded === void 0 ? void 0 : decoded.close();
|
|
81
|
-
};
|
|
82
|
-
}, [file]);
|
|
83
|
-
const crop = bitmap ? getSquareImageCrop(bitmap, framing) : null;
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (!bitmap || !canvas.current)
|
|
86
|
-
return;
|
|
87
|
-
const previewCrop = getSquareImageCrop(bitmap, framing);
|
|
88
|
-
const frame = requestAnimationFrame(() => {
|
|
89
|
-
var _a;
|
|
90
|
-
try {
|
|
91
|
-
const context = (_a = canvas.current) === null || _a === void 0 ? void 0 : _a.getContext("2d");
|
|
92
|
-
if (!context)
|
|
93
|
-
throw new Error("Canvas preview is unavailable.");
|
|
94
|
-
context.clearRect(0, 0, 512, 512);
|
|
95
|
-
context.drawImage(bitmap, previewCrop.x, previewCrop.y, previewCrop.width, previewCrop.height, 0, 0, 512, 512);
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
console.error("[ImageCropDialog] Could not render selected crop.", {
|
|
99
|
-
error,
|
|
100
|
-
});
|
|
101
|
-
setOwnedDecodeError({
|
|
102
|
-
file,
|
|
103
|
-
message: copyRef.current.previewError,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return () => cancelAnimationFrame(frame);
|
|
108
|
-
}, [bitmap, framing, file]);
|
|
109
|
-
function endDrag(event) {
|
|
110
|
-
var _a;
|
|
111
|
-
if (((_a = drag.current) === null || _a === void 0 ? void 0 : _a.id) !== event.pointerId)
|
|
112
|
-
return;
|
|
113
|
-
drag.current = null;
|
|
114
|
-
if (event.currentTarget.hasPointerCapture(event.pointerId))
|
|
115
|
-
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
116
|
-
}
|
|
117
|
-
async function confirm() {
|
|
118
|
-
if (busy || submitting.current || !crop || decodeError)
|
|
119
|
-
return;
|
|
120
|
-
submitting.current = true;
|
|
121
|
-
try {
|
|
122
|
-
await onConfirm(crop);
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
submitting.current = false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const disabled = busy || !bitmap || Boolean(decodeError);
|
|
129
|
-
return (_jsxs(Dialog, { open: true, fullWidth: true, maxWidth: "xs", onClose: () => {
|
|
130
|
-
if (!busy && !submitting.current)
|
|
131
|
-
onClose();
|
|
132
|
-
}, "aria-labelledby": titleId, onKeyDown: (event) => {
|
|
133
|
-
if (event.key === "Enter") {
|
|
134
|
-
if (!(event.target instanceof HTMLButtonElement))
|
|
135
|
-
event.preventDefault();
|
|
136
|
-
event.stopPropagation();
|
|
137
|
-
}
|
|
138
|
-
}, slotProps: {
|
|
139
|
-
paper: {
|
|
140
|
-
sx: {
|
|
141
|
-
maxHeight: "calc(100dvh - 32px)",
|
|
142
|
-
m: 2,
|
|
143
|
-
width: "calc(100% - 32px)",
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
}, children: [_jsxs(DialogTitle, { id: titleId, sx: { pr: 7 }, children: [copy.title, _jsx(DialogCloseButton, { label: copy.close, disabled: busy, onClose: () => {
|
|
147
|
-
if (!submitting.current)
|
|
148
|
-
onClose();
|
|
149
|
-
} })] }), _jsx(DialogContent, { children: _jsxs(Stack, { spacing: 1.5, children: [_jsxs(Box, { role: "img", "aria-label": copy.preview, sx: {
|
|
150
|
-
aspectRatio: "1",
|
|
151
|
-
// Keep framing controls near the preview on short viewports;
|
|
152
|
-
// pointer coordinates still use this element's actual bounds.
|
|
153
|
-
width: previewWidth,
|
|
154
|
-
alignSelf: "center",
|
|
155
|
-
flexShrink: 0,
|
|
156
|
-
position: "relative",
|
|
157
|
-
overflow: "hidden",
|
|
158
|
-
borderRadius: 1,
|
|
159
|
-
bgcolor: "action.hover",
|
|
160
|
-
touchAction: "none",
|
|
161
|
-
cursor: disabled ? "default" : "grab",
|
|
162
|
-
}, onPointerDown: (event) => {
|
|
163
|
-
if (disabled || !event.isPrimary)
|
|
164
|
-
return;
|
|
165
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
166
|
-
drag.current = {
|
|
167
|
-
id: event.pointerId,
|
|
168
|
-
x: event.clientX,
|
|
169
|
-
y: event.clientY,
|
|
170
|
-
};
|
|
171
|
-
}, onPointerMove: (event) => {
|
|
172
|
-
const previous = drag.current;
|
|
173
|
-
if (disabled ||
|
|
174
|
-
!bitmap ||
|
|
175
|
-
!previous ||
|
|
176
|
-
previous.id !== event.pointerId)
|
|
177
|
-
return;
|
|
178
|
-
const size = event.currentTarget.getBoundingClientRect().width;
|
|
179
|
-
setFraming((value) => panSquareImageCrop(bitmap, value, event.clientX - previous.x, event.clientY - previous.y, size));
|
|
180
|
-
drag.current = {
|
|
181
|
-
id: event.pointerId,
|
|
182
|
-
x: event.clientX,
|
|
183
|
-
y: event.clientY,
|
|
184
|
-
};
|
|
185
|
-
}, onPointerUp: endDrag, onPointerCancel: endDrag, onLostPointerCapture: () => {
|
|
186
|
-
drag.current = null;
|
|
187
|
-
}, children: [_jsx("canvas", { ref: canvas, width: 512, height: 512, "aria-hidden": "true", style: { display: "block", width: "100%", height: "100%" } }), _jsx(Box, { "aria-hidden": true, sx: {
|
|
188
|
-
position: "absolute",
|
|
189
|
-
inset: 0,
|
|
190
|
-
borderRadius: previewShape === "circle" ? "50%" : 0,
|
|
191
|
-
border: "2px solid",
|
|
192
|
-
borderColor: "common.white",
|
|
193
|
-
boxShadow: "0 0 0 100vmax rgba(0,0,0,0.45)",
|
|
194
|
-
pointerEvents: "none",
|
|
195
|
-
} })] }), _jsx(Typography, { variant: "body2", color: "text.secondary", children: !bitmap && !decodeError ? copy.opening : copy.instruction }), _jsx(Box, { sx: {
|
|
196
|
-
display: "grid",
|
|
197
|
-
gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
|
|
198
|
-
columnGap: 2,
|
|
199
|
-
}, children: [
|
|
200
|
-
[copy.zoom, "zoom", 1, 4, 0.01],
|
|
201
|
-
[copy.horizontal, "horizontal", 0, 100, 1],
|
|
202
|
-
[copy.vertical, "vertical", 0, 100, 1],
|
|
203
|
-
].map(([label, key, min, max, step]) => (_jsxs(Box, { sx: {
|
|
204
|
-
minWidth: 0,
|
|
205
|
-
display: "flex",
|
|
206
|
-
flexDirection: "column",
|
|
207
|
-
gridColumn: key === "zoom" ? "1 / -1" : undefined,
|
|
208
|
-
}, children: [_jsx(Typography, { id: `${titleId}-${key}`, variant: "body2", sx: { flex: 1, overflowWrap: "anywhere" }, children: label }), _jsx(Slider, { "aria-label": label, "aria-labelledby": `${titleId}-${key}`, min: min, max: max, step: step, value: framing[key], disabled: disabled, onChange: (_event, value) => {
|
|
209
|
-
if (typeof value === "number")
|
|
210
|
-
setFraming((previous) => ({ ...previous, [key]: value }));
|
|
211
|
-
} })] }, key))) }), decodeError || error ? (_jsx(StatusNotice, { tone: "error", message: decodeError !== null && decodeError !== void 0 ? decodeError : error })) : null] }) }), _jsx(DialogActionButtons, { confirmLabel: copy.confirm, confirmDisabled: disabled, confirmIcon: busy ? _jsx(DialogActionProgress, {}) : undefined, onConfirm: () => void confirm() })] }));
|
|
212
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
4
|
-
import { Box, IconButton, Stack, Typography } from "@mui/material";
|
|
5
|
-
/** Read-only image facts. The host supplies data and any map action. */
|
|
6
|
-
export function ImageInfoPanel({ id, dimensions, captureTime, captureOffset, camera, location, loading, failed, onClose, sx = [], }) {
|
|
7
|
-
var _a;
|
|
8
|
-
return (_jsxs(Box, { component: "section", id: id, "aria-labelledby": `${id}-title`, sx: [{
|
|
9
|
-
minHeight: 0,
|
|
10
|
-
minWidth: 0,
|
|
11
|
-
overflow: "auto",
|
|
12
|
-
bgcolor: "background.paper",
|
|
13
|
-
borderColor: "divider",
|
|
14
|
-
borderTop: { xs: 1, sm: 0 },
|
|
15
|
-
borderLeft: { xs: 0, sm: 1 },
|
|
16
|
-
borderTopLeftRadius: { xs: 3, sm: 0 },
|
|
17
|
-
borderTopRightRadius: { xs: 3, sm: 0 },
|
|
18
|
-
px: { xs: 2, sm: 3 },
|
|
19
|
-
pt: 1.5,
|
|
20
|
-
pb: "max(16px, env(safe-area-inset-bottom))",
|
|
21
|
-
}, ...(Array.isArray(sx) ? sx : [sx])], children: [_jsxs(Stack, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [_jsx(Typography, { id: `${id}-title`, component: "h2", variant: "h6", sx: { fontWeight: 700 }, children: "Image info" }), _jsx(IconButton, { "aria-label": "Close image info", onClick: onClose, children: _jsx(CloseRoundedIcon, {}) })] }), _jsxs(Box, { component: "dl", sx: {
|
|
22
|
-
m: 0,
|
|
23
|
-
"& > :not(:last-child)": { borderBottom: 1, borderColor: "divider" },
|
|
24
|
-
}, children: [dimensions && (_jsxs(InfoRow, { label: "Dimensions", children: [dimensions.width, " \u00D7 ", dimensions.height, " px"] })), captureTime && (_jsx(InfoRow, { label: "Date taken", detail: captureOffset, children: captureTime })), camera && _jsx(InfoRow, { label: "Camera", children: camera }), location && (_jsx(InfoRow, { label: "Location", action: location.action, detail: location.approximateName ? location.coordinates : undefined, children: (_a = location.approximateName) !== null && _a !== void 0 ? _a : location.coordinates }))] }), loading || failed ? (_jsx(Typography, { role: "status", variant: "body2", color: "text.secondary", sx: { py: 1 }, children: loading
|
|
25
|
-
? "Reading image metadata…"
|
|
26
|
-
: "Could not read image metadata." })) : null, !loading &&
|
|
27
|
-
!failed &&
|
|
28
|
-
!dimensions &&
|
|
29
|
-
!captureTime &&
|
|
30
|
-
!camera &&
|
|
31
|
-
!location ? (_jsx(Typography, { role: "status", variant: "body2", color: "text.secondary", sx: { py: 1 }, children: "No image details available." })) : null] }));
|
|
32
|
-
}
|
|
33
|
-
function InfoRow({ label, children, action, detail, }) {
|
|
34
|
-
return (_jsxs(Box, { sx: { py: { xs: 1.25, sm: 1.5 }, minWidth: 0 }, children: [_jsx(Typography, { component: "dt", variant: "body2", color: "text.secondary", children: label }), _jsxs(Stack, { component: "dd", direction: "row", spacing: 1, sx: { m: 0, alignItems: "center", justifyContent: "space-between" }, children: [_jsxs(Typography, { component: "span", sx: { fontWeight: 650, overflowWrap: "anywhere", minWidth: 0 }, children: [children, detail && (_jsx(Typography, { component: "span", sx: { display: "block" }, color: "text.secondary", variant: "body2", children: detail }))] }), action] })] }));
|
|
35
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import CompressIcon from "@mui/icons-material/Compress";
|
|
4
|
-
import ImageSearchIcon from "@mui/icons-material/ImageSearch";
|
|
5
|
-
import { Box, Dialog, DialogContent, DialogTitle, Stack, Typography, } from "@mui/material";
|
|
6
|
-
import { useEffect, useId, useState } from "react";
|
|
7
|
-
import { DialogActionButtons, DialogCloseButton, } from "../actions/DialogActionButtons.js";
|
|
8
|
-
import { DialogChoiceTile } from "../internal/DialogChoiceTile.js";
|
|
9
|
-
export function ImageUploadQualityDialog({ file, quality, highQualityAccess, focusLockedChoice = false, hint, onQualityChange, onLockedChoice, onClose, onConfirm, }) {
|
|
10
|
-
const titleId = useId();
|
|
11
|
-
const hintId = useId();
|
|
12
|
-
const radioName = useId();
|
|
13
|
-
const [preview, setPreview] = useState();
|
|
14
|
-
const [failedFile, setFailedFile] = useState();
|
|
15
|
-
const previewFailed = failedFile === file;
|
|
16
|
-
const url = (preview === null || preview === void 0 ? void 0 : preview.file) === file && !previewFailed ? preview.url : undefined;
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (previewFailed)
|
|
19
|
-
return;
|
|
20
|
-
try {
|
|
21
|
-
const url = URL.createObjectURL(file);
|
|
22
|
-
setPreview({ file, url });
|
|
23
|
-
return () => URL.revokeObjectURL(url);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
console.error("[ImageUploadQualityDialog] Could not open a preview for the selected file.", error);
|
|
27
|
-
setFailedFile(file);
|
|
28
|
-
}
|
|
29
|
-
}, [file, previewFailed]);
|
|
30
|
-
const highQualityTile = {
|
|
31
|
-
label: "High quality",
|
|
32
|
-
description: "Original file",
|
|
33
|
-
icon: _jsx(ImageSearchIcon, {}),
|
|
34
|
-
selected: quality === "high",
|
|
35
|
-
};
|
|
36
|
-
return (_jsxs(Dialog, { open: true, onClose: onClose, fullWidth: true, maxWidth: "xs", "aria-labelledby": titleId, children: [_jsxs(DialogTitle, { id: titleId, sx: { pr: 7 }, children: ["Upload image", _jsx(DialogCloseButton, { label: "Cancel image upload", onClose: onClose })] }), _jsx(DialogContent, { children: _jsxs(Stack, { spacing: 1.5, children: [url ? (_jsx(Box, { component: "img", src: url, alt: "Selected image preview", onError: () => {
|
|
37
|
-
console.warn("[ImageUploadQualityDialog] Could not display the selected image preview.", { type: file.type });
|
|
38
|
-
setFailedFile(file);
|
|
39
|
-
}, sx: {
|
|
40
|
-
display: "block",
|
|
41
|
-
width: "100%",
|
|
42
|
-
maxHeight: "min(32dvh, 230px)",
|
|
43
|
-
objectFit: "contain",
|
|
44
|
-
borderRadius: 2,
|
|
45
|
-
} })) : null, _jsx(Typography, { variant: "body2", sx: { overflowWrap: "anywhere" }, children: file.name }), previewFailed ? (_jsx(Typography, { variant: "caption", color: "text.secondary", children: "Preview unavailable." })) : null, _jsxs(Box, { role: highQualityAccess === "locked" ? "group" : "radiogroup", "aria-label": "Image quality", "aria-describedby": hint ? hintId : undefined, sx: {
|
|
46
|
-
display: "grid",
|
|
47
|
-
gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
|
|
48
|
-
"@media (max-width: 350px)": { gridTemplateColumns: "1fr" },
|
|
49
|
-
gap: 1,
|
|
50
|
-
}, children: [_jsx(DialogChoiceTile, { label: "Compressed", description: "Smaller file", icon: _jsx(CompressIcon, {}), name: radioName, selected: quality === "compressed", autoFocus: !focusLockedChoice, onSelect: () => onQualityChange("compressed") }), highQualityAccess === "locked" ? (_jsx(DialogChoiceTile, { ...highQualityTile, autoFocus: focusLockedChoice, onLockedClick: onLockedChoice })) : (_jsx(DialogChoiceTile, { ...highQualityTile, name: radioName, disabled: highQualityAccess === "unavailable", onSelect: () => onQualityChange("high") }))] }), hint ? (_jsx(Typography, { id: hintId, variant: "caption", color: "text.secondary", children: hint })) : null] }) }), _jsx(DialogActionButtons, { confirmLabel: "Upload image", confirmText: "Upload", onConfirm: onConfirm })] }));
|
|
51
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Box, CircularProgress } from "@mui/material";
|
|
4
|
-
/**
|
|
5
|
-
* Presents determinate upload progress at the object being changed.
|
|
6
|
-
*
|
|
7
|
-
* Product decision: progress belongs with a compact upload target rather than
|
|
8
|
-
* in a separate status row. The host owns file selection, upload lifecycle,
|
|
9
|
-
* validation, errors, and disabled interaction; this primitive only renders
|
|
10
|
-
* the accessible visual state around its child.
|
|
11
|
-
*/
|
|
12
|
-
export function UploadProgressRing({ children, progress, progressLabel, size = 88, sx, thickness = 3, }) {
|
|
13
|
-
const isUploading = progress !== null;
|
|
14
|
-
const normalizedProgress = Math.min(100, Math.max(0, progress !== null && progress !== void 0 ? progress : 0));
|
|
15
|
-
return (_jsxs(Box, { "aria-busy": isUploading || undefined, "data-component": "upload-progress-ring", sx: {
|
|
16
|
-
alignItems: "center",
|
|
17
|
-
display: "inline-flex",
|
|
18
|
-
height: size,
|
|
19
|
-
justifyContent: "center",
|
|
20
|
-
position: "relative",
|
|
21
|
-
width: size,
|
|
22
|
-
...sx,
|
|
23
|
-
}, children: [children, isUploading ? (_jsx(CircularProgress, { "aria-label": progressLabel, size: size, sx: {
|
|
24
|
-
left: 0,
|
|
25
|
-
pointerEvents: "none",
|
|
26
|
-
position: "absolute",
|
|
27
|
-
top: 0,
|
|
28
|
-
}, thickness: thickness, value: normalizedProgress, variant: "determinate" })) : null] }));
|
|
29
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
// Product decision: camera/crop retain their shared host-theme presentation;
|
|
3
|
-
// delegate to the canonical actions/feedback bodies instead of copying them.
|
|
4
|
-
export { DialogActionButtons, DialogActionProgress, DialogCloseButton, } from "../actions/DialogActionButtons.js";
|
|
5
|
-
export { StatusNotice } from "../feedback/StatusNotice.js";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
export { FileUpload } from "./FileUpload.js";
|
|
3
|
-
export { FileRow } from "./FileRow.js";
|
|
4
|
-
export { FileThumbnail } from "./FileThumbnail.js";
|
|
5
|
-
export { FileViewer } from "./FileViewer.js";
|
|
6
|
-
export { ImageInfoPanel } from "./ImageInfoPanel.js";
|
|
7
|
-
export { UploadProgressRing } from "./UploadProgressRing.js";
|
|
8
|
-
export { useUploadLock } from "@bayonai/file-uploads/hooks";
|
|
9
|
-
export { CameraCaptureDialog } from "./CameraCaptureDialog.js";
|
|
10
|
-
export { ImageCropDialog } from "./ImageCropDialog.js";
|
|
11
|
-
export { ImageUploadQualityDialog } from "./ImageUploadQualityDialog.js";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import createCache from '@emotion/cache';
|
|
2
|
-
const isBrowser = typeof document !== 'undefined';
|
|
3
|
-
export function createBayonEmotionCache(key = 'css') {
|
|
4
|
-
let insertionPoint;
|
|
5
|
-
if (isBrowser) {
|
|
6
|
-
const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
|
|
7
|
-
insertionPoint = emotionInsertionPoint !== null && emotionInsertionPoint !== void 0 ? emotionInsertionPoint : undefined;
|
|
8
|
-
}
|
|
9
|
-
return createCache({
|
|
10
|
-
key,
|
|
11
|
-
prepend: true,
|
|
12
|
-
insertionPoint,
|
|
13
|
-
speedy: typeof process !== 'undefined' && process.env.NODE_ENV === 'production',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type SxProps, type Theme } from "@mui/material";
|
|
2
|
-
import { type ReactNode } from "react";
|
|
3
|
-
export type ActionMenuColor = "default" | "primary" | "secondary" | "error";
|
|
4
|
-
export type ActionMenuItem = {
|
|
5
|
-
color?: ActionMenuColor;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
icon?: ReactNode;
|
|
8
|
-
label: string;
|
|
9
|
-
onClick: () => void;
|
|
10
|
-
section?: string;
|
|
11
|
-
};
|
|
12
|
-
export type ActionMenuProps = {
|
|
13
|
-
actionColorSx?: Partial<Record<ActionMenuColor, SxProps<Theme>>>;
|
|
14
|
-
actions: ActionMenuItem[];
|
|
15
|
-
buttonSx?: SxProps<Theme>;
|
|
16
|
-
containerSx?: SxProps<Theme>;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
label?: string;
|
|
19
|
-
loading?: boolean;
|
|
20
|
-
loadingLabel?: string;
|
|
21
|
-
size?: "small" | "medium" | "large";
|
|
22
|
-
};
|
|
23
|
-
/** A compact, grouped action menu with an optional in-flight trigger state. */
|
|
24
|
-
export declare function ActionMenu({ actionColorSx, actions, buttonSx, containerSx, disabled, label, loading, loadingLabel, size, }: ActionMenuProps): import("react").JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { SxProps, Theme } from "@mui/material/styles";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
export declare const compactDialogPaperSx: SxProps<Theme>;
|
|
4
|
-
export type DialogActionButtonsProps = {
|
|
5
|
-
confirmLabel: string;
|
|
6
|
-
confirmText?: string;
|
|
7
|
-
confirmDisabled?: boolean;
|
|
8
|
-
confirmColor?: "error" | "primary" | "secondary" | "success" | "warning";
|
|
9
|
-
confirmIcon?: ReactNode;
|
|
10
|
-
confirmType?: "button" | "submit";
|
|
11
|
-
onConfirm?: () => void;
|
|
12
|
-
sx?: SxProps<Theme>;
|
|
13
|
-
};
|
|
14
|
-
/** Keeps the modal's primary decision compact and explicitly labelled. */
|
|
15
|
-
export declare function DialogActionButtons({ confirmColor, confirmDisabled, confirmIcon, confirmLabel, confirmText, confirmType, onConfirm, sx, }: DialogActionButtonsProps): import("react").JSX.Element;
|
|
16
|
-
export declare function DialogActionProgress(): import("react").JSX.Element;
|
|
17
|
-
export type DialogCloseButtonProps = {
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
label?: string;
|
|
20
|
-
onClose: () => void;
|
|
21
|
-
sx?: SxProps<Theme>;
|
|
22
|
-
};
|
|
23
|
-
export declare function DialogCloseButton({ disabled, label, onClose, sx, }: DialogCloseButtonProps): import("react").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type IconButtonProps } from "@mui/material";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
export type LoadingIconButtonProps = Omit<IconButtonProps, "aria-label" | "children"> & {
|
|
4
|
-
"aria-label": string;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
loadingLabel: string;
|
|
8
|
-
spinnerSize?: number;
|
|
9
|
-
};
|
|
10
|
-
/** Keeps an icon action's footprint while making an in-flight request visible. */
|
|
11
|
-
export declare function LoadingIconButton({ "aria-label": ariaLabel, children, disabled, loading, loadingLabel, spinnerSize, ...props }: LoadingIconButtonProps): import("react").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type SxProps, type Theme } from "@mui/material";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
export type StickyActionFooterProps = {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
sx?: SxProps<Theme>;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Keeps the final actions of a long, scrollable form in view.
|
|
9
|
-
*
|
|
10
|
-
* Product decision: this component owns local sticky positioning and neutral
|
|
11
|
-
* footer chrome only. The host owns its scroll container, any edge-to-edge
|
|
12
|
-
* bleed required by a padded surface, action layout, and form submission.
|
|
13
|
-
*/
|
|
14
|
-
export declare function StickyActionFooter({ children, sx }: StickyActionFooterProps): import("react").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ButtonProps, type SxProps, type Theme } from "@mui/material";
|
|
2
|
-
export type StickySubmitButtonProps = {
|
|
3
|
-
buttonSx?: SxProps<Theme>;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
footerSx?: SxProps<Theme>;
|
|
6
|
-
label?: string;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
variant?: ButtonProps["variant"];
|
|
9
|
-
};
|
|
10
|
-
export declare function StickySubmitButton({ buttonSx, disabled, footerSx, label, loading, variant, }: StickySubmitButtonProps): import("react").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { ActionMenu, type ActionMenuColor, type ActionMenuItem, type ActionMenuProps, } from "./ActionMenu.js";
|
|
2
|
-
export { LoadingIconButton, type LoadingIconButtonProps, } from "./LoadingIconButton.js";
|
|
3
|
-
export { StickyActionFooter, type StickyActionFooterProps, } from "./StickyActionFooter.js";
|
|
4
|
-
export { StickySubmitButton, type StickySubmitButtonProps, } from "./StickySubmitButton.js";
|
|
5
|
-
export { compactDialogPaperSx, DialogActionButtons, DialogActionProgress, DialogCloseButton, type DialogActionButtonsProps, type DialogCloseButtonProps, } from "./DialogActionButtons.js";
|
package/dist/types/client.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type BoxProps } from '@mui/material/Box';
|
|
3
|
-
export type BayonFlowItem = {
|
|
4
|
-
label: React.ReactNode;
|
|
5
|
-
value: React.ReactNode;
|
|
6
|
-
color: string;
|
|
7
|
-
};
|
|
8
|
-
export interface BayonFlowVisualProps extends BoxProps {
|
|
9
|
-
items?: BayonFlowItem[];
|
|
10
|
-
caption?: React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare function BayonFlowVisual({ items, caption, sx, ...props }: BayonFlowVisualProps): React.JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type IconButtonProps } from '@mui/material/IconButton';
|
|
3
|
-
import type { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
-
export interface IconTooltipButtonProps extends Omit<IconButtonProps, 'aria-label'> {
|
|
5
|
-
component?: React.ElementType;
|
|
6
|
-
href?: string;
|
|
7
|
-
label: string;
|
|
8
|
-
tooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
|
|
9
|
-
}
|
|
10
|
-
export declare const IconTooltipButton: React.ForwardRefExoticComponent<Omit<IconTooltipButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type BoxProps } from '@mui/material/Box';
|
|
3
|
-
import { type StackProps } from '@mui/material/Stack';
|
|
4
|
-
export interface BayonPanelProps extends BoxProps {
|
|
5
|
-
hover?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function BayonPageShell({ sx, ...props }: BoxProps): React.JSX.Element;
|
|
8
|
-
export declare function BayonGradientHero({ sx, ...props }: BoxProps): React.JSX.Element;
|
|
9
|
-
export declare function BayonDarkPanel({ hover, sx, ...props }: BayonPanelProps): React.JSX.Element;
|
|
10
|
-
export declare function BayonAccentPanel({ hover, sx, ...props }: BayonPanelProps): React.JSX.Element;
|
|
11
|
-
export declare function BayonCtaPanel({ sx, ...props }: BoxProps): React.JSX.Element;
|
|
12
|
-
export declare function BayonContentBox({ sx, ...props }: BoxProps): React.JSX.Element;
|
|
13
|
-
export interface BayonMethodBoxProps extends BoxProps {
|
|
14
|
-
accentColor?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function BayonMethodBox({ accentColor, sx, ...props }: BayonMethodBoxProps): React.JSX.Element;
|
|
17
|
-
export interface BayonProjectCardProps extends Omit<BayonPanelProps, 'title'> {
|
|
18
|
-
category?: React.ReactNode;
|
|
19
|
-
status?: React.ReactNode;
|
|
20
|
-
title?: React.ReactNode;
|
|
21
|
-
body?: React.ReactNode;
|
|
22
|
-
actions?: React.ReactNode;
|
|
23
|
-
}
|
|
24
|
-
export declare function BayonProjectCard({ category, status, title, body, actions, children, hover, sx, ...props }: BayonProjectCardProps): React.JSX.Element;
|
|
25
|
-
export interface BayonPillarCardProps extends Omit<BoxProps, 'title'> {
|
|
26
|
-
accentColor?: string;
|
|
27
|
-
eyebrow?: React.ReactNode;
|
|
28
|
-
title?: React.ReactNode;
|
|
29
|
-
body?: React.ReactNode;
|
|
30
|
-
actions?: React.ReactNode;
|
|
31
|
-
}
|
|
32
|
-
export declare function BayonPillarCard({ accentColor, eyebrow, title, body, actions, children, sx, ...props }: BayonPillarCardProps): React.JSX.Element;
|
|
33
|
-
export interface BayonTechChipProps extends BoxProps {
|
|
34
|
-
label?: React.ReactNode;
|
|
35
|
-
}
|
|
36
|
-
export declare function BayonTechChip({ label, children, sx, ...props }: BayonTechChipProps): React.JSX.Element;
|
|
37
|
-
export declare function BayonPanelStack({ sx, ...props }: StackProps): React.JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SxProps, Theme } from "@mui/material/styles";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
import { type DrawerAppearance } from "./drawerAppearance.js";
|
|
4
|
-
export declare function BottomDrawer({ children, appearance, closeTooltip, closeLabel, contentSx, dataComponent, disablePortal, headerActions, onClose, open, title, }: {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
appearance?: DrawerAppearance;
|
|
7
|
-
closeTooltip?: string;
|
|
8
|
-
closeLabel: string;
|
|
9
|
-
contentSx?: SxProps<Theme>;
|
|
10
|
-
dataComponent?: string;
|
|
11
|
-
disablePortal?: boolean;
|
|
12
|
-
headerActions?: ReactNode;
|
|
13
|
-
onClose: () => void;
|
|
14
|
-
open: boolean;
|
|
15
|
-
title: ReactNode;
|
|
16
|
-
}): import("react").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { type DrawerAppearance } from "./drawerAppearance.js";
|
|
3
|
-
export declare const mobileBottomDrawerDismissDuration = 220;
|
|
4
|
-
export declare function MobileBottomDrawer({ ariaLabel, appearance, closeTooltip, children, contentScrollMode, dataComponent, dismiss, handleBackground, handlePlacement, headerLeft, headerRight, maxHeight, onClose, }: {
|
|
5
|
-
ariaLabel: string;
|
|
6
|
-
appearance?: DrawerAppearance;
|
|
7
|
-
closeTooltip?: string;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/** Chooses whether the drawer body or its direct child owns vertical scrolling. */
|
|
10
|
-
contentScrollMode?: "container" | "child";
|
|
11
|
-
dataComponent?: string;
|
|
12
|
-
/** Requests the standard dismiss animation before invoking onClose. */
|
|
13
|
-
dismiss?: boolean;
|
|
14
|
-
handleBackground?: "default" | "detailChrome";
|
|
15
|
-
handlePlacement?: "above-content" | "overlay";
|
|
16
|
-
headerLeft?: ReactNode;
|
|
17
|
-
headerRight?: ReactNode;
|
|
18
|
-
maxHeight?: string;
|
|
19
|
-
onClose: () => void;
|
|
20
|
-
}): import("react").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
type MobileBottomDrawerHeaderProps = {
|
|
3
|
-
closeLabel: string;
|
|
4
|
-
closeTooltip?: string;
|
|
5
|
-
dragHandle: ReactNode;
|
|
6
|
-
left: ReactNode;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
right?: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export declare function MobileBottomDrawerHeader({ closeLabel, closeTooltip, dragHandle, left, onClose, right, }: MobileBottomDrawerHeaderProps): import("react").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { SxProps, Theme } from "@mui/material/styles";
|
|
3
|
-
import type { DrawerAppearance } from "./drawerAppearance.js";
|
|
4
|
-
type DrawerPresentation = "desktop" | "mobile";
|
|
5
|
-
type ResponsiveDrawerProps = {
|
|
6
|
-
ariaLabel: string;
|
|
7
|
-
appearance?: DrawerAppearance;
|
|
8
|
-
closeTooltip?: string;
|
|
9
|
-
children: (presentation: DrawerPresentation) => ReactNode;
|
|
10
|
-
desktopContentSx?: SxProps<Theme>;
|
|
11
|
-
desktopCloseLabel?: string;
|
|
12
|
-
desktopDataComponent?: string;
|
|
13
|
-
desktopDisablePortal?: boolean;
|
|
14
|
-
desktopOpen?: boolean;
|
|
15
|
-
headerActions?: ReactNode;
|
|
16
|
-
mobileContentScrollMode?: "child" | "container";
|
|
17
|
-
mobileDataComponent?: string;
|
|
18
|
-
mobileDismiss?: boolean;
|
|
19
|
-
mobileOpen?: boolean;
|
|
20
|
-
onDesktopClose: () => void;
|
|
21
|
-
onMobileClose: () => void;
|
|
22
|
-
title: ReactNode;
|
|
23
|
-
};
|
|
24
|
-
export declare function ResponsiveDrawer({ ariaLabel, appearance, closeTooltip, children, desktopContentSx, desktopCloseLabel, desktopDataComponent, desktopDisablePortal, desktopOpen, headerActions, mobileContentScrollMode, mobileDataComponent, mobileDismiss, mobileOpen, onDesktopClose, onMobileClose, title, }: ResponsiveDrawerProps): import("react").JSX.Element | null;
|
|
25
|
-
export {};
|