@react-types/select 3.12.1 → 3.13.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 -96
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/select",
3
- "version": "3.12.1",
3
+ "version": "3.13.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.0"
12
+ "@react-aria/select": "^3.18.0",
13
+ "@react-spectrum/picker": "^3.17.0",
14
+ "@react-stately/select": "^3.10.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": "66e51757606b43a89ed02c574ca24517323a2ab9"
24
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
21
25
  }
package/src/index.d.ts CHANGED
@@ -10,99 +10,6 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {
14
- Alignment,
15
- AriaLabelingProps,
16
- AsyncLoadable,
17
- CollectionBase,
18
- DimensionValue,
19
- DOMProps,
20
- FocusableDOMProps,
21
- FocusableProps,
22
- HelpTextProps,
23
- InputBase,
24
- Key,
25
- LabelableProps,
26
- SingleSelection,
27
- SpectrumLabelableProps,
28
- StyleProps,
29
- TextInputBase,
30
- Validation,
31
- ValueBase
32
- } from '@react-types/shared';
33
-
34
- export type SelectionMode = 'single' | 'multiple';
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[];
37
- type ValidationType<M extends SelectionMode> = M extends 'single' ? Key : Key[];
38
-
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 {
40
- /**
41
- * Whether single or multiple selection is enabled.
42
- * @default 'single'
43
- */
44
- selectionMode?: M,
45
- /**
46
- * The currently selected key in the collection (controlled).
47
- * @deprecated
48
- */
49
- selectedKey?: Key | null,
50
- /**
51
- * The initial selected key in the collection (uncontrolled).
52
- * @deprecated
53
- */
54
- defaultSelectedKey?: Key,
55
- /**
56
- * Handler that is called when the selection changes.
57
- * @deprecated
58
- */
59
- onSelectionChange?: (key: Key | null) => void,
60
- /** Sets the open state of the menu. */
61
- isOpen?: boolean,
62
- /** Sets the default open state of the menu. */
63
- defaultOpen?: boolean,
64
- /** Method that is called when the open state of the menu changes. */
65
- onOpenChange?: (isOpen: boolean) => void,
66
- /** Whether the select should be allowed to be open when the collection is empty. */
67
- allowsEmptyCollection?: boolean
68
- }
69
-
70
- export interface AriaSelectProps<T, M extends SelectionMode = 'single'> extends SelectProps<T, M>, DOMProps, AriaLabelingProps, FocusableDOMProps {
71
- /**
72
- * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
73
- */
74
- autoComplete?: string,
75
- /**
76
- * The name of the input, used when submitting an HTML form.
77
- */
78
- name?: string,
79
- /**
80
- * The `<form>` element to associate the input with.
81
- * The value of this attribute must be the id of a `<form>` in the same document.
82
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).
83
- */
84
- form?: string
85
- }
86
-
87
- export interface SpectrumPickerProps<T> extends Omit<AriaSelectProps<T>, 'selectionMode' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange' | 'value' | 'defaultValue' | 'onChange' | 'allowsEmptyCollection'>, Omit<SingleSelection, 'disallowEmptySelection'>, AsyncLoadable, SpectrumLabelableProps, StyleProps {
88
- /** Whether the textfield should be displayed with a quiet style. */
89
- isQuiet?: boolean,
90
- /** Alignment of the menu relative to the input target.
91
- * @default 'start'
92
- */
93
- align?: Alignment,
94
- /**
95
- * Direction the menu will render relative to the Picker.
96
- * @default 'bottom'
97
- */
98
- direction?: 'bottom' | 'top',
99
- /**
100
- * Whether the menu should automatically flip direction when space is limited.
101
- * @default true
102
- */
103
- shouldFlip?: boolean,
104
- /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */
105
- menuWidth?: DimensionValue,
106
- /** Whether the element should receive focus on render. */
107
- autoFocus?: boolean
108
- }
13
+ export {SelectionMode, ValueType, ChangeValueType, SelectProps} from '@react-stately/select';
14
+ export {AriaSelectProps} from '@react-aria/select';
15
+ export {SpectrumPickerProps} from '@react-spectrum/picker';