@rescui/select 0.15.1-RUI-280-Update-select-component-downshift-2f40ef205.67 → 0.15.2-RUI-291-Update-next-js-to-the-latest-version-8f54dec0a.66

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 (59) hide show
  1. package/lib/_virtual/index.css.js +12 -12
  2. package/lib/common-prop-types.d.ts +29 -30
  3. package/lib/constants.d.ts +6 -6
  4. package/lib/hooks/use-a11y.d.ts +30 -29
  5. package/lib/hooks/use-a11y.js +10 -7
  6. package/lib/hooks/use-actual-size-from-css.d.ts +10 -0
  7. package/lib/hooks/use-actual-size-from-css.js +27 -0
  8. package/lib/hooks/use-focus.d.ts +10 -10
  9. package/lib/hooks/use-hover.d.ts +10 -10
  10. package/lib/hooks/use-label-focus.d.ts +9 -9
  11. package/lib/hooks/use-multi-handlers.d.ts +11 -11
  12. package/lib/hooks/use-multi-handlers.js +6 -10
  13. package/lib/hooks/use-options.d.ts +13 -13
  14. package/lib/hooks/use-options.js +7 -6
  15. package/lib/hooks/use-primary-contrast-css-var-transfer.d.ts +11 -0
  16. package/lib/hooks/use-primary-contrast-css-var-transfer.js +29 -0
  17. package/lib/hooks/use-safe-id.d.ts +6 -0
  18. package/lib/hooks/use-safe-id.js +15 -0
  19. package/lib/index.css +965 -932
  20. package/lib/index.d.ts +4 -4
  21. package/lib/multiselect.d.ts +3 -3
  22. package/lib/multiselect.js +34 -37
  23. package/lib/native-select.d.ts +4 -4
  24. package/lib/native-select.js +10 -13
  25. package/lib/parts/foldable.d.ts +34 -33
  26. package/lib/parts/form-trigger-wrapper.d.ts +34 -34
  27. package/lib/parts/hidden-select.d.ts +13 -13
  28. package/lib/parts/icons.d.ts +17 -17
  29. package/lib/parts/list-box.d.ts +13 -11
  30. package/lib/parts/list-box.js +12 -8
  31. package/lib/parts/multi-trigger.d.ts +12 -12
  32. package/lib/parts/multi-trigger.js +2 -6
  33. package/lib/parts/native-select-options-with-groups.d.ts +8 -8
  34. package/lib/parts/popup-content.d.ts +20 -0
  35. package/lib/parts/popup-content.js +68 -0
  36. package/lib/select-basic.d.ts +3 -3
  37. package/lib/select-basic.js +25 -24
  38. package/lib/select-searchable.d.ts +3 -3
  39. package/lib/select-searchable.js +22 -27
  40. package/lib/select.d.ts +28 -28
  41. package/lib/styles/common.p.module.css.js +29 -28
  42. package/lib/styles/form-trigger.p.module.css.js +12 -12
  43. package/lib/styles/list-box.p.module.css.js +13 -11
  44. package/lib/types.d.ts +202 -197
  45. package/lib/utils/calculate-max-height-by-items.d.ts +13 -13
  46. package/lib/utils/calculate-max-height-by-items.js +11 -11
  47. package/lib/utils/get-empty-message.d.ts +6 -6
  48. package/lib/utils/get-option-value.d.ts +2 -2
  49. package/lib/utils/get-real-items-cnt.d.ts +2 -2
  50. package/lib/utils/get-text-from-nodes.d.ts +2 -2
  51. package/lib/utils/get-text-from-nodes.js +1 -3
  52. package/lib/utils/is-option-a-group.d.ts +2 -2
  53. package/lib/utils/item-to-string.d.ts +2 -2
  54. package/lib/utils/merge-props.d.ts +19 -29
  55. package/lib/utils/merge-props.js +70 -72
  56. package/lib/utils/throttle.d.ts +1 -1
  57. package/package.json +8 -8
  58. package/lib/hooks/use-backward-compatible-id.d.ts +0 -4
  59. package/lib/hooks/use-backward-compatible-id.js +0 -14
package/lib/types.d.ts CHANGED
@@ -1,197 +1,202 @@
1
- import React from 'react';
2
- import type { Theme } from '@rescui/ui-contexts';
3
- import type { UseSelectPropGetters } from 'downshift';
4
- export declare type Key = string | number;
5
- export declare type Placement = 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
6
- export declare type SelectSize = 'l' | 'm' | 's';
7
- export declare type SelectMode = 'classic' | 'rock';
8
- export declare type SelectOption = {
9
- label: React.ReactNode;
10
- value?: Key;
11
- };
12
- export declare type SelectOptionsGroup = {
13
- label?: React.ReactNode;
14
- options: SelectOption[];
15
- };
16
- export declare type SelectOptionOrGroup = SelectOption | SelectOptionsGroup;
17
- export declare type SelectOptions = SelectOptionOrGroup[];
18
- export declare type ListBoxOptionItem = SelectOption & {
19
- index: number;
20
- type: 'option';
21
- key: Key;
22
- disabled?: boolean;
23
- };
24
- export declare type ListBoxGroupItem = Omit<SelectOptionsGroup, 'options'> & {
25
- options: ListBoxOptionItem[];
26
- type: 'group';
27
- key: Key;
28
- };
29
- export declare type ListBoxItem = ListBoxOptionItem | ListBoxGroupItem;
30
- export declare type ListBoxItems = ListBoxItem[];
31
- export declare type ListBoxState = {
32
- menuProps: ReturnType<UseSelectPropGetters<SelectOption>['getMenuProps']>;
33
- getItemProps: UseSelectPropGetters<SelectOption>['getItemProps'];
34
- selectionMode: 'single' | 'multiple';
35
- highlightedIndex: number;
36
- selectedMap: Map<Key, SelectOption>;
37
- menuRef?: React.RefObject<HTMLUListElement>;
38
- };
39
- export declare type NativeSelectOption = {
40
- label: string;
41
- value?: Key;
42
- disabled?: boolean;
43
- };
44
- export declare type NativeSelectOptionsGroup = {
45
- label?: string;
46
- disabled?: boolean;
47
- options: NativeSelectOption[];
48
- };
49
- export declare type NativeSelectOptionOrGroup = NativeSelectOption | NativeSelectOptionsGroup;
50
- export declare type NativeSelectOptions = NativeSelectOptionOrGroup[];
51
- export declare type Groups = SelectOptionsGroup[];
52
- export declare type NoOptionsMessageConfig = {
53
- noOptions: string;
54
- nothingFound?: string;
55
- loading?: string;
56
- };
57
- export declare type NoOptionsMessage = string | NoOptionsMessageConfig;
58
- export declare type SelectProps = {
59
- /**
60
- * Value of the select
61
- */
62
- value?: SelectOption | null;
63
- /**
64
- * Change value callback. `value => ...`. Pass `null` on clear.
65
- */
66
- onChange?: (newValue: SelectOption | null) => void;
67
- /**
68
- * Additional class name
69
- */
70
- className?: string;
71
- style?: React.CSSProperties;
72
- id?: string;
73
- /**
74
- * Array of options or option groups
75
- */
76
- options?: (SelectOption | SelectOptionsGroup)[] | null;
77
- /**
78
- * Is select supports clearing the value
79
- */
80
- isClearable?: boolean;
81
- /**
82
- * Is select supports inplace filtering
83
- */
84
- isSearchable?: boolean;
85
- /**
86
- * Is the component has been disabled
87
- */
88
- isDisabled?: boolean;
89
- /**
90
- * Is loader displayed inside the trigger part
91
- */
92
- isLoading?: boolean;
93
- /**
94
- * A hint to the user of what can be entered in the control
95
- */
96
- placeholder?: string;
97
- /**
98
- * Size
99
- */
100
- size?: SelectSize;
101
- /**
102
- * Appearance mode
103
- */
104
- mode?: SelectMode;
105
- /**
106
- * Appearance theme
107
- */
108
- theme?: Theme;
109
- /**
110
- * Error state flag or `React.ReactNode` (use with forms)
111
- */
112
- error?: boolean | React.ReactNode;
113
- /**
114
- * If `true`, there will be reserved a space for a 1-line error message. Subsequent lines will be placed below normally.
115
- * If `false`, there will be no reservation.
116
- */
117
- reserveErrorLine?: boolean;
118
- /**
119
- * Label element (use with forms)
120
- */
121
- label?: React.ReactNode;
122
- /**
123
- * If `true`, label will be bold
124
- */
125
- boldLabel?: boolean;
126
- /**
127
- * Placement of dropdown element
128
- */
129
- placement?: Placement;
130
- /**
131
- * Note element at the bottom (use with forms)
132
- */
133
- note?: React.ReactNode;
134
- /**
135
- * Text to display when there are no options
136
- */
137
- noOptionsMessage?: NoOptionsMessage;
138
- /**
139
- * Input name attribute
140
- */
141
- name?: string;
142
- /**
143
- * Maximum number of fully visible items in the dropdown list.
144
- * For large lists, `n + 0.5` items will be visible at a time.
145
- * If the maximum number of items in a list is exactly `n + 1`, all
146
- * items will be shown instead (to avoid creating a scroll for half an item only).
147
- */
148
- maxVisibleItems?: number;
149
- };
150
- export declare type MultiselectProps = {
151
- /**
152
- * Value of the multiselect (array of selected options)
153
- */
154
- value?: SelectOption[] | null;
155
- /**
156
- * Change value callback. `value => ...`. Pass `[]` on clear.
157
- */
158
- onChange?: (newValue: SelectOption[]) => void;
159
- /**
160
- * Display tags in single line with "+N" counter
161
- */
162
- isSingleLine?: boolean;
163
- } & Omit<SelectProps, 'value' | 'onChange' | 'isSearchable'>;
164
- export declare type TriggerFuncProps = {
165
- selectedLabel?: string;
166
- selectedValue?: Key;
167
- placeholder?: string;
168
- hovered: boolean;
169
- focused: boolean;
170
- };
171
- export declare type NativeSelectProps = {
172
- options?: (NativeSelectOption | NativeSelectOptionsGroup)[];
173
- size?: SelectSize;
174
- theme?: Theme;
175
- className?: string;
176
- id?: string;
177
- style?: React.CSSProperties;
178
- value?: NativeSelectOption | null;
179
- onChange?: (newValue: NativeSelectOption | null) => void;
180
- placeholder?: string;
181
- isLoading?: boolean;
182
- isDisabled?: boolean;
183
- isClearable?: boolean;
184
- trigger?: (props: TriggerFuncProps) => React.ReactNode;
185
- label?: React.ReactNode;
186
- note?: React.ReactNode;
187
- error?: boolean | React.ReactNode;
188
- /**
189
- * If `true`, there will be reserved a space for a 1-line error message. Subsequent lines will be placed below normally.
190
- * If `false`, there will be no reservation.
191
- */
192
- reserveErrorLine?: boolean;
193
- noOptionsMessage?: NoOptionsMessage;
194
- name?: string;
195
- boldLabel?: boolean;
196
- };
197
- export declare type InnerSingleComponentProps = Omit<SelectProps, 'isSearchable'>;
1
+ import React from 'react';
2
+ import type { Theme } from '@rescui/ui-contexts';
3
+ import type { UseSelectPropGetters } from 'downshift';
4
+ export type Key = string | number;
5
+ export type Placement = 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
6
+ export type SelectSize = 'l' | 'm' | 's';
7
+ export type SelectMode = 'classic' | 'rock';
8
+ export type SelectOption = {
9
+ label: React.ReactNode;
10
+ value?: Key;
11
+ };
12
+ export type SelectOptionsGroup = {
13
+ label?: React.ReactNode;
14
+ options: SelectOption[];
15
+ };
16
+ export type SelectOptionOrGroup = SelectOption | SelectOptionsGroup;
17
+ export type SelectOptions = SelectOptionOrGroup[];
18
+ export type ListBoxOptionItem = SelectOption & {
19
+ index: number;
20
+ type: 'option';
21
+ key: Key;
22
+ disabled?: boolean;
23
+ };
24
+ export type ListBoxGroupItem = Omit<SelectOptionsGroup, 'options'> & {
25
+ options: ListBoxOptionItem[];
26
+ type: 'group';
27
+ key: Key;
28
+ };
29
+ export type ListBoxItem = ListBoxOptionItem | ListBoxGroupItem;
30
+ export type ListBoxItems = ListBoxItem[];
31
+ export type ListBoxState = {
32
+ menuProps: ReturnType<UseSelectPropGetters<SelectOption>['getMenuProps']>;
33
+ getItemProps: UseSelectPropGetters<SelectOption>['getItemProps'];
34
+ highlightedIndex: number;
35
+ selectedMap: Map<Key, SelectOption>;
36
+ menuRef?: React.RefObject<HTMLUListElement>;
37
+ };
38
+ export type NativeSelectOption = {
39
+ label: string;
40
+ value?: Key;
41
+ disabled?: boolean;
42
+ };
43
+ export type NativeSelectOptionsGroup = {
44
+ label?: string;
45
+ disabled?: boolean;
46
+ options: NativeSelectOption[];
47
+ };
48
+ export type NativeSelectOptionOrGroup = NativeSelectOption | NativeSelectOptionsGroup;
49
+ export type NativeSelectOptions = NativeSelectOptionOrGroup[];
50
+ export type Groups = SelectOptionsGroup[];
51
+ export type NoOptionsMessageConfig = {
52
+ noOptions: string;
53
+ nothingFound?: string;
54
+ loading?: string;
55
+ };
56
+ export type NoOptionsMessage = string | NoOptionsMessageConfig;
57
+ export type SelectProps = {
58
+ /**
59
+ * Value of the select
60
+ */
61
+ value?: SelectOption | null;
62
+ /**
63
+ * Change value callback. `value => ...`. Pass `null` on clear.
64
+ */
65
+ onChange?: (newValue: SelectOption | null) => void;
66
+ /**
67
+ * Additional class name
68
+ */
69
+ className?: string;
70
+ style?: React.CSSProperties;
71
+ id?: string;
72
+ /**
73
+ * Array of options or option groups
74
+ */
75
+ options?: (SelectOption | SelectOptionsGroup)[] | null;
76
+ /**
77
+ * Is select supports clearing the value
78
+ */
79
+ isClearable?: boolean;
80
+ /**
81
+ * Is select supports inplace filtering
82
+ */
83
+ isSearchable?: boolean;
84
+ /**
85
+ * Is the component has been disabled
86
+ */
87
+ isDisabled?: boolean;
88
+ /**
89
+ * Is loader displayed inside the trigger part
90
+ */
91
+ isLoading?: boolean;
92
+ /**
93
+ * A hint to the user of what can be entered in the control
94
+ */
95
+ placeholder?: string;
96
+ /**
97
+ * Size
98
+ */
99
+ size?: SelectSize;
100
+ /**
101
+ * Appearance mode
102
+ */
103
+ mode?: SelectMode;
104
+ /**
105
+ * Appearance theme
106
+ */
107
+ theme?: Theme;
108
+ /**
109
+ * Error state flag or `React.ReactNode` (use with forms)
110
+ */
111
+ error?: boolean | React.ReactNode;
112
+ /**
113
+ * If `true`, there will be reserved a space for a 1-line error message. Subsequent lines will be placed below normally.
114
+ * If `false`, there will be no reservation.
115
+ */
116
+ reserveErrorLine?: boolean;
117
+ /**
118
+ * Label element (use with forms)
119
+ */
120
+ label?: React.ReactNode;
121
+ /**
122
+ * If `true`, label will be bold
123
+ */
124
+ boldLabel?: boolean;
125
+ /**
126
+ * Placement of dropdown element
127
+ */
128
+ placement?: Placement;
129
+ /**
130
+ * Note element at the bottom (use with forms)
131
+ */
132
+ note?: React.ReactNode;
133
+ /**
134
+ * Text to display when there are no options
135
+ */
136
+ noOptionsMessage?: NoOptionsMessage;
137
+ /**
138
+ * Input name attribute
139
+ */
140
+ name?: string;
141
+ /**
142
+ * Maximum number of fully visible items in the dropdown list.
143
+ * For large lists, `n + 0.5` items will be visible at a time.
144
+ * If the maximum number of items in a list is exactly `n + 1`, all
145
+ * items will be shown instead (to avoid creating a scroll for half an item only).
146
+ */
147
+ maxVisibleItems?: number;
148
+ };
149
+ export type MultiselectProps = {
150
+ /**
151
+ * Value of the multiselect (array of selected options)
152
+ */
153
+ value?: SelectOption[] | null;
154
+ /**
155
+ * Change value callback. `value => ...`. Pass `[]` on clear.
156
+ */
157
+ onChange?: (newValue: SelectOption[]) => void;
158
+ /**
159
+ * Display tags in single line with "+N" counter
160
+ */
161
+ isSingleLine?: boolean;
162
+ } & Omit<SelectProps, 'value' | 'onChange' | 'isSearchable'>;
163
+ export type TriggerFuncProps = {
164
+ selectedLabel?: string;
165
+ selectedValue?: Key;
166
+ placeholder?: string;
167
+ hovered: boolean;
168
+ focused: boolean;
169
+ };
170
+ export type NativeSelectProps = {
171
+ options?: (NativeSelectOption | NativeSelectOptionsGroup)[];
172
+ size?: SelectSize;
173
+ theme?: Theme;
174
+ className?: string;
175
+ id?: string;
176
+ style?: React.CSSProperties;
177
+ value?: NativeSelectOption | null;
178
+ onChange?: (newValue: NativeSelectOption | null) => void;
179
+ placeholder?: string;
180
+ isLoading?: boolean;
181
+ isDisabled?: boolean;
182
+ isClearable?: boolean;
183
+ trigger?: (props: TriggerFuncProps) => React.ReactNode;
184
+ label?: React.ReactNode;
185
+ note?: React.ReactNode;
186
+ error?: boolean | React.ReactNode;
187
+ /**
188
+ * If `true`, there will be reserved a space for a 1-line error message. Subsequent lines will be placed below normally.
189
+ * If `false`, there will be no reservation.
190
+ */
191
+ reserveErrorLine?: boolean;
192
+ noOptionsMessage?: NoOptionsMessage;
193
+ name?: string;
194
+ boldLabel?: boolean;
195
+ };
196
+ export type InnerSingleComponentProps = Omit<SelectProps, 'isSearchable'>;
197
+ export type DownshiftSyntheticEvent = React.SyntheticEvent & {
198
+ preventDownshiftDefault?: boolean;
199
+ nativeEvent: {
200
+ preventDownshiftDefault?: boolean;
201
+ };
202
+ };
@@ -1,13 +1,13 @@
1
- /**
2
- * Calculate the max height of the list based on items count and allowedMaxVisibleItems.
3
- * Instead of simply adding 0.5 to the allowedMaxVisibleItems, we process
4
- * `itemsCount == allowedMaxVisibleItems + 1` differently.
5
- *
6
- * For allowedMaxVisibleItems={5}:
7
- * - If items itemsCount <= 5: restrain by 5.5 items (to avoid scrollbar due to layout shifts)
8
- * - If items itemsCount = 6: restrain by all 6.1 items (6 + 0.1 for group separators)
9
- * - If items itemsCount > 6: restrain by 5.5 items
10
- *
11
- * Formula: max(5.5, min(itemsCount + 0.1, 6.1) - min(max(0, itemsCount - 6), 0.6))
12
- */
13
- export declare const calculateMaxHeightByItems: (itemsCount: number, allowedMaxVisibleItems: number) => number;
1
+ /**
2
+ * Calculate the max height of the list based on items count and allowedMaxVisibleItems.
3
+ * Instead of simply adding 0.5 to the allowedMaxVisibleItems, we process
4
+ * `itemsCount == allowedMaxVisibleItems + 1` differently.
5
+ *
6
+ * For allowedMaxVisibleItems={5}:
7
+ * - If items itemsCount <= 5: restrain by 5.5 items (to avoid scrollbar due to layout shifts)
8
+ * - If items itemsCount = 6: restrain by all 6.1 items (6 + 0.1 for group separators)
9
+ * - If items itemsCount > 6: restrain by 5.5 items
10
+ *
11
+ * Formula: max(5.5, min(itemsCount + 0.1, 6.1) - min(max(0, itemsCount - 6), 0.6))
12
+ */
13
+ export declare const calculateMaxHeightByItems: (itemsCount: number, allowedMaxVisibleItems: number) => number;
@@ -1,14 +1,14 @@
1
- /**
2
- * Calculate the max height of the list based on items count and allowedMaxVisibleItems.
3
- * Instead of simply adding 0.5 to the allowedMaxVisibleItems, we process
4
- * `itemsCount == allowedMaxVisibleItems + 1` differently.
5
- *
6
- * For allowedMaxVisibleItems={5}:
7
- * - If items itemsCount <= 5: restrain by 5.5 items (to avoid scrollbar due to layout shifts)
8
- * - If items itemsCount = 6: restrain by all 6.1 items (6 + 0.1 for group separators)
9
- * - If items itemsCount > 6: restrain by 5.5 items
10
- *
11
- * Formula: max(5.5, min(itemsCount + 0.1, 6.1) - min(max(0, itemsCount - 6), 0.6))
1
+ /**
2
+ * Calculate the max height of the list based on items count and allowedMaxVisibleItems.
3
+ * Instead of simply adding 0.5 to the allowedMaxVisibleItems, we process
4
+ * `itemsCount == allowedMaxVisibleItems + 1` differently.
5
+ *
6
+ * For allowedMaxVisibleItems={5}:
7
+ * - If items itemsCount <= 5: restrain by 5.5 items (to avoid scrollbar due to layout shifts)
8
+ * - If items itemsCount = 6: restrain by all 6.1 items (6 + 0.1 for group separators)
9
+ * - If items itemsCount > 6: restrain by 5.5 items
10
+ *
11
+ * Formula: max(5.5, min(itemsCount + 0.1, 6.1) - min(max(0, itemsCount - 6), 0.6))
12
12
  */
13
13
  const calculateMaxHeightByItems = (itemsCount, allowedMaxVisibleItems) => {
14
14
  const allowedFloor = Math.floor(allowedMaxVisibleItems);
@@ -1,6 +1,6 @@
1
- import type { NoOptionsMessage } from '../types';
2
- export declare function getEmptyMessage({ isLoading, isNothingFound, noOptionsMessage }: {
3
- isLoading: boolean;
4
- isNothingFound: boolean;
5
- noOptionsMessage: NoOptionsMessage;
6
- }): string;
1
+ import type { NoOptionsMessage } from '../types';
2
+ export declare function getEmptyMessage({ isLoading, isNothingFound, noOptionsMessage }: {
3
+ isLoading: boolean;
4
+ isNothingFound: boolean;
5
+ noOptionsMessage: NoOptionsMessage;
6
+ }): string;
@@ -1,2 +1,2 @@
1
- import type { SelectOption, Key } from '../types';
2
- export declare function getOptionValue(option?: SelectOption): Key | null;
1
+ import type { SelectOption, Key } from '../types';
2
+ export declare function getOptionValue(option?: SelectOption): Key | null;
@@ -1,2 +1,2 @@
1
- import { ListBoxItem } from '../types';
2
- export declare const getRealItemsCnt: (items: ListBoxItem[]) => number;
1
+ import { ListBoxItem } from '../types';
2
+ export declare const getRealItemsCnt: (items: ListBoxItem[]) => number;
@@ -1,2 +1,2 @@
1
- import React from 'react';
2
- export declare const getTextFromNodes: (node: React.ReactNode, depth?: number) => string;
1
+ import React from 'react';
2
+ export declare const getTextFromNodes: (node: React.ReactNode, depth?: number) => string;
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
3
  const getTextFromNodes = function (node) {
4
- var _node$type;
5
-
6
4
  let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
7
5
 
8
6
  if (typeof node === 'string' || typeof node === 'number') {
@@ -18,7 +16,7 @@ const getTextFromNodes = function (node) {
18
16
  return node.map(n => getTextFromNodes(n, depth + 1)).join('');
19
17
  }
20
18
 
21
- if ( /*#__PURE__*/React.isValidElement(node) && (node === null || node === void 0 || (_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.toString()) === null || _node$type === void 0 ? void 0 : _node$type.toLowerCase()) !== 'svg') {
19
+ if ( /*#__PURE__*/React.isValidElement(node) && node?.type?.toString()?.toLowerCase() !== 'svg') {
22
20
  return getTextFromNodes(node.props.children, depth + 1);
23
21
  }
24
22
 
@@ -1,2 +1,2 @@
1
- import type { SelectOptionOrGroup, SelectOptionsGroup, NativeSelectOptionOrGroup, NativeSelectOption } from '../types';
2
- export declare const isOptionAGroup: (optionOrGroup: SelectOptionOrGroup | NativeSelectOptionOrGroup) => optionOrGroup is SelectOptionsGroup | NativeSelectOption;
1
+ import type { SelectOptionOrGroup, SelectOptionsGroup, NativeSelectOptionOrGroup, NativeSelectOption } from '../types';
2
+ export declare const isOptionAGroup: (optionOrGroup: SelectOptionOrGroup | NativeSelectOptionOrGroup) => optionOrGroup is SelectOptionsGroup | NativeSelectOption;
@@ -1,2 +1,2 @@
1
- import type { SelectOption } from '../types';
2
- export declare function itemToString(item: SelectOption): string;
1
+ import type { SelectOption } from '../types';
2
+ export declare function itemToString(item: SelectOption): string;
@@ -1,29 +1,19 @@
1
- /**
2
- * Copied from react-aria repo
3
- * @see https://github.com/adobe/react-spectrum/blob/main/packages/react-aria/src/utils/mergeProps.ts
4
- */
5
- import type { MutableRefObject, RefCallback } from 'react';
6
- /**
7
- * Merges multiple refs into one. Works with either callback or object refs.
8
- */
9
- export declare function mergeRefs<T>(...refs: Array<RefCallback<T> | MutableRefObject<T> | null | undefined>): RefCallback<T> | MutableRefObject<T>;
10
- export declare function chain(...callbacks: any[]): (...args: any[]) => void;
11
- interface Props {
12
- [key: string]: any;
13
- }
14
- declare type PropsArg = Props | null | undefined;
15
- declare type TupleTypes<T> = {
16
- [P in keyof T]: T[P];
17
- } extends {
18
- [key: number]: infer V;
19
- } ? NullToObject<V> : never;
20
- declare type NullToObject<T> = T extends null | undefined ? object : T;
21
- declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
22
- /**
23
- * Merges multiple props objects together. Event handlers are chained,
24
- * classNames are combined, ids are deduplicated, and refs are merged.
25
- * For all other props, the last prop object overrides all previous ones.
26
- * @param args - Multiple sets of props to merge together.
27
- */
28
- export declare function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>>;
29
- export {};
1
+ import { RefCallback } from 'react';
2
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
3
+ /**
4
+ * Combines multiple sets of props into a single object:
5
+ * - conflicting `className` values are joined with a space
6
+ * - conflicting `style` objects are shallow-merged (rightmost wins on conflict)
7
+ * - conflicting function props (event handlers) are composed and called left to right
8
+ * - conflicting `ref` props (object refs, callback refs, or null) are merged into a single
9
+ * callback ref that assigns all of them; cleanup functions returned by callback refs are
10
+ * collected and called together on detach
11
+ * - any other conflicting prop is resolved by taking the value from the rightmost props object
12
+ * @param props One or more props objects to merge. Props further to the right take precedence.
13
+ */
14
+ export declare function mergeProps<T extends object[]>(...props: T): {
15
+ [K in keyof UnionToIntersection<T[number]>]: K extends 'className' ? string : K extends 'style' ? UnionToIntersection<T[number]>[K] : K extends 'ref' ? RefCallback<any> : Exclude<Extract<T[number], {
16
+ [Q in K]: unknown;
17
+ }>[K], undefined>;
18
+ };
19
+ export {};