@connectif/ui-components 7.0.1 → 8.1.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 (84) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/components/alert/Alert.d.ts +6 -4
  3. package/dist/components/avatar/Avatar.d.ts +8 -4
  4. package/dist/components/button/Button.d.ts +20 -11
  5. package/dist/components/button/ButtonGroup.d.ts +3 -1
  6. package/dist/components/button/ButtonWithActions.d.ts +7 -5
  7. package/dist/components/button/IconButton.d.ts +12 -6
  8. package/dist/components/button/IconToggleButton.d.ts +40 -5
  9. package/dist/components/button/MenuButton.d.ts +6 -4
  10. package/dist/components/button/MenuIconButton.d.ts +7 -5
  11. package/dist/components/button/ToggleButton.d.ts +1 -0
  12. package/dist/components/button/ToggleButton.theme.d.ts +3 -2
  13. package/dist/components/card/Card.d.ts +9 -1
  14. package/dist/components/card/CardChips.d.ts +2 -5
  15. package/dist/components/card/CardImage.d.ts +3 -1
  16. package/dist/components/card/EnhancedCard.d.ts +5 -2
  17. package/dist/components/chart/IncrementLabel.d.ts +6 -3
  18. package/dist/components/chart/LineChart.d.ts +3 -1
  19. package/dist/components/chat/ChatMessage.d.ts +3 -1
  20. package/dist/components/chip/Chip.d.ts +21 -862
  21. package/dist/components/chip/ChipList.d.ts +5 -0
  22. package/dist/components/chip/ChipViewer.d.ts +12 -21
  23. package/dist/components/chip/MenuChip.d.ts +4 -2
  24. package/dist/components/dialog/ConfirmationDialog.d.ts +2 -1
  25. package/dist/components/dialog/Dialog.d.ts +3 -1
  26. package/dist/components/divider/Divider.d.ts +4 -1
  27. package/dist/components/formatter/CurrencyFormatter.d.ts +3 -1
  28. package/dist/components/formatter/PercentageFormatter.d.ts +3 -1
  29. package/dist/components/icon/Icon.d.ts +4 -2
  30. package/dist/components/info/InfoBox.d.ts +2 -1
  31. package/dist/components/input/Checkbox.d.ts +3 -1
  32. package/dist/components/input/ColorPicker.d.ts +3 -1
  33. package/dist/components/input/InputHelperText.d.ts +4 -2
  34. package/dist/components/input/InputLabel.d.ts +4 -2
  35. package/dist/components/input/ItemSelector.d.ts +3 -1
  36. package/dist/components/input/NumberField.d.ts +4 -2
  37. package/dist/components/input/PageSelector.d.ts +6 -0
  38. package/dist/components/input/Radio.d.ts +6 -2
  39. package/dist/components/input/Select.d.ts +4 -2
  40. package/dist/components/input/TextEditor.d.ts +3 -1
  41. package/dist/components/input/TextField.d.ts +9 -3
  42. package/dist/components/input/TextFieldContainer.d.ts +4 -2
  43. package/dist/components/input/autocomplete/Autocomplete.d.ts +9 -3
  44. package/dist/components/input/date-interval-picker/DateIntervalPicker.d.ts +1 -0
  45. package/dist/components/input/date-interval-picker/DateIntervalPickerPopover.d.ts +3 -4
  46. package/dist/components/input/date-range-picker/DateRangePicker.d.ts +40 -0
  47. package/dist/components/input/date-range-picker/DateRangePickerPopover.d.ts +16 -0
  48. package/dist/components/input/index.d.ts +2 -0
  49. package/dist/components/layout/CollapsiblePanel.d.ts +3 -1
  50. package/dist/components/layout/CollapsiblePanelSwitcher.d.ts +6 -2
  51. package/dist/components/layout/Container.d.ts +1 -0
  52. package/dist/components/layout/Stepper.d.ts +3 -2
  53. package/dist/components/layout/ToolBox.d.ts +2 -1
  54. package/dist/components/list/BaseListItem.d.ts +9 -4
  55. package/dist/components/list/ListItemButton.d.ts +2 -2
  56. package/dist/components/loader/Loader.d.ts +2 -2
  57. package/dist/components/overlay/DonutFocusOverlay.d.ts +3 -1
  58. package/dist/components/popover/Popover.d.ts +8 -4
  59. package/dist/components/progress/CircularProgress.d.ts +6 -9
  60. package/dist/components/progress/DonutProgress.d.ts +3 -1
  61. package/dist/components/progress/LinearProgress.d.ts +3 -1
  62. package/dist/components/scrollable/Carousel.d.ts +3 -1
  63. package/dist/components/skeleton/Skeleton.d.ts +4 -1
  64. package/dist/components/snackbar/Snackbar.d.ts +4 -2
  65. package/dist/components/tab/TabButton.d.ts +3 -1
  66. package/dist/components/tab/Tabs.d.ts +6 -2
  67. package/dist/components/toolbar/ToolbarTitle.d.ts +3 -1
  68. package/dist/components/tooltip/Tooltip.d.ts +6 -3
  69. package/dist/components/typography/TextMarker.d.ts +3 -1
  70. package/dist/components/widget/WidgetLegendItem.d.ts +6 -2
  71. package/dist/components/window/MinimizableWindow.d.ts +4 -2
  72. package/dist/i18n/en.d.ts +3 -0
  73. package/dist/i18n/es.d.ts +3 -0
  74. package/dist/i18n/fr.d.ts +3 -0
  75. package/dist/i18n/it.d.ts +3 -0
  76. package/dist/i18n/pt.d.ts +3 -0
  77. package/dist/index.js +1356 -1018
  78. package/dist/models/ComparisonInterval.d.ts +2 -1
  79. package/dist/models/DateInterval.d.ts +2 -1
  80. package/dist/theme/CustomTheme.d.ts +1 -0
  81. package/dist/theme/Typography.d.ts +186 -3
  82. package/dist/tsconfig.build.tsbuildinfo +1 -1
  83. package/dist/utils/DateUtils.d.ts +2 -1
  84. package/package.json +1 -1
@@ -1,5 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { ChipProps } from './Chip';
3
+ /**
4
+ * @deprecated Use `ChipViewer` instead.
5
+ */
3
6
  export type ChipListProps = React.PropsWithChildren<{
4
7
  /**
5
8
  * The chips to display.
@@ -7,6 +10,8 @@ export type ChipListProps = React.PropsWithChildren<{
7
10
  chips: ChipProps[];
8
11
  }>;
9
12
  /**
13
+ * @deprecated Use `ChipViewer` instead.
14
+ *
10
15
  * Shows a list of chips, in a horizontal layout.
11
16
  * If chips doesn't fit in the available space, they will be overflow to multiline.
12
17
  */
@@ -1,33 +1,24 @@
1
1
  import * as React from 'react';
2
- import { ThemeTypography } from '../../theme';
3
2
  import { ChipProps } from './Chip';
4
- import { SxProps } from '@mui/material';
3
+ import { TypographyProps } from '../typography';
4
+ import { TypographyVariant } from '../../theme/Typography';
5
5
  export declare const CHIP_DATA_TEST_ID = "chip-viewer-chip";
6
6
  export declare const CHIP_VIEWER_ROOT_ID = "chip-viewer-root";
7
- declare const chipViewerStyle: {
8
- circle: {
9
- borderRadius: string;
10
- backgroundColor: string;
11
- color: string;
12
- };
13
- square: {
14
- borderRadius: string;
15
- backgroundColor: string;
16
- color: string;
17
- };
18
- };
7
+ export declare const chipViewerVariants: readonly ["circle", "square"];
8
+ type ChipViewerVariant = (typeof chipViewerVariants)[number];
19
9
  export type ChipViewerProps = {
20
10
  values: string[];
21
- chipSx?: SxProps;
22
- chipSize?: ChipProps['size'];
23
- chipVariant?: ChipProps['variant'];
24
11
  placeholder?: string;
25
12
  numberLines?: number;
26
13
  reserveHeight?: true;
27
- variant?: keyof typeof chipViewerStyle;
28
- typographyVariant?: ThemeTypography.TypographyVariant;
29
- preventHiddenChipsTooltip?: true;
14
+ variant?: ChipViewerVariant;
15
+ typographyVariant?: TypographyVariant;
16
+ preventHiddenChipsTooltip?: boolean;
30
17
  forceRecalculate?: boolean;
18
+ slotProps?: {
19
+ chip?: Partial<Pick<ChipProps, 'variant' | 'size' | 'sx'>>;
20
+ typography?: Partial<Pick<TypographyProps, 'variant'>>;
21
+ };
31
22
  /**
32
23
  * Function to set custom chip name
33
24
  * @param id
@@ -42,5 +33,5 @@ export type ChipViewerProps = {
42
33
  onRemoveChip?: (event: React.SyntheticEvent, id: string) => void;
43
34
  onHasHiddenChipsChange?: (hasHiddenChips: boolean) => void;
44
35
  };
45
- declare const ChipViewer: ({ values, chipSx, chipSize, chipVariant, placeholder, numberLines, reserveHeight, variant, preventHiddenChipsTooltip, typographyVariant, forceRecalculate, renderChipLabel, onRemoveChip, onClickChip, onHasHiddenChipsChange, getWarningTooltip }: ChipViewerProps) => import("react/jsx-runtime").JSX.Element;
36
+ declare const ChipViewer: ({ values, placeholder, numberLines, reserveHeight, variant, preventHiddenChipsTooltip, forceRecalculate, slotProps, renderChipLabel, onRemoveChip, onClickChip, onHasHiddenChipsChange, getWarningTooltip }: ChipViewerProps) => import("react/jsx-runtime").JSX.Element;
46
37
  export default ChipViewer;
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { ChipProps } from './Chip';
3
3
  import { PopoverProps } from '../popover';
4
+ export declare const menuChipPlacements: readonly ["top", "bottom"];
5
+ type MenuChipPlacement = (typeof menuChipPlacements)[number];
4
6
  export type MenuChipProps = Omit<ChipProps, 'children' | 'component'> & Pick<PopoverProps, 'anchorHorizontalOrigin' | 'horizontalAlign'> & {
5
7
  /**
6
8
  * The list of menu items to display.
@@ -19,7 +21,7 @@ export type MenuChipProps = Omit<ChipProps, 'children' | 'component'> & Pick<Pop
19
21
  * To show menu on the top of de chip.
20
22
  * @default bottom
21
23
  */
22
- placement?: 'top' | 'bottom';
24
+ placement?: MenuChipPlacement;
23
25
  /**
24
26
  * Called when the menuChip is closed by Escape key, Tab key or click outside.
25
27
  */
@@ -47,7 +49,7 @@ declare const MenuChip: React.ForwardRefExoticComponent<Omit<ChipProps, "childre
47
49
  * To show menu on the top of de chip.
48
50
  * @default bottom
49
51
  */
50
- placement?: "top" | "bottom";
52
+ placement?: MenuChipPlacement;
51
53
  /**
52
54
  * Called when the menuChip is closed by Escape key, Tab key or click outside.
53
55
  */
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DialogProps } from './Dialog';
3
- export type ConfirmationDialogVariant = 'primary' | 'warning';
3
+ export declare const confirmationDialogVariants: readonly ["primary", "warning"];
4
+ export type ConfirmationDialogVariant = (typeof confirmationDialogVariants)[number];
4
5
  export type ConfirmationDialogProps = Pick<DialogProps, 'title' | 'open' | 'children' | 'TransitionProps' | 'size' | 'fullScreen'> & {
5
6
  /**
6
7
  * Text to override the accept button default text
@@ -1,11 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { DialogProps as MuiDialogProps } from '@mui/material';
3
+ export declare const dialogSizes: readonly ["S", "M", "L", "XL", "XXL"];
4
+ type DialogSize = (typeof dialogSizes)[number];
3
5
  export type DialogProps = Pick<MuiDialogProps, 'open' | 'sx' | 'children' | 'TransitionProps' | 'fullScreen'> & {
4
6
  /**
5
7
  * The title of the Dialog
6
8
  */
7
9
  title: string | React.ReactNode;
8
- size?: 'S' | 'M' | 'L' | 'XL' | 'XXL';
10
+ size?: DialogSize;
9
11
  noPadding?: boolean;
10
12
  noPaddingTitle?: boolean;
11
13
  wrapChildren?: boolean;
@@ -1,9 +1,12 @@
1
1
  import { DividerProps as MuiDividerProps } from '@mui/material';
2
+ export declare const dividerVariants: readonly ["fullWidth", "middle"];
3
+ type DividerVariant = (typeof dividerVariants)[number];
4
+ export declare const dividerOrientations: readonly ["horizontal", "vertical"];
2
5
  export type DividerProps = Pick<MuiDividerProps, 'orientation' | 'flexItem' | 'sx'> & {
3
6
  /**
4
7
  * The variant to use for the divider.
5
8
  */
6
- variant?: 'fullWidth' | 'middle';
9
+ variant?: DividerVariant;
7
10
  /**
8
11
  * The color of the divider. By default, the divider will use the color of
9
12
  * grey300
@@ -1,3 +1,5 @@
1
+ export declare const currencyNotations: readonly ["compact"];
2
+ type CurrencyNotation = (typeof currencyNotations)[number];
1
3
  export type CurrencyFormatterProps = {
2
4
  /**
3
5
  * Amount to format
@@ -6,7 +8,7 @@ export type CurrencyFormatterProps = {
6
8
  /**
7
9
  * Notation to use
8
10
  */
9
- notation?: 'compact';
11
+ notation?: CurrencyNotation;
10
12
  /**
11
13
  * Ignore context Currency and use this one instead
12
14
  */
@@ -1,3 +1,5 @@
1
+ export declare const percentageFractionSizes: readonly [0, 1, 2, 3];
2
+ type PercentageFractionSize = (typeof percentageFractionSizes)[number];
1
3
  export type PercentageFormatterProps = {
2
4
  /**
3
5
  * Value to format
@@ -6,7 +8,7 @@ export type PercentageFormatterProps = {
6
8
  /**
7
9
  * Quantity of decimals to use
8
10
  */
9
- fractionSize?: 0 | 1 | 2 | 3;
11
+ fractionSize?: PercentageFractionSize;
10
12
  };
11
13
  /**
12
14
  * Component to format any currency amount.
@@ -11,6 +11,8 @@ export declare const iconSizes: {
11
11
  readonly XL: 48;
12
12
  readonly XXL: 72;
13
13
  };
14
+ export declare const iconSizeNames: (keyof typeof iconSizes)[];
15
+ export type IconSize = (typeof iconSizeNames)[number];
14
16
  export type IconProps = Pick<SvgIconProps, 'sx'> & {
15
17
  /**
16
18
  * The ID of the icon to display.
@@ -19,7 +21,7 @@ export type IconProps = Pick<SvgIconProps, 'sx'> & {
19
21
  /**
20
22
  * The size of the icon to display.
21
23
  */
22
- size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL' | 'XXL';
24
+ size?: IconSize;
23
25
  /**
24
26
  * Classes of this icon
25
27
  */
@@ -38,7 +40,7 @@ declare const Icon: React.ForwardRefExoticComponent<Pick<SvgIconProps, "sx"> & {
38
40
  /**
39
41
  * The size of the icon to display.
40
42
  */
41
- size?: "XXS" | "XS" | "S" | "M" | "L" | "XL" | "XXL";
43
+ size?: IconSize;
42
44
  /**
43
45
  * Classes of this icon
44
46
  */
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SxProps } from '@mui/material';
3
- type InfoBoxVariant = 'default';
3
+ export declare const infoBoxVariants: readonly ["default"];
4
+ type InfoBoxVariant = (typeof infoBoxVariants)[number];
4
5
  export type InfoBoxProps = {
5
6
  children: React.ReactNode;
6
7
  variant?: InfoBoxVariant;
@@ -1,4 +1,6 @@
1
1
  import { CheckboxProps as MuiCheckboxProps } from '@mui/material/Checkbox';
2
+ export declare const checkboxLabelPlacements: readonly ["start", "end"];
3
+ type CheckboxLabelPlacement = (typeof checkboxLabelPlacements)[number];
2
4
  export type CheckboxProps = Pick<MuiCheckboxProps, 'checked' | 'tabIndex' | 'indeterminate'> & {
3
5
  /**
4
6
  * Whether the checkbox is checked or not.
@@ -19,7 +21,7 @@ export type CheckboxProps = Pick<MuiCheckboxProps, 'checked' | 'tabIndex' | 'ind
19
21
  /**
20
22
  * Where to put the `label` text, if any.
21
23
  */
22
- labelPlacement?: 'start' | 'end';
24
+ labelPlacement?: CheckboxLabelPlacement;
23
25
  /**
24
26
  * Optional class in the input of the checkbox.
25
27
  */
@@ -52,12 +52,14 @@ export type ColorPickerProps = {
52
52
  * rgba will be used when alpha is allowed and the color has transparency even in hex mode.
53
53
  * @default 'auto'
54
54
  */
55
- mode?: 'hex' | 'auto';
55
+ mode?: ColorPickerMode;
56
56
  /**
57
57
  * A function to update color value
58
58
  */
59
59
  onChange: (value: string) => void;
60
60
  };
61
+ export declare const colorPickerModes: readonly ["hex", "auto"];
62
+ type ColorPickerMode = (typeof colorPickerModes)[number];
61
63
  export declare const colorPickerDefaultColors: string[];
62
64
  /**
63
65
  * A component that displays color picker from react-best-gradient-color-picker.
@@ -1,10 +1,12 @@
1
1
  import { SxProps } from '@mui/material';
2
2
  import * as React from 'react';
3
+ export declare const inputHelperTextSeverities: readonly ["info", "error"];
4
+ type InputHelperTextSeverity = (typeof inputHelperTextSeverities)[number];
3
5
  export type InputHelperTextProps = React.PropsWithChildren<{
4
6
  /**
5
7
  * The severity of this text
6
8
  */
7
- severity?: 'info' | 'error';
9
+ severity?: InputHelperTextSeverity;
8
10
  /**
9
11
  * Styles to custom main Box component
10
12
  */
@@ -18,7 +20,7 @@ declare const InputHelperText: React.ForwardRefExoticComponent<{
18
20
  /**
19
21
  * The severity of this text
20
22
  */
21
- severity?: "info" | "error";
23
+ severity?: InputHelperTextSeverity;
22
24
  /**
23
25
  * Styles to custom main Box component
24
26
  */
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/material';
3
3
  import { TooltipProps } from '../tooltip/Tooltip';
4
+ export declare const inputLabelSeverities: readonly ["info", "error"];
5
+ type InputLabelSeverity = (typeof inputLabelSeverities)[number];
4
6
  export type InputLabelProps = React.PropsWithChildren<{
5
7
  /**
6
8
  * The `for` native attribute. Set here the `id` of the related
@@ -14,7 +16,7 @@ export type InputLabelProps = React.PropsWithChildren<{
14
16
  /**
15
17
  * The severity of this label
16
18
  */
17
- severity?: 'info' | 'error';
19
+ severity?: InputLabelSeverity;
18
20
  /**
19
21
  * Show an info icon with the text as tooltip
20
22
  */
@@ -37,7 +39,7 @@ declare const InputLabel: React.ForwardRefExoticComponent<{
37
39
  /**
38
40
  * The severity of this label
39
41
  */
40
- severity?: "info" | "error";
42
+ severity?: InputLabelSeverity;
41
43
  /**
42
44
  * Show an info icon with the text as tooltip
43
45
  */
@@ -1,12 +1,14 @@
1
1
  import { SelectPopoverProps } from './SelectPopover';
2
2
  import { SelectableItem } from '../../models/SelectableItem';
3
+ export declare const itemSelectorVariants: readonly ["circular", "rounded", "transparent"];
4
+ type ItemSelectorVariant = (typeof itemSelectorVariants)[number];
3
5
  export type ItemSelectorItem = {
4
6
  id: string;
5
7
  };
6
8
  export type ItemSelectorProps<T extends ItemSelectorItem> = {
7
9
  items: T[];
8
10
  selectedItems: T[];
9
- variant?: 'circular' | 'rounded' | 'transparent';
11
+ variant?: ItemSelectorVariant;
10
12
  placeholder?: string;
11
13
  disabled?: boolean;
12
14
  helperText?: string;
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { TextFieldProps } from './TextField';
3
+ export declare const numberFieldTypes: readonly ["integer", "decimal"];
4
+ type NumberFieldType = (typeof numberFieldTypes)[number];
3
5
  export type NumberFieldProps = Omit<TextFieldProps, 'value' | 'onChange' | 'multiline' | 'onScroll' | 'type' | 'defaultValue'> & {
4
6
  /**
5
7
  * The numeric value of this input.
@@ -9,7 +11,7 @@ export type NumberFieldProps = Omit<TextFieldProps, 'value' | 'onChange' | 'mult
9
11
  * The numerical set to which the field belongs.
10
12
  * * @default integer
11
13
  */
12
- type?: 'integer' | 'decimal';
14
+ type?: NumberFieldType;
13
15
  /**
14
16
  * Called when value is changed internally (both with user typing or
15
17
  * by using arrowUp/arrowDown keyboard keys)
@@ -65,7 +67,7 @@ declare const NumberField: React.ForwardRefExoticComponent<Omit<TextFieldProps,
65
67
  * The numerical set to which the field belongs.
66
68
  * * @default integer
67
69
  */
68
- type?: "integer" | "decimal";
70
+ type?: NumberFieldType;
69
71
  /**
70
72
  * Called when value is changed internally (both with user typing or
71
73
  * by using arrowUp/arrowDown keyboard keys)
@@ -16,8 +16,14 @@ export type PageSelectorProps = {
16
16
  /**
17
17
  * The text to display next to the page selector.
18
18
  * It will be rendered as HTML, so make sure to sanitize it.
19
+ * When omitted or empty, a default internationalized text is shown.
19
20
  */
20
21
  text?: string;
22
+ /**
23
+ * When true, hides the text next to the page selector.
24
+ * @default false
25
+ */
26
+ hideText?: boolean;
21
27
  /**
22
28
  * The function to call when the page is changed by the user.
23
29
  */
@@ -1,6 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { RadioProps as MuiRadioProps } from '@mui/material/Radio';
3
3
  import { SxProps } from '@mui/material';
4
+ export declare const radioLabelPlacements: readonly ["start", "end"];
5
+ type RadioLabelPlacement = (typeof radioLabelPlacements)[number];
6
+ export declare const radioSizes: readonly ["S", "M"];
7
+ type RadioSize = (typeof radioSizes)[number];
4
8
  export type RadioProps<T extends string = string> = {
5
9
  /**
6
10
  * Wheather the radio is checked or not.
@@ -21,7 +25,7 @@ export type RadioProps<T extends string = string> = {
21
25
  /**
22
26
  * Where to put the `label` text, if any.
23
27
  */
24
- labelPlacement?: 'start' | 'end';
28
+ labelPlacement?: RadioLabelPlacement;
25
29
  /**
26
30
  * Callback fired when the state is changed.
27
31
  */
@@ -33,7 +37,7 @@ export type RadioProps<T extends string = string> = {
33
37
  /**
34
38
  * The size of the radio
35
39
  */
36
- size?: 'S' | 'M';
40
+ size?: RadioSize;
37
41
  /**
38
42
  * Settled directly in DOM element, for testing easy location purposes.
39
43
  */
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { SelectProps as MuiSelectProps } from '@mui/material/Select';
3
3
  import { ListItemButtonProps } from '../list/ListItemButton';
4
+ export declare const selectVariants: readonly ["rounded", "circular", "transparent"];
5
+ export declare const selectSizes: readonly ["S", "M"];
4
6
  type Colors = {
5
7
  backgroundColor?: string;
6
8
  color?: string;
@@ -18,7 +20,7 @@ type SelectValue<T extends string | number | undefined, Multiple extends boolean
18
20
  * https://github.com/Microsoft/TypeScript/issues/29340
19
21
  */
20
22
  export type SelectProps<T extends string | number | undefined, Multiple extends boolean | undefined, Value = SelectValue<T, Multiple>> = Pick<MuiSelectProps<T>, 'id' | 'children' | 'sx' | 'disabled' | 'onClose'> & {
21
- variant?: 'rounded' | 'circular' | 'transparent';
23
+ variant?: (typeof selectVariants)[number];
22
24
  /**
23
25
  * The placeholder to put in this Select when no value is selected.
24
26
  */
@@ -77,7 +79,7 @@ export type SelectProps<T extends string | number | undefined, Multiple extends
77
79
  * Ref to inner HTMLSelectElement
78
80
  */
79
81
  ref?: React.Ref<HTMLSelectElement>;
80
- size?: 'S' | 'M';
82
+ size?: (typeof selectSizes)[number];
81
83
  className?: string;
82
84
  paperClassName?: string;
83
85
  'data-testid'?: string;
@@ -26,6 +26,8 @@ type CustomToolbarGroup = {
26
26
  type CustomToolbarGroups = {
27
27
  [key: string]: CustomToolbarGroup;
28
28
  };
29
+ export declare const textEditorVariants: readonly ["normal", "simple", "reduced"];
30
+ type TextEditorVariant = (typeof textEditorVariants)[number];
29
31
  export type TextEditorProps = Omit<IAllProps, 'value' | 'onEditorChange' | 'onChange' | 'onDirty'> & Pick<CodeEditorPopupProps, 'linterFunction'> & {
30
32
  /**
31
33
  * This bool turn on/off the top menuBar on the textEditor
@@ -42,7 +44,7 @@ export type TextEditorProps = Omit<IAllProps, 'value' | 'onEditorChange' | 'onCh
42
44
  * options from more complete to less complete.
43
45
  * @default 'normal'
44
46
  */
45
- variant?: 'normal' | 'simple' | 'reduced';
47
+ variant?: TextEditorVariant;
46
48
  /**
47
49
  * Custom component's height
48
50
  * @default undefined
@@ -3,11 +3,17 @@ import { SxProps } from '@mui/material';
3
3
  import { TypographyVariant } from '../../theme/Typography';
4
4
  import { InputLabelProps } from './InputLabel';
5
5
  import { IconId } from '../icon';
6
+ export declare const textFieldTypes: readonly ["text", "password"];
7
+ type TextFieldType = (typeof textFieldTypes)[number];
8
+ export declare const textFieldAutoCompletes: readonly ["off", "new-password"];
9
+ type TextFieldAutoComplete = (typeof textFieldAutoCompletes)[number];
10
+ export declare const textFieldVariants: readonly ["default", "transparent"];
11
+ type TextFieldVariant = (typeof textFieldVariants)[number];
6
12
  export type TextFieldProps = {
7
13
  /**
8
14
  * Type of inner input. Only apply if this field is single line.
9
15
  */
10
- type?: 'text' | 'password';
16
+ type?: TextFieldType;
11
17
  /**
12
18
  * The native `id` of input or textarea. If not supplied, a random id
13
19
  * will be established.
@@ -18,7 +24,7 @@ export type TextFieldProps = {
18
24
  * you probably want to use `transparent` variant. Also you have `sx` and `inputSx` props for any
19
25
  * customization.
20
26
  */
21
- variant?: 'default' | 'transparent';
27
+ variant?: TextFieldVariant;
22
28
  /**
23
29
  * Whether the input is disabled or not.
24
30
  */
@@ -101,7 +107,7 @@ export type TextFieldProps = {
101
107
  * Settled directly in DOM element, for testing easy location purposes.
102
108
  */
103
109
  'data-testid'?: string;
104
- autoComplete?: 'off' | 'new-password';
110
+ autoComplete?: TextFieldAutoComplete;
105
111
  containerRef?: React.Ref<HTMLDivElement>;
106
112
  /**
107
113
  * Adornment components to be placed at the start of the input
@@ -1,10 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { BoxProps, SxProps } from '@mui/material';
3
+ export declare const textFieldContainerVariants: readonly ["default", "transparent"];
4
+ type TextFieldContainerVariant = (typeof textFieldContainerVariants)[number];
3
5
  export type TextFieldContainerProps = React.PropsWithChildren<{
4
6
  /**
5
7
  * The variant of this component.
6
8
  */
7
- variant?: 'default' | 'transparent';
9
+ variant?: TextFieldContainerVariant;
8
10
  /**
9
11
  * Custom styles to override.
10
12
  */
@@ -59,7 +61,7 @@ declare const TextFieldContainer: React.ForwardRefExoticComponent<{
59
61
  /**
60
62
  * The variant of this component.
61
63
  */
62
- variant?: "default" | "transparent";
64
+ variant?: TextFieldContainerVariant;
63
65
  /**
64
66
  * Custom styles to override.
65
67
  */
@@ -1,11 +1,17 @@
1
1
  import * as React from 'react';
2
2
  import { AutocompleteOption, AutocompleteValue, TextFieldFilteredProps } from '../../../models/Autocomplete';
3
3
  import { IconId } from '../../icon';
4
+ export declare const autocompleteVariants: readonly ["default", "text"];
5
+ type AutocompleteVariant = (typeof autocompleteVariants)[number];
6
+ export declare const autocompleteModes: readonly ["startsWith", "contains", "endsWith"];
7
+ type AutocompleteMode = (typeof autocompleteModes)[number];
8
+ export declare const autocompleteSizes: readonly ["S", "XS"];
9
+ type AutocompleteSize = (typeof autocompleteSizes)[number];
4
10
  export type AutocompleteProps<T extends string, Multiple extends boolean | undefined, Value = AutocompleteValue<T, Multiple>, Option = AutocompleteOption<T>> = {
5
11
  /**
6
12
  * The variant of the Autocomplete
7
13
  */
8
- variant?: 'default' | 'text';
14
+ variant?: AutocompleteVariant;
9
15
  /**
10
16
  * The value handled by this Autocomplete component. If multiple=true, it should be an array of ids.
11
17
  * If multiple=false (by default) it should be a string.
@@ -43,7 +49,7 @@ export type AutocompleteProps<T extends string, Multiple extends boolean | undef
43
49
  /**
44
50
  * The mode to search within the options.
45
51
  */
46
- mode?: 'startsWith' | 'contains' | 'endsWith';
52
+ mode?: AutocompleteMode;
47
53
  /**
48
54
  * Use this function to render the desired text for each id. Leave it empty if the id is also the label.
49
55
  */
@@ -113,7 +119,7 @@ export type AutocompleteProps<T extends string, Multiple extends boolean | undef
113
119
  /**
114
120
  * Define min with that autocomplete can have. S => 328px. XS => 248px. @default 'S'
115
121
  */
116
- size?: 'S' | 'XS';
122
+ size?: AutocompleteSize;
117
123
  /**
118
124
  * Ref to the inner HTMLInputElement
119
125
  */
@@ -1,5 +1,6 @@
1
1
  import { DateInterval } from '../../../models/DateInterval';
2
2
  import { ComparisonInterval } from '../../../models/ComparisonInterval';
3
+ export declare const dateIntervalPickerVariants: readonly ["default", "input"];
3
4
  export type DateIntervalValues = {
4
5
  interval: DateInterval;
5
6
  startDate: Date;
@@ -22,10 +22,9 @@ export type DateIntervalPickerState = {
22
22
  isComparing: boolean | undefined;
23
23
  };
24
24
  export type DateIntervalPickerPopoverProps = {
25
- variant?: 'default' | 'input';
26
25
  interval: DateInterval;
27
- startDate?: Date;
28
- endDate?: Date;
26
+ startDate: Date;
27
+ endDate: Date;
29
28
  color: string;
30
29
  maxSelectableDays: number;
31
30
  disabled?: boolean;
@@ -50,5 +49,5 @@ export type DateIntervalPickerPopoverProps = {
50
49
  }) => void;
51
50
  onCancel: () => void;
52
51
  };
53
- declare const DateIntervalPickerPopover: ({ variant, interval, startDate, endDate, color, maxSelectableDays, allowCompare, comparisonInterval, comparisonStartDate, comparisonEndDate, comparisonColor, intersectionColor, anchorEl, minDate, maxDate, allowedIntervals, showTime, onApply, onCancel }: DateIntervalPickerPopoverProps) => import("react/jsx-runtime").JSX.Element;
52
+ declare const DateIntervalPickerPopover: ({ interval, startDate, endDate, color, maxSelectableDays, allowCompare, comparisonInterval, comparisonStartDate, comparisonEndDate, comparisonColor, intersectionColor, anchorEl, minDate, maxDate, allowedIntervals, showTime, onApply, onCancel }: DateIntervalPickerPopoverProps) => import("react/jsx-runtime").JSX.Element;
54
53
  export default DateIntervalPickerPopover;
@@ -0,0 +1,40 @@
1
+ import { DateIntervalValues } from '../date-interval-picker/DateIntervalPicker';
2
+ export type DateRangePickerProps = {
3
+ /**
4
+ * The start date of the date interval
5
+ */
6
+ startDate?: Date;
7
+ /**
8
+ * The end date of the date interval
9
+ */
10
+ endDate?: Date;
11
+ /**
12
+ * Function to be called when the date interval changes
13
+ */
14
+ onChange: (values: Partial<Pick<DateIntervalValues, 'startDate' | 'endDate'>>) => void;
15
+ /**
16
+ * The color to mark the selected interval. If not provided, the Theme primary color will be used.
17
+ */
18
+ color?: string;
19
+ /**
20
+ * The maximum quantity of days allowed to be selected in the date interval
21
+ */
22
+ maxSelectableDays: number;
23
+ /**
24
+ * Whether the date range picker is disabled
25
+ */
26
+ disabled?: boolean;
27
+ /**
28
+ * The minimum date allowed to be selected. Defaults to 1900-01-01.
29
+ */
30
+ minDate?: Date;
31
+ /**
32
+ * The maximum date allowed to be selected. Defaults to 2100-12-31.
33
+ */
34
+ maxDate?: Date;
35
+ };
36
+ /**
37
+ * Date range picker component, which allows to select a date range via a text input trigger.
38
+ */
39
+ declare const DateRangePicker: ({ startDate, endDate, onChange, color, maxSelectableDays, disabled, minDate, maxDate }: DateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
40
+ export default DateRangePicker;
@@ -0,0 +1,16 @@
1
+ export type DateRangePickerPopoverProps = {
2
+ startDate?: Date;
3
+ endDate?: Date;
4
+ color: string;
5
+ maxSelectableDays: number;
6
+ minDate: Date;
7
+ maxDate: Date;
8
+ anchorEl?: HTMLElement | null;
9
+ onApply: (values: {
10
+ startDate: Date;
11
+ endDate: Date;
12
+ }) => void;
13
+ onCancel: () => void;
14
+ };
15
+ declare const DateRangePickerPopover: ({ startDate, endDate, color, maxSelectableDays, minDate, maxDate, anchorEl, onApply, onCancel }: DateRangePickerPopoverProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default DateRangePickerPopover;
@@ -6,6 +6,8 @@ export { default as InputHelperText } from './InputHelperText';
6
6
  export type { InputHelperTextProps } from './InputHelperText';
7
7
  export { default as DateIntervalPicker } from './date-interval-picker/DateIntervalPicker';
8
8
  export type { DateIntervalPickerProps, DateIntervalValues } from './date-interval-picker/DateIntervalPicker';
9
+ export { default as DateRangePicker } from './date-range-picker/DateRangePicker';
10
+ export type { DateRangePickerProps } from './date-range-picker/DateRangePicker';
9
11
  export { default as SelectPopoverItem } from './SelectPopoverItem';
10
12
  export type { SelectPopoverItemProps } from './SelectPopoverItem';
11
13
  export { default as TimezoneSelector } from './TimezoneSelector';
@@ -2,6 +2,8 @@ import { SxProps } from '@mui/material';
2
2
  import * as React from 'react';
3
3
  import { ListItemButtonProps } from '../list/ListItemButton';
4
4
  import { DividerProps } from '../divider';
5
+ export declare const collapsiblePanelCollapseDirections: readonly ["down", "up"];
6
+ type CollapsiblePanelCollapseDirection = (typeof collapsiblePanelCollapseDirections)[number];
5
7
  export type CollapsiblePanelProps = React.PropsWithChildren<{
6
8
  sx?: SxProps;
7
9
  /**
@@ -34,7 +36,7 @@ export type CollapsiblePanelProps = React.PropsWithChildren<{
34
36
  /**
35
37
  * Whether the collapse will be placed down or up from the header.
36
38
  */
37
- collapseDirection?: 'down' | 'up';
39
+ collapseDirection?: CollapsiblePanelCollapseDirection;
38
40
  /**
39
41
  * Whether to add a Divider between header and panel or not. Default is false.
40
42
  */