@react-types/textfield 3.0.0-nightly-641446f65-240905

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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @react-types/textfield
2
+
3
+ This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@react-types/textfield",
3
+ "version": "3.0.0-nightly-641446f65-240905",
4
+ "description": "Spectrum UI components in React",
5
+ "license": "Apache-2.0",
6
+ "types": "src/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/adobe/react-spectrum"
10
+ },
11
+ "dependencies": {
12
+ "@react-types/shared": "^3.0.0-nightly-641446f65-240905"
13
+ },
14
+ "peerDependencies": {
15
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "stableVersion": "3.9.6"
21
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {
14
+ AriaLabelingProps,
15
+ AriaValidationProps,
16
+ FocusableDOMProps,
17
+ FocusableProps,
18
+ FocusableRefValue,
19
+ HelpTextProps,
20
+ InputBase,
21
+ LabelableProps,
22
+ SpectrumFieldValidation,
23
+ SpectrumLabelableProps,
24
+ SpectrumTextInputBase,
25
+ StyleProps,
26
+ TextInputBase,
27
+ TextInputDOMProps,
28
+ Validation,
29
+ ValueBase
30
+ } from '@react-types/shared';
31
+ import {ReactElement} from 'react';
32
+
33
+ export interface TextFieldProps extends InputBase, Validation<string>, HelpTextProps, FocusableProps, TextInputBase, ValueBase<string>, LabelableProps {}
34
+
35
+ export interface AriaTextFieldProps extends TextFieldProps, AriaLabelingProps, FocusableDOMProps, TextInputDOMProps, AriaValidationProps {
36
+ // https://www.w3.org/TR/wai-aria-1.2/#textbox
37
+ /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
38
+ 'aria-activedescendant'?: string,
39
+ /**
40
+ * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
41
+ * presented if they are made.
42
+ */
43
+ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both',
44
+ /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
45
+ 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
46
+ }
47
+
48
+ export interface SpectrumTextFieldProps extends SpectrumTextInputBase, Omit<AriaTextFieldProps, 'isInvalid' | 'validationState'>, SpectrumFieldValidation<string>, SpectrumLabelableProps, StyleProps {
49
+ /** An icon to display at the start of the input. */
50
+ icon?: ReactElement | null,
51
+ /** Whether the input should be displayed with a quiet style. */
52
+ isQuiet?: boolean
53
+ }
54
+
55
+ export interface SpectrumTextAreaProps extends Omit<SpectrumTextFieldProps, 'type' | 'pattern'> {}
56
+
57
+ export interface TextFieldRef<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement> extends FocusableRefValue<T, HTMLDivElement> {
58
+ select(): void,
59
+ getInputElement(): T | null
60
+ }