envoc-form 4.0.1-11 → 4.0.1-12

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 (196) hide show
  1. package/README.md +5117 -12
  2. package/es/AddressInput/AddressInput.d.ts +10 -0
  3. package/es/AddressInput/AddressInput.js +10 -0
  4. package/es/ConfirmBaseForm/ConfirmBaseForm.d.ts +14 -0
  5. package/es/ConfirmBaseForm/ConfirmBaseForm.js +6 -0
  6. package/es/ConfirmDeleteForm/ConfirmDeleteForm.d.ts +13 -0
  7. package/es/ConfirmDeleteForm/ConfirmDeleteForm.js +5 -0
  8. package/es/DatePicker/DatePickerGroup.d.ts +5 -0
  9. package/es/DatePicker/DatePickerGroup.js +5 -0
  10. package/es/DatePicker/StringDateOnlyPickerGroup.d.ts +5 -0
  11. package/es/DatePicker/StringDateOnlyPickerGroup.js +5 -0
  12. package/es/DatePicker/StringDatePickerGroup.d.ts +5 -0
  13. package/es/DatePicker/StringDatePickerGroup.js +5 -0
  14. package/es/Field/Field.d.ts +6 -0
  15. package/es/Field/FieldErrorScrollTarget.d.ts +1 -0
  16. package/es/Field/FieldErrorScrollTarget.js +1 -0
  17. package/es/Field/StandAloneInput.d.ts +4 -0
  18. package/es/Field/StandAloneInput.js +1 -0
  19. package/es/Field/useStandardField.d.ts +6 -0
  20. package/es/Field/useStandardField.js +8 -9
  21. package/es/FieldArray/FieldArray.d.ts +9 -0
  22. package/es/FieldArray/FieldArray.js +5 -0
  23. package/es/File/FileGroup.d.ts +2 -0
  24. package/es/File/FileGroup.js +1 -0
  25. package/es/Form/FocusError.d.ts +2 -0
  26. package/es/Form/FocusError.js +1 -0
  27. package/es/Form/Form.d.ts +6 -0
  28. package/es/Form/Form.js +1 -0
  29. package/es/Form/FormBasedPreventNavigation.d.ts +3 -1
  30. package/es/Form/FormBasedPreventNavigation.js +12 -62
  31. package/es/Form/LegacyFormBasedPreventNavigation.d.ts +17 -0
  32. package/es/Form/LegacyFormBasedPreventNavigation.js +69 -0
  33. package/es/Form/NewFormBasedPreventNavigation.d.ts +14 -0
  34. package/es/Form/NewFormBasedPreventNavigation.js +39 -0
  35. package/es/Form/ServerErrorContext.d.ts +1 -0
  36. package/es/Form/ServerErrorContext.js +1 -0
  37. package/es/FormActions.d.ts +6 -0
  38. package/es/FormActions.js +1 -0
  39. package/es/FormDefaults.d.ts +1 -0
  40. package/es/FormDefaults.js +1 -0
  41. package/es/Group.d.ts +5 -3
  42. package/es/Group.js +2 -2
  43. package/es/Input/IconInputGroup.d.ts +3 -0
  44. package/es/Input/IconInputGroup.js +1 -0
  45. package/es/Input/InputGroup.d.ts +1 -1
  46. package/es/Input/InputGroup.js +2 -2
  47. package/es/Input/MoneyInputGroup.d.ts +2 -0
  48. package/es/Input/MoneyInputGroup.js +1 -0
  49. package/es/Input/NumberInputGroup.d.ts +2 -0
  50. package/es/Input/NumberInputGroup.js +1 -0
  51. package/es/Input/StringInputGroup.d.ts +1 -0
  52. package/es/Input/StringInputGroup.js +1 -0
  53. package/es/Normalization/normalizers.d.ts +2 -0
  54. package/es/Normalization/normalizers.js +2 -0
  55. package/es/Select/BooleanSelectGroup.d.ts +1 -0
  56. package/es/Select/BooleanSelectGroup.js +1 -0
  57. package/es/Select/NumberSelectGroup.d.ts +2 -0
  58. package/es/Select/NumberSelectGroup.js +2 -0
  59. package/es/Select/SelectGroup.d.ts +6 -0
  60. package/es/Select/SelectGroup.js +1 -0
  61. package/es/Select/StringSelectGroup.d.ts +2 -0
  62. package/es/Select/StringSelectGroup.js +2 -0
  63. package/es/StandardFormActions.d.ts +5 -0
  64. package/es/StandardFormActions.js +1 -0
  65. package/es/SubmitFormButton.d.ts +3 -0
  66. package/es/SubmitFormButton.js +1 -0
  67. package/es/TextArea/TextAreaGroup.d.ts +1 -0
  68. package/es/TextArea/TextAreaGroup.js +1 -1
  69. package/es/Validation/validators.d.ts +3 -0
  70. package/es/Validation/validators.js +3 -2
  71. package/es/setupTests.d.ts +1 -0
  72. package/es/setupTests.js +1 -0
  73. package/lib/AddressInput/AddressInput.d.ts +10 -0
  74. package/lib/AddressInput/AddressInput.js +10 -0
  75. package/lib/ConfirmBaseForm/ConfirmBaseForm.d.ts +14 -0
  76. package/lib/ConfirmBaseForm/ConfirmBaseForm.js +6 -0
  77. package/lib/ConfirmDeleteForm/ConfirmDeleteForm.d.ts +13 -0
  78. package/lib/ConfirmDeleteForm/ConfirmDeleteForm.js +5 -0
  79. package/lib/DatePicker/DatePickerGroup.d.ts +5 -0
  80. package/lib/DatePicker/DatePickerGroup.js +5 -0
  81. package/lib/DatePicker/StringDateOnlyPickerGroup.d.ts +5 -0
  82. package/lib/DatePicker/StringDateOnlyPickerGroup.js +5 -0
  83. package/lib/DatePicker/StringDatePickerGroup.d.ts +5 -0
  84. package/lib/DatePicker/StringDatePickerGroup.js +5 -0
  85. package/lib/Field/Field.d.ts +6 -0
  86. package/lib/Field/FieldErrorScrollTarget.d.ts +1 -0
  87. package/lib/Field/FieldErrorScrollTarget.js +1 -0
  88. package/lib/Field/StandAloneInput.d.ts +4 -0
  89. package/lib/Field/StandAloneInput.js +1 -0
  90. package/lib/Field/useStandardField.d.ts +6 -0
  91. package/lib/Field/useStandardField.js +8 -9
  92. package/lib/FieldArray/FieldArray.d.ts +9 -0
  93. package/lib/FieldArray/FieldArray.js +5 -0
  94. package/lib/File/FileGroup.d.ts +2 -0
  95. package/lib/File/FileGroup.js +1 -0
  96. package/lib/Form/FocusError.d.ts +2 -0
  97. package/lib/Form/FocusError.js +1 -0
  98. package/lib/Form/Form.d.ts +6 -0
  99. package/lib/Form/Form.js +1 -0
  100. package/lib/Form/FormBasedPreventNavigation.d.ts +3 -1
  101. package/lib/Form/FormBasedPreventNavigation.js +13 -60
  102. package/lib/Form/LegacyFormBasedPreventNavigation.d.ts +17 -0
  103. package/lib/Form/LegacyFormBasedPreventNavigation.js +72 -0
  104. package/lib/Form/NewFormBasedPreventNavigation.d.ts +14 -0
  105. package/lib/Form/NewFormBasedPreventNavigation.js +42 -0
  106. package/lib/Form/ServerErrorContext.d.ts +1 -0
  107. package/lib/Form/ServerErrorContext.js +1 -0
  108. package/lib/FormActions.d.ts +6 -0
  109. package/lib/FormActions.js +1 -0
  110. package/lib/FormDefaults.d.ts +1 -0
  111. package/lib/FormDefaults.js +1 -0
  112. package/lib/Group.d.ts +5 -3
  113. package/lib/Group.js +2 -2
  114. package/lib/Input/IconInputGroup.d.ts +3 -0
  115. package/lib/Input/IconInputGroup.js +1 -0
  116. package/lib/Input/InputGroup.d.ts +1 -1
  117. package/lib/Input/InputGroup.js +2 -2
  118. package/lib/Input/MoneyInputGroup.d.ts +2 -0
  119. package/lib/Input/MoneyInputGroup.js +1 -0
  120. package/lib/Input/NumberInputGroup.d.ts +2 -0
  121. package/lib/Input/NumberInputGroup.js +1 -0
  122. package/lib/Input/StringInputGroup.d.ts +1 -0
  123. package/lib/Input/StringInputGroup.js +1 -0
  124. package/lib/Normalization/normalizers.d.ts +2 -0
  125. package/lib/Normalization/normalizers.js +2 -0
  126. package/lib/Select/BooleanSelectGroup.d.ts +1 -0
  127. package/lib/Select/BooleanSelectGroup.js +1 -0
  128. package/lib/Select/NumberSelectGroup.d.ts +2 -0
  129. package/lib/Select/NumberSelectGroup.js +2 -0
  130. package/lib/Select/SelectGroup.d.ts +6 -0
  131. package/lib/Select/SelectGroup.js +1 -0
  132. package/lib/Select/StringSelectGroup.d.ts +2 -0
  133. package/lib/Select/StringSelectGroup.js +2 -0
  134. package/lib/StandardFormActions.d.ts +5 -0
  135. package/lib/StandardFormActions.js +1 -0
  136. package/lib/SubmitFormButton.d.ts +3 -0
  137. package/lib/SubmitFormButton.js +1 -0
  138. package/lib/TextArea/TextAreaGroup.d.ts +1 -0
  139. package/lib/TextArea/TextAreaGroup.js +1 -1
  140. package/lib/Validation/validators.d.ts +3 -0
  141. package/lib/Validation/validators.js +3 -2
  142. package/lib/setupTests.d.ts +1 -0
  143. package/lib/setupTests.js +3 -0
  144. package/package.json +9 -6
  145. package/src/AddressInput/AddressInput.tsx +10 -0
  146. package/src/AddressInput/__snapshots__/AddressInput.test.tsx.snap +4 -0
  147. package/src/ConfirmBaseForm/ConfirmBaseForm.tsx +14 -0
  148. package/src/ConfirmDeleteForm/ConfirmDeleteForm.tsx +13 -0
  149. package/src/DatePicker/DatePicker.test.tsx +1 -1
  150. package/src/DatePicker/DatePickerGroup.tsx +5 -2
  151. package/src/DatePicker/StringDateOnlyPickerGroup.tsx +5 -0
  152. package/src/DatePicker/StringDatePickerGroup.tsx +6 -0
  153. package/src/Field/Field.tsx +6 -1
  154. package/src/Field/FieldErrorScrollTarget.tsx +1 -0
  155. package/src/Field/StandAloneInput.tsx +4 -0
  156. package/src/Field/useStandardField.ts +13 -9
  157. package/src/FieldArray/FieldArray.tsx +9 -0
  158. package/src/File/FileGroup.tsx +2 -0
  159. package/src/Form/FocusError.tsx +3 -0
  160. package/src/Form/Form.tsx +6 -0
  161. package/src/Form/FormBasedPreventNavigation.tsx +26 -60
  162. package/src/Form/LegacyFormBasedPreventNavigation.tsx +77 -0
  163. package/src/Form/NewFormBasedPreventNavigation.tsx +59 -0
  164. package/src/Form/ServerErrorContext.ts +1 -0
  165. package/src/FormActions.tsx +7 -0
  166. package/src/FormDefaults.ts +1 -0
  167. package/src/Group.tsx +8 -4
  168. package/src/Input/IconInputGroup.tsx +3 -0
  169. package/src/Input/InputGroup.tsx +3 -1
  170. package/src/Input/MoneyInputGroup.tsx +2 -0
  171. package/src/Input/NumberInputGroup.tsx +2 -0
  172. package/src/Input/StringInputGroup.tsx +1 -0
  173. package/src/Input/__Tests__/__snapshots__/IconInputGroup.test.tsx.snap +1 -0
  174. package/src/Input/__Tests__/__snapshots__/MoneyInputGroup.test.tsx.snap +1 -0
  175. package/src/Input/__Tests__/__snapshots__/NumberInputGroup.test.tsx.snap +1 -0
  176. package/src/Input/__Tests__/__snapshots__/StringInputGroup.test.tsx.snap +1 -0
  177. package/src/Normalization/normalizers.ts +2 -0
  178. package/src/Select/BooleanSelectGroup.tsx +1 -0
  179. package/src/Select/NumberSelectGroup.tsx +2 -0
  180. package/src/Select/SelectGroup.tsx +6 -0
  181. package/src/Select/StringSelectGroup.tsx +2 -0
  182. package/src/StandardFormActions.tsx +5 -0
  183. package/src/SubmitFormButton.tsx +3 -0
  184. package/src/TextArea/TextAreaGroup.tsx +1 -1
  185. package/src/Validation/validators.ts +3 -2
  186. package/src/__Tests__/FormTestBase.tsx +7 -6
  187. package/src/__Tests__/RealisticForm.test.tsx +82 -0
  188. package/src/setupTests.ts +1 -0
  189. package/es/__Tests__/FormTestBase.d.ts +0 -27
  190. package/es/__Tests__/FormTestBase.js +0 -83
  191. package/es/__Tests__/index.d.ts +0 -2
  192. package/es/__Tests__/index.js +0 -2
  193. package/lib/__Tests__/FormTestBase.d.ts +0 -27
  194. package/lib/__Tests__/FormTestBase.js +0 -86
  195. package/lib/__Tests__/index.d.ts +0 -2
  196. package/lib/__Tests__/index.js +0 -8
@@ -0,0 +1,39 @@
1
+ import { useEffect } from 'react';
2
+ import { unstable_usePrompt as usePrompt, } from 'react-router-dom';
3
+ /** Temporary function to allow backwards compatibility with routers that do not use the new Data API */
4
+ export default function NewFormBasedPreventNavigation(_a) {
5
+ var _b = _a.promptMessage, promptMessage = _b === void 0 ? 'Changes you made may not be saved.' : _b, preventNavigate = _a.preventNavigate, navigator = _a.navigator;
6
+ usePrompt({
7
+ when: preventNavigate,
8
+ message: promptMessage,
9
+ });
10
+ // TODO: Once react-router fully supports usePrompt and when we do not want to support routers
11
+ // that do not support the react-router Data API we can remove this.
12
+ useEffect(function () {
13
+ if (!preventNavigate) {
14
+ return;
15
+ }
16
+ var unblock = function () { };
17
+ var push = navigator.push;
18
+ navigator.push = function () {
19
+ var args = [];
20
+ for (var _i = 0; _i < arguments.length; _i++) {
21
+ args[_i] = arguments[_i];
22
+ }
23
+ if (window.confirm(promptMessage)) {
24
+ push.apply(void 0, args);
25
+ }
26
+ };
27
+ window.addEventListener('beforeunload', beforeUnload);
28
+ return function () {
29
+ unblock();
30
+ navigator.push = push;
31
+ window.removeEventListener('beforeunload', beforeUnload);
32
+ };
33
+ function beforeUnload(e) {
34
+ e.preventDefault();
35
+ e.returnValue = promptMessage;
36
+ }
37
+ }, [preventNavigate, promptMessage, navigator]);
38
+ return null;
39
+ }
@@ -7,4 +7,5 @@ export interface ServerErrorContextProps {
7
7
  getError: (path: string) => string | undefined;
8
8
  setError: (path: string, errorMessage: string | undefined) => void;
9
9
  }
10
+ /** Context to store the API errors from the server for the form. */
10
11
  export declare const ServerErrorContext: React.Context<ServerErrorContextProps>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ /** Context to store the API errors from the server for the form. */
2
3
  export var ServerErrorContext = React.createContext({
3
4
  errors: {},
4
5
  getError: function (path) {
@@ -1,7 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  export interface FormActionsProps {
3
+ /** Allow the form to be submitted without any changes. By default this is not allowed. */
3
4
  allowPristineSubmit?: boolean;
5
+ /** The cancel button's `onClick`.
6
+ * @defaultValue `window.history.back()`
7
+ */
4
8
  handleCancel?: () => void;
9
+ /** Whether both buttons should be disabled. */
5
10
  disabled?: boolean;
6
11
  }
12
+ /** Standard cancel and submit buttons. */
7
13
  export default function FormActions({ allowPristineSubmit, handleCancel, disabled, }: FormActionsProps): JSX.Element;
package/es/FormActions.js CHANGED
@@ -13,6 +13,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
13
13
  import { FormDefaults } from './FormDefaults';
14
14
  import { useFormikContext } from 'formik';
15
15
  import SubmitFormButton from './SubmitFormButton';
16
+ /** Standard cancel and submit buttons. */
16
17
  export default function FormActions(_a) {
17
18
  var allowPristineSubmit = _a.allowPristineSubmit, handleCancel = _a.handleCancel, disabled = _a.disabled;
18
19
  var isSubmitting = useFormikContext().isSubmitting;
@@ -1,3 +1,4 @@
1
+ /** `envoc-form-` CSS class prefix */
1
2
  export declare const FormDefaults: {
2
3
  cssClassPrefix: string;
3
4
  };
@@ -1 +1,2 @@
1
+ /** `envoc-form-` CSS class prefix */
1
2
  export var FormDefaults = { cssClassPrefix: 'envoc-form-' };
package/es/Group.d.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import { InjectedFieldProps } from './Field/InjectedFieldProps';
3
3
  export interface GroupProps extends InjectedFieldProps<any> {
4
+ /** Extra class names to apply. */
4
5
  className?: string;
5
6
  children: React.ReactNode;
6
- /** simple text label before the input */
7
+ /** Simple text label before the input. */
7
8
  label?: string;
8
- /** simple helper text after the input*/
9
+ /** Simple helper text after the input. */
9
10
  helpText?: string | React.ReactNode;
11
+ /** Whether the field should be disabled. */
10
12
  disabled?: boolean;
11
13
  required?: boolean;
12
14
  }
13
- /** contains standard field bits like a label, helper text, error scroll target, validation message container, etc */
15
+ /** Contains standard field bits like a label, helper text, error scroll target, validation message container, etc. */
14
16
  export default function Group({ className, children, label, helpText, meta, input, disabled, required, }: GroupProps): JSX.Element;
package/es/Group.js CHANGED
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import classNames from 'classnames';
14
14
  import { FormDefaults } from './FormDefaults';
15
15
  import FieldErrorScrollTarget from './Field/FieldErrorScrollTarget';
16
- /** contains standard field bits like a label, helper text, error scroll target, validation message container, etc */
16
+ /** Contains standard field bits like a label, helper text, error scroll target, validation message container, etc. */
17
17
  export default function Group(_a) {
18
18
  var _b;
19
19
  var className = _a.className, children = _a.children, label = _a.label, helpText = _a.helpText, meta = _a.meta, input = _a.input, disabled = _a.disabled, required = _a.required;
@@ -21,5 +21,5 @@ export default function Group(_a) {
21
21
  _b[FormDefaults.cssClassPrefix + 'invalid'] = meta.error,
22
22
  _b[FormDefaults.cssClassPrefix + 'disabled'] = disabled,
23
23
  _b[FormDefaults.cssClassPrefix + 'required'] = required,
24
- _b)) }, { children: [_jsx(FieldErrorScrollTarget, {}), meta.warning && (_jsx("div", __assign({ className: FormDefaults.cssClassPrefix + 'warning' }, { children: meta.warning }))), _jsx("label", __assign({ htmlFor: input.id }, { children: label })), children, meta.error && (_jsx("div", __assign({ className: FormDefaults.cssClassPrefix + 'error' }, { children: meta.error }))), helpText && (_jsx("div", __assign({ className: FormDefaults.cssClassPrefix + 'help' }, { children: helpText })))] })));
24
+ _b)) }, { children: [_jsx(FieldErrorScrollTarget, {}), meta.warning && (_jsx("div", __assign({ className: FormDefaults.cssClassPrefix + 'warning' }, { children: meta.warning }))), _jsx("label", __assign({ htmlFor: input.id }, { children: label })), children, meta.error && (_jsx("div", __assign({ id: "".concat(input.id, "-error"), className: FormDefaults.cssClassPrefix + 'error' }, { children: meta.error }))), helpText && (_jsx("div", __assign({ className: FormDefaults.cssClassPrefix + 'help' }, { children: helpText })))] })));
25
25
  }
@@ -2,8 +2,11 @@ import React from 'react';
2
2
  import { InputGroupProps } from './InputGroup';
3
3
  export interface IconInputGroupProps extends Omit<InputGroupProps<string | undefined | null>, 'onChange' | 'type' | 'value'> {
4
4
  type?: 'color' | 'email' | 'search' | 'tel' | 'text' | 'url';
5
+ /** Icon to display on the input group. */
5
6
  icon: React.ReactNode;
7
+ /** Text to display after the input group to give more information to the user. */
6
8
  helpText?: string;
7
9
  }
10
+ /** Input group with an icon. */
8
11
  declare const IconInputGroupWithRef: React.ComponentType<IconInputGroupProps>;
9
12
  export default IconInputGroupWithRef;
@@ -38,5 +38,6 @@ function IconInputGroup(_a, ref) {
38
38
  }
39
39
  } }, rest)) }));
40
40
  }
41
+ /** Input group with an icon. */
41
42
  var IconInputGroupWithRef = React.forwardRef(IconInputGroup);
42
43
  export default IconInputGroupWithRef;
@@ -6,7 +6,7 @@ export interface InputGroupProps<TValue> extends InjectedFieldProps<TValue>, Omi
6
6
  value: string | number | null | undefined;
7
7
  icon?: React.ReactNode;
8
8
  }
9
- /** generic controlled <input/> wrapped by a Group */
10
9
  declare function InputGroup<TValue>({ input, meta, label, helpText, className, required, disabled, onChange, value, icon, ...rest }: InputGroupProps<TValue>, ref: LegacyRef<HTMLInputElement>): JSX.Element;
10
+ /** Generic controlled `<input/>` wrapped by a `<Group/>` */
11
11
  declare const InputGroupWithRef: typeof InputGroup;
12
12
  export default InputGroupWithRef;
@@ -25,10 +25,10 @@ import React from 'react';
25
25
  import classNames from 'classnames';
26
26
  import { FormDefaults } from '../FormDefaults';
27
27
  import Group from '../Group';
28
- /** generic controlled <input/> wrapped by a Group */
29
28
  function InputGroup(_a, ref) {
30
29
  var input = _a.input, meta = _a.meta, label = _a.label, helpText = _a.helpText, className = _a.className, required = _a.required, disabled = _a.disabled, onChange = _a.onChange, value = _a.value, icon = _a.icon, rest = __rest(_a, ["input", "meta", "label", "helpText", "className", "required", "disabled", "onChange", "value", "icon"]);
31
- return (_jsxs(Group, __assign({ input: input, meta: meta, required: required, disabled: disabled, label: label, helpText: helpText, className: classNames(className, FormDefaults.cssClassPrefix + 'input-group') }, { children: [icon, _jsx("input", __assign({}, input, rest, { value: value !== null && value !== void 0 ? value : '', onChange: onChange, ref: ref, className: classNames(className, FormDefaults.cssClassPrefix + 'input-group') }))] })));
30
+ return (_jsxs(Group, __assign({ input: input, meta: meta, required: required, disabled: disabled, label: label, helpText: helpText, className: classNames(className, FormDefaults.cssClassPrefix + 'input-group') }, { children: [icon, _jsx("input", __assign({}, input, rest, { "aria-invalid": !!meta.error, "aria-errormessage": !!meta.error ? "".concat(input.name, "-error") : undefined, value: value !== null && value !== void 0 ? value : '', onChange: onChange, ref: ref, className: classNames(className, FormDefaults.cssClassPrefix + 'input-group') }))] })));
32
31
  }
32
+ /** Generic controlled `<input/>` wrapped by a `<Group/>` */
33
33
  var InputGroupWithRef = React.forwardRef(InputGroup);
34
34
  export default InputGroupWithRef;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { InputGroupProps } from './InputGroup';
3
3
  export interface MoneyInputGroupProps extends Omit<InputGroupProps<number | undefined | null>, 'onChange' | 'type' | 'value'> {
4
+ /** Custom parsing function when the value changes. */
4
5
  parseFunc?: typeof parseInt | typeof parseFloat;
5
6
  }
7
+ /** Input group for inputting money. */
6
8
  declare const MoneyInputGroupWithRef: React.FunctionComponent<MoneyInputGroupProps>;
7
9
  export default MoneyInputGroupWithRef;
@@ -38,5 +38,6 @@ function MoneyInputGroup(_a, ref) {
38
38
  }
39
39
  } })));
40
40
  }
41
+ /** Input group for inputting money. */
41
42
  var MoneyInputGroupWithRef = React.forwardRef(MoneyInputGroup);
42
43
  export default MoneyInputGroupWithRef;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { InputGroupProps } from './InputGroup';
3
3
  export interface NumberInputGroupProps extends Omit<InputGroupProps<number | undefined | null>, 'onChange' | 'type' | 'value'> {
4
+ /** Custom parsing function when the value changes. */
4
5
  parseFunc?: typeof parseInt | typeof parseFloat;
5
6
  }
7
+ /** Standard number input group. By default allows for float values. */
6
8
  declare const NumberInputGroupWithRef: React.ComponentType<NumberInputGroupProps>;
7
9
  export default NumberInputGroupWithRef;
@@ -38,5 +38,6 @@ function NumberInputGroup(_a, ref) {
38
38
  }
39
39
  } })));
40
40
  }
41
+ /** Standard number input group. By default allows for float values. */
41
42
  var NumberInputGroupWithRef = React.forwardRef(NumberInputGroup);
42
43
  export default NumberInputGroupWithRef;
@@ -3,5 +3,6 @@ import { InputGroupProps } from './InputGroup';
3
3
  export interface StringInputGroupProps extends Omit<InputGroupProps<string | undefined | null>, 'onChange' | 'type' | 'value'> {
4
4
  type?: 'color' | 'email' | 'search' | 'tel' | 'text' | 'url' | 'password' | 'textarea';
5
5
  }
6
+ /** Standard string input group. */
6
7
  declare const StringInputGroupWithRef: React.ComponentType<StringInputGroupProps>;
7
8
  export default StringInputGroupWithRef;
@@ -38,5 +38,6 @@ function StringInputGroup(_a, ref) {
38
38
  }
39
39
  } })));
40
40
  }
41
+ /** Standard string input group. */
41
42
  var StringInputGroupWithRef = React.forwardRef(StringInputGroup);
42
43
  export default StringInputGroupWithRef;
@@ -1,2 +1,4 @@
1
+ /** Normalizer for converting a string into a valid phone number. */
1
2
  export declare const phoneNumber: (value: string | undefined | null) => string | undefined;
3
+ /** Normalizer for converting a string into a valid zip code. Allows for XXXXX and XXXXX-XXXX format. */
2
4
  export declare const zipCode: (value: string | undefined | null) => string | undefined;
@@ -1,3 +1,4 @@
1
+ /** Normalizer for converting a string into a valid phone number. */
1
2
  export var phoneNumber = function (value) {
2
3
  if (!value) {
3
4
  return undefined;
@@ -18,6 +19,7 @@ export var phoneNumber = function (value) {
18
19
  }
19
20
  return onlyNums;
20
21
  };
22
+ /** Normalizer for converting a string into a valid zip code. Allows for XXXXX and XXXXX-XXXX format. */
21
23
  export var zipCode = function (value) {
22
24
  if (!value) {
23
25
  return undefined;
@@ -4,4 +4,5 @@ import { SelectGroupPropsHelper } from './SelectGroupPropsHelper';
4
4
  export interface BooleanSelectGroupProps extends Omit<SelectGroupPropsHelper<boolean | undefined | null>, 'options'> {
5
5
  options?: SelectOption<boolean>[];
6
6
  }
7
+ /** A `<SelectGroup/>` dropdown with two options. Default options are 'Yes' and 'No' with values of `true` and `false`. */
7
8
  export declare function BooleanSelectGroup(props: BooleanSelectGroupProps): JSX.Element;
@@ -21,6 +21,7 @@ var booleanOptions = [
21
21
  value: false,
22
22
  },
23
23
  ];
24
+ /** A `<SelectGroup/>` dropdown with two options. Default options are 'Yes' and 'No' with values of `true` and `false`. */
24
25
  export function BooleanSelectGroup(props) {
25
26
  var _a;
26
27
  return (_jsx(SelectGroup, __assign({ multiple: false }, props, { options: (_a = props.options) !== null && _a !== void 0 ? _a : booleanOptions })));
@@ -2,7 +2,9 @@
2
2
  import { SelectGroupPropsHelper } from './SelectGroupPropsHelper';
3
3
  export interface MultiNumberSelectGroupProps extends SelectGroupPropsHelper<number[] | undefined | null> {
4
4
  }
5
+ /** A `<SelectGroup/>` dropdown with values as numbers. Many options can be selected at a time. */
5
6
  export declare function MultiNumberSelectGroup(props: MultiNumberSelectGroupProps): JSX.Element;
6
7
  export interface SingleNumberSelectGroupProps extends SelectGroupPropsHelper<number | undefined | null> {
7
8
  }
9
+ /** A `<SelectGroup/>` dropdown with values as numbers. Only one option can be selected at a time. */
8
10
  export declare function SingleNumberSelectGroup(props: SingleNumberSelectGroupProps): JSX.Element;
@@ -11,9 +11,11 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import SelectGroup from './SelectGroup';
14
+ /** A `<SelectGroup/>` dropdown with values as numbers. Many options can be selected at a time. */
14
15
  export function MultiNumberSelectGroup(props) {
15
16
  return _jsx(SelectGroup, __assign({ multiple: true }, props));
16
17
  }
18
+ /** A `<SelectGroup/>` dropdown with values as numbers. Only one option can be selected at a time. */
17
19
  export function SingleNumberSelectGroup(props) {
18
20
  return _jsx(SelectGroup, __assign({ multiple: false }, props));
19
21
  }
@@ -2,7 +2,9 @@
2
2
  import { InjectedFieldProps } from '../Field/InjectedFieldProps';
3
3
  import { GroupProps } from '../Group';
4
4
  export interface SelectOption<TValue> {
5
+ /** Value for the select. This will be sent to the API. */
5
6
  value: (TValue extends Array<infer P> ? P : TValue) | undefined;
7
+ /** Label for the select. This is displayed to the user. */
6
8
  label: string;
7
9
  }
8
10
  interface OptionsApiResult<TValue> {
@@ -14,9 +16,13 @@ interface OptionsUseServiceResult<TValue> {
14
16
  error?: any;
15
17
  }
16
18
  export interface SelectGroupProps<TValue> extends InjectedFieldProps<TValue | undefined | null>, Omit<GroupProps, 'input' | 'meta' | 'children'> {
19
+ /** Options for the dropdown. Includes the label and value. */
17
20
  options: SelectOption<TValue>[] | OptionsUseServiceResult<TValue>;
21
+ /** Whether the user should be able to have multiple values selected. */
18
22
  multiple: TValue extends Array<any> ? true : false;
23
+ /** Text diplayed when no value is selected. */
19
24
  placeholder?: string;
20
25
  }
26
+ /** Generic select dropdown. Uses [react-select](https://react-select.com/home). */
21
27
  export default function SelectGroup<TValue>({ input, meta, className, required, disabled, options, multiple, placeholder, ...rest }: SelectGroupProps<TValue>): JSX.Element;
22
28
  export {};
@@ -26,6 +26,7 @@ import classNames from 'classnames';
26
26
  import { FormDefaults } from '../FormDefaults';
27
27
  import Group from '../Group';
28
28
  // TODO: we could also name this "ReactSelectGroup" or similar but the types are strongly defined now so kept the names consistent
29
+ /** Generic select dropdown. Uses [react-select](https://react-select.com/home). */
29
30
  export default function SelectGroup(_a) {
30
31
  var _b;
31
32
  var input = _a.input, meta = _a.meta, className = _a.className, required = _a.required, disabled = _a.disabled, options = _a.options, multiple = _a.multiple, placeholder = _a.placeholder, rest = __rest(_a, ["input", "meta", "className", "required", "disabled", "options", "multiple", "placeholder"]);
@@ -2,7 +2,9 @@
2
2
  import { SelectGroupPropsHelper } from './SelectGroupPropsHelper';
3
3
  export interface MultiStringSelectGroupProps extends SelectGroupPropsHelper<string[]> {
4
4
  }
5
+ /** A `<SelectGroup/>` dropdown with values as strings. Multiple options can be selected at a time. */
5
6
  export declare function MultiStringSelectGroup(props: MultiStringSelectGroupProps): JSX.Element;
6
7
  export interface SingleStringSelectGroupProps extends SelectGroupPropsHelper<string> {
7
8
  }
9
+ /** A `<SelectGroup/>` dropdown with the value as a string. Only one option can be selected at a time. */
8
10
  export declare function SingleStringSelectGroup(props: SingleStringSelectGroupProps): JSX.Element;
@@ -11,9 +11,11 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import SelectGroup from './SelectGroup';
14
+ /** A `<SelectGroup/>` dropdown with values as strings. Multiple options can be selected at a time. */
14
15
  export function MultiStringSelectGroup(props) {
15
16
  return _jsx(SelectGroup, __assign({ multiple: true }, props));
16
17
  }
18
+ /** A `<SelectGroup/>` dropdown with the value as a string. Only one option can be selected at a time. */
17
19
  export function SingleStringSelectGroup(props) {
18
20
  return _jsx(SelectGroup, __assign({ multiple: false }, props));
19
21
  }
@@ -1,6 +1,11 @@
1
1
  import { MouseEventHandler } from 'react';
2
2
  export interface StandardFormActionsProps {
3
+ /** Allow the form to be submitted without any changes. By default this is not allowed. */
3
4
  allowPristineSubmit?: boolean;
5
+ /** The cancel button's `onClick`.
6
+ * @defaultValue `window.history.back()`
7
+ */
4
8
  handleCancel?: MouseEventHandler<HTMLButtonElement>;
5
9
  }
10
+ /** Standard submit and cancel buttons. */
6
11
  export default function StandardFormActions({ allowPristineSubmit, handleCancel, }: StandardFormActionsProps): JSX.Element;
@@ -14,6 +14,7 @@ import classNames from 'classnames';
14
14
  import { useFormikContext } from 'formik';
15
15
  import SubmitFormButton from './SubmitFormButton';
16
16
  import { FormDefaults } from './FormDefaults';
17
+ /** Standard submit and cancel buttons. */
17
18
  export default function StandardFormActions(_a) {
18
19
  var allowPristineSubmit = _a.allowPristineSubmit, handleCancel = _a.handleCancel;
19
20
  var isSubmitting = useFormikContext().isSubmitting;
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  export interface SubmitFormButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'type'> {
3
+ /** Allow the form to be submitted without any changes. By default this is not allowed. */
3
4
  allowPristineSubmit?: boolean;
5
+ /** Text to display on the button. Default text is 'Submit'. */
4
6
  children?: React.ReactNode;
5
7
  }
6
8
  declare const _default: React.FunctionComponent<SubmitFormButtonProps>;
9
+ /** Generic submit button for forms. */
7
10
  export default _default;
@@ -36,4 +36,5 @@ function SubmitFormButton(_a, ref) {
36
36
  ? "You haven't made any changes"
37
37
  : '', className: classNames(FormDefaults.cssClassPrefix + 'submit-form-button', className) }, { children: children || 'Submit' })));
38
38
  }
39
+ /** Generic submit button for forms. */
39
40
  export default React.forwardRef(SubmitFormButton);
@@ -4,5 +4,6 @@ import { GroupProps } from '../Group';
4
4
  export interface TextAreaGroupProps extends InjectedFieldProps<string | undefined | null>, Omit<React.HTMLProps<HTMLTextAreaElement>, keyof InjectedFieldProps<any> | 'children' | 'className' | 'label'>, Omit<GroupProps, keyof InjectedFieldProps<any> | 'children'> {
5
5
  icon?: React.ReactNode;
6
6
  }
7
+ /** Generic controlled `<textarea/>` wrapped by a `<Group/>` */
7
8
  declare const TextAreaGroupWithRef: React.ComponentType<TextAreaGroupProps>;
8
9
  export default TextAreaGroupWithRef;
@@ -25,11 +25,11 @@ import React from 'react';
25
25
  import classNames from 'classnames';
26
26
  import { FormDefaults } from '../FormDefaults';
27
27
  import Group from '../Group';
28
- /** generic controlled <textarea/> wrapped by a Group */
29
28
  function TextAreaGroup(_a, ref) {
30
29
  var _b;
31
30
  var input = _a.input, meta = _a.meta, label = _a.label, helpText = _a.helpText, className = _a.className, required = _a.required, disabled = _a.disabled, icon = _a.icon, rest = __rest(_a, ["input", "meta", "label", "helpText", "className", "required", "disabled", "icon"]);
32
31
  return (_jsxs(Group, __assign({ input: input, meta: meta, required: required, disabled: disabled, label: label, helpText: helpText, className: classNames(className, FormDefaults.cssClassPrefix + 'text-area-group') }, { children: [icon, _jsx("textarea", __assign({}, input, rest, { value: (_b = input.value) !== null && _b !== void 0 ? _b : '', onChange: function (val) { return input.onChange(val.target.value); }, ref: ref, className: classNames(className, FormDefaults.cssClassPrefix + 'text-area-group') }))] })));
33
32
  }
33
+ /** Generic controlled `<textarea/>` wrapped by a `<Group/>` */
34
34
  var TextAreaGroupWithRef = React.forwardRef(TextAreaGroup);
35
35
  export default TextAreaGroupWithRef;
@@ -1,5 +1,6 @@
1
1
  import { ValidationFunction } from './ValidationFunction';
2
2
  export declare const required: (value: any) => "Required" | undefined;
3
+ /** Asserts that the value is a certain number of characters. numbers are coerced to a string */
3
4
  export declare const length: (len: number) => (value: string | number | undefined | null) => string | undefined;
4
5
  export declare const integer: (val: string | number | undefined | null) => "Must be a whole number" | undefined;
5
6
  export declare const maxLength: (len: number) => (value: string | number | undefined | null) => string | undefined;
@@ -11,5 +12,7 @@ export declare const minCount: (count: number) => (value: {
11
12
  }[] | undefined | null) => string | undefined;
12
13
  export declare const maxValue: (max: number) => (value: number | undefined | null) => string | undefined;
13
14
  export declare const minValue: (min: number) => (value: number | undefined | null) => string | undefined;
15
+ /** Validate for a ZIP Code. Accepts formats: ##### and #####-#### */
14
16
  export declare const zipCode: (value: string | undefined | null) => "Invalid ZIP Code" | undefined;
17
+ /** One of the validators provided must be true. */
15
18
  export declare const any: <TValue>(validatorList: ValidationFunction<TValue>[]) => (value: TValue) => string | undefined;
@@ -7,7 +7,7 @@ export var required = function (value) {
7
7
  ? undefined
8
8
  : 'Required';
9
9
  };
10
- //asserts that the value is a certain number of characters. numbers are coerced to a string
10
+ /** Asserts that the value is a certain number of characters. numbers are coerced to a string */
11
11
  export var length = function (len) { return function (value) {
12
12
  var hasError = getLengthOfValue(value) !== len;
13
13
  return !hasError ? undefined : "Length must be ".concat(len);
@@ -40,12 +40,13 @@ export var minValue = function (min) { return function (value) {
40
40
  var hasError = !value || value < min;
41
41
  return !hasError ? undefined : "Minimum value ".concat(min, " not met");
42
42
  }; };
43
+ /** Validate for a ZIP Code. Accepts formats: ##### and #####-#### */
43
44
  export var zipCode = function (value) {
44
45
  return value && !/^[0-9]{5}(?:-[0-9]{4})?$/.test(value)
45
46
  ? 'Invalid ZIP Code'
46
47
  : undefined;
47
48
  };
48
- //one of the validators provided must be true
49
+ /** One of the validators provided must be true. */
49
50
  export var any = function (validatorList) {
50
51
  return function (value) {
51
52
  if (validatorList.length === 0 || !value) {
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -11,5 +11,15 @@ interface AddressDto {
11
11
  city?: string | null;
12
12
  state?: string | null;
13
13
  }
14
+ /**
15
+ * Collection of `<Field/>`s for inputting an address. Includes:
16
+ * ```txt
17
+ * Address 1
18
+ * Address 2
19
+ * City
20
+ * State
21
+ * Zip
22
+ * ```
23
+ */
14
24
  export default function AddressInput({ fieldBuilder: { Field }, name, }: AddressInputProps): JSX.Element;
15
25
  export {};
@@ -20,6 +20,16 @@ var __1 = require("../");
20
20
  var FieldSection_1 = __importDefault(require("../Field/FieldSection"));
21
21
  var normalizers_1 = require("../Normalization/normalizers");
22
22
  var validators_1 = require("../Validation/validators");
23
+ /**
24
+ * Collection of `<Field/>`s for inputting an address. Includes:
25
+ * ```txt
26
+ * Address 1
27
+ * Address 2
28
+ * City
29
+ * State
30
+ * Zip
31
+ * ```
32
+ */
23
33
  function AddressInput(_a) {
24
34
  var Field = _a.fieldBuilder.Field, name = _a.name;
25
35
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(FieldSection_1.default, __assign({ name: name }, { children: [(0, jsx_runtime_1.jsx)(Field, { name: "address1", placeholder: "Address, Line 1", label: "Address 1", Component: __1.StringInputGroup, validate: validators_1.required }), (0, jsx_runtime_1.jsx)(Field, { name: "address2", placeholder: "Address, Line 2", label: "Address 2", Component: __1.StringInputGroup }), (0, jsx_runtime_1.jsx)(Field, { name: "city", placeholder: "City", label: "City", Component: __1.StringInputGroup, validate: validators_1.required }), (0, jsx_runtime_1.jsx)(Field, { name: "state", placeholder: "State", label: "State", Component: __1.SingleStringSelectGroup, options: UsStates_1.default, validate: validators_1.required }), (0, jsx_runtime_1.jsx)(Field, { name: "zipCode", placeholder: "Zip", label: "Zip", Component: __1.StringInputGroup, normalize: normalizers_1.zipCode, validate: [validators_1.required, validators_1.zipCode] })] })) }));
@@ -1,12 +1,26 @@
1
1
  import React, { MouseEventHandler } from 'react';
2
2
  import { useAxiosRequestProps } from 'envoc-request';
3
3
  export interface ConfirmBaseFormProps {
4
+ /** Function to run when cancel button is clicked. */
4
5
  handleCancel?: MouseEventHandler<HTMLButtonElement>;
6
+ /** Axios request upon confirmation */
5
7
  request: useAxiosRequestProps;
6
8
  style?: React.CSSProperties;
9
+ /** `<h3/>` title text on top of the form. */
7
10
  title?: string;
11
+ /** Custom confirm button text.
12
+ * @defaultValue `Confirm`
13
+ */
8
14
  confirmButtonText?: string;
15
+ /** CSS class for the buttons. */
9
16
  confirmButtonClass?: string;
17
+ /** Any components to be rendered in between the title and the buttons. */
10
18
  children?: React.ReactNode;
11
19
  }
20
+ /**
21
+ * Confimation dialog. Navigates to a different route to allow the user to either confirm or cancel an action.
22
+ * Commonly used for confirming delete and archive.
23
+ *
24
+ * See `<ConfirmDeleteForm/>` if the confirmation is specifically for deletion.
25
+ */
12
26
  export default function ConfirmBaseForm({ handleCancel, request, style, title, confirmButtonText, confirmButtonClass, children, ...props }: ConfirmBaseFormProps): JSX.Element;
@@ -30,6 +30,12 @@ var classnames_1 = __importDefault(require("classnames"));
30
30
  var envoc_request_1 = require("envoc-request");
31
31
  var FormDefaults_1 = require("../FormDefaults");
32
32
  // TODO: ask about how we should use 'children'
33
+ /**
34
+ * Confimation dialog. Navigates to a different route to allow the user to either confirm or cancel an action.
35
+ * Commonly used for confirming delete and archive.
36
+ *
37
+ * See `<ConfirmDeleteForm/>` if the confirmation is specifically for deletion.
38
+ */
33
39
  function ConfirmBaseForm(_a) {
34
40
  var handleCancel = _a.handleCancel, request = _a.request, style = _a.style, title = _a.title, confirmButtonText = _a.confirmButtonText, confirmButtonClass = _a.confirmButtonClass, children = _a.children, props = __rest(_a, ["handleCancel", "request", "style", "title", "confirmButtonText", "confirmButtonClass", "children"]);
35
41
  var webRequest = (0, envoc_request_1.useAxiosRequest)(Object.assign({}, request, { autoExecute: false }));
@@ -1,11 +1,24 @@
1
1
  import React from 'react';
2
2
  import { ConfirmBaseFormProps } from '../ConfirmBaseForm/ConfirmBaseForm';
3
3
  export interface ConfirmDeleteFormProps extends Pick<ConfirmBaseFormProps, 'style'> {
4
+ /** Url to navigate to on success. */
4
5
  successUrl?: string;
6
+ /** Form name (key) to apply the confirmation on. */
5
7
  form: string;
8
+ /** Custom message to display.
9
+ * @defaultValue `Are you sure you want to delete this?`
10
+ */
6
11
  title?: string;
12
+ /** Custom function when the axios request succeeds. */
7
13
  handleComplete?: Function;
14
+ /** Custom function when the axios request fails. */
8
15
  handleError?: Function;
16
+ /** Any components to be rendered in between the title and the buttons. */
9
17
  children?: React.ReactNode;
10
18
  }
19
+ /**
20
+ * Deletion confirmation. Navigates to a different route to allow the user to either confirm or cancel an action.
21
+ *
22
+ * Wraps `<ConfirmBaseForm/>`.
23
+ */
11
24
  export default function ConfirmDeleteForm({ successUrl, form, title, handleComplete, handleError, children, ...props }: ConfirmDeleteFormProps): JSX.Element;
@@ -30,6 +30,11 @@ var react_router_dom_1 = require("react-router-dom");
30
30
  var react_toastify_1 = require("react-toastify");
31
31
  var ConfirmBaseForm_1 = __importDefault(require("../ConfirmBaseForm/ConfirmBaseForm"));
32
32
  var FormDefaults_1 = require("../FormDefaults");
33
+ /**
34
+ * Deletion confirmation. Navigates to a different route to allow the user to either confirm or cancel an action.
35
+ *
36
+ * Wraps `<ConfirmBaseForm/>`.
37
+ */
33
38
  function ConfirmDeleteForm(_a) {
34
39
  var successUrl = _a.successUrl, form = _a.form, title = _a.title, handleComplete = _a.handleComplete, handleError = _a.handleError, children = _a.children, props = __rest(_a, ["successUrl", "form", "title", "handleComplete", "handleError", "children"]);
35
40
  var navigate = (0, react_router_dom_1.useNavigate)();
@@ -5,5 +5,10 @@ import { GroupProps } from '../Group';
5
5
  export interface DatePickerGroupProps<T> extends InjectedFieldProps<T | undefined | null>, Omit<DatePickerProps, keyof InjectedFieldProps<T> | 'name' | 'value' | 'className'>, Omit<GroupProps, keyof InjectedFieldProps<T> | 'children'> {
6
6
  convert: (arg: Date) => T;
7
7
  }
8
+ /**
9
+ * Field for inputting dates. Uses `<Group/>` and `<DatePicker/>`.
10
+ *
11
+ * Uses [react-date-picker](https://www.npmjs.com/package/react-date-picker)
12
+ */
8
13
  export default function DatePickerGroup<T>({ input, meta, label, helpText, className, required, disabled, convert, ...rest }: DatePickerGroupProps<T>): JSX.Element;
9
14
  export declare function convertToTimeZoneInsensitiveISOString(date: Date): string;
@@ -33,6 +33,11 @@ var classnames_1 = __importDefault(require("classnames"));
33
33
  var parseISO_1 = __importDefault(require("date-fns/parseISO"));
34
34
  var FormDefaults_1 = require("../FormDefaults");
35
35
  var Group_1 = __importDefault(require("../Group"));
36
+ /**
37
+ * Field for inputting dates. Uses `<Group/>` and `<DatePicker/>`.
38
+ *
39
+ * Uses [react-date-picker](https://www.npmjs.com/package/react-date-picker)
40
+ */
36
41
  function DatePickerGroup(_a) {
37
42
  var input = _a.input, meta = _a.meta, label = _a.label, helpText = _a.helpText, className = _a.className, required = _a.required, disabled = _a.disabled, convert = _a.convert, rest = __rest(_a, ["input", "meta", "label", "helpText", "className", "required", "disabled", "convert"]);
38
43
  var _b = (0, react_1.useState)(null), displayDate = _b[0], setDisplayDate = _b[1];
@@ -2,4 +2,9 @@
2
2
  import { DatePickerHelper } from './DatePickerHelper';
3
3
  export interface StringDateOnlyPickerGroupProps extends DatePickerHelper<string | undefined | null> {
4
4
  }
5
+ /**
6
+ * Date picker input that consumes and outputs as a date only string in ISO format `YYYY-MM-DD`.
7
+ *
8
+ * Default display to the user is in `MM/DD/YYYY` format.
9
+ */
5
10
  export default function StringDatePickerGroup(props: StringDateOnlyPickerGroupProps): JSX.Element;