@wavv/ui 1.0.1 → 1.1.0-beta.1

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.
Files changed (42) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +5 -5
  4. package/dist/cjs/types/components/Dropdown/DropdownUtils.d.ts +7 -7
  5. package/dist/cjs/types/components/Form.d.ts +10 -10
  6. package/dist/cjs/types/components/Input.d.ts +5 -5
  7. package/dist/cjs/types/components/InputHelpers.d.ts +2 -2
  8. package/dist/cjs/types/components/Table/Body.d.ts +7 -0
  9. package/dist/cjs/types/components/Table/Column.d.ts +21 -0
  10. package/dist/cjs/types/components/Table/Content.d.ts +9 -0
  11. package/dist/cjs/types/components/Table/Header.d.ts +4 -0
  12. package/dist/cjs/types/components/Table/HeaderCell.d.ts +16 -0
  13. package/dist/cjs/types/components/Table/Row.d.ts +4 -0
  14. package/dist/cjs/types/components/Table/Table.d.ts +23 -0
  15. package/dist/cjs/types/components/Table/context.d.ts +4 -0
  16. package/dist/cjs/types/components/Table/index.d.ts +2 -0
  17. package/dist/cjs/types/components/Table/types.d.ts +38 -0
  18. package/dist/cjs/types/components/Table/utils.d.ts +2 -0
  19. package/dist/cjs/types/hooks/useSelect.d.ts +4 -4
  20. package/dist/esm/index.js +4 -4
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +5 -5
  23. package/dist/esm/types/components/Dropdown/DropdownUtils.d.ts +7 -7
  24. package/dist/esm/types/components/Form.d.ts +10 -10
  25. package/dist/esm/types/components/Input.d.ts +5 -5
  26. package/dist/esm/types/components/InputHelpers.d.ts +2 -2
  27. package/dist/esm/types/components/Table/Body.d.ts +7 -0
  28. package/dist/esm/types/components/Table/Column.d.ts +21 -0
  29. package/dist/esm/types/components/Table/Content.d.ts +9 -0
  30. package/dist/esm/types/components/Table/Header.d.ts +4 -0
  31. package/dist/esm/types/components/Table/HeaderCell.d.ts +16 -0
  32. package/dist/esm/types/components/Table/Row.d.ts +4 -0
  33. package/dist/esm/types/components/Table/Table.d.ts +23 -0
  34. package/dist/esm/types/components/Table/context.d.ts +4 -0
  35. package/dist/esm/types/components/Table/index.d.ts +2 -0
  36. package/dist/esm/types/components/Table/types.d.ts +38 -0
  37. package/dist/esm/types/components/Table/utils.d.ts +2 -0
  38. package/dist/esm/types/hooks/useSelect.d.ts +4 -4
  39. package/dist/index.d.ts +68 -75
  40. package/package.json +2 -1
  41. package/dist/cjs/types/components/Table.d.ts +0 -53
  42. package/dist/esm/types/components/Table.d.ts +0 -53
@@ -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;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, ReactNode } from 'react';
2
+ import { Height } from '../types';
3
+ declare type BodyProps = {
4
+ children: ReactNode;
5
+ } & Height & HTMLProps<HTMLTableSectionElement>;
6
+ declare const Body: ({ children, height }: BodyProps) => JSX.Element;
7
+ export default Body;
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ import { FlexPosition, ThemeProp } from '../types';
3
+ declare type TableColumn = {
4
+ children?: ReactNode;
5
+ /** The flex positioning of the Column contents */
6
+ contentPosition?: FlexPosition;
7
+ /** The string value to display if the child text is undefined (i.e. "N/A", "—") */
8
+ defaultValue?: string;
9
+ };
10
+ declare const Column: ({ children, contentPosition, defaultValue }: TableColumn) => JSX.Element;
11
+ declare const TableColumn: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any> | undefined;
14
+ } & {
15
+ contentPosition?: FlexPosition | undefined;
16
+ } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ } & {
19
+ showDefault?: boolean | undefined;
20
+ } & ThemeProp, {}, {}>;
21
+ export default Column;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { FlexPosition } from '../types';
3
+ declare const Content: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & {
7
+ contentPosition?: FlexPosition | undefined;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
+ export default Content;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TableHeaderRow } from './types';
3
+ declare const Header: ({ children, columns, ...rest }: TableHeaderRow) => JSX.Element;
4
+ export default Header;
@@ -0,0 +1,16 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { FlexPosition } from '../types';
3
+ declare type SortDir = 'asc' | 'desc' | 'inactive';
4
+ declare type HeaderCellProps = {
5
+ children?: ReactNode;
6
+ /** The flex positioning of the HeaderCell contents */
7
+ contentPosition?: FlexPosition;
8
+ /** The function to be called when the HeaderCell is clicked */
9
+ onClick?: (event: MouseEvent) => void;
10
+ /** Controls the direction of the sort icon indicating the direction of the data */
11
+ sorted?: SortDir;
12
+ /** The property of the data object to sort by */
13
+ sortKey?: string;
14
+ };
15
+ declare const HeaderCell: ({ children, onClick, contentPosition, sorted, sortKey }: HeaderCellProps) => JSX.Element;
16
+ export default HeaderCell;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TableHeaderRow } from './types';
3
+ declare const Row: ({ children, columns, onClick, ...rest }: TableHeaderRow) => JSX.Element;
4
+ export default Row;
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ import { Data, TableProps } from './types';
3
+ declare const Table: {
4
+ <DataType extends Data>({ children, columns, data, ...rest }: TableProps<DataType>): JSX.Element;
5
+ Header: ({ children, columns, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
6
+ HeaderCell: ({ children, onClick, contentPosition, sorted, sortKey }: {
7
+ children?: ReactNode;
8
+ contentPosition?: import("../types").FlexPosition | undefined;
9
+ onClick?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
10
+ sorted?: ("desc" | "inactive" | "asc") | undefined;
11
+ sortKey?: string | undefined;
12
+ }) => JSX.Element;
13
+ Body: ({ children, height }: {
14
+ children: ReactNode;
15
+ } & import("../types").Height & import("react").HTMLProps<HTMLTableSectionElement>) => JSX.Element;
16
+ Row: ({ children, columns, onClick, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
17
+ Column: ({ children, contentPosition, defaultValue }: {
18
+ children?: ReactNode;
19
+ contentPosition?: import("../types").FlexPosition | undefined;
20
+ defaultValue?: string | undefined;
21
+ }) => JSX.Element;
22
+ };
23
+ export default Table;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { Context, Data } from './types';
3
+ declare const TableContext: import("react").Context<Context<Data>>;
4
+ export default TableContext;
@@ -0,0 +1,2 @@
1
+ import Table from './Table';
2
+ export default Table;
@@ -0,0 +1,38 @@
1
+ import React, { HTMLProps, ReactNode } from 'react';
2
+ import { As, MarginPadding, Width, ThemeProp, Padding } from '../types';
3
+ export declare type Data = {
4
+ [key: string]: unknown;
5
+ };
6
+ export declare type SetData<DataType> = React.Dispatch<React.SetStateAction<DataType[]>>;
7
+ export declare type SetColumn = React.Dispatch<React.SetStateAction<string>>;
8
+ export declare type Columns = number | string;
9
+ export declare type SortedChildFunc<DataType> = (data: DataType[]) => ReactNode;
10
+ declare type Default = {
11
+ data?: never;
12
+ children: ReactNode;
13
+ };
14
+ declare type Sorted<DataType> = {
15
+ /** The data the table should use to add column sort functionality */
16
+ data: DataType[];
17
+ children: SortedChildFunc<DataType>;
18
+ };
19
+ declare type TableTypes<DataType> = Default | Sorted<DataType>;
20
+ declare type DefaultTableProps = Omit<HTMLProps<HTMLTableElement>, 'as' | 'children' | 'data'> & As;
21
+ declare type TableBase = {
22
+ /** If a number, columns creates n number columns of an equal size. If a string, columns sets the gridTemplateColumns property */
23
+ columns?: Columns;
24
+ } & Width & MarginPadding;
25
+ export declare type TableProps<DataType> = TableBase & TableTypes<DataType> & DefaultTableProps;
26
+ export declare type TableHeaderRow = TableBase & HTMLProps<HTMLTableRowElement>;
27
+ export declare type TableElements = {
28
+ as?: string;
29
+ } & ThemeProp & Padding;
30
+ export declare type Context<DataType> = {
31
+ data?: DataType[];
32
+ originalData?: DataType[];
33
+ parentColumns?: Columns;
34
+ setData?: SetData<DataType>;
35
+ activeColumn?: string;
36
+ setActiveColumn?: SetColumn;
37
+ };
38
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const wrappedChildren: (children: ReactNode, type: string) => (JSX.Element | null)[];
@@ -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;