@bayonai/mui-design 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +16 -0
- package/dist/cjs/pending/PendingChangesDialogView.js +9 -5
- package/dist/cjs/pricing/PricingTable.js +58 -0
- package/dist/cjs/pricing/index.js +6 -0
- package/dist/esm/pending/PendingChangesDialogView.js +9 -5
- package/dist/esm/pricing/PricingTable.js +52 -0
- package/dist/esm/pricing/index.js +2 -0
- package/dist/types/pending/PendingChangesDialogView.d.ts +1 -1
- package/dist/types/pending/types.d.ts +5 -0
- package/dist/types/pricing/PricingTable.d.ts +25 -0
- package/dist/types/pricing/index.d.ts +2 -0
- package/docs/pending-contract.md +11 -0
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@bayonai/mui-design` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 1.2.0 - 2026-11-08
|
|
6
|
+
|
|
7
|
+
- Pending change rows accept host-formatted `elapsedText` and display it in a compact secondary style. Navigation aligns with the first change and the title spacing is tighter.
|
|
8
|
+
- The optional `onDiscardRequest` and `discardLabel` add a summary action. The host owns item selection, confirmation, cancellation safety, and error handling.
|
|
9
|
+
|
|
5
10
|
## 1.1.0 candidate - 2026-11-05
|
|
6
11
|
|
|
7
12
|
- Audit: thumbnail loaders handle synchronous failures with the existing fallback and show successful retries after an earlier failure.
|
package/README.md
CHANGED
|
@@ -186,3 +186,19 @@ private presentation shim reuses the canonical MUI action and feedback component
|
|
|
186
186
|
See the [camera/crop contract](docs/camera-crop-contract.md) for ownership,
|
|
187
187
|
migration and the preserved behavioral suites. The version remains unpublished
|
|
188
188
|
1.1.0; adoption requires owner-controlled paired publication and verification.
|
|
189
|
+
|
|
190
|
+
## Pricing cards
|
|
191
|
+
|
|
192
|
+
`@bayonai/mui-design/pricing` exports `PricingTable`, a responsive card grid.
|
|
193
|
+
Supply plan IDs, labels, descriptions, prices, price notes, feature content,
|
|
194
|
+
optional badges and actions, a highlight flag, and presentation colors. The
|
|
195
|
+
caller owns pricing, availability, navigation, analytics and localization.
|
|
196
|
+
|
|
197
|
+
### Pending change age and discard requests
|
|
198
|
+
|
|
199
|
+
`PendingChangesDialogView` accepts `elapsedText` on each row. The host formats
|
|
200
|
+
and refreshes that text from its own timestamp; the package does not read or
|
|
201
|
+
persist changes. An optional `onDiscardRequest` displays a summary icon (customize
|
|
202
|
+
its accessible label with `discardLabel`). The host owns selecting an item,
|
|
203
|
+
confirmation, safe cancellation, and error reporting. A supplied `contentHeader`
|
|
204
|
+
replaces the default summary and is responsible for its own actions.
|
|
@@ -8,11 +8,12 @@ exports.PendingChangesDialogView = PendingChangesDialogView;
|
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const material_1 = require("@mui/material");
|
|
10
10
|
const ArrowForwardRounded_1 = __importDefault(require("@mui/icons-material/ArrowForwardRounded"));
|
|
11
|
+
const DeleteOutlineRounded_1 = __importDefault(require("@mui/icons-material/DeleteOutlineRounded"));
|
|
11
12
|
const CloudUploadOutlined_1 = __importDefault(require("@mui/icons-material/CloudUploadOutlined"));
|
|
12
13
|
const react_1 = require("react");
|
|
13
14
|
const PendingChangesDialogShell_js_1 = require("./PendingChangesDialogShell.js");
|
|
14
15
|
const pageSize = 10;
|
|
15
|
-
function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage = "All changes are saved.", accountKey, onOpenItem, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell = PendingChangesDialogShell_js_1.PendingChangesDialogShell, }) {
|
|
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, }) {
|
|
16
17
|
const returnItemButton = (0, react_1.useRef)(null);
|
|
17
18
|
const [page, setPage] = (0, react_1.useState)(1);
|
|
18
19
|
const [actionPages, setActionPages] = (0, react_1.useState)({});
|
|
@@ -46,7 +47,7 @@ function PendingChangesDialogView({ groups, open, onClose, title, summary, empty
|
|
|
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 ? (
|
|
47
48
|
// Product decision: the sync summary remains distinct and visible
|
|
48
49
|
// while the user scrolls through pending groups.
|
|
49
|
-
(0, jsx_runtime_1.
|
|
50
|
+
(0, jsx_runtime_1.jsxs)(material_1.Stack, { component: "section", "aria-label": "Pending changes summary", direction: "row", spacing: 1, sx: { p: 2, borderRadius: 1, bgcolor: "action.selected", alignItems: "center" }, 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: () => {
|
|
50
51
|
// Entry focus runs after MUI settles its focus trap, including a reopen
|
|
51
52
|
// of the same inspector. A removed group retains the shell's fallback.
|
|
52
53
|
const target = returnItemButton.current;
|
|
@@ -62,11 +63,12 @@ function PendingChangesDialogView({ groups, open, onClose, title, summary, empty
|
|
|
62
63
|
const actionPage = Math.min((_a = actionPages[group.key]) !== null && _a !== void 0 ? _a : 1, actionPageCount);
|
|
63
64
|
return ((0, jsx_runtime_1.jsx)(material_1.ListItem, { disableGutters: true, sx: {
|
|
64
65
|
p: 2,
|
|
66
|
+
position: "relative",
|
|
65
67
|
alignItems: "flex-start",
|
|
66
68
|
border: 1,
|
|
67
69
|
borderColor: "divider",
|
|
68
70
|
borderRadius: 1,
|
|
69
|
-
}, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing:
|
|
71
|
+
}, 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: {
|
|
70
72
|
alignItems: "center",
|
|
71
73
|
justifyContent: "space-between",
|
|
72
74
|
}, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: title, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h3", "aria-label": title, tabIndex: 0, sx: {
|
|
@@ -78,7 +80,7 @@ function PendingChangesDialogView({ groups, open, onClose, title, summary, empty
|
|
|
78
80
|
overflow: "hidden",
|
|
79
81
|
textOverflow: "ellipsis",
|
|
80
82
|
whiteSpace: "nowrap",
|
|
81
|
-
}, variant: "body2", children: title }) }), (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", spacing: 0.5, sx: { alignItems: "center", flexShrink: 0 }, 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
|
|
83
|
+
}, variant: "body2", children: title }) }), (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", spacing: 0.5, sx: { alignItems: "center", flexShrink: 0, position: "absolute", right: 8, top: group.rows.length ? 32 : 4 }, 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
|
|
82
84
|
? `${group.openLabel} unavailable. ${unavailableReason}`
|
|
83
85
|
: undefined, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": `${group.openLabel}: ${title}`, disabled: Boolean(unavailableReason), ref: focusGroupKey === group.key
|
|
84
86
|
? returnItemButton
|
|
@@ -90,6 +92,7 @@ function PendingChangesDialogView({ groups, open, onClose, title, summary, empty
|
|
|
90
92
|
if (!presentation.action &&
|
|
91
93
|
!exception &&
|
|
92
94
|
!presentation.targetLabel &&
|
|
95
|
+
!presentation.elapsedText &&
|
|
93
96
|
presentation.attemptedText === undefined)
|
|
94
97
|
return null;
|
|
95
98
|
return ((0, jsx_runtime_1.jsx)(material_1.ListItem, { disableGutters: true, sx: {
|
|
@@ -101,9 +104,10 @@ function PendingChangesDialogView({ groups, open, onClose, title, summary, empty
|
|
|
101
104
|
alignItems: "baseline",
|
|
102
105
|
justifyContent: "space-between",
|
|
103
106
|
flexWrap: "wrap",
|
|
107
|
+
pr: index === 0 && group.openLabel && onOpenItem ? 5 : 0,
|
|
104
108
|
}, 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
|
|
105
109
|
? "error"
|
|
106
|
-
: "text.secondary", variant: "caption", children: exception })) : null] }), presentation.targetLabel ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.secondary", variant: "caption", sx: {
|
|
110
|
+
: "text.secondary", variant: "caption", children: exception })) : null] }), presentation.elapsedText ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { fontSize: "0.6875rem", color: "text.primary", opacity: 0.78 }, children: presentation.elapsedText })) : null, presentation.targetLabel ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.secondary", variant: "caption", sx: {
|
|
107
111
|
overflowWrap: "anywhere",
|
|
108
112
|
whiteSpace: "pre-wrap",
|
|
109
113
|
}, children: presentation.targetLabel })) : null, presentation.attemptedText !== undefined ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", sx: {
|
|
@@ -0,0 +1,58 @@
|
|
|
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, }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { "aria-label": label, className: className, sx: {
|
|
15
|
+
display: "grid",
|
|
16
|
+
gap: 1.5,
|
|
17
|
+
gridTemplateColumns: {
|
|
18
|
+
xs: "1fr",
|
|
19
|
+
md: `repeat(${plans.length}, minmax(0, 1fr))`,
|
|
20
|
+
},
|
|
21
|
+
}, children: plans.map((plan) => {
|
|
22
|
+
const highlighted = Boolean(plan.highlighted);
|
|
23
|
+
const secondary = highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { className: interactiveClassName, spacing: 2.25, sx: {
|
|
25
|
+
bgcolor: highlighted ? colors.accent : "#FFFFFF",
|
|
26
|
+
boxShadow: highlighted
|
|
27
|
+
? "0 8px 18px rgba(23, 106, 168, 0.22)"
|
|
28
|
+
: "none",
|
|
29
|
+
color: highlighted ? "#FFFFFF" : colors.text,
|
|
30
|
+
minHeight: { md: 430 },
|
|
31
|
+
p: { xs: 2.5, sm: 3 },
|
|
32
|
+
position: "relative",
|
|
33
|
+
borderRadius: 2,
|
|
34
|
+
...(highlighted
|
|
35
|
+
? {}
|
|
36
|
+
: { border: "1px solid rgba(23, 38, 56, 0.12)" }),
|
|
37
|
+
"&:hover": {
|
|
38
|
+
...(highlighted
|
|
39
|
+
? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
|
|
40
|
+
: { bgcolor: "#FCFEFF" }),
|
|
41
|
+
transform: "translateY(-2px)",
|
|
42
|
+
},
|
|
43
|
+
}, 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, { sx: { fontSize: 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
|
|
44
|
+
color: secondary,
|
|
45
|
+
fontSize: 14,
|
|
46
|
+
lineHeight: 1.5,
|
|
47
|
+
minHeight: { md: 42 },
|
|
48
|
+
}, children: plan.description }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
|
|
49
|
+
fontSize: { xs: 25, sm: 28 },
|
|
50
|
+
fontWeight: 780,
|
|
51
|
+
letterSpacing: "-0.03em",
|
|
52
|
+
}, children: plan.price }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: secondary, fontSize: 13 }, children: plan.priceNote })] }), (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, { sx: {
|
|
53
|
+
color: highlighted ? "#FFFFFF" : colors.accentDark,
|
|
54
|
+
fontSize: 18,
|
|
55
|
+
mt: "2px",
|
|
56
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: 14, lineHeight: 1.45 }, children: feature })] }, index))) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
|
|
57
|
+
}) }));
|
|
58
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
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; } });
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { IconButton, List, ListItem, Pagination, Stack, Typography, Tooltip, } from "@mui/material";
|
|
4
4
|
import ArrowForwardRoundedIcon from "@mui/icons-material/ArrowForwardRounded";
|
|
5
|
+
import DeleteOutlineRoundedIcon from "@mui/icons-material/DeleteOutlineRounded";
|
|
5
6
|
import CloudUploadOutlinedIcon from "@mui/icons-material/CloudUploadOutlined";
|
|
6
7
|
import { useRef, useState } from "react";
|
|
7
8
|
import { PendingChangesDialogShell } from "./PendingChangesDialogShell.js";
|
|
8
9
|
const pageSize = 10;
|
|
9
|
-
export function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage = "All changes are saved.", accountKey, onOpenItem, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell = PendingChangesDialogShell, }) {
|
|
10
|
+
export 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, }) {
|
|
10
11
|
const returnItemButton = useRef(null);
|
|
11
12
|
const [page, setPage] = useState(1);
|
|
12
13
|
const [actionPages, setActionPages] = useState({});
|
|
@@ -40,7 +41,7 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
|
|
|
40
41
|
return (_jsxs(Shell, { autoFocusInput: false, closeLabel: "Close pending changes", closeTooltip: "Close pending changes", contentHeader: contentHeader !== null && contentHeader !== void 0 ? contentHeader : (groups.length ? (
|
|
41
42
|
// Product decision: the sync summary remains distinct and visible
|
|
42
43
|
// while the user scrolls through pending groups.
|
|
43
|
-
|
|
44
|
+
_jsxs(Stack, { component: "section", "aria-label": "Pending changes summary", direction: "row", spacing: 1, sx: { p: 2, borderRadius: 1, bgcolor: "action.selected", alignItems: "center" }, children: [_jsx(Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: summary }), onDiscardRequest ? (_jsx(Tooltip, { title: discardLabel, children: _jsx(IconButton, { "aria-label": discardLabel, onClick: onDiscardRequest, sx: { width: 44, height: 44 }, children: _jsx(DeleteOutlineRoundedIcon, {}) }) })) : null] })) : undefined), contentTouchHandlers: contentTouchHandlers, contentSx: { pt: 0.5, pb: 3, overscrollBehaviorY: "contain" }, exclusive: false, onClose: onClose, onEntered: () => {
|
|
44
45
|
// Entry focus runs after MUI settles its focus trap, including a reopen
|
|
45
46
|
// of the same inspector. A removed group retains the shell's fallback.
|
|
46
47
|
const target = returnItemButton.current;
|
|
@@ -56,11 +57,12 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
|
|
|
56
57
|
const actionPage = Math.min((_a = actionPages[group.key]) !== null && _a !== void 0 ? _a : 1, actionPageCount);
|
|
57
58
|
return (_jsx(ListItem, { disableGutters: true, sx: {
|
|
58
59
|
p: 2,
|
|
60
|
+
position: "relative",
|
|
59
61
|
alignItems: "flex-start",
|
|
60
62
|
border: 1,
|
|
61
63
|
borderColor: "divider",
|
|
62
64
|
borderRadius: 1,
|
|
63
|
-
}, children: _jsxs(Stack, { spacing:
|
|
65
|
+
}, children: _jsxs(Stack, { spacing: 0, sx: { minWidth: 0, width: "100%" }, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: {
|
|
64
66
|
alignItems: "center",
|
|
65
67
|
justifyContent: "space-between",
|
|
66
68
|
}, children: [_jsx(Tooltip, { title: title, children: _jsx(Typography, { component: "h3", "aria-label": title, tabIndex: 0, sx: {
|
|
@@ -72,7 +74,7 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
|
|
|
72
74
|
overflow: "hidden",
|
|
73
75
|
textOverflow: "ellipsis",
|
|
74
76
|
whiteSpace: "nowrap",
|
|
75
|
-
}, variant: "body2", children: title }) }), _jsx(Stack, { direction: "row", spacing: 0.5, sx: { alignItems: "center", flexShrink: 0 }, children: group.openLabel && onOpenItem ? (_jsx(Tooltip, { title: unavailableReason || group.openLabel, children: _jsx("span", { tabIndex: unavailableReason ? 0 : undefined, "aria-label": unavailableReason
|
|
77
|
+
}, variant: "body2", children: title }) }), _jsx(Stack, { direction: "row", spacing: 0.5, sx: { alignItems: "center", flexShrink: 0, position: "absolute", right: 8, top: group.rows.length ? 32 : 4 }, children: group.openLabel && onOpenItem ? (_jsx(Tooltip, { title: unavailableReason || group.openLabel, children: _jsx("span", { tabIndex: unavailableReason ? 0 : undefined, "aria-label": unavailableReason
|
|
76
78
|
? `${group.openLabel} unavailable. ${unavailableReason}`
|
|
77
79
|
: undefined, children: _jsx(IconButton, { "aria-label": `${group.openLabel}: ${title}`, disabled: Boolean(unavailableReason), ref: focusGroupKey === group.key
|
|
78
80
|
? returnItemButton
|
|
@@ -84,6 +86,7 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
|
|
|
84
86
|
if (!presentation.action &&
|
|
85
87
|
!exception &&
|
|
86
88
|
!presentation.targetLabel &&
|
|
89
|
+
!presentation.elapsedText &&
|
|
87
90
|
presentation.attemptedText === undefined)
|
|
88
91
|
return null;
|
|
89
92
|
return (_jsx(ListItem, { disableGutters: true, sx: {
|
|
@@ -95,9 +98,10 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
|
|
|
95
98
|
alignItems: "baseline",
|
|
96
99
|
justifyContent: "space-between",
|
|
97
100
|
flexWrap: "wrap",
|
|
101
|
+
pr: index === 0 && group.openLabel && onOpenItem ? 5 : 0,
|
|
98
102
|
}, children: [presentation.action ? (_jsx(Typography, { component: "h4", color: "text.secondary", variant: "caption", children: presentation.action })) : null, exception ? (_jsx(Typography, { color: item.needsAttention
|
|
99
103
|
? "error"
|
|
100
|
-
: "text.secondary", variant: "caption", children: exception })) : null] }), presentation.targetLabel ? (_jsx(Typography, { color: "text.secondary", variant: "caption", sx: {
|
|
104
|
+
: "text.secondary", variant: "caption", children: exception })) : null] }), presentation.elapsedText ? (_jsx(Typography, { variant: "caption", sx: { fontSize: "0.6875rem", color: "text.primary", opacity: 0.78 }, children: presentation.elapsedText })) : null, presentation.targetLabel ? (_jsx(Typography, { color: "text.secondary", variant: "caption", sx: {
|
|
101
105
|
overflowWrap: "anywhere",
|
|
102
106
|
whiteSpace: "pre-wrap",
|
|
103
107
|
}, children: presentation.targetLabel })) : null, presentation.attemptedText !== undefined ? (_jsx(Typography, { variant: "body1", sx: {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import CheckRoundedIcon from "@mui/icons-material/CheckRounded";
|
|
4
|
+
import { Box, Stack, Typography } from "@mui/material";
|
|
5
|
+
// Product decision: callers own plan content and actions; this component only
|
|
6
|
+
// presents the supplied plans and never determines prices or availability.
|
|
7
|
+
export function PricingTable({ label, plans, className, interactiveClassName, colors, }) {
|
|
8
|
+
return (_jsx(Box, { "aria-label": label, className: className, sx: {
|
|
9
|
+
display: "grid",
|
|
10
|
+
gap: 1.5,
|
|
11
|
+
gridTemplateColumns: {
|
|
12
|
+
xs: "1fr",
|
|
13
|
+
md: `repeat(${plans.length}, minmax(0, 1fr))`,
|
|
14
|
+
},
|
|
15
|
+
}, children: plans.map((plan) => {
|
|
16
|
+
const highlighted = Boolean(plan.highlighted);
|
|
17
|
+
const secondary = highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
|
|
18
|
+
return (_jsxs(Stack, { className: interactiveClassName, spacing: 2.25, sx: {
|
|
19
|
+
bgcolor: highlighted ? colors.accent : "#FFFFFF",
|
|
20
|
+
boxShadow: highlighted
|
|
21
|
+
? "0 8px 18px rgba(23, 106, 168, 0.22)"
|
|
22
|
+
: "none",
|
|
23
|
+
color: highlighted ? "#FFFFFF" : colors.text,
|
|
24
|
+
minHeight: { md: 430 },
|
|
25
|
+
p: { xs: 2.5, sm: 3 },
|
|
26
|
+
position: "relative",
|
|
27
|
+
borderRadius: 2,
|
|
28
|
+
...(highlighted
|
|
29
|
+
? {}
|
|
30
|
+
: { border: "1px solid rgba(23, 38, 56, 0.12)" }),
|
|
31
|
+
"&:hover": {
|
|
32
|
+
...(highlighted
|
|
33
|
+
? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
|
|
34
|
+
: { bgcolor: "#FCFEFF" }),
|
|
35
|
+
transform: "translateY(-2px)",
|
|
36
|
+
},
|
|
37
|
+
}, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-between" }, children: [_jsx(Typography, { sx: { fontSize: 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), _jsx(Typography, { sx: {
|
|
38
|
+
color: secondary,
|
|
39
|
+
fontSize: 14,
|
|
40
|
+
lineHeight: 1.5,
|
|
41
|
+
minHeight: { md: 42 },
|
|
42
|
+
}, children: plan.description }), _jsxs(Stack, { spacing: 0.25, children: [_jsx(Typography, { sx: {
|
|
43
|
+
fontSize: { xs: 25, sm: 28 },
|
|
44
|
+
fontWeight: 780,
|
|
45
|
+
letterSpacing: "-0.03em",
|
|
46
|
+
}, children: plan.price }), _jsx(Typography, { sx: { color: secondary, fontSize: 13 }, children: plan.priceNote })] }), _jsx(Stack, { component: "ul", spacing: 1.1, sx: { listStyle: "none", m: 0, p: 0 }, children: plan.features.map((feature, index) => (_jsxs(Stack, { component: "li", direction: "row", spacing: 1, children: [_jsx(CheckRoundedIcon, { sx: {
|
|
47
|
+
color: highlighted ? "#FFFFFF" : colors.accentDark,
|
|
48
|
+
fontSize: 18,
|
|
49
|
+
mt: "2px",
|
|
50
|
+
} }), _jsx(Typography, { sx: { fontSize: 14, lineHeight: 1.45 }, children: feature })] }, index))) }), _jsx(Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
|
|
51
|
+
}) }));
|
|
52
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PendingChangesDialogViewProps } from "./types.js";
|
|
2
|
-
export declare function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage, accountKey, onOpenItem, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell, }: PendingChangesDialogViewProps): import("react").JSX.Element;
|
|
2
|
+
export declare function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage, accountKey, onOpenItem, onDiscardRequest, discardLabel, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell, }: PendingChangesDialogViewProps): import("react").JSX.Element;
|
|
@@ -7,6 +7,8 @@ export type PendingChangeRow = {
|
|
|
7
7
|
exception?: string;
|
|
8
8
|
needsAttention?: boolean;
|
|
9
9
|
targetLabel?: string;
|
|
10
|
+
/** Host-formatted age of this change, refreshed by the host as needed. */
|
|
11
|
+
elapsedText?: string;
|
|
10
12
|
attemptedText?: string;
|
|
11
13
|
};
|
|
12
14
|
export type PendingChangeViewGroup = {
|
|
@@ -40,6 +42,9 @@ export type PendingChangesDialogViewProps = {
|
|
|
40
42
|
onClose: () => void;
|
|
41
43
|
accountKey?: string | null;
|
|
42
44
|
onOpenItem?: (groupKey: string) => void;
|
|
45
|
+
/** Requests host-owned selection and confirmation; does not discard data. */
|
|
46
|
+
onDiscardRequest?: () => void;
|
|
47
|
+
discardLabel?: string;
|
|
43
48
|
focusGroupKey?: string | null;
|
|
44
49
|
navigationError?: string | null;
|
|
45
50
|
contentHeader?: ReactNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
};
|
|
13
|
+
export type PricingTableProps = {
|
|
14
|
+
label: string;
|
|
15
|
+
plans: readonly PricingTablePlan[];
|
|
16
|
+
className?: string;
|
|
17
|
+
interactiveClassName?: string;
|
|
18
|
+
colors: {
|
|
19
|
+
accent: string;
|
|
20
|
+
accentDark: string;
|
|
21
|
+
text: string;
|
|
22
|
+
muted: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare function PricingTable({ label, plans, className, interactiveClassName, colors, }: PricingTableProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Pending inspection contract
|
|
2
|
+
|
|
3
|
+
Each group has a compact title followed by its change rows. The group's optional
|
|
4
|
+
open action aligns with the first visible change and retains its accessible name,
|
|
5
|
+
tooltip, 44px target, and focus behavior. Rows can display host-formatted elapsed
|
|
6
|
+
time in compact secondary text. The host supplies and refreshes this value.
|
|
7
|
+
|
|
8
|
+
When supplied, the discard request appears in the default summary; it delegates
|
|
9
|
+
only the request to the host. The host owns item selection, confirmation, safe
|
|
10
|
+
cancellation, and error handling. A custom summary replaces the default and owns
|
|
11
|
+
its own controls. Inspection never removes, retries, or stores data itself.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bayonai/mui-design",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Shared Bayon AI Material UI theme, style recipes, and reusable design components.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -62,6 +62,11 @@
|
|
|
62
62
|
"types": "./dist/types/uploads/index.d.ts",
|
|
63
63
|
"import": "./dist/esm/uploads/index.js",
|
|
64
64
|
"require": "./dist/cjs/uploads/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./pricing": {
|
|
67
|
+
"types": "./dist/types/pricing/index.d.ts",
|
|
68
|
+
"import": "./dist/esm/pricing/index.js",
|
|
69
|
+
"require": "./dist/cjs/pricing/index.js"
|
|
65
70
|
}
|
|
66
71
|
},
|
|
67
72
|
"files": [
|