@bayonai/mui-design 0.2.1 → 1.1.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 +50 -0
- package/README.md +108 -7
- package/dist/cjs/actions/ActionMenu.js +36 -0
- package/dist/cjs/actions/DialogActionButtons.js +33 -0
- package/dist/cjs/actions/LoadingIconButton.js +10 -0
- package/dist/cjs/actions/StickyActionFooter.js +27 -0
- package/dist/cjs/actions/StickySubmitButton.js +10 -0
- package/dist/cjs/actions/index.js +18 -0
- package/dist/cjs/client.js +1 -0
- package/dist/cjs/components/BayonFlowVisual.js +6 -6
- package/dist/cjs/components/BayonThemeModeToggle.js +34 -0
- package/dist/cjs/components/panels.js +7 -7
- package/dist/cjs/drawers/BottomDrawer.js +43 -0
- package/dist/cjs/drawers/MobileBottomDrawer.js +102 -0
- package/dist/cjs/drawers/MobileBottomDrawerHeader.js +36 -0
- package/dist/cjs/drawers/ResponsiveDrawer.js +22 -0
- package/dist/cjs/drawers/drawerAppearance.js +10 -0
- package/dist/cjs/drawers/index.js +17 -0
- package/dist/cjs/drawers/useVisualViewportBottomInset.js +33 -0
- package/dist/cjs/feedback/StatusNotice.js +62 -0
- package/dist/cjs/feedback/index.js +7 -0
- package/dist/cjs/links/LinkAddressPreview.js +80 -0
- package/dist/cjs/links/index.js +9 -0
- package/dist/cjs/links/useLinkAddressPreview.js +152 -0
- package/dist/cjs/pending/PendingChangesDialogShell.js +16 -0
- package/dist/cjs/pending/PendingChangesDialogView.js +126 -0
- package/dist/cjs/pending/PendingChangesIndicatorView.js +27 -0
- package/dist/cjs/pending/index.js +9 -0
- package/dist/cjs/pending/types.js +2 -0
- package/dist/cjs/providers/BayonThemeProvider.js +83 -4
- package/dist/cjs/sections/ExpandableSectionToggle.js +32 -0
- package/dist/cjs/sections/index.js +7 -0
- package/dist/cjs/styles/pageStyles.js +17 -17
- package/dist/cjs/swipe/SwipeActionRow.js +123 -0
- package/dist/cjs/swipe/index.js +8 -0
- package/dist/cjs/theme/components.js +60 -0
- package/dist/cjs/theme/createBayonTheme.js +23 -2
- package/dist/cjs/toasts/ActionToast.js +12 -0
- package/dist/cjs/toasts/Toast.js +55 -0
- package/dist/cjs/toasts/index.js +12 -0
- package/dist/cjs/toasts/useUpwardToastDismiss.js +73 -0
- package/dist/cjs/uploads/CameraCaptureDialog.js +187 -0
- package/dist/cjs/uploads/FileRow.js +23 -0
- package/dist/cjs/uploads/FileSwipeActionRow.js +11 -0
- package/dist/cjs/uploads/FileThumbnail.js +104 -0
- package/dist/cjs/uploads/FileUpload.js +98 -0
- package/dist/cjs/uploads/FileViewer.js +151 -0
- package/dist/cjs/uploads/ImageCropDialog.js +215 -0
- package/dist/cjs/uploads/UploadProgressRing.js +32 -0
- package/dist/cjs/uploads/cameraCropPresentation.js +12 -0
- package/dist/cjs/uploads/index.js +20 -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 +1 -0
- package/dist/esm/components/BayonFlowVisual.js +6 -6
- package/dist/esm/components/BayonThemeModeToggle.js +28 -0
- package/dist/esm/components/panels.js +7 -7
- 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/drawerAppearance.js +7 -0
- package/dist/esm/drawers/index.js +7 -0
- package/dist/esm/drawers/useVisualViewportBottomInset.js +29 -0
- package/dist/esm/feedback/StatusNotice.js +56 -0
- package/dist/esm/feedback/index.js +3 -0
- package/dist/esm/links/LinkAddressPreview.js +74 -0
- package/dist/esm/links/index.js +4 -0
- package/dist/esm/links/useLinkAddressPreview.js +149 -0
- package/dist/esm/pending/PendingChangesDialogShell.js +10 -0
- package/dist/esm/pending/PendingChangesDialogView.js +120 -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/providers/BayonThemeProvider.js +83 -5
- package/dist/esm/sections/ExpandableSectionToggle.js +26 -0
- package/dist/esm/sections/index.js +3 -0
- package/dist/esm/styles/pageStyles.js +17 -17
- package/dist/esm/swipe/SwipeActionRow.js +116 -0
- package/dist/esm/swipe/index.js +3 -0
- package/dist/esm/theme/components.js +60 -0
- package/dist/esm/theme/createBayonTheme.js +23 -2
- 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 +145 -0
- package/dist/esm/uploads/ImageCropDialog.js +212 -0
- package/dist/esm/uploads/UploadProgressRing.js +29 -0
- package/dist/esm/uploads/cameraCropPresentation.js +5 -0
- package/dist/esm/uploads/index.js +9 -0
- package/dist/types/actions/ActionMenu.d.ts +24 -0
- package/dist/types/actions/DialogActionButtons.d.ts +22 -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 +1 -0
- package/dist/types/components/BayonThemeModeToggle.d.ts +6 -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/drawerAppearance.d.ts +8 -0
- package/dist/types/drawers/index.d.ts +6 -0
- package/dist/types/drawers/useVisualViewportBottomInset.d.ts +6 -0
- package/dist/types/feedback/StatusNotice.d.ts +13 -0
- package/dist/types/feedback/index.d.ts +1 -0
- package/dist/types/links/LinkAddressPreview.d.ts +19 -0
- package/dist/types/links/index.d.ts +3 -0
- package/dist/types/links/useLinkAddressPreview.d.ts +24 -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 +48 -0
- package/dist/types/providers/BayonThemeProvider.d.ts +10 -1
- package/dist/types/sections/ExpandableSectionToggle.d.ts +12 -0
- package/dist/types/sections/index.d.ts +2 -0
- package/dist/types/swipe/SwipeActionRow.d.ts +8 -0
- package/dist/types/swipe/index.d.ts +1 -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/UploadProgressRing.d.ts +24 -0
- package/dist/types/uploads/cameraCropPresentation.d.ts +2 -0
- package/dist/types/uploads/index.d.ts +10 -0
- package/docs/camera-crop-contract.md +50 -0
- package/docs/uploads-contract.md +40 -0
- package/package.json +70 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@bayonai/mui-design` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 1.1.0 candidate - 2026-11-05
|
|
6
|
+
|
|
7
|
+
- Audit: thumbnail loaders handle synchronous failures with the existing fallback and show successful retries after an earlier failure.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `/uploads` now owns CameraCaptureDialog, ImageCropDialog and their labels/props,
|
|
12
|
+
relocated unchanged apart from imports from `@bayonai/file-uploads/react`.
|
|
13
|
+
Camera/crop presentation delegates to shared actions and feedback; preserved
|
|
14
|
+
browser behavior suites and the camera/crop ownership contract accompany them.
|
|
15
|
+
|
|
16
|
+
- Preserved MUI application primitives from `@bayonai/ui` through additive
|
|
17
|
+
`/actions`, `/drawers`, `/feedback`, `/links`, `/pending`, `/sections`, `/swipe`,
|
|
18
|
+
and `/toasts` exports, with independent local helpers and ESM/CommonJS/types.
|
|
19
|
+
- Preserved behavior regression tests under `tests/` for release verification.
|
|
20
|
+
- Explicit client boundaries for all new React component entry points.
|
|
21
|
+
- `/uploads` preserves FileUpload, FileRow, FileThumbnail, FileViewer and
|
|
22
|
+
UploadProgressRing, with copied lifecycle/safety tests and host-theme coverage.
|
|
23
|
+
Its private swipe adapter reuses the shared MUI row without gesture duplication.
|
|
24
|
+
- Optional `@bayonai/file-uploads@^0.2.0` peer supplies neutral UploadFile/LoadFile
|
|
25
|
+
contracts and the React-only `/hooks` upload lock; uploads reexports them.
|
|
26
|
+
|
|
27
|
+
### Migration
|
|
28
|
+
|
|
29
|
+
- Replace `@bayonai/file-uploads/react` camera/crop imports with
|
|
30
|
+
`@bayonai/mui-design/uploads` when adopting the paired unpublished candidates.
|
|
31
|
+
The neutral file-uploads 0.2.0 candidate removes `/react`; geometry and crop
|
|
32
|
+
types remain in its root entry. Keep callbacks, props and host providers.
|
|
33
|
+
Local development uses `bayonai-file-uploads-0.2.0-neutral.tgz`.
|
|
34
|
+
|
|
35
|
+
- Applications retaining the existing MUI presentation should replace only the
|
|
36
|
+
package prefix for these subpaths after this candidate is published and
|
|
37
|
+
verified. Existing names, props, `sx`, callbacks, and interactions are retained.
|
|
38
|
+
- Existing theme and `/client` exports are unchanged. Upload/file widgets move
|
|
39
|
+
from `@bayonai/ui/uploads` to `@bayonai/mui-design/uploads`; lightbox and scroll
|
|
40
|
+
remain with their existing owners. Install file-uploads 0.2.0 for uploads.
|
|
41
|
+
- External consumers retain exact current versions until both candidates are
|
|
42
|
+
published and verified. Packed ESM/CommonJS/types, preserved upload and swipe
|
|
43
|
+
behavior, theme-provider overrides and affected consumers gate publication.
|
|
44
|
+
No `file-uploads/mui` entry or deployment is introduced.
|
|
45
|
+
- Candidate only: publication is controlled manually by the package owner.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Raised the Material UI peer range to 9.2 and removed the unused Pigment CSS peer requirement; the package continues to use its existing Emotion provider and public API.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- Replaced effect-driven theme initialization with an external-store subscription so saved mode changes remain hydration-safe, cross-tab aware, and compatible with React's effect rules.
|
|
54
|
+
|
|
5
55
|
## 0.2.1 - 2026-06-09
|
|
6
56
|
|
|
7
57
|
### Fixed
|
package/README.md
CHANGED
|
@@ -7,17 +7,17 @@ Published package: [@bayonai/mui-design on npm](https://www.npmjs.com/package/@b
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @bayonai/mui-design @mui/material @mui/icons-material @
|
|
10
|
+
npm install @bayonai/mui-design @mui/material @mui/icons-material @emotion/react @emotion/styled @emotion/cache react react-dom
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The MUI 9,
|
|
13
|
+
The MUI 9, Emotion, React, and React DOM packages are peer dependencies so each consuming website controls its own app runtime. The package uses the Emotion theme path and does not require Pigment CSS.
|
|
14
14
|
|
|
15
15
|
## Provider
|
|
16
16
|
|
|
17
17
|
Provider and icon-button helpers are client-only exports:
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
|
-
import { BayonThemeProvider } from
|
|
20
|
+
import { BayonThemeProvider } from "@bayonai/mui-design/client";
|
|
21
21
|
|
|
22
22
|
export function App({ children }: { children: React.ReactNode }) {
|
|
23
23
|
return <BayonThemeProvider>{children}</BayonThemeProvider>;
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
BayonCtaPanel,
|
|
36
36
|
mutedTextSx,
|
|
37
37
|
tealButtonSx,
|
|
38
|
-
} from
|
|
38
|
+
} from "@bayonai/mui-design";
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Use the exported theme tokens and `sx` recipes as the single source of truth for Bayon surfaces, panels, buttons, and page shells.
|
|
@@ -57,12 +57,12 @@ Available shared surfaces include `BayonPageShell`, `BayonGradientHero`, `BayonD
|
|
|
57
57
|
## Icon Buttons
|
|
58
58
|
|
|
59
59
|
```tsx
|
|
60
|
-
import SearchIcon from
|
|
61
|
-
import { IconTooltipButton } from
|
|
60
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
61
|
+
import { IconTooltipButton } from "@bayonai/mui-design/client";
|
|
62
62
|
|
|
63
63
|
<IconTooltipButton label="Search">
|
|
64
64
|
<SearchIcon />
|
|
65
|
-
</IconTooltipButton
|
|
65
|
+
</IconTooltipButton>;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
## Local Development
|
|
@@ -85,3 +85,104 @@ The main website consumes this package through the local npm workspace while the
|
|
|
85
85
|
```bash
|
|
86
86
|
npm publish --workspace @bayonai/mui-design
|
|
87
87
|
```
|
|
88
|
+
|
|
89
|
+
## Preserved application primitives (1.1.0 candidate)
|
|
90
|
+
|
|
91
|
+
TL-M249 makes this package the owner of the existing MUI presentation previously
|
|
92
|
+
exported by `@bayonai/ui`. The additive client subpaths are `actions`, `drawers`,
|
|
93
|
+
`feedback`, `links`, `pending`, `sections`, `swipe`, and `toasts`. They preserve the
|
|
94
|
+
existing component names, props (including `sx`), event behavior, accessibility,
|
|
95
|
+
viewport helpers, and dismissal thresholds. They require the existing MUI,
|
|
96
|
+
Emotion, React, and React DOM peers, and do not depend on `@bayonai/ui`.
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { ActionMenu, StickySubmitButton } from "@bayonai/mui-design/actions";
|
|
100
|
+
import { ResponsiveDrawer } from "@bayonai/mui-design/drawers";
|
|
101
|
+
import { StatusNotice } from "@bayonai/mui-design/feedback";
|
|
102
|
+
import { useLinkAddressPreview } from "@bayonai/mui-design/links";
|
|
103
|
+
import { PendingChangesDialogView } from "@bayonai/mui-design/pending";
|
|
104
|
+
import { ExpandableSectionToggle } from "@bayonai/mui-design/sections";
|
|
105
|
+
import { SwipeActionRow } from "@bayonai/mui-design/swipe";
|
|
106
|
+
import { ActionToast } from "@bayonai/mui-design/toasts";
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For an application retaining its current MUI appearance, change only the package
|
|
110
|
+
prefix on these imports from `@bayonai/ui/` to `@bayonai/mui-design/` after the
|
|
111
|
+
owner publishes and verifies this candidate. Keep host providers and component
|
|
112
|
+
props unchanged. The root theme exports and existing `/client` exports remain
|
|
113
|
+
unchanged; the new components are available through their explicit subpaths.
|
|
114
|
+
Each subpath has ESM, CommonJS, and declaration outputs and a client boundary.
|
|
115
|
+
|
|
116
|
+
TL-M250 additionally moves file widgets to the client-only `@bayonai/mui-design/uploads`
|
|
117
|
+
entry. It exports `FileUpload`, `FileRow`, `FileThumbnail`, `FileViewer`,
|
|
118
|
+
`UploadProgressRing`, `UploadProgressRingProps`, and compatibility reexports
|
|
119
|
+
`UploadFile`, `LoadFile`, and `useUploadLock`. Existing props and host MUI theme
|
|
120
|
+
context are retained. The private file swipe adapter delegates `/swipe` with
|
|
121
|
+
identical delete colors, spacing, gesture thresholds, easing and reduced-motion
|
|
122
|
+
behavior. Lightbox and scroll utilities keep their existing owners.
|
|
123
|
+
|
|
124
|
+
Uploads consumers must install exact `@bayonai/file-uploads@0.2.0` (an optional peer for
|
|
125
|
+
applications using other MUI entries). Neutral contracts belong to
|
|
126
|
+
`@bayonai/file-uploads`; React-only locking belongs to
|
|
127
|
+
`@bayonai/file-uploads/hooks`. No `file-uploads/mui` entry is introduced.
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import {
|
|
131
|
+
FileUpload,
|
|
132
|
+
FileRow,
|
|
133
|
+
FileThumbnail,
|
|
134
|
+
FileViewer,
|
|
135
|
+
UploadProgressRing,
|
|
136
|
+
} from "@bayonai/mui-design/uploads";
|
|
137
|
+
import type { UploadFile, LoadFile } from "@bayonai/file-uploads";
|
|
138
|
+
import { useUploadLock } from "@bayonai/file-uploads/hooks";
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
External consumers including Thunderlist must keep their exact existing package
|
|
142
|
+
versions until the owner publishes and verifies file-uploads 0.2.0 and mui-design
|
|
143
|
+
1.1.0 together. Then install those versions and replace `@bayonai/ui/uploads`
|
|
144
|
+
imports using the mapping above; compatibility type/hook exports also allow a
|
|
145
|
+
single prefix replacement. Keep host providers, callbacks and props unchanged.
|
|
146
|
+
The local development dependency uses `vendor/bayonai-file-uploads-0.2.0-neutral.tgz`.
|
|
147
|
+
Release gates include packed ESM/CommonJS/types imports, copied upload lifecycle,
|
|
148
|
+
security, loading, cancellation and download tests, shared swipe regressions,
|
|
149
|
+
host-theme overrides and affected consumer verification. No publication or
|
|
150
|
+
deployment is authorized by this relocation.
|
|
151
|
+
|
|
152
|
+
Behavior regression snapshots are in `tests/`, outside the declaration/build
|
|
153
|
+
source tree. They retain the source package's Vitest and React test renderer
|
|
154
|
+
contracts; release verification must supply those test dependencies and run the
|
|
155
|
+
preserved suite as well as build, typecheck, packed ESM/CommonJS import checks,
|
|
156
|
+
and affected consumer checks in the designated fresh verification context.
|
|
157
|
+
Version `1.1.0` is a local release candidate; this work does not publish it.
|
|
158
|
+
|
|
159
|
+
The [upload ownership contract](docs/uploads-contract.md) records preserved flow,
|
|
160
|
+
swipe equivalence and linked behavioral coverage.
|
|
161
|
+
|
|
162
|
+
### Package behavior tests
|
|
163
|
+
|
|
164
|
+
Run `npm test --workspace @bayonai/mui-design` from the owner repository. The package Vitest configuration runs the preserved generic and upload suites against source with one React runtime, including host theme-provider overrides. Install the checked-in development archive for file-uploads before building/testing; production consumers of uploads explicitly install file-uploads 0.2.0 alongside their MUI/React peers.
|
|
165
|
+
|
|
166
|
+
### Camera and crop dialogs (TL-M251)
|
|
167
|
+
|
|
168
|
+
`CameraCaptureDialog`, `ImageCropDialog`, `CameraCaptureDialogProps`,
|
|
169
|
+
`ImageCropDialogProps`, `CameraCaptureLabels`, and `ImageCropLabels` now belong to
|
|
170
|
+
`@bayonai/mui-design/uploads`. Replace imports from
|
|
171
|
+
`@bayonai/file-uploads/react` with this entry when adopting the paired candidates.
|
|
172
|
+
Keep existing props, callbacks and host MUI providers unchanged. The neutral
|
|
173
|
+
file-uploads 0.2.0 candidate removes its old `/react` presentation entry; crop
|
|
174
|
+
geometry and `ImageCrop` remain at `@bayonai/file-uploads` and upload locking
|
|
175
|
+
remains at `@bayonai/file-uploads/hooks`.
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { CameraCaptureDialog, ImageCropDialog } from "@bayonai/mui-design/uploads";
|
|
179
|
+
import type { CameraCaptureLabels, ImageCropDialogProps } from "@bayonai/mui-design/uploads";
|
|
180
|
+
import type { ImageCrop } from "@bayonai/file-uploads";
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The dialogs preserve camera permission/fallback handling, stale-operation fences,
|
|
184
|
+
resource cleanup, preview URLs, accessible labels and pointer crop framing. Their
|
|
185
|
+
private presentation shim reuses the canonical MUI action and feedback components.
|
|
186
|
+
See the [camera/crop contract](docs/camera-crop-contract.md) for ownership,
|
|
187
|
+
migration and the preserved behavioral suites. The version remains unpublished
|
|
188
|
+
1.1.0; adoption requires owner-controlled paired publication and verification.
|
|
@@ -0,0 +1,36 @@
|
|
|
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.ActionMenu = ActionMenu;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const MoreHoriz_1 = __importDefault(require("@mui/icons-material/MoreHoriz"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const LoadingIconButton_js_1 = require("./LoadingIconButton.js");
|
|
13
|
+
/** A compact, grouped action menu with an optional in-flight trigger state. */
|
|
14
|
+
function ActionMenu({ actionColorSx, actions, buttonSx, containerSx, disabled = false, label = "Actions", loading = false, loadingLabel = `${label} loading`, size = "small", }) {
|
|
15
|
+
const menuId = (0, react_1.useId)();
|
|
16
|
+
const [anchorElement, setAnchorElement] = (0, react_1.useState)(null);
|
|
17
|
+
const open = Boolean(anchorElement);
|
|
18
|
+
function handleAction(action) {
|
|
19
|
+
setAnchorElement(null);
|
|
20
|
+
action.onClick();
|
|
21
|
+
}
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: loading ? loadingLabel : label, children: (0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: containerSx, children: (0, jsx_runtime_1.jsx)(LoadingIconButton_js_1.LoadingIconButton, { "aria-controls": open ? menuId : undefined, "aria-expanded": open ? "true" : undefined, "aria-haspopup": "menu", "aria-label": label, disabled: disabled, loading: loading, loadingLabel: loadingLabel, onClick: (event) => setAnchorElement(event.currentTarget), size: size, sx: buttonSx, children: (0, jsx_runtime_1.jsx)(MoreHoriz_1.default, { fontSize: size === "large" ? "medium" : "small" }) }) }) }), (0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorElement, anchorOrigin: { horizontal: "right", vertical: "bottom" }, disableScrollLock: true, id: menuId, onClose: () => setAnchorElement(null), open: open, transformOrigin: { horizontal: "right", vertical: "top" }, children: actions.map((action, index) => {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [action.section &&
|
|
25
|
+
action.section !== ((_a = actions[index - 1]) === null || _a === void 0 ? void 0 : _a.section) ? ((0, jsx_runtime_1.jsx)(material_1.ListSubheader, { children: action.section })) : null, (0, jsx_runtime_1.jsxs)(material_1.MenuItem, { disabled: action.disabled, onClick: () => handleAction(action), sx: (_c = actionColorSx === null || actionColorSx === void 0 ? void 0 : actionColorSx[(_b = action.color) !== null && _b !== void 0 ? _b : "default"]) !== null && _c !== void 0 ? _c : getDefaultActionColorSx(action.color), children: [action.icon ? (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: action.icon }) : null, action.label] })] }, `${(_d = action.section) !== null && _d !== void 0 ? _d : "default"}:${action.label}`));
|
|
26
|
+
}) })] }));
|
|
27
|
+
}
|
|
28
|
+
function getDefaultActionColorSx(color) {
|
|
29
|
+
if (color === "primary")
|
|
30
|
+
return { color: "primary.main" };
|
|
31
|
+
if (color === "secondary")
|
|
32
|
+
return { color: "secondary.main" };
|
|
33
|
+
if (color === "error")
|
|
34
|
+
return { color: "error.main" };
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.compactDialogPaperSx = void 0;
|
|
8
|
+
exports.DialogActionButtons = DialogActionButtons;
|
|
9
|
+
exports.DialogActionProgress = DialogActionProgress;
|
|
10
|
+
exports.DialogCloseButton = DialogCloseButton;
|
|
11
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
+
const Check_1 = __importDefault(require("@mui/icons-material/Check"));
|
|
13
|
+
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
14
|
+
const material_1 = require("@mui/material");
|
|
15
|
+
// Product decision: concise decisions/info fit content above a readable 320px floor.
|
|
16
|
+
// Keep MUI's readable maxWidth/viewport cap; forms and previews own their sizing.
|
|
17
|
+
exports.compactDialogPaperSx = {
|
|
18
|
+
width: "fit-content",
|
|
19
|
+
// Preserve MUI's 32px margins even when the viewport is narrower than the floor.
|
|
20
|
+
minWidth: "min(320px, calc(100% - 64px))",
|
|
21
|
+
overflowWrap: "anywhere",
|
|
22
|
+
};
|
|
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, {}) }) }) }) }) }));
|
|
26
|
+
}
|
|
27
|
+
function DialogActionProgress() {
|
|
28
|
+
return (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 });
|
|
29
|
+
}
|
|
30
|
+
function DialogCloseButton({ disabled = false, label = "Close", onClose, sx, }) {
|
|
31
|
+
// Product decision: dismissible dialogs have one close action in the title's top-right corner.
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, { sx: { position: "absolute", right: 16, top: 16, ...sx }, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: label, children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": label, disabled: disabled, onClick: onClose, size: "small", type: "button", children: (0, jsx_runtime_1.jsx)(Close_1.default, { fontSize: "small" }) }) }) }) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LoadingIconButton = LoadingIconButton;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
/** Keeps an icon action's footprint while making an in-flight request visible. */
|
|
8
|
+
function LoadingIconButton({ "aria-label": ariaLabel, children, disabled, loading = false, loadingLabel, spinnerSize = 20, ...props }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(material_1.IconButton, { ...props, "aria-busy": loading || undefined, "aria-label": loading ? loadingLabel : ariaLabel, disabled: disabled || loading, children: loading ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { "aria-label": loadingLabel, color: "inherit", size: spinnerSize })) : (children) }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.StickyActionFooter = StickyActionFooter;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
/**
|
|
8
|
+
* Keeps the final actions of a long, scrollable form in view.
|
|
9
|
+
*
|
|
10
|
+
* Product decision: this component owns local sticky positioning and neutral
|
|
11
|
+
* footer chrome only. The host owns its scroll container, any edge-to-edge
|
|
12
|
+
* bleed required by a padded surface, action layout, and form submission.
|
|
13
|
+
*/
|
|
14
|
+
function StickyActionFooter({ children, sx }) {
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "footer", "data-component": "sticky-action-footer", sx: {
|
|
16
|
+
backgroundColor: "background.paper",
|
|
17
|
+
borderColor: "divider",
|
|
18
|
+
borderTop: 1,
|
|
19
|
+
bottom: 0,
|
|
20
|
+
mt: 1,
|
|
21
|
+
p: 2,
|
|
22
|
+
position: "sticky",
|
|
23
|
+
// Local stacking keeps the footer above fields without escaping its form.
|
|
24
|
+
zIndex: 1,
|
|
25
|
+
...sx,
|
|
26
|
+
}, children: children }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.StickySubmitButton = StickySubmitButton;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const StickyActionFooter_js_1 = require("./StickyActionFooter.js");
|
|
8
|
+
function StickySubmitButton({ buttonSx, disabled = false, footerSx, label = "Save", loading = false, variant = "contained", }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(StickyActionFooter_js_1.StickyActionFooter, { sx: footerSx, children: (0, jsx_runtime_1.jsx)(material_1.Button, { color: "secondary", disabled: disabled, fullWidth: true, loading: loading, sx: { minHeight: 44, ...buttonSx }, type: "submit", variant: variant, children: label }) }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DialogCloseButton = exports.DialogActionProgress = exports.DialogActionButtons = exports.compactDialogPaperSx = exports.StickySubmitButton = exports.StickyActionFooter = exports.LoadingIconButton = exports.ActionMenu = void 0;
|
|
5
|
+
// TL-M249: preserve the established MUI presentation under its owning package.
|
|
6
|
+
var ActionMenu_js_1 = require("./ActionMenu.js");
|
|
7
|
+
Object.defineProperty(exports, "ActionMenu", { enumerable: true, get: function () { return ActionMenu_js_1.ActionMenu; } });
|
|
8
|
+
var LoadingIconButton_js_1 = require("./LoadingIconButton.js");
|
|
9
|
+
Object.defineProperty(exports, "LoadingIconButton", { enumerable: true, get: function () { return LoadingIconButton_js_1.LoadingIconButton; } });
|
|
10
|
+
var StickyActionFooter_js_1 = require("./StickyActionFooter.js");
|
|
11
|
+
Object.defineProperty(exports, "StickyActionFooter", { enumerable: true, get: function () { return StickyActionFooter_js_1.StickyActionFooter; } });
|
|
12
|
+
var StickySubmitButton_js_1 = require("./StickySubmitButton.js");
|
|
13
|
+
Object.defineProperty(exports, "StickySubmitButton", { enumerable: true, get: function () { return StickySubmitButton_js_1.StickySubmitButton; } });
|
|
14
|
+
var DialogActionButtons_js_1 = require("./DialogActionButtons.js");
|
|
15
|
+
Object.defineProperty(exports, "compactDialogPaperSx", { enumerable: true, get: function () { return DialogActionButtons_js_1.compactDialogPaperSx; } });
|
|
16
|
+
Object.defineProperty(exports, "DialogActionButtons", { enumerable: true, get: function () { return DialogActionButtons_js_1.DialogActionButtons; } });
|
|
17
|
+
Object.defineProperty(exports, "DialogActionProgress", { enumerable: true, get: function () { return DialogActionButtons_js_1.DialogActionProgress; } });
|
|
18
|
+
Object.defineProperty(exports, "DialogCloseButton", { enumerable: true, get: function () { return DialogActionButtons_js_1.DialogCloseButton; } });
|
package/dist/cjs/client.js
CHANGED
|
@@ -17,4 +17,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
__exportStar(require("./components/IconTooltipButton.js"), exports);
|
|
19
19
|
__exportStar(require("./components/BayonFlowVisual.js"), exports);
|
|
20
|
+
__exportStar(require("./components/BayonThemeModeToggle.js"), exports);
|
|
20
21
|
__exportStar(require("./providers/BayonThemeProvider.js"), exports);
|
|
@@ -35,10 +35,10 @@ const defaultItems = [
|
|
|
35
35
|
function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system design -> production app', sx, ...props }) {
|
|
36
36
|
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { "aria-hidden": "true", sx: mergeSx({
|
|
37
37
|
minHeight: { xs: 320, md: 520 },
|
|
38
|
-
border: '1px solid
|
|
38
|
+
border: '1px solid var(--bayon-border-strong)',
|
|
39
39
|
borderRadius: 2,
|
|
40
|
-
bgcolor: '
|
|
41
|
-
boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0
|
|
40
|
+
bgcolor: 'var(--bayon-panel-solid)',
|
|
41
|
+
boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 var(--bayon-border)',
|
|
42
42
|
p: { xs: 3, md: 4 },
|
|
43
43
|
display: 'grid',
|
|
44
44
|
gridTemplateRows: 'auto 1fr auto',
|
|
@@ -72,8 +72,8 @@ function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system de
|
|
|
72
72
|
},
|
|
73
73
|
}, children: items.map((item, index) => ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: {
|
|
74
74
|
borderRadius: 2,
|
|
75
|
-
border: '1px solid
|
|
76
|
-
bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : '
|
|
75
|
+
border: '1px solid var(--bayon-border)',
|
|
76
|
+
bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'var(--bayon-grid-line)',
|
|
77
77
|
p: 2.5,
|
|
78
78
|
display: 'flex',
|
|
79
79
|
flexDirection: 'column',
|
|
@@ -83,5 +83,5 @@ function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system de
|
|
|
83
83
|
'@media (prefers-reduced-motion: reduce)': {
|
|
84
84
|
animation: 'none',
|
|
85
85
|
},
|
|
86
|
-
}, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '
|
|
86
|
+
}, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-fg)', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-muted)', fontSize: '0.95rem' }, children: caption })] }));
|
|
87
87
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.BayonThemeModeToggle = BayonThemeModeToggle;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const DarkMode_1 = __importDefault(require("@mui/icons-material/DarkMode"));
|
|
10
|
+
const LightMode_1 = __importDefault(require("@mui/icons-material/LightMode"));
|
|
11
|
+
const BayonThemeProvider_js_1 = require("../providers/BayonThemeProvider.js");
|
|
12
|
+
const IconTooltipButton_js_1 = require("./IconTooltipButton.js");
|
|
13
|
+
function mergeSx(...items) {
|
|
14
|
+
return items.flat().filter(Boolean);
|
|
15
|
+
}
|
|
16
|
+
function BayonThemeModeToggle({ sx }) {
|
|
17
|
+
const { mode, toggleMode } = (0, BayonThemeProvider_js_1.useBayonThemeMode)();
|
|
18
|
+
const nextMode = mode === 'dark' ? 'light' : 'dark';
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(IconTooltipButton_js_1.IconTooltipButton, { label: `Switch to ${nextMode} mode`, onClick: toggleMode, sx: mergeSx({
|
|
20
|
+
color: 'var(--bayon-fg)',
|
|
21
|
+
border: '1px solid var(--bayon-border)',
|
|
22
|
+
bgcolor: 'var(--bayon-panel)',
|
|
23
|
+
transition: 'border-color 180ms ease, background-color 180ms ease, color 180ms ease',
|
|
24
|
+
'&:hover': {
|
|
25
|
+
bgcolor: 'rgba(45, 212, 191, 0.12)',
|
|
26
|
+
borderColor: 'var(--bayon-link-hover)',
|
|
27
|
+
color: 'var(--bayon-link-hover)',
|
|
28
|
+
},
|
|
29
|
+
'&:focus-visible': {
|
|
30
|
+
outline: '2px solid rgba(45, 212, 191, 0.52)',
|
|
31
|
+
outlineOffset: 3,
|
|
32
|
+
},
|
|
33
|
+
}, sx), children: mode === 'dark' ? (0, jsx_runtime_1.jsx)(LightMode_1.default, { fontSize: "small" }) : (0, jsx_runtime_1.jsx)(DarkMode_1.default, { fontSize: "small" }) }));
|
|
34
|
+
}
|
|
@@ -40,9 +40,9 @@ function BayonCtaPanel({ sx, ...props }) {
|
|
|
40
40
|
function BayonContentBox({ sx, ...props }) {
|
|
41
41
|
return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: mergeSx({
|
|
42
42
|
p: { xs: 3, md: 4 },
|
|
43
|
-
border: '1px solid
|
|
43
|
+
border: '1px solid var(--bayon-border)',
|
|
44
44
|
borderRadius: 2,
|
|
45
|
-
bgcolor: '
|
|
45
|
+
bgcolor: 'var(--bayon-panel)',
|
|
46
46
|
}, sx), ...props }));
|
|
47
47
|
}
|
|
48
48
|
function BayonMethodBox({ accentColor = '#2DD4BF', sx, ...props }) {
|
|
@@ -57,21 +57,21 @@ function BayonProjectCard({ category, status, title, body, actions, children, ho
|
|
|
57
57
|
minHeight: 290,
|
|
58
58
|
display: 'flex',
|
|
59
59
|
flexDirection: 'column',
|
|
60
|
-
}, sx), ...props, children: [category && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h5", sx: { color: '
|
|
60
|
+
}, sx), ...props, children: [category && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h5", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
|
|
61
61
|
}
|
|
62
62
|
function BayonPillarCard({ accentColor = '#2DD4BF', eyebrow, title, body, actions, children, sx, ...props }) {
|
|
63
63
|
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: mergeSx({
|
|
64
64
|
p: { xs: 3, md: 5 },
|
|
65
|
-
border: '1px solid
|
|
65
|
+
border: '1px solid var(--bayon-border)',
|
|
66
66
|
borderRadius: 2,
|
|
67
|
-
bgcolor: '
|
|
68
|
-
boxShadow: '
|
|
67
|
+
bgcolor: 'var(--bayon-panel)',
|
|
68
|
+
boxShadow: 'var(--bayon-panel-shadow)',
|
|
69
69
|
transition: 'transform 180ms ease, border-color 180ms ease',
|
|
70
70
|
'&:hover': {
|
|
71
71
|
transform: 'translateY(-5px)',
|
|
72
72
|
borderColor: accentColor,
|
|
73
73
|
},
|
|
74
|
-
}, sx), ...props, children: [eyebrow && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h3", sx: { color: '
|
|
74
|
+
}, sx), ...props, children: [eyebrow && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h3", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75 }, children: body }), children, actions] }));
|
|
75
75
|
}
|
|
76
76
|
function BayonTechChip({ label, children, sx, ...props }) {
|
|
77
77
|
return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: mergeSx({
|
|
@@ -0,0 +1,43 @@
|
|
|
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.BottomDrawer = BottomDrawer;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const drawerAppearance_js_1 = require("./drawerAppearance.js");
|
|
12
|
+
function BottomDrawer({ children, appearance = drawerAppearance_js_1.defaultDrawerAppearance, closeTooltip, closeLabel, contentSx, dataComponent, disablePortal = false, headerActions, onClose, open, title, }) {
|
|
13
|
+
const paperSlotProps = {
|
|
14
|
+
"data-component": dataComponent,
|
|
15
|
+
sx: {
|
|
16
|
+
bgcolor: appearance.background,
|
|
17
|
+
borderRadius: "16px 16px 0 0",
|
|
18
|
+
boxShadow: appearance.shadow,
|
|
19
|
+
maxHeight: "calc(100dvh - 24px)",
|
|
20
|
+
width: "100%",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Drawer, { anchor: "bottom",
|
|
24
|
+
// Portal ownership belongs to the host because route slots and stacking
|
|
25
|
+
// containers are application concerns rather than drawer presentation.
|
|
26
|
+
ModalProps: { disablePortal }, onClose: onClose, open: open, slotProps: { paper: paperSlotProps }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
borderBottom: 1,
|
|
29
|
+
borderColor: "divider",
|
|
30
|
+
display: "flex",
|
|
31
|
+
flex: "0 0 auto",
|
|
32
|
+
gap: 1,
|
|
33
|
+
minHeight: 64,
|
|
34
|
+
px: 2.5,
|
|
35
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", sx: { flex: 1, fontWeight: 760 }, children: title }), headerActions ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { alignItems: "center", display: "flex" }, children: headerActions })) : null, (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: closeTooltip !== null && closeTooltip !== void 0 ? closeTooltip : "", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": closeLabel, onClick: onClose, sx: {
|
|
36
|
+
minHeight: 40,
|
|
37
|
+
minWidth: 40,
|
|
38
|
+
"& > .MuiSvgIcon-root": { fontSize: 28 },
|
|
39
|
+
}, children: (0, jsx_runtime_1.jsx)(CloseRounded_1.default, {}) }) })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: [
|
|
40
|
+
{ flex: 1, minHeight: 0, overflowY: "auto" },
|
|
41
|
+
...(Array.isArray(contentSx) ? contentSx : [contentSx]),
|
|
42
|
+
], children: children })] }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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.mobileBottomDrawerDismissDuration = void 0;
|
|
8
|
+
exports.MobileBottomDrawer = MobileBottomDrawer;
|
|
9
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const SwipeableDrawer_1 = __importDefault(require("@mui/material/SwipeableDrawer"));
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const drawerAppearance_js_1 = require("./drawerAppearance.js");
|
|
14
|
+
const MobileBottomDrawerHeader_js_1 = require("./MobileBottomDrawerHeader.js");
|
|
15
|
+
exports.mobileBottomDrawerDismissDuration = 220;
|
|
16
|
+
function MobileBottomDrawer({ ariaLabel, appearance = drawerAppearance_js_1.defaultDrawerAppearance, closeTooltip, children, contentScrollMode = "container", dataComponent, dismiss = false, handleBackground = "default", handlePlacement = "above-content", headerLeft, headerRight, maxHeight = "calc(100dvh - 24px)", onClose, }) {
|
|
17
|
+
const dismissTimer = (0, react_1.useRef)(null);
|
|
18
|
+
const [open, setOpen] = (0, react_1.useState)(true);
|
|
19
|
+
(0, react_1.useEffect)(() => () => {
|
|
20
|
+
if (dismissTimer.current) {
|
|
21
|
+
clearTimeout(dismissTimer.current);
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
const requestClose = (0, react_1.useCallback)(() => {
|
|
25
|
+
if (!open || dismissTimer.current) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
setOpen(false);
|
|
29
|
+
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
30
|
+
dismissTimer.current = setTimeout(onClose, prefersReducedMotion ? 0 : exports.mobileBottomDrawerDismissDuration);
|
|
31
|
+
}, [onClose, open]);
|
|
32
|
+
// Product decision: nested dialogs may layer over a retained drawer; the host
|
|
33
|
+
// decides whether closing that dialog also closes its underlying context.
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
if (!dismiss || !open) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
39
|
+
dismissTimer.current = setTimeout(onClose, prefersReducedMotion ? 0 : exports.mobileBottomDrawerDismissDuration);
|
|
40
|
+
return () => {
|
|
41
|
+
if (dismissTimer.current) {
|
|
42
|
+
clearTimeout(dismissTimer.current);
|
|
43
|
+
dismissTimer.current = null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}, [dismiss, onClose, open]);
|
|
47
|
+
const paperSlotProps = {
|
|
48
|
+
"aria-label": ariaLabel,
|
|
49
|
+
"data-component": dataComponent !== null && dataComponent !== void 0 ? dataComponent : "mobile-bottom-drawer",
|
|
50
|
+
sx: {
|
|
51
|
+
backgroundColor: appearance.background,
|
|
52
|
+
borderRadius: "16px 16px 0 0",
|
|
53
|
+
bottom: 0,
|
|
54
|
+
boxShadow: appearance.shadow,
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
height: maxHeight,
|
|
58
|
+
maxHeight,
|
|
59
|
+
overflow: "hidden",
|
|
60
|
+
overscrollBehaviorY: "contain",
|
|
61
|
+
width: "100%",
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const drawerHandle = ((0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": true, "data-component": "mobile-bottom-drawer-handle", "data-placement": handlePlacement, "data-swipe-surface": "drawer", sx: {
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
bgcolor: handleBackground === "detailChrome"
|
|
67
|
+
? appearance.chrome
|
|
68
|
+
: "transparent",
|
|
69
|
+
display: "flex",
|
|
70
|
+
flex: "0 0 auto",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
minHeight: 44,
|
|
73
|
+
// Product decision: header actions sit above this visual handle while
|
|
74
|
+
// MUI SwipeableDrawer owns a natural pull-down gesture across the
|
|
75
|
+
// entire sheet, including its scroll-aware cancellation behavior.
|
|
76
|
+
pointerEvents: handlePlacement === "overlay" ? "none" : "auto",
|
|
77
|
+
position: handlePlacement === "overlay" ? "absolute" : "relative",
|
|
78
|
+
top: handlePlacement === "overlay" ? 0 : "auto",
|
|
79
|
+
width: "100%",
|
|
80
|
+
zIndex: 0,
|
|
81
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
82
|
+
bgcolor: appearance.handle,
|
|
83
|
+
borderRadius: 999,
|
|
84
|
+
height: 4,
|
|
85
|
+
width: 36,
|
|
86
|
+
} }) }));
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(SwipeableDrawer_1.default, { anchor: "bottom", disableBackdropTransition: true, disableDiscovery: true, disableSwipeToOpen: true, hysteresis: 0.16, onClose: requestClose, onOpen: () => undefined, open: dismiss ? false : open, slotProps: {
|
|
88
|
+
backdrop: {
|
|
89
|
+
sx: { backgroundColor: "transparent" },
|
|
90
|
+
},
|
|
91
|
+
paper: paperSlotProps,
|
|
92
|
+
}, transitionDuration: exports.mobileBottomDrawerDismissDuration, children: [headerLeft ? ((0, jsx_runtime_1.jsx)(MobileBottomDrawerHeader_js_1.MobileBottomDrawerHeader, { closeLabel: `Close ${ariaLabel}`, closeTooltip: closeTooltip, dragHandle: drawerHandle, left: headerLeft, onClose: requestClose, right: headerRight })) : handlePlacement === "above-content" ? (drawerHandle) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { "data-component": "mobile-bottom-drawer-scroll", sx: {
|
|
93
|
+
display: contentScrollMode === "child" ? "flex" : "block",
|
|
94
|
+
flex: 1,
|
|
95
|
+
minHeight: 0,
|
|
96
|
+
overflowY: contentScrollMode === "child" ? "hidden" : "auto",
|
|
97
|
+
overscrollBehaviorY: "contain",
|
|
98
|
+
pb: appearance.safeAreaBottom,
|
|
99
|
+
position: "relative",
|
|
100
|
+
zIndex: handlePlacement === "overlay" ? 1 : "auto",
|
|
101
|
+
}, children: [handlePlacement === "overlay" ? drawerHandle : null, children] })] }));
|
|
102
|
+
}
|