@chayns-components/core 5.3.9 → 5.3.11-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 (495) hide show
  1. package/AGENTS.md +73 -2
  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 +17 -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 +52 -5
  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 +100 -6
  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/file-input/FileInput.js +4 -2
  42. package/lib/cjs/components/file-input/FileInput.js.map +1 -1
  43. package/lib/cjs/components/file-list/file-item/FileItem.js +23 -2
  44. package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
  45. package/lib/cjs/components/file-list/file-item/FileItem.styles.js +19 -1
  46. package/lib/cjs/components/file-list/file-item/FileItem.styles.js.map +1 -1
  47. package/lib/cjs/components/file-select/FileSelect.js +27 -4
  48. package/lib/cjs/components/file-select/FileSelect.js.map +1 -1
  49. package/lib/cjs/components/file-select/FileSelect.styles.js +10 -0
  50. package/lib/cjs/components/file-select/FileSelect.styles.js.map +1 -1
  51. package/lib/cjs/components/filter/Filter.js +51 -16
  52. package/lib/cjs/components/filter/Filter.js.map +1 -1
  53. package/lib/cjs/components/filter/Filter.styles.js +9 -0
  54. package/lib/cjs/components/filter/Filter.styles.js.map +1 -1
  55. package/lib/cjs/components/filter/filter-content/FilterContent.js +14 -5
  56. package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
  57. package/lib/cjs/components/filter/filter-content/FilterContent.types.js.map +1 -1
  58. package/lib/cjs/components/filter-buttons/FilterButtons.js +69 -4
  59. package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
  60. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js +40 -2
  61. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  62. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  63. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  64. package/lib/cjs/components/grid-image/GridImage.js +20 -2
  65. package/lib/cjs/components/grid-image/GridImage.js.map +1 -1
  66. package/lib/cjs/components/grid-image/GridImage.styles.js +11 -2
  67. package/lib/cjs/components/grid-image/GridImage.styles.js.map +1 -1
  68. package/lib/cjs/components/grouped-image/GroupedImage.js +23 -4
  69. package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
  70. package/lib/cjs/components/grouped-image/GroupedImage.styles.js +9 -0
  71. package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
  72. package/lib/cjs/components/highlight-slider/HighlightSlider.js +10 -3
  73. package/lib/cjs/components/highlight-slider/HighlightSlider.js.map +1 -1
  74. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +21 -4
  75. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  76. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +11 -2
  77. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  78. package/lib/cjs/components/icon/Icon.js +24 -5
  79. package/lib/cjs/components/icon/Icon.js.map +1 -1
  80. package/lib/cjs/components/icon/Icon.styles.js +23 -0
  81. package/lib/cjs/components/icon/Icon.styles.js.map +1 -1
  82. package/lib/cjs/components/input/Input.js +29 -8
  83. package/lib/cjs/components/input/Input.js.map +1 -1
  84. package/lib/cjs/components/input/Input.styles.js +33 -3
  85. package/lib/cjs/components/input/Input.styles.js.map +1 -1
  86. package/lib/cjs/components/list/List.js +124 -37
  87. package/lib/cjs/components/list/List.js.map +1 -1
  88. package/lib/cjs/components/list/List.utils.js +107 -1
  89. package/lib/cjs/components/list/List.utils.js.map +1 -1
  90. package/lib/cjs/components/list/list-item/ListItem.js +82 -3
  91. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  92. package/lib/cjs/components/list/list-item/ListItem.styles.js +9 -0
  93. package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
  94. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js +40 -5
  95. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  96. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +5 -1
  97. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  98. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +32 -1
  99. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  100. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +32 -1
  101. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  102. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +30 -1
  103. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  104. package/lib/cjs/components/list/list-item/useListItemFocus.js +47 -0
  105. package/lib/cjs/components/list/list-item/useListItemFocus.js.map +1 -0
  106. package/lib/cjs/components/masonry/Masonry.context.js +17 -0
  107. package/lib/cjs/components/masonry/Masonry.context.js.map +1 -0
  108. package/lib/cjs/components/masonry/Masonry.hooks.js +53 -0
  109. package/lib/cjs/components/masonry/Masonry.hooks.js.map +1 -0
  110. package/lib/cjs/components/masonry/Masonry.js +81 -0
  111. package/lib/cjs/components/masonry/Masonry.js.map +1 -0
  112. package/lib/cjs/components/masonry/Masonry.styles.js +16 -0
  113. package/lib/cjs/components/masonry/Masonry.styles.js.map +1 -0
  114. package/lib/cjs/components/masonry/Masonry.types.js +6 -0
  115. package/lib/cjs/components/masonry/Masonry.types.js.map +1 -0
  116. package/lib/cjs/components/masonry/Masonry.utils.js +121 -0
  117. package/lib/cjs/components/masonry/Masonry.utils.js.map +1 -0
  118. package/lib/cjs/components/masonry/masonry-item/MasonryItem.js +77 -0
  119. package/lib/cjs/components/masonry/masonry-item/MasonryItem.js.map +1 -0
  120. package/lib/cjs/components/masonry/masonry-item/MasonryItem.styles.js +17 -0
  121. package/lib/cjs/components/masonry/masonry-item/MasonryItem.styles.js.map +1 -0
  122. package/lib/cjs/components/mention-finder/MentionFinder.js +31 -2
  123. package/lib/cjs/components/mention-finder/MentionFinder.js.map +1 -1
  124. package/lib/cjs/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  125. package/lib/cjs/components/multi-action-button/MultiActionButton.js +36 -3
  126. package/lib/cjs/components/multi-action-button/MultiActionButton.js.map +1 -1
  127. package/lib/cjs/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  128. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js +7 -1
  129. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  130. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  131. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  132. package/lib/cjs/components/number-input/NumberInput.js +13 -10
  133. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  134. package/lib/cjs/components/page-provider/PageProvider.js +4 -2
  135. package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
  136. package/lib/cjs/components/popup/Popup.js +8 -1
  137. package/lib/cjs/components/popup/Popup.js.map +1 -1
  138. package/lib/cjs/components/radio-button/RadioButton.js +29 -15
  139. package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
  140. package/lib/cjs/components/radio-button/RadioButton.styles.js +19 -8
  141. package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
  142. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  143. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  144. package/lib/cjs/components/search-box/SearchBox.js +5 -2
  145. package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
  146. package/lib/cjs/components/search-input/SearchInput.js +40 -41
  147. package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
  148. package/lib/cjs/components/search-input/SearchInput.styles.js +25 -2
  149. package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
  150. package/lib/cjs/components/select-button/SelectButton.js +4 -2
  151. package/lib/cjs/components/select-button/SelectButton.js.map +1 -1
  152. package/lib/cjs/components/setup-wizard/SetupWizard.js +7 -4
  153. package/lib/cjs/components/setup-wizard/SetupWizard.js.map +1 -1
  154. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  155. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  156. package/lib/cjs/components/sharing-bar/SharingBar.js +31 -6
  157. package/lib/cjs/components/sharing-bar/SharingBar.js.map +1 -1
  158. package/lib/cjs/components/sharing-bar/SharingBar.styles.js +5 -0
  159. package/lib/cjs/components/sharing-bar/SharingBar.styles.js.map +1 -1
  160. package/lib/cjs/components/sharing-button/SharingButton.js +4 -2
  161. package/lib/cjs/components/sharing-button/SharingButton.js.map +1 -1
  162. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js +3 -1
  163. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  164. package/lib/cjs/components/signature/Signature.js +6 -3
  165. package/lib/cjs/components/signature/Signature.js.map +1 -1
  166. package/lib/cjs/components/slider/Slider.js +30 -7
  167. package/lib/cjs/components/slider/Slider.js.map +1 -1
  168. package/lib/cjs/components/slider/Slider.styles.js +9 -2
  169. package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
  170. package/lib/cjs/components/slider-button/SliderButton.js +63 -6
  171. package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
  172. package/lib/cjs/components/slider-button/SliderButton.styles.js +19 -2
  173. package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
  174. package/lib/cjs/components/slider-button/SliderButton.types.js +6 -0
  175. package/lib/cjs/components/slider-button/SliderButton.types.js.map +1 -0
  176. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js +66 -0
  177. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  178. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js +47 -0
  179. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  180. package/lib/cjs/components/tag-input/TagInput.js +91 -36
  181. package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
  182. package/lib/cjs/components/tag-input/TagInput.styles.js +31 -3
  183. package/lib/cjs/components/tag-input/TagInput.styles.js.map +1 -1
  184. package/lib/cjs/components/text-area/TextArea.js +17 -8
  185. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  186. package/lib/cjs/components/text-area/TextArea.styles.js +15 -1
  187. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  188. package/lib/cjs/components/truncation/Truncation.js +17 -3
  189. package/lib/cjs/components/truncation/Truncation.js.map +1 -1
  190. package/lib/cjs/components/truncation/Truncation.styles.js +19 -1
  191. package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
  192. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js +68 -0
  193. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  194. package/lib/cjs/index.js +7 -0
  195. package/lib/cjs/index.js.map +1 -1
  196. package/lib/cjs/utils/file.js.map +1 -1
  197. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js +30 -0
  198. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  199. package/lib/esm/components/accordion/Accordion.js +105 -12
  200. package/lib/esm/components/accordion/Accordion.js.map +1 -1
  201. package/lib/esm/components/accordion/Accordion.styles.js +23 -3
  202. package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
  203. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
  204. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  205. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +33 -19
  206. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  207. package/lib/esm/components/accordion/accordion-head/AccordionHead.js +6 -3
  208. package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  209. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
  210. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  211. package/lib/esm/components/amount-control/AmountControl.js +30 -16
  212. package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
  213. package/lib/esm/components/amount-control/AmountControl.styles.js +18 -2
  214. package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
  215. package/lib/esm/components/button/Button.js +5 -1
  216. package/lib/esm/components/button/Button.js.map +1 -1
  217. package/lib/esm/components/button/Button.styles.js +17 -0
  218. package/lib/esm/components/button/Button.styles.js.map +1 -1
  219. package/lib/esm/components/button/Button.types.js.map +1 -1
  220. package/lib/esm/components/checkbox/Checkbox.js +5 -1
  221. package/lib/esm/components/checkbox/Checkbox.js.map +1 -1
  222. package/lib/esm/components/checkbox/Checkbox.styles.js +29 -2
  223. package/lib/esm/components/checkbox/Checkbox.styles.js.map +1 -1
  224. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  225. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  226. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  227. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  228. package/lib/esm/components/combobox/ComboBox.js +50 -5
  229. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  230. package/lib/esm/components/combobox/ComboBox.styles.js +11 -0
  231. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  232. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
  233. package/lib/esm/components/context-menu/ContextMenu.js +99 -5
  234. package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
  235. package/lib/esm/components/context-menu/ContextMenu.styles.js +38 -0
  236. package/lib/esm/components/context-menu/ContextMenu.styles.js.map +1 -1
  237. package/lib/esm/components/context-menu/ContextMenu.types.js.map +1 -1
  238. package/lib/esm/components/file-input/FileInput.js +4 -2
  239. package/lib/esm/components/file-input/FileInput.js.map +1 -1
  240. package/lib/esm/components/file-list/file-item/FileItem.js +24 -3
  241. package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
  242. package/lib/esm/components/file-list/file-item/FileItem.styles.js +18 -0
  243. package/lib/esm/components/file-list/file-item/FileItem.styles.js.map +1 -1
  244. package/lib/esm/components/file-select/FileSelect.js +27 -4
  245. package/lib/esm/components/file-select/FileSelect.js.map +1 -1
  246. package/lib/esm/components/file-select/FileSelect.styles.js +10 -0
  247. package/lib/esm/components/file-select/FileSelect.styles.js.map +1 -1
  248. package/lib/esm/components/filter/Filter.js +52 -16
  249. package/lib/esm/components/filter/Filter.js.map +1 -1
  250. package/lib/esm/components/filter/Filter.styles.js +9 -0
  251. package/lib/esm/components/filter/Filter.styles.js.map +1 -1
  252. package/lib/esm/components/filter/filter-content/FilterContent.js +15 -5
  253. package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
  254. package/lib/esm/components/filter/filter-content/FilterContent.types.js.map +1 -1
  255. package/lib/esm/components/filter-buttons/FilterButtons.js +69 -5
  256. package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
  257. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js +40 -2
  258. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  259. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  260. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  261. package/lib/esm/components/grid-image/GridImage.js +20 -2
  262. package/lib/esm/components/grid-image/GridImage.js.map +1 -1
  263. package/lib/esm/components/grid-image/GridImage.styles.js +10 -1
  264. package/lib/esm/components/grid-image/GridImage.styles.js.map +1 -1
  265. package/lib/esm/components/grouped-image/GroupedImage.js +22 -4
  266. package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
  267. package/lib/esm/components/grouped-image/GroupedImage.styles.js +9 -0
  268. package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
  269. package/lib/esm/components/highlight-slider/HighlightSlider.js +10 -3
  270. package/lib/esm/components/highlight-slider/HighlightSlider.js.map +1 -1
  271. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +20 -3
  272. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  273. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +10 -1
  274. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  275. package/lib/esm/components/icon/Icon.js +26 -7
  276. package/lib/esm/components/icon/Icon.js.map +1 -1
  277. package/lib/esm/components/icon/Icon.styles.js +23 -0
  278. package/lib/esm/components/icon/Icon.styles.js.map +1 -1
  279. package/lib/esm/components/input/Input.js +24 -4
  280. package/lib/esm/components/input/Input.js.map +1 -1
  281. package/lib/esm/components/input/Input.styles.js +33 -3
  282. package/lib/esm/components/input/Input.styles.js.map +1 -1
  283. package/lib/esm/components/list/List.js +123 -37
  284. package/lib/esm/components/list/List.js.map +1 -1
  285. package/lib/esm/components/list/List.utils.js +99 -0
  286. package/lib/esm/components/list/List.utils.js.map +1 -1
  287. package/lib/esm/components/list/list-item/ListItem.js +83 -4
  288. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  289. package/lib/esm/components/list/list-item/ListItem.styles.js +9 -0
  290. package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
  291. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +41 -6
  292. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  293. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +4 -0
  294. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  295. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +33 -2
  296. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  297. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +33 -2
  298. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  299. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +30 -1
  300. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  301. package/lib/esm/components/list/list-item/useListItemFocus.js +40 -0
  302. package/lib/esm/components/list/list-item/useListItemFocus.js.map +1 -0
  303. package/lib/esm/components/masonry/Masonry.context.js +10 -0
  304. package/lib/esm/components/masonry/Masonry.context.js.map +1 -0
  305. package/lib/esm/components/masonry/Masonry.hooks.js +44 -0
  306. package/lib/esm/components/masonry/Masonry.hooks.js.map +1 -0
  307. package/lib/esm/components/masonry/Masonry.js +74 -0
  308. package/lib/esm/components/masonry/Masonry.js.map +1 -0
  309. package/lib/esm/components/masonry/Masonry.styles.js +9 -0
  310. package/lib/esm/components/masonry/Masonry.styles.js.map +1 -0
  311. package/lib/esm/components/masonry/Masonry.types.js +2 -0
  312. package/lib/esm/components/masonry/Masonry.types.js.map +1 -0
  313. package/lib/esm/components/masonry/Masonry.utils.js +110 -0
  314. package/lib/esm/components/masonry/Masonry.utils.js.map +1 -0
  315. package/lib/esm/components/masonry/masonry-item/MasonryItem.js +69 -0
  316. package/lib/esm/components/masonry/masonry-item/MasonryItem.js.map +1 -0
  317. package/lib/esm/components/masonry/masonry-item/MasonryItem.styles.js +10 -0
  318. package/lib/esm/components/masonry/masonry-item/MasonryItem.styles.js.map +1 -0
  319. package/lib/esm/components/mention-finder/MentionFinder.js +30 -2
  320. package/lib/esm/components/mention-finder/MentionFinder.js.map +1 -1
  321. package/lib/esm/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  322. package/lib/esm/components/multi-action-button/MultiActionButton.js +36 -3
  323. package/lib/esm/components/multi-action-button/MultiActionButton.js.map +1 -1
  324. package/lib/esm/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  325. package/lib/esm/components/multi-action-button/action-button/ActionButton.js +7 -1
  326. package/lib/esm/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  327. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  328. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  329. package/lib/esm/components/number-input/NumberInput.js +13 -10
  330. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  331. package/lib/esm/components/page-provider/PageProvider.js +4 -2
  332. package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
  333. package/lib/esm/components/popup/Popup.js +8 -1
  334. package/lib/esm/components/popup/Popup.js.map +1 -1
  335. package/lib/esm/components/radio-button/RadioButton.js +29 -15
  336. package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
  337. package/lib/esm/components/radio-button/RadioButton.styles.js +19 -8
  338. package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
  339. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  340. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  341. package/lib/esm/components/search-box/SearchBox.js +5 -2
  342. package/lib/esm/components/search-box/SearchBox.js.map +1 -1
  343. package/lib/esm/components/search-input/SearchInput.js +41 -42
  344. package/lib/esm/components/search-input/SearchInput.js.map +1 -1
  345. package/lib/esm/components/search-input/SearchInput.styles.js +24 -1
  346. package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
  347. package/lib/esm/components/select-button/SelectButton.js +4 -2
  348. package/lib/esm/components/select-button/SelectButton.js.map +1 -1
  349. package/lib/esm/components/setup-wizard/SetupWizard.js +7 -4
  350. package/lib/esm/components/setup-wizard/SetupWizard.js.map +1 -1
  351. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  352. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  353. package/lib/esm/components/sharing-bar/SharingBar.js +30 -5
  354. package/lib/esm/components/sharing-bar/SharingBar.js.map +1 -1
  355. package/lib/esm/components/sharing-bar/SharingBar.styles.js +5 -0
  356. package/lib/esm/components/sharing-bar/SharingBar.styles.js.map +1 -1
  357. package/lib/esm/components/sharing-button/SharingButton.js +4 -2
  358. package/lib/esm/components/sharing-button/SharingButton.js.map +1 -1
  359. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js +3 -1
  360. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  361. package/lib/esm/components/signature/Signature.js +6 -3
  362. package/lib/esm/components/signature/Signature.js.map +1 -1
  363. package/lib/esm/components/slider/Slider.js +30 -7
  364. package/lib/esm/components/slider/Slider.js.map +1 -1
  365. package/lib/esm/components/slider/Slider.styles.js +8 -1
  366. package/lib/esm/components/slider/Slider.styles.js.map +1 -1
  367. package/lib/esm/components/slider-button/SliderButton.js +62 -6
  368. package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
  369. package/lib/esm/components/slider-button/SliderButton.styles.js +18 -1
  370. package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
  371. package/lib/esm/components/slider-button/SliderButton.types.js +2 -0
  372. package/lib/esm/components/slider-button/SliderButton.types.js.map +1 -0
  373. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js +56 -0
  374. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  375. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js +38 -0
  376. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  377. package/lib/esm/components/tag-input/TagInput.js +85 -35
  378. package/lib/esm/components/tag-input/TagInput.js.map +1 -1
  379. package/lib/esm/components/tag-input/TagInput.styles.js +29 -1
  380. package/lib/esm/components/tag-input/TagInput.styles.js.map +1 -1
  381. package/lib/esm/components/text-area/TextArea.js +18 -9
  382. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  383. package/lib/esm/components/text-area/TextArea.styles.js +14 -0
  384. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  385. package/lib/esm/components/truncation/Truncation.js +18 -4
  386. package/lib/esm/components/truncation/Truncation.js.map +1 -1
  387. package/lib/esm/components/truncation/Truncation.styles.js +18 -0
  388. package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
  389. package/lib/esm/hooks/useKeyboardFocusHighlighting.js +61 -0
  390. package/lib/esm/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  391. package/lib/esm/index.js +1 -0
  392. package/lib/esm/index.js.map +1 -1
  393. package/lib/esm/utils/file.js.map +1 -1
  394. package/lib/esm/utils/keyboardFocusHighlighting.styles.js +25 -0
  395. package/lib/esm/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  396. package/lib/types/components/accordion/Accordion.d.ts +5 -0
  397. package/lib/types/components/accordion/Accordion.styles.d.ts +8 -4
  398. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
  399. package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +7 -2
  400. package/lib/types/components/accordion/accordion-head/AccordionHead.d.ts +1 -0
  401. package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +18 -18
  402. package/lib/types/components/amount-control/AmountControl.d.ts +5 -0
  403. package/lib/types/components/amount-control/AmountControl.styles.d.ts +8 -4
  404. package/lib/types/components/button/Button.styles.d.ts +8 -6
  405. package/lib/types/components/button/Button.types.d.ts +8 -0
  406. package/lib/types/components/checkbox/Checkbox.d.ts +4 -0
  407. package/lib/types/components/checkbox/Checkbox.styles.d.ts +5 -1
  408. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +5 -0
  409. package/lib/types/components/combobox/ComboBox.styles.d.ts +4 -2
  410. package/lib/types/components/combobox/ComboBox.types.d.ts +5 -0
  411. package/lib/types/components/context-menu/ContextMenu.styles.d.ts +4 -2
  412. package/lib/types/components/context-menu/ContextMenu.types.d.ts +6 -0
  413. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +2 -2
  414. package/lib/types/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.styles.d.ts +2 -2
  415. package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +2 -2
  416. package/lib/types/components/file-input/FileInput.d.ts +4 -0
  417. package/lib/types/components/file-input/FileInput.styles.d.ts +2 -2
  418. package/lib/types/components/file-list/file-item/FileItem.styles.d.ts +3 -0
  419. package/lib/types/components/file-select/FileSelect.d.ts +4 -0
  420. package/lib/types/components/file-select/FileSelect.styles.d.ts +6 -4
  421. package/lib/types/components/filter/Filter.d.ts +1 -0
  422. package/lib/types/components/filter/Filter.styles.d.ts +6 -4
  423. package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +4 -0
  424. package/lib/types/components/filter-buttons/FilterButtons.d.ts +4 -0
  425. package/lib/types/components/filter-buttons/filter-button/FilterButton.d.ts +5 -0
  426. package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +12 -8
  427. package/lib/types/components/grid-image/GridImage.d.ts +4 -0
  428. package/lib/types/components/grid-image/GridImage.styles.d.ts +4 -2
  429. package/lib/types/components/grouped-image/GroupedImage.d.ts +4 -0
  430. package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +8 -6
  431. package/lib/types/components/highlight-slider/HighlightSlider.d.ts +4 -0
  432. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.d.ts +3 -0
  433. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.d.ts +9 -5
  434. package/lib/types/components/icon/Icon.d.ts +4 -0
  435. package/lib/types/components/icon/Icon.styles.d.ts +1 -0
  436. package/lib/types/components/input/Input.d.ts +4 -0
  437. package/lib/types/components/input/Input.styles.d.ts +17 -9
  438. package/lib/types/components/list/List.d.ts +11 -0
  439. package/lib/types/components/list/List.utils.d.ts +16 -1
  440. package/lib/types/components/list/list-item/ListItem.styles.d.ts +64 -64
  441. package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +2 -2
  442. package/lib/types/components/list/list-item/list-item-head/ListItemHead.d.ts +1 -0
  443. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +195 -194
  444. package/lib/types/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.d.ts +1 -0
  445. package/lib/types/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.d.ts +1 -0
  446. package/lib/types/components/list/list-item/list-item-head/list-item-title/ListItemTitle.d.ts +1 -0
  447. package/lib/types/components/list/list-item/useListItemFocus.d.ts +13 -0
  448. package/lib/types/components/masonry/Masonry.context.d.ts +3 -0
  449. package/lib/types/components/masonry/Masonry.d.ts +3 -0
  450. package/lib/types/components/masonry/Masonry.hooks.d.ts +22 -0
  451. package/lib/types/components/masonry/Masonry.styles.d.ts +5 -0
  452. package/lib/types/components/masonry/Masonry.types.d.ts +40 -0
  453. package/lib/types/components/masonry/Masonry.utils.d.ts +22 -0
  454. package/lib/types/components/masonry/masonry-item/MasonryItem.d.ts +5 -0
  455. package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +5 -0
  456. package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +4 -4
  457. package/lib/types/components/multi-action-button/MultiActionButton.styles.d.ts +2 -2
  458. package/lib/types/components/multi-action-button/MultiActionButton.types.d.ts +7 -0
  459. package/lib/types/components/multi-action-button/action-button/ActionButton.d.ts +4 -1
  460. package/lib/types/components/multi-action-button/action-button/ActionButton.styles.d.ts +4 -2
  461. package/lib/types/components/number-input/NumberInput.d.ts +4 -0
  462. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +2 -2
  463. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +6 -6
  464. package/lib/types/components/radio-button/RadioButton.d.ts +4 -0
  465. package/lib/types/components/radio-button/RadioButton.styles.d.ts +15 -9
  466. package/lib/types/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +5 -0
  467. package/lib/types/components/search-box/SearchBox.d.ts +4 -0
  468. package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
  469. package/lib/types/components/search-input/SearchInput.d.ts +4 -0
  470. package/lib/types/components/search-input/SearchInput.styles.d.ts +17 -9
  471. package/lib/types/components/select-button/SelectButton.d.ts +4 -0
  472. package/lib/types/components/setup-wizard/SetupWizard.d.ts +5 -0
  473. package/lib/types/components/sharing-bar/SharingBar.d.ts +4 -0
  474. package/lib/types/components/sharing-button/SharingButton.d.ts +1 -1
  475. package/lib/types/components/sharing-context-menu/SharingContextMenu.d.ts +10 -2
  476. package/lib/types/components/signature/Signature.d.ts +4 -0
  477. package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.styles.d.ts +4 -4
  478. package/lib/types/components/slider/Slider.d.ts +8 -0
  479. package/lib/types/components/slider/Slider.styles.d.ts +18 -14
  480. package/lib/types/components/slider-button/SliderButton.d.ts +1 -28
  481. package/lib/types/components/slider-button/SliderButton.styles.d.ts +6 -4
  482. package/lib/types/components/slider-button/SliderButton.types.d.ts +32 -0
  483. package/lib/types/components/slider-button/useSliderButtonPopupKeyboard.d.ts +17 -0
  484. package/lib/types/components/slider-button/useSliderButtonThumbKeyboard.d.ts +13 -0
  485. package/lib/types/components/tag-input/TagInput.d.ts +4 -0
  486. package/lib/types/components/tag-input/TagInput.styles.d.ts +12 -2
  487. package/lib/types/components/text-area/TextArea.d.ts +4 -0
  488. package/lib/types/components/text-area/TextArea.styles.d.ts +1 -0
  489. package/lib/types/components/truncation/Truncation.d.ts +4 -0
  490. package/lib/types/components/truncation/Truncation.styles.d.ts +7 -2
  491. package/lib/types/hooks/useKeyboardFocusHighlighting.d.ts +5 -0
  492. package/lib/types/index.d.ts +1 -0
  493. package/lib/types/utils/file.d.ts +1 -1
  494. package/lib/types/utils/keyboardFocusHighlighting.styles.d.ts +9 -0
  495. package/package.json +2 -2
@@ -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":[]}
@@ -15,6 +15,7 @@ var _ContextMenuContent = _interopRequireDefault(require("./context-menu-content
15
15
  var _ContextMenu = require("./ContextMenu.styles");
16
16
  var _ContextMenu2 = require("./ContextMenu.types");
17
17
  var _ContextMenu3 = require("./ContextMenu.utils");
18
+ var _useKeyboardFocusHighlighting = require("../../hooks/useKeyboardFocusHighlighting");
18
19
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
20
  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); }
20
21
  const ContextMenu = /*#__PURE__*/(0, _react2.forwardRef)(({
@@ -34,6 +35,7 @@ const ContextMenu = /*#__PURE__*/(0, _react2.forwardRef)(({
34
35
  shouldDisableClick = false,
35
36
  shouldHidePopupArrow = false,
36
37
  shouldShowHoverEffect = false,
38
+ shouldEnableKeyboardHighlighting,
37
39
  shouldUseDefaultTriggerStyles = true,
38
40
  style,
39
41
  yOffset = 0,
@@ -49,10 +51,16 @@ const ContextMenu = /*#__PURE__*/(0, _react2.forwardRef)(({
49
51
  const [isContentShown, setIsContentShown] = (0, _react2.useState)(false);
50
52
  const [portal, setPortal] = (0, _react2.useState)();
51
53
  const [isHovered, setIsHovered] = (0, _react2.useState)(false);
54
+ const [shouldUseFocusableWrapper, setShouldUseFocusableWrapper] = (0, _react2.useState)(false);
52
55
  const uuid = (0, _uuid.useUuid)();
53
56
  const contextMenuContentRef = (0, _react2.useRef)(null);
54
57
  const contextMenuRef = (0, _react2.useRef)(null);
58
+ const shouldSkipNextContextMenuOpenRef = (0, _react2.useRef)(false);
59
+ const shouldPreventNextNativeContextMenuRef = (0, _react2.useRef)(false);
55
60
  const isTouch = (0, _environment.useIsTouch)();
61
+ const shouldShowKeyboardHighlighting = (0, _useKeyboardFocusHighlighting.useKeyboardFocusHighlighting)(shouldEnableKeyboardHighlighting && !shouldDisableClick);
62
+ const shouldShowWrapperKeyboardHighlighting = shouldShowKeyboardHighlighting && shouldUseFocusableWrapper;
63
+ const shouldUseKeyboardFocusableWrapper = shouldUseFocusableWrapper && !shouldDisableClick;
56
64
  (0, _react2.useEffect)(() => {
57
65
  if (isContentShown) {
58
66
  setFocusedIndex((0, _ContextMenu3.getDefaultFocusedIndex)(items));
@@ -170,18 +178,88 @@ const ContextMenu = /*#__PURE__*/(0, _react2.forwardRef)(({
170
178
  event.stopPropagation();
171
179
  void handleShow();
172
180
  }, [handleShow, shouldDisableClick]);
173
- const handleDocumentClick = (0, _react2.useCallback)(event => {
174
- var _contextMenuContentRe;
175
- if (!shouldCloseOnPopupClick && (_contextMenuContentRe = contextMenuContentRef.current) !== null && _contextMenuContentRe !== void 0 && _contextMenuContentRe.contains(event.target)) {
181
+ const handleKeyDown = (0, _react2.useCallback)(event => {
182
+ if (shouldDisableClick) {
183
+ return;
184
+ }
185
+ const isContextMenuShortcut = event.key === 'ContextMenu' || event.key === 'F10' && event.shiftKey;
186
+ const isActivationKey = event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';
187
+ if (isContextMenuShortcut) {
188
+ event.preventDefault();
189
+ event.stopPropagation();
190
+ shouldSkipNextContextMenuOpenRef.current = true;
191
+ void handleShow();
192
+ return;
193
+ }
194
+ if (shouldUseFocusableWrapper && isActivationKey) {
195
+ event.preventDefault();
196
+ event.stopPropagation();
197
+ void handleShow();
198
+ }
199
+ }, [handleShow, shouldDisableClick, shouldUseFocusableWrapper]);
200
+ const handleContextMenu = (0, _react2.useCallback)(event => {
201
+ event.preventDefault();
202
+ event.stopPropagation();
203
+ if (shouldDisableClick) {
176
204
  return;
177
205
  }
178
- handleHide();
179
- }, [handleHide, shouldCloseOnPopupClick]);
206
+ if (shouldSkipNextContextMenuOpenRef.current) {
207
+ shouldSkipNextContextMenuOpenRef.current = false;
208
+ return;
209
+ }
210
+ void handleShow();
211
+ }, [handleShow, shouldDisableClick]);
212
+ (0, _react2.useEffect)(() => {
213
+ const handleGlobalKeyDown = event => {
214
+ if (shouldDisableClick || !contextMenuRef.current) {
215
+ return;
216
+ }
217
+ const isContextMenuShortcut = event.key === 'ContextMenu' || event.key === 'F10' && event.shiftKey;
218
+ if (!isContextMenuShortcut) {
219
+ return;
220
+ }
221
+ const {
222
+ activeElement
223
+ } = document;
224
+ if (!(activeElement instanceof HTMLElement) || activeElement === document.body || activeElement === document.documentElement) {
225
+ return;
226
+ }
227
+ const shouldOpenFromFocusedParent = activeElement.contains(contextMenuRef.current) && !contextMenuRef.current.contains(activeElement);
228
+ if (!shouldOpenFromFocusedParent) {
229
+ return;
230
+ }
231
+ event.preventDefault();
232
+ event.stopPropagation();
233
+ shouldPreventNextNativeContextMenuRef.current = true;
234
+ void handleShow();
235
+ };
236
+ const handleNativeContextMenuCapture = event => {
237
+ if (!shouldPreventNextNativeContextMenuRef.current) {
238
+ return;
239
+ }
240
+ shouldPreventNextNativeContextMenuRef.current = false;
241
+ event.preventDefault();
242
+ event.stopPropagation();
243
+ };
244
+ document.addEventListener('keydown', handleGlobalKeyDown, true);
245
+ document.addEventListener('contextmenu', handleNativeContextMenuCapture, true);
246
+ return () => {
247
+ document.removeEventListener('keydown', handleGlobalKeyDown, true);
248
+ document.removeEventListener('contextmenu', handleNativeContextMenuCapture, true);
249
+ };
250
+ }, [handleShow, shouldDisableClick]);
180
251
  (0, _react2.useImperativeHandle)(ref, () => ({
181
252
  hide: handleHide,
182
253
  show: handleShow
183
254
  }), [handleHide, handleShow]);
184
255
  (0, _react2.useEffect)(() => {
256
+ const handleDocumentClick = event => {
257
+ var _contextMenuContentRe;
258
+ if (!shouldCloseOnPopupClick && (_contextMenuContentRe = contextMenuContentRef.current) !== null && _contextMenuContentRe !== void 0 && _contextMenuContentRe.contains(event.target)) {
259
+ return;
260
+ }
261
+ handleHide();
262
+ };
185
263
  if (isContentShown) {
186
264
  document.addEventListener('click', handleDocumentClick, true);
187
265
  window.addEventListener('blur', handleHide);
@@ -195,7 +273,7 @@ const ContextMenu = /*#__PURE__*/(0, _react2.forwardRef)(({
195
273
  document.removeEventListener('click', handleDocumentClick, true);
196
274
  window.removeEventListener('blur', handleHide);
197
275
  };
198
- }, [handleDocumentClick, handleHide, isContentShown, onHide, onShow]);
276
+ }, [handleHide, isContentShown, onHide, onShow, shouldCloseOnPopupClick]);
199
277
  (0, _react2.useEffect)(() => {
200
278
  if (!newContainer) {
201
279
  return;
@@ -228,13 +306,29 @@ const ContextMenu = /*#__PURE__*/(0, _react2.forwardRef)(({
228
306
  }
229
307
  })), newContainer));
230
308
  }, [alignment, newContainer, coordinates, internalAlignment, internalCoordinates, isContentShown, items, uuid, zIndex, shouldHidePopupArrow, headline, focusedIndex, handleHide]);
309
+ (0, _react2.useEffect)(() => {
310
+ if (!contextMenuRef.current) {
311
+ return;
312
+ }
313
+ const focusableChildSelector = 'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
314
+ const hasFocusableChild = Boolean(contextMenuRef.current.querySelector(focusableChildSelector));
315
+ setShouldUseFocusableWrapper(!hasFocusableChild);
316
+ }, [children]);
231
317
  return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement(_ContextMenu.StyledContextMenu, {
232
318
  className: className ? `beta-chayns-context-menu ${className}` : 'beta-chayns-context-menu',
233
319
  $isActive: isContentShown && shouldShowHoverEffect,
234
320
  $shouldAddHoverEffect: !isTouch && shouldShowHoverEffect,
321
+ $shouldShowWrapperKeyboardHighlighting: shouldShowWrapperKeyboardHighlighting,
235
322
  $shouldUseDefaultTriggerStyles: shouldUseDefaultTriggerStyles,
236
323
  onClick: handleClick,
324
+ onContextMenuCapture: handleContextMenu,
325
+ onContextMenu: handleContextMenu,
326
+ onKeyDown: handleKeyDown,
237
327
  ref: contextMenuRef,
328
+ tabIndex: shouldUseKeyboardFocusableWrapper ? 0 : undefined,
329
+ role: shouldUseKeyboardFocusableWrapper ? 'button' : undefined,
330
+ "aria-haspopup": shouldUseKeyboardFocusableWrapper ? 'menu' : undefined,
331
+ "aria-expanded": shouldUseKeyboardFocusableWrapper ? isContentShown : undefined,
238
332
  style: style
239
333
  }, children), portal);
240
334
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.js","names":["_chaynsApi","require","_react","_react2","_interopRequireWildcard","_reactDom","_uuid","_environment","_Icon","_interopRequireDefault","_ContextMenuContent","_ContextMenu","_ContextMenu2","_ContextMenu3","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ContextMenu","forwardRef","alignment","className","children","createElement","icons","size","container","coordinates","headline","items","onHide","onShow","shouldCloseOnPopupClick","shouldDisableClick","shouldHidePopupArrow","shouldShowHoverEffect","shouldUseDefaultTriggerStyles","style","yOffset","zIndex","ref","internalCoordinates","setInternalCoordinates","useState","x","y","internalAlignment","setInternalAlignment","ContextMenuAlignment","TopLeft","newContainer","setNewContainer","focusedIndex","setFocusedIndex","getDefaultFocusedIndex","isContentShown","setIsContentShown","portal","setPortal","isHovered","setIsHovered","uuid","useUuid","contextMenuContentRef","useRef","contextMenuRef","isTouch","useIsTouch","useEffect","current","el","element","closest","Element","handleHide","useCallback","handleKey","length","key","preventDefault","prev","item","onClick","document","addEventListener","removeEventListener","handleShow","result","createDialog","type","DialogType","SELECT","buttons","list","map","text","isSelected","index","name","id","icon","isValidElement","undefined","open","_items$result$","height","childrenHeight","left","childrenLeft","top","childrenTop","width","childrenWidth","getBoundingClientRect","zoomX","offsetWidth","zoomY","offsetHeight","scrollLeft","scrollTop","BottomRight","TopRight","BottomLeft","handleClick","event","stopPropagation","handleDocumentClick","_contextMenuContentRe","contains","target","useImperativeHandle","hide","show","window","createPortal","AnimatePresence","initial","onKeySelect","onMouseEnter","onMouseLeave","Fragment","StyledContextMenu","$isActive","$shouldAddHoverEffect","$shouldUseDefaultTriggerStyles","displayName","_default","exports"],"sources":["../../../../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["import { createDialog, DialogType } from 'chayns-api';\nimport { AnimatePresence } from 'motion/react';\nimport React, {\n forwardRef,\n isValidElement,\n MouseEventHandler,\n ReactPortal,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useUuid } from '../../hooks/uuid';\nimport { useIsTouch } from '../../utils/environment';\nimport Icon from '../icon/Icon';\nimport ContextMenuContent from './context-menu-content/ContextMenuContent';\nimport { StyledContextMenu } from './ContextMenu.styles';\nimport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './ContextMenu.types';\nimport { SelectDialogResult } from '../../types/general';\nimport { getDefaultFocusedIndex } from './ContextMenu.utils';\n\nconst ContextMenu = forwardRef<ContextMenuRef, ContextMenuProps>(\n (\n {\n alignment,\n className,\n children = <Icon icons={['ts-ellipsis_v']} size={18} />,\n container,\n coordinates,\n headline,\n items,\n onHide,\n onShow,\n shouldCloseOnPopupClick = true,\n shouldDisableClick = false,\n shouldHidePopupArrow = false,\n shouldShowHoverEffect = false,\n shouldUseDefaultTriggerStyles = true,\n style,\n yOffset = 0,\n zIndex = 20,\n },\n ref,\n ) => {\n const [internalCoordinates, setInternalCoordinates] = useState<ContextMenuCoordinates>({\n x: 0,\n y: 0,\n });\n\n const [internalAlignment, setInternalAlignment] = useState<ContextMenuAlignment>(\n ContextMenuAlignment.TopLeft,\n );\n\n const [newContainer, setNewContainer] = useState(container ?? null);\n const [focusedIndex, setFocusedIndex] = useState(getDefaultFocusedIndex(items));\n const [isContentShown, setIsContentShown] = useState(false);\n const [portal, setPortal] = useState<ReactPortal>();\n const [isHovered, setIsHovered] = useState(false);\n\n const uuid = useUuid();\n\n const contextMenuContentRef = useRef<HTMLDivElement>(null);\n const contextMenuRef = useRef<HTMLSpanElement>(null);\n\n const isTouch = useIsTouch();\n\n useEffect(() => {\n if (isContentShown) {\n setFocusedIndex(getDefaultFocusedIndex(items));\n }\n }, [isContentShown, items]);\n\n useEffect(() => {\n if (contextMenuRef.current && !container) {\n const el = contextMenuRef.current as HTMLElement;\n\n const element = el.closest('.dialog-inner, .page-provider, .tapp, body');\n\n setNewContainer(element);\n }\n }, [container]);\n\n useEffect(() => {\n if (container instanceof Element) {\n setNewContainer(container);\n }\n }, [container]);\n\n const handleHide = useCallback(() => {\n setIsContentShown(false);\n }, []);\n\n useEffect(() => {\n if (!isContentShown) return () => {};\n\n const handleKey = (e: KeyboardEvent) => {\n if (items.length === 0 || isHovered) return;\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setFocusedIndex((prev) => (prev >= items.length - 1 ? 0 : prev + 1));\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n setFocusedIndex((prev) => (prev <= 0 ? items.length - 1 : prev - 1));\n }\n\n if (e.key === 'Enter') {\n e.preventDefault();\n const item = items[focusedIndex];\n if (item) {\n void item.onClick();\n\n if (shouldCloseOnPopupClick) {\n handleHide();\n }\n }\n }\n\n if (e.key === 'Escape') {\n handleHide();\n }\n };\n\n document.addEventListener('keydown', handleKey);\n\n return () => document.removeEventListener('keydown', handleKey);\n }, [isContentShown, items, focusedIndex, handleHide, shouldCloseOnPopupClick, isHovered]);\n\n const handleShow = useCallback(async () => {\n if (isTouch) {\n const { result } = (await createDialog({\n type: DialogType.SELECT,\n buttons: [],\n list: items.map(({ icons, text, isSelected }, index) => ({\n name: text,\n id: index,\n isSelected,\n icon: isValidElement(icons)\n ? undefined\n : (icons as string[] | undefined)?.[0],\n })),\n }).open()) as SelectDialogResult;\n\n if (result && typeof result[0] === 'number') {\n void items[result[0]]?.onClick();\n }\n } else if (contextMenuRef.current) {\n if (!newContainer) {\n return;\n }\n\n const {\n height: childrenHeight,\n left: childrenLeft,\n top: childrenTop,\n width: childrenWidth,\n } = contextMenuRef.current.getBoundingClientRect();\n\n const { height, width, top, left } = newContainer.getBoundingClientRect();\n\n const zoomX = width / (newContainer as HTMLElement).offsetWidth;\n const zoomY = height / (newContainer as HTMLElement).offsetHeight;\n\n const x =\n (childrenLeft + childrenWidth / 2 - left) / zoomX + newContainer.scrollLeft;\n const y =\n (childrenTop + childrenHeight / 2 - top) / zoomY +\n newContainer.scrollTop -\n yOffset;\n\n setInternalCoordinates({ x, y });\n\n if (x < width / 2) {\n if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomRight);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopRight);\n }\n } else if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomLeft);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopLeft);\n }\n\n setIsContentShown(true);\n }\n }, [isTouch, items, newContainer, yOffset]);\n\n const handleClick = useCallback<MouseEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n const handleDocumentClick = useCallback<EventListener>(\n (event) => {\n if (\n !shouldCloseOnPopupClick &&\n contextMenuContentRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n handleHide();\n },\n [handleHide, shouldCloseOnPopupClick],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleHide,\n show: handleShow,\n }),\n [handleHide, handleShow],\n );\n\n useEffect(() => {\n if (isContentShown) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n\n if (typeof onShow === 'function') {\n onShow();\n }\n } else if (typeof onHide === 'function') {\n onHide();\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleDocumentClick, handleHide, isContentShown, onHide, onShow]);\n\n useEffect(() => {\n if (!newContainer) {\n return;\n }\n\n setPortal(() =>\n createPortal(\n <AnimatePresence initial={false}>\n {isContentShown && (\n <ContextMenuContent\n coordinates={coordinates ?? internalCoordinates}\n items={items}\n zIndex={zIndex}\n headline={headline}\n shouldHidePopupArrow={shouldHidePopupArrow}\n key={`contextMenu_${uuid}`}\n alignment={alignment ?? internalAlignment}\n ref={contextMenuContentRef}\n focusedIndex={focusedIndex}\n onKeySelect={(index) => {\n const item = items[index];\n if (item) {\n void item.onClick();\n handleHide();\n }\n }}\n onMouseEnter={() => {\n setIsHovered(true);\n setFocusedIndex(-1);\n }}\n onMouseLeave={() => {\n setIsHovered(false);\n }}\n />\n )}\n </AnimatePresence>,\n newContainer,\n ),\n );\n }, [\n alignment,\n newContainer,\n coordinates,\n internalAlignment,\n internalCoordinates,\n isContentShown,\n items,\n uuid,\n zIndex,\n shouldHidePopupArrow,\n headline,\n focusedIndex,\n handleHide,\n ]);\n\n return (\n <>\n <StyledContextMenu\n className={\n className\n ? `beta-chayns-context-menu ${className}`\n : 'beta-chayns-context-menu'\n }\n $isActive={isContentShown && shouldShowHoverEffect}\n $shouldAddHoverEffect={!isTouch && shouldShowHoverEffect}\n $shouldUseDefaultTriggerStyles={shouldUseDefaultTriggerStyles}\n onClick={handleClick}\n ref={contextMenuRef}\n style={style}\n >\n {children}\n </StyledContextMenu>\n {portal}\n </>\n );\n },\n);\n\nContextMenu.displayName = 'ContextMenu';\n\nexport default ContextMenu;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,uBAAA,CAAAH,OAAA;AAWA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,mBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAOA,IAAAY,aAAA,GAAAZ,OAAA;AAA6D,SAAAQ,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,w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ignoreList":[]}
1
+ {"version":3,"file":"ContextMenu.js","names":["_chaynsApi","require","_react","_react2","_interopRequireWildcard","_reactDom","_uuid","_environment","_Icon","_interopRequireDefault","_ContextMenuContent","_ContextMenu","_ContextMenu2","_ContextMenu3","_useKeyboardFocusHighlighting","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ContextMenu","forwardRef","alignment","className","children","createElement","icons","size","container","coordinates","headline","items","onHide","onShow","shouldCloseOnPopupClick","shouldDisableClick","shouldHidePopupArrow","shouldShowHoverEffect","shouldEnableKeyboardHighlighting","shouldUseDefaultTriggerStyles","style","yOffset","zIndex","ref","internalCoordinates","setInternalCoordinates","useState","x","y","internalAlignment","setInternalAlignment","ContextMenuAlignment","TopLeft","newContainer","setNewContainer","focusedIndex","setFocusedIndex","getDefaultFocusedIndex","isContentShown","setIsContentShown","portal","setPortal","isHovered","setIsHovered","shouldUseFocusableWrapper","setShouldUseFocusableWrapper","uuid","useUuid","contextMenuContentRef","useRef","contextMenuRef","shouldSkipNextContextMenuOpenRef","shouldPreventNextNativeContextMenuRef","isTouch","useIsTouch","shouldShowKeyboardHighlighting","useKeyboardFocusHighlighting","shouldShowWrapperKeyboardHighlighting","shouldUseKeyboardFocusableWrapper","useEffect","current","el","element","closest","Element","handleHide","useCallback","handleKey","length","key","preventDefault","prev","item","onClick","document","addEventListener","removeEventListener","handleShow","result","createDialog","type","DialogType","SELECT","buttons","list","map","text","isSelected","index","name","id","icon","isValidElement","undefined","open","_items$result$","height","childrenHeight","left","childrenLeft","top","childrenTop","width","childrenWidth","getBoundingClientRect","zoomX","offsetWidth","zoomY","offsetHeight","scrollLeft","scrollTop","BottomRight","TopRight","BottomLeft","handleClick","event","stopPropagation","handleKeyDown","isContextMenuShortcut","shiftKey","isActivationKey","handleContextMenu","handleGlobalKeyDown","activeElement","HTMLElement","body","documentElement","shouldOpenFromFocusedParent","contains","handleNativeContextMenuCapture","useImperativeHandle","hide","show","handleDocumentClick","_contextMenuContentRe","target","window","createPortal","AnimatePresence","initial","onKeySelect","onMouseEnter","onMouseLeave","focusableChildSelector","hasFocusableChild","Boolean","querySelector","Fragment","StyledContextMenu","$isActive","$shouldAddHoverEffect","$shouldShowWrapperKeyboardHighlighting","$shouldUseDefaultTriggerStyles","onContextMenuCapture","onContextMenu","onKeyDown","tabIndex","role","displayName","_default","exports"],"sources":["../../../../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["import { createDialog, DialogType } from 'chayns-api';\nimport { AnimatePresence } from 'motion/react';\nimport React, {\n forwardRef,\n isValidElement,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactPortal,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useUuid } from '../../hooks/uuid';\nimport { useIsTouch } from '../../utils/environment';\nimport Icon from '../icon/Icon';\nimport ContextMenuContent from './context-menu-content/ContextMenuContent';\nimport { StyledContextMenu } from './ContextMenu.styles';\nimport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './ContextMenu.types';\nimport { SelectDialogResult } from '../../types/general';\nimport { getDefaultFocusedIndex } from './ContextMenu.utils';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\n\nconst ContextMenu = forwardRef<ContextMenuRef, ContextMenuProps>(\n (\n {\n alignment,\n className,\n children = <Icon icons={['ts-ellipsis_v']} size={18} />,\n container,\n coordinates,\n headline,\n items,\n onHide,\n onShow,\n shouldCloseOnPopupClick = true,\n shouldDisableClick = false,\n shouldHidePopupArrow = false,\n shouldShowHoverEffect = false,\n shouldEnableKeyboardHighlighting,\n shouldUseDefaultTriggerStyles = true,\n style,\n yOffset = 0,\n zIndex = 20,\n },\n ref,\n ) => {\n const [internalCoordinates, setInternalCoordinates] = useState<ContextMenuCoordinates>({\n x: 0,\n y: 0,\n });\n\n const [internalAlignment, setInternalAlignment] = useState<ContextMenuAlignment>(\n ContextMenuAlignment.TopLeft,\n );\n\n const [newContainer, setNewContainer] = useState(container ?? null);\n const [focusedIndex, setFocusedIndex] = useState(getDefaultFocusedIndex(items));\n const [isContentShown, setIsContentShown] = useState(false);\n const [portal, setPortal] = useState<ReactPortal>();\n const [isHovered, setIsHovered] = useState(false);\n const [shouldUseFocusableWrapper, setShouldUseFocusableWrapper] = useState(false);\n\n const uuid = useUuid();\n\n const contextMenuContentRef = useRef<HTMLDivElement>(null);\n const contextMenuRef = useRef<HTMLSpanElement>(null);\n const shouldSkipNextContextMenuOpenRef = useRef(false);\n const shouldPreventNextNativeContextMenuRef = useRef(false);\n\n const isTouch = useIsTouch();\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !shouldDisableClick,\n );\n const shouldShowWrapperKeyboardHighlighting =\n shouldShowKeyboardHighlighting && shouldUseFocusableWrapper;\n const shouldUseKeyboardFocusableWrapper = shouldUseFocusableWrapper && !shouldDisableClick;\n\n useEffect(() => {\n if (isContentShown) {\n setFocusedIndex(getDefaultFocusedIndex(items));\n }\n }, [isContentShown, items]);\n\n useEffect(() => {\n if (contextMenuRef.current && !container) {\n const el = contextMenuRef.current as HTMLElement;\n\n const element = el.closest('.dialog-inner, .page-provider, .tapp, body');\n\n setNewContainer(element);\n }\n }, [container]);\n\n useEffect(() => {\n if (container instanceof Element) {\n setNewContainer(container);\n }\n }, [container]);\n\n const handleHide = useCallback(() => {\n setIsContentShown(false);\n }, []);\n\n useEffect(() => {\n if (!isContentShown) return () => {};\n\n const handleKey = (e: KeyboardEvent) => {\n if (items.length === 0 || isHovered) return;\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setFocusedIndex((prev) => (prev >= items.length - 1 ? 0 : prev + 1));\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n setFocusedIndex((prev) => (prev <= 0 ? items.length - 1 : prev - 1));\n }\n\n if (e.key === 'Enter') {\n e.preventDefault();\n const item = items[focusedIndex];\n if (item) {\n void item.onClick();\n\n if (shouldCloseOnPopupClick) {\n handleHide();\n }\n }\n }\n\n if (e.key === 'Escape') {\n handleHide();\n }\n };\n\n document.addEventListener('keydown', handleKey);\n\n return () => document.removeEventListener('keydown', handleKey);\n }, [isContentShown, items, focusedIndex, handleHide, shouldCloseOnPopupClick, isHovered]);\n\n const handleShow = useCallback(async () => {\n if (isTouch) {\n const { result } = (await createDialog({\n type: DialogType.SELECT,\n buttons: [],\n list: items.map(({ icons, text, isSelected }, index) => ({\n name: text,\n id: index,\n isSelected,\n icon: isValidElement(icons)\n ? undefined\n : (icons as string[] | undefined)?.[0],\n })),\n }).open()) as SelectDialogResult;\n\n if (result && typeof result[0] === 'number') {\n void items[result[0]]?.onClick();\n }\n } else if (contextMenuRef.current) {\n if (!newContainer) {\n return;\n }\n\n const {\n height: childrenHeight,\n left: childrenLeft,\n top: childrenTop,\n width: childrenWidth,\n } = contextMenuRef.current.getBoundingClientRect();\n\n const { height, width, top, left } = newContainer.getBoundingClientRect();\n\n const zoomX = width / (newContainer as HTMLElement).offsetWidth;\n const zoomY = height / (newContainer as HTMLElement).offsetHeight;\n\n const x =\n (childrenLeft + childrenWidth / 2 - left) / zoomX + newContainer.scrollLeft;\n const y =\n (childrenTop + childrenHeight / 2 - top) / zoomY +\n newContainer.scrollTop -\n yOffset;\n\n setInternalCoordinates({ x, y });\n\n if (x < width / 2) {\n if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomRight);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopRight);\n }\n } else if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomLeft);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopLeft);\n }\n\n setIsContentShown(true);\n }\n }, [isTouch, items, newContainer, yOffset]);\n\n const handleClick = useCallback<MouseEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLSpanElement>>(\n (event) => {\n if (shouldDisableClick) {\n return;\n }\n\n const isContextMenuShortcut =\n event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n const isActivationKey =\n event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';\n\n if (isContextMenuShortcut) {\n event.preventDefault();\n event.stopPropagation();\n shouldSkipNextContextMenuOpenRef.current = true;\n void handleShow();\n return;\n }\n\n if (shouldUseFocusableWrapper && isActivationKey) {\n event.preventDefault();\n event.stopPropagation();\n void handleShow();\n }\n },\n [handleShow, shouldDisableClick, shouldUseFocusableWrapper],\n );\n\n const handleContextMenu = useCallback(\n (event: MouseEvent<HTMLSpanElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (shouldDisableClick) {\n return;\n }\n\n if (shouldSkipNextContextMenuOpenRef.current) {\n shouldSkipNextContextMenuOpenRef.current = false;\n return;\n }\n\n void handleShow();\n },\n [handleShow, shouldDisableClick],\n );\n\n useEffect(() => {\n const handleGlobalKeyDown = (event: KeyboardEvent) => {\n if (shouldDisableClick || !contextMenuRef.current) {\n return;\n }\n\n const isContextMenuShortcut =\n event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n\n if (!isContextMenuShortcut) {\n return;\n }\n\n const { activeElement } = document;\n\n if (\n !(activeElement instanceof HTMLElement) ||\n activeElement === document.body ||\n activeElement === document.documentElement\n ) {\n return;\n }\n\n const shouldOpenFromFocusedParent =\n activeElement.contains(contextMenuRef.current) &&\n !contextMenuRef.current.contains(activeElement);\n\n if (!shouldOpenFromFocusedParent) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n shouldPreventNextNativeContextMenuRef.current = true;\n void handleShow();\n };\n\n const handleNativeContextMenuCapture = (event: Event) => {\n if (!shouldPreventNextNativeContextMenuRef.current) {\n return;\n }\n\n shouldPreventNextNativeContextMenuRef.current = false;\n event.preventDefault();\n event.stopPropagation();\n };\n\n document.addEventListener('keydown', handleGlobalKeyDown, true);\n document.addEventListener('contextmenu', handleNativeContextMenuCapture, true);\n\n return () => {\n document.removeEventListener('keydown', handleGlobalKeyDown, true);\n document.removeEventListener('contextmenu', handleNativeContextMenuCapture, true);\n };\n }, [handleShow, shouldDisableClick]);\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleHide,\n show: handleShow,\n }),\n [handleHide, handleShow],\n );\n\n useEffect(() => {\n const handleDocumentClick = (event: PointerEvent) => {\n if (\n !shouldCloseOnPopupClick &&\n contextMenuContentRef.current?.contains(event.target as Node)\n ) {\n return;\n }\n\n handleHide();\n };\n\n if (isContentShown) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n\n if (typeof onShow === 'function') {\n onShow();\n }\n } else if (typeof onHide === 'function') {\n onHide();\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleHide, isContentShown, onHide, onShow, shouldCloseOnPopupClick]);\n\n useEffect(() => {\n if (!newContainer) {\n return;\n }\n\n setPortal(() =>\n createPortal(\n <AnimatePresence initial={false}>\n {isContentShown && (\n <ContextMenuContent\n coordinates={coordinates ?? internalCoordinates}\n items={items}\n zIndex={zIndex}\n headline={headline}\n shouldHidePopupArrow={shouldHidePopupArrow}\n key={`contextMenu_${uuid}`}\n alignment={alignment ?? internalAlignment}\n ref={contextMenuContentRef}\n focusedIndex={focusedIndex}\n onKeySelect={(index) => {\n const item = items[index];\n if (item) {\n void item.onClick();\n handleHide();\n }\n }}\n onMouseEnter={() => {\n setIsHovered(true);\n setFocusedIndex(-1);\n }}\n onMouseLeave={() => {\n setIsHovered(false);\n }}\n />\n )}\n </AnimatePresence>,\n newContainer,\n ),\n );\n }, [\n alignment,\n newContainer,\n coordinates,\n internalAlignment,\n internalCoordinates,\n isContentShown,\n items,\n uuid,\n zIndex,\n shouldHidePopupArrow,\n headline,\n focusedIndex,\n handleHide,\n ]);\n\n useEffect(() => {\n if (!contextMenuRef.current) {\n return;\n }\n\n const focusableChildSelector =\n 'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\n const hasFocusableChild = Boolean(\n contextMenuRef.current.querySelector(focusableChildSelector),\n );\n\n setShouldUseFocusableWrapper(!hasFocusableChild);\n }, [children]);\n\n return (\n <>\n <StyledContextMenu\n className={\n className\n ? `beta-chayns-context-menu ${className}`\n : 'beta-chayns-context-menu'\n }\n $isActive={isContentShown && shouldShowHoverEffect}\n $shouldAddHoverEffect={!isTouch && shouldShowHoverEffect}\n $shouldShowWrapperKeyboardHighlighting={shouldShowWrapperKeyboardHighlighting}\n $shouldUseDefaultTriggerStyles={shouldUseDefaultTriggerStyles}\n onClick={handleClick}\n onContextMenuCapture={handleContextMenu}\n onContextMenu={handleContextMenu}\n onKeyDown={handleKeyDown}\n ref={contextMenuRef}\n tabIndex={shouldUseKeyboardFocusableWrapper ? 0 : undefined}\n role={shouldUseKeyboardFocusableWrapper ? 'button' : undefined}\n aria-haspopup={shouldUseKeyboardFocusableWrapper ? 'menu' : undefined}\n aria-expanded={shouldUseKeyboardFocusableWrapper ? isContentShown : undefined}\n style={style}\n >\n {children}\n </StyledContextMenu>\n {portal}\n </>\n );\n },\n);\n\nContextMenu.displayName = 'ContextMenu';\n\nexport default ContextMenu;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,uBAAA,CAAAH,OAAA;AAaA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,mBAAA,GAAAD,sBAAA,CAAAR,OAA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,iCAAiC,GAAG,MAAM,GAAGmC,SAAU;IACtE,iBAAenC,iCAAiC,GAAGpB,cAAc,GAAGuD,SAAU;IAC9EzE,KAAK,EAAEA;EAAM,GAEZhB,QACc,CAAC,EACnBoC,MACH,CAAC;AAEX,CACJ,CAAC;AAEDxC,WAAW,CAAC8J,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjL,OAAA,GAEzBiB,WAAW","ignoreList":[]}
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.StyledContextMenu = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ var _keyboardFocusHighlighting = require("../../utils/keyboardFocusHighlighting.styles");
8
9
  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); }
9
10
  const StyledContextMenu = exports.StyledContextMenu = _styledComponents.default.span`
10
11
  align-items: center;
11
12
  cursor: pointer;
12
13
  display: flex;
14
+ position: relative;
13
15
 
14
16
  ${({
15
17
  $isActive,
@@ -38,5 +40,41 @@ const StyledContextMenu = exports.StyledContextMenu = _styledComponents.default.
38
40
  background-color: ${theme['201']};
39
41
  }
40
42
  `}
43
+
44
+ ${({
45
+ $shouldShowWrapperKeyboardHighlighting,
46
+ $shouldUseDefaultTriggerStyles
47
+ }) => $shouldShowWrapperKeyboardHighlighting && ($shouldUseDefaultTriggerStyles ? (0, _styledComponents.css)`
48
+ &:focus-visible {
49
+ outline: none;
50
+ box-shadow: none;
51
+ }
52
+
53
+ &:focus-visible > .beta-chayns-icon {
54
+ position: relative;
55
+ color: inherit;
56
+ }
57
+
58
+ &:focus-visible > .beta-chayns-icon::after {
59
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingCircleRingCss};
60
+ content: '';
61
+ position: absolute;
62
+ top: 50%;
63
+ left: 50%;
64
+ width: calc(100% + 8px);
65
+ height: calc(100% + 8px);
66
+ transform: translate(-50%, -50%);
67
+ pointer-events: none;
68
+ }
69
+ ` : (0, _styledComponents.css)`
70
+ &:focus-visible {
71
+ outline: none;
72
+ box-shadow: none;
73
+ }
74
+
75
+ &:focus-visible > * {
76
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingRingCss}
77
+ }
78
+ `)}
41
79
  `;
42
80
  //# sourceMappingURL=ContextMenu.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledContextMenu","exports","styled","span","$isActive","$shouldUseDefaultTriggerStyles","theme","css","$shouldAddHoverEffect"],"sources":["../../../../src/components/context-menu/ContextMenu.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledContextMenuProps = WithTheme<{\n $isActive: boolean;\n $shouldAddHoverEffect: boolean;\n $shouldUseDefaultTriggerStyles: boolean;\n}>;\n\nexport const StyledContextMenu = styled.span<StyledContextMenuProps>`\n align-items: center;\n cursor: pointer;\n display: flex;\n\n ${({ $isActive, $shouldUseDefaultTriggerStyles, theme }: StyledContextMenuProps) =>\n $shouldUseDefaultTriggerStyles\n ? css`\n background-color: ${$isActive ? theme['201'] : 'transparent'};\n border-radius: 3px;\n padding: 6px;\n transition: background-color 0.3s ease;\n `\n : css`\n background-color: transparent;\n border-radius: inherit;\n padding: 0;\n\n > * {\n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ACA;AACA;AACA,MAAM,CAAC;EAAEC,SAAS;EAAEC,8BAA8B;EAAEC;AAA8B,CAAC,KAC3ED,8BAA8B,GACxB,IAAAE,qBAAG;AACjB,sCAAsCH,SAAS,GAAGE,KAAK,CAAC,KAAK,CAAC,GAAG,aAAa;AAC9E;AACA;AACA;AACA,eAAe,GACD,IAAAC,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,MAAM,CAAC;EAAEC,qBAAqB;EAAEF;AAA8B,CAAC,KACvDE,qBAAqB,IACrB,IAAAD,qBAAG;AACX;AACA,oCAAoCD,KAAK,CAAC,KAAK,CAAC;AAChD;AACA,SAAS;AACT,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ContextMenu.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_keyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledContextMenu","exports","styled","span","$isActive","$shouldUseDefaultTriggerStyles","theme","css","$shouldAddHoverEffect","$shouldShowWrapperKeyboardHighlighting","keyboardFocusHighlightingCircleRingCss","keyboardFocusHighlightingRingCss"],"sources":["../../../../src/components/context-menu/ContextMenu.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport {\n keyboardFocusHighlightingCircleRingCss,\n keyboardFocusHighlightingRingCss,\n} from '../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledContextMenuProps = WithTheme<{\n $isActive: boolean;\n $shouldAddHoverEffect: boolean;\n $shouldShowWrapperKeyboardHighlighting: boolean;\n $shouldUseDefaultTriggerStyles: boolean;\n}>;\n\nexport const StyledContextMenu = styled.span<StyledContextMenuProps>`\n align-items: center;\n cursor: pointer;\n display: flex;\n position: relative;\n\n ${({ $isActive, $shouldUseDefaultTriggerStyles, theme }: StyledContextMenuProps) =>\n $shouldUseDefaultTriggerStyles\n ? css`\n background-color: ${$isActive ? theme['201'] : 'transparent'};\n border-radius: 3px;\n padding: 6px;\n transition: background-color 0.3s ease;\n `\n : css`\n background-color: transparent;\n border-radius: inherit;\n padding: 0;\n\n > * {\n width: 100%;\n }\n `}\n\n ${({ $shouldAddHoverEffect, theme }: StyledContextMenuProps) =>\n $shouldAddHoverEffect &&\n css`\n &:hover {\n background-color: ${theme['201']};\n }\n `}\n\n ${({\n $shouldShowWrapperKeyboardHighlighting,\n $shouldUseDefaultTriggerStyles,\n }: StyledContextMenuProps) =>\n $shouldShowWrapperKeyboardHighlighting &&\n ($shouldUseDefaultTriggerStyles\n ? css`\n &:focus-visible {\n outline: none;\n box-shadow: none;\n }\n\n &:focus-visible > .beta-chayns-icon {\n position: relative;\n color: inherit;\n }\n\n &:focus-visible > .beta-chayns-icon::after {\n ${keyboardFocusHighlightingCircleRingCss};\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: calc(100% + 8px);\n height: calc(100% + 8px);\n transform: translate(-50%, -50%);\n pointer-events: none;\n }\n `\n : css`\n &:focus-visible {\n outline: none;\n box-shadow: none;\n }\n\n &:focus-visible > * {\n ${keyboardFocusHighlightingRingCss}\n }\n `)}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAD,OAAA;AAGsD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,GAA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AACA;AACA;AACA;AACA;AACA;AACA,wBAAwBG,iEAAsC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GACD,IAAAH,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwBI,2DAAgC;AACxD;AACA,eAAe,CAAC;AAChB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.types.js","names":["ContextMenuAlignment","exports"],"sources":["../../../../src/components/context-menu/ContextMenu.types.ts"],"sourcesContent":["import type { CSSProperties, MouseEvent, ReactNode } from 'react';\n\n/**\n * Enum representing the possible alignments for the context menu.\n */\nexport enum ContextMenuAlignment {\n TopLeft,\n BottomLeft,\n TopRight,\n BottomRight,\n TopCenter,\n BottomCenter,\n}\n\n/**\n * Type representing the coordinates for positioning the context menu.\n */\nexport type ContextMenuCoordinates = {\n /** The x-coordinate. */\n x: number;\n /** The y-coordinate. */\n y: number;\n};\n\n/**\n * Type representing an item in the context menu.\n */\nexport type ContextMenuItem = {\n /** Optional icons for the item. Can be strings or React nodes. */\n icons?: string[] | ReactNode;\n /** Whether the item is selected. */\n isSelected?: boolean;\n /** Unique key for the item. */\n key: string;\n /** Function called when the item is clicked. */\n onClick: (event?: MouseEvent<HTMLDivElement>) => Promise<void> | void;\n /** Whether to show a spacer after the item. */\n shouldShowSpacer?: boolean;\n /** The text displayed for the item. */\n text: string;\n};\n\n/**\n * Props for the ContextMenu component.\n */\nexport type ContextMenuProps = {\n /**\n * Context menu alignment\n * @description Optional custom alignment used instead of calculating it using the alignment\n * within the page. The available alignments can be taken from the ContextMenuAlignment enum.\n * @example alignment={ContextMenuAlignment.TopLeft}\n * @optional\n */\n alignment?: ContextMenuAlignment;\n /**\n * Additional class name applied to the trigger wrapper.\n * @optional\n */\n className?: string;\n /**\n * Children element\n * @description The element over which the content of the ContextMenu should be displayed.\n * @example children={<Icon icons={['fa fa-paper-clip']} />\n * @default <Icon icons={['ts-ellipsis_v']} size={18} />\n * @optional\n */\n children?: ReactNode;\n /**\n * Container element\n * @description The element where the content of the ContextMenu should be rendered via React Portal.\n * @example container={document.body}\n * @optional\n */\n container?: Element;\n /**\n * Custom coordinates\n * @description Optional own coordinates to be used instead of calculating the alignment based\n * on the alignment of the children.\n * @example coordinates={{ x: 100, y: 200 }}\n * @optional\n */\n coordinates?: ContextMenuCoordinates;\n /**\n * Context menu headline\n * @description The headline of the context menu. If not provided, no headline will be displayed.\n * @example headline=\"Options\"\n * @optional\n */\n headline?: string;\n /**\n * Menu items\n * @description The items that will be displayed in the content of the ContextMenu. Custom icon\n * elements only will be displayed on desktop devices.\n * @example items={[{ key: '1', text: 'Option 1', onClick: () => {} }]}\n */\n items: ContextMenuItem[];\n /**\n * Hide callback function\n * @description Function to be executed when the content of the Context menu has been hidden.\n * @example onHide={() => console.log('Menu hidden')}\n * @optional\n */\n onHide?: VoidFunction;\n /**\n * Show callback function\n * @description Function to be executed when the content of the Context menu has been shown.\n * @example onShow={() => console.log('Menu shown')}\n * @optional\n */\n onShow?: VoidFunction;\n /**\n * Close on popup click flag\n * @description Whether the popup should be closed if it is clicked.\n * @default true\n * @optional\n */\n shouldCloseOnPopupClick?: boolean;\n /**\n * Disable click flag\n * @description Whether the click should be disabled.\n * @default false\n * @optional\n */\n shouldDisableClick?: boolean;\n /**\n * Hide popup arrow flag\n * @description Whether the arrow of the popup should be hidden.\n * @default false\n * @optional\n */\n shouldHidePopupArrow?: boolean;\n /**\n * Whether the default trigger padding/background styles should be applied.\n * @description Disable this when the trigger child already provides its own full visual styling.\n * @default true\n * @optional\n */\n shouldUseDefaultTriggerStyles?: boolean;\n /**\n * Show hover effect flag\n * @description Whether the hover effect should be shown.\n * @default false\n * @optional\n */\n shouldShowHoverEffect?: boolean;\n /**\n * Inline styles applied to the trigger wrapper.\n * @optional\n */\n style?: CSSProperties;\n /**\n * Vertical offset between the trigger element and the context menu.\n * @description Use this prop to fine-tune the context menu position on the Y axis. Positive and\n * negative values can be used depending on the desired spacing.\n * @default 0\n * @example yOffset={8}\n * @optional\n */\n yOffset?: number;\n /**\n * Z-index value\n * @description The z-index of the popup.\n * @example zIndex={100}\n * @default 20\n * @optional\n */\n zIndex?: number;\n};\n\n/**\n * Ref interface for the ContextMenu component.\n */\nexport interface ContextMenuRef {\n /** Hides the context menu. */\n hide: VoidFunction;\n /** Shows the context menu. */\n show: VoidFunction;\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AAFA,IAGYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAShC;AACA;AACA;AAQA;AACA;AACA;AAgBA;AACA;AACA;AA6HA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"ContextMenu.types.js","names":["ContextMenuAlignment","exports"],"sources":["../../../../src/components/context-menu/ContextMenu.types.ts"],"sourcesContent":["import type { CSSProperties, MouseEvent, ReactNode } from 'react';\n\n/**\n * Enum representing the possible alignments for the context menu.\n */\nexport enum ContextMenuAlignment {\n TopLeft,\n BottomLeft,\n TopRight,\n BottomRight,\n TopCenter,\n BottomCenter,\n}\n\n/**\n * Type representing the coordinates for positioning the context menu.\n */\nexport type ContextMenuCoordinates = {\n /** The x-coordinate. */\n x: number;\n /** The y-coordinate. */\n y: number;\n};\n\n/**\n * Type representing an item in the context menu.\n */\nexport type ContextMenuItem = {\n /** Optional icons for the item. Can be strings or React nodes. */\n icons?: string[] | ReactNode;\n /** Whether the item is selected. */\n isSelected?: boolean;\n /** Unique key for the item. */\n key: string;\n /** Function called when the item is clicked. */\n onClick: (event?: MouseEvent<HTMLDivElement>) => Promise<void> | void;\n /** Whether to show a spacer after the item. */\n shouldShowSpacer?: boolean;\n /** The text displayed for the item. */\n text: string;\n};\n\n/**\n * Props for the ContextMenu component.\n */\nexport type ContextMenuProps = {\n /**\n * Context menu alignment\n * @description Optional custom alignment used instead of calculating it using the alignment\n * within the page. The available alignments can be taken from the ContextMenuAlignment enum.\n * @example alignment={ContextMenuAlignment.TopLeft}\n * @optional\n */\n alignment?: ContextMenuAlignment;\n /**\n * Additional class name applied to the trigger wrapper.\n * @optional\n */\n className?: string;\n /**\n * Children element\n * @description The element over which the content of the ContextMenu should be displayed.\n * @example children={<Icon icons={['fa fa-paper-clip']} />\n * @default <Icon icons={['ts-ellipsis_v']} size={18} />\n * @optional\n */\n children?: ReactNode;\n /**\n * Container element\n * @description The element where the content of the ContextMenu should be rendered via React Portal.\n * @example container={document.body}\n * @optional\n */\n container?: Element;\n /**\n * Custom coordinates\n * @description Optional own coordinates to be used instead of calculating the alignment based\n * on the alignment of the children.\n * @example coordinates={{ x: 100, y: 200 }}\n * @optional\n */\n coordinates?: ContextMenuCoordinates;\n /**\n * Context menu headline\n * @description The headline of the context menu. If not provided, no headline will be displayed.\n * @example headline=\"Options\"\n * @optional\n */\n headline?: string;\n /**\n * Menu items\n * @description The items that will be displayed in the content of the ContextMenu. Custom icon\n * elements only will be displayed on desktop devices.\n * @example items={[{ key: '1', text: 'Option 1', onClick: () => {} }]}\n */\n items: ContextMenuItem[];\n /**\n * Hide callback function\n * @description Function to be executed when the content of the Context menu has been hidden.\n * @example onHide={() => console.log('Menu hidden')}\n * @optional\n */\n onHide?: VoidFunction;\n /**\n * Show callback function\n * @description Function to be executed when the content of the Context menu has been shown.\n * @example onShow={() => console.log('Menu shown')}\n * @optional\n */\n onShow?: VoidFunction;\n /**\n * Close on popup click flag\n * @description Whether the popup should be closed if it is clicked.\n * @default true\n * @optional\n */\n shouldCloseOnPopupClick?: boolean;\n /**\n * Disable click flag\n * @description Whether the click should be disabled.\n * @default false\n * @optional\n */\n shouldDisableClick?: boolean;\n /**\n * Hide popup arrow flag\n * @description Whether the arrow of the popup should be hidden.\n * @default false\n * @optional\n */\n shouldHidePopupArrow?: boolean;\n /**\n * Whether the default trigger padding/background styles should be applied.\n * @description Disable this when the trigger child already provides its own full visual styling.\n * @default true\n * @optional\n */\n shouldUseDefaultTriggerStyles?: boolean;\n /**\n * Show hover effect flag\n * @description Whether the hover effect should be shown.\n * @default false\n * @optional\n */\n shouldShowHoverEffect?: boolean;\n /**\n * Enables keyboard-only focus highlighting for the trigger.\n * @default false\n * @optional\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * Inline styles applied to the trigger wrapper.\n * @optional\n */\n style?: CSSProperties;\n /**\n * Vertical offset between the trigger element and the context menu.\n * @description Use this prop to fine-tune the context menu position on the Y axis. Positive and\n * negative values can be used depending on the desired spacing.\n * @default 0\n * @example yOffset={8}\n * @optional\n */\n yOffset?: number;\n /**\n * Z-index value\n * @description The z-index of the popup.\n * @example zIndex={100}\n * @default 20\n * @optional\n */\n zIndex?: number;\n};\n\n/**\n * Ref interface for the ContextMenu component.\n */\nexport interface ContextMenuRef {\n /** Hides the context menu. */\n hide: VoidFunction;\n /** Shows the context menu. */\n show: VoidFunction;\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AAFA,IAGYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAShC;AACA;AACA;AAQA;AACA;AACA;AAgBA;AACA;AACA;AAmIA;AACA;AACA","ignoreList":[]}
@@ -27,7 +27,8 @@ const FileInput = /*#__PURE__*/(0, _react.forwardRef)(({
27
27
  fileSelectionPlaceholder = 'Dateien hochladen',
28
28
  imageSelectPlaceholder,
29
29
  shouldPreventImageUpload = false,
30
- shouldAllowDownload
30
+ shouldAllowDownload,
31
+ shouldEnableKeyboardHighlighting
31
32
  }, ref) => {
32
33
  const [internalFiles, setInternalFiles] = (0, _react.useState)([]);
33
34
  const [internalImages, setInternalImages] = (0, _react.useState)([]);
@@ -162,6 +163,7 @@ const FileInput = /*#__PURE__*/(0, _react.forwardRef)(({
162
163
  }, [files, internalFiles, internalImages]);
163
164
  return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_FileInput.StyledFileInput, null, /*#__PURE__*/_react.default.createElement(_FileSelect.default, {
164
165
  shouldPreventImageUpload: shouldPreventImageUpload,
166
+ shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlighting,
165
167
  maxFiles: maxFiles,
166
168
  fileTypes: fileTypes,
167
169
  fileSelectionIcons: fileSelectionIcons,
@@ -175,7 +177,7 @@ const FileInput = /*#__PURE__*/(0, _react.forwardRef)(({
175
177
  files: filesToDisplay,
176
178
  onRemove: handleDeleteFile,
177
179
  shouldAllowDownload: shouldAllowDownload
178
- })), [shouldPreventImageUpload, maxFiles, fileTypes, fileSelectionIcons, fileSelectionPlaceholder, imageSelectIcons, imageSelectPlaceholder, maxFileSizeInMB, internalIsDisabled, handleAdd, filesToDisplay, handleDeleteFile, shouldAllowDownload]);
180
+ })), [shouldPreventImageUpload, shouldEnableKeyboardHighlighting, maxFiles, fileTypes, fileSelectionIcons, fileSelectionPlaceholder, imageSelectIcons, imageSelectPlaceholder, maxFileSizeInMB, internalIsDisabled, handleAdd, filesToDisplay, handleDeleteFile, shouldAllowDownload]);
179
181
  });
180
182
  FileInput.displayName = 'FileInput';
181
183
  var _default = exports.default = FileInput;
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.js","names":["_react","_interopRequireWildcard","require","_file","_FileInput","_FileList","_interopRequireDefault","_FileSelect","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TSIMG_FILE_TYPES","exports","STREAMINGSERVICE_FILE_TYPES","FileInput","forwardRef","fileSelectionIcons","imageSelectIcons","fileTypes","onMaxFilesReached","maxFiles","onRemove","files","isDisabled","maxFileSizeInMB","onAdd","fileSelectionPlaceholder","imageSelectPlaceholder","shouldPreventImageUpload","shouldAllowDownload","ref","internalFiles","setInternalFiles","useState","internalImages","setInternalImages","handleInputClear","useImperativeHandle","clear","handleAddImages","useCallback","images","newImages","forEach","image","filterDuplicateFileUrls","newFile","push","tmp","slice","length","prevState","handleAddFiles","newFiles","newFileItems","file","isValidFileType","types","filterDuplicateFile","handleAdd","Array","isArray","handleDeleteFile","id","fileToDelete","filteredFiles","filter","name","filteredImages","internalIsDisabled","useMemo","filesToDisplay","items","map","size","mimeType","type","source","url","createElement","StyledFileInput","displayName","_default"],"sources":["../../../../src/components/file-input/FileInput.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useState } from 'react';\nimport { filterDuplicateFile, filterDuplicateFileUrls, isValidFileType } from '../../utils/file';\nimport { StyledFileInput } from './FileInput.styles';\nimport FileList, { IFileItem } from '../file-list/FileList';\nimport FileSelect, { UploadedFile } from '../file-select/FileSelect';\n\nexport const TSIMG_FILE_TYPES =\n 'image/png, image/jpg, image/jpeg, image/gif, image/webp, image/svg+xml, image/avif';\n\nexport const STREAMINGSERVICE_FILE_TYPES =\n 'video/mp4, video/webm, video/avi, video/flv, video/wmv, video/mpg, video/quicktime';\n\nexport type FileInputProps = {\n /**\n * Already uploaded files to display.\n */\n files?: IFileItem[];\n /**\n * An array of icons that should be displayed inside the FileInput\n */\n fileSelectionIcons?: string[];\n /**\n * The text that should be displayed inside the FileInput.\n */\n fileSelectionPlaceholder?: string;\n /**\n * The filetypes that could be selected. Example for multiple types: 'image/*, video/*'.\n */\n fileTypes?: string;\n /**\n * The icon of the image selection.\n */\n imageSelectIcons?: string[];\n /**\n * If set, pictures can be select via Pixabay.\n */\n imageSelectPlaceholder?: string;\n /**\n * Whether the FileInput is disabled.\n */\n isDisabled?: boolean;\n /**\n * The maximum amount of Files that can be uploaded.\n */\n maxFiles?: number;\n /**\n * The maximum size of a file in MB.\n */\n maxFileSizeInMB?: number;\n /**\n * A function to be executed when files are added.\n */\n onAdd?: (files: File[] | UploadedFile[]) => void;\n /**\n * Function to be executed when the maximum amount of Files are reached.\n */\n onMaxFilesReached?: () => void;\n /**\n * A function to be executed when a file is removed.\n */\n onRemove?: (file: File | IFileItem | UploadedFile) => void;\n /**\n * Whether the image upload should be prevented.\n */\n shouldPreventImageUpload?: boolean;\n /**\n * Whether to show a download icon for files that have a `source` set.\n */\n shouldAllowDownload?: boolean;\n};\n\nexport type FileInputRef = {\n clear: () => void;\n};\n\nconst FileInput = forwardRef<FileInputRef, FileInputProps>(\n (\n {\n fileSelectionIcons = ['fa fa-upload'],\n imageSelectIcons = ['ts-image'],\n fileTypes,\n onMaxFilesReached,\n maxFiles,\n onRemove,\n files,\n isDisabled,\n maxFileSizeInMB,\n onAdd,\n fileSelectionPlaceholder = 'Dateien hochladen',\n imageSelectPlaceholder,\n shouldPreventImageUpload = false,\n shouldAllowDownload,\n },\n ref,\n ) => {\n const [internalFiles, setInternalFiles] = useState<File[]>([]);\n const [internalImages, setInternalImages] = useState<UploadedFile[]>([]);\n\n const handleInputClear = () => {\n setInternalFiles([]);\n setInternalImages([]);\n };\n\n useImperativeHandle(\n ref,\n () => ({\n clear: handleInputClear,\n }),\n [],\n );\n\n const handleAddImages = useCallback(\n (images: UploadedFile[]) => {\n const newImages: UploadedFile[] = [];\n\n images.forEach((image) => {\n if (!filterDuplicateFileUrls({ files: internalImages, newFile: image })) {\n newImages.push(image);\n }\n });\n\n let tmp = newImages;\n\n if (maxFiles) {\n tmp = newImages.slice(\n 0,\n maxFiles -\n (internalFiles.length + internalImages.length + (files?.length ?? 0)),\n );\n }\n\n if (tmp.length > 0 && typeof onAdd === 'function') {\n onAdd(tmp);\n }\n\n setInternalImages((prevState) => [...prevState, ...tmp]);\n },\n [files?.length, internalFiles.length, internalImages, maxFiles, onAdd],\n );\n\n const handleAddFiles = useCallback(\n (newFiles: File[]) => {\n const newFileItems: File[] = [];\n\n newFiles.forEach((file) => {\n if (fileTypes && !isValidFileType({ file, types: fileTypes })) {\n return;\n }\n\n if (file && !filterDuplicateFile({ files: internalFiles, newFile: file })) {\n newFileItems.push(file);\n }\n });\n\n let tmp = newFileItems;\n\n if (maxFiles) {\n tmp = newFileItems.slice(\n 0,\n maxFiles - (internalFiles.length + (files?.length ?? 0)),\n );\n }\n\n if (tmp.length > 0 && typeof onAdd === 'function') {\n onAdd(tmp);\n }\n\n setInternalFiles((prevState) => [...prevState, ...tmp]);\n },\n [fileTypes, files?.length, internalFiles, maxFiles, onAdd],\n );\n\n const handleAdd = useCallback(\n (newFiles: File[] | UploadedFile[]) => {\n if (Array.isArray(newFiles) && newFiles.length > 0) {\n if (newFiles[0] && 'url' in newFiles[0]) {\n handleAddImages(newFiles as UploadedFile[]);\n } else {\n handleAddFiles(newFiles as File[]);\n }\n }\n },\n [handleAddFiles, handleAddImages],\n );\n\n const handleDeleteFile = useCallback(\n (id: string) => {\n let fileToDelete: File | IFileItem | UploadedFile | undefined;\n\n const filteredFiles = internalFiles.filter((file) => {\n const { name } = file;\n\n if (name === id) {\n fileToDelete = file;\n }\n\n return name !== id;\n });\n\n setInternalFiles(filteredFiles);\n\n if (!fileToDelete) {\n const filteredImages = internalImages.filter((image) => {\n if (image.name === id) {\n fileToDelete = image;\n }\n\n return image.name !== id;\n });\n\n setInternalImages(filteredImages);\n }\n\n if (!fileToDelete) {\n files?.forEach((file) => {\n if (file.id === id || file.name === id) {\n fileToDelete = file;\n }\n });\n }\n\n if (!fileToDelete || typeof onRemove !== 'function') {\n return;\n }\n\n onRemove(fileToDelete);\n },\n [files, internalFiles, internalImages, onRemove],\n );\n\n const internalIsDisabled = useMemo(() => {\n if (isDisabled) {\n return true;\n }\n\n if (maxFiles) {\n if (internalFiles.length + internalImages.length >= maxFiles) {\n if (typeof onMaxFilesReached === 'function') {\n onMaxFilesReached();\n }\n\n return true;\n }\n }\n\n return false;\n }, [internalFiles.length, internalImages.length, isDisabled, maxFiles, onMaxFilesReached]);\n\n const filesToDisplay: IFileItem[] = useMemo(() => {\n const items: IFileItem[] = internalFiles.map((file) => ({\n id: file.name,\n name: file.name,\n size: file.size,\n mimeType: file.type,\n source: file,\n }));\n\n internalImages.forEach((image) => {\n items.push({\n id: image.name ?? image.url,\n name: image.name ?? image.url,\n size: image.size ?? 0,\n mimeType: 'image/png',\n source: image.url,\n });\n });\n\n files?.forEach((file) => {\n items.push(file);\n });\n\n return items;\n }, [files, internalFiles, internalImages]);\n\n return useMemo(\n () => (\n <StyledFileInput>\n <FileSelect\n shouldPreventImageUpload={shouldPreventImageUpload}\n maxFiles={maxFiles}\n fileTypes={fileTypes}\n fileSelectionIcons={fileSelectionIcons}\n fileSelectionPlaceholder={fileSelectionPlaceholder}\n imageSelectIcons={imageSelectIcons}\n imageSelectPlaceholder={imageSelectPlaceholder}\n maxFileSizeInMB={maxFileSizeInMB}\n isDisabled={internalIsDisabled}\n onAdd={handleAdd}\n />\n <FileList\n files={filesToDisplay}\n onRemove={handleDeleteFile}\n shouldAllowDownload={shouldAllowDownload}\n />\n </StyledFileInput>\n ),\n [\n shouldPreventImageUpload,\n maxFiles,\n fileTypes,\n fileSelectionIcons,\n fileSelectionPlaceholder,\n imageSelectIcons,\n imageSelectPlaceholder,\n maxFileSizeInMB,\n internalIsDisabled,\n handleAdd,\n filesToDisplay,\n handleDeleteFile,\n shouldAllowDownload,\n ],\n );\n },\n);\n\nFileInput.displayName = 'FileInput';\n\nexport default FileInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAD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AAK,EAAEiD,cAAe;IACtBlD,QAAQ,EAAEyC,gBAAiB;IAC3BjC,mBAAmB,EAAEA;EAAoB,CAC5C,CACY,CACpB,EACD,CACID,wBAAwB,EACxBR,QAAQ,EACRF,SAAS,EACTF,kBAAkB,EAClBU,wBAAwB,EACxBT,gBAAgB,EAChBU,sBAAsB,EACtBH,eAAe,EACf6C,kBAAkB,EAClBV,SAAS,EACTY,cAAc,EACdT,gBAAgB,EAChBjC,mBAAmB,CAE3B,CAAC;AACL,CACJ,CAAC;AAEDf,SAAS,CAACmE,WAAW,GAAG,WAAW;AAAC,IAAAC,QAAA,GAAAtE,OAAA,CAAAlB,OAAA,GAErBoB,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"FileInput.js","names":["_react","_interopRequireWildcard","require","_file","_FileInput","_FileList","_interopRequireDefault","_FileSelect","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TSIMG_FILE_TYPES","exports","STREAMINGSERVICE_FILE_TYPES","FileInput","forwardRef","fileSelectionIcons","imageSelectIcons","fileTypes","onMaxFilesReached","maxFiles","onRemove","files","isDisabled","maxFileSizeInMB","onAdd","fileSelectionPlaceholder","imageSelectPlaceholder","shouldPreventImageUpload","shouldAllowDownload","shouldEnableKeyboardHighlighting","ref","internalFiles","setInternalFiles","useState","internalImages","setInternalImages","handleInputClear","useImperativeHandle","clear","handleAddImages","useCallback","images","newImages","forEach","image","filterDuplicateFileUrls","newFile","push","tmp","slice","length","prevState","handleAddFiles","newFiles","newFileItems","file","isValidFileType","types","filterDuplicateFile","handleAdd","Array","isArray","handleDeleteFile","id","fileToDelete","filteredFiles","filter","name","filteredImages","internalIsDisabled","useMemo","filesToDisplay","items","map","size","mimeType","type","source","url","createElement","StyledFileInput","displayName","_default"],"sources":["../../../../src/components/file-input/FileInput.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useState } from 'react';\nimport { filterDuplicateFile, filterDuplicateFileUrls, isValidFileType } from '../../utils/file';\nimport { StyledFileInput } from './FileInput.styles';\nimport FileList, { IFileItem } from '../file-list/FileList';\nimport FileSelect, { UploadedFile } from '../file-select/FileSelect';\n\nexport const TSIMG_FILE_TYPES =\n 'image/png, image/jpg, image/jpeg, image/gif, image/webp, image/svg+xml, image/avif';\n\nexport const STREAMINGSERVICE_FILE_TYPES =\n 'video/mp4, video/webm, video/avi, video/flv, video/wmv, video/mpg, video/quicktime';\n\nexport type FileInputProps = {\n /**\n * Already uploaded files to display.\n */\n files?: IFileItem[];\n /**\n * An array of icons that should be displayed inside the FileInput\n */\n fileSelectionIcons?: string[];\n /**\n * The text that should be displayed inside the FileInput.\n */\n fileSelectionPlaceholder?: string;\n /**\n * The filetypes that could be selected. Example for multiple types: 'image/*, video/*'.\n */\n fileTypes?: string;\n /**\n * The icon of the image selection.\n */\n imageSelectIcons?: string[];\n /**\n * If set, pictures can be select via Pixabay.\n */\n imageSelectPlaceholder?: string;\n /**\n * Whether the FileInput is disabled.\n */\n isDisabled?: boolean;\n /**\n * The maximum amount of Files that can be uploaded.\n */\n maxFiles?: number;\n /**\n * The maximum size of a file in MB.\n */\n maxFileSizeInMB?: number;\n /**\n * A function to be executed when files are added.\n */\n onAdd?: (files: File[] | UploadedFile[]) => void;\n /**\n * Function to be executed when the maximum amount of Files are reached.\n */\n onMaxFilesReached?: () => void;\n /**\n * A function to be executed when a file is removed.\n */\n onRemove?: (file: File | IFileItem | UploadedFile) => void;\n /**\n * Whether the image upload should be prevented.\n */\n shouldPreventImageUpload?: boolean;\n /**\n * Whether to show a download icon for files that have a `source` set.\n */\n shouldAllowDownload?: boolean;\n /**\n * Enables keyboard-only focus highlighting for the file selection trigger.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nexport type FileInputRef = {\n clear: () => void;\n};\n\nconst FileInput = forwardRef<FileInputRef, FileInputProps>(\n (\n {\n fileSelectionIcons = ['fa fa-upload'],\n imageSelectIcons = ['ts-image'],\n fileTypes,\n onMaxFilesReached,\n maxFiles,\n onRemove,\n files,\n isDisabled,\n maxFileSizeInMB,\n onAdd,\n fileSelectionPlaceholder = 'Dateien hochladen',\n imageSelectPlaceholder,\n shouldPreventImageUpload = false,\n shouldAllowDownload,\n shouldEnableKeyboardHighlighting,\n },\n ref,\n ) => {\n const [internalFiles, setInternalFiles] = useState<File[]>([]);\n const [internalImages, setInternalImages] = useState<UploadedFile[]>([]);\n\n const handleInputClear = () => {\n setInternalFiles([]);\n setInternalImages([]);\n };\n\n useImperativeHandle(\n ref,\n () => ({\n clear: handleInputClear,\n }),\n [],\n );\n\n const handleAddImages = useCallback(\n (images: UploadedFile[]) => {\n const newImages: UploadedFile[] = [];\n\n images.forEach((image) => {\n if (!filterDuplicateFileUrls({ files: internalImages, newFile: image })) {\n newImages.push(image);\n }\n });\n\n let tmp = newImages;\n\n if (maxFiles) {\n tmp = newImages.slice(\n 0,\n maxFiles -\n (internalFiles.length + internalImages.length + (files?.length ?? 0)),\n );\n }\n\n if (tmp.length > 0 && typeof onAdd === 'function') {\n onAdd(tmp);\n }\n\n setInternalImages((prevState) => [...prevState, ...tmp]);\n },\n [files?.length, internalFiles.length, internalImages, maxFiles, onAdd],\n );\n\n const handleAddFiles = useCallback(\n (newFiles: File[]) => {\n const newFileItems: File[] = [];\n\n newFiles.forEach((file) => {\n if (fileTypes && !isValidFileType({ file, types: fileTypes })) {\n return;\n }\n\n if (file && !filterDuplicateFile({ files: internalFiles, newFile: file })) {\n newFileItems.push(file);\n }\n });\n\n let tmp = newFileItems;\n\n if (maxFiles) {\n tmp = newFileItems.slice(\n 0,\n maxFiles - (internalFiles.length + (files?.length ?? 0)),\n );\n }\n\n if (tmp.length > 0 && typeof onAdd === 'function') {\n onAdd(tmp);\n }\n\n setInternalFiles((prevState) => [...prevState, ...tmp]);\n },\n [fileTypes, files?.length, internalFiles, maxFiles, onAdd],\n );\n\n const handleAdd = useCallback(\n (newFiles: File[] | UploadedFile[]) => {\n if (Array.isArray(newFiles) && newFiles.length > 0) {\n if (newFiles[0] && 'url' in newFiles[0]) {\n handleAddImages(newFiles as UploadedFile[]);\n } else {\n handleAddFiles(newFiles as File[]);\n }\n }\n },\n [handleAddFiles, handleAddImages],\n );\n\n const handleDeleteFile = useCallback(\n (id: string) => {\n let fileToDelete: File | IFileItem | UploadedFile | undefined;\n\n const filteredFiles = internalFiles.filter((file) => {\n const { name } = file;\n\n if (name === id) {\n fileToDelete = file;\n }\n\n return name !== id;\n });\n\n setInternalFiles(filteredFiles);\n\n if (!fileToDelete) {\n const filteredImages = internalImages.filter((image) => {\n if (image.name === id) {\n fileToDelete = image;\n }\n\n return image.name !== id;\n });\n\n setInternalImages(filteredImages);\n }\n\n if (!fileToDelete) {\n files?.forEach((file) => {\n if (file.id === id || file.name === id) {\n fileToDelete = file;\n }\n });\n }\n\n if (!fileToDelete || typeof onRemove !== 'function') {\n return;\n }\n\n onRemove(fileToDelete);\n },\n [files, internalFiles, internalImages, onRemove],\n );\n\n const internalIsDisabled = useMemo(() => {\n if (isDisabled) {\n return true;\n }\n\n if (maxFiles) {\n if (internalFiles.length + internalImages.length >= maxFiles) {\n if (typeof onMaxFilesReached === 'function') {\n onMaxFilesReached();\n }\n\n return true;\n }\n }\n\n return false;\n }, [internalFiles.length, internalImages.length, isDisabled, maxFiles, onMaxFilesReached]);\n\n const filesToDisplay: IFileItem[] = useMemo(() => {\n const items: IFileItem[] = internalFiles.map((file) => ({\n id: file.name,\n name: file.name,\n size: file.size,\n mimeType: file.type,\n source: file,\n }));\n\n internalImages.forEach((image) => {\n items.push({\n id: image.name ?? image.url,\n name: image.name ?? image.url,\n size: image.size ?? 0,\n mimeType: 'image/png',\n source: image.url,\n });\n });\n\n files?.forEach((file) => {\n items.push(file);\n });\n\n return items;\n }, [files, internalFiles, internalImages]);\n\n return useMemo(\n () => (\n <StyledFileInput>\n <FileSelect\n shouldPreventImageUpload={shouldPreventImageUpload}\n shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlighting}\n maxFiles={maxFiles}\n fileTypes={fileTypes}\n fileSelectionIcons={fileSelectionIcons}\n fileSelectionPlaceholder={fileSelectionPlaceholder}\n imageSelectIcons={imageSelectIcons}\n imageSelectPlaceholder={imageSelectPlaceholder}\n maxFileSizeInMB={maxFileSizeInMB}\n isDisabled={internalIsDisabled}\n onAdd={handleAdd}\n />\n <FileList\n files={filesToDisplay}\n onRemove={handleDeleteFile}\n shouldAllowDownload={shouldAllowDownload}\n />\n </StyledFileInput>\n ),\n [\n shouldPreventImageUpload,\n shouldEnableKeyboardHighlighting,\n maxFiles,\n fileTypes,\n fileSelectionIcons,\n fileSelectionPlaceholder,\n imageSelectIcons,\n imageSelectPlaceholder,\n maxFileSizeInMB,\n internalIsDisabled,\n handleAdd,\n filesToDisplay,\n handleDeleteFile,\n shouldAllowDownload,\n ],\n );\n },\n);\n\nFileInput.displayName = 'FileInput';\n\nexport default FileInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAAqE,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,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