@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,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PendingChangesDialogView = PendingChangesDialogView;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const ArrowForwardRounded_1 = __importDefault(require("@mui/icons-material/ArrowForwardRounded"));
|
|
11
|
+
const DeleteOutlineRounded_1 = __importDefault(require("@mui/icons-material/DeleteOutlineRounded"));
|
|
12
|
+
const CloudUploadOutlined_1 = __importDefault(require("@mui/icons-material/CloudUploadOutlined"));
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const PendingChangesDialogShell_js_1 = require("./PendingChangesDialogShell.js");
|
|
15
|
+
const pageSize = 10;
|
|
16
|
+
function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage = "All changes are saved.", accountKey, onOpenItem, onDiscardRequest, discardLabel = "Discard a change", focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell = PendingChangesDialogShell_js_1.PendingChangesDialogShell, }) {
|
|
17
|
+
const returnItemButton = (0, react_1.useRef)(null);
|
|
18
|
+
const [page, setPage] = (0, react_1.useState)(1);
|
|
19
|
+
const [actionPages, setActionPages] = (0, react_1.useState)({});
|
|
20
|
+
const pages = Math.max(1, Math.ceil(groups.length / pageSize));
|
|
21
|
+
const visiblePage = Math.min(page, pages);
|
|
22
|
+
const [previousGroups, setPreviousGroups] = (0, react_1.useState)(groups);
|
|
23
|
+
const [previousAccount, setPreviousAccount] = (0, react_1.useState)(accountKey);
|
|
24
|
+
// Adjust pagination only when the source view changes. Guarded render state
|
|
25
|
+
// keeps the first painted frame bounded and avoids effect-driven page jumps.
|
|
26
|
+
if (previousGroups !== groups || previousAccount !== accountKey) {
|
|
27
|
+
setPreviousGroups(groups);
|
|
28
|
+
setPreviousAccount(accountKey);
|
|
29
|
+
if (previousAccount !== accountKey) {
|
|
30
|
+
setPage(1);
|
|
31
|
+
setActionPages({});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
setPage((current) => Math.min(current, pages));
|
|
35
|
+
setActionPages((current) => {
|
|
36
|
+
const next = {};
|
|
37
|
+
for (const group of groups)
|
|
38
|
+
if (current[group.key] !== undefined)
|
|
39
|
+
next[group.key] = Math.min(current[group.key], Math.max(1, Math.ceil(group.rows.length / pageSize)));
|
|
40
|
+
return Object.keys(next).length === Object.keys(current).length &&
|
|
41
|
+
Object.keys(next).every((key) => next[key] === current[key])
|
|
42
|
+
? current
|
|
43
|
+
: next;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(Shell, { autoFocusInput: false, closeLabel: "Close pending changes", closeTooltip: "Close pending changes", contentHeader: contentHeader !== null && contentHeader !== void 0 ? contentHeader : (groups.length ? (
|
|
48
|
+
// Product decision: the sync summary remains distinct and visible
|
|
49
|
+
// while the user scrolls through pending groups.
|
|
50
|
+
(0, jsx_runtime_1.jsxs)(material_1.Stack, { component: "section", "aria-label": "Pending changes summary", direction: "row", spacing: 1, sx: {
|
|
51
|
+
p: 2,
|
|
52
|
+
borderRadius: 1,
|
|
53
|
+
bgcolor: "action.selected",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: summary }), onDiscardRequest ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: discardLabel, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": discardLabel, onClick: onDiscardRequest, sx: { width: 44, height: 44 }, children: (0, jsx_runtime_1.jsx)(DeleteOutlineRounded_1.default, {}) }) })) : null] })) : undefined), contentTouchHandlers: contentTouchHandlers, contentSx: { pt: 0.5, pb: 3, overscrollBehaviorY: "contain" }, exclusive: false, onClose: onClose, onEntered: () => {
|
|
56
|
+
// Entry focus runs after MUI settles its focus trap, including a reopen
|
|
57
|
+
// of the same inspector. A removed group retains the shell's fallback.
|
|
58
|
+
const target = returnItemButton.current;
|
|
59
|
+
if ((target === null || target === void 0 ? void 0 : target.isConnected) && !target.disabled)
|
|
60
|
+
target.focus();
|
|
61
|
+
}, open: open, title: title, titleIcon: (0, jsx_runtime_1.jsx)(CloudUploadOutlined_1.default, {}), children: [navigationError ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { role: "alert", color: "error", variant: "body2", sx: { mb: 1 }, children: navigationError })) : null, groups.length ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { "aria-label": "Pending changes", disablePadding: true, sx: { display: "flex", flexDirection: "column", gap: 1.5 }, children: groups
|
|
62
|
+
.slice((visiblePage - 1) * pageSize, visiblePage * pageSize)
|
|
63
|
+
.map((group) => {
|
|
64
|
+
var _a;
|
|
65
|
+
const title = group.title;
|
|
66
|
+
const unavailableReason = group.unavailableReason;
|
|
67
|
+
const actionPageCount = Math.max(1, Math.ceil(group.rows.length / pageSize));
|
|
68
|
+
const actionPage = Math.min((_a = actionPages[group.key]) !== null && _a !== void 0 ? _a : 1, actionPageCount);
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ListItem, { disableGutters: true, sx: {
|
|
70
|
+
p: 2,
|
|
71
|
+
position: "relative",
|
|
72
|
+
alignItems: "flex-start",
|
|
73
|
+
border: 1,
|
|
74
|
+
borderColor: "divider",
|
|
75
|
+
borderRadius: 1,
|
|
76
|
+
}, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 0, sx: { minWidth: 0, width: "100%" }, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 1, sx: {
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
justifyContent: "space-between",
|
|
79
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h3", sx: {
|
|
80
|
+
flex: 1,
|
|
81
|
+
minWidth: 0,
|
|
82
|
+
fontWeight: 600,
|
|
83
|
+
overflowWrap: "anywhere",
|
|
84
|
+
}, variant: "body2", children: title }), (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", spacing: 0.5, sx: {
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
flexShrink: 0,
|
|
87
|
+
}, children: group.openLabel && onOpenItem ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: unavailableReason || group.openLabel, children: (0, jsx_runtime_1.jsx)("span", { tabIndex: unavailableReason ? 0 : undefined, "aria-label": unavailableReason
|
|
88
|
+
? `${group.openLabel} unavailable. ${unavailableReason}`
|
|
89
|
+
: undefined, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": `${group.openLabel}: ${title}`, disabled: Boolean(unavailableReason), ref: focusGroupKey === group.key
|
|
90
|
+
? returnItemButton
|
|
91
|
+
: undefined, onClick: () => onOpenItem(group.key), size: "small", sx: { width: 44, height: 44 }, children: (0, jsx_runtime_1.jsx)(ArrowForwardRounded_1.default, { fontSize: "small" }) }) }) })) : null })] }), (0, jsx_runtime_1.jsx)(material_1.List, { "aria-label": `Changes for ${group.title}`, disablePadding: true, children: group.rows
|
|
92
|
+
.slice((actionPage - 1) * pageSize, actionPage * pageSize)
|
|
93
|
+
.map((item, index) => {
|
|
94
|
+
const presentation = item;
|
|
95
|
+
const exception = item.exception;
|
|
96
|
+
if (!presentation.action &&
|
|
97
|
+
!exception &&
|
|
98
|
+
!presentation.targetLabel &&
|
|
99
|
+
!presentation.elapsedText &&
|
|
100
|
+
presentation.attemptedText === undefined &&
|
|
101
|
+
!presentation.endAction)
|
|
102
|
+
return null;
|
|
103
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ListItem, { disableGutters: true, sx: {
|
|
104
|
+
display: "flex",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
gap: 1,
|
|
107
|
+
py: 1,
|
|
108
|
+
borderTop: index > 0 ? 1 : 0,
|
|
109
|
+
borderColor: "divider",
|
|
110
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 0.75, sx: { flex: 1, minWidth: 0 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 1, sx: {
|
|
111
|
+
alignItems: "baseline",
|
|
112
|
+
justifyContent: "space-between",
|
|
113
|
+
flexWrap: "wrap",
|
|
114
|
+
}, children: [presentation.action ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h4", color: "text.secondary", variant: "caption", children: presentation.action })) : null, exception ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: item.needsAttention
|
|
115
|
+
? "error"
|
|
116
|
+
: "text.secondary", variant: "caption", children: exception })) : null] }), presentation.elapsedText ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: {
|
|
117
|
+
fontSize: "0.6875rem",
|
|
118
|
+
color: "text.primary",
|
|
119
|
+
opacity: 0.78,
|
|
120
|
+
}, children: presentation.elapsedText })) : null, presentation.targetLabel ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.secondary", variant: "caption", sx: {
|
|
121
|
+
overflowWrap: "anywhere",
|
|
122
|
+
whiteSpace: "pre-wrap",
|
|
123
|
+
}, children: presentation.targetLabel })) : null, presentation.attemptedText !== undefined ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", sx: {
|
|
124
|
+
whiteSpace: "pre-wrap",
|
|
125
|
+
overflowWrap: "anywhere",
|
|
126
|
+
}, children: presentation.attemptedText })) : null] }), presentation.endAction] }, item.id));
|
|
127
|
+
}) }), actionPageCount > 1 ? ((0, jsx_runtime_1.jsx)(material_1.Pagination, { "aria-label": `Change pages for ${group.title}`, count: actionPageCount, page: actionPage, onChange: (_event, nextPage) => setActionPages((previous) => ({
|
|
128
|
+
...previous,
|
|
129
|
+
[group.key]: nextPage,
|
|
130
|
+
})), sx: {
|
|
131
|
+
"& .MuiPaginationItem-root": {
|
|
132
|
+
minWidth: 44,
|
|
133
|
+
minHeight: 44,
|
|
134
|
+
},
|
|
135
|
+
} })) : null] }) }, group.key));
|
|
136
|
+
}) }), pages > 1 ? ((0, jsx_runtime_1.jsx)(material_1.Pagination, { "aria-label": "Pending changes pages", count: pages, onChange: (_event, nextPage) => setPage(nextPage), page: visiblePage, sx: {
|
|
137
|
+
mt: 2,
|
|
138
|
+
"& .MuiPaginationItem-root": { minWidth: 44, minHeight: 44 },
|
|
139
|
+
} })) : null] })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { role: "status", sx: { py: 2 }, children: emptyMessage }))] }));
|
|
140
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SxProps, type Theme } from "@mui/material/styles";
|
|
2
|
+
export type PendingChangesIndicatorViewProps = {
|
|
3
|
+
count: number;
|
|
4
|
+
isOffline?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
explanation?: string;
|
|
7
|
+
onOpen: () => void;
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
};
|
|
10
|
+
export declare function PendingChangesIndicatorView({ count, isOffline, label, explanation, onOpen, sx, }: PendingChangesIndicatorViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PendingChangesIndicatorView = PendingChangesIndicatorView;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const styles_1 = require("@mui/material/styles");
|
|
11
|
+
const CloudOffOutlined_1 = __importDefault(require("@mui/icons-material/CloudOffOutlined"));
|
|
12
|
+
const CloudUploadOutlined_1 = __importDefault(require("@mui/icons-material/CloudUploadOutlined"));
|
|
13
|
+
function PendingChangesIndicatorView({ count, isOffline = false, label = `${count} pending ${count === 1 ? "change" : "changes"}`, explanation = "View pending changes", onOpen, sx, }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: `${isOffline ? "Offline. " : ""}${label}. ${explanation}`, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": `${isOffline ? "Offline. " : ""}${label}. View pending changes`, "aria-haspopup": "dialog", onClick: onOpen, sx: [
|
|
15
|
+
{
|
|
16
|
+
width: 44,
|
|
17
|
+
height: 44,
|
|
18
|
+
borderRadius: "50%",
|
|
19
|
+
color: "primary.main",
|
|
20
|
+
bgcolor: "background.paper",
|
|
21
|
+
"&:hover": {
|
|
22
|
+
bgcolor: (theme) => (0, styles_1.alpha)(theme.palette.primary.main, 0.18),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
...(Array.isArray(sx) ? sx : sx ? [sx] : []),
|
|
26
|
+
], children: (0, jsx_runtime_1.jsx)(material_1.Badge, { badgeContent: count, color: "primary", max: Number.MAX_SAFE_INTEGER, slotProps: { badge: { "aria-hidden": true } }, children: isOffline ? (0, jsx_runtime_1.jsx)(CloudOffOutlined_1.default, {}) : (0, jsx_runtime_1.jsx)(CloudUploadOutlined_1.default, {}) }) }) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { PendingChangesDialogView } from "./PendingChangesDialogView.js";
|
|
2
|
+
export { PendingChangesIndicatorView, type PendingChangesIndicatorViewProps, } from "./PendingChangesIndicatorView.js";
|
|
3
|
+
export type { PendingChangeRow, PendingChangeViewGroup, PendingChangesDialogViewProps, PendingChangesDialogShellProps, } from "./types.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PendingChangesIndicatorView = exports.PendingChangesDialogView = void 0;
|
|
5
|
+
// TL-M249: preserve the established MUI presentation under its owning package.
|
|
6
|
+
var PendingChangesDialogView_js_1 = require("./PendingChangesDialogView.js");
|
|
7
|
+
Object.defineProperty(exports, "PendingChangesDialogView", { enumerable: true, get: function () { return PendingChangesDialogView_js_1.PendingChangesDialogView; } });
|
|
8
|
+
var PendingChangesIndicatorView_js_1 = require("./PendingChangesIndicatorView.js");
|
|
9
|
+
Object.defineProperty(exports, "PendingChangesIndicatorView", { enumerable: true, get: function () { return PendingChangesIndicatorView_js_1.PendingChangesIndicatorView; } });
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ComponentType, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { SxProps, Theme } from "@mui/material/styles";
|
|
3
|
+
/** Hosts own domain copy, safe navigation and correction editors. */
|
|
4
|
+
export type PendingChangeRow = {
|
|
5
|
+
id: string;
|
|
6
|
+
action?: string;
|
|
7
|
+
exception?: string;
|
|
8
|
+
needsAttention?: boolean;
|
|
9
|
+
targetLabel?: string;
|
|
10
|
+
/** Host-formatted age of this change, refreshed by the host as needed. */
|
|
11
|
+
elapsedText?: string;
|
|
12
|
+
attemptedText?: string;
|
|
13
|
+
/** Host-owned action for this individual change. */
|
|
14
|
+
endAction?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export type PendingChangeViewGroup = {
|
|
17
|
+
key: string;
|
|
18
|
+
title: string;
|
|
19
|
+
rows: readonly PendingChangeRow[];
|
|
20
|
+
openLabel?: string;
|
|
21
|
+
unavailableReason?: string | null;
|
|
22
|
+
};
|
|
23
|
+
export type PendingChangesDialogShellProps = {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
open: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
title: string;
|
|
28
|
+
titleIcon?: ReactNode;
|
|
29
|
+
contentHeader?: ReactNode;
|
|
30
|
+
contentTouchHandlers?: HTMLAttributes<HTMLDivElement>;
|
|
31
|
+
contentSx?: SxProps<Theme>;
|
|
32
|
+
onEntered?: () => void;
|
|
33
|
+
autoFocusInput?: boolean;
|
|
34
|
+
closeLabel?: string;
|
|
35
|
+
closeTooltip?: string;
|
|
36
|
+
exclusive?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type PendingChangesDialogViewProps = {
|
|
39
|
+
groups: readonly PendingChangeViewGroup[];
|
|
40
|
+
title: string;
|
|
41
|
+
summary: string;
|
|
42
|
+
emptyMessage?: string;
|
|
43
|
+
open: boolean;
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
accountKey?: string | null;
|
|
46
|
+
onOpenItem?: (groupKey: string) => void;
|
|
47
|
+
/** Requests host-owned selection and confirmation; does not discard data. */
|
|
48
|
+
onDiscardRequest?: () => void;
|
|
49
|
+
discardLabel?: string;
|
|
50
|
+
focusGroupKey?: string | null;
|
|
51
|
+
navigationError?: string | null;
|
|
52
|
+
contentHeader?: ReactNode;
|
|
53
|
+
contentTouchHandlers?: HTMLAttributes<HTMLDivElement>;
|
|
54
|
+
shell?: ComponentType<PendingChangesDialogShellProps>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type UpgradePlan<Id extends string = string> = {
|
|
2
|
+
id: Id;
|
|
3
|
+
name: string;
|
|
4
|
+
details: readonly string[];
|
|
5
|
+
};
|
|
6
|
+
export type PlanUpgradeDialogProps<Id extends string> = {
|
|
7
|
+
title: string;
|
|
8
|
+
message: string;
|
|
9
|
+
plans: readonly UpgradePlan<Id>[];
|
|
10
|
+
selectedPlanId: Id;
|
|
11
|
+
confirmLabel: string;
|
|
12
|
+
closeLabel?: string;
|
|
13
|
+
onSelectPlan: (id: Id) => void;
|
|
14
|
+
onViewPlan: (id: Id) => void;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function PlanUpgradeDialog<Id extends string>({ title, message, plans, selectedPlanId, confirmLabel, closeLabel, onSelectPlan, onViewPlan, onClose, }: PlanUpgradeDialogProps<Id>): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PlanUpgradeDialog = PlanUpgradeDialog;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const DialogActionButtons_js_1 = require("../actions/DialogActionButtons.js");
|
|
9
|
+
const DialogChoiceTile_js_1 = require("../internal/DialogChoiceTile.js");
|
|
10
|
+
function PlanUpgradeDialog({ title, message, plans, selectedPlanId, confirmLabel, closeLabel = "Close upgrade dialog", onSelectPlan, onViewPlan, onClose, }) {
|
|
11
|
+
const titleId = (0, react_1.useId)();
|
|
12
|
+
const messageId = (0, react_1.useId)();
|
|
13
|
+
const radioName = (0, react_1.useId)();
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: true, fullWidth: true, maxWidth: "sm", onClose: onClose, "aria-labelledby": titleId, "aria-describedby": messageId, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { id: titleId, sx: { pr: 7 }, children: [title, (0, jsx_runtime_1.jsx)(DialogActionButtons_js_1.DialogCloseButton, { label: closeLabel, onClose: onClose })] }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { id: messageId, variant: "body2", color: "text.secondary", children: message }), (0, jsx_runtime_1.jsx)(material_1.Box, { role: "radiogroup", "aria-label": "Upgrade plan", sx: {
|
|
15
|
+
display: "grid",
|
|
16
|
+
gridTemplateColumns: {
|
|
17
|
+
xs: "1fr",
|
|
18
|
+
sm: "repeat(2, minmax(0, 1fr))",
|
|
19
|
+
},
|
|
20
|
+
gap: 1,
|
|
21
|
+
}, children: plans.map((plan) => ((0, jsx_runtime_1.jsx)(DialogChoiceTile_js_1.DialogChoiceTile, { name: radioName, label: plan.name, description: plan.details.map((detail) => ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: { display: "block" }, children: detail }, detail))), selected: selectedPlanId === plan.id, autoFocus: selectedPlanId === plan.id, onSelect: () => onSelectPlan(plan.id) }, plan.id))) })] }) }), (0, jsx_runtime_1.jsx)(DialogActionButtons_js_1.DialogActionButtons, { confirmLabel: confirmLabel, confirmText: confirmLabel, onConfirm: () => onViewPlan(selectedPlanId) })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type PricingTablePlan = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
description: ReactNode;
|
|
6
|
+
price: ReactNode;
|
|
7
|
+
priceNote: ReactNode;
|
|
8
|
+
features: readonly ReactNode[];
|
|
9
|
+
badge?: ReactNode;
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
highlighted?: boolean;
|
|
12
|
+
/** Overrides the section name; defaults to the text label or plan ID. */
|
|
13
|
+
accessibleLabel?: string;
|
|
14
|
+
};
|
|
15
|
+
export type PricingTableProps = {
|
|
16
|
+
label: string;
|
|
17
|
+
plans: readonly PricingTablePlan[];
|
|
18
|
+
appearance?: "default" | "darkComparison";
|
|
19
|
+
className?: string;
|
|
20
|
+
interactiveClassName?: string;
|
|
21
|
+
colors: {
|
|
22
|
+
accent: string;
|
|
23
|
+
accentDark: string;
|
|
24
|
+
text: string;
|
|
25
|
+
muted: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function PricingTable({ label, plans, className, interactiveClassName, colors, appearance, }: PricingTableProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PricingTable = PricingTable;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const CheckRounded_1 = __importDefault(require("@mui/icons-material/CheckRounded"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
// Product decision: callers own plan content and actions; this component only
|
|
12
|
+
// presents the supplied plans and never determines prices or availability.
|
|
13
|
+
function PricingTable({ label, plans, className, interactiveClassName, colors, appearance = "default", }) {
|
|
14
|
+
const dark = appearance === "darkComparison";
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { "aria-label": label, className: className, sx: {
|
|
16
|
+
display: "grid",
|
|
17
|
+
gap: dark ? 2.5 : 1.5,
|
|
18
|
+
gridTemplateColumns: {
|
|
19
|
+
xs: "1fr",
|
|
20
|
+
md: `repeat(${plans.length}, minmax(0, 1fr))`,
|
|
21
|
+
},
|
|
22
|
+
}, children: plans.map((plan) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const highlighted = Boolean(plan.highlighted);
|
|
25
|
+
const secondary = dark ? "#c9c3dc" : highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { className: interactiveClassName, component: dark ? "section" : "div", "aria-label": dark ? ((_a = plan.accessibleLabel) !== null && _a !== void 0 ? _a : (typeof plan.label === "string" ? plan.label : plan.id)) : undefined, spacing: dark ? 2 : 2.25, sx: {
|
|
27
|
+
bgcolor: dark ? (highlighted ? "#27204d" : "#151327") : highlighted ? colors.accent : "#FFFFFF",
|
|
28
|
+
boxShadow: dark ? "none" : highlighted
|
|
29
|
+
? "0 8px 18px rgba(23, 106, 168, 0.22)"
|
|
30
|
+
: "none",
|
|
31
|
+
color: dark || highlighted ? "#f5efff" : colors.text,
|
|
32
|
+
minHeight: { md: dark ? 520 : 430 },
|
|
33
|
+
p: dark ? { xs: 2.5, md: 4 } : { xs: 2.5, sm: 3 },
|
|
34
|
+
position: "relative",
|
|
35
|
+
borderRadius: dark ? 2.5 : 2,
|
|
36
|
+
...(dark ? { border: highlighted ? "1px solid #b56ef3" : "1px solid #49405e" } : highlighted
|
|
37
|
+
? {}
|
|
38
|
+
: { border: "1px solid rgba(23, 38, 56, 0.12)" }),
|
|
39
|
+
...(!dark && { "&:hover": {
|
|
40
|
+
...(highlighted
|
|
41
|
+
? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
|
|
42
|
+
: { bgcolor: "#FCFEFF" }),
|
|
43
|
+
transform: "translateY(-2px)",
|
|
44
|
+
} }),
|
|
45
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: dark ? "h2" : "p", sx: { fontSize: dark ? { xs: 26, md: 34 } : 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
|
|
46
|
+
color: secondary,
|
|
47
|
+
fontSize: dark ? { xs: 15, md: 17 } : 14,
|
|
48
|
+
lineHeight: 1.5,
|
|
49
|
+
minHeight: { md: 42 },
|
|
50
|
+
}, children: plan.description }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: dark ? "row" : "column", spacing: dark ? 1 : 0.25, sx: dark ? { alignItems: "baseline", flexWrap: "wrap" } : undefined, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
|
|
51
|
+
fontSize: dark ? { xs: 36, md: 56 } : { xs: 25, sm: 28 },
|
|
52
|
+
fontWeight: 780,
|
|
53
|
+
letterSpacing: "-0.03em",
|
|
54
|
+
}, children: plan.price }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: secondary, fontSize: dark ? { xs: 15, md: 18 } : 13 }, children: plan.priceNote })] }), dark && (0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": "true", sx: { borderTop: "1px solid #514761" } }), (0, jsx_runtime_1.jsx)(material_1.Stack, { component: "ul", spacing: 1.1, sx: { listStyle: "none", m: 0, p: 0 }, children: plan.features.map((feature, index) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, { component: "li", direction: "row", spacing: 1, children: [(0, jsx_runtime_1.jsx)(CheckRounded_1.default, { "aria-hidden": "true", sx: {
|
|
55
|
+
color: dark ? "#d5b3f9" : highlighted ? "#FFFFFF" : colors.accentDark,
|
|
56
|
+
fontSize: 18,
|
|
57
|
+
mt: "2px",
|
|
58
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: dark ? { xs: 15, md: 18 } : 14, lineHeight: 1.45 }, children: feature })] }, index))) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
|
|
59
|
+
}) }));
|
|
60
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PlanUpgradeDialog = exports.PricingTable = void 0;
|
|
5
|
+
var PricingTable_js_1 = require("./PricingTable.js");
|
|
6
|
+
Object.defineProperty(exports, "PricingTable", { enumerable: true, get: function () { return PricingTable_js_1.PricingTable; } });
|
|
7
|
+
var PlanUpgradeDialog_js_1 = require("./PlanUpgradeDialog.js");
|
|
8
|
+
Object.defineProperty(exports, "PlanUpgradeDialog", { enumerable: true, get: function () { return PlanUpgradeDialog_js_1.PlanUpgradeDialog; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type EmotionCache } from '@emotion/react';
|
|
3
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
4
|
+
export type BayonThemeMode = 'light' | 'dark';
|
|
5
|
+
export interface BayonThemeModeContextValue {
|
|
6
|
+
mode: BayonThemeMode;
|
|
7
|
+
setMode: (mode: BayonThemeMode) => void;
|
|
8
|
+
toggleMode: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface BayonThemeProviderProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
emotionCache?: EmotionCache;
|
|
13
|
+
disableEmotionCacheProvider?: boolean;
|
|
14
|
+
theme?: Parameters<typeof ThemeProvider>[0]['theme'];
|
|
15
|
+
defaultMode?: BayonThemeMode;
|
|
16
|
+
storageKey?: string;
|
|
17
|
+
enableErrorBoundary?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function useBayonThemeMode(): BayonThemeModeContextValue;
|
|
20
|
+
export declare function BayonThemeProvider({ children, emotionCache, disableEmotionCacheProvider, theme, defaultMode, storageKey, enableErrorBoundary, }: BayonThemeProviderProps): React.JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.useBayonThemeMode = useBayonThemeMode;
|
|
41
|
+
exports.BayonThemeProvider = BayonThemeProvider;
|
|
42
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
+
const React = __importStar(require("react"));
|
|
44
|
+
const react_1 = require("@emotion/react");
|
|
45
|
+
const Box_1 = __importDefault(require("@mui/material/Box"));
|
|
46
|
+
const CssBaseline_1 = __importDefault(require("@mui/material/CssBaseline"));
|
|
47
|
+
const styles_1 = require("@mui/material/styles");
|
|
48
|
+
const createBayonTheme_js_1 = require("../theme/createBayonTheme.js");
|
|
49
|
+
const createBayonEmotionCache_js_1 = require("../utils/createBayonEmotionCache.js");
|
|
50
|
+
const clientSideEmotionCache = (0, createBayonEmotionCache_js_1.createBayonEmotionCache)();
|
|
51
|
+
const defaultStorageKey = 'bayon-theme-mode';
|
|
52
|
+
const themeModeChangeEvent = 'bayon-theme-mode-change';
|
|
53
|
+
const clientModeOverrides = new Map();
|
|
54
|
+
const BayonThemeModeContext = React.createContext(undefined);
|
|
55
|
+
function readStoredMode(storageKey, defaultMode) {
|
|
56
|
+
if (typeof window === 'undefined') {
|
|
57
|
+
return defaultMode;
|
|
58
|
+
}
|
|
59
|
+
const clientOverride = clientModeOverrides.get(storageKey);
|
|
60
|
+
if (clientOverride) {
|
|
61
|
+
return clientOverride;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const storedMode = window.localStorage.getItem(storageKey);
|
|
65
|
+
return storedMode === 'light' || storedMode === 'dark' ? storedMode : defaultMode;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('[bayon-theme] Failed to read the saved theme mode', { error, storageKey });
|
|
69
|
+
clientModeOverrides.set(storageKey, defaultMode);
|
|
70
|
+
return defaultMode;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function subscribeToStoredMode(storageKey, onStoreChange) {
|
|
74
|
+
const handleStorageChange = (event) => {
|
|
75
|
+
if (event.key === storageKey) {
|
|
76
|
+
clientModeOverrides.delete(storageKey);
|
|
77
|
+
onStoreChange();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const handleLocalChange = (event) => {
|
|
81
|
+
if (event instanceof CustomEvent && event.detail === storageKey) {
|
|
82
|
+
onStoreChange();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
window.addEventListener('storage', handleStorageChange);
|
|
86
|
+
window.addEventListener(themeModeChangeEvent, handleLocalChange);
|
|
87
|
+
return () => {
|
|
88
|
+
window.removeEventListener('storage', handleStorageChange);
|
|
89
|
+
window.removeEventListener(themeModeChangeEvent, handleLocalChange);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function useBayonThemeMode() {
|
|
93
|
+
const context = React.useContext(BayonThemeModeContext);
|
|
94
|
+
if (!context) {
|
|
95
|
+
throw new Error('useBayonThemeMode must be used inside BayonThemeProvider.');
|
|
96
|
+
}
|
|
97
|
+
return context;
|
|
98
|
+
}
|
|
99
|
+
class BayonThemeErrorBoundary extends React.Component {
|
|
100
|
+
constructor(props) {
|
|
101
|
+
super(props);
|
|
102
|
+
this.state = { hasError: false };
|
|
103
|
+
}
|
|
104
|
+
static getDerivedStateFromError() {
|
|
105
|
+
return { hasError: true };
|
|
106
|
+
}
|
|
107
|
+
componentDidCatch(error, errorInfo) {
|
|
108
|
+
console.error('Bayon theme error:', error, errorInfo);
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
if (this.state.hasError) {
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
113
|
+
display: 'flex',
|
|
114
|
+
justifyContent: 'center',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
minHeight: '100vh',
|
|
117
|
+
bgcolor: 'background.default',
|
|
118
|
+
}, children: (0, jsx_runtime_1.jsxs)(Box_1.default, { sx: { textAlign: 'center' }, children: [(0, jsx_runtime_1.jsx)("h1", { children: "Something went wrong with the theme." }), (0, jsx_runtime_1.jsx)("p", { children: "Please try refreshing the page or contact support if the problem persists." })] }) }));
|
|
119
|
+
}
|
|
120
|
+
return this.props.children;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function BayonThemeProvider({ children, emotionCache = clientSideEmotionCache, disableEmotionCacheProvider = false, theme, defaultMode = 'dark', storageKey = defaultStorageKey, enableErrorBoundary = true, }) {
|
|
124
|
+
const subscribe = React.useCallback((onStoreChange) => subscribeToStoredMode(storageKey, onStoreChange), [storageKey]);
|
|
125
|
+
const getSnapshot = React.useCallback(() => readStoredMode(storageKey, defaultMode), [defaultMode, storageKey]);
|
|
126
|
+
const getServerSnapshot = React.useCallback(() => defaultMode, [defaultMode]);
|
|
127
|
+
const mode = React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
128
|
+
const setMode = React.useCallback((nextMode) => {
|
|
129
|
+
if (typeof window === 'undefined') {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
clientModeOverrides.set(storageKey, nextMode);
|
|
133
|
+
try {
|
|
134
|
+
window.localStorage.setItem(storageKey, nextMode);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
console.error('[bayon-theme] Failed to persist the selected theme mode', {
|
|
138
|
+
error,
|
|
139
|
+
mode: nextMode,
|
|
140
|
+
storageKey,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
window.dispatchEvent(new CustomEvent(themeModeChangeEvent, { detail: storageKey }));
|
|
144
|
+
}, [storageKey]);
|
|
145
|
+
const toggleMode = React.useCallback(() => {
|
|
146
|
+
setMode(mode === 'dark' ? 'light' : 'dark');
|
|
147
|
+
}, [mode, setMode]);
|
|
148
|
+
const activeTheme = React.useMemo(() => theme !== null && theme !== void 0 ? theme : (0, createBayonTheme_js_1.createBayonTheme)({ mode }), [mode, theme]);
|
|
149
|
+
const modeContextValue = React.useMemo(() => ({
|
|
150
|
+
mode,
|
|
151
|
+
setMode,
|
|
152
|
+
toggleMode,
|
|
153
|
+
}), [mode, setMode, toggleMode]);
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
document.documentElement.setAttribute('data-theme', mode);
|
|
156
|
+
}, [mode]);
|
|
157
|
+
const content = enableErrorBoundary ? ((0, jsx_runtime_1.jsx)(BayonThemeErrorBoundary, { children: children })) : (children);
|
|
158
|
+
const themedContent = ((0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: activeTheme, children: (0, jsx_runtime_1.jsxs)(BayonThemeModeContext.Provider, { value: modeContextValue, children: [(0, jsx_runtime_1.jsx)(CssBaseline_1.default, { enableColorScheme: true }), content] }) }));
|
|
159
|
+
if (disableEmotionCacheProvider) {
|
|
160
|
+
return themedContent;
|
|
161
|
+
}
|
|
162
|
+
return (0, jsx_runtime_1.jsx)(react_1.CacheProvider, { value: emotionCache, children: themedContent });
|
|
163
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type ExpandableSectionToggleProps = {
|
|
3
|
+
ariaControls?: string;
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
endAdornment?: ReactNode;
|
|
7
|
+
expanded: boolean;
|
|
8
|
+
onToggle: () => void;
|
|
9
|
+
showExpandIcon?: boolean;
|
|
10
|
+
sx?: object;
|
|
11
|
+
};
|
|
12
|
+
export declare function ExpandableSectionToggle({ ariaControls, ariaLabel, children, endAdornment, expanded, onToggle, showExpandIcon, sx, }: ExpandableSectionToggleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ExpandableSectionToggle = ExpandableSectionToggle;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
function ExpandableSectionToggle({ ariaControls, ariaLabel, children, endAdornment, expanded, onToggle, showExpandIcon = true, sx, }) {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ButtonBase, { "aria-controls": ariaControls, "aria-expanded": expanded, "aria-label": ariaLabel, "data-expandable-section-toggle": "true", onClick: onToggle, sx: {
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
borderRadius: 1,
|
|
15
|
+
color: "text.primary",
|
|
16
|
+
display: "flex",
|
|
17
|
+
gap: 1,
|
|
18
|
+
justifyContent: "space-between",
|
|
19
|
+
minWidth: 0,
|
|
20
|
+
px: 0.75,
|
|
21
|
+
py: 0.5,
|
|
22
|
+
textAlign: "left",
|
|
23
|
+
width: "100%",
|
|
24
|
+
"&:hover": { backgroundColor: "action.hover" },
|
|
25
|
+
"&:focus-visible": {
|
|
26
|
+
outline: "2px solid",
|
|
27
|
+
outlineColor: "primary.main",
|
|
28
|
+
outlineOffset: 2,
|
|
29
|
+
},
|
|
30
|
+
...sx,
|
|
31
|
+
}, type: "button", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: "1 1 auto", minWidth: 0 }, children: children }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 0.5, sx: { alignItems: "center", flex: "0 0 auto" }, children: [endAdornment, showExpandIcon ? ((0, jsx_runtime_1.jsx)(ExpandMore_1.default, { "aria-hidden": "true", fontSize: "small", sx: { transform: expanded ? "rotate(180deg)" : "none" } })) : null] })] }));
|
|
32
|
+
}
|