@jobber/components 6.101.4 → 6.101.5-JOB-140604-4487daa.55

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 (177) hide show
  1. package/dist/Autocomplete/Autocomplete.types.d.ts +11 -51
  2. package/dist/Autocomplete/components/MenuList.d.ts +3 -2
  3. package/dist/Autocomplete/components/PersistentRegion.d.ts +3 -2
  4. package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +3 -2
  5. package/dist/Autocomplete/index.cjs +95 -51
  6. package/dist/Autocomplete/index.mjs +97 -53
  7. package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +14 -1
  8. package/dist/Autocomplete/useAutocomplete.d.ts +4 -3
  9. package/dist/Autocomplete/utils/interactionUtils.d.ts +14 -0
  10. package/dist/Card-cjs.js +1 -1
  11. package/dist/Card-es.js +1 -1
  12. package/dist/Checkbox/Checkbox.rebuilt.d.ts +2 -2
  13. package/dist/Checkbox/Checkbox.types.d.ts +24 -18
  14. package/dist/Checkbox/index.cjs +9 -2
  15. package/dist/Checkbox/index.mjs +9 -2
  16. package/dist/Chip/Chip.d.ts +1 -2
  17. package/dist/Chip/hooks/useChildComponent.d.ts +4 -3
  18. package/dist/Chip/index.cjs +1 -1
  19. package/dist/Chip-cjs.js +5 -4
  20. package/dist/Chip-es.js +5 -4
  21. package/dist/ChipDismissible-cjs.js +4 -4
  22. package/dist/ChipDismissible-es.js +5 -5
  23. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
  24. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
  25. package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +1 -1
  26. package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +1 -1
  27. package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +1 -1
  28. package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
  29. package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
  30. package/dist/Chips/index.cjs +2 -2
  31. package/dist/Chips/index.mjs +2 -2
  32. package/dist/Combobox/Combobox.d.ts +2 -1
  33. package/dist/Combobox/Combobox.types.d.ts +2 -2
  34. package/dist/Combobox/ComboboxProvider.d.ts +3 -3
  35. package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +1 -1
  36. package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +2 -1
  37. package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +2 -1
  38. package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +2 -1
  39. package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +2 -1
  40. package/dist/Combobox/hooks/useCombobox.d.ts +1 -1
  41. package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +2 -2
  42. package/dist/Combobox/hooks/useComboboxContent.d.ts +2 -1
  43. package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +1 -1
  44. package/dist/ComboboxActivator-cjs.js +2 -2
  45. package/dist/ComboboxActivator-es.js +3 -3
  46. package/dist/ComboboxTrigger-cjs.js +1 -1
  47. package/dist/ComboboxTrigger-es.js +2 -2
  48. package/dist/DataList/DataList.types.d.ts +2 -2
  49. package/dist/DataList/DataList.utils.d.ts +2 -2
  50. package/dist/DataList/components/DataListHeader/index.cjs +1 -0
  51. package/dist/DataList/components/DataListHeader/index.mjs +1 -0
  52. package/dist/DataList/components/DataListHeaderTile/components/DataListSortingOptions.d.ts +2 -2
  53. package/dist/DataList/components/DataListItem/DataListItemInternal.d.ts +2 -2
  54. package/dist/DataList/components/DataListItem/index.cjs +1 -0
  55. package/dist/DataList/components/DataListItem/index.mjs +1 -0
  56. package/dist/DataList/components/DataListItems/index.cjs +1 -0
  57. package/dist/DataList/components/DataListItems/index.mjs +1 -0
  58. package/dist/DataList/components/DataListLayout/index.cjs +1 -0
  59. package/dist/DataList/components/DataListLayout/index.mjs +1 -0
  60. package/dist/DataList/components/DataListSearch/index.cjs +2 -12
  61. package/dist/DataList/components/DataListSearch/index.mjs +2 -12
  62. package/dist/DataList/hooks/useGetItemActions.d.ts +1 -1
  63. package/dist/DataList/index.cjs +1 -8
  64. package/dist/DataList/index.mjs +1 -8
  65. package/dist/DataListActions-cjs.js +4 -2
  66. package/dist/DataListActions-es.js +4 -2
  67. package/dist/DataListItem-cjs.js +8 -7
  68. package/dist/DataListItem-es.js +9 -8
  69. package/dist/DataListSort-cjs.js +1 -1
  70. package/dist/DataListSort-es.js +2 -2
  71. package/dist/DataTable/SortIcon.d.ts +2 -1
  72. package/dist/DataTable/components/DataTableSortableHeader.d.ts +1 -1
  73. package/dist/DataTable/index.cjs +3 -2
  74. package/dist/DataTable/index.mjs +3 -2
  75. package/dist/DatePicker/DatePicker.d.ts +5 -1
  76. package/dist/DatePicker/index.cjs +2 -2
  77. package/dist/DatePicker/index.mjs +2 -2
  78. package/dist/DatePicker/useFocusOnSelectedDate.d.ts +1 -2
  79. package/dist/DatePicker-cjs.js +4 -2
  80. package/dist/DatePicker-es.js +5 -3
  81. package/dist/FormField/FormFieldAffix.d.ts +2 -2
  82. package/dist/FormField/FormFieldTypes.d.ts +3 -5
  83. package/dist/FormField/FormFieldWrapper.d.ts +5 -1
  84. package/dist/FormField/hooks/useFormFieldFocus.d.ts +1 -1
  85. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +9 -4
  86. package/dist/FormField-cjs.js +35 -31
  87. package/dist/FormField-es.js +35 -31
  88. package/dist/InputDate/InputDate.types.d.ts +12 -7
  89. package/dist/InputDate/index.cjs +35 -12
  90. package/dist/InputDate/index.mjs +35 -12
  91. package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
  92. package/dist/InputEmail/InputEmail.types.d.ts +10 -20
  93. package/dist/InputEmail/hooks/useInputEmailActions.d.ts +10 -4
  94. package/dist/InputEmail/index.cjs +43 -60
  95. package/dist/InputEmail/index.mjs +44 -61
  96. package/dist/InputFile-cjs.js +5 -2
  97. package/dist/InputFile-es.js +5 -2
  98. package/dist/InputGroup-cjs.js +5 -2
  99. package/dist/InputGroup-es.js +5 -2
  100. package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +7 -15
  101. package/dist/InputNumber/index.cjs +7 -5
  102. package/dist/InputNumber/index.mjs +7 -5
  103. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +12 -28
  104. package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +9 -4
  105. package/dist/InputPhoneNumber/index.cjs +37 -36
  106. package/dist/InputPhoneNumber/index.mjs +38 -37
  107. package/dist/InputText/InputText.d.ts +2 -2
  108. package/dist/InputText/InputText.types.d.ts +30 -25
  109. package/dist/InputText/index.cjs +54 -62
  110. package/dist/InputText/index.mjs +55 -63
  111. package/dist/InputText/useInputTextActions.d.ts +11 -5
  112. package/dist/InputText/useTextAreaResize.d.ts +2 -2
  113. package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
  114. package/dist/InputTime/InputTime.types.d.ts +13 -4
  115. package/dist/InputTime/hooks/useInputTimeActions.d.ts +21 -0
  116. package/dist/InputTime/index.cjs +90 -30
  117. package/dist/InputTime/index.mjs +93 -33
  118. package/dist/InternalChipDismissible-cjs.js +3 -3
  119. package/dist/InternalChipDismissible-es.js +4 -4
  120. package/dist/List/index.cjs +2 -2
  121. package/dist/List/index.mjs +2 -2
  122. package/dist/Menu/Menu.d.ts +2 -4
  123. package/dist/Menu/Menu.types.d.ts +21 -5
  124. package/dist/Menu-cjs.js +9 -9
  125. package/dist/Menu-es.js +9 -9
  126. package/dist/Modal/Modal.types.d.ts +3 -3
  127. package/dist/Modal/ModalContext.rebuilt.d.ts +2 -2
  128. package/dist/MultiSelect/DropDownMenu.d.ts +1 -1
  129. package/dist/MultiSelect/index.cjs +1 -0
  130. package/dist/MultiSelect/index.mjs +1 -0
  131. package/dist/MultiSelect-cjs.js +13 -7
  132. package/dist/MultiSelect-es.js +13 -7
  133. package/dist/RadioGroup/RadioGroup.d.ts +2 -1
  134. package/dist/RadioGroup/RadioOption.d.ts +1 -1
  135. package/dist/RecurringSelect/index.cjs +3 -2
  136. package/dist/RecurringSelect/index.mjs +3 -2
  137. package/dist/Select/Select.types.d.ts +7 -3
  138. package/dist/Select/hooks/useSelectActions.d.ts +5 -5
  139. package/dist/Select/index.cjs +27 -42
  140. package/dist/Select/index.mjs +29 -44
  141. package/dist/StatusLabel/StatusLabel.d.ts +2 -1
  142. package/dist/Tabs/hooks/useTabsOverflow.d.ts +2 -2
  143. package/dist/Tabs-cjs.js +4 -2
  144. package/dist/Tabs-es.js +5 -3
  145. package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
  146. package/dist/_baseEach-cjs.js +12 -12
  147. package/dist/_baseEach-es.js +1 -1
  148. package/dist/_baseFlatten-cjs.js +2 -2
  149. package/dist/_baseFlatten-es.js +1 -1
  150. package/dist/{_baseGet-cjs.js → _getAllKeys-cjs.js} +181 -181
  151. package/dist/{_baseGet-es.js → _getAllKeys-es.js} +182 -182
  152. package/dist/debounce-es.js +1 -1
  153. package/dist/filterDataAttributes-cjs.js +26 -0
  154. package/dist/filterDataAttributes-es.js +24 -0
  155. package/dist/floating-ui.react-cjs.js +115 -0
  156. package/dist/floating-ui.react-es.js +115 -1
  157. package/dist/helpers-cjs.js +1 -1
  158. package/dist/helpers-es.js +1 -1
  159. package/dist/index.cjs +4 -3
  160. package/dist/index.mjs +3 -2
  161. package/dist/omit-cjs.js +14 -14
  162. package/dist/omit-es.js +1 -1
  163. package/dist/sharedHelpers/filterDataAttributes.d.ts +17 -0
  164. package/dist/sharedHelpers/types.d.ts +231 -0
  165. package/dist/showToast-cjs.js +2 -2
  166. package/dist/showToast-es.js +2 -2
  167. package/dist/styles.css +32 -23
  168. package/dist/useChildComponent-cjs.js +1 -1
  169. package/dist/useChildComponent-es.js +1 -1
  170. package/dist/useScrollToActive-cjs.js +3 -3
  171. package/dist/useScrollToActive-es.js +2 -2
  172. package/dist/utils/mergeRefs.d.ts +2 -2
  173. package/package.json +2 -2
  174. package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +0 -32
  175. package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +0 -71
  176. package/dist/InputText/useInputTextFormField.d.ts +0 -352
  177. package/dist/Select/hooks/useSelectFormField.d.ts +0 -34
@@ -14,22 +14,22 @@ var Spinner = require('./Spinner-cjs.js');
14
14
  var tslib_es6 = require('./tslib.es6-cjs.js');
15
15
  var reactHookForm = require('react-hook-form');
16
16
 
17
- var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
17
+ var formFieldStyles = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
18
18
 
19
19
  /**
20
20
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
21
21
  */
22
22
  function AffixLabel({ label, variation = "prefix", labelRef, }) {
23
- const affixLabelClass = classnames(styles$1.affixLabel, {
24
- [styles$1.suffix]: variation === "suffix",
23
+ const affixLabelClass = classnames(formFieldStyles.affixLabel, {
24
+ [formFieldStyles.suffix]: variation === "suffix",
25
25
  });
26
26
  if (!label)
27
27
  return null;
28
28
  return (React.createElement("div", { ref: labelRef, className: affixLabelClass }, label));
29
29
  }
30
30
  function AffixIcon({ icon, onClick, ariaLabel, variation = "prefix", size, }) {
31
- const affixIconClass = classnames(styles$1.affixIcon, {
32
- [styles$1.suffix]: variation === "suffix",
31
+ const affixIconClass = classnames(formFieldStyles.affixIcon, {
32
+ [formFieldStyles.suffix]: variation === "suffix",
33
33
  });
34
34
  const iconSize = size === "small" ? "small" : "base";
35
35
  if (!icon)
@@ -51,7 +51,7 @@ function FormFieldDescription({ id, description, visible = true, }) {
51
51
  if (!visible)
52
52
  return null;
53
53
  const useStringFormat = !description || typeof description === "string";
54
- return (React.createElement("div", { id: id, className: styles$1.description }, useStringFormat ? (React.createElement(Text.Text, { size: "small", variation: "subdued" }, description)) : (description)));
54
+ return (React.createElement("div", { id: id, className: formFieldStyles.description }, useStringFormat ? (React.createElement(Text.Text, { size: "small", variation: "subdued" }, description)) : (description)));
55
55
  }
56
56
 
57
57
  var styles = {"clearInput":"YmRTd-KeXv4-","spinning":"B25z9B8I3gs-"};
@@ -86,22 +86,22 @@ function useIsSafari() {
86
86
  */
87
87
  function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, error, max, prefixRef, suffixRef, maxLength, type, disabled, inline, showMiniLabel = true, }) {
88
88
  const isSafari = useIsSafari();
89
- const wrapperClasses = classnames(styles$1.wrapper, size && styles$1[size], align && styles$1[align], {
90
- [styles$1.miniLabel]: (showMiniLabel && placeholder && value !== "") ||
89
+ const wrapperClasses = classnames(formFieldStyles.wrapper, size && formFieldStyles[size], align && formFieldStyles[align], {
90
+ [formFieldStyles.miniLabel]: (showMiniLabel && placeholder && value !== "") ||
91
91
  (placeholder && type === "select") ||
92
92
  // Naively assume that if the the type is tel, it is the InputPhoneNumber
93
93
  (placeholder && type === "tel"),
94
- [styles$1.text]: type === "textarea" || type === "text",
95
- [styles$1.textarea]: type === "textarea",
96
- [styles$1.safari]: isSafari && type === "textarea",
97
- [styles$1.select]: type === "select",
98
- [styles$1.invalid]: invalid !== null && invalid !== void 0 ? invalid : error,
99
- [styles$1.disabled]: disabled,
100
- [styles$1.maxLength]: maxLength,
101
- [styles$1.timeInputLabel]: placeholder && type === "time" && placeholder && value === "",
94
+ [formFieldStyles.text]: type === "textarea" || type === "text",
95
+ [formFieldStyles.textarea]: type === "textarea",
96
+ [formFieldStyles.safari]: isSafari && type === "textarea",
97
+ [formFieldStyles.select]: type === "select",
98
+ [formFieldStyles.invalid]: invalid !== null && invalid !== void 0 ? invalid : error,
99
+ [formFieldStyles.disabled]: disabled,
100
+ [formFieldStyles.maxLength]: maxLength,
101
+ [formFieldStyles.timeInputLabel]: placeholder && type === "time" && placeholder && value === "",
102
102
  });
103
- const containerClasses = classnames(styles$1.container, {
104
- [styles$1.inline]: inline,
103
+ const containerClasses = classnames(formFieldStyles.container, {
104
+ [formFieldStyles.inline]: inline,
105
105
  });
106
106
  const wrapperInlineStyle = {
107
107
  ["--formField-maxLength"]: maxLength || max,
@@ -120,7 +120,7 @@ function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, e
120
120
  }));
121
121
  }, [value]);
122
122
  return {
123
- inputStyle: styles$1.input,
123
+ inputStyle: formFieldStyles.input,
124
124
  wrapperClasses,
125
125
  containerClasses,
126
126
  wrapperInlineStyle,
@@ -150,8 +150,8 @@ function getAffixPaddding({ value, type, prefixWidth, suffixWidth, }) {
150
150
  }
151
151
 
152
152
  function FormFieldWrapper({ align, description, descriptionIdentifier, placeholder, value, children, invalid, error, size, prefix, suffix, max, maxLength, type, disabled, inline, identifier, clearable, onClear, readonly, toolbar, toolbarVisibility = "while-editing", showMiniLabel = true, wrapperRef, }) {
153
- const prefixRef = React.useRef();
154
- const suffixRef = React.useRef();
153
+ const prefixRef = React.useRef(null);
154
+ const suffixRef = React.useRef(null);
155
155
  const { wrapperClasses, containerClasses, wrapperInlineStyle, labelStyle } = useFormFieldWrapperStyles({
156
156
  align,
157
157
  max,
@@ -203,24 +203,24 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
203
203
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
204
204
  */
205
205
  function FormFieldInputHorizontalWrapper({ children, }) {
206
- return React.createElement("div", { className: styles$1.horizontalWrapper }, children);
206
+ return React.createElement("div", { className: formFieldStyles.horizontalWrapper }, children);
207
207
  }
208
208
  /**
209
209
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
210
210
  */
211
211
  function FormFieldInputWrapperStyles({ children, }) {
212
- return React.createElement("div", { className: styles$1.inputWrapper }, children);
212
+ return React.createElement("div", { className: formFieldStyles.inputWrapper }, children);
213
213
  }
214
214
  /**
215
215
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
216
216
  */
217
217
  function FormFieldWrapperMain({ children, tabIndex = -1, }) {
218
- return (React.createElement("div", { className: styles$1.childrenWrapper, tabIndex: tabIndex }, children));
218
+ return (React.createElement("div", { className: formFieldStyles.childrenWrapper, tabIndex: tabIndex }, children));
219
219
  }
220
220
  function FormFieldLabel({ children, htmlFor, style, external = false, }) {
221
221
  if (!children)
222
222
  return null;
223
- return (React.createElement("label", { className: external ? styles$1.externalLabel : styles$1.label, htmlFor: htmlFor, style: style }, children));
223
+ return (React.createElement("label", { className: external ? formFieldStyles.externalLabel : formFieldStyles.label, htmlFor: htmlFor, style: style }, children));
224
224
  }
225
225
  /**
226
226
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
@@ -230,13 +230,13 @@ function FormFieldWrapperToolbar({ toolbar, isToolbarVisible, toolbarAnimationEn
230
230
  duration: design.tokens["timing-base"] / 1000,
231
231
  ease: "easeInOut",
232
232
  }, tabIndex: -1 },
233
- React.createElement("div", { className: styles$1.toolbar, "data-testid": "ATL-InputText-Toolbar" }, toolbar)))));
233
+ React.createElement("div", { className: formFieldStyles.toolbar, "data-testid": "ATL-InputText-Toolbar" }, toolbar)))));
234
234
  }
235
235
 
236
236
  function FormFieldPostFix({ variation, visible = true, className, }) {
237
237
  if (!visible)
238
238
  return null;
239
- return (React.createElement("span", { className: classnames(styles$1.postfix, className) }, variation === "select" ? (React.createElement(Icon.Icon, { name: "arrowDown" })) : (React.createElement(Spinner.Spinner, { size: "small" }))));
239
+ return (React.createElement("span", { className: classnames(formFieldStyles.postfix, className) }, variation === "select" ? (React.createElement(Icon.Icon, { name: "arrowDown" })) : (React.createElement(Spinner.Spinner, { size: "small" }))));
240
240
  }
241
241
 
242
242
  /**
@@ -299,8 +299,8 @@ function useAtlantisFormFieldActions({ name, onChange, inputRef, onControllerCha
299
299
  */
300
300
  function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
301
301
  const descriptionIdentifier = `descriptionUUID--${id}`;
302
- const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(styles$1.input, {
303
- [styles$1.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
302
+ const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(formFieldStyles.input, {
303
+ [formFieldStyles.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
304
304
  }), name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
305
305
  !inline && { "aria-describedby": descriptionIdentifier }));
306
306
  const textFieldProps = Object.assign(Object.assign({}, fieldProps), { autoFocus: autofocus, onKeyDown: handleKeyDown });
@@ -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":
@@ -466,8 +470,8 @@ exports.FormFieldPostFix = FormFieldPostFix;
466
470
  exports.FormFieldWrapper = FormFieldWrapper;
467
471
  exports.FormFieldWrapperMain = FormFieldWrapperMain;
468
472
  exports.FormFieldWrapperToolbar = FormFieldWrapperToolbar;
473
+ exports.formFieldStyles = formFieldStyles;
469
474
  exports.mergeRefs = mergeRefs;
470
- exports.styles = styles$1;
471
475
  exports.useAtlantisFormField = useAtlantisFormField;
472
476
  exports.useAtlantisFormFieldActions = useAtlantisFormFieldActions;
473
477
  exports.useAtlantisFormFieldName = useAtlantisFormFieldName;
@@ -12,22 +12,22 @@ import { S as Spinner } from './Spinner-es.js';
12
12
  import { _ as __rest } from './tslib.es6-es.js';
13
13
  import { useFormContext, useForm, useController } from 'react-hook-form';
14
14
 
15
- var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
15
+ var formFieldStyles = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","disabled":"Tz9LK9ABKMk-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
16
16
 
17
17
  /**
18
18
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
19
19
  */
20
20
  function AffixLabel({ label, variation = "prefix", labelRef, }) {
21
- const affixLabelClass = classnames(styles$1.affixLabel, {
22
- [styles$1.suffix]: variation === "suffix",
21
+ const affixLabelClass = classnames(formFieldStyles.affixLabel, {
22
+ [formFieldStyles.suffix]: variation === "suffix",
23
23
  });
24
24
  if (!label)
25
25
  return null;
26
26
  return (React__default.createElement("div", { ref: labelRef, className: affixLabelClass }, label));
27
27
  }
28
28
  function AffixIcon({ icon, onClick, ariaLabel, variation = "prefix", size, }) {
29
- const affixIconClass = classnames(styles$1.affixIcon, {
30
- [styles$1.suffix]: variation === "suffix",
29
+ const affixIconClass = classnames(formFieldStyles.affixIcon, {
30
+ [formFieldStyles.suffix]: variation === "suffix",
31
31
  });
32
32
  const iconSize = size === "small" ? "small" : "base";
33
33
  if (!icon)
@@ -49,7 +49,7 @@ function FormFieldDescription({ id, description, visible = true, }) {
49
49
  if (!visible)
50
50
  return null;
51
51
  const useStringFormat = !description || typeof description === "string";
52
- return (React__default.createElement("div", { id: id, className: styles$1.description }, useStringFormat ? (React__default.createElement(Text, { size: "small", variation: "subdued" }, description)) : (description)));
52
+ return (React__default.createElement("div", { id: id, className: formFieldStyles.description }, useStringFormat ? (React__default.createElement(Text, { size: "small", variation: "subdued" }, description)) : (description)));
53
53
  }
54
54
 
55
55
  var styles = {"clearInput":"YmRTd-KeXv4-","spinning":"B25z9B8I3gs-"};
@@ -84,22 +84,22 @@ function useIsSafari() {
84
84
  */
85
85
  function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, error, max, prefixRef, suffixRef, maxLength, type, disabled, inline, showMiniLabel = true, }) {
86
86
  const isSafari = useIsSafari();
87
- const wrapperClasses = classnames(styles$1.wrapper, size && styles$1[size], align && styles$1[align], {
88
- [styles$1.miniLabel]: (showMiniLabel && placeholder && value !== "") ||
87
+ const wrapperClasses = classnames(formFieldStyles.wrapper, size && formFieldStyles[size], align && formFieldStyles[align], {
88
+ [formFieldStyles.miniLabel]: (showMiniLabel && placeholder && value !== "") ||
89
89
  (placeholder && type === "select") ||
90
90
  // Naively assume that if the the type is tel, it is the InputPhoneNumber
91
91
  (placeholder && type === "tel"),
92
- [styles$1.text]: type === "textarea" || type === "text",
93
- [styles$1.textarea]: type === "textarea",
94
- [styles$1.safari]: isSafari && type === "textarea",
95
- [styles$1.select]: type === "select",
96
- [styles$1.invalid]: invalid !== null && invalid !== void 0 ? invalid : error,
97
- [styles$1.disabled]: disabled,
98
- [styles$1.maxLength]: maxLength,
99
- [styles$1.timeInputLabel]: placeholder && type === "time" && placeholder && value === "",
92
+ [formFieldStyles.text]: type === "textarea" || type === "text",
93
+ [formFieldStyles.textarea]: type === "textarea",
94
+ [formFieldStyles.safari]: isSafari && type === "textarea",
95
+ [formFieldStyles.select]: type === "select",
96
+ [formFieldStyles.invalid]: invalid !== null && invalid !== void 0 ? invalid : error,
97
+ [formFieldStyles.disabled]: disabled,
98
+ [formFieldStyles.maxLength]: maxLength,
99
+ [formFieldStyles.timeInputLabel]: placeholder && type === "time" && placeholder && value === "",
100
100
  });
101
- const containerClasses = classnames(styles$1.container, {
102
- [styles$1.inline]: inline,
101
+ const containerClasses = classnames(formFieldStyles.container, {
102
+ [formFieldStyles.inline]: inline,
103
103
  });
104
104
  const wrapperInlineStyle = {
105
105
  ["--formField-maxLength"]: maxLength || max,
@@ -118,7 +118,7 @@ function useFormFieldWrapperStyles({ size, align, placeholder, value, invalid, e
118
118
  }));
119
119
  }, [value]);
120
120
  return {
121
- inputStyle: styles$1.input,
121
+ inputStyle: formFieldStyles.input,
122
122
  wrapperClasses,
123
123
  containerClasses,
124
124
  wrapperInlineStyle,
@@ -148,8 +148,8 @@ function getAffixPaddding({ value, type, prefixWidth, suffixWidth, }) {
148
148
  }
149
149
 
150
150
  function FormFieldWrapper({ align, description, descriptionIdentifier, placeholder, value, children, invalid, error, size, prefix, suffix, max, maxLength, type, disabled, inline, identifier, clearable, onClear, readonly, toolbar, toolbarVisibility = "while-editing", showMiniLabel = true, wrapperRef, }) {
151
- const prefixRef = useRef();
152
- const suffixRef = useRef();
151
+ const prefixRef = useRef(null);
152
+ const suffixRef = useRef(null);
153
153
  const { wrapperClasses, containerClasses, wrapperInlineStyle, labelStyle } = useFormFieldWrapperStyles({
154
154
  align,
155
155
  max,
@@ -201,24 +201,24 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
201
201
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
202
202
  */
203
203
  function FormFieldInputHorizontalWrapper({ children, }) {
204
- return React__default.createElement("div", { className: styles$1.horizontalWrapper }, children);
204
+ return React__default.createElement("div", { className: formFieldStyles.horizontalWrapper }, children);
205
205
  }
206
206
  /**
207
207
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
208
208
  */
209
209
  function FormFieldInputWrapperStyles({ children, }) {
210
- return React__default.createElement("div", { className: styles$1.inputWrapper }, children);
210
+ return React__default.createElement("div", { className: formFieldStyles.inputWrapper }, children);
211
211
  }
212
212
  /**
213
213
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
214
214
  */
215
215
  function FormFieldWrapperMain({ children, tabIndex = -1, }) {
216
- return (React__default.createElement("div", { className: styles$1.childrenWrapper, tabIndex: tabIndex }, children));
216
+ return (React__default.createElement("div", { className: formFieldStyles.childrenWrapper, tabIndex: tabIndex }, children));
217
217
  }
218
218
  function FormFieldLabel({ children, htmlFor, style, external = false, }) {
219
219
  if (!children)
220
220
  return null;
221
- return (React__default.createElement("label", { className: external ? styles$1.externalLabel : styles$1.label, htmlFor: htmlFor, style: style }, children));
221
+ return (React__default.createElement("label", { className: external ? formFieldStyles.externalLabel : formFieldStyles.label, htmlFor: htmlFor, style: style }, children));
222
222
  }
223
223
  /**
224
224
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
@@ -228,13 +228,13 @@ function FormFieldWrapperToolbar({ toolbar, isToolbarVisible, toolbarAnimationEn
228
228
  duration: tokens["timing-base"] / 1000,
229
229
  ease: "easeInOut",
230
230
  }, tabIndex: -1 },
231
- React__default.createElement("div", { className: styles$1.toolbar, "data-testid": "ATL-InputText-Toolbar" }, toolbar)))));
231
+ React__default.createElement("div", { className: formFieldStyles.toolbar, "data-testid": "ATL-InputText-Toolbar" }, toolbar)))));
232
232
  }
233
233
 
234
234
  function FormFieldPostFix({ variation, visible = true, className, }) {
235
235
  if (!visible)
236
236
  return null;
237
- return (React__default.createElement("span", { className: classnames(styles$1.postfix, className) }, variation === "select" ? (React__default.createElement(Icon, { name: "arrowDown" })) : (React__default.createElement(Spinner, { size: "small" }))));
237
+ return (React__default.createElement("span", { className: classnames(formFieldStyles.postfix, className) }, variation === "select" ? (React__default.createElement(Icon, { name: "arrowDown" })) : (React__default.createElement(Spinner, { size: "small" }))));
238
238
  }
239
239
 
240
240
  /**
@@ -297,8 +297,8 @@ function useAtlantisFormFieldActions({ name, onChange, inputRef, onControllerCha
297
297
  */
298
298
  function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
299
299
  const descriptionIdentifier = `descriptionUUID--${id}`;
300
- const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(styles$1.input, {
301
- [styles$1.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
300
+ const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(formFieldStyles.input, {
301
+ [formFieldStyles.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
302
302
  }), name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
303
303
  !inline && { "aria-describedby": descriptionIdentifier }));
304
304
  const textFieldProps = Object.assign(Object.assign({}, fieldProps), { autoFocus: autofocus, onKeyDown: handleKeyDown });
@@ -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, styles$1 as s, 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, formFieldStyles as l, FormFieldPostFix as m, mergeRefs as n, useAtlantisFormField as u };
@@ -1,11 +1,21 @@
1
1
  import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
2
- import type { InputTextRebuiltProps } from "../InputText/InputText.types";
3
- export interface InputDateRebuiltProps extends Omit<InputTextRebuiltProps, "clearable" | "onChange" | "value" | "prefix" | "suffix" | "multiline" | "rows" | "type" | "version"> {
2
+ import type { FocusEvents, HTMLInputBaseProps, KeyboardEvents, RebuiltInputCommonProps } from "../sharedHelpers/types";
3
+ export interface InputDateRebuiltProps extends HTMLInputBaseProps, FocusEvents<HTMLInputElement | HTMLTextAreaElement>, KeyboardEvents<HTMLInputElement | HTMLTextAreaElement>, Omit<RebuiltInputCommonProps, "clearable" | "prefix" | "suffix"> {
4
4
  /**
5
5
  * A Date object value
6
6
  * (e.g., `new Date("11/11/2011")`)
7
7
  * */
8
8
  readonly value?: Date;
9
+ /**
10
+ * Callback for value changes.
11
+ * @param newValue - The new Date value
12
+ * @param event - Optional change event
13
+ */
14
+ readonly onChange: (newValue: Date, event?: React.ChangeEvent<HTMLInputElement>) => void;
15
+ /**
16
+ * @deprecated Use `onKeyDown` or `onKeyUp` instead.
17
+ */
18
+ readonly onEnter?: FormFieldProps["onEnter"];
9
19
  /**
10
20
  * The maximum selectable date.
11
21
  */
@@ -23,11 +33,6 @@ export interface InputDateRebuiltProps extends Omit<InputTextRebuiltProps, "clea
23
33
  * Text to display instead of a date value
24
34
  */
25
35
  readonly emptyValueLabel?: string;
26
- /**
27
- * Version 2 is highly experimental, avoid using it unless you have talked with Atlantis first.
28
- */
29
- readonly version: 2;
30
- readonly onChange: (newValue: Date, event?: React.ChangeEvent<HTMLInputElement>) => void;
31
36
  }
32
37
  export interface InputDateProps extends Omit<CommonFormFieldProps, "clearable">, Pick<FormFieldProps, "readonly" | "disabled" | "onEnter" | "onFocus" | "inputRef" | "validations" | "placeholder" | "onChange" | "onBlur"> {
33
38
  /**
@@ -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');
@@ -35,6 +35,7 @@ require('../floating-ui.react-cjs.js');
35
35
  require('react/jsx-runtime');
36
36
  require('react-dom');
37
37
  require('../AtlantisContext-cjs.js');
38
+ require('../filterDataAttributes-cjs.js');
38
39
 
39
40
  function InputDate$1(inputProps) {
40
41
  const formFieldActionsRef = React.useRef(null);
@@ -79,13 +80,9 @@ function InputDate$1(inputProps) {
79
80
  } }));
80
81
  }
81
82
 
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
83
  function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
87
84
  const [isFocused, setIsFocused] = React.useState(false);
88
- function handleChange(_, event) {
85
+ function handleChange(_newValue, event) {
89
86
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
90
87
  }
91
88
  function handleFocus(event) {
@@ -93,8 +90,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
93
90
  setIsFocused(true);
94
91
  }
95
92
  function handleBlur(event) {
96
- setIsFocused(false);
97
93
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
94
+ setIsFocused(false);
98
95
  }
99
96
  return {
100
97
  handleBlur,
@@ -106,21 +103,47 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
106
103
 
107
104
  const InputDateRebuilt = React.forwardRef((props, forwardedRef) => {
108
105
  const { onChange } = props;
106
+ const isCalendarOpenRef = React.useRef(false);
107
+ const inputFocusedRef = React.useRef(false);
108
+ const compositeFocusedRef = React.useRef(false);
109
+ const lastBlurEventRef = React.useRef(null);
109
110
  return (React.createElement(DatePicker.DatePicker, { selected: props.value, onChange: newValue => {
110
111
  onChange(newValue);
111
- }, disabled: props.disabled, readonly: props.readOnly, fullWidth: !props.inline, minDate: props.minDate, maxDate: props.maxDate, smartAutofocus: false, activator: InputDateActivator }));
112
+ }, disabled: props.disabled, readonly: props.readOnly, fullWidth: !props.inline, minDate: props.minDate, maxDate: props.maxDate, smartAutofocus: false, activator: InputDateActivator, onOpenChange: open => {
113
+ var _a;
114
+ isCalendarOpenRef.current = open;
115
+ // When calendar closes, fire onBlur if input is also not focused
116
+ if (!open &&
117
+ !inputFocusedRef.current &&
118
+ compositeFocusedRef.current &&
119
+ lastBlurEventRef.current) {
120
+ compositeFocusedRef.current = false;
121
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, lastBlurEventRef.current);
122
+ }
123
+ } }));
112
124
  function InputDateActivator(activatorProps) {
113
125
  const { onClick, value } = activatorProps;
114
126
  const { handleChange, handleFocus, handleBlur, isFocused } = useInputDateActivatorActions({
115
127
  onChange: activatorProps.onChange,
116
128
  onFocus: event => {
117
129
  var _a, _b;
118
- (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
130
+ inputFocusedRef.current = true;
131
+ // Fire parent's onFocus only when the composite component first receives focus
132
+ if (!compositeFocusedRef.current) {
133
+ compositeFocusedRef.current = true;
134
+ (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
135
+ }
119
136
  (_b = activatorProps.onFocus) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
120
137
  },
121
138
  onBlur: event => {
122
139
  var _a, _b;
123
- (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
140
+ inputFocusedRef.current = false;
141
+ lastBlurEventRef.current = event;
142
+ // Only fire parent's onBlur if calendar is also closed
143
+ if (!isCalendarOpenRef.current && compositeFocusedRef.current) {
144
+ compositeFocusedRef.current = false;
145
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
146
+ }
124
147
  (_b = activatorProps.onBlur) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
125
148
  },
126
149
  });
@@ -135,7 +158,7 @@ const InputDateRebuilt = React.forwardRef((props, forwardedRef) => {
135
158
  return (
136
159
  // 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
160
  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 => {
161
+ React.createElement(InputText_index.InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, autoFocus: props.autoFocus, 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
162
  var _a, _b;
140
163
  if (props.showIcon === false && event.key === "ArrowDown") {
141
164
  (_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 '../_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';
@@ -33,6 +33,7 @@ import '../floating-ui.react-es.js';
33
33
  import 'react/jsx-runtime';
34
34
  import 'react-dom';
35
35
  import '../AtlantisContext-es.js';
36
+ import '../filterDataAttributes-es.js';
36
37
 
37
38
  function InputDate$1(inputProps) {
38
39
  const formFieldActionsRef = useRef(null);
@@ -77,13 +78,9 @@ function InputDate$1(inputProps) {
77
78
  } }));
78
79
  }
79
80
 
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
- */
84
81
  function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
85
82
  const [isFocused, setIsFocused] = useState(false);
86
- function handleChange(_, event) {
83
+ function handleChange(_newValue, event) {
87
84
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
88
85
  }
89
86
  function handleFocus(event) {
@@ -91,8 +88,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
91
88
  setIsFocused(true);
92
89
  }
93
90
  function handleBlur(event) {
94
- setIsFocused(false);
95
91
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
92
+ setIsFocused(false);
96
93
  }
97
94
  return {
98
95
  handleBlur,
@@ -104,21 +101,47 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
104
101
 
105
102
  const InputDateRebuilt = forwardRef((props, forwardedRef) => {
106
103
  const { onChange } = props;
104
+ const isCalendarOpenRef = useRef(false);
105
+ const inputFocusedRef = useRef(false);
106
+ const compositeFocusedRef = useRef(false);
107
+ const lastBlurEventRef = useRef(null);
107
108
  return (React__default.createElement(DatePicker, { selected: props.value, onChange: newValue => {
108
109
  onChange(newValue);
109
- }, disabled: props.disabled, readonly: props.readOnly, fullWidth: !props.inline, minDate: props.minDate, maxDate: props.maxDate, smartAutofocus: false, activator: InputDateActivator }));
110
+ }, disabled: props.disabled, readonly: props.readOnly, fullWidth: !props.inline, minDate: props.minDate, maxDate: props.maxDate, smartAutofocus: false, activator: InputDateActivator, onOpenChange: open => {
111
+ var _a;
112
+ isCalendarOpenRef.current = open;
113
+ // When calendar closes, fire onBlur if input is also not focused
114
+ if (!open &&
115
+ !inputFocusedRef.current &&
116
+ compositeFocusedRef.current &&
117
+ lastBlurEventRef.current) {
118
+ compositeFocusedRef.current = false;
119
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, lastBlurEventRef.current);
120
+ }
121
+ } }));
110
122
  function InputDateActivator(activatorProps) {
111
123
  const { onClick, value } = activatorProps;
112
124
  const { handleChange, handleFocus, handleBlur, isFocused } = useInputDateActivatorActions({
113
125
  onChange: activatorProps.onChange,
114
126
  onFocus: event => {
115
127
  var _a, _b;
116
- (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
128
+ inputFocusedRef.current = true;
129
+ // Fire parent's onFocus only when the composite component first receives focus
130
+ if (!compositeFocusedRef.current) {
131
+ compositeFocusedRef.current = true;
132
+ (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
133
+ }
117
134
  (_b = activatorProps.onFocus) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
118
135
  },
119
136
  onBlur: event => {
120
137
  var _a, _b;
121
- (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
138
+ inputFocusedRef.current = false;
139
+ lastBlurEventRef.current = event;
140
+ // Only fire parent's onBlur if calendar is also closed
141
+ if (!isCalendarOpenRef.current && compositeFocusedRef.current) {
142
+ compositeFocusedRef.current = false;
143
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
144
+ }
122
145
  (_b = activatorProps.onBlur) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
123
146
  },
124
147
  });
@@ -133,7 +156,7 @@ const InputDateRebuilt = forwardRef((props, forwardedRef) => {
133
156
  return (
134
157
  // 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
135
158
  React__default.createElement("div", { onClick: onClick },
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 => {
159
+ React__default.createElement(InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, autoFocus: props.autoFocus, 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 => {
137
160
  var _a, _b;
138
161
  if (props.showIcon === false && event.key === "ArrowDown") {
139
162
  (_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);