sosk-ui-lib 0.1.3 → 0.3.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/dist/components/Autocomplete.d.ts +1 -2
- package/dist/components/ConfirmDialog.d.ts +16 -0
- package/dist/components/ContactForm.d.ts +2 -1
- package/dist/components/DetailList.d.ts +12 -0
- package/dist/components/DismissibleAlert.d.ts +1 -2
- package/dist/components/FeatureList.d.ts +15 -0
- package/dist/components/HeroBanner.d.ts +23 -2
- package/dist/components/ItemGrid.d.ts +6 -3
- package/dist/components/MediaCard.d.ts +18 -2
- package/dist/components/QuantityPicker.d.ts +13 -0
- package/dist/components/SearchField.d.ts +13 -0
- package/dist/components/SiteFooter.d.ts +24 -0
- package/dist/components/StatusPanel.d.ts +19 -0
- package/dist/components/TitledDialog.d.ts +13 -0
- package/dist/index.d.ts +18 -2
- package/dist/sosk-ui-lib.cjs +1 -96
- package/dist/sosk-ui-lib.cjs.map +1 -1
- package/dist/sosk-ui-lib.js +1249 -4700
- package/dist/sosk-ui-lib.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/package.json +4 -5
|
@@ -10,10 +10,9 @@ export interface SelectFieldProps<T> {
|
|
|
10
10
|
icon?: ReactNode;
|
|
11
11
|
popupIcon?: ReactNode;
|
|
12
12
|
width?: number | string;
|
|
13
|
-
disableClearable?: boolean;
|
|
14
13
|
variant?: "card" | "minimal";
|
|
15
14
|
size?: "small" | "medium";
|
|
16
15
|
sx?: SxProps<Theme>;
|
|
17
16
|
}
|
|
18
|
-
export declare function Autocomplete<T>({ options, value, onChange, getOptionLabel, isOptionEqualToValue, label, icon, popupIcon, width,
|
|
17
|
+
export declare function Autocomplete<T>({ options, value, onChange, getOptionLabel, isOptionEqualToValue, label, icon, popupIcon, width, variant, size, sx, }: SelectFieldProps<T>): import("react").JSX.Element;
|
|
19
18
|
export default Autocomplete;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '@mui/material';
|
|
3
|
+
export interface ConfirmDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onConfirm: () => void | Promise<void>;
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
message: ReactNode;
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
cancelLabel?: string;
|
|
11
|
+
pendingLabel?: string;
|
|
12
|
+
confirmColor?: ButtonProps["color"];
|
|
13
|
+
errorMessage?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function ConfirmDialog({ open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, pendingLabel, confirmColor, errorMessage, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
16
|
+
export default ConfirmDialog;
|
|
@@ -7,7 +7,8 @@ export interface ContactFormData {
|
|
|
7
7
|
export interface ContactFormProps {
|
|
8
8
|
onSubmit: (data: ContactFormData) => Promise<void>;
|
|
9
9
|
submitLabel?: string;
|
|
10
|
+
submittingLabel?: string;
|
|
10
11
|
successMessage?: string;
|
|
11
12
|
errorMessage?: string;
|
|
12
13
|
}
|
|
13
|
-
export declare function ContactForm({ onSubmit, submitLabel, successMessage, errorMessage, }: ContactFormProps): import("react").JSX.Element;
|
|
14
|
+
export declare function ContactForm({ onSubmit, submitLabel, submittingLabel, successMessage, errorMessage, }: ContactFormProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface DetailListItem {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface DetailListProps {
|
|
8
|
+
items: DetailListItem[];
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
}
|
|
11
|
+
export declare function DetailList(props: DetailListProps): import("react").JSX.Element | null;
|
|
12
|
+
export default DetailList;
|
|
@@ -3,6 +3,5 @@ export interface DismissibleAlertProps {
|
|
|
3
3
|
severity: AlertProps["severity"];
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
onClose: () => void;
|
|
6
|
-
autoHideDuration?: number;
|
|
7
6
|
}
|
|
8
|
-
export declare function DismissibleAlert({ severity, children, onClose,
|
|
7
|
+
export declare function DismissibleAlert({ severity, children, onClose, }: DismissibleAlertProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Breakpoint } from '@mui/material';
|
|
3
|
+
export interface FeatureListItem {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
text?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface FeatureListProps {
|
|
9
|
+
items: FeatureListItem[];
|
|
10
|
+
columns?: number;
|
|
11
|
+
background?: string;
|
|
12
|
+
maxWidth?: Breakpoint | false;
|
|
13
|
+
}
|
|
14
|
+
export declare function FeatureList(props: FeatureListProps): import("react").JSX.Element;
|
|
15
|
+
export default FeatureList;
|
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SxProps, Theme, TypographyProps } from '@mui/material';
|
|
2
|
+
import { ElementType, ReactNode } from 'react';
|
|
3
|
+
type TextSlotProps = Partial<TypographyProps> & {
|
|
4
|
+
component?: ElementType;
|
|
5
|
+
};
|
|
2
6
|
export interface HeroBannerProps {
|
|
3
7
|
title: ReactNode;
|
|
4
8
|
subtitle?: ReactNode;
|
|
9
|
+
eyebrow?: ReactNode;
|
|
10
|
+
actions?: ReactNode;
|
|
5
11
|
imageSrc?: string;
|
|
6
12
|
imageAlt?: string;
|
|
13
|
+
imagePosition?: "left" | "right";
|
|
14
|
+
align?: "auto" | "left";
|
|
15
|
+
background?: string;
|
|
7
16
|
minHeight?: string | number;
|
|
17
|
+
maxWidth?: string | number;
|
|
18
|
+
slotProps?: {
|
|
19
|
+
root?: {
|
|
20
|
+
sx?: SxProps<Theme>;
|
|
21
|
+
};
|
|
22
|
+
image?: {
|
|
23
|
+
sx?: SxProps<Theme>;
|
|
24
|
+
};
|
|
25
|
+
title?: TextSlotProps;
|
|
26
|
+
subtitle?: TextSlotProps;
|
|
27
|
+
};
|
|
8
28
|
}
|
|
9
|
-
export declare function HeroBanner({ title, subtitle, imageSrc, imageAlt, minHeight, }: HeroBannerProps): import("react").JSX.Element;
|
|
29
|
+
export declare function HeroBanner({ title, subtitle, eyebrow, actions, imageSrc, imageAlt, imagePosition, align, background, minHeight, maxWidth, slotProps, }: HeroBannerProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { Breakpoint } from '@mui/material';
|
|
2
3
|
export interface AddNewItemFormProps {
|
|
3
4
|
onSubmit: (payload: Record<string, unknown>) => void | Promise<void>;
|
|
4
5
|
onCancel: () => void;
|
|
5
6
|
}
|
|
7
|
+
type Responsive<V> = V | Partial<Record<Breakpoint, V>>;
|
|
6
8
|
export interface ItemGridProps<T = Record<string, unknown>> {
|
|
7
9
|
items: T[];
|
|
8
10
|
renderItem: (item: T) => ReactNode;
|
|
9
11
|
getItemKey: (item: T) => string | number;
|
|
10
|
-
margin?: number | string
|
|
11
|
-
spacing?: number
|
|
12
|
+
margin?: Responsive<number | string>;
|
|
13
|
+
spacing?: Responsive<number>;
|
|
12
14
|
gridSize?: {
|
|
13
15
|
xs?: number;
|
|
14
16
|
sm?: number;
|
|
@@ -22,7 +24,8 @@ export interface ItemGridProps<T = Record<string, unknown>> {
|
|
|
22
24
|
skeletonCount?: number;
|
|
23
25
|
skeletonWidth?: number | string;
|
|
24
26
|
skeletonHeight?: number | string;
|
|
27
|
+
renderSkeleton?: () => ReactNode;
|
|
25
28
|
header?: ReactNode;
|
|
26
29
|
}
|
|
27
|
-
export declare function ItemGrid<T = Record<string, unknown>>({ items, renderItem, getItemKey, margin, spacing, gridSize, onAddNewItem, addNewItemForm, addNewItemLabel, loading, skeletonCount, skeletonWidth, skeletonHeight, header, }: ItemGridProps<T>): import("react").JSX.Element;
|
|
30
|
+
export declare function ItemGrid<T = Record<string, unknown>>({ items, renderItem, getItemKey, margin, spacing, gridSize, onAddNewItem, addNewItemForm, addNewItemLabel, loading, skeletonCount, skeletonWidth, skeletonHeight, renderSkeleton, header, }: ItemGridProps<T>): import("react").JSX.Element;
|
|
28
31
|
export default ItemGrid;
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material';
|
|
3
3
|
export interface EditFormProps {
|
|
4
4
|
onSubmit: (payload: Record<string, unknown>) => void | Promise<void>;
|
|
5
5
|
onCancel: () => void;
|
|
6
6
|
}
|
|
7
|
+
type MediaCardVariant = "elevated" | "outlined";
|
|
8
|
+
type MediaCardDensity = "comfortable" | "compact";
|
|
7
9
|
export interface MediaCardProps {
|
|
8
10
|
image?: string;
|
|
9
11
|
imageAlt?: string;
|
|
10
12
|
imageHeight?: number;
|
|
13
|
+
imageAspectRatio?: string | number;
|
|
11
14
|
fallback?: ReactNode;
|
|
12
15
|
title: ReactNode;
|
|
16
|
+
titleComponent?: ElementType;
|
|
17
|
+
subtitle?: ReactNode;
|
|
13
18
|
description?: ReactNode;
|
|
14
19
|
descriptionLines?: number;
|
|
15
20
|
highlight?: ReactNode;
|
|
16
21
|
footer?: ReactNode;
|
|
22
|
+
actions?: ReactNode;
|
|
23
|
+
variant?: MediaCardVariant;
|
|
24
|
+
density?: MediaCardDensity;
|
|
17
25
|
sx?: SxProps<Theme>;
|
|
18
26
|
onEdit?: (payload: Record<string, unknown>) => void | Promise<void>;
|
|
19
27
|
editForm?: (props: EditFormProps) => ReactNode;
|
|
@@ -23,4 +31,12 @@ export interface MediaCardProps {
|
|
|
23
31
|
deleteConfirmMessage?: ReactNode;
|
|
24
32
|
onClick?: () => void;
|
|
25
33
|
}
|
|
26
|
-
export
|
|
34
|
+
export interface MediaCardSkeletonProps {
|
|
35
|
+
imageHeight?: number;
|
|
36
|
+
imageAspectRatio?: string | number;
|
|
37
|
+
variant?: MediaCardVariant;
|
|
38
|
+
density?: MediaCardDensity;
|
|
39
|
+
}
|
|
40
|
+
export declare function MediaCard({ image, imageAlt, imageHeight, imageAspectRatio, fallback, title, titleComponent, subtitle, description, descriptionLines, highlight, footer, actions, variant, density, sx, onEdit, editForm, editLabel, onDelete, deleteLabel, deleteConfirmMessage, onClick, }: MediaCardProps): import("react").JSX.Element;
|
|
41
|
+
export declare function MediaCardSkeleton({ imageHeight, imageAspectRatio, variant, density, }: MediaCardSkeletonProps): import("react").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
export interface QuantityPickerProps {
|
|
3
|
+
value: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
label?: string;
|
|
8
|
+
size?: "small" | "medium";
|
|
9
|
+
shape?: "pill" | "rounded";
|
|
10
|
+
sx?: SxProps<Theme>;
|
|
11
|
+
}
|
|
12
|
+
export declare function QuantityPicker({ value, onChange, min, max, label, size, shape, sx, }: QuantityPickerProps): import("react").JSX.Element;
|
|
13
|
+
export default QuantityPicker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
export interface SearchFieldProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
onSubmit?: (value: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
submitLabel?: string;
|
|
9
|
+
clearLabel?: string;
|
|
10
|
+
sx?: SxProps<Theme>;
|
|
11
|
+
}
|
|
12
|
+
export declare function SearchField(props: SearchFieldProps): import("react").JSX.Element;
|
|
13
|
+
export default SearchField;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Breakpoint } from '@mui/material';
|
|
3
|
+
export interface SiteFooterColumn {
|
|
4
|
+
title: string;
|
|
5
|
+
items: ReactNode[];
|
|
6
|
+
wide?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SiteFooterColors {
|
|
9
|
+
background?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
heading?: string;
|
|
12
|
+
divider?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SiteFooterProps {
|
|
15
|
+
brand: ReactNode;
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
columns?: SiteFooterColumn[];
|
|
18
|
+
bottom?: ReactNode;
|
|
19
|
+
bottomAlign?: "left" | "right";
|
|
20
|
+
colors?: SiteFooterColors;
|
|
21
|
+
maxWidth?: Breakpoint | false;
|
|
22
|
+
}
|
|
23
|
+
export declare function SiteFooter(props: SiteFooterProps): import("react").JSX.Element;
|
|
24
|
+
export default SiteFooter;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme, TypographyProps } from '@mui/material';
|
|
3
|
+
export interface StatusPanelProps {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
titleVariant?: TypographyProps["variant"];
|
|
9
|
+
titleComponent?: ElementType;
|
|
10
|
+
iconBackground?: string;
|
|
11
|
+
sx?: SxProps<Theme>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A centred icon, title, short text and optional buttons, for screens that
|
|
15
|
+
* have nothing else to show: an empty list, no search results, or a
|
|
16
|
+
* finished step such as "Request sent".
|
|
17
|
+
*/
|
|
18
|
+
export declare function StatusPanel(props: StatusPanelProps): import("react").JSX.Element;
|
|
19
|
+
export default StatusPanel;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Breakpoint } from '@mui/material';
|
|
3
|
+
export interface TitledDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
maxWidth?: Breakpoint;
|
|
10
|
+
disableClose?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function TitledDialog({ open, onClose, title, children, actions, maxWidth, disableClose, }: TitledDialogProps): import("react").JSX.Element;
|
|
13
|
+
export default TitledDialog;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { MediaCard } from './components/MediaCard';
|
|
2
|
-
export type { MediaCardProps } from './components/MediaCard';
|
|
1
|
+
export { MediaCard, MediaCardSkeleton } from './components/MediaCard';
|
|
2
|
+
export type { MediaCardProps, MediaCardSkeletonProps, } from './components/MediaCard';
|
|
3
3
|
export { ItemGrid } from './components/ItemGrid';
|
|
4
4
|
export type { ItemGridProps, AddNewItemFormProps } from './components/ItemGrid';
|
|
5
5
|
export { ImageField } from './components/Form/ImageField';
|
|
@@ -12,3 +12,19 @@ export { HeroBanner } from './components/HeroBanner';
|
|
|
12
12
|
export { ContactForm } from './components/ContactForm';
|
|
13
13
|
export type { ContactFormData } from './components/ContactForm';
|
|
14
14
|
export { DismissibleAlert } from './components/DismissibleAlert';
|
|
15
|
+
export { TitledDialog } from './components/TitledDialog';
|
|
16
|
+
export type { TitledDialogProps } from './components/TitledDialog';
|
|
17
|
+
export { ConfirmDialog } from './components/ConfirmDialog';
|
|
18
|
+
export type { ConfirmDialogProps } from './components/ConfirmDialog';
|
|
19
|
+
export { QuantityPicker } from './components/QuantityPicker';
|
|
20
|
+
export type { QuantityPickerProps } from './components/QuantityPicker';
|
|
21
|
+
export { FeatureList } from './components/FeatureList';
|
|
22
|
+
export type { FeatureListProps, FeatureListItem } from './components/FeatureList';
|
|
23
|
+
export { SearchField } from './components/SearchField';
|
|
24
|
+
export type { SearchFieldProps } from './components/SearchField';
|
|
25
|
+
export { StatusPanel } from './components/StatusPanel';
|
|
26
|
+
export type { StatusPanelProps } from './components/StatusPanel';
|
|
27
|
+
export { DetailList } from './components/DetailList';
|
|
28
|
+
export type { DetailListProps, DetailListItem } from './components/DetailList';
|
|
29
|
+
export { SiteFooter } from './components/SiteFooter';
|
|
30
|
+
export type { SiteFooterProps, SiteFooterColumn, SiteFooterColors, } from './components/SiteFooter';
|