@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,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/listHelper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nexport const getSelectableOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && !option.disabled);\n\nexport const getOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION);\n\nexport const isSelectedValueEmpty = (value: DSComboboxT.SelectedOptionsT): boolean =>\n Array.isArray(value) ? value.length === 0 : !value;\n\nexport const isSelectedValueMultiple = (value: DSComboboxT.SelectedOptionsT): boolean => Array.isArray(value);\n\nexport const isSelected = (value: DSComboboxT.SelectedOptionsT, activeOption: DSComboboxT.ItemOption): boolean => {\n if (isSelectedValueMultiple(value)) {\n const multiValue = value as DSComboboxT.ItemOption[];\n return multiValue.some((item) => item?.value === activeOption?.value);\n }\n const singleValue = value as DSComboboxT.ItemOption;\n return singleValue?.value === activeOption.value;\n};\n\nexport function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[] {\n return Array.isArray(value) && value.length > 0;\n}\n\nexport const isItem = (value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption =>\n !Array.isArray(value) && value !== null && typeof value === 'object';\n\nexport const findInCircularList = (\n list: DSComboboxT.OptionTypes[],\n from: number,\n criteria: (item: DSComboboxT.OptionTypes) => boolean,\n step = 1,\n): number => {\n if (list.length === 0) return from;\n\n let i = (from + step + list.length) % list.length;\n let iterations = 0;\n\n while (iterations < list.length) {\n if (criteria(list[i])) return i;\n\n i = (i + step + list.length) % list.length;\n iterations += 1;\n }\n\n return from; // Return the original index if no match is found\n};\nexport const getLastValueSelected = (selectedValues: DSComboboxT.SelectedOptionsT) => {\n if (Array.isArray(selectedValues)) {\n return selectedValues[selectedValues.length - 1];\n }\n return selectedValues;\n};\n\nexport const getFirstOption = (\n options: DSComboboxT.OptionTypes[],\n selectedValues?: DSComboboxT.SelectedOptionsT,\n): string => {\n if (selectedValues) {\n const lastValue = getLastValueSelected(selectedValues);\n if (lastValue) return lastValue.dsId;\n }\n for (let i = 0; i < options.length; i += 1)\n if (!['section', 'separator'].includes(options[i].type) && !options[i].disabled) {\n return options[i].dsId;\n }\n // list of disabled item results return ''\n return '';\n};\n\nexport const getSuggestedValueOnChange = (\n selectedOption: DSComboboxT.ItemOption,\n selectedValues: DSComboboxT.SelectedOptionsT,\n isNonClearable?: boolean,\n): Parameters<DSComboboxT.InternalProps['onChange']>[0] => {\n if (Array.isArray(selectedValues)) {\n const isFound = selectedValues.find((item) => item.type === 'option' && item.value === selectedOption.value);\n if (isFound) {\n if (isNonClearable) return selectedValues;\n return selectedValues.filter((item) => item.type === 'option' && item.value !== selectedOption.value);\n }\n return [...selectedValues, selectedOption];\n }\n if (selectedValues && selectedValues.dsId === selectedOption.dsId) {\n if (isNonClearable) return selectedOption;\n return null;\n }\n return selectedOption;\n};\n\nexport const filterOptions = (inputValue: string, options: DSComboboxT.OptionTypes[]) => {\n if (!inputValue) return options;\n return options.filter(\n (option) =>\n option.type === MENU_OPTION_TYPES.OPTION && option.label.toLowerCase().includes(inputValue.toLowerCase()),\n );\n};\n\nexport const getFilteredOptionsSelected = (\n filteredOption: DSComboboxT.OptionTypes[],\n selectedValues: DSComboboxT.ItemOption[],\n) => filteredOption.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option));\n\nexport const scrollIfNeeded = (\n elem: HTMLElement,\n options = { behavior: 'smooth', block: 'end', inline: 'nearest' } as ScrollIntoViewOptions | undefined,\n) => {\n const bounding = elem.getBoundingClientRect();\n if (\n !(\n bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n )\n )\n elem.scrollIntoView(options);\n};\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nexport const getSelectableOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && !option.disabled);\n\nexport const getOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION);\n\nexport const isSelectedValueEmpty = (value: DSComboboxT.SelectedOptionsT): boolean =>\n Array.isArray(value) ? value.length === 0 : !value;\n\nexport const isSelectedValueMultiple = (value: DSComboboxT.SelectedOptionsT): boolean => Array.isArray(value);\n\nexport const isSelected = (value: DSComboboxT.SelectedOptionsT, activeOption: DSComboboxT.ItemOption): boolean => {\n if (isSelectedValueMultiple(value)) {\n const multiValue = value as DSComboboxT.ItemOption[];\n return multiValue.some((item) => item?.value === activeOption?.value);\n }\n const singleValue = value as DSComboboxT.ItemOption;\n return singleValue?.value === activeOption.value;\n};\n\nexport function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[] {\n return Array.isArray(value) && value.length > 0;\n}\n\nexport const isItem = (value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption =>\n !Array.isArray(value) && value !== null && typeof value === 'object';\n\nexport const findInCircularList = (\n list: DSComboboxT.OptionTypes[],\n from: number,\n criteria: (item: DSComboboxT.OptionTypes) => boolean,\n step = 1,\n): number => {\n if (list.length === 0) return from;\n\n let i = (from + step + list.length) % list.length;\n let iterations = 0;\n\n while (iterations < list.length) {\n if (criteria(list[i])) return i;\n\n i = (i + step + list.length) % list.length;\n iterations += 1;\n }\n\n return from; // Return the original index if no match is found\n};\nexport const getLastValueSelected = (selectedValues: DSComboboxT.SelectedOptionsT) => {\n if (Array.isArray(selectedValues)) {\n return selectedValues[selectedValues.length - 1];\n }\n return selectedValues;\n};\n\nexport const getFirstOption = (\n options: DSComboboxT.OptionTypes[],\n selectedValues?: DSComboboxT.SelectedOptionsT,\n): string => {\n if (selectedValues) {\n const lastValue = getLastValueSelected(selectedValues);\n /**\n * A selected value can be created dynamically (e.g. a creatable filter) and later filtered\n * out of the rendered options, so its id must still exist in `options` before we focus it \u2014\n * otherwise aria-activedescendant would point at a non-existent id.\n */\n if (lastValue && options.some((option) => option.dsId === lastValue.dsId)) return lastValue.dsId;\n }\n for (let i = 0; i < options.length; i += 1)\n if (!['section', 'separator'].includes(options[i].type) && !options[i].disabled) {\n return options[i].dsId;\n }\n // list of disabled item results return ''\n return '';\n};\n\nexport const getSuggestedValueOnChange = (\n selectedOption: DSComboboxT.SelectionableOptions,\n selectedValues: DSComboboxT.SelectedOptionsT,\n isNonClearable?: boolean,\n): DSComboboxT.SelectedOptionsT => {\n if (Array.isArray(selectedValues)) {\n if (selectedOption === null) return selectedValues;\n const isFound = selectedValues.find((item) => item.type === 'option' && item.value === selectedOption.value);\n if (isFound) {\n if (isNonClearable) return selectedValues;\n return selectedValues.filter((item) => item.type === 'option' && item.value !== selectedOption.value);\n }\n return [...selectedValues, selectedOption];\n }\n if (selectedValues && selectedValues.dsId === selectedOption.dsId) {\n if (isNonClearable) return selectedOption;\n return null;\n }\n return selectedOption;\n};\n\nexport const filterOptions = (inputValue: string, options: DSComboboxT.OptionTypes[]) => {\n if (!inputValue) return options;\n return options.filter(\n (option) =>\n option.type === MENU_OPTION_TYPES.OPTION && option.label.toLowerCase().includes(inputValue.toLowerCase()),\n );\n};\n\nexport const getFilteredOptionsSelected = (\n filteredOption: DSComboboxT.OptionTypes[],\n selectedValues: DSComboboxT.ItemOption[],\n) => filteredOption.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option));\n\nexport const scrollIfNeeded = (\n elem: HTMLElement,\n options = { behavior: 'smooth', block: 'end', inline: 'nearest' } as ScrollIntoViewOptions | undefined,\n) => {\n const bounding = elem.getBoundingClientRect();\n if (!(\n bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n ))\n elem.scrollIntoView(options);\n};\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const isItemContainingALabel = (item) => typeof item === "object" && item !== null && "label" in item && typeof item.label === "string";
3
+ export {
4
+ isItemContainingALabel
5
+ };
6
+ //# sourceMappingURL=typeGuards.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/typeGuards.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\n\nexport const isItemContainingALabel = (\n item: unknown,\n): item is\n | DSCommonComboboxPropsT.ItemSectionOptions\n | DSCommonComboboxPropsT.ItemOption\n | DSCommonComboboxPropsT.ItemCreatableOption =>\n typeof item === 'object' && item !== null && 'label' in item && typeof item.label === 'string';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,yBAAyB,CACpC,SAKA,OAAO,SAAS,YAAY,SAAS,QAAQ,WAAW,QAAQ,OAAO,KAAK,UAAU;",
6
+ "names": []
7
+ }
@@ -3,7 +3,7 @@ import type { DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';
3
3
  import type { DSComboboxT } from './react-desc-prop-types.js';
4
4
  export declare const offScreenStyle: React.CSSProperties;
5
5
  declare const DSComboBox: {
6
- <T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null = DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[]>(props: DSComboboxT.Props<T>): import("react/jsx-runtime.js").JSX.Element;
6
+ <T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null = DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[]>(props: DSComboboxT.Props<T>): React.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  declare const DSComboBoxWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<import("./DSComboboxMultiT.js").DSComboboxMultiT.Props | (Omit<import("./DSComboboxSingleT.js").DSComboboxSingleT.Props, "selectedValue"> & {
@@ -1,6 +1,8 @@
1
1
  import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';
2
+ import type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
2
3
  import type React from 'react';
3
4
  import { type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';
5
+ import { DSFormComboboxName, FORM_COMBOBOX_MULTI_SLOTS } from './constants/index.js';
4
6
  export declare namespace DSComboboxMultiT {
5
7
  type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;
6
8
  type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;
@@ -11,12 +13,12 @@ export declare namespace DSComboboxMultiT {
11
13
  type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;
12
14
  type OptionTypes = DSCommonComboboxPropsT.OptionTypes;
13
15
  interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {
14
- selectedValues: DSCommonComboboxPropsT.ItemOption[];
15
- onChange: (suggestedValue: DSCommonComboboxPropsT.ItemOption[], selectedOption: DSCommonComboboxPropsT.SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void;
16
+ selectedValues: DSCommonComboboxPropsT.SelectionableOptions[];
17
+ onChange: (suggestedValue: DSCommonComboboxPropsT.SelectionableOptions[], selectedOption: DSCommonComboboxPropsT.SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void;
16
18
  }
17
19
  interface DefaultProps extends DSCommonComboboxPropsT.DefaultProps {
18
20
  }
19
- interface OptionalProps extends DSCommonComboboxPropsT.OptionalProps {
21
+ interface OptionalProps extends DSCommonComboboxPropsT.OptionalProps, TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSFormComboboxName, typeof FORM_COMBOBOX_MULTI_SLOTS> {
20
22
  }
21
23
  interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLElement>, keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
22
24
  }
@@ -1,6 +1,8 @@
1
1
  import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';
2
+ import type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
2
3
  import type React from 'react';
3
4
  import { type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';
5
+ import { DSFormComboboxName, FORM_COMBOBOX_SINGLE_SLOTS } from './constants/index.js';
4
6
  export declare namespace DSComboboxSingleT {
5
7
  type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;
6
8
  type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;
@@ -11,12 +13,12 @@ export declare namespace DSComboboxSingleT {
11
13
  type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;
12
14
  type OptionTypes = DSCommonComboboxPropsT.OptionTypes;
13
15
  interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {
14
- selectedValue: DSCommonComboboxPropsT.ItemOption | null;
15
- onChange: (suggestedValue: DSCommonComboboxPropsT.ItemOption | null, selectedOption: DSCommonComboboxPropsT.SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void;
16
+ selectedValue: DSCommonComboboxPropsT.SelectionableOptions | null;
17
+ onChange: (suggestedValue: DSCommonComboboxPropsT.SelectionableOptions | null, selectedOption: DSCommonComboboxPropsT.SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void;
16
18
  }
17
19
  interface DefaultProps extends DSCommonComboboxPropsT.DefaultProps {
18
20
  }
19
- interface OptionalProps extends DSCommonComboboxPropsT.OptionalProps {
21
+ interface OptionalProps extends DSCommonComboboxPropsT.OptionalProps, TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSFormComboboxName, typeof FORM_COMBOBOX_SINGLE_SLOTS> {
20
22
  }
21
23
  interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLElement>, keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
22
24
  }
@@ -63,7 +63,7 @@ export declare namespace DSCommonComboboxPropsT {
63
63
  onCreate?: (label: string) => void;
64
64
  onFilter?: (newOptions: OptionTypes[], inputValue?: string) => void;
65
65
  onCancel?: () => void;
66
- onSelectAll?: (suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void;
66
+ onSelectAll?: (suggestedValue: SelectionableOptions[] | [], event: React.MouseEvent | React.KeyboardEvent) => void;
67
67
  onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;
68
68
  isLoading?: boolean;
69
69
  popperProps?: DSFloatingWrapperT.Props;
@@ -0,0 +1,13 @@
1
+ interface TruncatedTextProps {
2
+ value?: string;
3
+ }
4
+ /**
5
+ * PUI-18660: this used to render its own hand-rolled hover tooltip on truncation.
6
+ * That internal tooltip was removed — truncation is visual-only here. Consumers who
7
+ * need the full value on hover/focus (e.g. readOnly/aria-disabled states where the
8
+ * menu can't be opened) wrap the combobox in DSTooltipV3 themselves; see the
9
+ * "WithTooltip" examples in ds-form-single-combobox / ds-form-multi-combobox.
10
+ */
11
+ declare const TruncatedText: ({ value }: TruncatedTextProps) => import("react").JSX.Element;
12
+ export { TruncatedText };
13
+ export default TruncatedText;
@@ -1,5 +1,6 @@
1
1
  export declare const DSFormComboboxName = "DSCombobox";
2
- export declare const FORM_COMBOBOX_SLOTS: {
2
+ export declare const FORM_COMBOBOX_SINGLE_SLOTS: {
3
+ readonly SELECTED_VALUES: "single-value-wrapper";
3
4
  readonly ROOT: "root";
4
5
  readonly INPUT_WRAPPER: "input-wrapper";
5
6
  readonly INPUT: "input";
@@ -8,10 +9,75 @@ export declare const FORM_COMBOBOX_SLOTS: {
8
9
  readonly SECTION_WRAPPER: "section-wrapper";
9
10
  readonly SECTION_LABEL: "section-label";
10
11
  readonly SINGLE_MENU_ITEM: "single-menu-item";
12
+ readonly LOADING_INDICATOR: "loading-indicator";
13
+ readonly SKELETON_MENU_ITEM: "skeleton-menu-item";
14
+ readonly POPPER_WRAPPER: "popper-wrapper";
15
+ readonly SELECTION: "selection";
16
+ readonly HEADER_ACTIONS: "header-actions";
17
+ readonly HEADER_ACTIONS_SEPARATOR: "header-actions-separator";
18
+ readonly INPUT_PLACEHOLDER: "input-placeholder";
19
+ readonly INPUT_FIELD_WRAPPER: "input-field-wrapper";
20
+ readonly LIST_WRAPPER: "list-wrapper";
21
+ readonly NO_MATCHES_FOUND: "no-results";
22
+ readonly CREATABLE_LABEL: "creatable-label";
23
+ readonly CREATABLE_VALUE: "creatable-value";
24
+ readonly MENU_ITEMS_WRAPPER: "menu-items-wrapper";
25
+ readonly LOADING_WRAPPER: "loading-wrapper";
26
+ };
27
+ export declare const FORM_COMBOBOX_MULTI_SLOTS: {
28
+ readonly PILL: "pill";
29
+ readonly PILL_GROUP: "pill-group";
11
30
  readonly MULTI_MENU_ITEM: "multi-menu-item";
31
+ readonly ROOT: "root";
32
+ readonly INPUT_WRAPPER: "input-wrapper";
33
+ readonly INPUT: "input";
34
+ readonly DROPDOWN_BUTTON: "dropdown-button";
35
+ readonly FAST_LIST: "fast-list";
36
+ readonly SECTION_WRAPPER: "section-wrapper";
37
+ readonly SECTION_LABEL: "section-label";
38
+ readonly SINGLE_MENU_ITEM: "single-menu-item";
12
39
  readonly LOADING_INDICATOR: "loading-indicator";
13
40
  readonly SKELETON_MENU_ITEM: "skeleton-menu-item";
41
+ readonly POPPER_WRAPPER: "popper-wrapper";
42
+ readonly SELECTION: "selection";
43
+ readonly HEADER_ACTIONS: "header-actions";
44
+ readonly HEADER_ACTIONS_SEPARATOR: "header-actions-separator";
45
+ readonly INPUT_PLACEHOLDER: "input-placeholder";
46
+ readonly INPUT_FIELD_WRAPPER: "input-field-wrapper";
47
+ readonly LIST_WRAPPER: "list-wrapper";
48
+ readonly NO_MATCHES_FOUND: "no-results";
49
+ readonly CREATABLE_LABEL: "creatable-label";
50
+ readonly CREATABLE_VALUE: "creatable-value";
51
+ readonly MENU_ITEMS_WRAPPER: "menu-items-wrapper";
52
+ readonly LOADING_WRAPPER: "loading-wrapper";
53
+ };
54
+ export declare const FORM_COMBOBOX_SLOTS: {
14
55
  readonly PILL: "pill";
56
+ readonly PILL_GROUP: "pill-group";
57
+ readonly MULTI_MENU_ITEM: "multi-menu-item";
58
+ readonly ROOT: "root";
59
+ readonly INPUT_WRAPPER: "input-wrapper";
60
+ readonly INPUT: "input";
61
+ readonly DROPDOWN_BUTTON: "dropdown-button";
62
+ readonly FAST_LIST: "fast-list";
63
+ readonly SECTION_WRAPPER: "section-wrapper";
64
+ readonly SECTION_LABEL: "section-label";
65
+ readonly SINGLE_MENU_ITEM: "single-menu-item";
66
+ readonly LOADING_INDICATOR: "loading-indicator";
67
+ readonly SKELETON_MENU_ITEM: "skeleton-menu-item";
68
+ readonly POPPER_WRAPPER: "popper-wrapper";
69
+ readonly SELECTION: "selection";
70
+ readonly HEADER_ACTIONS: "header-actions";
71
+ readonly HEADER_ACTIONS_SEPARATOR: "header-actions-separator";
72
+ readonly INPUT_PLACEHOLDER: "input-placeholder";
73
+ readonly INPUT_FIELD_WRAPPER: "input-field-wrapper";
74
+ readonly LIST_WRAPPER: "list-wrapper";
75
+ readonly NO_MATCHES_FOUND: "no-results";
76
+ readonly CREATABLE_LABEL: "creatable-label";
77
+ readonly CREATABLE_VALUE: "creatable-value";
78
+ readonly MENU_ITEMS_WRAPPER: "menu-items-wrapper";
79
+ readonly LOADING_WRAPPER: "loading-wrapper";
80
+ readonly SELECTED_VALUES: "single-value-wrapper";
15
81
  };
16
82
  export declare const FORM_COMBOBOX_DATA_TESTID: {
17
83
  CONTROLS_WRAPPER: string;
@@ -24,6 +90,8 @@ export declare const FORM_COMBOBOX_DATA_TESTID: {
24
90
  OPTION: string;
25
91
  ALLY_SELECTED_VALUES: string;
26
92
  PILL: string;
93
+ PILL_GROUP: "ds-combobox-pill-group";
94
+ MULTI_MENU_ITEM: "ds-combobox-multi-menu-item";
27
95
  ROOT: "ds-combobox-root";
28
96
  INPUT_WRAPPER: "ds-combobox-input-wrapper";
29
97
  DROPDOWN_BUTTON: "ds-combobox-dropdown-button";
@@ -31,7 +99,17 @@ export declare const FORM_COMBOBOX_DATA_TESTID: {
31
99
  SECTION_WRAPPER: "ds-combobox-section-wrapper";
32
100
  SECTION_LABEL: "ds-combobox-section-label";
33
101
  SINGLE_MENU_ITEM: "ds-combobox-single-menu-item";
34
- MULTI_MENU_ITEM: "ds-combobox-multi-menu-item";
35
102
  LOADING_INDICATOR: "ds-combobox-loading-indicator";
36
103
  SKELETON_MENU_ITEM: "ds-combobox-skeleton-menu-item";
104
+ POPPER_WRAPPER: "ds-combobox-popper-wrapper";
105
+ SELECTION: "ds-combobox-selection";
106
+ HEADER_ACTIONS: "ds-combobox-header-actions";
107
+ HEADER_ACTIONS_SEPARATOR: "ds-combobox-header-actions-separator";
108
+ INPUT_PLACEHOLDER: "ds-combobox-input-placeholder";
109
+ INPUT_FIELD_WRAPPER: "ds-combobox-input-field-wrapper";
110
+ LIST_WRAPPER: "ds-combobox-list-wrapper";
111
+ CREATABLE_LABEL: "ds-combobox-creatable-label";
112
+ CREATABLE_VALUE: "ds-combobox-creatable-value";
113
+ MENU_ITEMS_WRAPPER: "ds-combobox-menu-items-wrapper";
114
+ LOADING_WRAPPER: "ds-combobox-loading-wrapper";
37
115
  };
@@ -1,5 +1,26 @@
1
1
  import React from 'react';
2
2
  export declare const LiveRegion: () => JSX.Element;
3
+ /**
4
+ * PUI-18034 — Previously used in ComboBox.tsx for the "Loading options please wait"
5
+ * announcement; replaced by aria-busy + aria-label on Loading/Skeleton containers (which
6
+ * carry the listbox role during async states) plus a polite ResultCountStatus for the
7
+ * post-load count. No internal callers remain and not re-exported from index.tsx —
8
+ * evaluate removing.
9
+ */
3
10
  export declare const Announcer: React.MemoExoticComponent<({ message }: {
4
11
  message: string;
5
- }) => import("react/jsx-runtime.js").JSX.Element>;
12
+ }) => React.JSX.Element>;
13
+ /**
14
+ * PUI-18034 — Polite live region for post-load result count. Replaces the previous
15
+ * assertive Announcer that raced with the SR's aria-expanded announcement.
16
+ *
17
+ * WCAG 2.2 SC 4.1.3 Status Messages — announce changes without shifting focus.
18
+ * WAI-ARIA APG combobox: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
19
+ * WCAG: https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html
20
+ */
21
+ export declare const ResultCountStatus: React.MemoExoticComponent<({ menuOpen, isLoading, isSkeleton, resultCount, }: {
22
+ menuOpen: boolean;
23
+ isLoading: boolean;
24
+ isSkeleton: boolean;
25
+ resultCount: number;
26
+ }) => React.JSX.Element>;
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import type { DSComboboxT } from '../react-desc-prop-types.js';
3
3
  interface SectionProps {
4
4
  label: string;
5
- wrapperStyles: React.CSSProperties;
6
- innerRef: (instance: HTMLDivElement | null) => void;
7
- options: DSComboboxT.ItemOption[] | DSComboboxT.ItemSeparatorOptions[];
8
- handleClick: (option: DSComboboxT.ItemOption, e: React.MouseEvent<HTMLInputElement>) => void;
5
+ wrapperStyles?: React.CSSProperties;
6
+ innerRef?: (instance: HTMLDivElement | null) => void;
7
+ options: DSComboboxT.OptionTypes[];
8
+ handleClick: (option: DSComboboxT.OptionTypes, e: React.MouseEvent<HTMLInputElement>) => void;
9
9
  handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;
10
10
  focusOptionIdx: string;
11
11
  selectedValues: DSComboboxT.SelectedOptionsT;
@@ -14,5 +14,5 @@ interface SectionProps {
14
14
  index: number;
15
15
  };
16
16
  }
17
- export declare const Section: React.MemoExoticComponent<(props: SectionProps) => import("react/jsx-runtime.js").JSX.Element>;
17
+ export declare const Section: React.MemoExoticComponent<(props: SectionProps) => React.JSX.Element>;
18
18
  export {};
@@ -12,7 +12,7 @@ export declare const StyledSingleSelectWraper: import("styled-components").Style
12
12
  applyAriaDisabled: boolean;
13
13
  readOnly: boolean;
14
14
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
15
- export declare const StyledSelection: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
15
+ export declare const StyledSelection: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
16
16
  export declare const StyledHeaderActionsWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
17
17
  export declare const StyleDropdownIndicator: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
18
18
  export declare const StyleHeaderActionsSeparator: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, Partial<StyledControlsWrapperT> & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
@@ -5,7 +5,9 @@ export declare const StyledInput: import("styled-components").StyledComponent<"i
5
5
  withoutCaret: boolean;
6
6
  applyAriaDisabled: boolean;
7
7
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"input">, never>;
8
- export declare const StyledInputPlaceHolder: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
9
- export declare const StyledInputWidthReference: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
8
+ export declare const StyledInputPlaceHolder: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, {
9
+ $nonInteractive?: boolean;
10
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
11
+ export declare const StyledInputWidthReference: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, import("styled-components").ThemeProps<import("@xstyled/system").Theme> & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
10
12
  export declare const StyledInputWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
11
13
  export declare const StyledHiddenDiv: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
@@ -1,5 +1,8 @@
1
- declare const LoadingContainer: ({ getOwnerProps }: {
1
+ import React from 'react';
2
+ declare const LoadingContainer: ({ instanceUid, isMulti, getOwnerProps, }: {
3
+ instanceUid: string;
4
+ isMulti: boolean;
2
5
  getOwnerProps: () => object;
3
- }) => import("react/jsx-runtime.js").JSX.Element;
6
+ }) => React.JSX.Element;
4
7
  export { LoadingContainer };
5
8
  export default LoadingContainer;
@@ -1,4 +1,5 @@
1
- export declare const SkeletonContainer: ({ instanceUid, getOwnerProps, }: {
1
+ export declare const SkeletonContainer: ({ instanceUid, isMulti, getOwnerProps, }: {
2
2
  instanceUid: string;
3
+ isMulti: boolean;
3
4
  getOwnerProps: () => object;
4
5
  }) => JSX.Element;
@@ -6,7 +6,26 @@ interface StyledListWrapperT {
6
6
  inline?: boolean;
7
7
  }
8
8
  export declare const StyledListWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, StyledListWrapperT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
9
- export declare const StyledCreatableLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
10
- export declare const StyledCreatableValue: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
9
+ export declare const StyledCreatableLabel: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
10
+ export declare const StyledCreatableValue: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
11
11
  export declare const StyledNoResultsWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
12
+ type IdleLabelColorProps = {
13
+ disabled?: boolean;
14
+ applyAriaDisabled?: boolean;
15
+ readOnly?: boolean;
16
+ };
17
+ /**
18
+ * Combobox-specific idle color override for single menu item labels.
19
+ *
20
+ * The decision to render the idle label as neutral-700 is a combobox-level call
21
+ * (team consistency with multi, which lands at neutral-700 via the checkbox spec),
22
+ * not a generic menu-item rule. It lives here so other consumers of ds-menu-items
23
+ * are not forced into a color opinion they did not ask for.
24
+ *
25
+ * Muted states (disabled / aria-disabled / readOnly) intentionally fall through
26
+ * so disabledOption() in ds-menu-items-commons keeps owning neutral-500 and the
27
+ * neutral-600 hover variant.
28
+ */
29
+ export declare const StyledSingleMenuItem: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-menu-items").DSMenuItemsSingleT.Props>, import("@elliemae/ds-system").Theme, IdleLabelColorProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ComponentType<import("@elliemae/ds-menu-items").DSMenuItemsSingleT.Props>>, never>;
30
+ export declare const StyledMultiMenuItem: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-menu-items").DSMenuItemsMultiT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ComponentType<import("@elliemae/ds-menu-items").DSMenuItemsMultiT.Props>>, never>;
12
31
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { DSComboboxT } from '../../react-desc-prop-types.js';
2
3
  interface ItemRendererT {
3
4
  extraItemProps?: {
@@ -5,5 +6,5 @@ interface ItemRendererT {
5
6
  };
6
7
  index: number;
7
8
  }
8
- export declare const ItemRenderer: ({ index, extraItemProps }: ItemRendererT) => JSX.Element;
9
+ export declare const ItemRenderer: ({ index, extraItemProps }: ItemRendererT) => React.ReactElement | null;
9
10
  export {};
@@ -5,7 +5,7 @@ export declare const RemovableSelectedValuePill: React.ComponentType<{
5
5
  applyAriaDisabled?: boolean;
6
6
  trailingComma?: boolean;
7
7
  ownerProps?: {
8
- getOwnerProps: () => DSComboboxT.InternalProps;
8
+ getOwnerProps: () => object;
9
9
  getOwnerPropsArguments: () => object;
10
10
  };
11
11
  }>;
@@ -3,6 +3,34 @@ import type { DSComboboxMultiT } from './DSComboboxMultiT.js';
3
3
  import type { DSComboboxSingleT } from './DSComboboxSingleT.js';
4
4
  import { type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';
5
5
  export declare namespace DSComboboxT {
6
+ type SlotFunctionArguments = {
7
+ dsComboboxRoot: () => object;
8
+ dsComboboxInputWrapper: () => object;
9
+ dsComboboxInput: () => object;
10
+ dsComboboxDropdownButton: () => object;
11
+ dsComboboxFastList: () => object;
12
+ dsComboboxSectionWrapper: () => object;
13
+ dsComboboxSectionLabel: () => object;
14
+ dsComboboxSingleMenuItem: () => object;
15
+ dsComboboxMultiMenuItem: () => object;
16
+ dsComboboxLoadingIndicator: () => object;
17
+ dsComboboxSkeletonMenuItem: () => object;
18
+ dsComboboxPill: () => object;
19
+ dsComboboxPillGroup: () => object;
20
+ dsComboboxPopperWrapper: () => object;
21
+ dsComboboxSelection: () => object;
22
+ dsComboboxSingleValueWrapper: () => object;
23
+ dsComboboxHeaderActions: () => object;
24
+ dsComboboxHeaderActionsSeparator: () => object;
25
+ dsComboboxInputPlaceholder: () => object;
26
+ dsComboboxInputFieldWrapper: () => object;
27
+ dsComboboxListWrapper: () => object;
28
+ dsComboboxNoResults: () => object;
29
+ dsComboboxCreatableLabel: () => object;
30
+ dsComboboxCreatableValue: () => object;
31
+ dsComboboxMenuItemsWrapper: () => object;
32
+ dsComboboxLoadingWrapper: () => object;
33
+ };
6
34
  type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;
7
35
  type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;
8
36
  type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;
@@ -11,7 +39,7 @@ export declare namespace DSComboboxT {
11
39
  type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;
12
40
  type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;
13
41
  type OptionTypes = DSCommonComboboxPropsT.OptionTypes;
14
- type SelectedOptionsT = ItemOption[] | ItemOption | null;
42
+ type SelectedOptionsT = SelectionableOptions[] | SelectionableOptions | null;
15
43
  type SingleComboboxRequirePropsRenameInterface = Omit<DSComboboxSingleT.RequiredProps, 'selectedValue'> & {
16
44
  selectedValues: DSComboboxSingleT.RequiredProps['selectedValue'];
17
45
  };
@@ -7,9 +7,9 @@ export declare const isSelected: (value: DSComboboxT.SelectedOptionsT, activeOpt
7
7
  export declare function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[];
8
8
  export declare const isItem: (value: DSComboboxT.SelectedOptionsT) => value is DSComboboxT.ItemOption;
9
9
  export declare const findInCircularList: (list: DSComboboxT.OptionTypes[], from: number, criteria: (item: DSComboboxT.OptionTypes) => boolean, step?: number) => number;
10
- export declare const getLastValueSelected: (selectedValues: DSComboboxT.SelectedOptionsT) => import("../DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.ItemOption | null;
10
+ export declare const getLastValueSelected: (selectedValues: DSComboboxT.SelectedOptionsT) => import("../DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.SelectionableOptions | null;
11
11
  export declare const getFirstOption: (options: DSComboboxT.OptionTypes[], selectedValues?: DSComboboxT.SelectedOptionsT) => string;
12
- export declare const getSuggestedValueOnChange: (selectedOption: DSComboboxT.ItemOption, selectedValues: DSComboboxT.SelectedOptionsT, isNonClearable?: boolean) => Parameters<DSComboboxT.InternalProps["onChange"]>[0];
12
+ export declare const getSuggestedValueOnChange: (selectedOption: DSComboboxT.SelectionableOptions, selectedValues: DSComboboxT.SelectedOptionsT, isNonClearable?: boolean) => DSComboboxT.SelectedOptionsT;
13
13
  export declare const filterOptions: (inputValue: string, options: DSComboboxT.OptionTypes[]) => import("../DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.OptionTypes[];
14
14
  export declare const getFilteredOptionsSelected: (filteredOption: DSComboboxT.OptionTypes[], selectedValues: DSComboboxT.ItemOption[]) => import("../DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.OptionTypes[];
15
15
  export declare const scrollIfNeeded: (elem: HTMLElement, options?: ScrollIntoViewOptions | undefined) => void;
@@ -0,0 +1,2 @@
1
+ import type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';
2
+ export declare const isItemContainingALabel: (item: unknown) => item is DSCommonComboboxPropsT.ItemSectionOptions | DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemCreatableOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-combobox",
3
- "version": "3.62.1",
3
+ "version": "3.70.0-alpha.9",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Combobox",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://git.elliemae.io/platform-ui/dimsum.git"
25
+ "url": "https://github.com/intcx/PLATFORM-UI.dimsum.git"
26
26
  },
27
27
  "engines": {
28
28
  "pnpm": ">=9",
@@ -37,37 +37,37 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "uid": "^2.0.2",
40
- "@elliemae/ds-button-v2": "3.62.1",
41
- "@elliemae/ds-fast-list": "3.62.1",
42
- "@elliemae/ds-grid": "3.62.1",
43
- "@elliemae/ds-circular-progress-indicator": "3.62.1",
44
- "@elliemae/ds-floating-context": "3.62.1",
45
- "@elliemae/ds-icons": "3.62.1",
46
- "@elliemae/ds-menu-items": "3.62.1",
47
- "@elliemae/ds-system": "3.62.1",
48
- "@elliemae/ds-props-helpers": "3.62.1",
49
- "@elliemae/ds-truncated-tooltip-text": "3.62.1",
50
- "@elliemae/ds-pills-v2": "3.62.1"
40
+ "@elliemae/ds-button-v2": "3.70.0-alpha.9",
41
+ "@elliemae/ds-grid": "3.70.0-alpha.9",
42
+ "@elliemae/ds-floating-context": "3.70.0-alpha.9",
43
+ "@elliemae/ds-circular-progress-indicator": "3.70.0-alpha.9",
44
+ "@elliemae/ds-icons": "3.70.0-alpha.9",
45
+ "@elliemae/ds-fast-list": "3.70.0-alpha.9",
46
+ "@elliemae/ds-menu-items": "3.70.0-alpha.9",
47
+ "@elliemae/ds-pills-v2": "3.70.0-alpha.9",
48
+ "@elliemae/ds-props-helpers": "3.70.0-alpha.9",
49
+ "@elliemae/ds-system": "3.70.0-alpha.9",
50
+ "@elliemae/ds-typography": "3.70.0-alpha.9"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@elliemae/pui-theme": "~2.13.0",
54
54
  "jest": "^30.0.0",
55
- "styled-components": "~5.3.9",
55
+ "styled-components": "~5.3.11",
56
56
  "styled-system": "^5.1.5",
57
- "@elliemae/ds-form-helpers-mask-hooks": "3.62.1",
58
- "@elliemae/ds-monorepo-devops": "3.62.1",
59
- "@elliemae/ds-test-utils": "3.62.1"
57
+ "@elliemae/ds-form-helpers-mask-hooks": "3.70.0-alpha.9",
58
+ "@elliemae/ds-monorepo-devops": "3.70.0-alpha.9",
59
+ "@elliemae/ds-test-utils": "3.70.0-alpha.9"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@elliemae/pui-theme": "~2.13.0",
63
63
  "react": "^18.3.1",
64
64
  "react-dom": "^18.3.1",
65
- "styled-components": "~5.3.9",
65
+ "styled-components": "~5.3.11",
66
66
  "styled-system": "^5.1.5"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public",
70
- "typeSafety": false
70
+ "typeSafety": true
71
71
  },
72
72
  "scripts": {
73
73
  "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/config/useClickOutside.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useEffect } from 'react';\n\nexport function useOnClickOutside<T extends Node, CbT extends (event: Event) => void, Z extends Node>(\n ref: T | null,\n cb: CbT,\n excludeNode: Z | null,\n): void {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n if (\n !ref ||\n ref?.contains?.(event.target as Node) ||\n (excludeNode && excludeNode.contains(event.target as Node))\n ) {\n return;\n }\n cb(event);\n };\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, cb, excludeNode]);\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0B;AAEnB,SAAS,kBACd,KACA,IACA,aACM;AACN,8BAAU,MAAM;AACd,UAAM,WAAW,CAAC,UAAmC;AACnD,UACE,CAAC,OACD,KAAK,WAAW,MAAM,MAAc,KACnC,eAAe,YAAY,SAAS,MAAM,MAAc,GACzD;AACA;AAAA,MACF;AACA,SAAG,KAAK;AAAA,IACV;AACA,aAAS,iBAAiB,aAAa,QAAQ;AAC/C,aAAS,iBAAiB,cAAc,QAAQ;AAChD,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,QAAQ;AAClD,eAAS,oBAAoB,cAAc,QAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,KAAK,IAAI,WAAW,CAAC;AAC3B;",
6
- "names": []
7
- }
@@ -1,22 +0,0 @@
1
- import * as React from "react";
2
- import { useEffect } from "react";
3
- function useOnClickOutside(ref, cb, excludeNode) {
4
- useEffect(() => {
5
- const listener = (event) => {
6
- if (!ref || ref?.contains?.(event.target) || excludeNode && excludeNode.contains(event.target)) {
7
- return;
8
- }
9
- cb(event);
10
- };
11
- document.addEventListener("mousedown", listener);
12
- document.addEventListener("touchstart", listener);
13
- return () => {
14
- document.removeEventListener("mousedown", listener);
15
- document.removeEventListener("touchstart", listener);
16
- };
17
- }, [ref, cb, excludeNode]);
18
- }
19
- export {
20
- useOnClickOutside
21
- };
22
- //# sourceMappingURL=useClickOutside.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useClickOutside.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect } from 'react';\n\nexport function useOnClickOutside<T extends Node, CbT extends (event: Event) => void, Z extends Node>(\n ref: T | null,\n cb: CbT,\n excludeNode: Z | null,\n): void {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n if (\n !ref ||\n ref?.contains?.(event.target as Node) ||\n (excludeNode && excludeNode.contains(event.target as Node))\n ) {\n return;\n }\n cb(event);\n };\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, cb, excludeNode]);\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,SAAS,kBACd,KACA,IACA,aACM;AACN,YAAU,MAAM;AACd,UAAM,WAAW,CAAC,UAAmC;AACnD,UACE,CAAC,OACD,KAAK,WAAW,MAAM,MAAc,KACnC,eAAe,YAAY,SAAS,MAAM,MAAc,GACzD;AACA;AAAA,MACF;AACA,SAAG,KAAK;AAAA,IACV;AACA,aAAS,iBAAiB,aAAa,QAAQ;AAC/C,aAAS,iBAAiB,cAAc,QAAQ;AAChD,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,QAAQ;AAClD,eAAS,oBAAoB,cAAc,QAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,KAAK,IAAI,WAAW,CAAC;AAC3B;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- export declare function useOnClickOutside<T extends Node, CbT extends (event: Event) => void, Z extends Node>(ref: T | null, cb: CbT, excludeNode: Z | null): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};