@react-types/combobox 3.14.0 → 3.15.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 (2) hide show
  1. package/package.json +8 -4
  2. package/src/index.d.ts +3 -125
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/combobox",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,13 +9,17 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/shared": "^3.33.1"
12
+ "@react-aria/combobox": "^3.16.0",
13
+ "@react-spectrum/combobox": "^3.17.0",
14
+ "@react-stately/combobox": "^3.14.0"
13
15
  },
14
16
  "peerDependencies": {
15
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
17
+ "@react-spectrum/provider": "^3.0.0",
18
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
19
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
16
20
  },
17
21
  "publishConfig": {
18
22
  "access": "public"
19
23
  },
20
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
24
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
21
25
  }
package/src/index.d.ts CHANGED
@@ -10,128 +10,6 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {
14
- AriaLabelingProps,
15
- AsyncLoadable,
16
- CollectionBase,
17
- DimensionValue,
18
- DOMProps,
19
- FocusableProps,
20
- HelpTextProps,
21
- InputBase,
22
- InputDOMProps,
23
- Key,
24
- LabelableProps,
25
- LoadingState,
26
- SingleSelection,
27
- SpectrumFieldValidation,
28
- SpectrumLabelableProps,
29
- SpectrumTextInputBase,
30
- StyleProps,
31
- TextInputBase,
32
- Validation,
33
- ValueBase
34
- } from '@react-types/shared';
35
-
36
- export type MenuTriggerAction = 'focus' | 'input' | 'manual';
37
- export type SelectionMode = 'single' | 'multiple';
38
- export type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];
39
- type ValidationType<M extends SelectionMode> = M extends 'single' ? Key : Key[];
40
-
41
- export interface ComboBoxValidationValue<M extends SelectionMode = 'single'> {
42
- /**
43
- * The selected key in the ComboBox.
44
- * @deprecated
45
- */
46
- selectedKey: Key | null,
47
- /** The keys of the currently selected items. */
48
- value: ValidationType<M>,
49
- /** The value of the ComboBox input. */
50
- inputValue: string
51
- }
52
-
53
- export interface ComboBoxProps<T, M extends SelectionMode = 'single'> extends CollectionBase<T>, InputBase, ValueBase<ValueType<M>>, TextInputBase, Validation<ComboBoxValidationValue>, FocusableProps<HTMLInputElement>, LabelableProps, HelpTextProps {
54
- /** The list of ComboBox items (uncontrolled). */
55
- defaultItems?: Iterable<T>,
56
- /** The list of ComboBox items (controlled). */
57
- items?: Iterable<T>,
58
- /** Method that is called when the open state of the menu changes. Returns the new open state and the action that caused the opening of the menu. */
59
- onOpenChange?: (isOpen: boolean, menuTrigger?: MenuTriggerAction) => void,
60
- /**
61
- * Whether single or multiple selection is enabled.
62
- * @default 'single'
63
- */
64
- selectionMode?: M,
65
- /**
66
- * The currently selected key in the collection (controlled).
67
- * @deprecated
68
- */
69
- selectedKey?: Key | null,
70
- /**
71
- * The initial selected key in the collection (uncontrolled).
72
- * @deprecated
73
- */
74
- defaultSelectedKey?: Key | null,
75
- /**
76
- * Handler that is called when the selection changes.
77
- * @deprecated
78
- */
79
- onSelectionChange?: (key: Key | null) => void,
80
- /** The value of the ComboBox input (controlled). */
81
- inputValue?: string,
82
- /** The default value of the ComboBox input (uncontrolled). */
83
- defaultInputValue?: string,
84
- /** Handler that is called when the ComboBox input value changes. */
85
- onInputChange?: (value: string) => void,
86
- /** Whether the ComboBox allows a non-item matching input value to be set. */
87
- allowsCustomValue?: boolean,
88
- // /**
89
- // * Whether the Combobox should only suggest matching options or autocomplete the field with the nearest matching option.
90
- // * @default 'suggest'
91
- // */
92
- // completionMode?: 'suggest' | 'complete',
93
- /**
94
- * The interaction required to display the ComboBox menu.
95
- * @default 'input'
96
- */
97
- menuTrigger?: MenuTriggerAction
98
- }
99
-
100
- export interface AriaComboBoxProps<T, M extends SelectionMode = 'single'> extends ComboBoxProps<T, M>, DOMProps, InputDOMProps, AriaLabelingProps {
101
- /** Whether keyboard navigation is circular. */
102
- shouldFocusWrap?: boolean
103
- }
104
-
105
- export interface SpectrumComboBoxProps<T> extends SpectrumTextInputBase, Omit<AriaComboBoxProps<T>, 'menuTrigger' | 'isInvalid' | 'validationState' | 'selectionMode' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange' | 'value' | 'defaultValue' | 'onChange'>, Omit<SingleSelection, 'disallowEmptySelection'>, SpectrumFieldValidation<ComboBoxValidationValue>, SpectrumLabelableProps, StyleProps, Omit<AsyncLoadable, 'isLoading'> {
106
- /**
107
- * The interaction required to display the ComboBox menu. Note that this prop has no effect on the mobile ComboBox experience.
108
- * @default 'input'
109
- */
110
- menuTrigger?: MenuTriggerAction,
111
- /** Whether the ComboBox should be displayed with a quiet style. */
112
- isQuiet?: boolean,
113
- /** Alignment of the menu relative to the input target.
114
- * @default 'start'
115
- */
116
- align?: 'start' | 'end',
117
- /**
118
- * Direction the menu will render relative to the ComboBox.
119
- * @default 'bottom'
120
- */
121
- direction?: 'bottom' | 'top',
122
- /** The current loading state of the ComboBox. Determines whether or not the progress circle should be shown. */
123
- loadingState?: LoadingState,
124
- /**
125
- * Whether the menu should automatically flip direction when space is limited.
126
- * @default true
127
- */
128
- shouldFlip?: boolean,
129
- /** Width of the menu. By default, matches width of the combobox. Note that the minimum width of the dropdown is always equal to the combobox's width. */
130
- menuWidth?: DimensionValue,
131
- /**
132
- * Whether the text or key of the selected item is submitted as part of an HTML form.
133
- * When `allowsCustomValue` is `true`, this option does not apply and the text is always submitted.
134
- * @default 'text'
135
- */
136
- formValue?: 'text' | 'key'
137
- }
13
+ export {MenuTriggerAction, ComboBoxValidationValue, ComboBoxProps} from '@react-stately/combobox';
14
+ export {AriaComboBoxProps} from '@react-aria/combobox';
15
+ export {SpectrumComboBoxProps} from '@react-spectrum/combobox';