@jobber/components 6.103.2-JOB-140609-8386817.45 → 6.103.3

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 (79) hide show
  1. package/dist/Autocomplete/Autocomplete.types.d.ts +1 -12
  2. package/dist/Autocomplete/index.cjs +13 -1
  3. package/dist/Autocomplete/index.mjs +13 -1
  4. package/dist/Checkbox/Checkbox.types.d.ts +9 -2
  5. package/dist/Checkbox/index.cjs +2 -4
  6. package/dist/Checkbox/index.mjs +2 -4
  7. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
  8. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
  9. package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
  10. package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
  11. package/dist/Chips/index.cjs +2 -2
  12. package/dist/Chips/index.mjs +2 -2
  13. package/dist/DataList/components/DataListSearch/index.cjs +12 -1
  14. package/dist/DataList/components/DataListSearch/index.mjs +12 -1
  15. package/dist/DataList/index.cjs +8 -0
  16. package/dist/DataList/index.mjs +8 -0
  17. package/dist/DataTable/index.cjs +2 -2
  18. package/dist/DataTable/index.mjs +2 -2
  19. package/dist/DatePicker/index.cjs +2 -2
  20. package/dist/DatePicker/index.mjs +2 -2
  21. package/dist/FormField/FormFieldTypes.d.ts +2 -0
  22. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +2 -7
  23. package/dist/FormField-cjs.js +6 -1
  24. package/dist/FormField-es.js +6 -2
  25. package/dist/InputDate/index.cjs +9 -5
  26. package/dist/InputDate/index.mjs +9 -5
  27. package/dist/InputDate/useInputDateActivatorActions.d.ts +8 -4
  28. package/dist/InputEmail/InputEmail.types.d.ts +20 -12
  29. package/dist/InputEmail/hooks/useInputEmailActions.d.ts +1 -1
  30. package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +32 -0
  31. package/dist/InputEmail/index.cjs +44 -8
  32. package/dist/InputEmail/index.mjs +44 -8
  33. package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +3 -20
  34. package/dist/InputNumber/index.cjs +3 -3
  35. package/dist/InputNumber/index.mjs +3 -3
  36. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +27 -13
  37. package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +1 -1
  38. package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +71 -0
  39. package/dist/InputPhoneNumber/index.cjs +34 -17
  40. package/dist/InputPhoneNumber/index.mjs +34 -17
  41. package/dist/InputText/InputText.types.d.ts +24 -24
  42. package/dist/InputText/index.cjs +54 -54
  43. package/dist/InputText/index.mjs +55 -55
  44. package/dist/InputText/useInputTextActions.d.ts +1 -1
  45. package/dist/InputText/useInputTextFormField.d.ts +352 -0
  46. package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
  47. package/dist/InputTime/InputTime.types.d.ts +1 -21
  48. package/dist/InputTime/index.cjs +33 -63
  49. package/dist/InputTime/index.d.ts +1 -1
  50. package/dist/InputTime/index.mjs +36 -66
  51. package/dist/List/index.cjs +2 -2
  52. package/dist/List/index.mjs +2 -2
  53. package/dist/RecurringSelect/index.cjs +2 -2
  54. package/dist/RecurringSelect/index.mjs +2 -2
  55. package/dist/Select/Select.rebuilt.d.ts +1 -1
  56. package/dist/Select/Select.types.d.ts +1 -14
  57. package/dist/Select/hooks/useSelectActions.d.ts +5 -5
  58. package/dist/Select/hooks/useSelectFormField.d.ts +34 -0
  59. package/dist/Select/index.cjs +41 -28
  60. package/dist/Select/index.d.ts +5 -7
  61. package/dist/Select/index.mjs +43 -30
  62. package/dist/Tabs-es.js +1 -1
  63. package/dist/_baseEach-cjs.js +12 -12
  64. package/dist/_baseEach-es.js +1 -1
  65. package/dist/_baseFlatten-cjs.js +2 -2
  66. package/dist/_baseFlatten-es.js +1 -1
  67. package/dist/{_getAllKeys-cjs.js → _baseGet-cjs.js} +181 -181
  68. package/dist/{_getAllKeys-es.js → _baseGet-es.js} +182 -182
  69. package/dist/debounce-es.js +1 -1
  70. package/dist/index.cjs +2 -2
  71. package/dist/index.mjs +2 -2
  72. package/dist/omit-cjs.js +14 -14
  73. package/dist/omit-es.js +1 -1
  74. package/dist/sharedHelpers/types.d.ts +0 -235
  75. package/dist/styles.css +18 -20
  76. package/dist/useScrollToActive-cjs.js +3 -3
  77. package/dist/useScrollToActive-es.js +2 -2
  78. package/package.json +2 -2
  79. package/dist/InputTime/hooks/useInputTimeActions.d.ts +0 -16
@@ -1,17 +1,6 @@
1
1
  import type { CSSProperties, Key, Ref, RefObject } from "react";
2
- import type { AriaInputProps } from "../sharedHelpers/types";
3
2
  import type { FormFieldProps } from "../FormField";
4
3
  import type { InputTextRebuiltProps, InputTextRef } from "../InputText";
5
- /**
6
- * ARIA attributes for Autocomplete with managed/orchestrated behavior.
7
- * Certain ARIA attributes are controlled internally by Autocomplete's
8
- * state management and floating-ui integration and shouldn't be overridden.
9
- *
10
- * Omits: ariaControls, ariaExpanded, ariaActiveDescendant, ariaAutocomplete
11
- * (These are managed by the component's internal state/floating-ui)
12
- */
13
- export interface AriaInputPropsManaged extends Omit<AriaInputProps, "ariaControls" | "ariaExpanded" | "ariaActiveDescendant" | "ariaAutocomplete"> {
14
- }
15
4
  export type ExtraProps = Record<string, unknown>;
16
5
  type OptionValue = string | number;
17
6
  export interface BaseOption {
@@ -233,7 +222,7 @@ export type MenuFooter<Extra extends object = ExtraProps> = Extra & {
233
222
  };
234
223
  export type MenuItem<T extends OptionLike, SectionExtra extends object = ExtraProps, ActionExtra extends object = ExtraProps> = MenuSection<T, SectionExtra, ActionExtra> | MenuOptions<T, ActionExtra> | MenuHeader<ActionExtra> | MenuFooter<ActionExtra>;
235
224
  export type AutocompleteValue<Value extends OptionLike, Multiple extends boolean> = Multiple extends true ? Value[] : Value | undefined;
236
- interface AutocompleteRebuiltBaseProps<Value extends OptionLike, Multiple extends boolean, SectionExtra extends object, ActionExtra extends object> extends AriaInputPropsManaged {
225
+ interface AutocompleteRebuiltBaseProps<Value extends OptionLike, Multiple extends boolean, SectionExtra extends object, ActionExtra extends object> {
237
226
  version: 2;
238
227
  /**
239
228
  * Whether the autocomplete allows multiple selections.
@@ -20,6 +20,18 @@ require('react-hook-form');
20
20
  require('framer-motion');
21
21
  require('../Button-cjs.js');
22
22
  require('react-router-dom');
23
+ require('../omit-cjs.js');
24
+ require('../_commonjsHelpers-cjs.js');
25
+ require('../_baseGet-cjs.js');
26
+ require('../isTypedArray-cjs.js');
27
+ require('../isObjectLike-cjs.js');
28
+ require('../identity-cjs.js');
29
+ require('../_getTag-cjs.js');
30
+ require('../isSymbol-cjs.js');
31
+ require('../keysIn-cjs.js');
32
+ require('../_baseAssignValue-cjs.js');
33
+ require('../_baseFlatten-cjs.js');
34
+ require('../_setToString-cjs.js');
23
35
  require('../useFormFieldFocus-cjs.js');
24
36
  require('../InputValidation-cjs.js');
25
37
  require('../Spinner-cjs.js');
@@ -909,7 +921,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
909
921
  onBlur: onInputBlur,
910
922
  });
911
923
  const inputProps = Object.assign(Object.assign(Object.assign(Object.assign({ version: 2, value: inputValue, onChange: props.readOnly ? undefined : onInputChangeFromUser }, (props.readOnly ? { onFocus: onInputFocus, onBlur: onInputBlur } : {})), { placeholder,
912
- disabled, readOnly: props.readOnly, error: error !== null && error !== void 0 ? error : undefined, name: props.name, invalid, autoComplete: "off", description, size: sizeProp ? sizeProp : undefined, prefix: props.prefix, suffix: props.suffix }), (props.readOnly ? {} : composedReferenceProps)), { role: "combobox", ariaAutocomplete: "list", ariaExpanded: open ? true : false, ariaControls: listboxId, ariaActiveDescendant: open && activeIndex != null
924
+ disabled, readOnly: props.readOnly, error: error !== null && error !== void 0 ? error : undefined, name: props.name, invalid, autoComplete: "off", description, size: sizeProp ? sizeProp : undefined, prefix: props.prefix, suffix: props.suffix }), (props.readOnly ? {} : composedReferenceProps)), { role: "combobox", "aria-autocomplete": "list", "aria-expanded": open ? true : false, "aria-controls": listboxId, "aria-activedescendant": open && activeIndex != null
913
925
  ? `${listboxId}-item-${activeIndex}`
914
926
  : undefined });
915
927
  const referenceInputRef = (node) => {
@@ -18,6 +18,18 @@ import 'react-hook-form';
18
18
  import 'framer-motion';
19
19
  import '../Button-es.js';
20
20
  import 'react-router-dom';
21
+ import '../omit-es.js';
22
+ import '../_commonjsHelpers-es.js';
23
+ import '../_baseGet-es.js';
24
+ import '../isTypedArray-es.js';
25
+ import '../isObjectLike-es.js';
26
+ import '../identity-es.js';
27
+ import '../_getTag-es.js';
28
+ import '../isSymbol-es.js';
29
+ import '../keysIn-es.js';
30
+ import '../_baseAssignValue-es.js';
31
+ import '../_baseFlatten-es.js';
32
+ import '../_setToString-es.js';
21
33
  import '../useFormFieldFocus-es.js';
22
34
  import '../InputValidation-es.js';
23
35
  import '../Spinner-es.js';
@@ -907,7 +919,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
907
919
  onBlur: onInputBlur,
908
920
  });
909
921
  const inputProps = Object.assign(Object.assign(Object.assign(Object.assign({ version: 2, value: inputValue, onChange: props.readOnly ? undefined : onInputChangeFromUser }, (props.readOnly ? { onFocus: onInputFocus, onBlur: onInputBlur } : {})), { placeholder,
910
- disabled, readOnly: props.readOnly, error: error !== null && error !== void 0 ? error : undefined, name: props.name, invalid, autoComplete: "off", description, size: sizeProp ? sizeProp : undefined, prefix: props.prefix, suffix: props.suffix }), (props.readOnly ? {} : composedReferenceProps)), { role: "combobox", ariaAutocomplete: "list", ariaExpanded: open ? true : false, ariaControls: listboxId, ariaActiveDescendant: open && activeIndex != null
922
+ disabled, readOnly: props.readOnly, error: error !== null && error !== void 0 ? error : undefined, name: props.name, invalid, autoComplete: "off", description, size: sizeProp ? sizeProp : undefined, prefix: props.prefix, suffix: props.suffix }), (props.readOnly ? {} : composedReferenceProps)), { role: "combobox", "aria-autocomplete": "list", "aria-expanded": open ? true : false, "aria-controls": listboxId, "aria-activedescendant": open && activeIndex != null
911
923
  ? `${listboxId}-item-${activeIndex}`
912
924
  : undefined });
913
925
  const referenceInputRef = (node) => {
@@ -1,7 +1,6 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  import type { XOR } from "ts-xor";
3
- import type { AriaInputProps, FocusEvents } from "../sharedHelpers/types";
4
- export interface BaseCheckboxProps extends AriaInputProps, FocusEvents<HTMLInputElement> {
3
+ export interface BaseCheckboxProps {
5
4
  /**
6
5
  * Determines if the checkbox is checked or not.
7
6
  */
@@ -42,6 +41,14 @@ export interface BaseCheckboxProps extends AriaInputProps, FocusEvents<HTMLInput
42
41
  * Called when the checkbox value changes
43
42
  */
44
43
  onChange?(newValue: boolean): void;
44
+ /**
45
+ * Called when the checkbox is focused
46
+ */
47
+ onFocus?(event: React.FocusEvent<HTMLInputElement>): void;
48
+ /**
49
+ * Called when the checkbox loses focus
50
+ */
51
+ onBlur?(event: React.FocusEvent<HTMLInputElement>): void;
45
52
  /**
46
53
  * Whether the checkbox is invalid
47
54
  */
@@ -54,10 +54,9 @@ function CheckboxLegacy({ checked, defaultChecked, disabled, label, name, value,
54
54
  } }));
55
55
  }
56
56
 
57
- const CheckboxRebuilt = React.forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, ariaLabel, ariaDescribedBy, ariaRequired, }, ref) {
57
+ const CheckboxRebuilt = React.forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, }, ref) {
58
58
  const descriptionIdentifier = React.useId();
59
59
  const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled, invalid && styles.invalid);
60
- const isInvalid = Boolean(invalid);
61
60
  const inputClassName = classnames(styles.input, {
62
61
  [styles.indeterminate]: indeterminate,
63
62
  });
@@ -71,8 +70,7 @@ const CheckboxRebuilt = React.forwardRef(function CheckboxRebuiltInternal({ chec
71
70
  return (React.createElement("div", { className: styles.checkBoxParent },
72
71
  React.createElement("label", { className: wrapperClassName },
73
72
  React.createElement("span", { className: styles.checkHolder },
74
- React.createElement("input", { ref: ref, type: "checkbox", id: id, className: inputClassName, name: name, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy ||
75
- (description ? descriptionIdentifier : undefined), "aria-invalid": isInvalid ? true : undefined, "aria-required": ariaRequired, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
73
+ React.createElement("input", { ref: ref, type: "checkbox", id: id, className: inputClassName, name: name, "aria-describedby": description ? descriptionIdentifier : undefined, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
76
74
  React.createElement("span", { className: styles.checkBox },
77
75
  React.createElement(Icon.Icon, { name: iconName, color: "surface" }))),
78
76
  labelContent && React.createElement("span", { className: styles.label }, labelContent)),
@@ -52,10 +52,9 @@ function CheckboxLegacy({ checked, defaultChecked, disabled, label, name, value,
52
52
  } }));
53
53
  }
54
54
 
55
- const CheckboxRebuilt = forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, ariaLabel, ariaDescribedBy, ariaRequired, }, ref) {
55
+ const CheckboxRebuilt = forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, }, ref) {
56
56
  const descriptionIdentifier = useId();
57
57
  const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled, invalid && styles.invalid);
58
- const isInvalid = Boolean(invalid);
59
58
  const inputClassName = classnames(styles.input, {
60
59
  [styles.indeterminate]: indeterminate,
61
60
  });
@@ -69,8 +68,7 @@ const CheckboxRebuilt = forwardRef(function CheckboxRebuiltInternal({ checked, d
69
68
  return (React__default.createElement("div", { className: styles.checkBoxParent },
70
69
  React__default.createElement("label", { className: wrapperClassName },
71
70
  React__default.createElement("span", { className: styles.checkHolder },
72
- React__default.createElement("input", { ref: ref, type: "checkbox", id: id, className: inputClassName, name: name, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy ||
73
- (description ? descriptionIdentifier : undefined), "aria-invalid": isInvalid ? true : undefined, "aria-required": ariaRequired, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
71
+ React__default.createElement("input", { ref: ref, type: "checkbox", id: id, className: inputClassName, name: name, "aria-describedby": description ? descriptionIdentifier : undefined, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
74
72
  React__default.createElement("span", { className: styles.checkBox },
75
73
  React__default.createElement(Icon, { name: iconName, color: "surface" }))),
76
74
  labelContent && React__default.createElement("span", { className: styles.label }, labelContent)),
@@ -4,12 +4,12 @@ var useScrollToActive = require('../../../useScrollToActive-cjs.js');
4
4
  require('react');
5
5
  require('../../../_commonjsHelpers-cjs.js');
6
6
  require('../../../_baseFlatten-cjs.js');
7
- require('../../../_getAllKeys-cjs.js');
7
+ require('../../../_baseGet-cjs.js');
8
8
  require('../../../isTypedArray-cjs.js');
9
9
  require('../../../isObjectLike-cjs.js');
10
- require('../../../isSymbol-cjs.js');
11
10
  require('../../../identity-cjs.js');
12
11
  require('../../../_getTag-cjs.js');
12
+ require('../../../isSymbol-cjs.js');
13
13
  require('../../../_baseEach-cjs.js');
14
14
  require('../../../_baseFor-cjs.js');
15
15
  require('../../../_isIterateeCall-cjs.js');
@@ -2,12 +2,12 @@ export { b as useInView, u as useInternalChipDismissible, a as useInternalChipDi
2
2
  import 'react';
3
3
  import '../../../_commonjsHelpers-es.js';
4
4
  import '../../../_baseFlatten-es.js';
5
- import '../../../_getAllKeys-es.js';
5
+ import '../../../_baseGet-es.js';
6
6
  import '../../../isTypedArray-es.js';
7
7
  import '../../../isObjectLike-es.js';
8
- import '../../../isSymbol-es.js';
9
8
  import '../../../identity-es.js';
10
9
  import '../../../_getTag-es.js';
10
+ import '../../../isSymbol-es.js';
11
11
  import '../../../_baseEach-es.js';
12
12
  import '../../../_baseFor-es.js';
13
13
  import '../../../_isIterateeCall-es.js';
@@ -5,12 +5,12 @@ require('react');
5
5
  require('../../useScrollToActive-cjs.js');
6
6
  require('../../_commonjsHelpers-cjs.js');
7
7
  require('../../_baseFlatten-cjs.js');
8
- require('../../_getAllKeys-cjs.js');
8
+ require('../../_baseGet-cjs.js');
9
9
  require('../../isTypedArray-cjs.js');
10
10
  require('../../isObjectLike-cjs.js');
11
- require('../../isSymbol-cjs.js');
12
11
  require('../../identity-cjs.js');
13
12
  require('../../_getTag-cjs.js');
13
+ require('../../isSymbol-cjs.js');
14
14
  require('../../_baseEach-cjs.js');
15
15
  require('../../_baseFor-cjs.js');
16
16
  require('../../_isIterateeCall-cjs.js');
@@ -3,12 +3,12 @@ import 'react';
3
3
  import '../../useScrollToActive-es.js';
4
4
  import '../../_commonjsHelpers-es.js';
5
5
  import '../../_baseFlatten-es.js';
6
- import '../../_getAllKeys-es.js';
6
+ import '../../_baseGet-es.js';
7
7
  import '../../isTypedArray-es.js';
8
8
  import '../../isObjectLike-es.js';
9
- import '../../isSymbol-es.js';
10
9
  import '../../identity-es.js';
11
10
  import '../../_getTag-es.js';
11
+ import '../../isSymbol-es.js';
12
12
  import '../../_baseEach-es.js';
13
13
  import '../../_baseFor-es.js';
14
14
  import '../../_isIterateeCall-es.js';
@@ -7,12 +7,12 @@ var Chips = require('../Chips-cjs.js');
7
7
  require('../useScrollToActive-cjs.js');
8
8
  require('../_commonjsHelpers-cjs.js');
9
9
  require('../_baseFlatten-cjs.js');
10
- require('../_getAllKeys-cjs.js');
10
+ require('../_baseGet-cjs.js');
11
11
  require('../isTypedArray-cjs.js');
12
12
  require('../isObjectLike-cjs.js');
13
- require('../isSymbol-cjs.js');
14
13
  require('../identity-cjs.js');
15
14
  require('../_getTag-cjs.js');
15
+ require('../isSymbol-cjs.js');
16
16
  require('../_baseEach-cjs.js');
17
17
  require('../_baseFor-cjs.js');
18
18
  require('../_isIterateeCall-cjs.js');
@@ -5,12 +5,12 @@ export { C as Chips } from '../Chips-es.js';
5
5
  import '../useScrollToActive-es.js';
6
6
  import '../_commonjsHelpers-es.js';
7
7
  import '../_baseFlatten-es.js';
8
- import '../_getAllKeys-es.js';
8
+ import '../_baseGet-es.js';
9
9
  import '../isTypedArray-es.js';
10
10
  import '../isObjectLike-es.js';
11
- import '../isSymbol-es.js';
12
11
  import '../identity-es.js';
13
12
  import '../_getTag-es.js';
13
+ import '../isSymbol-es.js';
14
14
  import '../_baseEach-es.js';
15
15
  import '../_baseFor-es.js';
16
16
  import '../_isIterateeCall-es.js';
@@ -18,9 +18,20 @@ require('../../../useFormFieldFocus-cjs.js');
18
18
  require('../../../InputValidation-cjs.js');
19
19
  require('../../../Spinner-cjs.js');
20
20
  require('react-hook-form');
21
+ require('../../../omit-cjs.js');
22
+ require('../../../_commonjsHelpers-cjs.js');
23
+ require('../../../_baseGet-cjs.js');
24
+ require('../../../isTypedArray-cjs.js');
25
+ require('../../../isObjectLike-cjs.js');
26
+ require('../../../identity-cjs.js');
27
+ require('../../../_getTag-cjs.js');
28
+ require('../../../isSymbol-cjs.js');
29
+ require('../../../keysIn-cjs.js');
30
+ require('../../../_baseAssignValue-cjs.js');
31
+ require('../../../_baseFlatten-cjs.js');
32
+ require('../../../_setToString-cjs.js');
21
33
  require('../../../DataListContext-cjs.js');
22
34
  require('../../../noop-cjs.js');
23
- require('../../../_commonjsHelpers-cjs.js');
24
35
  require('../../../DataList.const-cjs.js');
25
36
  require('../../../AnimatedSwitcher-cjs.js');
26
37
 
@@ -16,8 +16,19 @@ import '../../../useFormFieldFocus-es.js';
16
16
  import '../../../InputValidation-es.js';
17
17
  import '../../../Spinner-es.js';
18
18
  import 'react-hook-form';
19
+ import '../../../omit-es.js';
20
+ import '../../../_commonjsHelpers-es.js';
21
+ import '../../../_baseGet-es.js';
22
+ import '../../../isTypedArray-es.js';
23
+ import '../../../isObjectLike-es.js';
24
+ import '../../../identity-es.js';
25
+ import '../../../_getTag-es.js';
26
+ import '../../../isSymbol-es.js';
27
+ import '../../../keysIn-es.js';
28
+ import '../../../_baseAssignValue-es.js';
29
+ import '../../../_baseFlatten-es.js';
30
+ import '../../../_setToString-es.js';
19
31
  import '../../../DataListContext-es.js';
20
32
  import '../../../noop-es.js';
21
- import '../../../_commonjsHelpers-es.js';
22
33
  import '../../../DataList.const-es.js';
23
34
  import '../../../AnimatedSwitcher-es.js';
@@ -81,6 +81,14 @@ require('../InputText/index.cjs');
81
81
  require('../FormField-cjs.js');
82
82
  require('../useFormFieldFocus-cjs.js');
83
83
  require('../InputValidation-cjs.js');
84
+ require('../omit-cjs.js');
85
+ require('../_baseGet-cjs.js');
86
+ require('../identity-cjs.js');
87
+ require('../isSymbol-cjs.js');
88
+ require('../keysIn-cjs.js');
89
+ require('../_baseAssignValue-cjs.js');
90
+ require('../_baseFlatten-cjs.js');
91
+ require('../_setToString-cjs.js');
84
92
  require('../DataListEmptyState-cjs.js');
85
93
  require('../DataListLoadMore-cjs.js');
86
94
  require('../DataListAction-cjs.js');
@@ -79,6 +79,14 @@ import '../InputText/index.mjs';
79
79
  import '../FormField-es.js';
80
80
  import '../useFormFieldFocus-es.js';
81
81
  import '../InputValidation-es.js';
82
+ import '../omit-es.js';
83
+ import '../_baseGet-es.js';
84
+ import '../identity-es.js';
85
+ import '../isSymbol-es.js';
86
+ import '../keysIn-es.js';
87
+ import '../_baseAssignValue-es.js';
88
+ import '../_baseFlatten-es.js';
89
+ import '../_setToString-es.js';
82
90
  import '../DataListEmptyState-es.js';
83
91
  import '../DataListLoadMore-es.js';
84
92
  import '../DataListAction-es.js';
@@ -13,12 +13,12 @@ require('../Content-cjs.js');
13
13
  require('../Select/index.cjs');
14
14
  require('../omit-cjs.js');
15
15
  require('../_commonjsHelpers-cjs.js');
16
- require('../_getAllKeys-cjs.js');
16
+ require('../_baseGet-cjs.js');
17
17
  require('../isTypedArray-cjs.js');
18
18
  require('../isObjectLike-cjs.js');
19
- require('../isSymbol-cjs.js');
20
19
  require('../identity-cjs.js');
21
20
  require('../_getTag-cjs.js');
21
+ require('../isSymbol-cjs.js');
22
22
  require('../keysIn-cjs.js');
23
23
  require('../_baseAssignValue-cjs.js');
24
24
  require('../_baseFlatten-cjs.js');
@@ -11,12 +11,12 @@ import '../Content-es.js';
11
11
  import '../Select/index.mjs';
12
12
  import '../omit-es.js';
13
13
  import '../_commonjsHelpers-es.js';
14
- import '../_getAllKeys-es.js';
14
+ import '../_baseGet-es.js';
15
15
  import '../isTypedArray-es.js';
16
16
  import '../isObjectLike-es.js';
17
- import '../isSymbol-es.js';
18
17
  import '../identity-es.js';
19
18
  import '../_getTag-es.js';
19
+ import '../isSymbol-es.js';
20
20
  import '../keysIn-es.js';
21
21
  import '../_baseAssignValue-es.js';
22
22
  import '../_baseFlatten-es.js';
@@ -16,12 +16,12 @@ require('../Icon-cjs.js');
16
16
  require('@jobber/design');
17
17
  require('../omit-cjs.js');
18
18
  require('../_commonjsHelpers-cjs.js');
19
- require('../_getAllKeys-cjs.js');
19
+ require('../_baseGet-cjs.js');
20
20
  require('../isTypedArray-cjs.js');
21
21
  require('../isObjectLike-cjs.js');
22
- require('../isSymbol-cjs.js');
23
22
  require('../identity-cjs.js');
24
23
  require('../_getTag-cjs.js');
24
+ require('../isSymbol-cjs.js');
25
25
  require('../keysIn-cjs.js');
26
26
  require('../_baseAssignValue-cjs.js');
27
27
  require('../_baseFlatten-cjs.js');
@@ -14,12 +14,12 @@ import '../Icon-es.js';
14
14
  import '@jobber/design';
15
15
  import '../omit-es.js';
16
16
  import '../_commonjsHelpers-es.js';
17
- import '../_getAllKeys-es.js';
17
+ import '../_baseGet-es.js';
18
18
  import '../isTypedArray-es.js';
19
19
  import '../isObjectLike-es.js';
20
- import '../isSymbol-es.js';
21
20
  import '../identity-es.js';
22
21
  import '../_getTag-es.js';
22
+ import '../isSymbol-es.js';
23
23
  import '../keysIn-es.js';
24
24
  import '../_baseAssignValue-es.js';
25
25
  import '../_baseFlatten-es.js';
@@ -158,6 +158,8 @@ export interface FormFieldProps extends CommonFormFieldProps {
158
158
  */
159
159
  readonly suffix?: XOR<Affix, Suffix>;
160
160
  /**
161
+ * Simplified onChange handler that only provides the new value.
162
+ * @param newValue
161
163
  * Specifies the minimum numerical or date value that a user can type
162
164
  */
163
165
  readonly min?: number;
@@ -1,12 +1,7 @@
1
1
  import type { RefObject } from "react";
2
2
  import type { FormFieldProps } from "../FormFieldTypes";
3
- export interface useFormFieldWrapperStylesProps extends Pick<FormFieldProps, "size" | "align" | "placeholder" | "value" | "invalid" | "maxLength" | "type" | "disabled" | "inline"> {
3
+ export interface useFormFieldWrapperStylesProps extends Pick<FormFieldProps, "size" | "align" | "placeholder" | "value" | "invalid" | "max" | "maxLength" | "type" | "disabled" | "inline"> {
4
4
  readonly error?: string;
5
- /**
6
- * Maximum numerical or date value
7
- * In v2 components, this is typically undefined.
8
- */
9
- readonly max?: number | string;
10
5
  suffixRef?: RefObject<HTMLDivElement>;
11
6
  prefixRef?: RefObject<HTMLDivElement>;
12
7
  showMiniLabel?: boolean;
@@ -23,7 +18,7 @@ export declare function useFormFieldWrapperStyles({ size, align, placeholder, va
23
18
  wrapperClasses: string;
24
19
  containerClasses: string;
25
20
  wrapperInlineStyle: {
26
- [x: string]: string | number | undefined;
21
+ [x: string]: number | undefined;
27
22
  };
28
23
  labelStyle: LabelPadding;
29
24
  setLabelStyle: import("react").Dispatch<import("react").SetStateAction<LabelPadding>>;
@@ -383,6 +383,7 @@ function FormField(props) {
383
383
  return React.createElement(FormFieldInternal, Object.assign({}, props, { id: id }));
384
384
  }
385
385
  function FormFieldInternal(props) {
386
+ var _a;
386
387
  const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, pattern, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
387
388
  const { name } = useAtlantisFormFieldName({ id, nameProp });
388
389
  const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } = useAtlantisReactHookForm({
@@ -429,7 +430,10 @@ function FormFieldInternal(props) {
429
430
  handleValidation,
430
431
  handleKeyDown,
431
432
  });
432
- return (React.createElement(FormFieldWrapper, Object.assign({}, props, { value: useControllerField.value, error: errorMessage, identifier: id, descriptionIdentifier: descriptionIdentifier, clearable: clearable, onClear: handleClear }), renderField()));
433
+ // Ensure focus tracking works by providing a wrapperRef when none is passed
434
+ const internalWrapperRef = React.useRef(null);
435
+ const wrapperRef = (_a = props.wrapperRef) !== null && _a !== void 0 ? _a : internalWrapperRef;
436
+ return (React.createElement(FormFieldWrapper, Object.assign({}, props, { value: useControllerField.value, error: errorMessage, identifier: id, descriptionIdentifier: descriptionIdentifier, clearable: clearable, onClear: handleClear, wrapperRef: wrapperRef }), renderField()));
433
437
  function renderField() {
434
438
  switch (type) {
435
439
  case "select":
@@ -467,6 +471,7 @@ exports.FormFieldWrapper = FormFieldWrapper;
467
471
  exports.FormFieldWrapperMain = FormFieldWrapperMain;
468
472
  exports.FormFieldWrapperToolbar = FormFieldWrapperToolbar;
469
473
  exports.mergeRefs = mergeRefs;
474
+ exports.styles = styles$1;
470
475
  exports.useAtlantisFormField = useAtlantisFormField;
471
476
  exports.useAtlantisFormFieldActions = useAtlantisFormFieldActions;
472
477
  exports.useAtlantisFormFieldName = useAtlantisFormFieldName;
@@ -381,6 +381,7 @@ function FormField(props) {
381
381
  return React__default.createElement(FormFieldInternal, Object.assign({}, props, { id: id }));
382
382
  }
383
383
  function FormFieldInternal(props) {
384
+ var _a;
384
385
  const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, pattern, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
385
386
  const { name } = useAtlantisFormFieldName({ id, nameProp });
386
387
  const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } = useAtlantisReactHookForm({
@@ -427,7 +428,10 @@ function FormFieldInternal(props) {
427
428
  handleValidation,
428
429
  handleKeyDown,
429
430
  });
430
- return (React__default.createElement(FormFieldWrapper, Object.assign({}, props, { value: useControllerField.value, error: errorMessage, identifier: id, descriptionIdentifier: descriptionIdentifier, clearable: clearable, onClear: handleClear }), renderField()));
431
+ // Ensure focus tracking works by providing a wrapperRef when none is passed
432
+ const internalWrapperRef = useRef(null);
433
+ const wrapperRef = (_a = props.wrapperRef) !== null && _a !== void 0 ? _a : internalWrapperRef;
434
+ return (React__default.createElement(FormFieldWrapper, Object.assign({}, props, { value: useControllerField.value, error: errorMessage, identifier: id, descriptionIdentifier: descriptionIdentifier, clearable: clearable, onClear: handleClear, wrapperRef: wrapperRef }), renderField()));
431
435
  function renderField() {
432
436
  switch (type) {
433
437
  case "select":
@@ -454,4 +458,4 @@ function setAutocomplete(autocompleteSetting) {
454
458
  return autocompleteSetting;
455
459
  }
456
460
 
457
- export { AffixIcon as A, FormFieldInputHorizontalWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, FormFieldInputWrapperStyles as d, FormFieldLabel as e, FormFieldWrapper as f, FormFieldWrapperMain as g, FormFieldWrapperToolbar as h, AffixLabel as i, useFormFieldWrapperStyles as j, FormField as k, FormFieldPostFix as l, mergeRefs as m, useAtlantisFormField as u };
461
+ export { AffixIcon as A, FormFieldInputHorizontalWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, FormFieldInputWrapperStyles as d, FormFieldLabel as e, FormFieldWrapper as f, FormFieldWrapperMain as g, FormFieldWrapperToolbar as h, AffixLabel as i, useFormFieldWrapperStyles as j, FormField as k, FormFieldPostFix as l, mergeRefs as m, styles$1 as s, useAtlantisFormField as u };
@@ -13,12 +13,12 @@ require('../Button-cjs.js');
13
13
  var DatePicker = require('../DatePicker-cjs.js');
14
14
  var InputText_index = require('../InputText/index.cjs');
15
15
  require('../_commonjsHelpers-cjs.js');
16
- require('../_getAllKeys-cjs.js');
16
+ require('../_baseGet-cjs.js');
17
17
  require('../isTypedArray-cjs.js');
18
18
  require('../isObjectLike-cjs.js');
19
- require('../isSymbol-cjs.js');
20
19
  require('../identity-cjs.js');
21
20
  require('../_getTag-cjs.js');
21
+ require('../isSymbol-cjs.js');
22
22
  require('../keysIn-cjs.js');
23
23
  require('../_baseAssignValue-cjs.js');
24
24
  require('../_baseFlatten-cjs.js');
@@ -79,9 +79,13 @@ function InputDate$1(inputProps) {
79
79
  } }));
80
80
  }
81
81
 
82
+ /**
83
+ * Combines the actions on the InputDate such as onChange, onFocus, onBlur to forward event handler passed to the InputDate component to the DatePicker component.
84
+ * DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
85
+ */
82
86
  function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
83
87
  const [isFocused, setIsFocused] = React.useState(false);
84
- function handleChange(_newValue, event) {
88
+ function handleChange(_, event) {
85
89
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
86
90
  }
87
91
  function handleFocus(event) {
@@ -89,8 +93,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
89
93
  setIsFocused(true);
90
94
  }
91
95
  function handleBlur(event) {
92
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
93
96
  setIsFocused(false);
97
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
94
98
  }
95
99
  return {
96
100
  handleBlur,
@@ -131,7 +135,7 @@ const InputDateRebuilt = React.forwardRef((props, forwardedRef) => {
131
135
  return (
132
136
  // We prevent the picker from opening on focus for keyboard navigation, so to maintain a good UX for mouse users we want to open the picker on click
133
137
  React.createElement("div", { onClick: onClick },
134
- React.createElement(InputText_index.InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
138
+ React.createElement(InputText_index.InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-invalid": activatorProps.ariaInvalid === "true" ? true : false, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
135
139
  var _a, _b;
136
140
  if (props.showIcon === false && event.key === "ArrowDown") {
137
141
  (_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);
@@ -11,12 +11,12 @@ import '../Button-es.js';
11
11
  import { D as DatePicker } from '../DatePicker-es.js';
12
12
  import { InputText } from '../InputText/index.mjs';
13
13
  import '../_commonjsHelpers-es.js';
14
- import '../_getAllKeys-es.js';
14
+ import '../_baseGet-es.js';
15
15
  import '../isTypedArray-es.js';
16
16
  import '../isObjectLike-es.js';
17
- import '../isSymbol-es.js';
18
17
  import '../identity-es.js';
19
18
  import '../_getTag-es.js';
19
+ import '../isSymbol-es.js';
20
20
  import '../keysIn-es.js';
21
21
  import '../_baseAssignValue-es.js';
22
22
  import '../_baseFlatten-es.js';
@@ -77,9 +77,13 @@ function InputDate$1(inputProps) {
77
77
  } }));
78
78
  }
79
79
 
80
+ /**
81
+ * Combines the actions on the InputDate such as onChange, onFocus, onBlur to forward event handler passed to the InputDate component to the DatePicker component.
82
+ * DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
83
+ */
80
84
  function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
81
85
  const [isFocused, setIsFocused] = useState(false);
82
- function handleChange(_newValue, event) {
86
+ function handleChange(_, event) {
83
87
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
84
88
  }
85
89
  function handleFocus(event) {
@@ -87,8 +91,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
87
91
  setIsFocused(true);
88
92
  }
89
93
  function handleBlur(event) {
90
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
91
94
  setIsFocused(false);
95
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
92
96
  }
93
97
  return {
94
98
  handleBlur,
@@ -129,7 +133,7 @@ const InputDateRebuilt = forwardRef((props, forwardedRef) => {
129
133
  return (
130
134
  // We prevent the picker from opening on focus for keyboard navigation, so to maintain a good UX for mouse users we want to open the picker on click
131
135
  React__default.createElement("div", { onClick: onClick },
132
- React__default.createElement(InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
136
+ React__default.createElement(InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-invalid": activatorProps.ariaInvalid === "true" ? true : false, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
133
137
  var _a, _b;
134
138
  if (props.showIcon === false && event.key === "ArrowDown") {
135
139
  (_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);
@@ -1,12 +1,16 @@
1
- import type { ChangeEvent } from "react";
1
+ import type { ChangeEvent, FocusEvent } from "react";
2
2
  import type { InputDateRebuiltProps } from "./InputDate.types";
3
3
  import type { DatePickerActivatorProps } from "../DatePicker/DatePickerActivator";
4
4
  export interface useInputDateActivatorActionsProps extends Pick<InputDateRebuiltProps, "onFocus" | "onBlur"> {
5
5
  onChange: DatePickerActivatorProps["onChange"];
6
6
  }
7
+ /**
8
+ * Combines the actions on the InputDate such as onChange, onFocus, onBlur to forward event handler passed to the InputDate component to the DatePicker component.
9
+ * DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
10
+ */
7
11
  export declare function useInputDateActivatorActions({ onChange, onBlur, onFocus, }: useInputDateActivatorActionsProps): {
8
- handleBlur: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
9
- handleChange: (_newValue: string, event?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
10
- handleFocus: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
12
+ handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
13
+ handleChange: (_: unknown, event?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
14
+ handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
11
15
  isFocused: boolean;
12
16
  };