@react-types/select 3.12.0 → 3.12.2

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 +3 -3
  2. package/src/index.d.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/select",
3
- "version": "3.12.0",
3
+ "version": "3.12.2",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/shared": "^3.32.1"
12
+ "@react-types/shared": "^3.33.1"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "gitHead": "4d838da5bfe36abb35aed166995a9ef63825370f"
20
+ "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
21
21
  }
package/src/index.d.ts CHANGED
@@ -32,10 +32,11 @@ import {
32
32
  } from '@react-types/shared';
33
33
 
34
34
  export type SelectionMode = 'single' | 'multiple';
35
- export type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];
35
+ export type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : readonly Key[];
36
+ export type ChangeValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];
36
37
  type ValidationType<M extends SelectionMode> = M extends 'single' ? Key : Key[];
37
38
 
38
- export interface SelectProps<T, M extends SelectionMode = 'single'> extends CollectionBase<T>, Omit<InputBase, 'isReadOnly'>, ValueBase<ValueType<M>>, Validation<ValidationType<M>>, HelpTextProps, LabelableProps, TextInputBase, FocusableProps {
39
+ export interface SelectProps<T, M extends SelectionMode = 'single'> extends CollectionBase<T>, Omit<InputBase, 'isReadOnly'>, ValueBase<ValueType<M>, ChangeValueType<M>>, Validation<ValidationType<M>>, HelpTextProps, LabelableProps, TextInputBase, FocusableProps {
39
40
  /**
40
41
  * Whether single or multiple selection is enabled.
41
42
  * @default 'single'
@@ -50,7 +51,7 @@ export interface SelectProps<T, M extends SelectionMode = 'single'> extends Coll
50
51
  * The initial selected key in the collection (uncontrolled).
51
52
  * @deprecated
52
53
  */
53
- defaultSelectedKey?: Key,
54
+ defaultSelectedKey?: Key | null,
54
55
  /**
55
56
  * Handler that is called when the selection changes.
56
57
  * @deprecated