@carto/ps-react-ui 1.2.7 → 1.3.1

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.
@@ -18,7 +18,7 @@ import { GroupedChipsProps } from './types';
18
18
  * ```jsx
19
19
  * <GroupedChips
20
20
  * items={[
21
- * { id: '1', label: 'Option 1' },
21
+ * { id: '1', label: 'Option 1', info: 'Option 1 is the prefered option if you prefer one.' },
22
22
  * { id: '2', label: 'Option 2' },
23
23
  * ]}
24
24
  * label='Select'
@@ -27,4 +27,4 @@ import { GroupedChipsProps } from './types';
27
27
  * />;
28
28
  * ```
29
29
  */
30
- export declare function GroupedChips({ label, items, size, onDelete, ChipProps, BoxProps, }: GroupedChipsProps): JSX.Element;
30
+ export declare function GroupedChips({ label, items, size, onDelete, ChipProps, BoxProps, TooltipProps, }: GroupedChipsProps): JSX.Element;
@@ -1,7 +1,8 @@
1
- import type { BoxProps, ChipProps } from '@material-ui/core';
1
+ import type { BoxProps, ChipProps, TooltipProps } from '@material-ui/core';
2
2
  export interface GroupedChipsOption {
3
3
  id: string | number;
4
4
  label: string;
5
+ info?: string;
5
6
  }
6
7
  export interface GroupedChipsProps {
7
8
  label?: string;
@@ -10,4 +11,5 @@ export interface GroupedChipsProps {
10
11
  onDelete: (item: GroupedChipsOption) => void;
11
12
  ChipProps?: ChipProps;
12
13
  BoxProps?: BoxProps;
14
+ TooltipProps?: TooltipProps;
13
15
  }
@@ -10,7 +10,8 @@ export * from './list/types';
10
10
  export { SectionContainer } from './section-container/section-container.component';
11
11
  export * from './section-container/types';
12
12
  export { SimpleSelect } from './selects/simple-select/simple-select.component';
13
- export { AutocompleteSelect } from './selects/autocomplete-select/autocomplete-select.component';
13
+ export { AutocompleteSelect } from './selects/autocomplete/autocomplete-select/autocomplete-select.component';
14
+ export { AutocompleteSelectSimple } from './selects/autocomplete/autocomplete-select-simple/autocomplete-select-simple.component';
14
15
  export { createOptionsFromArray } from './selects/simple-select/create-options-from-array.utils';
15
16
  export * from './selects/types';
16
17
  export { Table } from './table/table.component';
@@ -1,4 +1,4 @@
1
- import { AutocompleteSelectProps } from '../types';
1
+ import { AutocompleteSelectProps } from '../../types';
2
2
  /**
3
3
  * AutocompleteSelect component
4
4
  *
@@ -22,16 +22,12 @@ import { AutocompleteSelectProps } from '../types';
22
22
  * ```jsx
23
23
  * <AutocompleteSelect
24
24
  * options={[
25
- * { value: '1', label: 'Option 1' },
26
- * { value: '2', label: 'Option 2' },
25
+ * { value: '1', label: 'Option 1', group: 'Group 1' },
26
+ * { value: '2', label: 'Option 2', group: 'Group 1' },
27
27
  * ]}
28
28
  * hasAll={true}
29
29
  * grouped={true}
30
30
  * label='Select'
31
- * divisionType={{
32
- * singular: 'option',
33
- * plural: 'options',
34
- * }}
35
31
  * placeholder='Select'
36
32
  * selectAllLabel='Select all'
37
33
  * size='small'
@@ -0,0 +1,35 @@
1
+ import { AutocompleteSelectSimpleProps } from '../../types';
2
+ /**
3
+ * AutocompleteSelectSimple component
4
+ *
5
+ * @param {AutocompleteSelectSimpleProps} props - Material UI Autocomplete props
6
+ *
7
+ * @defaultValues
8
+ *
9
+ * | Prop | Value |
10
+ * | --- | --- |
11
+ * | `grouped` | `false` |
12
+ * | `placeholder` | `'Select'` |
13
+ * | `size` | `'small'` |
14
+ *
15
+ * @remarks
16
+ * The AutocompleteSelectSimple component is a wrapper around the Material UI Autocomplete component. More information about the props can be found here: https://v4.mui.com/api/autocomplete
17
+ *
18
+ * @example
19
+ *
20
+ * ```jsx
21
+ * <AutocompleteSelectSimple
22
+ * options={[
23
+ * { value: '1', label: 'Option 1', group: 'Group 1' },
24
+ * { value: '2', label: 'Option 2', group: 'Group 1' },
25
+ * ]}
26
+ * grouped={true}
27
+ * label='Select'
28
+ * placeholder='Select'
29
+ * size='small'
30
+ * value={value}
31
+ * onChange={onChange}
32
+ * />;
33
+ * ```
34
+ */
35
+ export declare function AutocompleteSelectSimple({ options, grouped, label, placeholder, size, value, onChange, ...props }: AutocompleteSelectSimpleProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { OptionProps } from '../../types';
2
+ export declare function AutocompleteSelectOption({ option, state: { selected }, simple, }: OptionProps): JSX.Element;
@@ -14,6 +14,7 @@ export interface SimpleSelectProps extends SelectProps {
14
14
  export interface OptionProps<T = SelectOption> {
15
15
  option: T;
16
16
  state: AutocompleteRenderOptionState;
17
+ simple?: boolean;
17
18
  }
18
19
  export interface AutocompleteSelectProps<T = SelectOption, Multiple extends boolean | undefined = true, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> extends Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, 'onChange' | 'renderInput'> {
19
20
  grouped?: boolean;
@@ -28,3 +29,8 @@ export interface AutocompleteSelectProps<T = SelectOption, Multiple extends bool
28
29
  };
29
30
  onChange: (event: ChangeEvent<unknown>, options: Value<T, Multiple, DisableClearable, FreeSolo>, reason: AutocompleteChangeReason, detail?: AutocompleteChangeDetails<T>) => void;
30
31
  }
32
+ export interface AutocompleteSelectSimpleProps<T = SelectOption, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> extends Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, 'onChange' | 'renderInput'> {
33
+ grouped?: boolean;
34
+ label?: ReactNode;
35
+ onChange: (event: ChangeEvent<unknown>, options: Value<T, Multiple, DisableClearable, FreeSolo>, reason: AutocompleteChangeReason, detail?: AutocompleteChangeDetails<T>) => void;
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "1.2.7",
3
+ "version": "1.3.1",
4
4
  "description": "CARTO's Professional Service React UI library",
5
5
  "files": [
6
6
  "dist"
@@ -1,2 +0,0 @@
1
- import { OptionProps } from '../types';
2
- export declare function AutocompleteSelectOption({ option, state: { selected }, }: OptionProps): JSX.Element;