@chayns-components/core 5.4.13 → 5.4.14-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 (462) hide show
  1. package/AGENTS.md +12 -0
  2. package/lib/cjs/components/accordion/Accordion.js +107 -12
  3. package/lib/cjs/components/accordion/Accordion.js.map +1 -1
  4. package/lib/cjs/components/accordion/Accordion.styles.js +23 -3
  5. package/lib/cjs/components/accordion/Accordion.styles.js.map +1 -1
  6. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
  7. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  8. package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js +36 -19
  9. package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  10. package/lib/cjs/components/accordion/accordion-head/AccordionHead.js +6 -3
  11. package/lib/cjs/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  12. package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
  13. package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  14. package/lib/cjs/components/amount-control/AmountControl.js +31 -17
  15. package/lib/cjs/components/amount-control/AmountControl.js.map +1 -1
  16. package/lib/cjs/components/amount-control/AmountControl.styles.js +18 -2
  17. package/lib/cjs/components/amount-control/AmountControl.styles.js.map +1 -1
  18. package/lib/cjs/components/button/Button.js +5 -1
  19. package/lib/cjs/components/button/Button.js.map +1 -1
  20. package/lib/cjs/components/button/Button.styles.js +10 -0
  21. package/lib/cjs/components/button/Button.styles.js.map +1 -1
  22. package/lib/cjs/components/button/Button.types.js.map +1 -1
  23. package/lib/cjs/components/checkbox/Checkbox.js +5 -1
  24. package/lib/cjs/components/checkbox/Checkbox.js.map +1 -1
  25. package/lib/cjs/components/checkbox/Checkbox.styles.js +29 -2
  26. package/lib/cjs/components/checkbox/Checkbox.styles.js.map +1 -1
  27. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  28. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  29. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  30. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  31. package/lib/cjs/components/combobox/ComboBox.js +68 -11
  32. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  33. package/lib/cjs/components/combobox/ComboBox.styles.js +11 -0
  34. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  35. package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -1
  36. package/lib/cjs/components/context-menu/ContextMenu.js +146 -42
  37. package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
  38. package/lib/cjs/components/context-menu/ContextMenu.styles.js +38 -0
  39. package/lib/cjs/components/context-menu/ContextMenu.styles.js.map +1 -1
  40. package/lib/cjs/components/context-menu/ContextMenu.types.js.map +1 -1
  41. package/lib/cjs/components/context-menu/ContextMenu.utils.js +27 -1
  42. package/lib/cjs/components/context-menu/ContextMenu.utils.js.map +1 -1
  43. package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js +3 -8
  44. package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  45. package/lib/cjs/components/file-input/FileInput.js +4 -2
  46. package/lib/cjs/components/file-input/FileInput.js.map +1 -1
  47. package/lib/cjs/components/file-list/file-item/FileItem.js +48 -25
  48. package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
  49. package/lib/cjs/components/file-list/file-item/FileItem.styles.js +25 -1
  50. package/lib/cjs/components/file-list/file-item/FileItem.styles.js.map +1 -1
  51. package/lib/cjs/components/file-select/FileSelect.js +27 -4
  52. package/lib/cjs/components/file-select/FileSelect.js.map +1 -1
  53. package/lib/cjs/components/file-select/FileSelect.styles.js +10 -0
  54. package/lib/cjs/components/file-select/FileSelect.styles.js.map +1 -1
  55. package/lib/cjs/components/filter/Filter.js +51 -16
  56. package/lib/cjs/components/filter/Filter.js.map +1 -1
  57. package/lib/cjs/components/filter/Filter.styles.js +9 -0
  58. package/lib/cjs/components/filter/Filter.styles.js.map +1 -1
  59. package/lib/cjs/components/filter/filter-content/FilterContent.js +14 -5
  60. package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
  61. package/lib/cjs/components/filter/filter-content/FilterContent.types.js.map +1 -1
  62. package/lib/cjs/components/filter-buttons/FilterButtons.js +69 -4
  63. package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
  64. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js +40 -2
  65. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  66. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  67. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  68. package/lib/cjs/components/grid-image/GridImage.js +20 -2
  69. package/lib/cjs/components/grid-image/GridImage.js.map +1 -1
  70. package/lib/cjs/components/grid-image/GridImage.styles.js +11 -2
  71. package/lib/cjs/components/grid-image/GridImage.styles.js.map +1 -1
  72. package/lib/cjs/components/grouped-image/GroupedImage.js +23 -4
  73. package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
  74. package/lib/cjs/components/grouped-image/GroupedImage.styles.js +9 -0
  75. package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
  76. package/lib/cjs/components/highlight-slider/HighlightSlider.js +13 -3
  77. package/lib/cjs/components/highlight-slider/HighlightSlider.js.map +1 -1
  78. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +21 -4
  79. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  80. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +11 -2
  81. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  82. package/lib/cjs/components/icon/Icon.js +24 -5
  83. package/lib/cjs/components/icon/Icon.js.map +1 -1
  84. package/lib/cjs/components/icon/Icon.styles.js +23 -0
  85. package/lib/cjs/components/icon/Icon.styles.js.map +1 -1
  86. package/lib/cjs/components/input/Input.js +29 -8
  87. package/lib/cjs/components/input/Input.js.map +1 -1
  88. package/lib/cjs/components/input/Input.styles.js +38 -3
  89. package/lib/cjs/components/input/Input.styles.js.map +1 -1
  90. package/lib/cjs/components/list/List.js +124 -37
  91. package/lib/cjs/components/list/List.js.map +1 -1
  92. package/lib/cjs/components/list/List.utils.js +213 -1
  93. package/lib/cjs/components/list/List.utils.js.map +1 -1
  94. package/lib/cjs/components/list/list-item/ListItem.js +84 -3
  95. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  96. package/lib/cjs/components/list/list-item/ListItem.styles.js +7 -0
  97. package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
  98. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js +5 -1
  99. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  100. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +5 -1
  101. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  102. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +1 -0
  103. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  104. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +3 -0
  105. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  106. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +1 -0
  107. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  108. package/lib/cjs/components/list/list-item/useListItemFocus.js +47 -0
  109. package/lib/cjs/components/list/list-item/useListItemFocus.js.map +1 -0
  110. package/lib/cjs/components/mention-finder/MentionFinder.js +43 -5
  111. package/lib/cjs/components/mention-finder/MentionFinder.js.map +1 -1
  112. package/lib/cjs/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  113. package/lib/cjs/components/multi-action-button/MultiActionButton.js +36 -3
  114. package/lib/cjs/components/multi-action-button/MultiActionButton.js.map +1 -1
  115. package/lib/cjs/components/multi-action-button/MultiActionButton.styles.js +6 -0
  116. package/lib/cjs/components/multi-action-button/MultiActionButton.styles.js.map +1 -1
  117. package/lib/cjs/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  118. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js +7 -1
  119. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  120. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  121. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  122. package/lib/cjs/components/number-input/NumberInput.js +13 -10
  123. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  124. package/lib/cjs/components/page-provider/PageProvider.js +4 -2
  125. package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
  126. package/lib/cjs/components/popup/Popup.js +8 -1
  127. package/lib/cjs/components/popup/Popup.js.map +1 -1
  128. package/lib/cjs/components/radio-button/RadioButton.js +29 -15
  129. package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
  130. package/lib/cjs/components/radio-button/RadioButton.styles.js +19 -8
  131. package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
  132. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  133. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  134. package/lib/cjs/components/search-box/SearchBox.js +21 -6
  135. package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
  136. package/lib/cjs/components/search-input/SearchInput.js +56 -43
  137. package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
  138. package/lib/cjs/components/search-input/SearchInput.styles.js +26 -2
  139. package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
  140. package/lib/cjs/components/select-button/SelectButton.js +4 -2
  141. package/lib/cjs/components/select-button/SelectButton.js.map +1 -1
  142. package/lib/cjs/components/setup-wizard/SetupWizard.js +10 -4
  143. package/lib/cjs/components/setup-wizard/SetupWizard.js.map +1 -1
  144. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  145. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  146. package/lib/cjs/components/sharing-bar/SharingBar.js +31 -6
  147. package/lib/cjs/components/sharing-bar/SharingBar.js.map +1 -1
  148. package/lib/cjs/components/sharing-bar/SharingBar.styles.js +5 -0
  149. package/lib/cjs/components/sharing-bar/SharingBar.styles.js.map +1 -1
  150. package/lib/cjs/components/sharing-button/SharingButton.js +4 -2
  151. package/lib/cjs/components/sharing-button/SharingButton.js.map +1 -1
  152. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js +3 -1
  153. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  154. package/lib/cjs/components/signature/Signature.js +6 -3
  155. package/lib/cjs/components/signature/Signature.js.map +1 -1
  156. package/lib/cjs/components/slider/Slider.js +30 -7
  157. package/lib/cjs/components/slider/Slider.js.map +1 -1
  158. package/lib/cjs/components/slider/Slider.styles.js +9 -2
  159. package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
  160. package/lib/cjs/components/slider-button/SliderButton.js +63 -6
  161. package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
  162. package/lib/cjs/components/slider-button/SliderButton.styles.js +15 -2
  163. package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
  164. package/lib/cjs/components/slider-button/SliderButton.types.js +6 -0
  165. package/lib/cjs/components/slider-button/SliderButton.types.js.map +1 -0
  166. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js +66 -0
  167. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  168. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js +47 -0
  169. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  170. package/lib/cjs/components/tag-input/TagInput.js +92 -36
  171. package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
  172. package/lib/cjs/components/tag-input/TagInput.styles.js +29 -3
  173. package/lib/cjs/components/tag-input/TagInput.styles.js.map +1 -1
  174. package/lib/cjs/components/text-area/TextArea.js +17 -8
  175. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  176. package/lib/cjs/components/text-area/TextArea.styles.js +15 -1
  177. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  178. package/lib/cjs/components/truncation/Truncation.js +17 -3
  179. package/lib/cjs/components/truncation/Truncation.js.map +1 -1
  180. package/lib/cjs/components/truncation/Truncation.styles.js +18 -1
  181. package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
  182. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js +57 -0
  183. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  184. package/lib/cjs/utils/file.js.map +1 -1
  185. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js +29 -0
  186. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  187. package/lib/esm/components/accordion/Accordion.js +105 -12
  188. package/lib/esm/components/accordion/Accordion.js.map +1 -1
  189. package/lib/esm/components/accordion/Accordion.styles.js +23 -3
  190. package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
  191. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
  192. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  193. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +33 -19
  194. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  195. package/lib/esm/components/accordion/accordion-head/AccordionHead.js +6 -3
  196. package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  197. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
  198. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  199. package/lib/esm/components/amount-control/AmountControl.js +30 -16
  200. package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
  201. package/lib/esm/components/amount-control/AmountControl.styles.js +18 -2
  202. package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
  203. package/lib/esm/components/button/Button.js +5 -1
  204. package/lib/esm/components/button/Button.js.map +1 -1
  205. package/lib/esm/components/button/Button.styles.js +10 -0
  206. package/lib/esm/components/button/Button.styles.js.map +1 -1
  207. package/lib/esm/components/button/Button.types.js.map +1 -1
  208. package/lib/esm/components/checkbox/Checkbox.js +5 -1
  209. package/lib/esm/components/checkbox/Checkbox.js.map +1 -1
  210. package/lib/esm/components/checkbox/Checkbox.styles.js +29 -2
  211. package/lib/esm/components/checkbox/Checkbox.styles.js.map +1 -1
  212. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  213. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  214. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  215. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  216. package/lib/esm/components/combobox/ComboBox.js +61 -7
  217. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  218. package/lib/esm/components/combobox/ComboBox.styles.js +11 -0
  219. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  220. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
  221. package/lib/esm/components/context-menu/ContextMenu.js +145 -42
  222. package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
  223. package/lib/esm/components/context-menu/ContextMenu.styles.js +38 -0
  224. package/lib/esm/components/context-menu/ContextMenu.styles.js.map +1 -1
  225. package/lib/esm/components/context-menu/ContextMenu.types.js.map +1 -1
  226. package/lib/esm/components/context-menu/ContextMenu.utils.js +24 -0
  227. package/lib/esm/components/context-menu/ContextMenu.utils.js.map +1 -1
  228. package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js +3 -8
  229. package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
  230. package/lib/esm/components/file-input/FileInput.js +4 -2
  231. package/lib/esm/components/file-input/FileInput.js.map +1 -1
  232. package/lib/esm/components/file-list/file-item/FileItem.js +49 -26
  233. package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
  234. package/lib/esm/components/file-list/file-item/FileItem.styles.js +24 -0
  235. package/lib/esm/components/file-list/file-item/FileItem.styles.js.map +1 -1
  236. package/lib/esm/components/file-select/FileSelect.js +27 -4
  237. package/lib/esm/components/file-select/FileSelect.js.map +1 -1
  238. package/lib/esm/components/file-select/FileSelect.styles.js +10 -0
  239. package/lib/esm/components/file-select/FileSelect.styles.js.map +1 -1
  240. package/lib/esm/components/filter/Filter.js +52 -16
  241. package/lib/esm/components/filter/Filter.js.map +1 -1
  242. package/lib/esm/components/filter/Filter.styles.js +9 -0
  243. package/lib/esm/components/filter/Filter.styles.js.map +1 -1
  244. package/lib/esm/components/filter/filter-content/FilterContent.js +15 -5
  245. package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
  246. package/lib/esm/components/filter/filter-content/FilterContent.types.js.map +1 -1
  247. package/lib/esm/components/filter-buttons/FilterButtons.js +69 -5
  248. package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
  249. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js +40 -2
  250. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  251. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  252. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  253. package/lib/esm/components/grid-image/GridImage.js +20 -2
  254. package/lib/esm/components/grid-image/GridImage.js.map +1 -1
  255. package/lib/esm/components/grid-image/GridImage.styles.js +10 -1
  256. package/lib/esm/components/grid-image/GridImage.styles.js.map +1 -1
  257. package/lib/esm/components/grouped-image/GroupedImage.js +22 -4
  258. package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
  259. package/lib/esm/components/grouped-image/GroupedImage.styles.js +9 -0
  260. package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
  261. package/lib/esm/components/highlight-slider/HighlightSlider.js +13 -3
  262. package/lib/esm/components/highlight-slider/HighlightSlider.js.map +1 -1
  263. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +20 -3
  264. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  265. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +10 -1
  266. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  267. package/lib/esm/components/icon/Icon.js +26 -7
  268. package/lib/esm/components/icon/Icon.js.map +1 -1
  269. package/lib/esm/components/icon/Icon.styles.js +23 -0
  270. package/lib/esm/components/icon/Icon.styles.js.map +1 -1
  271. package/lib/esm/components/input/Input.js +24 -4
  272. package/lib/esm/components/input/Input.js.map +1 -1
  273. package/lib/esm/components/input/Input.styles.js +38 -3
  274. package/lib/esm/components/input/Input.styles.js.map +1 -1
  275. package/lib/esm/components/list/List.js +123 -37
  276. package/lib/esm/components/list/List.js.map +1 -1
  277. package/lib/esm/components/list/List.utils.js +202 -0
  278. package/lib/esm/components/list/List.utils.js.map +1 -1
  279. package/lib/esm/components/list/list-item/ListItem.js +85 -4
  280. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  281. package/lib/esm/components/list/list-item/ListItem.styles.js +7 -0
  282. package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
  283. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +6 -2
  284. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  285. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +4 -0
  286. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  287. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +1 -0
  288. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  289. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +4 -1
  290. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  291. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +1 -0
  292. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  293. package/lib/esm/components/list/list-item/useListItemFocus.js +40 -0
  294. package/lib/esm/components/list/list-item/useListItemFocus.js.map +1 -0
  295. package/lib/esm/components/mention-finder/MentionFinder.js +39 -3
  296. package/lib/esm/components/mention-finder/MentionFinder.js.map +1 -1
  297. package/lib/esm/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  298. package/lib/esm/components/multi-action-button/MultiActionButton.js +36 -3
  299. package/lib/esm/components/multi-action-button/MultiActionButton.js.map +1 -1
  300. package/lib/esm/components/multi-action-button/MultiActionButton.styles.js +6 -0
  301. package/lib/esm/components/multi-action-button/MultiActionButton.styles.js.map +1 -1
  302. package/lib/esm/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  303. package/lib/esm/components/multi-action-button/action-button/ActionButton.js +7 -1
  304. package/lib/esm/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  305. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  306. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  307. package/lib/esm/components/number-input/NumberInput.js +13 -10
  308. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  309. package/lib/esm/components/page-provider/PageProvider.js +4 -2
  310. package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
  311. package/lib/esm/components/popup/Popup.js +8 -1
  312. package/lib/esm/components/popup/Popup.js.map +1 -1
  313. package/lib/esm/components/radio-button/RadioButton.js +29 -15
  314. package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
  315. package/lib/esm/components/radio-button/RadioButton.styles.js +19 -8
  316. package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
  317. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  318. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  319. package/lib/esm/components/search-box/SearchBox.js +18 -4
  320. package/lib/esm/components/search-box/SearchBox.js.map +1 -1
  321. package/lib/esm/components/search-input/SearchInput.js +56 -44
  322. package/lib/esm/components/search-input/SearchInput.js.map +1 -1
  323. package/lib/esm/components/search-input/SearchInput.styles.js +25 -1
  324. package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
  325. package/lib/esm/components/select-button/SelectButton.js +4 -2
  326. package/lib/esm/components/select-button/SelectButton.js.map +1 -1
  327. package/lib/esm/components/setup-wizard/SetupWizard.js +10 -4
  328. package/lib/esm/components/setup-wizard/SetupWizard.js.map +1 -1
  329. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  330. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  331. package/lib/esm/components/sharing-bar/SharingBar.js +30 -5
  332. package/lib/esm/components/sharing-bar/SharingBar.js.map +1 -1
  333. package/lib/esm/components/sharing-bar/SharingBar.styles.js +5 -0
  334. package/lib/esm/components/sharing-bar/SharingBar.styles.js.map +1 -1
  335. package/lib/esm/components/sharing-button/SharingButton.js +4 -2
  336. package/lib/esm/components/sharing-button/SharingButton.js.map +1 -1
  337. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js +3 -1
  338. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  339. package/lib/esm/components/signature/Signature.js +6 -3
  340. package/lib/esm/components/signature/Signature.js.map +1 -1
  341. package/lib/esm/components/slider/Slider.js +30 -7
  342. package/lib/esm/components/slider/Slider.js.map +1 -1
  343. package/lib/esm/components/slider/Slider.styles.js +8 -1
  344. package/lib/esm/components/slider/Slider.styles.js.map +1 -1
  345. package/lib/esm/components/slider-button/SliderButton.js +62 -6
  346. package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
  347. package/lib/esm/components/slider-button/SliderButton.styles.js +14 -1
  348. package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
  349. package/lib/esm/components/slider-button/SliderButton.types.js +2 -0
  350. package/lib/esm/components/slider-button/SliderButton.types.js.map +1 -0
  351. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js +56 -0
  352. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  353. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js +38 -0
  354. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  355. package/lib/esm/components/tag-input/TagInput.js +86 -35
  356. package/lib/esm/components/tag-input/TagInput.js.map +1 -1
  357. package/lib/esm/components/tag-input/TagInput.styles.js +27 -1
  358. package/lib/esm/components/tag-input/TagInput.styles.js.map +1 -1
  359. package/lib/esm/components/text-area/TextArea.js +18 -9
  360. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  361. package/lib/esm/components/text-area/TextArea.styles.js +14 -0
  362. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  363. package/lib/esm/components/truncation/Truncation.js +18 -4
  364. package/lib/esm/components/truncation/Truncation.js.map +1 -1
  365. package/lib/esm/components/truncation/Truncation.styles.js +17 -0
  366. package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
  367. package/lib/esm/hooks/useKeyboardFocusHighlighting.js +49 -0
  368. package/lib/esm/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  369. package/lib/esm/utils/file.js.map +1 -1
  370. package/lib/esm/utils/keyboardFocusHighlighting.styles.js +24 -0
  371. package/lib/esm/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  372. package/lib/types/components/accordion/Accordion.d.ts +5 -0
  373. package/lib/types/components/accordion/Accordion.styles.d.ts +8 -4
  374. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
  375. package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +7 -2
  376. package/lib/types/components/accordion/accordion-head/AccordionHead.d.ts +1 -0
  377. package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +18 -18
  378. package/lib/types/components/amount-control/AmountControl.d.ts +5 -0
  379. package/lib/types/components/amount-control/AmountControl.styles.d.ts +8 -4
  380. package/lib/types/components/button/Button.styles.d.ts +8 -6
  381. package/lib/types/components/button/Button.types.d.ts +8 -0
  382. package/lib/types/components/checkbox/Checkbox.d.ts +4 -0
  383. package/lib/types/components/checkbox/Checkbox.styles.d.ts +5 -1
  384. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +5 -0
  385. package/lib/types/components/combobox/ComboBox.styles.d.ts +4 -2
  386. package/lib/types/components/combobox/ComboBox.types.d.ts +5 -0
  387. package/lib/types/components/context-menu/ContextMenu.styles.d.ts +4 -2
  388. package/lib/types/components/context-menu/ContextMenu.types.d.ts +6 -0
  389. package/lib/types/components/context-menu/ContextMenu.utils.d.ts +10 -0
  390. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.d.ts +1 -1
  391. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +2 -2
  392. package/lib/types/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.styles.d.ts +2 -2
  393. package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +2 -2
  394. package/lib/types/components/file-input/FileInput.d.ts +4 -0
  395. package/lib/types/components/file-input/FileInput.styles.d.ts +2 -2
  396. package/lib/types/components/file-list/file-item/FileItem.styles.d.ts +3 -0
  397. package/lib/types/components/file-select/FileSelect.d.ts +4 -0
  398. package/lib/types/components/file-select/FileSelect.styles.d.ts +6 -4
  399. package/lib/types/components/filter/Filter.d.ts +1 -0
  400. package/lib/types/components/filter/Filter.styles.d.ts +6 -4
  401. package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +4 -0
  402. package/lib/types/components/filter-buttons/FilterButtons.d.ts +4 -0
  403. package/lib/types/components/filter-buttons/filter-button/FilterButton.d.ts +5 -0
  404. package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +12 -8
  405. package/lib/types/components/grid-image/GridImage.d.ts +4 -0
  406. package/lib/types/components/grid-image/GridImage.styles.d.ts +4 -2
  407. package/lib/types/components/grouped-image/GroupedImage.d.ts +4 -0
  408. package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +8 -6
  409. package/lib/types/components/highlight-slider/HighlightSlider.d.ts +4 -0
  410. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.d.ts +3 -0
  411. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.d.ts +9 -5
  412. package/lib/types/components/icon/Icon.d.ts +4 -0
  413. package/lib/types/components/icon/Icon.styles.d.ts +1 -0
  414. package/lib/types/components/input/Input.d.ts +4 -0
  415. package/lib/types/components/input/Input.styles.d.ts +17 -9
  416. package/lib/types/components/list/List.d.ts +11 -0
  417. package/lib/types/components/list/List.utils.d.ts +32 -1
  418. package/lib/types/components/list/list-item/ListItem.d.ts +4 -0
  419. package/lib/types/components/list/list-item/ListItem.styles.d.ts +64 -64
  420. package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +2 -2
  421. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +195 -194
  422. package/lib/types/components/list/list-item/useListItemFocus.d.ts +13 -0
  423. package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +2 -2
  424. package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +4 -4
  425. package/lib/types/components/multi-action-button/MultiActionButton.styles.d.ts +2 -2
  426. package/lib/types/components/multi-action-button/MultiActionButton.types.d.ts +7 -0
  427. package/lib/types/components/multi-action-button/action-button/ActionButton.d.ts +4 -1
  428. package/lib/types/components/multi-action-button/action-button/ActionButton.styles.d.ts +4 -2
  429. package/lib/types/components/number-input/NumberInput.d.ts +4 -0
  430. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +2 -2
  431. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +6 -6
  432. package/lib/types/components/radio-button/RadioButton.d.ts +4 -0
  433. package/lib/types/components/radio-button/RadioButton.styles.d.ts +15 -9
  434. package/lib/types/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +5 -0
  435. package/lib/types/components/search-box/SearchBox.d.ts +4 -0
  436. package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
  437. package/lib/types/components/search-input/SearchInput.d.ts +4 -0
  438. package/lib/types/components/search-input/SearchInput.styles.d.ts +17 -9
  439. package/lib/types/components/select-button/SelectButton.d.ts +4 -0
  440. package/lib/types/components/setup-wizard/SetupWizard.d.ts +5 -0
  441. package/lib/types/components/sharing-bar/SharingBar.d.ts +4 -0
  442. package/lib/types/components/sharing-button/SharingButton.d.ts +1 -1
  443. package/lib/types/components/sharing-context-menu/SharingContextMenu.d.ts +10 -2
  444. package/lib/types/components/signature/Signature.d.ts +4 -0
  445. package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.styles.d.ts +4 -4
  446. package/lib/types/components/slider/Slider.d.ts +8 -0
  447. package/lib/types/components/slider/Slider.styles.d.ts +18 -14
  448. package/lib/types/components/slider-button/SliderButton.d.ts +1 -28
  449. package/lib/types/components/slider-button/SliderButton.styles.d.ts +6 -4
  450. package/lib/types/components/slider-button/SliderButton.types.d.ts +32 -0
  451. package/lib/types/components/slider-button/useSliderButtonPopupKeyboard.d.ts +17 -0
  452. package/lib/types/components/slider-button/useSliderButtonThumbKeyboard.d.ts +13 -0
  453. package/lib/types/components/tag-input/TagInput.d.ts +4 -0
  454. package/lib/types/components/tag-input/TagInput.styles.d.ts +12 -2
  455. package/lib/types/components/text-area/TextArea.d.ts +4 -0
  456. package/lib/types/components/text-area/TextArea.styles.d.ts +1 -0
  457. package/lib/types/components/truncation/Truncation.d.ts +4 -0
  458. package/lib/types/components/truncation/Truncation.styles.d.ts +7 -2
  459. package/lib/types/hooks/useKeyboardFocusHighlighting.d.ts +5 -0
  460. package/lib/types/utils/file.d.ts +1 -1
  461. package/lib/types/utils/keyboardFocusHighlighting.styles.d.ts +9 -0
  462. package/package.json +3 -3
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyledTruncationPseudoContent = exports.StyledTruncationClampWrapper = exports.StyledTruncationClamp = exports.StyledTruncation = exports.StyledMotionTruncationContent = void 0;
6
+ exports.StyledTruncationPseudoContent = exports.StyledTruncationClampWrapper = exports.StyledTruncationClampFocusWrapper = exports.StyledTruncationClamp = exports.StyledTruncation = exports.StyledMotionTruncationContent = void 0;
7
7
  var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  var _truncation = require("../../types/truncation");
10
+ var _keyboardFocusHighlighting = require("../../utils/keyboardFocusHighlighting.styles");
10
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
12
  const StyledTruncation = exports.StyledTruncation = _styledComponents.default.div`
12
13
  position: relative;
@@ -45,8 +46,24 @@ const StyledTruncationClampWrapper = exports.StyledTruncationClampWrapper = _sty
45
46
  }
46
47
  }}
47
48
  `;
49
+ const StyledTruncationClampFocusWrapper = exports.StyledTruncationClampFocusWrapper = _styledComponents.default.div`
50
+ display: inline-block;
51
+ border-radius: 3px;
52
+
53
+ ${({
54
+ $shouldShowKeyboardHighlighting
55
+ }) => $shouldShowKeyboardHighlighting && (0, _styledComponents.css)`
56
+ &:focus-within {
57
+ transition: none;
58
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingRingCss};
59
+ color: inherit;
60
+ }
61
+ `}
62
+ `;
48
63
  const StyledTruncationClamp = exports.StyledTruncationClamp = _styledComponents.default.a`
49
64
  cursor: pointer;
50
65
  z-index: 2;
66
+ display: inline-block;
67
+ line-height: 1.2;
51
68
  `;
52
69
  //# sourceMappingURL=Truncation.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Truncation.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_truncation","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledTruncation","exports","styled","div","StyledMotionTruncationContent","motion","StyledTruncationPseudoContent","StyledTruncationClampWrapper","$position","ClampPosition","Left","css","Middle","StyledTruncationClamp","a"],"sources":["../../../../src/components/truncation/Truncation.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { ClampPosition } from '../../types/truncation';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledTruncation = styled.div`\n position: relative;\n overflow: hidden;\n`;\n\n// Fix framer-motion bug\nexport const StyledMotionTruncationContent = styled(motion.div)`\n overflow: hidden;\n position: relative;\n`;\n\nexport const StyledTruncationPseudoContent = styled.div`\n visibility: hidden;\n position: absolute;\n width: 100%;\n`;\n\ntype StyledTruncationClampWrapperProps = WithTheme<{ $position: ClampPosition }>;\n\nexport const StyledTruncationClampWrapper = styled.div<StyledTruncationClampWrapperProps>`\n display: flex;\n\n ${({ $position }) => {\n switch ($position) {\n case ClampPosition.Left:\n return css`\n justify-content: left;\n `;\n case ClampPosition.Middle:\n return css`\n justify-content: center;\n `;\n default:\n return css`\n justify-content: right;\n `;\n }\n }}\n`;\n\nexport const StyledTruncationClamp = styled.a`\n cursor: pointer;\n z-index: 2;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAuD,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAGhD,MAAMkB,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,yBAAM,CAACC,GAAG;AAC1C;AACA;AACA,CAAC;;AAED;AACO,MAAMC,6BAA6B,GAAAH,OAAA,CAAAG,6BAAA,GAAG,IAAAF,yBAAM,EAACG,aAAM,CAACF,GAAG,CAAC;AAC/D;AACA;AACA,CAAC;AAEM,MAAMG,6BAA6B,GAAAL,OAAA,CAAAK,6BAAA,GAAGJ,yBAAM,CAACC,GAAG;AACvD;AACA;AACA;AACA,CAAC;AAIM,MAAMI,4BAA4B,GAAAN,OAAA,CAAAM,4BAAA,GAAGL,yBAAM,CAACC,GAAsC;AACzF;AACA;AACA,MAAM,CAAC;EAAEK;AAAU,CAAC,KAAK;EACjB,QAAQA,SAAS;IACb,KAAKC,yBAAa,CAACC,IAAI;MACnB,OAAO,IAAAC,qBAAG;AAC1B;AACA,iBAAiB;IACL,KAAKF,yBAAa,CAACG,MAAM;MACrB,OAAO,IAAAD,qBAAG;AAC1B;AACA,iBAAiB;IACL;MACI,OAAO,IAAAA,qBAAG;AAC1B;AACA,iBAAiB;EACT;AACJ,CAAC;AACL,CAAC;AAEM,MAAME,qBAAqB,GAAAZ,OAAA,CAAAY,qBAAA,GAAGX,yBAAM,CAACY,CAAC;AAC7C;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Truncation.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_truncation","_keyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledTruncation","exports","styled","div","StyledMotionTruncationContent","motion","StyledTruncationPseudoContent","StyledTruncationClampWrapper","$position","ClampPosition","Left","css","Middle","StyledTruncationClampFocusWrapper","$shouldShowKeyboardHighlighting","keyboardFocusHighlightingRingCss","StyledTruncationClamp","a"],"sources":["../../../../src/components/truncation/Truncation.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { ClampPosition } from '../../types/truncation';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\nexport const StyledTruncation = styled.div`\n position: relative;\n overflow: hidden;\n`;\n\n// Fix framer-motion bug\nexport const StyledMotionTruncationContent = styled(motion.div)`\n overflow: hidden;\n position: relative;\n`;\n\nexport const StyledTruncationPseudoContent = styled.div`\n visibility: hidden;\n position: absolute;\n width: 100%;\n`;\n\ntype StyledTruncationClampWrapperProps = WithTheme<{ $position: ClampPosition }>;\n\nexport const StyledTruncationClampWrapper = styled.div<StyledTruncationClampWrapperProps>`\n display: flex;\n\n ${({ $position }) => {\n switch ($position) {\n case ClampPosition.Left:\n return css`\n justify-content: left;\n `;\n case ClampPosition.Middle:\n return css`\n justify-content: center;\n `;\n default:\n return css`\n justify-content: right;\n `;\n }\n }}\n`;\n\ntype StyledTruncationClampProps = {\n $shouldShowKeyboardHighlighting: boolean;\n};\n\nexport const StyledTruncationClampFocusWrapper = styled.div<StyledTruncationClampProps>`\n display: inline-block;\n border-radius: 3px;\n\n ${({ $shouldShowKeyboardHighlighting }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-within {\n transition: none;\n ${keyboardFocusHighlightingRingCss};\n color: inherit;\n }\n `}\n`;\n\nexport const StyledTruncationClamp = styled.a`\n cursor: pointer;\n z-index: 2;\n display: inline-block;\n line-height: 1.2;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,0BAAA,GAAAJ,OAAA;AAAgG,SAAAE,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC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AAC;EAAEK;AAAU,CAAC,KAAK;EACjB,QAAQA,SAAS;IACb,KAAKC,yBAAa,CAACC,IAAI;MACnB,OAAO,IAAAC,qBAAG;AAC1B;AACA,iBAAiB;IACL,KAAKF,yBAAa,CAACG,MAAM;MACrB,OAAO,IAAAD,qBAAG;AAC1B;AACA,iBAAiB;IACL;MACI,OAAO,IAAAA,qBAAG;AAC1B;AACA,iBAAiB;EACT;AACJ,CAAC;AACL,CAAC;AAMM,MAAME,iCAAiC,GAAAZ,OAAA,CAAAY,iCAAA,GAAGX,yBAAM,CAACC,GAA+B;AACvF;AACA;AACA;AACA,MAAM,CAAC;EAAEW;AAAgC,CAAC,KAClCA,+BAA+B,IAC/B,IAAAH,qBAAG;AACX;AACA;AACA,kBAAkBI,2DAAgC;AAClD;AACA;AACA,SAAS;AACT,CAAC;AAEM,MAAMC,qBAAqB,GAAAf,OAAA,CAAAe,qBAAA,GAAGd,yBAAM,CAACe,CAAC;AAC7C;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useKeyboardFocusHighlighting = void 0;
7
+ var _react = require("react");
8
+ var _ColorSchemeProvider = require("../components/color-scheme-provider/ColorSchemeProvider");
9
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */
10
+
11
+ const KEYBOARD_NAVIGATION_KEYS = new Set(['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Enter', ' ', 'Spacebar', 'Escape', 'Home', 'End', 'PageUp', 'PageDown']);
12
+
13
+ /**
14
+ * Tracks whether focus highlighting should be visible for keyboard navigation.
15
+ * Keyboard mode is enabled via Tab and reset by mouse interaction.
16
+ */
17
+ const useKeyboardFocusHighlighting = isEnabledProp => {
18
+ const colorScheme = (0, _react.useContext)(_ColorSchemeProvider.ColorSchemeContext);
19
+ const contextIsEnabled = (colorScheme === null || colorScheme === void 0 ? void 0 : colorScheme.shouldEnableKeyboardHighlighting) === true;
20
+ const isEnabled = isEnabledProp ?? contextIsEnabled;
21
+ const [isKeyboardNavigation, setIsKeyboardNavigation] = (0, _react.useState)(false);
22
+ (0, _react.useEffect)(() => {
23
+ const canListen = isEnabled && typeof window !== 'undefined';
24
+ const enableKeyboardNavigation = () => {
25
+ setIsKeyboardNavigation(true);
26
+ };
27
+ const handleKeyDown = event => {
28
+ if (event.ctrlKey || event.altKey || event.metaKey) {
29
+ return;
30
+ }
31
+ if (!KEYBOARD_NAVIGATION_KEYS.has(event.key)) {
32
+ return;
33
+ }
34
+ enableKeyboardNavigation();
35
+ };
36
+ const disableKeyboardNavigation = () => {
37
+ setIsKeyboardNavigation(current => current ? false : current);
38
+ };
39
+ if (canListen) {
40
+ window.addEventListener('keydown', handleKeyDown);
41
+ window.addEventListener('mousedown', disableKeyboardNavigation);
42
+ window.addEventListener('mousemove', disableKeyboardNavigation);
43
+ } else {
44
+ setIsKeyboardNavigation(false);
45
+ }
46
+ return () => {
47
+ if (canListen) {
48
+ window.removeEventListener('keydown', handleKeyDown);
49
+ window.removeEventListener('mousedown', disableKeyboardNavigation);
50
+ window.removeEventListener('mousemove', disableKeyboardNavigation);
51
+ }
52
+ };
53
+ }, [isEnabled]);
54
+ return Boolean(isEnabled && isKeyboardNavigation);
55
+ };
56
+ exports.useKeyboardFocusHighlighting = useKeyboardFocusHighlighting;
57
+ //# sourceMappingURL=useKeyboardFocusHighlighting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyboardFocusHighlighting.js","names":["_react","require","_ColorSchemeProvider","KEYBOARD_NAVIGATION_KEYS","Set","useKeyboardFocusHighlighting","isEnabledProp","colorScheme","useContext","ColorSchemeContext","contextIsEnabled","shouldEnableKeyboardHighlighting","isEnabled","isKeyboardNavigation","setIsKeyboardNavigation","useState","useEffect","canListen","window","enableKeyboardNavigation","handleKeyDown","event","ctrlKey","altKey","metaKey","has","key","disableKeyboardNavigation","current","addEventListener","removeEventListener","Boolean","exports"],"sources":["../../../src/hooks/useKeyboardFocusHighlighting.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */\nimport { useContext, useEffect, useState } from 'react';\nimport {\n ColorSchemeContext,\n type ColorSchemeContextProps,\n} from '../components/color-scheme-provider/ColorSchemeProvider';\n\nconst KEYBOARD_NAVIGATION_KEYS = new Set([\n 'Tab',\n 'ArrowUp',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n ' ',\n 'Spacebar',\n 'Escape',\n 'Home',\n 'End',\n 'PageUp',\n 'PageDown',\n]);\n\n/**\n * Tracks whether focus highlighting should be visible for keyboard navigation.\n * Keyboard mode is enabled via Tab and reset by mouse interaction.\n */\nexport const useKeyboardFocusHighlighting = (isEnabledProp?: boolean): boolean => {\n const colorScheme = useContext<ColorSchemeContextProps | undefined>(ColorSchemeContext);\n const contextIsEnabled: boolean = colorScheme?.shouldEnableKeyboardHighlighting === true;\n const isEnabled: boolean = isEnabledProp ?? contextIsEnabled;\n\n const [isKeyboardNavigation, setIsKeyboardNavigation] = useState(false);\n\n useEffect(() => {\n const canListen = isEnabled && typeof window !== 'undefined';\n\n const enableKeyboardNavigation = () => {\n setIsKeyboardNavigation(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n\n if (!KEYBOARD_NAVIGATION_KEYS.has(event.key)) {\n return;\n }\n\n enableKeyboardNavigation();\n };\n\n const disableKeyboardNavigation = () => {\n setIsKeyboardNavigation((current) => (current ? false : current));\n };\n\n if (canListen) {\n window.addEventListener('keydown', handleKeyDown);\n window.addEventListener('mousedown', disableKeyboardNavigation);\n window.addEventListener('mousemove', disableKeyboardNavigation);\n } else {\n setIsKeyboardNavigation(false);\n }\n\n return () => {\n if (canListen) {\n window.removeEventListener('keydown', handleKeyDown);\n window.removeEventListener('mousedown', disableKeyboardNavigation);\n window.removeEventListener('mousemove', disableKeyboardNavigation);\n }\n };\n }, [isEnabled]);\n\n return Boolean(isEnabled && isKeyboardNavigation);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AAFA;;AAOA,MAAME,wBAAwB,GAAG,IAAIC,GAAG,CAAC,CACrC,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,OAAO,EACP,GAAG,EACH,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,UAAU,CACb,CAAC;;AAEF;AACA;AACA;AACA;AACO,MAAMC,4BAA4B,GAAIC,aAAuB,IAAc;EAC9E,MAAMC,WAAW,GAAG,IAAAC,iBAAU,EAAsCC,uCAAkB,CAAC;EACvF,MAAMC,gBAAyB,GAAG,CAAAH,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEI,gCAAgC,MAAK,IAAI;EACxF,MAAMC,SAAkB,GAAGN,aAAa,IAAII,gBAAgB;EAE5D,MAAM,CAACG,oBAAoB,EAAEC,uBAAuB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEvE,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,SAAS,GAAGL,SAAS,IAAI,OAAOM,MAAM,KAAK,WAAW;IAE5D,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;MACnCL,uBAAuB,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,MAAMM,aAAa,GAAIC,KAAoB,IAAK;MAC5C,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACE,MAAM,IAAIF,KAAK,CAACG,OAAO,EAAE;QAChD;MACJ;MAEA,IAAI,CAACrB,wBAAwB,CAACsB,GAAG,CAACJ,KAAK,CAACK,GAAG,CAAC,EAAE;QAC1C;MACJ;MAEAP,wBAAwB,CAAC,CAAC;IAC9B,CAAC;IAED,MAAMQ,yBAAyB,GAAGA,CAAA,KAAM;MACpCb,uBAAuB,CAAEc,OAAO,IAAMA,OAAO,GAAG,KAAK,GAAGA,OAAQ,CAAC;IACrE,CAAC;IAED,IAAIX,SAAS,EAAE;MACXC,MAAM,CAACW,gBAAgB,CAAC,SAAS,EAAET,aAAa,CAAC;MACjDF,MAAM,CAACW,gBAAgB,CAAC,WAAW,EAAEF,yBAAyB,CAAC;MAC/DT,MAAM,CAACW,gBAAgB,CAAC,WAAW,EAAEF,yBAAyB,CAAC;IACnE,CAAC,MAAM;MACHb,uBAAuB,CAAC,KAAK,CAAC;IAClC;IAEA,OAAO,MAAM;MACT,IAAIG,SAAS,EAAE;QACXC,MAAM,CAACY,mBAAmB,CAAC,SAAS,EAAEV,aAAa,CAAC;QACpDF,MAAM,CAACY,mBAAmB,CAAC,WAAW,EAAEH,yBAAyB,CAAC;QAClET,MAAM,CAACY,mBAAmB,CAAC,WAAW,EAAEH,yBAAyB,CAAC;MACtE;IACJ,CAAC;EACL,CAAC,EAAE,CAACf,SAAS,CAAC,CAAC;EAEf,OAAOmB,OAAO,CAACnB,SAAS,IAAIC,oBAAoB,CAAC;AACrD,CAAC;AAACmB,OAAA,CAAA3B,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","names":["hasDuplicate","items","newItem","comparator","some","item","exports","filterDuplicateFile","files","newFile","a","b","name","size","filterDuplicateFileUrls","getHumanSize","bytes","FILE_SIZE_UNITS","unitIndex","Math","round","toString","replace","isValidFileType","types","file","allowedTypesArray","split","map","type","trim","fileType","endsWith","baseType","slice","startsWith","MIME_TYPE_MAPPING","getIconByMimeType","mimeType","matchedType","Object","keys","find"],"sources":["../../../src/utils/file.ts"],"sourcesContent":["import { UploadedFile } from '../components/file-select/FileSelect';\n\nexport const hasDuplicate = <T>(\n items: T[],\n newItem: T,\n comparator: (a: T, b: T) => boolean,\n): boolean => items.some((item) => comparator(item, newItem));\n\ninterface FilerDuplicateFileOptions {\n files: File[];\n newFile: File;\n}\n\nexport const filterDuplicateFile = ({ files, newFile }: FilerDuplicateFileOptions) =>\n hasDuplicate(files, newFile, (a, b) => a.name === b.name && a.size === b.size);\n\ninterface FilterDuplicateFileUrlsOptions {\n files: UploadedFile[];\n newFile: UploadedFile;\n}\n\nexport const filterDuplicateFileUrls = ({ files, newFile }: FilterDuplicateFileUrlsOptions) =>\n hasDuplicate(files, newFile, (a, b) => a === b);\n\nexport const getHumanSize = (bytes: number): string => {\n const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n let size = bytes || 0;\n let unitIndex = 0;\n\n while (size >= 1024) {\n size /= 1024;\n unitIndex += 1;\n }\n\n size = Math.round(size * 10) / 10;\n\n return `${size.toString().replace('.', ',')} ${FILE_SIZE_UNITS[unitIndex] ?? ''}`;\n};\n\ninterface IsValidFileTypeOptions {\n file: File;\n types: string;\n}\n\nexport const isValidFileType = ({ types, file }: IsValidFileTypeOptions) => {\n const allowedTypesArray = types.split(',').map((type) => type.trim());\n const fileType = file.type;\n\n return allowedTypesArray.some((type) => {\n if (type.endsWith('/*')) {\n const baseType = type.slice(0, -2); // remove '/*'\n return fileType.startsWith(baseType);\n }\n return fileType === type;\n });\n};\n\nexport const MIME_TYPE_MAPPING: Record<string, string> = {\n // Haupttypen\n 'application/pdf': 'fa fa-file-pdf',\n 'application/zip': 'fa fa-file-archive',\n 'application/msword': 'fa fa-file-word',\n 'application/vnd.ms-excel': 'fa fa-file-excel',\n // Typen mit Wildcards\n 'application/vnd.openxmlformats-officedocument.': 'fa fa-file-word',\n 'application/x-': 'fa fa-file-archive',\n // Addiere nur spezifische Fälle\n 'text/pdf': 'fa fa-file-pdf',\n};\n\nexport const getIconByMimeType = (mimeType?: string): string => {\n const matchedType = Object.keys(MIME_TYPE_MAPPING).find((type) => mimeType?.startsWith(type));\n return MIME_TYPE_MAPPING[matchedType!] || 'fa fa-file';\n};\n"],"mappings":";;;;;;AAEO,MAAM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OAAA,CAAA+B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"file.js","names":["hasDuplicate","items","newItem","comparator","some","item","exports","filterDuplicateFile","files","newFile","a","b","name","size","filterDuplicateFileUrls","getHumanSize","bytes","FILE_SIZE_UNITS","unitIndex","Math","round","toString","replace","isValidFileType","types","file","allowedTypesArray","split","map","type","trim","fileType","endsWith","baseType","slice","startsWith","MIME_TYPE_MAPPING","getIconByMimeType","mimeType","matchedType","Object","keys","find"],"sources":["../../../src/utils/file.ts"],"sourcesContent":["import type { UploadedFile } from '../components/file-select/FileSelect';\n\nexport const hasDuplicate = <T>(\n items: T[],\n newItem: T,\n comparator: (a: T, b: T) => boolean,\n): boolean => items.some((item) => comparator(item, newItem));\n\ninterface FilerDuplicateFileOptions {\n files: File[];\n newFile: File;\n}\n\nexport const filterDuplicateFile = ({ files, newFile }: FilerDuplicateFileOptions) =>\n hasDuplicate(files, newFile, (a, b) => a.name === b.name && a.size === b.size);\n\ninterface FilterDuplicateFileUrlsOptions {\n files: UploadedFile[];\n newFile: UploadedFile;\n}\n\nexport const filterDuplicateFileUrls = ({ files, newFile }: FilterDuplicateFileUrlsOptions) =>\n hasDuplicate(files, newFile, (a, b) => a === b);\n\nexport const getHumanSize = (bytes: number): string => {\n const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n let size = bytes || 0;\n let unitIndex = 0;\n\n while (size >= 1024) {\n size /= 1024;\n unitIndex += 1;\n }\n\n size = Math.round(size * 10) / 10;\n\n return `${size.toString().replace('.', ',')} ${FILE_SIZE_UNITS[unitIndex] ?? ''}`;\n};\n\ninterface IsValidFileTypeOptions {\n file: File;\n types: string;\n}\n\nexport const isValidFileType = ({ types, file }: IsValidFileTypeOptions) => {\n const allowedTypesArray = types.split(',').map((type) => type.trim());\n const fileType = file.type;\n\n return allowedTypesArray.some((type) => {\n if (type.endsWith('/*')) {\n const baseType = type.slice(0, -2); // remove '/*'\n return fileType.startsWith(baseType);\n }\n return fileType === type;\n });\n};\n\nexport const MIME_TYPE_MAPPING: Record<string, string> = {\n // Haupttypen\n 'application/pdf': 'fa fa-file-pdf',\n 'application/zip': 'fa fa-file-archive',\n 'application/msword': 'fa fa-file-word',\n 'application/vnd.ms-excel': 'fa fa-file-excel',\n // Typen mit Wildcards\n 'application/vnd.openxmlformats-officedocument.': 'fa fa-file-word',\n 'application/x-': 'fa fa-file-archive',\n // Addiere nur spezifische Fälle\n 'text/pdf': 'fa fa-file-pdf',\n};\n\nexport const getIconByMimeType = (mimeType?: string): string => {\n const matchedType = Object.keys(MIME_TYPE_MAPPING).find((type) => mimeType?.startsWith(type));\n return MIME_TYPE_MAPPING[matchedType!] || 'fa fa-file';\n};\n"],"mappings":";;;;;;AAEO,MAAMA,YAAY,GAAGA,CACxBC,KAAU,EACVC,OAAU,EACVC,UAAmC,KACzBF,KAAK,CAACG,IAAI,CAAEC,IAAI,IAAKF,UAAU,CAACE,IAAI,EAAEH,OAAO,CAAC,CAAC;AAACI,OAAA,CAAAN,YAAA,GAAAA,YAAA;AAOvD,MAAMO,mBAAmB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAmC,CAAC,KAC7ET,YAAY,CAACQ,KAAK,EAAEC,OAAO,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,IAAI,KAAKD,CAAC,CAACC,IAAI,IAAIF,CAAC,CAACG,IAAI,KAAKF,CAAC,CAACE,IAAI,CAAC;AAACP,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAO5E,MAAMO,uBAAuB,GAAGA,CAAC;EAAEN,KAAK;EAAEC;AAAwC,CAAC,KACtFT,YAAY,CAACQ,KAAK,EAAEC,OAAO,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,KAAKC,CAAC,CAAC;AAACL,OAAA,CAAAQ,uBAAA,GAAAA,uBAAA;AAE7C,MAAMC,YAAY,GAAIC,KAAa,IAAa;EACnD,MAAMC,eAAe,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EAAE,gBAAgB;EACnC,iBAAiB,EAAE,oBAAoB;EACvC,oBAAoB,EAAE,iBAAiB;EACvC,0BAA0B,EAAE,kBAAkB;EAC9C;EACA,gDAAgD,EAAE,iBAAiB;EACnE,gBAAgB,EAAE,oBAAoB;EACtC;EACA,UAAU,EAAE;AAChB,CAAC;AAEM,MAAMC,iBAAiB,GAAIC,QAAiB,IAAa;EAC5D,MAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACL,iBAAiB,CAAC,CAACM,IAAI,CAAEb,IAAI,IAAKS,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEH,UAAU,CAACN,IAAI,CAAC,CAAC;EAC7F,OAAOO,iBAAiB,CAACG,WAAW,CAAE,IAAI,YAAY;AAC1D,CAAC;AAACjC,OAAA,CAAA+B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.keyboardFocusHighlightingRingCss = exports.keyboardFocusHighlightingCircleRingCss = void 0;
7
+ var _styledComponents = require("styled-components");
8
+ /**
9
+ * Shared focus ring for components with keyboard-only highlighting.
10
+ * Apply this only when keyboard highlighting is enabled/active.
11
+ */
12
+ const keyboardFocusHighlightingRingCss = exports.keyboardFocusHighlightingRingCss = (0, _styledComponents.css)`
13
+ outline: solid 2px color-mix(in srgb, white 70%, transparent);
14
+ box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
15
+ border-radius: 3px;
16
+ outline-offset: 1px;
17
+ `;
18
+
19
+ /**
20
+ * Circular focus ring variant for round controls (e.g. RadioButton).
21
+ */
22
+ const keyboardFocusHighlightingCircleRingCss = exports.keyboardFocusHighlightingCircleRingCss = (0, _styledComponents.css)`
23
+ outline: solid 2px color-mix(in srgb, white 70%, transparent);
24
+ box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
25
+ border-radius: 50%;
26
+ outline-offset: 1px;
27
+ color: white;
28
+ `;
29
+ //# sourceMappingURL=keyboardFocusHighlighting.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardFocusHighlighting.styles.js","names":["_styledComponents","require","keyboardFocusHighlightingRingCss","exports","css","keyboardFocusHighlightingCircleRingCss"],"sources":["../../../src/utils/keyboardFocusHighlighting.styles.ts"],"sourcesContent":["import { css } from 'styled-components';\n\n/**\n * Shared focus ring for components with keyboard-only highlighting.\n * Apply this only when keyboard highlighting is enabled/active.\n */\nexport const keyboardFocusHighlightingRingCss = css`\n outline: solid 2px color-mix(in srgb, white 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 3px;\n outline-offset: 1px;\n`;\n\n/**\n * Circular focus ring variant for round controls (e.g. RadioButton).\n */\nexport const keyboardFocusHighlightingCircleRingCss = css`\n outline: solid 2px color-mix(in srgb, white 70%, transparent);\n box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);\n border-radius: 50%;\n outline-offset: 1px;\n color: white;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,gCAAgC,GAAAC,OAAA,CAAAD,gCAAA,GAAG,IAAAE,qBAAG;AACnD;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACO,MAAMC,sCAAsC,GAAAF,OAAA,CAAAE,sCAAA,GAAG,IAAAD,qBAAG;AACzD;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,7 +1,9 @@
1
1
  import { AnimatePresence, MotionConfig } from 'motion/react';
2
2
  import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { useUuid } from '../../hooks/uuid';
4
+ import { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';
4
5
  import { AreaContext } from '../area-provider/AreaContextProvider';
6
+ import { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';
5
7
  import AccordionBody from './accordion-body/AccordionBody';
6
8
  import { AccordionGroupContext } from './accordion-group/AccordionGroup';
7
9
  import AccordionHead from './accordion-head/AccordionHead';
@@ -41,14 +43,19 @@ const Accordion = ({
41
43
  shouldSkipAnimation: shouldSkipAnimationProp = false,
42
44
  colors,
43
45
  shouldIndex = false,
44
- onBodyAnimationComplete
46
+ onBodyAnimationComplete,
47
+ shouldEnableKeyboardHighlighting
45
48
  }) => {
46
49
  const {
47
50
  isWrapped: groupIsWrapped,
48
51
  openAccordionUuid,
49
52
  accordionGroupUuid,
50
53
  accordionUuids,
51
- updateOpenAccordionUuid
54
+ updateOpenAccordionUuid,
55
+ activeAccordionUuid,
56
+ updateActiveAccordionUuid,
57
+ registerAccordionUuid,
58
+ unregisterAccordionUuid
52
59
  } = useContext(AccordionGroupContext);
53
60
  const {
54
61
  isWrapped: isParentWrapped
@@ -56,8 +63,11 @@ const Accordion = ({
56
63
  const {
57
64
  isWrapped: contextIsWrapped
58
65
  } = useContext(AccordionWrappedContext);
66
+ const colorScheme = useColorScheme();
67
+ const shouldEnableKeyboardHighlightingEffective = shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;
59
68
  const isWrapped = useMemo(() => groupIsWrapped ?? contextIsWrapped, [contextIsWrapped, groupIsWrapped]);
60
69
  const [isAccordionOpen, setIsAccordionOpen] = useState(isDefaultOpen ?? isOpened);
70
+ const [isGroupFocusWithin, setIsGroupFocusWithin] = useState(false);
61
71
  const uuid = useUuid();
62
72
  const isInitialRenderRef = useRef(true);
63
73
  const initialRenderSkipRef = useInitialRenderRef(true);
@@ -67,6 +77,18 @@ const Accordion = ({
67
77
  const isOpenRef = useRef(isOpen);
68
78
  const onCloseRef = useRef(onClose);
69
79
  const onOpenRef = useRef(onOpen);
80
+ const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlightingEffective);
81
+ const isKeyboardFocusable = !isDisabled && (shouldIndex || shouldEnableKeyboardHighlightingEffective);
82
+ const isInKeyboardNavigationGroup = isKeyboardFocusable && typeof updateActiveAccordionUuid === 'function' && typeof accordionGroupUuid === 'string';
83
+ useEffect(() => {
84
+ if (typeof accordionGroupUuid === 'string' && typeof registerAccordionUuid === 'function' && typeof unregisterAccordionUuid === 'function') {
85
+ registerAccordionUuid(uuid);
86
+ return () => {
87
+ unregisterAccordionUuid(uuid);
88
+ };
89
+ }
90
+ return undefined;
91
+ }, [accordionGroupUuid, registerAccordionUuid, unregisterAccordionUuid, uuid]);
70
92
  const isLastAccordion = useMemo(() => accordionUuids ? accordionUuids[accordionUuids.length - 1] === uuid : false, [accordionUuids, uuid]);
71
93
  useEffect(() => {
72
94
  isOpenRef.current = isOpen;
@@ -77,11 +99,14 @@ const Accordion = ({
77
99
  if (isDisabled) {
78
100
  return;
79
101
  }
102
+ if (isKeyboardFocusable && typeof updateActiveAccordionUuid === 'function') {
103
+ updateActiveAccordionUuid(uuid);
104
+ }
80
105
  if (typeof updateOpenAccordionUuid === 'function') {
81
106
  updateOpenAccordionUuid(uuid);
82
107
  }
83
108
  setIsAccordionOpen(currentIsAccordionOpen => !currentIsAccordionOpen);
84
- }, [isDisabled, updateOpenAccordionUuid, uuid]);
109
+ }, [isDisabled, isKeyboardFocusable, updateActiveAccordionUuid, updateOpenAccordionUuid, uuid]);
85
110
  useEffect(() => {
86
111
  if (isDisabled && isOpen) {
87
112
  if (typeof updateOpenAccordionUuid === 'function') {
@@ -145,6 +170,75 @@ const Accordion = ({
145
170
  opacity: 0
146
171
  };
147
172
  }, [isOpen, shouldSkipAnimation]);
173
+ const tabIndex = useMemo(() => isKeyboardFocusable ? 0 : -1, [isKeyboardFocusable]);
174
+ const handleKeyDown = useCallback(e => {
175
+ const isCurrentAccordionTarget = e.currentTarget === e.target;
176
+ if (isCurrentAccordionTarget && isInKeyboardNavigationGroup && accordionUuids?.length && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
177
+ const currentIndex = accordionUuids.indexOf(uuid);
178
+ if (currentIndex !== -1) {
179
+ const nextIndex = e.key === 'ArrowDown' ? (currentIndex + 1) % accordionUuids.length : (currentIndex - 1 + accordionUuids.length) % accordionUuids.length;
180
+ const nextAccordionUuid = accordionUuids[nextIndex];
181
+ if (nextAccordionUuid && nextAccordionUuid !== uuid) {
182
+ const nextAccordionElement = document.querySelector(`[data-uuid="${accordionGroupUuid}---${nextAccordionUuid}"]`);
183
+ if (nextAccordionElement) {
184
+ updateActiveAccordionUuid(nextAccordionUuid);
185
+ nextAccordionElement.focus();
186
+ return;
187
+ }
188
+ }
189
+ }
190
+ }
191
+ if (isCurrentAccordionTarget && (e.key === 'Enter' || e.key === ' ') && isKeyboardFocusable) {
192
+ handleHeadClick();
193
+ }
194
+ if (isCurrentAccordionTarget && e.key === 'ArrowRight' && isKeyboardFocusable && !isOpen) {
195
+ e.preventDefault();
196
+ handleHeadClick();
197
+ }
198
+ if (isCurrentAccordionTarget && (e.key === 'Escape' || e.key === 'ArrowLeft')) {
199
+ if (isOpen && isKeyboardFocusable) {
200
+ e.preventDefault();
201
+ handleHeadClick();
202
+ return;
203
+ }
204
+ if (isInKeyboardNavigationGroup && typeof updateActiveAccordionUuid === 'function') {
205
+ e.preventDefault();
206
+ updateActiveAccordionUuid(undefined);
207
+ let parentAccordion = e.currentTarget.parentElement?.closest('.beta-chayns-accordion');
208
+ while (parentAccordion) {
209
+ const parentGroupId = parentAccordion.getAttribute('data-uuid')?.split('---')[0];
210
+ if (parentGroupId !== accordionGroupUuid) {
211
+ parentAccordion.focus();
212
+ break;
213
+ }
214
+ parentAccordion = parentAccordion.parentElement?.closest('.beta-chayns-accordion');
215
+ }
216
+ }
217
+ }
218
+ }, [accordionGroupUuid, accordionUuids, handleHeadClick, isInKeyboardNavigationGroup, isKeyboardFocusable, isOpen, updateActiveAccordionUuid, uuid]);
219
+ const handleFocus = useCallback(e => {
220
+ if (e.currentTarget === e.target && isInKeyboardNavigationGroup && typeof updateActiveAccordionUuid === 'function') {
221
+ setIsGroupFocusWithin(true);
222
+ updateActiveAccordionUuid(uuid);
223
+ }
224
+ }, [isInKeyboardNavigationGroup, updateActiveAccordionUuid, uuid]);
225
+ const handleBlur = useCallback(e => {
226
+ if (isInKeyboardNavigationGroup && typeof updateActiveAccordionUuid === 'function' && typeof accordionGroupUuid === 'string') {
227
+ const nextFocusedElement = e.relatedTarget;
228
+ const currentGroupElement = e.currentTarget;
229
+ if (!nextFocusedElement || !currentGroupElement.contains(nextFocusedElement)) {
230
+ setIsGroupFocusWithin(false);
231
+ updateActiveAccordionUuid(undefined);
232
+ }
233
+ }
234
+ }, [accordionGroupUuid, isInKeyboardNavigationGroup, updateActiveAccordionUuid]);
235
+ useEffect(() => {
236
+ if (!isInKeyboardNavigationGroup) {
237
+ setIsGroupFocusWithin(false);
238
+ } else if (activeAccordionUuid == null && typeof updateActiveAccordionUuid === 'function' && accordionUuids?.[0] === uuid) {
239
+ updateActiveAccordionUuid(uuid);
240
+ }
241
+ }, [accordionUuids, activeAccordionUuid, isInKeyboardNavigationGroup, updateActiveAccordionUuid, uuid]);
148
242
  return /*#__PURE__*/React.createElement(StyledMotionAccordion, {
149
243
  animate: {
150
244
  height: 'auto',
@@ -158,7 +252,7 @@ const Accordion = ({
158
252
  },
159
253
  initial: initialAnimation,
160
254
  $isOpen: isOpen,
161
- tabIndex: shouldIndex ? 0 : -1,
255
+ tabIndex: tabIndex,
162
256
  $shouldShowLines: !isLastAccordion || !isWrapped,
163
257
  $isParentWrapped: isParentWrapped,
164
258
  $isWrapped: isWrapped,
@@ -166,13 +260,11 @@ const Accordion = ({
166
260
  $shouldHideBackground: shouldHideBackground,
167
261
  $shouldHideBottomLine: shouldHideBottomLine,
168
262
  $bottomBorderColor: colors?.borderBottomColor,
169
- onKeyDown: e => {
170
- if ((e.key === 'Enter' || e.key === ' ') && e.target.className.includes('beta-chayns-accordion') && shouldIndex) {
171
- e.preventDefault();
172
- e.stopPropagation();
173
- handleHeadClick();
174
- }
175
- },
263
+ $shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlightingEffective,
264
+ $shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
265
+ onKeyDown: handleKeyDown,
266
+ onFocus: handleFocus,
267
+ onBlur: handleBlur,
176
268
  onMouseEnter: onHoverStart,
177
269
  onMouseLeave: onHoverEnd,
178
270
  transition: {
@@ -202,7 +294,8 @@ const Accordion = ({
202
294
  titleElement: titleElement,
203
295
  onTitleInputChange: onTitleInputChange,
204
296
  titleInputProps: titleInputProps,
205
- titleColor: colors?.titleColor
297
+ titleColor: colors?.titleColor,
298
+ shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlightingEffective
206
299
  }), /*#__PURE__*/React.createElement(AnimatePresence, {
207
300
  initial: false
208
301
  }, (isOpen || shouldRenderClosed) && /*#__PURE__*/React.createElement(AccordionBody, {
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","names":["AnimatePresence","MotionConfig","React","useCallback","useContext","useEffect","useMemo","useRef","useState","useUuid","AreaContext","AccordionBody","AccordionGroupContext","AccordionHead","AccordionWrappedContext","StyledMotionAccordion","useInitialRenderRef","AccordionContext","createContext","isWrapped","undefined","Accordion","bodyMaxHeight","children","icon","isDefaultOpen","isDisabled","isFixed","isOpened","isTitleGreyed","onBodyScroll","onClose","onHoverEnd","onHoverStart","onOpen","onSearchChange","rightElement","searchPlaceholder","searchValue","shouldForceBackground","shouldHideBackground","shouldRenderClosed","shouldRotateIcon","shouldHideBottomLine","title","titleElement","onTitleInputChange","titleInputProps","shouldSkipAnimation","shouldSkipAnimationProp","colors","shouldIndex","onBodyAnimationComplete","groupIsWrapped","openAccordionUuid","accordionGroupUuid","accordionUuids","updateOpenAccordionUuid","isParentWrapped","contextIsWrapped","isAccordionOpen","setIsAccordionOpen","uuid","isInitialRenderRef","initialRenderSkipRef","current","isInGroup","isOpen","isOpenRef","onCloseRef","onOpenRef","isLastAccordion","length","handleHeadClick","currentIsAccordionOpen","shouldOnlyOpen","accordionContextProviderValue","areaContextProviderValue","shouldChangeColor","accordionWrappedContextProviderValue","initialAnimation","height","opacity","createElement","animate","className","exit","initial","$isOpen","tabIndex","$shouldShowLines","$isParentWrapped","$isWrapped","$shouldForceBackground","$shouldHideBackground","$shouldHideBottomLine","$bottomBorderColor","borderBottomColor","onKeyDown","e","key","target","includes","preventDefault","stopPropagation","onMouseEnter","onMouseLeave","transition","duration","Provider","value","type","onClick","titleColor","maxHeight","onScroll","onAnimationComplete","shouldHideBody","displayName"],"sources":["../../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'motion/react';\nimport React, {\n ChangeEventHandler,\n type CSSProperties,\n FC,\n type MouseEventHandler,\n ReactNode,\n UIEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { InputProps } from '../input/Input';\nimport AccordionBody from './accordion-body/AccordionBody';\nimport { AccordionGroupContext } from './accordion-group/AccordionGroup';\nimport AccordionHead from './accordion-head/AccordionHead';\nimport { AccordionWrappedContext } from './accordion-provider/AccordionContextProvider';\nimport { StyledMotionAccordion } from './Accordion.styles';\nimport { useInitialRenderRef } from '../../hooks/ref';\n\nexport const AccordionContext = React.createContext<{ isWrapped?: boolean }>({\n isWrapped: undefined,\n});\n\ntype AccordionColors = {\n titleColor?: CSSProperties['color'];\n borderBottomColor?: CSSProperties['borderBottomColor'];\n};\n\nexport type AccordionProps = {\n /**\n * Maximum height of the accordion body element. This automatically makes the content of the\n * body element scrollable.\n */\n bodyMaxHeight?: number;\n /**\n * The content of the accordion body\n */\n children: ReactNode;\n /**\n * The icon that is displayed in front of the title\n */\n icon?: string;\n /**\n * This can be used to automatically expand the Accordion during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This will disable the Accordion so that it cannot be opened and will gray out the title. Does not work with isOpened.\n */\n isDisabled?: boolean;\n /**\n * This can be used so that the Accordion cannot be opened or closed.\n * In addition, in this case the icon is exchanged to mark the Accordions.\n */\n isFixed?: boolean;\n /**\n * This can be used to open the Accordion from the outside\n */\n isOpened?: boolean;\n /**\n * This will gray out the title of the Accordion to indicate hidden content, for example.\n */\n isTitleGreyed?: boolean;\n /**\n * Function that is executed when the accordion body will be scrolled\n */\n onBodyScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Function that is executed when the accordion will be closed.\n */\n onClose?: VoidFunction;\n /**\n * Function to be executed when the accordion is no longer hovered.\n */\n onHoverEnd?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the accordion is hovered.\n */\n onHoverStart?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function that is executed when the accordion will be opened.\n */\n onOpen?: VoidFunction;\n /**\n * Function that is executed when the accordion body is animated\n */\n onBodyAnimationComplete?: VoidFunction;\n /**\n * Function that is executed when the text of the search in the accordion\n * head changes. When this function is given, the search field is displayed\n * in the Accordion Head.\n */\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the search in the accordion\n * title changes. When this function is given, the search field is displayed\n * as the Accordion title.\n */\n onTitleInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Content to be displayed on the right side in the head of the Accordion\n */\n rightElement?: ReactNode;\n /**\n * The placeholder to be used for the search\n */\n searchPlaceholder?: string;\n /**\n * The value that is displayed inside the search\n */\n searchValue?: string;\n /**\n * This will force the background color of the accordion to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * This will hide the background color of the accordion\n */\n shouldHideBackground?: boolean;\n /**\n * Whether the bottom line should be hidden.\n */\n shouldHideBottomLine?: boolean;\n /**\n * This will render the Accordion closed on the first render.\n */\n shouldRenderClosed?: boolean;\n /**\n * Whether the icon should be rotating.\n */\n shouldRotateIcon?: boolean;\n /**\n * Whether the animation should be skipped.\n * If 'isDefaultOpen' is true the initial animation will be skipped even this prop is false\n */\n shouldSkipAnimation?: boolean;\n /**\n * Title of the Accordion displayed in the head\n */\n title?: string;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * The props of the title Input.\n */\n titleInputProps?: InputProps;\n /**\n * Provide custom colors to the Accordion Component\n */\n colors?: AccordionColors;\n /**\n * Whether the accordion should be indexed.\n */\n shouldIndex?: boolean;\n};\n\nconst Accordion: FC<AccordionProps> = ({\n bodyMaxHeight,\n children,\n icon,\n isDefaultOpen = false,\n isDisabled = false,\n isFixed = false,\n isOpened,\n isTitleGreyed = false,\n onBodyScroll,\n onClose,\n onHoverEnd,\n onHoverStart,\n onOpen,\n onSearchChange,\n rightElement,\n searchPlaceholder,\n searchValue,\n shouldForceBackground = false,\n shouldHideBackground = false,\n shouldRenderClosed = false,\n shouldRotateIcon = true,\n shouldHideBottomLine = false,\n title,\n titleElement,\n onTitleInputChange,\n titleInputProps,\n shouldSkipAnimation: shouldSkipAnimationProp = false,\n colors,\n shouldIndex = false,\n onBodyAnimationComplete,\n}) => {\n const {\n isWrapped: groupIsWrapped,\n openAccordionUuid,\n accordionGroupUuid,\n accordionUuids,\n updateOpenAccordionUuid,\n } = useContext(AccordionGroupContext);\n const { isWrapped: isParentWrapped } = useContext(AccordionContext);\n\n const { isWrapped: contextIsWrapped } = useContext(AccordionWrappedContext);\n const isWrapped = useMemo(\n () => groupIsWrapped ?? contextIsWrapped,\n [contextIsWrapped, groupIsWrapped],\n );\n\n const [isAccordionOpen, setIsAccordionOpen] = useState<boolean>(isDefaultOpen ?? isOpened);\n\n const uuid = useUuid();\n\n const isInitialRenderRef = useRef(true);\n\n const initialRenderSkipRef = useInitialRenderRef(true);\n\n const shouldSkipAnimation =\n shouldSkipAnimationProp ?? (initialRenderSkipRef.current && isDefaultOpen);\n\n const isInGroup = shouldSkipAnimation ? false : typeof updateOpenAccordionUuid === 'function';\n\n const isOpen = isInGroup ? openAccordionUuid === uuid : isAccordionOpen;\n\n const isOpenRef = useRef(isOpen);\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n const isLastAccordion = useMemo(\n () => (accordionUuids ? accordionUuids[accordionUuids.length - 1] === uuid : false),\n [accordionUuids, uuid],\n );\n\n useEffect(() => {\n isOpenRef.current = isOpen;\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [isOpen, onClose, onOpen]);\n\n const handleHeadClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }, [isDisabled, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isDisabled && isOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }\n }, [isDisabled, isOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (isDefaultOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid, { shouldOnlyOpen: true });\n } else {\n setIsAccordionOpen(true);\n }\n }\n }, [isDefaultOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (typeof isOpened === 'boolean') {\n if (typeof updateOpenAccordionUuid === 'function' && isOpened !== isOpenRef.current) {\n updateOpenAccordionUuid(uuid);\n } else {\n setIsAccordionOpen(isOpened);\n }\n }\n }, [isOpened, updateOpenAccordionUuid, uuid]);\n\n const accordionContextProviderValue = useMemo(\n () => ({ isWrapped: isWrapped === true }),\n [isWrapped],\n );\n\n const areaContextProviderValue = useMemo(\n () => ({ shouldChangeColor: !shouldHideBackground }),\n [shouldHideBackground],\n );\n\n const accordionWrappedContextProviderValue = useMemo(() => ({ isWrapped: true }), []);\n\n const initialAnimation = useMemo(() => {\n if (shouldSkipAnimation) {\n return { height: 'auto', opacity: 1 };\n }\n\n return isOpen ? { height: 'auto', opacity: 1 } : { height: 0, opacity: 0 };\n }, [isOpen, shouldSkipAnimation]);\n\n return (\n <StyledMotionAccordion\n animate={{ height: 'auto', opacity: 1 }}\n data-uuid={`${accordionGroupUuid ?? ''}---${uuid}`}\n className=\"beta-chayns-accordion\"\n exit={{ height: 0, opacity: 0 }}\n initial={initialAnimation}\n $isOpen={isOpen}\n tabIndex={shouldIndex ? 0 : -1}\n $shouldShowLines={!isLastAccordion || !isWrapped}\n $isParentWrapped={isParentWrapped}\n $isWrapped={isWrapped}\n $shouldForceBackground={shouldForceBackground}\n $shouldHideBackground={shouldHideBackground}\n $shouldHideBottomLine={shouldHideBottomLine}\n $bottomBorderColor={colors?.borderBottomColor}\n onKeyDown={(e) => {\n if (\n (e.key === 'Enter' || e.key === ' ') &&\n (e.target as HTMLDivElement).className.includes('beta-chayns-accordion') &&\n shouldIndex\n ) {\n e.preventDefault();\n e.stopPropagation();\n handleHeadClick();\n }\n }}\n onMouseEnter={onHoverStart}\n onMouseLeave={onHoverEnd}\n transition={{ duration: shouldSkipAnimation ? 0 : 0.25 }}\n >\n <AccordionContext.Provider value={accordionContextProviderValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AccordionHead\n uuid={uuid}\n icon={icon}\n isOpen={isOpen}\n shouldSkipAnimation={shouldSkipAnimation}\n isFixed={isFixed}\n isTitleGreyed={isTitleGreyed || isDisabled}\n isWrapped={isWrapped === true}\n onClick={handleHeadClick}\n onSearchChange={onSearchChange}\n rightElement={rightElement}\n searchPlaceholder={searchPlaceholder}\n searchValue={searchValue}\n shouldRotateIcon={shouldRotateIcon}\n title={title}\n titleElement={titleElement}\n onTitleInputChange={onTitleInputChange}\n titleInputProps={titleInputProps}\n titleColor={colors?.titleColor}\n />\n <AnimatePresence initial={false}>\n {(isOpen || shouldRenderClosed) && (\n <AccordionBody\n shouldSkipAnimation={shouldSkipAnimation}\n maxHeight={bodyMaxHeight}\n onScroll={onBodyScroll}\n onAnimationComplete={onBodyAnimationComplete}\n shouldHideBody={shouldRenderClosed && !isOpen}\n >\n <AccordionWrappedContext.Provider\n value={accordionWrappedContextProviderValue}\n >\n <AreaContext.Provider value={areaContextProviderValue}>\n {children}\n </AreaContext.Provider>\n </AccordionWrappedContext.Provider>\n </AccordionBody>\n )}\n </AnimatePresence>\n </MotionConfig>\n </AccordionContext.Provider>\n </StyledMotionAccordion>\n );\n};\n\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAC5D,OAAOC,KAAK,IAORC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,WAAW,QAAQ,sCAAsC;AAElE,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,uBAAuB,QAAQ,+CAA+C;AACvF,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,mBAAmB,QAAQ,iBAAiB;AAErD,OAAO,MAAMC,gBAAgB,gBAAGf,KAAK,CAACgB,aAAa,CAA0B;EACzEC,SAAS,EAAEC;AACf,CAAC,CAAC;AAyIF,MAAMC,SAA6B,GAAGA,CAAC;EACnCC,aAAa;EACbC,QAAQ;EACRC,IAAI;EACJC,aAAa,GAAG,KAAK;EACrBC,UAAU,GAAG,KAAK;EAClBC,OAAO,GAAG,KAAK;EACfC,QAAQ;EACRC,aAAa,GAAG,KAAK;EACrBC,YAAY;EACZC,OAAO;EACPC,UAAU;EACVC,YAAY;EACZC,MAAM;EACNC,cAAc;EACdC,YAAY;EACZC,iBA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,CAACnF,eAAe;IAACuF,OAAO,EAAE;EAAM,GAC3B,CAACpB,MAAM,IAAI1B,kBAAkB,kBAC1BvC,KAAA,CAAAiF,aAAA,CAACxE,aAAa;IACVqC,mBAAmB,EAAEA,mBAAoB;IACzCkE,SAAS,EAAE5F,aAAc;IACzB6F,QAAQ,EAAErF,YAAa;IACvBsF,mBAAmB,EAAEhE,uBAAwB;IAC7CiE,cAAc,EAAE5E,kBAAkB,IAAI,CAAC0B;EAAO,gBAE9CjE,KAAA,CAAAiF,aAAA,CAACrE,uBAAuB,CAAC+F,QAAQ;IAC7BC,KAAK,EAAE/B;EAAqC,gBAE5C7E,KAAA,CAAAiF,aAAA,CAACzE,WAAW,CAACmG,QAAQ;IAACC,KAAK,EAAEjC;EAAyB,GACjDtD,QACiB,CACQ,CACvB,CAEN,CACP,CACS,CACR,CAAC;AAEhC,CAAC;AAEDF,SAAS,CAACiG,WAAW,GAAG,WAAW;AAEnC,eAAejG,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"Accordion.js","names":["AnimatePresence","MotionConfig","React","useCallback","useContext","useEffect","useMemo","useRef","useState","useUuid","useKeyboardFocusHighlighting","AreaContext","useColorScheme","AccordionBody","AccordionGroupContext","AccordionHead","AccordionWrappedContext","StyledMotionAccordion","useInitialRenderRef","AccordionContext","createContext","isWrapped","undefined","Accordion","bodyMaxHeight","children","icon","isDefaultOpen","isDisabled","isFixed","isOpened","isTitleGreyed","onBodyScroll","onClose","onHoverEnd","onHoverStart","onOpen","onSearchChange","rightElement","searchPlaceholder","searchValue","shouldForceBackground","shouldHideBackground","shouldRenderClosed","shouldRotateIcon","shouldHideBottomLine","title","titleElement","onTitleInputChange","titleInputProps","shouldSkipAnimation","shouldSkipAnimationProp","colors","shouldIndex","onBodyAnimationComplete","shouldEnableKeyboardHighlighting","groupIsWrapped","openAccordionUuid","accordionGroupUuid","accordionUuids","updateOpenAccordionUuid","activeAccordionUuid","updateActiveAccordionUuid","registerAccordionUuid","unregisterAccordionUuid","isParentWrapped","contextIsWrapped","colorScheme","shouldEnableKeyboardHighlightingEffective","isAccordionOpen","setIsAccordionOpen","isGroupFocusWithin","setIsGroupFocusWithin","uuid","isInitialRenderRef","initialRenderSkipRef","current","isInGroup","isOpen","isOpenRef","onCloseRef","onOpenRef","shouldShowKeyboardHighlighting","isKeyboardFocusable","isInKeyboardNavigationGroup","isLastAccordion","length","handleHeadClick","currentIsAccordionOpen","shouldOnlyOpen","accordionContextProviderValue","areaContextProviderValue","shouldChangeColor","accordionWrappedContextProviderValue","initialAnimation","height","opacity","tabIndex","handleKeyDown","e","isCurrentAccordionTarget","currentTarget","target","key","currentIndex","indexOf","nextIndex","nextAccordionUuid","nextAccordionElement","document","querySelector","focus","preventDefault","parentAccordion","parentElement","closest","parentGroupId","getAttribute","split","handleFocus","handleBlur","nextFocusedElement","relatedTarget","currentGroupElement","contains","createElement","animate","className","exit","initial","$isOpen","$shouldShowLines","$isParentWrapped","$isWrapped","$shouldForceBackground","$shouldHideBackground","$shouldHideBottomLine","$bottomBorderColor","borderBottomColor","$shouldEnableKeyboardHighlighting","$shouldShowKeyboardHighlighting","onKeyDown","onFocus","onBlur","onMouseEnter","onMouseLeave","transition","duration","Provider","value","type","onClick","titleColor","maxHeight","onScroll","onAnimationComplete","shouldHideBody","displayName"],"sources":["../../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'motion/react';\nimport React, {\n ChangeEventHandler,\n type CSSProperties,\n FC,\n type MouseEventHandler,\n ReactNode,\n UIEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n KeyboardEvent,\n FocusEvent,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { InputProps } from '../input/Input';\nimport AccordionBody from './accordion-body/AccordionBody';\nimport { AccordionGroupContext } from './accordion-group/AccordionGroup';\nimport AccordionHead from './accordion-head/AccordionHead';\nimport { AccordionWrappedContext } from './accordion-provider/AccordionContextProvider';\nimport { StyledMotionAccordion } from './Accordion.styles';\nimport { useInitialRenderRef } from '../../hooks/ref';\n\nexport const AccordionContext = React.createContext<{ isWrapped?: boolean }>({\n isWrapped: undefined,\n});\n\ntype AccordionColors = {\n titleColor?: CSSProperties['color'];\n borderBottomColor?: CSSProperties['borderBottomColor'];\n};\n\nexport type AccordionProps = {\n /**\n * Maximum height of the accordion body element. This automatically makes the content of the\n * body element scrollable.\n */\n bodyMaxHeight?: number;\n /**\n * The content of the accordion body\n */\n children: ReactNode;\n /**\n * The icon that is displayed in front of the title\n */\n icon?: string;\n /**\n * This can be used to automatically expand the Accordion during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This will disable the Accordion so that it cannot be opened and will gray out the title. Does not work with isOpened.\n */\n isDisabled?: boolean;\n /**\n * This can be used so that the Accordion cannot be opened or closed.\n * In addition, in this case the icon is exchanged to mark the Accordions.\n */\n isFixed?: boolean;\n /**\n * This can be used to open the Accordion from the outside\n */\n isOpened?: boolean;\n /**\n * This will gray out the title of the Accordion to indicate hidden content, for example.\n */\n isTitleGreyed?: boolean;\n /**\n * Function that is executed when the accordion body will be scrolled\n */\n onBodyScroll?: (event: UIEvent<HTMLDivElement>) => void;\n /**\n * Function that is executed when the accordion will be closed.\n */\n onClose?: VoidFunction;\n /**\n * Function to be executed when the accordion is no longer hovered.\n */\n onHoverEnd?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the accordion is hovered.\n */\n onHoverStart?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function that is executed when the accordion will be opened.\n */\n onOpen?: VoidFunction;\n /**\n * Function that is executed when the accordion body is animated\n */\n onBodyAnimationComplete?: VoidFunction;\n /**\n * Function that is executed when the text of the search in the accordion\n * head changes. When this function is given, the search field is displayed\n * in the Accordion Head.\n */\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the search in the accordion\n * title changes. When this function is given, the search field is displayed\n * as the Accordion title.\n */\n onTitleInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Content to be displayed on the right side in the head of the Accordion\n */\n rightElement?: ReactNode;\n /**\n * The placeholder to be used for the search\n */\n searchPlaceholder?: string;\n /**\n * The value that is displayed inside the search\n */\n searchValue?: string;\n /**\n * This will force the background color of the accordion to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * This will hide the background color of the accordion\n */\n shouldHideBackground?: boolean;\n /**\n * Whether the bottom line should be hidden.\n */\n shouldHideBottomLine?: boolean;\n /**\n * This will render the Accordion closed on the first render.\n */\n shouldRenderClosed?: boolean;\n /**\n * Whether the icon should be rotating.\n */\n shouldRotateIcon?: boolean;\n /**\n * Whether the animation should be skipped.\n * If 'isDefaultOpen' is true the initial animation will be skipped even this prop is false\n */\n shouldSkipAnimation?: boolean;\n /**\n * Title of the Accordion displayed in the head\n */\n title?: string;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * The props of the title Input.\n */\n titleInputProps?: InputProps;\n /**\n * Provide custom colors to the Accordion Component\n */\n colors?: AccordionColors;\n /**\n * Whether the accordion should be indexed.\n */\n shouldIndex?: boolean;\n /**\n * Enables keyboard-only focus highlighting. The highlighting is only visible while the\n * user navigates with the keyboard and is reset on mouse movement or click.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst Accordion: FC<AccordionProps> = ({\n bodyMaxHeight,\n children,\n icon,\n isDefaultOpen = false,\n isDisabled = false,\n isFixed = false,\n isOpened,\n isTitleGreyed = false,\n onBodyScroll,\n onClose,\n onHoverEnd,\n onHoverStart,\n onOpen,\n onSearchChange,\n rightElement,\n searchPlaceholder,\n searchValue,\n shouldForceBackground = false,\n shouldHideBackground = false,\n shouldRenderClosed = false,\n shouldRotateIcon = true,\n shouldHideBottomLine = false,\n title,\n titleElement,\n onTitleInputChange,\n titleInputProps,\n shouldSkipAnimation: shouldSkipAnimationProp = false,\n colors,\n shouldIndex = false,\n onBodyAnimationComplete,\n shouldEnableKeyboardHighlighting,\n}) => {\n const {\n isWrapped: groupIsWrapped,\n openAccordionUuid,\n accordionGroupUuid,\n accordionUuids,\n updateOpenAccordionUuid,\n activeAccordionUuid,\n updateActiveAccordionUuid,\n registerAccordionUuid,\n unregisterAccordionUuid,\n } = useContext(AccordionGroupContext);\n const { isWrapped: isParentWrapped } = useContext(AccordionContext);\n\n const { isWrapped: contextIsWrapped } = useContext(AccordionWrappedContext);\n const colorScheme = useColorScheme();\n const shouldEnableKeyboardHighlightingEffective =\n shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;\n\n const isWrapped = useMemo(\n () => groupIsWrapped ?? contextIsWrapped,\n [contextIsWrapped, groupIsWrapped],\n );\n\n const [isAccordionOpen, setIsAccordionOpen] = useState<boolean>(isDefaultOpen ?? isOpened);\n const [isGroupFocusWithin, setIsGroupFocusWithin] = useState(false);\n\n const uuid = useUuid();\n\n const isInitialRenderRef = useRef(true);\n\n const initialRenderSkipRef = useInitialRenderRef(true);\n\n const shouldSkipAnimation =\n shouldSkipAnimationProp ?? (initialRenderSkipRef.current && isDefaultOpen);\n\n const isInGroup = shouldSkipAnimation ? false : typeof updateOpenAccordionUuid === 'function';\n\n const isOpen = isInGroup ? openAccordionUuid === uuid : isAccordionOpen;\n\n const isOpenRef = useRef(isOpen);\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlightingEffective,\n );\n const isKeyboardFocusable =\n !isDisabled && (shouldIndex || shouldEnableKeyboardHighlightingEffective);\n\n const isInKeyboardNavigationGroup =\n isKeyboardFocusable &&\n typeof updateActiveAccordionUuid === 'function' &&\n typeof accordionGroupUuid === 'string';\n\n useEffect(() => {\n if (\n typeof accordionGroupUuid === 'string' &&\n typeof registerAccordionUuid === 'function' &&\n typeof unregisterAccordionUuid === 'function'\n ) {\n registerAccordionUuid(uuid);\n\n return () => {\n unregisterAccordionUuid(uuid);\n };\n }\n\n return undefined;\n }, [accordionGroupUuid, registerAccordionUuid, unregisterAccordionUuid, uuid]);\n\n const isLastAccordion = useMemo(\n () => (accordionUuids ? accordionUuids[accordionUuids.length - 1] === uuid : false),\n [accordionUuids, uuid],\n );\n\n useEffect(() => {\n isOpenRef.current = isOpen;\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [isOpen, onClose, onOpen]);\n\n const handleHeadClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (isKeyboardFocusable && typeof updateActiveAccordionUuid === 'function') {\n updateActiveAccordionUuid(uuid);\n }\n\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }, [isDisabled, isKeyboardFocusable, updateActiveAccordionUuid, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isDisabled && isOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }\n }, [isDisabled, isOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (isDefaultOpen) {\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid, { shouldOnlyOpen: true });\n } else {\n setIsAccordionOpen(true);\n }\n }\n }, [isDefaultOpen, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (typeof isOpened === 'boolean') {\n if (typeof updateOpenAccordionUuid === 'function' && isOpened !== isOpenRef.current) {\n updateOpenAccordionUuid(uuid);\n } else {\n setIsAccordionOpen(isOpened);\n }\n }\n }, [isOpened, updateOpenAccordionUuid, uuid]);\n\n const accordionContextProviderValue = useMemo(\n () => ({ isWrapped: isWrapped === true }),\n [isWrapped],\n );\n\n const areaContextProviderValue = useMemo(\n () => ({ shouldChangeColor: !shouldHideBackground }),\n [shouldHideBackground],\n );\n\n const accordionWrappedContextProviderValue = useMemo(() => ({ isWrapped: true }), []);\n\n const initialAnimation = useMemo(() => {\n if (shouldSkipAnimation) {\n return { height: 'auto', opacity: 1 };\n }\n\n return isOpen ? { height: 'auto', opacity: 1 } : { height: 0, opacity: 0 };\n }, [isOpen, shouldSkipAnimation]);\n\n const tabIndex = useMemo(() => (isKeyboardFocusable ? 0 : -1), [isKeyboardFocusable]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n const isCurrentAccordionTarget = e.currentTarget === e.target;\n\n if (\n isCurrentAccordionTarget &&\n isInKeyboardNavigationGroup &&\n accordionUuids?.length &&\n (e.key === 'ArrowDown' || e.key === 'ArrowUp')\n ) {\n const currentIndex = accordionUuids.indexOf(uuid);\n\n if (currentIndex !== -1) {\n const nextIndex =\n e.key === 'ArrowDown'\n ? (currentIndex + 1) % accordionUuids.length\n : (currentIndex - 1 + accordionUuids.length) % accordionUuids.length;\n const nextAccordionUuid = accordionUuids[nextIndex];\n\n if (nextAccordionUuid && nextAccordionUuid !== uuid) {\n const nextAccordionElement = document.querySelector<HTMLDivElement>(\n `[data-uuid=\"${accordionGroupUuid}---${nextAccordionUuid}\"]`,\n );\n\n if (nextAccordionElement) {\n updateActiveAccordionUuid(nextAccordionUuid);\n nextAccordionElement.focus();\n return;\n }\n }\n }\n }\n\n if (\n isCurrentAccordionTarget &&\n (e.key === 'Enter' || e.key === ' ') &&\n isKeyboardFocusable\n ) {\n handleHeadClick();\n }\n\n if (\n isCurrentAccordionTarget &&\n e.key === 'ArrowRight' &&\n isKeyboardFocusable &&\n !isOpen\n ) {\n e.preventDefault();\n handleHeadClick();\n }\n\n if (isCurrentAccordionTarget && (e.key === 'Escape' || e.key === 'ArrowLeft')) {\n if (isOpen && isKeyboardFocusable) {\n e.preventDefault();\n handleHeadClick();\n return;\n }\n\n if (\n isInKeyboardNavigationGroup &&\n typeof updateActiveAccordionUuid === 'function'\n ) {\n e.preventDefault();\n updateActiveAccordionUuid(undefined);\n let parentAccordion =\n e.currentTarget.parentElement?.closest<HTMLElement>(\n '.beta-chayns-accordion',\n );\n while (parentAccordion) {\n const parentGroupId = parentAccordion\n .getAttribute('data-uuid')\n ?.split('---')[0];\n if (parentGroupId !== accordionGroupUuid) {\n parentAccordion.focus();\n break;\n }\n parentAccordion =\n parentAccordion.parentElement?.closest<HTMLElement>(\n '.beta-chayns-accordion',\n );\n }\n }\n }\n },\n [\n accordionGroupUuid,\n accordionUuids,\n handleHeadClick,\n isInKeyboardNavigationGroup,\n isKeyboardFocusable,\n isOpen,\n updateActiveAccordionUuid,\n uuid,\n ],\n );\n\n const handleFocus = useCallback(\n (e: FocusEvent<HTMLDivElement>) => {\n if (\n e.currentTarget === e.target &&\n isInKeyboardNavigationGroup &&\n typeof updateActiveAccordionUuid === 'function'\n ) {\n setIsGroupFocusWithin(true);\n updateActiveAccordionUuid(uuid);\n }\n },\n [isInKeyboardNavigationGroup, updateActiveAccordionUuid, uuid],\n );\n\n const handleBlur = useCallback(\n (e: FocusEvent<HTMLDivElement>) => {\n if (\n isInKeyboardNavigationGroup &&\n typeof updateActiveAccordionUuid === 'function' &&\n typeof accordionGroupUuid === 'string'\n ) {\n const nextFocusedElement = e.relatedTarget as Node | null;\n const currentGroupElement = e.currentTarget as HTMLElement;\n\n if (!nextFocusedElement || !currentGroupElement.contains(nextFocusedElement)) {\n setIsGroupFocusWithin(false);\n updateActiveAccordionUuid(undefined);\n }\n }\n },\n [accordionGroupUuid, isInKeyboardNavigationGroup, updateActiveAccordionUuid],\n );\n\n useEffect(() => {\n if (!isInKeyboardNavigationGroup) {\n setIsGroupFocusWithin(false);\n } else if (\n activeAccordionUuid == null &&\n typeof updateActiveAccordionUuid === 'function' &&\n accordionUuids?.[0] === uuid\n ) {\n updateActiveAccordionUuid(uuid);\n }\n }, [\n accordionUuids,\n activeAccordionUuid,\n isInKeyboardNavigationGroup,\n updateActiveAccordionUuid,\n uuid,\n ]);\n\n return (\n <StyledMotionAccordion\n animate={{ height: 'auto', opacity: 1 }}\n data-uuid={`${accordionGroupUuid ?? ''}---${uuid}`}\n className=\"beta-chayns-accordion\"\n exit={{ height: 0, opacity: 0 }}\n initial={initialAnimation}\n $isOpen={isOpen}\n tabIndex={tabIndex}\n $shouldShowLines={!isLastAccordion || !isWrapped}\n $isParentWrapped={isParentWrapped}\n $isWrapped={isWrapped}\n $shouldForceBackground={shouldForceBackground}\n $shouldHideBackground={shouldHideBackground}\n $shouldHideBottomLine={shouldHideBottomLine}\n $bottomBorderColor={colors?.borderBottomColor}\n $shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlightingEffective}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onMouseEnter={onHoverStart}\n onMouseLeave={onHoverEnd}\n transition={{ duration: shouldSkipAnimation ? 0 : 0.25 }}\n >\n <AccordionContext.Provider value={accordionContextProviderValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AccordionHead\n uuid={uuid}\n icon={icon}\n isOpen={isOpen}\n shouldSkipAnimation={shouldSkipAnimation}\n isFixed={isFixed}\n isTitleGreyed={isTitleGreyed || isDisabled}\n isWrapped={isWrapped === true}\n onClick={handleHeadClick}\n onSearchChange={onSearchChange}\n rightElement={rightElement}\n searchPlaceholder={searchPlaceholder}\n searchValue={searchValue}\n shouldRotateIcon={shouldRotateIcon}\n title={title}\n titleElement={titleElement}\n onTitleInputChange={onTitleInputChange}\n titleInputProps={titleInputProps}\n titleColor={colors?.titleColor}\n shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlightingEffective}\n />\n <AnimatePresence initial={false}>\n {(isOpen || shouldRenderClosed) && (\n <AccordionBody\n shouldSkipAnimation={shouldSkipAnimation}\n maxHeight={bodyMaxHeight}\n onScroll={onBodyScroll}\n onAnimationComplete={onBodyAnimationComplete}\n shouldHideBody={shouldRenderClosed && !isOpen}\n >\n <AccordionWrappedContext.Provider\n value={accordionWrappedContextProviderValue}\n >\n <AreaContext.Provider value={areaContextProviderValue}>\n {children}\n </AreaContext.Provider>\n </AccordionWrappedContext.Provider>\n </AccordionBody>\n )}\n </AnimatePresence>\n </MotionConfig>\n </AccordionContext.Provider>\n </StyledMotionAccordion>\n );\n};\n\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAC5D,OAAOC,KAAK,IAORC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAGL,OAAO;AACd,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SAASC,WAAW,QAAQ,sCAAsC;AAClE,SAASC,cAAc,QAAQ,8CAA8C;AAE7E,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,uBAAuB,QAAQ,+CAA+C;AACvF,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,mBAAmB,QAAQ,iBAAiB;AAErD,OAAO,MAAMC,gBAAgB,gBAAGjB,KAAK,CAACkB,aAAa,CAA0B;EACzEC,SAAS,EAAEC;AACf,CAAC,CAAC;AA8IF,MAAMC,SAA6B,GAAGA,CAAC;EACnCC,aAAa;EACbC,QAAQ;EACRC,IAAI;EACJC,aAAa,GAAG,KAAK;EACrBC,U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B,CAACoI,QAAQ;IAC7BC,KAAK,EAAExD;EAAqC,gBAE5C3F,KAAA,CAAA2H,aAAA,CAAClH,WAAW,CAACyI,QAAQ;IAACC,KAAK,EAAE1D;EAAyB,GACjDlE,QACiB,CACQ,CACvB,CAEN,CACP,CACS,CACR,CAAC;AAEhC,CAAC;AAEDF,SAAS,CAACsI,WAAW,GAAG,WAAW;AAEnC,eAAetI,SAAS","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import { motion } from 'motion/react';
2
2
  import styled, { css } from 'styled-components';
3
+ import { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';
3
4
  export const StyledMotionAccordion = styled(motion.div)`
4
5
  ${({
5
6
  $isOpen,
@@ -69,12 +70,31 @@ export const StyledMotionAccordion = styled(motion.div)`
69
70
  ${({
70
71
  $isWrapped,
71
72
  $shouldHideBackground,
72
- theme
73
+ theme,
74
+ $shouldEnableKeyboardHighlighting
73
75
  }) => !$isWrapped && !$shouldHideBackground && css`
74
- &:hover,
75
- &:focus-visible {
76
+ &:hover {
76
77
  background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});
77
78
  }
79
+ ${!$shouldEnableKeyboardHighlighting ? css`
80
+ &:focus-visible {
81
+ background-color: rgba(
82
+ ${theme['100-rgb']},
83
+ ${theme.cardBackgroundOpacity}
84
+ );
85
+ }
86
+ ` : null}
87
+ `};
88
+
89
+ ${({
90
+ $shouldEnableKeyboardHighlighting,
91
+ $shouldShowKeyboardHighlighting,
92
+ $shouldHideBackground
93
+ }) => $shouldEnableKeyboardHighlighting && $shouldShowKeyboardHighlighting && !$shouldHideBackground && css`
94
+ &:focus-visible {
95
+ transition: none;
96
+ ${keyboardFocusHighlightingRingCss};
97
+ }
78
98
  `};
79
99
  `;
80
100
  //# sourceMappingURL=Accordion.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.styles.js","names":["motion","styled","css","StyledMotionAccordion","div","$isOpen","$isWrapped","$shouldForceBackground","$shouldHideBackground","theme","cardBackgroundOpacity","cardBorderRadius","cardShadow","accordionLines","$shouldShowLines","$shouldHideBottomLine","$bottomBorderColor","undefined","shouldShowBottomBorder","$isParentWrapped"],"sources":["../../../../src/components/accordion/Accordion.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledMotionAccordionProps = WithTheme<{\n $isOpen: boolean;\n $isParentWrapped?: boolean;\n $isWrapped?: boolean;\n $shouldForceBackground?: boolean;\n $shouldHideBackground?: boolean;\n $shouldShowLines?: boolean;\n $shouldHideBottomLine: boolean;\n $bottomBorderColor?: string;\n}>;\n\nexport const StyledMotionAccordion = styled(motion.div)<StyledMotionAccordionProps>`\n ${({\n $isOpen,\n $isWrapped,\n $shouldForceBackground,\n $shouldHideBackground,\n theme,\n }: StyledMotionAccordionProps) =>\n ($isOpen || $shouldForceBackground) &&\n !$isWrapped &&\n !$shouldHideBackground &&\n css`\n background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});\n border-radius: ${theme.cardBorderRadius}px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${theme.cardShadow});\n `}\n\n ${({ theme }: StyledMotionAccordionProps) =>\n theme.accordionLines &&\n css`\n border-bottom: 1px solid transparent;\n `}\n\n margin-bottom: ${({ $isOpen, $isWrapped }: StyledMotionAccordionProps) =>\n $isOpen && !$isWrapped ? '30px' : '0px'};\n transition:\n background-color 0.3s ease,\n border-bottom-color 0.3s ease,\n border-radius 0.3s ease,\n box-shadow 0.3s ease,\n margin-bottom 0.3s ease;\n will-change: unset !important;\n\n margin-top: 10px;\n\n ${({\n $isOpen,\n $isWrapped,\n $shouldForceBackground,\n $shouldShowLines,\n $shouldHideBottomLine,\n theme,\n $bottomBorderColor,\n }: StyledMotionAccordionProps) => {\n if ($shouldForceBackground || $shouldHideBottomLine) return undefined;\n const shouldShowBottomBorder =\n theme.accordionLines && $shouldShowLines && ($isWrapped || !$isOpen);\n\n if ($bottomBorderColor && shouldShowBottomBorder)\n return css`\n border-bottom-color: ${$bottomBorderColor};\n `;\n\n if (shouldShowBottomBorder) {\n return css`\n border-bottom-color: rgba(${theme['headline-rgb']}, 1);\n `;\n }\n\n return undefined;\n }}\n ${({ $isParentWrapped }: StyledMotionAccordionProps) =>\n $isParentWrapped &&\n css`\n padding-left: 17px;\n `}\n ${({ $isWrapped }: StyledMotionAccordionProps) =>\n !$isWrapped\n ? css`\n margin-top: 5px;\n `\n : css`\n margin: 0;\n `}\n ${({ $isWrapped, $shouldHideBackground, theme }: StyledMotionAccordionProps) =>\n !$isWrapped &&\n !$shouldHideBackground &&\n css`\n &:hover,\n &:focus-visible {\n background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});\n }\n `};\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAc/C,OAAO,MAAMC,qBAAqB,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAA6B;AACnF,MAAM,CAAC;EACCC,OAAO;EACPC,UAAU;EACVC,sBAAsB;EACtBC,qBAAqB;EACrBC;AACwB,CAAC,KACzB,CAACJ,OAAO,IAAIE,sBAAsB,KAClC,CAACD,UAAU,IACX,CAACE,qBAAqB,IACtBN,GAAG;AACX,qCAAqCO,KAAK,CAAC,SAAS,CAAC,KAAKA,KAAK,CAACC,qBAAqB;AACrF,6BAA6BD,KAAK,CAACE,gBAAgB;AACnD,oDAAoDF,KAAK,CAACG,UAAU;AACpE,SAAS;AACT;AACA,MAAM,CAAC;EAAEH;AAAkC,CAAC,KACpCA,KAAK,CAACI,cAAc,IACpBX,GAAG;AACX;AACA,SAAS;AACT;AACA,qBAAqB,CAAC;EAAEG,OAAO;EAAEC;AAAuC,CAAC,KACjED,OAAO,IAAI,CAACC,UAAU,GAAG,MAAM,GAAG,KAAK;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC;EACCD,OAAO;EACPC,UAAU;EACVC,sBAAsB;EACtBO,gBAAgB;EAChBC,qBAAqB;EACrBN,KAAK;EACLO;AACwB,CAAC,KAAK;EAC9B,IAAIT,sBAAsB,IAAIQ,qBAAqB,EAAE,OAAOE,SAAS;EACrE,MAAMC,sBAAsB,GACxBT,KAAK,CAACI,cAAc,IAAIC,gBAAgB,KAAKR,UAAU,IAAI,CAACD,OAAO,CAAC;EAExE,IAAIW,kBAAkB,IAAIE,sBAAsB,EAC5C,OAAOhB,GAAG;AACtB,uCAAuCc,kBAAkB;AACzD,aAAa;EAEL,IAAIE,sBAAsB,EAAE;IACxB,OAAOhB,GAAG;AACtB,4CAA4CO,KAAK,CAAC,cAAc,CAAC;AACjE,aAAa;EACL;EAEA,OAAOQ,SAAS;AACpB,CAAC;AACL,MAAM,CAAC;EAAEE;AAA6C,CAAC,KAC/CA,gBAAgB,IAChBjB,GAAG;AACX;AACA,SAAS;AACT,MAAM,CAAC;EAAEI;AAAuC,CAAC,KACzC,CAACA,UAAU,GACLJ,GAAG;AACjB;AACA,eAAe,GACDA,GAAG;AACjB;AACA,eAAe;AACf,MAAM,CAAC;EAAEI,UAAU;EAAEE,qBAAqB;EAAEC;AAAkC,CAAC,KACvE,CAACH,UAAU,IACX,CAACE,qBAAqB,IACtBN,GAAG;AACX;AACA;AACA,yCAAyCO,KAAK,CAAC,SAAS,CAAC,KAAKA,KAAK,CAACC,qBAAqB;AACzF;AACA,SAAS;AACT,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Accordion.styles.js","names":["motion","styled","css","keyboardFocusHighlightingRingCss","StyledMotionAccordion","div","$isOpen","$isWrapped","$shouldForceBackground","$shouldHideBackground","theme","cardBackgroundOpacity","cardBorderRadius","cardShadow","accordionLines","$shouldShowLines","$shouldHideBottomLine","$bottomBorderColor","undefined","shouldShowBottomBorder","$isParentWrapped","$shouldEnableKeyboardHighlighting","$shouldShowKeyboardHighlighting"],"sources":["../../../../src/components/accordion/Accordion.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledMotionAccordionProps = WithTheme<{\n $isOpen: boolean;\n $isParentWrapped?: boolean;\n $isWrapped?: boolean;\n $shouldForceBackground?: boolean;\n $shouldHideBackground?: boolean;\n $shouldShowLines?: boolean;\n $shouldHideBottomLine: boolean;\n $bottomBorderColor?: string;\n $shouldEnableKeyboardHighlighting?: boolean;\n $shouldShowKeyboardHighlighting?: boolean;\n}>;\n\nexport const StyledMotionAccordion = styled(motion.div)<StyledMotionAccordionProps>`\n ${({\n $isOpen,\n $isWrapped,\n $shouldForceBackground,\n $shouldHideBackground,\n theme,\n }: StyledMotionAccordionProps) =>\n ($isOpen || $shouldForceBackground) &&\n !$isWrapped &&\n !$shouldHideBackground &&\n css`\n background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});\n border-radius: ${theme.cardBorderRadius}px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${theme.cardShadow});\n `}\n\n ${({ theme }: StyledMotionAccordionProps) =>\n theme.accordionLines &&\n css`\n border-bottom: 1px solid transparent;\n `}\n\n margin-bottom: ${({ $isOpen, $isWrapped }: StyledMotionAccordionProps) =>\n $isOpen && !$isWrapped ? '30px' : '0px'};\n transition:\n background-color 0.3s ease,\n border-bottom-color 0.3s ease,\n border-radius 0.3s ease,\n box-shadow 0.3s ease,\n margin-bottom 0.3s ease;\n will-change: unset !important;\n\n margin-top: 10px;\n\n ${({\n $isOpen,\n $isWrapped,\n $shouldForceBackground,\n $shouldShowLines,\n $shouldHideBottomLine,\n theme,\n $bottomBorderColor,\n }: StyledMotionAccordionProps) => {\n if ($shouldForceBackground || $shouldHideBottomLine) return undefined;\n const shouldShowBottomBorder =\n theme.accordionLines && $shouldShowLines && ($isWrapped || !$isOpen);\n\n if ($bottomBorderColor && shouldShowBottomBorder)\n return css`\n border-bottom-color: ${$bottomBorderColor};\n `;\n\n if (shouldShowBottomBorder) {\n return css`\n border-bottom-color: rgba(${theme['headline-rgb']}, 1);\n `;\n }\n\n return undefined;\n }}\n ${({ $isParentWrapped }: StyledMotionAccordionProps) =>\n $isParentWrapped &&\n css`\n padding-left: 17px;\n `}\n ${({ $isWrapped }: StyledMotionAccordionProps) =>\n !$isWrapped\n ? css`\n margin-top: 5px;\n `\n : css`\n margin: 0;\n `}\n ${({\n $isWrapped,\n $shouldHideBackground,\n theme,\n $shouldEnableKeyboardHighlighting,\n }: StyledMotionAccordionProps) =>\n !$isWrapped &&\n !$shouldHideBackground &&\n css`\n &:hover {\n background-color: rgba(${theme['100-rgb']}, ${theme.cardBackgroundOpacity});\n }\n ${!$shouldEnableKeyboardHighlighting\n ? css`\n &:focus-visible {\n background-color: rgba(\n ${theme['100-rgb']},\n ${theme.cardBackgroundOpacity}\n );\n }\n `\n : null}\n `};\n\n ${({\n $shouldEnableKeyboardHighlighting,\n $shouldShowKeyboardHighlighting,\n $shouldHideBackground,\n }: StyledMotionAccordionProps) =>\n $shouldEnableKeyboardHighlighting &&\n $shouldShowKeyboardHighlighting &&\n !$shouldHideBackground &&\n css`\n &:focus-visible {\n transition: none;\n ${keyboardFocusHighlightingRingCss};\n }\n `};\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,gCAAgC,QAAQ,8CAA8C;AAe/F,OAAO,MAAMC,qBAAqB,GAAGH,MAAM,CAACD,MAAM,CAACK,GAAG,CAA6B;AACnF,MAAM,CAAC;EACCC,OAAO;EACPC,UAAU;EACVC,sBAAsB;EACtBC,qBAAqB;EACrBC;AACwB,CAAC,KACzB,CAACJ,OAAO,IAAIE,sBAAsB,KAClC,CAACD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AAC,KACzB,CAACd,UAAU,IACX,CAACE,qBAAqB,IACtBP,GAAG;AACX;AACA,yCAAyCQ,KAAK,CAAC,SAAS,CAAC,KAAKA,KAAK,CAACC,qBAAqB;AACzF;AACA,cAAc,CAACU,iCAAiC,GAC9BnB,GAAG;AACrB;AACA;AACA,gCAAgCQ,KAAK,CAAC,SAAS,CAAC;AAChD,gCAAgCA,KAAK,CAACC,qBAAqB;AAC3D;AACA;AACA,mBAAmB,GACD,IAAI;AACtB,SAAS;AACT;AACA,MAAM,CAAC;EACCU,iCAAiC;EACjCC,+BAA+B;EAC/Bb;AACwB,CAAC,KACzBY,iCAAiC,IACjCC,+BAA+B,IAC/B,CAACb,qBAAqB,IACtBP,GAAG;AACX;AACA;AACA,kBAAkBC,gCAAgC;AAClD;AACA,SAAS;AACT,CAAC","ignoreList":[]}
@@ -1,7 +1,9 @@
1
1
  import { motion } from 'motion/react';
2
2
  import styled, { css } from 'styled-components';
3
3
  export const StyledMotionAccordionBody = styled(motion.div)`
4
- overflow: hidden;
4
+ /* overflow: clip erlaubt overflow-clip-margin, sodass der Fokusring sichtbar bleibt */
5
+ overflow: clip;
6
+ overflow-clip-margin: 4px;
5
7
  transition: none !important;
6
8
 
7
9
  ${({