@bayonai/mui-design 1.5.0 → 1.7.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 +12 -0
- package/dist/cjs/actions/ActionMenu.d.ts +24 -0
- package/dist/cjs/actions/DialogActionButtons.d.ts +23 -0
- package/dist/cjs/actions/DialogActionButtons.js +2 -2
- package/dist/cjs/actions/LoadingIconButton.d.ts +11 -0
- package/dist/cjs/actions/StickyActionFooter.d.ts +14 -0
- package/dist/cjs/actions/StickySubmitButton.d.ts +10 -0
- package/dist/cjs/actions/index.d.ts +5 -0
- package/dist/cjs/client.d.ts +4 -0
- package/dist/cjs/components/BayonFlowVisual.d.ts +12 -0
- package/dist/cjs/components/BayonThemeModeToggle.d.ts +6 -0
- package/dist/cjs/components/IconTooltipButton.d.ts +10 -0
- package/dist/cjs/components/panels.d.ts +37 -0
- package/dist/cjs/drawers/BottomDrawer.d.ts +16 -0
- package/dist/cjs/drawers/MobileBottomDrawer.d.ts +20 -0
- package/dist/cjs/drawers/MobileBottomDrawerHeader.d.ts +11 -0
- package/dist/cjs/drawers/ResponsiveDrawer.d.ts +25 -0
- package/dist/cjs/drawers/drawerAppearance.d.ts +8 -0
- package/dist/cjs/drawers/index.d.ts +6 -0
- package/dist/cjs/drawers/useVisualViewportBottomInset.d.ts +6 -0
- package/dist/cjs/feedback/StatusNotice.d.ts +13 -0
- package/dist/cjs/feedback/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/internal/DialogChoiceTile.d.ts +20 -0
- package/dist/cjs/internal/DialogChoiceTile.js +60 -0
- package/dist/cjs/links/LinkAddressPreview.d.ts +19 -0
- package/dist/cjs/links/index.d.ts +3 -0
- package/dist/cjs/links/useLinkAddressPreview.d.ts +26 -0
- package/dist/cjs/location/GeographicLocationField.d.ts +26 -0
- package/dist/cjs/location/GoogleMapsAttribution.d.ts +1 -0
- package/dist/cjs/location/MetadataFieldGroup.d.ts +5 -0
- package/dist/cjs/location/MetadataValueField.d.ts +23 -0
- package/dist/cjs/location/SearchInputAction.d.ts +9 -0
- package/dist/cjs/location/TemplateBadge.d.ts +5 -0
- package/dist/cjs/location/VenueSearchDialog.d.ts +33 -0
- package/dist/cjs/location/index.d.ts +6 -0
- package/dist/cjs/pending/PendingChangesDialogShell.d.ts +2 -0
- package/dist/cjs/pending/PendingChangesDialogView.d.ts +2 -0
- package/dist/cjs/pending/PendingChangesIndicatorView.d.ts +10 -0
- package/dist/cjs/pending/index.d.ts +3 -0
- package/dist/cjs/pending/types.d.ts +55 -0
- package/dist/cjs/pricing/PlanUpgradeDialog.d.ts +17 -0
- package/dist/cjs/pricing/PlanUpgradeDialog.js +22 -0
- package/dist/cjs/pricing/PricingTable.d.ts +28 -0
- package/dist/cjs/pricing/index.d.ts +3 -0
- package/dist/cjs/pricing/index.js +3 -1
- package/dist/cjs/providers/BayonThemeProvider.d.ts +20 -0
- package/dist/cjs/sections/ExpandableSectionToggle.d.ts +12 -0
- package/dist/cjs/sections/index.d.ts +2 -0
- package/dist/cjs/styles/pageStyles.d.ts +15 -0
- package/dist/cjs/swipe/SwipeActionRow.d.ts +8 -0
- package/dist/cjs/swipe/index.d.ts +1 -0
- package/dist/cjs/theme/components.d.ts +2 -0
- package/dist/cjs/theme/createBayonTheme.d.ts +4 -0
- package/dist/cjs/theme/palette.d.ts +146 -0
- package/dist/cjs/theme/shadows.d.ts +2 -0
- package/dist/cjs/theme/types.d.ts +47 -0
- package/dist/cjs/theme/typography.d.ts +2 -0
- package/dist/cjs/toasts/ActionToast.d.ts +11 -0
- package/dist/cjs/toasts/Toast.d.ts +16 -0
- package/dist/cjs/toasts/index.d.ts +5 -0
- package/dist/cjs/toasts/useUpwardToastDismiss.d.ts +15 -0
- package/dist/cjs/uploads/CameraCaptureDialog.d.ts +22 -0
- package/dist/cjs/uploads/FileRow.d.ts +10 -0
- package/dist/cjs/uploads/FileSwipeActionRow.d.ts +1 -0
- package/dist/cjs/uploads/FileThumbnail.d.ts +5 -0
- package/dist/cjs/uploads/FileUpload.d.ts +26 -0
- package/dist/cjs/uploads/FileViewer.d.ts +9 -0
- package/dist/cjs/uploads/FileViewer.js +25 -21
- package/dist/cjs/uploads/ImageCropDialog.d.ts +26 -0
- package/dist/cjs/uploads/ImageInfoPanel.d.ts +24 -0
- package/dist/cjs/uploads/ImageInfoPanel.js +41 -0
- package/dist/cjs/uploads/ImageUploadQualityDialog.d.ts +13 -0
- package/dist/cjs/uploads/ImageUploadQualityDialog.js +57 -0
- package/dist/cjs/uploads/UploadProgressRing.d.ts +24 -0
- package/dist/cjs/uploads/cameraCropPresentation.d.ts +2 -0
- package/dist/cjs/uploads/index.d.ts +12 -0
- package/dist/cjs/uploads/index.js +5 -1
- package/dist/cjs/utils/createBayonEmotionCache.d.ts +1 -0
- package/dist/esm/actions/DialogActionButtons.js +3 -3
- package/dist/esm/internal/DialogChoiceTile.js +54 -0
- package/dist/esm/pricing/PlanUpgradeDialog.js +19 -0
- package/dist/esm/pricing/index.js +1 -0
- package/dist/esm/uploads/FileViewer.js +25 -21
- package/dist/esm/uploads/ImageInfoPanel.js +35 -0
- package/dist/esm/uploads/ImageUploadQualityDialog.js +51 -0
- package/dist/esm/uploads/index.js +2 -0
- package/dist/types/actions/DialogActionButtons.d.ts +2 -1
- package/dist/types/internal/DialogChoiceTile.d.ts +20 -0
- package/dist/types/pricing/PlanUpgradeDialog.d.ts +17 -0
- package/dist/types/pricing/index.d.ts +1 -0
- package/dist/types/uploads/ImageInfoPanel.d.ts +24 -0
- package/dist/types/uploads/ImageUploadQualityDialog.d.ts +13 -0
- package/dist/types/uploads/index.d.ts +2 -0
- package/docs/uploads-contract.md +9 -0
- package/package.json +119 -41
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ComponentType, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { SxProps, Theme } from "@mui/material/styles";
|
|
3
|
+
/** Hosts own domain copy, safe navigation and correction editors. */
|
|
4
|
+
export type PendingChangeRow = {
|
|
5
|
+
id: string;
|
|
6
|
+
action?: string;
|
|
7
|
+
exception?: string;
|
|
8
|
+
needsAttention?: boolean;
|
|
9
|
+
targetLabel?: string;
|
|
10
|
+
/** Host-formatted age of this change, refreshed by the host as needed. */
|
|
11
|
+
elapsedText?: string;
|
|
12
|
+
attemptedText?: string;
|
|
13
|
+
/** Host-owned action for this individual change. */
|
|
14
|
+
endAction?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export type PendingChangeViewGroup = {
|
|
17
|
+
key: string;
|
|
18
|
+
title: string;
|
|
19
|
+
rows: readonly PendingChangeRow[];
|
|
20
|
+
openLabel?: string;
|
|
21
|
+
unavailableReason?: string | null;
|
|
22
|
+
};
|
|
23
|
+
export type PendingChangesDialogShellProps = {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
open: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
title: string;
|
|
28
|
+
titleIcon?: ReactNode;
|
|
29
|
+
contentHeader?: ReactNode;
|
|
30
|
+
contentTouchHandlers?: HTMLAttributes<HTMLDivElement>;
|
|
31
|
+
contentSx?: SxProps<Theme>;
|
|
32
|
+
onEntered?: () => void;
|
|
33
|
+
autoFocusInput?: boolean;
|
|
34
|
+
closeLabel?: string;
|
|
35
|
+
closeTooltip?: string;
|
|
36
|
+
exclusive?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type PendingChangesDialogViewProps = {
|
|
39
|
+
groups: readonly PendingChangeViewGroup[];
|
|
40
|
+
title: string;
|
|
41
|
+
summary: string;
|
|
42
|
+
emptyMessage?: string;
|
|
43
|
+
open: boolean;
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
accountKey?: string | null;
|
|
46
|
+
onOpenItem?: (groupKey: string) => void;
|
|
47
|
+
/** Requests host-owned selection and confirmation; does not discard data. */
|
|
48
|
+
onDiscardRequest?: () => void;
|
|
49
|
+
discardLabel?: string;
|
|
50
|
+
focusGroupKey?: string | null;
|
|
51
|
+
navigationError?: string | null;
|
|
52
|
+
contentHeader?: ReactNode;
|
|
53
|
+
contentTouchHandlers?: HTMLAttributes<HTMLDivElement>;
|
|
54
|
+
shell?: ComponentType<PendingChangesDialogShellProps>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type UpgradePlan<Id extends string = string> = {
|
|
2
|
+
id: Id;
|
|
3
|
+
name: string;
|
|
4
|
+
details: readonly string[];
|
|
5
|
+
};
|
|
6
|
+
export type PlanUpgradeDialogProps<Id extends string> = {
|
|
7
|
+
title: string;
|
|
8
|
+
message: string;
|
|
9
|
+
plans: readonly UpgradePlan<Id>[];
|
|
10
|
+
selectedPlanId: Id;
|
|
11
|
+
confirmLabel: string;
|
|
12
|
+
closeLabel?: string;
|
|
13
|
+
onSelectPlan: (id: Id) => void;
|
|
14
|
+
onViewPlan: (id: Id) => void;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function PlanUpgradeDialog<Id extends string>({ title, message, plans, selectedPlanId, confirmLabel, closeLabel, onSelectPlan, onViewPlan, onClose, }: PlanUpgradeDialogProps<Id>): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PlanUpgradeDialog = PlanUpgradeDialog;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const DialogActionButtons_js_1 = require("../actions/DialogActionButtons.js");
|
|
9
|
+
const DialogChoiceTile_js_1 = require("../internal/DialogChoiceTile.js");
|
|
10
|
+
function PlanUpgradeDialog({ title, message, plans, selectedPlanId, confirmLabel, closeLabel = "Close upgrade dialog", onSelectPlan, onViewPlan, onClose, }) {
|
|
11
|
+
const titleId = (0, react_1.useId)();
|
|
12
|
+
const messageId = (0, react_1.useId)();
|
|
13
|
+
const radioName = (0, react_1.useId)();
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: true, fullWidth: true, maxWidth: "sm", onClose: onClose, "aria-labelledby": titleId, "aria-describedby": messageId, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { id: titleId, sx: { pr: 7 }, children: [title, (0, jsx_runtime_1.jsx)(DialogActionButtons_js_1.DialogCloseButton, { label: closeLabel, onClose: onClose })] }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { id: messageId, variant: "body2", color: "text.secondary", children: message }), (0, jsx_runtime_1.jsx)(material_1.Box, { role: "radiogroup", "aria-label": "Upgrade plan", sx: {
|
|
15
|
+
display: "grid",
|
|
16
|
+
gridTemplateColumns: {
|
|
17
|
+
xs: "1fr",
|
|
18
|
+
sm: "repeat(2, minmax(0, 1fr))",
|
|
19
|
+
},
|
|
20
|
+
gap: 1,
|
|
21
|
+
}, children: plans.map((plan) => ((0, jsx_runtime_1.jsx)(DialogChoiceTile_js_1.DialogChoiceTile, { name: radioName, label: plan.name, description: plan.details.map((detail) => ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: { display: "block" }, children: detail }, detail))), selected: selectedPlanId === plan.id, autoFocus: selectedPlanId === plan.id, onSelect: () => onSelectPlan(plan.id) }, plan.id))) })] }) }), (0, jsx_runtime_1.jsx)(DialogActionButtons_js_1.DialogActionButtons, { confirmLabel: confirmLabel, confirmText: confirmLabel, onConfirm: () => onViewPlan(selectedPlanId) })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type PricingTablePlan = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
description: ReactNode;
|
|
6
|
+
price: ReactNode;
|
|
7
|
+
priceNote: ReactNode;
|
|
8
|
+
features: readonly ReactNode[];
|
|
9
|
+
badge?: ReactNode;
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
highlighted?: boolean;
|
|
12
|
+
/** Overrides the section name; defaults to the text label or plan ID. */
|
|
13
|
+
accessibleLabel?: string;
|
|
14
|
+
};
|
|
15
|
+
export type PricingTableProps = {
|
|
16
|
+
label: string;
|
|
17
|
+
plans: readonly PricingTablePlan[];
|
|
18
|
+
appearance?: "default" | "darkComparison";
|
|
19
|
+
className?: string;
|
|
20
|
+
interactiveClassName?: string;
|
|
21
|
+
colors: {
|
|
22
|
+
accent: string;
|
|
23
|
+
accentDark: string;
|
|
24
|
+
text: string;
|
|
25
|
+
muted: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function PricingTable({ label, plans, className, interactiveClassName, colors, appearance, }: PricingTableProps): import("react").JSX.Element;
|
|
@@ -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,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type EmotionCache } from '@emotion/react';
|
|
3
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
4
|
+
export type BayonThemeMode = 'light' | 'dark';
|
|
5
|
+
export interface BayonThemeModeContextValue {
|
|
6
|
+
mode: BayonThemeMode;
|
|
7
|
+
setMode: (mode: BayonThemeMode) => void;
|
|
8
|
+
toggleMode: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface BayonThemeProviderProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
emotionCache?: EmotionCache;
|
|
13
|
+
disableEmotionCacheProvider?: boolean;
|
|
14
|
+
theme?: Parameters<typeof ThemeProvider>[0]['theme'];
|
|
15
|
+
defaultMode?: BayonThemeMode;
|
|
16
|
+
storageKey?: string;
|
|
17
|
+
enableErrorBoundary?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function useBayonThemeMode(): BayonThemeModeContextValue;
|
|
20
|
+
export declare function BayonThemeProvider({ children, emotionCache, disableEmotionCacheProvider, theme, defaultMode, storageKey, enableErrorBoundary, }: BayonThemeProviderProps): React.JSX.Element;
|
|
@@ -0,0 +1,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,15 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
export declare const pageShellSx: SxProps<Theme>;
|
|
3
|
+
export declare const gradientHeroSx: SxProps<Theme>;
|
|
4
|
+
export declare const heroContainerSx: SxProps<Theme>;
|
|
5
|
+
export declare const heroStackSx: SxProps<Theme>;
|
|
6
|
+
export declare const heroTitleSx: SxProps<Theme>;
|
|
7
|
+
export declare const heroBodySx: SxProps<Theme>;
|
|
8
|
+
export declare const darkPanelSx: SxProps<Theme>;
|
|
9
|
+
export declare const accentPanelSx: SxProps<Theme>;
|
|
10
|
+
export declare const darkPanelHoverSx: SxProps<Theme>;
|
|
11
|
+
export declare const darkCtaSx: SxProps<Theme>;
|
|
12
|
+
export declare const eyebrowSx: SxProps<Theme>;
|
|
13
|
+
export declare const mutedTextSx: SxProps<Theme>;
|
|
14
|
+
export declare const tealButtonSx: SxProps<Theme>;
|
|
15
|
+
export declare const outlineButtonSx: SxProps<Theme>;
|
|
@@ -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,4 @@
|
|
|
1
|
+
import type { CreateBayonThemeOptions } from './types.js';
|
|
2
|
+
export declare function createBayonTheme(options?: CreateBayonThemeOptions): import("@mui/material/styles").Theme;
|
|
3
|
+
export declare const bayonTheme: import("@mui/material/styles").Theme;
|
|
4
|
+
export declare const bayonDarkTheme: import("@mui/material/styles").Theme;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { BayonColorScale } from './types.js';
|
|
2
|
+
export declare const bayonAccent: {
|
|
3
|
+
readonly teal: "#2DD4BF";
|
|
4
|
+
readonly tealLight: "#5EEAD4";
|
|
5
|
+
readonly tealSoft: "#A7F3D0";
|
|
6
|
+
readonly blue: "#60A5FA";
|
|
7
|
+
readonly yellow: "#FDE047";
|
|
8
|
+
readonly coral: "#FF6B6B";
|
|
9
|
+
readonly night: "#0B1020";
|
|
10
|
+
readonly panel: "#111827";
|
|
11
|
+
readonly ink: "#031B20";
|
|
12
|
+
readonly foreground: "#F8FAFC";
|
|
13
|
+
};
|
|
14
|
+
export declare const bayonPrimary: BayonColorScale;
|
|
15
|
+
export declare const bayonSecondary: BayonColorScale;
|
|
16
|
+
export declare const bayonPalette: {
|
|
17
|
+
readonly primary: BayonColorScale;
|
|
18
|
+
readonly secondary: BayonColorScale;
|
|
19
|
+
readonly info: {
|
|
20
|
+
readonly lighter: "#D0F2FF";
|
|
21
|
+
readonly light: "#74CAFF";
|
|
22
|
+
readonly main: "#1890FF";
|
|
23
|
+
readonly dark: "#0C53B7";
|
|
24
|
+
readonly darker: "#04297A";
|
|
25
|
+
readonly contrastText: "#FFFFFF";
|
|
26
|
+
};
|
|
27
|
+
readonly success: {
|
|
28
|
+
readonly lighter: "#E9FCD4";
|
|
29
|
+
readonly light: "#AAF27F";
|
|
30
|
+
readonly main: "#54D62C";
|
|
31
|
+
readonly dark: "#229A16";
|
|
32
|
+
readonly darker: "#08660D";
|
|
33
|
+
readonly contrastText: "#FFFFFF";
|
|
34
|
+
};
|
|
35
|
+
readonly warning: {
|
|
36
|
+
readonly lighter: "#FFF7CD";
|
|
37
|
+
readonly light: "#FFE16A";
|
|
38
|
+
readonly main: "#FFC107";
|
|
39
|
+
readonly dark: "#B78103";
|
|
40
|
+
readonly darker: "#7A4F01";
|
|
41
|
+
readonly contrastText: "#212B36";
|
|
42
|
+
};
|
|
43
|
+
readonly error: {
|
|
44
|
+
readonly lighter: "#FFE7D9";
|
|
45
|
+
readonly light: "#FFA48D";
|
|
46
|
+
readonly main: "#FF4842";
|
|
47
|
+
readonly dark: "#B72136";
|
|
48
|
+
readonly darker: "#7A0C2E";
|
|
49
|
+
readonly contrastText: "#FFFFFF";
|
|
50
|
+
};
|
|
51
|
+
readonly grey: {
|
|
52
|
+
readonly 0: "#FFFFFF";
|
|
53
|
+
readonly 100: "#F9FAFB";
|
|
54
|
+
readonly 200: "#F4F6F8";
|
|
55
|
+
readonly 300: "#DFE3E8";
|
|
56
|
+
readonly 400: "#C4CDD5";
|
|
57
|
+
readonly 500: "#919EAB";
|
|
58
|
+
readonly 600: "#637381";
|
|
59
|
+
readonly 700: "#454F5B";
|
|
60
|
+
readonly 800: "#212B36";
|
|
61
|
+
readonly 900: "#161C24";
|
|
62
|
+
};
|
|
63
|
+
readonly text: {
|
|
64
|
+
readonly primary: "#212B36";
|
|
65
|
+
readonly secondary: "#637381";
|
|
66
|
+
readonly disabled: "#919EAB";
|
|
67
|
+
};
|
|
68
|
+
readonly background: {
|
|
69
|
+
readonly paper: "#FFFFFF";
|
|
70
|
+
readonly default: "#F9FAFB";
|
|
71
|
+
};
|
|
72
|
+
readonly action: {
|
|
73
|
+
readonly active: "#637381";
|
|
74
|
+
readonly hover: "rgba(99, 115, 129, 0.08)";
|
|
75
|
+
readonly selected: "rgba(99, 115, 129, 0.16)";
|
|
76
|
+
readonly disabled: "rgba(99, 115, 129, 0.8)";
|
|
77
|
+
readonly disabledBackground: "rgba(99, 115, 129, 0.24)";
|
|
78
|
+
readonly focus: "rgba(99, 115, 129, 0.24)";
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export declare const bayonDarkPalette: {
|
|
82
|
+
readonly mode: "dark";
|
|
83
|
+
readonly background: {
|
|
84
|
+
readonly default: "#0B1020";
|
|
85
|
+
readonly paper: "#111827";
|
|
86
|
+
};
|
|
87
|
+
readonly text: {
|
|
88
|
+
readonly primary: "#FFFFFF";
|
|
89
|
+
readonly secondary: "rgba(255, 255, 255, 0.72)";
|
|
90
|
+
readonly disabled: "rgba(255, 255, 255, 0.5)";
|
|
91
|
+
};
|
|
92
|
+
readonly primary: BayonColorScale;
|
|
93
|
+
readonly secondary: BayonColorScale;
|
|
94
|
+
readonly info: {
|
|
95
|
+
readonly lighter: "#D0F2FF";
|
|
96
|
+
readonly light: "#74CAFF";
|
|
97
|
+
readonly main: "#1890FF";
|
|
98
|
+
readonly dark: "#0C53B7";
|
|
99
|
+
readonly darker: "#04297A";
|
|
100
|
+
readonly contrastText: "#FFFFFF";
|
|
101
|
+
};
|
|
102
|
+
readonly success: {
|
|
103
|
+
readonly lighter: "#E9FCD4";
|
|
104
|
+
readonly light: "#AAF27F";
|
|
105
|
+
readonly main: "#54D62C";
|
|
106
|
+
readonly dark: "#229A16";
|
|
107
|
+
readonly darker: "#08660D";
|
|
108
|
+
readonly contrastText: "#FFFFFF";
|
|
109
|
+
};
|
|
110
|
+
readonly warning: {
|
|
111
|
+
readonly lighter: "#FFF7CD";
|
|
112
|
+
readonly light: "#FFE16A";
|
|
113
|
+
readonly main: "#FFC107";
|
|
114
|
+
readonly dark: "#B78103";
|
|
115
|
+
readonly darker: "#7A4F01";
|
|
116
|
+
readonly contrastText: "#212B36";
|
|
117
|
+
};
|
|
118
|
+
readonly error: {
|
|
119
|
+
readonly lighter: "#FFE7D9";
|
|
120
|
+
readonly light: "#FFA48D";
|
|
121
|
+
readonly main: "#FF4842";
|
|
122
|
+
readonly dark: "#B72136";
|
|
123
|
+
readonly darker: "#7A0C2E";
|
|
124
|
+
readonly contrastText: "#FFFFFF";
|
|
125
|
+
};
|
|
126
|
+
readonly grey: {
|
|
127
|
+
readonly 0: "#FFFFFF";
|
|
128
|
+
readonly 100: "#F9FAFB";
|
|
129
|
+
readonly 200: "#F4F6F8";
|
|
130
|
+
readonly 300: "#DFE3E8";
|
|
131
|
+
readonly 400: "#C4CDD5";
|
|
132
|
+
readonly 500: "#919EAB";
|
|
133
|
+
readonly 600: "#637381";
|
|
134
|
+
readonly 700: "#454F5B";
|
|
135
|
+
readonly 800: "#212B36";
|
|
136
|
+
readonly 900: "#161C24";
|
|
137
|
+
};
|
|
138
|
+
readonly action: {
|
|
139
|
+
readonly active: "#637381";
|
|
140
|
+
readonly hover: "rgba(99, 115, 129, 0.08)";
|
|
141
|
+
readonly selected: "rgba(99, 115, 129, 0.16)";
|
|
142
|
+
readonly disabled: "rgba(99, 115, 129, 0.8)";
|
|
143
|
+
readonly disabledBackground: "rgba(99, 115, 129, 0.24)";
|
|
144
|
+
readonly focus: "rgba(99, 115, 129, 0.24)";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ThemeOptions } from '@mui/material/styles';
|
|
2
|
+
export type BayonColorScale = {
|
|
3
|
+
lighter: string;
|
|
4
|
+
light: string;
|
|
5
|
+
main: string;
|
|
6
|
+
dark: string;
|
|
7
|
+
darker: string;
|
|
8
|
+
contrastText: string;
|
|
9
|
+
};
|
|
10
|
+
export type BayonCustomShadows = {
|
|
11
|
+
z1: string;
|
|
12
|
+
z8: string;
|
|
13
|
+
z12: string;
|
|
14
|
+
z16: string;
|
|
15
|
+
z20: string;
|
|
16
|
+
z24: string;
|
|
17
|
+
primary: string;
|
|
18
|
+
secondary: string;
|
|
19
|
+
info: string;
|
|
20
|
+
success: string;
|
|
21
|
+
warning: string;
|
|
22
|
+
error: string;
|
|
23
|
+
card: string;
|
|
24
|
+
dialog: string;
|
|
25
|
+
dropdown: string;
|
|
26
|
+
};
|
|
27
|
+
export type BayonThemeMode = 'light' | 'dark';
|
|
28
|
+
export type CreateBayonThemeOptions = {
|
|
29
|
+
mode?: BayonThemeMode;
|
|
30
|
+
overrides?: ThemeOptions;
|
|
31
|
+
};
|
|
32
|
+
declare module '@mui/material/styles' {
|
|
33
|
+
interface PaletteColor {
|
|
34
|
+
lighter?: string;
|
|
35
|
+
darker?: string;
|
|
36
|
+
}
|
|
37
|
+
interface SimplePaletteColorOptions {
|
|
38
|
+
lighter?: string;
|
|
39
|
+
darker?: string;
|
|
40
|
+
}
|
|
41
|
+
interface Theme {
|
|
42
|
+
customShadows: BayonCustomShadows;
|
|
43
|
+
}
|
|
44
|
+
interface ThemeOptions {
|
|
45
|
+
customShadows?: Partial<BayonCustomShadows>;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -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,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 {};
|