@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;