@wavv/ui 1.9.4 → 1.9.5-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 (221) hide show
  1. package/build/cjs/types/theme/colorsIndex.d.ts +3 -0
  2. package/build/colors.ts +150 -0
  3. package/build/esm/types/theme/colorsIndex.d.ts +3 -0
  4. package/build/types/assets/icons/ActivityHistory.d.ts +3 -0
  5. package/build/types/assets/icons/Add.d.ts +3 -0
  6. package/build/types/assets/icons/AddCircle.d.ts +3 -0
  7. package/build/types/assets/icons/AddCircleOutline.d.ts +3 -0
  8. package/build/types/assets/icons/AddPerson.d.ts +3 -0
  9. package/build/types/assets/icons/ArrowDown.d.ts +3 -0
  10. package/build/types/assets/icons/ArrowLeft.d.ts +3 -0
  11. package/build/types/assets/icons/ArrowRight.d.ts +3 -0
  12. package/build/types/assets/icons/ArrowUp.d.ts +3 -0
  13. package/build/types/assets/icons/Attachment.d.ts +3 -0
  14. package/build/types/assets/icons/Calendar.d.ts +3 -0
  15. package/build/types/assets/icons/Camera.d.ts +3 -0
  16. package/build/types/assets/icons/Card.d.ts +3 -0
  17. package/build/types/assets/icons/CaretDown.d.ts +3 -0
  18. package/build/types/assets/icons/CaretUp.d.ts +3 -0
  19. package/build/types/assets/icons/Check.d.ts +3 -0
  20. package/build/types/assets/icons/CheckBadge.d.ts +3 -0
  21. package/build/types/assets/icons/CheckCircle.d.ts +3 -0
  22. package/build/types/assets/icons/CheckCircleOutline.d.ts +3 -0
  23. package/build/types/assets/icons/Checkbox.d.ts +3 -0
  24. package/build/types/assets/icons/CheckboxOff.d.ts +3 -0
  25. package/build/types/assets/icons/CheckboxPartial.d.ts +3 -0
  26. package/build/types/assets/icons/ChevronDown.d.ts +3 -0
  27. package/build/types/assets/icons/ChevronLeft.d.ts +3 -0
  28. package/build/types/assets/icons/ChevronRight.d.ts +3 -0
  29. package/build/types/assets/icons/ChevronUp.d.ts +3 -0
  30. package/build/types/assets/icons/Clapperboard.d.ts +3 -0
  31. package/build/types/assets/icons/ClapperboardOpen.d.ts +3 -0
  32. package/build/types/assets/icons/Close.d.ts +3 -0
  33. package/build/types/assets/icons/CloseCircle.d.ts +3 -0
  34. package/build/types/assets/icons/CloseCircleOutline.d.ts +3 -0
  35. package/build/types/assets/icons/Copy.d.ts +3 -0
  36. package/build/types/assets/icons/Devices.d.ts +3 -0
  37. package/build/types/assets/icons/Dialpad.d.ts +3 -0
  38. package/build/types/assets/icons/DoubleArrowLeft.d.ts +3 -0
  39. package/build/types/assets/icons/DoubleArrowRight.d.ts +3 -0
  40. package/build/types/assets/icons/Download.d.ts +3 -0
  41. package/build/types/assets/icons/Drag.d.ts +3 -0
  42. package/build/types/assets/icons/Edit.d.ts +3 -0
  43. package/build/types/assets/icons/Emoji.d.ts +3 -0
  44. package/build/types/assets/icons/EyeOff.d.ts +3 -0
  45. package/build/types/assets/icons/EyeOn.d.ts +3 -0
  46. package/build/types/assets/icons/Facebook.d.ts +3 -0
  47. package/build/types/assets/icons/Filter.d.ts +3 -0
  48. package/build/types/assets/icons/Flask.d.ts +3 -0
  49. package/build/types/assets/icons/Group.d.ts +3 -0
  50. package/build/types/assets/icons/Heart.d.ts +3 -0
  51. package/build/types/assets/icons/HeartOutline.d.ts +3 -0
  52. package/build/types/assets/icons/Help.d.ts +3 -0
  53. package/build/types/assets/icons/Hourglass.d.ts +3 -0
  54. package/build/types/assets/icons/Info.d.ts +3 -0
  55. package/build/types/assets/icons/Instagram.d.ts +3 -0
  56. package/build/types/assets/icons/KebabMenu.d.ts +3 -0
  57. package/build/types/assets/icons/Link.d.ts +3 -0
  58. package/build/types/assets/icons/Linkedin.d.ts +3 -0
  59. package/build/types/assets/icons/Loading.d.ts +3 -0
  60. package/build/types/assets/icons/Logout.d.ts +3 -0
  61. package/build/types/assets/icons/Maximize.d.ts +3 -0
  62. package/build/types/assets/icons/Menu.d.ts +3 -0
  63. package/build/types/assets/icons/Merge.d.ts +3 -0
  64. package/build/types/assets/icons/MergeField.d.ts +3 -0
  65. package/build/types/assets/icons/Message.d.ts +3 -0
  66. package/build/types/assets/icons/Mic.d.ts +3 -0
  67. package/build/types/assets/icons/MicOff.d.ts +3 -0
  68. package/build/types/assets/icons/Minimize.d.ts +3 -0
  69. package/build/types/assets/icons/Mobile.d.ts +3 -0
  70. package/build/types/assets/icons/NotAllowed.d.ts +3 -0
  71. package/build/types/assets/icons/Open.d.ts +3 -0
  72. package/build/types/assets/icons/Pause.d.ts +3 -0
  73. package/build/types/assets/icons/PauseOutline.d.ts +3 -0
  74. package/build/types/assets/icons/Person.d.ts +3 -0
  75. package/build/types/assets/icons/Phone.d.ts +3 -0
  76. package/build/types/assets/icons/PhoneBlocked.d.ts +3 -0
  77. package/build/types/assets/icons/PhoneCallback.d.ts +3 -0
  78. package/build/types/assets/icons/PhoneEnd.d.ts +3 -0
  79. package/build/types/assets/icons/PhoneForward.d.ts +3 -0
  80. package/build/types/assets/icons/PhoneHistory.d.ts +3 -0
  81. package/build/types/assets/icons/PhoneHold.d.ts +3 -0
  82. package/build/types/assets/icons/PhoneTalk.d.ts +3 -0
  83. package/build/types/assets/icons/PhoneTransfer.d.ts +3 -0
  84. package/build/types/assets/icons/Play.d.ts +3 -0
  85. package/build/types/assets/icons/PlayOutline.d.ts +3 -0
  86. package/build/types/assets/icons/ProfileUser.d.ts +3 -0
  87. package/build/types/assets/icons/RadioButton.d.ts +3 -0
  88. package/build/types/assets/icons/RadioButtonOff.d.ts +3 -0
  89. package/build/types/assets/icons/Record.d.ts +3 -0
  90. package/build/types/assets/icons/Refresh.d.ts +3 -0
  91. package/build/types/assets/icons/Rocket.d.ts +3 -0
  92. package/build/types/assets/icons/Schedule.d.ts +3 -0
  93. package/build/types/assets/icons/ScheduleOutline.d.ts +3 -0
  94. package/build/types/assets/icons/Screenshot.d.ts +3 -0
  95. package/build/types/assets/icons/Search.d.ts +3 -0
  96. package/build/types/assets/icons/Settings.d.ts +3 -0
  97. package/build/types/assets/icons/Share.d.ts +3 -0
  98. package/build/types/assets/icons/ShieldCheck.d.ts +3 -0
  99. package/build/types/assets/icons/ShieldSlash.d.ts +3 -0
  100. package/build/types/assets/icons/Sort.d.ts +3 -0
  101. package/build/types/assets/icons/Spotify.d.ts +3 -0
  102. package/build/types/assets/icons/Star.d.ts +3 -0
  103. package/build/types/assets/icons/StarOutline.d.ts +3 -0
  104. package/build/types/assets/icons/Stop.d.ts +3 -0
  105. package/build/types/assets/icons/StopOutline.d.ts +3 -0
  106. package/build/types/assets/icons/Template.d.ts +3 -0
  107. package/build/types/assets/icons/ToggleOff.d.ts +3 -0
  108. package/build/types/assets/icons/ToggleOn.d.ts +3 -0
  109. package/build/types/assets/icons/Transfer.d.ts +3 -0
  110. package/build/types/assets/icons/TransferCancel.d.ts +3 -0
  111. package/build/types/assets/icons/Trash.d.ts +3 -0
  112. package/build/types/assets/icons/Twitter.d.ts +3 -0
  113. package/build/types/assets/icons/Upload.d.ts +3 -0
  114. package/build/types/assets/icons/Video.d.ts +3 -0
  115. package/build/types/assets/icons/Voicemail.d.ts +3 -0
  116. package/build/types/assets/icons/VolOn.d.ts +3 -0
  117. package/build/types/assets/icons/Warning.d.ts +3 -0
  118. package/build/types/assets/icons/WarningCircleOutline.d.ts +3 -0
  119. package/build/types/assets/icons/Youtube.d.ts +3 -0
  120. package/build/types/components/Accordion.d.ts +45 -0
  121. package/build/types/components/Audio.d.ts +29 -0
  122. package/build/types/components/BarChart.d.ts +25 -0
  123. package/build/types/components/Button/Button.d.ts +17 -0
  124. package/build/types/components/Button/ButtonLoader.d.ts +4 -0
  125. package/build/types/components/Button/ButtonTypes.d.ts +150 -0
  126. package/build/types/components/Button/Group.d.ts +18 -0
  127. package/build/types/components/Button/index.d.ts +2 -0
  128. package/build/types/components/Calendar.d.ts +14 -0
  129. package/build/types/components/ChartHelpers.d.ts +36 -0
  130. package/build/types/components/Checkbox.d.ts +20 -0
  131. package/build/types/components/Code/Code.d.ts +26 -0
  132. package/build/types/components/Code/Copy.d.ts +4 -0
  133. package/build/types/components/Code/Endpoint.d.ts +5 -0
  134. package/build/types/components/Code/index.d.ts +2 -0
  135. package/build/types/components/DocTable.d.ts +7 -0
  136. package/build/types/components/DraftEditor.d.ts +56 -0
  137. package/build/types/components/Dropdown/Dropdown.d.ts +85 -0
  138. package/build/types/components/Dropdown/DropdownUtils.d.ts +56 -0
  139. package/build/types/components/Dropdown/index.d.ts +4 -0
  140. package/build/types/components/DropdownMenu.d.ts +78 -0
  141. package/build/types/components/Form.d.ts +174 -0
  142. package/build/types/components/FormControl.d.ts +18 -0
  143. package/build/types/components/Grid.d.ts +55 -0
  144. package/build/types/components/Icon/Icon.d.ts +38 -0
  145. package/build/types/components/Icon/icons.d.ts +222 -0
  146. package/build/types/components/Icon/index.d.ts +2 -0
  147. package/build/types/components/ImageViewer.d.ts +20 -0
  148. package/build/types/components/InlineCode.d.ts +7 -0
  149. package/build/types/components/Input.d.ts +192 -0
  150. package/build/types/components/InputHelpers.d.ts +90 -0
  151. package/build/types/components/Label.d.ts +16 -0
  152. package/build/types/components/LineChart.d.ts +3 -0
  153. package/build/types/components/Menu.d.ts +53 -0
  154. package/build/types/components/Message.d.ts +25 -0
  155. package/build/types/components/MessageHr.d.ts +11 -0
  156. package/build/types/components/Modal.d.ts +66 -0
  157. package/build/types/components/MultiSelect.d.ts +46 -0
  158. package/build/types/components/Notification.d.ts +14 -0
  159. package/build/types/components/Options.d.ts +45 -0
  160. package/build/types/components/Pagination.d.ts +13 -0
  161. package/build/types/components/PieChart.d.ts +18 -0
  162. package/build/types/components/Progress/CirclePercent.d.ts +10 -0
  163. package/build/types/components/Progress/Progress.d.ts +23 -0
  164. package/build/types/components/Progress/index.d.ts +2 -0
  165. package/build/types/components/Radio.d.ts +16 -0
  166. package/build/types/components/Slider.d.ts +15 -0
  167. package/build/types/components/Spacer.d.ts +6 -0
  168. package/build/types/components/Spinner.d.ts +16 -0
  169. package/build/types/components/Table/Body.d.ts +8 -0
  170. package/build/types/components/Table/Column.d.ts +10 -0
  171. package/build/types/components/Table/Content.d.ts +19 -0
  172. package/build/types/components/Table/Header.d.ts +7 -0
  173. package/build/types/components/Table/HeaderCell.d.ts +14 -0
  174. package/build/types/components/Table/Row.d.ts +3 -0
  175. package/build/types/components/Table/Table.d.ts +28 -0
  176. package/build/types/components/Table/context.d.ts +4 -0
  177. package/build/types/components/Table/index.d.ts +2 -0
  178. package/build/types/components/Table/types.d.ts +43 -0
  179. package/build/types/components/Table/utils.d.ts +4 -0
  180. package/build/types/components/Tabs.d.ts +31 -0
  181. package/build/types/components/Toggle.d.ts +18 -0
  182. package/build/types/components/Tooltip.d.ts +50 -0
  183. package/build/types/components/TransferList.d.ts +47 -0
  184. package/build/types/components/draftUtils.d.ts +49 -0
  185. package/build/types/components/helpers/getIcon.d.ts +8 -0
  186. package/build/types/components/helpers/getPopPosition.d.ts +6 -0
  187. package/build/types/components/helpers/isPropAllowed.d.ts +2 -0
  188. package/build/types/components/helpers/styledProps.d.ts +26 -0
  189. package/build/types/components/types.d.ts +80 -0
  190. package/build/types/global-styles/ResetStyles.d.ts +9 -0
  191. package/build/types/global-styles/ScrollbarStyles.d.ts +2 -0
  192. package/build/types/global-styles/ToastStyles.d.ts +2 -0
  193. package/build/types/global-styles/index.d.ts +3 -0
  194. package/build/types/hooks/index.d.ts +7 -0
  195. package/build/types/hooks/useConfirm.d.ts +13 -0
  196. package/build/types/hooks/useElementObserver.d.ts +8 -0
  197. package/build/types/hooks/useEventListener.d.ts +3 -0
  198. package/build/types/hooks/useOnClickOutside.d.ts +3 -0
  199. package/build/types/hooks/usePrevious.d.ts +2 -0
  200. package/build/types/hooks/useSelect.d.ts +20 -0
  201. package/build/types/hooks/useSelectAll.d.ts +12 -0
  202. package/build/types/hooks/useWindowSize.d.ts +5 -0
  203. package/build/types/index.d.ts +64 -0
  204. package/build/types/theme/ThemeTypes.d.ts +294 -0
  205. package/build/types/theme/colors.d.ts +201 -0
  206. package/build/types/theme/colorsIndex.d.ts +3 -0
  207. package/build/types/theme/common/button.d.ts +24 -0
  208. package/build/types/theme/common/common.d.ts +103 -0
  209. package/build/types/theme/common/index.d.ts +3 -0
  210. package/build/types/theme/dark.d.ts +3 -0
  211. package/build/types/theme/darkScale.d.ts +22 -0
  212. package/build/types/theme/index.d.ts +10 -0
  213. package/build/types/theme/light.d.ts +3 -0
  214. package/build/types/theme/lightScale.d.ts +22 -0
  215. package/build/types/utils/chunk.d.ts +2 -0
  216. package/build/types/utils/copyToClipboard.d.ts +2 -0
  217. package/build/types/utils/formatDate.d.ts +7 -0
  218. package/build/types/utils/index.d.ts +5 -0
  219. package/build/types/utils/numberWithCommas.d.ts +2 -0
  220. package/build/types/utils/range.d.ts +1 -0
  221. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ import { KeyboardEvent, CSSProperties as CSS } from 'react';
2
+ import { EditorChangeType } from 'draft-js';
3
+ import { DraftEditorRef, InputFocusEvent, Margin, MergeField } from './types';
4
+ declare const DraftEditor: import("react").ForwardRefExoticComponent<{
5
+ /** Controlled text value of the editor */
6
+ value: string;
7
+ /** Function called after editor change with the text value and boolean indicating missing merge fields */
8
+ onChange?: ((text: string, hasMissing: boolean, reason: EditorChangeType | null) => void) | undefined;
9
+ /** Function called after the enter key is pressed */
10
+ onEnterKey?: ((e: KeyboardEvent) => void) | undefined;
11
+ /** Callback run after onFocus event */
12
+ onFocus?: ((event?: InputFocusEvent) => void) | undefined;
13
+ /** Callback run after onBlur event */
14
+ onBlur?: ((event?: InputFocusEvent) => void) | undefined;
15
+ /** Array of MergeFields ({ id: string, label: string, value?: string }) for the editor to use/parse */
16
+ mergeFields?: MergeField[] | undefined;
17
+ /** Placeholder text of editor when value is empty */
18
+ placeholder?: string | undefined;
19
+ /** Places a description message below the editor */
20
+ description?: string | undefined;
21
+ /** Sets the Editor's bottom border and description text to red */
22
+ invalid?: boolean | undefined;
23
+ /** Width of the editor */
24
+ width?: string | number | undefined;
25
+ /** Height of the editor */
26
+ height?: number | undefined;
27
+ /** Max Height of the editor. Editor contents will scroll after this height is reached */
28
+ maxHeight?: number | undefined;
29
+ /** Removes the border from the editor */
30
+ borderless?: boolean | undefined;
31
+ /** Removes the padding from the editor */
32
+ noPadding?: boolean | undefined;
33
+ /** Disables any editing capability of the editor */
34
+ readOnly?: boolean | undefined;
35
+ /** Displays the value of the merge field rather than the label */
36
+ displayMergedValues?: boolean | undefined;
37
+ /** Sets the text color of the editor */
38
+ color?: string | undefined;
39
+ /** Sets the overflow css value of the editor */
40
+ overflow?: CSS['overflow'];
41
+ /** Truncates the editor text to the number of lines specified and adds an ellipsis textOverflow */
42
+ clampLines?: number | undefined;
43
+ /** Places a label element above the input. The value will set the text of the label */
44
+ label?: string | undefined;
45
+ /** Disables the input */
46
+ disabled?: boolean | undefined;
47
+ /** Sets the input borderRadius */
48
+ borderRadius?: string | number | undefined;
49
+ /** Sets the input backgroundColor */
50
+ backgroundColor?: string | undefined;
51
+ /** Sets the editor fontSize */
52
+ fontSize?: string | number | undefined;
53
+ /** Removes the border, padding, and backgroundColor from the DraftEditor */
54
+ textOnly?: boolean | undefined;
55
+ } & Margin & import("react").RefAttributes<DraftEditorRef>>;
56
+ export default DraftEditor;
@@ -0,0 +1,85 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ import { InputProps } from '../Input';
3
+ import { Margin, WidthHeight, InputFocusEvent, InputRef } from '../types';
4
+ import { OptionItem, DropdownItemProps } from './DropdownUtils';
5
+ export type RestInputProps = Omit<InputProps, 'value' | 'onChange' | 'onError'>;
6
+ type DropdownProps<OptionType> = {
7
+ children?: ReactNode;
8
+ /** The function to be called when an option is selected */
9
+ onChange?: (item: OptionType | null) => void;
10
+ /** The function to be called when the search input is updated */
11
+ onTextChange?: (text: string) => void;
12
+ /** The value of the Dropdown */
13
+ value?: string | number;
14
+ /** The function to be called when the Dropdown is opened */
15
+ afterShow?: () => void;
16
+ /** The function to be called when the Dropdown is closed */
17
+ afterHide?: () => void;
18
+ /** The function to be called when the Dropdown input is focused */
19
+ onFocus?: (event?: InputFocusEvent) => void;
20
+ /** The function to be called when the Dropdown input is blurred */
21
+ onBlur?: (event?: InputFocusEvent) => void;
22
+ /** The function to be called when the Dropdown input goes to or from an invalid state */
23
+ onError?: (invalid: boolean) => void;
24
+ /** Sets the input placeholder text */
25
+ placeholder?: string;
26
+ /** Sets the input placeholder color */
27
+ placeholderColor?: string;
28
+ /** The options to be displayed */
29
+ options?: OptionType[];
30
+ /** Removes the border from the Dropdown input */
31
+ borderless?: boolean;
32
+ /** Sets the input borderColor */
33
+ borderColor?: string;
34
+ /** Sets the input backgroundColor */
35
+ backgroundColor?: string;
36
+ /** Removes the caret icon from the right side of the Dropdown */
37
+ hideIcon?: boolean;
38
+ /** Displays a spinner icon on the right side of the input */
39
+ isLoading?: boolean;
40
+ /** Resets the selected text in the dropdown after an option is selected */
41
+ clearOnSelect?: boolean;
42
+ /** As the dropdown is searched, the options narrow down according to the search value */
43
+ filter?: boolean;
44
+ /** Removes the border and background-color from the Dropdown input */
45
+ textOnly?: boolean;
46
+ /** Adds a label to the Dropdown input */
47
+ label?: string;
48
+ /** Sets the id of the Dropdown input or trigger */
49
+ id?: string;
50
+ /** Sets the name of the Dropdown input */
51
+ name?: string;
52
+ /** (DEPRECATED! Use the DropdownMenu component instead.) An HTML element/React component to trigger the opening and closing of the dropdown instead of an input */
53
+ trigger?: ReactNode;
54
+ /** Center the Dropdown options vertically with the trigger */
55
+ centerY?: boolean;
56
+ /** Center the Dropdown options horizontally with the trigger */
57
+ centerX?: boolean;
58
+ /** Pixel amount the Dropdown options are offset vertically from the trigger */
59
+ offsetY?: number;
60
+ /** Pixel amount the Dropdown options are offset horizontally from the trigger */
61
+ offsetX?: number;
62
+ /** The direction the options should open in relation to the trigger */
63
+ direction?: 'left' | 'right' | 'top' | 'bottom';
64
+ /** Sets the Dropdown fontSize */
65
+ fontSize?: number | string;
66
+ /** Places a description message below the Dropdown */
67
+ description?: string;
68
+ /** Disables the Dropdown */
69
+ disabled?: boolean;
70
+ /** Sets the Dropdown's bottom border and description text to red */
71
+ invalid?: boolean;
72
+ /** Allows the Dropdown input to be edited */
73
+ search?: boolean;
74
+ /** Prevents the search Dropdown from accepting any input other than what matches the provided options */
75
+ restrictInput?: boolean | ((text: string) => boolean);
76
+ /** The ref of the Dropdown's input */
77
+ inputRef?: RefObject<InputRef>;
78
+ /** The selector (id or className) of the element the options should open in relataion to */
79
+ optionsParent?: string;
80
+ } & WidthHeight & Margin & RestInputProps;
81
+ declare const Dropdown: {
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>): import("react/jsx-runtime").JSX.Element;
83
+ Item<OptionType_1 extends OptionItem>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps<OptionType_1>): import("react/jsx-runtime").JSX.Element;
84
+ };
85
+ export default Dropdown;
@@ -0,0 +1,56 @@
1
+ import { ChangeEvent, MouseEvent, ReactElement, ReactNode } from 'react';
2
+ import { FlexPosition, ThemeProp } from '../types';
3
+ export type OptionItem = {
4
+ id: number | string;
5
+ label: string;
6
+ header?: string;
7
+ body?: string;
8
+ leftElement?: ReactElement;
9
+ rightElement?: ReactElement;
10
+ onClick?: (event?: MouseEvent | Event) => void;
11
+ value?: unknown;
12
+ [key: string]: unknown;
13
+ };
14
+ export type DropdownItemProps<OptionType> = {
15
+ setValue?: (v: OptionType, event: MouseEvent) => void;
16
+ close?: () => void;
17
+ children: ReactNode;
18
+ /** Sets the value of the option that will be returned in the object */
19
+ value?: number | string;
20
+ /** Sets the label property of the object to be returned. Only required if the content of the Item is anything other than a string (icons, other elements) */
21
+ displayText?: string;
22
+ /** The flex positioning of the Item contents */
23
+ contentPosition?: FlexPosition;
24
+ /** The color of the Option text */
25
+ color?: string;
26
+ /** Sets the Option text color to theme.accent */
27
+ accented?: boolean;
28
+ /** Callback function to override the default onChange function of Dropdown. */
29
+ onClick?: (event: MouseEvent) => void;
30
+ /** The id of the Item element */
31
+ id: number | string;
32
+ };
33
+ export type SetEvent = MouseEvent | ChangeEvent | KeyboardEvent;
34
+ export type SetValueFunc = <OptionType extends OptionItem>(selection: OptionType | string | null, event?: SetEvent) => void;
35
+ type toggleFunc = (event?: MouseEvent) => void;
36
+ type StatePieces = {
37
+ selected: number;
38
+ search?: boolean;
39
+ filter?: boolean;
40
+ inputText?: string;
41
+ };
42
+ type FilterState = Omit<StatePieces, 'selected'>;
43
+ export declare const getFilteredOptions: <OptionType extends OptionItem>(options: OptionType[], state: FilterState) => OptionType[];
44
+ export declare const getItemContentFromOption: <OptionType extends OptionItem>(option: OptionType) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const getOptionsFromArray: <OptionType extends OptionItem>(options: OptionType[], setValue: SetValueFunc, toggle: toggleFunc, state: FilterState) => import("react/jsx-runtime").JSX.Element[];
46
+ export declare const getOptionsFromChildren: <OptionType extends OptionItem>(children: ReactNode, setValue: SetValueFunc, toggle: toggleFunc) => (ReactElement<DropdownItemProps<OptionType>, string | import("react").JSXElementConstructor<any>> | null)[];
47
+ export declare const getCombinedChildren: <OptionType extends OptionItem>(options: OptionType[], children: ReactNode, setValue: SetValueFunc, toggle: toggleFunc, state: StatePieces) => (ReactElement<any, string | import("react").JSXElementConstructor<any>> | null)[];
48
+ export declare const ItemHeader: import("@emotion/styled").StyledComponent<{
49
+ theme?: import("@emotion/react").Theme | undefined;
50
+ as?: import("react").ElementType<any> | undefined;
51
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
52
+ export declare const ItemSubtext: import("@emotion/styled").StyledComponent<{
53
+ theme?: import("@emotion/react").Theme | undefined;
54
+ as?: import("react").ElementType<any> | undefined;
55
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
56
+ export {};
@@ -0,0 +1,4 @@
1
+ import Dropdown from './Dropdown';
2
+ export default Dropdown;
3
+ export type { RestInputProps as InputProps } from './Dropdown';
4
+ export type { OptionItem as DropdownOption } from './DropdownUtils';
@@ -0,0 +1,78 @@
1
+ import { HTMLProps, ReactNode } from 'react';
2
+ import { OptionItem } from './Dropdown/DropdownUtils';
3
+ import { As, FlexPosition, PopPosition } from './types';
4
+ type DivProps = Omit<HTMLProps<HTMLDivElement>, 'onChange' | 'as'> & As;
5
+ type WithChildren = {
6
+ children: ReactNode;
7
+ onChange?: never;
8
+ };
9
+ type WithOptions<OptionType> = {
10
+ options: OptionType[];
11
+ /** The function called after an option from the options array is selected */
12
+ onChange?: (option: OptionType, event: Event) => void;
13
+ };
14
+ type EitherChildrenOrOptions<OptionType> = WithChildren | WithOptions<OptionType>;
15
+ type DropdownMenuProps<OptionType> = {
16
+ children?: ReactNode;
17
+ /** The options to be displayed */
18
+ options?: OptionType[];
19
+ /** The id of the menu container */
20
+ id?: string | number;
21
+ /** The position of the menu body and arrow in relation to the trigger */
22
+ position?: PopPosition;
23
+ /** The element that will trigger the opening of the menu */
24
+ trigger: ReactNode;
25
+ /** Controls the open state of the menu */
26
+ open?: boolean;
27
+ /** Offset of the menu from the trigger */
28
+ offset?: number;
29
+ /** Controls the visibility of the the menu arrow */
30
+ arrow?: boolean;
31
+ /** The width of the menu */
32
+ width?: number | string;
33
+ /** Overrides the default maxHeight of 200px */
34
+ maxHeight?: number;
35
+ /** Specify a container element to portal the content into */
36
+ container?: HTMLElement;
37
+ /** zIndex of the menu's portal container */
38
+ zIndex?: number;
39
+ /** Enables the page to scroll when the menu is open */
40
+ disableScrollLock?: boolean;
41
+ /** The function called after the menu opens */
42
+ afterShow?: () => void;
43
+ /** The function called after the menu closes */
44
+ afterHide?: () => void;
45
+ } & EitherChildrenOrOptions<OptionType> & DivProps;
46
+ declare const DropdownMenu: {
47
+ <OptionType extends OptionItem>({ children, options, id, position, trigger, open, offset, arrow, width, maxHeight, container, zIndex, disableScrollLock, onChange, afterShow, afterHide, ...props }: DropdownMenuProps<OptionType>): import("react/jsx-runtime").JSX.Element;
48
+ Item: ({ children, id, disabled, onClick, ...props }: ItemProps) => import("react/jsx-runtime").JSX.Element;
49
+ Sub({ children, id, label, zIndex, disabled, container, ...props }: SubProps): import("react/jsx-runtime").JSX.Element;
50
+ Separator(): import("react/jsx-runtime").JSX.Element;
51
+ };
52
+ type BaseItemProps = {
53
+ children: ReactNode;
54
+ disabled?: boolean;
55
+ };
56
+ type ItemProps = {
57
+ /** The id of the item */
58
+ id?: string | number;
59
+ /** The function to be called when the item is clicked */
60
+ onClick?: (event: Event) => void;
61
+ /** The flex positioning of the item contents */
62
+ contentPosition?: FlexPosition;
63
+ /** The color of the item text */
64
+ color?: string;
65
+ /** Sets the item text color to theme.accent */
66
+ accented?: boolean;
67
+ } & BaseItemProps;
68
+ type SubProps = {
69
+ /** The id of the sub menu's content container */
70
+ id?: string;
71
+ /** The text or element to display as the sub menu item's trigger */
72
+ label: string | ReactNode;
73
+ /** zIndex of the sub menu's portal container */
74
+ zIndex?: number;
75
+ /** Specify a container element to portal the sub menu content into */
76
+ container?: HTMLElement;
77
+ } & BaseItemProps;
78
+ export default DropdownMenu;
@@ -0,0 +1,174 @@
1
+ import { FormEvent, HTMLProps, ReactNode } from 'react';
2
+ import { GridProps } from './Grid';
3
+ import { Margin } from './types';
4
+ type FormProps = {
5
+ children?: ReactNode;
6
+ /** The function to be run after the form is submitted */
7
+ onSubmit?: (event: FormEvent) => void;
8
+ } & GridProps & HTMLProps<HTMLFormElement>;
9
+ declare const Form: {
10
+ ({ children, rows, columns, rowGap, columnGap, onSubmit, ...rest }: FormProps): import("react/jsx-runtime").JSX.Element;
11
+ Group({ children, rows, columns, rowGap, columnGap, disabled, ...rest }: FormGroupProps): import("react/jsx-runtime").JSX.Element;
12
+ Field({ children, inline, align, disabled, ...props }: {
13
+ /** Sets the flexDirection of the Field to 'row' instead of 'column' */
14
+ inline?: boolean | undefined;
15
+ /** Sets the vertical alignment of the Field's contents */
16
+ align?: "center" | "top" | "bottom" | undefined;
17
+ /** Disables pointer events and reduces the opacity of the Field's contents */
18
+ disabled?: boolean | undefined;
19
+ } & Margin & {
20
+ children?: ReactNode;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ Input: import("react").ForwardRefExoticComponent<(Omit<{
23
+ id?: string | undefined;
24
+ label?: string | undefined;
25
+ placeholder?: string | undefined;
26
+ placeholderColor?: string | undefined;
27
+ description?: string | undefined;
28
+ isLoading?: boolean | undefined;
29
+ iconLeft?: import("./helpers/getIcon").IconType | undefined;
30
+ iconRight?: import("./helpers/getIcon").IconType | undefined;
31
+ invalid?: boolean | undefined;
32
+ borderless?: boolean | undefined;
33
+ borderRadius?: string | number | undefined;
34
+ borderColor?: string | undefined;
35
+ backgroundColor?: string | undefined;
36
+ fontSize?: string | number | undefined;
37
+ width?: string | number | undefined;
38
+ height?: string | number | undefined;
39
+ containerRef?: import("react").MutableRefObject<HTMLDivElement> | undefined;
40
+ value?: string | number | undefined;
41
+ disabled?: boolean | undefined;
42
+ readOnly?: boolean | undefined;
43
+ preventFocus?: boolean | undefined;
44
+ pointer?: boolean | undefined;
45
+ textOnly?: boolean | undefined;
46
+ search?: boolean | undefined;
47
+ onFocus?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
48
+ onBlur?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
49
+ onClick?: ((event?: import("react").MouseEvent<Element, MouseEvent> | undefined) => void) | undefined;
50
+ onClear?: (() => void) | undefined;
51
+ } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").As & {
52
+ phone?: undefined;
53
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>) => void) | undefined;
54
+ } & Margin & import("./types").Padding, "ref"> | Omit<{
55
+ id?: string | undefined;
56
+ label?: string | undefined;
57
+ placeholder?: string | undefined;
58
+ placeholderColor?: string | undefined;
59
+ description?: string | undefined;
60
+ isLoading?: boolean | undefined;
61
+ iconLeft?: import("./helpers/getIcon").IconType | undefined;
62
+ iconRight?: import("./helpers/getIcon").IconType | undefined;
63
+ invalid?: boolean | undefined;
64
+ borderless?: boolean | undefined;
65
+ borderRadius?: string | number | undefined;
66
+ borderColor?: string | undefined;
67
+ backgroundColor?: string | undefined;
68
+ fontSize?: string | number | undefined;
69
+ width?: string | number | undefined;
70
+ height?: string | number | undefined;
71
+ containerRef?: import("react").MutableRefObject<HTMLDivElement> | undefined;
72
+ value?: string | number | undefined;
73
+ disabled?: boolean | undefined;
74
+ readOnly?: boolean | undefined;
75
+ preventFocus?: boolean | undefined;
76
+ pointer?: boolean | undefined;
77
+ textOnly?: boolean | undefined;
78
+ search?: boolean | undefined;
79
+ onFocus?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
80
+ onBlur?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
81
+ onClick?: ((event?: import("react").MouseEvent<Element, MouseEvent> | undefined) => void) | undefined;
82
+ onClear?: (() => void) | undefined;
83
+ } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").As & {
84
+ phone: true;
85
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
86
+ } & Margin & import("./types").Padding, "ref">) & import("react").RefAttributes<import("./types").InputRef>>;
87
+ Dropdown: {
88
+ <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 }: {
89
+ children?: ReactNode;
90
+ onChange?: ((item: OptionType | null) => void) | undefined;
91
+ onTextChange?: ((text: string) => void) | undefined;
92
+ value?: string | number | undefined;
93
+ afterShow?: (() => void) | undefined;
94
+ afterHide?: (() => void) | undefined;
95
+ onFocus?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
96
+ onBlur?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
97
+ onError?: ((invalid: boolean) => void) | undefined;
98
+ placeholder?: string | undefined;
99
+ placeholderColor?: string | undefined;
100
+ options?: OptionType[] | undefined;
101
+ borderless?: boolean | undefined;
102
+ borderColor?: string | undefined;
103
+ backgroundColor?: string | undefined;
104
+ hideIcon?: boolean | undefined;
105
+ isLoading?: boolean | undefined;
106
+ clearOnSelect?: boolean | undefined;
107
+ filter?: boolean | undefined;
108
+ textOnly?: boolean | undefined;
109
+ label?: string | undefined;
110
+ id?: string | undefined;
111
+ name?: string | undefined;
112
+ trigger?: ReactNode;
113
+ centerY?: boolean | undefined;
114
+ centerX?: boolean | undefined;
115
+ offsetY?: number | undefined;
116
+ offsetX?: number | undefined;
117
+ direction?: "top" | "bottom" | "right" | "left" | undefined;
118
+ fontSize?: string | number | undefined;
119
+ description?: string | undefined;
120
+ disabled?: boolean | undefined;
121
+ invalid?: boolean | undefined;
122
+ search?: boolean | undefined;
123
+ restrictInput?: boolean | ((text: string) => boolean) | undefined;
124
+ inputRef?: import("react").RefObject<import("./types").InputRef> | undefined;
125
+ optionsParent?: string | undefined;
126
+ } & import("./types").Width & import("./types").Height & Margin & import("./Dropdown").InputProps): import("react/jsx-runtime").JSX.Element;
127
+ Item<OptionType_1 extends import("./Dropdown").DropdownOption>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: import("./Dropdown/DropdownUtils").DropdownItemProps<OptionType_1>): import("react/jsx-runtime").JSX.Element;
128
+ };
129
+ Radio: ({ id, label, labelPosition, checked, disabled, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
130
+ id?: string | undefined;
131
+ label?: string | undefined;
132
+ labelPosition?: "right" | "left" | undefined;
133
+ disabled?: boolean | undefined;
134
+ checked?: boolean | undefined;
135
+ } & Margin & import("./types").As & HTMLProps<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
136
+ Toggle: ({ id, label, labelPosition, checked, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
137
+ id?: string | undefined;
138
+ label?: string | undefined;
139
+ labelPosition?: "right" | "left" | undefined;
140
+ disabled?: boolean | undefined;
141
+ checked?: boolean | undefined;
142
+ onChange: (val: boolean) => void;
143
+ } & Margin & import("./types").As & import("./FormControl").CheckboxAttributes) => import("react/jsx-runtime").JSX.Element;
144
+ Checkbox: ({ id, label, labelPosition, checked, partial, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
145
+ id?: string | undefined;
146
+ label?: string | undefined;
147
+ labelPosition?: "right" | "left" | undefined;
148
+ disabled?: boolean | undefined;
149
+ checked?: boolean | undefined;
150
+ partial?: boolean | undefined;
151
+ onChange: (val: boolean) => void;
152
+ } & Margin & import("./types").As & import("./FormControl").CheckboxAttributes) => import("react/jsx-runtime").JSX.Element;
153
+ Label: ({ children, iconLeft, iconRight, disabled, pill, ...rest }: {
154
+ children?: ReactNode;
155
+ iconLeft?: import("./helpers/getIcon").IconType | undefined;
156
+ iconRight?: import("./helpers/getIcon").IconType | undefined;
157
+ pill?: boolean | undefined;
158
+ disabled?: boolean | undefined;
159
+ } & Margin) => import("react/jsx-runtime").JSX.Element;
160
+ };
161
+ type FormGroupProps = {
162
+ /** Disables pointer events and reduces the opacity of the Group's contents */
163
+ disabled?: boolean;
164
+ children?: ReactNode;
165
+ } & GridProps;
166
+ type FieldProps = {
167
+ /** Sets the flexDirection of the Field to 'row' instead of 'column' */
168
+ inline?: boolean;
169
+ /** Sets the vertical alignment of the Field's contents */
170
+ align?: 'top' | 'bottom' | 'center';
171
+ /** Disables pointer events and reduces the opacity of the Field's contents */
172
+ disabled?: boolean;
173
+ } & Margin;
174
+ export default Form;
@@ -0,0 +1,18 @@
1
+ import { HTMLProps } from 'react';
2
+ import { Margin, ThemeProp } from './types';
3
+ export declare const ControlContainer: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & {
7
+ labelRight?: boolean | undefined;
8
+ disabled?: boolean | undefined;
9
+ } & Margin & ThemeProp, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {}>;
10
+ export declare const ControlInput: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
14
+ export declare const ControlLabel: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
18
+ export type CheckboxAttributes = Omit<HTMLProps<HTMLInputElement>, 'onChange'>;
@@ -0,0 +1,55 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyledComponent } from '@emotion/styled';
3
+ import { MarginPadding, WidthHeight } from './types';
4
+ export type GridProps = {
5
+ /** If a number, rows creates n number rows of an equal size. If a string, rows sets the gridTemplateRows property */
6
+ rows?: string | number;
7
+ /** The amount of pixels between each row */
8
+ rowGap?: number;
9
+ /** If a number, columns creates n number columns of an equal size. If a string, columns sets the gridTemplateColumns property */
10
+ columns?: string | number;
11
+ /** The amount of pixels between each column */
12
+ columnGap?: number;
13
+ /** Sets the gridGap property */
14
+ gap?: number;
15
+ /** Sets the gridTemplate property */
16
+ template?: string;
17
+ /** Sets the alignContent property */
18
+ alignContent?: string;
19
+ /** Sets the alignItems property */
20
+ alignItems?: string;
21
+ /** Sets the justifyContent property */
22
+ justifyContent?: string;
23
+ /** Sets the justifyItems property */
24
+ justifyItems?: string;
25
+ children?: ReactNode;
26
+ } & WidthHeight & MarginPadding;
27
+ type ItemProps = {
28
+ /** Sets the gridRow property */
29
+ row?: number;
30
+ /** Sets the gridRowStart property */
31
+ rowStart?: number;
32
+ /** Sets the gridRowEnd property */
33
+ rowEnd?: number;
34
+ /** Sets the gridColumn property */
35
+ column?: number;
36
+ /** Sets the gridColumnStart property */
37
+ columnStart?: number;
38
+ /** Sets the gridColumnEnd property */
39
+ columnEnd?: number;
40
+ /** Sets the gridArea property */
41
+ area?: number;
42
+ /** Sets the alignSelf property */
43
+ alignSelf?: string;
44
+ /** Sets the justifySelf property */
45
+ justifySelf?: string;
46
+ /** Sets the placeSelf property */
47
+ placeSelf?: string;
48
+ /** Sets the border property */
49
+ border?: string;
50
+ } & MarginPadding;
51
+ interface GridType extends StyledComponent<GridProps> {
52
+ Item?: StyledComponent<ItemProps>;
53
+ }
54
+ declare const Grid: GridType;
55
+ export default Grid;
@@ -0,0 +1,38 @@
1
+ import { HTMLProps, ReactNode } from 'react';
2
+ import { IconNames } from './icons';
3
+ import { As, MarginPadding } from '../types';
4
+ export type Sizes = number | 'small' | 'medium' | 'large';
5
+ type DivAttributes = Omit<HTMLProps<HTMLDivElement>, 'size'>;
6
+ type ConditionalProps = {
7
+ /** Name of the specific icon to use */
8
+ name: IconNames;
9
+ svg?: never;
10
+ } | {
11
+ /** The SVG element to wrap with the Icon component */
12
+ svg: ReactNode | (() => JSX.Element);
13
+ name?: never;
14
+ };
15
+ export type IconProps = {
16
+ /** Sets the width and height of the icon */
17
+ size?: Sizes;
18
+ /** Sets the width of the icon */
19
+ width?: number | string;
20
+ /** Sets the height of the icon */
21
+ height?: number | string;
22
+ /** Sets the color of the icon */
23
+ color?: string;
24
+ /** Sets the color of the icon when hovered */
25
+ hoverColor?: string;
26
+ /** Sets the cursor as a pointer when hovered */
27
+ pointer?: boolean;
28
+ /** Sets the color of the icon to the parent element's color */
29
+ inheritColor?: boolean;
30
+ /** CSS Animation shorthand property */
31
+ animation?: string;
32
+ /** Sets the style prop of the Icon wrapper element */
33
+ style?: {
34
+ [key: string]: string | number;
35
+ };
36
+ } & ConditionalProps & MarginPadding & As & DivAttributes;
37
+ declare const Icon: ({ name, svg, size, width, height, color, hoverColor, pointer, inheritColor, animation, style, onClick, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element | null;
38
+ export default Icon;