@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/DSCommonComboboxPropsT.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { DSFloatingWrapperT, DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';\nimport type { DSPropTypesSchema, GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport type React from 'react';\n\nexport declare function noop<T extends unknown[]>(..._args: T): void;\n\nexport declare namespace DSCommonComboboxPropsT {\n export interface CommonItemOptions extends GlobalAttributesT {\n dsId: string;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n render?: React.ComponentType<unknown>;\n }\n export interface ItemSeparatorOptions extends CommonItemOptions {\n type: 'separator';\n }\n export interface ItemSectionOptions extends CommonItemOptions {\n type: 'section';\n label: string;\n options: OptionTypes[];\n }\n export interface ItemOption extends CommonItemOptions {\n value: string;\n label: string;\n type: 'option';\n }\n export interface ItemCreatableOption extends CommonItemOptions {\n label: string;\n type: 'creatable';\n }\n export type SelectionableOptions = ItemOption | ItemCreatableOption;\n export type LayoutOptions = ItemSeparatorOptions | ItemSectionOptions;\n export type OptionTypes = SelectionableOptions | LayoutOptions;\n\n export interface RequiredProps {\n allOptions: OptionTypes[];\n }\n export interface DefaultProps {\n startPlacementPreference: DSHookFloatingContextT.PopperPlacementsT;\n placementOrderPreference: DSHookFloatingContextT.PopperPlacementsT[];\n hasError: boolean;\n inline: boolean;\n withoutPortal: boolean;\n isNonClearable: boolean;\n disabled: boolean;\n noOptionsMessage: string;\n innerRef: React.MutableRefObject<HTMLInputElement | null> | ((ref: HTMLInputElement | null) => void);\n useMask: DSMaskT.Hook | typeof noop;\n onlySelectable: boolean;\n isSkeleton: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n isMenuOpenableWithReadOnly: boolean;\n forceFocusFirstOptionOnType: boolean;\n menuMaxHeight: SizingProps['maxHeight'];\n }\n export interface OptionalProps {\n menuMinWidth?: SizingProps['minWidth'];\n placeholder?: string;\n autoFocus?: boolean;\n filteredOptions?: OptionTypes[];\n isMenuOpen?: boolean;\n onMenuChange?: (\n state: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => void;\n onCreate?: (label: string) => void;\n onFilter?: (newOptions: OptionTypes[], inputValue?: string) => void;\n onCancel?: () => void;\n onSelectAll?: (suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;\n isLoading?: boolean;\n popperProps?: DSFloatingWrapperT.Props;\n }\n}\n\ntype CommonComboboxProps = DSCommonComboboxPropsT.RequiredProps &\n DSCommonComboboxPropsT.DefaultProps &\n DSCommonComboboxPropsT.OptionalProps;\n\nexport const commonComboboxPropTypes: DSPropTypesSchema<CommonComboboxProps> = {\n placeholder: PropTypes.string.description(\n 'Input placeholder text. Note: announcement behavior may be handled by component logic for accessibility, while visible placeholder text remains as provided.',\n ),\n allOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.object, PropTypes.string])).isRequired.description(\n 'Full list of options and layout rows used by the combobox before filtering.',\n ),\n filteredOptions: PropTypes.arrayOf(PropTypes.object).description(\n 'Filtered list rendered in the menu for the current input value. THIS DOES NOT SUPPORT STRING OPTIONS, ALL OPTIONS MUST BE OBJECTS.',\n ),\n disabled: PropTypes.bool\n .description('Disables user interaction with the combobox input and menu trigger.')\n .defaultValue('false'),\n autoFocus: PropTypes.bool.description('Automatically focuses the input on mount when true.'),\n hasError: PropTypes.bool.description('Applies error styling/state to the combobox.').defaultValue('false'),\n noOptionsMessage: PropTypes.string\n .description('Message displayed when no options match the current filter.')\n .defaultValue('No Matches Found'),\n onFilter: PropTypes.func\n .description('Called when input text changes and options are filtered.')\n .signature('(newOptions: OptionTypes[], inputValue?: string) => void'),\n onCreate: PropTypes.func\n .description('Called when the user creates a new option from free-text input.')\n .signature('(label: string) => void'),\n onCancel: PropTypes.func\n .description('Called when Escape dismisses/closes the menu (effectively menu dismiss semantics).')\n .signature('() => void'),\n onMenuChange: PropTypes.func\n .description('Called when the menu open state changes.')\n .signature(\n '(state: boolean, reason: string, e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>) => void',\n ),\n menuMinWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'Minimum menu width. Numeric values are interpreted as px.',\n ),\n menuMaxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Maximum menu height. Will always append \"px\" to the provided values.')\n .defaultValue('300'),\n withoutPortal: PropTypes.bool\n .description(\n 'When true the contextual menu DOM will render as part of the same parent element of the input instead of the body tag.',\n )\n .defaultValue('false'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.object })])\n .description('Mutable ref object or callback ref assigned to the underlying input.')\n .defaultValue('createRef()'),\n onlySelectable: PropTypes.bool\n .description('Disables free-text filtering and allows only selectable option values.')\n .defaultValue('false'),\n isSkeleton: PropTypes.bool.description('Displays the component in skeleton loading mode.').defaultValue('false'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Applies disabled semantics for accessibility while preserving focusability. Primary action remains blocked.',\n )\n .defaultValue('false'),\n readOnly: PropTypes.bool\n .description('Makes input content non-editable while keeping the field accessible.')\n .defaultValue('false'),\n isMenuOpenableWithReadOnly: PropTypes.bool\n .description('Controls whether the menu may still open while `readOnly` is true.')\n .defaultValue('false'),\n onSelectAll: PropTypes.func\n .description('Deprecated callback fired when selecting all options.')\n .signature('(suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void')\n .deprecated({ version: '25.2' }),\n popperProps: PropTypes.object.description(\n 'Pass-through props forwarded to the floating wrapper implementation. Behavior is primarily defined by the floating wrapper contract.',\n ),\n forceFocusFirstOptionOnType: PropTypes.bool\n .description('When typing, moves pseudo focus to the first available option.')\n .defaultValue('false'),\n placementOrderPreference: PropTypes.arrayOf(PropTypes.string)\n .description(\n 'When the floating menu cannot be placed in the preferred start placement, it will attempt placements in the order defined by this array.',\n )\n .defaultValue('[\"bottom-start\", \"top-start\"]'),\n startPlacementPreference: PropTypes.string\n .description('If possible, the contextual menu will position first and foremost according to this placement.')\n .defaultValue('bottom-start'),\n inline: PropTypes.bool.description('Renders menu using inline positioning strategy when true.').defaultValue('false'),\n isNonClearable: PropTypes.bool\n .description('Prevents clearing the current selection when true, in a select-like fashion.')\n .defaultValue('false'),\n useMask: PropTypes.func\n .description(\n 'Mask hook/function returning input mask handlers. Designed for the design system masks (e.g. usePhoneMask) but accepts any compatible implementation.',\n )\n .defaultValue('() => {}'),\n isMenuOpen: PropTypes.bool.description('Controlled open state for the menu.'),\n isLoading: PropTypes.bool.description('Shows loading state while options are being fetched.'),\n onKeyDown: PropTypes.func\n .description(\n 'Callback for key down events on the input text element only (not a root-level/global keyboard handler). This is intentionally narrower than generic global onKeyDown behavior.',\n )\n .signature('(e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void'),\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { DSFloatingWrapperT, DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';\nimport type { DSPropTypesSchema, GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport type React from 'react';\n\nexport declare function noop<T extends unknown[]>(..._args: T): void;\n\nexport declare namespace DSCommonComboboxPropsT {\n export interface CommonItemOptions extends GlobalAttributesT {\n dsId: string;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n render?: React.ComponentType<unknown>;\n }\n export interface ItemSeparatorOptions extends CommonItemOptions {\n type: 'separator';\n }\n export interface ItemSectionOptions extends CommonItemOptions {\n type: 'section';\n label: string;\n options: OptionTypes[];\n }\n export interface ItemOption extends CommonItemOptions {\n value: string;\n label: string;\n type: 'option';\n }\n export interface ItemCreatableOption extends CommonItemOptions {\n label: string;\n type: 'creatable';\n }\n export type SelectionableOptions = ItemOption | ItemCreatableOption;\n export type LayoutOptions = ItemSeparatorOptions | ItemSectionOptions;\n export type OptionTypes = SelectionableOptions | LayoutOptions;\n\n export interface RequiredProps {\n allOptions: OptionTypes[];\n }\n export interface DefaultProps {\n startPlacementPreference: DSHookFloatingContextT.PopperPlacementsT;\n placementOrderPreference: DSHookFloatingContextT.PopperPlacementsT[];\n hasError: boolean;\n inline: boolean;\n withoutPortal: boolean;\n isNonClearable: boolean;\n disabled: boolean;\n noOptionsMessage: string;\n innerRef: React.MutableRefObject<HTMLInputElement | null> | ((ref: HTMLInputElement | null) => void);\n useMask: DSMaskT.Hook | typeof noop;\n onlySelectable: boolean;\n isSkeleton: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n isMenuOpenableWithReadOnly: boolean;\n forceFocusFirstOptionOnType: boolean;\n menuMaxHeight: SizingProps['maxHeight'];\n }\n export interface OptionalProps {\n menuMinWidth?: SizingProps['minWidth'];\n placeholder?: string;\n autoFocus?: boolean;\n filteredOptions?: OptionTypes[];\n isMenuOpen?: boolean;\n onMenuChange?: (\n state: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => void;\n onCreate?: (label: string) => void;\n onFilter?: (newOptions: OptionTypes[], inputValue?: string) => void;\n onCancel?: () => void;\n onSelectAll?: (suggestedValue: SelectionableOptions[] | [], event: React.MouseEvent | React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;\n isLoading?: boolean;\n popperProps?: DSFloatingWrapperT.Props;\n }\n}\n\ntype CommonComboboxProps = DSCommonComboboxPropsT.RequiredProps &\n DSCommonComboboxPropsT.DefaultProps &\n DSCommonComboboxPropsT.OptionalProps;\n\nexport const commonComboboxPropTypes: DSPropTypesSchema<CommonComboboxProps> = {\n placeholder: PropTypes.string.description(\n 'Input placeholder text. Note: announcement behavior may be handled by component logic for accessibility, while visible placeholder text remains as provided.',\n ),\n allOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.object, PropTypes.string])).isRequired.description(\n 'Full list of options and layout rows used by the combobox before filtering.',\n ),\n filteredOptions: PropTypes.arrayOf(PropTypes.object).description(\n 'Filtered list rendered in the menu for the current input value. THIS DOES NOT SUPPORT STRING OPTIONS, ALL OPTIONS MUST BE OBJECTS.',\n ),\n disabled: PropTypes.bool\n .description('Disables user interaction with the combobox input and menu trigger.')\n .defaultValue('false'),\n autoFocus: PropTypes.bool.description('Automatically focuses the input on mount when true.'),\n hasError: PropTypes.bool.description('Applies error styling/state to the combobox.').defaultValue('false'),\n noOptionsMessage: PropTypes.string\n .description('Message displayed when no options match the current filter.')\n .defaultValue('No Matches Found'),\n onFilter: PropTypes.func\n .description('Called when input text changes and options are filtered.')\n .signature('(newOptions: OptionTypes[], inputValue?: string) => void'),\n onCreate: PropTypes.func\n .description('Called when the user creates a new option from free-text input.')\n .signature('(label: string) => void'),\n onCancel: PropTypes.func\n .description('Called when Escape dismisses/closes the menu (effectively menu dismiss semantics).')\n .signature('() => void'),\n onMenuChange: PropTypes.func\n .description('Called when the menu open state changes.')\n .signature(\n '(state: boolean, reason: string, e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>) => void',\n ),\n menuMinWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'Minimum menu width. Numeric values are interpreted as px.',\n ),\n menuMaxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Maximum menu height. Will always append \"px\" to the provided values.')\n .defaultValue('300'),\n withoutPortal: PropTypes.bool\n .description(\n 'When true the contextual menu DOM will render as part of the same parent element of the input instead of the body tag.',\n )\n .defaultValue('false'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.object })])\n .description('Mutable ref object or callback ref assigned to the underlying input.')\n .defaultValue('createRef()'),\n onlySelectable: PropTypes.bool\n .description('Disables free-text filtering and allows only selectable option values.')\n .defaultValue('false'),\n isSkeleton: PropTypes.bool.description('Displays the component in skeleton loading mode.').defaultValue('false'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Applies disabled semantics for accessibility while preserving focusability. Primary action remains blocked.',\n )\n .defaultValue('false'),\n readOnly: PropTypes.bool\n .description('Makes input content non-editable while keeping the field accessible.')\n .defaultValue('false'),\n isMenuOpenableWithReadOnly: PropTypes.bool\n .description('Controls whether the menu may still open while `readOnly` is true.')\n .defaultValue('false'),\n onSelectAll: PropTypes.func\n .description('Deprecated callback fired when selecting all options.')\n .signature('(suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void')\n .deprecated({ version: '25.2' }),\n popperProps: PropTypes.object.description(\n 'Pass-through props forwarded to the floating wrapper implementation. Behavior is primarily defined by the floating wrapper contract.',\n ),\n forceFocusFirstOptionOnType: PropTypes.bool\n .description('When typing, moves pseudo focus to the first available option.')\n .defaultValue('false'),\n placementOrderPreference: PropTypes.arrayOf(PropTypes.string)\n .description(\n 'When the floating menu cannot be placed in the preferred start placement, it will attempt placements in the order defined by this array.',\n )\n .defaultValue('[\"bottom-start\", \"top-start\"]'),\n startPlacementPreference: PropTypes.string\n .description('If possible, the contextual menu will position first and foremost according to this placement.')\n .defaultValue('bottom-start'),\n inline: PropTypes.bool.description('Renders menu using inline positioning strategy when true.').defaultValue('false'),\n isNonClearable: PropTypes.bool\n .description('Prevents clearing the current selection when true, in a select-like fashion.')\n .defaultValue('false'),\n useMask: PropTypes.func\n .description(\n 'Mask hook/function returning input mask handlers. Designed for the design system masks (e.g. usePhoneMask) but accepts any compatible implementation.',\n )\n .defaultValue('() => {}'),\n isMenuOpen: PropTypes.bool.description('Controlled open state for the menu.'),\n isLoading: PropTypes.bool.description('Shows loading state while options are being fetched.'),\n onKeyDown: PropTypes.func\n .description(\n 'Callback for key down events on the input text element only (not a root-level/global keyboard handler). This is intentionally narrower than generic global onKeyDown behavior.',\n )\n .signature('(e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void'),\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,iBAAiB;AAiFnB,MAAM,0BAAkE;AAAA,EAC7E,aAAa,UAAU,OAAO;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,YAAY,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,EAAE,WAAW;AAAA,IAClG;AAAA,EACF;AAAA,EACA,iBAAiB,UAAU,QAAQ,UAAU,MAAM,EAAE;AAAA,IACnD;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KACjB,YAAY,qEAAqE,EACjF,aAAa,OAAO;AAAA,EACvB,WAAW,UAAU,KAAK,YAAY,qDAAqD;AAAA,EAC3F,UAAU,UAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,OAAO;AAAA,EACzG,kBAAkB,UAAU,OACzB,YAAY,6DAA6D,EACzE,aAAa,kBAAkB;AAAA,EAClC,UAAU,UAAU,KACjB,YAAY,0DAA0D,EACtE,UAAU,0DAA0D;AAAA,EACvE,UAAU,UAAU,KACjB,YAAY,iEAAiE,EAC7E,UAAU,yBAAyB;AAAA,EACtC,UAAU,UAAU,KACjB,YAAY,oFAAoF,EAChG,UAAU,YAAY;AAAA,EACzB,cAAc,UAAU,KACrB,YAAY,0CAA0C,EACtD;AAAA,IACC;AAAA,EACF;AAAA,EACF,cAAc,UAAU,UAAU,CAAC,UAAU,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U,KAChB;AAAA,IACC;AAAA,EACF,EACC,aAAa,UAAU;AAAA,EAC1B,YAAY,UAAU,KAAK,YAAY,qCAAqC;AAAA,EAC5E,WAAW,UAAU,KAAK,YAAY,sDAAsD;AAAA,EAC5F,WAAW,UAAU,KAClB;AAAA,IACC;AAAA,EACF,EACC,UAAU,uEAAuE;AACtF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { styled } from "@elliemae/ds-system";
4
+ const TruncatedSpan = styled.span`
5
+ text-overflow: ellipsis;
6
+ white-space: nowrap;
7
+ overflow: hidden;
8
+ display: inline-block;
9
+ max-width: 100%;
10
+ `;
11
+ const TruncatedText = ({ value = "" }) => /* @__PURE__ */ jsx(TruncatedSpan, { children: value });
12
+ var TruncatedText_default = TruncatedText;
13
+ export {
14
+ TruncatedText,
15
+ TruncatedText_default as default
16
+ };
17
+ //# sourceMappingURL=TruncatedText.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TruncatedText.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\n\nconst TruncatedSpan = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\ninterface TruncatedTextProps {\n value?: string;\n}\n\n/**\n * PUI-18660: this used to render its own hand-rolled hover tooltip on truncation.\n * That internal tooltip was removed \u2014 truncation is visual-only here. Consumers who\n * need the full value on hover/focus (e.g. readOnly/aria-disabled states where the\n * menu can't be opened) wrap the combobox in DSTooltipV3 themselves; see the\n * \"WithTooltip\" examples in ds-form-single-combobox / ds-form-multi-combobox.\n */\nconst TruncatedText = ({ value = '' }: TruncatedTextProps) => <TruncatedSpan>{value}</TruncatedSpan>;\n\nexport { TruncatedText };\nexport default TruncatedText;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqBuC;AArB9D,SAAS,cAAc;AAEvB,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmB7B,MAAM,gBAAgB,CAAC,EAAE,QAAQ,GAAG,MAA0B,oBAAC,iBAAe,iBAAM;AAGpF,IAAO,wBAAQ;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useComboBox.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n | DSCommonComboboxPropsT.ItemOption\n | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.Props<T>>(\n props,\n // we have a weird inference going on in this component\n // weird because we are even renaming selectedValues to selectedValue for the single combobox,\n // type safety here is flanky, we need to cast this, as a one ad-hoc exception\n defaultProps as DSComboboxT.Props<T>,\n );\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const {\n id,\n selectedValues,\n isMenuOpen,\n onMenuChange,\n applyAriaDisabled,\n forceFocusFirstOptionOnType,\n inline,\n readOnly,\n isMenuOpenableWithReadOnly,\n } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (applyAriaDisabled) return;\n if (onMenuChange !== undefined) onMenuChange(newState, reason, e);\n setShowPopover(newState);\n if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {\n const focusedValue = getFirstOption(correctOptions, selectedValues);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n } else {\n setFocusOptionIdx('');\n }\n },\n [applyAriaDisabled, onMenuChange, inputValue, focusOptionIdx, selectedValues, correctOptions, scrollOptionIntoView],\n );\n\n // We need to force the auto focus for the inline since we dont control the floating wrapper.\n useEffect(() => {\n if (inline) {\n setMenuState(true, 'inline');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const shouldPreventContextMenuOpening = readOnly && !isMenuOpenableWithReadOnly;\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n menuState,\n referenceElement,\n listRef,\n focusOptionIdx,\n selectedOptionsRef,\n controlsWrapperRef,\n inputValue,\n setInputValue,\n setMenuState,\n hasFocus,\n pillGroupRef,\n wrapperListRef,\n setHasFocus,\n setFocusOptionIdx,\n scrollOptionIntoView,\n setReferenceElement,\n setShowPopover,\n internalRef,\n correctOptions,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n }),\n [\n scrollOptionIntoView,\n setMenuState,\n correctOptions,\n hasFocus,\n propsWithDefaults,\n inputValue,\n focusOptionIdx,\n wrapperListRef,\n menuState,\n pillGroupRef,\n referenceElement,\n selectedOptionsRef,\n controlsWrapperRef,\n listRef,\n internalRef,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n ],\n );\n\n return ctx;\n};\n\nexport type UseComboBoxReturnType = ReturnType<typeof useComboBox>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,8BAA8B,sCAAsC;AAC7E,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AAClE,SAAS,WAAW;AAGpB,SAAS,mBAAmB,oBAAoB;AAChD,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AAM9B,MAAM,cAAc,CAKzB,UACG;AACH,QAAM,oBAAoB;AAAA,IACxB;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,EACF;AACA,iCAA+B,mBAAmB,mBAAmB,cAAc;AACnF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkB,KAAK;AAC7D,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAA6B,IAAI;AAEjF,QAAM,CAAC,YAAY,aAAa,IAAI,SAAiB,EAAE;AACvD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB,KAAK;AAEvD,QAAM,cAAc,OAAyB,IAAI;AACjD,QAAM,iBAAiB,OAAuB,IAAI;AAElD,QAAM,qBAAqB,OAAuB,IAAI;AACtD,QAAM,qBAAqB,OAAuB,IAAI;AACtD,QAAM,eAAe,OAAuB,IAAI;AAEhD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,cAAc,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAEpD,QAAM,YAAY,QAAQ,MAAM;AAC9B,QAAI,eAAe,OAAW,QAAO;AACrC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,UAAU,CAAC;AAM5B,QAA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,gBAAgB,oBAAoB;AAAA,EACpH;AAGA,YAAU,MAAM;AACd,QAAI,QAAQ;AACV,mBAAa,MAAM,QAAQ;AAAA,IAC7B;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,QAAM,kCAAkC,YAAY,CAAC;AAErD,QAAM,MAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO,EAAE,GAAG,kBAAkB;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.Props<T>>(\n props,\n // we have a weird inference going on in this component\n // weird because we are even renaming selectedValues to selectedValue for the single combobox,\n // type safety here is flanky, we need to cast this, as a one ad-hoc exception\n defaultProps as DSComboboxT.Props<T>,\n );\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const {\n id,\n selectedValues,\n isMenuOpen,\n onMenuChange,\n applyAriaDisabled,\n forceFocusFirstOptionOnType,\n inline,\n readOnly,\n isMenuOpenableWithReadOnly,\n } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (applyAriaDisabled) return;\n if (onMenuChange !== undefined) onMenuChange(newState, reason, e);\n setShowPopover(newState);\n if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {\n const focusedValue = getFirstOption(correctOptions, selectedValues);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n } else {\n setFocusOptionIdx('');\n }\n },\n [applyAriaDisabled, onMenuChange, inputValue, focusOptionIdx, selectedValues, correctOptions, scrollOptionIntoView],\n );\n\n // We need to force the auto focus for the inline since we dont control the floating wrapper.\n useEffect(() => {\n if (inline) {\n setMenuState(true, 'inline');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const shouldPreventContextMenuOpening = readOnly && !isMenuOpenableWithReadOnly;\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n menuState,\n referenceElement,\n listRef,\n focusOptionIdx,\n selectedOptionsRef,\n controlsWrapperRef,\n inputValue,\n setInputValue,\n setMenuState,\n hasFocus,\n pillGroupRef,\n wrapperListRef,\n setHasFocus,\n setFocusOptionIdx,\n scrollOptionIntoView,\n setReferenceElement,\n setShowPopover,\n internalRef,\n correctOptions,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n }),\n [\n scrollOptionIntoView,\n setMenuState,\n correctOptions,\n hasFocus,\n propsWithDefaults,\n inputValue,\n focusOptionIdx,\n wrapperListRef,\n menuState,\n pillGroupRef,\n referenceElement,\n selectedOptionsRef,\n controlsWrapperRef,\n listRef,\n internalRef,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n ],\n );\n\n return ctx;\n};\n\nexport type UseComboBoxReturnType = ReturnType<typeof useComboBox>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,8BAA8B,sCAAsC;AAC7E,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AAClE,SAAS,WAAW;AAGpB,SAAS,mBAAmB,oBAAoB;AAChD,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,4BAA4B;AACrD,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AAM9B,MAAM,cAAc,CAIzB,UACG;AACH,QAAM,oBAAoB;AAAA,IACxB;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,EACF;AACA,iCAA+B,mBAAmB,mBAAmB,cAAc;AACnF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkB,KAAK;AAC7D,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAA6B,IAAI;AAEjF,QAAM,CAAC,YAAY,aAAa,IAAI,SAAiB,EAAE;AACvD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB,KAAK;AAEvD,QAAM,cAAc,OAAyB,IAAI;AACjD,QAAM,iBAAiB,OAAuB,IAAI;AAElD,QAAM,qBAAqB,OAAuB,IAA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ACE,UACA,QACA,MACG;AACH,UAAI,kBAAmB;AACvB,UAAI,iBAAiB,OAAW,cAAa,UAAU,QAAQ,CAAC;AAChE,qBAAe,QAAQ;AACvB,UAAI,CAAC,cAAc,YAAY,CAAC,kBAAkB,CAAC,qBAAqB,cAAc,GAAG;AACvF,cAAM,eAAe,eAAe,gBAAgB,cAAc;AAClE,0BAAkB,YAAY;AAC9B,6BAAqB,cAAc,EAAE,OAAO,SAAS,CAAC;AAAA,MACxD,OAAO;AACL,0BAAkB,EAAE;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,cAAc,YAAY,gBAAgB,gBAAgB,gBAAgB,oBAAoB;AAAA,EACpH;AAGA,YAAU,MAAM;AACd,QAAI,QAAQ;AACV,mBAAa,MAAM,QAAQ;AAAA,IAC7B;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,QAAM,kCAAkC,YAAY,CAAC;AAErD,QAAM,MAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO,EAAE,GAAG,kBAAkB;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
3
  const DSFormComboboxName = "DSCombobox";
4
- const FORM_COMBOBOX_SLOTS = {
5
- // Same as old container
4
+ const FORM_COMBOBOX_COMMON_SLOTS = {
6
5
  ROOT: "root",
7
6
  INPUT_WRAPPER: "input-wrapper",
8
7
  INPUT: "input",
@@ -10,11 +9,38 @@ const FORM_COMBOBOX_SLOTS = {
10
9
  FAST_LIST: "fast-list",
11
10
  SECTION_WRAPPER: "section-wrapper",
12
11
  SECTION_LABEL: "section-label",
12
+ // Single-select: regular menu items. Both modes: creatable items (when `onCreate` is provided).
13
13
  SINGLE_MENU_ITEM: "single-menu-item",
14
- MULTI_MENU_ITEM: "multi-menu-item",
15
14
  LOADING_INDICATOR: "loading-indicator",
16
15
  SKELETON_MENU_ITEM: "skeleton-menu-item",
17
- PILL: "pill"
16
+ POPPER_WRAPPER: "popper-wrapper",
17
+ SELECTION: "selection",
18
+ HEADER_ACTIONS: "header-actions",
19
+ HEADER_ACTIONS_SEPARATOR: "header-actions-separator",
20
+ INPUT_PLACEHOLDER: "input-placeholder",
21
+ INPUT_FIELD_WRAPPER: "input-field-wrapper",
22
+ LIST_WRAPPER: "list-wrapper",
23
+ NO_MATCHES_FOUND: "no-results",
24
+ // legacy data-testid: combobox-no-matches-found — breaking change if removed
25
+ CREATABLE_LABEL: "creatable-label",
26
+ CREATABLE_VALUE: "creatable-value",
27
+ MENU_ITEMS_WRAPPER: "menu-items-wrapper",
28
+ LOADING_WRAPPER: "loading-wrapper"
29
+ };
30
+ const FORM_COMBOBOX_SINGLE_SLOTS = {
31
+ ...FORM_COMBOBOX_COMMON_SLOTS,
32
+ SELECTED_VALUES: "single-value-wrapper"
33
+ // legacy data-testid: combobox-selected-values — breaking change if removed
34
+ };
35
+ const FORM_COMBOBOX_MULTI_SLOTS = {
36
+ ...FORM_COMBOBOX_COMMON_SLOTS,
37
+ PILL: "pill",
38
+ PILL_GROUP: "pill-group",
39
+ MULTI_MENU_ITEM: "multi-menu-item"
40
+ };
41
+ const FORM_COMBOBOX_SLOTS = {
42
+ ...FORM_COMBOBOX_SINGLE_SLOTS,
43
+ ...FORM_COMBOBOX_MULTI_SLOTS
18
44
  };
19
45
  const FORM_COMBOBOX_DATA_TESTID = {
20
46
  ...slotObjectToDataTestIds(DSFormComboboxName, FORM_COMBOBOX_SLOTS),
@@ -33,6 +59,8 @@ const FORM_COMBOBOX_DATA_TESTID = {
33
59
  export {
34
60
  DSFormComboboxName,
35
61
  FORM_COMBOBOX_DATA_TESTID,
62
+ FORM_COMBOBOX_MULTI_SLOTS,
63
+ FORM_COMBOBOX_SINGLE_SLOTS,
36
64
  FORM_COMBOBOX_SLOTS
37
65
  };
38
66
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFormComboboxName = 'DSCombobox';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_COMBOBOX_SLOTS = {\n // Same as old container\n ROOT: 'root',\n INPUT_WRAPPER: 'input-wrapper',\n INPUT: 'input',\n DROPDOWN_BUTTON: 'dropdown-button',\n FAST_LIST: 'fast-list',\n SECTION_WRAPPER: 'section-wrapper',\n SECTION_LABEL: 'section-label',\n SINGLE_MENU_ITEM: 'single-menu-item',\n MULTI_MENU_ITEM: 'multi-menu-item',\n LOADING_INDICATOR: 'loading-indicator',\n SKELETON_MENU_ITEM: 'skeleton-menu-item',\n PILL: 'pill',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_COMBOBOX_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSFormComboboxName, FORM_COMBOBOX_SLOTS),\n // legacy data-testid\n CONTROLS_WRAPPER: 'combobox-controls-wrapper',\n CONTAINER: 'combobox-container',\n INPUT: 'combobox-input',\n LIST: 'combobox-menu-list',\n NO_MATCHES_FOUND: 'combobox-no-matches-found',\n SELECTED_VALUES: 'combobox-selected-values',\n DROPDOWN: 'combobox-dropdown-btn',\n OPTION: 'combobox-option',\n ALLY_SELECTED_VALUES: 'combobox-ally-selected-values',\n PILL: 'ds-pill-wrapper',\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,qBAAqB;AAG3B,MAAM,sBAAsB;AAAA;AAAA,EAEjC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,MAAM;AACR;AAGO,MAAM,4BAA4B;AAAA,EACvC,GAAG,wBAAwB,oBAAoB,mBAAmB;AAAA;AAAA,EAElE,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,sBAAsB;AAAA,EACtB,MAAM;AACR;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFormComboboxName = 'DSCombobox';\n\n// Slots available in both single and multi-select modes\nconst FORM_COMBOBOX_COMMON_SLOTS = {\n ROOT: 'root',\n INPUT_WRAPPER: 'input-wrapper',\n INPUT: 'input',\n DROPDOWN_BUTTON: 'dropdown-button',\n FAST_LIST: 'fast-list',\n SECTION_WRAPPER: 'section-wrapper',\n SECTION_LABEL: 'section-label',\n // Single-select: regular menu items. Both modes: creatable items (when `onCreate` is provided).\n SINGLE_MENU_ITEM: 'single-menu-item',\n LOADING_INDICATOR: 'loading-indicator',\n SKELETON_MENU_ITEM: 'skeleton-menu-item',\n POPPER_WRAPPER: 'popper-wrapper',\n SELECTION: 'selection',\n HEADER_ACTIONS: 'header-actions',\n HEADER_ACTIONS_SEPARATOR: 'header-actions-separator',\n INPUT_PLACEHOLDER: 'input-placeholder',\n INPUT_FIELD_WRAPPER: 'input-field-wrapper',\n LIST_WRAPPER: 'list-wrapper',\n NO_MATCHES_FOUND: 'no-results', // legacy data-testid: combobox-no-matches-found \u2014 breaking change if removed\n CREATABLE_LABEL: 'creatable-label',\n CREATABLE_VALUE: 'creatable-value',\n MENU_ITEMS_WRAPPER: 'menu-items-wrapper',\n LOADING_WRAPPER: 'loading-wrapper',\n} as const;\n\n// Slots available in single-select mode only\nexport const FORM_COMBOBOX_SINGLE_SLOTS = {\n ...FORM_COMBOBOX_COMMON_SLOTS,\n SELECTED_VALUES: 'single-value-wrapper', // legacy data-testid: combobox-selected-values \u2014 breaking change if removed\n} as const;\n\n// Slots available in multi-select mode only\nexport const FORM_COMBOBOX_MULTI_SLOTS = {\n ...FORM_COMBOBOX_COMMON_SLOTS,\n PILL: 'pill',\n PILL_GROUP: 'pill-group',\n MULTI_MENU_ITEM: 'multi-menu-item',\n} as const;\n\n// Full slot set \u2014 union of both modes. Used for slot declarations in styled components and runtime helpers.\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_COMBOBOX_SLOTS = {\n ...FORM_COMBOBOX_SINGLE_SLOTS,\n ...FORM_COMBOBOX_MULTI_SLOTS,\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_COMBOBOX_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSFormComboboxName, FORM_COMBOBOX_SLOTS),\n // legacy data-testid\n CONTROLS_WRAPPER: 'combobox-controls-wrapper',\n CONTAINER: 'combobox-container',\n INPUT: 'combobox-input',\n LIST: 'combobox-menu-list',\n NO_MATCHES_FOUND: 'combobox-no-matches-found',\n SELECTED_VALUES: 'combobox-selected-values',\n DROPDOWN: 'combobox-dropdown-btn',\n OPTION: 'combobox-option',\n ALLY_SELECTED_VALUES: 'combobox-ally-selected-values',\n PILL: 'ds-pill-wrapper',\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,qBAAqB;AAGlC,MAAM,6BAA6B;AAAA,EACjC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,eAAe;AAAA;AAAA,EAEf,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,kBAAkB;AAAA;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,iBAAiB;AACnB;AAGO,MAAM,6BAA6B;AAAA,EACxC,GAAG;AAAA,EACH,iBAAiB;AAAA;AACnB;AAGO,MAAM,4BAA4B;AAAA,EACvC,GAAG;AAAA,EACH,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,iBAAiB;AACnB;AAIO,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AACL;AAGO,MAAM,4BAA4B;AAAA,EACvC,GAAG,wBAAwB,oBAAoB,mBAAmB;AAAA;AAAA,EAElE,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,sBAAsB;AAAA,EACtB,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -2,13 +2,13 @@ import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useCallback, useContext } from "react";
4
4
  import { styled } from "@elliemae/ds-system";
5
- import { DSButtonV2 } from "@elliemae/ds-button-v2";
5
+ import { DSButtonV3 } from "@elliemae/ds-button-v2";
6
6
  import { ChevronSmallDown } from "@elliemae/ds-icons";
7
7
  import { useOwnerProps } from "@elliemae/ds-props-helpers";
8
8
  import ComboBoxContext from "../ComboBoxCTX.js";
9
9
  import { ComboboxDataTestid } from "../ComboboxDataTestids.js";
10
10
  import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../constants/index.js";
11
- const StyledDropDownButton = styled(DSButtonV2, {
11
+ const StyledDropDownButton = styled(DSButtonV3, {
12
12
  name: DSFormComboboxName,
13
13
  slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON
14
14
  })`
@@ -20,7 +20,7 @@ const StyledDropDownButton = styled(DSButtonV2, {
20
20
  }
21
21
 
22
22
  & svg {
23
- fill: ${({ theme, disabled, readOnly, applyAriaDisabled }) => disabled || readOnly || applyAriaDisabled ? theme.colors.neutral["400"] : theme.colors.brand["600"]};
23
+ fill: ${({ theme, disabled }) => disabled ? theme.colors.neutral["400"] : theme.colors.brand["600"]};
24
24
  }
25
25
 
26
26
  ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DropdownIndicator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\nconst StyledDropDownButton = styled(DSButtonV2, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON,\n})<{ applyAriaDisabled: boolean | undefined }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled, readOnly, applyAriaDisabled }) =>\n disabled || readOnly || applyAriaDisabled ? theme.colors.neutral['400'] : theme.colors.brand['600']};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}\n`;\n\nexport const DropdownIndicator = (): JSX.Element => {\n const {\n props,\n props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void =\n useCallback((e) => {\n e.preventDefault();\n }, []);\n\n return (\n <StyledDropDownButton\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onClick={handleOnClick}\n data-testid={ComboboxDataTestid.DROPDOWN}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-labelledby=\"combo-label\"\n disabled={disabled}\n aria-disabled={readOnly && !isMenuOpenableWithReadOnly} // button never use readOnly attribute\n aria-expanded={menuState}\n aria-haspopup=\"listbox\"\n aria-hidden\n buttonType=\"icon\"\n tabIndex={-1}\n size=\"s\"\n applyAriaDisabled={applyAriaDisabled}\n >\n <ChevronSmallDown size=\"s\" />\n </StyledDropDownButton>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC+DjB;AA7DN,SAAgB,aAAa,kBAAkB;AAC/C,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,uBAAuB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YASW,CAAC,EAAE,OAAO,UAAU,UAAU,kBAAkB,MACtD,YAAY,YAAY,oBAAoB,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA,IAGrG,CAAC,EAAE,kBAAkB,MAAM,qBAAqB,qBAAqB;AAAA;AAGlE,MAAM,oBAAoB,MAAmB;AAClD,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,mBAAmB,UAAU,2BAA2B;AAAA,IAC3E;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM,gBACJ,YAAY,CAAC,MAAM;AACjB,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAEP,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,eAAa,mBAAmB;AAAA,MAChC,iBAAe,iBAAiB,WAAW;AAAA,MAC3C,mBAAgB;AAAA,MAChB;AAAA,MACA,iBAAe,YAAY,CAAC;AAAA,MAC5B,iBAAe;AAAA,MACf,iBAAc;AAAA,MACd,eAAW;AAAA,MACX,YAAW;AAAA,MACX,UAAU;AAAA,MACV,MAAK;AAAA,MACL;AAAA,MAEA,8BAAC,oBAAiB,MAAK,KAAI;AAAA;AAAA,EAC7B;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\nconst StyledDropDownButton = styled(DSButtonV3, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON,\n})<{ applyAriaDisabled: boolean | undefined }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['400'] : theme.colors.brand['600'])};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}\n`;\n\nexport const DropdownIndicator = (): JSX.Element => {\n const {\n props,\n props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void =\n useCallback((e) => {\n e.preventDefault();\n }, []);\n\n return (\n <StyledDropDownButton\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onClick={handleOnClick}\n data-testid={ComboboxDataTestid.DROPDOWN}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-labelledby=\"combo-label\"\n disabled={disabled}\n aria-disabled={readOnly && !isMenuOpenableWithReadOnly} // button never use readOnly attribute\n aria-expanded={menuState}\n aria-haspopup=\"listbox\"\n aria-hidden\n buttonType=\"icon\"\n tabIndex={-1}\n size=\"s\"\n applyAriaDisabled={applyAriaDisabled}\n >\n <ChevronSmallDown size=\"s\" />\n </StyledDropDownButton>\n );\n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7
7
  }
@@ -22,8 +22,20 @@ const LiveRegion = () => {
22
22
  );
23
23
  };
24
24
  const Announcer = React2.memo(({ message }) => /* @__PURE__ */ jsx(StyledA11yNotVisible, { "aria-live": "assertive", "aria-relevant": "all", children: message }));
25
+ const ResultCountStatus = React2.memo(
26
+ ({
27
+ menuOpen,
28
+ isLoading,
29
+ isSkeleton,
30
+ resultCount
31
+ }) => {
32
+ const message = !menuOpen || isLoading || isSkeleton || resultCount === 0 ? "" : `${resultCount} options available`;
33
+ return /* @__PURE__ */ jsx(StyledA11yNotVisible, { role: "status", "aria-live": "polite", "aria-atomic": "true", children: message });
34
+ }
35
+ );
25
36
  export {
26
37
  Announcer,
27
- LiveRegion
38
+ LiveRegion,
39
+ ResultCountStatus
28
40
  };
29
41
  //# sourceMappingURL=LiveRegion.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/LiveRegion.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { StyledA11yNotVisible } from './styled.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nexport const LiveRegion = (): JSX.Element => {\n const {\n props: { onCreate },\n hasFocus,\n } = useContext(ComboBoxContext);\n\n const ScreenReaderText = onCreate ? <span id=\"aria-creatable\">press enter to create the option</span> : '';\n\n return (\n <StyledA11yNotVisible\n data-testid={ComboboxDataTestid.ALLY_SELECTED_VALUES}\n aria-live=\"polite\"\n aria-atomic=\"false\"\n aria-relevant=\"additions text\"\n >\n {hasFocus && ScreenReaderText}\n </StyledA11yNotVisible>\n );\n};\n\nexport const Announcer = React.memo(({ message }: { message: string }) => (\n <StyledA11yNotVisible aria-live=\"assertive\" aria-relevant=\"all\">\n {message}\n </StyledA11yNotVisible>\n));\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACUe;AAVtC,OAAOA,UAAS,kBAAkB;AAClC,OAAO,qBAAqB;AAC5B,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AAC5B,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS;AAAA,IAClB;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,mBAAmB,WAAW,oBAAC,UAAK,IAAG,kBAAiB,8CAAgC,IAAU;AAExG,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,mBAAmB;AAAA,MAChC,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,iBAAc;AAAA,MAEb,sBAAY;AAAA;AAAA,EACf;AAEJ;AAEO,MAAM,YAAYA,OAAM,KAAK,CAAC,EAAE,QAAQ,MAC7C,oBAAC,wBAAqB,aAAU,aAAY,iBAAc,OACvD,mBACH,CACD;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { StyledA11yNotVisible } from './styled.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nexport const LiveRegion = (): JSX.Element => {\n const {\n props: { onCreate },\n hasFocus,\n } = useContext(ComboBoxContext);\n\n const ScreenReaderText = onCreate ? <span id=\"aria-creatable\">press enter to create the option</span> : '';\n\n return (\n <StyledA11yNotVisible\n data-testid={ComboboxDataTestid.ALLY_SELECTED_VALUES}\n aria-live=\"polite\"\n aria-atomic=\"false\"\n aria-relevant=\"additions text\"\n >\n {hasFocus && ScreenReaderText}\n </StyledA11yNotVisible>\n );\n};\n\n/**\n * PUI-18034 \u2014 Previously used in ComboBox.tsx for the \"Loading options please wait\"\n * announcement; replaced by aria-busy + aria-label on Loading/Skeleton containers (which\n * carry the listbox role during async states) plus a polite ResultCountStatus for the\n * post-load count. No internal callers remain and not re-exported from index.tsx \u2014\n * evaluate removing.\n */\nexport const Announcer = React.memo(({ message }: { message: string }) => (\n <StyledA11yNotVisible aria-live=\"assertive\" aria-relevant=\"all\">\n {message}\n </StyledA11yNotVisible>\n));\n\n/**\n * PUI-18034 \u2014 Polite live region for post-load result count. Replaces the previous\n * assertive Announcer that raced with the SR's aria-expanded announcement.\n *\n * WCAG 2.2 SC 4.1.3 Status Messages \u2014 announce changes without shifting focus.\n * WAI-ARIA APG combobox: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/\n * WCAG: https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html\n */\nexport const ResultCountStatus = React.memo(\n ({\n menuOpen,\n isLoading,\n isSkeleton,\n resultCount,\n }: {\n menuOpen: boolean;\n isLoading: boolean;\n isSkeleton: boolean;\n resultCount: number;\n }) => {\n const message = !menuOpen || isLoading || isSkeleton || resultCount === 0 ? '' : `${resultCount} options available`;\n return (\n <StyledA11yNotVisible role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {message}\n </StyledA11yNotVisible>\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACUe;AAVtC,OAAOA,UAAS,kBAAkB;AAClC,OAAO,qBAAqB;AAC5B,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AAC5B,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS;AAAA,IAClB;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,mBAAmB,WAAW,oBAAC,UAAK,IAAG,kBAAiB,8CAAgC,IAAU;AAExG,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,mBAAmB;AAAA,MAChC,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,iBAAc;AAAA,MAEb,sBAAY;AAAA;AAAA,EACf;AAEJ;AASO,MAAM,YAAYA,OAAM,KAAK,CAAC,EAAE,QAAQ,MAC7C,oBAAC,wBAAqB,aAAU,aAAY,iBAAc,OACvD,mBACH,CACD;AAUM,MAAM,oBAAoBA,OAAM;AAAA,EACrC,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAKM;AACJ,UAAM,UAAU,CAAC,YAAY,aAAa,cAAc,gBAAgB,IAAI,KAAK,GAAG,WAAW;AAC/F,WACE,oBAAC,wBAAqB,MAAK,UAAS,aAAU,UAAS,eAAY,QAChE,mBACH;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -3,29 +3,23 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { createElement } from "react";
4
4
  import React2 from "react";
5
5
  import { styled } from "@elliemae/ds-system";
6
- import { SingleMenuItem, MultiMenuItem, Separator } from "@elliemae/ds-menu-items";
6
+ import { DSTypography } from "@elliemae/ds-typography";
7
+ import { Separator } from "@elliemae/ds-menu-items";
7
8
  import { MENU_OPTION_TYPES } from "../constants.js";
8
9
  import { ComboboxDataTestid } from "../ComboboxDataTestids.js";
9
10
  import { isSelected } from "../utils/listHelper.js";
10
11
  import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../constants/index.js";
12
+ import { StyledSingleMenuItem, StyledMultiMenuItem } from "./menu-list/styled.js";
11
13
  const StyledSectionWrapper = styled("section", { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`
12
14
  list-style: none;
13
- min-height: 24px;
14
15
  display: grid;
15
16
  align-items: center;
16
17
  `;
17
- const StyledSectionLabel = styled("header", { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`
18
+ const StyledSectionLabel = styled(DSTypography, { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`
18
19
  display: flex;
19
20
  align-items: center;
20
- padding: 0px 16px;
21
- min-height: 24px;
22
- font-size: 1rem;
23
- color: neutral-500;
21
+ padding: 8px 16px;
24
22
  `;
25
- const StyledSingleMenuItem = styled(SingleMenuItem, {
26
- name: DSFormComboboxName,
27
- slot: FORM_COMBOBOX_SLOTS.SINGLE_MENU_ITEM
28
- })``;
29
23
  const Section = React2.memo((props) => {
30
24
  const {
31
25
  label,
@@ -40,7 +34,7 @@ const Section = React2.memo((props) => {
40
34
  getOwnerPropsArguments
41
35
  } = props;
42
36
  const id = `${label.replace(/ /g, "")}-section`;
43
- const CBItem = Array.isArray(selectedValues) ? MultiMenuItem : StyledSingleMenuItem;
37
+ const CBItem = Array.isArray(selectedValues) ? StyledMultiMenuItem : StyledSingleMenuItem;
44
38
  return /* @__PURE__ */ jsxs(
45
39
  StyledSectionWrapper,
46
40
  {
@@ -54,6 +48,8 @@ const Section = React2.memo((props) => {
54
48
  /* @__PURE__ */ jsx(
55
49
  StyledSectionLabel,
56
50
  {
51
+ component: "header",
52
+ variant: "b3-strong",
57
53
  id,
58
54
  role: "presentation",
59
55
  getOwnerProps,
@@ -92,7 +88,7 @@ const Section = React2.memo((props) => {
92
88
  },
93
89
  onMouseDown: handleOnMouseDown,
94
90
  isActive: dsId === focusOptionIdx,
95
- isSelected: isSelected(selectedValues, option),
91
+ isSelected: option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option),
96
92
  tabIndex: -1,
97
93
  ...rest,
98
94
  key: option.dsId,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Section.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { SingleMenuItem, MultiMenuItem, Separator } from '@elliemae/ds-menu-items';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles: React.CSSProperties;\n innerRef: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.ItemOption[] | DSComboboxT.ItemSeparatorOptions[];\n handleClick: (option: DSComboboxT.ItemOption, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n min-height: 24px;\n display: grid;\n align-items: center;\n`;\n\nconst StyledSectionLabel = styled('header', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`\n display: flex;\n align-items: center;\n padding: 0px 16px;\n min-height: 24px;\n font-size: 1rem;\n color: neutral-500;\n`;\n\nconst StyledSingleMenuItem = styled(SingleMenuItem, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.SINGLE_MENU_ITEM,\n})``;\n\nexport const Section = React.memo((props: SectionProps) => {\n const {\n label,\n wrapperStyles,\n focusOptionIdx,\n selectedValues,\n innerRef,\n handleOnMouseDown,\n options,\n handleClick,\n getOwnerProps,\n getOwnerPropsArguments,\n } = props;\n const id = `${label.replace(/ /g, '')}-section`;\n const CBItem = Array.isArray(selectedValues) ? MultiMenuItem : StyledSingleMenuItem;\n\n return (\n <StyledSectionWrapper\n role=\"group\"\n aria-labelledby={id}\n style={wrapperStyles}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSectionLabel\n id={id}\n role=\"presentation\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const {\n dsId,\n type,\n value,\n label: optionLabel,\n readOnly,\n disabled,\n applyAriaDisabled,\n render,\n ...rest\n } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n return (\n <CBItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n if (applyAriaDisabled) return;\n handleClick(option, e);\n }}\n onMouseDown={handleOnMouseDown}\n isActive={dsId === focusOptionIdx}\n isSelected={isSelected(selectedValues, option)}\n tabIndex={-1}\n {...rest}\n key={option.dsId}\n dsId={option.dsId}\n />\n );\n })}\n </StyledSectionWrapper>\n );\n});\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC8DnB,SAQE,KARF;AAkCM;AAhGV,OAAOA,YAAW;AAClB,SAAS,cAAc;AACvB,SAAS,gBAAgB,eAAe,iBAAiB;AAEzD,SAAS,yBAAyB;AAElC,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB,2BAA2B;AAexD,MAAM,uBAAuB,OAAO,WAAW,EAAE,MAAM,oBAAoB,MAAM,oBAAoB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtH,MAAM,qBAAqB,OAAO,UAAU,EAAE,MAAM,oBAAoB,MAAM,oBAAoB,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASjH,MAAM,uBAAuB,OAAO,gBAAgB;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAEM,MAAM,UAAUA,OAAM,KAAK,CAAC,UAAwB;AACzD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,KAAK,GAAG,MAAM,QAAQ,MAAM,EAAE,CAAC;AACrC,QAAM,SAAS,MAAM,QAAQ,cAAc,IAAI,gBAAgB;AAE/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,mBAAiB;AAAA,MACjB,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,MAAK;AAAA,YACL;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACC,SAAS,IAAI,CAAC,WAAW;AACxB,gBAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,GAAG;AAAA,UACL,IAAI;AAEJ,cAAI,SAAS,kBAAkB,WAAW;AACxC,mBAAO,oBAAC,eAAe,IAAM;AAAA,UAC/B;AAEA,iBACE;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA,OAAO;AAAA,cACP,YAAY,mBAAmB;AAAA,cAC/B;AAAA,cACA,mBAAmB,qBAAqB;AAAA,cACxC,SAAS,CAAC,MAA0C;AAClD,oBAAI,kBAAmB;AACvB,4BAAY,QAAQ,CAAC;AAAA,cACvB;AAAA,cACA,aAAa;AAAA,cACb,UAAU,SAAS;AAAA,cACnB,YAAY,WAAW,gBAAgB,MAAM;AAAA,cAC7C,UAAU;AAAA,cACT,GAAG;AAAA,cACJ,KAAK,OAAO;AAAA,cACZ,MAAM,OAAO;AAAA;AAAA,UACf;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { Separator } from '@elliemae/ds-menu-items';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nimport { StyledSingleMenuItem, StyledMultiMenuItem } from './menu-list/styled.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles?: React.CSSProperties;\n innerRef?: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.OptionTypes[];\n handleClick: (option: DSComboboxT.OptionTypes, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n display: grid;\n align-items: center;\n`;\n\n/**\n * The 32px group-label row height comes from this label alone: 8px top + 8px bottom padding +\n * the b3-strong line-height (~16px) = 32px. No min-height needed here.\n *\n * This is one of four independent reimplementations of the section/group-label row \u2014 the menu-items\n * path (ds-menu-items-commons StyledSectionWrapper) and ds-menu-button reach the same 32px via a\n * wrapper min-height instead. Keep all four aligned (PUI-18609); see KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nconst StyledSectionLabel = styled(DSTypography, { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`\n display: flex;\n align-items: center;\n padding: 8px 16px;\n`;\n\nexport const Section = React.memo((props: SectionProps) => {\n const {\n label,\n wrapperStyles,\n focusOptionIdx,\n selectedValues,\n innerRef,\n handleOnMouseDown,\n options,\n handleClick,\n getOwnerProps,\n getOwnerPropsArguments,\n } = props;\n const id = `${label.replace(/ /g, '')}-section`;\n const CBItem: React.ComponentType<React.ComponentProps<typeof StyledSingleMenuItem>> = Array.isArray(selectedValues)\n ? StyledMultiMenuItem\n : StyledSingleMenuItem;\n\n return (\n <StyledSectionWrapper\n role=\"group\"\n aria-labelledby={id}\n style={wrapperStyles}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSectionLabel\n component=\"header\"\n variant=\"b3-strong\"\n id={id}\n role=\"presentation\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const {\n dsId,\n type,\n value,\n label: optionLabel,\n readOnly,\n disabled,\n applyAriaDisabled,\n render,\n ...rest\n } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n return (\n <CBItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n if (applyAriaDisabled) return;\n handleClick(option, e);\n }}\n onMouseDown={handleOnMouseDown}\n isActive={dsId === focusOptionIdx}\n isSelected={option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option)}\n tabIndex={-1}\n {...rest}\n key={option.dsId}\n dsId={option.dsId}\n />\n );\n })}\n </StyledSectionWrapper>\n );\n});\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiEnB,SAQE,KARF;AAoCM;AArGV,OAAOA,YAAW;AAClB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAE1B,SAAS,yBAAyB;AAElC,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB,2BAA2B;AACxD,SAAS,sBAAsB,2BAA2B;AAe1D,MAAM,uBAAuB,OAAO,WAAW,EAAE,MAAM,oBAAoB,MAAM,oBAAoB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AActH,MAAM,qBAAqB,OAAO,cAAc,EAAE,MAAM,oBAAoB,MAAM,oBAAoB,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAM9G,M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A;AAAA,UACf;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
6
6
  "names": ["React"]
7
7
  }
@@ -6,13 +6,12 @@ import { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from "@elli
6
6
  import { useCallback, useContext, useEffect, useMemo } from "react";
7
7
  import ComboBoxContext from "../../ComboBoxCTX.js";
8
8
  import { ComboboxDataTestid } from "../../ComboboxDataTestids.js";
9
- import { useOnClickOutside } from "../../config/useClickOutside.js";
10
9
  import { Controls } from "../controls/index.js";
11
10
  import { LiveRegion } from "../LiveRegion.js";
12
11
  import { MenuList } from "../menu-list/index.js";
13
12
  import { StyledContainer, StyledPopperWrapper } from "./styled.js";
14
13
  const Container = () => {
15
- const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);
14
+ const { props, setMenuState, menuState } = useContext(ComboBoxContext);
16
15
  const {
17
16
  inline,
18
17
  startPlacementPreference,
@@ -30,10 +29,6 @@ const Container = () => {
30
29
  const handleMouseDown = useCallback((e) => {
31
30
  e.preventDefault();
32
31
  }, []);
33
- const handleCloseMenu = useCallback(() => {
34
- setMenuState(false, "blur");
35
- if (internalRef?.current) internalRef.current.blur();
36
- }, [internalRef, setMenuState]);
37
32
  useEffect(() => {
38
33
  const closeMenuOnWindowBlur = () => {
39
34
  if (menuState) setMenuState(false, "blur");
@@ -43,6 +38,10 @@ const Container = () => {
43
38
  window.removeEventListener("blur", closeMenuOnWindowBlur);
44
39
  };
45
40
  }, [menuState, setMenuState]);
41
+ const handleClickOutside = useCallback(() => {
42
+ if (inline) return;
43
+ setMenuState(false, "blur");
44
+ }, [setMenuState, inline]);
46
45
  const config = useMemo(
47
46
  () => ({
48
47
  placement: startPlacementPreference,
@@ -50,23 +49,20 @@ const Container = () => {
50
49
  placementOrderPreference,
51
50
  zIndex: correctZIndex,
52
51
  customOffset: [0, 5],
53
- handleCloseMenu,
54
- externallyControlledIsOpen: menuState
52
+ externallyControlledIsOpen: menuState,
53
+ // Gate on `!inline` — in inline mode the consumer's outer wrapper handles dismissal.
54
+ onClickOutside: inline ? void 0 : handleClickOutside
55
55
  }),
56
- [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState]
56
+ [startPlacementPreference, placementOrderPreference, correctZIndex, menuState, inline, handleClickOutside]
57
57
  );
58
58
  const { refs, floatingStyles, context } = useFloatingContext(config);
59
- const hideTooltip = useCallback(() => {
60
- setMenuState(false, "blur");
61
- }, [setMenuState]);
62
- useOnClickOutside(refs.reference, hideTooltip, refs.floating);
63
59
  return /* @__PURE__ */ jsxs(
64
60
  StyledContainer,
65
61
  {
66
62
  "data-testid": dataTestId ?? ComboboxDataTestid.CONTAINER,
67
63
  innerRef: refs.setReference,
68
64
  className,
69
- applyAriaDisabled,
65
+ applyAriaDisabled: applyAriaDisabled ?? false,
70
66
  ...xStyledProps,
71
67
  getOwnerProps,
72
68
  getOwnerPropsArguments,
@@ -84,7 +80,17 @@ const Container = () => {
84
80
  ...popperProps,
85
81
  key: `${isLoading}${isSkeleton}`
86
82
  },
87
- /* @__PURE__ */ jsx(StyledPopperWrapper, { tabIndex: -1, onMouseDown: handleMouseDown, applyAriaDisabled, children: /* @__PURE__ */ jsx(MenuList, {}) })
83
+ /* @__PURE__ */ jsx(
84
+ StyledPopperWrapper,
85
+ {
86
+ tabIndex: -1,
87
+ onMouseDown: handleMouseDown,
88
+ applyAriaDisabled: applyAriaDisabled ?? false,
89
+ getOwnerProps,
90
+ getOwnerPropsArguments,
91
+ children: /* @__PURE__ */ jsx(MenuList, {})
92
+ }
93
+ )
88
94
  ) : null
89
95
  ]
90
96
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/container/Container.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport { FloatingWrapper, useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useEffect, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { useOnClickOutside } from '../../config/useClickOutside.js';\nimport { Controls } from '../controls/index.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\n\nexport const Container = (): JSX.Element => {\n const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const {\n inline,\n startPlacementPreference,\n placementOrderPreference,\n isLoading,\n isSkeleton,\n applyAriaDisabled,\n popperProps,\n } = props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n const handleCloseMenu = useCallback(() => {\n setMenuState(false, 'blur');\n if (internalRef?.current) internalRef.current.blur();\n }, [internalRef, setMenuState]);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n const config = useMemo(\n () => ({\n placement: startPlacementPreference,\n withoutAnimation: true,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n handleCloseMenu,\n externallyControlledIsOpen: menuState,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n const hideTooltip = useCallback(() => {\n setMenuState(false, 'blur');\n }, [setMenuState]);\n\n useOnClickOutside(refs.reference, hideTooltip, refs.floating);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n applyAriaDisabled={applyAriaDisabled}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper tabIndex={-1} onMouseDown={handleMouseDown} applyAriaDisabled={applyAriaDisabled}>\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC6EnB,SASE,KATF;AAcI;AAzFR,SAAS,iBAAiB,0BAA0B;AACpD,SAAS,wBAAwB,oBAAoB,qBAAqB;AAC1E,SAAgB,aAAa,YAAY,WAAW,eAAe;AACnE,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB,2BAA2B;AAE9C,MAAM,YAAY,MAAmB;AAC1C,QAAM,EAAE,OAAO,aAAa,cAAc,UAAU,IAAI,WAAW,eAAe;AAElF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,mBAAmB,uBAAuB,KAAK;AAGrD,QAAM,EAAE,QAAQ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ACJ;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,cAAW;AAAA,QACZ,oBAAC,YAAS;AAAA,QAET,aAAa,SAAS,oBAAC,YAAS,IAAK;AAAA,QACrC,aAAa,CAAC,UAAU,KAAK,YAC5B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG;AAAA,YACJ,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B,oBAAC,uBAAoB,UAAU,IAAI,aAAa,iBAAiB,mBAC/D,8BAAC,YAAS,GACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport { FloatingWrapper, useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useEffect, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { Controls } from '../controls/index.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\n\nexport const Container = (): JSX.Element => {\n const { props, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const {\n inline,\n startPlacementPreference,\n placementOrderPreference,\n isLoading,\n isSkeleton,\n applyAriaDisabled,\n popperProps,\n } = props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n // In inline mode the combobox is rendered inside a consumer-controlled FloatingWrapper.\n // The consumer owns dismissal; if we closed the internal menuState here, the outer wrapper\n // would stay open and the user would see the input without options (\"weird state\").\n const handleClickOutside = useCallback(() => {\n if (inline) return;\n setMenuState(false, 'blur');\n }, [setMenuState, inline]);\n\n const config = useMemo(\n () => ({\n placement: startPlacementPreference,\n withoutAnimation: true,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n externallyControlledIsOpen: menuState,\n // Gate on `!inline` \u2014 in inline mode the consumer's outer wrapper handles dismissal.\n onClickOutside: inline ? undefined : handleClickOutside,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, menuState, inline, handleClickOutside],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n applyAriaDisabled={applyAriaDisabled ?? false}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper\n tabIndex={-1}\n onMouseDown={handleMouseDown}\n applyAriaDisabled={applyAriaDisabled ?? false}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}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Ac,MAAM,CAAC;AAEzB,QAAM,SAAS;AAAA,IACb,OAAO;AAAA,MACL,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB;AAAA,MACA,QAAQ;AAAA,MACR,cAAc,CAAC,GAAG,CAAC;AAAA,MACnB,4BAA4B;AAAA;AAAA,MAE5B,gBAAgB,SAAS,SAAY;AAAA,IACvC;AAAA,IACA,CAAC,0BAA0B,0BAA0B,eAAe,WAAW,QAAQ,kBAAkB;AAAA,EAC3G;AAEA,QAAM,EAAE,MAAM,gBAAgB,QAAQ,IAAI,mBAAmB,MAAM;AAEnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,cAAc,mBAAmB;AAAA,MAC9C,UAAU,KAAK;AAAA,MACf;AAAA,MACA,mBAAmB,qBAAqB;AAAA,MACvC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,cAAW;AAAA,QACZ,oBAAC,YAAS;AAAA,QAET,aAAa,SAAS,oBAAC,YAAS,IAAK;AAAA,QACrC,aAAa,CAAC,UAAU,KAAK,YAC5B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG;AAAA,YACJ,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,aAAa;AAAA,cACb,mBAAmB,qBAAqB;AAAA,cACxC;AAAA,cACA;AAAA,cAEA,8BAAC,YAAS;AAAA;AAAA,UACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { styled, xStyledCommonProps } from "@elliemae/ds-system";
3
- import { DSComboBoxName, DSComboboxSlots } from "../../theming.js";
3
+ import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../../constants/index.js";
4
4
  const StyledContainer = styled("div", {
5
- name: DSComboBoxName,
6
- slot: DSComboboxSlots.CONTAINER
5
+ name: DSFormComboboxName,
6
+ slot: FORM_COMBOBOX_SLOTS.ROOT
7
7
  })`
8
8
  position: relative;
9
9
  cursor: ${({ disabled }) => disabled ? "not-allowed" : "default"};
@@ -11,7 +11,10 @@ const StyledContainer = styled("div", {
11
11
  min-width: 64px;
12
12
  ${xStyledCommonProps}
13
13
  `;
14
- const StyledPopperWrapper = styled("div")`
14
+ const StyledPopperWrapper = styled("div", {
15
+ name: DSFormComboboxName,
16
+ slot: FORM_COMBOBOX_SLOTS.POPPER_WRAPPER
17
+ })`
15
18
  position: relative;
16
19
  cursor: ${({ disabled }) => disabled ? "not-allowed" : "default"};
17
20
  cursor: ${({ applyAriaDisabled }) => applyAriaDisabled ? "not-allowed" : "default"};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/container/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { DSComboBoxName, DSComboboxSlots } from '../../theming.js';\n\nimport type {} from '@xstyled/system';\n\nexport const StyledContainer = styled('div', {\n name: DSComboBoxName,\n slot: DSComboboxSlots.CONTAINER,\n})<XstyledProps & { disabled?: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'default')};\n cursor: ${({ applyAriaDisabled }) => (applyAriaDisabled ? 'not-allowed' : 'default')};\n min-width: 64px;\n ${xStyledCommonProps}\n`;\n\nexport const StyledPopperWrapper = styled('div')<{ disabled?: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'default')};\n cursor: ${({ applyAriaDisabled }) => (applyAriaDisabled ? 'not-allowed' : 'default')};\n overflow: auto;\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAE3C,SAAS,gBAAgB,uBAAuB;AAIzC,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA,YAEW,CAAC,EAAE,SAAS,MAAO,WAAW,gBAAgB,SAAU;AAAA,YACxD,CAAC,EAAE,kBAAkB,MAAO,oBAAoB,gBAAgB,SAAU;AAAA;AAAA,IAElF,kBAAkB;AAAA;AAGf,MAAM,sBAAsB,OAAO,KAAK;AAAA;AAAA,YAEnC,CAAC,EAAE,SAAS,MAAO,WAAW,gBAAgB,SAAU;AAAA,YACxD,CAAC,EAAE,kBAAkB,MAAO,oBAAoB,gBAAgB,SAAU;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\nimport type {} from '@xstyled/system';\n\nexport const StyledContainer = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.ROOT,\n})<XstyledProps & { disabled?: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'default')};\n cursor: ${({ applyAriaDisabled }) => (applyAriaDisabled ? 'not-allowed' : 'default')};\n min-width: 64px;\n ${xStyledCommonProps}\n`;\n\nexport const StyledPopperWrapper = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.POPPER_WRAPPER,\n})<{ disabled?: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'default')};\n cursor: ${({ applyAriaDisabled }) => (applyAriaDisabled ? 'not-allowed' : 'default')};\n overflow: auto;\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAE3C,SAAS,oBAAoB,2BAA2B;AAIjD,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA,YAEW,CAAC,EAAE,SAAS,MAAO,WAAW,gBAAgB,SAAU;AAAA,YACxD,CAAC,EAAE,kBAAkB,MAAO,oBAAoB,gBAAgB,SAAU;AAAA;AAAA,IAElF,kBAAkB;AAAA;AAGf,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA,YAEW,CAAC,EAAE,SAAS,MAAO,WAAW,gBAAgB,SAAU;AAAA,YACxD,CAAC,EAAE,kBAAkB,MAAO,oBAAoB,gBAAgB,SAAU;AAAA;AAAA;",
6
6
  "names": []
7
7
  }