@bayonai/mui-design 1.0.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.
Files changed (137) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +124 -7
  3. package/dist/cjs/actions/ActionMenu.js +36 -0
  4. package/dist/cjs/actions/DialogActionButtons.js +33 -0
  5. package/dist/cjs/actions/LoadingIconButton.js +10 -0
  6. package/dist/cjs/actions/StickyActionFooter.js +27 -0
  7. package/dist/cjs/actions/StickySubmitButton.js +10 -0
  8. package/dist/cjs/actions/index.js +18 -0
  9. package/dist/cjs/drawers/BottomDrawer.js +43 -0
  10. package/dist/cjs/drawers/MobileBottomDrawer.js +102 -0
  11. package/dist/cjs/drawers/MobileBottomDrawerHeader.js +36 -0
  12. package/dist/cjs/drawers/ResponsiveDrawer.js +22 -0
  13. package/dist/cjs/drawers/drawerAppearance.js +10 -0
  14. package/dist/cjs/drawers/index.js +17 -0
  15. package/dist/cjs/drawers/useVisualViewportBottomInset.js +33 -0
  16. package/dist/cjs/feedback/StatusNotice.js +62 -0
  17. package/dist/cjs/feedback/index.js +7 -0
  18. package/dist/cjs/links/LinkAddressPreview.js +80 -0
  19. package/dist/cjs/links/index.js +9 -0
  20. package/dist/cjs/links/useLinkAddressPreview.js +152 -0
  21. package/dist/cjs/pending/PendingChangesDialogShell.js +16 -0
  22. package/dist/cjs/pending/PendingChangesDialogView.js +130 -0
  23. package/dist/cjs/pending/PendingChangesIndicatorView.js +27 -0
  24. package/dist/cjs/pending/index.js +9 -0
  25. package/dist/cjs/pending/types.js +2 -0
  26. package/dist/cjs/pricing/PricingTable.js +58 -0
  27. package/dist/cjs/pricing/index.js +6 -0
  28. package/dist/cjs/providers/BayonThemeProvider.js +51 -11
  29. package/dist/cjs/sections/ExpandableSectionToggle.js +32 -0
  30. package/dist/cjs/sections/index.js +7 -0
  31. package/dist/cjs/swipe/SwipeActionRow.js +123 -0
  32. package/dist/cjs/swipe/index.js +8 -0
  33. package/dist/cjs/toasts/ActionToast.js +12 -0
  34. package/dist/cjs/toasts/Toast.js +55 -0
  35. package/dist/cjs/toasts/index.js +12 -0
  36. package/dist/cjs/toasts/useUpwardToastDismiss.js +73 -0
  37. package/dist/cjs/uploads/CameraCaptureDialog.js +187 -0
  38. package/dist/cjs/uploads/FileRow.js +23 -0
  39. package/dist/cjs/uploads/FileSwipeActionRow.js +11 -0
  40. package/dist/cjs/uploads/FileThumbnail.js +104 -0
  41. package/dist/cjs/uploads/FileUpload.js +98 -0
  42. package/dist/cjs/uploads/FileViewer.js +151 -0
  43. package/dist/cjs/uploads/ImageCropDialog.js +215 -0
  44. package/dist/cjs/uploads/UploadProgressRing.js +32 -0
  45. package/dist/cjs/uploads/cameraCropPresentation.js +12 -0
  46. package/dist/cjs/uploads/index.js +20 -0
  47. package/dist/esm/actions/ActionMenu.js +30 -0
  48. package/dist/esm/actions/DialogActionButtons.js +24 -0
  49. package/dist/esm/actions/LoadingIconButton.js +7 -0
  50. package/dist/esm/actions/StickyActionFooter.js +24 -0
  51. package/dist/esm/actions/StickySubmitButton.js +7 -0
  52. package/dist/esm/actions/index.js +7 -0
  53. package/dist/esm/drawers/BottomDrawer.js +37 -0
  54. package/dist/esm/drawers/MobileBottomDrawer.js +95 -0
  55. package/dist/esm/drawers/MobileBottomDrawerHeader.js +30 -0
  56. package/dist/esm/drawers/ResponsiveDrawer.js +19 -0
  57. package/dist/esm/drawers/drawerAppearance.js +7 -0
  58. package/dist/esm/drawers/index.js +7 -0
  59. package/dist/esm/drawers/useVisualViewportBottomInset.js +29 -0
  60. package/dist/esm/feedback/StatusNotice.js +56 -0
  61. package/dist/esm/feedback/index.js +3 -0
  62. package/dist/esm/links/LinkAddressPreview.js +74 -0
  63. package/dist/esm/links/index.js +4 -0
  64. package/dist/esm/links/useLinkAddressPreview.js +149 -0
  65. package/dist/esm/pending/PendingChangesDialogShell.js +10 -0
  66. package/dist/esm/pending/PendingChangesDialogView.js +124 -0
  67. package/dist/esm/pending/PendingChangesIndicatorView.js +21 -0
  68. package/dist/esm/pending/index.js +4 -0
  69. package/dist/esm/pending/types.js +1 -0
  70. package/dist/esm/pricing/PricingTable.js +52 -0
  71. package/dist/esm/pricing/index.js +2 -0
  72. package/dist/esm/providers/BayonThemeProvider.js +51 -11
  73. package/dist/esm/sections/ExpandableSectionToggle.js +26 -0
  74. package/dist/esm/sections/index.js +3 -0
  75. package/dist/esm/swipe/SwipeActionRow.js +116 -0
  76. package/dist/esm/swipe/index.js +3 -0
  77. package/dist/esm/toasts/ActionToast.js +9 -0
  78. package/dist/esm/toasts/Toast.js +52 -0
  79. package/dist/esm/toasts/index.js +5 -0
  80. package/dist/esm/toasts/useUpwardToastDismiss.js +69 -0
  81. package/dist/esm/uploads/CameraCaptureDialog.js +181 -0
  82. package/dist/esm/uploads/FileRow.js +17 -0
  83. package/dist/esm/uploads/FileSwipeActionRow.js +7 -0
  84. package/dist/esm/uploads/FileThumbnail.js +98 -0
  85. package/dist/esm/uploads/FileUpload.js +92 -0
  86. package/dist/esm/uploads/FileViewer.js +145 -0
  87. package/dist/esm/uploads/ImageCropDialog.js +212 -0
  88. package/dist/esm/uploads/UploadProgressRing.js +29 -0
  89. package/dist/esm/uploads/cameraCropPresentation.js +5 -0
  90. package/dist/esm/uploads/index.js +9 -0
  91. package/dist/types/actions/ActionMenu.d.ts +24 -0
  92. package/dist/types/actions/DialogActionButtons.d.ts +22 -0
  93. package/dist/types/actions/LoadingIconButton.d.ts +11 -0
  94. package/dist/types/actions/StickyActionFooter.d.ts +14 -0
  95. package/dist/types/actions/StickySubmitButton.d.ts +10 -0
  96. package/dist/types/actions/index.d.ts +5 -0
  97. package/dist/types/drawers/BottomDrawer.d.ts +16 -0
  98. package/dist/types/drawers/MobileBottomDrawer.d.ts +20 -0
  99. package/dist/types/drawers/MobileBottomDrawerHeader.d.ts +11 -0
  100. package/dist/types/drawers/ResponsiveDrawer.d.ts +25 -0
  101. package/dist/types/drawers/drawerAppearance.d.ts +8 -0
  102. package/dist/types/drawers/index.d.ts +6 -0
  103. package/dist/types/drawers/useVisualViewportBottomInset.d.ts +6 -0
  104. package/dist/types/feedback/StatusNotice.d.ts +13 -0
  105. package/dist/types/feedback/index.d.ts +1 -0
  106. package/dist/types/links/LinkAddressPreview.d.ts +19 -0
  107. package/dist/types/links/index.d.ts +3 -0
  108. package/dist/types/links/useLinkAddressPreview.d.ts +24 -0
  109. package/dist/types/pending/PendingChangesDialogShell.d.ts +2 -0
  110. package/dist/types/pending/PendingChangesDialogView.d.ts +2 -0
  111. package/dist/types/pending/PendingChangesIndicatorView.d.ts +10 -0
  112. package/dist/types/pending/index.d.ts +3 -0
  113. package/dist/types/pending/types.d.ts +53 -0
  114. package/dist/types/pricing/PricingTable.d.ts +25 -0
  115. package/dist/types/pricing/index.d.ts +2 -0
  116. package/dist/types/sections/ExpandableSectionToggle.d.ts +12 -0
  117. package/dist/types/sections/index.d.ts +2 -0
  118. package/dist/types/swipe/SwipeActionRow.d.ts +8 -0
  119. package/dist/types/swipe/index.d.ts +1 -0
  120. package/dist/types/toasts/ActionToast.d.ts +11 -0
  121. package/dist/types/toasts/Toast.d.ts +16 -0
  122. package/dist/types/toasts/index.d.ts +5 -0
  123. package/dist/types/toasts/useUpwardToastDismiss.d.ts +15 -0
  124. package/dist/types/uploads/CameraCaptureDialog.d.ts +22 -0
  125. package/dist/types/uploads/FileRow.d.ts +10 -0
  126. package/dist/types/uploads/FileSwipeActionRow.d.ts +1 -0
  127. package/dist/types/uploads/FileThumbnail.d.ts +5 -0
  128. package/dist/types/uploads/FileUpload.d.ts +26 -0
  129. package/dist/types/uploads/FileViewer.d.ts +9 -0
  130. package/dist/types/uploads/ImageCropDialog.d.ts +26 -0
  131. package/dist/types/uploads/UploadProgressRing.d.ts +24 -0
  132. package/dist/types/uploads/cameraCropPresentation.d.ts +2 -0
  133. package/dist/types/uploads/index.d.ts +10 -0
  134. package/docs/camera-crop-contract.md +50 -0
  135. package/docs/pending-contract.md +11 -0
  136. package/docs/uploads-contract.md +40 -0
  137. package/package.json +115 -48
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from "react";
2
+ export type ExpandableSectionToggleProps = {
3
+ ariaControls?: string;
4
+ ariaLabel: string;
5
+ children: ReactNode;
6
+ endAdornment?: ReactNode;
7
+ expanded: boolean;
8
+ onToggle: () => void;
9
+ showExpandIcon?: boolean;
10
+ sx?: object;
11
+ };
12
+ export declare function ExpandableSectionToggle({ ariaControls, ariaLabel, children, endAdornment, expanded, onToggle, showExpandIcon, sx, }: ExpandableSectionToggleProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ExpandableSectionToggle } from "./ExpandableSectionToggle.js";
2
+ export type { ExpandableSectionToggleProps } from "./ExpandableSectionToggle.js";
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from "react";
2
+ export declare const SWIPE_ROW_SWIPE_DELETE_DISTANCE_PX = 72;
3
+ export declare function SwipeActionRow({ children, onDelete, canDelete, dataComponent, }: {
4
+ children: ReactNode;
5
+ onDelete: () => void;
6
+ canDelete?: boolean;
7
+ dataComponent?: string;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export { SwipeActionRow, SWIPE_ROW_SWIPE_DELETE_DISTANCE_PX } from "./SwipeActionRow.js";
@@ -0,0 +1,11 @@
1
+ import type { ComponentType, ReactNode } from "react";
2
+ import { type ToastProps } from "./Toast.js";
3
+ export type ActionToastProps = Omit<ToastProps, "children"> & {
4
+ message: ReactNode;
5
+ actionLabel: string;
6
+ actionAriaLabel: string;
7
+ onAction: () => void;
8
+ actionDisabled?: boolean;
9
+ ToastComponent?: ComponentType<ToastProps>;
10
+ };
11
+ export declare function ActionToast({ message, actionLabel, actionAriaLabel, onAction, actionDisabled, ToastComponent, ...toastProps }: ActionToastProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type SxProps, type Theme } from "@mui/material";
2
+ import type { ReactNode } from "react";
3
+ export type ToastProps = {
4
+ mobileTopOffset?: number | string;
5
+ mobileBottomOffset?: number | string;
6
+ ariaLive?: "assertive" | "polite";
7
+ children: ReactNode;
8
+ contained?: boolean;
9
+ dataComponent?: string;
10
+ onDismiss?: () => void;
11
+ placement?: "bottom-end" | "top-center";
12
+ role?: "alert" | "status";
13
+ sx?: SxProps<Theme>;
14
+ variant?: "standard" | "unstyled";
15
+ };
16
+ export declare function Toast({ ariaLive, mobileTopOffset, mobileBottomOffset, children, contained, dataComponent, onDismiss, placement, role, sx, variant, }: ToastProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export { Toast } from "./Toast.js";
2
+ export type { ToastProps } from "./Toast.js";
3
+ export { ActionToast } from "./ActionToast.js";
4
+ export type { ActionToastProps } from "./ActionToast.js";
5
+ export { useUpwardToastDismiss, TOAST_UPWARD_DISMISS_DISTANCE_PX, } from "./useUpwardToastDismiss.js";
@@ -0,0 +1,15 @@
1
+ import type { SxProps, Theme } from "@mui/material";
2
+ import { type PointerEvent } from "react";
3
+ export declare const TOAST_UPWARD_DISMISS_DISTANCE_PX = 64;
4
+ export declare function useUpwardToastDismiss({ onDismiss, transform, }: {
5
+ onDismiss?: () => void;
6
+ transform: string;
7
+ }): {
8
+ pointerHandlers: {
9
+ onPointerCancel: () => void;
10
+ onPointerDown: (event: PointerEvent<HTMLElement>) => void;
11
+ onPointerMove: (event: PointerEvent<HTMLElement>) => void;
12
+ onPointerUp: (event: PointerEvent<HTMLElement>) => void;
13
+ } | undefined;
14
+ sx: SxProps<Theme> | undefined;
15
+ };
@@ -0,0 +1,22 @@
1
+ export type CameraCaptureLabels = {
2
+ title: string;
3
+ close: string;
4
+ preview: string;
5
+ capture: string;
6
+ opening: string;
7
+ ready: string;
8
+ denied: string;
9
+ unavailable: string;
10
+ previewError: string;
11
+ captureError: string;
12
+ };
13
+ export type CameraCaptureDialogProps = {
14
+ onClose: () => void;
15
+ onCapture: (file: File) => void;
16
+ labels?: Partial<CameraCaptureLabels>;
17
+ facingMode?: VideoFacingModeEnum;
18
+ fileName?: string;
19
+ previewMaxHeight?: string | number;
20
+ };
21
+ /** Owns camera resources only; the host owns crop, upload and persistence. */
22
+ export declare function CameraCaptureDialog({ onClose, onCapture, labels, facingMode, fileName, previewMaxHeight, }: CameraCaptureDialogProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from "react";
2
+ import type { UploadFile } from "@bayonai/file-uploads";
3
+ export declare function FileRow<T extends UploadFile>({ attachment, canDelete, onDelete, onPreview, thumbnail, sizeLabel, }: {
4
+ attachment: T;
5
+ canDelete: boolean;
6
+ onDelete: (file: T) => void;
7
+ onPreview: (file: T) => void;
8
+ thumbnail: ReactNode;
9
+ sizeLabel: string;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export { SwipeActionRow } from "../swipe/SwipeActionRow.js";
@@ -0,0 +1,5 @@
1
+ import type { LoadFile, UploadFile } from "@bayonai/file-uploads";
2
+ export declare function FileThumbnail<T extends UploadFile>({ attachment, loadFile, }: {
3
+ attachment: T;
4
+ loadFile: LoadFile<T>;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { type ReactNode, type ComponentType } from "react";
2
+ import type { UploadFile } from "@bayonai/file-uploads";
3
+ export declare function FileUpload<T extends UploadFile>({ attachments, canUpload, onUploadAttachment, label, accept, errorMessage, renderFile, renderViewer, RowShell, FieldIcon, colors, }: {
4
+ attachments: T[];
5
+ canUpload?: boolean;
6
+ onUploadAttachment: (file: File) => Promise<void> | void;
7
+ label: string;
8
+ accept: string;
9
+ errorMessage: (error: unknown) => string | null;
10
+ renderFile: (file: T, onPreview: (file: T) => void) => ReactNode;
11
+ renderViewer: (file: T | null, onClose: () => void) => ReactNode;
12
+ RowShell: ComponentType<{
13
+ children: ReactNode;
14
+ hasBottomBorder?: boolean;
15
+ }>;
16
+ FieldIcon: ComponentType<{
17
+ children: ReactNode;
18
+ ariaLabel?: string;
19
+ onClick?: () => void;
20
+ }>;
21
+ colors: {
22
+ text: string;
23
+ divider: string;
24
+ transition: string;
25
+ };
26
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import type { LoadFile, UploadFile } from "@bayonai/file-uploads";
2
+ type FileViewerProps<T extends UploadFile> = {
3
+ attachment: T | null;
4
+ onClose: () => void;
5
+ loadFile: LoadFile<T>;
6
+ onDownload: (file: T) => Promise<void>;
7
+ };
8
+ export declare function FileViewer<T extends UploadFile>(props: FileViewerProps<T>): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { ImageCrop } from "@bayonai/file-uploads";
2
+ export type ImageCropLabels = {
3
+ title: string;
4
+ close: string;
5
+ preview: string;
6
+ confirm: string;
7
+ opening: string;
8
+ instruction: string;
9
+ zoom: string;
10
+ horizontal: string;
11
+ vertical: string;
12
+ decodeError: string;
13
+ previewError: string;
14
+ };
15
+ export type ImageCropDialogProps = {
16
+ file: File;
17
+ busy: boolean;
18
+ error: string | null;
19
+ onClose: () => void;
20
+ onConfirm: (crop: ImageCrop) => Promise<void>;
21
+ labels?: Partial<ImageCropLabels>;
22
+ previewShape?: "circle" | "square";
23
+ previewWidth?: string | number;
24
+ };
25
+ /** Emits orientation-correct decoded-pixel coordinates; the host persists them. */
26
+ export declare function ImageCropDialog({ file, busy, error, onClose, onConfirm, labels, previewShape, previewWidth, }: ImageCropDialogProps): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type SxProps, type Theme } from "@mui/material";
2
+ import type { ReactNode } from "react";
3
+ export type UploadProgressRingProps = {
4
+ /** The interactive upload target, such as an avatar picker. */
5
+ children: ReactNode;
6
+ /** A short accessible description of the in-flight upload. */
7
+ progressLabel: string;
8
+ /** `null` hides the ring; supplied values are clamped to the valid 0–100 range. */
9
+ progress: number | null;
10
+ /** The diameter of the target and progress ring. */
11
+ size?: number;
12
+ /** The MUI circular-progress stroke width. */
13
+ thickness?: number;
14
+ sx?: SxProps<Theme>;
15
+ };
16
+ /**
17
+ * Presents determinate upload progress at the object being changed.
18
+ *
19
+ * Product decision: progress belongs with a compact upload target rather than
20
+ * in a separate status row. The host owns file selection, upload lifecycle,
21
+ * validation, errors, and disabled interaction; this primitive only renders
22
+ * the accessible visual state around its child.
23
+ */
24
+ export declare function UploadProgressRing({ children, progress, progressLabel, size, sx, thickness, }: UploadProgressRingProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DialogActionButtons, DialogActionProgress, DialogCloseButton, } from "../actions/DialogActionButtons.js";
2
+ export { StatusNotice } from "../feedback/StatusNotice.js";
@@ -0,0 +1,10 @@
1
+ export { FileUpload } from "./FileUpload.js";
2
+ export { FileRow } from "./FileRow.js";
3
+ export { FileThumbnail } from "./FileThumbnail.js";
4
+ export { FileViewer } from "./FileViewer.js";
5
+ export { UploadProgressRing } from "./UploadProgressRing.js";
6
+ export { useUploadLock } from "@bayonai/file-uploads/hooks";
7
+ export type { UploadFile, LoadFile } from "@bayonai/file-uploads";
8
+ export type { UploadProgressRingProps } from "./UploadProgressRing.js";
9
+ export { CameraCaptureDialog, type CameraCaptureDialogProps, type CameraCaptureLabels } from "./CameraCaptureDialog.js";
10
+ export { ImageCropDialog, type ImageCropDialogProps, type ImageCropLabels } from "./ImageCropDialog.js";
@@ -0,0 +1,50 @@
1
+ # Camera and crop ownership contract
2
+
3
+ TL-M251 moves the existing camera and crop presentation into the client-only
4
+ `@bayonai/mui-design/uploads` entry. This is an ownership/import migration;
5
+ component bodies and behavioral tests are preserved. The unpublished MUI
6
+ candidate stays at 1.1.0 and the paired neutral file-uploads candidate at 0.2.0.
7
+
8
+ ## Ownership and migration
9
+
10
+ Replace `@bayonai/file-uploads/react` with `@bayonai/mui-design/uploads` for
11
+ `CameraCaptureDialog`, `ImageCropDialog`, `CameraCaptureDialogProps`,
12
+ `ImageCropDialogProps`, `CameraCaptureLabels` and `ImageCropLabels`.
13
+ The neutral file package removes `/react`. Crop geometry, framing math and
14
+ `ImageCrop` remain in `@bayonai/file-uploads`; React upload locking stays in
15
+ `@bayonai/file-uploads/hooks`. There is no reverse dependency from file-uploads
16
+ into mui-design and no new persistence, transfer or storage policy.
17
+
18
+ ## Preserved flows and decisions
19
+
20
+ The camera dialog owns camera resources; the host receives a File and owns
21
+ subsequent crop, upload and persistence. Preserve permission errors, supported
22
+ constraint fallback, preview loading, capture failures, generation fences,
23
+ late-resolving stream disposal, and track cleanup on closure/unmount. Labels,
24
+ facing mode, capture filename and preview sizing retain their existing props.
25
+
26
+ The crop dialog decodes the selected photo, renders a preview and emits
27
+ orientation-correct decoded-pixel coordinates. The host controls busy/error
28
+ state and persistence. Preserve zoom, horizontal/vertical framing, pointer
29
+ capture and drag behavior, stale decode handling, bitmap disposal and object URL
30
+ cleanup. No upload occurs merely by selecting or framing a photo.
31
+
32
+ Both dialogs inherit the host MUI theme. `cameraCropPresentation.ts` delegates to
33
+ canonical `DialogActionButtons`, `DialogActionProgress`, `DialogCloseButton` and
34
+ `StatusNotice`; it contains no duplicate presentation implementation. The public
35
+ entry retains its client boundary and ESM/CommonJS/declaration build paths.
36
+
37
+ ## Behavioral evidence and release gates
38
+
39
+ - [Camera suite](../tests/uploads/CameraCaptureDialog.test.tsx): permissions,
40
+ fallback, preview/capture errors, stream lifecycle and stale continuations.
41
+ - [Crop suite](../tests/uploads/ImageCropDialog.test.tsx): accessible framing,
42
+ decoding, confirmation, pointer interaction and resource lifecycle.
43
+
44
+ These are the existing suites moved with import changes only. Release validation
45
+ must run them alongside shared action/feedback and host-theme coverage, package
46
+ build/typechecks, packed ESM/CommonJS/types imports and affected consumers.
47
+ The development archive is `vendor/bayonai-file-uploads-0.2.0-neutral.tgz`.
48
+ External consumers retain existing exact versions until the owner publishes and
49
+ verifies the paired candidates. This relocation authorizes no publication or
50
+ deployment.
@@ -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.
@@ -0,0 +1,40 @@
1
+ # Upload presentation ownership (TL-M250)
2
+
3
+ `@bayonai/mui-design/uploads` owns the existing MUI presentation. The five public
4
+ components retain their original props, callbacks and rendering flow. Contracts
5
+ `UploadFile` and `LoadFile` belong to `@bayonai/file-uploads`; `useUploadLock`
6
+ belongs to its React-only `/hooks` entry. Compatibility reexports do not create
7
+ another implementation. Uploads uses the host's MUI/Emotion provider.
8
+
9
+ Source was copied from the preserved Bounded upload snapshot at
10
+ `/Users/snicklet/.codex/backups/bounded-TL-M250-upload-move/bounded/working/packages/ui/src/uploads`.
11
+ The five public component implementations change only import ownership and local
12
+ `.js` specifiers. Keep authenticated blob loading, abort signals, stale-result
13
+ protection, owned object-URL revocation, preview sandboxing, download behavior,
14
+ error handling and accepted upload concurrency semantics intact.
15
+
16
+ The private FileSwipeActionRow delegates the existing MUI SwipeActionRow. The
17
+ previous styled native adapter supplied error.main/common.white delete colors,
18
+ spacing(2), background.paper content, the Delete icon/label, 160ms
19
+ cubic-bezier(0.2, 0, 0, 1) easing and reduced-motion disabling. The existing MUI
20
+ row already supplies each value. Both gesture contracts use 12px direction lock,
21
+ 72px deletion distance, 104px maximum travel, pan-y, touch cancellation and click
22
+ suppression. Sharing the MUI implementation preserves these decisions without
23
+ adding gesture code or a dependency on `@bayonai/ui`.
24
+
25
+ Behavioral coverage: `tests/uploads/FileUpload.test.tsx`,
26
+ `FileThumbnail.test.tsx`, `FileViewer.test.tsx`, `FileViewer.lifecycle.test.tsx`,
27
+ `UploadProgressRing.test.tsx`, `uploads.theme.test.tsx`, plus shared
28
+ `tests/swipe/SwipeActionRow.test.tsx`. The theme test verifies host palette values
29
+ on the file swipe surfaces and a host CircularProgress component override.
30
+ Release verification must run these tests and packed ESM/CommonJS/declaration
31
+ checks with file-uploads 0.2.0 before publishing mui-design 1.1.0. External
32
+ consumers migrate only after publication; see README for exact import mapping.
33
+
34
+ ## Thumbnail failure recovery (TL-M252)
35
+
36
+ A host loader that throws synchronously or rejects its promise reaches the same
37
+ logged inert thumbnail fallback. A successful current load supersedes any prior
38
+ failure for that source; aborted/stale attempts cannot update presentation or
39
+ create retained preview URLs. The host still owns retry initiation through its
40
+ loader/attachment updates. Regression coverage is in FileThumbnail.test.tsx.
package/package.json CHANGED
@@ -1,48 +1,115 @@
1
- {
2
- "name": "@bayonai/mui-design",
3
- "version": "1.0.0",
4
- "description": "Shared Bayon AI Material UI theme, style recipes, and reusable design components.",
5
- "license": "UNLICENSED",
6
- "type": "module",
7
- "main": "./dist/cjs/index.js",
8
- "module": "./dist/esm/index.js",
9
- "types": "./dist/types/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./dist/types/index.d.ts",
13
- "import": "./dist/esm/index.js",
14
- "require": "./dist/cjs/index.js"
15
- },
16
- "./client": {
17
- "types": "./dist/types/client.d.ts",
18
- "import": "./dist/esm/client.js",
19
- "require": "./dist/cjs/client.js"
20
- }
21
- },
22
- "files": [
23
- "dist",
24
- "README.md",
25
- "CHANGELOG.md"
26
- ],
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "scripts": {
31
- "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
32
- "build": "npm run clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && node scripts/rename-cjs.cjs",
33
- "typecheck": "tsc -p tsconfig.types.json --noEmit"
34
- },
35
- "peerDependencies": {
36
- "@emotion/cache": "^11.14.0",
37
- "@emotion/react": "^11.14.0",
38
- "@emotion/styled": "^11.14.0",
39
- "@mui/icons-material": "^9.1.0",
40
- "@mui/material": "^9.1.0",
41
- "@mui/material-pigment-css": "^9.1.0",
42
- "react": "^19.0.0",
43
- "react-dom": "^19.0.0"
44
- },
45
- "devDependencies": {
46
- "typescript": "^5"
47
- }
48
- }
1
+ {
2
+ "name": "@bayonai/mui-design",
3
+ "version": "1.2.0",
4
+ "description": "Shared Bayon AI Material UI theme, style recipes, and reusable design components.",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "main": "./dist/cjs/index.js",
8
+ "module": "./dist/esm/index.js",
9
+ "types": "./dist/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/types/index.d.ts",
13
+ "import": "./dist/esm/index.js",
14
+ "require": "./dist/cjs/index.js"
15
+ },
16
+ "./client": {
17
+ "types": "./dist/types/client.d.ts",
18
+ "import": "./dist/esm/client.js",
19
+ "require": "./dist/cjs/client.js"
20
+ },
21
+ "./actions": {
22
+ "types": "./dist/types/actions/index.d.ts",
23
+ "import": "./dist/esm/actions/index.js",
24
+ "require": "./dist/cjs/actions/index.js"
25
+ },
26
+ "./drawers": {
27
+ "types": "./dist/types/drawers/index.d.ts",
28
+ "import": "./dist/esm/drawers/index.js",
29
+ "require": "./dist/cjs/drawers/index.js"
30
+ },
31
+ "./feedback": {
32
+ "types": "./dist/types/feedback/index.d.ts",
33
+ "import": "./dist/esm/feedback/index.js",
34
+ "require": "./dist/cjs/feedback/index.js"
35
+ },
36
+ "./links": {
37
+ "types": "./dist/types/links/index.d.ts",
38
+ "import": "./dist/esm/links/index.js",
39
+ "require": "./dist/cjs/links/index.js"
40
+ },
41
+ "./pending": {
42
+ "types": "./dist/types/pending/index.d.ts",
43
+ "import": "./dist/esm/pending/index.js",
44
+ "require": "./dist/cjs/pending/index.js"
45
+ },
46
+ "./sections": {
47
+ "types": "./dist/types/sections/index.d.ts",
48
+ "import": "./dist/esm/sections/index.js",
49
+ "require": "./dist/cjs/sections/index.js"
50
+ },
51
+ "./swipe": {
52
+ "types": "./dist/types/swipe/index.d.ts",
53
+ "import": "./dist/esm/swipe/index.js",
54
+ "require": "./dist/cjs/swipe/index.js"
55
+ },
56
+ "./toasts": {
57
+ "types": "./dist/types/toasts/index.d.ts",
58
+ "import": "./dist/esm/toasts/index.js",
59
+ "require": "./dist/cjs/toasts/index.js"
60
+ },
61
+ "./uploads": {
62
+ "types": "./dist/types/uploads/index.d.ts",
63
+ "import": "./dist/esm/uploads/index.js",
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"
70
+ }
71
+ },
72
+ "files": [
73
+ "dist",
74
+ "README.md",
75
+ "CHANGELOG.md",
76
+ "docs",
77
+ "docs/uploads-contract.md"
78
+ ],
79
+ "publishConfig": {
80
+ "access": "public"
81
+ },
82
+ "scripts": {
83
+ "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
84
+ "build": "npm run clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && node scripts/rename-cjs.cjs",
85
+ "typecheck": "tsc -p tsconfig.types.json --noEmit",
86
+ "test": "vitest run --config vitest.config.mts"
87
+ },
88
+ "peerDependencies": {
89
+ "@emotion/cache": "^11.14.0",
90
+ "@emotion/react": "^11.14.0",
91
+ "@emotion/styled": "^11.14.0",
92
+ "@mui/icons-material": "^9.2.0",
93
+ "@mui/material": "^9.2.0",
94
+ "react": "^19.0.0",
95
+ "react-dom": "^19.0.0",
96
+ "@bayonai/file-uploads": "^0.2.0"
97
+ },
98
+ "devDependencies": {
99
+ "typescript": "^5",
100
+ "@bayonai/file-uploads": "file:../../vendor/bayonai-file-uploads-0.2.0-neutral.tgz",
101
+ "react": "19.3.1",
102
+ "react-dom": "19.3.1",
103
+ "react-test-renderer": "19.3.1",
104
+ "@types/react": "^19.3.0",
105
+ "@types/react-dom": "^19.3.0",
106
+ "@types/react-test-renderer": "^19.1.0",
107
+ "vitest": "^5.0.5",
108
+ "happy-dom": "^20.14.5"
109
+ },
110
+ "peerDependenciesMeta": {
111
+ "@bayonai/file-uploads": {
112
+ "optional": true
113
+ }
114
+ }
115
+ }