@connectif/ui-components 3.0.4 → 4.0.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 CHANGED
@@ -1,43 +1,51 @@
1
1
  # Changelog
2
2
 
3
- ## [2.4.3] - 2025-11-25
3
+ ## [4.0.0] - 2026-01-13
4
4
 
5
5
  ### Added
6
6
 
7
- - Added changelog file in package.
8
- - Added optional centeredInScreen and paddingContent props to the SelectPopover component.
9
- - Modified emptyListPlaceholder prop to receive string | React.ReactNode in SelectPopover component.
10
- - Added optional sx, onMouseEnter, and onMouseLeave props to the EnhancedCard component.
11
- - Added new cellphone-off, filter-off and tag-hidden icons.
12
- - Added new Carousel component.
13
- - Added optional showTime prop in DateIntervalPicker component.
14
- - Added optional keepMounted prop in TabContent.
15
- - Added optional disableContentScroll prop in Tabs component.
7
+ - `ChipViewer` component has been added.
16
8
 
17
- ## [3.0.0] - 2025-12-11
9
+ ### Fixed
10
+
11
+ - Fixed bug with select selection in `Select` component.
12
+
13
+ ### Changed
14
+
15
+ - `TextField` changes its background color for readonly state.
16
+
17
+ ### Deprecated
18
+
19
+ - `Autocomplete` component removes limitValueTags prop.
20
+
21
+ ## [3.0.5] - 2025-12-29
18
22
 
19
23
  ### Added
20
24
 
21
- - `Tabs` now supports a `hideScrollButtons` and `hideLineTabs` prop.
25
+ - Added full month date format.
26
+ - Added "brain", "tools" and "sitemap-outline" icons.
22
27
 
23
- ### Changed
28
+ ## [3.0.4] - 2025-12-23
24
29
 
25
- - `Tabs` changes its styles to match the new design.
26
- - `DateIntervalPicker` changes buttons styles.
30
+ ### Added
27
31
 
28
- ### Fixed
32
+ - Added "rotate-3d-variant" icon.
29
33
 
30
- - Fixed an issue where reloading the `Tabs` component on a non-first tab caused an unwanted scroll effect.
31
- - Fixed change interval when showTime is true.
34
+ ## [3.0.3] - 2025-12-22
32
35
 
33
- ### Security
36
+ ### Added
34
37
 
35
- - Upgrade to Typescript 5.9
36
- - Upgrade cspell to 6.0.0 (latest)
38
+ - Added "minimizeIconId", "closeIconId" and "backIconId" props to MinimizableWindow component.
37
39
 
38
- ### Removed
40
+ ## [3.0.2] - 2025-12-16
39
41
 
40
- - `TabButton` no longer accepts the `disableUppercase` prop; Text always will be lowercase.
42
+ ### Added
43
+
44
+ - Added new styles for `Tabs`.
45
+
46
+ ### Fixed
47
+
48
+ - Fixed bug with timezone in `DateIntervalPicker`
41
49
 
42
50
  ## [3.0.1] - 2025-12-12
43
51
 
@@ -50,24 +58,41 @@
50
58
 
51
59
  - Fixed bug with timezone in `DateIntervalPicker`
52
60
 
53
- ## [3.0.2] - 2025-12-16
61
+ ## [3.0.0] - 2025-12-11
54
62
 
55
63
  ### Added
56
64
 
57
- - Added new styles for `Tabs`.
65
+ - `Tabs` now supports a `hideScrollButtons` and `hideLineTabs` prop.
66
+
67
+ ### Changed
68
+
69
+ - `Tabs` changes its styles to match the new design.
70
+ - `DateIntervalPicker` changes buttons styles.
58
71
 
59
72
  ### Fixed
60
73
 
61
- - Fixed bug with timezone in `DateIntervalPicker`
74
+ - Fixed an issue where reloading the `Tabs` component on a non-first tab caused an unwanted scroll effect.
75
+ - Fixed change interval when showTime is true.
62
76
 
63
- ## [3.0.3] - 2025-12-22
77
+ ### Security
64
78
 
65
- ### Added
79
+ - Upgrade to Typescript 5.9
80
+ - Upgrade cspell to 6.0.0 (latest)
66
81
 
67
- - Added "minimizeIconId", "closeIconId" and "backIconId" props to MinimizableWindow component.
82
+ ### Removed
68
83
 
69
- ## [3.0.4] - 2025-12-23
84
+ - `TabButton` no longer accepts the `disableUppercase` prop; Text always will be lowercase.
85
+
86
+ ## [2.4.3] - 2025-11-25
70
87
 
71
88
  ### Added
72
89
 
73
- - Added "rotate-3d-variant" icon.
90
+ - Added changelog file in package.
91
+ - Added optional centeredInScreen and paddingContent props to the SelectPopover component.
92
+ - Modified emptyListPlaceholder prop to receive string | React.ReactNode in SelectPopover component.
93
+ - Added optional sx, onMouseEnter, and onMouseLeave props to the EnhancedCard component.
94
+ - Added new cellphone-off, filter-off and tag-hidden icons.
95
+ - Added new Carousel component.
96
+ - Added optional showTime prop in DateIntervalPicker component.
97
+ - Added optional keepMounted prop in TabContent.
98
+ - Added optional disableContentScroll prop in Tabs component.
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { ThemeTypography } from '../../theme';
3
+ export declare const DEFAULT_DATA_TEST_ID = "chip-container";
4
+ export declare const TOOLTIP_DATA_TEST_ID = "chip-container-tooltip";
5
+ export declare const COUNTER_LABEL_DATA_TEST_ID = "chip-counter-label";
6
+ export declare const PLACEHOLDER_DATA_TEST_ID = "chip-container-placeholder";
7
+ type ChipContainerProps = {
8
+ containerRef: React.MutableRefObject<HTMLDivElement | null>;
9
+ visibleChips: string[];
10
+ hiddenChips: string[];
11
+ gap: string;
12
+ height: string;
13
+ typographyVariant?: ThemeTypography.TypographyVariant;
14
+ reserveHeight?: true;
15
+ placeholder?: string;
16
+ clickable?: boolean;
17
+ preventHiddenChipsTooltip?: true;
18
+ isDeletable?: boolean;
19
+ dataTestId?: string;
20
+ renderChip: (data: {
21
+ chipName: string;
22
+ index?: number;
23
+ maxWidth?: string;
24
+ isCounterLabel?: boolean;
25
+ }) => React.ReactNode;
26
+ };
27
+ declare const ChipContainer: ({ containerRef, gap, visibleChips, hiddenChips, placeholder, isDeletable, height, typographyVariant, reserveHeight, clickable, preventHiddenChipsTooltip, dataTestId, renderChip }: ChipContainerProps) => import("react/jsx-runtime").JSX.Element;
28
+ export default ChipContainer;
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import { ThemeTypography } from '../../theme';
3
+ import { ChipProps } from './Chip';
4
+ import { SxProps } from '@mui/material';
5
+ export declare const CHIP_DATA_TEST_ID = "chip-viewer-chip";
6
+ declare const chipViewerStyle: {
7
+ circle: {
8
+ borderRadius: string;
9
+ backgroundColor: string;
10
+ color: string;
11
+ };
12
+ square: {
13
+ borderRadius: string;
14
+ backgroundColor: string;
15
+ color: string;
16
+ };
17
+ };
18
+ export type ChipViewerProps = {
19
+ values: string[];
20
+ chipSx?: SxProps;
21
+ chipSize?: ChipProps['size'];
22
+ chipVariant?: ChipProps['variant'];
23
+ placeholder?: string;
24
+ numberLines?: number;
25
+ reserveHeight?: true;
26
+ variant?: keyof typeof chipViewerStyle;
27
+ typographyVariant?: ThemeTypography.TypographyVariant;
28
+ preventHiddenChipsTooltip?: true;
29
+ /**
30
+ * Property to adjust maximum width. If property is null, maxWidth will be containerRef.current.offsetWidth
31
+ */
32
+ maxWidth?: number;
33
+ /**
34
+ * Function to set custom chip name
35
+ * @param id
36
+ * @returns
37
+ */
38
+ renderChipLabel?: (chipName: string) => string;
39
+ onClickChip?: (chip: string) => void;
40
+ onRemoveChip?: (event: React.SyntheticEvent, id: string) => void;
41
+ onHasHiddenChipsChange?: (hasHiddenChips: boolean) => void;
42
+ };
43
+ declare const ChipViewer: ({ values, chipSx, chipSize, chipVariant, placeholder, numberLines, reserveHeight, variant, preventHiddenChipsTooltip, typographyVariant, maxWidth, renderChipLabel, onRemoveChip, onClickChip, onHasHiddenChipsChange }: ChipViewerProps) => import("react/jsx-runtime").JSX.Element;
44
+ export default ChipViewer;
@@ -1,6 +1,8 @@
1
1
  export { default as Chip } from './Chip';
2
2
  export { default as ChipList } from './ChipList';
3
3
  export { default as MenuChip } from './MenuChip';
4
+ export { default as ChipViewer } from './ChipViewer';
4
5
  export type { ChipProps } from './Chip';
5
6
  export type { ChipListProps } from './ChipList';
6
7
  export type { MenuChipProps } from './MenuChip';
8
+ export type { ChipViewerProps } from './ChipViewer';
@@ -270,6 +270,7 @@ export declare const icons: {
270
270
  box: string;
271
271
  'box-cutter': string;
272
272
  'box-shadow': string;
273
+ brain: string;
273
274
  bridge: string;
274
275
  briefcase: string;
275
276
  'briefcase-check': string;
@@ -1583,6 +1584,7 @@ export declare const icons: {
1583
1584
  'sim-alert': string;
1584
1585
  'sim-off': string;
1585
1586
  sitemap: string;
1587
+ 'sitemap-outline': string;
1586
1588
  'skip-backward': string;
1587
1589
  'skip-forward': string;
1588
1590
  'skip-next': string;
@@ -1750,6 +1752,7 @@ export declare const icons: {
1750
1752
  timetable: string;
1751
1753
  'toggle-switch': string;
1752
1754
  'toggle-switch-off': string;
1755
+ tools: string;
1753
1756
  tooltip: string;
1754
1757
  'tooltip-edit': string;
1755
1758
  'tooltip-image': string;
@@ -133,6 +133,14 @@ export type TextFieldProps = {
133
133
  * Called when text area scroll.
134
134
  */
135
135
  onScroll?: (scrollTop: number) => void;
136
+ /**
137
+ * Called when mouse enters in text field.
138
+ */
139
+ onMouseEnter?: () => void;
140
+ /**
141
+ * Called when mouse leaves in text field.
142
+ */
143
+ onMouseLeave?: () => void;
136
144
  /**
137
145
  * Set if input is readonly
138
146
  */
@@ -37,6 +37,14 @@ export type TextFieldContainerProps = React.PropsWithChildren<{
37
37
  * Called on click on this component
38
38
  */
39
39
  onClick?: BoxProps['onClick'];
40
+ /**
41
+ * Called when mouse enters in text field.
42
+ */
43
+ onMouseEnter?: () => void;
44
+ /**
45
+ * Called when mouse leaves in text field.
46
+ */
47
+ onMouseLeave?: () => void;
40
48
  className?: string;
41
49
  /**
42
50
  * Settled directly in DOM element, for testing easy location purposes.
@@ -84,6 +92,14 @@ declare const TextFieldContainer: React.ForwardRefExoticComponent<{
84
92
  * Called on click on this component
85
93
  */
86
94
  onClick?: BoxProps["onClick"];
95
+ /**
96
+ * Called when mouse enters in text field.
97
+ */
98
+ onMouseEnter?: () => void;
99
+ /**
100
+ * Called when mouse leaves in text field.
101
+ */
102
+ onMouseLeave?: () => void;
87
103
  className?: string;
88
104
  /**
89
105
  * Settled directly in DOM element, for testing easy location purposes.
@@ -1,10 +1,5 @@
1
1
  import * as React from 'react';
2
- import { DebouncedTextFieldProps } from './DebouncedTextField';
3
- export type AutocompleteValue<T, Multiple> = Multiple extends undefined | false ? T | '' : T[];
4
- type TextFieldFilteredProps = Pick<DebouncedTextFieldProps, 'autoFocus' | 'activeColor' | 'data-testid' | 'helperText' | 'highlighted' | 'iconId' | 'isError' | 'label' | 'placeholder' | 'debounce' | 'sx' | 'inputSx' | 'maxLength' | 'id' | 'endAdornment'>;
5
- export type AutocompleteOption<T extends string> = {
6
- readonly id: T;
7
- };
2
+ import { AutocompleteOption, AutocompleteValue, TextFieldFilteredProps } from '../../../models/Autocomplete';
8
3
  export type AutocompleteProps<T extends string, Multiple extends boolean | undefined, Value = AutocompleteValue<T, Multiple>, Option = AutocompleteOption<T>> = {
9
4
  /**
10
5
  * The variant of the Autocomplete
@@ -93,10 +88,6 @@ export type AutocompleteProps<T extends string, Multiple extends boolean | undef
93
88
  * Custom text to be shown when number of values reaches maxValues.
94
89
  */
95
90
  maxValuesText?: string;
96
- /**
97
- * Number of selected values to be shown when multiple is enabled. Default value is 0, which shows all selected values tags.
98
- */
99
- limitValueTags?: number;
100
91
  /**
101
92
  * Callback when options list popover is opened.
102
93
  */
@@ -117,6 +108,5 @@ export type AutocompleteProps<T extends string, Multiple extends boolean | undef
117
108
  /**
118
109
  * Powered TextField with the ability to select from a predefined list of options, allowing to select one or multiple values.
119
110
  */
120
- declare const Autocomplete: <T extends string, Multiple extends boolean | undefined = undefined, Value = AutocompleteValue<T, Multiple>>({ variant, value, multiple, textFieldProps, options, disabled, mode, isCaseSensitive, isDiacriticSensitive, onChange, renderLabel, isLoading, onSearch, loadingText, noOptionsText, allowFreeText, addNewValueText, closeOnSelect, maxValueLength, maxValues, maxValuesText, limitValueTags, onClose, onOpen, disableClear }: AutocompleteProps<T, Multiple, Value>, ref: React.Ref<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
121
- declare const _default: typeof Autocomplete;
122
- export default _default;
111
+ declare const Autocomplete: <T extends string, Multiple extends boolean | undefined = undefined, Value = AutocompleteValue<T, Multiple>>({ variant, value, multiple, textFieldProps, options, disabled, mode, isCaseSensitive, isDiacriticSensitive, onChange, renderLabel, isLoading, onSearch, loadingText, noOptionsText, allowFreeText, addNewValueText, closeOnSelect, maxValueLength, maxValues, maxValuesText, onClose, onOpen, disableClear }: AutocompleteProps<T, Multiple, Value>) => import("react/jsx-runtime").JSX.Element;
112
+ export default Autocomplete;
@@ -0,0 +1,69 @@
1
+ import * as React from 'react';
2
+ import { AutocompleteValue, TextFieldFilteredProps } from '../../../models/Autocomplete';
3
+ export type AutocompleteInputProps<T extends string, Multiple extends boolean | undefined, Value = AutocompleteValue<T, Multiple>> = {
4
+ /**
5
+ * The variant of the Autocomplete
6
+ */
7
+ variant?: 'default' | 'text';
8
+ /**
9
+ * The value handled by this Autocomplete component. If multiple=true, it should be an array of ids.
10
+ * If multiple=false (by default) it should be a string.
11
+ */
12
+ value: Value;
13
+ /**
14
+ * If has filtered options in dropdown
15
+ */
16
+ hasFilteredOptions: boolean;
17
+ /**
18
+ * Whether the autocomplete is disabled or not.
19
+ */
20
+ disabled?: boolean;
21
+ /**
22
+ * Whether this component is working in multiple mode or single mode. By default it is single mode.
23
+ * See `value` prop description for more info.
24
+ */
25
+ multiple?: Multiple;
26
+ /**
27
+ * Properties to be pass through inner TextField component.
28
+ */
29
+ textFieldProps?: TextFieldFilteredProps;
30
+ /**
31
+ * Use this function to render the desired text for each id. Leave it empty if the id is also the label.
32
+ */
33
+ renderLabel: (id: T) => string;
34
+ /**
35
+ * Maximum length for allowFreeText value
36
+ */
37
+ maxValueLength?: number;
38
+ /**
39
+ * Maximum amount of values allowed when multiple is enabled. If not set, there is no limit.
40
+ */
41
+ maxValues?: number;
42
+ /**
43
+ * Custom text to be shown when number of values reaches maxValues.
44
+ */
45
+ maxValuesText?: string;
46
+ /**
47
+ * Disables clear button at the end of the component when field is dirty.
48
+ */
49
+ disableClear?: boolean;
50
+ isOpenPopover: boolean;
51
+ /**
52
+ * Ref to the outer HTMLDivElement
53
+ */
54
+ containerRef: React.RefObject<HTMLDivElement>;
55
+ inputRef: React.RefObject<HTMLInputElement>;
56
+ inputValue: string;
57
+ setInputValue: (value: string) => void;
58
+ placeholder: string;
59
+ onClosePopover: () => void;
60
+ onOpenPopover: () => void;
61
+ onSearchValueChange: (event: React.SyntheticEvent, searchValue: string) => void;
62
+ onPressEnter: (event: React.SyntheticEvent, inputValue: string) => void;
63
+ onRemoveValue: (event: React.SyntheticEvent, value: Value) => void;
64
+ };
65
+ /**
66
+ * Powered TextField Input.
67
+ */
68
+ declare const AutocompleteInput: <T extends string, Multiple extends boolean | undefined = undefined, Value = AutocompleteValue<T, Multiple>>({ variant, value, multiple, textFieldProps, hasFilteredOptions, disabled, renderLabel, maxValueLength, maxValues, maxValuesText, disableClear, containerRef, inputRef, onClosePopover, onOpenPopover, isOpenPopover, inputValue, setInputValue, placeholder, onSearchValueChange, onPressEnter, onRemoveValue }: AutocompleteInputProps<T, Multiple, Value>) => import("react/jsx-runtime").JSX.Element;
69
+ export default AutocompleteInput;
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { AutocompleteValue } from '../../../models/Autocomplete';
3
+ export type AutocompleteInputSelectionProps<T extends string, Multiple extends boolean | undefined, Value = AutocompleteValue<T, Multiple>> = {
4
+ /**
5
+ * The value handled by this Autocomplete component. If multiple=true, it should be an array of ids.
6
+ * If multiple=false (by default) it should be a string.
7
+ */
8
+ value: Value;
9
+ /**
10
+ * Whether the autocomplete is disabled or not.
11
+ */
12
+ disabled?: boolean;
13
+ /**
14
+ * Use this function to render the desired text for each id. Leave it empty if the id is also the label.
15
+ */
16
+ renderLabel: (id: T) => string;
17
+ /**
18
+ * Disables clear button at the end of the component when field is dirty.
19
+ */
20
+ disableClear?: boolean;
21
+ isOpenPopover: boolean;
22
+ inputValue: string;
23
+ isHover: boolean;
24
+ onOpenPopover: () => void;
25
+ onRemoveValue: (event: React.SyntheticEvent, value: Value) => void;
26
+ };
27
+ declare const AutocompleteInputSelection: <T extends string, Multiple extends boolean | undefined = undefined, Value = AutocompleteValue<T, Multiple>>({ value, disabled, renderLabel, disableClear, onOpenPopover, isOpenPopover, inputValue, isHover, onRemoveValue }: AutocompleteInputSelectionProps<T, Multiple, Value>) => import("react/jsx-runtime").JSX.Element;
28
+ export default AutocompleteInputSelection;
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ import { FixedSizeList } from 'react-window';
3
+ import { AutocompleteLabeledOption, AutocompleteOption, SelectedIndex } from '../../../models/Autocomplete';
4
+ type AutocompleteListProps<T extends string, Multiple extends boolean | undefined, Option = AutocompleteOption<T>> = {
5
+ /**
6
+ * The available options to be shown on dropdown
7
+ */
8
+ options: readonly Option[];
9
+ filteredOptions: AutocompleteLabeledOption<T>[];
10
+ /**
11
+ * Whether the autocomplete options are loading or not. Use only on initial load or if using async search approach
12
+ */
13
+ isLoading?: boolean;
14
+ /**
15
+ * Custom text to be shown when autocomplete options are loading by the `isLoading` prop.
16
+ */
17
+ loadingText?: string;
18
+ /**
19
+ * Custom text to be shown when no options are available to be selected.
20
+ */
21
+ noOptionsText?: string;
22
+ /**
23
+ * Custom text to be shown when allowFreeText feature is enabled and written text is a new value to add.
24
+ */
25
+ addNewValueText?: string;
26
+ inputContainerRef: React.RefObject<HTMLDivElement>;
27
+ virtualListRef: React.RefObject<FixedSizeList<unknown>>;
28
+ listRef: React.RefObject<HTMLDivElement>;
29
+ isOpen: boolean;
30
+ selectedIndex: SelectedIndex<Multiple>;
31
+ highlightedIndex: number;
32
+ onAddSelectedValue: (event: React.MouseEvent<HTMLElement, MouseEvent>, option: AutocompleteLabeledOption<T>) => void;
33
+ onClickAwayPopover: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
34
+ };
35
+ /**
36
+ * Powered autocomplete list.
37
+ */
38
+ declare const AutocompleteList: <T extends string, Multiple extends boolean | undefined = undefined>({ options, isLoading, loadingText, noOptionsText, addNewValueText, inputContainerRef, isOpen, selectedIndex, highlightedIndex, virtualListRef, listRef, filteredOptions, onAddSelectedValue, onClickAwayPopover }: AutocompleteListProps<T, Multiple>) => import("react/jsx-runtime").JSX.Element;
39
+ export default AutocompleteList;
@@ -20,7 +20,7 @@ export { default as CategorizedPicker } from './CategorizedPicker';
20
20
  export type { CategorizedPickerProps } from './CategorizedPicker';
21
21
  export { default as ItemSelector } from './ItemSelector';
22
22
  export type { ItemSelectorProps, ItemSelectorItem } from './ItemSelector';
23
- export { default as Autocomplete } from './Autocomplete';
23
+ export { default as Autocomplete } from './autocomplete/Autocomplete';
24
24
  export { default as Select } from './Select';
25
25
  export { default as Switch } from './Switch';
26
26
  export { default as TextField } from './TextField';
@@ -35,7 +35,7 @@ export { default as SelectPopover } from './SelectPopover';
35
35
  export { default as Checkbox } from './Checkbox';
36
36
  export { default as Radio } from './Radio';
37
37
  export { default as PageSelector } from './PageSelector';
38
- export type { AutocompleteProps } from './Autocomplete';
38
+ export type { AutocompleteProps } from './autocomplete/Autocomplete';
39
39
  export type { SelectProps } from './Select';
40
40
  export type { SwitchProps } from './Switch';
41
41
  export type { TextFieldProps } from './TextField';