@bayonai/mui-design 1.6.0 → 1.8.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +29 -0
  3. package/dist/cjs/actions/DialogActionButtons.d.ts +2 -1
  4. package/dist/cjs/actions/DialogActionButtons.js +2 -2
  5. package/dist/cjs/drawers/WorkspaceSidePane.d.ts +25 -0
  6. package/dist/cjs/drawers/WorkspaceSidePane.js +206 -0
  7. package/dist/cjs/drawers/WorkspaceSidePaneRoot.d.ts +1 -0
  8. package/dist/cjs/drawers/WorkspaceSidePaneRoot.js +93 -0
  9. package/dist/cjs/drawers/index.d.ts +1 -0
  10. package/dist/cjs/drawers/index.js +3 -1
  11. package/dist/cjs/drawers/workspaceSidePaneGeometry.d.ts +11 -0
  12. package/dist/cjs/drawers/workspaceSidePaneGeometry.js +15 -0
  13. package/dist/cjs/internal/DialogChoiceTile.d.ts +20 -0
  14. package/dist/cjs/internal/DialogChoiceTile.js +60 -0
  15. package/dist/cjs/pricing/PlanUpgradeDialog.d.ts +17 -0
  16. package/dist/cjs/pricing/PlanUpgradeDialog.js +22 -0
  17. package/dist/cjs/pricing/index.d.ts +1 -0
  18. package/dist/cjs/pricing/index.js +3 -1
  19. package/dist/cjs/uploads/ImageUploadQualityDialog.d.ts +13 -0
  20. package/dist/cjs/uploads/ImageUploadQualityDialog.js +57 -0
  21. package/dist/cjs/uploads/index.d.ts +1 -0
  22. package/dist/cjs/uploads/index.js +3 -1
  23. package/dist/esm/actions/DialogActionButtons.js +3 -3
  24. package/dist/esm/drawers/WorkspaceSidePane.js +200 -0
  25. package/dist/esm/drawers/WorkspaceSidePaneRoot.js +90 -0
  26. package/dist/esm/drawers/index.js +1 -0
  27. package/dist/esm/drawers/workspaceSidePaneGeometry.js +11 -0
  28. package/dist/esm/internal/DialogChoiceTile.js +54 -0
  29. package/dist/esm/pricing/PlanUpgradeDialog.js +19 -0
  30. package/dist/esm/pricing/index.js +1 -0
  31. package/dist/esm/uploads/ImageUploadQualityDialog.js +51 -0
  32. package/dist/esm/uploads/index.js +1 -0
  33. package/dist/types/actions/DialogActionButtons.d.ts +2 -1
  34. package/dist/types/drawers/WorkspaceSidePane.d.ts +25 -0
  35. package/dist/types/drawers/WorkspaceSidePaneRoot.d.ts +1 -0
  36. package/dist/types/drawers/index.d.ts +1 -0
  37. package/dist/types/drawers/workspaceSidePaneGeometry.d.ts +11 -0
  38. package/dist/types/internal/DialogChoiceTile.d.ts +20 -0
  39. package/dist/types/pricing/PlanUpgradeDialog.d.ts +17 -0
  40. package/dist/types/pricing/index.d.ts +1 -0
  41. package/dist/types/uploads/ImageUploadQualityDialog.d.ts +13 -0
  42. package/dist/types/uploads/index.d.ts +1 -0
  43. package/drawers.js +4 -0
  44. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.8.0 — 2026-11-21 (candidate)
4
+
5
+ - Add `WorkspaceSidePane` to the drawers entry for a docked, resizable workspace pane that becomes a modal on narrow layouts.
6
+
7
+ ## 1.7.0 — 2026-11-20
8
+
9
+ - Add a controlled image quality dialog with a local preview and quality tiles.
10
+ - Add a host-configured plan upgrade dialog with selectable plan cards.
11
+ - Let dialog consumers opt into a labeled primary button.
12
+
3
13
  ## 1.6.0 — 2026-11-20
4
14
 
5
15
  - Add the read-only `ImageInfoPanel` to `@bayonai/mui-design/uploads`.
@@ -14,6 +24,12 @@ All notable changes to `@bayonai/mui-design` will be documented in this file.
14
24
  - Give plan sections accessible names with an optional host override.
15
25
  - Use the published file-uploads package for local upload component development.
16
26
 
27
+ ## 1.5.0 - 2026-11-19
28
+
29
+ - Add the optional dark comparison appearance for pricing tables.
30
+ - Give plan sections accessible names with an optional host override.
31
+ - Use the published file-uploads package for local upload component development.
32
+
17
33
  ## 1.4.0 - 2026-11-12
18
34
 
19
35
  - Add reusable metadata value-row/group spacing, neutral template badge, and explicit venue-search presentation.
package/README.md CHANGED
@@ -86,6 +86,35 @@ The main website consumes this package through the local npm workspace while the
86
86
  npm publish --workspace @bayonai/mui-design
87
87
  ```
88
88
 
89
+ ## Workspace side pane
90
+
91
+ `WorkspaceSidePane` is available from `@bayonai/mui-design/drawers`.
92
+ Place it in the right-aligned workspace and provide the working content as
93
+ children. The rail sits between the workspace and the pane. The pane opens
94
+ docked when the workspace can retain 640px of usable content and otherwise
95
+ opens as a modal overlay. Resize by dragging the docked edge or by focusing
96
+ its separator and pressing Left, Right, Home, End, or Enter.
97
+
98
+ Pass a heading ID and ref for naming the pane and directing focus. Render
99
+ rail buttons with `renderActions`, connecting `aria-controls` to `paneId` and
100
+ `aria-expanded` to `visible`. Call `openFrom(event)` from the opener and
101
+ `close(event.currentTarget)` when the active button closes the pane. If a
102
+ button switches to a different heading, pass its ref to `openFrom`.
103
+ `renderPane(visible)` receives `false` as soon as dismissal starts. Use it to
104
+ stop protected reads or clear interactive content immediately.
105
+ `keepPaneMounted` can retain a pane draft across close and reopen.
106
+
107
+ Hosts provide rail actions, view selection, data access, and workspace
108
+ padding. `getOverlaySiblings` can identify additional background elements,
109
+ such as sibling navigation, to make inert during the modal. `workspaceRef`
110
+ optionally exposes the working slot. The layout respects reduced motion and
111
+ restores focus to the opener on close. The package includes a physical drawers
112
+ entry for bundlers that resolve subpaths without reading the export map. CSS custom properties
113
+ `--workspace-side-pane-background`, `--workspace-side-pane-rail-background`,
114
+ `--workspace-side-pane-border`, `--workspace-side-pane-text`,
115
+ `--workspace-side-pane-focus`, and `--workspace-side-pane-z-index` let the
116
+ host match its theme and stacking order.
117
+
89
118
  ## Preserved application primitives (1.1.0 candidate)
90
119
 
91
120
  TL-M249 makes this package the owner of the existing MUI presentation previously
@@ -3,6 +3,7 @@ import type { ReactNode } from "react";
3
3
  export declare const compactDialogPaperSx: SxProps<Theme>;
4
4
  export type DialogActionButtonsProps = {
5
5
  confirmLabel: string;
6
+ confirmText?: string;
6
7
  confirmDisabled?: boolean;
7
8
  confirmColor?: "error" | "primary" | "secondary" | "success" | "warning";
8
9
  confirmIcon?: ReactNode;
@@ -11,7 +12,7 @@ export type DialogActionButtonsProps = {
11
12
  sx?: SxProps<Theme>;
12
13
  };
13
14
  /** Keeps the modal's primary decision compact and explicitly labelled. */
14
- export declare function DialogActionButtons({ confirmColor, confirmDisabled, confirmIcon, confirmLabel, confirmType, onConfirm, sx, }: DialogActionButtonsProps): import("react").JSX.Element;
15
+ export declare function DialogActionButtons({ confirmColor, confirmDisabled, confirmIcon, confirmLabel, confirmText, confirmType, onConfirm, sx, }: DialogActionButtonsProps): import("react").JSX.Element;
15
16
  export declare function DialogActionProgress(): import("react").JSX.Element;
16
17
  export type DialogCloseButtonProps = {
17
18
  disabled?: boolean;
@@ -21,8 +21,8 @@ exports.compactDialogPaperSx = {
21
21
  overflowWrap: "anywhere",
22
22
  };
23
23
  /** Keeps the modal's primary decision compact and explicitly labelled. */
24
- function DialogActionButtons({ confirmColor = "success", confirmDisabled = false, confirmIcon, confirmLabel, confirmType = "button", onConfirm, sx, }) {
25
- return ((0, jsx_runtime_1.jsx)(material_1.DialogActions, { sx: sx, children: (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", spacing: 1, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: confirmLabel, children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": confirmLabel, color: confirmColor, disabled: confirmDisabled, onClick: confirmType === "submit" ? undefined : onConfirm, type: confirmType, children: confirmIcon !== null && confirmIcon !== void 0 ? confirmIcon : (0, jsx_runtime_1.jsx)(Check_1.default, {}) }) }) }) }) }));
24
+ function DialogActionButtons({ confirmColor = "success", confirmDisabled = false, confirmIcon, confirmLabel, confirmText, confirmType = "button", onConfirm, sx, }) {
25
+ return ((0, jsx_runtime_1.jsx)(material_1.DialogActions, { sx: sx, children: confirmText ? ((0, jsx_runtime_1.jsx)(material_1.Button, { "aria-label": confirmLabel, color: confirmColor, disabled: confirmDisabled, onClick: confirmType === "submit" ? undefined : onConfirm, startIcon: confirmIcon, type: confirmType, variant: "contained", children: confirmText })) : ((0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", spacing: 1, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: confirmLabel, children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": confirmLabel, color: confirmColor, disabled: confirmDisabled, onClick: confirmType === "submit" ? undefined : onConfirm, type: confirmType, children: confirmIcon !== null && confirmIcon !== void 0 ? confirmIcon : (0, jsx_runtime_1.jsx)(Check_1.default, {}) }) }) }) })) }));
26
26
  }
27
27
  function DialogActionProgress() {
28
28
  return (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 });
@@ -0,0 +1,25 @@
1
+ import { type CSSProperties, type MouseEvent, type ReactNode, type RefObject } from "react";
2
+ export interface WorkspaceSidePaneActions {
3
+ visible: boolean;
4
+ paneId: string;
5
+ openFrom: (event: MouseEvent<HTMLButtonElement>, focusTarget?: RefObject<HTMLElement | null>) => void;
6
+ close: (opener?: HTMLButtonElement) => void;
7
+ }
8
+ export interface WorkspaceSidePaneProps {
9
+ children: ReactNode;
10
+ enabled?: boolean;
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ paneId?: string;
14
+ headingId: string;
15
+ headingRef: RefObject<HTMLElement | null>;
16
+ workspaceRef?: RefObject<HTMLDivElement | null>;
17
+ actionsLabel: string;
18
+ resizeLabel?: string;
19
+ keepPaneMounted?: boolean;
20
+ getOverlaySiblings?: (root: HTMLDivElement) => readonly HTMLElement[];
21
+ renderActions: (actions: WorkspaceSidePaneActions) => ReactNode;
22
+ renderPane: (visible: boolean) => ReactNode;
23
+ }
24
+ /** Keeps the workspace in one slot across docked, modal and closed presentation. */
25
+ export declare function WorkspaceSidePane({ children, enabled, className, style, paneId, headingId, headingRef, workspaceRef, actionsLabel, resizeLabel, keepPaneMounted, getOverlaySiblings, renderActions, renderPane, }: WorkspaceSidePaneProps): import("react").JSX.Element;
@@ -0,0 +1,206 @@
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.WorkspaceSidePane = WorkspaceSidePane;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = require("react");
10
+ const Collapse_1 = __importDefault(require("@mui/material/Collapse"));
11
+ const Fade_1 = __importDefault(require("@mui/material/Fade"));
12
+ const useMediaQuery_1 = __importDefault(require("@mui/material/useMediaQuery"));
13
+ const WorkspaceSidePaneRoot_js_1 = require("./WorkspaceSidePaneRoot.js");
14
+ const workspaceSidePaneGeometry_js_1 = require("./workspaceSidePaneGeometry.js");
15
+ const motion = { timeout: { enter: 220, exit: 170 }, easing: "cubic-bezier(0.25, 1, 0.5, 1)" };
16
+ /** Keeps the workspace in one slot across docked, modal and closed presentation. */
17
+ function WorkspaceSidePane({ children, enabled = true, className, style, paneId, headingId, headingRef, workspaceRef, actionsLabel, resizeLabel = "Resize side pane", keepPaneMounted = false, getOverlaySiblings, renderActions, renderPane, }) {
18
+ const generatedId = (0, react_1.useId)();
19
+ const panelId = paneId !== null && paneId !== void 0 ? paneId : generatedId;
20
+ const rootRef = (0, react_1.useRef)(null);
21
+ const internalWorkspaceRef = (0, react_1.useRef)(null);
22
+ const contentRef = workspaceRef !== null && workspaceRef !== void 0 ? workspaceRef : internalWorkspaceRef;
23
+ const groupRef = (0, react_1.useRef)(null);
24
+ const openerRef = (0, react_1.useRef)(null);
25
+ const [open, setOpen] = (0, react_1.useState)(false);
26
+ const [present, setPresent] = (0, react_1.useState)(false);
27
+ const [directResize, setDirectResize] = (0, react_1.useState)(false);
28
+ const reducedMotion = (0, useMediaQuery_1.default)("(prefers-reduced-motion: reduce)", { noSsr: true });
29
+ const duration = reducedMotion ? 0 : motion.timeout;
30
+ const [width, setWidth] = (0, react_1.useState)(workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.initialPane);
31
+ const [bounds, setBounds] = (0, react_1.useState)({ width: workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.minCanvas + workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.rail + workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.initialPane, top: 0, workspaceInset: 0 });
32
+ const drag = (0, react_1.useRef)(null);
33
+ const geometry = (0, workspaceSidePaneGeometry_js_1.workspaceSidePaneGeometry)(bounds.width, width, bounds.workspaceInset);
34
+ const visible = enabled && open;
35
+ const overlay = visible && geometry.overlay;
36
+ const visibleRef = (0, react_1.useRef)(visible);
37
+ visibleRef.current = visible;
38
+ // Release modal focus and report closed to the host before visual exit.
39
+ const overlayPresentation = geometry.overlay && (visible || (present && !reducedMotion));
40
+ (0, react_1.useLayoutEffect)(() => {
41
+ if (!enabled) {
42
+ setPresent(false);
43
+ setDirectResize(false);
44
+ drag.current = null;
45
+ }
46
+ else if (visible) {
47
+ setPresent(true);
48
+ }
49
+ }, [enabled, visible]);
50
+ (0, react_1.useLayoutEffect)(() => {
51
+ const element = rootRef.current;
52
+ if (!element)
53
+ return;
54
+ const measure = () => {
55
+ const rect = element.getBoundingClientRect();
56
+ const workspaceStyle = contentRef.current ? getComputedStyle(contentRef.current) : null;
57
+ // Useful canvas excludes its retained page padding; chrome still uses
58
+ // the full root width, including in narrow overlays.
59
+ const workspaceInset = workspaceStyle
60
+ ? (parseFloat(workspaceStyle.paddingLeft) || 0) + (parseFloat(workspaceStyle.paddingRight) || 0)
61
+ : 0;
62
+ const next = { width: rect.width || window.innerWidth, top: Math.max(0, rect.top), workspaceInset };
63
+ // Content ResizeObserver notifications also arrive during pane motion;
64
+ // unchanged shell geometry must not rerender pane content per frame.
65
+ setBounds((previous) => previous.width === next.width && previous.top === next.top && previous.workspaceInset === next.workspaceInset ? previous : next);
66
+ };
67
+ measure();
68
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
69
+ observer === null || observer === void 0 ? void 0 : observer.observe(element);
70
+ if (contentRef.current)
71
+ observer === null || observer === void 0 ? void 0 : observer.observe(contentRef.current);
72
+ window.addEventListener("resize", measure);
73
+ return () => {
74
+ observer === null || observer === void 0 ? void 0 : observer.disconnect();
75
+ window.removeEventListener("resize", measure);
76
+ };
77
+ }, [enabled, contentRef]);
78
+ (0, react_1.useLayoutEffect)(() => {
79
+ var _a, _b, _c;
80
+ if (!overlay)
81
+ return;
82
+ const content = contentRef.current;
83
+ const root = rootRef.current;
84
+ const siblings = root ? (_a = getOverlaySiblings === null || getOverlaySiblings === void 0 ? void 0 : getOverlaySiblings(root)) !== null && _a !== void 0 ? _a : [] : [];
85
+ const covered = [...new Set([...(content ? [content] : []), ...siblings])];
86
+ const priorInert = covered.map((element) => ({ element, value: element.getAttribute("inert") }));
87
+ // Restore the pre-existing inert state when this overlay releases focus.
88
+ covered.forEach((element) => element.setAttribute("inert", ""));
89
+ const ownerDocument = (_c = (_b = rootRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument) !== null && _c !== void 0 ? _c : document;
90
+ const focusInside = () => { var _a; return (_a = headingRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
91
+ const containsTarget = (target) => { var _a; return Boolean(target && ((_a = groupRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))); };
92
+ const containFocus = (event) => {
93
+ if (!containsTarget(event.target))
94
+ focusInside();
95
+ };
96
+ const containOutsideTab = (event) => {
97
+ if (event.key !== "Tab" || containsTarget(event.target))
98
+ return;
99
+ event.preventDefault();
100
+ event.stopPropagation();
101
+ focusInside();
102
+ };
103
+ // inert blocks normal background interaction; focusin additionally contains
104
+ // programmatic focus and browsers/environments with incomplete inert support.
105
+ ownerDocument.addEventListener("focusin", containFocus, true);
106
+ ownerDocument.addEventListener("keydown", containOutsideTab, true);
107
+ focusInside();
108
+ return () => {
109
+ ownerDocument.removeEventListener("focusin", containFocus, true);
110
+ ownerDocument.removeEventListener("keydown", containOutsideTab, true);
111
+ priorInert.forEach(({ element, value }) => {
112
+ if (value === null)
113
+ element.removeAttribute("inert");
114
+ else
115
+ element.setAttribute("inert", value);
116
+ });
117
+ };
118
+ }, [overlay, headingId, headingRef, contentRef, getOverlaySiblings]);
119
+ (0, react_1.useLayoutEffect)(() => {
120
+ var _a;
121
+ if (!visible && present)
122
+ (_a = openerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
123
+ }, [visible, present]);
124
+ const close = (opener) => {
125
+ if (opener)
126
+ openerRef.current = opener;
127
+ setOpen(false);
128
+ setDirectResize(false);
129
+ drag.current = null;
130
+ };
131
+ // Deliberate docked resizing preserves the useful canvas and its focusable
132
+ // control. Only an external viewport/container change may require an overlay.
133
+ const dockedMaximum = Math.max(workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.minPane, Math.min(workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.maxPane, bounds.width - bounds.workspaceInset - workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.rail - workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.minCanvas));
134
+ const clampWidth = (next) => {
135
+ setDirectResize(true);
136
+ setWidth(Math.max(workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.minPane, Math.min(dockedMaximum, next)));
137
+ };
138
+ const keyboard = (event) => {
139
+ var _a, _b, _c, _d, _e;
140
+ // Nested native dialogs own their own Escape handling.
141
+ if ((_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, "dialog[open]"))
142
+ return;
143
+ if (event.key === "Escape" && !event.defaultPrevented) {
144
+ event.preventDefault();
145
+ event.stopPropagation();
146
+ close();
147
+ return;
148
+ }
149
+ if (!overlay || event.key !== "Tab")
150
+ return;
151
+ const controls = [...((_d = (_c = groupRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('button, a[href], input, textarea, select, summary, [tabindex]')) !== null && _d !== void 0 ? _d : [])]
152
+ .filter((element) => element.tabIndex >= 0 && !element.matches(":disabled")
153
+ && !element.closest('[hidden], [inert], dialog:not([open])')
154
+ && element.getClientRects().length > 0 && getComputedStyle(element).visibility !== "hidden");
155
+ const first = controls[0], last = controls[controls.length - 1];
156
+ const focused = (_e = groupRef.current) === null || _e === void 0 ? void 0 : _e.ownerDocument.activeElement;
157
+ if (event.shiftKey && (focused === first || focused === headingRef.current)) {
158
+ event.preventDefault();
159
+ last === null || last === void 0 ? void 0 : last.focus();
160
+ }
161
+ else if (!event.shiftKey && focused === last) {
162
+ event.preventDefault();
163
+ first === null || first === void 0 ? void 0 : first.focus();
164
+ }
165
+ };
166
+ const openFrom = (event, focusTarget = headingRef) => {
167
+ openerRef.current = event.currentTarget;
168
+ setPresent(true);
169
+ setOpen(true);
170
+ if (event.detail === 0)
171
+ requestAnimationFrame(() => {
172
+ var _a;
173
+ if (visibleRef.current)
174
+ (_a = focusTarget.current) === null || _a === void 0 ? void 0 : _a.focus();
175
+ });
176
+ };
177
+ return ((0, jsx_runtime_1.jsxs)(WorkspaceSidePaneRoot_js_1.WorkspaceSidePaneRoot, { ref: rootRef, className: `workspace-side-pane${className ? ` ${className}` : ""}${enabled ? " workspace-side-pane-enabled" : ""}${visible ? " workspace-side-pane-open" : ""}${overlayPresentation ? " workspace-side-pane-overlay" : ""}${directResize && visible ? " workspace-side-pane-direct-resize" : ""}${reducedMotion ? " workspace-side-pane-reduced-motion" : ""}`, style: { ...style, "--workspace-side-pane-width": `${geometry.paneWidth}px`, "--workspace-side-pane-top": `${bounds.top}px` }, children: [(0, jsx_runtime_1.jsx)("div", { ref: contentRef, className: "workspace-side-pane-workspace", children: children }), enabled && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Fade_1.default, { in: overlay, timeout: duration, easing: motion.easing, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)("div", { className: "workspace-side-pane-backdrop", "data-active": overlay, style: { pointerEvents: overlay ? "auto" : "none" }, onClick: () => close(), "aria-hidden": "true" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "workspace-side-pane-group", ref: groupRef, role: overlay ? "dialog" : undefined, "aria-modal": overlay ? true : undefined, "aria-labelledby": overlay ? headingId : undefined, onKeyDown: keyboard, children: [(0, jsx_runtime_1.jsxs)("nav", { className: "workspace-side-pane-rail", "aria-label": actionsLabel, children: [renderActions({ visible, paneId: panelId, openFrom, close }), visible && !overlay && ((0, jsx_runtime_1.jsx)("div", { role: "separator", tabIndex: 0, className: "workspace-side-pane-resize", "aria-label": resizeLabel, "aria-orientation": "vertical", "aria-valuemin": workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.minPane, "aria-valuemax": dockedMaximum, "aria-valuenow": width, "aria-valuetext": `${Math.round(geometry.paneWidth)} pixels`, title: "Drag to resize; Left/Right adjusts width; Enter resets", onKeyDown: (event) => {
178
+ const next = event.key === "ArrowLeft"
179
+ ? width + 16
180
+ : event.key === "ArrowRight"
181
+ ? width - 16
182
+ : event.key === "Home"
183
+ ? workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.minPane
184
+ : event.key === "End"
185
+ ? workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.maxPane
186
+ : event.key === "Enter"
187
+ ? workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.initialPane
188
+ : null;
189
+ if (next !== null) {
190
+ event.preventDefault();
191
+ event.stopPropagation();
192
+ clampWidth(next);
193
+ }
194
+ }, onPointerDown: (event) => {
195
+ var _a, _b;
196
+ drag.current = { x: event.clientX, width };
197
+ (_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
198
+ }, onPointerMove: (event) => {
199
+ if (drag.current)
200
+ clampWidth(drag.current.width + drag.current.x - event.clientX);
201
+ }, onPointerUp: () => {
202
+ drag.current = null;
203
+ }, onPointerCancel: () => {
204
+ drag.current = null;
205
+ } }))] }), (0, jsx_runtime_1.jsx)(Collapse_1.default, { in: visible, orientation: "horizontal", className: "workspace-side-pane-presence", timeout: duration, easing: motion.easing, mountOnEnter: true, unmountOnExit: !keepPaneMounted, onExited: () => setPresent(false), children: (0, jsx_runtime_1.jsx)("aside", { id: panelId, className: "workspace-side-pane-panel", "aria-labelledby": headingId, "aria-hidden": !visible || undefined, inert: !visible, children: renderPane(visible) }) })] })] }))] }));
206
+ }
@@ -0,0 +1 @@
1
+ export declare const WorkspaceSidePaneRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.WorkspaceSidePaneRoot = void 0;
5
+ const styles_1 = require("@mui/material/styles");
6
+ const workspaceSidePaneGeometry_js_1 = require("./workspaceSidePaneGeometry.js");
7
+ const width = "var(--workspace-side-pane-width)";
8
+ const top = "var(--workspace-side-pane-top)";
9
+ const layer = "var(--workspace-side-pane-z-index, 1250)";
10
+ exports.WorkspaceSidePaneRoot = (0, styles_1.styled)("div")(({ theme }) => ({
11
+ minWidth: 0,
12
+ minHeight: "100%",
13
+ "&.workspace-side-pane-enabled": {
14
+ display: "flex",
15
+ alignItems: "flex-start",
16
+ gap: 0,
17
+ position: "relative",
18
+ },
19
+ "& .workspace-side-pane-workspace": { minWidth: 0, flex: "1 1 auto" },
20
+ "& .workspace-side-pane-group": {
21
+ display: "flex",
22
+ flex: "0 0 auto",
23
+ position: "sticky",
24
+ top: 0,
25
+ alignSelf: "flex-start",
26
+ color: "var(--workspace-side-pane-text, " + theme.palette.text.primary + ")",
27
+ },
28
+ "& .workspace-side-pane-rail": {
29
+ boxSizing: "border-box",
30
+ width: workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.rail,
31
+ flex: `0 0 ${workspaceSidePaneGeometry_js_1.workspaceSidePaneMetrics.rail}px`,
32
+ display: "flex",
33
+ alignItems: "center",
34
+ flexDirection: "column",
35
+ gap: 8,
36
+ padding: "8px 0",
37
+ background: "var(--workspace-side-pane-rail-background, " + theme.palette.background.default + ")",
38
+ borderInline: "1px solid var(--workspace-side-pane-border, " + theme.palette.divider + ")",
39
+ minHeight: "100dvh",
40
+ },
41
+ "& .workspace-side-pane-group :is(button, [tabindex], summary):focus-visible": {
42
+ outline: "2px solid var(--workspace-side-pane-focus, " + theme.palette.primary.main + ")",
43
+ outlineOffset: -2,
44
+ },
45
+ "& .workspace-side-pane-resize": {
46
+ position: "absolute", left: -5, top: 0, bottom: 0, width: 10, zIndex: 2,
47
+ cursor: "ew-resize", touchAction: "none",
48
+ },
49
+ "& .workspace-side-pane-panel": {
50
+ boxSizing: "border-box",
51
+ width,
52
+ height: "100dvh",
53
+ maxHeight: `calc(100dvh - ${top})`,
54
+ background: "var(--workspace-side-pane-background, " + theme.palette.background.paper + ")",
55
+ display: "flex",
56
+ flexDirection: "column",
57
+ minWidth: 0,
58
+ minHeight: 0,
59
+ overflow: "hidden",
60
+ borderRight: "1px solid var(--workspace-side-pane-border, " + theme.palette.divider + ")",
61
+ },
62
+ "& .workspace-side-pane-backdrop": {
63
+ position: "fixed", inset: `${top} 0 0`, background: "rgba(0, 0, 0, 0.45)", zIndex: layer,
64
+ },
65
+ "&.workspace-side-pane-overlay .workspace-side-pane-group": {
66
+ position: "fixed", top, right: 0, bottom: 0, width: "max-content", maxWidth: "100%",
67
+ height: `calc(100dvh - ${top})`, minHeight: 0, zIndex: layer,
68
+ },
69
+ "&.workspace-side-pane-overlay :is(.workspace-side-pane-panel, .workspace-side-pane-rail)": {
70
+ height: "100%", maxHeight: "100%", minHeight: 0,
71
+ },
72
+ // Open/close animates the allocation. Explicit resizing responds immediately.
73
+ "& .workspace-side-pane-presence": { flex: "0 0 auto" },
74
+ "&.workspace-side-pane-direct-resize .workspace-side-pane-presence": {
75
+ transition: "none !important", width: `${width} !important`,
76
+ },
77
+ // A live motion preference change snaps the layout during an existing transition.
78
+ "&.workspace-side-pane-reduced-motion .workspace-side-pane-presence": {
79
+ transition: "none !important", width: "0 !important", overflow: "hidden !important",
80
+ },
81
+ "&.workspace-side-pane-reduced-motion.workspace-side-pane-open .workspace-side-pane-presence": {
82
+ width: `${width} !important`,
83
+ },
84
+ "&.workspace-side-pane-reduced-motion .workspace-side-pane-backdrop": {
85
+ transition: "none !important", opacity: "0 !important",
86
+ },
87
+ "&.workspace-side-pane-reduced-motion .workspace-side-pane-backdrop[data-active='true']": {
88
+ opacity: "1 !important",
89
+ },
90
+ "@media (max-width: 480px)": {
91
+ "& .workspace-side-pane-panel": { paddingBottom: "env(safe-area-inset-bottom)" },
92
+ },
93
+ }));
@@ -4,3 +4,4 @@ export { BottomDrawer } from "./BottomDrawer.js";
4
4
  export { ResponsiveDrawer } from "./ResponsiveDrawer.js";
5
5
  export { useVisualViewportBottomInset, getVisualViewportBottomInset, } from "./useVisualViewportBottomInset.js";
6
6
  export type { DrawerAppearance } from "./drawerAppearance.js";
7
+ export { WorkspaceSidePane, type WorkspaceSidePaneActions, type WorkspaceSidePaneProps, } from "./WorkspaceSidePane.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  "use client";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getVisualViewportBottomInset = exports.useVisualViewportBottomInset = exports.ResponsiveDrawer = exports.BottomDrawer = exports.MobileBottomDrawerHeader = exports.mobileBottomDrawerDismissDuration = exports.MobileBottomDrawer = void 0;
4
+ exports.WorkspaceSidePane = exports.getVisualViewportBottomInset = exports.useVisualViewportBottomInset = exports.ResponsiveDrawer = exports.BottomDrawer = exports.MobileBottomDrawerHeader = exports.mobileBottomDrawerDismissDuration = exports.MobileBottomDrawer = void 0;
5
5
  // TL-M249: preserve the established MUI presentation under its owning package.
6
6
  var MobileBottomDrawer_js_1 = require("./MobileBottomDrawer.js");
7
7
  Object.defineProperty(exports, "MobileBottomDrawer", { enumerable: true, get: function () { return MobileBottomDrawer_js_1.MobileBottomDrawer; } });
@@ -15,3 +15,5 @@ Object.defineProperty(exports, "ResponsiveDrawer", { enumerable: true, get: func
15
15
  var useVisualViewportBottomInset_js_1 = require("./useVisualViewportBottomInset.js");
16
16
  Object.defineProperty(exports, "useVisualViewportBottomInset", { enumerable: true, get: function () { return useVisualViewportBottomInset_js_1.useVisualViewportBottomInset; } });
17
17
  Object.defineProperty(exports, "getVisualViewportBottomInset", { enumerable: true, get: function () { return useVisualViewportBottomInset_js_1.getVisualViewportBottomInset; } });
18
+ var WorkspaceSidePane_js_1 = require("./WorkspaceSidePane.js");
19
+ Object.defineProperty(exports, "WorkspaceSidePane", { enumerable: true, get: function () { return WorkspaceSidePane_js_1.WorkspaceSidePane; } });
@@ -0,0 +1,11 @@
1
+ export declare const workspaceSidePaneMetrics: {
2
+ readonly rail: 56;
3
+ readonly initialPane: 384;
4
+ readonly minPane: 320;
5
+ readonly maxPane: 480;
6
+ readonly minCanvas: 640;
7
+ };
8
+ export declare function workspaceSidePaneGeometry(available: number, requested: number, workspaceInset?: number): {
9
+ overlay: boolean;
10
+ paneWidth: number;
11
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workspaceSidePaneMetrics = void 0;
4
+ exports.workspaceSidePaneGeometry = workspaceSidePaneGeometry;
5
+ exports.workspaceSidePaneMetrics = { rail: 56, initialPane: 384, minPane: 320, maxPane: 480, minCanvas: 640 };
6
+ function workspaceSidePaneGeometry(available, requested, workspaceInset = 0) {
7
+ const preferred = Math.min(exports.workspaceSidePaneMetrics.maxPane, Math.max(exports.workspaceSidePaneMetrics.minPane, requested));
8
+ const overlay = available < exports.workspaceSidePaneMetrics.minCanvas + workspaceInset + exports.workspaceSidePaneMetrics.rail + preferred;
9
+ return {
10
+ overlay,
11
+ paneWidth: Math.max(0, available < exports.workspaceSidePaneMetrics.minCanvas + workspaceInset + exports.workspaceSidePaneMetrics.rail
12
+ ? available - exports.workspaceSidePaneMetrics.rail
13
+ : Math.min(preferred, available - exports.workspaceSidePaneMetrics.rail)),
14
+ };
15
+ }
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ type DialogChoiceTileProps = {
3
+ label: string;
4
+ description?: ReactNode;
5
+ icon?: ReactNode;
6
+ selected: boolean;
7
+ autoFocus?: boolean;
8
+ } & ({
9
+ name: string;
10
+ disabled?: boolean;
11
+ onSelect: () => void;
12
+ onLockedClick?: never;
13
+ } | {
14
+ onLockedClick: () => void;
15
+ name?: never;
16
+ disabled?: never;
17
+ onSelect?: never;
18
+ });
19
+ export declare function DialogChoiceTile(props: DialogChoiceTileProps): import("react").JSX.Element;
20
+ export {};
@@ -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.DialogChoiceTile = DialogChoiceTile;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const CheckCircle_1 = __importDefault(require("@mui/icons-material/CheckCircle"));
10
+ const LockOutlined_1 = __importDefault(require("@mui/icons-material/LockOutlined"));
11
+ const material_1 = require("@mui/material");
12
+ function DialogChoiceTile(props) {
13
+ const { label, description, icon, selected, autoFocus } = props;
14
+ const sx = {
15
+ position: "relative",
16
+ display: "flex",
17
+ flexDirection: "column",
18
+ alignItems: icon ? "center" : "flex-start",
19
+ justifyContent: "center",
20
+ textAlign: icon ? "center" : "start",
21
+ gap: 0.5,
22
+ p: 1.5,
23
+ minWidth: 0,
24
+ minHeight: 80,
25
+ border: "1px solid",
26
+ borderColor: selected ? "success.main" : "divider",
27
+ borderRadius: 2,
28
+ backgroundColor: selected ? "action.selected" : "background.paper",
29
+ overflowWrap: "anywhere",
30
+ "&:hover": { backgroundColor: "action.hover" },
31
+ "&:has(input:focus-visible), &.Mui-focusVisible": {
32
+ outline: "2px solid",
33
+ outlineColor: "success.main",
34
+ outlineOffset: 2,
35
+ },
36
+ };
37
+ const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [selected || props.onLockedClick ? ((0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": true, sx: {
38
+ position: "absolute",
39
+ top: 8,
40
+ right: 8,
41
+ color: selected ? "success.main" : "text.secondary",
42
+ lineHeight: 0,
43
+ }, children: selected ? ((0, jsx_runtime_1.jsx)(CheckCircle_1.default, { fontSize: "small" })) : ((0, jsx_runtime_1.jsx)(LockOutlined_1.default, { fontSize: "small" })) })) : null, icon ? ((0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": true, sx: { lineHeight: 0 }, children: icon })) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { component: "span", variant: "subtitle2", sx: { pr: icon ? 0 : 3 }, children: label }), description ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { component: "span", variant: "body2", color: "text.secondary", children: description })) : null] }));
44
+ if (props.onLockedClick) {
45
+ return ((0, jsx_runtime_1.jsx)(material_1.ButtonBase, { "aria-label": label, "aria-haspopup": "dialog", autoFocus: autoFocus, onClick: props.onLockedClick, sx: sx, type: "button", children: content }));
46
+ }
47
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { component: "label", sx: {
48
+ ...sx,
49
+ cursor: props.disabled ? "default" : "pointer",
50
+ opacity: props.disabled ? 0.6 : 1,
51
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { component: "input", type: "radio", name: props.name, "aria-label": label, autoFocus: autoFocus, checked: selected, disabled: props.disabled, onChange: props.onSelect, sx: {
52
+ position: "absolute",
53
+ inset: 0,
54
+ opacity: 0,
55
+ width: "100%",
56
+ height: "100%",
57
+ m: 0,
58
+ cursor: "inherit",
59
+ } }), content] }));
60
+ }
@@ -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
+ }
@@ -1,2 +1,3 @@
1
1
  export { PricingTable } from "./PricingTable.js";
2
2
  export type { PricingTablePlan, PricingTableProps } from "./PricingTable.js";
3
+ export { PlanUpgradeDialog, type PlanUpgradeDialogProps, type UpgradePlan } from "./PlanUpgradeDialog.js";
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  "use client";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PricingTable = void 0;
4
+ exports.PlanUpgradeDialog = exports.PricingTable = void 0;
5
5
  var PricingTable_js_1 = require("./PricingTable.js");
6
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,13 @@
1
+ export type ImageUploadQuality = "compressed" | "high";
2
+ export type ImageUploadQualityDialogProps = {
3
+ file: File;
4
+ quality: ImageUploadQuality;
5
+ highQualityAccess: "available" | "locked" | "unavailable";
6
+ focusLockedChoice?: boolean;
7
+ hint?: string;
8
+ onQualityChange: (quality: ImageUploadQuality) => void;
9
+ onLockedChoice: () => void;
10
+ onClose: () => void;
11
+ onConfirm: () => void;
12
+ };
13
+ export declare function ImageUploadQualityDialog({ file, quality, highQualityAccess, focusLockedChoice, hint, onQualityChange, onLockedChoice, onClose, onConfirm, }: ImageUploadQualityDialogProps): import("react").JSX.Element;