@chayns-components/core 5.4.5 → 5.4.6-alpha.0

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 (472) hide show
  1. package/AGENTS.md +12 -0
  2. package/lib/cjs/components/accordion/Accordion.js +107 -12
  3. package/lib/cjs/components/accordion/Accordion.js.map +1 -1
  4. package/lib/cjs/components/accordion/Accordion.styles.js +23 -3
  5. package/lib/cjs/components/accordion/Accordion.styles.js.map +1 -1
  6. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
  7. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  8. package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js +36 -19
  9. package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  10. package/lib/cjs/components/accordion/accordion-head/AccordionHead.js +6 -3
  11. package/lib/cjs/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  12. package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
  13. package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  14. package/lib/cjs/components/amount-control/AmountControl.js +31 -17
  15. package/lib/cjs/components/amount-control/AmountControl.js.map +1 -1
  16. package/lib/cjs/components/amount-control/AmountControl.styles.js +18 -2
  17. package/lib/cjs/components/amount-control/AmountControl.styles.js.map +1 -1
  18. package/lib/cjs/components/button/Button.js +5 -1
  19. package/lib/cjs/components/button/Button.js.map +1 -1
  20. package/lib/cjs/components/button/Button.styles.js +10 -0
  21. package/lib/cjs/components/button/Button.styles.js.map +1 -1
  22. package/lib/cjs/components/button/Button.types.js.map +1 -1
  23. package/lib/cjs/components/checkbox/Checkbox.js +5 -1
  24. package/lib/cjs/components/checkbox/Checkbox.js.map +1 -1
  25. package/lib/cjs/components/checkbox/Checkbox.styles.js +29 -2
  26. package/lib/cjs/components/checkbox/Checkbox.styles.js.map +1 -1
  27. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  28. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  29. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  30. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  31. package/lib/cjs/components/combobox/ComboBox.js +70 -26
  32. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  33. package/lib/cjs/components/combobox/ComboBox.styles.js +11 -0
  34. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  35. package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -1
  36. package/lib/cjs/components/context-menu/ContextMenu.js +146 -42
  37. package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
  38. package/lib/cjs/components/context-menu/ContextMenu.styles.js +38 -0
  39. package/lib/cjs/components/context-menu/ContextMenu.styles.js.map +1 -1
  40. package/lib/cjs/components/context-menu/ContextMenu.types.js.map +1 -1
  41. package/lib/cjs/components/context-menu/ContextMenu.utils.js +27 -1
  42. package/lib/cjs/components/context-menu/ContextMenu.utils.js.map +1 -1
  43. package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js +3 -8
  44. package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  45. package/lib/cjs/components/dropdown-body-wrapper/DropdownBodyWrapper.js +1 -8
  46. package/lib/cjs/components/dropdown-body-wrapper/DropdownBodyWrapper.js.map +1 -1
  47. package/lib/cjs/components/file-input/FileInput.js +4 -2
  48. package/lib/cjs/components/file-input/FileInput.js.map +1 -1
  49. package/lib/cjs/components/file-list/file-item/FileItem.js +48 -25
  50. package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
  51. package/lib/cjs/components/file-list/file-item/FileItem.styles.js +25 -1
  52. package/lib/cjs/components/file-list/file-item/FileItem.styles.js.map +1 -1
  53. package/lib/cjs/components/file-select/FileSelect.js +27 -4
  54. package/lib/cjs/components/file-select/FileSelect.js.map +1 -1
  55. package/lib/cjs/components/file-select/FileSelect.styles.js +10 -0
  56. package/lib/cjs/components/file-select/FileSelect.styles.js.map +1 -1
  57. package/lib/cjs/components/filter/Filter.js +51 -16
  58. package/lib/cjs/components/filter/Filter.js.map +1 -1
  59. package/lib/cjs/components/filter/Filter.styles.js +9 -0
  60. package/lib/cjs/components/filter/Filter.styles.js.map +1 -1
  61. package/lib/cjs/components/filter/filter-content/FilterContent.js +14 -5
  62. package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
  63. package/lib/cjs/components/filter/filter-content/FilterContent.types.js.map +1 -1
  64. package/lib/cjs/components/filter-buttons/FilterButtons.js +69 -4
  65. package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
  66. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js +40 -2
  67. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  68. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  69. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  70. package/lib/cjs/components/grid-image/GridImage.js +20 -2
  71. package/lib/cjs/components/grid-image/GridImage.js.map +1 -1
  72. package/lib/cjs/components/grid-image/GridImage.styles.js +11 -2
  73. package/lib/cjs/components/grid-image/GridImage.styles.js.map +1 -1
  74. package/lib/cjs/components/grouped-image/GroupedImage.js +23 -4
  75. package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
  76. package/lib/cjs/components/grouped-image/GroupedImage.styles.js +9 -0
  77. package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
  78. package/lib/cjs/components/highlight-slider/HighlightSlider.js +13 -3
  79. package/lib/cjs/components/highlight-slider/HighlightSlider.js.map +1 -1
  80. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +21 -4
  81. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  82. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +11 -2
  83. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  84. package/lib/cjs/components/icon/Icon.js +24 -5
  85. package/lib/cjs/components/icon/Icon.js.map +1 -1
  86. package/lib/cjs/components/icon/Icon.styles.js +23 -0
  87. package/lib/cjs/components/icon/Icon.styles.js.map +1 -1
  88. package/lib/cjs/components/input/Input.js +29 -8
  89. package/lib/cjs/components/input/Input.js.map +1 -1
  90. package/lib/cjs/components/input/Input.styles.js +38 -3
  91. package/lib/cjs/components/input/Input.styles.js.map +1 -1
  92. package/lib/cjs/components/list/List.js +124 -37
  93. package/lib/cjs/components/list/List.js.map +1 -1
  94. package/lib/cjs/components/list/List.utils.js +213 -1
  95. package/lib/cjs/components/list/List.utils.js.map +1 -1
  96. package/lib/cjs/components/list/list-item/ListItem.js +84 -3
  97. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  98. package/lib/cjs/components/list/list-item/ListItem.styles.js +7 -0
  99. package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
  100. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js +5 -1
  101. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  102. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +5 -1
  103. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  104. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +1 -0
  105. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  106. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +3 -0
  107. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  108. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +1 -0
  109. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  110. package/lib/cjs/components/list/list-item/useListItemFocus.js +47 -0
  111. package/lib/cjs/components/list/list-item/useListItemFocus.js.map +1 -0
  112. package/lib/cjs/components/mention-finder/MentionFinder.js +43 -5
  113. package/lib/cjs/components/mention-finder/MentionFinder.js.map +1 -1
  114. package/lib/cjs/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  115. package/lib/cjs/components/multi-action-button/MultiActionButton.js +36 -3
  116. package/lib/cjs/components/multi-action-button/MultiActionButton.js.map +1 -1
  117. package/lib/cjs/components/multi-action-button/MultiActionButton.styles.js +6 -0
  118. package/lib/cjs/components/multi-action-button/MultiActionButton.styles.js.map +1 -1
  119. package/lib/cjs/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  120. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js +7 -1
  121. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  122. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  123. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  124. package/lib/cjs/components/number-input/NumberInput.js +13 -10
  125. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  126. package/lib/cjs/components/page-provider/PageProvider.js +4 -2
  127. package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
  128. package/lib/cjs/components/popup/Popup.js +8 -1
  129. package/lib/cjs/components/popup/Popup.js.map +1 -1
  130. package/lib/cjs/components/radio-button/RadioButton.js +29 -15
  131. package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
  132. package/lib/cjs/components/radio-button/RadioButton.styles.js +19 -8
  133. package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
  134. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  135. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  136. package/lib/cjs/components/search-box/SearchBox.js +20 -5
  137. package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
  138. package/lib/cjs/components/search-input/SearchInput.js +56 -43
  139. package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
  140. package/lib/cjs/components/search-input/SearchInput.styles.js +26 -2
  141. package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
  142. package/lib/cjs/components/select-button/SelectButton.js +4 -2
  143. package/lib/cjs/components/select-button/SelectButton.js.map +1 -1
  144. package/lib/cjs/components/setup-wizard/SetupWizard.js +10 -4
  145. package/lib/cjs/components/setup-wizard/SetupWizard.js.map +1 -1
  146. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  147. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  148. package/lib/cjs/components/sharing-bar/SharingBar.js +31 -6
  149. package/lib/cjs/components/sharing-bar/SharingBar.js.map +1 -1
  150. package/lib/cjs/components/sharing-bar/SharingBar.styles.js +5 -0
  151. package/lib/cjs/components/sharing-bar/SharingBar.styles.js.map +1 -1
  152. package/lib/cjs/components/sharing-button/SharingButton.js +4 -2
  153. package/lib/cjs/components/sharing-button/SharingButton.js.map +1 -1
  154. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js +3 -1
  155. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  156. package/lib/cjs/components/signature/Signature.js +6 -3
  157. package/lib/cjs/components/signature/Signature.js.map +1 -1
  158. package/lib/cjs/components/slider/Slider.js +30 -7
  159. package/lib/cjs/components/slider/Slider.js.map +1 -1
  160. package/lib/cjs/components/slider/Slider.styles.js +9 -2
  161. package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
  162. package/lib/cjs/components/slider-button/SliderButton.js +63 -6
  163. package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
  164. package/lib/cjs/components/slider-button/SliderButton.styles.js +15 -2
  165. package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
  166. package/lib/cjs/components/slider-button/SliderButton.types.js +6 -0
  167. package/lib/cjs/components/slider-button/SliderButton.types.js.map +1 -0
  168. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js +66 -0
  169. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  170. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js +47 -0
  171. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  172. package/lib/cjs/components/tag-input/TagInput.js +92 -36
  173. package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
  174. package/lib/cjs/components/tag-input/TagInput.styles.js +29 -3
  175. package/lib/cjs/components/tag-input/TagInput.styles.js.map +1 -1
  176. package/lib/cjs/components/text-area/TextArea.js +17 -8
  177. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  178. package/lib/cjs/components/text-area/TextArea.styles.js +15 -1
  179. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  180. package/lib/cjs/components/truncation/Truncation.js +17 -3
  181. package/lib/cjs/components/truncation/Truncation.js.map +1 -1
  182. package/lib/cjs/components/truncation/Truncation.styles.js +18 -1
  183. package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
  184. package/lib/cjs/hooks/dropdown.js +5 -24
  185. package/lib/cjs/hooks/dropdown.js.map +1 -1
  186. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js +68 -0
  187. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  188. package/lib/cjs/utils/file.js.map +1 -1
  189. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js +29 -0
  190. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  191. package/lib/esm/components/accordion/Accordion.js +105 -12
  192. package/lib/esm/components/accordion/Accordion.js.map +1 -1
  193. package/lib/esm/components/accordion/Accordion.styles.js +23 -3
  194. package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
  195. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
  196. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  197. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +33 -19
  198. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  199. package/lib/esm/components/accordion/accordion-head/AccordionHead.js +6 -3
  200. package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  201. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
  202. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  203. package/lib/esm/components/amount-control/AmountControl.js +30 -16
  204. package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
  205. package/lib/esm/components/amount-control/AmountControl.styles.js +18 -2
  206. package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
  207. package/lib/esm/components/button/Button.js +5 -1
  208. package/lib/esm/components/button/Button.js.map +1 -1
  209. package/lib/esm/components/button/Button.styles.js +10 -0
  210. package/lib/esm/components/button/Button.styles.js.map +1 -1
  211. package/lib/esm/components/button/Button.types.js.map +1 -1
  212. package/lib/esm/components/checkbox/Checkbox.js +5 -1
  213. package/lib/esm/components/checkbox/Checkbox.js.map +1 -1
  214. package/lib/esm/components/checkbox/Checkbox.styles.js +29 -2
  215. package/lib/esm/components/checkbox/Checkbox.styles.js.map +1 -1
  216. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  217. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  218. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  219. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  220. package/lib/esm/components/combobox/ComboBox.js +63 -22
  221. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  222. package/lib/esm/components/combobox/ComboBox.styles.js +11 -0
  223. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  224. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
  225. package/lib/esm/components/context-menu/ContextMenu.js +145 -42
  226. package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
  227. package/lib/esm/components/context-menu/ContextMenu.styles.js +38 -0
  228. package/lib/esm/components/context-menu/ContextMenu.styles.js.map +1 -1
  229. package/lib/esm/components/context-menu/ContextMenu.types.js.map +1 -1
  230. package/lib/esm/components/context-menu/ContextMenu.utils.js +24 -0
  231. package/lib/esm/components/context-menu/ContextMenu.utils.js.map +1 -1
  232. package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js +3 -8
  233. package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  234. package/lib/esm/components/dropdown-body-wrapper/DropdownBodyWrapper.js +1 -8
  235. package/lib/esm/components/dropdown-body-wrapper/DropdownBodyWrapper.js.map +1 -1
  236. package/lib/esm/components/file-input/FileInput.js +4 -2
  237. package/lib/esm/components/file-input/FileInput.js.map +1 -1
  238. package/lib/esm/components/file-list/file-item/FileItem.js +49 -26
  239. package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
  240. package/lib/esm/components/file-list/file-item/FileItem.styles.js +24 -0
  241. package/lib/esm/components/file-list/file-item/FileItem.styles.js.map +1 -1
  242. package/lib/esm/components/file-select/FileSelect.js +27 -4
  243. package/lib/esm/components/file-select/FileSelect.js.map +1 -1
  244. package/lib/esm/components/file-select/FileSelect.styles.js +10 -0
  245. package/lib/esm/components/file-select/FileSelect.styles.js.map +1 -1
  246. package/lib/esm/components/filter/Filter.js +52 -16
  247. package/lib/esm/components/filter/Filter.js.map +1 -1
  248. package/lib/esm/components/filter/Filter.styles.js +9 -0
  249. package/lib/esm/components/filter/Filter.styles.js.map +1 -1
  250. package/lib/esm/components/filter/filter-content/FilterContent.js +15 -5
  251. package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
  252. package/lib/esm/components/filter/filter-content/FilterContent.types.js.map +1 -1
  253. package/lib/esm/components/filter-buttons/FilterButtons.js +69 -5
  254. package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
  255. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js +40 -2
  256. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  257. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  258. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  259. package/lib/esm/components/grid-image/GridImage.js +20 -2
  260. package/lib/esm/components/grid-image/GridImage.js.map +1 -1
  261. package/lib/esm/components/grid-image/GridImage.styles.js +10 -1
  262. package/lib/esm/components/grid-image/GridImage.styles.js.map +1 -1
  263. package/lib/esm/components/grouped-image/GroupedImage.js +22 -4
  264. package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
  265. package/lib/esm/components/grouped-image/GroupedImage.styles.js +9 -0
  266. package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
  267. package/lib/esm/components/highlight-slider/HighlightSlider.js +13 -3
  268. package/lib/esm/components/highlight-slider/HighlightSlider.js.map +1 -1
  269. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +20 -3
  270. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  271. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +10 -1
  272. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  273. package/lib/esm/components/icon/Icon.js +26 -7
  274. package/lib/esm/components/icon/Icon.js.map +1 -1
  275. package/lib/esm/components/icon/Icon.styles.js +23 -0
  276. package/lib/esm/components/icon/Icon.styles.js.map +1 -1
  277. package/lib/esm/components/input/Input.js +24 -4
  278. package/lib/esm/components/input/Input.js.map +1 -1
  279. package/lib/esm/components/input/Input.styles.js +38 -3
  280. package/lib/esm/components/input/Input.styles.js.map +1 -1
  281. package/lib/esm/components/list/List.js +123 -37
  282. package/lib/esm/components/list/List.js.map +1 -1
  283. package/lib/esm/components/list/List.utils.js +202 -0
  284. package/lib/esm/components/list/List.utils.js.map +1 -1
  285. package/lib/esm/components/list/list-item/ListItem.js +85 -4
  286. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  287. package/lib/esm/components/list/list-item/ListItem.styles.js +7 -0
  288. package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
  289. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +6 -2
  290. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  291. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +4 -0
  292. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  293. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +1 -0
  294. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  295. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +4 -1
  296. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  297. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +1 -0
  298. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  299. package/lib/esm/components/list/list-item/useListItemFocus.js +40 -0
  300. package/lib/esm/components/list/list-item/useListItemFocus.js.map +1 -0
  301. package/lib/esm/components/mention-finder/MentionFinder.js +39 -3
  302. package/lib/esm/components/mention-finder/MentionFinder.js.map +1 -1
  303. package/lib/esm/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  304. package/lib/esm/components/multi-action-button/MultiActionButton.js +36 -3
  305. package/lib/esm/components/multi-action-button/MultiActionButton.js.map +1 -1
  306. package/lib/esm/components/multi-action-button/MultiActionButton.styles.js +6 -0
  307. package/lib/esm/components/multi-action-button/MultiActionButton.styles.js.map +1 -1
  308. package/lib/esm/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  309. package/lib/esm/components/multi-action-button/action-button/ActionButton.js +7 -1
  310. package/lib/esm/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  311. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  312. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  313. package/lib/esm/components/number-input/NumberInput.js +13 -10
  314. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  315. package/lib/esm/components/page-provider/PageProvider.js +4 -2
  316. package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
  317. package/lib/esm/components/popup/Popup.js +8 -1
  318. package/lib/esm/components/popup/Popup.js.map +1 -1
  319. package/lib/esm/components/radio-button/RadioButton.js +29 -15
  320. package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
  321. package/lib/esm/components/radio-button/RadioButton.styles.js +19 -8
  322. package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
  323. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  324. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  325. package/lib/esm/components/search-box/SearchBox.js +17 -3
  326. package/lib/esm/components/search-box/SearchBox.js.map +1 -1
  327. package/lib/esm/components/search-input/SearchInput.js +56 -44
  328. package/lib/esm/components/search-input/SearchInput.js.map +1 -1
  329. package/lib/esm/components/search-input/SearchInput.styles.js +25 -1
  330. package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
  331. package/lib/esm/components/select-button/SelectButton.js +4 -2
  332. package/lib/esm/components/select-button/SelectButton.js.map +1 -1
  333. package/lib/esm/components/setup-wizard/SetupWizard.js +10 -4
  334. package/lib/esm/components/setup-wizard/SetupWizard.js.map +1 -1
  335. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  336. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  337. package/lib/esm/components/sharing-bar/SharingBar.js +30 -5
  338. package/lib/esm/components/sharing-bar/SharingBar.js.map +1 -1
  339. package/lib/esm/components/sharing-bar/SharingBar.styles.js +5 -0
  340. package/lib/esm/components/sharing-bar/SharingBar.styles.js.map +1 -1
  341. package/lib/esm/components/sharing-button/SharingButton.js +4 -2
  342. package/lib/esm/components/sharing-button/SharingButton.js.map +1 -1
  343. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js +3 -1
  344. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  345. package/lib/esm/components/signature/Signature.js +6 -3
  346. package/lib/esm/components/signature/Signature.js.map +1 -1
  347. package/lib/esm/components/slider/Slider.js +30 -7
  348. package/lib/esm/components/slider/Slider.js.map +1 -1
  349. package/lib/esm/components/slider/Slider.styles.js +8 -1
  350. package/lib/esm/components/slider/Slider.styles.js.map +1 -1
  351. package/lib/esm/components/slider-button/SliderButton.js +62 -6
  352. package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
  353. package/lib/esm/components/slider-button/SliderButton.styles.js +14 -1
  354. package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
  355. package/lib/esm/components/slider-button/SliderButton.types.js +2 -0
  356. package/lib/esm/components/slider-button/SliderButton.types.js.map +1 -0
  357. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js +56 -0
  358. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  359. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js +38 -0
  360. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  361. package/lib/esm/components/tag-input/TagInput.js +86 -35
  362. package/lib/esm/components/tag-input/TagInput.js.map +1 -1
  363. package/lib/esm/components/tag-input/TagInput.styles.js +27 -1
  364. package/lib/esm/components/tag-input/TagInput.styles.js.map +1 -1
  365. package/lib/esm/components/text-area/TextArea.js +18 -9
  366. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  367. package/lib/esm/components/text-area/TextArea.styles.js +14 -0
  368. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  369. package/lib/esm/components/truncation/Truncation.js +18 -4
  370. package/lib/esm/components/truncation/Truncation.js.map +1 -1
  371. package/lib/esm/components/truncation/Truncation.styles.js +17 -0
  372. package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
  373. package/lib/esm/hooks/dropdown.js +5 -24
  374. package/lib/esm/hooks/dropdown.js.map +1 -1
  375. package/lib/esm/hooks/useKeyboardFocusHighlighting.js +61 -0
  376. package/lib/esm/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  377. package/lib/esm/utils/file.js.map +1 -1
  378. package/lib/esm/utils/keyboardFocusHighlighting.styles.js +24 -0
  379. package/lib/esm/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  380. package/lib/types/components/accordion/Accordion.d.ts +5 -0
  381. package/lib/types/components/accordion/Accordion.styles.d.ts +8 -4
  382. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
  383. package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +7 -2
  384. package/lib/types/components/accordion/accordion-head/AccordionHead.d.ts +1 -0
  385. package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +18 -18
  386. package/lib/types/components/amount-control/AmountControl.d.ts +5 -0
  387. package/lib/types/components/amount-control/AmountControl.styles.d.ts +8 -4
  388. package/lib/types/components/button/Button.styles.d.ts +8 -6
  389. package/lib/types/components/button/Button.types.d.ts +8 -0
  390. package/lib/types/components/checkbox/Checkbox.d.ts +4 -0
  391. package/lib/types/components/checkbox/Checkbox.styles.d.ts +5 -1
  392. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +5 -0
  393. package/lib/types/components/combobox/ComboBox.styles.d.ts +4 -2
  394. package/lib/types/components/combobox/ComboBox.types.d.ts +5 -0
  395. package/lib/types/components/context-menu/ContextMenu.styles.d.ts +4 -2
  396. package/lib/types/components/context-menu/ContextMenu.types.d.ts +6 -0
  397. package/lib/types/components/context-menu/ContextMenu.utils.d.ts +10 -0
  398. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.d.ts +1 -1
  399. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +2 -2
  400. package/lib/types/components/dropdown-body-wrapper/DropdownBodyWrapper.d.ts +0 -7
  401. package/lib/types/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.styles.d.ts +2 -2
  402. package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +2 -2
  403. package/lib/types/components/file-input/FileInput.d.ts +4 -0
  404. package/lib/types/components/file-input/FileInput.styles.d.ts +2 -2
  405. package/lib/types/components/file-list/file-item/FileItem.styles.d.ts +3 -0
  406. package/lib/types/components/file-select/FileSelect.d.ts +4 -0
  407. package/lib/types/components/file-select/FileSelect.styles.d.ts +6 -4
  408. package/lib/types/components/filter/Filter.d.ts +1 -0
  409. package/lib/types/components/filter/Filter.styles.d.ts +6 -4
  410. package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +4 -0
  411. package/lib/types/components/filter-buttons/FilterButtons.d.ts +4 -0
  412. package/lib/types/components/filter-buttons/filter-button/FilterButton.d.ts +5 -0
  413. package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +12 -8
  414. package/lib/types/components/grid-image/GridImage.d.ts +4 -0
  415. package/lib/types/components/grid-image/GridImage.styles.d.ts +4 -2
  416. package/lib/types/components/grouped-image/GroupedImage.d.ts +4 -0
  417. package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +8 -6
  418. package/lib/types/components/highlight-slider/HighlightSlider.d.ts +4 -0
  419. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.d.ts +3 -0
  420. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.d.ts +9 -5
  421. package/lib/types/components/icon/Icon.d.ts +4 -0
  422. package/lib/types/components/icon/Icon.styles.d.ts +1 -0
  423. package/lib/types/components/input/Input.d.ts +4 -0
  424. package/lib/types/components/input/Input.styles.d.ts +17 -9
  425. package/lib/types/components/list/List.d.ts +11 -0
  426. package/lib/types/components/list/List.utils.d.ts +32 -1
  427. package/lib/types/components/list/list-item/ListItem.d.ts +4 -0
  428. package/lib/types/components/list/list-item/ListItem.styles.d.ts +64 -64
  429. package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +2 -2
  430. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +195 -194
  431. package/lib/types/components/list/list-item/useListItemFocus.d.ts +13 -0
  432. package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +2 -2
  433. package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +4 -4
  434. package/lib/types/components/multi-action-button/MultiActionButton.styles.d.ts +2 -2
  435. package/lib/types/components/multi-action-button/MultiActionButton.types.d.ts +7 -0
  436. package/lib/types/components/multi-action-button/action-button/ActionButton.d.ts +4 -1
  437. package/lib/types/components/multi-action-button/action-button/ActionButton.styles.d.ts +4 -2
  438. package/lib/types/components/number-input/NumberInput.d.ts +4 -0
  439. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +2 -2
  440. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +6 -6
  441. package/lib/types/components/radio-button/RadioButton.d.ts +4 -0
  442. package/lib/types/components/radio-button/RadioButton.styles.d.ts +15 -9
  443. package/lib/types/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +5 -0
  444. package/lib/types/components/search-box/SearchBox.d.ts +4 -0
  445. package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
  446. package/lib/types/components/search-input/SearchInput.d.ts +4 -0
  447. package/lib/types/components/search-input/SearchInput.styles.d.ts +17 -9
  448. package/lib/types/components/select-button/SelectButton.d.ts +4 -0
  449. package/lib/types/components/setup-wizard/SetupWizard.d.ts +5 -0
  450. package/lib/types/components/sharing-bar/SharingBar.d.ts +4 -0
  451. package/lib/types/components/sharing-button/SharingButton.d.ts +1 -1
  452. package/lib/types/components/sharing-context-menu/SharingContextMenu.d.ts +10 -2
  453. package/lib/types/components/signature/Signature.d.ts +4 -0
  454. package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.styles.d.ts +4 -4
  455. package/lib/types/components/slider/Slider.d.ts +8 -0
  456. package/lib/types/components/slider/Slider.styles.d.ts +18 -14
  457. package/lib/types/components/slider-button/SliderButton.d.ts +1 -28
  458. package/lib/types/components/slider-button/SliderButton.styles.d.ts +6 -4
  459. package/lib/types/components/slider-button/SliderButton.types.d.ts +32 -0
  460. package/lib/types/components/slider-button/useSliderButtonPopupKeyboard.d.ts +17 -0
  461. package/lib/types/components/slider-button/useSliderButtonThumbKeyboard.d.ts +13 -0
  462. package/lib/types/components/tag-input/TagInput.d.ts +4 -0
  463. package/lib/types/components/tag-input/TagInput.styles.d.ts +12 -2
  464. package/lib/types/components/text-area/TextArea.d.ts +4 -0
  465. package/lib/types/components/text-area/TextArea.styles.d.ts +1 -0
  466. package/lib/types/components/truncation/Truncation.d.ts +4 -0
  467. package/lib/types/components/truncation/Truncation.styles.d.ts +7 -2
  468. package/lib/types/hooks/dropdown.d.ts +0 -2
  469. package/lib/types/hooks/useKeyboardFocusHighlighting.d.ts +5 -0
  470. package/lib/types/utils/file.d.ts +1 -1
  471. package/lib/types/utils/keyboardFocusHighlighting.styles.d.ts +9 -0
  472. package/package.json +3 -3
@@ -16,6 +16,7 @@ var _dropdown = require("../../types/dropdown");
16
16
  var _element = require("../../hooks/element");
17
17
  var _ComboBox2 = require("./ComboBox.types");
18
18
  var _ComboBox3 = require("./ComboBox.utils");
19
+ var _useKeyboardFocusHighlighting = require("../../hooks/useKeyboardFocusHighlighting");
19
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
21
22
  const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
@@ -44,16 +45,18 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
44
45
  onInputBlur,
45
46
  shouldShowTransparentBackground = false,
46
47
  inputValue,
47
- shouldDropDownUseMaxItemWidth = false
48
+ shouldDropDownUseMaxItemWidth = false,
49
+ shouldEnableKeyboardHighlighting
48
50
  }, ref) => {
49
51
  const [internalSelectedItem, setInternalSelectedItem] = (0, _react.useState)();
50
52
  const [isAnimating, setIsAnimating] = (0, _react.useState)(false);
51
53
  const [minWidth, setMinWidth] = (0, _react.useState)(undefined);
52
54
  const [bodyMinWidth, setBodyMinWidth] = (0, _react.useState)(0);
53
55
  const [focusedIndex, setFocusedIndex] = (0, _react.useState)(null);
54
- const [availableMaxHeight, setAvailableMaxHeight] = (0, _react.useState)(undefined);
55
56
  const isInputFocused = (0, _react.useRef)(false);
56
57
  const styledComboBoxElementRef = (0, _react.useRef)(null);
58
+ const comboBoxHeaderRef = (0, _react.useRef)(null);
59
+ const comboBoxInputRef = (0, _react.useRef)(null);
57
60
  const contentRef = (0, _react.useRef)(null);
58
61
  const parentSize = (0, _element.useElementSize)(styledComboBoxElementRef, {
59
62
  shouldUseParentElement: true
@@ -89,6 +92,7 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
89
92
  setBodyMinWidth(calculatedBodyMinWidth);
90
93
  }, [functions, internalSelectedItem, lists, parentSize, placeholder, prefix, prefixMinWidth, selectedItem, shouldDropDownUseMaxItemWidth, shouldShowBigImage, shouldShowClearIcon, shouldUseCurrentItemWidth, shouldUseFullWidth, values]);
91
94
  const shouldChangeColor = (0, _react.useMemo)(() => areaProvider.shouldChangeColor ?? false, [areaProvider.shouldChangeColor]);
95
+ const shouldShowKeyboardHighlighting = (0, _useKeyboardFocusHighlighting.useKeyboardFocusHighlighting)(shouldEnableKeyboardHighlighting && !isDisabled);
92
96
  const shouldDisableActions = (0, _react.useMemo)(() => {
93
97
  if (!selectedItem) {
94
98
  return false;
@@ -96,16 +100,6 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
96
100
  const combinedLists = lists.flatMap(list => list.list);
97
101
  return combinedLists.length === 1 && combinedLists.some(item => item.value === selectedItem.value);
98
102
  }, [lists, selectedItem]);
99
-
100
- // Limits the configured maxHeight by the height that is actually available inside the
101
- // container (reported by the DropdownBodyWrapper). This prevents the dropdown from being cut
102
- // off when it is opened to the top or bottom and there is not enough space.
103
- const effectiveMaxHeight = (0, _react.useMemo)(() => {
104
- if (typeof availableMaxHeight === 'number' && availableMaxHeight > 0) {
105
- return Math.min(maxHeight, availableMaxHeight);
106
- }
107
- return maxHeight;
108
- }, [availableMaxHeight, maxHeight]);
109
103
  const contentHeight = (0, _react.useMemo)(() => {
110
104
  const flatItems = lists.flatMap(list => list.list);
111
105
  let height = flatItems.reduce((value, item) => {
@@ -115,11 +109,11 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
115
109
  if (lists.length > 1) {
116
110
  height += lists.length * 38;
117
111
  }
118
- if (effectiveMaxHeight < height) {
119
- height = effectiveMaxHeight;
112
+ if (maxHeight < height) {
113
+ height = maxHeight;
120
114
  }
121
115
  return height;
122
- }, [effectiveMaxHeight, lists, shouldShowBigImage]);
116
+ }, [lists, maxHeight, shouldShowBigImage]);
123
117
  const handleInputFocus = (0, _react.useCallback)(event => {
124
118
  isInputFocused.current = true;
125
119
  onInputFocus === null || onInputFocus === void 0 || onInputFocus(event);
@@ -140,6 +134,26 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
140
134
  }
141
135
  setIsAnimating(false);
142
136
  }, [onHide]);
137
+ const handleContainerBlur = (0, _react.useCallback)(event => {
138
+ var _contentRef$current;
139
+ const nextFocusedElement = event.relatedTarget;
140
+ const currentContainer = event.currentTarget;
141
+ if (!nextFocusedElement || !currentContainer.contains(nextFocusedElement) && !((_contentRef$current = contentRef.current) !== null && _contentRef$current !== void 0 && _contentRef$current.contains(nextFocusedElement))) {
142
+ handleClose();
143
+ }
144
+ }, [handleClose]);
145
+ const restoreTriggerFocus = (0, _react.useCallback)(() => {
146
+ // Delay is needed so focus happens after dropdown close/render cycle.
147
+ requestAnimationFrame(() => {
148
+ var _comboBoxHeaderRef$cu;
149
+ if (typeof inputValue === 'string') {
150
+ var _comboBoxInputRef$cur;
151
+ (_comboBoxInputRef$cur = comboBoxInputRef.current) === null || _comboBoxInputRef$cur === void 0 || _comboBoxInputRef$cur.focus();
152
+ return;
153
+ }
154
+ (_comboBoxHeaderRef$cu = comboBoxHeaderRef.current) === null || _comboBoxHeaderRef$cu === void 0 || _comboBoxHeaderRef$cu.focus();
155
+ });
156
+ }, [inputValue]);
143
157
 
144
158
  /**
145
159
  * This function sets the selected item
@@ -155,13 +169,15 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
155
169
  if (shouldPreventSelection) return;
156
170
  setInternalSelectedItem(itemToSelect);
157
171
  handleClose();
172
+ restoreTriggerFocus();
158
173
  });
159
174
  return;
160
175
  }
161
176
  }
162
177
  setInternalSelectedItem(itemToSelect);
163
178
  handleClose();
164
- }, [handleClose, onSelect]);
179
+ restoreTriggerFocus();
180
+ }, [handleClose, onSelect, restoreTriggerFocus]);
165
181
  const handleClear = (0, _react.useCallback)(event => {
166
182
  event.preventDefault();
167
183
  event.stopPropagation();
@@ -170,10 +186,16 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
170
186
  (0, _react.useEffect)(() => {
171
187
  const handleKeyDown = e => {
172
188
  if (!isAnimating) return;
189
+ if (e.key === 'Escape') {
190
+ e.preventDefault();
191
+ handleClose();
192
+ restoreTriggerFocus();
193
+ return;
194
+ }
173
195
  if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
174
- var _contentRef$current;
196
+ var _contentRef$current2;
175
197
  e.preventDefault();
176
- const children = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.children;
198
+ const children = (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 ? void 0 : _contentRef$current2.children;
177
199
  if (!children || children.length === 0) return;
178
200
  const stepDirection = e.key === 'ArrowUp' ? -1 : 1;
179
201
  let newIndex = focusedIndex ?? -1;
@@ -197,8 +219,8 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
197
219
  focusedElement.tabIndex = 0;
198
220
  focusedElement.focus();
199
221
  } else if (e.key === 'Enter' && focusedIndex !== null) {
200
- var _contentRef$current2;
201
- const element = (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 ? void 0 : _contentRef$current2.children[focusedIndex];
222
+ var _contentRef$current3;
223
+ const element = (_contentRef$current3 = contentRef.current) === null || _contentRef$current3 === void 0 ? void 0 : _contentRef$current3.children[focusedIndex];
202
224
  if (!element) return;
203
225
  const {
204
226
  id
@@ -217,7 +239,7 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
217
239
  };
218
240
  document.addEventListener('keydown', handleKeyDown);
219
241
  return () => document.removeEventListener('keydown', handleKeyDown);
220
- }, [focusedIndex, handleSetSelectedItem, isAnimating, lists]);
242
+ }, [focusedIndex, handleClose, handleSetSelectedItem, isAnimating, lists, restoreTriggerFocus]);
221
243
 
222
244
  /**
223
245
  * This function sets the external selected item
@@ -276,6 +298,21 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
276
298
  }
277
299
  }
278
300
  }, [handleClose, handleOpen, isAnimating, isDisabled]);
301
+ const handleHeaderKeyDown = (0, _react.useCallback)(event => {
302
+ if (isDisabled || typeof inputValue === 'string') {
303
+ return;
304
+ }
305
+ if (event.key === 'Escape' && isAnimating) {
306
+ event.preventDefault();
307
+ handleClose();
308
+ restoreTriggerFocus();
309
+ return;
310
+ }
311
+ if (event.key === 'Enter' || event.key === ' ') {
312
+ event.preventDefault();
313
+ handleHeaderClick();
314
+ }
315
+ }, [handleClose, handleHeaderClick, inputValue, isAnimating, isDisabled, restoreTriggerFocus]);
279
316
  (0, _react.useImperativeHandle)(ref, () => ({
280
317
  hide: handleClose,
281
318
  show: handleOpen
@@ -295,8 +332,10 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
295
332
  return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBox, {
296
333
  ref: styledComboBoxElementRef,
297
334
  $minWidth: minWidth,
298
- $shouldUseFullWidth: shouldUseFullWidth
335
+ $shouldUseFullWidth: shouldUseFullWidth,
336
+ onBlur: handleContainerBlur
299
337
  }, /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxHeader, {
338
+ ref: comboBoxHeaderRef,
300
339
  $direction: direction,
301
340
  onClick: handleHeaderClick,
302
341
  $isOpen: isAnimating,
@@ -305,7 +344,12 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
305
344
  $shouldShowTransparentBackground: shouldShowTransparentBackground,
306
345
  $isDisabled: isDisabled,
307
346
  $shouldChangeColor: shouldChangeColor,
308
- $shouldShowBigImage: shouldShowBigImage
347
+ $shouldShowBigImage: shouldShowBigImage,
348
+ $shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
349
+ onKeyDown: handleHeaderKeyDown,
350
+ tabIndex: !isDisabled && typeof inputValue !== 'string' ? 0 : undefined,
351
+ role: !isDisabled && typeof inputValue !== 'string' ? 'button' : undefined,
352
+ "aria-expanded": !isDisabled && typeof inputValue !== 'string' ? isAnimating : undefined
309
353
  }, /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxPrefixAndPlaceholderWrapper, null, prefix && /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxPrefix, {
310
354
  $prefixMinWidth: prefixMinWidth
311
355
  }, prefix), /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxPlaceholder, {
@@ -317,6 +361,7 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
317
361
  }), placeholderIcon && /*#__PURE__*/_react.default.createElement(_Icon.default, {
318
362
  icons: placeholderIcon
319
363
  }), typeof inputValue === 'string' ? /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxInput, {
364
+ ref: comboBoxInputRef,
320
365
  disabled: isDisabled,
321
366
  value: inputValue,
322
367
  onChange: onInputChange,
@@ -340,19 +385,18 @@ const ComboBox = /*#__PURE__*/(0, _react.forwardRef)(({
340
385
  bodyWidth: bodyWidth,
341
386
  contentHeight: contentHeight,
342
387
  shouldCaptureEvents: shouldCaptureEvents,
343
- onAvailableMaxHeightChange: setAvailableMaxHeight,
344
388
  onClose: handleClose,
345
389
  direction: direction,
346
390
  container: container,
347
391
  shouldShowDropdown: isAnimating,
348
392
  minBodyWidth: bodyWidth ?? bodyMinWidth
349
393
  }, /*#__PURE__*/_react.default.createElement(_ComboBox.StyledComboBoxBody, {
350
- $maxHeight: effectiveMaxHeight,
394
+ $maxHeight: maxHeight,
351
395
  $minWidth: bodyWidth ?? bodyMinWidth,
352
396
  className: "chayns-scrollbar",
353
397
  ref: contentRef,
354
398
  tabIndex: 0
355
- }, comboBoxGroups))), [bodyMinWidth, bodyWidth, comboBoxGroups, container, contentHeight, direction, handleClear, handleClose, handleHeaderClick, handleInputBlur, handleInputFocus, inputValue, internalSelectedItem, isAnimating, isDisabled, isTouch, effectiveMaxHeight, minWidth, onInputChange, placeholderIcon, placeholderImageUrl, placeholderText, prefix, prefixMinWidth, selectedItem, shouldChangeColor, shouldDisableActions, shouldCaptureEvents, shouldShowBigImage, shouldShowClearIcon, shouldShowRoundPlaceholderImage, shouldShowTransparentBackground, shouldUseFullWidth, size]);
399
+ }, comboBoxGroups))), [bodyMinWidth, bodyWidth, comboBoxGroups, container, contentHeight, direction, handleClear, handleClose, handleHeaderClick, handleHeaderKeyDown, handleInputBlur, handleInputFocus, inputValue, internalSelectedItem, isAnimating, isDisabled, isTouch, maxHeight, minWidth, onInputChange, placeholderIcon, placeholderImageUrl, placeholderText, prefix, prefixMinWidth, selectedItem, shouldChangeColor, shouldDisableActions, shouldCaptureEvents, shouldShowKeyboardHighlighting, shouldShowBigImage, shouldShowClearIcon, shouldShowRoundPlaceholderImage, shouldShowTransparentBackground, shouldUseFullWidth, size]);
356
400
  });
357
401
  ComboBox.displayName = 'ComboBox';
358
402
  var _default = exports.default = ComboBox;
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_environment","_AreaContextProvider","_Icon","_interopRequireDefault","_ComboBoxItem","_ComboBox","_DropdownBodyWrapper","_dropdown","_element","_ComboBox2","_ComboBox3","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ComboBox","forwardRef","bodyWidth","direction","DropdownDirection","RIGHT","isDisabled","lists","maxHeight","onSelect","placeholder","prefix","container","shouldCaptureEvents","selectedItem","onHide","onShow","shouldShowBigImage","shouldShowClearIcon","shouldShowRoundImage","onInputFocus","prefixMinWidth","size","ComboBoxSize","NORMAL","shouldUseFullWidth","onInputChange","shouldUseCurrentItemWidth","onInputBlur","shouldShowTransparentBackground","inputValue","shouldDropDownUseMaxItemWidth","ref","internalSelectedItem","setInternalSelectedItem","useState","isAnimating","setIsAnimating","minWidth","setMinWidth","undefined","bodyMinWidth","setBodyMinWidth","focusedIndex","setFocusedIndex","availableMaxHeight","setAvailableMaxHeight","isInputFocused","useRef","styledComboBoxElementRef","contentRef","parentSize","useElementSize","shouldUseParentElement","functions","useFunctions","values","useValues","isTouch","useIsTouch","areaProvider","useContext","AreaContext","useEffect","calculatedMinWidth","calculatedBodyMinWidth","getComboBoxWidthResult","parentWidth","width","shouldChangeColor","useMemo","shouldDisableActions","combinedLists","flatMap","list","length","some","item","value","effectiveMaxHeight","Math","min","contentHeight","flatItems","height","reduce","isBigItem","subtext","trim","handleInputFocus","useCallback","event","current","handleInputBlur","handleOpen","handleClose","handleSetSelectedItem","itemToSelect","onSelectResult","Promise","then","shouldPreventSelection","handleClear","preventDefault","stopPropagation","handleKeyDown","key","_contentRef$current","children","stepDirection","newIndex","attempts","newElement","shouldSkip","id","startsWith","endsWith","prevElement","tabIndex","focusedElement","focus","_contentRef$current2","element","newSelectedItem","find","String","replace","document","addEventListener","removeEventListener","placeholderImageUrl","imageUrl","placeholderIcon","icons","placeholderText","text","shouldShowRoundPlaceholderImage","selectedItemList","handleHeaderClick","useImperativeHandle","hide","show","comboBoxGroups","map","createElement","Fragment","groupName","StyledComboBoxTopic","isSelected","StyledComboBox","$minWidth","$shouldUseFullWidth","StyledComboBoxHeader","$direction","onClick","$isOpen","$isTouch","$size","$shouldShowTransparentBackground","$isDisabled","$shouldChangeColor","$shouldShowBigImage","StyledComboBoxPrefixAndPlaceholderWrapper","StyledComboBoxPrefix","$prefixMinWidth","StyledComboBoxPlaceholder","$shouldReduceOpacity","StyledComboBoxPlaceholderImage","src","$shouldShowRoundImage","StyledComboBoxInput","disabled","onChange","onBlur","onFocus","StyledComboBoxPlaceholderText","suffixElement","StyledComboBoxClearIconWrapper","StyledComboBoxIconWrapper","$shouldShowBorderLeft","anchorElement","onAvailableMaxHeightChange","onClose","shouldShowDropdown","minBodyWidth","StyledComboBoxBody","$maxHeight","className","displayName","_default","exports"],"sources":["../../../../src/components/combobox/ComboBox.tsx"],"sourcesContent":["import { useFunctions, useValues } from 'chayns-api';\nimport React, {\n FocusEventHandler,\n forwardRef,\n Fragment,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useIsTouch } from '../../utils/environment';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport Icon from '../icon/Icon';\nimport ComboBoxItem from './combobox-item/ComboBoxItem';\nimport {\n StyledComboBox,\n StyledComboBoxBody,\n StyledComboBoxClearIconWrapper,\n StyledComboBoxHeader,\n StyledComboBoxIconWrapper,\n StyledComboBoxInput,\n StyledComboBoxPlaceholder,\n StyledComboBoxPlaceholderImage,\n StyledComboBoxPlaceholderText,\n StyledComboBoxPrefix,\n StyledComboBoxPrefixAndPlaceholderWrapper,\n StyledComboBoxTopic,\n} from './ComboBox.styles';\nimport DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';\nimport { DropdownDirection } from '../../types/dropdown';\nimport { useElementSize } from '../../hooks/element';\nimport { ComboBoxProps, ComboBoxRef, ComboBoxSize, IComboBoxItem } from './ComboBox.types';\nimport { getComboBoxWidthResult } from './ComboBox.utils';\n\nconst ComboBox = forwardRef<ComboBoxRef, ComboBoxProps>(\n (\n {\n bodyWidth,\n direction = DropdownDirection.RIGHT,\n isDisabled = false,\n lists,\n maxHeight = 280,\n onSelect,\n placeholder,\n prefix,\n container,\n shouldCaptureEvents,\n selectedItem,\n onHide,\n onShow,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldShowRoundImage,\n onInputFocus,\n prefixMinWidth,\n size = ComboBoxSize.NORMAL,\n shouldUseFullWidth = false,\n onInputChange,\n shouldUseCurrentItemWidth = false,\n onInputBlur,\n shouldShowTransparentBackground = false,\n inputValue,\n shouldDropDownUseMaxItemWidth = false,\n },\n ref,\n ) => {\n const [internalSelectedItem, setInternalSelectedItem] = useState<IComboBoxItem>();\n const [isAnimating, setIsAnimating] = useState(false);\n const [minWidth, setMinWidth] = useState<number | undefined>(undefined);\n const [bodyMinWidth, setBodyMinWidth] = useState(0);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [availableMaxHeight, setAvailableMaxHeight] = useState<number | undefined>(undefined);\n\n const isInputFocused = useRef(false);\n const styledComboBoxElementRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const parentSize = useElementSize(styledComboBoxElementRef, {\n shouldUseParentElement: true,\n });\n\n const functions = useFunctions();\n const values = useValues();\n const isTouch = useIsTouch();\n const areaProvider = useContext(AreaContext);\n\n useEffect(() => {\n if (!parentSize) {\n return;\n }\n\n const { minWidth: calculatedMinWidth, bodyMinWidth: calculatedBodyMinWidth } =\n getComboBoxWidthResult({\n functions,\n internalSelectedItem,\n lists,\n parentWidth: parentSize.width,\n placeholder,\n prefix,\n prefixMinWidth,\n selectedItem,\n shouldDropDownUseMaxItemWidth,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldUseCurrentItemWidth,\n shouldUseFullWidth,\n values,\n });\n\n setMinWidth(calculatedMinWidth);\n setBodyMinWidth(calculatedBodyMinWidth);\n }, [\n functions,\n internalSelectedItem,\n lists,\n parentSize,\n placeholder,\n prefix,\n prefixMinWidth,\n selectedItem,\n shouldDropDownUseMaxItemWidth,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldUseCurrentItemWidth,\n shouldUseFullWidth,\n values,\n ]);\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n const shouldDisableActions = useMemo(() => {\n if (!selectedItem) {\n return false;\n }\n\n const combinedLists = lists.flatMap((list) => list.list);\n\n return (\n combinedLists.length === 1 &&\n combinedLists.some((item) => item.value === selectedItem.value)\n );\n }, [lists, selectedItem]);\n\n // Limits the configured maxHeight by the height that is actually available inside the\n // container (reported by the DropdownBodyWrapper). This prevents the dropdown from being cut\n // off when it is opened to the top or bottom and there is not enough space.\n const effectiveMaxHeight = useMemo(() => {\n if (typeof availableMaxHeight === 'number' && availableMaxHeight > 0) {\n return Math.min(maxHeight, availableMaxHeight);\n }\n\n return maxHeight;\n }, [availableMaxHeight, maxHeight]);\n\n const contentHeight = useMemo(() => {\n const flatItems = lists.flatMap((list) => list.list);\n\n let height = flatItems.reduce((value, item) => {\n const isBigItem =\n shouldShowBigImage ||\n (typeof item.subtext === 'string' && item.subtext.trim() !== '');\n\n return value + (isBigItem ? 56 : 38);\n }, 0);\n\n if (lists.length > 1) {\n height += lists.length * 38;\n }\n\n if (effectiveMaxHeight < height) {\n height = effectiveMaxHeight;\n }\n\n return height;\n }, [effectiveMaxHeight, lists, shouldShowBigImage]);\n\n const handleInputFocus: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = true;\n onInputFocus?.(event);\n },\n [onInputFocus],\n );\n\n const handleInputBlur: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = false;\n onInputBlur?.(event);\n },\n [onInputBlur],\n );\n\n const handleOpen = useCallback(() => {\n if (typeof onShow === 'function') {\n onShow();\n }\n\n setIsAnimating(true);\n }, [onShow]);\n\n const handleClose = useCallback(() => {\n if (typeof onHide === 'function') {\n onHide();\n }\n\n setIsAnimating(false);\n }, [onHide]);\n\n /**\n * This function sets the selected item\n */\n const handleSetSelectedItem = useCallback(\n (itemToSelect?: IComboBoxItem) => {\n if (typeof onSelect === 'function') {\n const onSelectResult = onSelect(itemToSelect);\n\n if (onSelectResult === false) {\n return;\n }\n\n if (onSelectResult instanceof Promise) {\n void onSelectResult.then((shouldPreventSelection) => {\n if (shouldPreventSelection) return;\n\n setInternalSelectedItem(itemToSelect);\n handleClose();\n });\n\n return;\n }\n }\n\n setInternalSelectedItem(itemToSelect);\n handleClose();\n },\n [handleClose, onSelect],\n );\n\n const handleClear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n handleSetSelectedItem(undefined);\n },\n [handleSetSelectedItem],\n );\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!isAnimating) return;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n\n const children = contentRef.current?.children;\n\n if (!children || children.length === 0) return;\n\n const stepDirection = e.key === 'ArrowUp' ? -1 : 1;\n\n let newIndex = focusedIndex ?? -1;\n\n let attempts = 0;\n\n do {\n newIndex = (newIndex + stepDirection + children.length) % children.length;\n\n const newElement = children[newIndex] as HTMLDivElement;\n\n let shouldSkip = false;\n\n if (\n newElement.id.startsWith('combobox-group--') ||\n newElement.id.endsWith('--disabled-item')\n ) {\n shouldSkip = true;\n }\n\n if (!shouldSkip) break;\n\n attempts++;\n } while (attempts < children.length);\n\n if (focusedIndex !== null) {\n const prevElement = children[focusedIndex] as HTMLDivElement;\n\n prevElement.tabIndex = -1;\n }\n\n setFocusedIndex(newIndex);\n\n const focusedElement = children[newIndex] as HTMLDivElement;\n\n focusedElement.tabIndex = 0;\n focusedElement.focus();\n } else if (e.key === 'Enter' && focusedIndex !== null) {\n const element = contentRef.current?.children[focusedIndex];\n\n if (!element) return;\n\n const { id } = element;\n\n let newSelectedItem: IComboBoxItem | undefined;\n\n lists.some((list) => {\n newSelectedItem = list.list.find(\n ({ value }) => String(value) === id.replace('combobox-item__', ''),\n );\n\n return !!newSelectedItem;\n });\n\n if (newSelectedItem) {\n handleSetSelectedItem(newSelectedItem);\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [focusedIndex, handleSetSelectedItem, isAnimating, lists]);\n\n /**\n * This function sets the external selected item\n */\n useEffect(() => {\n setIsAnimating(false);\n setInternalSelectedItem(selectedItem);\n }, [selectedItem]);\n\n const placeholderImageUrl = useMemo(() => {\n if (selectedItem) {\n return selectedItem.imageUrl;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.imageUrl;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n const placeholderIcon = useMemo(() => {\n if (selectedItem) {\n return selectedItem.icons;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.icons;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n /**\n * This function resets the placeholder\n */\n const placeholderText = useMemo(() => {\n let text = placeholder;\n\n if (selectedItem) {\n text = selectedItem.text;\n } else if (internalSelectedItem) {\n text = internalSelectedItem.text;\n }\n\n return text;\n }, [internalSelectedItem, placeholder, selectedItem]);\n\n const shouldShowRoundPlaceholderImage = useMemo(() => {\n const selectedItemList = lists.find((list) =>\n list.list.some(\n ({ value }) => value === (selectedItem?.value ?? internalSelectedItem?.value),\n ),\n );\n\n return selectedItemList?.shouldShowRoundImage ?? shouldShowRoundImage;\n }, [internalSelectedItem?.value, lists, selectedItem?.value, shouldShowRoundImage]);\n\n /**\n * This function opens the content of the combobox\n */\n const handleHeaderClick = useCallback(() => {\n if (!isDisabled && !isInputFocused.current) {\n if (isAnimating) {\n handleClose();\n } else {\n handleOpen();\n }\n }\n }, [handleClose, handleOpen, isAnimating, isDisabled]);\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleClose,\n show: handleOpen,\n }),\n [handleClose, handleOpen],\n );\n\n const comboBoxGroups = useMemo(\n () =>\n lists.map((list) => (\n <Fragment key={list.groupName ?? 'default-group'}>\n {list.groupName && lists.length > 1 && (\n <StyledComboBoxTopic id={`combobox-group--${list.groupName}`}>\n {list.groupName}\n </StyledComboBoxTopic>\n )}\n {list.list.map((item) => (\n <ComboBoxItem\n key={`item-${item.text}`}\n item={item}\n isSelected={\n selectedItem ? item.value === selectedItem.value : false\n }\n onSelect={handleSetSelectedItem}\n shouldShowBigImage={shouldShowBigImage}\n shouldShowRoundImage={\n list.shouldShowRoundImage ?? shouldShowRoundImage\n }\n />\n ))}\n </Fragment>\n )),\n [handleSetSelectedItem, lists, selectedItem, shouldShowBigImage, shouldShowRoundImage],\n );\n\n return useMemo(\n () => (\n <StyledComboBox\n ref={styledComboBoxElementRef}\n $minWidth={minWidth}\n $shouldUseFullWidth={shouldUseFullWidth}\n >\n <StyledComboBoxHeader\n $direction={direction}\n onClick={handleHeaderClick}\n $isOpen={isAnimating}\n $isTouch={isTouch}\n $size={size}\n $shouldShowTransparentBackground={shouldShowTransparentBackground}\n $isDisabled={isDisabled}\n $shouldChangeColor={shouldChangeColor}\n $shouldShowBigImage={shouldShowBigImage}\n >\n <StyledComboBoxPrefixAndPlaceholderWrapper>\n {prefix && (\n <StyledComboBoxPrefix $prefixMinWidth={prefixMinWidth}>\n {prefix}\n </StyledComboBoxPrefix>\n )}\n <StyledComboBoxPlaceholder\n $shouldReduceOpacity={!selectedItem && !internalSelectedItem}\n >\n {placeholderImageUrl && (\n <StyledComboBoxPlaceholderImage\n src={placeholderImageUrl}\n $shouldShowBigImage={shouldShowBigImage}\n $shouldShowRoundImage={shouldShowRoundPlaceholderImage}\n />\n )}\n {placeholderIcon && <Icon icons={placeholderIcon} />}\n {typeof inputValue === 'string' ? (\n <StyledComboBoxInput\n disabled={isDisabled}\n value={inputValue}\n onChange={onInputChange}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n placeholder={placeholderText}\n />\n ) : (\n <StyledComboBoxPlaceholderText>\n {placeholderText}\n </StyledComboBoxPlaceholderText>\n )}\n {internalSelectedItem &&\n internalSelectedItem.suffixElement &&\n internalSelectedItem.suffixElement}\n </StyledComboBoxPlaceholder>\n </StyledComboBoxPrefixAndPlaceholderWrapper>\n {shouldShowClearIcon && internalSelectedItem && (\n <StyledComboBoxClearIconWrapper\n $isDisabled={isDisabled}\n onClick={handleClear}\n >\n <Icon icons={['fa fa-times']} />\n </StyledComboBoxClearIconWrapper>\n )}\n {!shouldDisableActions && (\n <StyledComboBoxIconWrapper\n $isDisabled={isDisabled}\n $size={size}\n $shouldShowBorderLeft={\n shouldShowClearIcon === true &&\n internalSelectedItem !== undefined\n }\n >\n <Icon icons={['fa fa-chevron-down']} isDisabled={isDisabled} />\n </StyledComboBoxIconWrapper>\n )}\n </StyledComboBoxHeader>\n {styledComboBoxElementRef.current && (\n <DropdownBodyWrapper\n anchorElement={styledComboBoxElementRef.current}\n bodyWidth={bodyWidth}\n contentHeight={contentHeight}\n shouldCaptureEvents={shouldCaptureEvents}\n onAvailableMaxHeightChange={setAvailableMaxHeight}\n onClose={handleClose}\n direction={direction}\n container={container}\n shouldShowDropdown={isAnimating}\n minBodyWidth={bodyWidth ?? bodyMinWidth}\n >\n <StyledComboBoxBody\n $maxHeight={effectiveMaxHeight}\n $minWidth={bodyWidth ?? bodyMinWidth}\n className=\"chayns-scrollbar\"\n ref={contentRef}\n tabIndex={0}\n >\n {comboBoxGroups}\n </StyledComboBoxBody>\n </DropdownBodyWrapper>\n )}\n </StyledComboBox>\n ),\n [\n bodyMinWidth,\n bodyWidth,\n comboBoxGroups,\n container,\n contentHeight,\n direction,\n handleClear,\n handleClose,\n handleHeaderClick,\n handleInputBlur,\n handleInputFocus,\n inputValue,\n internalSelectedItem,\n isAnimating,\n isDisabled,\n isTouch,\n effectiveMaxHeight,\n minWidth,\n onInputChange,\n placeholderIcon,\n placeholderImageUrl,\n placeholderText,\n prefix,\n prefixMinWidth,\n selectedItem,\n shouldChangeColor,\n shouldDisableActions,\n shouldCaptureEvents,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldShowRoundPlaceholderImage,\n shouldShowTransparentBackground,\n shouldUseFullWidth,\n size,\n ],\n );\n },\n);\n\nComboBox.displayName = 'ComboBox';\n\nexport default ComboBox;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAYA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,aAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAcA,IAAAS,oBAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AAA0D,SAAAM,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB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,EAAC,kBAAkB;IAC5B3J,GAAG,EAAEkB,UAAW;IAChBoE,QAAQ,EAAE;EAAE,GAEXwB,cACe,CACH,CAEb,CACnB,EACD,CACIrG,YAAY,EACZvC,SAAS,EACT4I,cAAc,EACdlI,SAAS,EACTsE,aAAa,EACb/E,SAAS,EACTmG,WAAW,EACXP,WAAW,EACX2C,iBAAiB,EACjB7C,eAAe,EACfJ,gBAAgB,EAChB3D,UAAU,EACVG,oBAAoB,EACpBG,WAAW,EACX9B,UAAU,EACVoD,OAAO,EACPqB,kBAAkB,EAClBzC,QAAQ,EACRZ,aAAa,EACb0G,eAAe,EACfF,mBAAmB,EACnBI,eAAe,EACf3H,MAAM,EACNU,cAAc,EACdP,YAAY,EACZuD,iBAAiB,EACjBE,oBAAoB,EACpB1D,mBAAmB,EACnBI,kBAAkB,EAClBC,mBAAmB,EACnBsH,+BAA+B,EAC/B3G,+BAA+B,EAC/BJ,kBAAkB,EAClBH,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDtB,QAAQ,CAAC4L,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/M,OAAA,GAEnBiB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"ComboBox.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_environment","_AreaContextProvider","_Icon","_interopRequireDefault","_ComboBoxItem","_ComboBox","_DropdownBodyWrapper","_dropdown","_element","_ComboBox2","_ComboBox3","_useKeyboardFocusHighlighting","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ComboBox","forwardRef","bodyWidth","direction","DropdownDirection","RIGHT","isDisabled","lists","maxHeight","onSelect","placeholder","prefix","container","shouldCaptureEvents","selectedItem","onHide","onShow","shouldShowBigImage","shouldShowClearIcon","shouldShowRoundImage","onInputFocus","prefixMinWidth","size","ComboBoxSize","NORMAL","shouldUseFullWidth","onInputChange","shouldUseCurrentItemWidth","onInputBlur","shouldShowTransparentBackground","inputValue","shouldDropDownUseMaxItemWidth","shouldEnableKeyboardHighlighting","ref","internalSelectedItem","setInternalSelectedItem","useState","isAnimating","setIsAnimating","minWidth","setMinWidth","undefined","bodyMinWidth","setBodyMinWidth","focusedIndex","setFocusedIndex","isInputFocused","useRef","styledComboBoxElementRef","comboBoxHeaderRef","comboBoxInputRef","contentRef","parentSize","useElementSize","shouldUseParentElement","functions","useFunctions","values","useValues","isTouch","useIsTouch","areaProvider","useContext","AreaContext","useEffect","calculatedMinWidth","calculatedBodyMinWidth","getComboBoxWidthResult","parentWidth","width","shouldChangeColor","useMemo","shouldShowKeyboardHighlighting","useKeyboardFocusHighlighting","shouldDisableActions","combinedLists","flatMap","list","length","some","item","value","contentHeight","flatItems","height","reduce","isBigItem","subtext","trim","handleInputFocus","useCallback","event","current","handleInputBlur","handleOpen","handleClose","handleContainerBlur","_contentRef$current","nextFocusedElement","relatedTarget","currentContainer","currentTarget","contains","restoreTriggerFocus","requestAnimationFrame","_comboBoxHeaderRef$cu","_comboBoxInputRef$cur","focus","handleSetSelectedItem","itemToSelect","onSelectResult","Promise","then","shouldPreventSelection","handleClear","preventDefault","stopPropagation","handleKeyDown","key","_contentRef$current2","children","stepDirection","newIndex","attempts","newElement","shouldSkip","id","startsWith","endsWith","prevElement","tabIndex","focusedElement","_contentRef$current3","element","newSelectedItem","find","String","replace","document","addEventListener","removeEventListener","placeholderImageUrl","imageUrl","placeholderIcon","icons","placeholderText","text","shouldShowRoundPlaceholderImage","selectedItemList","handleHeaderClick","handleHeaderKeyDown","useImperativeHandle","hide","show","comboBoxGroups","map","createElement","Fragment","groupName","StyledComboBoxTopic","isSelected","StyledComboBox","$minWidth","$shouldUseFullWidth","onBlur","StyledComboBoxHeader","$direction","onClick","$isOpen","$isTouch","$size","$shouldShowTransparentBackground","$isDisabled","$shouldChangeColor","$shouldShowBigImage","$shouldShowKeyboardHighlighting","onKeyDown","role","StyledComboBoxPrefixAndPlaceholderWrapper","StyledComboBoxPrefix","$prefixMinWidth","StyledComboBoxPlaceholder","$shouldReduceOpacity","StyledComboBoxPlaceholderImage","src","$shouldShowRoundImage","StyledComboBoxInput","disabled","onChange","onFocus","StyledComboBoxPlaceholderText","suffixElement","StyledComboBoxClearIconWrapper","StyledComboBoxIconWrapper","$shouldShowBorderLeft","anchorElement","onClose","shouldShowDropdown","minBodyWidth","StyledComboBoxBody","$maxHeight","className","displayName","_default","exports"],"sources":["../../../../src/components/combobox/ComboBox.tsx"],"sourcesContent":["import { useFunctions, useValues } from 'chayns-api';\nimport React, {\n FocusEventHandler,\n KeyboardEventHandler,\n forwardRef,\n Fragment,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useIsTouch } from '../../utils/environment';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport Icon from '../icon/Icon';\nimport ComboBoxItem from './combobox-item/ComboBoxItem';\nimport {\n StyledComboBox,\n StyledComboBoxBody,\n StyledComboBoxClearIconWrapper,\n StyledComboBoxHeader,\n StyledComboBoxIconWrapper,\n StyledComboBoxInput,\n StyledComboBoxPlaceholder,\n StyledComboBoxPlaceholderImage,\n StyledComboBoxPlaceholderText,\n StyledComboBoxPrefix,\n StyledComboBoxPrefixAndPlaceholderWrapper,\n StyledComboBoxTopic,\n} from './ComboBox.styles';\nimport DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';\nimport { DropdownDirection } from '../../types/dropdown';\nimport { useElementSize } from '../../hooks/element';\nimport { ComboBoxProps, ComboBoxRef, ComboBoxSize, IComboBoxItem } from './ComboBox.types';\nimport { getComboBoxWidthResult } from './ComboBox.utils';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\n\nconst ComboBox = forwardRef<ComboBoxRef, ComboBoxProps>(\n (\n {\n bodyWidth,\n direction = DropdownDirection.RIGHT,\n isDisabled = false,\n lists,\n maxHeight = 280,\n onSelect,\n placeholder,\n prefix,\n container,\n shouldCaptureEvents,\n selectedItem,\n onHide,\n onShow,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldShowRoundImage,\n onInputFocus,\n prefixMinWidth,\n size = ComboBoxSize.NORMAL,\n shouldUseFullWidth = false,\n onInputChange,\n shouldUseCurrentItemWidth = false,\n onInputBlur,\n shouldShowTransparentBackground = false,\n inputValue,\n shouldDropDownUseMaxItemWidth = false,\n shouldEnableKeyboardHighlighting,\n },\n ref,\n ) => {\n const [internalSelectedItem, setInternalSelectedItem] = useState<IComboBoxItem>();\n const [isAnimating, setIsAnimating] = useState(false);\n const [minWidth, setMinWidth] = useState<number | undefined>(undefined);\n const [bodyMinWidth, setBodyMinWidth] = useState(0);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n\n const isInputFocused = useRef(false);\n const styledComboBoxElementRef = useRef<HTMLDivElement>(null);\n const comboBoxHeaderRef = useRef<HTMLDivElement>(null);\n const comboBoxInputRef = useRef<HTMLInputElement>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const parentSize = useElementSize(styledComboBoxElementRef, {\n shouldUseParentElement: true,\n });\n\n const functions = useFunctions();\n const values = useValues();\n const isTouch = useIsTouch();\n const areaProvider = useContext(AreaContext);\n\n useEffect(() => {\n if (!parentSize) {\n return;\n }\n\n const { minWidth: calculatedMinWidth, bodyMinWidth: calculatedBodyMinWidth } =\n getComboBoxWidthResult({\n functions,\n internalSelectedItem,\n lists,\n parentWidth: parentSize.width,\n placeholder,\n prefix,\n prefixMinWidth,\n selectedItem,\n shouldDropDownUseMaxItemWidth,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldUseCurrentItemWidth,\n shouldUseFullWidth,\n values,\n });\n\n setMinWidth(calculatedMinWidth);\n setBodyMinWidth(calculatedBodyMinWidth);\n }, [\n functions,\n internalSelectedItem,\n lists,\n parentSize,\n placeholder,\n prefix,\n prefixMinWidth,\n selectedItem,\n shouldDropDownUseMaxItemWidth,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldUseCurrentItemWidth,\n shouldUseFullWidth,\n values,\n ]);\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !isDisabled,\n );\n\n const shouldDisableActions = useMemo(() => {\n if (!selectedItem) {\n return false;\n }\n\n const combinedLists = lists.flatMap((list) => list.list);\n\n return (\n combinedLists.length === 1 &&\n combinedLists.some((item) => item.value === selectedItem.value)\n );\n }, [lists, selectedItem]);\n\n const contentHeight = useMemo(() => {\n const flatItems = lists.flatMap((list) => list.list);\n\n let height = flatItems.reduce((value, item) => {\n const isBigItem =\n shouldShowBigImage ||\n (typeof item.subtext === 'string' && item.subtext.trim() !== '');\n\n return value + (isBigItem ? 56 : 38);\n }, 0);\n\n if (lists.length > 1) {\n height += lists.length * 38;\n }\n\n if (maxHeight < height) {\n height = maxHeight;\n }\n\n return height;\n }, [lists, maxHeight, shouldShowBigImage]);\n\n const handleInputFocus: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = true;\n onInputFocus?.(event);\n },\n [onInputFocus],\n );\n\n const handleInputBlur: FocusEventHandler<HTMLInputElement> = useCallback(\n (event) => {\n isInputFocused.current = false;\n onInputBlur?.(event);\n },\n [onInputBlur],\n );\n\n const handleOpen = useCallback(() => {\n if (typeof onShow === 'function') {\n onShow();\n }\n\n setIsAnimating(true);\n }, [onShow]);\n\n const handleClose = useCallback(() => {\n if (typeof onHide === 'function') {\n onHide();\n }\n\n setIsAnimating(false);\n }, [onHide]);\n\n const handleContainerBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n const nextFocusedElement = event.relatedTarget as Node | null;\n const currentContainer = event.currentTarget as HTMLElement;\n\n if (\n !nextFocusedElement ||\n (!currentContainer.contains(nextFocusedElement) &&\n !contentRef.current?.contains(nextFocusedElement))\n ) {\n handleClose();\n }\n },\n [handleClose],\n );\n\n const restoreTriggerFocus = useCallback(() => {\n // Delay is needed so focus happens after dropdown close/render cycle.\n requestAnimationFrame(() => {\n if (typeof inputValue === 'string') {\n comboBoxInputRef.current?.focus();\n return;\n }\n\n comboBoxHeaderRef.current?.focus();\n });\n }, [inputValue]);\n\n /**\n * This function sets the selected item\n */\n const handleSetSelectedItem = useCallback(\n (itemToSelect?: IComboBoxItem) => {\n if (typeof onSelect === 'function') {\n const onSelectResult = onSelect(itemToSelect);\n\n if (onSelectResult === false) {\n return;\n }\n\n if (onSelectResult instanceof Promise) {\n void onSelectResult.then((shouldPreventSelection) => {\n if (shouldPreventSelection) return;\n\n setInternalSelectedItem(itemToSelect);\n handleClose();\n restoreTriggerFocus();\n });\n\n return;\n }\n }\n\n setInternalSelectedItem(itemToSelect);\n handleClose();\n restoreTriggerFocus();\n },\n [handleClose, onSelect, restoreTriggerFocus],\n );\n\n const handleClear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n handleSetSelectedItem(undefined);\n },\n [handleSetSelectedItem],\n );\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!isAnimating) return;\n\n if (e.key === 'Escape') {\n e.preventDefault();\n handleClose();\n restoreTriggerFocus();\n return;\n }\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n\n const children = contentRef.current?.children;\n\n if (!children || children.length === 0) return;\n\n const stepDirection = e.key === 'ArrowUp' ? -1 : 1;\n\n let newIndex = focusedIndex ?? -1;\n\n let attempts = 0;\n\n do {\n newIndex = (newIndex + stepDirection + children.length) % children.length;\n\n const newElement = children[newIndex] as HTMLDivElement;\n\n let shouldSkip = false;\n\n if (\n newElement.id.startsWith('combobox-group--') ||\n newElement.id.endsWith('--disabled-item')\n ) {\n shouldSkip = true;\n }\n\n if (!shouldSkip) break;\n\n attempts++;\n } while (attempts < children.length);\n\n if (focusedIndex !== null) {\n const prevElement = children[focusedIndex] as HTMLDivElement;\n\n prevElement.tabIndex = -1;\n }\n\n setFocusedIndex(newIndex);\n\n const focusedElement = children[newIndex] as HTMLDivElement;\n\n focusedElement.tabIndex = 0;\n focusedElement.focus();\n } else if (e.key === 'Enter' && focusedIndex !== null) {\n const element = contentRef.current?.children[focusedIndex];\n\n if (!element) return;\n\n const { id } = element;\n\n let newSelectedItem: IComboBoxItem | undefined;\n\n lists.some((list) => {\n newSelectedItem = list.list.find(\n ({ value }) => String(value) === id.replace('combobox-item__', ''),\n );\n\n return !!newSelectedItem;\n });\n\n if (newSelectedItem) {\n handleSetSelectedItem(newSelectedItem);\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [\n focusedIndex,\n handleClose,\n handleSetSelectedItem,\n isAnimating,\n lists,\n restoreTriggerFocus,\n ]);\n\n /**\n * This function sets the external selected item\n */\n useEffect(() => {\n setIsAnimating(false);\n setInternalSelectedItem(selectedItem);\n }, [selectedItem]);\n\n const placeholderImageUrl = useMemo(() => {\n if (selectedItem) {\n return selectedItem.imageUrl;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.imageUrl;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n const placeholderIcon = useMemo(() => {\n if (selectedItem) {\n return selectedItem.icons;\n }\n\n if (internalSelectedItem) {\n return internalSelectedItem.icons;\n }\n\n return undefined;\n }, [internalSelectedItem, selectedItem]);\n\n /**\n * This function resets the placeholder\n */\n const placeholderText = useMemo(() => {\n let text = placeholder;\n\n if (selectedItem) {\n text = selectedItem.text;\n } else if (internalSelectedItem) {\n text = internalSelectedItem.text;\n }\n\n return text;\n }, [internalSelectedItem, placeholder, selectedItem]);\n\n const shouldShowRoundPlaceholderImage = useMemo(() => {\n const selectedItemList = lists.find((list) =>\n list.list.some(\n ({ value }) => value === (selectedItem?.value ?? internalSelectedItem?.value),\n ),\n );\n\n return selectedItemList?.shouldShowRoundImage ?? shouldShowRoundImage;\n }, [internalSelectedItem?.value, lists, selectedItem?.value, shouldShowRoundImage]);\n\n /**\n * This function opens the content of the combobox\n */\n const handleHeaderClick = useCallback(() => {\n if (!isDisabled && !isInputFocused.current) {\n if (isAnimating) {\n handleClose();\n } else {\n handleOpen();\n }\n }\n }, [handleClose, handleOpen, isAnimating, isDisabled]);\n\n const handleHeaderKeyDown: KeyboardEventHandler<HTMLDivElement> = useCallback(\n (event) => {\n if (isDisabled || typeof inputValue === 'string') {\n return;\n }\n\n if (event.key === 'Escape' && isAnimating) {\n event.preventDefault();\n handleClose();\n restoreTriggerFocus();\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleHeaderClick();\n }\n },\n [\n handleClose,\n handleHeaderClick,\n inputValue,\n isAnimating,\n isDisabled,\n restoreTriggerFocus,\n ],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleClose,\n show: handleOpen,\n }),\n [handleClose, handleOpen],\n );\n\n const comboBoxGroups = useMemo(\n () =>\n lists.map((list) => (\n <Fragment key={list.groupName ?? 'default-group'}>\n {list.groupName && lists.length > 1 && (\n <StyledComboBoxTopic id={`combobox-group--${list.groupName}`}>\n {list.groupName}\n </StyledComboBoxTopic>\n )}\n {list.list.map((item) => (\n <ComboBoxItem\n key={`item-${item.text}`}\n item={item}\n isSelected={\n selectedItem ? item.value === selectedItem.value : false\n }\n onSelect={handleSetSelectedItem}\n shouldShowBigImage={shouldShowBigImage}\n shouldShowRoundImage={\n list.shouldShowRoundImage ?? shouldShowRoundImage\n }\n />\n ))}\n </Fragment>\n )),\n [handleSetSelectedItem, lists, selectedItem, shouldShowBigImage, shouldShowRoundImage],\n );\n\n return useMemo(\n () => (\n <StyledComboBox\n ref={styledComboBoxElementRef}\n $minWidth={minWidth}\n $shouldUseFullWidth={shouldUseFullWidth}\n onBlur={handleContainerBlur}\n >\n <StyledComboBoxHeader\n ref={comboBoxHeaderRef}\n $direction={direction}\n onClick={handleHeaderClick}\n $isOpen={isAnimating}\n $isTouch={isTouch}\n $size={size}\n $shouldShowTransparentBackground={shouldShowTransparentBackground}\n $isDisabled={isDisabled}\n $shouldChangeColor={shouldChangeColor}\n $shouldShowBigImage={shouldShowBigImage}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n onKeyDown={handleHeaderKeyDown}\n tabIndex={!isDisabled && typeof inputValue !== 'string' ? 0 : undefined}\n role={!isDisabled && typeof inputValue !== 'string' ? 'button' : undefined}\n aria-expanded={\n !isDisabled && typeof inputValue !== 'string' ? isAnimating : undefined\n }\n >\n <StyledComboBoxPrefixAndPlaceholderWrapper>\n {prefix && (\n <StyledComboBoxPrefix $prefixMinWidth={prefixMinWidth}>\n {prefix}\n </StyledComboBoxPrefix>\n )}\n <StyledComboBoxPlaceholder\n $shouldReduceOpacity={!selectedItem && !internalSelectedItem}\n >\n {placeholderImageUrl && (\n <StyledComboBoxPlaceholderImage\n src={placeholderImageUrl}\n $shouldShowBigImage={shouldShowBigImage}\n $shouldShowRoundImage={shouldShowRoundPlaceholderImage}\n />\n )}\n {placeholderIcon && <Icon icons={placeholderIcon} />}\n {typeof inputValue === 'string' ? (\n <StyledComboBoxInput\n ref={comboBoxInputRef}\n disabled={isDisabled}\n value={inputValue}\n onChange={onInputChange}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n placeholder={placeholderText}\n />\n ) : (\n <StyledComboBoxPlaceholderText>\n {placeholderText}\n </StyledComboBoxPlaceholderText>\n )}\n {internalSelectedItem &&\n internalSelectedItem.suffixElement &&\n internalSelectedItem.suffixElement}\n </StyledComboBoxPlaceholder>\n </StyledComboBoxPrefixAndPlaceholderWrapper>\n {shouldShowClearIcon && internalSelectedItem && (\n <StyledComboBoxClearIconWrapper\n $isDisabled={isDisabled}\n onClick={handleClear}\n >\n <Icon icons={['fa fa-times']} />\n </StyledComboBoxClearIconWrapper>\n )}\n {!shouldDisableActions && (\n <StyledComboBoxIconWrapper\n $isDisabled={isDisabled}\n $size={size}\n $shouldShowBorderLeft={\n shouldShowClearIcon === true &&\n internalSelectedItem !== undefined\n }\n >\n <Icon icons={['fa fa-chevron-down']} isDisabled={isDisabled} />\n </StyledComboBoxIconWrapper>\n )}\n </StyledComboBoxHeader>\n {styledComboBoxElementRef.current && (\n <DropdownBodyWrapper\n anchorElement={styledComboBoxElementRef.current}\n bodyWidth={bodyWidth}\n contentHeight={contentHeight}\n shouldCaptureEvents={shouldCaptureEvents}\n onClose={handleClose}\n direction={direction}\n container={container}\n shouldShowDropdown={isAnimating}\n minBodyWidth={bodyWidth ?? bodyMinWidth}\n >\n <StyledComboBoxBody\n $maxHeight={maxHeight}\n $minWidth={bodyWidth ?? bodyMinWidth}\n className=\"chayns-scrollbar\"\n ref={contentRef}\n tabIndex={0}\n >\n {comboBoxGroups}\n </StyledComboBoxBody>\n </DropdownBodyWrapper>\n )}\n </StyledComboBox>\n ),\n [\n bodyMinWidth,\n bodyWidth,\n comboBoxGroups,\n container,\n contentHeight,\n direction,\n handleClear,\n handleClose,\n handleHeaderClick,\n handleHeaderKeyDown,\n handleInputBlur,\n handleInputFocus,\n inputValue,\n internalSelectedItem,\n isAnimating,\n isDisabled,\n isTouch,\n maxHeight,\n minWidth,\n onInputChange,\n placeholderIcon,\n placeholderImageUrl,\n placeholderText,\n prefix,\n prefixMinWidth,\n selectedItem,\n shouldChangeColor,\n shouldDisableActions,\n shouldCaptureEvents,\n shouldShowKeyboardHighlighting,\n shouldShowBigImage,\n shouldShowClearIcon,\n shouldShowRoundPlaceholderImage,\n shouldShowTransparentBackground,\n shouldUseFullWidth,\n size,\n ],\n );\n },\n);\n\nComboBox.displayName = 'ComboBox';\n\nexport default ComboBox;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAaA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAA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AiO,kBAAkB;IACfC,UAAU,EAAEhM,SAAU;IACtB0J,SAAS,EAAEhK,SAAS,IAAIwC,YAAa;IACrC+J,SAAS,EAAC,kBAAkB;IAC5BxK,GAAG,EAAEkB,UAAW;IAChB+E,QAAQ,EAAE;EAAE,GAEXwB,cACe,CACH,CAEb,CACnB,EACD,CACIhH,YAAY,EACZxC,SAAS,EACTwJ,cAAc,EACd9I,SAAS,EACTsE,aAAa,EACb/E,SAAS,EACT+G,WAAW,EACXnB,WAAW,EACXsD,iBAAiB,EACjBC,mBAAmB,EACnBzD,eAAe,EACfJ,gBAAgB,EAChB3D,UAAU,EACVI,oBAAoB,EACpBG,WAAW,EACX/B,UAAU,EACVqD,OAAO,EACPnD,SAAS,EACT+B,QAAQ,EACRb,aAAa,EACbqH,eAAe,EACfF,mBAAmB,EACnBI,eAAe,EACftI,MAAM,EACNU,cAAc,EACdP,YAAY,EACZwD,iBAAiB,EACjBI,oBAAoB,EACpB7D,mBAAmB,EACnB2D,8BAA8B,EAC9BvD,kBAAkB,EAClBC,mBAAmB,EACnBiI,+BAA+B,EAC/BtH,+BAA+B,EAC/BJ,kBAAkB,EAClBH,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDtB,QAAQ,CAAC0M,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7N,OAAA,GAEnBiB,QAAQ","ignoreList":[]}
@@ -7,6 +7,7 @@ exports.StyledComboBoxTopic = exports.StyledComboBoxPrefixAndPlaceholderWrapper
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
8
  var _dropdown = require("../../types/dropdown");
9
9
  var _ComboBox = require("./ComboBox.types");
10
+ var _keyboardFocusHighlighting = require("../../utils/keyboardFocusHighlighting.styles");
10
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
12
  const StyledComboBox = exports.StyledComboBox = _styledComponents.default.div`
12
13
  min-width: 0;
@@ -122,6 +123,16 @@ const StyledComboBoxHeader = exports.StyledComboBoxHeader = _styledComponents.de
122
123
  background-color: ${theme['secondary-102']};
123
124
  }
124
125
  `}
126
+
127
+ ${({
128
+ $shouldShowKeyboardHighlighting
129
+ }) => $shouldShowKeyboardHighlighting && (0, _styledComponents.css)`
130
+ &:focus-visible,
131
+ &:focus-within {
132
+ transition: none;
133
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingRingCss}
134
+ }
135
+ `}
125
136
  `;
126
137
  const StyledComboBoxPlaceholder = exports.StyledComboBoxPlaceholder = _styledComponents.default.div`
127
138
  align-items: center;
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_dropdown","_ComboBox","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledComboBox","exports","styled","div","$shouldUseFullWidth","$minWidth","css","StyledComboBoxHeader","$isDisabled","$size","ComboBoxSize","SMALL","NORMAL","theme","$shouldShowTransparentBackground","$shouldChangeColor","colorMode","$shouldShowBigImage","$isOpen","$direction","DropdownDirection","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","includes","$isTouch","StyledComboBoxPlaceholder","text","$shouldReduceOpacity","StyledComboBoxPlaceholderText","StyledComboBoxPrefixAndPlaceholderWrapper","StyledComboBoxPrefix","$prefixMinWidth","StyledComboBoxInput","input","StyledComboBoxPlaceholderImage","img","$shouldShowRoundImage","StyledComboBoxClearIconWrapper","StyledComboBoxIconWrapper","$shouldShowBorderLeft","StyledComboBoxBody","$maxHeight","StyledComboBoxTopic"],"sources":["../../../../src/components/combobox/ComboBox.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { Theme, WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { DropdownDirection } from '../../types/dropdown';\nimport { ComboBoxProps, ComboBoxSize } from './ComboBox.types';\n\ntype StyledComboBoxProps = WithTheme<{\n $minWidth?: number;\n $shouldUseFullWidth: ComboBoxProps['shouldUseFullWidth'];\n}>;\n\nexport const StyledComboBox = styled.div<StyledComboBoxProps>`\n min-width: 0;\n user-select: none;\n position: relative;\n\n ${({ $shouldUseFullWidth, $minWidth }) => {\n if ($shouldUseFullWidth) {\n return css`\n width: 100%;\n max-width: 100%;\n min-width: ${typeof $minWidth === 'number' ? `${$minWidth}px` : '0'};\n `;\n }\n\n if (typeof $minWidth === 'number') {\n return css`\n width: fit-content;\n max-width: 100%;\n min-width: ${$minWidth}px;\n `;\n }\n\n return css`\n width: fit-content;\n max-width: 100%;\n `;\n }}\n`;\n\ntype StyledComboBoxHeaderProps = WithTheme<{\n $isTouch: boolean;\n $isOpen: boolean;\n $direction: DropdownDirection;\n $isDisabled?: boolean;\n $shouldChangeColor: boolean;\n $shouldShowBigImage: ComboBoxProps['shouldShowBigImage'];\n $shouldShowTransparentBackground: boolean;\n $size: ComboBoxSize;\n}>;\n\nexport const StyledComboBoxHeader = styled.div<StyledComboBoxHeaderProps>`\n display: flex;\n min-width: 0;\n border: 1px solid transparent;\n cursor: ${({ $isDisabled }) => (!$isDisabled ? 'pointer' : 'default')};\n justify-content: space-between;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n transition: background-color 0.2s ease-in-out;\n\n ${({ $size }) => {\n switch ($size) {\n case ComboBoxSize.SMALL:\n return css`\n height: 34px;\n `;\n case ComboBoxSize.NORMAL:\n default:\n return css`\n min-height: 42px;\n `;\n }\n }}\n\n ${({ theme, $shouldShowTransparentBackground, $shouldChangeColor }) => {\n if ($shouldShowTransparentBackground) {\n if (theme.colorMode === 'dark') {\n return css`\n border-color: rgba(255, 255, 255, 0.5);\n background-color: transparent;\n `;\n }\n\n return css`\n border-color: rgba(0, 0, 0, 0.5);\n background-color: transparent;\n `;\n }\n\n return css`\n border-color: rgba(160, 160, 160, 0.3);\n background-color: ${theme.colorMode === 'classic' || $shouldChangeColor\n ? theme['000']\n : theme['100']};\n `;\n }}\n\n ${({ $shouldShowBigImage }) =>\n $shouldShowBigImage &&\n css`\n height: 42px;\n `}\n\n ${({ $isOpen, $direction }) => {\n if ($isOpen) {\n return [\n DropdownDirection.BOTTOM,\n DropdownDirection.BOTTOM_LEFT,\n DropdownDirection.BOTTOM_RIGHT,\n ].includes($direction)\n ? css`\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n `\n : css`\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n `;\n }\n\n return css`\n border-radius: 3px;\n `;\n }}\n\n ${({ $isTouch, $isDisabled, theme }: StyledComboBoxHeaderProps) =>\n !$isTouch &&\n !$isDisabled &&\n css`\n &:hover {\n background-color: ${theme['secondary-102']};\n }\n `}\n`;\n\ntype StyledComboBoxPlaceholderProps = WithTheme<{ $shouldReduceOpacity: boolean }>;\n\nexport const StyledComboBoxPlaceholder = styled.div<StyledComboBoxPlaceholderProps>`\n align-items: center;\n color: ${({ theme }: StyledComboBoxPlaceholderProps) => theme.text};\n display: flex;\n flex: 1 1 auto;\n gap: 10px;\n min-width: 0;\n opacity: ${({ $shouldReduceOpacity }) => ($shouldReduceOpacity ? 0.5 : 1)};\n`;\n\nexport const StyledComboBoxPlaceholderText = styled.div`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledComboBoxPrefixAndPlaceholderWrapper = styled.div`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n padding: 4px 10px;\n`;\n\ntype StyledComboBoxPrefixProps = {\n $prefixMinWidth?: number;\n};\n\nexport const StyledComboBoxPrefix = styled.div<StyledComboBoxPrefixProps>`\n flex: 0 0 auto;\n min-width: ${({ $prefixMinWidth }) => $prefixMinWidth ?? 0}px;\n padding-right: 5px;\n`;\n\nexport const StyledComboBoxInput = styled.input`\n color: ${({ theme }: { theme: Theme }) => theme.text};\n border: none;\n background-color: transparent;\n width: 100%;\n min-width: 0;\n`;\n\ntype StyledComboBoxPlaceholderImageProps = WithTheme<{\n $shouldShowBigImage: ComboBoxProps['shouldShowBigImage'];\n $shouldShowRoundImage: ComboBoxProps['shouldShowRoundImage'];\n}>;\n\nexport const StyledComboBoxPlaceholderImage = styled.img<StyledComboBoxPlaceholderImageProps>`\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledComboBoxPlaceholderImageProps) => theme['009-rgb']}, 0.15);\n height: ${({ $shouldShowBigImage }) => ($shouldShowBigImage ? '32px' : '22px')};\n width: ${({ $shouldShowBigImage }) => ($shouldShowBigImage ? '32px' : '22px')};\n\n ${({ $shouldShowRoundImage }) =>\n $shouldShowRoundImage &&\n css`\n border-radius: 50%;\n `}\n`;\n\ntype StyledComboBoxClearIconWrapperProps = { $isDisabled: boolean };\n\nexport const StyledComboBoxClearIconWrapper = styled.div<StyledComboBoxClearIconWrapperProps>`\n align-items: center;\n cursor: ${({ $isDisabled }) => (!$isDisabled ? 'pointer' : 'default')};\n display: flex;\n flex: 0 0 auto;\n height: 40px;\n justify-content: center;\n width: 40px;\n`;\n\ntype StyledComboBoxIconWrapperProps = {\n $shouldShowBorderLeft: boolean;\n $isDisabled: boolean;\n $size: ComboBoxSize;\n};\n\nexport const StyledComboBoxIconWrapper = styled.div<StyledComboBoxIconWrapperProps>`\n align-items: center;\n border-left: ${({ $shouldShowBorderLeft }) =>\n $shouldShowBorderLeft ? '1px solid rgba(160, 160, 160, 0.3)' : 'none'};\n cursor: ${({ $isDisabled }) => (!$isDisabled ? 'pointer' : 'default')};\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n width: 40px;\n\n ${({ $size }) => {\n switch ($size) {\n case ComboBoxSize.SMALL:\n return css`\n height: 30px;\n `;\n case ComboBoxSize.NORMAL:\n default:\n return css`\n height: 40px;\n `;\n }\n }}\n`;\n\ntype StyledComboBoxBodyProps = WithTheme<{\n $maxHeight: number;\n $minWidth: number;\n}>;\n\nexport const StyledComboBoxBody = styled.div<StyledComboBoxBodyProps>`\n display: flex;\n flex-direction: column;\n cursor: pointer;\n min-width: ${({ $minWidth }) => $minWidth}px;\n\n overflow-x: hidden;\n overflow-y: auto;\n\n max-height: ${({ $maxHeight }) => $maxHeight}px;\n`;\n\ntype StyledComboBoxTopicProps = WithTheme<unknown>;\n\nexport const StyledComboBoxTopic = styled.div`\n align-items: center;\n background-color: ${({ theme }: StyledComboBoxTopicProps) => theme['secondary-102']};\n color: rgba(${({ theme }: StyledComboBoxTopicProps) => theme['text-rgb']}, 0.65);\n cursor: default;\n display: flex;\n flex: 0 0 auto;\n font-weight: bold;\n min-height: 38px;\n line-height: normal;\n padding: 8px 10px;\n position: sticky;\n top: 0;\n z-index: 10;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAA+D,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAA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,GAAG;AAC7C;AACA,wBAAwB,CAAC;EAAEU;AAAgC,CAAC,KAAKA,KAAK,CAAC,eAAe,CAAC;AACvF,kBAAkB,CAAC;EAAEA;AAAgC,CAAC,KAAKA,KAAK,CAAC,UAAU,CAAC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ComboBox.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_dropdown","_ComboBox","_keyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledComboBox","exports","styled","div","$shouldUseFullWidth","$minWidth","css","StyledComboBoxHeader","$isDisabled","$size","ComboBoxSize","SMALL","NORMAL","theme","$shouldShowTransparentBackground","$shouldChangeColor","colorMode","$shouldShowBigImage","$isOpen","$direction","DropdownDirection","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","includes","$isTouch","$shouldShowKeyboardHighlighting","keyboardFocusHighlightingRingCss","StyledComboBoxPlaceholder","text","$shouldReduceOpacity","StyledComboBoxPlaceholderText","StyledComboBoxPrefixAndPlaceholderWrapper","StyledComboBoxPrefix","$prefixMinWidth","StyledComboBoxInput","input","StyledComboBoxPlaceholderImage","img","$shouldShowRoundImage","StyledComboBoxClearIconWrapper","StyledComboBoxIconWrapper","$shouldShowBorderLeft","StyledComboBoxBody","$maxHeight","StyledComboBoxTopic"],"sources":["../../../../src/components/combobox/ComboBox.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { Theme, WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { DropdownDirection } from '../../types/dropdown';\nimport { ComboBoxProps, ComboBoxSize } from './ComboBox.types';\nimport { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledComboBoxProps = WithTheme<{\n $minWidth?: number;\n $shouldUseFullWidth: ComboBoxProps['shouldUseFullWidth'];\n}>;\n\nexport const StyledComboBox = styled.div<StyledComboBoxProps>`\n min-width: 0;\n user-select: none;\n position: relative;\n\n ${({ $shouldUseFullWidth, $minWidth }) => {\n if ($shouldUseFullWidth) {\n return css`\n width: 100%;\n max-width: 100%;\n min-width: ${typeof $minWidth === 'number' ? `${$minWidth}px` : '0'};\n `;\n }\n\n if (typeof $minWidth === 'number') {\n return css`\n width: fit-content;\n max-width: 100%;\n min-width: ${$minWidth}px;\n `;\n }\n\n return css`\n width: fit-content;\n max-width: 100%;\n `;\n }}\n`;\n\ntype StyledComboBoxHeaderProps = WithTheme<{\n $isTouch: boolean;\n $isOpen: boolean;\n $direction: DropdownDirection;\n $isDisabled?: boolean;\n $shouldChangeColor: boolean;\n $shouldShowBigImage: ComboBoxProps['shouldShowBigImage'];\n $shouldShowTransparentBackground: boolean;\n $size: ComboBoxSize;\n $shouldShowKeyboardHighlighting: boolean;\n}>;\n\nexport const StyledComboBoxHeader = styled.div<StyledComboBoxHeaderProps>`\n display: flex;\n min-width: 0;\n border: 1px solid transparent;\n cursor: ${({ $isDisabled }) => (!$isDisabled ? 'pointer' : 'default')};\n justify-content: space-between;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n transition: background-color 0.2s ease-in-out;\n\n ${({ $size }) => {\n switch ($size) {\n case ComboBoxSize.SMALL:\n return css`\n height: 34px;\n `;\n case ComboBoxSize.NORMAL:\n default:\n return css`\n min-height: 42px;\n `;\n }\n }}\n\n ${({ theme, $shouldShowTransparentBackground, $shouldChangeColor }) => {\n if ($shouldShowTransparentBackground) {\n if (theme.colorMode === 'dark') {\n return css`\n border-color: rgba(255, 255, 255, 0.5);\n background-color: transparent;\n `;\n }\n\n return css`\n border-color: rgba(0, 0, 0, 0.5);\n background-color: transparent;\n `;\n }\n\n return css`\n border-color: rgba(160, 160, 160, 0.3);\n background-color: ${theme.colorMode === 'classic' || $shouldChangeColor\n ? theme['000']\n : theme['100']};\n `;\n }}\n\n ${({ $shouldShowBigImage }) =>\n $shouldShowBigImage &&\n css`\n height: 42px;\n `}\n\n ${({ $isOpen, $direction }) => {\n if ($isOpen) {\n return [\n DropdownDirection.BOTTOM,\n DropdownDirection.BOTTOM_LEFT,\n DropdownDirection.BOTTOM_RIGHT,\n ].includes($direction)\n ? css`\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n `\n : css`\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n `;\n }\n\n return css`\n border-radius: 3px;\n `;\n }}\n\n ${({ $isTouch, $isDisabled, theme }: StyledComboBoxHeaderProps) =>\n !$isTouch &&\n !$isDisabled &&\n css`\n &:hover {\n background-color: ${theme['secondary-102']};\n }\n `}\n\n ${({ $shouldShowKeyboardHighlighting }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-visible,\n &:focus-within {\n transition: none;\n ${keyboardFocusHighlightingRingCss}\n }\n `}\n`;\n\ntype StyledComboBoxPlaceholderProps = WithTheme<{ $shouldReduceOpacity: boolean }>;\n\nexport const StyledComboBoxPlaceholder = styled.div<StyledComboBoxPlaceholderProps>`\n align-items: center;\n color: ${({ theme }: StyledComboBoxPlaceholderProps) => theme.text};\n display: flex;\n flex: 1 1 auto;\n gap: 10px;\n min-width: 0;\n opacity: ${({ $shouldReduceOpacity }) => ($shouldReduceOpacity ? 0.5 : 1)};\n`;\n\nexport const StyledComboBoxPlaceholderText = styled.div`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledComboBoxPrefixAndPlaceholderWrapper = styled.div`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n padding: 4px 10px;\n`;\n\ntype StyledComboBoxPrefixProps = {\n $prefixMinWidth?: number;\n};\n\nexport const StyledComboBoxPrefix = styled.div<StyledComboBoxPrefixProps>`\n flex: 0 0 auto;\n min-width: ${({ $prefixMinWidth }) => $prefixMinWidth ?? 0}px;\n padding-right: 5px;\n`;\n\nexport const StyledComboBoxInput = styled.input`\n color: ${({ theme }: { theme: Theme }) => theme.text};\n border: none;\n background-color: transparent;\n width: 100%;\n min-width: 0;\n`;\n\ntype StyledComboBoxPlaceholderImageProps = WithTheme<{\n $shouldShowBigImage: ComboBoxProps['shouldShowBigImage'];\n $shouldShowRoundImage: ComboBoxProps['shouldShowRoundImage'];\n}>;\n\nexport const StyledComboBoxPlaceholderImage = styled.img<StyledComboBoxPlaceholderImageProps>`\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledComboBoxPlaceholderImageProps) => theme['009-rgb']}, 0.15);\n height: ${({ $shouldShowBigImage }) => ($shouldShowBigImage ? '32px' : '22px')};\n width: ${({ $shouldShowBigImage }) => ($shouldShowBigImage ? '32px' : '22px')};\n\n ${({ $shouldShowRoundImage }) =>\n $shouldShowRoundImage &&\n css`\n border-radius: 50%;\n `}\n`;\n\ntype StyledComboBoxClearIconWrapperProps = { $isDisabled: boolean };\n\nexport const StyledComboBoxClearIconWrapper = styled.div<StyledComboBoxClearIconWrapperProps>`\n align-items: center;\n cursor: ${({ $isDisabled }) => (!$isDisabled ? 'pointer' : 'default')};\n display: flex;\n flex: 0 0 auto;\n height: 40px;\n justify-content: center;\n width: 40px;\n`;\n\ntype StyledComboBoxIconWrapperProps = {\n $shouldShowBorderLeft: boolean;\n $isDisabled: boolean;\n $size: ComboBoxSize;\n};\n\nexport const StyledComboBoxIconWrapper = styled.div<StyledComboBoxIconWrapperProps>`\n align-items: center;\n border-left: ${({ $shouldShowBorderLeft }) =>\n $shouldShowBorderLeft ? '1px solid rgba(160, 160, 160, 0.3)' : 'none'};\n cursor: ${({ $isDisabled }) => (!$isDisabled ? 'pointer' : 'default')};\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n width: 40px;\n\n ${({ $size }) => {\n switch ($size) {\n case ComboBoxSize.SMALL:\n return css`\n height: 30px;\n `;\n case ComboBoxSize.NORMAL:\n default:\n return css`\n height: 40px;\n `;\n }\n }}\n`;\n\ntype StyledComboBoxBodyProps = WithTheme<{\n $maxHeight: number;\n $minWidth: number;\n}>;\n\nexport const StyledComboBoxBody = styled.div<StyledComboBoxBodyProps>`\n display: flex;\n flex-direction: column;\n cursor: pointer;\n min-width: ${({ $minWidth }) => $minWidth}px;\n\n overflow-x: hidden;\n overflow-y: auto;\n\n max-height: ${({ $maxHeight }) => $maxHeight}px;\n`;\n\ntype StyledComboBoxTopicProps = WithTheme<unknown>;\n\nexport const StyledComboBoxTopic = styled.div`\n align-items: center;\n background-color: ${({ theme }: StyledComboBoxTopicProps) => theme['secondary-102']};\n color: rgba(${({ theme }: StyledComboBoxTopicProps) => theme['text-rgb']}, 0.65);\n cursor: default;\n display: flex;\n flex: 0 0 auto;\n font-weight: bold;\n min-height: 38px;\n line-height: normal;\n padding: 8px 10px;\n position: sticky;\n top: 0;\n z-index: 10;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAH,OAAA;AAAgG,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,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GAAG;AAC7C;AACA,wBAAwB,CAAC;EAAEU;AAAgC,CAAC,KAAKA,KAAK,CAAC,eAAe,CAAC;AACvF,kBAAkB,CAAC;EAAEA;AAAgC,CAAC,KAAKA,KAAK,CAAC,UAAU,CAAC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.types.js","names":["ComboBoxSize","exports"],"sources":["../../../../src/components/combobox/ComboBox.types.ts"],"sourcesContent":["import { ChangeEventHandler, CSSProperties, FocusEventHandler, ReactHTML, ReactNode } from 'react';\nimport { CSSPropertiesWithVars } from 'styled-components/dist/types';\nimport { DropdownDirection } from '../../types/dropdown';\n\n/**\n * Ref interface for the `ComboBox` component.\n */\nexport interface ComboBoxRef {\n /**\n * Hides the dropdown content.\n */\n hide: VoidFunction;\n /**\n * Shows the dropdown content.\n */\n show: VoidFunction;\n}\n\n/**\n * A grouped list definition used by the `ComboBox` component.\n */\nexport interface IComboBoxItems {\n /**\n * Optional group label shown above the list.\n */\n groupName?: string;\n /**\n * The items that should be rendered inside the group.\n */\n list: Array<IComboBoxItem>;\n /**\n * Whether the items in this group should use round images.\n */\n shouldShowRoundImage?: boolean;\n}\n\n/**\n * Optional text styling configuration for a combobox item.\n */\nexport interface ComboBoxTextStyles {\n /**\n * The HTML tag that should be used for the text wrapper.\n */\n tagName?: keyof ReactHTML;\n /**\n * Additional inline styles applied to the text wrapper.\n */\n styles?: CSSPropertiesWithVars;\n /**\n * Additional class name applied to the text wrapper.\n */\n className?: string;\n}\n\n/**\n * Single selectable item configuration for the `ComboBox` component.\n */\nexport interface IComboBoxItem {\n /**\n * Optional icon classes rendered before the text.\n */\n icons?: string[];\n /**\n * Optional background style used for the image placeholder.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Optional image URL rendered for the item.\n */\n imageUrl?: string;\n /**\n * Whether the item should be disabled.\n */\n isDisabled?: boolean;\n /**\n * Optional element rendered on the right side of the item.\n */\n rightElement?: ReactNode;\n /**\n * Optional secondary text rendered below the main text.\n */\n subtext?: string;\n /**\n * Optional suffix element rendered after the text.\n */\n suffixElement?: ReactNode;\n /**\n * Main label of the item.\n */\n text: string;\n /**\n * Stable item value used for selection and matching.\n */\n value: string | number;\n /**\n * Optional text styling overrides for the item label.\n */\n textStyles?: ComboBoxTextStyles;\n}\n\n/**\n * Available size variants for the `ComboBox` header.\n */\nexport enum ComboBoxSize {\n /**\n * Standard height and spacing.\n */\n NORMAL = 'normal',\n /**\n * Compact height and spacing.\n */\n SMALL = 'small',\n}\n\n/**\n * Props for the `ComboBox` component.\n */\nexport type ComboBoxProps = {\n /**\n * The width of the body.\n * @default undefined\n */\n bodyWidth?: number;\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n * @default undefined\n */\n container?: Element;\n /**\n * The direction in which the combobox should open.\n * @default DropdownDirection.RIGHT\n */\n direction?: DropdownDirection;\n /**\n * The value of the optional input.\n * @default undefined\n */\n inputValue?: string;\n /**\n * Whether the combobox should be disabled.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * The list of the items that should be displayed.\n */\n lists: IComboBoxItems[];\n /**\n * The maximum height of the combobox content.\n * @default 280\n */\n maxHeight?: number;\n /**\n * Function to be executed when the value of the optional input is changed.\n * @default undefined\n */\n onInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input lost its focus.\n * @default undefined\n */\n onInputBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input gets its focus.\n * @default undefined\n */\n onInputFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.\n * @default undefined\n */\n onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;\n /**\n * Function to be executed when the content of the `ComboBox` is shown.\n * @default undefined\n */\n onShow?: () => void;\n /**\n * Function to be executed when the content of the `ComboBox` is hidden.\n * @default undefined\n */\n onHide?: () => void;\n /**\n * A text that should be displayed when no item is selected.\n */\n placeholder: string;\n /**\n * A prefix that should be displayed before the placeholder.\n * @default undefined\n */\n prefix?: string;\n /**\n * An item that should be preselected.\n * @default undefined\n */\n selectedItem?: IComboBoxItem;\n /**\n * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.\n * @default false\n */\n shouldShowBigImage?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the combo box if an item is selected.\n * @default false\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether the background should be transparent.\n * @default false\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n * @default false\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the width of the ComboBox should be the width of the current item.\n * @default false\n */\n shouldUseCurrentItemWidth?: boolean;\n /**\n * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.\n * @default false\n */\n shouldUseFullWidth?: boolean;\n /**\n * If true, the dropdown will use the maximum width of the items.\n * @default false\n */\n shouldDropDownUseMaxItemWidth?: boolean;\n /**\n * Whether the outside events should be captured.\n * @default undefined\n */\n shouldCaptureEvents?: boolean;\n /**\n * The size of the ComboBox.\n * @default ComboBoxSize.NORMAL\n */\n size?: ComboBoxSize;\n /**\n * Optional min width for the prefix element.\n * @default undefined\n */\n prefixMinWidth?: number;\n};\n"],"mappings":";;;;;;AAIA;AACA;AACA;AAYA;AACA;AACA;AAgBA;AACA;AACA;AAgBA;AACA;AACA;AA4CA;AACA;AACA;AAFA,IAGYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EACpB;AACJ;AACA;EAHYA,YAAY;EAKpB;AACJ;AACA;EAPYA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAWxB;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"ComboBox.types.js","names":["ComboBoxSize","exports"],"sources":["../../../../src/components/combobox/ComboBox.types.ts"],"sourcesContent":["import { ChangeEventHandler, CSSProperties, FocusEventHandler, ReactHTML, ReactNode } from 'react';\nimport { CSSPropertiesWithVars } from 'styled-components/dist/types';\nimport { DropdownDirection } from '../../types/dropdown';\n\n/**\n * Ref interface for the `ComboBox` component.\n */\nexport interface ComboBoxRef {\n /**\n * Hides the dropdown content.\n */\n hide: VoidFunction;\n /**\n * Shows the dropdown content.\n */\n show: VoidFunction;\n}\n\n/**\n * A grouped list definition used by the `ComboBox` component.\n */\nexport interface IComboBoxItems {\n /**\n * Optional group label shown above the list.\n */\n groupName?: string;\n /**\n * The items that should be rendered inside the group.\n */\n list: Array<IComboBoxItem>;\n /**\n * Whether the items in this group should use round images.\n */\n shouldShowRoundImage?: boolean;\n}\n\n/**\n * Optional text styling configuration for a combobox item.\n */\nexport interface ComboBoxTextStyles {\n /**\n * The HTML tag that should be used for the text wrapper.\n */\n tagName?: keyof ReactHTML;\n /**\n * Additional inline styles applied to the text wrapper.\n */\n styles?: CSSPropertiesWithVars;\n /**\n * Additional class name applied to the text wrapper.\n */\n className?: string;\n}\n\n/**\n * Single selectable item configuration for the `ComboBox` component.\n */\nexport interface IComboBoxItem {\n /**\n * Optional icon classes rendered before the text.\n */\n icons?: string[];\n /**\n * Optional background style used for the image placeholder.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Optional image URL rendered for the item.\n */\n imageUrl?: string;\n /**\n * Whether the item should be disabled.\n */\n isDisabled?: boolean;\n /**\n * Optional element rendered on the right side of the item.\n */\n rightElement?: ReactNode;\n /**\n * Optional secondary text rendered below the main text.\n */\n subtext?: string;\n /**\n * Optional suffix element rendered after the text.\n */\n suffixElement?: ReactNode;\n /**\n * Main label of the item.\n */\n text: string;\n /**\n * Stable item value used for selection and matching.\n */\n value: string | number;\n /**\n * Optional text styling overrides for the item label.\n */\n textStyles?: ComboBoxTextStyles;\n}\n\n/**\n * Available size variants for the `ComboBox` header.\n */\nexport enum ComboBoxSize {\n /**\n * Standard height and spacing.\n */\n NORMAL = 'normal',\n /**\n * Compact height and spacing.\n */\n SMALL = 'small',\n}\n\n/**\n * Props for the `ComboBox` component.\n */\nexport type ComboBoxProps = {\n /**\n * The width of the body.\n * @default undefined\n */\n bodyWidth?: number;\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n * @default undefined\n */\n container?: Element;\n /**\n * The direction in which the combobox should open.\n * @default DropdownDirection.RIGHT\n */\n direction?: DropdownDirection;\n /**\n * The value of the optional input.\n * @default undefined\n */\n inputValue?: string;\n /**\n * Whether the combobox should be disabled.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * The list of the items that should be displayed.\n */\n lists: IComboBoxItems[];\n /**\n * The maximum height of the combobox content.\n * @default 280\n */\n maxHeight?: number;\n /**\n * Function to be executed when the value of the optional input is changed.\n * @default undefined\n */\n onInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input lost its focus.\n * @default undefined\n */\n onInputBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input gets its focus.\n * @default undefined\n */\n onInputFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.\n * @default undefined\n */\n onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;\n /**\n * Function to be executed when the content of the `ComboBox` is shown.\n * @default undefined\n */\n onShow?: () => void;\n /**\n * Function to be executed when the content of the `ComboBox` is hidden.\n * @default undefined\n */\n onHide?: () => void;\n /**\n * A text that should be displayed when no item is selected.\n */\n placeholder: string;\n /**\n * A prefix that should be displayed before the placeholder.\n * @default undefined\n */\n prefix?: string;\n /**\n * An item that should be preselected.\n * @default undefined\n */\n selectedItem?: IComboBoxItem;\n /**\n * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.\n * @default false\n */\n shouldShowBigImage?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the combo box if an item is selected.\n * @default false\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether the background should be transparent.\n * @default false\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n * @default false\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the width of the ComboBox should be the width of the current item.\n * @default false\n */\n shouldUseCurrentItemWidth?: boolean;\n /**\n * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.\n * @default false\n */\n shouldUseFullWidth?: boolean;\n /**\n * If true, the dropdown will use the maximum width of the items.\n * @default false\n */\n shouldDropDownUseMaxItemWidth?: boolean;\n /**\n * Whether the outside events should be captured.\n * @default undefined\n */\n shouldCaptureEvents?: boolean;\n /**\n * The size of the ComboBox.\n * @default ComboBoxSize.NORMAL\n */\n size?: ComboBoxSize;\n /**\n * Enables the shared keyboard-only focus ring for the combobox header.\n * @default false\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * Optional min width for the prefix element.\n * @default undefined\n */\n prefixMinWidth?: number;\n};\n"],"mappings":";;;;;;AAIA;AACA;AACA;AAYA;AACA;AACA;AAgBA;AACA;AACA;AAgBA;AACA;AACA;AA4CA;AACA;AACA;AAFA,IAGYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EACpB;AACJ;AACA;EAHYA,YAAY;EAKpB;AACJ;AACA;EAPYA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAWxB;AACA;AACA","ignoreList":[]}