@wavv/ui 1.0.1 → 1.0.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.
@@ -3,10 +3,10 @@ import { InputProps } from '../Input';
3
3
  import { Margin, WidthHeight, InputFocusEvent, InputRef } from '../types';
4
4
  import { OptionItem, DropdownItemProps } from './DropdownUtils';
5
5
  declare type RestInputProps = Omit<InputProps, 'value' | 'onChange' | 'onError'>;
6
- declare type DropdownProps = {
6
+ declare type DropdownProps<OptionType> = {
7
7
  children?: ReactNode;
8
8
  /** The function to be called when an option is selected */
9
- onChange?: (item: OptionItem | null) => void;
9
+ onChange?: (item: OptionType | null) => void;
10
10
  /** The function to be called when the search input is updated */
11
11
  onTextChange?: (text: string) => void;
12
12
  /** The value of the Dropdown */
@@ -26,7 +26,7 @@ declare type DropdownProps = {
26
26
  /** Sets the input placeholder color */
27
27
  placeholderColor?: string;
28
28
  /** The options to be displayed */
29
- options?: OptionItem[];
29
+ options?: OptionType[];
30
30
  /** Removes the border from the Dropdown input */
31
31
  borderless?: boolean;
32
32
  /** Sets the input borderColor */
@@ -79,7 +79,7 @@ declare type DropdownProps = {
79
79
  optionsParent?: string;
80
80
  } & WidthHeight & Margin & RestInputProps;
81
81
  declare const Dropdown: {
82
- ({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: DropdownProps): JSX.Element;
83
- Item({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps): JSX.Element;
82
+ <OptionType extends OptionItem>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: DropdownProps<OptionType>): JSX.Element;
83
+ Item<OptionType_1 extends OptionItem>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps<OptionType_1>): JSX.Element;
84
84
  };
85
85
  export default Dropdown;
@@ -11,8 +11,8 @@ export declare type OptionItem = {
11
11
  value?: unknown;
12
12
  [key: string]: unknown;
13
13
  };
14
- export declare type DropdownItemProps = {
15
- setValue?: (v: OptionItem) => void;
14
+ export declare type DropdownItemProps<OptionType> = {
15
+ setValue?: (v: OptionType) => void;
16
16
  close?: () => void;
17
17
  children: ReactNode;
18
18
  /** Sets the value of the option that will be returned in the object */
@@ -30,7 +30,7 @@ export declare type DropdownItemProps = {
30
30
  /** The id of the Item element */
31
31
  id: number | string;
32
32
  };
33
- declare type setValueFunc = (selection: OptionItem | string | null) => void;
33
+ export declare type setValueFunc = <OptionType extends OptionItem>(selection: OptionType | string | null) => void;
34
34
  declare type toggleFunc = (event?: MouseEvent) => void;
35
35
  declare type StatePieces = {
36
36
  selected: number;
@@ -39,8 +39,8 @@ declare type StatePieces = {
39
39
  inputText?: string;
40
40
  };
41
41
  declare type FilterState = Omit<StatePieces, 'selected'>;
42
- export declare const getFilteredOptions: (options: OptionItem[], state: FilterState) => OptionItem[];
43
- export declare const getOptionsFromArray: (options: OptionItem[], setValue: setValueFunc, toggle: toggleFunc, state: FilterState) => JSX.Element[];
44
- export declare const getOptionsFromChildren: (children: ReactNode, setValue: setValueFunc, toggle: toggleFunc) => (React.ReactElement<DropdownItemProps, string | React.JSXElementConstructor<any>> | null)[];
45
- export declare const getCombinedChildren: (options: OptionItem[], children: ReactNode, setValue: setValueFunc, toggle: toggleFunc, state: StatePieces) => (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
42
+ export declare const getFilteredOptions: <OptionType extends OptionItem>(options: OptionType[], state: FilterState) => OptionType[];
43
+ export declare const getOptionsFromArray: <OptionType extends OptionItem>(options: OptionType[], setValue: setValueFunc, toggle: toggleFunc, state: FilterState) => JSX.Element[];
44
+ export declare const getOptionsFromChildren: <OptionType extends OptionItem>(children: ReactNode, setValue: setValueFunc, toggle: toggleFunc) => (React.ReactElement<DropdownItemProps<OptionType>, string | React.JSXElementConstructor<any>> | null)[];
45
+ export declare const getCombinedChildren: <OptionType extends OptionItem>(options: OptionType[], children: ReactNode, setValue: setValueFunc, toggle: toggleFunc, state: StatePieces) => (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
46
46
  export {};
@@ -29,7 +29,7 @@ declare const Form: {
29
29
  width?: string | number | undefined;
30
30
  height?: string | number | undefined;
31
31
  containerRef?: import("react").MutableRefObject<HTMLDivElement> | undefined;
32
- value: string | number;
32
+ value?: string | number | undefined;
33
33
  disabled?: boolean | undefined;
34
34
  readOnly?: boolean | undefined;
35
35
  preventFocus?: boolean | undefined;
@@ -42,10 +42,10 @@ declare const Form: {
42
42
  onClear?: (() => void) | undefined;
43
43
  } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").As & {
44
44
  phone?: undefined;
45
- onChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
45
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>) => void) | undefined;
46
46
  } & import("./types").Margin, "search" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "pointer" | "backgroundColor" | "fontSize" | "borderColor" | "borderRadius" | "borderless" | "textOnly" | "invalid" | keyof import("./types").Margin | "placeholderColor" | "description" | "isLoading" | "iconLeft" | "iconRight" | "containerRef" | "preventFocus" | "onClear" | keyof {
47
47
  phone?: undefined;
48
- onChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
48
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>) => void) | undefined;
49
49
  }> | Pick<{
50
50
  id?: string | undefined;
51
51
  label?: string | undefined;
@@ -64,7 +64,7 @@ declare const Form: {
64
64
  width?: string | number | undefined;
65
65
  height?: string | number | undefined;
66
66
  containerRef?: import("react").MutableRefObject<HTMLDivElement> | undefined;
67
- value: string | number;
67
+ value?: string | number | undefined;
68
68
  disabled?: boolean | undefined;
69
69
  readOnly?: boolean | undefined;
70
70
  preventFocus?: boolean | undefined;
@@ -77,15 +77,15 @@ declare const Form: {
77
77
  onClear?: (() => void) | undefined;
78
78
  } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").As & {
79
79
  phone: true;
80
- onChange: (event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void;
80
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
81
81
  } & import("./types").Margin, "search" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "pointer" | "backgroundColor" | "fontSize" | "borderColor" | "borderRadius" | "borderless" | "textOnly" | "invalid" | keyof import("./types").Margin | "placeholderColor" | "description" | "isLoading" | "iconLeft" | "iconRight" | "containerRef" | "preventFocus" | "onClear" | keyof {
82
82
  phone: true;
83
- onChange: (event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void;
83
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
84
84
  }>) & import("react").RefAttributes<import("./types").InputRef>>;
85
85
  Dropdown: {
86
- ({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: {
86
+ <OptionType extends import("./Dropdown").DropdownOption>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: {
87
87
  children?: ReactNode;
88
- onChange?: ((item: import("./Dropdown").DropdownOption | null) => void) | undefined;
88
+ onChange?: ((item: OptionType | null) => void) | undefined;
89
89
  onTextChange?: ((text: string) => void) | undefined;
90
90
  value?: string | number | undefined;
91
91
  afterShow?: (() => void) | undefined;
@@ -95,7 +95,7 @@ declare const Form: {
95
95
  onError?: ((invalid: boolean) => void) | undefined;
96
96
  placeholder?: string | undefined;
97
97
  placeholderColor?: string | undefined;
98
- options?: import("./Dropdown").DropdownOption[] | undefined;
98
+ options?: OptionType[] | undefined;
99
99
  borderless?: boolean | undefined;
100
100
  borderColor?: string | undefined;
101
101
  backgroundColor?: string | undefined;
@@ -506,7 +506,7 @@ declare const Form: {
506
506
  preventFocus?: boolean | undefined;
507
507
  onClear?: (() => void) | undefined;
508
508
  }): JSX.Element;
509
- Item({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: import("./Dropdown/DropdownUtils").DropdownItemProps): JSX.Element;
509
+ Item<OptionType_1 extends import("./Dropdown").DropdownOption>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: import("./Dropdown/DropdownUtils").DropdownItemProps<OptionType_1>): JSX.Element;
510
510
  };
511
511
  Radio: ({ id, label, labelPosition, checked, disabled, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
512
512
  id?: string | undefined;
@@ -8,11 +8,11 @@ declare type Default = {
8
8
  /** Auto-formats the input to a US phone number */
9
9
  phone?: never;
10
10
  /** A callback function that is run upon changing the contents of the input */
11
- onChange: OnChangeDefault;
11
+ onChange?: OnChangeDefault;
12
12
  };
13
13
  declare type Phone = {
14
14
  phone: true;
15
- onChange: OnChangePhone;
15
+ onChange?: OnChangePhone;
16
16
  };
17
17
  declare type InputTypes = Default | Phone;
18
18
  declare type DefaultInputProps = Omit<HTMLProps<HTMLInputElement>, 'onChange' | 'as'> & As;
@@ -52,7 +52,7 @@ export declare type InputProps = {
52
52
  /** A ref to the input's container element */
53
53
  containerRef?: MutableRefObject<HTMLDivElement>;
54
54
  /** Value of the input */
55
- value: string | number;
55
+ value?: string | number;
56
56
  /** Disables the input */
57
57
  disabled?: boolean;
58
58
  /** Prevents the input from being clicked, focused, hovered, or edited */
@@ -110,7 +110,7 @@ declare const Input: import("react").ForwardRefExoticComponent<(Pick<{
110
110
  /** A ref to the input's container element */
111
111
  containerRef?: MutableRefObject<HTMLDivElement> | undefined;
112
112
  /** Value of the input */
113
- value: string | number;
113
+ value?: string | number | undefined;
114
114
  /** Disables the input */
115
115
  disabled?: boolean | undefined;
116
116
  /** Prevents the input from being clicked, focused, hovered, or edited */
@@ -167,7 +167,7 @@ declare const Input: import("react").ForwardRefExoticComponent<(Pick<{
167
167
  /** A ref to the input's container element */
168
168
  containerRef?: MutableRefObject<HTMLDivElement> | undefined;
169
169
  /** Value of the input */
170
- value: string | number;
170
+ value?: string | number | undefined;
171
171
  /** Disables the input */
172
172
  disabled?: boolean | undefined;
173
173
  /** Prevents the input from being clicked, focused, hovered, or edited */
@@ -6,7 +6,7 @@ export declare const useInputFocus: (onFocus?: FocusCallBack, onBlur?: FocusCall
6
6
  handleFocus: (event?: InputFocusEvent) => void;
7
7
  handleBlur: (event?: InputFocusEvent) => void;
8
8
  };
9
- export declare const isInputFilled: (value: string | number) => boolean;
9
+ export declare const isInputFilled: (value?: string | number) => boolean;
10
10
  export declare const InputContainer: import("@emotion/styled").StyledComponent<{
11
11
  theme?: import("@emotion/react").Theme | undefined;
12
12
  as?: import("react").ElementType<any> | undefined;
@@ -73,6 +73,6 @@ declare const _default: {
73
73
  handleFocus: (event?: InputFocusEvent | undefined) => void;
74
74
  handleBlur: (event?: InputFocusEvent | undefined) => void;
75
75
  };
76
- isInputFilled: (value: string | number) => boolean;
76
+ isInputFilled: (value?: string | number | undefined) => boolean;
77
77
  };
78
78
  export default _default;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { OptionItem } from '../components/Dropdown/DropdownUtils';
3
- declare type UseSelectProps = {
3
+ declare type UseSelectProps<OptionType> = {
4
4
  /** The options that will be displayed in the list */
5
- options: OptionItem[];
5
+ options: OptionType[];
6
6
  /** The function called when an option is selected */
7
- select: (option: OptionItem | string | null) => void;
7
+ select: (option: OptionType | string | null) => void;
8
8
  /** The function to close the open option list */
9
9
  close: Function;
10
10
  /** The function to open the closed option list */
@@ -16,5 +16,5 @@ declare type UseSelectProps = {
16
16
  /** The text from a search Droppdown */
17
17
  searchText?: string;
18
18
  };
19
- declare const useSelect: ({ options, select, close, open, searchText, isOpen, isFocused }: UseSelectProps) => readonly [number, import("react").RefObject<HTMLDivElement>];
19
+ declare const useSelect: <OptionType extends OptionItem>({ options, select, close, open, searchText, isOpen, isFocused, }: UseSelectProps<OptionType>) => readonly [number, import("react").RefObject<HTMLDivElement>];
20
20
  export default useSelect;
package/dist/index.d.ts CHANGED
@@ -575,8 +575,8 @@ declare type OptionItem = {
575
575
  value?: unknown;
576
576
  [key: string]: unknown;
577
577
  };
578
- declare type DropdownItemProps = {
579
- setValue?: (v: OptionItem) => void;
578
+ declare type DropdownItemProps<OptionType> = {
579
+ setValue?: (v: OptionType) => void;
580
580
  close?: () => void;
581
581
  children: ReactNode;
582
582
  /** Sets the value of the option that will be returned in the object */
@@ -1233,11 +1233,11 @@ declare type Default = {
1233
1233
  /** Auto-formats the input to a US phone number */
1234
1234
  phone?: never;
1235
1235
  /** A callback function that is run upon changing the contents of the input */
1236
- onChange: OnChangeDefault;
1236
+ onChange?: OnChangeDefault;
1237
1237
  };
1238
1238
  declare type Phone = {
1239
1239
  phone: true;
1240
- onChange: OnChangePhone;
1240
+ onChange?: OnChangePhone;
1241
1241
  };
1242
1242
  declare type InputTypes = Default | Phone;
1243
1243
  declare type DefaultInputProps = Omit<HTMLProps<HTMLInputElement>, 'onChange' | 'as'> & As;
@@ -1277,7 +1277,7 @@ declare type InputProps = {
1277
1277
  /** A ref to the input's container element */
1278
1278
  containerRef?: MutableRefObject<HTMLDivElement>;
1279
1279
  /** Value of the input */
1280
- value: string | number;
1280
+ value?: string | number;
1281
1281
  /** Disables the input */
1282
1282
  disabled?: boolean;
1283
1283
  /** Prevents the input from being clicked, focused, hovered, or edited */
@@ -1335,7 +1335,7 @@ declare const Input: react.ForwardRefExoticComponent<(Pick<{
1335
1335
  /** A ref to the input's container element */
1336
1336
  containerRef?: MutableRefObject<HTMLDivElement> | undefined;
1337
1337
  /** Value of the input */
1338
- value: string | number;
1338
+ value?: string | number | undefined;
1339
1339
  /** Disables the input */
1340
1340
  disabled?: boolean | undefined;
1341
1341
  /** Prevents the input from being clicked, focused, hovered, or edited */
@@ -1392,7 +1392,7 @@ declare const Input: react.ForwardRefExoticComponent<(Pick<{
1392
1392
  /** A ref to the input's container element */
1393
1393
  containerRef?: MutableRefObject<HTMLDivElement> | undefined;
1394
1394
  /** Value of the input */
1395
- value: string | number;
1395
+ value?: string | number | undefined;
1396
1396
  /** Disables the input */
1397
1397
  disabled?: boolean | undefined;
1398
1398
  /** Prevents the input from being clicked, focused, hovered, or edited */
@@ -1416,10 +1416,10 @@ declare const Input: react.ForwardRefExoticComponent<(Pick<{
1416
1416
  } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & As & Phone & Margin, "search" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "pointer" | "backgroundColor" | "fontSize" | "borderColor" | "borderRadius" | "borderless" | "textOnly" | "invalid" | keyof Margin | "placeholderColor" | "description" | "isLoading" | "iconLeft" | "iconRight" | "containerRef" | "preventFocus" | "onClear" | keyof Phone>) & react.RefAttributes<InputRef>>;
1417
1417
 
1418
1418
  declare type RestInputProps = Omit<InputProps, 'value' | 'onChange' | 'onError'>;
1419
- declare type DropdownProps = {
1419
+ declare type DropdownProps<OptionType> = {
1420
1420
  children?: ReactNode;
1421
1421
  /** The function to be called when an option is selected */
1422
- onChange?: (item: OptionItem | null) => void;
1422
+ onChange?: (item: OptionType | null) => void;
1423
1423
  /** The function to be called when the search input is updated */
1424
1424
  onTextChange?: (text: string) => void;
1425
1425
  /** The value of the Dropdown */
@@ -1439,7 +1439,7 @@ declare type DropdownProps = {
1439
1439
  /** Sets the input placeholder color */
1440
1440
  placeholderColor?: string;
1441
1441
  /** The options to be displayed */
1442
- options?: OptionItem[];
1442
+ options?: OptionType[];
1443
1443
  /** Removes the border from the Dropdown input */
1444
1444
  borderless?: boolean;
1445
1445
  /** Sets the input borderColor */
@@ -1492,8 +1492,8 @@ declare type DropdownProps = {
1492
1492
  optionsParent?: string;
1493
1493
  } & WidthHeight & Margin & RestInputProps;
1494
1494
  declare const Dropdown: {
1495
- ({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: DropdownProps): JSX.Element;
1496
- Item({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps): JSX.Element;
1495
+ <OptionType extends OptionItem>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: DropdownProps<OptionType>): JSX.Element;
1496
+ Item<OptionType_1 extends OptionItem>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps<OptionType_1>): JSX.Element;
1497
1497
  };
1498
1498
 
1499
1499
  declare type GridProps = {
@@ -1577,7 +1577,7 @@ declare const Form: {
1577
1577
  width?: string | number | undefined;
1578
1578
  height?: string | number | undefined;
1579
1579
  containerRef?: react.MutableRefObject<HTMLDivElement> | undefined;
1580
- value: string | number;
1580
+ value?: string | number | undefined;
1581
1581
  disabled?: boolean | undefined;
1582
1582
  readOnly?: boolean | undefined;
1583
1583
  preventFocus?: boolean | undefined;
@@ -1590,10 +1590,10 @@ declare const Form: {
1590
1590
  onClear?: (() => void) | undefined;
1591
1591
  } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & As & {
1592
1592
  phone?: undefined;
1593
- onChange: (event: react.ChangeEvent<HTMLInputElement>) => void;
1593
+ onChange?: ((event: react.ChangeEvent<HTMLInputElement>) => void) | undefined;
1594
1594
  } & Margin, "search" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "pointer" | "backgroundColor" | "fontSize" | "borderColor" | "borderRadius" | "borderless" | "textOnly" | "invalid" | keyof Margin | "placeholderColor" | "description" | "isLoading" | "iconLeft" | "iconRight" | "containerRef" | "preventFocus" | "onClear" | keyof {
1595
1595
  phone?: undefined;
1596
- onChange: (event: react.ChangeEvent<HTMLInputElement>) => void;
1596
+ onChange?: ((event: react.ChangeEvent<HTMLInputElement>) => void) | undefined;
1597
1597
  }> | Pick<{
1598
1598
  id?: string | undefined;
1599
1599
  label?: string | undefined;
@@ -1612,7 +1612,7 @@ declare const Form: {
1612
1612
  width?: string | number | undefined;
1613
1613
  height?: string | number | undefined;
1614
1614
  containerRef?: react.MutableRefObject<HTMLDivElement> | undefined;
1615
- value: string | number;
1615
+ value?: string | number | undefined;
1616
1616
  disabled?: boolean | undefined;
1617
1617
  readOnly?: boolean | undefined;
1618
1618
  preventFocus?: boolean | undefined;
@@ -1625,15 +1625,15 @@ declare const Form: {
1625
1625
  onClear?: (() => void) | undefined;
1626
1626
  } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & As & {
1627
1627
  phone: true;
1628
- onChange: (event: react.ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void;
1628
+ onChange?: ((event: react.ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
1629
1629
  } & Margin, "search" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "size" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "pointer" | "backgroundColor" | "fontSize" | "borderColor" | "borderRadius" | "borderless" | "textOnly" | "invalid" | keyof Margin | "placeholderColor" | "description" | "isLoading" | "iconLeft" | "iconRight" | "containerRef" | "preventFocus" | "onClear" | keyof {
1630
1630
  phone: true;
1631
- onChange: (event: react.ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void;
1631
+ onChange?: ((event: react.ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
1632
1632
  }>) & react.RefAttributes<InputRef>>;
1633
1633
  Dropdown: {
1634
- ({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: {
1634
+ <OptionType extends OptionItem>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: {
1635
1635
  children?: ReactNode;
1636
- onChange?: ((item: OptionItem | null) => void) | undefined;
1636
+ onChange?: ((item: OptionType | null) => void) | undefined;
1637
1637
  onTextChange?: ((text: string) => void) | undefined;
1638
1638
  value?: string | number | undefined;
1639
1639
  afterShow?: (() => void) | undefined;
@@ -1643,7 +1643,7 @@ declare const Form: {
1643
1643
  onError?: ((invalid: boolean) => void) | undefined;
1644
1644
  placeholder?: string | undefined;
1645
1645
  placeholderColor?: string | undefined;
1646
- options?: OptionItem[] | undefined;
1646
+ options?: OptionType[] | undefined;
1647
1647
  borderless?: boolean | undefined;
1648
1648
  borderColor?: string | undefined;
1649
1649
  backgroundColor?: string | undefined;
@@ -2054,7 +2054,7 @@ declare const Form: {
2054
2054
  preventFocus?: boolean | undefined;
2055
2055
  onClear?: (() => void) | undefined;
2056
2056
  }): JSX.Element;
2057
- Item({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps): JSX.Element;
2057
+ Item<OptionType_1 extends OptionItem>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps<OptionType_1>): JSX.Element;
2058
2058
  };
2059
2059
  Radio: ({ id, label, labelPosition, checked, disabled, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
2060
2060
  id?: string | undefined;
@@ -2164,7 +2164,7 @@ declare const _default: {
2164
2164
  handleFocus: (event?: InputFocusEvent | undefined) => void;
2165
2165
  handleBlur: (event?: InputFocusEvent | undefined) => void;
2166
2166
  };
2167
- isInputFilled: (value: string | number) => boolean;
2167
+ isInputFilled: (value?: string | number | undefined) => boolean;
2168
2168
  };
2169
2169
 
2170
2170
  declare type LabelProps = {
@@ -2613,11 +2613,11 @@ declare const useEventListener: <T extends Event>(element: MutableRefObject<HTML
2613
2613
 
2614
2614
  declare const useOnClickOutside: <T extends HTMLElement>(onClickOutside: () => void, condition?: boolean, exclusions?: string[]) => MutableRefObject<T | null>;
2615
2615
 
2616
- declare type UseSelectProps = {
2616
+ declare type UseSelectProps<OptionType> = {
2617
2617
  /** The options that will be displayed in the list */
2618
- options: OptionItem[];
2618
+ options: OptionType[];
2619
2619
  /** The function called when an option is selected */
2620
- select: (option: OptionItem | string | null) => void;
2620
+ select: (option: OptionType | string | null) => void;
2621
2621
  /** The function to close the open option list */
2622
2622
  close: Function;
2623
2623
  /** The function to open the closed option list */
@@ -2629,7 +2629,7 @@ declare type UseSelectProps = {
2629
2629
  /** The text from a search Droppdown */
2630
2630
  searchText?: string;
2631
2631
  };
2632
- declare const useSelect: ({ options, select, close, open, searchText, isOpen, isFocused }: UseSelectProps) => readonly [number, react.RefObject<HTMLDivElement>];
2632
+ declare const useSelect: <OptionType extends OptionItem>({ options, select, close, open, searchText, isOpen, isFocused, }: UseSelectProps<OptionType>) => readonly [number, react.RefObject<HTMLDivElement>];
2633
2633
 
2634
2634
  declare type ListItem = {
2635
2635
  id: number | string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],