@elliemae/ds-form-combobox 3.62.1 → 3.70.0-alpha.9

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 (160) hide show
  1. package/dist/cjs/ComboBox.js +9 -1
  2. package/dist/cjs/ComboBox.js.map +2 -2
  3. package/dist/cjs/DSComboboxMultiT.js +3 -1
  4. package/dist/cjs/DSComboboxMultiT.js.map +2 -2
  5. package/dist/cjs/DSComboboxSingleT.js +2 -0
  6. package/dist/cjs/DSComboboxSingleT.js.map +2 -2
  7. package/dist/cjs/DSCommonComboboxPropsT.js.map +1 -1
  8. package/dist/cjs/{config/useClickOutside.js → TruncatedText.js} +17 -22
  9. package/dist/cjs/TruncatedText.js.map +7 -0
  10. package/dist/cjs/config/useComboBox.js.map +2 -2
  11. package/dist/cjs/constants/index.js +32 -4
  12. package/dist/cjs/constants/index.js.map +2 -2
  13. package/dist/cjs/parts/DropdownIndicator.js +2 -2
  14. package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
  15. package/dist/cjs/parts/LiveRegion.js +13 -1
  16. package/dist/cjs/parts/LiveRegion.js.map +2 -2
  17. package/dist/cjs/parts/Section.js +8 -12
  18. package/dist/cjs/parts/Section.js.map +2 -2
  19. package/dist/cjs/parts/container/Container.js +21 -15
  20. package/dist/cjs/parts/container/Container.js.map +2 -2
  21. package/dist/cjs/parts/container/styled.js +7 -4
  22. package/dist/cjs/parts/container/styled.js.map +2 -2
  23. package/dist/cjs/parts/controls/Controls.js +35 -15
  24. package/dist/cjs/parts/controls/Controls.js.map +2 -2
  25. package/dist/cjs/parts/controls/styled.js +36 -14
  26. package/dist/cjs/parts/controls/styled.js.map +2 -2
  27. package/dist/cjs/parts/controls-input/ControlsInput.js +22 -9
  28. package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
  29. package/dist/cjs/parts/controls-input/styled.js +33 -13
  30. package/dist/cjs/parts/controls-input/styled.js.map +2 -2
  31. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +13 -3
  32. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  33. package/dist/cjs/parts/controls-input/useMaskedOnChange.js +1 -1
  34. package/dist/cjs/parts/controls-input/useMaskedOnChange.js.map +2 -2
  35. package/dist/cjs/parts/menu-list/LoadingContainer.js +28 -2
  36. package/dist/cjs/parts/menu-list/LoadingContainer.js.map +2 -2
  37. package/dist/cjs/parts/menu-list/MenuList.js +12 -4
  38. package/dist/cjs/parts/menu-list/MenuList.js.map +2 -2
  39. package/dist/cjs/parts/menu-list/SkeletonContainer.js +20 -1
  40. package/dist/cjs/parts/menu-list/SkeletonContainer.js.map +2 -2
  41. package/dist/cjs/parts/menu-list/styled.js +35 -5
  42. package/dist/cjs/parts/menu-list/styled.js.map +2 -2
  43. package/dist/cjs/parts/menu-list/useItemRenderer.js +35 -44
  44. package/dist/cjs/parts/menu-list/useItemRenderer.js.map +3 -3
  45. package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  46. package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +2 -2
  47. package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js +6 -1
  48. package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
  49. package/dist/cjs/parts/styled.js +9 -2
  50. package/dist/cjs/parts/styled.js.map +2 -2
  51. package/dist/cjs/react-desc-prop-types.js +2 -0
  52. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  53. package/dist/cjs/typescript-testing/slot-props.js +82 -0
  54. package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
  55. package/dist/cjs/typescript-testing/typescript-combobox-multi-valid.js +158 -0
  56. package/dist/cjs/typescript-testing/typescript-combobox-multi-valid.js.map +7 -0
  57. package/dist/cjs/typescript-testing/typescript-combobox-single-valid.js +158 -0
  58. package/dist/cjs/typescript-testing/typescript-combobox-single-valid.js.map +7 -0
  59. package/dist/cjs/utils/listHelper.js +2 -1
  60. package/dist/cjs/utils/listHelper.js.map +2 -2
  61. package/dist/cjs/utils/typeGuards.js +36 -0
  62. package/dist/cjs/utils/typeGuards.js.map +7 -0
  63. package/dist/esm/ComboBox.js +10 -2
  64. package/dist/esm/ComboBox.js.map +2 -2
  65. package/dist/esm/DSComboboxMultiT.js +9 -2
  66. package/dist/esm/DSComboboxMultiT.js.map +2 -2
  67. package/dist/esm/DSComboboxSingleT.js +8 -1
  68. package/dist/esm/DSComboboxSingleT.js.map +2 -2
  69. package/dist/esm/DSCommonComboboxPropsT.js.map +1 -1
  70. package/dist/esm/TruncatedText.js +17 -0
  71. package/dist/esm/TruncatedText.js.map +7 -0
  72. package/dist/esm/config/useComboBox.js.map +2 -2
  73. package/dist/esm/constants/index.js +32 -4
  74. package/dist/esm/constants/index.js.map +2 -2
  75. package/dist/esm/parts/DropdownIndicator.js +3 -3
  76. package/dist/esm/parts/DropdownIndicator.js.map +2 -2
  77. package/dist/esm/parts/LiveRegion.js +13 -1
  78. package/dist/esm/parts/LiveRegion.js.map +2 -2
  79. package/dist/esm/parts/Section.js +9 -13
  80. package/dist/esm/parts/Section.js.map +2 -2
  81. package/dist/esm/parts/container/Container.js +21 -15
  82. package/dist/esm/parts/container/Container.js.map +2 -2
  83. package/dist/esm/parts/container/styled.js +7 -4
  84. package/dist/esm/parts/container/styled.js.map +2 -2
  85. package/dist/esm/parts/controls/Controls.js +35 -15
  86. package/dist/esm/parts/controls/Controls.js.map +2 -2
  87. package/dist/esm/parts/controls/styled.js +37 -15
  88. package/dist/esm/parts/controls/styled.js.map +2 -2
  89. package/dist/esm/parts/controls-input/ControlsInput.js +22 -9
  90. package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
  91. package/dist/esm/parts/controls-input/styled.js +34 -14
  92. package/dist/esm/parts/controls-input/styled.js.map +2 -2
  93. package/dist/esm/parts/controls-input/useKeyboardNavigation.js +13 -3
  94. package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  95. package/dist/esm/parts/controls-input/useMaskedOnChange.js +1 -1
  96. package/dist/esm/parts/controls-input/useMaskedOnChange.js.map +2 -2
  97. package/dist/esm/parts/menu-list/LoadingContainer.js +28 -2
  98. package/dist/esm/parts/menu-list/LoadingContainer.js.map +2 -2
  99. package/dist/esm/parts/menu-list/MenuList.js +12 -4
  100. package/dist/esm/parts/menu-list/MenuList.js.map +2 -2
  101. package/dist/esm/parts/menu-list/SkeletonContainer.js +20 -1
  102. package/dist/esm/parts/menu-list/SkeletonContainer.js.map +2 -2
  103. package/dist/esm/parts/menu-list/styled.js +35 -5
  104. package/dist/esm/parts/menu-list/styled.js.map +2 -2
  105. package/dist/esm/parts/menu-list/useItemRenderer.js +35 -44
  106. package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
  107. package/dist/esm/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  108. package/dist/esm/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +2 -2
  109. package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js +6 -1
  110. package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
  111. package/dist/esm/parts/styled.js +9 -2
  112. package/dist/esm/parts/styled.js.map +2 -2
  113. package/dist/esm/react-desc-prop-types.js +8 -1
  114. package/dist/esm/react-desc-prop-types.js.map +2 -2
  115. package/dist/esm/typescript-testing/slot-props.js +59 -0
  116. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  117. package/dist/esm/typescript-testing/typescript-combobox-multi-valid.js +135 -0
  118. package/dist/esm/typescript-testing/typescript-combobox-multi-valid.js.map +7 -0
  119. package/dist/esm/typescript-testing/typescript-combobox-single-valid.js +135 -0
  120. package/dist/esm/typescript-testing/typescript-combobox-single-valid.js.map +7 -0
  121. package/dist/esm/utils/listHelper.js +2 -1
  122. package/dist/esm/utils/listHelper.js.map +2 -2
  123. package/dist/esm/utils/typeGuards.js +6 -0
  124. package/dist/esm/utils/typeGuards.js.map +7 -0
  125. package/dist/types/ComboBox.d.ts +1 -1
  126. package/dist/types/DSComboboxMultiT.d.ts +5 -3
  127. package/dist/types/DSComboboxSingleT.d.ts +5 -3
  128. package/dist/types/DSCommonComboboxPropsT.d.ts +1 -1
  129. package/dist/types/TruncatedText.d.ts +13 -0
  130. package/dist/types/constants/index.d.ts +80 -2
  131. package/dist/types/parts/LiveRegion.d.ts +22 -1
  132. package/dist/types/parts/Section.d.ts +5 -5
  133. package/dist/types/parts/controls/styled.d.ts +1 -1
  134. package/dist/types/parts/controls-input/styled.d.ts +4 -2
  135. package/dist/types/parts/menu-list/LoadingContainer.d.ts +5 -2
  136. package/dist/types/parts/menu-list/SkeletonContainer.d.ts +2 -1
  137. package/dist/types/parts/menu-list/styled.d.ts +21 -2
  138. package/dist/types/parts/menu-list/useItemRenderer.d.ts +2 -1
  139. package/dist/types/parts/multi-selected-values-container/RemovableSelectedValuePill.d.ts +1 -1
  140. package/dist/types/react-desc-prop-types.d.ts +29 -1
  141. package/dist/types/utils/listHelper.d.ts +2 -2
  142. package/dist/types/utils/typeGuards.d.ts +2 -0
  143. package/package.json +19 -19
  144. package/dist/cjs/config/useClickOutside.js.map +0 -7
  145. package/dist/esm/config/useClickOutside.js +0 -22
  146. package/dist/esm/config/useClickOutside.js.map +0 -7
  147. package/dist/types/config/useClickOutside.d.ts +0 -1
  148. package/dist/types/tests/DSCombobox.exports.test.d.ts +0 -1
  149. package/dist/types/tests/DSCombobox.get-owner-props.test.d.ts +0 -1
  150. package/dist/types/tests/a11y.test.d.ts +0 -1
  151. package/dist/types/tests/creatable.test.d.ts +0 -1
  152. package/dist/types/tests/disabled.test.d.ts +0 -1
  153. package/dist/types/tests/force-focus-first-option-on-type.test.d.ts +0 -1
  154. package/dist/types/tests/general.test.d.ts +0 -1
  155. package/dist/types/tests/multi-select.test.d.ts +0 -1
  156. package/dist/types/tests/onlyselectable.test.d.ts +0 -1
  157. package/dist/types/tests/read-only.test.d.ts +0 -1
  158. package/dist/types/tests/single-select.test.d.ts +0 -1
  159. package/dist/types/tests/usemask.test.d.ts +0 -1
  160. package/dist/types/tests/utils.d.ts +0 -30
@@ -1,10 +1,10 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useOwnerProps } from "@elliemae/ds-props-helpers";
4
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
5
4
  import { useCallback, useContext, useMemo } from "react";
6
5
  import ComboBoxContext from "../../ComboBoxCTX.js";
7
6
  import { ComboboxDataTestid } from "../../ComboboxDataTestids.js";
7
+ import { TruncatedText } from "../../TruncatedText.js";
8
8
  import { ControlsInput } from "../controls-input/ControlsInput.js";
9
9
  import { DropdownIndicator } from "../DropdownIndicator.js";
10
10
  import { MultiSelectedValuesContainer } from "../multi-selected-values-container/index.js";
@@ -90,28 +90,39 @@ const Controls = () => {
90
90
  getOwnerProps,
91
91
  getOwnerPropsArguments,
92
92
  innerRef: controlsWrapperRef,
93
- readOnly,
93
+ readOnly: readOnly ?? false,
94
94
  cols,
95
- disabled,
96
- applyAriaDisabled,
97
- hasError,
98
- inline,
95
+ disabled: disabled ?? false,
96
+ applyAriaDisabled: applyAriaDisabled ?? false,
97
+ hasError: hasError ?? false,
98
+ inline: inline ?? false,
99
99
  onClick: handleOnClick,
100
100
  onMouseDown: handleOnMouseDown,
101
101
  onKeyDown: onKeyDownPills,
102
102
  "aria-disabled": applyAriaDisabled,
103
103
  "data-testid": ComboboxDataTestid.CONTROLS_WRAPPER,
104
104
  children: [
105
- !inline && /* @__PURE__ */ jsx(StyledSelection, { innerRef: selectedOptionsRef, onClick: handleOnPillsClick, children: Array.isArray(selectedValues) ? /* @__PURE__ */ jsx(MultiSelectedValuesContainer, {}) : /* @__PURE__ */ jsx(
106
- StyledSingleSelectWraper,
105
+ !inline && /* @__PURE__ */ jsx(
106
+ StyledSelection,
107
107
  {
108
- readOnly,
109
- "data-testid": ComboboxDataTestid.SELECTED_VALUES,
110
- disabled,
111
- applyAriaDisabled,
112
- children: selectedValues && inputValue === "" ? /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: selectedValues.label }) : null
108
+ variant: "b2",
109
+ component: "div",
110
+ innerRef: selectedOptionsRef,
111
+ onClick: handleOnPillsClick,
112
+ getOwnerProps,
113
+ children: Array.isArray(selectedValues) ? /* @__PURE__ */ jsx(MultiSelectedValuesContainer, {}) : /* @__PURE__ */ jsx(
114
+ StyledSingleSelectWraper,
115
+ {
116
+ readOnly: readOnly ?? false,
117
+ "data-testid": ComboboxDataTestid.SELECTED_VALUES,
118
+ disabled: disabled ?? false,
119
+ applyAriaDisabled: applyAriaDisabled ?? false,
120
+ getOwnerProps,
121
+ children: selectedValues && inputValue === "" ? /* @__PURE__ */ jsx(TruncatedText, { value: selectedValues.label }) : null
122
+ }
123
+ )
113
124
  }
114
- ) }),
125
+ ),
115
126
  /* @__PURE__ */ jsx(ControlsInput, {}),
116
127
  /* @__PURE__ */ jsx("div", {}),
117
128
  !inline && /* @__PURE__ */ jsxs(
@@ -120,8 +131,17 @@ const Controls = () => {
120
131
  justifyItems: "center",
121
132
  cols: ["min-content", "minmax(28px,max-content)"],
122
133
  justifyContent: "flex-end",
134
+ getOwnerProps,
123
135
  children: [
124
- /* @__PURE__ */ jsx(StyleHeaderActionsSeparator, { disabled, applyAriaDisabled, readOnly }),
136
+ /* @__PURE__ */ jsx(
137
+ StyleHeaderActionsSeparator,
138
+ {
139
+ disabled,
140
+ applyAriaDisabled,
141
+ readOnly,
142
+ getOwnerProps
143
+ }
144
+ ),
125
145
  /* @__PURE__ */ jsx(DropdownIndicator, {})
126
146
  ]
127
147
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/controls/Controls.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport {\n StyledControlsWrapper,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n StyleHeaderActionsSeparator,\n} from './styled.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\n\nexport const Controls = (): JSX.Element => {\n const {\n props,\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (applyAriaDisabled || shouldPreventContextMenuOpening) {\n internalRef.current?.focus();\n return;\n }\n if (hasFocus && menuState && !inline) {\n setMenuState(false, 'click');\n setFocusOptionIdx('');\n internalRef.current?.blur();\n return;\n }\n internalRef.current?.focus();\n setMenuState(true, 'click');\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n disabled,\n listRef,\n hasFocus,\n menuState,\n inline,\n setMenuState,\n focusOptionIdx,\n readOnly,\n applyAriaDisabled,\n isMenuOpenableWithReadOnly,\n ]);\n\n // this callback prevent to toggle the menu when clicking or removing pills\n const handleOnPillsClick: React.MouseEventHandler = useCallback(\n (e) => {\n if (applyAriaDisabled) return;\n if (menuState || disabled || shouldPreventContextMenuOpening) {\n e.stopPropagation();\n } else {\n internalRef.current?.focus();\n setMenuState(true, 'pill-click');\n }\n },\n [applyAriaDisabled, menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening],\n );\n\n // callback to prevent onBlur on the input when clicking in all the wrapper\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n (e) => {\n if (document.activeElement === internalRef.current || inline) {\n e.preventDefault();\n }\n },\n [internalRef, inline],\n );\n\n const { onKeyDownPills } = useOnPillsNavigation();\n\n const cols = useMemo(\n () => (!inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '8px', '2.231rem'] : ['minmax(0px, auto)']),\n [inline],\n );\n return (\n <StyledControlsWrapper\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={controlsWrapperRef}\n readOnly={readOnly}\n cols={cols}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n inline={inline}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n onKeyDown={onKeyDownPills}\n aria-disabled={applyAriaDisabled}\n data-testid={ComboboxDataTestid.CONTROLS_WRAPPER}\n >\n {!inline && (\n <StyledSelection innerRef={selectedOptionsRef} onClick={handleOnPillsClick}>\n {Array.isArray(selectedValues) ? (\n <MultiSelectedValuesContainer />\n ) : (\n <StyledSingleSelectWraper\n readOnly={readOnly}\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n >\n {selectedValues && inputValue === '' ? <SimpleTruncatedTooltipText value={selectedValues.label} /> : null}\n </StyledSingleSelectWraper>\n )}\n </StyledSelection>\n )}\n\n <ControlsInput />\n {/** This empty div is a gap between the input and the drop down indicator */}\n <div />\n {!inline && (\n <StyledHeaderActionsWrapper\n justifyItems=\"center\"\n cols={['min-content', 'minmax(28px,max-content)']}\n justifyContent=\"flex-end\"\n >\n <StyleHeaderActionsSeparator disabled={disabled} applyAriaDisabled={applyAriaDisabled} readOnly={readOnly} />\n <DropdownIndicator />\n </St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AAAA,YAEf;AAAA,kCAAC,+BAA4B,UAAoB,mBAAsC,UAAoB;AAAA,cAC3G,oBAAC,qBAAkB;AAAA;AAAA;AAAA,QACrB;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { TruncatedText } from '../../TruncatedText.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport {\n StyledControlsWrapper,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n StyleHeaderActionsSeparator,\n} from './styled.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\n\nexport const Controls = (): JSX.Element => {\n const {\n props,\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (applyAriaDisabled || shouldPreventContextMenuOpening) {\n internalRef.current?.focus();\n return;\n }\n if (hasFocus && menuState && !inline) {\n setMenuState(false, 'click');\n setFocusOptionIdx('');\n internalRef.current?.blur();\n return;\n }\n internalRef.current?.focus();\n setMenuState(true, 'click');\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n disabled,\n listRef,\n hasFocus,\n menuState,\n inline,\n setMenuState,\n focusOptionIdx,\n readOnly,\n applyAriaDisabled,\n isMenuOpenableWithReadOnly,\n ]);\n\n // this callback prevent to toggle the menu when clicking or removing pills\n const handleOnPillsClick: React.MouseEventHandler = useCallback(\n (e) => {\n if (applyAriaDisabled) return;\n if (menuState || disabled || shouldPreventContextMenuOpening) {\n e.stopPropagation();\n } else {\n internalRef.current?.focus();\n setMenuState(true, 'pill-click');\n }\n },\n [applyAriaDisabled, menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening],\n );\n\n // callback to prevent onBlur on the input when clicking in all the wrapper\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n (e) => {\n if (document.activeElement === internalRef.current || inline) {\n e.preventDefault();\n }\n },\n [internalRef, inline],\n );\n\n const { onKeyDownPills } = useOnPillsNavigation();\n\n const cols = useMemo(\n () => (!inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '8px', '2.231rem'] : ['minmax(0px, auto)']),\n [inline],\n );\n return (\n <StyledControlsWrapper\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={controlsWrapperRef}\n readOnly={readOnly ?? false}\n cols={cols}\n disabled={disabled ?? false}\n applyAriaDisabled={applyAriaDisabled ?? false}\n hasError={hasError ?? false}\n inline={inline ?? false}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n onKeyDown={onKeyDownPills}\n aria-disabled={applyAriaDisabled}\n data-testid={ComboboxDataTestid.CONTROLS_WRAPPER}\n >\n {!inline && (\n <StyledSelection\n variant=\"b2\"\n component=\"div\"\n innerRef={selectedOptionsRef}\n onClick={handleOnPillsClick}\n getOwnerProps={getOwnerProps}\n >\n {Array.isArray(selectedValues) ? (\n <MultiSelectedValuesContainer />\n ) : (\n <StyledSingleSelectWraper\n readOnly={readOnly ?? false}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n disabled={disabled ?? false}\n applyAriaDisabled={applyAriaDisabled ?? false}\n getOwnerProps={getOwnerProps}\n >\n {selectedValues && inputValue === '' ? <TruncatedText value={selectedValues.label} /> : null}\n </StyledSingleSelectWraper>\n )}\n </StyledSelection>\n )}\n\n <ControlsInput />\n {/** This empty div is a gap between the input and the drop down indicator */}\n <div />\n {!inline && (\n <StyledHeaderActionsWrapper\n justifyItems=\"center\"\n cols={['min-content', 'minmax(28px,max-content)']}\n justifyContent=\"flex-end\"\n getOwnerProps={getOwnerProps}\n >\n <StyleHeaderActionsSeparator\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n />\n <DropdownIndicator />\n </StyledHeaderActionsWrapper>\n )}\n </StyledControlsWrapper>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC2HX,cAoBJ,YApBI;AAzHZ,SAAS,qBAAqB;AAC9B,SAAgB,aAAa,YAAY,eAAe;AACxD,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AAE9B,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,QAAQ,UAAU,UAAU,gBAAgB,mBAAmB,UAAU,2BAA2B;AAAA,IAC7G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM,gBAAgB,YAAY,MAAM;AACtC,QAAI,SAAU;AACd,QAAI,qBAAqB,iCAAiC;AACxD,kBAAY,SAAS,MAAM;AAC3B;AAA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AA,MACf,eAAa,mBAAmB;AAAA,MAE/B;AAAA,SAAC,UACA;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,WAAU;AAAA,YACV,UAAU;AAAA,YACV,SAAS;AAAA,YACT;AAAA,YAEC,gBAAM,QAAQ,cAAc,IAC3B,oBAAC,gCAA6B,IAE9B;AAAA,cAAC;AAAA;AAAA,gBACC,UAAU,YAAY;AAAA,gBAEtB,eAAa,mBAAmB;AAAA,gBAChC,UAAU,YAAY;AAAA,gBACtB,mBAAmB,qBAAqB;AAAA,gBACxC;AAAA,gBAEC,4BAAkB,eAAe,KAAK,oBAAC,iBAAc,OAAO,eAAe,OAAO,IAAK;AAAA;AAAA,YAC1F;AAAA;AAAA,QAEJ;AAAA,QAGF,oBAAC,iBAAc;AAAA,QAEf,oBAAC,SAAI;AAAA,QACJ,CAAC,UACA;AAAA,UAAC;AAAA;AAAA,YACC,cAAa;AAAA,YACb,MAAM,CAAC,eAAe,0BAA0B;AAAA,YAChD,gBAAe;AAAA,YACf;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACF;AAAA,cACA,oBAAC,qBAAkB;AAAA;AAAA;AAAA,QACrB;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
- import { styled, css, th } from "@elliemae/ds-system";
2
+ import { styled, css } from "@elliemae/ds-system";
3
3
  import { Grid } from "@elliemae/ds-grid";
4
- import { DSComboBoxName, DSComboboxSlots } from "../../theming.js";
4
+ import { DSTypography } from "@elliemae/ds-typography";
5
+ import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../../constants/index.js";
5
6
  const readOnlyBorder = css`
6
7
  border: 1px solid ${({ theme }) => theme.colors.neutral["080"]};
7
8
  border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[400]};
@@ -29,8 +30,8 @@ const hoverBorder = css`
29
30
  border: 1px solid ${({ theme }) => theme.colors.brand[600]};
30
31
  `;
31
32
  const StyledControlsWrapper = styled(Grid, {
32
- name: DSComboBoxName,
33
- slot: DSComboboxSlots.INPUT_WRAPPER
33
+ name: DSFormComboboxName,
34
+ slot: FORM_COMBOBOX_SLOTS.INPUT_WRAPPER
34
35
  })`
35
36
  ${backgroundStyles}
36
37
  position: relative;
@@ -39,11 +40,11 @@ const StyledControlsWrapper = styled(Grid, {
39
40
  align-items: center;
40
41
  align-content: center;
41
42
  min-height: 28px;
42
- padding: 3px 0px 3px 8px;
43
- @media (max-width: ${th.breakpoint("small")}) {
44
- padding: 1.25px 0px 1.25px 8px;
45
- }
46
- margin: ${({ inline }) => inline ? "10px 16px" : ""};
43
+ /** PUI-15490: the spec's 5px vertical padding belongs to the TEXT LINE (StyledInputWrapper),
44
+ * not here — padding the wrapper would also inset the separator + chevron column and inflate
45
+ * the control past the spec's min-height. Right-side 8px comes from the grid gap column. */
46
+ padding: 0px 0px 0px 8px;
47
+ margin: ${({ inline }) => inline ? "8px 16px" : ""};
47
48
  ${borderStyles}
48
49
  &:hover {
49
50
  ${({ disabled }) => !disabled ? hoverBorder : ""}
@@ -52,27 +53,48 @@ const StyledControlsWrapper = styled(Grid, {
52
53
  ${focusBorder}
53
54
  }
54
55
  `;
55
- const StyledSingleSelectWraper = styled.div`
56
+ const StyledSingleSelectWraper = styled("div", {
57
+ name: DSFormComboboxName,
58
+ slot: FORM_COMBOBOX_SLOTS.SELECTED_VALUES
59
+ })`
56
60
  display: flex;
57
61
  width: 100%;
58
62
  align-items: center;
59
63
  color: ${({ disabled, readOnly, theme }) => disabled || readOnly ? theme.colors.neutral["600"] : theme.colors.neutral["700"]};
60
64
  user-select: ${({ disabled, applyAriaDisabled }) => disabled || applyAriaDisabled ? "none" : ""};
61
65
  `;
62
- const StyledSelection = styled.div`
63
- font-size: 1rem;
66
+ const StyledSelection = styled(DSTypography, {
67
+ name: DSFormComboboxName,
68
+ slot: FORM_COMBOBOX_SLOTS.SELECTION
69
+ })`
64
70
  margin-right: 3px;
65
71
  display: flex;
72
+ /** PUI-15490 — no vertical padding here on purpose: the 5px text-line rhythm lives on
73
+ * StyledInputWrapper (always rendered), so the control height stays constant and pills
74
+ * (taller than the text line) center within it instead of growing the control. */
75
+ align-self: center;
66
76
  `;
67
- const StyledHeaderActionsWrapper = styled(Grid)`
77
+ const StyledHeaderActionsWrapper = styled(Grid, {
78
+ name: DSFormComboboxName,
79
+ slot: FORM_COMBOBOX_SLOTS.HEADER_ACTIONS
80
+ })`
68
81
  height: 100%;
82
+ /** PUI-15490 — grid children otherwise stretch to the row height; the chevron button must
83
+ * keep its spec box (size 's' square, icon + 2px) and the separator its fixed 20px. */
84
+ align-items: center;
69
85
  .em-ds-button--text:focus::after {
70
86
  border: none;
71
87
  }
72
88
  `;
73
89
  const StyleDropdownIndicator = styled.div``;
74
- const StyleHeaderActionsSeparator = styled.span`
75
- height: 100%;
90
+ const StyleHeaderActionsSeparator = styled("span", {
91
+ name: DSFormComboboxName,
92
+ slot: FORM_COMBOBOX_SLOTS.HEADER_ACTIONS_SEPARATOR
93
+ })`
94
+ /** PUI-15490 — fixed 20px per the box-model spec (was height: 100%, which stretched it
95
+ * with the control row instead of staying at spec size). */
96
+ height: 20px;
97
+ align-self: center;
76
98
  width: 1px;
77
99
  background-color: ${({ theme }) => theme.colors.neutral["400"]};
78
100
  `;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/controls/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css, th } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSComboBoxName, DSComboboxSlots } from '../../theming.js';\n\ninterface StyledControlsWrapperT {\n hasError: boolean;\n inline: boolean;\n minWidth?: number;\n disabled: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n}\n\nconst readOnlyBorder = css`\n border: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[400]};\n`;\n\nconst borderStyles = css<{ hasError: boolean; readOnly: boolean; applyAriaDisabled: boolean }>`\n border: 1px solid ${({ hasError, theme }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n ${({ readOnly, applyAriaDisabled }) => (readOnly || applyAriaDisabled ? readOnlyBorder : '')}\n`;\n\nconst backgroundStyles = css<{ disabled: boolean; applyAriaDisabled: boolean; readOnly: boolean }>`\n background: ${({ disabled, applyAriaDisabled, readOnly, theme }) => {\n if (readOnly || applyAriaDisabled) {\n return theme.colors.neutral['050'];\n }\n if (disabled) {\n return theme.colors.neutral['080'];\n }\n return '#ffffff';\n }};\n`;\n\nconst focusBorder = css`\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n outline-offset: -2px;\n`;\n\nconst hoverBorder = css`\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n`;\n\nexport const StyledControlsWrapper = styled(Grid, {\n name: DSComboBoxName,\n slot: DSComboboxSlots.INPUT_WRAPPER,\n})<StyledControlsWrapperT>`\n ${backgroundStyles}\n position: relative;\n border-radius: 2px;\n min-width: ${({ minWidth, inline }) => (inline || !minWidth ? '' : `${minWidth}px`)};\n align-items: center;\n align-content: center;\n min-height: 28px;\n padding: 3px 0px 3px 8px;\n @media (max-width: ${th.breakpoint('small')}) {\n padding: 1.25px 0px 1.25px 8px;\n }\n margin: ${({ inline }) => (inline ? '10px 16px' : '')};\n ${borderStyles}\n &:hover {\n ${({ disabled }) => (!disabled ? hoverBorder : '')}\n }\n &:focus-within {\n ${focusBorder}\n }\n`;\n\nexport const StyledSingleSelectWraper = styled.div<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n}>`\n display: flex;\n width: 100%;\n align-items: center;\n color: ${({ disabled, readOnly, theme }) =>\n disabled || readOnly ? theme.colors.neutral['600'] : theme.colors.neutral['700']};\n user-select: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'none' : '')};\n`;\n\nexport const StyledSelection = styled.div`\n font-size: 1rem;\n margin-right: 3px;\n display: flex;\n`;\n\nexport const StyledHeaderActionsWrapper = styled(Grid)`\n height: 100%;\n .em-ds-button--text:focus::after {\n border: none;\n }\n`;\n\nexport const StyleDropdownIndicator = styled.div``;\n\nexport const StyleHeaderActionsSeparator = styled.span<Partial<StyledControlsWrapperT>>`\n height: 100%;\n width: 1px;\n background-color: ${({ theme }) => theme.colors.neutral['400']};\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,KAAK,UAAU;AAChC,SAAS,YAAY;AACrB,SAAS,gBAAgB,uBAAuB;AAWhD,MAAM,iBAAiB;AAAA,sBACD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,6BACnC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAGrE,MAAM,eAAe;AAAA,sBACC,CAAC,EAAE,UAAU,MAAM,MAAO,WAAW,MAAM,OAAO,OAAO,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,CAAE;AAAA,IAC5G,CAAC,EAAE,UAAU,kBAAkB,MAAO,YAAY,oBAAoB,iBAAiB,EAAG;AAAA;AAG9F,MAAM,mBAAmB;AAAA,gBACT,CAAC,EAAE,UAAU,mBAAmB,UAAU,MAAM,MAAM;AAClE,MAAI,YAAY,mBAAmB;AACjC,WAAO,MAAM,OAAO,QAAQ,KAAK;AAAA,EACnC;AACA,MAAI,UAAU;AACZ,WAAO,MAAM,OAAO,QAAQ,KAAK;AAAA,EACnC;AACA,SAAO;AACT,CAAC;AAAA;AAGH,MAAM,cAAc;AAAA,uBACG,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAI7D,MAAM,cAAc;AAAA,sBACE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAGrD,MAAM,wBAAwB,OAAO,MAAM;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA,IACG,gBAAgB;AAAA;AAAA;AAAA,eAGL,CAAC,EAAE,UAAU,OAAO,MAAO,UAAU,CAAC,WAAW,KAAK,GAAG,QAAQ,IAAK;AAAA;AAAA;AAAA;AAAA;AAAA,uBAK9D,GAAG,WAAW,OAAO,CAAC;AAAA;AAAA;AAAA,YAGjC,CAAC,EAAE,OAAO,MAAO,SAAS,cAAc,EAAG;AAAA,IACnD,YAAY;AAAA;AAAA,MAEV,CAAC,EAAE,SAAS,MAAO,CAAC,WAAW,cAAc,EAAG;AAAA;AAAA;AAAA,MAGhD,WAAW;AAAA;AAAA;AAIV,MAAM,2BAA2B,OAAO;AAAA;AAAA;AAAA;AAAA,WAQpC,CAAC,EAAE,UAAU,UAAU,MAAM,MACpC,YAAY,WAAW,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,iBACnE,CAAC,EAAE,UAAU,kBAAkB,MAAO,YAAY,oBAAoB,SAAS,EAAG;AAAA;AAG5F,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAM/B,MAAM,6BAA6B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9C,MAAM,yBAAyB,OAAO;AAEtC,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA,sBAG5B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\ninterface StyledControlsWrapperT {\n hasError: boolean;\n inline: boolean;\n minWidth?: number;\n disabled: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n}\n\nconst readOnlyBorder = css`\n border: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[400]};\n`;\n\nconst borderStyles = css<{ hasError: boolean; readOnly: boolean; applyAriaDisabled: boolean }>`\n border: 1px solid ${({ hasError, theme }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n ${({ readOnly, applyAriaDisabled }) => (readOnly || applyAriaDisabled ? readOnlyBorder : '')}\n`;\n\nconst backgroundStyles = css<{ disabled: boolean; applyAriaDisabled: boolean; readOnly: boolean }>`\n background: ${({ disabled, applyAriaDisabled, readOnly, theme }) => {\n if (readOnly || applyAriaDisabled) {\n return theme.colors.neutral['050'];\n }\n if (disabled) {\n return theme.colors.neutral['080'];\n }\n return '#ffffff';\n }};\n`;\n\nconst focusBorder = css`\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n outline-offset: -2px;\n`;\n\nconst hoverBorder = css`\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n`;\n\nexport const StyledControlsWrapper = styled(Grid, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.INPUT_WRAPPER,\n})<StyledControlsWrapperT>`\n ${backgroundStyles}\n position: relative;\n border-radius: 2px;\n min-width: ${({ minWidth, inline }) => (inline || !minWidth ? '' : `${minWidth}px`)};\n align-items: center;\n align-content: center;\n min-height: 28px;\n /** PUI-15490: the spec's 5px vertical padding belongs to the TEXT LINE (StyledInputWrapper),\n * not here \u2014 padding the wrapper would also inset the separator + chevron column and inflate\n * the control past the spec's min-height. Right-side 8px comes from the grid gap column. */\n padding: 0px 0px 0px 8px;\n margin: ${({ inline }) => (inline ? '8px 16px' : '')};\n ${borderStyles}\n &:hover {\n ${({ disabled }) => (!disabled ? hoverBorder : '')}\n }\n &:focus-within {\n ${focusBorder}\n }\n`;\n\nexport const StyledSingleSelectWraper = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.SELECTED_VALUES,\n})<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n}>`\n display: flex;\n width: 100%;\n align-items: center;\n color: ${({ disabled, readOnly, theme }) =>\n disabled || readOnly ? theme.colors.neutral['600'] : theme.colors.neutral['700']};\n user-select: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'none' : '')};\n`;\n\nexport const StyledSelection = styled(DSTypography, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.SELECTION,\n})`\n margin-right: 3px;\n display: flex;\n /** PUI-15490 \u2014 no vertical padding here on purpose: the 5px text-line rhythm lives on\n * StyledInputWrapper (always rendered), so the control height stays constant and pills\n * (taller than the text line) center within it instead of growing the control. */\n align-self: center;\n`;\n\nexport const StyledHeaderActionsWrapper = styled(Grid, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.HEADER_ACTIONS,\n})`\n height: 100%;\n /** PUI-15490 \u2014 grid children otherwise stretch to the row height; the chevron button must\n * keep its spec box (size 's' square, icon + 2px) and the separator its fixed 20px. */\n align-items: center;\n .em-ds-button--text:focus::after {\n border: none;\n }\n`;\n\nexport const StyleDropdownIndicator = styled.div``;\n\nexport const StyleHeaderActionsSeparator = styled('span', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.HEADER_ACTIONS_SEPARATOR,\n})<Partial<StyledControlsWrapperT>>`\n /** PUI-15490 \u2014 fixed 20px per the box-model spec (was height: 100%, which stretched it\n * with the control row instead of staying at spec size). */\n height: 20px;\n align-self: center;\n width: 1px;\n background-color: ${({ theme }) => theme.colors.neutral['400']};\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW;AAC5B,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB,2BAA2B;AAWxD,MAAM,iBAAi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,2BAA2B,OAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA,WAQU,CAAC,EAAE,UAAU,UAAU,MAAM,MACpC,YAAY,WAAW,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,iBACnE,CAAC,EAAE,UAAU,kBAAkB,MAAO,YAAY,oBAAoB,SAAS,EAAG;AAAA;AAG5F,MAAM,kBAAkB,OAAO,cAAc;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASM,MAAM,6BAA6B,OAAO,MAAM;AAAA,EACrD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUM,MAAM,yBAAyB,OAAO;AAEtC,MAAM,8BAA8B,OAAO,QAAQ;AAAA,EACxD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMqB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useContext, useMemo } from "react";
3
4
  import { useGetGlobalAttributes, useOwnerProps } from "@elliemae/ds-props-helpers";
4
5
  import { mergeRefs } from "@elliemae/ds-system";
5
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
6
- import { useContext, useMemo } from "react";
6
+ import { TruncatedText } from "../../TruncatedText.js";
7
7
  import { ComboBoxContext } from "../../ComboBoxCTX.js";
8
8
  import { ComboboxDataTestid } from "../../ComboboxDataTestids.js";
9
9
  import { isArrayOfItems } from "../../utils/listHelper.js";
@@ -17,6 +17,7 @@ import {
17
17
  } from "./styled.js";
18
18
  import { useControlsInput } from "./useControlsInput.js";
19
19
  import { useKeyboardNavigation } from "./useKeyboardNavigation.js";
20
+ import { isItemContainingALabel } from "../../utils/typeGuards.js";
20
21
  const ControlsInput = () => {
21
22
  const {
22
23
  props,
@@ -55,7 +56,8 @@ const ControlsInput = () => {
55
56
  });
56
57
  const actualAriaDescribedBy = useMemo(() => {
57
58
  if (id) {
58
- return `${ariaDescribedBy ?? ""} ${id}_current_placeholder ${id}_feedback_message ${id}_error_message`;
59
+ const internalIds = `${id}_current_placeholder ${id}_feedback_message ${id}_error_message`;
60
+ return ariaDescribedBy ? `${ariaDescribedBy} ${internalIds}` : internalIds;
59
61
  }
60
62
  return ariaDescribedBy;
61
63
  }, [ariaDescribedBy, id]);
@@ -63,7 +65,7 @@ const ControlsInput = () => {
63
65
  if (isArrayOfItems(selectedValues)) {
64
66
  return `options ${selectedValues.map((item) => item.label).join(", ")} selected. ${readOnly ? "Read only" : ""}`;
65
67
  }
66
- if (typeof selectedValues?.label === "string") {
68
+ if (isItemContainingALabel(selectedValues)) {
67
69
  return `option ${selectedValues.label} selected. ${readOnly ? "Read only" : ""}`;
68
70
  }
69
71
  if (readOnly) {
@@ -77,14 +79,25 @@ const ControlsInput = () => {
77
79
  }
78
80
  return void 0;
79
81
  }, [focusOptionIdx, hasFocus, isLoading, menuState]);
82
+ const isNonInteractive = [disabled, applyAriaDisabled, readOnly].some(Boolean);
80
83
  const handleOnPaste = (e) => {
81
84
  e.preventDefault();
82
85
  setInputValue(e.clipboardData.getData("text/plain"));
83
86
  internalRef.current?.focus();
84
87
  };
85
- return /* @__PURE__ */ jsxs(StyledInputWrapper, { children: [
88
+ return /* @__PURE__ */ jsxs(StyledInputWrapper, { getOwnerProps, children: [
86
89
  /* @__PURE__ */ jsx(StyledInputWidthReference, { innerRef: spanReference, children: spanReferenceText }),
87
- showPlaceholder && /* @__PURE__ */ jsx(StyledInputPlaceHolder, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: showPlaceholder }) }),
90
+ showPlaceholder && /* @__PURE__ */ jsx(
91
+ StyledInputPlaceHolder,
92
+ {
93
+ variant: "b2",
94
+ component: "span",
95
+ getOwnerProps,
96
+ "aria-hidden": "true",
97
+ $nonInteractive: isNonInteractive,
98
+ children: /* @__PURE__ */ jsx(TruncatedText, { value: showPlaceholder })
99
+ }
100
+ ),
88
101
  menuState === false && !inline ? /* @__PURE__ */ jsx(StyledHiddenDiv, { id: `combo-listbox-${instanceUid}` }) : null,
89
102
  /* @__PURE__ */ jsx(StyledHiddenDiv, { id: `${id}_current_placeholder`, children: currentPlaceholder }),
90
103
  /* @__PURE__ */ jsx(
@@ -107,7 +120,7 @@ const ControlsInput = () => {
107
120
  "aria-autocomplete": "list",
108
121
  role: "combobox",
109
122
  disabled,
110
- applyAriaDisabled,
123
+ applyAriaDisabled: applyAriaDisabled ?? false,
111
124
  style: { width },
112
125
  innerRef: mergeRefs(innerRef, internalRef),
113
126
  value: inputValue,
@@ -115,7 +128,7 @@ const ControlsInput = () => {
115
128
  onKeyDown: onInputKeyDown,
116
129
  onChange: handleOnChange,
117
130
  tabIndex,
118
- withoutCaret: onlySelectable,
131
+ withoutCaret: onlySelectable ?? false,
119
132
  autoComplete: "off",
120
133
  "aria-readonly": readOnly
121
134
  }
@@ -130,7 +143,7 @@ const ControlsInput = () => {
130
143
  tabIndex: -1,
131
144
  onPaste: handleOnPaste,
132
145
  "aria-hidden": "true",
133
- isDisabled: disabled || applyAriaDisabled
146
+ isDisabled: !!(disabled || applyAriaDisabled)
134
147
  }
135
148
  )
136
149
  ] });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/controls-input/ControlsInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useGetGlobalAttributes, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useContext, useMemo } from 'react';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { isArrayOfItems } from '../../utils/listHelper.js';\nimport {\n StyledHiddenDiv,\n StyledInput,\n StyledInputPlaceHolder,\n StyledInputWidthReference,\n StyledInputWrapper,\n StyleHiddenInput,\n} from './styled.js';\nimport { useControlsInput } from './useControlsInput.js';\nimport { useKeyboardNavigation } from './useKeyboardNavigation.js';\n\nexport const ControlsInput = (): JSX.Element => {\n const {\n props,\n props: {\n autoFocus,\n inline,\n selectedValues,\n placeholder,\n disabled,\n innerRef,\n isLoading,\n onlySelectable,\n applyAriaDisabled,\n readOnly,\n ...restProps\n },\n focusOptionIdx,\n hasFocus,\n internalRef,\n inputValue,\n setInputValue,\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n const { onInputKeyDown } = useKeyboardNavigation();\n\n const { spanReference, width, spanReferenceText, showPlaceholder, handleOnBlur, handleOnChange, handleOnFocus } =\n useControlsInput();\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const {\n tabIndex,\n id,\n 'aria-describedby': ariaDescribedBy,\n ...globalAttrs\n } = useGetGlobalAttributes(restProps, {\n onFocus: handleOnFocus,\n onBlur: handleOnBlur,\n });\n\n const actualAriaDescribedBy = useMemo(() => {\n if (id) {\n return `${ariaDescribedBy ?? ''} ${id}_current_placeholder ${id}_feedback_message ${id}_error_message`;\n }\n return ariaDescribedBy;\n }, [ariaDescribedBy, id]);\n\n const currentPlaceholder = useMemo(() => {\n if (isArrayOfItems(selectedValues)) {\n return `options ${selectedValues.map((item) => item.label).join(', ')} selected. ${readOnly ? 'Read only' : ''}`;\n }\n if (typeof selectedValues?.label === 'string') {\n return `option ${selectedValues.label} selected. ${readOnly ? 'Read only' : ''}`;\n }\n if (readOnly) {\n return `${placeholder}. Read only`;\n }\n return placeholder;\n }, [placeholder, selectedValues, readOnly]);\n\n const activeDescendant = useMemo(() => {\n if (!isLoading && hasFocus && menuState) {\n return focusOptionIdx;\n }\n return undefined;\n }, [focusOptionIdx, hasFocus, isLoading, menuState]);\n\n const handleOnPaste = (e: React.ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n setInputValue(e.clipboardData.getData('text/plain'));\n internalRef.current?.focus();\n };\n return (\n <StyledInputWrapper>\n <StyledInputWidthReference innerRef={spanReference}>{spanReferenceText}</StyledInputWidthReference>\n {showPlaceholder && (\n <StyledInputPlaceHolder aria-hidden=\"true\">\n <SimpleTruncatedTooltipText value={showPlaceholder}></SimpleTruncatedTooltipText>\n </StyledInputPlaceHolder>\n )}\n\n {/* The purpose of this div is to always have the 'combo-listbox-{uid}' present in the DOM */}\n {/* Fix for PUI-11597 */}\n {menuState === false && !inline ? <StyledHiddenDiv id={`combo-listbox-${instanceUid}`}></StyledHiddenDiv> : null}\n\n {/* The announcement of currentPlaceholder is being overridden by the value of actualAriaDescribedBy */}\n {/* and since this variable is necessary for the annoucement of FormLayoutBlockItem error and feedback */}\n {/* messages, we concatenate the value of actualPlaceholder with that aria description */}\n {/* Fix for PUI-9609 */}\n <StyledHiddenDiv id={`${id}_current_placeholder`}>{currentPlaceholder}</StyledHiddenDiv>\n\n <StyledInput\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n readOnly={readOnly || onlySelectable}\n {...globalAttrs}\n id={id}\n data-testid={ComboboxDataTestid.INPUT}\n autoFocus={autoFocus}\n placeholder={currentPlaceholder}\n aria-activedescendant={activeDescendant}\n aria-expanded={menuState}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-describedby={actualAriaDescribedBy}\n aria-autocomplete=\"list\"\n role=\"combobox\"\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n style={{ width }}\n innerRef={mergeRefs(innerRef, internalRef)}\n value={inputValue}\n type=\"text\"\n onKeyDown={onInputKeyDown}\n onChange={handleOnChange}\n tabIndex={tabIndex}\n withoutCaret={onlySelectable}\n autoComplete=\"off\"\n aria-readonly={readOnly}\n />\n {/* This input is used to handle the paste event */}\n <StyleHiddenInput\n type=\"text\"\n disabled={disabled || applyAriaDisabled}\n readOnly={readOnly}\n name=\"hidden\"\n tabIndex={-1}\n onPaste={handleOnPaste}\n aria-hidden=\"true\"\n isDisabled={disabled || applyAriaDisabled}\n />\n </StyledInputWrapper>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC4FnB,SACE,KADF;AA5FJ,SAAS,wBAAwB,qBAAqB;AACtD,SAAS,iBAAiB;AAC1B,SAAS,kCAAkC;AAC3C,SAAgB,YAAY,eAAe;AAC3C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AAE/B,MAAM,gBAAgB,MAAmB;AAC9C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAC9B,QAAM,EAAE,eAAe,IAAI,sBAAsB;AAEjD,QAAM,EAAE,eAAe,OAAO,mBAAmB,iBAAiB,cAAc,gBAAgB,cAAc,IAC5G,iBAAiB;AAEnB,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,oBAAoB;AA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AAC,mBAAgB,IAAI,GAAG,EAAE,wBAAyB,8BAAmB;AAAA,IAEtE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,UAAU,YAAY;AAAA,QACrB,GAAG;AAAA,QACJ;AAAA,QACA,eAAa,mBAAmB;AAAA,QAChC;AAAA,QACA,aAAa;AAAA,QACb,yBAAuB;AAAA,QACvB,iBAAe;AAAA,QACf,iBAAe,iBAAiB,WAAW;AAAA,QAC3C,oBAAkB;AAAA,QAClB,qBAAkB;AAAA,QAClB,MAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA,OAAO,EAAE,MAAM;AAAA,QACf,UAAU,UAAU,UAAU,WAAW;AAAA,QACzC,OAAO;AAAA,QACP,MAAK;AAAA,QACL,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA,cAAc;AAAA,QACd,cAAa;AAAA,QACb,iBAAe;AAAA;AAAA,IACjB;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAU,YAAY;AAAA,QACtB;AAAA,QACA,MAAK;AAAA,QACL,UAAU;AAAA,QACV,SAAS;AAAA,QACT,eAAY;AAAA,QACZ,YAAY,YAAY;AAAA;AAAA,IAC1B;AAAA,KACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { useGetGlobalAttributes, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { TruncatedText } from '../../TruncatedText.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { isArrayOfItems } from '../../utils/listHelper.js';\nimport {\n StyledHiddenDiv,\n StyledInput,\n StyledInputPlaceHolder,\n StyledInputWidthReference,\n StyledInputWrapper,\n StyleHiddenInput,\n} from './styled.js';\nimport { useControlsInput } from './useControlsInput.js';\nimport { useKeyboardNavigation } from './useKeyboardNavigation.js';\nimport { isItemContainingALabel } from '../../utils/typeGuards.js';\n\nexport const ControlsInput = (): JSX.Element => {\n const {\n props,\n props: {\n autoFocus,\n inline,\n selectedValues,\n placeholder,\n disabled,\n innerRef,\n isLoading,\n onlySelectable,\n applyAriaDisabled,\n readOnly,\n ...restProps\n },\n focusOptionIdx,\n hasFocus,\n internalRef,\n inputValue,\n setInputValue,\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n const { onInputKeyDown } = useKeyboardNavigation();\n\n const { spanReference, width, spanReferenceText, showPlaceholder, handleOnBlur, handleOnChange, handleOnFocus } =\n useControlsInput();\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const {\n tabIndex,\n id,\n 'aria-describedby': ariaDescribedBy,\n ...globalAttrs\n } = useGetGlobalAttributes(restProps, {\n onFocus: handleOnFocus,\n onBlur: handleOnBlur,\n });\n\n const actualAriaDescribedBy = useMemo(() => {\n if (id) {\n const internalIds = `${id}_current_placeholder ${id}_feedback_message ${id}_error_message`;\n return ariaDescribedBy ? `${ariaDescribedBy} ${internalIds}` : internalIds;\n }\n return ariaDescribedBy;\n }, [ariaDescribedBy, id]);\n\n const currentPlaceholder = useMemo(() => {\n if (isArrayOfItems(selectedValues)) {\n return `options ${selectedValues.map((item) => item.label).join(', ')} selected. ${readOnly ? 'Read only' : ''}`;\n }\n if (isItemContainingALabel(selectedValues)) {\n return `option ${selectedValues.label} selected. ${readOnly ? 'Read only' : ''}`;\n }\n if (readOnly) {\n return `${placeholder}. Read only`;\n }\n return placeholder;\n }, [placeholder, selectedValues, readOnly]);\n\n const activeDescendant = useMemo(() => {\n if (!isLoading && hasFocus && menuState) {\n return focusOptionIdx;\n }\n return undefined;\n }, [focusOptionIdx, hasFocus, isLoading, menuState]);\n\n // `.some(Boolean)` over `||` keeps this component within its cyclomatic-complexity limit.\n const isNonInteractive = [disabled, applyAriaDisabled, readOnly].some(Boolean);\n\n const handleOnPaste = (e: React.ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n setInputValue(e.clipboardData.getData('text/plain'));\n internalRef.current?.focus();\n };\n return (\n <StyledInputWrapper getOwnerProps={getOwnerProps}>\n <StyledInputWidthReference innerRef={spanReference}>{spanReferenceText}</StyledInputWidthReference>\n {showPlaceholder && (\n <StyledInputPlaceHolder\n variant=\"b2\"\n component=\"span\"\n getOwnerProps={getOwnerProps}\n aria-hidden=\"true\"\n $nonInteractive={isNonInteractive}\n >\n <TruncatedText value={showPlaceholder} />\n </StyledInputPlaceHolder>\n )}\n\n {/* The purpose of this div is to always have the 'combo-listbox-{uid}' present in the DOM */}\n {/* Fix for PUI-11597 */}\n {menuState === false && !inline ? <StyledHiddenDiv id={`combo-listbox-${instanceUid}`}></StyledHiddenDiv> : null}\n\n {/* The announcement of currentPlaceholder is being overridden by the value of actualAriaDescribedBy */}\n {/* and since this variable is necessary for the annoucement of FormLayoutBlockItem error and feedback */}\n {/* messages, we concatenate the value of actualPlaceholder with that aria description */}\n {/* Fix for PUI-9609 */}\n <StyledHiddenDiv id={`${id}_current_placeholder`}>{currentPlaceholder}</StyledHiddenDiv>\n\n <StyledInput\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n readOnly={readOnly || onlySelectable}\n {...globalAttrs}\n id={id}\n data-testid={ComboboxDataTestid.INPUT}\n autoFocus={autoFocus}\n placeholder={currentPlaceholder}\n aria-activedescendant={activeDescendant}\n aria-expanded={menuState}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-describedby={actualAriaDescribedBy}\n aria-autocomplete=\"list\"\n role=\"combobox\"\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled ?? false}\n style={{ width }}\n innerRef={mergeRefs(innerRef, internalRef)}\n value={inputValue}\n type=\"text\"\n onKeyDown={onInputKeyDown}\n onChange={handleOnChange}\n tabIndex={tabIndex}\n withoutCaret={onlySelectable ?? false}\n autoComplete=\"off\"\n aria-readonly={readOnly}\n />\n {/* This input is used to handle the paste event */}\n <StyleHiddenInput\n type=\"text\"\n disabled={disabled || applyAriaDisabled}\n readOnly={readOnly}\n name=\"hidden\"\n tabIndex={-1}\n onPaste={handleOnPaste}\n aria-hidden=\"true\"\n isDisabled={!!(disabled || applyAriaDisabled)}\n />\n </StyledInputWrapper>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiGnB,SACE,KADF;AAjGJ,SAAgB,YAAY,eAAe;AAC3C,SAAS,wBAAwB,qBAAqB;AACtD,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AAEhC,MAAM,gBAAgB,MAAmB;AAC9C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAC9B,QAAM,EAAE,eAAe,IAAI,sBAAsB;AAEjD,QAAM,EAAE,eAAe,OAAO,mBAAmB,iBAAiB,cAAc,gBAAgB,cAAc,IAC5G,iBAAiB;AAEnB,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI,uBAAuB,WAAW;AAAA,IACpC,SAAS;AAAA,IACT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O,iBAAiB;AAAA;AAAA,IACzC;AAAA,IAKD,cAAc,SAAS,CAAC,SAAS,oBAAC,mBAAgB,IAAI,iBAAiB,WAAW,IAAI,IAAqB;AAAA,IAM5G,oBAAC,mBAAgB,IAAI,GAAG,EAAE,wBAAyB,8BAAmB;AAAA,IAEtE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,UAAU,YAAY;AAAA,QACrB,GAAG;AAAA,QACJ;AAAA,QACA,eAAa,mBAAmB;AAAA,QAChC;AAAA,QACA,aAAa;AAAA,QACb,yBAAuB;AAAA,QACvB,iBAAe;AAAA,QACf,iBAAe,iBAAiB,WAAW;AAAA,QAC3C,oBAAkB;AAAA,QAClB,qBAAkB;AAAA,QAClB,MAAK;AAAA,QACL;AAAA,QACA,mBAAmB,qBAAqB;AAAA,QACxC,OAAO,EAAE,MAAM;AAAA,QACf,UAAU,UAAU,UAAU,WAAW;AAAA,QACzC,OAAO;AAAA,QACP,MAAK;AAAA,QACL,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA,cAAc,kBAAkB;AAAA,QAChC,cAAa;AAAA,QACb,iBAAe;AAAA;AAAA,IACjB;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAU,YAAY;AAAA,QACtB;AAAA,QACA,MAAK;AAAA,QACL,UAAU;AAAA,QACV,SAAS;AAAA,QACT,eAAY;AAAA,QACZ,YAAY,CAAC,EAAE,YAAY;AAAA;AAAA,IAC7B;AAAA,KACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,16 @@
1
1
  import * as React from "react";
2
- import { styled } from "@elliemae/ds-system";
3
- import { DSComboBoxName, DSComboboxSlots } from "../../theming.js";
2
+ import { styled, css } from "@elliemae/ds-system";
3
+ import { DSTypography } from "@elliemae/ds-typography";
4
+ import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../../constants/index.js";
5
+ const b2InputTypography = css`
6
+ font-size: 0.8125rem;
7
+ line-height: 1rem;
8
+ font-weight: 400;
9
+ @media (min-width: ${({ theme }) => theme.breakpoints.small}) {
10
+ font-size: 1rem;
11
+ line-height: 1.2307692308rem;
12
+ }
13
+ `;
4
14
  const StyleHiddenInput = styled("input")`
5
15
  color: transparent;
6
16
  position: absolute;
@@ -17,18 +27,17 @@ const StyleHiddenInput = styled("input")`
17
27
  ${({ isDisabled }) => isDisabled && `cursor: not-allowed;`}
18
28
  `;
19
29
  const StyledInput = styled("input", {
20
- name: DSComboBoxName,
21
- slot: DSComboboxSlots.INPUT
30
+ name: DSFormComboboxName,
31
+ slot: FORM_COMBOBOX_SLOTS.INPUT
22
32
  })`
23
- line-height: 1rem;
33
+ ${b2InputTypography}
24
34
  background: transparent;
25
- font-size: 1rem;
26
35
  border: none;
27
36
  overflow: hidden;
28
37
  padding: 0;
29
38
  z-index: 2;
30
39
  outline: none;
31
- color: ${(props) => props.theme.colors.neutral[700]};
40
+ color: ${(props) => props.disabled ? props.theme.colors.neutral[600] : props.theme.colors.neutral[700]};
32
41
  &:focus {
33
42
  outline: none;
34
43
  }
@@ -39,18 +48,18 @@ const StyledInput = styled("input", {
39
48
  transition: none;
40
49
  ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed; caret-color: transparent;`}
41
50
  `;
42
- const StyledInputPlaceHolder = styled.div`
51
+ const StyledInputPlaceHolder = styled(DSTypography, {
52
+ name: DSFormComboboxName,
53
+ slot: FORM_COMBOBOX_SLOTS.INPUT_PLACEHOLDER
54
+ })`
43
55
  font-style: italic;
44
- color: ${(props) => props.theme.colors.neutral[500]};
56
+ color: ${(props) => props.$nonInteractive ? props.theme.colors.neutral[600] : props.theme.colors.neutral[500]};
45
57
  position: absolute;
46
58
  display: flex;
47
59
  align-items: center;
48
60
  width: 100%;
49
61
  user-select: none;
50
62
 
51
- line-height: 1rem;
52
- font-size: 1rem;
53
-
54
63
  & span::after {
55
64
  content: '';
56
65
  padding: 1px;
@@ -58,16 +67,27 @@ const StyledInputPlaceHolder = styled.div`
58
67
  }
59
68
  `;
60
69
  const StyledInputWidthReference = styled.span`
70
+ ${b2InputTypography}
61
71
  visibility: hidden;
62
72
  position: absolute;
63
73
  top: -9999px;
64
74
  z-index: 1;
65
75
  `;
66
- const StyledInputWrapper = styled("div")`
76
+ const StyledInputWrapper = styled("div", {
77
+ name: DSFormComboboxName,
78
+ slot: FORM_COMBOBOX_SLOTS.INPUT_FIELD_WRAPPER
79
+ })`
67
80
  position: relative;
68
81
  align-items: center;
69
82
  display: flex;
70
- padding-right: 1px;
83
+ /** PUI-15490 — the spec's 5px vertical padding lives on the text line (this wrapper, always
84
+ * rendered) so the control height is constant and breathing room survives text resize.
85
+ * Mobile keeps the legacy 1.25px — no mobile spec exists (KNOWN_INTENTIONAL_DEVIATIONS §5).
86
+ * The 1px right padding is pre-existing (caret clipping). */
87
+ padding: 5px 1px 5px 0px;
88
+ @media (max-width: ${({ theme }) => theme.breakpoints.small}) {
89
+ padding: 1.25px 1px 1.25px 0px;
90
+ }
71
91
  overflow: hidden;
72
92
  `;
73
93
  const StyledHiddenDiv = styled("div")`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/controls-input/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { DSComboBoxName, DSComboboxSlots } from '../../theming.js';\n\nexport const StyleHiddenInput = styled('input')<{ isDisabled: boolean }>`\n color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n border: none;\n outline: none;\n background: transparent;\n width: 100%;\n &:focus {\n outline: none;\n }\n ${({ isDisabled }) => isDisabled && `cursor: not-allowed;`}\n`;\n\nexport const StyledInput = styled('input', {\n name: DSComboBoxName,\n slot: DSComboboxSlots.INPUT,\n})<{ withoutCaret: boolean; applyAriaDisabled: boolean }>`\n line-height: 1rem;\n background: transparent;\n font-size: 1rem;\n border: none;\n overflow: hidden;\n padding: 0;\n z-index: 2;\n outline: none;\n color: ${(props) => props.theme.colors.neutral[700]};\n &:focus {\n outline: none;\n }\n ${({ withoutCaret }) => withoutCaret && 'caret-color: transparent;'}\n &::placeholder {\n color: transparent;\n }\n transition: none;\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed; caret-color: transparent;`}\n`;\n\nexport const StyledInputPlaceHolder = styled.div`\n font-style: italic;\n color: ${(props) => props.theme.colors.neutral[500]};\n position: absolute;\n display: flex;\n align-items: center;\n width: 100%;\n user-select: none;\n\n line-height: 1rem;\n font-size: 1rem;\n\n & span::after {\n content: '';\n padding: 1px;\n // solve italic font style clipping issue with overflow hidden.\n }\n`;\n\nexport const StyledInputWidthReference = styled.span`\n visibility: hidden;\n position: absolute;\n top: -9999px;\n z-index: 1;\n`;\n\nexport const StyledInputWrapper = styled('div')`\n position: relative;\n align-items: center;\n display: flex;\n padding-right: 1px;\n overflow: hidden;\n`;\n\nexport const StyledHiddenDiv = styled('div')`\n display: none;\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,gBAAgB,uBAAuB;AAEzC,MAAM,mBAAmB,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAa1C,CAAC,EAAE,WAAW,MAAM,cAAc,sBAAsB;AAAA;AAGrD,MAAM,cAAc,OAAO,SAAS;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WASU,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA,IAIjD,CAAC,EAAE,aAAa,MAAM,gBAAgB,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjE,CAAC,EAAE,kBAAkB,MAAM,qBAAqB,gDAAgD;AAAA;AAG7F,MAAM,yBAAyB,OAAO;AAAA;AAAA,WAElC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB9C,MAAM,4BAA4B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOzC,MAAM,qBAAqB,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvC,MAAM,kBAAkB,OAAO,KAAK;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\n/**\n * b2 typography mirrored as raw CSS for the native `<input>` and its hidden\n * width-measuring twin (`StyledInputWidthReference`). Neither can be a `DSTypography`\n * component \u2014 an `<input>` takes no children, and the reference must match the input's\n * exact font metrics or the autosizing (measured off the reference) drifts. ds-typography\n * does not export its VARIANTS_CSS_MAP, so the b2 values are duplicated here \u2014 keep in\n * sync with `ds-typography` b2 (`parts/variants/body.ts`). Text containers that CAN hold\n * children (placeholder, selection) use `styled(DSTypography)` with `variant=\"b2\"` instead.\n */\nconst b2InputTypography = css`\n font-size: 0.8125rem;\n line-height: 1rem;\n font-weight: 400;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: 1rem;\n line-height: 1.2307692308rem;\n }\n`;\n\nexport const StyleHiddenInput = styled('input')<{ isDisabled: boolean }>`\n color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n border: none;\n outline: none;\n background: transparent;\n width: 100%;\n &:focus {\n outline: none;\n }\n ${({ isDisabled }) => isDisabled && `cursor: not-allowed;`}\n`;\n\nexport const StyledInput = styled('input', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.INPUT,\n})<{ withoutCaret: boolean; applyAriaDisabled: boolean }>`\n ${b2InputTypography}\n background: transparent;\n border: none;\n overflow: hidden;\n padding: 0;\n z-index: 2;\n outline: none;\n color: ${(props) => (props.disabled ? props.theme.colors.neutral[600] : props.theme.colors.neutral[700])};\n &:focus {\n outline: none;\n }\n ${({ withoutCaret }) => withoutCaret && 'caret-color: transparent;'}\n &::placeholder {\n color: transparent;\n }\n transition: none;\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed; caret-color: transparent;`}\n`;\n\nexport const StyledInputPlaceHolder = styled(DSTypography, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.INPUT_PLACEHOLDER,\n})<{ $nonInteractive?: boolean }>`\n font-style: italic;\n color: ${(props) => (props.$nonInteractive ? props.theme.colors.neutral[600] : props.theme.colors.neutral[500])};\n position: absolute;\n display: flex;\n align-items: center;\n width: 100%;\n user-select: none;\n\n & span::after {\n content: '';\n padding: 1px;\n // solve italic font style clipping issue with overflow hidden.\n }\n`;\n\nexport const StyledInputWidthReference = styled.span`\n ${b2InputTypography}\n visibility: hidden;\n position: absolute;\n top: -9999px;\n z-index: 1;\n`;\n\nexport const StyledInputWrapper = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.INPUT_FIELD_WRAPPER,\n})`\n position: relative;\n align-items: center;\n display: flex;\n /** PUI-15490 \u2014 the spec's 5px vertical padding lives on the text line (this wrapper, always\n * rendered) so the control height is constant and breathing room survives text resize.\n * Mobile keeps the legacy 1.25px \u2014 no mobile spec exists (KNOWN_INTENTIONAL_DEVIATIONS \u00A75).\n * The 1px right padding is pre-existing (caret clipping). */\n padding: 5px 1px 5px 0px;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n padding: 1.25px 1px 1.25px 0px;\n }\n overflow: hidden;\n`;\n\nexport const StyledHiddenDiv = styled('div')`\n display: none;\n`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,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBASsB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAMtD,MAAM,kBAAkB,OAAO,KAAK;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -83,7 +83,11 @@ const useKeyboardNavigation = () => {
83
83
  if (!multiple) {
84
84
  setMenuState(false, MENU_CONTROL_REASONS.SELECT_OPTION, e);
85
85
  }
86
- onChange(getSuggestedValueOnChange(currentItem, selectedValues, isNonClearable), currentItem, e);
86
+ onChange(
87
+ getSuggestedValueOnChange(currentItem, selectedValues, isNonClearable),
88
+ currentItem,
89
+ e
90
+ );
87
91
  }
88
92
  }
89
93
  if (e.key === "Enter" && e.altKey) {
@@ -91,7 +95,9 @@ const useKeyboardNavigation = () => {
91
95
  }
92
96
  if (e.key === "a" && e.ctrlKey && multiple && onSelectAll) {
93
97
  onSelectAll(
94
- filteredOptions.filter((option) => option.type === "option" && !option.disabled),
98
+ filteredOptions.filter(
99
+ (option) => option.type === "option" && !option.disabled
100
+ ),
95
101
  e
96
102
  );
97
103
  }
@@ -134,7 +140,11 @@ const useKeyboardNavigation = () => {
134
140
  if (readOnly) return;
135
141
  const lastValue = getLastValueSelected(selectedValues);
136
142
  if (!e.currentTarget.value && lastValue && !isNonClearable && !lastValue.applyAriaDisabled) {
137
- onChange(getSuggestedValueOnChange(lastValue, selectedValues), lastValue, e);
143
+ onChange(
144
+ getSuggestedValueOnChange(lastValue, selectedValues),
145
+ lastValue,
146
+ e
147
+ );
138
148
  }
139
149
  }
140
150
  if (e.key === "Tab" && !inline && menuState) {