@bspk/ui 1.1.17 → 1.1.19
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/Avatar.d.ts +17 -6
- package/dist/Avatar.js +15 -6
- package/dist/Avatar.js.map +1 -1
- package/dist/AvatarGroup.d.ts +49 -0
- package/dist/AvatarGroup.js +18 -0
- package/dist/AvatarGroup.js.map +1 -0
- package/dist/Badge.js +1 -1
- package/dist/Button.d.ts +14 -4
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.d.ts +15 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.d.ts +6 -3
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CheckboxOption.d.ts +8 -1
- package/dist/CheckboxOption.js.map +1 -1
- package/dist/Chip.d.ts +3 -1
- package/dist/Chip.js.map +1 -1
- package/dist/Dialog.d.ts +3 -3
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +1 -1
- package/dist/Dropdown.d.ts +33 -7
- package/dist/Dropdown.js +5 -5
- package/dist/Dropdown.js.map +1 -1
- package/dist/ListItem.js +1 -1
- package/dist/Menu.d.ts +40 -21
- package/dist/Menu.js +63 -41
- package/dist/Menu.js.map +1 -1
- package/dist/NumberInput.d.ts +5 -1
- package/dist/NumberInput.js +7 -5
- package/dist/NumberInput.js.map +1 -1
- package/dist/Portal.d.ts +5 -1
- package/dist/Portal.js.map +1 -1
- package/dist/ProgressBar.d.ts +4 -0
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressionStepper.d.ts +9 -2
- package/dist/ProgressionStepper.js +1 -1
- package/dist/ProgressionStepper.js.map +1 -1
- package/dist/ProgressionStepperBar.d.ts +6 -0
- package/dist/ProgressionStepperBar.js.map +1 -1
- package/dist/Radio.d.ts +16 -2
- package/dist/Radio.js +2 -2
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.d.ts +26 -3
- package/dist/RadioGroup.js +3 -3
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioOption.d.ts +9 -1
- package/dist/RadioOption.js.map +1 -1
- package/dist/SearchBar.d.ts +30 -4
- package/dist/SearchBar.js +16 -15
- package/dist/SearchBar.js.map +1 -1
- package/dist/SegmentedControl.d.ts +21 -2
- package/dist/SegmentedControl.js +1 -1
- package/dist/SegmentedControl.js.map +1 -1
- package/dist/Switch.d.ts +1 -1
- package/dist/SwitchGroup.d.ts +13 -6
- package/dist/SwitchGroup.js +1 -1
- package/dist/SwitchGroup.js.map +1 -1
- package/dist/TabGroup.d.ts +23 -5
- package/dist/TabGroup.js +1 -1
- package/dist/TabGroup.js.map +1 -1
- package/dist/Tag.d.ts +5 -2
- package/dist/Tag.js +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/TextInput.d.ts +15 -6
- package/dist/TextInput.js +11 -5
- package/dist/TextInput.js.map +1 -1
- package/dist/Textarea.d.ts +3 -3
- package/dist/avatar-group.css +1 -0
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/button.css +1 -1
- package/dist/demo/ExampleModalRender.d.ts +7 -0
- package/dist/demo/ExampleModalRender.js +16 -0
- package/dist/demo/ExampleModalRender.js.map +1 -0
- package/dist/demo/ExamplePlaceholder.d.ts +7 -0
- package/dist/demo/ExamplePlaceholder.js +13 -0
- package/dist/demo/ExamplePlaceholder.js.map +1 -0
- package/dist/demo/examples.d.ts +101 -0
- package/dist/demo/examples.js +483 -0
- package/dist/demo/examples.js.map +1 -0
- package/dist/divider.css +1 -1
- package/dist/dropdown.css +1 -1
- package/dist/hooks/useKeyboardNavigation.js +5 -2
- package/dist/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/hooks/useOptionIconsInvalid.d.ts +10 -1
- package/dist/hooks/useOptionIconsInvalid.js.map +1 -1
- package/dist/index.d.ts +4 -26
- package/dist/index.js.map +1 -1
- package/dist/list-item.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/segmented-control.css +1 -1
- package/dist/tab-group.css +1 -1
- package/dist/tag.css +1 -1
- package/dist/text-input.css +1 -1
- package/dist/utils/children.js.map +1 -1
- package/meta-types.ts +2 -0
- package/meta.ts +76 -42
- package/package.json +1 -1
- package/src/Avatar.tsx +35 -8
- package/src/AvatarGroup.tsx +71 -0
- package/src/Button.tsx +14 -4
- package/src/Checkbox.tsx +25 -11
- package/src/CheckboxGroup.tsx +6 -3
- package/src/CheckboxOption.tsx +9 -2
- package/src/Chip.tsx +3 -1
- package/src/Dialog.tsx +3 -3
- package/src/Dropdown.tsx +40 -11
- package/src/Menu.tsx +159 -108
- package/src/NumberInput.tsx +15 -6
- package/src/Portal.tsx +5 -1
- package/src/ProgressBar.tsx +4 -0
- package/src/ProgressionStepper.tsx +9 -2
- package/src/ProgressionStepperBar.tsx +6 -0
- package/src/Radio.tsx +21 -4
- package/src/RadioGroup.tsx +34 -6
- package/src/RadioOption.tsx +11 -2
- package/src/SearchBar.tsx +87 -44
- package/src/SegmentedControl.tsx +21 -2
- package/src/Switch.tsx +1 -1
- package/src/SwitchGroup.tsx +19 -7
- package/src/TabGroup.tsx +23 -5
- package/src/Tag.tsx +5 -2
- package/src/TextInput.tsx +25 -15
- package/src/Textarea.tsx +3 -3
- package/src/avatar-group.scss +17 -0
- package/src/avatar.scss +26 -2
- package/src/badge.scss +1 -0
- package/src/button.scss +1 -0
- package/src/demo/ExampleModalRender.tsx +37 -0
- package/src/demo/ExamplePlaceholder.tsx +40 -0
- package/src/demo/examples.tsx +699 -0
- package/src/divider.scss +2 -0
- package/src/dropdown.scss +5 -0
- package/src/hooks/useKeyboardNavigation.ts +3 -2
- package/src/hooks/useOptionIconsInvalid.ts +10 -1
- package/src/index.ts +5 -32
- package/src/list-item.scss +5 -1
- package/src/menu.scss +5 -1
- package/src/segmented-control.scss +1 -0
- package/src/tab-group.scss +1 -0
- package/src/tag.scss +1 -0
- package/src/text-input.scss +13 -18
- package/src/utils/children.ts +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Avatar, AvatarProps, SizeVariant } from './Avatar';
|
|
2
|
+
import './avatar-group.scss';
|
|
3
|
+
|
|
4
|
+
export type AvatarItem = Pick<AvatarProps, 'color' | 'icon' | 'image' | 'initials' | 'name'>;
|
|
5
|
+
|
|
6
|
+
export type AvatarGroupProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The avatars to display in the group.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* [
|
|
12
|
+
* { name: 'Jane Doe', image: '/path/to/image.jpg' },
|
|
13
|
+
* { name: 'John Smith', initials: 'JS' },
|
|
14
|
+
* ];
|
|
15
|
+
*
|
|
16
|
+
* @type Array<AvatarItem>
|
|
17
|
+
* @required
|
|
18
|
+
*/
|
|
19
|
+
items: AvatarItem[];
|
|
20
|
+
/**
|
|
21
|
+
* Size of the avatar group.
|
|
22
|
+
*
|
|
23
|
+
* @default small
|
|
24
|
+
*/
|
|
25
|
+
size?: Extract<SizeVariant, 'large' | 'medium' | 'small' | 'x-small'>;
|
|
26
|
+
/**
|
|
27
|
+
* The maximum number of avatars to display before showing the overflowCount.
|
|
28
|
+
*
|
|
29
|
+
* This is used to limit the number of avatars displayed in the group.
|
|
30
|
+
*
|
|
31
|
+
* @minimum 3
|
|
32
|
+
* @maximum 5
|
|
33
|
+
*/
|
|
34
|
+
max?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The variant of the avatar group.
|
|
37
|
+
*
|
|
38
|
+
* @default spread
|
|
39
|
+
*/
|
|
40
|
+
variant?: 'spread' | 'stacked';
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* AvatarGroup component displays a group of avatars.
|
|
45
|
+
*
|
|
46
|
+
* @name AvatarGroup
|
|
47
|
+
*/
|
|
48
|
+
function AvatarGroup({ items, size = 'small', max = 5, variant }: AvatarGroupProps) {
|
|
49
|
+
if (!Array.isArray(items) || !items?.length) return null;
|
|
50
|
+
|
|
51
|
+
const overFlowCount = items.length - max;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div data-bspk="avatar-group" data-max={max} data-size={size} data-variant={variant}>
|
|
55
|
+
<div data-wrap>
|
|
56
|
+
{items.map((item, index) => (
|
|
57
|
+
<Avatar key={index} {...item} size={size} />
|
|
58
|
+
))}
|
|
59
|
+
{overFlowCount > 0 && (
|
|
60
|
+
<div aria-hidden data-bspk="avatar" data-size={size}>
|
|
61
|
+
<span data-overflow-count>+{overFlowCount}</span>
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
AvatarGroup.bspkName = 'AvatarGroup';
|
|
70
|
+
|
|
71
|
+
export { AvatarGroup };
|
package/src/Button.tsx
CHANGED
|
@@ -9,10 +9,18 @@ import { ButtonSize, CommonProps, ElementProps } from './';
|
|
|
9
9
|
|
|
10
10
|
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
11
11
|
|
|
12
|
-
export type ButtonProps<As extends ElementType = 'button'> = CommonProps<'disabled'
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type ButtonProps<As extends ElementType = 'button'> = CommonProps<'disabled'> & {
|
|
13
|
+
/**
|
|
14
|
+
* The label of the button.
|
|
15
|
+
*
|
|
16
|
+
* @required
|
|
17
|
+
*/
|
|
18
|
+
label: string;
|
|
19
|
+
/**
|
|
20
|
+
* The icon of the button.
|
|
21
|
+
*
|
|
22
|
+
* @type BspkIcon
|
|
23
|
+
*/
|
|
16
24
|
icon?: ReactNode;
|
|
17
25
|
/**
|
|
18
26
|
* Shows the button label. When label isn't showing it is used in a tooltip and as the aria-label prop.
|
|
@@ -59,6 +67,8 @@ export type ButtonProps<As extends ElementType = 'button'> = CommonProps<'disabl
|
|
|
59
67
|
children?: ReactNode;
|
|
60
68
|
/** The tool tip text that appears when hovered. */
|
|
61
69
|
toolTip?: string;
|
|
70
|
+
/** The function to call when the button is clicked. */
|
|
71
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
62
72
|
};
|
|
63
73
|
|
|
64
74
|
/**
|
package/src/Checkbox.tsx
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import './checkbox.scss';
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { ChangeEvent, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { CommonProps, ElementProps, InvalidPropsLibrary } from './';
|
|
5
5
|
|
|
6
|
-
export type CheckboxProps =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
export type CheckboxProps = CommonProps<'aria-label' | 'disabled' | 'name'> &
|
|
7
|
+
InvalidPropsLibrary &
|
|
8
|
+
Required<CommonProps<'value'>> & {
|
|
9
|
+
/**
|
|
10
|
+
* If the checkbox is partially checked or
|
|
11
|
+
* [indeterminate](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
indeterminate?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Marks the checkbox as checked.
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The function to call when the checkbox is checked or unchecked.
|
|
24
|
+
*
|
|
25
|
+
* @required
|
|
26
|
+
*/
|
|
27
|
+
onChange: (checked: boolean, event: ChangeEvent<HTMLInputElement>) => void;
|
|
28
|
+
};
|
|
15
29
|
|
|
16
30
|
/**
|
|
17
31
|
* A control that allows users to choose one or more items from a list or turn an feature on or off. This is the base
|
package/src/CheckboxGroup.tsx
CHANGED
|
@@ -9,9 +9,12 @@ export type CheckboxGroupProps = CommonProps<'aria-label'> & {
|
|
|
9
9
|
/**
|
|
10
10
|
* The function to call when the checkboxes are changed.
|
|
11
11
|
*
|
|
12
|
+
* @example
|
|
13
|
+
* (values) => setState({ values });
|
|
14
|
+
*
|
|
12
15
|
* @required
|
|
13
16
|
*/
|
|
14
|
-
onChange: (
|
|
17
|
+
onChange: (values: string[]) => void;
|
|
15
18
|
/**
|
|
16
19
|
* The input control name of the checkboxes.
|
|
17
20
|
*
|
|
@@ -21,14 +24,14 @@ export type CheckboxGroupProps = CommonProps<'aria-label'> & {
|
|
|
21
24
|
/**
|
|
22
25
|
* The options for the checkboxes.
|
|
23
26
|
*
|
|
24
|
-
* @type CheckboxGroupOption
|
|
27
|
+
* @type Array<CheckboxGroupOption>
|
|
25
28
|
* @required
|
|
26
29
|
*/
|
|
27
30
|
options: CheckboxGroupOption[];
|
|
28
31
|
/**
|
|
29
32
|
* The values of the checked checkboxes.
|
|
30
33
|
*
|
|
31
|
-
* @type string
|
|
34
|
+
* @type Array<string>
|
|
32
35
|
*/
|
|
33
36
|
values?: CheckboxGroupProps['options'][number]['value'][];
|
|
34
37
|
/**
|
package/src/CheckboxOption.tsx
CHANGED
|
@@ -4,8 +4,15 @@ import { ToggleOptionProps, ToggleOption } from './ToggleOption';
|
|
|
4
4
|
import { InvalidPropsLibrary } from '.';
|
|
5
5
|
|
|
6
6
|
export type CheckboxOptionProps = InvalidPropsLibrary &
|
|
7
|
-
Pick<CheckboxProps, 'checked' | 'disabled' | 'indeterminate' | 'name' | '
|
|
8
|
-
Pick<ToggleOptionProps, 'description' | 'label'
|
|
7
|
+
Pick<CheckboxProps, 'checked' | 'disabled' | 'indeterminate' | 'name' | 'value'> &
|
|
8
|
+
Pick<ToggleOptionProps, 'description' | 'label'> & {
|
|
9
|
+
/**
|
|
10
|
+
* The function to call when the checkbox is checked or unchecked.
|
|
11
|
+
*
|
|
12
|
+
* @required
|
|
13
|
+
*/
|
|
14
|
+
onChange: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
};
|
|
9
16
|
|
|
10
17
|
/**
|
|
11
18
|
* A control that allows users to choose one or more items from a list or turn an feature on or off.
|
package/src/Chip.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { CSSProperties, ReactNode } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { CommonProps } from '.';
|
|
5
5
|
|
|
6
|
-
export type ChipProps = CommonProps<'disabled'
|
|
6
|
+
export type ChipProps = CommonProps<'disabled'> & {
|
|
7
7
|
/**
|
|
8
8
|
* The content of the chip.
|
|
9
9
|
*
|
|
@@ -39,6 +39,8 @@ export type ChipProps = CommonProps<'disabled' | 'onClick'> & {
|
|
|
39
39
|
selected?: boolean;
|
|
40
40
|
/** The style of the chip. */
|
|
41
41
|
style?: CSSProperties;
|
|
42
|
+
/** The function to call when the chip is clicked. */
|
|
43
|
+
onClick?: (event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
/**
|
package/src/Dialog.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './dialog.scss';
|
|
2
2
|
import { FocusTrap } from 'focus-trap-react';
|
|
3
|
-
import { ReactNode,
|
|
3
|
+
import { ReactNode, useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { Portal } from './Portal';
|
|
6
6
|
import { useId } from './hooks/useId';
|
|
7
7
|
import { useOutsideClick } from './hooks/useOutsideClick';
|
|
8
8
|
|
|
9
|
-
import { CommonProps, ElementProps } from './';
|
|
9
|
+
import { CommonProps, ElementProps, SetRef } from './';
|
|
10
10
|
|
|
11
11
|
export type DialogProps = CommonProps<'id'> & {
|
|
12
12
|
/** The content of the dialog. */
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
/** A ref to the dialog element. */
|
|
15
|
-
innerRef?:
|
|
15
|
+
innerRef?: SetRef<HTMLDivElement>;
|
|
16
16
|
/**
|
|
17
17
|
* If the dialog should appear.
|
|
18
18
|
*
|
package/src/Dropdown.tsx
CHANGED
|
@@ -10,27 +10,48 @@ import { useId } from './hooks/useId';
|
|
|
10
10
|
|
|
11
11
|
import { CommonProps, InvalidPropsLibrary } from './';
|
|
12
12
|
|
|
13
|
-
export type DropdownOption = {
|
|
13
|
+
export type DropdownOption = Record<string, unknown> & {
|
|
14
14
|
/** The value of the option. */
|
|
15
15
|
value: string;
|
|
16
16
|
/** The label of the option. This is the text that will be displayed on the option. */
|
|
17
17
|
label: string;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export type
|
|
20
|
+
export type DropdownOptionAll = {
|
|
21
|
+
/** The label of the option. This is the text that will be displayed on the option. */
|
|
22
|
+
label: string;
|
|
23
|
+
/** Whether the option is selected. */
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type DropdownProps<T extends DropdownOption = DropdownOption> = CommonProps<
|
|
21
28
|
'aria-label' | 'disabled' | 'id' | 'name' | 'readOnly' | 'size'
|
|
22
29
|
> &
|
|
23
30
|
InvalidPropsLibrary &
|
|
24
|
-
Pick<MenuProps<
|
|
31
|
+
Pick<MenuProps<T>, 'isMulti' | 'itemCount' | 'renderListItem' | 'selectAll'> & {
|
|
25
32
|
/**
|
|
26
33
|
* Array of options to display in the dropdown
|
|
27
34
|
*
|
|
28
|
-
* @
|
|
35
|
+
* @example
|
|
36
|
+
* [
|
|
37
|
+
* { value: '1', label: 'Option 1' },
|
|
38
|
+
* { value: '2', label: 'Option 2' },
|
|
39
|
+
* { value: '3', label: 'Option 3' },
|
|
40
|
+
* { value: '4', label: 'Option 4' },
|
|
41
|
+
* { value: '5', label: 'Option 5' },
|
|
42
|
+
* { value: '6', label: 'Option 6' },
|
|
43
|
+
* { value: '7', label: 'Option 7' },
|
|
44
|
+
* { value: '8', label: 'Option 8' },
|
|
45
|
+
* { value: '9', label: 'Option 9' },
|
|
46
|
+
* { value: '10', label: 'Option 10' },
|
|
47
|
+
* ];
|
|
48
|
+
*
|
|
49
|
+
* @type Array<DropdownOption>
|
|
29
50
|
* @required
|
|
30
51
|
*/
|
|
31
|
-
options:
|
|
52
|
+
options: T[];
|
|
32
53
|
/**
|
|
33
|
-
* Array of selected values
|
|
54
|
+
* Array of selected values
|
|
34
55
|
*
|
|
35
56
|
* @type Array<string>
|
|
36
57
|
*/
|
|
@@ -38,7 +59,7 @@ export type DropdownProps<O extends DropdownOption = DropdownOption> = CommonPro
|
|
|
38
59
|
/**
|
|
39
60
|
* Placeholder for the dropdown
|
|
40
61
|
*
|
|
41
|
-
* @default Select...
|
|
62
|
+
* @default Select one...
|
|
42
63
|
*/
|
|
43
64
|
placeholder?: string;
|
|
44
65
|
/**
|
|
@@ -49,6 +70,12 @@ export type DropdownProps<O extends DropdownOption = DropdownOption> = CommonPro
|
|
|
49
70
|
placement?: Extract<Placement, 'bottom' | 'top'>;
|
|
50
71
|
/** The style of the dropdown. */
|
|
51
72
|
style?: React.CSSProperties;
|
|
73
|
+
/**
|
|
74
|
+
* The function to call when the selected values change.
|
|
75
|
+
*
|
|
76
|
+
* @required
|
|
77
|
+
*/
|
|
78
|
+
onChange?: (value: string[], event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
52
79
|
};
|
|
53
80
|
|
|
54
81
|
/**
|
|
@@ -56,7 +83,7 @@ export type DropdownProps<O extends DropdownOption = DropdownOption> = CommonPro
|
|
|
56
83
|
*
|
|
57
84
|
* @name Dropdown
|
|
58
85
|
*/
|
|
59
|
-
function Dropdown
|
|
86
|
+
function Dropdown({
|
|
60
87
|
options = [],
|
|
61
88
|
value: selected,
|
|
62
89
|
onChange,
|
|
@@ -74,7 +101,8 @@ function Dropdown<O extends DropdownOption = DropdownOption>({
|
|
|
74
101
|
isMulti,
|
|
75
102
|
renderListItem,
|
|
76
103
|
style: styleProp,
|
|
77
|
-
|
|
104
|
+
selectAll,
|
|
105
|
+
}: DropdownProps) {
|
|
78
106
|
const id = useId(propId);
|
|
79
107
|
|
|
80
108
|
const { triggerProps, menuProps, closeMenu } = useFloatingMenu({
|
|
@@ -116,12 +144,13 @@ function Dropdown<O extends DropdownOption = DropdownOption>({
|
|
|
116
144
|
isMulti={isMulti}
|
|
117
145
|
itemCount={itemCount}
|
|
118
146
|
items={options}
|
|
119
|
-
onChange={(
|
|
147
|
+
onChange={(next, event) => {
|
|
120
148
|
event?.preventDefault();
|
|
121
149
|
if (!isMulti) closeMenu();
|
|
122
|
-
onChange?.(
|
|
150
|
+
onChange?.(next);
|
|
123
151
|
}}
|
|
124
152
|
renderListItem={renderListItem}
|
|
153
|
+
selectAll={selectAll}
|
|
125
154
|
selectedValues={selected}
|
|
126
155
|
{...menuProps}
|
|
127
156
|
/>
|