@jobber/components 6.103.2-JOB-141426-1b49367.0 → 6.103.2-JOB-140609-8386817.45

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 +12 -1
  2. package/dist/Autocomplete/index.cjs +3 -24
  3. package/dist/Autocomplete/index.mjs +3 -24
  4. package/dist/Autocomplete/useAutocomplete.d.ts +0 -1
  5. package/dist/Checkbox/Checkbox.types.d.ts +2 -9
  6. package/dist/Checkbox/index.cjs +4 -2
  7. package/dist/Checkbox/index.mjs +4 -2
  8. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
  9. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
  10. package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
  11. package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
  12. package/dist/Chips/index.cjs +2 -2
  13. package/dist/Chips/index.mjs +2 -2
  14. package/dist/DataList/components/DataListSearch/index.cjs +1 -12
  15. package/dist/DataList/components/DataListSearch/index.mjs +1 -12
  16. package/dist/DataList/index.cjs +0 -8
  17. package/dist/DataList/index.mjs +0 -8
  18. package/dist/DataTable/index.cjs +2 -2
  19. package/dist/DataTable/index.mjs +2 -2
  20. package/dist/DatePicker/index.cjs +2 -2
  21. package/dist/DatePicker/index.mjs +2 -2
  22. package/dist/FormField/FormFieldTypes.d.ts +0 -2
  23. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +7 -2
  24. package/dist/FormField-cjs.js +0 -1
  25. package/dist/FormField-es.js +1 -1
  26. package/dist/InputDate/index.cjs +5 -9
  27. package/dist/InputDate/index.mjs +5 -9
  28. package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
  29. package/dist/InputEmail/InputEmail.types.d.ts +12 -20
  30. package/dist/InputEmail/hooks/useInputEmailActions.d.ts +1 -1
  31. package/dist/InputEmail/index.cjs +8 -44
  32. package/dist/InputEmail/index.mjs +8 -44
  33. package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +20 -3
  34. package/dist/InputNumber/index.cjs +2 -2
  35. package/dist/InputNumber/index.mjs +2 -2
  36. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +13 -27
  37. package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +1 -1
  38. package/dist/InputPhoneNumber/index.cjs +17 -34
  39. package/dist/InputPhoneNumber/index.mjs +17 -34
  40. package/dist/InputText/InputText.types.d.ts +24 -24
  41. package/dist/InputText/index.cjs +54 -54
  42. package/dist/InputText/index.mjs +55 -55
  43. package/dist/InputText/useInputTextActions.d.ts +1 -1
  44. package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
  45. package/dist/InputTime/InputTime.types.d.ts +21 -1
  46. package/dist/InputTime/hooks/useInputTimeActions.d.ts +16 -0
  47. package/dist/InputTime/index.cjs +63 -33
  48. package/dist/InputTime/index.d.ts +1 -1
  49. package/dist/InputTime/index.mjs +66 -36
  50. package/dist/List/index.cjs +2 -2
  51. package/dist/List/index.mjs +2 -2
  52. package/dist/RecurringSelect/index.cjs +2 -2
  53. package/dist/RecurringSelect/index.mjs +2 -2
  54. package/dist/Select/Select.rebuilt.d.ts +1 -1
  55. package/dist/Select/Select.types.d.ts +14 -1
  56. package/dist/Select/hooks/useSelectActions.d.ts +5 -5
  57. package/dist/Select/index.cjs +28 -41
  58. package/dist/Select/index.d.ts +7 -5
  59. package/dist/Select/index.mjs +30 -43
  60. package/dist/Tabs-es.js +1 -1
  61. package/dist/_baseEach-cjs.js +12 -12
  62. package/dist/_baseEach-es.js +1 -1
  63. package/dist/_baseFlatten-cjs.js +2 -2
  64. package/dist/_baseFlatten-es.js +1 -1
  65. package/dist/{_baseGet-cjs.js → _getAllKeys-cjs.js} +181 -181
  66. package/dist/{_baseGet-es.js → _getAllKeys-es.js} +182 -182
  67. package/dist/debounce-es.js +1 -1
  68. package/dist/index.cjs +2 -2
  69. package/dist/index.mjs +2 -2
  70. package/dist/omit-cjs.js +14 -14
  71. package/dist/omit-es.js +1 -1
  72. package/dist/sharedHelpers/types.d.ts +235 -0
  73. package/dist/useScrollToActive-cjs.js +3 -3
  74. package/dist/useScrollToActive-es.js +2 -2
  75. package/package.json +2 -2
  76. package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +0 -32
  77. package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +0 -71
  78. package/dist/InputText/useInputTextFormField.d.ts +0 -352
  79. package/dist/Select/hooks/useSelectFormField.d.ts +0 -34
@@ -1,6 +1,17 @@
1
1
  import type { CSSProperties, Key, Ref, RefObject } from "react";
2
+ import type { AriaInputProps } from "../sharedHelpers/types";
2
3
  import type { FormFieldProps } from "../FormField";
3
4
  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
+ }
4
15
  export type ExtraProps = Record<string, unknown>;
5
16
  type OptionValue = string | number;
6
17
  export interface BaseOption {
@@ -222,7 +233,7 @@ export type MenuFooter<Extra extends object = ExtraProps> = Extra & {
222
233
  };
223
234
  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>;
224
235
  export type AutocompleteValue<Value extends OptionLike, Multiple extends boolean> = Multiple extends true ? Value[] : Value | undefined;
225
- interface AutocompleteRebuiltBaseProps<Value extends OptionLike, Multiple extends boolean, SectionExtra extends object, ActionExtra extends object> {
236
+ interface AutocompleteRebuiltBaseProps<Value extends OptionLike, Multiple extends boolean, SectionExtra extends object, ActionExtra extends object> extends AriaInputPropsManaged {
226
237
  version: 2;
227
238
  /**
228
239
  * Whether the autocomplete allows multiple selections.
@@ -20,18 +20,6 @@ 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');
35
23
  require('../useFormFieldFocus-cjs.js');
36
24
  require('../InputValidation-cjs.js');
37
25
  require('../Spinner-cjs.js');
@@ -225,7 +213,6 @@ function useAutocompleteListNav({ navigableCount, shouldResetActiveIndexOnClose,
225
213
  // eslint-disable-next-line max-statements
226
214
  function useAutocomplete(props) {
227
215
  const { menu, emptyActions, getOptionLabel: getOptionLabelProp, isOptionEqualToValue, inputValue, onInputChange, value, onChange, multiple, openOnFocus = true, readOnly = false, debounce: debounceMs = 300, } = props;
228
- const isClickingWithinRef = React.useRef(false);
229
216
  // TODO: Clean up the types in these refs by enhancing the type system in useCallbackRef
230
217
  const getOptionLabelPropRef = jobberHooks.useCallbackRef((opt) => getOptionLabelProp === null || getOptionLabelProp === void 0 ? void 0 : getOptionLabelProp(opt));
231
218
  const getOptionLabel = React.useCallback((opt) => {
@@ -521,9 +508,6 @@ function useAutocomplete(props) {
521
508
  const onInputBlur = React.useCallback(() => {
522
509
  var _a, _b;
523
510
  setInputFocused(false);
524
- if (isClickingWithinRef.current) {
525
- return;
526
- }
527
511
  if (readOnly) {
528
512
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
529
513
  return;
@@ -670,7 +654,6 @@ function useAutocomplete(props) {
670
654
  activeIndex,
671
655
  setActiveIndex,
672
656
  listRef,
673
- isClickingWithinRef,
674
657
  // actions
675
658
  onSelection,
676
659
  onAction,
@@ -909,7 +892,7 @@ const AutocompleteRebuilt = React.forwardRef(AutocompleteRebuiltInternal);
909
892
  function AutocompleteRebuiltInternal(props, forwardedRef) {
910
893
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
911
894
  const { inputValue, placeholder, disabled, error, invalid, description, size: sizeProp, loading = false, } = props;
912
- const { renderable, optionCount, persistentsHeaders, persistentsFooters, headerInteractiveCount, middleNavigableCount, getOptionLabel, isOptionSelected, refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps, activeIndex, open, listRef, isClickingWithinRef, onSelection, onAction, onInputChangeFromUser, onInputBlur, onInputFocus, onInputKeyDown, setReferenceElement, } = useAutocomplete(props);
895
+ const { renderable, optionCount, persistentsHeaders, persistentsFooters, headerInteractiveCount, middleNavigableCount, getOptionLabel, isOptionSelected, refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps, activeIndex, open, listRef, onSelection, onAction, onInputChangeFromUser, onInputBlur, onInputFocus, onInputKeyDown, setReferenceElement, } = useAutocomplete(props);
913
896
  const listboxId = React.useId();
914
897
  // Provides mount/unmount-aware transition styles for the floating element
915
898
  const { isMounted, styles: transitionStyles } = floatingUi_react.useTransitionStyles(context, {
@@ -926,7 +909,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
926
909
  onBlur: onInputBlur,
927
910
  });
928
911
  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,
929
- 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
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
930
913
  ? `${listboxId}-item-${activeIndex}`
931
914
  : undefined });
932
915
  const referenceInputRef = (node) => {
@@ -967,11 +950,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
967
950
  style: Object.assign(Object.assign(Object.assign(Object.assign({}, floatingStyles), transitionStyles), (_b = props.UNSAFE_styles) === null || _b === void 0 ? void 0 : _b.menu), (menuWidth
968
951
  ? { width: menuWidth, maxWidth: menuWidth }
969
952
  : {})),
970
- }), { onPointerDown: () => {
971
- isClickingWithinRef.current = true;
972
- }, onPointerUp: () => {
973
- isClickingWithinRef.current = false;
974
- } }),
953
+ })),
975
954
  React.createElement(PersistentRegion, { items: persistentsHeaders, position: "header", activeIndex: activeIndex, indexOffset: 0, listboxId: listboxId, getItemProps: getItemProps, listRef: listRef, customRenderHeader: props.customRenderHeader, customRenderFooter: props.customRenderFooter, onAction: onAction, className: classnames(styles$1.persistentHeader, (_c = props.UNSAFE_className) === null || _c === void 0 ? void 0 : _c.header), style: (_d = props.UNSAFE_styles) === null || _d === void 0 ? void 0 : _d.header }),
976
955
  React.createElement("div", { className: styles$1.scrollRegion }, loading ? ((_e = props.customRenderLoading) !== null && _e !== void 0 ? _e : React.createElement(LoadingContent, null)) : (React.createElement(React.Fragment, null,
977
956
  showEmptyStateMessage && (React.createElement(EmptyStateMessage, { emptyState: props.emptyStateMessage })),
@@ -18,18 +18,6 @@ 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';
33
21
  import '../useFormFieldFocus-es.js';
34
22
  import '../InputValidation-es.js';
35
23
  import '../Spinner-es.js';
@@ -223,7 +211,6 @@ function useAutocompleteListNav({ navigableCount, shouldResetActiveIndexOnClose,
223
211
  // eslint-disable-next-line max-statements
224
212
  function useAutocomplete(props) {
225
213
  const { menu, emptyActions, getOptionLabel: getOptionLabelProp, isOptionEqualToValue, inputValue, onInputChange, value, onChange, multiple, openOnFocus = true, readOnly = false, debounce: debounceMs = 300, } = props;
226
- const isClickingWithinRef = useRef(false);
227
214
  // TODO: Clean up the types in these refs by enhancing the type system in useCallbackRef
228
215
  const getOptionLabelPropRef = useCallbackRef((opt) => getOptionLabelProp === null || getOptionLabelProp === void 0 ? void 0 : getOptionLabelProp(opt));
229
216
  const getOptionLabel = useCallback((opt) => {
@@ -519,9 +506,6 @@ function useAutocomplete(props) {
519
506
  const onInputBlur = useCallback(() => {
520
507
  var _a, _b;
521
508
  setInputFocused(false);
522
- if (isClickingWithinRef.current) {
523
- return;
524
- }
525
509
  if (readOnly) {
526
510
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
527
511
  return;
@@ -668,7 +652,6 @@ function useAutocomplete(props) {
668
652
  activeIndex,
669
653
  setActiveIndex,
670
654
  listRef,
671
- isClickingWithinRef,
672
655
  // actions
673
656
  onSelection,
674
657
  onAction,
@@ -907,7 +890,7 @@ const AutocompleteRebuilt = forwardRef(AutocompleteRebuiltInternal);
907
890
  function AutocompleteRebuiltInternal(props, forwardedRef) {
908
891
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
909
892
  const { inputValue, placeholder, disabled, error, invalid, description, size: sizeProp, loading = false, } = props;
910
- const { renderable, optionCount, persistentsHeaders, persistentsFooters, headerInteractiveCount, middleNavigableCount, getOptionLabel, isOptionSelected, refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps, activeIndex, open, listRef, isClickingWithinRef, onSelection, onAction, onInputChangeFromUser, onInputBlur, onInputFocus, onInputKeyDown, setReferenceElement, } = useAutocomplete(props);
893
+ const { renderable, optionCount, persistentsHeaders, persistentsFooters, headerInteractiveCount, middleNavigableCount, getOptionLabel, isOptionSelected, refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps, activeIndex, open, listRef, onSelection, onAction, onInputChangeFromUser, onInputBlur, onInputFocus, onInputKeyDown, setReferenceElement, } = useAutocomplete(props);
911
894
  const listboxId = React__default.useId();
912
895
  // Provides mount/unmount-aware transition styles for the floating element
913
896
  const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
@@ -924,7 +907,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
924
907
  onBlur: onInputBlur,
925
908
  });
926
909
  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,
927
- 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
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
928
911
  ? `${listboxId}-item-${activeIndex}`
929
912
  : undefined });
930
913
  const referenceInputRef = (node) => {
@@ -965,11 +948,7 @@ function AutocompleteRebuiltInternal(props, forwardedRef) {
965
948
  style: Object.assign(Object.assign(Object.assign(Object.assign({}, floatingStyles), transitionStyles), (_b = props.UNSAFE_styles) === null || _b === void 0 ? void 0 : _b.menu), (menuWidth
966
949
  ? { width: menuWidth, maxWidth: menuWidth }
967
950
  : {})),
968
- }), { onPointerDown: () => {
969
- isClickingWithinRef.current = true;
970
- }, onPointerUp: () => {
971
- isClickingWithinRef.current = false;
972
- } }),
951
+ })),
973
952
  React__default.createElement(PersistentRegion, { items: persistentsHeaders, position: "header", activeIndex: activeIndex, indexOffset: 0, listboxId: listboxId, getItemProps: getItemProps, listRef: listRef, customRenderHeader: props.customRenderHeader, customRenderFooter: props.customRenderFooter, onAction: onAction, className: classnames(styles$1.persistentHeader, (_c = props.UNSAFE_className) === null || _c === void 0 ? void 0 : _c.header), style: (_d = props.UNSAFE_styles) === null || _d === void 0 ? void 0 : _d.header }),
974
953
  React__default.createElement("div", { className: styles$1.scrollRegion }, loading ? ((_e = props.customRenderLoading) !== null && _e !== void 0 ? _e : React__default.createElement(LoadingContent, null)) : (React__default.createElement(React__default.Fragment, null,
975
954
  showEmptyStateMessage && (React__default.createElement(EmptyStateMessage, { emptyState: props.emptyStateMessage })),
@@ -56,7 +56,6 @@ export declare function useAutocomplete<Value extends OptionLike, Multiple exten
56
56
  activeIndex: number | null;
57
57
  setActiveIndex: (index: number | null) => void;
58
58
  listRef: React.MutableRefObject<(HTMLElement | null)[]>;
59
- isClickingWithinRef: React.MutableRefObject<boolean>;
60
59
  onSelection: (option: Value) => void;
61
60
  onAction: (action: ActionConfig) => void;
62
61
  onInputChangeFromUser: (val: string) => void;
@@ -1,6 +1,7 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  import type { XOR } from "ts-xor";
3
- export interface BaseCheckboxProps {
3
+ import type { AriaInputProps, FocusEvents } from "../sharedHelpers/types";
4
+ export interface BaseCheckboxProps extends AriaInputProps, FocusEvents<HTMLInputElement> {
4
5
  /**
5
6
  * Determines if the checkbox is checked or not.
6
7
  */
@@ -41,14 +42,6 @@ export interface BaseCheckboxProps {
41
42
  * Called when the checkbox value changes
42
43
  */
43
44
  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;
52
45
  /**
53
46
  * Whether the checkbox is invalid
54
47
  */
@@ -54,9 +54,10 @@ 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, }, ref) {
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) {
58
58
  const descriptionIdentifier = React.useId();
59
59
  const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled, invalid && styles.invalid);
60
+ const isInvalid = Boolean(invalid);
60
61
  const inputClassName = classnames(styles.input, {
61
62
  [styles.indeterminate]: indeterminate,
62
63
  });
@@ -70,7 +71,8 @@ const CheckboxRebuilt = React.forwardRef(function CheckboxRebuiltInternal({ chec
70
71
  return (React.createElement("div", { className: styles.checkBoxParent },
71
72
  React.createElement("label", { className: wrapperClassName },
72
73
  React.createElement("span", { className: styles.checkHolder },
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 }),
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 }),
74
76
  React.createElement("span", { className: styles.checkBox },
75
77
  React.createElement(Icon.Icon, { name: iconName, color: "surface" }))),
76
78
  labelContent && React.createElement("span", { className: styles.label }, labelContent)),
@@ -52,9 +52,10 @@ 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, }, ref) {
55
+ const CheckboxRebuilt = forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, ariaLabel, ariaDescribedBy, ariaRequired, }, ref) {
56
56
  const descriptionIdentifier = useId();
57
57
  const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled, invalid && styles.invalid);
58
+ const isInvalid = Boolean(invalid);
58
59
  const inputClassName = classnames(styles.input, {
59
60
  [styles.indeterminate]: indeterminate,
60
61
  });
@@ -68,7 +69,8 @@ const CheckboxRebuilt = forwardRef(function CheckboxRebuiltInternal({ checked, d
68
69
  return (React__default.createElement("div", { className: styles.checkBoxParent },
69
70
  React__default.createElement("label", { className: wrapperClassName },
70
71
  React__default.createElement("span", { className: styles.checkHolder },
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 }),
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 }),
72
74
  React__default.createElement("span", { className: styles.checkBox },
73
75
  React__default.createElement(Icon, { name: iconName, color: "surface" }))),
74
76
  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('../../../_baseGet-cjs.js');
7
+ require('../../../_getAllKeys-cjs.js');
8
8
  require('../../../isTypedArray-cjs.js');
9
9
  require('../../../isObjectLike-cjs.js');
10
+ require('../../../isSymbol-cjs.js');
10
11
  require('../../../identity-cjs.js');
11
12
  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 '../../../_baseGet-es.js';
5
+ import '../../../_getAllKeys-es.js';
6
6
  import '../../../isTypedArray-es.js';
7
7
  import '../../../isObjectLike-es.js';
8
+ import '../../../isSymbol-es.js';
8
9
  import '../../../identity-es.js';
9
10
  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('../../_baseGet-cjs.js');
8
+ require('../../_getAllKeys-cjs.js');
9
9
  require('../../isTypedArray-cjs.js');
10
10
  require('../../isObjectLike-cjs.js');
11
+ require('../../isSymbol-cjs.js');
11
12
  require('../../identity-cjs.js');
12
13
  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 '../../_baseGet-es.js';
6
+ import '../../_getAllKeys-es.js';
7
7
  import '../../isTypedArray-es.js';
8
8
  import '../../isObjectLike-es.js';
9
+ import '../../isSymbol-es.js';
9
10
  import '../../identity-es.js';
10
11
  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('../_baseGet-cjs.js');
10
+ require('../_getAllKeys-cjs.js');
11
11
  require('../isTypedArray-cjs.js');
12
12
  require('../isObjectLike-cjs.js');
13
+ require('../isSymbol-cjs.js');
13
14
  require('../identity-cjs.js');
14
15
  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 '../_baseGet-es.js';
8
+ import '../_getAllKeys-es.js';
9
9
  import '../isTypedArray-es.js';
10
10
  import '../isObjectLike-es.js';
11
+ import '../isSymbol-es.js';
11
12
  import '../identity-es.js';
12
13
  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,20 +18,9 @@ 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');
33
21
  require('../../../DataListContext-cjs.js');
34
22
  require('../../../noop-cjs.js');
23
+ require('../../../_commonjsHelpers-cjs.js');
35
24
  require('../../../DataList.const-cjs.js');
36
25
  require('../../../AnimatedSwitcher-cjs.js');
37
26
 
@@ -16,19 +16,8 @@ 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';
31
19
  import '../../../DataListContext-es.js';
32
20
  import '../../../noop-es.js';
21
+ import '../../../_commonjsHelpers-es.js';
33
22
  import '../../../DataList.const-es.js';
34
23
  import '../../../AnimatedSwitcher-es.js';
@@ -81,14 +81,6 @@ 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');
92
84
  require('../DataListEmptyState-cjs.js');
93
85
  require('../DataListLoadMore-cjs.js');
94
86
  require('../DataListAction-cjs.js');
@@ -79,14 +79,6 @@ 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';
90
82
  import '../DataListEmptyState-es.js';
91
83
  import '../DataListLoadMore-es.js';
92
84
  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('../_baseGet-cjs.js');
16
+ require('../_getAllKeys-cjs.js');
17
17
  require('../isTypedArray-cjs.js');
18
18
  require('../isObjectLike-cjs.js');
19
+ require('../isSymbol-cjs.js');
19
20
  require('../identity-cjs.js');
20
21
  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 '../_baseGet-es.js';
14
+ import '../_getAllKeys-es.js';
15
15
  import '../isTypedArray-es.js';
16
16
  import '../isObjectLike-es.js';
17
+ import '../isSymbol-es.js';
17
18
  import '../identity-es.js';
18
19
  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('../_baseGet-cjs.js');
19
+ require('../_getAllKeys-cjs.js');
20
20
  require('../isTypedArray-cjs.js');
21
21
  require('../isObjectLike-cjs.js');
22
+ require('../isSymbol-cjs.js');
22
23
  require('../identity-cjs.js');
23
24
  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 '../_baseGet-es.js';
17
+ import '../_getAllKeys-es.js';
18
18
  import '../isTypedArray-es.js';
19
19
  import '../isObjectLike-es.js';
20
+ import '../isSymbol-es.js';
20
21
  import '../identity-es.js';
21
22
  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,8 +158,6 @@ 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
163
161
  * Specifies the minimum numerical or date value that a user can type
164
162
  */
165
163
  readonly min?: number;
@@ -1,7 +1,12 @@
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" | "max" | "maxLength" | "type" | "disabled" | "inline"> {
3
+ export interface useFormFieldWrapperStylesProps extends Pick<FormFieldProps, "size" | "align" | "placeholder" | "value" | "invalid" | "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;
5
10
  suffixRef?: RefObject<HTMLDivElement>;
6
11
  prefixRef?: RefObject<HTMLDivElement>;
7
12
  showMiniLabel?: boolean;
@@ -18,7 +23,7 @@ export declare function useFormFieldWrapperStyles({ size, align, placeholder, va
18
23
  wrapperClasses: string;
19
24
  containerClasses: string;
20
25
  wrapperInlineStyle: {
21
- [x: string]: number | undefined;
26
+ [x: string]: string | number | undefined;
22
27
  };
23
28
  labelStyle: LabelPadding;
24
29
  setLabelStyle: import("react").Dispatch<import("react").SetStateAction<LabelPadding>>;
@@ -467,7 +467,6 @@ exports.FormFieldWrapper = FormFieldWrapper;
467
467
  exports.FormFieldWrapperMain = FormFieldWrapperMain;
468
468
  exports.FormFieldWrapperToolbar = FormFieldWrapperToolbar;
469
469
  exports.mergeRefs = mergeRefs;
470
- exports.styles = styles$1;
471
470
  exports.useAtlantisFormField = useAtlantisFormField;
472
471
  exports.useAtlantisFormFieldActions = useAtlantisFormFieldActions;
473
472
  exports.useAtlantisFormFieldName = useAtlantisFormFieldName;
@@ -454,4 +454,4 @@ function setAutocomplete(autocompleteSetting) {
454
454
  return autocompleteSetting;
455
455
  }
456
456
 
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, styles$1 as s, useAtlantisFormField as u };
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 };
@@ -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('../_baseGet-cjs.js');
16
+ require('../_getAllKeys-cjs.js');
17
17
  require('../isTypedArray-cjs.js');
18
18
  require('../isObjectLike-cjs.js');
19
+ require('../isSymbol-cjs.js');
19
20
  require('../identity-cjs.js');
20
21
  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,13 +79,9 @@ 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
- */
86
82
  function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
87
83
  const [isFocused, setIsFocused] = React.useState(false);
88
- function handleChange(_, event) {
84
+ function handleChange(_newValue, event) {
89
85
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
90
86
  }
91
87
  function handleFocus(event) {
@@ -93,8 +89,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
93
89
  setIsFocused(true);
94
90
  }
95
91
  function handleBlur(event) {
96
- setIsFocused(false);
97
92
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
93
+ setIsFocused(false);
98
94
  }
99
95
  return {
100
96
  handleBlur,
@@ -135,7 +131,7 @@ const InputDateRebuilt = React.forwardRef((props, forwardedRef) => {
135
131
  return (
136
132
  // 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
137
133
  React.createElement("div", { onClick: onClick },
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 => {
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 => {
139
135
  var _a, _b;
140
136
  if (props.showIcon === false && event.key === "ArrowDown") {
141
137
  (_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);