@connectif/ui-components 2.2.0 → 2.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.
@@ -1,2 +1,3 @@
1
- import { Components, Theme } from '@mui/material';
2
- export declare const alertTheme: Components<Theme>['MuiAlert'];
1
+ import { Components } from '@mui/material';
2
+ import type { CustomTheme } from '../../theme/CustomTheme';
3
+ export declare const alertTheme: Components<CustomTheme>['MuiAlert'];
@@ -1,2 +1,3 @@
1
- import { Components, Theme } from '@mui/material';
2
- export declare const alertTitleTheme: Components<Theme>['MuiAlertTitle'];
1
+ import { Components } from '@mui/material';
2
+ import type { CustomTheme } from '../../theme/CustomTheme';
3
+ export declare const alertTitleTheme: Components<CustomTheme>['MuiAlertTitle'];
@@ -120,7 +120,7 @@ export type ButtonProps = Pick<MuiButtonProps, 'id' | 'disabled' | 'onClick' | '
120
120
  * Button can be primary, secondary, outlined or text, and it can have an icon at the start or at the end.
121
121
  * It can be disabled.
122
122
  */
123
- declare const Button: React.ForwardRefExoticComponent<Pick<MuiButtonProps, "id" | "className" | "aria-controls" | "aria-expanded" | "aria-haspopup" | "sx" | "disabled" | "type" | "onClick" | "onMouseEnter" | "onMouseLeave"> & {
123
+ declare const Button: React.ForwardRefExoticComponent<Pick<MuiButtonProps, "sx" | "onClick" | "className" | "id" | "aria-controls" | "aria-expanded" | "aria-haspopup" | "onMouseEnter" | "onMouseLeave" | "disabled" | "type"> & {
124
124
  /**
125
125
  * The variant of the button.
126
126
  */
@@ -29,7 +29,7 @@ export type ButtonWithActionsProps = ButtonProps & Pick<PopoverProps, 'anchorHor
29
29
  * A component that groups multiple buttons.
30
30
  * All supported children types of this component are: Button, IconButton, MenuButton or MenuIconButton.
31
31
  */
32
- declare const ButtonWithActions: React.ForwardRefExoticComponent<Pick<MuiButtonProps, "id" | "className" | "aria-controls" | "aria-expanded" | "aria-haspopup" | "sx" | "disabled" | "type" | "onClick" | "onMouseEnter" | "onMouseLeave"> & {
32
+ declare const ButtonWithActions: React.ForwardRefExoticComponent<Pick<MuiButtonProps, "sx" | "onClick" | "className" | "id" | "aria-controls" | "aria-expanded" | "aria-haspopup" | "onMouseEnter" | "onMouseLeave" | "disabled" | "type"> & {
33
33
  variant?: "contained" | "outlined" | "text";
34
34
  color?: "primary" | "inherit" | "white" | "warning";
35
35
  size?: "M" | "L" | "XL";
@@ -43,7 +43,7 @@ declare const ButtonWithActions: React.ForwardRefExoticComponent<Pick<MuiButtonP
43
43
  badgeLeft?: boolean;
44
44
  children?: React.ReactElement<"input">;
45
45
  link?: React.ElementType;
46
- } & Pick<PopoverProps, "horizontalAlign" | "anchorHorizontalOrigin"> & {
46
+ } & Pick<PopoverProps, "anchorHorizontalOrigin" | "horizontalAlign"> & {
47
47
  /**
48
48
  * The options to show in button submenu
49
49
  */
@@ -53,7 +53,7 @@ export type IconButtonProps = Pick<MuiIconButtonProps, 'disabled' | 'onClick' |
53
53
  */
54
54
  shape?: 'default' | 'square';
55
55
  };
56
- declare const IconButton: React.ForwardRefExoticComponent<Pick<MuiIconButtonProps, "id" | "className" | "sx" | "disabled" | "onClick" | "onMouseDown"> & {
56
+ declare const IconButton: React.ForwardRefExoticComponent<Pick<MuiIconButtonProps, "sx" | "onClick" | "className" | "id" | "onMouseDown" | "disabled"> & {
57
57
  /**
58
58
  * The identifier of the icon to display.
59
59
  */
@@ -17,7 +17,7 @@ export type IconToggleButtonProps = Pick<MuiToggleButtonProps, 'disabled' | 'onC
17
17
  */
18
18
  value?: string;
19
19
  };
20
- declare const _default: React.ForwardRefExoticComponent<Pick<MuiToggleButtonProps, "sx" | "disabled" | "onClick" | "selected"> & {
20
+ declare const _default: React.ForwardRefExoticComponent<Pick<MuiToggleButtonProps, "sx" | "onClick" | "disabled" | "selected"> & {
21
21
  variant?: IconToggleButtonVariant;
22
22
  /**
23
23
  * The identifier of the icon to display at the start of the button.
@@ -29,7 +29,7 @@ export type MenuButtonProps = Omit<ButtonProps, 'children' | 'component'> & Pick
29
29
  * A component that displays a Button with a menu.
30
30
  * An invisible overlay is displayed on top of the page to close menu if clicked outside.
31
31
  */
32
- declare const MenuButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "children" | "component"> & Pick<PopoverProps, "horizontalAlign" | "anchorHorizontalOrigin"> & {
32
+ declare const MenuButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "children" | "component"> & Pick<PopoverProps, "anchorHorizontalOrigin" | "horizontalAlign"> & {
33
33
  /**
34
34
  * The list of menu items to display.
35
35
  */
@@ -37,13 +37,13 @@ export type MenuIconButtonProps = IconButtonProps & Pick<PopoverProps, 'anchorHo
37
37
  * A component that displays an IconButton with a menu.
38
38
  * An invisible overlay is displayed on top of the page to close menu if clicked outside.
39
39
  */
40
- declare const MenuIconButton: React.ForwardRefExoticComponent<Pick<import("@mui/material").IconButtonProps, "id" | "className" | "sx" | "disabled" | "onClick" | "onMouseDown"> & {
40
+ declare const MenuIconButton: React.ForwardRefExoticComponent<Pick<import("@mui/material").IconButtonProps, "sx" | "onClick" | "className" | "id" | "onMouseDown" | "disabled"> & {
41
41
  iconId: import("..").IconId;
42
- size?: "XXS" | "XS" | "S" | "M" | "L" | "XL" | "ML";
42
+ size?: "M" | "L" | "S" | "XL" | "XXS" | "XS" | "ML";
43
43
  'data-test'?: string;
44
44
  variant?: "contained" | "default" | "primary" | "outlined";
45
45
  shape?: "default" | "square";
46
- } & Pick<PopoverProps, "horizontalAlign" | "anchorHorizontalOrigin"> & {
46
+ } & Pick<PopoverProps, "anchorHorizontalOrigin" | "horizontalAlign"> & {
47
47
  /**
48
48
  * The list of menu items to display.
49
49
  */
@@ -5,72 +5,7 @@ import { variants } from '../../theme/Typography';
5
5
  import { ChipProps as MuiChipProps } from '@mui/material/Chip';
6
6
  import { AvatarProps } from '../avatar';
7
7
  import { Link } from '@mui/material';
8
- declare const variantStyles: {
9
- default: {
10
- backgroundColor: string;
11
- color: string;
12
- hoverBackgroundColor: string;
13
- borderColor: string;
14
- iconColor: string;
15
- avatarColor: string;
16
- };
17
- primary: {
18
- backgroundColor: string;
19
- color: string;
20
- hoverBackgroundColor: string;
21
- borderColor: string;
22
- iconColor: string;
23
- avatarColor: string;
24
- };
25
- success: {
26
- backgroundColor: string;
27
- color: string;
28
- hoverBackgroundColor: string;
29
- borderColor: string;
30
- iconColor: string;
31
- avatarColor: string;
32
- };
33
- error: {
34
- backgroundColor: string;
35
- color: string;
36
- hoverBackgroundColor: string;
37
- borderColor: string;
38
- iconColor: string;
39
- avatarColor: string;
40
- };
41
- warning: {
42
- backgroundColor: string;
43
- color: string;
44
- hoverBackgroundColor: string;
45
- borderColor: string;
46
- iconColor: string;
47
- avatarColor: string;
48
- };
49
- dark: {
50
- backgroundColor: string;
51
- color: string;
52
- hoverBackgroundColor: string;
53
- borderColor: string;
54
- iconColor: string;
55
- avatarColor: string;
56
- };
57
- darker: {
58
- backgroundColor: string;
59
- color: string;
60
- hoverBackgroundColor: string;
61
- borderColor: string;
62
- iconColor: string;
63
- avatarColor: string;
64
- };
65
- black: {
66
- backgroundColor: string;
67
- color: string;
68
- hoverBackgroundColor: string;
69
- borderColor: string;
70
- iconColor: string;
71
- avatarColor: string;
72
- };
73
- };
8
+ type ChipVariant = 'default' | 'primary' | 'success' | 'error' | 'warning' | 'dark' | 'darker' | 'black';
74
9
  declare const sizeStyles: {
75
10
  XS: {
76
11
  borderRadius: string;
@@ -951,7 +886,7 @@ export type ChipProps = Pick<MuiChipProps, 'id' | 'label' | 'sx' | 'onClick' | '
951
886
  /**
952
887
  * The variant to use.
953
888
  */
954
- variant?: keyof typeof variantStyles;
889
+ variant?: ChipVariant;
955
890
  /**
956
891
  * The size of the chip.
957
892
  */
@@ -976,7 +911,7 @@ export type ChipProps = Pick<MuiChipProps, 'id' | 'label' | 'sx' | 'onClick' | '
976
911
  * A component that displays a chip containing simple text.
977
912
  * If chips doesn't fit in the available space, they will be truncated with ellipsis.
978
913
  */
979
- declare const Chip: React.ForwardRefExoticComponent<Pick<MuiChipProps, "id" | "sx" | "label" | "onClick" | "onMouseEnter" | "onMouseLeave" | "onDelete"> & {
914
+ declare const Chip: React.ForwardRefExoticComponent<Pick<MuiChipProps, "sx" | "onClick" | "id" | "onMouseEnter" | "onMouseLeave" | "label" | "onDelete"> & {
980
915
  /**
981
916
  * The icon to display
982
917
  */
@@ -1015,7 +950,7 @@ declare const Chip: React.ForwardRefExoticComponent<Pick<MuiChipProps, "id" | "s
1015
950
  /**
1016
951
  * The variant to use.
1017
952
  */
1018
- variant?: keyof typeof variantStyles;
953
+ variant?: ChipVariant;
1019
954
  /**
1020
955
  * The size of the chip.
1021
956
  */
@@ -29,7 +29,7 @@ export type MenuChipProps = Omit<ChipProps, 'children' | 'component'> & Pick<Pop
29
29
  * A component that displays a Chip with a menu.
30
30
  * An invisible overlay is displayed on top of the page to close menu if clicked outside.
31
31
  */
32
- declare const MenuChip: React.ForwardRefExoticComponent<Omit<ChipProps, "children" | "component"> & Pick<PopoverProps, "horizontalAlign" | "anchorHorizontalOrigin"> & {
32
+ declare const MenuChip: React.ForwardRefExoticComponent<Omit<ChipProps, "children" | "component"> & Pick<PopoverProps, "anchorHorizontalOrigin" | "horizontalAlign"> & {
33
33
  /**
34
34
  * The list of menu items to display.
35
35
  */
@@ -10,7 +10,9 @@ export declare const iconSizes: {
10
10
  readonly XL: 48;
11
11
  readonly XXL: 72;
12
12
  };
13
- export type IconId = keyof typeof icons;
13
+ export interface IconRegistry {
14
+ }
15
+ export type IconId = keyof typeof icons | keyof IconRegistry;
14
16
  export type IconProps = Pick<SvgIconProps, 'sx'> & {
15
17
  /**
16
18
  * The ID of the icon to display.
@@ -1955,3 +1955,6 @@ export declare const icons: {
1955
1955
  'database-export': string;
1956
1956
  };
1957
1957
  export declare const iconIds: string[];
1958
+ declare let customIcons: Record<string, string>;
1959
+ export declare function registerCustomIcons(newIcons: Record<string, string>): void;
1960
+ export { customIcons };
@@ -1,4 +1,4 @@
1
1
  export { default as Icon, iconSizes } from './Icon';
2
- export type { IconProps, IconId } from './Icon';
3
- export { iconIds } from './icons';
2
+ export type { IconProps, IconId, IconRegistry } from './Icon';
3
+ export { iconIds, registerCustomIcons } from './icons';
4
4
  export { default as StackedIcons, StackedIconsProps } from './StackedIcons';
@@ -30,7 +30,7 @@ export type DatePickerProps = Omit<TextFieldProps, 'value' | 'onChange' | 'type'
30
30
  * An input component which uses a vitamined TextField with a popover to allow user
31
31
  * to pick a Date (without time component)
32
32
  */
33
- declare const DatePicker: React.ForwardRefExoticComponent<Omit<TextFieldProps, "type" | "onBlur" | "onChange" | "onKeyDown" | "onScroll" | "value" | "maxLength"> & {
33
+ declare const DatePicker: React.ForwardRefExoticComponent<Omit<TextFieldProps, "onBlur" | "onChange" | "onKeyDown" | "onScroll" | "value" | "maxLength" | "type"> & {
34
34
  /**
35
35
  * The value handled by this DatePicker
36
36
  */
@@ -56,7 +56,7 @@ export type NumberFieldProps = Omit<TextFieldProps, 'value' | 'onChange' | 'mult
56
56
  * The exposed `ref` property is the refference to the native &lt;input&gt; element,
57
57
  * typed as React.Ref&lt;HTMLInputElement&gt;
58
58
  */
59
- declare const NumberField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "type" | "onChange" | "onScroll" | "defaultValue" | "value" | "multiline"> & {
59
+ declare const NumberField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "defaultValue" | "onChange" | "onScroll" | "value" | "multiline" | "type"> & {
60
60
  /**
61
61
  * The numeric value of this input.
62
62
  */
@@ -25,7 +25,7 @@ export type PhoneFieldProps = Omit<TextFieldProps, 'multiline' | 'onChange' | 'r
25
25
  * The exposed `ref` property is the refference to the native &lt;input&gt; element,
26
26
  * typed as React.Ref&lt;HTMLInputElement&gt;
27
27
  */
28
- declare const PhoneField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "type" | "onChange" | "onScroll" | "defaultValue" | "rows" | "multiline"> & {
28
+ declare const PhoneField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "defaultValue" | "onChange" | "onScroll" | "multiline" | "rows" | "type"> & {
29
29
  /**
30
30
  * Called when the value changes
31
31
  */
@@ -20,7 +20,7 @@ export type ListItemButtonProps = Pick<MuiListItemButtonProps, 'onClick' | 'tabI
20
20
  'data-test'?: string;
21
21
  buttonDataTest?: string;
22
22
  } & BaseListItemProps;
23
- declare const ListItemButton: React.ForwardRefExoticComponent<Pick<MuiListItemButtonProps, "className" | "role" | "tabIndex" | "onClick" | "onMouseDown" | "onMouseEnter" | "onMouseLeave" | "onMouseUp"> & {
23
+ declare const ListItemButton: React.ForwardRefExoticComponent<Pick<MuiListItemButtonProps, "onClick" | "className" | "tabIndex" | "role" | "onMouseDown" | "onMouseEnter" | "onMouseLeave" | "onMouseUp"> & {
24
24
  /**
25
25
  * If `true`, the onClick callback will also be triggered on aux click. Default is `false`.
26
26
  */