@getsoren/design-system 4.65.0 → 4.67.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/main.cjs +63 -63
- package/dist/main.js +5959 -5594
- package/dist/src/components/DataDisplay/Icons/RefreshIcon.d.ts +3 -0
- package/dist/src/components/DataDisplay/Icons/StorefrontIcon.d.ts +3 -0
- package/dist/src/components/DataDisplay/LogoAvatar/LogoAvatar.d.ts +15 -0
- package/dist/src/components/DataDisplay/NumberBadge/NumberBadge.d.ts +17 -0
- package/dist/src/components/Feedback/Dialog/DialogCloseIcon/DialogCloseIcon.d.ts +6 -1
- package/dist/src/components/Feedback/Dialog/DialogForm/DialogForm.d.ts +11 -0
- package/dist/src/components/Feedback/ErrorState/ErrorState.d.ts +16 -0
- package/dist/src/components/Inputs/ApiAutocomplete/ApiAutocomplete.d.ts +90 -0
- package/dist/src/components/Layout/PageHeader/PageHeader.d.ts +24 -0
- package/dist/src/config/theme.d.ts +13 -0
- package/dist/src/locales/en.d.ts +4 -0
- package/dist/src/locales/fr.d.ts +4 -0
- package/dist/src/main.d.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface LogoAvatarProps {
|
|
4
|
+
src?: string | null;
|
|
5
|
+
alt?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
fallbackIcon?: ReactNode;
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Rounded square avatar for an entity logo (supplier, agency, brand…). Falls back to a storefront
|
|
12
|
+
* icon when the logo is missing or broken; pass `fallbackIcon` for other entity kinds.
|
|
13
|
+
*/
|
|
14
|
+
declare const LogoAvatar: ({ src, alt, size, sx, fallbackIcon }: LogoAvatarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default LogoAvatar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface NumberBadgeProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Palette key driving the fill (`<color>.main`) and the text (`<color>.contrastText`) */
|
|
6
|
+
color?: "primary" | "secondary" | "error" | "info" | "success" | "warning";
|
|
7
|
+
/** Injected by MapView from the marker `size` when used as a marker IconComponent */
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
sx?: SxProps<Theme>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Standalone numbered disc badge. Made to identify the same item across two surfaces —
|
|
14
|
+
* e.g. a card in a list and its marker on a map — at a glance.
|
|
15
|
+
*/
|
|
16
|
+
declare const NumberBadge: ({ children, color, width, height, sx }: NumberBadgeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default NumberBadge;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
1
2
|
import { MouseEvent } from 'react';
|
|
2
3
|
export interface DialogCloseProps {
|
|
3
4
|
onClick?: (e: MouseEvent) => void;
|
|
4
5
|
position?: "absolute" | "relative";
|
|
6
|
+
sx?: SxProps<Theme>;
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Dialog close button: permanent grey outline, icon and hairline reinforced on hover.
|
|
10
|
+
*/
|
|
11
|
+
declare const DialogCloseIcon: ({ onClick, position, sx }: DialogCloseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
12
|
export default DialogCloseIcon;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
export type DialogFormProps = Omit<BoxProps<"form">, "component">;
|
|
3
|
+
/**
|
|
4
|
+
* Form wrapper for a Dialog's children: restores the Paper's flex column that a plain <form>
|
|
5
|
+
* breaks. Without it the whole paper scrolls (title and close button included) instead of the
|
|
6
|
+
* DialogContent, and the actions bar leaves the viewport.
|
|
7
|
+
* Use it whenever a form element must sit between the Dialog and its DialogContent/DialogActions
|
|
8
|
+
* (e.g. form libraries owning the submit).
|
|
9
|
+
*/
|
|
10
|
+
declare const DialogForm: ({ sx, ...props }: DialogFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default DialogForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ErrorStateProps {
|
|
3
|
+
/** Shows the brand logo above the message (full-page crash screens) */
|
|
4
|
+
fullPage?: boolean;
|
|
5
|
+
/** Reload/retry callback — the host app owns the navigation strategy */
|
|
6
|
+
onReload?: () => void;
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
actionLabel?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Error screen counterpart of EmptyState: headline, hairline divider and a reload action.
|
|
13
|
+
* Router-agnostic — the reload behaviour comes from `onReload`.
|
|
14
|
+
*/
|
|
15
|
+
declare const ErrorState: ({ fullPage, onReload, title, description, actionLabel }: ErrorStateProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default ErrorState;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AutocompleteChangeReason, AutocompleteProps, AutocompleteRenderGroupParams, AutocompleteRenderOptionState, PopperProps, SxProps, TextFieldProps } from '@mui/material';
|
|
2
|
+
import { HTMLAttributes, JSXElementConstructor, KeyboardEvent, ReactNode, Ref, SyntheticEvent } from 'react';
|
|
3
|
+
interface ActionEndOption {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
value?: unknown;
|
|
7
|
+
isActionEndOption?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ApiAutocompleteProps<Value, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false> {
|
|
10
|
+
/**
|
|
11
|
+
* Action added in and of options
|
|
12
|
+
*/
|
|
13
|
+
actionEndOption?: ActionEndOption;
|
|
14
|
+
/** Replaces the default dropdown caret (e.g. a switcher's up/down chevrons). */
|
|
15
|
+
popupIcon?: ReactNode;
|
|
16
|
+
limitTags?: number;
|
|
17
|
+
defaultValue?: Value;
|
|
18
|
+
value?: Multiple extends true ? Value[] | null : Value | null;
|
|
19
|
+
label?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
keyOptionLabel: string | string[];
|
|
23
|
+
noOptionsText?: ReactNode;
|
|
24
|
+
getOptionLabel?: (option: Value) => string;
|
|
25
|
+
renderOption?: (props: HTMLAttributes<HTMLLIElement>, option: Value & ActionEndOption, state: AutocompleteRenderOptionState) => ReactNode;
|
|
26
|
+
searchKey?: string;
|
|
27
|
+
required?: boolean;
|
|
28
|
+
queryParams?: Record<string, unknown>;
|
|
29
|
+
queryParamsOnFocus?: Record<string, unknown>;
|
|
30
|
+
queryOptions?: Record<string, unknown>;
|
|
31
|
+
helperMessage?: string | false;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
disableClearable?: DisableClearable;
|
|
34
|
+
width?: number | string;
|
|
35
|
+
sx?: SxProps;
|
|
36
|
+
error?: boolean;
|
|
37
|
+
openOnFocus?: boolean;
|
|
38
|
+
autoHighlight?: boolean;
|
|
39
|
+
getOptionKey?: (option: Value) => string;
|
|
40
|
+
size?: AutocompleteProps<Value, false, false, false>["size"];
|
|
41
|
+
renderInput?: AutocompleteProps<Value, false, false, false>["renderInput"];
|
|
42
|
+
InputProps?: TextFieldProps["InputProps"];
|
|
43
|
+
setSelectedValue?: (value: Multiple extends true ? Value[] | null : Value | null) => void;
|
|
44
|
+
shrink?: boolean;
|
|
45
|
+
onFocus?: () => void;
|
|
46
|
+
onBlur?: () => void;
|
|
47
|
+
variant?: "standard" | "outlined" | "filled";
|
|
48
|
+
endAdornment?: ReactNode;
|
|
49
|
+
/** Hide the circular loader shown in the input while fetching; the listbox loading state is unaffected. */
|
|
50
|
+
disableInputLoader?: boolean;
|
|
51
|
+
fetchOnFocus?: boolean;
|
|
52
|
+
filterOptions?: (options: Value[], state: {
|
|
53
|
+
inputValue: string;
|
|
54
|
+
}) => Value[];
|
|
55
|
+
groupBy?: (option: Value) => string;
|
|
56
|
+
slotProps?: AutocompleteProps<Value, false, false, false>["slotProps"];
|
|
57
|
+
inputSlotProps?: TextFieldProps["slotProps"];
|
|
58
|
+
disableCloseOnSelect?: boolean;
|
|
59
|
+
PopperComponent?: JSXElementConstructor<PopperProps>;
|
|
60
|
+
ListboxProps?: AutocompleteProps<Value, false, false, false>["ListboxProps"];
|
|
61
|
+
renderGroup?: (params: AutocompleteRenderGroupParams) => ReactNode;
|
|
62
|
+
filterSelectedOptions?: boolean;
|
|
63
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
64
|
+
multiple?: Multiple;
|
|
65
|
+
open?: boolean;
|
|
66
|
+
onOpen?: () => void;
|
|
67
|
+
onClose?: () => void;
|
|
68
|
+
blurOnSelect?: "touch" | "mouse" | true | false;
|
|
69
|
+
autoFocus?: boolean;
|
|
70
|
+
onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
71
|
+
onNoResults?: (search: string) => void;
|
|
72
|
+
/** Resolves the option `image` field to a displayable URL (e.g. a CDN path adapter). Identity by default. */
|
|
73
|
+
getOptionImageSrc?: (imagePath: string) => string | undefined;
|
|
74
|
+
onChange?(event: SyntheticEvent, value: Value | Value[] | null, reason: AutocompleteChangeReason): void;
|
|
75
|
+
/**
|
|
76
|
+
* Injected query hook. Structurally typed so any data layer fits (react-query hooks match as-is)
|
|
77
|
+
* without making the library depend on one.
|
|
78
|
+
*/
|
|
79
|
+
useQuery(params?: Record<string, unknown>, options?: {
|
|
80
|
+
query: {
|
|
81
|
+
enabled: boolean;
|
|
82
|
+
};
|
|
83
|
+
}): {
|
|
84
|
+
data?: Value[];
|
|
85
|
+
isFetching: boolean;
|
|
86
|
+
refetch: (refetchOptions?: Record<string, unknown>) => Promise<unknown>;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
declare const ApiAutocomplete: <Value extends Record<string | symbol, any>>({ actionEndOption, popupIcon, blurOnSelect, label, placeholder, name, slotProps, disableClearable, setSelectedValue, useQuery, noOptionsText, renderOption, getOptionLabel: getOptionLabelProp, keyOptionLabel, queryParams, openOnFocus, autoHighlight, queryParamsOnFocus, queryOptions, required, helperMessage, error, disabled, defaultValue, onFocus, onBlur, onChange, sx, renderInput, variant, InputProps, size, shrink, getOptionKey, width, limitTags, groupBy, disableCloseOnSelect, renderGroup, value, PopperComponent, ListboxProps, multiple, filterSelectedOptions, autoFocus, onKeyDown, onNoResults, endAdornment, inputSlotProps, inputRef, open, onOpen, onClose, searchKey, disableInputLoader, fetchOnFocus, filterOptions, getOptionImageSrc, }: ApiAutocompleteProps<Value>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
90
|
+
export default ApiAutocomplete;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Breakpoint, SxProps } from '@mui/material';
|
|
2
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
export type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
4
|
+
[key: string]: T | null;
|
|
5
|
+
};
|
|
6
|
+
export interface PageHeaderProps extends PropsWithChildren {
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
maxWidth?: Breakpoint | false;
|
|
10
|
+
sx?: SxProps;
|
|
11
|
+
RightContent?: ReactNode;
|
|
12
|
+
LeftContent?: ReactNode;
|
|
13
|
+
marginBottom?: number;
|
|
14
|
+
disableDivider?: boolean;
|
|
15
|
+
direction?: ResponsiveStyleValue<"row" | "row-reverse" | "column" | "column-reverse">;
|
|
16
|
+
alignItems?: ResponsiveStyleValue<"flex-start" | "center" | "flex-end" | "stretch" | "baseline">;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Page header block: title, optional side slots and filters as children.
|
|
20
|
+
* The title block's vertical padding is asymmetric on purpose: a page title belongs to the content
|
|
21
|
+
* below it, so it sits closer to that content than to the app bar above.
|
|
22
|
+
*/
|
|
23
|
+
declare const PageHeader: ({ title, children, sx, RightContent, LeftContent, disableDivider, alignItems, direction, marginBottom, maxWidth, }: PageHeaderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default PageHeader;
|
|
@@ -15,6 +15,9 @@ declare module "@mui/material/Button" {
|
|
|
15
15
|
interface ButtonPropsColorOverrides {
|
|
16
16
|
contrast: true;
|
|
17
17
|
}
|
|
18
|
+
interface ButtonPropsSizeOverrides {
|
|
19
|
+
xSmall: true;
|
|
20
|
+
}
|
|
18
21
|
interface ButtonPropsVariantOverrides {
|
|
19
22
|
dashed: true;
|
|
20
23
|
"dashed-rounded": true;
|
|
@@ -38,6 +41,16 @@ declare module "@mui/material/Dialog" {
|
|
|
38
41
|
backgroundColor?: "primary" | "secondary" | string;
|
|
39
42
|
}
|
|
40
43
|
}
|
|
44
|
+
declare module "@mui/material/DialogActions" {
|
|
45
|
+
interface DialogActionsProps {
|
|
46
|
+
/**
|
|
47
|
+
* "sticky": the buttons stay reachable when the dialog scrolls (engages only on overflow, so
|
|
48
|
+
* short dialogs render as before). "sticky-flat": same without the hairline, for small
|
|
49
|
+
* confirmation dialogs where the line separates nothing.
|
|
50
|
+
*/
|
|
51
|
+
variant?: "sticky" | "sticky-flat";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
41
54
|
declare module "@mui/material/FormControlLabel" {
|
|
42
55
|
interface FormControlLabelProps {
|
|
43
56
|
variant?: "card";
|
package/dist/src/locales/en.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
anErrorOccurred: string;
|
|
2
3
|
apply: string;
|
|
3
4
|
clear: string;
|
|
4
5
|
clickToUpload: string;
|
|
@@ -11,9 +12,12 @@ declare const _default: {
|
|
|
11
12
|
files: string;
|
|
12
13
|
month: string;
|
|
13
14
|
noResult: string;
|
|
15
|
+
oops: string;
|
|
14
16
|
open: string;
|
|
15
17
|
openFullPage: string;
|
|
16
18
|
openFullScreen: string;
|
|
19
|
+
orDragAndDrop: string;
|
|
20
|
+
reload: string;
|
|
17
21
|
reset: string;
|
|
18
22
|
selectAll: string;
|
|
19
23
|
today: string;
|
package/dist/src/locales/fr.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
anErrorOccurred: string;
|
|
2
3
|
apply: string;
|
|
3
4
|
clear: string;
|
|
4
5
|
clickToUpload: string;
|
|
@@ -11,9 +12,12 @@ declare const _default: {
|
|
|
11
12
|
files: string;
|
|
12
13
|
month: string;
|
|
13
14
|
noResult: string;
|
|
15
|
+
oops: string;
|
|
14
16
|
open: string;
|
|
15
17
|
openFullPage: string;
|
|
16
18
|
openFullScreen: string;
|
|
19
|
+
orDragAndDrop: string;
|
|
20
|
+
reload: string;
|
|
17
21
|
reset: string;
|
|
18
22
|
selectAll: string;
|
|
19
23
|
today: string;
|
package/dist/src/main.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export * from './components/DataDisplay/ListItemCard';
|
|
|
33
33
|
export { default as ListItemCard } from './components/DataDisplay/ListItemCard';
|
|
34
34
|
export * from './components/DataDisplay/Logo';
|
|
35
35
|
export { default as Logo } from './components/DataDisplay/Logo';
|
|
36
|
+
export type { LogoAvatarProps } from './components/DataDisplay/LogoAvatar/LogoAvatar';
|
|
37
|
+
export * from './components/DataDisplay/LogoAvatar/LogoAvatar';
|
|
38
|
+
export { default as LogoAvatar } from './components/DataDisplay/LogoAvatar/LogoAvatar';
|
|
39
|
+
export * from './components/DataDisplay/NumberBadge/NumberBadge';
|
|
40
|
+
export { default as NumberBadge } from './components/DataDisplay/NumberBadge/NumberBadge';
|
|
36
41
|
export { default as PlanningTimeline } from './components/DataDisplay/PlanningTimeline/PlanningTimeline';
|
|
37
42
|
export * from './components/DataDisplay/PlanningTimeline/types';
|
|
38
43
|
export * from './components/DataDisplay/StatusIcon';
|
|
@@ -43,16 +48,22 @@ export * from './components/DataDisplay/TypographySkeleton';
|
|
|
43
48
|
export { default as TypographySkeleton } from './components/DataDisplay/TypographySkeleton';
|
|
44
49
|
export * from './components/Feedback/Dialog/DialogCloseIcon';
|
|
45
50
|
export { default as DialogCloseIcon } from './components/Feedback/Dialog/DialogCloseIcon';
|
|
51
|
+
export * from './components/Feedback/Dialog/DialogForm/DialogForm';
|
|
52
|
+
export { default as DialogForm } from './components/Feedback/Dialog/DialogForm/DialogForm';
|
|
46
53
|
export * from './components/Feedback/Dialog/DialogPopper';
|
|
47
54
|
export { default as DialogPopper } from './components/Feedback/Dialog/DialogPopper';
|
|
48
55
|
export * from './components/Feedback/Dialog/DialogValidation/DialogValidation';
|
|
49
56
|
export { default as DialogValidation } from './components/Feedback/Dialog/DialogValidation/DialogValidation';
|
|
50
57
|
export type { EmptyStateProps } from './components/Feedback/EmptyState/EmptyState';
|
|
51
58
|
export { default as EmptyState } from './components/Feedback/EmptyState/EmptyState';
|
|
59
|
+
export * from './components/Feedback/ErrorState/ErrorState';
|
|
60
|
+
export { default as ErrorState } from './components/Feedback/ErrorState/ErrorState';
|
|
52
61
|
export * from './components/Feedback/Lightbox';
|
|
53
62
|
export { default as Lightbox } from './components/Feedback/Lightbox';
|
|
54
63
|
export * from './components/Inputs/ActionAppBar';
|
|
55
64
|
export { default as ActionAppBar } from './components/Inputs/ActionAppBar';
|
|
65
|
+
export * from './components/Inputs/ApiAutocomplete/ApiAutocomplete';
|
|
66
|
+
export { default as ApiAutocomplete } from './components/Inputs/ApiAutocomplete/ApiAutocomplete';
|
|
56
67
|
export * from './components/Inputs/AutocompleteFilter';
|
|
57
68
|
export { default as AutocompleteFilter } from './components/Inputs/AutocompleteFilter';
|
|
58
69
|
export type { ButtonProps } from './components/Inputs/Button';
|
|
@@ -75,6 +86,8 @@ export * from './components/Layout/Backoffice';
|
|
|
75
86
|
export { default as Backoffice } from './components/Layout/Backoffice';
|
|
76
87
|
export { default as CollapsingHeader } from './components/Layout/CollapsingHeader/CollapsingHeader';
|
|
77
88
|
export * from './components/Layout/CollapsingHeader/types';
|
|
89
|
+
export * from './components/Layout/PageHeader/PageHeader';
|
|
90
|
+
export { default as PageHeader } from './components/Layout/PageHeader/PageHeader';
|
|
78
91
|
export * from './components/Navigation/NavigationMenu/NavigationMenu';
|
|
79
92
|
export { default as NavigationMenu } from './components/Navigation/NavigationMenu/NavigationMenu';
|
|
80
93
|
export * from './components/Navigation/TabPanel';
|