@solid-aria/types
Advanced tools
Comparing version 0.1.3 to 0.1.4
import { MaybeAccessor } from '@solid-primitives/utils'; | ||
import { JSX, Component, ComponentProps } from 'solid-js'; | ||
import { JSX, Component } from 'solid-js'; | ||
@@ -61,2 +61,95 @@ declare type ItemKey = string | number; | ||
} | ||
interface TextInputDOMEvents { | ||
/** | ||
* Handler that is called when the user copies text. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy). | ||
*/ | ||
onCopy?: JSX.EventHandlerUnion<HTMLInputElement, ClipboardEvent>; | ||
/** | ||
* Handler that is called when the user cuts text. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut). | ||
*/ | ||
onCut?: JSX.EventHandlerUnion<HTMLInputElement, ClipboardEvent>; | ||
/** | ||
* Handler that is called when the user pastes text. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste). | ||
*/ | ||
onPaste?: JSX.EventHandlerUnion<HTMLInputElement, ClipboardEvent>; | ||
/** | ||
* Handler that is called when a text composition system starts a new text composition session. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event). | ||
*/ | ||
onCompositionStart?: JSX.EventHandlerUnion<HTMLInputElement, CompositionEvent>; | ||
/** | ||
* Handler that is called when a text composition system completes or cancels the current text composition session. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). | ||
*/ | ||
onCompositionEnd?: JSX.EventHandlerUnion<HTMLInputElement, CompositionEvent>; | ||
/** | ||
* Handler that is called when a new character is received in the current text composition session. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event). | ||
*/ | ||
onCompositionUpdate?: JSX.EventHandlerUnion<HTMLInputElement, CompositionEvent>; | ||
/** | ||
* Handler that is called when text in the input is selected. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event). | ||
*/ | ||
onSelect?: JSX.EventHandlerUnion<HTMLInputElement, Event>; | ||
/** | ||
* Handler that is called when the input value is about to be modified. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event). | ||
*/ | ||
onBeforeInput?: JSX.EventHandlerUnion<HTMLInputElement, InputEvent>; | ||
/** | ||
* Handler that is called when the input value is modified. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event). | ||
*/ | ||
onInput?: JSX.EventHandlerUnion<HTMLInputElement, InputEvent>; | ||
} | ||
/** | ||
* DOM props that apply to all text inputs. | ||
* Ensure this is synced with useTextField | ||
*/ | ||
interface TextInputDOMProps extends DOMProps, TextInputDOMEvents { | ||
/** | ||
* 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). | ||
*/ | ||
autocomplete?: string; | ||
/** | ||
* The maximum number of characters supported by the input. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength). | ||
*/ | ||
maxLength?: number; | ||
/** | ||
* The minimum number of characters required by the input. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength). | ||
*/ | ||
minLength?: number; | ||
/** | ||
* The name of the input element, used when submitting an HTML form. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname). | ||
*/ | ||
name?: string; | ||
/** | ||
* Regex pattern that the value of the input must match to be valid. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern). | ||
*/ | ||
pattern?: string; | ||
/** | ||
* Content that appears in the input when it is empty. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder). | ||
*/ | ||
placeholder?: string; | ||
/** | ||
* The type of input to render. | ||
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype). | ||
*/ | ||
type?: "text" | "search" | "url" | "tel" | "email" | "password" | string; | ||
/** | ||
* Hints at the type of data that might be entered by the user while editing the element or its contents. | ||
* See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute). | ||
*/ | ||
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; | ||
} | ||
@@ -72,7 +165,8 @@ /** | ||
/** | ||
* Allows for extending a set of props (`SourceProps`) by an overriding set of props | ||
* (`OverrideProps`), ensuring that any duplicates are overridden by the overriding | ||
* set of props. | ||
* A map of HTML element names and their interface types. | ||
* For example `'a'` -> `HTMLAnchorElement`. | ||
*/ | ||
declare type ExtendedProps<SourceProps = {}, OverrideProps = {}> = Omit<SourceProps, keyof OverrideProps> & OverrideProps; | ||
declare type IntrinsicHTMLElements = { | ||
[K in keyof JSX.IntrinsicElements]: JSX.IntrinsicElements[K] extends JSX.HTMLAttributes<infer T> ? T : never; | ||
}; | ||
@@ -317,11 +411,2 @@ declare type HoverPointerType = "mouse" | "pen"; | ||
declare type AsProp<C extends ElementType> = { | ||
/** | ||
* Tag or component that should be used as root element. | ||
*/ | ||
as?: C; | ||
}; | ||
declare type InheritedProps<C extends ElementType, Props = {}> = ExtendedProps<ComponentProps<C>, Props>; | ||
declare type PolymorphicComponentProps<C, Props = {}> = C extends ElementType ? InheritedProps<C, Props & AsProp<C>> : Props & AsProp<ElementType>; | ||
interface SingleSelection { | ||
@@ -357,2 +442,2 @@ /** Whether the collection allows empty selection. */ | ||
export { AriaLabelingProps, AriaValidationProps, AsyncLoadable, DOMElements, DOMProps, Direction, DisabledBehavior, ElementType, Expandable, ExtendedProps, FocusEvents, FocusStrategy, FocusWithinEvents, FocusableDOMProps, FocusableProps, HelpTextProps, HoverEvent, HoverEvents, HoverPointerType, InputBase, ItemKey, KeyboardDelegate, KeyboardEvents, LabelableProps, LongPressEvent, MultipleSelection, Orientation, PointerType, PolymorphicComponentProps, PressEvent, PressEvents, SelectionBehavior, SelectionMode, SelectionType, SingleSelection, TextInputBase, Validation, ValidationState, ValueBase }; | ||
export { AriaLabelingProps, AriaValidationProps, AsyncLoadable, DOMElements, DOMProps, Direction, DisabledBehavior, ElementType, Expandable, FocusEvents, FocusStrategy, FocusWithinEvents, FocusableDOMProps, FocusableProps, HelpTextProps, HoverEvent, HoverEvents, HoverPointerType, InputBase, IntrinsicHTMLElements, ItemKey, KeyboardDelegate, KeyboardEvents, LabelableProps, LongPressEvent, MultipleSelection, Orientation, PointerType, PressEvent, PressEvents, SelectionBehavior, SelectionMode, SelectionType, SingleSelection, TextInputBase, TextInputDOMEvents, TextInputDOMProps, Validation, ValidationState, ValueBase }; |
{ | ||
"name": "@solid-aria/types", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "A collection of type definitions, for building Solid Aria primitives.", |
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
20897
447