@bayonai/mui-design 1.8.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 +10 -0
- package/README.md +26 -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 -25
- package/dist/cjs/drawers/WorkspaceSidePane.js +0 -206
- 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 -200
- 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 -25
- 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,81 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { keyframes } from '@emotion/react';
|
|
3
|
-
import Box from '@mui/material/Box';
|
|
4
|
-
import Stack from '@mui/material/Stack';
|
|
5
|
-
import Typography from '@mui/material/Typography';
|
|
6
|
-
const drift = keyframes `
|
|
7
|
-
0% { transform: translate3d(0, 0, 0); }
|
|
8
|
-
50% { transform: translate3d(0, -10px, 0); }
|
|
9
|
-
100% { transform: translate3d(0, 0, 0); }
|
|
10
|
-
`;
|
|
11
|
-
const flow = keyframes `
|
|
12
|
-
0% { transform: translateX(-36%); opacity: 0.28; }
|
|
13
|
-
50% { opacity: 0.8; }
|
|
14
|
-
100% { transform: translateX(36%); opacity: 0.28; }
|
|
15
|
-
`;
|
|
16
|
-
const tilePulse = keyframes `
|
|
17
|
-
0%, 100% { transform: scale(1); filter: brightness(1); }
|
|
18
|
-
50% { transform: scale(1.04); filter: brightness(1.18); }
|
|
19
|
-
`;
|
|
20
|
-
function mergeSx(...items) {
|
|
21
|
-
return items.filter(Boolean);
|
|
22
|
-
}
|
|
23
|
-
const defaultItems = [
|
|
24
|
-
{ label: 'Prompt', value: 'Design brief', color: '#2DD4BF' },
|
|
25
|
-
{ label: 'Model', value: 'Context map', color: '#60A5FA' },
|
|
26
|
-
{ label: 'Build', value: 'App surface', color: '#FDE047' },
|
|
27
|
-
{ label: 'Ship', value: 'Live product', color: '#FF6B6B' },
|
|
28
|
-
];
|
|
29
|
-
export function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system design -> production app', sx, ...props }) {
|
|
30
|
-
return (_jsxs(Box, { "aria-hidden": "true", sx: mergeSx({
|
|
31
|
-
minHeight: { xs: 320, md: 520 },
|
|
32
|
-
border: '1px solid var(--bayon-border-strong)',
|
|
33
|
-
borderRadius: 2,
|
|
34
|
-
bgcolor: 'var(--bayon-panel-solid)',
|
|
35
|
-
boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 var(--bayon-border)',
|
|
36
|
-
p: { xs: 3, md: 4 },
|
|
37
|
-
display: 'grid',
|
|
38
|
-
gridTemplateRows: 'auto 1fr auto',
|
|
39
|
-
gap: 3,
|
|
40
|
-
animation: `${drift} 8s ease-in-out infinite`,
|
|
41
|
-
position: 'relative',
|
|
42
|
-
overflow: 'hidden',
|
|
43
|
-
'@media (prefers-reduced-motion: reduce)': {
|
|
44
|
-
animation: 'none',
|
|
45
|
-
},
|
|
46
|
-
}, sx), ...props, children: [_jsx(Stack, { direction: "row", spacing: 1.2, children: ['#2DD4BF', '#FF6B6B', '#FDE047'].map((color) => (_jsx(Box, { sx: { width: 10, height: 10, borderRadius: '50%', bgcolor: color } }, color))) }), _jsx(Box, { sx: {
|
|
47
|
-
display: 'grid',
|
|
48
|
-
gridTemplateColumns: '1fr 1.1fr',
|
|
49
|
-
gridTemplateRows: '1fr 1fr',
|
|
50
|
-
gap: 2,
|
|
51
|
-
position: 'relative',
|
|
52
|
-
'&::before': {
|
|
53
|
-
content: '""',
|
|
54
|
-
position: 'absolute',
|
|
55
|
-
left: '10%',
|
|
56
|
-
right: '10%',
|
|
57
|
-
top: '50%',
|
|
58
|
-
height: 2,
|
|
59
|
-
background: 'linear-gradient(90deg, transparent, #2DD4BF, #FDE047, #FF6B6B, transparent)',
|
|
60
|
-
animation: `${flow} 5s ease-in-out infinite`,
|
|
61
|
-
},
|
|
62
|
-
'@media (prefers-reduced-motion: reduce)': {
|
|
63
|
-
'&::before': {
|
|
64
|
-
animation: 'none',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
}, children: items.map((item, index) => (_jsxs(Box, { sx: {
|
|
68
|
-
borderRadius: 2,
|
|
69
|
-
border: '1px solid var(--bayon-border)',
|
|
70
|
-
bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'var(--bayon-grid-line)',
|
|
71
|
-
p: 2.5,
|
|
72
|
-
display: 'flex',
|
|
73
|
-
flexDirection: 'column',
|
|
74
|
-
justifyContent: 'space-between',
|
|
75
|
-
minHeight: 128,
|
|
76
|
-
animation: `${tilePulse} ${5 + index}s ease-in-out infinite`,
|
|
77
|
-
'@media (prefers-reduced-motion: reduce)': {
|
|
78
|
-
animation: 'none',
|
|
79
|
-
},
|
|
80
|
-
}, children: [_jsx(Typography, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), _jsx(Typography, { sx: { color: 'var(--bayon-fg)', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), _jsx(Typography, { sx: { color: 'var(--bayon-muted)', fontSize: '0.95rem' }, children: caption })] }));
|
|
81
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import DarkModeIcon from '@mui/icons-material/DarkMode';
|
|
4
|
-
import LightModeIcon from '@mui/icons-material/LightMode';
|
|
5
|
-
import { useBayonThemeMode } from '../providers/BayonThemeProvider.js';
|
|
6
|
-
import { IconTooltipButton } from './IconTooltipButton.js';
|
|
7
|
-
function mergeSx(...items) {
|
|
8
|
-
return items.flat().filter(Boolean);
|
|
9
|
-
}
|
|
10
|
-
export function BayonThemeModeToggle({ sx }) {
|
|
11
|
-
const { mode, toggleMode } = useBayonThemeMode();
|
|
12
|
-
const nextMode = mode === 'dark' ? 'light' : 'dark';
|
|
13
|
-
return (_jsx(IconTooltipButton, { label: `Switch to ${nextMode} mode`, onClick: toggleMode, sx: mergeSx({
|
|
14
|
-
color: 'var(--bayon-fg)',
|
|
15
|
-
border: '1px solid var(--bayon-border)',
|
|
16
|
-
bgcolor: 'var(--bayon-panel)',
|
|
17
|
-
transition: 'border-color 180ms ease, background-color 180ms ease, color 180ms ease',
|
|
18
|
-
'&:hover': {
|
|
19
|
-
bgcolor: 'rgba(45, 212, 191, 0.12)',
|
|
20
|
-
borderColor: 'var(--bayon-link-hover)',
|
|
21
|
-
color: 'var(--bayon-link-hover)',
|
|
22
|
-
},
|
|
23
|
-
'&:focus-visible': {
|
|
24
|
-
outline: '2px solid rgba(45, 212, 191, 0.52)',
|
|
25
|
-
outlineOffset: 3,
|
|
26
|
-
},
|
|
27
|
-
}, sx), children: mode === 'dark' ? _jsx(LightModeIcon, { fontSize: "small" }) : _jsx(DarkModeIcon, { fontSize: "small" }) }));
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import IconButton from '@mui/material/IconButton';
|
|
5
|
-
const LazyTooltip = React.lazy(async () => ({
|
|
6
|
-
default: (await import('@mui/material/Tooltip')).default,
|
|
7
|
-
}));
|
|
8
|
-
export const IconTooltipButton = React.forwardRef(function IconTooltipButton({ label, tooltipProps, children, ...props }, ref) {
|
|
9
|
-
const button = (_jsx(IconButton, { ref: ref, "aria-label": label, ...props, children: children }));
|
|
10
|
-
return (_jsx(React.Suspense, { fallback: button, children: _jsx(LazyTooltip, { title: label, ...tooltipProps, children: button }) }));
|
|
11
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Box from '@mui/material/Box';
|
|
3
|
-
import Stack from '@mui/material/Stack';
|
|
4
|
-
import Typography from '@mui/material/Typography';
|
|
5
|
-
import { accentPanelSx, darkCtaSx, darkPanelHoverSx, darkPanelSx, gradientHeroSx, pageShellSx, } from '../styles/pageStyles.js';
|
|
6
|
-
function mergeSx(...items) {
|
|
7
|
-
return items.flat().filter(Boolean);
|
|
8
|
-
}
|
|
9
|
-
export function BayonPageShell({ sx, ...props }) {
|
|
10
|
-
return _jsx(Box, { sx: mergeSx(pageShellSx, sx), ...props });
|
|
11
|
-
}
|
|
12
|
-
export function BayonGradientHero({ sx, ...props }) {
|
|
13
|
-
return _jsx(Box, { component: "section", sx: mergeSx(gradientHeroSx, sx), ...props });
|
|
14
|
-
}
|
|
15
|
-
export function BayonDarkPanel({ hover = false, sx, ...props }) {
|
|
16
|
-
return _jsx(Box, { sx: mergeSx(darkPanelSx, hover ? darkPanelHoverSx : undefined, sx), ...props });
|
|
17
|
-
}
|
|
18
|
-
export function BayonAccentPanel({ hover = false, sx, ...props }) {
|
|
19
|
-
return _jsx(Box, { sx: mergeSx(accentPanelSx, hover ? darkPanelHoverSx : undefined, sx), ...props });
|
|
20
|
-
}
|
|
21
|
-
export function BayonCtaPanel({ sx, ...props }) {
|
|
22
|
-
return _jsx(Box, { sx: mergeSx(darkCtaSx, sx), ...props });
|
|
23
|
-
}
|
|
24
|
-
export function BayonContentBox({ sx, ...props }) {
|
|
25
|
-
return (_jsx(Box, { sx: mergeSx({
|
|
26
|
-
p: { xs: 3, md: 4 },
|
|
27
|
-
border: '1px solid var(--bayon-border)',
|
|
28
|
-
borderRadius: 2,
|
|
29
|
-
bgcolor: 'var(--bayon-panel)',
|
|
30
|
-
}, sx), ...props }));
|
|
31
|
-
}
|
|
32
|
-
export function BayonMethodBox({ accentColor = '#2DD4BF', sx, ...props }) {
|
|
33
|
-
return (_jsx(BayonCtaPanel, { sx: mergeSx({
|
|
34
|
-
p: 3,
|
|
35
|
-
borderLeft: `3px solid ${accentColor}`,
|
|
36
|
-
}, sx), ...props }));
|
|
37
|
-
}
|
|
38
|
-
export function BayonProjectCard({ category, status, title, body, actions, children, hover = true, sx, ...props }) {
|
|
39
|
-
return (_jsxs(BayonAccentPanel, { hover: hover, sx: mergeSx({
|
|
40
|
-
p: 4,
|
|
41
|
-
minHeight: 290,
|
|
42
|
-
display: 'flex',
|
|
43
|
-
flexDirection: 'column',
|
|
44
|
-
}, sx), ...props, children: [category && (_jsx(Typography, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && (_jsx(Typography, { variant: "h5", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && _jsx(Typography, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
|
|
45
|
-
}
|
|
46
|
-
export function BayonPillarCard({ accentColor = '#2DD4BF', eyebrow, title, body, actions, children, sx, ...props }) {
|
|
47
|
-
return (_jsxs(Box, { sx: mergeSx({
|
|
48
|
-
p: { xs: 3, md: 5 },
|
|
49
|
-
border: '1px solid var(--bayon-border)',
|
|
50
|
-
borderRadius: 2,
|
|
51
|
-
bgcolor: 'var(--bayon-panel)',
|
|
52
|
-
boxShadow: 'var(--bayon-panel-shadow)',
|
|
53
|
-
transition: 'transform 180ms ease, border-color 180ms ease',
|
|
54
|
-
'&:hover': {
|
|
55
|
-
transform: 'translateY(-5px)',
|
|
56
|
-
borderColor: accentColor,
|
|
57
|
-
},
|
|
58
|
-
}, sx), ...props, children: [eyebrow && (_jsx(Typography, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && (_jsx(Typography, { variant: "h3", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75 }, children: body }), children, actions] }));
|
|
59
|
-
}
|
|
60
|
-
export function BayonTechChip({ label, children, sx, ...props }) {
|
|
61
|
-
return (_jsx(Box, { sx: mergeSx({
|
|
62
|
-
px: 1.5,
|
|
63
|
-
py: 0.75,
|
|
64
|
-
borderRadius: 1,
|
|
65
|
-
bgcolor: 'rgba(45, 212, 191, 0.12)',
|
|
66
|
-
color: '#A7F3D0',
|
|
67
|
-
border: '1px solid rgba(45, 212, 191, 0.24)',
|
|
68
|
-
fontSize: '0.9rem',
|
|
69
|
-
fontWeight: 600,
|
|
70
|
-
maxWidth: '100%',
|
|
71
|
-
overflowWrap: 'anywhere',
|
|
72
|
-
}, sx), ...props, children: label !== null && label !== void 0 ? label : children }));
|
|
73
|
-
}
|
|
74
|
-
export function BayonPanelStack({ sx, ...props }) {
|
|
75
|
-
return _jsx(Stack, { spacing: 3, sx: sx, ...props });
|
|
76
|
-
}
|
|
@@ -1,37 +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, Drawer, IconButton, Tooltip, Typography, } from "@mui/material";
|
|
5
|
-
import { defaultDrawerAppearance, } from "./drawerAppearance.js";
|
|
6
|
-
export function BottomDrawer({ children, appearance = defaultDrawerAppearance, closeTooltip, closeLabel, contentSx, dataComponent, disablePortal = false, headerActions, onClose, open, title, }) {
|
|
7
|
-
const paperSlotProps = {
|
|
8
|
-
"data-component": dataComponent,
|
|
9
|
-
sx: {
|
|
10
|
-
bgcolor: appearance.background,
|
|
11
|
-
borderRadius: "16px 16px 0 0",
|
|
12
|
-
boxShadow: appearance.shadow,
|
|
13
|
-
maxHeight: "calc(100dvh - 24px)",
|
|
14
|
-
width: "100%",
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
return (_jsxs(Drawer, { anchor: "bottom",
|
|
18
|
-
// Portal ownership belongs to the host because route slots and stacking
|
|
19
|
-
// containers are application concerns rather than drawer presentation.
|
|
20
|
-
ModalProps: { disablePortal }, onClose: onClose, open: open, slotProps: { paper: paperSlotProps }, children: [_jsxs(Box, { sx: {
|
|
21
|
-
alignItems: "center",
|
|
22
|
-
borderBottom: 1,
|
|
23
|
-
borderColor: "divider",
|
|
24
|
-
display: "flex",
|
|
25
|
-
flex: "0 0 auto",
|
|
26
|
-
gap: 1,
|
|
27
|
-
minHeight: 64,
|
|
28
|
-
px: 2.5,
|
|
29
|
-
}, children: [_jsx(Typography, { component: "h1", sx: { flex: 1, fontWeight: 760 }, children: title }), headerActions ? (_jsx(Box, { sx: { alignItems: "center", display: "flex" }, children: headerActions })) : null, _jsx(Tooltip, { title: closeTooltip !== null && closeTooltip !== void 0 ? closeTooltip : "", children: _jsx(IconButton, { "aria-label": closeLabel, onClick: onClose, sx: {
|
|
30
|
-
minHeight: 40,
|
|
31
|
-
minWidth: 40,
|
|
32
|
-
"& > .MuiSvgIcon-root": { fontSize: 28 },
|
|
33
|
-
}, children: _jsx(CloseRoundedIcon, {}) }) })] }), _jsx(Box, { sx: [
|
|
34
|
-
{ flex: 1, minHeight: 0, overflowY: "auto" },
|
|
35
|
-
...(Array.isArray(contentSx) ? contentSx : [contentSx]),
|
|
36
|
-
], children: children })] }));
|
|
37
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Box } from "@mui/material";
|
|
4
|
-
import SwipeableDrawer from "@mui/material/SwipeableDrawer";
|
|
5
|
-
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
6
|
-
import { defaultDrawerAppearance, } from "./drawerAppearance.js";
|
|
7
|
-
import { MobileBottomDrawerHeader } from "./MobileBottomDrawerHeader.js";
|
|
8
|
-
export const mobileBottomDrawerDismissDuration = 220;
|
|
9
|
-
export function MobileBottomDrawer({ ariaLabel, appearance = defaultDrawerAppearance, closeTooltip, children, contentScrollMode = "container", dataComponent, dismiss = false, handleBackground = "default", handlePlacement = "above-content", headerLeft, headerRight, maxHeight = "calc(100dvh - 24px)", onClose, }) {
|
|
10
|
-
const dismissTimer = useRef(null);
|
|
11
|
-
const [open, setOpen] = useState(true);
|
|
12
|
-
useEffect(() => () => {
|
|
13
|
-
if (dismissTimer.current) {
|
|
14
|
-
clearTimeout(dismissTimer.current);
|
|
15
|
-
}
|
|
16
|
-
}, []);
|
|
17
|
-
const requestClose = useCallback(() => {
|
|
18
|
-
if (!open || dismissTimer.current) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
setOpen(false);
|
|
22
|
-
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
23
|
-
dismissTimer.current = setTimeout(onClose, prefersReducedMotion ? 0 : mobileBottomDrawerDismissDuration);
|
|
24
|
-
}, [onClose, open]);
|
|
25
|
-
// Product decision: nested dialogs may layer over a retained drawer; the host
|
|
26
|
-
// decides whether closing that dialog also closes its underlying context.
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (!dismiss || !open) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
32
|
-
dismissTimer.current = setTimeout(onClose, prefersReducedMotion ? 0 : mobileBottomDrawerDismissDuration);
|
|
33
|
-
return () => {
|
|
34
|
-
if (dismissTimer.current) {
|
|
35
|
-
clearTimeout(dismissTimer.current);
|
|
36
|
-
dismissTimer.current = null;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}, [dismiss, onClose, open]);
|
|
40
|
-
const paperSlotProps = {
|
|
41
|
-
"aria-label": ariaLabel,
|
|
42
|
-
"data-component": dataComponent !== null && dataComponent !== void 0 ? dataComponent : "mobile-bottom-drawer",
|
|
43
|
-
sx: {
|
|
44
|
-
backgroundColor: appearance.background,
|
|
45
|
-
borderRadius: "16px 16px 0 0",
|
|
46
|
-
bottom: 0,
|
|
47
|
-
boxShadow: appearance.shadow,
|
|
48
|
-
display: "flex",
|
|
49
|
-
flexDirection: "column",
|
|
50
|
-
height: maxHeight,
|
|
51
|
-
maxHeight,
|
|
52
|
-
overflow: "hidden",
|
|
53
|
-
overscrollBehaviorY: "contain",
|
|
54
|
-
width: "100%",
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
const drawerHandle = (_jsx(Box, { "aria-hidden": true, "data-component": "mobile-bottom-drawer-handle", "data-placement": handlePlacement, "data-swipe-surface": "drawer", sx: {
|
|
58
|
-
alignItems: "center",
|
|
59
|
-
bgcolor: handleBackground === "detailChrome"
|
|
60
|
-
? appearance.chrome
|
|
61
|
-
: "transparent",
|
|
62
|
-
display: "flex",
|
|
63
|
-
flex: "0 0 auto",
|
|
64
|
-
justifyContent: "center",
|
|
65
|
-
minHeight: 44,
|
|
66
|
-
// Product decision: header actions sit above this visual handle while
|
|
67
|
-
// MUI SwipeableDrawer owns a natural pull-down gesture across the
|
|
68
|
-
// entire sheet, including its scroll-aware cancellation behavior.
|
|
69
|
-
pointerEvents: handlePlacement === "overlay" ? "none" : "auto",
|
|
70
|
-
position: handlePlacement === "overlay" ? "absolute" : "relative",
|
|
71
|
-
top: handlePlacement === "overlay" ? 0 : "auto",
|
|
72
|
-
width: "100%",
|
|
73
|
-
zIndex: 0,
|
|
74
|
-
}, children: _jsx(Box, { sx: {
|
|
75
|
-
bgcolor: appearance.handle,
|
|
76
|
-
borderRadius: 999,
|
|
77
|
-
height: 4,
|
|
78
|
-
width: 36,
|
|
79
|
-
} }) }));
|
|
80
|
-
return (_jsxs(SwipeableDrawer, { anchor: "bottom", disableBackdropTransition: true, disableDiscovery: true, disableSwipeToOpen: true, hysteresis: 0.16, onClose: requestClose, onOpen: () => undefined, open: dismiss ? false : open, slotProps: {
|
|
81
|
-
backdrop: {
|
|
82
|
-
sx: { backgroundColor: "transparent" },
|
|
83
|
-
},
|
|
84
|
-
paper: paperSlotProps,
|
|
85
|
-
}, transitionDuration: mobileBottomDrawerDismissDuration, children: [headerLeft ? (_jsx(MobileBottomDrawerHeader, { closeLabel: `Close ${ariaLabel}`, closeTooltip: closeTooltip, dragHandle: drawerHandle, left: headerLeft, onClose: requestClose, right: headerRight })) : handlePlacement === "above-content" ? (drawerHandle) : null, _jsxs(Box, { "data-component": "mobile-bottom-drawer-scroll", sx: {
|
|
86
|
-
display: contentScrollMode === "child" ? "flex" : "block",
|
|
87
|
-
flex: 1,
|
|
88
|
-
minHeight: 0,
|
|
89
|
-
overflowY: contentScrollMode === "child" ? "hidden" : "auto",
|
|
90
|
-
overscrollBehaviorY: "contain",
|
|
91
|
-
pb: appearance.safeAreaBottom,
|
|
92
|
-
position: "relative",
|
|
93
|
-
zIndex: handlePlacement === "overlay" ? 1 : "auto",
|
|
94
|
-
}, children: [handlePlacement === "overlay" ? drawerHandle : null, children] })] }));
|
|
95
|
-
}
|
|
@@ -1,30 +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, Tooltip } from "@mui/material";
|
|
5
|
-
export function MobileBottomDrawerHeader({ closeLabel, closeTooltip, dragHandle, left, onClose, right, }) {
|
|
6
|
-
return (_jsxs(Box, { component: "header", "data-component": "mobile-bottom-drawer-header", sx: {
|
|
7
|
-
flex: "0 0 auto",
|
|
8
|
-
minHeight: 56,
|
|
9
|
-
position: "relative",
|
|
10
|
-
}, children: [_jsx(Box, { sx: {
|
|
11
|
-
inset: 0,
|
|
12
|
-
position: "absolute",
|
|
13
|
-
zIndex: 0,
|
|
14
|
-
}, children: dragHandle }), _jsxs(Box, { sx: {
|
|
15
|
-
alignItems: "center",
|
|
16
|
-
display: "flex",
|
|
17
|
-
gap: 1,
|
|
18
|
-
minHeight: 56,
|
|
19
|
-
px: 2,
|
|
20
|
-
// Product decision: title and actions occupy the same compact row as
|
|
21
|
-
// the drag affordance, avoiding a second band that pushes context
|
|
22
|
-
// away from the top edge of the drawer.
|
|
23
|
-
position: "relative",
|
|
24
|
-
zIndex: 1,
|
|
25
|
-
}, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: left }), _jsxs(Box, { sx: { alignItems: "center", display: "flex", gap: 0.5 }, children: [right, _jsx(Tooltip, { title: closeTooltip !== null && closeTooltip !== void 0 ? closeTooltip : "", children: _jsx(IconButton, { "aria-label": closeLabel, onClick: onClose, sx: {
|
|
26
|
-
minHeight: 48,
|
|
27
|
-
minWidth: 48,
|
|
28
|
-
"& > .MuiSvgIcon-root": { fontSize: 32 },
|
|
29
|
-
}, children: _jsx(CloseRoundedIcon, {}) }) })] })] })] }));
|
|
30
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Typography, useMediaQuery } from "@mui/material";
|
|
4
|
-
import { MobileBottomDrawer } from "./MobileBottomDrawer.js";
|
|
5
|
-
import { BottomDrawer } from "./BottomDrawer.js";
|
|
6
|
-
// Product decision: consumers share responsive drawer chrome but keep
|
|
7
|
-
// navigation and dismissal policies in their owning feature.
|
|
8
|
-
export function ResponsiveDrawer({ ariaLabel, appearance, closeTooltip, children, desktopContentSx, desktopCloseLabel, desktopDataComponent, desktopDisablePortal = false, desktopOpen = true, headerActions, mobileContentScrollMode, mobileDataComponent, mobileDismiss = false, mobileOpen = true, onDesktopClose, onMobileClose, title, }) {
|
|
9
|
-
const isMobileDrawer = useMediaQuery("(max-width:899.95px)", {
|
|
10
|
-
noSsr: true,
|
|
11
|
-
});
|
|
12
|
-
if (isMobileDrawer) {
|
|
13
|
-
if (!mobileOpen) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return (_jsx(MobileBottomDrawer, { appearance: appearance, closeTooltip: closeTooltip, ariaLabel: ariaLabel, contentScrollMode: mobileContentScrollMode, dataComponent: mobileDataComponent, dismiss: mobileDismiss, headerLeft: _jsx(Typography, { component: "h1", sx: { fontWeight: 760 }, children: title }), headerRight: headerActions, onClose: onMobileClose, children: children("mobile") }));
|
|
17
|
-
}
|
|
18
|
-
return (_jsx(BottomDrawer, { appearance: appearance, closeTooltip: closeTooltip, closeLabel: desktopCloseLabel !== null && desktopCloseLabel !== void 0 ? desktopCloseLabel : `Close ${ariaLabel}`, contentSx: desktopContentSx, dataComponent: desktopDataComponent, disablePortal: desktopDisablePortal, headerActions: headerActions, onClose: onDesktopClose, open: desktopOpen, title: title, children: children("desktop") }));
|
|
19
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import Collapse from "@mui/material/Collapse";
|
|
5
|
-
import Fade from "@mui/material/Fade";
|
|
6
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
7
|
-
import { WorkspaceSidePaneRoot } from "./WorkspaceSidePaneRoot.js";
|
|
8
|
-
import { workspaceSidePaneGeometry, workspaceSidePaneMetrics } from "./workspaceSidePaneGeometry.js";
|
|
9
|
-
const motion = { timeout: { enter: 220, exit: 170 }, easing: "cubic-bezier(0.25, 1, 0.5, 1)" };
|
|
10
|
-
/** Keeps the workspace in one slot across docked, modal and closed presentation. */
|
|
11
|
-
export function WorkspaceSidePane({ children, enabled = true, className, style, paneId, headingId, headingRef, workspaceRef, actionsLabel, resizeLabel = "Resize side pane", keepPaneMounted = false, getOverlaySiblings, renderActions, renderPane, }) {
|
|
12
|
-
const generatedId = useId();
|
|
13
|
-
const panelId = paneId !== null && paneId !== void 0 ? paneId : generatedId;
|
|
14
|
-
const rootRef = useRef(null);
|
|
15
|
-
const internalWorkspaceRef = useRef(null);
|
|
16
|
-
const contentRef = workspaceRef !== null && workspaceRef !== void 0 ? workspaceRef : internalWorkspaceRef;
|
|
17
|
-
const groupRef = useRef(null);
|
|
18
|
-
const openerRef = useRef(null);
|
|
19
|
-
const [open, setOpen] = useState(false);
|
|
20
|
-
const [present, setPresent] = useState(false);
|
|
21
|
-
const [directResize, setDirectResize] = useState(false);
|
|
22
|
-
const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)", { noSsr: true });
|
|
23
|
-
const duration = reducedMotion ? 0 : motion.timeout;
|
|
24
|
-
const [width, setWidth] = useState(workspaceSidePaneMetrics.initialPane);
|
|
25
|
-
const [bounds, setBounds] = useState({ width: workspaceSidePaneMetrics.minCanvas + workspaceSidePaneMetrics.rail + workspaceSidePaneMetrics.initialPane, top: 0, workspaceInset: 0 });
|
|
26
|
-
const drag = useRef(null);
|
|
27
|
-
const geometry = workspaceSidePaneGeometry(bounds.width, width, bounds.workspaceInset);
|
|
28
|
-
const visible = enabled && open;
|
|
29
|
-
const overlay = visible && geometry.overlay;
|
|
30
|
-
const visibleRef = useRef(visible);
|
|
31
|
-
visibleRef.current = visible;
|
|
32
|
-
// Release modal focus and report closed to the host before visual exit.
|
|
33
|
-
const overlayPresentation = geometry.overlay && (visible || (present && !reducedMotion));
|
|
34
|
-
useLayoutEffect(() => {
|
|
35
|
-
if (!enabled) {
|
|
36
|
-
setPresent(false);
|
|
37
|
-
setDirectResize(false);
|
|
38
|
-
drag.current = null;
|
|
39
|
-
}
|
|
40
|
-
else if (visible) {
|
|
41
|
-
setPresent(true);
|
|
42
|
-
}
|
|
43
|
-
}, [enabled, visible]);
|
|
44
|
-
useLayoutEffect(() => {
|
|
45
|
-
const element = rootRef.current;
|
|
46
|
-
if (!element)
|
|
47
|
-
return;
|
|
48
|
-
const measure = () => {
|
|
49
|
-
const rect = element.getBoundingClientRect();
|
|
50
|
-
const workspaceStyle = contentRef.current ? getComputedStyle(contentRef.current) : null;
|
|
51
|
-
// Useful canvas excludes its retained page padding; chrome still uses
|
|
52
|
-
// the full root width, including in narrow overlays.
|
|
53
|
-
const workspaceInset = workspaceStyle
|
|
54
|
-
? (parseFloat(workspaceStyle.paddingLeft) || 0) + (parseFloat(workspaceStyle.paddingRight) || 0)
|
|
55
|
-
: 0;
|
|
56
|
-
const next = { width: rect.width || window.innerWidth, top: Math.max(0, rect.top), workspaceInset };
|
|
57
|
-
// Content ResizeObserver notifications also arrive during pane motion;
|
|
58
|
-
// unchanged shell geometry must not rerender pane content per frame.
|
|
59
|
-
setBounds((previous) => previous.width === next.width && previous.top === next.top && previous.workspaceInset === next.workspaceInset ? previous : next);
|
|
60
|
-
};
|
|
61
|
-
measure();
|
|
62
|
-
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
63
|
-
observer === null || observer === void 0 ? void 0 : observer.observe(element);
|
|
64
|
-
if (contentRef.current)
|
|
65
|
-
observer === null || observer === void 0 ? void 0 : observer.observe(contentRef.current);
|
|
66
|
-
window.addEventListener("resize", measure);
|
|
67
|
-
return () => {
|
|
68
|
-
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
69
|
-
window.removeEventListener("resize", measure);
|
|
70
|
-
};
|
|
71
|
-
}, [enabled, contentRef]);
|
|
72
|
-
useLayoutEffect(() => {
|
|
73
|
-
var _a, _b, _c;
|
|
74
|
-
if (!overlay)
|
|
75
|
-
return;
|
|
76
|
-
const content = contentRef.current;
|
|
77
|
-
const root = rootRef.current;
|
|
78
|
-
const siblings = root ? (_a = getOverlaySiblings === null || getOverlaySiblings === void 0 ? void 0 : getOverlaySiblings(root)) !== null && _a !== void 0 ? _a : [] : [];
|
|
79
|
-
const covered = [...new Set([...(content ? [content] : []), ...siblings])];
|
|
80
|
-
const priorInert = covered.map((element) => ({ element, value: element.getAttribute("inert") }));
|
|
81
|
-
// Restore the pre-existing inert state when this overlay releases focus.
|
|
82
|
-
covered.forEach((element) => element.setAttribute("inert", ""));
|
|
83
|
-
const ownerDocument = (_c = (_b = rootRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument) !== null && _c !== void 0 ? _c : document;
|
|
84
|
-
const focusInside = () => { var _a; return (_a = headingRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
|
|
85
|
-
const containsTarget = (target) => { var _a; return Boolean(target && ((_a = groupRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))); };
|
|
86
|
-
const containFocus = (event) => {
|
|
87
|
-
if (!containsTarget(event.target))
|
|
88
|
-
focusInside();
|
|
89
|
-
};
|
|
90
|
-
const containOutsideTab = (event) => {
|
|
91
|
-
if (event.key !== "Tab" || containsTarget(event.target))
|
|
92
|
-
return;
|
|
93
|
-
event.preventDefault();
|
|
94
|
-
event.stopPropagation();
|
|
95
|
-
focusInside();
|
|
96
|
-
};
|
|
97
|
-
// inert blocks normal background interaction; focusin additionally contains
|
|
98
|
-
// programmatic focus and browsers/environments with incomplete inert support.
|
|
99
|
-
ownerDocument.addEventListener("focusin", containFocus, true);
|
|
100
|
-
ownerDocument.addEventListener("keydown", containOutsideTab, true);
|
|
101
|
-
focusInside();
|
|
102
|
-
return () => {
|
|
103
|
-
ownerDocument.removeEventListener("focusin", containFocus, true);
|
|
104
|
-
ownerDocument.removeEventListener("keydown", containOutsideTab, true);
|
|
105
|
-
priorInert.forEach(({ element, value }) => {
|
|
106
|
-
if (value === null)
|
|
107
|
-
element.removeAttribute("inert");
|
|
108
|
-
else
|
|
109
|
-
element.setAttribute("inert", value);
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
}, [overlay, headingId, headingRef, contentRef, getOverlaySiblings]);
|
|
113
|
-
useLayoutEffect(() => {
|
|
114
|
-
var _a;
|
|
115
|
-
if (!visible && present)
|
|
116
|
-
(_a = openerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
117
|
-
}, [visible, present]);
|
|
118
|
-
const close = (opener) => {
|
|
119
|
-
if (opener)
|
|
120
|
-
openerRef.current = opener;
|
|
121
|
-
setOpen(false);
|
|
122
|
-
setDirectResize(false);
|
|
123
|
-
drag.current = null;
|
|
124
|
-
};
|
|
125
|
-
// Deliberate docked resizing preserves the useful canvas and its focusable
|
|
126
|
-
// control. Only an external viewport/container change may require an overlay.
|
|
127
|
-
const dockedMaximum = Math.max(workspaceSidePaneMetrics.minPane, Math.min(workspaceSidePaneMetrics.maxPane, bounds.width - bounds.workspaceInset - workspaceSidePaneMetrics.rail - workspaceSidePaneMetrics.minCanvas));
|
|
128
|
-
const clampWidth = (next) => {
|
|
129
|
-
setDirectResize(true);
|
|
130
|
-
setWidth(Math.max(workspaceSidePaneMetrics.minPane, Math.min(dockedMaximum, next)));
|
|
131
|
-
};
|
|
132
|
-
const keyboard = (event) => {
|
|
133
|
-
var _a, _b, _c, _d, _e;
|
|
134
|
-
// Nested native dialogs own their own Escape handling.
|
|
135
|
-
if ((_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, "dialog[open]"))
|
|
136
|
-
return;
|
|
137
|
-
if (event.key === "Escape" && !event.defaultPrevented) {
|
|
138
|
-
event.preventDefault();
|
|
139
|
-
event.stopPropagation();
|
|
140
|
-
close();
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (!overlay || event.key !== "Tab")
|
|
144
|
-
return;
|
|
145
|
-
const controls = [...((_d = (_c = groupRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('button, a[href], input, textarea, select, summary, [tabindex]')) !== null && _d !== void 0 ? _d : [])]
|
|
146
|
-
.filter((element) => element.tabIndex >= 0 && !element.matches(":disabled")
|
|
147
|
-
&& !element.closest('[hidden], [inert], dialog:not([open])')
|
|
148
|
-
&& element.getClientRects().length > 0 && getComputedStyle(element).visibility !== "hidden");
|
|
149
|
-
const first = controls[0], last = controls[controls.length - 1];
|
|
150
|
-
const focused = (_e = groupRef.current) === null || _e === void 0 ? void 0 : _e.ownerDocument.activeElement;
|
|
151
|
-
if (event.shiftKey && (focused === first || focused === headingRef.current)) {
|
|
152
|
-
event.preventDefault();
|
|
153
|
-
last === null || last === void 0 ? void 0 : last.focus();
|
|
154
|
-
}
|
|
155
|
-
else if (!event.shiftKey && focused === last) {
|
|
156
|
-
event.preventDefault();
|
|
157
|
-
first === null || first === void 0 ? void 0 : first.focus();
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const openFrom = (event, focusTarget = headingRef) => {
|
|
161
|
-
openerRef.current = event.currentTarget;
|
|
162
|
-
setPresent(true);
|
|
163
|
-
setOpen(true);
|
|
164
|
-
if (event.detail === 0)
|
|
165
|
-
requestAnimationFrame(() => {
|
|
166
|
-
var _a;
|
|
167
|
-
if (visibleRef.current)
|
|
168
|
-
(_a = focusTarget.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
return (_jsxs(WorkspaceSidePaneRoot, { ref: rootRef, className: `workspace-side-pane${className ? ` ${className}` : ""}${enabled ? " workspace-side-pane-enabled" : ""}${visible ? " workspace-side-pane-open" : ""}${overlayPresentation ? " workspace-side-pane-overlay" : ""}${directResize && visible ? " workspace-side-pane-direct-resize" : ""}${reducedMotion ? " workspace-side-pane-reduced-motion" : ""}`, style: { ...style, "--workspace-side-pane-width": `${geometry.paneWidth}px`, "--workspace-side-pane-top": `${bounds.top}px` }, children: [_jsx("div", { ref: contentRef, className: "workspace-side-pane-workspace", children: children }), enabled && (_jsxs(_Fragment, { children: [_jsx(Fade, { in: overlay, timeout: duration, easing: motion.easing, mountOnEnter: true, unmountOnExit: true, children: _jsx("div", { className: "workspace-side-pane-backdrop", "data-active": overlay, style: { pointerEvents: overlay ? "auto" : "none" }, onClick: () => close(), "aria-hidden": "true" }) }), _jsxs("div", { className: "workspace-side-pane-group", ref: groupRef, role: overlay ? "dialog" : undefined, "aria-modal": overlay ? true : undefined, "aria-labelledby": overlay ? headingId : undefined, onKeyDown: keyboard, children: [_jsxs("nav", { className: "workspace-side-pane-rail", "aria-label": actionsLabel, children: [renderActions({ visible, paneId: panelId, openFrom, close }), visible && !overlay && (_jsx("div", { role: "separator", tabIndex: 0, className: "workspace-side-pane-resize", "aria-label": resizeLabel, "aria-orientation": "vertical", "aria-valuemin": workspaceSidePaneMetrics.minPane, "aria-valuemax": dockedMaximum, "aria-valuenow": width, "aria-valuetext": `${Math.round(geometry.paneWidth)} pixels`, title: "Drag to resize; Left/Right adjusts width; Enter resets", onKeyDown: (event) => {
|
|
172
|
-
const next = event.key === "ArrowLeft"
|
|
173
|
-
? width + 16
|
|
174
|
-
: event.key === "ArrowRight"
|
|
175
|
-
? width - 16
|
|
176
|
-
: event.key === "Home"
|
|
177
|
-
? workspaceSidePaneMetrics.minPane
|
|
178
|
-
: event.key === "End"
|
|
179
|
-
? workspaceSidePaneMetrics.maxPane
|
|
180
|
-
: event.key === "Enter"
|
|
181
|
-
? workspaceSidePaneMetrics.initialPane
|
|
182
|
-
: null;
|
|
183
|
-
if (next !== null) {
|
|
184
|
-
event.preventDefault();
|
|
185
|
-
event.stopPropagation();
|
|
186
|
-
clampWidth(next);
|
|
187
|
-
}
|
|
188
|
-
}, onPointerDown: (event) => {
|
|
189
|
-
var _a, _b;
|
|
190
|
-
drag.current = { x: event.clientX, width };
|
|
191
|
-
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
192
|
-
}, onPointerMove: (event) => {
|
|
193
|
-
if (drag.current)
|
|
194
|
-
clampWidth(drag.current.width + drag.current.x - event.clientX);
|
|
195
|
-
}, onPointerUp: () => {
|
|
196
|
-
drag.current = null;
|
|
197
|
-
}, onPointerCancel: () => {
|
|
198
|
-
drag.current = null;
|
|
199
|
-
} }))] }), _jsx(Collapse, { in: visible, orientation: "horizontal", className: "workspace-side-pane-presence", timeout: duration, easing: motion.easing, mountOnEnter: true, unmountOnExit: !keepPaneMounted, onExited: () => setPresent(false), children: _jsx("aside", { id: panelId, className: "workspace-side-pane-panel", "aria-labelledby": headingId, "aria-hidden": !visible || undefined, inert: !visible, children: renderPane(visible) }) })] })] }))] }));
|
|
200
|
-
}
|