@mackin.com/styleguide 7.6.0 → 7.7.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.
Files changed (3) hide show
  1. package/index.d.ts +536 -494
  2. package/index.js +2628 -2369
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -3,169 +3,60 @@ import * as React from 'react';
3
3
  import React__default, { ReactNode } from 'react';
4
4
  import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
5
5
 
6
- declare type Alignment = 'left' | 'right' | 'center';
7
-
8
- /** @deprecated This will not work correctly with emotion/css. Use 'cx' for adding multiple class names together. */
9
- declare const mergeClassNames: (...classes: (string | boolean | undefined)[]) => string | undefined;
10
- declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
11
-
12
- declare const Table: (props: {
13
- caption?: string | JSX.Element;
14
- children?: any;
15
- noCellBorder?: boolean;
16
- className?: string;
17
- /** Colors alternate rows. */
18
- altRows?: boolean;
19
- }) => JSX.Element;
20
- declare const Tr: (props: {
21
- className?: string;
22
- children?: any;
23
- }) => JSX.Element;
24
- declare const Th: (props: {
25
- children?: any;
26
- align?: Alignment;
27
- width?: string;
28
- style?: React.CSSProperties;
29
- className?: string;
30
- }) => JSX.Element;
31
- declare const Td: (props: {
32
- children?: any;
33
- align?: Alignment;
34
- style?: React.CSSProperties;
35
- colSpan?: number;
36
- }) => JSX.Element;
37
-
38
- declare const TdCurrency: (props: {
39
- value: number;
40
- cents?: boolean;
41
- }) => JSX.Element;
42
-
43
- declare const TdNumber: (props: {
44
- value: number;
45
- }) => JSX.Element;
46
-
47
- declare const ThSort: (props: {
48
- text: string | JSX.Element;
49
- onClick: () => void;
50
- align?: Alignment;
51
- direction?: 'asc' | 'desc';
52
- style?: React.CSSProperties;
53
- width?: string;
54
- rightContent?: JSX.Element;
55
- }) => JSX.Element;
56
-
57
- declare type SortDirection = 'asc' | 'desc';
58
- interface PagerSortOption<TItem> {
59
- id: string;
60
- name?: string;
61
- sort: (items: TItem[]) => TItem[];
62
- }
63
- interface PagerOptions<TItem> {
64
- /** Defaults to 10. */
65
- limit?: number;
66
- /** Defaults to [10] */
67
- limitOptions?: number[];
68
- sort?: string;
69
- sortOptions?: PagerSortOption<TItem>[];
70
- previous?: ItemPager<TItem>;
6
+ interface AutoCompleteItem {
7
+ id: string | number;
8
+ name: string;
71
9
  }
72
- /** For in-memory paging. */
73
- declare class ItemPager<TItem> {
74
- constructor(allItems: TItem[], options?: PagerOptions<TItem>);
75
- get allItems(): TItem[];
76
- /** The ID of the current sort within the sortOptions. */
77
- get sort(): string | undefined;
78
- set sort(sortId: string | undefined);
79
- /** The direction of the current sort when using an option created from addToggleSortOption */
80
- get sortDirection(): SortDirection | undefined;
81
- get sortOptions(): PagerSortOption<TItem>[];
82
- get limit(): number;
83
- set limit(value: number);
84
- get limitOptions(): number[];
85
- get totalPages(): number;
86
- /** The zero-based page index. */
87
- get page(): number;
88
- /** The zero-based page index. */
89
- set page(value: number);
90
- get pageItems(): TItem[];
91
- get totalItems(): number;
92
- get minItemIndex(): number;
93
- get maxItemIndex(): number;
94
- get hasNext(): boolean;
95
- get hasPrevious(): boolean;
96
- /**
97
- * Adds both asc and des sort options
98
- *
99
- * @param propPath Prop name or path ('resource.title').
100
- * @param name Name to display or asc Name and desc Name.
101
- */
102
- addToggleSortOption(propPath: string, name?: string | [string, string]): void;
103
- /**
104
- * Toggles between asc and desc.
105
- * @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
106
- */
107
- toggleSort(sortId: string): void;
108
- applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
109
- next(): void;
110
- previous(): void;
111
- pageByOffset(direction: 1 | -1): void;
112
- /** Adds the item optionally keeping the current page. */
113
- add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
114
- /** Removes the matched item(s). */
115
- remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
116
- replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
117
- private _allItems;
118
- private _page;
119
- private _limit;
120
- private _limitOptions;
121
- private _pageResult;
122
- private _filteredItems;
123
- private _sort;
124
- private _sortOptions;
125
- private _currentFilter;
126
- private createPageResult;
127
- }
128
-
129
- interface PagerStyleProps {
130
- /** Used for localizations. Defaults to 'of' */
131
- itemDividerText?: string;
132
- /** Used for localizations. Defaults to 'No Results' */
133
- noResultsText?: string;
134
- /** Used for localizations. Defaults to 'Page' */
135
- pageText?: string;
10
+ declare type AutocompleteValue = string | AutoCompleteItem;
11
+ interface AutocompleteProps {
12
+ value: AutocompleteValue | undefined;
13
+ round?: boolean;
136
14
  /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
137
15
  rounded?: boolean;
16
+ rightControl?: JSX.Element;
17
+ placeholder?: string;
18
+ id?: string;
19
+ disabled?: boolean;
138
20
  className?: string;
139
- leftControls?: JSX.Element;
140
- rightControls?: JSX.Element;
141
- }
142
- interface PagerProps extends PagerStyleProps {
143
- canGoNext: boolean;
144
- canGoPrevious: boolean;
145
- minItem: number;
146
- maxItem: number;
147
- totalItems: number;
148
- page: (direction: 1 | -1) => void;
149
- /** For display purposes. Will show under items text if this if present. */
150
- pageIndex?: number;
151
- /** For display purposes. Will show under items text if this if present. */
152
- totalPages?: number;
21
+ inputClassName?: string;
22
+ /** If not set, defaults to 100 */
23
+ maxLength?: number;
24
+ required?: boolean;
25
+ /** Limits what will be show in the autocomplete options. Default is 7. */
26
+ maxShownValues?: number;
27
+ /** The minimum characters before 'getOptions' is called. No default. */
28
+ minChars?: number;
29
+ inputAriaAttributes?: React.AriaAttributes;
30
+ onChange: (value: string) => void;
31
+ getOptions: (value: string) => Promise<AutocompleteValue[]>;
32
+ onPick: (value: AutocompleteValue) => void;
33
+ onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
153
34
  }
154
- declare const Pager: (props: PagerProps) => JSX.Element;
35
+ declare const Autocomplete: (p: AutocompleteProps) => JSX.Element;
155
36
 
156
- interface Props$1<T> extends PagerStyleProps {
157
- pager: ItemPager<T>;
158
- onPage: (direction: 1 | -1) => void;
159
- /** Defaults to 'Limit' */
160
- limitText?: string;
161
- /** Defaults to 'Sort' */
162
- sortText?: string;
163
- onLimit?: (limit: number) => void;
164
- onSort?: (sort: string) => void;
165
- /** Shows 'Page X of Y'. */
166
- showPageText?: boolean;
167
- }
168
- declare const BoundMemoryPager: <T>(p: Props$1<T>) => JSX.Element;
37
+ /** @deprecated Use Backdrop2 going forward. */
38
+ declare const Backdrop$1: (props: {
39
+ show: boolean;
40
+ onClick?: () => void;
41
+ transparent?: boolean;
42
+ /** If true, the backdrop will hide on larger screens. */
43
+ responsive?: boolean;
44
+ /** If true, the backdrop will hide on smaller screens. */
45
+ reverseResponsive?: boolean;
46
+ children?: React.ReactNode;
47
+ className?: string;
48
+ /** If true, will not prevent scroll when shown. */
49
+ allowScroll?: boolean;
50
+ /** Fade in time. Defaults to 250ms. */
51
+ showTimeMs?: number;
52
+ }) => JSX.Element;
53
+
54
+ declare const Backdrop: (p: {
55
+ children: React__default.ReactNode;
56
+ /** Fade in time. Defaults to 250ms. */
57
+ showTimeMs?: number;
58
+ debug?: boolean;
59
+ }) => JSX.Element;
169
60
 
170
61
  declare type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
171
62
  interface ButtonProps {
@@ -203,16 +94,42 @@ interface ButtonProps {
203
94
  }
204
95
  declare const Button: (props: ButtonProps) => JSX.Element;
205
96
 
206
- interface CheckboxProps {
97
+ interface CalendarProps {
98
+ month: number;
99
+ year: number;
100
+ /** Defaults to 3rem. */
101
+ cellSize?: string;
102
+ smallHeader?: boolean;
103
+ id?: string;
104
+ /** Defaults to true. */
105
+ title?: boolean;
106
+ yearInTitle?: boolean;
107
+ /** Ignored if title is set to false. */
108
+ customTitle?: JSX.Element;
109
+ /** If true, will always show 6 rows / 42 cells. */
110
+ fixedRows?: boolean;
111
+ /** Bolds the current date. */
112
+ showCurrent?: boolean;
113
+ selectedValue?: number;
114
+ /** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
115
+ renderCell?: (date: Date) => JSX.Element;
116
+ /** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
117
+ isCellDisabled?: (date: Date) => boolean;
118
+ onClick?: (date: Date) => void;
119
+ /** This is the ms from Date.valueOf(). */
120
+ min?: number;
121
+ /** This is the ms from Date.valueOf(). */
122
+ max?: number;
123
+ }
124
+ declare const Calendar: (p: CalendarProps) => JSX.Element;
125
+
126
+ interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'checked' | 'onChange' | 'type'> {
207
127
  checked: boolean;
208
- onChange: (checked: boolean) => void;
128
+ onChange: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
129
+ readonly?: boolean;
209
130
  label?: string;
210
- children?: React.ReactNode;
211
- className?: string;
212
131
  checkedIcon?: string;
213
132
  uncheckedIcon?: string;
214
- disabled?: boolean;
215
- readonly?: boolean;
216
133
  /** Background color when checked based on the current theme. Mutually exclusive with 'checkedColor'. */
217
134
  checkedThemeColor?: 'primary' | 'primary2' | 'secondary';
218
135
  /** Background color when checked. Mutually exclusive with 'checkedThemeColor'. */
@@ -235,16 +152,72 @@ interface ConfirmModalProps {
235
152
  }
236
153
  declare const ConfirmModal: (props: ConfirmModalProps) => JSX.Element;
237
154
 
238
- declare const Divider: () => JSX.Element;
155
+ interface CopyButtonProps {
156
+ /** HTML selector of the target input to copy from. */
157
+ selector: string;
158
+ title?: string;
159
+ }
160
+ declare const CopyButton: (props: CopyButtonProps) => JSX.Element;
239
161
 
240
- declare const ErrorModal: (props: {
241
- message: string;
242
- show: boolean;
162
+ interface DatePickerProps {
163
+ value: number | undefined;
164
+ /** Called with debounce when the input changes. */
165
+ onChange: (value: number | undefined) => void;
166
+ style?: React.CSSProperties;
167
+ /** Defaults to MM/DD/YYYY. */
168
+ placeholder?: string;
243
169
  id?: string;
244
- debug?: boolean;
170
+ disabled?: boolean;
171
+ className?: string;
172
+ inputClassName?: string;
173
+ readOnly?: boolean;
174
+ required?: boolean;
175
+ /** Defaults to 250ms */
176
+ debounceMs?: number;
177
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
178
+ rounded?: boolean;
179
+ round?: boolean;
180
+ /** This is the ms from Date.valueOf(). */
181
+ min?: number;
182
+ /** This is the ms from Date.valueOf(). */
183
+ max?: number;
184
+ /** Whether to move the popover on collision with the parent's bounds. Default is true. */
185
+ reposition?: boolean;
186
+ }
187
+ declare const DatePicker: (p: DatePickerProps) => JSX.Element;
188
+
189
+ declare const Divider: () => JSX.Element;
190
+
191
+ declare const ErrorModal: (props: {
192
+ message: string;
193
+ show: boolean;
194
+ id?: string;
195
+ debug?: boolean;
245
196
  close: () => void;
246
197
  }) => JSX.Element;
247
198
 
199
+ interface FileUploaderProps {
200
+ onUpload: (files: FileList) => Promise<void>;
201
+ /** Defaults to 'Upload'. */
202
+ buttonText?: string;
203
+ /** Defauts to 'Upload successful'. */
204
+ successMessage?: string | JSX.Element;
205
+ /** Defaults to 'Upload failed.' */
206
+ failureMessage?: string | JSX.Element;
207
+ /** Defaults to 10rem. */
208
+ buttonWidth?: string;
209
+ /** Defaults to 'primary'. */
210
+ buttonVariant?: ButtonVariant;
211
+ maxBytes?: number;
212
+ multiple?: boolean;
213
+ accept?: string;
214
+ /** Defaults to 'Click or drag and drop files.'*/
215
+ instructionMessage?: string;
216
+ /** For additional info below the instructionMessage. */
217
+ infoMessage?: string | JSX.Element;
218
+ }
219
+ declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
220
+
248
221
  declare type FormProps = React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement>;
249
222
  interface IProps extends FormProps {
250
223
  inline?: boolean;
@@ -252,7 +225,7 @@ interface IProps extends FormProps {
252
225
  ajax?: boolean;
253
226
  }
254
227
  /** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
255
- declare const Form: React.ForwardRefExoticComponent<Pick<IProps, "inline" | "ajax" | "key" | "acceptCharset" | "action" | "autoComplete" | "encType" | "method" | "name" | "noValidate" | "target" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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" | "onChange" | "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"> & React.RefAttributes<any>>;
228
+ declare const Form: React.ForwardRefExoticComponent<Pick<IProps, "inline" | "ajax" | "key" | "acceptCharset" | "action" | "autoComplete" | "encType" | "method" | "name" | "noValidate" | "target" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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" | "onChange" | "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"> & React.RefAttributes<HTMLFormElement>>;
256
229
  declare const FormFlexRow: (props: {
257
230
  children: React.ReactNode;
258
231
  className?: string;
@@ -333,6 +306,24 @@ interface InfoTipProps {
333
306
  }
334
307
  declare const InfoTip: (props: InfoTipProps) => JSX.Element;
335
308
 
309
+ interface BaseInputProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
310
+ rightControl?: JSX.Element;
311
+ round?: boolean;
312
+ /** The class applied to the wrapping element without this component. Use 'className' to style the input directly. */
313
+ wrapperClassName?: string;
314
+ }
315
+
316
+ interface DateInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step' | 'pattern' | 'maxLength'> {
317
+ /** The epoch timestamp. Equivalent to Date.valueOf(). */
318
+ value: number | undefined;
319
+ /** The min epoch timestamp. */
320
+ min?: number;
321
+ /** The max epoch timestamp. */
322
+ max?: number;
323
+ onChange: (value: number | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
324
+ }
325
+ declare const DateInput: React.ForwardRefExoticComponent<Pick<DateInputProps, "value" | "onChange" | "min" | "max" | "rightControl" | "round" | "wrapperClassName" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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"> & React.RefAttributes<HTMLInputElement>>;
326
+
336
327
  declare type InputValue = string | number | undefined;
337
328
  declare type InputType = 'text' | 'number' | 'textarea' | 'date' | 'password' | 'url' | 'email';
338
329
  interface InputProps {
@@ -353,8 +344,9 @@ interface InputProps {
353
344
  /** Defaults to 'off'. */
354
345
  autoComplete?: string;
355
346
  autoFocus?: boolean;
347
+ inputAriaAttributes?: React.AriaAttributes;
356
348
  /** Called with debounce when the input changes. */
357
- onChange?: (value: InputValue, name?: string) => void;
349
+ onChange?: (value: InputValue, name?: string, event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
358
350
  onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
359
351
  onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
360
352
  onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
@@ -374,8 +366,32 @@ interface InputProps {
374
366
  rows?: number;
375
367
  pattern?: string;
376
368
  }
369
+ /** @deprecated Use DateInput, NumberInput, or TextInput instead. */
377
370
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<any>>;
378
371
 
372
+ interface NumberInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step'> {
373
+ value: number | undefined;
374
+ min?: number;
375
+ max?: number;
376
+ step?: number;
377
+ onChange: (value: number | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
378
+ }
379
+ declare const NumberInput: React.ForwardRefExoticComponent<Pick<NumberInputProps, "value" | "onChange" | "min" | "max" | "step" | "rightControl" | "round" | "wrapperClassName" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "maxLength" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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"> & React.RefAttributes<HTMLInputElement>>;
380
+
381
+ interface TextAreaProps extends Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value' | 'onChange'> {
382
+ value: string | undefined;
383
+ onChange: (value: string | undefined, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
384
+ }
385
+ declare const TextArea: React.ForwardRefExoticComponent<Pick<TextAreaProps, "value" | "onChange" | "key" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "disabled" | "form" | "maxLength" | "minLength" | "name" | "placeholder" | "readOnly" | "required" | "rows" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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"> & React.RefAttributes<HTMLTextAreaElement>>;
386
+
387
+ interface TextInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step'> {
388
+ value: string | undefined;
389
+ /** Defaults to 'text'. */
390
+ type?: 'text' | 'email' | 'url' | 'password';
391
+ onChange: (value: string | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
392
+ }
393
+ declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputProps, "type" | "value" | "onChange" | "rightControl" | "round" | "wrapperClassName" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "maxLength" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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"> & React.RefAttributes<HTMLInputElement>>;
394
+
379
395
  interface LabelProps {
380
396
  text: string | JSX.Element;
381
397
  children: React.ReactNode;
@@ -445,6 +461,7 @@ interface OmniLinkProps {
445
461
  children: React.ReactNode;
446
462
  onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
447
463
  className?: string;
464
+ style?: React.CSSProperties;
448
465
  noRouter?: boolean;
449
466
  /** Ignored if 'noRouter' is false */
450
467
  target?: string;
@@ -467,196 +484,250 @@ interface OmniLinkProps {
467
484
  }
468
485
  declare const OmniLink: (props: OmniLinkProps) => JSX.Element;
469
486
 
470
- declare type PickerValue = string | number;
471
- interface PickerProps<T extends PickerValue> {
472
- type: 'select';
473
- value: T;
474
- options: (T | {
475
- id: T;
476
- name?: string;
477
- })[];
478
- onChange: (value: T) => void;
479
- id?: string;
480
- /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
481
- rounded?: boolean;
482
- disabled?: boolean;
483
- className?: string;
484
- readonly?: boolean;
487
+ declare type SortDirection = 'asc' | 'desc';
488
+ interface PagerSortOption<TItem> {
489
+ id: string;
490
+ name?: string;
491
+ sort: (items: TItem[]) => TItem[];
485
492
  }
486
- declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => JSX.Element | null;
487
-
488
- interface ProgressBarProps {
489
- pct: number;
490
- round?: boolean;
491
- showPct?: boolean;
492
- className?: string;
493
+ interface PagerOptions<TItem> {
494
+ /** Defaults to 10. */
495
+ limit?: number;
496
+ /** Defaults to [10] */
497
+ limitOptions?: number[];
498
+ sort?: string;
499
+ sortOptions?: PagerSortOption<TItem>[];
500
+ previous?: ItemPager<TItem>;
493
501
  }
494
- declare const ProgressBar: (props: {
495
- pct: number;
496
- round?: boolean;
497
- showPct?: boolean;
498
- className?: string;
499
- }) => JSX.Element;
502
+ /** For in-memory paging. */
503
+ declare class ItemPager<TItem> {
504
+ constructor(allItems: TItem[], options?: PagerOptions<TItem>);
505
+ get allItems(): TItem[];
506
+ /** The ID of the current sort within the sortOptions. */
507
+ get sort(): string | undefined;
508
+ set sort(sortId: string | undefined);
509
+ /** The direction of the current sort when using an option created from addToggleSortOption */
510
+ get sortDirection(): SortDirection | undefined;
511
+ get sortOptions(): PagerSortOption<TItem>[];
512
+ get limit(): number;
513
+ set limit(value: number);
514
+ get limitOptions(): number[];
515
+ get totalPages(): number;
516
+ /** The zero-based page index. */
517
+ get page(): number;
518
+ /** The zero-based page index. */
519
+ set page(value: number);
520
+ get pageItems(): TItem[];
521
+ get totalItems(): number;
522
+ get minItemIndex(): number;
523
+ get maxItemIndex(): number;
524
+ get hasNext(): boolean;
525
+ get hasPrevious(): boolean;
526
+ /**
527
+ * Adds both asc and des sort options
528
+ *
529
+ * @param propPath Prop name or path ('resource.title').
530
+ * @param name Name to display or asc Name and desc Name.
531
+ */
532
+ addToggleSortOption(propPath: string, name?: string | [string, string]): void;
533
+ /**
534
+ * Toggles between asc and desc.
535
+ * @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
536
+ */
537
+ toggleSort(sortId: string): void;
538
+ applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
539
+ next(): void;
540
+ previous(): void;
541
+ pageByOffset(direction: 1 | -1): void;
542
+ /** Adds the item optionally keeping the current page. */
543
+ add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
544
+ /** Removes the matched item(s). */
545
+ remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
546
+ replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
547
+ private _allItems;
548
+ private _page;
549
+ private _limit;
550
+ private _limitOptions;
551
+ private _pageResult;
552
+ private _filteredItems;
553
+ private _sort;
554
+ private _sortOptions;
555
+ private _currentFilter;
556
+ private createPageResult;
557
+ }
500
558
 
501
- interface SearchBoxProps {
502
- value: string | undefined;
503
- onChange: (value: string | undefined | number) => void;
504
- id?: string;
505
- placeholder?: string;
506
- round?: boolean;
559
+ interface PagerStyleProps {
560
+ /** Used for localizations. Defaults to 'of' */
561
+ itemDividerText?: string;
562
+ /** Used for localizations. Defaults to 'No Results' */
563
+ noResultsText?: string;
564
+ /** Used for localizations. Defaults to 'Page' */
565
+ pageText?: string;
507
566
  /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
508
567
  rounded?: boolean;
509
568
  className?: string;
510
- onSubmit?: () => Promise<void>;
511
- /** Defaults to 250ms */
512
- debounceMs?: number;
569
+ leftControls?: JSX.Element;
570
+ rightControls?: JSX.Element;
513
571
  }
514
- declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
515
-
516
- interface TextProps {
517
- children: any;
518
- /** Defaults to 'p'. */
519
- tag?: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
520
- align?: Alignment;
521
- bold?: boolean;
522
- italics?: boolean;
523
- className?: string;
524
- /** You will need to set a width or max-width on the element for this to work. */
525
- ellipsis?: boolean;
526
- style?: React.CSSProperties;
527
- smaller?: boolean;
528
- larger?: boolean;
529
- spacedOut?: boolean;
530
- lineClamp?: number;
531
- /** Will remove all margin/padding from specified tag */
532
- noPad?: boolean;
533
- leftPad?: string;
572
+ interface PagerProps extends PagerStyleProps {
573
+ canGoNext: boolean;
574
+ canGoPrevious: boolean;
575
+ minItem: number;
576
+ maxItem: number;
577
+ totalItems: number;
578
+ page: (direction: 1 | -1) => void;
579
+ /** For display purposes. Will show under items text if this if present. */
580
+ pageIndex?: number;
581
+ /** For display purposes. Will show under items text if this if present. */
582
+ totalPages?: number;
534
583
  }
535
- declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
536
- style: React.CSSProperties;
537
- className: string;
538
- }, HTMLElement>;
584
+ declare const Pager: (props: PagerProps) => JSX.Element;
539
585
 
540
- declare type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
541
- interface ToggleButtonProps {
542
- checked: boolean;
543
- checkedText: string;
544
- uncheckedText: string;
545
- onClick: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
546
- className?: string;
547
- checkedClassName?: string;
548
- disabled?: boolean;
549
- /** The minimum button size will be set to the themes' formButtonMinWidth. */
550
- enforceMinWidth?: boolean;
551
- checkedIcon?: JSX.Element;
552
- uncheckedIcon?: JSX.Element;
553
- variant?: ToggleButtonVariant;
554
- checkedVariant?: ToggleButtonVariant;
555
- style?: React.CSSProperties;
556
- checkedStyle?: React.CSSProperties;
586
+ interface Props$1<T> extends PagerStyleProps {
587
+ pager: ItemPager<T>;
588
+ onPage: (direction: 1 | -1) => void;
589
+ /** Defaults to 'Limit' */
590
+ limitText?: string;
591
+ /** Defaults to 'Sort' */
592
+ sortText?: string;
593
+ onLimit?: (limit: number) => void;
594
+ onSort?: (sort: string) => void;
595
+ /** Shows 'Page X of Y'. */
596
+ showPageText?: boolean;
557
597
  }
558
- declare const ToggleButton: (props: ToggleButtonProps) => JSX.Element;
598
+ declare const BoundMemoryPager: <T>(p: Props$1<T>) => JSX.Element;
559
599
 
560
- interface ToggleButtonGroupProps {
561
- value: string | number;
562
- options: {
563
- id: string | number;
564
- name: string | JSX.Element;
565
- rightIcon?: JSX.Element;
566
- activeClass?: string;
567
- }[];
568
- onChange: (value: string | number) => void;
569
- className?: string;
570
- disabled?: boolean;
571
- /** The minimum button size will be set to the themes' formButtonMinWidth. */
572
- enforceMinWidth?: boolean;
573
- round?: boolean;
574
- small?: boolean;
575
- width?: string;
600
+ interface Props<T> extends PagerStyleProps {
601
+ result: PagedResult<T>;
602
+ onPage: (direction: 1 | -1) => void;
603
+ limitOptions?: number[];
604
+ sort?: string | number;
605
+ sortOptions?: {
606
+ id: string | number;
607
+ name?: string;
608
+ }[];
609
+ /** Defaults to 'Limit' */
610
+ limitText?: string;
611
+ /** Defaults to 'Sort' */
612
+ sortText?: string;
613
+ onLimit?: (limit: number) => void;
614
+ onSort?: (sort: string | number) => void;
615
+ /** Shows 'Page X of Y'. */
616
+ showPageText?: boolean;
576
617
  }
577
- declare const ToggleButtonGroup: (props: ToggleButtonGroupProps) => JSX.Element;
618
+ declare const BoundStaticPager: <T>(p: Props<T>) => JSX.Element;
578
619
 
579
- declare const WaitingIndicator: (p: {
580
- show: boolean;
581
- minShowTimeMs?: number;
582
- id?: string;
583
- debug?: boolean;
584
- }) => JSX.Element;
620
+ declare class PagedResult<T> {
621
+ constructor(items?: T[], total?: number, page?: number, limit?: number);
622
+ static fromDto<T>(dto: {
623
+ [key: string]: any;
624
+ }): PagedResult<T>;
625
+ total: number;
626
+ /** The zero-based page index. */
627
+ page: number;
628
+ limit: number;
629
+ items: T[];
630
+ /** Helper for items.length */
631
+ get length(): number;
632
+ get hasItems(): boolean;
633
+ get previousPage(): number;
634
+ get hasPrevious(): boolean;
635
+ get nextPage(): number;
636
+ get hasNext(): boolean;
637
+ get lastPage(): number;
638
+ get totalPages(): number;
639
+ get minPageItemIndex(): number;
640
+ get maxPageItemIndex(): number;
641
+ /** Returns the first item on the current page. */
642
+ get firstPageItem(): T;
643
+ /** Returns the last item on the current page */
644
+ get lastPageItem(): T;
645
+ getPageRelativeItemIndex(item: T): number;
646
+ getResultRelativeItemIndex(item: T): number | undefined;
647
+ getPreviousItem(fromItem: T): T | undefined;
648
+ getNextItem(fromItem: T): T | undefined;
649
+ getPagingRange(radius: number): number[];
650
+ toJSON(): {
651
+ [key: string]: any;
652
+ };
653
+ clone(newItems?: T[]): PagedResult<T>;
654
+ }
585
655
 
586
- interface CalendarProps {
587
- month: number;
588
- year: number;
589
- /** Defaults to 3rem. */
590
- cellSize?: string;
591
- smallHeader?: boolean;
592
- id?: string;
593
- /** Defaults to true. */
594
- title?: boolean;
595
- yearInTitle?: boolean;
596
- /** Ignored if title is set to false. */
597
- customTitle?: JSX.Element;
598
- /** If true, will always show 6 rows / 42 cells. */
599
- fixedRows?: boolean;
600
- /** Bolds the current date. */
601
- showCurrent?: boolean;
602
- selectedValue?: number;
603
- /** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
604
- renderCell?: (date: Date) => JSX.Element;
605
- /** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
606
- isCellDisabled?: (date: Date) => boolean;
607
- onClick?: (date: Date) => void;
608
- /** This is the ms from Date.valueOf(). */
609
- min?: number;
610
- /** This is the ms from Date.valueOf(). */
611
- max?: number;
656
+ declare type PickerValue = string | number;
657
+ interface SelectProps extends Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, 'value' | 'options' | 'onChange'> {
612
658
  }
613
- declare const Calendar: (p: CalendarProps) => JSX.Element;
614
-
615
- interface DatePickerProps {
616
- value: number | undefined;
617
- /** Called with debounce when the input changes. */
618
- onChange: (value: number | undefined) => void;
619
- style?: React.CSSProperties;
620
- /** Defaults to MM/DD/YYYY. */
621
- placeholder?: string;
622
- id?: string;
623
- disabled?: boolean;
624
- className?: string;
625
- inputClassName?: string;
626
- readOnly?: boolean;
627
- required?: boolean;
628
- /** Defaults to 250ms */
629
- debounceMs?: number;
659
+ interface PickerProps<T extends PickerValue> extends SelectProps {
660
+ value: T;
661
+ options: (T | {
662
+ id: T;
663
+ name?: string;
664
+ })[];
665
+ onChange: (value: T, event: React.ChangeEvent<HTMLSelectElement>) => void;
666
+ readonly?: boolean;
667
+ /** @deprecated Unused. Picker will always render a 'select' element. */
668
+ type?: 'select';
630
669
  /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
631
670
  rounded?: boolean;
632
- round?: boolean;
633
- /** This is the ms from Date.valueOf(). */
634
- min?: number;
635
- /** This is the ms from Date.valueOf(). */
636
- max?: number;
671
+ }
672
+ declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => JSX.Element;
673
+
674
+ interface PopoverProps {
675
+ isOpen: boolean;
676
+ /** The content inside the popover. */
677
+ content: JSX.Element;
678
+ /** The element controlling the state of the popover. */
679
+ parent: JSX.Element;
680
+ id?: string;
637
681
  /** Whether to move the popover on collision with the parent's bounds. Default is true. */
638
682
  reposition?: boolean;
683
+ onClickOutside?: (e: MouseEvent) => void;
684
+ /** Popover arrow color. Defaults to theme.colors.border. */
685
+ arrorColor?: string;
686
+ /** Popover border. Defaults to theme.controls.border. */
687
+ border?: string;
688
+ /** Popover background. Defaults to theme.colors.bg. */
689
+ backgroundColor?: string;
690
+ /** Order of positions as the Popover colides with the window edge. */
691
+ positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
639
692
  }
640
- declare const DatePicker: (p: DatePickerProps) => JSX.Element;
693
+ declare const Popover: (p: PopoverProps) => JSX.Element;
641
694
 
642
- interface TabHeaderTabProps {
643
- name: string;
695
+ interface ProgressBarProps {
696
+ pct: number;
697
+ round?: boolean;
698
+ showPct?: boolean;
699
+ className?: string;
644
700
  }
645
- interface TabHeaderProps {
646
- tabs: TabHeaderTabProps[];
701
+ declare const ProgressBar: (props: {
702
+ pct: number;
703
+ round?: boolean;
704
+ showPct?: boolean;
705
+ className?: string;
706
+ }) => JSX.Element;
707
+
708
+ interface SearchBoxProps {
709
+ value: string | undefined;
710
+ onChange: (value: string | undefined | number) => void;
647
711
  id?: string;
712
+ placeholder?: string;
713
+ round?: boolean;
648
714
  /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
649
715
  rounded?: boolean;
650
- /** Defaults to 10rem. */
651
- maxTabWidth?: string;
652
- onTabChanged?: (tabIndex: number) => void;
653
- /** Defaults to 'tab'. */
654
- variant?: 'tab' | 'button';
716
+ className?: string;
717
+ onSubmit?: () => Promise<void>;
718
+ /** Defaults to 250ms */
719
+ debounceMs?: number;
655
720
  }
656
- declare const TabHeader: (p: TabHeaderProps) => JSX.Element;
721
+ declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
722
+
723
+ declare type Alignment = 'left' | 'right' | 'center';
657
724
 
658
725
  declare const GlobalStyles: () => null;
659
726
 
727
+ /** @deprecated This will not work correctly with emotion/css. Use 'cx' for adding multiple class names together. */
728
+ declare const mergeClassNames: (...classes: (string | boolean | undefined)[]) => string | undefined;
729
+ declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
730
+
660
731
  interface MackinTheme {
661
732
  colors: {
662
733
  primary: string;
@@ -751,129 +822,15 @@ interface MackinTheme {
751
822
  declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
752
823
  declare const defaultTheme: MackinTheme;
753
824
 
754
- /** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
755
- declare const useThemeSafely: () => MackinTheme;
756
-
757
825
  declare const ThemeProvider: <T extends MackinTheme>(p: {
758
826
  children?: ReactNode;
759
827
  theme: T;
760
828
  }) => JSX.Element;
761
829
 
762
- declare const TabLocker: (props: {
763
- disabled?: boolean;
764
- children?: React.ReactNode;
765
- style?: React.CSSProperties;
766
- }) => JSX.Element;
767
-
768
- interface FileUploaderProps {
769
- onUpload: (files: FileList) => Promise<void>;
770
- /** Defaults to 'Upload'. */
771
- buttonText?: string;
772
- /** Defauts to 'Upload successful'. */
773
- successMessage?: string | JSX.Element;
774
- /** Defaults to 'Upload failed.' */
775
- failureMessage?: string | JSX.Element;
776
- /** Defaults to 10rem. */
777
- buttonWidth?: string;
778
- /** Defaults to 'primary'. */
779
- buttonVariant?: ButtonVariant;
780
- maxBytes?: number;
781
- multiple?: boolean;
782
- accept?: string;
783
- /** Defaults to 'Click or drag and drop files.'*/
784
- instructionMessage?: string;
785
- /** For additional info below the instructionMessage. */
786
- infoMessage?: string | JSX.Element;
787
- }
788
- declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
789
-
790
- interface CopyButtonProps {
791
- /** HTML selector of the target input to copy from. */
792
- selector: string;
793
- title?: string;
794
- }
795
- declare const CopyButton: (props: CopyButtonProps) => JSX.Element;
796
-
797
- interface PopoverProps {
798
- isOpen: boolean;
799
- /** The content inside the popover. */
800
- content: JSX.Element;
801
- /** The element controlling the state of the popover. */
802
- parent: JSX.Element;
803
- id?: string;
804
- /** Whether to move the popover on collision with the parent's bounds. Default is true. */
805
- reposition?: boolean;
806
- onClickOutside?: (e: MouseEvent) => void;
807
- /** Popover arrow color. Defaults to theme.colors.border. */
808
- arrorColor?: string;
809
- /** Popover border. Defaults to theme.controls.border. */
810
- border?: string;
811
- /** Popover background. Defaults to theme.colors.bg. */
812
- backgroundColor?: string;
813
- /** Order of positions as the Popover colides with the window edge. */
814
- positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
815
- }
816
- declare const Popover: (p: PopoverProps) => JSX.Element;
817
-
818
- interface TogglePasswordInputProps extends Omit<InputProps, 'type' | 'rightControl'> {
819
- }
820
- declare const TogglePasswordInput: (p: TogglePasswordInputProps) => JSX.Element;
821
-
822
- declare class PagedResult<T> {
823
- constructor(items?: T[], total?: number, page?: number, limit?: number);
824
- static fromDto<T>(dto: {
825
- [key: string]: any;
826
- }): PagedResult<T>;
827
- total: number;
828
- /** The zero-based page index. */
829
- page: number;
830
- limit: number;
831
- items: T[];
832
- /** Helper for items.length */
833
- get length(): number;
834
- get hasItems(): boolean;
835
- get previousPage(): number;
836
- get hasPrevious(): boolean;
837
- get nextPage(): number;
838
- get hasNext(): boolean;
839
- get lastPage(): number;
840
- get totalPages(): number;
841
- get minPageItemIndex(): number;
842
- get maxPageItemIndex(): number;
843
- /** Returns the first item on the current page. */
844
- get firstPageItem(): T;
845
- /** Returns the last item on the current page */
846
- get lastPageItem(): T;
847
- getPageRelativeItemIndex(item: T): number;
848
- getResultRelativeItemIndex(item: T): number | undefined;
849
- getPreviousItem(fromItem: T): T | undefined;
850
- getNextItem(fromItem: T): T | undefined;
851
- getPagingRange(radius: number): number[];
852
- toJSON(): {
853
- [key: string]: any;
854
- };
855
- clone(newItems?: T[]): PagedResult<T>;
856
- }
830
+ declare const useMediaQuery: (query: string) => boolean;
857
831
 
858
- interface Props<T> extends PagerStyleProps {
859
- result: PagedResult<T>;
860
- onPage: (direction: 1 | -1) => void;
861
- limitOptions?: number[];
862
- sort?: string | number;
863
- sortOptions?: {
864
- id: string | number;
865
- name?: string;
866
- }[];
867
- /** Defaults to 'Limit' */
868
- limitText?: string;
869
- /** Defaults to 'Sort' */
870
- sortText?: string;
871
- onLimit?: (limit: number) => void;
872
- onSort?: (sort: string | number) => void;
873
- /** Shows 'Page X of Y'. */
874
- showPageText?: boolean;
875
- }
876
- declare const BoundStaticPager: <T>(p: Props<T>) => JSX.Element;
832
+ /** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
833
+ declare const useThemeSafely: () => MackinTheme;
877
834
 
878
835
  declare type SliderValue = number | [number, number];
879
836
  interface SliderProps<T extends SliderValue> {
@@ -894,60 +851,145 @@ interface SliderProps<T extends SliderValue> {
894
851
  }
895
852
  declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => JSX.Element;
896
853
 
897
- /** @deprecated Use Backdrop2 going forward. */
898
- declare const Backdrop$1: (props: {
899
- show: boolean;
900
- onClick?: () => void;
901
- transparent?: boolean;
902
- /** If true, the backdrop will hide on larger screens. */
903
- responsive?: boolean;
904
- /** If true, the backdrop will hide on smaller screens. */
905
- reverseResponsive?: boolean;
906
- children?: React.ReactNode;
854
+ interface TabHeaderTabProps {
855
+ name: string;
856
+ }
857
+ interface TabHeaderProps {
858
+ tabs: TabHeaderTabProps[];
859
+ id?: string;
860
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
861
+ rounded?: boolean;
862
+ /** Defaults to 10rem. */
863
+ maxTabWidth?: string;
864
+ onTabChanged?: (tabIndex: number) => void;
865
+ /** Defaults to 'tab'. */
866
+ variant?: 'tab' | 'button';
867
+ }
868
+ declare const TabHeader: (p: TabHeaderProps) => JSX.Element;
869
+
870
+ declare const Table: (props: {
871
+ caption?: string | JSX.Element;
872
+ children?: any;
873
+ noCellBorder?: boolean;
907
874
  className?: string;
908
- /** If true, will not prevent scroll when shown. */
909
- allowScroll?: boolean;
910
- /** Fade in time. Defaults to 250ms. */
911
- showTimeMs?: number;
875
+ /** Colors alternate rows. */
876
+ altRows?: boolean;
877
+ }) => JSX.Element;
878
+ declare const Tr: (props: {
879
+ className?: string;
880
+ children?: any;
881
+ }) => JSX.Element;
882
+ declare const Th: (props: {
883
+ children?: any;
884
+ align?: Alignment;
885
+ width?: string;
886
+ style?: React.CSSProperties;
887
+ className?: string;
888
+ }) => JSX.Element;
889
+ declare const Td: (props: {
890
+ children?: any;
891
+ align?: Alignment;
892
+ style?: React.CSSProperties;
893
+ colSpan?: number;
912
894
  }) => JSX.Element;
913
895
 
914
- declare const Backdrop: (p: {
915
- children: React__default.ReactNode;
916
- /** Fade in time. Defaults to 250ms. */
917
- showTimeMs?: number;
918
- debug?: boolean;
896
+ declare const TdCurrency: (props: {
897
+ value: number;
898
+ cents?: boolean;
919
899
  }) => JSX.Element;
920
900
 
921
- declare const useMediaQuery: (query: string) => boolean;
901
+ declare const TdNumber: (props: {
902
+ value: number;
903
+ }) => JSX.Element;
922
904
 
923
- interface AutoCompleteItem {
924
- id: string | number;
925
- name: string;
905
+ declare const ThSort: (props: {
906
+ text: string | JSX.Element;
907
+ onClick: () => void;
908
+ align?: Alignment;
909
+ direction?: 'asc' | 'desc';
910
+ style?: React.CSSProperties;
911
+ width?: string;
912
+ rightContent?: JSX.Element;
913
+ }) => JSX.Element;
914
+
915
+ declare const TabLocker: (props: {
916
+ disabled?: boolean;
917
+ children?: React.ReactNode;
918
+ style?: React.CSSProperties;
919
+ }) => JSX.Element;
920
+
921
+ interface TextProps {
922
+ children: any;
923
+ /** Defaults to 'p'. */
924
+ tag?: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
925
+ align?: Alignment;
926
+ bold?: boolean;
927
+ italics?: boolean;
928
+ className?: string;
929
+ /** You will need to set a width or max-width on the element for this to work. */
930
+ ellipsis?: boolean;
931
+ style?: React.CSSProperties;
932
+ smaller?: boolean;
933
+ larger?: boolean;
934
+ spacedOut?: boolean;
935
+ lineClamp?: number;
936
+ /** Will remove all margin/padding from specified tag */
937
+ noPad?: boolean;
938
+ leftPad?: string;
926
939
  }
927
- declare type AutocompleteValue = string | AutoCompleteItem;
928
- interface AutocompleteProps {
929
- value: AutocompleteValue | undefined;
930
- round?: boolean;
931
- /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
932
- rounded?: boolean;
933
- rightControl?: JSX.Element;
934
- placeholder?: string;
935
- id?: string;
940
+ declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
941
+ style: React.CSSProperties;
942
+ className: string;
943
+ }, HTMLElement>;
944
+
945
+ declare type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
946
+ interface ToggleButtonProps {
947
+ checked: boolean;
948
+ checkedText: string;
949
+ uncheckedText: string;
950
+ onClick: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
951
+ className?: string;
952
+ checkedClassName?: string;
936
953
  disabled?: boolean;
954
+ /** The minimum button size will be set to the themes' formButtonMinWidth. */
955
+ enforceMinWidth?: boolean;
956
+ checkedIcon?: JSX.Element;
957
+ uncheckedIcon?: JSX.Element;
958
+ variant?: ToggleButtonVariant;
959
+ checkedVariant?: ToggleButtonVariant;
960
+ style?: React.CSSProperties;
961
+ checkedStyle?: React.CSSProperties;
962
+ }
963
+ declare const ToggleButton: (props: ToggleButtonProps) => JSX.Element;
964
+
965
+ interface ToggleButtonGroupProps {
966
+ value: string | number;
967
+ options: {
968
+ id: string | number;
969
+ name: string | JSX.Element;
970
+ rightIcon?: JSX.Element;
971
+ activeClass?: string;
972
+ }[];
973
+ onChange: (value: string | number) => void;
937
974
  className?: string;
938
- inputClassName?: string;
939
- /** If not set, defaults to 100 */
940
- maxLength?: number;
941
- required?: boolean;
942
- /** Limits what will be show in the autocomplete options. Default is 7. */
943
- maxShownValues?: number;
944
- /** The minimum characters before 'getOptions' is called. No default. */
945
- minChars?: number;
946
- onChange: (value: string) => void;
947
- getOptions: (value: string) => Promise<AutocompleteValue[]>;
948
- onPick: (value: AutocompleteValue) => void;
949
- onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
975
+ disabled?: boolean;
976
+ /** The minimum button size will be set to the themes' formButtonMinWidth. */
977
+ enforceMinWidth?: boolean;
978
+ round?: boolean;
979
+ small?: boolean;
980
+ width?: string;
950
981
  }
951
- declare const Autocomplete: (p: AutocompleteProps) => JSX.Element;
982
+ declare const ToggleButtonGroup: (props: ToggleButtonGroupProps) => JSX.Element;
983
+
984
+ interface TogglePasswordInputProps extends Omit<InputProps, 'type' | 'rightControl'> {
985
+ }
986
+ declare const TogglePasswordInput: (p: TogglePasswordInputProps) => JSX.Element;
987
+
988
+ declare const WaitingIndicator: (p: {
989
+ show: boolean;
990
+ minShowTimeMs?: number;
991
+ id?: string;
992
+ debug?: boolean;
993
+ }) => JSX.Element;
952
994
 
953
- export { Alignment, Autocomplete, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
995
+ export { Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };