@elliemae/ds-controlled-form 2.4.2-rc.9 → 2.4.2

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 (234) hide show
  1. package/cjs/autocomplete/config/useAutocomplete.js +0 -1
  2. package/cjs/autocomplete/parts/A11yFocusedOption.js +46 -0
  3. package/cjs/autocomplete/parts/container/Container.js +36 -24
  4. package/cjs/autocomplete/parts/container/styled.js +2 -2
  5. package/cjs/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
  6. package/cjs/autocomplete/parts/menu-list/MenuList.js +6 -6
  7. package/cjs/autocomplete/parts/menu-list/styled.js +2 -2
  8. package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
  9. package/cjs/autocomplete/parts/styled.js +2 -0
  10. package/cjs/autocomplete/utils/listHelper.js +1 -1
  11. package/cjs/checkbox/ControlledCheckbox.js +1 -1
  12. package/cjs/checkbox/config/useValidateProps.js +6 -3
  13. package/cjs/checkbox/react-desc-prop-types.js +2 -1
  14. package/cjs/checkbox/styles.js +73 -27
  15. package/cjs/checkbox/utils/styleHelpers.js +20 -2
  16. package/cjs/combobox/ComboBoxCTX.js +6 -3
  17. package/cjs/combobox/config/useComboBox.js +16 -6
  18. package/cjs/combobox/config/useCorrectOptions.js +1 -2
  19. package/cjs/combobox/parts/A11yFocusedOption.js +14 -6
  20. package/cjs/combobox/parts/A11ySelectedValues.js +2 -4
  21. package/cjs/combobox/parts/DropdownIndicator.js +15 -7
  22. package/cjs/combobox/parts/container/Container.js +11 -14
  23. package/cjs/combobox/parts/container/styled.js +11 -10
  24. package/cjs/combobox/parts/controls/Controls.js +19 -27
  25. package/cjs/combobox/parts/controls/styled.js +54 -22
  26. package/cjs/combobox/parts/controls/useOnPillsNavigation.js +7 -15
  27. package/cjs/combobox/parts/controls-input/ControlsInput.js +2 -2
  28. package/cjs/combobox/parts/controls-input/styled.js +41 -11
  29. package/cjs/combobox/parts/controls-input/useControlsInput.js +4 -7
  30. package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +19 -28
  31. package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
  32. package/cjs/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  33. package/cjs/combobox/parts/header-list/HeaderList.js +1 -1
  34. package/cjs/combobox/parts/header-list/styled.js +39 -10
  35. package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
  36. package/cjs/combobox/parts/menu-list/MenuList.js +8 -6
  37. package/cjs/combobox/parts/menu-list/styled.js +38 -20
  38. package/cjs/combobox/parts/menu-list/useItemRenderer.js +18 -17
  39. package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  40. package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
  41. package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
  42. package/cjs/combobox/parts/styled.js +6 -7
  43. package/cjs/combobox/react-desc-prop-types.js +3 -2
  44. package/cjs/combobox/sharedTypes.js +2 -2
  45. package/cjs/combobox/utils/listHelper.js +14 -9
  46. package/cjs/date-range-picker/config/useRangePickerLogic.js +4 -8
  47. package/cjs/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
  48. package/cjs/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
  49. package/cjs/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
  50. package/cjs/date-time-picker/config/useChangeHandlers.js +3 -3
  51. package/cjs/date-time-picker/config/useControlledDateTimePicker.js +1 -1
  52. package/cjs/date-time-picker/config/useFocusTracker.js +1 -1
  53. package/cjs/date-time-picker/config/useGetDestructuredValues.js +6 -6
  54. package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
  55. package/cjs/date-time-picker/config/useGetReferences.js +1 -1
  56. package/cjs/date-time-picker/config/useRelevantValueFromProps.js +1 -1
  57. package/cjs/date-time-picker/config/useValidateProps.js +42 -11
  58. package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
  59. package/cjs/date-time-picker/parts/DateInputs/DDInput.js +3 -7
  60. package/cjs/date-time-picker/parts/DateInputs/MMInput.js +3 -7
  61. package/cjs/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
  62. package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
  63. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  64. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
  65. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
  66. package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
  67. package/cjs/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -15
  68. package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +1 -2
  69. package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
  70. package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
  71. package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
  72. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
  73. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
  74. package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
  75. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
  76. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
  77. package/cjs/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
  78. package/cjs/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -15
  79. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -5
  80. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
  81. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
  82. package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
  83. package/cjs/date-time-picker/parts/Styleds.js +12 -6
  84. package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
  85. package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
  86. package/cjs/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
  87. package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
  88. package/cjs/date-time-picker/utils/dateHelpers.js +17 -34
  89. package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
  90. package/cjs/date-time-picker/utils/stringHelpers.js +5 -11
  91. package/cjs/input-group/InputGroup.js +8 -7
  92. package/cjs/input-group/exported-related/data-test-ids.js +12 -0
  93. package/cjs/input-group/exported-related/index.js +12 -0
  94. package/cjs/input-group/exported-related/theming.js +13 -0
  95. package/cjs/input-group/styled.js +90 -23
  96. package/cjs/large-text-input/DSControlledLargeTextInput.js +1 -1
  97. package/cjs/large-text-input/styles.js +27 -13
  98. package/cjs/mask-hook/hooks/useNumberMask.js +1 -5
  99. package/cjs/mask-hook/hooks/usePhoneMask.js +1 -4
  100. package/cjs/mask-hook/hooks/useRegExpMask.js +4 -7
  101. package/cjs/mask-hook/hooks/useSSNMask.js +1 -4
  102. package/cjs/mask-hook/hooks/useZipCodeMask.js +1 -4
  103. package/cjs/mask-hook/utils/addSpecialCharacters.js +0 -1
  104. package/cjs/mask-hook/utils/flatStringArray.js +0 -1
  105. package/cjs/text-input/config/useInputText.js +0 -1
  106. package/cjs/text-input/styled/borders.js +18 -11
  107. package/cjs/text-input/styled/components.js +49 -10
  108. package/cjs/toggle/ControlledToggle.js +2 -3
  109. package/cjs/toggle/styles.js +7 -5
  110. package/esm/autocomplete/config/useAutocomplete.js +0 -1
  111. package/esm/autocomplete/parts/A11yFocusedOption.js +36 -0
  112. package/esm/autocomplete/parts/container/Container.js +39 -27
  113. package/esm/autocomplete/parts/container/styled.js +2 -2
  114. package/esm/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
  115. package/esm/autocomplete/parts/menu-list/MenuList.js +7 -7
  116. package/esm/autocomplete/parts/menu-list/styled.js +2 -2
  117. package/esm/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
  118. package/esm/autocomplete/parts/styled.js +1 -0
  119. package/esm/autocomplete/utils/listHelper.js +1 -1
  120. package/esm/checkbox/ControlledCheckbox.js +2 -2
  121. package/esm/checkbox/config/useValidateProps.js +6 -3
  122. package/esm/checkbox/react-desc-prop-types.js +2 -1
  123. package/esm/checkbox/styles.js +73 -24
  124. package/esm/checkbox/utils/styleHelpers.js +20 -2
  125. package/esm/combobox/ComboBoxCTX.js +6 -3
  126. package/esm/combobox/config/useComboBox.js +16 -6
  127. package/esm/combobox/config/useCorrectOptions.js +1 -2
  128. package/esm/combobox/parts/A11yFocusedOption.js +15 -7
  129. package/esm/combobox/parts/A11ySelectedValues.js +2 -4
  130. package/esm/combobox/parts/DropdownIndicator.js +15 -6
  131. package/esm/combobox/parts/container/Container.js +11 -14
  132. package/esm/combobox/parts/container/styled.js +11 -6
  133. package/esm/combobox/parts/controls/Controls.js +19 -27
  134. package/esm/combobox/parts/controls/styled.js +54 -18
  135. package/esm/combobox/parts/controls/useOnPillsNavigation.js +7 -15
  136. package/esm/combobox/parts/controls-input/ControlsInput.js +2 -2
  137. package/esm/combobox/parts/controls-input/styled.js +41 -7
  138. package/esm/combobox/parts/controls-input/useControlsInput.js +4 -7
  139. package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +20 -29
  140. package/esm/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
  141. package/esm/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  142. package/esm/combobox/parts/header-list/HeaderList.js +1 -1
  143. package/esm/combobox/parts/header-list/styled.js +40 -7
  144. package/esm/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
  145. package/esm/combobox/parts/menu-list/MenuList.js +8 -6
  146. package/esm/combobox/parts/menu-list/styled.js +38 -17
  147. package/esm/combobox/parts/menu-list/useItemRenderer.js +20 -19
  148. package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  149. package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
  150. package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
  151. package/esm/combobox/parts/styled.js +6 -3
  152. package/esm/combobox/react-desc-prop-types.js +3 -2
  153. package/esm/combobox/sharedTypes.js +2 -2
  154. package/esm/combobox/utils/listHelper.js +14 -10
  155. package/esm/date-range-picker/config/useRangePickerLogic.js +3 -7
  156. package/esm/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
  157. package/esm/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
  158. package/esm/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
  159. package/esm/date-time-picker/config/useChangeHandlers.js +3 -3
  160. package/esm/date-time-picker/config/useControlledDateTimePicker.js +1 -1
  161. package/esm/date-time-picker/config/useFocusTracker.js +1 -1
  162. package/esm/date-time-picker/config/useGetDestructuredValues.js +6 -6
  163. package/esm/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
  164. package/esm/date-time-picker/config/useGetReferences.js +1 -1
  165. package/esm/date-time-picker/config/useRelevantValueFromProps.js +1 -1
  166. package/esm/date-time-picker/config/useValidateProps.js +42 -11
  167. package/esm/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
  168. package/esm/date-time-picker/parts/DateInputs/DDInput.js +3 -7
  169. package/esm/date-time-picker/parts/DateInputs/MMInput.js +3 -7
  170. package/esm/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
  171. package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
  172. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  173. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
  174. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
  175. package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
  176. package/esm/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -14
  177. package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +0 -1
  178. package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
  179. package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
  180. package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
  181. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
  182. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
  183. package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
  184. package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
  185. package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
  186. package/esm/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
  187. package/esm/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -14
  188. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -5
  189. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
  190. package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
  191. package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
  192. package/esm/date-time-picker/parts/Styleds.js +12 -6
  193. package/esm/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
  194. package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
  195. package/esm/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
  196. package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
  197. package/esm/date-time-picker/utils/dateHelpers.js +17 -34
  198. package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
  199. package/esm/date-time-picker/utils/stringHelpers.js +5 -11
  200. package/esm/input-group/InputGroup.js +5 -4
  201. package/esm/input-group/exported-related/data-test-ids.js +8 -0
  202. package/esm/input-group/exported-related/index.js +2 -0
  203. package/esm/input-group/exported-related/theming.js +8 -0
  204. package/esm/input-group/styled.js +89 -18
  205. package/esm/large-text-input/DSControlledLargeTextInput.js +1 -1
  206. package/esm/large-text-input/styles.js +27 -9
  207. package/esm/mask-hook/hooks/useNumberMask.js +1 -5
  208. package/esm/mask-hook/hooks/usePhoneMask.js +1 -4
  209. package/esm/mask-hook/hooks/useRegExpMask.js +4 -7
  210. package/esm/mask-hook/hooks/useSSNMask.js +1 -4
  211. package/esm/mask-hook/hooks/useZipCodeMask.js +1 -4
  212. package/esm/mask-hook/utils/addSpecialCharacters.js +0 -1
  213. package/esm/mask-hook/utils/flatStringArray.js +0 -1
  214. package/esm/text-input/config/useInputText.js +0 -1
  215. package/esm/text-input/styled/borders.js +18 -7
  216. package/esm/text-input/styled/components.js +49 -6
  217. package/esm/toggle/ControlledToggle.js +0 -1
  218. package/esm/toggle/styles.js +7 -5
  219. package/package.json +35 -15
  220. package/types/autocomplete/parts/A11yFocusedOption.d.ts +5 -0
  221. package/types/autocomplete/parts/container/styled.d.ts +1 -1
  222. package/types/autocomplete/parts/styled.d.ts +0 -0
  223. package/types/autocomplete/utils/listHelper.d.ts +5 -5
  224. package/types/checkbox/react-desc-prop-types.d.ts +1 -1
  225. package/types/checkbox/styles.d.ts +1 -0
  226. package/types/combobox/parts/menu-list/styled.d.ts +1 -0
  227. package/types/combobox/react-desc-prop-types.d.ts +8 -6
  228. package/types/combobox/sharedTypes.d.ts +3 -2
  229. package/types/combobox/utils/listHelper.d.ts +1 -0
  230. package/types/input-group/exported-related/data-test-ids.d.ts +6 -0
  231. package/types/input-group/exported-related/index.d.ts +2 -0
  232. package/types/input-group/exported-related/theming.d.ts +6 -0
  233. package/types/input-group/styled.d.ts +4 -7
  234. package/types/text-input/config/useInputText.d.ts +4 -4
@@ -19,22 +19,30 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
19
19
  const A11yFocusedOption = () => {
20
20
  const {
21
21
  props: {
22
- filteredOptions
22
+ filteredOptions,
23
+ selectedValues
23
24
  },
24
25
  focusOptionIdx,
25
- showPopover
26
+ menuState
26
27
  } = React.useContext(ComboBoxCTX.ComboBoxContext);
27
28
  const selectabledOptions = listHelper.getSelectableOptions(filteredOptions);
28
- const focusOption = filteredOptions.find(option => !sharedTypes.isSeparator(option) && option.dsId === focusOptionIdx);
29
+ const focusOption = filteredOptions.find(option => option.dsId === focusOptionIdx);
30
+ const isFocusOptionSelected = focusOption?.type === 'option' && listHelper.isSelected(selectedValues, focusOption);
29
31
  const focusSelectableOptionIdx = selectabledOptions.findIndex(option => option.dsId === focusOptionIdx);
32
+ const navigationContext = 'Use up and down to choose options,press enter to choose focused option, press Escape to excuse dropdown menu';
30
33
  return React.useMemo(() => {
31
- if (!sharedTypes.isSeparator(focusOption) && showPopover && focusOption) return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
34
+ if (!sharedTypes.isSeparator(focusOption) && menuState && focusOption && focusOption.type === 'option') return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
32
35
  "aria-live": "polite",
33
36
  "aria-atomic": "false",
34
37
  "aria-relevant": "additions text"
35
- }, void 0, "option ".concat(focusOption === null || focusOption === void 0 ? void 0 : focusOption.label, " focused.").concat(focusSelectableOptionIdx + 1, " of ").concat(selectabledOptions.length, " "));
38
+ }, menuState, `option ${focusOption?.label} ${isFocusOptionSelected ? 'selected and ' : ''}focused .${focusSelectableOptionIdx + 1} of ${selectabledOptions.length}. ${navigationContext} `);
39
+ if (focusOption?.type === 'creatable') return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
40
+ "aria-live": "assertive",
41
+ "aria-atomic": "false",
42
+ "aria-relevant": "additions text"
43
+ }, menuState, `Press enter to Add: ${focusOption?.label}. ${navigationContext}`);
36
44
  return null;
37
- }, [showPopover, focusOption, focusSelectableOptionIdx, selectabledOptions]);
45
+ }, [focusOption, menuState, isFocusOptionSelected, focusSelectableOptionIdx, selectabledOptions.length]);
38
46
  };
39
47
 
40
48
  exports.A11yFocusedOption = A11yFocusedOption;
@@ -25,12 +25,10 @@ const A11ySelectedValues = () => {
25
25
 
26
26
  if (Array.isArray(selectedValues)) {
27
27
  if (selectedValues.length > 0) {
28
- msg = "Options selected: ".concat(selectedValues.map(item => item.label).join(', '));
28
+ msg = `Options selected: ${selectedValues.map(item => item.label).join(', ')}`;
29
29
  }
30
-
31
- msg = 'No Options Selected';
32
30
  } else if (selectedValues) {
33
- msg = "Option selected: ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.label);
31
+ msg = `Option selected: ${selectedValues?.label}`;
34
32
  }
35
33
 
36
34
  return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _jsx = require('@babel/runtime/helpers/jsx');
6
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
7
6
  var React = require('react');
8
7
  var dsSystem = require('@elliemae/ds-system');
9
8
  var DSButton = require('@elliemae/ds-button');
@@ -14,22 +13,31 @@ var ComboboxDataTestids = require('../ComboboxDataTestids.js');
14
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
16
15
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
18
16
 
19
- var _templateObject;
20
- const StyledDropDownButton = dsSystem.styled(DSButton.DSButtonV2)(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ", ";\n }\n"])), _ref => {
17
+ const StyledDropDownButton = dsSystem.styled(DSButton.DSButtonV2)`
18
+ &:focus::after {
19
+ border: none;
20
+ }
21
+ &:hover:not(:disabled) {
22
+ background-color: transparent;
23
+ }
24
+
25
+ & svg {
26
+ fill: ${_ref => {
21
27
  let {
22
28
  theme,
23
29
  disabled
24
30
  } = _ref;
25
31
  return disabled ? theme.colors.neutral['400'] : theme.colors.brand['700'];
26
- });
32
+ }};
33
+ }
34
+ `;
27
35
  const DropdownIndicator = () => {
28
36
  const {
29
37
  props: {
30
38
  disabled
31
39
  },
32
- showPopover
40
+ menuState
33
41
  } = React.useContext(ComboBoxCTX.ComboBoxContext);
34
42
  const colorButton = React.useMemo(() => disabled ? ['neutral', 400] : ['brand-primary', 700], [disabled]);
35
43
  const handleOnClick = React.useCallback(e => {
@@ -41,7 +49,7 @@ const DropdownIndicator = () => {
41
49
  "aria-controls": "combo-listbox",
42
50
  "aria-labelledby": "combo-label",
43
51
  disabled: disabled,
44
- "aria-expanded": showPopover,
52
+ "aria-expanded": menuState,
45
53
  "aria-haspopup": "listbox",
46
54
  "aria-hidden": true,
47
55
  buttonType: "icon",
@@ -38,15 +38,13 @@ const Container = () => {
38
38
 
39
39
  const {
40
40
  props,
41
- setShowPopover,
42
- showPopover,
41
+ setMenuState,
42
+ menuState,
43
43
  setReferenceElement,
44
44
  referenceElement
45
45
  } = React.useContext(ComboBoxCTX.ComboBoxContext);
46
46
  const {
47
47
  inline,
48
- onMenuOpen,
49
- onMenuClose,
50
48
  innerRef,
51
49
  startPlacementPreference,
52
50
  placementOrderPreference,
@@ -62,20 +60,19 @@ const Container = () => {
62
60
  e.preventDefault();
63
61
  }, []);
64
62
  const handleCloseMenu = React.useCallback(() => {
65
- setShowPopover(false);
66
- if (innerRef !== null && innerRef !== void 0 && innerRef.current) innerRef.current.blur();
67
- }, [innerRef, setShowPopover]);
63
+ setMenuState(false, 'blur');
64
+ if (innerRef?.current) innerRef.current.blur();
65
+ }, [innerRef, setMenuState]);
68
66
  React.useEffect(() => {
69
- const closeMenuOnWindowBlur = () => setShowPopover(false);
67
+ const closeMenuOnWindowBlur = () => {
68
+ setMenuState(false, 'blur');
69
+ };
70
70
 
71
71
  window.addEventListener('blur', closeMenuOnWindowBlur);
72
72
  return () => {
73
73
  window.removeEventListener('blur', closeMenuOnWindowBlur);
74
74
  };
75
- }, [setShowPopover]);
76
- React.useEffect(() => {
77
- if (onMenuOpen && showPopover) onMenuOpen();else if (onMenuClose && !showPopover) onMenuClose();
78
- }, [showPopover, onMenuOpen, onMenuClose]);
75
+ }, [setMenuState]);
79
76
  return React.useMemo(() => /*#__PURE__*/jsxRuntime.jsx(styled.StyledContainer, _objectSpread(_objectSpread(_objectSpread({
80
77
  "data-testid": ComboboxDataTestids.ComboboxDataTestid.CONTAINER,
81
78
  ref: setReferenceElement
@@ -86,7 +83,7 @@ const Container = () => {
86
83
  children: [_Controls2 || (_Controls2 = /*#__PURE__*/_jsx__default["default"](Controls.Controls, {})), /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
87
84
  customOffset: [0, 5],
88
85
  referenceElement: referenceElement,
89
- showPopover: showPopover,
86
+ showPopover: menuState,
90
87
  closeContextMenu: handleCloseMenu,
91
88
  startPlacementPreference: startPlacementPreference,
92
89
  placementOrderPreference: placementOrderPreference,
@@ -99,7 +96,7 @@ const Container = () => {
99
96
  onMouseDown: handleMouseDown
100
97
  }, void 0, _MenuList2 || (_MenuList2 = /*#__PURE__*/_jsx__default["default"](MenuList.MenuList, {})))))]
101
98
  })
102
- })), [inline, setReferenceElement, globalsAttrs, referenceElement, showPopover, xStyledProps, handleCloseMenu, startPlacementPreference, placementOrderPreference, withoutPortal, zIndex, handleMouseDown]);
99
+ })), [inline, setReferenceElement, globalsAttrs, referenceElement, menuState, xStyledProps, handleCloseMenu, startPlacementPreference, placementOrderPreference, withoutPortal, zIndex, handleMouseDown]);
103
100
  };
104
101
 
105
102
  exports.Container = Container;
@@ -2,30 +2,31 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
5
  var dsSystem = require('@elliemae/ds-system');
7
6
  var theming = require('../../theming.js');
8
7
 
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
12
-
13
- var _templateObject, _templateObject2;
14
8
  const StyledContainer = dsSystem.styled('div', {
15
9
  name: theming.DSComboBoxName,
16
10
  slot: theming.DSComboboxSlots.CONTAINER
17
- })(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n position: relative;\n cursor: ", ";\n"])), _ref => {
11
+ })`
12
+ position: relative;
13
+ cursor: ${_ref => {
18
14
  let {
19
15
  disabled
20
16
  } = _ref;
21
17
  return disabled ? 'not-allowed' : 'default';
22
- });
23
- const StyledPopperWrapper = dsSystem.styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n position: relative;\n cursor: ", ";\n overflow: auto;\n"])), _ref2 => {
18
+ }};
19
+ `;
20
+ const StyledPopperWrapper = dsSystem.styled('div')`
21
+ position: relative;
22
+ cursor: ${_ref2 => {
24
23
  let {
25
24
  disabled
26
25
  } = _ref2;
27
26
  return disabled ? 'not-allowed' : 'default';
28
- });
27
+ }};
28
+ overflow: auto;
29
+ `;
29
30
 
30
31
  exports.StyledContainer = StyledContainer;
31
32
  exports.StyledPopperWrapper = StyledPopperWrapper;
@@ -8,6 +8,7 @@ var DropdownIndicator = require('../DropdownIndicator.js');
8
8
  var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
9
9
  var ComboBoxCTX = require('../../ComboBoxCTX.js');
10
10
  var styled = require('./styled.js');
11
+ var listHelper = require('../../utils/listHelper.js');
11
12
  var MultiSelectedValuesContainer = require('../multi-selected-values-container/MultiSelectedValuesContainer.js');
12
13
  var ControlsInput = require('../controls-input/ControlsInput.js');
13
14
  var useOnPillsNavigation = require('./useOnPillsNavigation.js');
@@ -20,7 +21,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
20
21
 
21
22
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
22
23
 
23
- var _A11ySelectedValues, _A11yFocusedOption, _MultiSelectedValuesC, _ControlsInput, _DropdownIndicator;
24
+ var _A11ySelectedValues, _MultiSelectedValuesC, _A11yFocusedOption, _ControlsInput, _DropdownIndicator;
24
25
  const Controls = () => {
25
26
  const {
26
27
  props: {
@@ -32,50 +33,41 @@ const Controls = () => {
32
33
  innerRef
33
34
  },
34
35
  selectedOptionsRef,
35
- setShowPopover,
36
+ setMenuState,
36
37
  setFocusOptionIdx,
37
38
  hasFocus,
38
39
  listRef,
39
40
  focusOptionIdx,
40
- showPopover,
41
+ menuState,
41
42
  controlsWrapperRef
42
43
  } = React.useContext(ComboBoxCTX.ComboBoxContext);
43
44
  const handleOnClick = React.useCallback(() => {
44
- var _innerRef$current2;
45
-
46
45
  if (disabled) return;
47
46
 
48
- if (hasFocus && showPopover && !inline) {
49
- var _innerRef$current;
50
-
51
- setShowPopover(false);
47
+ if (hasFocus && menuState && !inline) {
48
+ setMenuState(false);
52
49
  setFocusOptionIdx('');
53
- (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.blur();
50
+ innerRef.current?.blur();
54
51
  return;
55
52
  }
56
53
 
57
- (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.focus();
58
- setShowPopover(true);
54
+ innerRef.current?.focus();
55
+ setMenuState(true);
59
56
  window.requestAnimationFrame(() => {
60
- if (listRef.current && window.scrollY < listRef.current.scrollHeight) {
61
- window.scrollTo({
62
- top: listRef.current.scrollHeight,
63
- behavior: 'smooth'
64
- });
65
- }
57
+ window.requestAnimationFrame(() => {
58
+ if (listRef.current) listHelper.scrollIfNeeded(listRef.current);
59
+ });
66
60
  }); // eslint-disable-next-line react-hooks/exhaustive-deps
67
- }, [disabled, listRef, hasFocus, showPopover, inline, innerRef, setShowPopover, focusOptionIdx]); // this callback prevent to toggle the menu when clicking or removing pills
61
+ }, [disabled, listRef, hasFocus, menuState, inline, innerRef, setMenuState, focusOptionIdx]); // this callback prevent to toggle the menu when clicking or removing pills
68
62
 
69
63
  const handleOnPillsClick = React.useCallback(e => {
70
- if (showPopover || disabled) {
64
+ if (menuState || disabled) {
71
65
  e.stopPropagation();
72
66
  } else {
73
- var _innerRef$current3;
74
-
75
- (_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.focus();
76
- setShowPopover(true);
67
+ innerRef.current?.focus();
68
+ setMenuState(true);
77
69
  }
78
- }, [showPopover, innerRef, disabled, setShowPopover]); // callback to prevent onBlur on the input when clicking in all the wrapper
70
+ }, [menuState, innerRef, disabled, setMenuState]); // callback to prevent onBlur on the input when clicking in all the wrapper
79
71
 
80
72
  const handleOnMouseDown = React.useCallback(e => {
81
73
  if (document.activeElement === innerRef.current || inline) {
@@ -100,12 +92,12 @@ const Controls = () => {
100
92
  children: [!inline && /*#__PURE__*/jsxRuntime.jsxs(styled.StyledSelection, {
101
93
  ref: selectedOptionsRef,
102
94
  onClick: handleOnPillsClick,
103
- children: [_A11ySelectedValues || (_A11ySelectedValues = /*#__PURE__*/_jsx__default["default"](A11ySelectedValues.A11ySelectedValues, {})), _A11yFocusedOption || (_A11yFocusedOption = /*#__PURE__*/_jsx__default["default"](A11yFocusedOption.A11yFocusedOption, {})), Array.isArray(selectedValues) ? _MultiSelectedValuesC || (_MultiSelectedValuesC = /*#__PURE__*/_jsx__default["default"](MultiSelectedValuesContainer.MultiSelectedValuesContainer, {})) : /*#__PURE__*/_jsx__default["default"]("div", {
95
+ children: [_A11ySelectedValues || (_A11ySelectedValues = /*#__PURE__*/_jsx__default["default"](A11ySelectedValues.A11ySelectedValues, {})), Array.isArray(selectedValues) ? _MultiSelectedValuesC || (_MultiSelectedValuesC = /*#__PURE__*/_jsx__default["default"](MultiSelectedValuesContainer.MultiSelectedValuesContainer, {})) : /*#__PURE__*/_jsx__default["default"]("div", {
104
96
  "data-testid": ComboboxDataTestids.ComboboxDataTestid.SELECTED_VALUES
105
97
  }, void 0, selectedValues && /*#__PURE__*/_jsx__default["default"](RemovableSelectedValuePill.RemovableSelectedValuePill, {
106
98
  pill: selectedValues
107
99
  }))]
108
- }), _ControlsInput || (_ControlsInput = /*#__PURE__*/_jsx__default["default"](ControlsInput.ControlsInput, {})), !inline && /*#__PURE__*/_jsx__default["default"](styled.StyledHeaderActionsWrapper, {
100
+ }), _A11yFocusedOption || (_A11yFocusedOption = /*#__PURE__*/_jsx__default["default"](A11yFocusedOption.A11yFocusedOption, {})), _ControlsInput || (_ControlsInput = /*#__PURE__*/_jsx__default["default"](ControlsInput.ControlsInput, {})), !inline && /*#__PURE__*/_jsx__default["default"](styled.StyledHeaderActionsWrapper, {
109
101
  justifyContent: "center",
110
102
  cols: ['min-content', 'min-content']
111
103
  }, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyleHeaderActionsSeparator, {
@@ -2,66 +2,98 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
5
  var dsSystem = require('@elliemae/ds-system');
7
6
  var dsGrid = require('@elliemae/ds-grid');
8
7
  var theming = require('../../theming.js');
9
8
 
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
13
-
14
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
15
- const normalBorder = dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n border: 1px solid ", ";\n"])), _ref => {
9
+ const normalBorder = dsSystem.css`
10
+ border: 1px solid ${_ref => {
16
11
  let {
17
12
  hasError,
18
13
  theme
19
14
  } = _ref;
20
15
  return hasError ? theme.colors.danger[900] : theme.colors.neutral[400];
21
- });
22
- const focusBorder = dsSystem.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n outline: 2px solid ", ";\n outline-offset: -2px;\n"])), _ref2 => {
16
+ }};
17
+ `;
18
+ const focusBorder = dsSystem.css`
19
+ outline: 2px solid ${_ref2 => {
23
20
  let {
24
21
  theme
25
22
  } = _ref2;
26
23
  return theme.colors.brand[700];
27
- });
28
- const hoverBorder = dsSystem.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n border: 1px solid ", ";\n"])), _ref3 => {
24
+ }};
25
+ outline-offset: -2px;
26
+ `;
27
+ const hoverBorder = dsSystem.css`
28
+ border: 1px solid ${_ref3 => {
29
29
  let {
30
30
  theme
31
31
  } = _ref3;
32
32
  return theme.colors.brand[700];
33
- });
33
+ }};
34
+ `;
34
35
  const StyledControlsWrapper = dsSystem.styled(dsGrid.Grid, {
35
36
  name: theming.DSComboBoxName,
36
37
  slot: theming.DSComboboxSlots.INPUT_WRAPPER
37
- })(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral__default["default"](["\n background: ", ";\n position: relative;\n border-radius: 2px;\n min-width: ", ";\n align-items: center;\n align-content: center;\n height: 28px;\n padding-left: 8px;\n margin: ", ";\n ", "\n &:hover {\n ", "\n }\n &:focus-within {\n ", "\n }\n"])), _ref4 => {
38
+ })`
39
+ background: ${_ref4 => {
38
40
  let {
39
41
  disabled,
40
42
  theme
41
43
  } = _ref4;
42
44
  return disabled ? theme.colors.neutral['080'] : '#ffffff';
43
- }, _ref5 => {
45
+ }};
46
+ position: relative;
47
+ border-radius: 2px;
48
+ min-width: ${_ref5 => {
44
49
  let {
45
50
  minWidth,
46
51
  inline
47
52
  } = _ref5;
48
- return inline || !minWidth ? '' : "".concat(minWidth, "px");
49
- }, _ref6 => {
53
+ return inline || !minWidth ? '' : `${minWidth}px`;
54
+ }};
55
+ align-items: center;
56
+ align-content: center;
57
+ height: 28px;
58
+ padding-left: 8px;
59
+ margin: ${_ref6 => {
50
60
  let {
51
61
  inline
52
62
  } = _ref6;
53
63
  return inline ? '10px 16px' : '';
54
- }, normalBorder, hoverBorder, focusBorder);
55
- const StyledSelection = dsSystem.styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral__default["default"](["\n font-size: 13px;\n margin-right: 3px;\n display: flex;\n"])));
56
- const StyledHeaderActionsWrapper = dsSystem.styled(dsGrid.Grid)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral__default["default"](["\n height: 100%;\n .em-ds-button--text:focus::after {\n border: none;\n }\n"])));
57
- const StyleDropdownIndicator = dsSystem.styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral__default["default"]([""])));
58
- const StyleHeaderActionsSeparator = dsSystem.styled.span(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral__default["default"](["\n align-self: stretch;\n margin: 4px 0px;\n width: 1px;\n background-color: ", ";\n"])), _ref7 => {
64
+ }};
65
+ ${normalBorder}
66
+ &:hover {
67
+ ${hoverBorder}
68
+ }
69
+ &:focus-within {
70
+ ${focusBorder}
71
+ }
72
+ `;
73
+ const StyledSelection = dsSystem.styled.div`
74
+ font-size: 13px;
75
+ margin-right: 3px;
76
+ display: flex;
77
+ `;
78
+ const StyledHeaderActionsWrapper = dsSystem.styled(dsGrid.Grid)`
79
+ height: 100%;
80
+ .em-ds-button--text:focus::after {
81
+ border: none;
82
+ }
83
+ `;
84
+ const StyleDropdownIndicator = dsSystem.styled.div``;
85
+ const StyleHeaderActionsSeparator = dsSystem.styled.span`
86
+ align-self: stretch;
87
+ margin: 4px 0px;
88
+ width: 1px;
89
+ background-color: ${_ref7 => {
59
90
  let {
60
91
  theme,
61
92
  disabled
62
93
  } = _ref7;
63
94
  return disabled ? theme.colors.neutral['400'] : theme.colors.neutral['500'];
64
- });
95
+ }};
96
+ `;
65
97
 
66
98
  exports.StyleDropdownIndicator = StyleDropdownIndicator;
67
99
  exports.StyleHeaderActionsSeparator = StyleHeaderActionsSeparator;
@@ -13,7 +13,7 @@ const useOnPillsNavigation = () => {
13
13
  },
14
14
  inputValue,
15
15
  hasFocus,
16
- setShowPopover,
16
+ setMenuState,
17
17
  selectedOptionsRef
18
18
  } = React.useContext(ComboBoxCTX.ComboBoxContext); // todo: constant must be defined on pills component
19
19
 
@@ -21,33 +21,25 @@ const useOnPillsNavigation = () => {
21
21
  const onKeyDownPills = React.useCallback(e => {
22
22
  if ((e.key === 'ArrowLeft' || e.key === 'ArrowRight' || e.key === 'ArrowUp' || e.key === 'ArrowDown') && inputValue === '') {
23
23
  if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
24
- var _innerRef$current;
25
-
26
- (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
27
- setShowPopover(true);
24
+ innerRef.current?.focus();
25
+ setMenuState(true, 'open', e);
28
26
  return;
29
27
  }
30
28
 
31
29
  if (e.key === 'ArrowLeft') {
32
- var _selectedOptionsRef$c;
33
-
34
- const removablePills = (_selectedOptionsRef$c = selectedOptionsRef.current) === null || _selectedOptionsRef$c === void 0 ? void 0 : _selectedOptionsRef$c.querySelectorAll(REMOVABLE_PILL_SELECTOR);
30
+ const removablePills = selectedOptionsRef.current?.querySelectorAll(REMOVABLE_PILL_SELECTOR);
35
31
 
36
32
  if (hasFocus && removablePills) {
37
- var _removablePills;
38
-
39
- (_removablePills = removablePills[removablePills.length - 1]) === null || _removablePills === void 0 ? void 0 : _removablePills.focus();
33
+ removablePills[removablePills.length - 1]?.focus();
40
34
  }
41
35
  }
42
36
 
43
37
  if (e.key === 'ArrowRight') {
44
- var _innerRef$current2;
45
-
46
38
  e.preventDefault();
47
- (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.focus();
39
+ innerRef.current?.focus();
48
40
  }
49
41
  }
50
- }, [inputValue, hasFocus, innerRef, selectedOptionsRef, setShowPopover]);
42
+ }, [inputValue, innerRef, setMenuState, selectedOptionsRef, hasFocus]);
51
43
  return {
52
44
  onKeyDownPills
53
45
  };
@@ -27,7 +27,7 @@ const ControlsInput = () => {
27
27
  },
28
28
  focusOptionIdx,
29
29
  inputValue,
30
- showPopover
30
+ menuState
31
31
  } = React.useContext(ComboBoxCTX.ComboBoxContext);
32
32
  const {
33
33
  onInputKeyDown
@@ -52,7 +52,7 @@ const ControlsInput = () => {
52
52
  placeholder: placeholder,
53
53
  "aria-controls": "combo-listbox",
54
54
  "aria-activedescendant": focusOptionIdx,
55
- "aria-expanded": showPopover,
55
+ "aria-expanded": menuState,
56
56
  "aria-haspopup": "listbox",
57
57
  "aria-describedby": "combobox-selected-items",
58
58
  role: "combobox",
@@ -2,27 +2,57 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
5
  var dsSystem = require('@elliemae/ds-system');
7
6
  var theming = require('../../theming.js');
8
7
 
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
12
-
13
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
14
8
  const StyledInput = dsSystem.styled('input', {
15
9
  name: theming.DSComboBoxName,
16
10
  slot: theming.DSComboboxSlots.INPUT
17
- })(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n font-size: 13px;\n line-height: 13px;\n border: none;\n padding: 0;\n outline: none;\n color: ", ";\n &:focus {\n outline: none;\n }\n ", "\n &::placeholder {\n color: transparent;\n }\n"])), props => props.theme.colors.neutral[700], _ref => {
11
+ })`
12
+ font-size: 13px;
13
+ line-height: 13px;
14
+ border: none;
15
+ padding: 0;
16
+ outline: none;
17
+ color: ${props => props.theme.colors.neutral[700]};
18
+ &:focus {
19
+ outline: none;
20
+ }
21
+ ${_ref => {
18
22
  let {
19
23
  withoutCaret
20
24
  } = _ref;
21
25
  return withoutCaret && 'caret-color: transparent;';
22
- });
23
- const StyledInputPlaceHolder = dsSystem.styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n font-style: italic;\n color: ", ";\n position: absolute;\n display: flex;\n align-items: center;\n width: 100%;\n user-select: none;\n height: 28px;\n font-size: 13px;\n & span::after {\n content: '';\n padding: 1px;\n }\n"])), props => props.theme.colors.neutral[500]);
24
- const StyledInputWidthReference = dsSystem.styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n visibility: hidden;\n position: absolute;\n top: -9999px;\n"])));
25
- const StyledInputWrapper = dsSystem.styled('div')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral__default["default"](["\n position: relative;\n align-items: center;\n display: flex;\n"])));
26
+ }}
27
+ &::placeholder {
28
+ color: transparent;
29
+ }
30
+ `;
31
+ const StyledInputPlaceHolder = dsSystem.styled.div`
32
+ font-style: italic;
33
+ color: ${props => props.theme.colors.neutral[500]};
34
+ position: absolute;
35
+ display: flex;
36
+ align-items: center;
37
+ width: 100%;
38
+ user-select: none;
39
+ height: 28px;
40
+ font-size: 13px;
41
+ & span::after {
42
+ content: '';
43
+ padding: 1px;
44
+ }
45
+ `;
46
+ const StyledInputWidthReference = dsSystem.styled.span`
47
+ visibility: hidden;
48
+ position: absolute;
49
+ top: -9999px;
50
+ `;
51
+ const StyledInputWrapper = dsSystem.styled('div')`
52
+ position: relative;
53
+ align-items: center;
54
+ display: flex;
55
+ `;
26
56
 
27
57
  exports.StyledInput = StyledInput;
28
58
  exports.StyledInputPlaceHolder = StyledInputPlaceHolder;
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
- require('core-js/modules/es.string.replace.js');
7
5
  var React = require('react');
8
6
  var useMaskedOnChange = require('./useMaskedOnChange.js');
9
7
  var ComboBoxCTX = require('../../ComboBoxCTX.js');
@@ -19,6 +17,7 @@ const useControlsInput = () => {
19
17
  },
20
18
  setHasFocus,
21
19
  inputValue,
20
+ setMenuState,
22
21
  setInputValue
23
22
  } = React.useContext(ComboBoxCTX.ComboBoxContext);
24
23
  const [width, setWidth] = React.useState(1); // use span reference to calculate the real width for the input
@@ -27,18 +26,16 @@ const useControlsInput = () => {
27
26
  const showPlaceholder = !inputValue && listHelper.isSelectedValueEmpty(selectedValues) ? placeholder : null;
28
27
  const spanReferenceText = inputValue.replace(/\s/g, '\u00a0');
29
28
  React.useEffect(() => {
30
- var _spanReference$curren;
31
-
32
- setWidth((_spanReference$curren = spanReference.current) !== null && _spanReference$curren !== void 0 && _spanReference$curren.offsetWidth ? spanReference.current.offsetWidth + 2 : 1);
29
+ setWidth(spanReference.current?.offsetWidth ? spanReference.current.offsetWidth + 2 : 1);
33
30
  }, [inputValue]); // if we se an input mask we configure inside here the proper mask
34
31
  // or a stardard combobox onchange event
35
32
 
36
33
  const handleOnChange = useMaskedOnChange.useMaskedOnChange();
37
34
  const handleOnBlur = React.useCallback(() => {
38
35
  setInputValue('');
39
- if (onFilter) onFilter(allOptions, inputValue);
36
+ if (onFilter) onFilter(allOptions);
40
37
  setHasFocus(false);
41
- }, [setInputValue, onFilter, allOptions, inputValue, setHasFocus]);
38
+ }, [setInputValue, onFilter, allOptions, setHasFocus]);
42
39
  const handleOnFocus = React.useCallback(() => {
43
40
  setHasFocus(true);
44
41
  }, [setHasFocus]);