@react-aria/textfield
Advanced tools
Comparing version 3.14.5 to 3.14.6
import { AriaTextFieldProps } from "@react-types/textfield"; | ||
import { DOMFactory, HTMLAttributes, LabelHTMLAttributes, ReactDOM, RefObject } from "react"; | ||
import { DOMAttributes, ValidationResult } from "@react-types/shared"; | ||
import { HTMLAttributes, JSX, LabelHTMLAttributes, RefObject } from "react"; | ||
import { DOMAttributes, ValidationResult, RefObject as _RefObject1 } from "@react-types/shared"; | ||
/** | ||
@@ -15,5 +15,3 @@ * A map of HTML element names and their interface types. | ||
*/ | ||
type IntrinsicHTMLAttributes = { | ||
[K in keyof ReactDOM]: ReactDOM[K] extends DOMFactory<infer T, any> ? T : never; | ||
}; | ||
type IntrinsicHTMLAttributes = JSX.IntrinsicElements; | ||
type DefaultElementType = 'input'; | ||
@@ -61,3 +59,3 @@ /** | ||
*/ | ||
type TextFieldRefObject<T extends TextFieldIntrinsicElements> = RefObject<TextFieldHTMLElementType[T]>; | ||
type TextFieldRefObject<T extends TextFieldIntrinsicElements> = RefObject<TextFieldHTMLElementType[T] | null>; | ||
export interface TextFieldAria<T extends TextFieldIntrinsicElements = DefaultElementType> extends ValidationResult { | ||
@@ -83,5 +81,5 @@ /** Props for the input element. */ | ||
} | ||
export function useFormattedTextField(props: AriaTextFieldProps, state: FormattedTextFieldState, inputRef: RefObject<HTMLInputElement>): TextFieldAria; | ||
export function useFormattedTextField(props: AriaTextFieldProps, state: FormattedTextFieldState, inputRef: _RefObject1<HTMLInputElement | null>): TextFieldAria; | ||
export type { AriaTextFieldProps } from '@react-types/textfield'; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -76,3 +76,3 @@ var $4Z7CR$react = require("react"); | ||
labelProps: labelProps, | ||
inputProps: (0, $4Z7CR$reactariautils.mergeProps)(domProps, inputElementType === 'input' && inputOnlyProps, { | ||
inputProps: (0, $4Z7CR$reactariautils.mergeProps)(domProps, inputElementType === 'input' ? inputOnlyProps : undefined, { | ||
disabled: isDisabled, | ||
@@ -79,0 +79,0 @@ readOnly: isReadOnly, |
@@ -70,3 +70,3 @@ import {useEffect as $ig234$useEffect} from "react"; | ||
labelProps: labelProps, | ||
inputProps: (0, $ig234$mergeProps)(domProps, inputElementType === 'input' && inputOnlyProps, { | ||
inputProps: (0, $ig234$mergeProps)(domProps, inputElementType === 'input' ? inputOnlyProps : undefined, { | ||
disabled: isDisabled, | ||
@@ -73,0 +73,0 @@ readOnly: isReadOnly, |
{ | ||
"name": "@react-aria/textfield", | ||
"version": "3.14.5", | ||
"version": "3.14.6", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,14 +25,14 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "^3.17.1", | ||
"@react-aria/form": "^3.0.5", | ||
"@react-aria/label": "^3.7.8", | ||
"@react-aria/utils": "^3.24.1", | ||
"@react-stately/form": "^3.0.3", | ||
"@react-stately/utils": "^3.10.1", | ||
"@react-types/shared": "^3.23.1", | ||
"@react-types/textfield": "^3.9.3", | ||
"@react-aria/focus": "^3.18.0", | ||
"@react-aria/form": "^3.0.6", | ||
"@react-aria/label": "^3.7.9", | ||
"@react-aria/utils": "^3.25.0", | ||
"@react-stately/form": "^3.0.4", | ||
"@react-stately/utils": "^3.10.2", | ||
"@react-types/shared": "^3.24.0", | ||
"@react-types/textfield": "^3.9.4", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
}, | ||
@@ -42,3 +42,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433" | ||
"gitHead": "86d80e3216bc32e75108831cf3a5a720bc849206" | ||
} |
@@ -15,4 +15,5 @@ /* | ||
import {mergeProps, useEffectEvent} from '@react-aria/utils'; | ||
import {RefObject, useEffect, useRef} from 'react'; | ||
import {RefObject} from '@react-types/shared'; | ||
import {TextFieldAria, useTextField} from './useTextField'; | ||
import {useEffect, useRef} from 'react'; | ||
@@ -32,3 +33,3 @@ interface FormattedTextFieldState { | ||
export function useFormattedTextField(props: AriaTextFieldProps, state: FormattedTextFieldState, inputRef: RefObject<HTMLInputElement>): TextFieldAria { | ||
export function useFormattedTextField(props: AriaTextFieldProps, state: FormattedTextFieldState, inputRef: RefObject<HTMLInputElement | null>): TextFieldAria { | ||
// All browsers implement the 'beforeinput' event natively except Firefox | ||
@@ -35,0 +36,0 @@ // (currently behind a flag as of Firefox 84). React's polyfill does not |
@@ -16,6 +16,5 @@ /* | ||
ChangeEvent, | ||
DOMFactory, | ||
HTMLAttributes, | ||
type JSX, | ||
LabelHTMLAttributes, | ||
ReactDOM, | ||
RefObject, | ||
@@ -44,5 +43,3 @@ useEffect | ||
*/ | ||
type IntrinsicHTMLAttributes = { | ||
[K in keyof ReactDOM]: ReactDOM[K] extends DOMFactory<infer T, any> ? T : never | ||
}; | ||
type IntrinsicHTMLAttributes = JSX.IntrinsicElements; | ||
@@ -86,3 +83,3 @@ type DefaultElementType = 'input'; | ||
/** | ||
* Controls whether inputted text is automatically capitalized and, if so, in what manner. | ||
* Controls whether inputted text is automatically capitalized and, if so, in what manner. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize). | ||
@@ -98,3 +95,3 @@ */ | ||
*/ | ||
type TextFieldRefObject<T extends TextFieldIntrinsicElements> = RefObject<TextFieldHTMLElementType[T]>; | ||
type TextFieldRefObject<T extends TextFieldIntrinsicElements> = RefObject<TextFieldHTMLElementType[T] | null>; | ||
@@ -173,3 +170,3 @@ export interface TextFieldAria<T extends TextFieldIntrinsicElements = DefaultElementType> extends ValidationResult { | ||
domProps, | ||
inputElementType === 'input' && inputOnlyProps, | ||
inputElementType === 'input' ? inputOnlyProps : undefined, | ||
{ | ||
@@ -176,0 +173,0 @@ disabled: isDisabled, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124426
1189
Updated@react-aria/focus@^3.18.0
Updated@react-aria/form@^3.0.6
Updated@react-aria/label@^3.7.9
Updated@react-aria/utils@^3.25.0
Updated@react-stately/form@^3.0.4
Updated@react-stately/utils@^3.10.2
Updated@react-types/shared@^3.24.0