@bayonai/mui-design 1.10.0 → 1.10.2
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 +9 -0
- package/dist/cjs/actions/ActionMenu.d.ts +24 -0
- package/dist/cjs/actions/ActionMenu.js +36 -0
- package/dist/cjs/actions/DialogActionButtons.d.ts +23 -0
- package/dist/cjs/actions/DialogActionButtons.js +33 -0
- package/dist/cjs/actions/LoadingIconButton.d.ts +11 -0
- package/dist/cjs/actions/LoadingIconButton.js +10 -0
- package/dist/cjs/actions/StickyActionFooter.d.ts +14 -0
- package/dist/cjs/actions/StickyActionFooter.js +27 -0
- package/dist/cjs/actions/StickySubmitButton.d.ts +10 -0
- package/dist/cjs/actions/StickySubmitButton.js +10 -0
- package/dist/cjs/actions/index.d.ts +5 -0
- package/dist/cjs/actions/index.js +18 -0
- package/dist/cjs/client.d.ts +4 -0
- package/dist/cjs/client.js +21 -0
- package/dist/cjs/components/BayonFlowVisual.d.ts +12 -0
- package/dist/cjs/components/BayonFlowVisual.js +87 -0
- package/dist/cjs/components/BayonThemeModeToggle.d.ts +6 -0
- package/dist/cjs/components/BayonThemeModeToggle.js +34 -0
- package/dist/cjs/components/IconTooltipButton.d.ts +10 -0
- package/dist/cjs/components/IconTooltipButton.js +50 -0
- package/dist/cjs/components/panels.d.ts +37 -0
- package/dist/cjs/components/panels.js +92 -0
- package/dist/cjs/drawers/BottomDrawer.d.ts +16 -0
- package/dist/cjs/drawers/BottomDrawer.js +43 -0
- package/dist/cjs/drawers/MobileBottomDrawer.d.ts +20 -0
- package/dist/cjs/drawers/MobileBottomDrawer.js +102 -0
- package/dist/cjs/drawers/MobileBottomDrawerHeader.d.ts +11 -0
- package/dist/cjs/drawers/MobileBottomDrawerHeader.js +36 -0
- package/dist/cjs/drawers/ResponsiveDrawer.d.ts +25 -0
- package/dist/cjs/drawers/ResponsiveDrawer.js +22 -0
- package/dist/cjs/drawers/WorkspaceSidePane.d.ts +31 -0
- package/dist/cjs/drawers/WorkspaceSidePane.js +228 -0
- package/dist/cjs/drawers/WorkspaceSidePaneRoot.d.ts +1 -0
- package/dist/cjs/drawers/WorkspaceSidePaneRoot.js +93 -0
- package/dist/cjs/drawers/drawerAppearance.d.ts +8 -0
- package/dist/cjs/drawers/drawerAppearance.js +10 -0
- package/dist/cjs/drawers/index.d.ts +7 -0
- package/dist/cjs/drawers/index.js +19 -0
- package/dist/cjs/drawers/useVisualViewportBottomInset.d.ts +6 -0
- package/dist/cjs/drawers/useVisualViewportBottomInset.js +33 -0
- package/dist/cjs/drawers/workspaceSidePaneGeometry.d.ts +11 -0
- package/dist/cjs/drawers/workspaceSidePaneGeometry.js +15 -0
- package/dist/cjs/feedback/StatusNotice.d.ts +13 -0
- package/dist/cjs/feedback/StatusNotice.js +62 -0
- package/dist/cjs/feedback/index.d.ts +1 -0
- package/dist/cjs/feedback/index.js +7 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/internal/DialogChoiceTile.d.ts +20 -0
- package/dist/cjs/internal/DialogChoiceTile.js +60 -0
- package/dist/cjs/links/LinkAddressPreview.d.ts +21 -0
- package/dist/cjs/links/LinkAddressPreview.js +130 -0
- package/dist/cjs/links/index.d.ts +3 -0
- package/dist/cjs/links/index.js +9 -0
- package/dist/cjs/links/useLinkAddressPreview.d.ts +26 -0
- package/dist/cjs/links/useLinkAddressPreview.js +171 -0
- package/dist/cjs/location/GeographicLocationField.d.ts +26 -0
- package/dist/cjs/location/GeographicLocationField.js +49 -0
- package/dist/cjs/location/GoogleMapsAttribution.d.ts +1 -0
- package/dist/cjs/location/GoogleMapsAttribution.js +12 -0
- package/dist/cjs/location/MetadataFieldGroup.d.ts +5 -0
- package/dist/cjs/location/MetadataFieldGroup.js +13 -0
- package/dist/cjs/location/MetadataValueField.d.ts +23 -0
- package/dist/cjs/location/MetadataValueField.js +27 -0
- package/dist/cjs/location/SearchInputAction.d.ts +9 -0
- package/dist/cjs/location/SearchInputAction.js +14 -0
- package/dist/cjs/location/TemplateBadge.d.ts +5 -0
- package/dist/cjs/location/TemplateBadge.js +9 -0
- package/dist/cjs/location/VenueSearchDialog.d.ts +33 -0
- package/dist/cjs/location/VenueSearchDialog.js +112 -0
- package/dist/cjs/location/index.d.ts +6 -0
- package/dist/cjs/location/index.js +20 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/pending/PendingChangesDialogShell.d.ts +2 -0
- package/dist/cjs/pending/PendingChangesDialogShell.js +16 -0
- package/dist/cjs/pending/PendingChangesDialogView.d.ts +2 -0
- package/dist/cjs/pending/PendingChangesDialogView.js +140 -0
- package/dist/cjs/pending/PendingChangesIndicatorView.d.ts +10 -0
- package/dist/cjs/pending/PendingChangesIndicatorView.js +27 -0
- package/dist/cjs/pending/index.d.ts +3 -0
- package/dist/cjs/pending/index.js +9 -0
- package/dist/cjs/pending/types.d.ts +55 -0
- package/dist/cjs/pending/types.js +2 -0
- package/dist/cjs/pricing/PlanUpgradeDialog.d.ts +17 -0
- package/dist/cjs/pricing/PlanUpgradeDialog.js +22 -0
- package/dist/cjs/pricing/PricingTable.d.ts +28 -0
- package/dist/cjs/pricing/PricingTable.js +60 -0
- package/dist/cjs/pricing/index.d.ts +3 -0
- package/dist/cjs/pricing/index.js +8 -0
- package/dist/cjs/providers/BayonThemeProvider.d.ts +20 -0
- package/dist/cjs/providers/BayonThemeProvider.js +163 -0
- package/dist/cjs/sections/ExpandableSectionToggle.d.ts +12 -0
- package/dist/cjs/sections/ExpandableSectionToggle.js +32 -0
- package/dist/cjs/sections/index.d.ts +2 -0
- package/dist/cjs/sections/index.js +7 -0
- package/dist/cjs/styles/pageStyles.d.ts +15 -0
- package/dist/cjs/styles/pageStyles.js +103 -0
- package/dist/cjs/swipe/SwipeActionRow.d.ts +8 -0
- package/dist/cjs/swipe/SwipeActionRow.js +123 -0
- package/dist/cjs/swipe/index.d.ts +1 -0
- package/dist/cjs/swipe/index.js +8 -0
- package/dist/cjs/theme/components.d.ts +2 -0
- package/dist/cjs/theme/components.js +123 -0
- package/dist/cjs/theme/createBayonTheme.d.ts +4 -0
- package/dist/cjs/theme/createBayonTheme.js +45 -0
- package/dist/cjs/theme/palette.d.ts +146 -0
- package/dist/cjs/theme/palette.js +109 -0
- package/dist/cjs/theme/shadows.d.ts +2 -0
- package/dist/cjs/theme/shadows.js +21 -0
- package/dist/cjs/theme/types.d.ts +47 -0
- package/dist/cjs/theme/types.js +2 -0
- package/dist/cjs/theme/typography.d.ts +2 -0
- package/dist/cjs/theme/typography.js +58 -0
- package/dist/cjs/toasts/ActionToast.d.ts +11 -0
- package/dist/cjs/toasts/ActionToast.js +12 -0
- package/dist/cjs/toasts/Toast.d.ts +16 -0
- package/dist/cjs/toasts/Toast.js +55 -0
- package/dist/cjs/toasts/index.d.ts +5 -0
- package/dist/cjs/toasts/index.js +12 -0
- package/dist/cjs/toasts/useUpwardToastDismiss.d.ts +15 -0
- package/dist/cjs/toasts/useUpwardToastDismiss.js +73 -0
- package/dist/cjs/uploads/CameraCaptureDialog.d.ts +22 -0
- package/dist/cjs/uploads/CameraCaptureDialog.js +187 -0
- package/dist/cjs/uploads/FileRow.d.ts +10 -0
- package/dist/cjs/uploads/FileRow.js +23 -0
- package/dist/cjs/uploads/FileSwipeActionRow.d.ts +1 -0
- package/dist/cjs/uploads/FileSwipeActionRow.js +11 -0
- package/dist/cjs/uploads/FileThumbnail.d.ts +5 -0
- package/dist/cjs/uploads/FileThumbnail.js +104 -0
- package/dist/cjs/uploads/FileUpload.d.ts +26 -0
- package/dist/cjs/uploads/FileUpload.js +98 -0
- package/dist/cjs/uploads/FileViewer.d.ts +9 -0
- package/dist/cjs/uploads/FileViewer.js +173 -0
- package/dist/cjs/uploads/ImageCropDialog.d.ts +26 -0
- package/dist/cjs/uploads/ImageCropDialog.js +215 -0
- package/dist/cjs/uploads/ImageInfoPanel.d.ts +24 -0
- package/dist/cjs/uploads/ImageInfoPanel.js +41 -0
- package/dist/cjs/uploads/ImageUploadQualityDialog.d.ts +13 -0
- package/dist/cjs/uploads/ImageUploadQualityDialog.js +57 -0
- package/dist/cjs/uploads/UploadProgressRing.d.ts +24 -0
- package/dist/cjs/uploads/UploadProgressRing.js +32 -0
- package/dist/cjs/uploads/cameraCropPresentation.d.ts +2 -0
- package/dist/cjs/uploads/cameraCropPresentation.js +12 -0
- package/dist/cjs/uploads/index.d.ts +12 -0
- package/dist/cjs/uploads/index.js +24 -0
- package/dist/cjs/utils/createBayonEmotionCache.d.ts +1 -0
- package/dist/cjs/utils/createBayonEmotionCache.js +21 -0
- package/dist/esm/actions/ActionMenu.js +30 -0
- package/dist/esm/actions/DialogActionButtons.js +24 -0
- package/dist/esm/actions/LoadingIconButton.js +7 -0
- package/dist/esm/actions/StickyActionFooter.js +24 -0
- package/dist/esm/actions/StickySubmitButton.js +7 -0
- package/dist/esm/actions/index.js +7 -0
- package/dist/esm/client.js +5 -0
- package/dist/esm/components/BayonFlowVisual.js +81 -0
- package/dist/esm/components/BayonThemeModeToggle.js +28 -0
- package/dist/esm/components/IconTooltipButton.js +11 -0
- package/dist/esm/components/panels.js +76 -0
- package/dist/esm/drawers/BottomDrawer.js +37 -0
- package/dist/esm/drawers/MobileBottomDrawer.js +95 -0
- package/dist/esm/drawers/MobileBottomDrawerHeader.js +30 -0
- package/dist/esm/drawers/ResponsiveDrawer.js +19 -0
- package/dist/esm/drawers/WorkspaceSidePane.js +222 -0
- package/dist/esm/drawers/WorkspaceSidePaneRoot.js +90 -0
- package/dist/esm/drawers/drawerAppearance.js +7 -0
- package/dist/esm/drawers/index.js +8 -0
- package/dist/esm/drawers/useVisualViewportBottomInset.js +29 -0
- package/dist/esm/drawers/workspaceSidePaneGeometry.js +11 -0
- package/dist/esm/feedback/StatusNotice.js +56 -0
- package/dist/esm/feedback/index.js +3 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/internal/DialogChoiceTile.js +54 -0
- package/dist/esm/links/LinkAddressPreview.js +91 -0
- package/dist/esm/links/index.js +4 -0
- package/dist/esm/links/useLinkAddressPreview.js +168 -0
- package/dist/esm/location/GeographicLocationField.js +43 -0
- package/dist/esm/location/GoogleMapsAttribution.js +9 -0
- package/dist/esm/location/MetadataFieldGroup.js +9 -0
- package/dist/esm/location/MetadataValueField.js +23 -0
- package/dist/esm/location/SearchInputAction.js +8 -0
- package/dist/esm/location/TemplateBadge.js +6 -0
- package/dist/esm/location/VenueSearchDialog.js +109 -0
- package/dist/esm/location/index.js +7 -0
- package/dist/esm/pending/PendingChangesDialogShell.js +10 -0
- package/dist/esm/pending/PendingChangesDialogView.js +134 -0
- package/dist/esm/pending/PendingChangesIndicatorView.js +21 -0
- package/dist/esm/pending/index.js +4 -0
- package/dist/esm/pending/types.js +1 -0
- package/dist/esm/pricing/PlanUpgradeDialog.js +19 -0
- package/dist/esm/pricing/PricingTable.js +54 -0
- package/dist/esm/pricing/index.js +3 -0
- package/dist/esm/providers/BayonThemeProvider.js +123 -0
- package/dist/esm/sections/ExpandableSectionToggle.js +26 -0
- package/dist/esm/sections/index.js +3 -0
- package/dist/esm/styles/pageStyles.js +100 -0
- package/dist/esm/swipe/SwipeActionRow.js +116 -0
- package/dist/esm/swipe/index.js +3 -0
- package/dist/esm/theme/components.js +120 -0
- package/dist/esm/theme/createBayonTheme.js +41 -0
- package/dist/esm/theme/palette.js +106 -0
- package/dist/esm/theme/shadows.js +18 -0
- package/dist/esm/theme/types.js +1 -0
- package/dist/esm/theme/typography.js +55 -0
- package/dist/esm/toasts/ActionToast.js +9 -0
- package/dist/esm/toasts/Toast.js +52 -0
- package/dist/esm/toasts/index.js +5 -0
- package/dist/esm/toasts/useUpwardToastDismiss.js +69 -0
- package/dist/esm/uploads/CameraCaptureDialog.js +181 -0
- package/dist/esm/uploads/FileRow.js +17 -0
- package/dist/esm/uploads/FileSwipeActionRow.js +7 -0
- package/dist/esm/uploads/FileThumbnail.js +98 -0
- package/dist/esm/uploads/FileUpload.js +92 -0
- package/dist/esm/uploads/FileViewer.js +167 -0
- package/dist/esm/uploads/ImageCropDialog.js +212 -0
- package/dist/esm/uploads/ImageInfoPanel.js +35 -0
- package/dist/esm/uploads/ImageUploadQualityDialog.js +51 -0
- package/dist/esm/uploads/UploadProgressRing.js +29 -0
- package/dist/esm/uploads/cameraCropPresentation.js +5 -0
- package/dist/esm/uploads/index.js +11 -0
- package/dist/esm/utils/createBayonEmotionCache.js +15 -0
- package/dist/types/actions/ActionMenu.d.ts +24 -0
- package/dist/types/actions/DialogActionButtons.d.ts +23 -0
- package/dist/types/actions/LoadingIconButton.d.ts +11 -0
- package/dist/types/actions/StickyActionFooter.d.ts +14 -0
- package/dist/types/actions/StickySubmitButton.d.ts +10 -0
- package/dist/types/actions/index.d.ts +5 -0
- package/dist/types/client.d.ts +4 -0
- package/dist/types/components/BayonFlowVisual.d.ts +12 -0
- package/dist/types/components/BayonThemeModeToggle.d.ts +6 -0
- package/dist/types/components/IconTooltipButton.d.ts +10 -0
- package/dist/types/components/panels.d.ts +37 -0
- package/dist/types/drawers/BottomDrawer.d.ts +16 -0
- package/dist/types/drawers/MobileBottomDrawer.d.ts +20 -0
- package/dist/types/drawers/MobileBottomDrawerHeader.d.ts +11 -0
- package/dist/types/drawers/ResponsiveDrawer.d.ts +25 -0
- package/dist/types/drawers/WorkspaceSidePane.d.ts +31 -0
- package/dist/types/drawers/WorkspaceSidePaneRoot.d.ts +1 -0
- package/dist/types/drawers/drawerAppearance.d.ts +8 -0
- package/dist/types/drawers/index.d.ts +7 -0
- package/dist/types/drawers/useVisualViewportBottomInset.d.ts +6 -0
- package/dist/types/drawers/workspaceSidePaneGeometry.d.ts +11 -0
- package/dist/types/feedback/StatusNotice.d.ts +13 -0
- package/dist/types/feedback/index.d.ts +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/internal/DialogChoiceTile.d.ts +20 -0
- package/dist/types/links/LinkAddressPreview.d.ts +21 -0
- package/dist/types/links/index.d.ts +3 -0
- package/dist/types/links/useLinkAddressPreview.d.ts +26 -0
- package/dist/types/location/GeographicLocationField.d.ts +26 -0
- package/dist/types/location/GoogleMapsAttribution.d.ts +1 -0
- package/dist/types/location/MetadataFieldGroup.d.ts +5 -0
- package/dist/types/location/MetadataValueField.d.ts +23 -0
- package/dist/types/location/SearchInputAction.d.ts +9 -0
- package/dist/types/location/TemplateBadge.d.ts +5 -0
- package/dist/types/location/VenueSearchDialog.d.ts +33 -0
- package/dist/types/location/index.d.ts +6 -0
- package/dist/types/pending/PendingChangesDialogShell.d.ts +2 -0
- package/dist/types/pending/PendingChangesDialogView.d.ts +2 -0
- package/dist/types/pending/PendingChangesIndicatorView.d.ts +10 -0
- package/dist/types/pending/index.d.ts +3 -0
- package/dist/types/pending/types.d.ts +55 -0
- package/dist/types/pricing/PlanUpgradeDialog.d.ts +17 -0
- package/dist/types/pricing/PricingTable.d.ts +28 -0
- package/dist/types/pricing/index.d.ts +3 -0
- package/dist/types/providers/BayonThemeProvider.d.ts +20 -0
- package/dist/types/sections/ExpandableSectionToggle.d.ts +12 -0
- package/dist/types/sections/index.d.ts +2 -0
- package/dist/types/styles/pageStyles.d.ts +15 -0
- package/dist/types/swipe/SwipeActionRow.d.ts +8 -0
- package/dist/types/swipe/index.d.ts +1 -0
- package/dist/types/theme/components.d.ts +2 -0
- package/dist/types/theme/createBayonTheme.d.ts +4 -0
- package/dist/types/theme/palette.d.ts +146 -0
- package/dist/types/theme/shadows.d.ts +2 -0
- package/dist/types/theme/types.d.ts +47 -0
- package/dist/types/theme/typography.d.ts +2 -0
- package/dist/types/toasts/ActionToast.d.ts +11 -0
- package/dist/types/toasts/Toast.d.ts +16 -0
- package/dist/types/toasts/index.d.ts +5 -0
- package/dist/types/toasts/useUpwardToastDismiss.d.ts +15 -0
- package/dist/types/uploads/CameraCaptureDialog.d.ts +22 -0
- package/dist/types/uploads/FileRow.d.ts +10 -0
- package/dist/types/uploads/FileSwipeActionRow.d.ts +1 -0
- package/dist/types/uploads/FileThumbnail.d.ts +5 -0
- package/dist/types/uploads/FileUpload.d.ts +26 -0
- package/dist/types/uploads/FileViewer.d.ts +9 -0
- package/dist/types/uploads/ImageCropDialog.d.ts +26 -0
- package/dist/types/uploads/ImageInfoPanel.d.ts +24 -0
- package/dist/types/uploads/ImageUploadQualityDialog.d.ts +13 -0
- package/dist/types/uploads/UploadProgressRing.d.ts +24 -0
- package/dist/types/uploads/cameraCropPresentation.d.ts +2 -0
- package/dist/types/uploads/index.d.ts +12 -0
- package/dist/types/utils/createBayonEmotionCache.d.ts +1 -0
- package/docs/uploads-contract.md +15 -0
- package/package.json +2 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { bayonAccent } from '../theme/palette.js';
|
|
2
|
+
export const pageShellSx = {
|
|
3
|
+
bgcolor: 'var(--bayon-bg)',
|
|
4
|
+
color: 'var(--bayon-fg)',
|
|
5
|
+
};
|
|
6
|
+
export const gradientHeroSx = {
|
|
7
|
+
bgcolor: 'var(--bayon-bg)',
|
|
8
|
+
color: 'var(--bayon-fg)',
|
|
9
|
+
py: { xs: 8, md: 11 },
|
|
10
|
+
position: 'relative',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
'&::before': {
|
|
13
|
+
content: '""',
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
inset: 0,
|
|
16
|
+
background: 'linear-gradient(120deg, var(--bayon-hero-teal), transparent 34%), linear-gradient(55deg, transparent 48%, var(--bayon-hero-yellow), transparent 70%), linear-gradient(150deg, transparent 40%, var(--bayon-hero-coral))',
|
|
17
|
+
pointerEvents: 'none',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const heroContainerSx = {
|
|
21
|
+
position: 'relative',
|
|
22
|
+
};
|
|
23
|
+
export const heroStackSx = {
|
|
24
|
+
maxWidth: 880,
|
|
25
|
+
position: 'relative',
|
|
26
|
+
};
|
|
27
|
+
export const heroTitleSx = {
|
|
28
|
+
color: 'var(--bayon-heading)',
|
|
29
|
+
fontSize: { xs: '2.75rem', md: '4.75rem' },
|
|
30
|
+
lineHeight: 1,
|
|
31
|
+
};
|
|
32
|
+
export const heroBodySx = {
|
|
33
|
+
color: 'var(--bayon-muted-strong)',
|
|
34
|
+
fontSize: { xs: '1.1rem', md: '1.3rem' },
|
|
35
|
+
lineHeight: 1.65,
|
|
36
|
+
};
|
|
37
|
+
export const darkPanelSx = {
|
|
38
|
+
bgcolor: 'var(--bayon-panel)',
|
|
39
|
+
border: '1px solid var(--bayon-border)',
|
|
40
|
+
borderRadius: 2,
|
|
41
|
+
boxShadow: 'var(--bayon-panel-shadow)',
|
|
42
|
+
};
|
|
43
|
+
export const accentPanelSx = {
|
|
44
|
+
...darkPanelSx,
|
|
45
|
+
position: 'relative',
|
|
46
|
+
isolation: 'isolate',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
'&::before': {
|
|
49
|
+
content: '""',
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
left: 0,
|
|
52
|
+
top: 0,
|
|
53
|
+
bottom: 0,
|
|
54
|
+
width: 6,
|
|
55
|
+
background: 'linear-gradient(180deg, #2DD4BF, #60A5FA 38%, #FDE047 68%, #FF6B6B)',
|
|
56
|
+
pointerEvents: 'none',
|
|
57
|
+
zIndex: 0,
|
|
58
|
+
},
|
|
59
|
+
'& > *': {
|
|
60
|
+
position: 'relative',
|
|
61
|
+
zIndex: 1,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export const darkPanelHoverSx = {
|
|
65
|
+
transition: 'transform 180ms ease, border-color 180ms ease, background-color 180ms ease',
|
|
66
|
+
'&:hover': {
|
|
67
|
+
transform: 'translateY(-5px)',
|
|
68
|
+
borderColor: 'rgba(45, 212, 191, 0.65)',
|
|
69
|
+
bgcolor: 'var(--bayon-panel-hover)',
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
export const darkCtaSx = {
|
|
73
|
+
bgcolor: 'var(--bayon-panel-solid)',
|
|
74
|
+
color: 'var(--bayon-fg)',
|
|
75
|
+
border: '1px solid var(--bayon-border)',
|
|
76
|
+
borderRadius: 2,
|
|
77
|
+
};
|
|
78
|
+
export const eyebrowSx = {
|
|
79
|
+
color: bayonAccent.teal,
|
|
80
|
+
fontSize: '0.82rem',
|
|
81
|
+
fontWeight: 800,
|
|
82
|
+
textTransform: 'uppercase',
|
|
83
|
+
};
|
|
84
|
+
export const mutedTextSx = {
|
|
85
|
+
color: 'var(--bayon-muted)',
|
|
86
|
+
lineHeight: 1.75,
|
|
87
|
+
};
|
|
88
|
+
export const tealButtonSx = {
|
|
89
|
+
bgcolor: bayonAccent.teal,
|
|
90
|
+
color: bayonAccent.ink,
|
|
91
|
+
'&:hover': { bgcolor: bayonAccent.tealLight },
|
|
92
|
+
};
|
|
93
|
+
export const outlineButtonSx = {
|
|
94
|
+
borderColor: 'var(--bayon-border-strong)',
|
|
95
|
+
color: 'var(--bayon-fg)',
|
|
96
|
+
'&:hover': {
|
|
97
|
+
borderColor: bayonAccent.teal,
|
|
98
|
+
bgcolor: 'rgba(45, 212, 191, 0.1)',
|
|
99
|
+
},
|
|
100
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import DeleteOutlineRoundedIcon from "@mui/icons-material/DeleteOutlineRounded";
|
|
4
|
+
import { Box, Stack, Typography } from "@mui/material";
|
|
5
|
+
import { useRef, useState } from "react";
|
|
6
|
+
export const SWIPE_ROW_SWIPE_DELETE_DISTANCE_PX = 72;
|
|
7
|
+
const SWIPE_ROW_MAX_SWIPE_DISTANCE_PX = 104;
|
|
8
|
+
const SWIPE_ROW_SWIPE_DIRECTION_DISTANCE_PX = 12;
|
|
9
|
+
export function SwipeActionRow({ children, onDelete, canDelete = true, dataComponent = "swipe-action-row", }) {
|
|
10
|
+
const [swipeOffset, setSwipeOffset] = useState(0);
|
|
11
|
+
const suppressNextClickRef = useRef(false);
|
|
12
|
+
const swipeStartRef = useRef(null);
|
|
13
|
+
function resetSwipe() {
|
|
14
|
+
swipeStartRef.current = null;
|
|
15
|
+
setSwipeOffset(0);
|
|
16
|
+
}
|
|
17
|
+
function handleTouchStart(event) {
|
|
18
|
+
resetSwipe();
|
|
19
|
+
if (!canDelete)
|
|
20
|
+
return;
|
|
21
|
+
if (event.touches.length !== 1)
|
|
22
|
+
return;
|
|
23
|
+
const touch = event.touches[0];
|
|
24
|
+
if (!touch)
|
|
25
|
+
return;
|
|
26
|
+
swipeStartRef.current = {
|
|
27
|
+
direction: null,
|
|
28
|
+
identifier: touch.identifier,
|
|
29
|
+
x: touch.clientX,
|
|
30
|
+
y: touch.clientY,
|
|
31
|
+
};
|
|
32
|
+
setSwipeOffset(0);
|
|
33
|
+
}
|
|
34
|
+
function handleTouchMove(event) {
|
|
35
|
+
if (!canDelete || event.touches.length !== 1) {
|
|
36
|
+
resetSwipe();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const swipeStart = swipeStartRef.current;
|
|
40
|
+
const touch = getTouchByIdentifier(event.touches, swipeStart === null || swipeStart === void 0 ? void 0 : swipeStart.identifier);
|
|
41
|
+
if (!swipeStart || !touch || swipeStart.direction === "vertical")
|
|
42
|
+
return;
|
|
43
|
+
const offsetX = touch.clientX - swipeStart.x;
|
|
44
|
+
const offsetY = touch.clientY - swipeStart.y;
|
|
45
|
+
if (!swipeStart.direction) {
|
|
46
|
+
if (Math.abs(offsetX) < SWIPE_ROW_SWIPE_DIRECTION_DISTANCE_PX &&
|
|
47
|
+
Math.abs(offsetY) < SWIPE_ROW_SWIPE_DIRECTION_DISTANCE_PX) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (offsetX > 0 || Math.abs(offsetY) >= Math.abs(offsetX)) {
|
|
51
|
+
swipeStart.direction = "vertical";
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
swipeStart.direction = "horizontal";
|
|
55
|
+
}
|
|
56
|
+
// pan-y leaves vertical scrolling to the browser; only claim a left pull
|
|
57
|
+
// after direction lock so parent sheets do not also dismiss.
|
|
58
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
59
|
+
setSwipeOffset(Math.max(-SWIPE_ROW_MAX_SWIPE_DISTANCE_PX, Math.min(0, offsetX)));
|
|
60
|
+
}
|
|
61
|
+
function handleTouchEnd(event) {
|
|
62
|
+
const swipeStart = swipeStartRef.current;
|
|
63
|
+
const touch = getTouchByIdentifier(event.changedTouches, swipeStart === null || swipeStart === void 0 ? void 0 : swipeStart.identifier);
|
|
64
|
+
if (!swipeStart || !touch || swipeStart.direction !== "horizontal") {
|
|
65
|
+
resetSwipe();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
69
|
+
const swipeDistance = touch.clientX - swipeStart.x;
|
|
70
|
+
resetSwipe();
|
|
71
|
+
suppressNextClickRef.current = true;
|
|
72
|
+
globalThis.setTimeout(() => {
|
|
73
|
+
suppressNextClickRef.current = false;
|
|
74
|
+
}, 0);
|
|
75
|
+
if (canDelete && swipeDistance <= -SWIPE_ROW_SWIPE_DELETE_DISTANCE_PX) {
|
|
76
|
+
onDelete();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return (_jsxs(Box, { "data-component": dataComponent, "data-drawer-gesture-exclude": true, onClickCapture: (event) => {
|
|
80
|
+
if (!suppressNextClickRef.current)
|
|
81
|
+
return;
|
|
82
|
+
suppressNextClickRef.current = false;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
}, onTouchCancel: resetSwipe, onTouchEnd: handleTouchEnd, onTouchMove: handleTouchMove, onTouchStart: handleTouchStart, sx: { overflow: "hidden", position: "relative", touchAction: "pan-y" }, children: [_jsx(Box, { "aria-hidden": true, "data-component": "swipe-delete-action", sx: {
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
bgcolor: "error.main",
|
|
88
|
+
color: "common.white",
|
|
89
|
+
display: "flex",
|
|
90
|
+
inset: 0,
|
|
91
|
+
justifyContent: "flex-end",
|
|
92
|
+
opacity: swipeOffset === 0 ? 0 : 1,
|
|
93
|
+
px: 2,
|
|
94
|
+
pointerEvents: "none",
|
|
95
|
+
position: "absolute",
|
|
96
|
+
}, children: _jsxs(Stack, { direction: "row", spacing: 0.75, sx: { alignItems: "center" }, children: [_jsx(DeleteOutlineRoundedIcon, { fontSize: "small" }), _jsx(Typography, { component: "span", sx: { fontSize: 12, fontWeight: 700 }, children: "Delete" })] }) }), _jsx(Box, { sx: {
|
|
97
|
+
bgcolor: "background.paper",
|
|
98
|
+
transform: swipeOffset === 0
|
|
99
|
+
? undefined
|
|
100
|
+
: `translate3d(${swipeOffset}px, 0, 0)`,
|
|
101
|
+
transition: swipeOffset
|
|
102
|
+
? "none"
|
|
103
|
+
: "transform 160ms cubic-bezier(0.2, 0, 0, 1)",
|
|
104
|
+
"@media (prefers-reduced-motion: reduce)": { transition: "none" },
|
|
105
|
+
}, children: children })] }));
|
|
106
|
+
}
|
|
107
|
+
function getTouchByIdentifier(touches, identifier) {
|
|
108
|
+
if (identifier === undefined)
|
|
109
|
+
return undefined;
|
|
110
|
+
for (let index = 0; index < touches.length; index += 1) {
|
|
111
|
+
const touch = touches[index];
|
|
112
|
+
if ((touch === null || touch === void 0 ? void 0 : touch.identifier) === identifier)
|
|
113
|
+
return touch;
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { bayonShadows } from './shadows.js';
|
|
2
|
+
export const bayonComponents = {
|
|
3
|
+
MuiCssBaseline: {
|
|
4
|
+
styleOverrides: {
|
|
5
|
+
':root, html[data-theme="dark"]': {
|
|
6
|
+
'--bayon-bg': '#0B1020',
|
|
7
|
+
'--bayon-bg-soft': '#111827',
|
|
8
|
+
'--bayon-fg': '#F8FAFC',
|
|
9
|
+
'--bayon-heading': '#FFFFFF',
|
|
10
|
+
'--bayon-muted': 'rgba(248, 250, 252, 0.74)',
|
|
11
|
+
'--bayon-muted-strong': 'rgba(248, 250, 252, 0.82)',
|
|
12
|
+
'--bayon-border': 'rgba(248, 250, 252, 0.14)',
|
|
13
|
+
'--bayon-border-strong': 'rgba(248, 250, 252, 0.28)',
|
|
14
|
+
'--bayon-panel': 'rgba(248, 250, 252, 0.06)',
|
|
15
|
+
'--bayon-panel-hover': 'rgba(248, 250, 252, 0.08)',
|
|
16
|
+
'--bayon-panel-solid': '#111827',
|
|
17
|
+
'--bayon-panel-shadow': '0 28px 80px rgba(2, 6, 23, 0.24)',
|
|
18
|
+
'--bayon-grid-line': 'rgba(248, 250, 252, 0.08)',
|
|
19
|
+
'--bayon-hero-teal': 'rgba(45, 212, 191, 0.2)',
|
|
20
|
+
'--bayon-hero-blue': 'rgba(96, 165, 250, 0.18)',
|
|
21
|
+
'--bayon-hero-yellow': 'rgba(253, 224, 71, 0.14)',
|
|
22
|
+
'--bayon-hero-coral': 'rgba(255, 107, 107, 0.16)',
|
|
23
|
+
'--bayon-link': '#A7F3D0',
|
|
24
|
+
'--bayon-link-hover': '#2DD4BF',
|
|
25
|
+
colorScheme: 'dark',
|
|
26
|
+
},
|
|
27
|
+
'html[data-theme="light"]': {
|
|
28
|
+
'--bayon-bg': '#F7FAFC',
|
|
29
|
+
'--bayon-bg-soft': '#EAF2F7',
|
|
30
|
+
'--bayon-fg': '#10242A',
|
|
31
|
+
'--bayon-heading': '#08181D',
|
|
32
|
+
'--bayon-muted': 'rgba(16, 36, 42, 0.74)',
|
|
33
|
+
'--bayon-muted-strong': 'rgba(16, 36, 42, 0.84)',
|
|
34
|
+
'--bayon-border': 'rgba(15, 51, 61, 0.14)',
|
|
35
|
+
'--bayon-border-strong': 'rgba(15, 51, 61, 0.26)',
|
|
36
|
+
'--bayon-panel': 'rgba(255, 255, 255, 0.74)',
|
|
37
|
+
'--bayon-panel-hover': 'rgba(255, 255, 255, 0.9)',
|
|
38
|
+
'--bayon-panel-solid': '#FFFFFF',
|
|
39
|
+
'--bayon-panel-shadow': '0 18px 52px rgba(20, 63, 74, 0.13)',
|
|
40
|
+
'--bayon-grid-line': 'rgba(15, 51, 61, 0.08)',
|
|
41
|
+
'--bayon-hero-teal': 'rgba(20, 184, 166, 0.18)',
|
|
42
|
+
'--bayon-hero-blue': 'rgba(37, 99, 235, 0.13)',
|
|
43
|
+
'--bayon-hero-yellow': 'rgba(202, 138, 4, 0.12)',
|
|
44
|
+
'--bayon-hero-coral': 'rgba(225, 83, 83, 0.13)',
|
|
45
|
+
'--bayon-link': '#0F766E',
|
|
46
|
+
'--bayon-link-hover': '#0D9488',
|
|
47
|
+
colorScheme: 'light',
|
|
48
|
+
},
|
|
49
|
+
'html, body': {
|
|
50
|
+
backgroundColor: 'var(--bayon-bg)',
|
|
51
|
+
color: 'var(--bayon-fg)',
|
|
52
|
+
},
|
|
53
|
+
'body': {
|
|
54
|
+
transition: 'background-color 180ms ease, color 180ms ease',
|
|
55
|
+
},
|
|
56
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
57
|
+
body: {
|
|
58
|
+
transition: 'none',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
MuiButtonBase: {
|
|
64
|
+
defaultProps: {
|
|
65
|
+
disableRipple: true,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
MuiButton: {
|
|
69
|
+
styleOverrides: {
|
|
70
|
+
root: {
|
|
71
|
+
borderRadius: 8,
|
|
72
|
+
padding: '8px 22px',
|
|
73
|
+
fontWeight: 600,
|
|
74
|
+
textTransform: 'none',
|
|
75
|
+
boxShadow: 'none',
|
|
76
|
+
'&:hover': {
|
|
77
|
+
boxShadow: 'none',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
sizeLarge: {
|
|
81
|
+
padding: '10px 24px',
|
|
82
|
+
fontSize: '1rem',
|
|
83
|
+
},
|
|
84
|
+
sizeSmall: {
|
|
85
|
+
padding: '6px 16px',
|
|
86
|
+
fontSize: '0.875rem',
|
|
87
|
+
},
|
|
88
|
+
contained: {
|
|
89
|
+
boxShadow: 'none',
|
|
90
|
+
'&:hover': {
|
|
91
|
+
boxShadow: 'none',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
MuiCard: {
|
|
97
|
+
styleOverrides: {
|
|
98
|
+
root: {
|
|
99
|
+
borderRadius: 16,
|
|
100
|
+
boxShadow: bayonShadows.z8,
|
|
101
|
+
'&:hover': {
|
|
102
|
+
boxShadow: bayonShadows.z16,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
MuiTextField: {
|
|
108
|
+
defaultProps: {
|
|
109
|
+
fullWidth: true,
|
|
110
|
+
variant: 'outlined',
|
|
111
|
+
},
|
|
112
|
+
styleOverrides: {
|
|
113
|
+
root: {
|
|
114
|
+
'& .MuiOutlinedInput-root': {
|
|
115
|
+
borderRadius: 8,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
|
|
2
|
+
import { bayonComponents } from './components.js';
|
|
3
|
+
import { bayonDarkPalette, bayonPalette } from './palette.js';
|
|
4
|
+
import { bayonShadows } from './shadows.js';
|
|
5
|
+
import { bayonTypography } from './typography.js';
|
|
6
|
+
export function createBayonTheme(options = {}) {
|
|
7
|
+
const { mode = 'light', overrides = {} } = options;
|
|
8
|
+
const baseTheme = {
|
|
9
|
+
palette: mode === 'dark' ? bayonDarkPalette : bayonPalette,
|
|
10
|
+
shape: {
|
|
11
|
+
borderRadius: 8,
|
|
12
|
+
},
|
|
13
|
+
typography: bayonTypography,
|
|
14
|
+
components: bayonComponents,
|
|
15
|
+
customShadows: bayonShadows,
|
|
16
|
+
};
|
|
17
|
+
return responsiveFontSizes(createTheme(baseTheme, overrides));
|
|
18
|
+
}
|
|
19
|
+
function createLazyBayonTheme(options = {}) {
|
|
20
|
+
let theme;
|
|
21
|
+
const getTheme = () => {
|
|
22
|
+
theme !== null && theme !== void 0 ? theme : (theme = createBayonTheme(options));
|
|
23
|
+
return theme;
|
|
24
|
+
};
|
|
25
|
+
return new Proxy({}, {
|
|
26
|
+
get(_target, prop) {
|
|
27
|
+
return getTheme()[prop];
|
|
28
|
+
},
|
|
29
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
30
|
+
return Object.getOwnPropertyDescriptor(getTheme(), prop);
|
|
31
|
+
},
|
|
32
|
+
has(_target, prop) {
|
|
33
|
+
return prop in getTheme();
|
|
34
|
+
},
|
|
35
|
+
ownKeys() {
|
|
36
|
+
return Reflect.ownKeys(getTheme());
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export const bayonTheme = createLazyBayonTheme();
|
|
41
|
+
export const bayonDarkTheme = createLazyBayonTheme({ mode: 'dark' });
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export const bayonAccent = {
|
|
2
|
+
teal: '#2DD4BF',
|
|
3
|
+
tealLight: '#5EEAD4',
|
|
4
|
+
tealSoft: '#A7F3D0',
|
|
5
|
+
blue: '#60A5FA',
|
|
6
|
+
yellow: '#FDE047',
|
|
7
|
+
coral: '#FF6B6B',
|
|
8
|
+
night: '#0B1020',
|
|
9
|
+
panel: '#111827',
|
|
10
|
+
ink: '#031B20',
|
|
11
|
+
foreground: '#F8FAFC',
|
|
12
|
+
};
|
|
13
|
+
export const bayonPrimary = {
|
|
14
|
+
lighter: '#D1E9FC',
|
|
15
|
+
light: '#76B0F1',
|
|
16
|
+
main: '#2065D1',
|
|
17
|
+
dark: '#103996',
|
|
18
|
+
darker: '#061B64',
|
|
19
|
+
contrastText: '#FFFFFF',
|
|
20
|
+
};
|
|
21
|
+
export const bayonSecondary = {
|
|
22
|
+
lighter: '#D6E4FF',
|
|
23
|
+
light: '#84A9FF',
|
|
24
|
+
main: '#3366FF',
|
|
25
|
+
dark: '#1939B7',
|
|
26
|
+
darker: '#091A7A',
|
|
27
|
+
contrastText: '#FFFFFF',
|
|
28
|
+
};
|
|
29
|
+
export const bayonPalette = {
|
|
30
|
+
primary: bayonPrimary,
|
|
31
|
+
secondary: bayonSecondary,
|
|
32
|
+
info: {
|
|
33
|
+
lighter: '#D0F2FF',
|
|
34
|
+
light: '#74CAFF',
|
|
35
|
+
main: '#1890FF',
|
|
36
|
+
dark: '#0C53B7',
|
|
37
|
+
darker: '#04297A',
|
|
38
|
+
contrastText: '#FFFFFF',
|
|
39
|
+
},
|
|
40
|
+
success: {
|
|
41
|
+
lighter: '#E9FCD4',
|
|
42
|
+
light: '#AAF27F',
|
|
43
|
+
main: '#54D62C',
|
|
44
|
+
dark: '#229A16',
|
|
45
|
+
darker: '#08660D',
|
|
46
|
+
contrastText: '#FFFFFF',
|
|
47
|
+
},
|
|
48
|
+
warning: {
|
|
49
|
+
lighter: '#FFF7CD',
|
|
50
|
+
light: '#FFE16A',
|
|
51
|
+
main: '#FFC107',
|
|
52
|
+
dark: '#B78103',
|
|
53
|
+
darker: '#7A4F01',
|
|
54
|
+
contrastText: '#212B36',
|
|
55
|
+
},
|
|
56
|
+
error: {
|
|
57
|
+
lighter: '#FFE7D9',
|
|
58
|
+
light: '#FFA48D',
|
|
59
|
+
main: '#FF4842',
|
|
60
|
+
dark: '#B72136',
|
|
61
|
+
darker: '#7A0C2E',
|
|
62
|
+
contrastText: '#FFFFFF',
|
|
63
|
+
},
|
|
64
|
+
grey: {
|
|
65
|
+
0: '#FFFFFF',
|
|
66
|
+
100: '#F9FAFB',
|
|
67
|
+
200: '#F4F6F8',
|
|
68
|
+
300: '#DFE3E8',
|
|
69
|
+
400: '#C4CDD5',
|
|
70
|
+
500: '#919EAB',
|
|
71
|
+
600: '#637381',
|
|
72
|
+
700: '#454F5B',
|
|
73
|
+
800: '#212B36',
|
|
74
|
+
900: '#161C24',
|
|
75
|
+
},
|
|
76
|
+
text: {
|
|
77
|
+
primary: '#212B36',
|
|
78
|
+
secondary: '#637381',
|
|
79
|
+
disabled: '#919EAB',
|
|
80
|
+
},
|
|
81
|
+
background: {
|
|
82
|
+
paper: '#FFFFFF',
|
|
83
|
+
default: '#F9FAFB',
|
|
84
|
+
},
|
|
85
|
+
action: {
|
|
86
|
+
active: '#637381',
|
|
87
|
+
hover: 'rgba(99, 115, 129, 0.08)',
|
|
88
|
+
selected: 'rgba(99, 115, 129, 0.16)',
|
|
89
|
+
disabled: 'rgba(99, 115, 129, 0.8)',
|
|
90
|
+
disabledBackground: 'rgba(99, 115, 129, 0.24)',
|
|
91
|
+
focus: 'rgba(99, 115, 129, 0.24)',
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
export const bayonDarkPalette = {
|
|
95
|
+
...bayonPalette,
|
|
96
|
+
mode: 'dark',
|
|
97
|
+
background: {
|
|
98
|
+
default: bayonAccent.night,
|
|
99
|
+
paper: bayonAccent.panel,
|
|
100
|
+
},
|
|
101
|
+
text: {
|
|
102
|
+
primary: '#FFFFFF',
|
|
103
|
+
secondary: 'rgba(255, 255, 255, 0.72)',
|
|
104
|
+
disabled: 'rgba(255, 255, 255, 0.5)',
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { bayonPalette } from './palette.js';
|
|
2
|
+
export const bayonShadows = {
|
|
3
|
+
z1: '0px 1px 2px 0px rgba(145, 158, 171, 0.16)',
|
|
4
|
+
z8: '0px 8px 16px 0px rgba(145, 158, 171, 0.16)',
|
|
5
|
+
z12: '0px 12px 24px -4px rgba(145, 158, 171, 0.16)',
|
|
6
|
+
z16: '0px 16px 32px -4px rgba(145, 158, 171, 0.16)',
|
|
7
|
+
z20: '0px 20px 40px -4px rgba(145, 158, 171, 0.16)',
|
|
8
|
+
z24: '0px 20px 48px 0px rgba(145, 158, 171, 0.16)',
|
|
9
|
+
primary: `0 8px 16px 0 ${bayonPalette.primary.light}33`,
|
|
10
|
+
secondary: `0 8px 16px 0 ${bayonPalette.secondary.light}33`,
|
|
11
|
+
info: `0 8px 16px 0 ${bayonPalette.info.light}33`,
|
|
12
|
+
success: `0 8px 16px 0 ${bayonPalette.success.light}33`,
|
|
13
|
+
warning: `0 8px 16px 0 ${bayonPalette.warning.light}33`,
|
|
14
|
+
error: `0 8px 16px 0 ${bayonPalette.error.light}33`,
|
|
15
|
+
card: '0 0 2px 0 rgba(145, 158, 171, 0.2), 0 12px 24px -4px rgba(145, 158, 171, 0.12)',
|
|
16
|
+
dialog: '-40px 40px 80px -8px rgba(145, 158, 171, 0.24)',
|
|
17
|
+
dropdown: '0 8px 16px 0 rgba(145, 158, 171, 0.16)',
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const bayonTypography = {
|
|
2
|
+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
|
|
3
|
+
h1: {
|
|
4
|
+
fontWeight: 700,
|
|
5
|
+
fontSize: '2.5rem',
|
|
6
|
+
lineHeight: 1.2,
|
|
7
|
+
},
|
|
8
|
+
h2: {
|
|
9
|
+
fontWeight: 700,
|
|
10
|
+
fontSize: '2rem',
|
|
11
|
+
lineHeight: 1.3,
|
|
12
|
+
},
|
|
13
|
+
h3: {
|
|
14
|
+
fontWeight: 700,
|
|
15
|
+
fontSize: '1.75rem',
|
|
16
|
+
lineHeight: 1.4,
|
|
17
|
+
},
|
|
18
|
+
h4: {
|
|
19
|
+
fontWeight: 600,
|
|
20
|
+
fontSize: '1.5rem',
|
|
21
|
+
lineHeight: 1.5,
|
|
22
|
+
},
|
|
23
|
+
h5: {
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
fontSize: '1.25rem',
|
|
26
|
+
lineHeight: 1.5,
|
|
27
|
+
},
|
|
28
|
+
h6: {
|
|
29
|
+
fontWeight: 600,
|
|
30
|
+
fontSize: '1.125rem',
|
|
31
|
+
lineHeight: 1.6,
|
|
32
|
+
},
|
|
33
|
+
body1: {
|
|
34
|
+
fontSize: '1rem',
|
|
35
|
+
lineHeight: 1.7,
|
|
36
|
+
},
|
|
37
|
+
body2: {
|
|
38
|
+
fontSize: '0.875rem',
|
|
39
|
+
lineHeight: 1.7,
|
|
40
|
+
},
|
|
41
|
+
subtitle1: {
|
|
42
|
+
fontSize: '1rem',
|
|
43
|
+
fontWeight: 500,
|
|
44
|
+
lineHeight: 1.7,
|
|
45
|
+
},
|
|
46
|
+
subtitle2: {
|
|
47
|
+
fontSize: '0.875rem',
|
|
48
|
+
fontWeight: 500,
|
|
49
|
+
lineHeight: 1.7,
|
|
50
|
+
},
|
|
51
|
+
button: {
|
|
52
|
+
textTransform: 'none',
|
|
53
|
+
fontWeight: 500,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, Stack, Typography } from "@mui/material";
|
|
4
|
+
import { Toast } from "./Toast.js";
|
|
5
|
+
// The host owns expiry and action semantics: dismissing a notification must
|
|
6
|
+
// never implicitly commit a deletion or cancel a transaction in this package.
|
|
7
|
+
export function ActionToast({ message, actionLabel, actionAriaLabel, onAction, actionDisabled = false, ToastComponent = Toast, ...toastProps }) {
|
|
8
|
+
return (_jsx(ToastComponent, { ...toastProps, children: _jsxs(Stack, { direction: "row", sx: { alignItems: "center", gap: 1, justifyContent: "space-between" }, children: [_jsx(Typography, { noWrap: true, sx: { fontSize: 14, fontWeight: 650 }, children: message }), _jsx(Button, { "aria-label": actionAriaLabel, disabled: actionDisabled, onClick: onAction, size: "small", sx: { flexShrink: 0, fontWeight: 760, minWidth: 0, px: 1 }, children: actionLabel })] }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
|
+
import { useUpwardToastDismiss } from "./useUpwardToastDismiss.js";
|
|
5
|
+
export function Toast({ ariaLive, mobileTopOffset = 16, mobileBottomOffset = 16, children, contained = false, dataComponent, onDismiss, placement = "bottom-end", role = "status", sx, variant = "standard", }) {
|
|
6
|
+
const topCentered = placement === "top-center";
|
|
7
|
+
const swipeDismiss = useUpwardToastDismiss({
|
|
8
|
+
onDismiss,
|
|
9
|
+
transform: topCentered ? "translateX(-50%)" : "",
|
|
10
|
+
});
|
|
11
|
+
return (_jsx(Box, { "aria-live": ariaLive, "data-component": dataComponent, "data-presentation": contained ? "workspace-contained" : "viewport", "data-swipe-dismiss": onDismiss ? "up" : undefined, role: role, ...swipeDismiss.pointerHandlers, sx: [
|
|
12
|
+
{
|
|
13
|
+
...(topCentered
|
|
14
|
+
? {
|
|
15
|
+
bottom: { xs: "auto", md: contained ? 24 : "auto" },
|
|
16
|
+
left: "50%",
|
|
17
|
+
maxWidth: { xs: "none", md: 460 },
|
|
18
|
+
position: contained
|
|
19
|
+
? { xs: "fixed", md: "absolute" }
|
|
20
|
+
: "fixed",
|
|
21
|
+
top: { xs: mobileTopOffset, md: contained ? "auto" : 24 },
|
|
22
|
+
transform: "translateX(-50%)",
|
|
23
|
+
width: {
|
|
24
|
+
xs: "calc(100vw - 16px)",
|
|
25
|
+
md: contained ? "calc(100% - 32px)" : "calc(100vw - 32px)",
|
|
26
|
+
},
|
|
27
|
+
zIndex: 1600,
|
|
28
|
+
}
|
|
29
|
+
: {
|
|
30
|
+
bottom: { xs: mobileBottomOffset, md: 24 },
|
|
31
|
+
maxWidth: { xs: "calc(100vw - 32px)", sm: 476 },
|
|
32
|
+
position: "fixed",
|
|
33
|
+
right: { xs: 16, md: 24 },
|
|
34
|
+
zIndex: (theme) => theme.zIndex.snackbar,
|
|
35
|
+
}),
|
|
36
|
+
...(variant === "standard"
|
|
37
|
+
? {
|
|
38
|
+
bgcolor: "background.paper",
|
|
39
|
+
border: 1,
|
|
40
|
+
borderColor: "divider",
|
|
41
|
+
borderRadius: 2,
|
|
42
|
+
boxShadow: 6,
|
|
43
|
+
color: "text.primary",
|
|
44
|
+
px: 1.5,
|
|
45
|
+
py: 1.25,
|
|
46
|
+
}
|
|
47
|
+
: {}),
|
|
48
|
+
},
|
|
49
|
+
...(Array.isArray(sx) ? sx : sx ? [sx] : []),
|
|
50
|
+
...(swipeDismiss.sx ? [swipeDismiss.sx] : []),
|
|
51
|
+
], children: children }));
|
|
52
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// TL-M249: preserve the established MUI presentation under its owning package.
|
|
3
|
+
export { Toast } from "./Toast.js";
|
|
4
|
+
export { ActionToast } from "./ActionToast.js";
|
|
5
|
+
export { useUpwardToastDismiss, TOAST_UPWARD_DISMISS_DISTANCE_PX, } from "./useUpwardToastDismiss.js";
|