@chayns-components/core 5.3.10 → 5.3.11-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) 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 +17 -0
  21. package/lib/cjs/components/button/Button.styles.js.map +1 -1
  22. package/lib/cjs/components/button/Button.types.js.map +1 -1
  23. package/lib/cjs/components/checkbox/Checkbox.js +5 -1
  24. package/lib/cjs/components/checkbox/Checkbox.js.map +1 -1
  25. package/lib/cjs/components/checkbox/Checkbox.styles.js +29 -2
  26. package/lib/cjs/components/checkbox/Checkbox.styles.js.map +1 -1
  27. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  28. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  29. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  30. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  31. package/lib/cjs/components/combobox/ComboBox.js +52 -5
  32. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  33. package/lib/cjs/components/combobox/ComboBox.styles.js +11 -0
  34. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  35. package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -1
  36. package/lib/cjs/components/context-menu/ContextMenu.js +100 -6
  37. package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
  38. package/lib/cjs/components/context-menu/ContextMenu.styles.js +38 -0
  39. package/lib/cjs/components/context-menu/ContextMenu.styles.js.map +1 -1
  40. package/lib/cjs/components/context-menu/ContextMenu.types.js.map +1 -1
  41. package/lib/cjs/components/file-input/FileInput.js +4 -2
  42. package/lib/cjs/components/file-input/FileInput.js.map +1 -1
  43. package/lib/cjs/components/file-list/file-item/FileItem.js +23 -2
  44. package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
  45. package/lib/cjs/components/file-list/file-item/FileItem.styles.js +19 -1
  46. package/lib/cjs/components/file-list/file-item/FileItem.styles.js.map +1 -1
  47. package/lib/cjs/components/file-select/FileSelect.js +27 -4
  48. package/lib/cjs/components/file-select/FileSelect.js.map +1 -1
  49. package/lib/cjs/components/file-select/FileSelect.styles.js +10 -0
  50. package/lib/cjs/components/file-select/FileSelect.styles.js.map +1 -1
  51. package/lib/cjs/components/filter/Filter.js +51 -16
  52. package/lib/cjs/components/filter/Filter.js.map +1 -1
  53. package/lib/cjs/components/filter/Filter.styles.js +9 -0
  54. package/lib/cjs/components/filter/Filter.styles.js.map +1 -1
  55. package/lib/cjs/components/filter/filter-content/FilterContent.js +14 -5
  56. package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
  57. package/lib/cjs/components/filter/filter-content/FilterContent.types.js.map +1 -1
  58. package/lib/cjs/components/filter-buttons/FilterButtons.js +69 -4
  59. package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
  60. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js +40 -2
  61. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  62. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  63. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  64. package/lib/cjs/components/grid-image/GridImage.js +20 -2
  65. package/lib/cjs/components/grid-image/GridImage.js.map +1 -1
  66. package/lib/cjs/components/grid-image/GridImage.styles.js +11 -2
  67. package/lib/cjs/components/grid-image/GridImage.styles.js.map +1 -1
  68. package/lib/cjs/components/grouped-image/GroupedImage.js +23 -4
  69. package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
  70. package/lib/cjs/components/grouped-image/GroupedImage.styles.js +9 -0
  71. package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
  72. package/lib/cjs/components/highlight-slider/HighlightSlider.js +10 -3
  73. package/lib/cjs/components/highlight-slider/HighlightSlider.js.map +1 -1
  74. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +21 -4
  75. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  76. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +11 -2
  77. package/lib/cjs/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  78. package/lib/cjs/components/icon/Icon.js +24 -5
  79. package/lib/cjs/components/icon/Icon.js.map +1 -1
  80. package/lib/cjs/components/icon/Icon.styles.js +23 -0
  81. package/lib/cjs/components/icon/Icon.styles.js.map +1 -1
  82. package/lib/cjs/components/input/Input.js +29 -8
  83. package/lib/cjs/components/input/Input.js.map +1 -1
  84. package/lib/cjs/components/input/Input.styles.js +33 -3
  85. package/lib/cjs/components/input/Input.styles.js.map +1 -1
  86. package/lib/cjs/components/list/List.js +124 -37
  87. package/lib/cjs/components/list/List.js.map +1 -1
  88. package/lib/cjs/components/list/List.utils.js +107 -1
  89. package/lib/cjs/components/list/List.utils.js.map +1 -1
  90. package/lib/cjs/components/list/list-item/ListItem.js +82 -3
  91. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  92. package/lib/cjs/components/list/list-item/ListItem.styles.js +9 -0
  93. package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
  94. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js +40 -5
  95. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  96. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +5 -1
  97. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  98. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +32 -1
  99. package/lib/cjs/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  100. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +32 -1
  101. package/lib/cjs/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  102. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +30 -1
  103. package/lib/cjs/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  104. package/lib/cjs/components/list/list-item/useListItemFocus.js +47 -0
  105. package/lib/cjs/components/list/list-item/useListItemFocus.js.map +1 -0
  106. package/lib/cjs/components/mention-finder/MentionFinder.js +31 -2
  107. package/lib/cjs/components/mention-finder/MentionFinder.js.map +1 -1
  108. package/lib/cjs/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  109. package/lib/cjs/components/multi-action-button/MultiActionButton.js +36 -3
  110. package/lib/cjs/components/multi-action-button/MultiActionButton.js.map +1 -1
  111. package/lib/cjs/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  112. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js +7 -1
  113. package/lib/cjs/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  114. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  115. package/lib/cjs/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  116. package/lib/cjs/components/number-input/NumberInput.js +13 -10
  117. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  118. package/lib/cjs/components/page-provider/PageProvider.js +4 -2
  119. package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
  120. package/lib/cjs/components/popup/Popup.js +8 -1
  121. package/lib/cjs/components/popup/Popup.js.map +1 -1
  122. package/lib/cjs/components/radio-button/RadioButton.js +29 -15
  123. package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
  124. package/lib/cjs/components/radio-button/RadioButton.styles.js +19 -8
  125. package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
  126. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  127. package/lib/cjs/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  128. package/lib/cjs/components/search-box/SearchBox.js +5 -2
  129. package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
  130. package/lib/cjs/components/search-input/SearchInput.js +40 -41
  131. package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
  132. package/lib/cjs/components/search-input/SearchInput.styles.js +25 -2
  133. package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
  134. package/lib/cjs/components/select-button/SelectButton.js +4 -2
  135. package/lib/cjs/components/select-button/SelectButton.js.map +1 -1
  136. package/lib/cjs/components/setup-wizard/SetupWizard.js +7 -4
  137. package/lib/cjs/components/setup-wizard/SetupWizard.js.map +1 -1
  138. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  139. package/lib/cjs/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  140. package/lib/cjs/components/sharing-bar/SharingBar.js +31 -6
  141. package/lib/cjs/components/sharing-bar/SharingBar.js.map +1 -1
  142. package/lib/cjs/components/sharing-bar/SharingBar.styles.js +5 -0
  143. package/lib/cjs/components/sharing-bar/SharingBar.styles.js.map +1 -1
  144. package/lib/cjs/components/sharing-button/SharingButton.js +4 -2
  145. package/lib/cjs/components/sharing-button/SharingButton.js.map +1 -1
  146. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js +3 -1
  147. package/lib/cjs/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  148. package/lib/cjs/components/signature/Signature.js +6 -3
  149. package/lib/cjs/components/signature/Signature.js.map +1 -1
  150. package/lib/cjs/components/slider/Slider.js +30 -7
  151. package/lib/cjs/components/slider/Slider.js.map +1 -1
  152. package/lib/cjs/components/slider/Slider.styles.js +9 -2
  153. package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
  154. package/lib/cjs/components/slider-button/SliderButton.js +63 -6
  155. package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
  156. package/lib/cjs/components/slider-button/SliderButton.styles.js +19 -2
  157. package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
  158. package/lib/cjs/components/slider-button/SliderButton.types.js +6 -0
  159. package/lib/cjs/components/slider-button/SliderButton.types.js.map +1 -0
  160. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js +66 -0
  161. package/lib/cjs/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  162. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js +47 -0
  163. package/lib/cjs/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  164. package/lib/cjs/components/tag-input/TagInput.js +91 -36
  165. package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
  166. package/lib/cjs/components/tag-input/TagInput.styles.js +31 -3
  167. package/lib/cjs/components/tag-input/TagInput.styles.js.map +1 -1
  168. package/lib/cjs/components/text-area/TextArea.js +17 -8
  169. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  170. package/lib/cjs/components/text-area/TextArea.styles.js +15 -1
  171. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  172. package/lib/cjs/components/truncation/Truncation.js +17 -3
  173. package/lib/cjs/components/truncation/Truncation.js.map +1 -1
  174. package/lib/cjs/components/truncation/Truncation.styles.js +19 -1
  175. package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
  176. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js +68 -0
  177. package/lib/cjs/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  178. package/lib/cjs/utils/file.js.map +1 -1
  179. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js +30 -0
  180. package/lib/cjs/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  181. package/lib/esm/components/accordion/Accordion.js +105 -12
  182. package/lib/esm/components/accordion/Accordion.js.map +1 -1
  183. package/lib/esm/components/accordion/Accordion.styles.js +23 -3
  184. package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
  185. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +3 -1
  186. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  187. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +33 -19
  188. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  189. package/lib/esm/components/accordion/accordion-head/AccordionHead.js +6 -3
  190. package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  191. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +14 -0
  192. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  193. package/lib/esm/components/amount-control/AmountControl.js +30 -16
  194. package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
  195. package/lib/esm/components/amount-control/AmountControl.styles.js +18 -2
  196. package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
  197. package/lib/esm/components/button/Button.js +5 -1
  198. package/lib/esm/components/button/Button.js.map +1 -1
  199. package/lib/esm/components/button/Button.styles.js +17 -0
  200. package/lib/esm/components/button/Button.styles.js.map +1 -1
  201. package/lib/esm/components/button/Button.types.js.map +1 -1
  202. package/lib/esm/components/checkbox/Checkbox.js +5 -1
  203. package/lib/esm/components/checkbox/Checkbox.js.map +1 -1
  204. package/lib/esm/components/checkbox/Checkbox.styles.js +29 -2
  205. package/lib/esm/components/checkbox/Checkbox.styles.js.map +1 -1
  206. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +7 -2
  207. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  208. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +8 -2
  209. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  210. package/lib/esm/components/combobox/ComboBox.js +50 -5
  211. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  212. package/lib/esm/components/combobox/ComboBox.styles.js +11 -0
  213. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  214. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
  215. package/lib/esm/components/context-menu/ContextMenu.js +99 -5
  216. package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
  217. package/lib/esm/components/context-menu/ContextMenu.styles.js +38 -0
  218. package/lib/esm/components/context-menu/ContextMenu.styles.js.map +1 -1
  219. package/lib/esm/components/context-menu/ContextMenu.types.js.map +1 -1
  220. package/lib/esm/components/file-input/FileInput.js +4 -2
  221. package/lib/esm/components/file-input/FileInput.js.map +1 -1
  222. package/lib/esm/components/file-list/file-item/FileItem.js +24 -3
  223. package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
  224. package/lib/esm/components/file-list/file-item/FileItem.styles.js +18 -0
  225. package/lib/esm/components/file-list/file-item/FileItem.styles.js.map +1 -1
  226. package/lib/esm/components/file-select/FileSelect.js +27 -4
  227. package/lib/esm/components/file-select/FileSelect.js.map +1 -1
  228. package/lib/esm/components/file-select/FileSelect.styles.js +10 -0
  229. package/lib/esm/components/file-select/FileSelect.styles.js.map +1 -1
  230. package/lib/esm/components/filter/Filter.js +52 -16
  231. package/lib/esm/components/filter/Filter.js.map +1 -1
  232. package/lib/esm/components/filter/Filter.styles.js +9 -0
  233. package/lib/esm/components/filter/Filter.styles.js.map +1 -1
  234. package/lib/esm/components/filter/filter-content/FilterContent.js +15 -5
  235. package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
  236. package/lib/esm/components/filter/filter-content/FilterContent.types.js.map +1 -1
  237. package/lib/esm/components/filter-buttons/FilterButtons.js +69 -5
  238. package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
  239. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js +40 -2
  240. package/lib/esm/components/filter-buttons/filter-button/FilterButton.js.map +1 -1
  241. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +11 -0
  242. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  243. package/lib/esm/components/grid-image/GridImage.js +20 -2
  244. package/lib/esm/components/grid-image/GridImage.js.map +1 -1
  245. package/lib/esm/components/grid-image/GridImage.styles.js +10 -1
  246. package/lib/esm/components/grid-image/GridImage.styles.js.map +1 -1
  247. package/lib/esm/components/grouped-image/GroupedImage.js +22 -4
  248. package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
  249. package/lib/esm/components/grouped-image/GroupedImage.styles.js +9 -0
  250. package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
  251. package/lib/esm/components/highlight-slider/HighlightSlider.js +10 -3
  252. package/lib/esm/components/highlight-slider/HighlightSlider.js.map +1 -1
  253. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js +20 -3
  254. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.js.map +1 -1
  255. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js +10 -1
  256. package/lib/esm/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.js.map +1 -1
  257. package/lib/esm/components/icon/Icon.js +26 -7
  258. package/lib/esm/components/icon/Icon.js.map +1 -1
  259. package/lib/esm/components/icon/Icon.styles.js +23 -0
  260. package/lib/esm/components/icon/Icon.styles.js.map +1 -1
  261. package/lib/esm/components/input/Input.js +24 -4
  262. package/lib/esm/components/input/Input.js.map +1 -1
  263. package/lib/esm/components/input/Input.styles.js +33 -3
  264. package/lib/esm/components/input/Input.styles.js.map +1 -1
  265. package/lib/esm/components/list/List.js +123 -37
  266. package/lib/esm/components/list/List.js.map +1 -1
  267. package/lib/esm/components/list/List.utils.js +99 -0
  268. package/lib/esm/components/list/List.utils.js.map +1 -1
  269. package/lib/esm/components/list/list-item/ListItem.js +83 -4
  270. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  271. package/lib/esm/components/list/list-item/ListItem.styles.js +9 -0
  272. package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
  273. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +41 -6
  274. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  275. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +4 -0
  276. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  277. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js +33 -2
  278. package/lib/esm/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.js.map +1 -1
  279. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js +33 -2
  280. package/lib/esm/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.js.map +1 -1
  281. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js +30 -1
  282. package/lib/esm/components/list/list-item/list-item-head/list-item-title/ListItemTitle.js.map +1 -1
  283. package/lib/esm/components/list/list-item/useListItemFocus.js +40 -0
  284. package/lib/esm/components/list/list-item/useListItemFocus.js.map +1 -0
  285. package/lib/esm/components/mention-finder/MentionFinder.js +30 -2
  286. package/lib/esm/components/mention-finder/MentionFinder.js.map +1 -1
  287. package/lib/esm/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -1
  288. package/lib/esm/components/multi-action-button/MultiActionButton.js +36 -3
  289. package/lib/esm/components/multi-action-button/MultiActionButton.js.map +1 -1
  290. package/lib/esm/components/multi-action-button/MultiActionButton.types.js.map +1 -1
  291. package/lib/esm/components/multi-action-button/action-button/ActionButton.js +7 -1
  292. package/lib/esm/components/multi-action-button/action-button/ActionButton.js.map +1 -1
  293. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js +12 -0
  294. package/lib/esm/components/multi-action-button/action-button/ActionButton.styles.js.map +1 -1
  295. package/lib/esm/components/number-input/NumberInput.js +13 -10
  296. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  297. package/lib/esm/components/page-provider/PageProvider.js +4 -2
  298. package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
  299. package/lib/esm/components/popup/Popup.js +8 -1
  300. package/lib/esm/components/popup/Popup.js.map +1 -1
  301. package/lib/esm/components/radio-button/RadioButton.js +29 -15
  302. package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
  303. package/lib/esm/components/radio-button/RadioButton.styles.js +19 -8
  304. package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
  305. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js +7 -4
  306. package/lib/esm/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -1
  307. package/lib/esm/components/search-box/SearchBox.js +5 -2
  308. package/lib/esm/components/search-box/SearchBox.js.map +1 -1
  309. package/lib/esm/components/search-input/SearchInput.js +41 -42
  310. package/lib/esm/components/search-input/SearchInput.js.map +1 -1
  311. package/lib/esm/components/search-input/SearchInput.styles.js +24 -1
  312. package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
  313. package/lib/esm/components/select-button/SelectButton.js +4 -2
  314. package/lib/esm/components/select-button/SelectButton.js.map +1 -1
  315. package/lib/esm/components/setup-wizard/SetupWizard.js +7 -4
  316. package/lib/esm/components/setup-wizard/SetupWizard.js.map +1 -1
  317. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js +5 -3
  318. package/lib/esm/components/setup-wizard/setup-wizard-item/SetupWizardItem.js.map +1 -1
  319. package/lib/esm/components/sharing-bar/SharingBar.js +30 -5
  320. package/lib/esm/components/sharing-bar/SharingBar.js.map +1 -1
  321. package/lib/esm/components/sharing-bar/SharingBar.styles.js +5 -0
  322. package/lib/esm/components/sharing-bar/SharingBar.styles.js.map +1 -1
  323. package/lib/esm/components/sharing-button/SharingButton.js +4 -2
  324. package/lib/esm/components/sharing-button/SharingButton.js.map +1 -1
  325. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js +3 -1
  326. package/lib/esm/components/sharing-context-menu/SharingContextMenu.js.map +1 -1
  327. package/lib/esm/components/signature/Signature.js +6 -3
  328. package/lib/esm/components/signature/Signature.js.map +1 -1
  329. package/lib/esm/components/slider/Slider.js +30 -7
  330. package/lib/esm/components/slider/Slider.js.map +1 -1
  331. package/lib/esm/components/slider/Slider.styles.js +8 -1
  332. package/lib/esm/components/slider/Slider.styles.js.map +1 -1
  333. package/lib/esm/components/slider-button/SliderButton.js +62 -6
  334. package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
  335. package/lib/esm/components/slider-button/SliderButton.styles.js +18 -1
  336. package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
  337. package/lib/esm/components/slider-button/SliderButton.types.js +2 -0
  338. package/lib/esm/components/slider-button/SliderButton.types.js.map +1 -0
  339. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js +56 -0
  340. package/lib/esm/components/slider-button/useSliderButtonPopupKeyboard.js.map +1 -0
  341. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js +38 -0
  342. package/lib/esm/components/slider-button/useSliderButtonThumbKeyboard.js.map +1 -0
  343. package/lib/esm/components/tag-input/TagInput.js +85 -35
  344. package/lib/esm/components/tag-input/TagInput.js.map +1 -1
  345. package/lib/esm/components/tag-input/TagInput.styles.js +29 -1
  346. package/lib/esm/components/tag-input/TagInput.styles.js.map +1 -1
  347. package/lib/esm/components/text-area/TextArea.js +18 -9
  348. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  349. package/lib/esm/components/text-area/TextArea.styles.js +14 -0
  350. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  351. package/lib/esm/components/truncation/Truncation.js +18 -4
  352. package/lib/esm/components/truncation/Truncation.js.map +1 -1
  353. package/lib/esm/components/truncation/Truncation.styles.js +18 -0
  354. package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
  355. package/lib/esm/hooks/useKeyboardFocusHighlighting.js +61 -0
  356. package/lib/esm/hooks/useKeyboardFocusHighlighting.js.map +1 -0
  357. package/lib/esm/utils/file.js.map +1 -1
  358. package/lib/esm/utils/keyboardFocusHighlighting.styles.js +25 -0
  359. package/lib/esm/utils/keyboardFocusHighlighting.styles.js.map +1 -0
  360. package/lib/types/components/accordion/Accordion.d.ts +5 -0
  361. package/lib/types/components/accordion/Accordion.styles.d.ts +8 -4
  362. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -2
  363. package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +7 -2
  364. package/lib/types/components/accordion/accordion-head/AccordionHead.d.ts +1 -0
  365. package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +18 -18
  366. package/lib/types/components/amount-control/AmountControl.d.ts +5 -0
  367. package/lib/types/components/amount-control/AmountControl.styles.d.ts +8 -4
  368. package/lib/types/components/button/Button.styles.d.ts +8 -6
  369. package/lib/types/components/button/Button.types.d.ts +8 -0
  370. package/lib/types/components/checkbox/Checkbox.d.ts +4 -0
  371. package/lib/types/components/checkbox/Checkbox.styles.d.ts +5 -1
  372. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +5 -0
  373. package/lib/types/components/combobox/ComboBox.styles.d.ts +4 -2
  374. package/lib/types/components/combobox/ComboBox.types.d.ts +5 -0
  375. package/lib/types/components/context-menu/ContextMenu.styles.d.ts +4 -2
  376. package/lib/types/components/context-menu/ContextMenu.types.d.ts +6 -0
  377. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +2 -2
  378. package/lib/types/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.styles.d.ts +2 -2
  379. package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +2 -2
  380. package/lib/types/components/file-input/FileInput.d.ts +4 -0
  381. package/lib/types/components/file-input/FileInput.styles.d.ts +2 -2
  382. package/lib/types/components/file-list/file-item/FileItem.styles.d.ts +3 -0
  383. package/lib/types/components/file-select/FileSelect.d.ts +4 -0
  384. package/lib/types/components/file-select/FileSelect.styles.d.ts +6 -4
  385. package/lib/types/components/filter/Filter.d.ts +1 -0
  386. package/lib/types/components/filter/Filter.styles.d.ts +6 -4
  387. package/lib/types/components/filter/filter-content/FilterContent.types.d.ts +4 -0
  388. package/lib/types/components/filter-buttons/FilterButtons.d.ts +4 -0
  389. package/lib/types/components/filter-buttons/filter-button/FilterButton.d.ts +5 -0
  390. package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +12 -8
  391. package/lib/types/components/grid-image/GridImage.d.ts +4 -0
  392. package/lib/types/components/grid-image/GridImage.styles.d.ts +4 -2
  393. package/lib/types/components/grouped-image/GroupedImage.d.ts +4 -0
  394. package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +8 -6
  395. package/lib/types/components/highlight-slider/HighlightSlider.d.ts +4 -0
  396. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.d.ts +3 -0
  397. package/lib/types/components/highlight-slider/highlight-slider-item/HighlightSliderItem.styles.d.ts +9 -5
  398. package/lib/types/components/icon/Icon.d.ts +4 -0
  399. package/lib/types/components/icon/Icon.styles.d.ts +1 -0
  400. package/lib/types/components/input/Input.d.ts +4 -0
  401. package/lib/types/components/input/Input.styles.d.ts +17 -9
  402. package/lib/types/components/list/List.d.ts +11 -0
  403. package/lib/types/components/list/List.utils.d.ts +16 -1
  404. package/lib/types/components/list/list-item/ListItem.styles.d.ts +64 -64
  405. package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +2 -2
  406. package/lib/types/components/list/list-item/list-item-head/ListItemHead.d.ts +1 -0
  407. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +195 -194
  408. package/lib/types/components/list/list-item/list-item-head/list-item-right-element/ListItemRightElement.d.ts +1 -0
  409. package/lib/types/components/list/list-item/list-item-head/list-item-subtitle/ListItemSubtitle.d.ts +1 -0
  410. package/lib/types/components/list/list-item/list-item-head/list-item-title/ListItemTitle.d.ts +1 -0
  411. package/lib/types/components/list/list-item/useListItemFocus.d.ts +13 -0
  412. package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +2 -2
  413. package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +4 -4
  414. package/lib/types/components/multi-action-button/MultiActionButton.styles.d.ts +2 -2
  415. package/lib/types/components/multi-action-button/MultiActionButton.types.d.ts +7 -0
  416. package/lib/types/components/multi-action-button/action-button/ActionButton.d.ts +4 -1
  417. package/lib/types/components/multi-action-button/action-button/ActionButton.styles.d.ts +4 -2
  418. package/lib/types/components/number-input/NumberInput.d.ts +4 -0
  419. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +2 -2
  420. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +6 -6
  421. package/lib/types/components/radio-button/RadioButton.d.ts +4 -0
  422. package/lib/types/components/radio-button/RadioButton.styles.d.ts +15 -9
  423. package/lib/types/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +5 -0
  424. package/lib/types/components/search-box/SearchBox.d.ts +4 -0
  425. package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -2
  426. package/lib/types/components/search-input/SearchInput.d.ts +4 -0
  427. package/lib/types/components/search-input/SearchInput.styles.d.ts +17 -9
  428. package/lib/types/components/select-button/SelectButton.d.ts +4 -0
  429. package/lib/types/components/setup-wizard/SetupWizard.d.ts +5 -0
  430. package/lib/types/components/sharing-bar/SharingBar.d.ts +4 -0
  431. package/lib/types/components/sharing-button/SharingButton.d.ts +1 -1
  432. package/lib/types/components/sharing-context-menu/SharingContextMenu.d.ts +10 -2
  433. package/lib/types/components/signature/Signature.d.ts +4 -0
  434. package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.styles.d.ts +4 -4
  435. package/lib/types/components/slider/Slider.d.ts +8 -0
  436. package/lib/types/components/slider/Slider.styles.d.ts +18 -14
  437. package/lib/types/components/slider-button/SliderButton.d.ts +1 -28
  438. package/lib/types/components/slider-button/SliderButton.styles.d.ts +6 -4
  439. package/lib/types/components/slider-button/SliderButton.types.d.ts +32 -0
  440. package/lib/types/components/slider-button/useSliderButtonPopupKeyboard.d.ts +17 -0
  441. package/lib/types/components/slider-button/useSliderButtonThumbKeyboard.d.ts +13 -0
  442. package/lib/types/components/tag-input/TagInput.d.ts +4 -0
  443. package/lib/types/components/tag-input/TagInput.styles.d.ts +12 -2
  444. package/lib/types/components/text-area/TextArea.d.ts +4 -0
  445. package/lib/types/components/text-area/TextArea.styles.d.ts +1 -0
  446. package/lib/types/components/truncation/Truncation.d.ts +4 -0
  447. package/lib/types/components/truncation/Truncation.styles.d.ts +7 -2
  448. package/lib/types/hooks/useKeyboardFocusHighlighting.d.ts +5 -0
  449. package/lib/types/utils/file.d.ts +1 -1
  450. package/lib/types/utils/keyboardFocusHighlighting.styles.d.ts +9 -0
  451. package/package.json +2 -2
@@ -1,3 +1,5 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ /* eslint-disable react/jsx-props-no-spreading */
1
3
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
4
  import { StyledFilterContentControlWrapper, StyledFilterContentLabel, StyledFilterContentLabeledRow, StyledFilterContent } from './FilterContent.styles';
3
5
  import Input from '../../input/Input';
@@ -14,7 +16,8 @@ const FilterContent = ({
14
16
  filterButtonConfig,
15
17
  checkboxConfig,
16
18
  comboboxConfig,
17
- shouldAutoFocus
19
+ shouldAutoFocus,
20
+ shouldEnableKeyboardHighlighting
18
21
  }) => {
19
22
  const searchRef = useRef(null);
20
23
  const ts = textStrings.components.filter.filterContent;
@@ -51,7 +54,9 @@ const FilterContent = ({
51
54
  leftElement: /*#__PURE__*/React.createElement(Icon, {
52
55
  icons: ['fa fa-search']
53
56
  })
54
- }), filterButtonConfig && /*#__PURE__*/React.createElement(FilterButtons, filterButtonConfig), sortConfig && /*#__PURE__*/React.createElement(StyledFilterContentLabeledRow, null, /*#__PURE__*/React.createElement(StyledFilterContentLabel, null, /*#__PURE__*/React.createElement(Textstring, {
57
+ }), filterButtonConfig && /*#__PURE__*/React.createElement(FilterButtons, _extends({}, filterButtonConfig, {
58
+ shouldEnableKeyboardHighlighting: filterButtonConfig.shouldEnableKeyboardHighlighting ?? shouldEnableKeyboardHighlighting
59
+ })), sortConfig && /*#__PURE__*/React.createElement(StyledFilterContentLabeledRow, null, /*#__PURE__*/React.createElement(StyledFilterContentLabel, null, /*#__PURE__*/React.createElement(Textstring, {
55
60
  textstring: ttsToITextString(ts.sort)
56
61
  })), /*#__PURE__*/React.createElement(StyledFilterContentControlWrapper, null, /*#__PURE__*/React.createElement(ComboBox, {
57
62
  lists: getSortComboBoxLists(sortConfig),
@@ -60,11 +65,16 @@ const FilterContent = ({
60
65
  text: sortConfig.selectedItem.text,
61
66
  value: sortConfig.selectedItem.id
62
67
  },
63
- onSelect: handleSelectSortItem
64
- }))), comboboxConfig && /*#__PURE__*/React.createElement(StyledFilterContentLabeledRow, null, /*#__PURE__*/React.createElement(StyledFilterContentLabel, null, comboboxConfig.label), /*#__PURE__*/React.createElement(StyledFilterContentControlWrapper, null, /*#__PURE__*/React.createElement(ComboBox, comboboxConfig))), checkboxConfig &&
68
+ onSelect: handleSelectSortItem,
69
+ shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlighting
70
+ }))), comboboxConfig && /*#__PURE__*/React.createElement(StyledFilterContentLabeledRow, null, /*#__PURE__*/React.createElement(StyledFilterContentLabel, null, comboboxConfig.label), /*#__PURE__*/React.createElement(StyledFilterContentControlWrapper, null, /*#__PURE__*/React.createElement(ComboBox, _extends({}, comboboxConfig, {
71
+ shouldEnableKeyboardHighlighting: comboboxConfig.shouldEnableKeyboardHighlighting ?? shouldEnableKeyboardHighlighting
72
+ })))), checkboxConfig &&
65
73
  /*#__PURE__*/
66
74
  // eslint-disable-next-line react/jsx-props-no-spreading
67
- React.createElement(Checkbox, checkboxConfig))), [checkboxConfig, comboboxConfig, filterButtonConfig, handleSelectSortItem, searchConfig, sortConfig, ts.input.placeholder, ts.sort]);
75
+ React.createElement(Checkbox, _extends({}, checkboxConfig, {
76
+ shouldEnableKeyboardHighlighting: checkboxConfig.shouldEnableKeyboardHighlighting ?? shouldEnableKeyboardHighlighting
77
+ })))), [checkboxConfig, comboboxConfig, filterButtonConfig, handleSelectSortItem, searchConfig, shouldEnableKeyboardHighlighting, sortConfig, ts.input.placeholder, ts.sort]);
68
78
  };
69
79
  FilterContent.displayName = 'FilterContent';
70
80
  export default FilterContent;
@@ -1 +1 @@
1
- {"version":3,"file":"FilterContent.js","names":["React","useCallback","useEffect","useMemo","useRef","StyledFilterContentControlWrapper","StyledFilterContentLabel","StyledFilterContentLabeledRow","StyledFilterContent","Input","Icon","FilterButtons","ComboBox","Checkbox","Textstring","TextstringProvider","ttsToITextString","textStrings","getSortComboBoxLists","FilterContent","searchConfig","sortConfig","filterButtonConfig","checkboxConfig","comboboxConfig","shouldAutoFocus","searchRef","ts","components","filter","filterContent","handleSelectSortItem","item","text","value","onSortChange","id","current","focus","createElement","libraryName","ref","onChange","ev","onSearchChange","target","placeholder","textstring","input","searchValue","shouldShowClearIcon","length","leftElement","icons","sort","lists","selectedItem","onSelect","label","displayName"],"sources":["../../../../../src/components/filter/filter-content/FilterContent.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useMemo, useRef } from 'react';\nimport {\n StyledFilterContentControlWrapper,\n StyledFilterContentLabel,\n StyledFilterContentLabeledRow,\n StyledFilterContent,\n} from './FilterContent.styles';\nimport Input, { InputRef } from '../../input/Input';\nimport Icon from '../../icon/Icon';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport ComboBox from '../../combobox/ComboBox';\nimport Checkbox from '../../checkbox/Checkbox';\nimport { Textstring, TextstringProvider, ttsToITextString } from '@chayns-components/textstring';\nimport textStrings from '../../../constants/textStrings';\nimport type { IComboBoxItem } from '../../combobox/ComboBox.types';\nimport type { FilterContentProps } from './FilterContent.types';\nimport { getSortComboBoxLists } from './FilterContent.utils';\n\nconst FilterContent: FC<FilterContentProps> = ({\n searchConfig,\n sortConfig,\n filterButtonConfig,\n checkboxConfig,\n comboboxConfig,\n shouldAutoFocus,\n}) => {\n const searchRef = useRef<InputRef>(null);\n\n const ts = textStrings.components.filter.filterContent;\n\n const handleSelectSortItem = useCallback(\n (item: IComboBoxItem | undefined) => {\n if (!item) {\n return;\n }\n\n const { text, value } = item;\n\n if (sortConfig) {\n sortConfig.onSortChange({ text, id: value });\n }\n },\n [sortConfig],\n );\n\n useEffect(() => {\n if (shouldAutoFocus) {\n searchRef.current?.focus();\n }\n }, [shouldAutoFocus]);\n\n return useMemo(\n () => (\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <StyledFilterContent>\n {searchConfig && (\n <Input\n ref={searchRef}\n onChange={(ev) => searchConfig.onSearchChange(ev.target.value)}\n placeholder={\n <Textstring textstring={ttsToITextString(ts.input.placeholder)} />\n }\n value={searchConfig.searchValue}\n shouldShowClearIcon={searchConfig.searchValue.length > 0}\n leftElement={<Icon icons={['fa fa-search']} />}\n />\n )}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n {filterButtonConfig && <FilterButtons {...filterButtonConfig} />}\n {sortConfig && (\n <StyledFilterContentLabeledRow>\n <StyledFilterContentLabel>\n <Textstring textstring={ttsToITextString(ts.sort)} />\n </StyledFilterContentLabel>\n <StyledFilterContentControlWrapper>\n <ComboBox\n lists={getSortComboBoxLists(sortConfig)}\n placeholder=\"\"\n selectedItem={{\n text: sortConfig.selectedItem.text,\n value: sortConfig.selectedItem.id,\n }}\n onSelect={handleSelectSortItem}\n />\n </StyledFilterContentControlWrapper>\n </StyledFilterContentLabeledRow>\n )}\n {comboboxConfig && (\n <StyledFilterContentLabeledRow>\n <StyledFilterContentLabel>\n {comboboxConfig.label}\n </StyledFilterContentLabel>\n <StyledFilterContentControlWrapper>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <ComboBox {...comboboxConfig} />\n </StyledFilterContentControlWrapper>\n </StyledFilterContentLabeledRow>\n )}\n {checkboxConfig && (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <Checkbox {...checkboxConfig} />\n )}\n </StyledFilterContent>\n </TextstringProvider>\n ),\n [\n checkboxConfig,\n comboboxConfig,\n filterButtonConfig,\n handleSelectSortItem,\n searchConfig,\n sortConfig,\n ts.input.placeholder,\n ts.sort,\n ],\n );\n};\n\nFilterContent.displayName = 'FilterContent';\n\nexport default FilterContent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC1E,SACIC,iCAAiC,EACjCC,wBAAwB,EACxBC,6BAA6B,EAC7BC,mBAAmB,QAChB,wBAAwB;AAC/B,OAAOC,KAAK,MAAoB,mBAAmB;AACnD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,aAAa,MAAM,oCAAoC;AAC9D,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,OAAOC,QAAQ,MAAM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EACAD,cAAc;EAAA;EACX;EACAvB,KAAA,CAAAuC,aAAA,CAAC1B,QAAQ,EAAKU,cAAiB,CAElB,CACL,CACvB,EACD,CACIA,cAAc,EACdC,cAAc,EACdF,kBAAkB,EAClBS,oBAAoB,EACpBX,YAAY,EACZC,UAAU,EACVM,EAAE,CAACqB,KAAK,CAACF,WAAW,EACpBnB,EAAE,CAAC2B,IAAI,CAEf,CAAC;AACL,CAAC;AAEDnC,aAAa,CAACwC,WAAW,GAAG,eAAe;AAE3C,eAAexC,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"FilterContent.js","names":["React","useCallback","useEffect","useMemo","useRef","StyledFilterContentControlWrapper","StyledFilterContentLabel","StyledFilterContentLabeledRow","StyledFilterContent","Input","Icon","FilterButtons","ComboBox","Checkbox","Textstring","TextstringProvider","ttsToITextString","textStrings","getSortComboBoxLists","FilterContent","searchConfig","sortConfig","filterButtonConfig","checkboxConfig","comboboxConfig","shouldAutoFocus","shouldEnableKeyboardHighlighting","searchRef","ts","components","filter","filterContent","handleSelectSortItem","item","text","value","onSortChange","id","current","focus","createElement","libraryName","ref","onChange","ev","onSearchChange","target","placeholder","textstring","input","searchValue","shouldShowClearIcon","length","leftElement","icons","_extends","sort","lists","selectedItem","onSelect","label","displayName"],"sources":["../../../../../src/components/filter/filter-content/FilterContent.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport React, { FC, useCallback, useEffect, useMemo, useRef } from 'react';\nimport {\n StyledFilterContentControlWrapper,\n StyledFilterContentLabel,\n StyledFilterContentLabeledRow,\n StyledFilterContent,\n} from './FilterContent.styles';\nimport Input, { InputRef } from '../../input/Input';\nimport Icon from '../../icon/Icon';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport ComboBox from '../../combobox/ComboBox';\nimport Checkbox from '../../checkbox/Checkbox';\nimport { Textstring, TextstringProvider, ttsToITextString } from '@chayns-components/textstring';\nimport textStrings from '../../../constants/textStrings';\nimport type { IComboBoxItem } from '../../combobox/ComboBox.types';\nimport type { FilterContentProps } from './FilterContent.types';\nimport { getSortComboBoxLists } from './FilterContent.utils';\n\nconst FilterContent: FC<FilterContentProps> = ({\n searchConfig,\n sortConfig,\n filterButtonConfig,\n checkboxConfig,\n comboboxConfig,\n shouldAutoFocus,\n shouldEnableKeyboardHighlighting,\n}) => {\n const searchRef = useRef<InputRef>(null);\n\n const ts = textStrings.components.filter.filterContent;\n\n const handleSelectSortItem = useCallback(\n (item: IComboBoxItem | undefined) => {\n if (!item) {\n return;\n }\n\n const { text, value } = item;\n\n if (sortConfig) {\n sortConfig.onSortChange({ text, id: value });\n }\n },\n [sortConfig],\n );\n\n useEffect(() => {\n if (shouldAutoFocus) {\n searchRef.current?.focus();\n }\n }, [shouldAutoFocus]);\n\n return useMemo(\n () => (\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <StyledFilterContent>\n {searchConfig && (\n <Input\n ref={searchRef}\n onChange={(ev) => searchConfig.onSearchChange(ev.target.value)}\n placeholder={\n <Textstring textstring={ttsToITextString(ts.input.placeholder)} />\n }\n value={searchConfig.searchValue}\n shouldShowClearIcon={searchConfig.searchValue.length > 0}\n leftElement={<Icon icons={['fa fa-search']} />}\n />\n )}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n {filterButtonConfig && (\n <FilterButtons\n {...filterButtonConfig}\n shouldEnableKeyboardHighlighting={\n filterButtonConfig.shouldEnableKeyboardHighlighting ??\n shouldEnableKeyboardHighlighting\n }\n />\n )}\n {sortConfig && (\n <StyledFilterContentLabeledRow>\n <StyledFilterContentLabel>\n <Textstring textstring={ttsToITextString(ts.sort)} />\n </StyledFilterContentLabel>\n <StyledFilterContentControlWrapper>\n <ComboBox\n lists={getSortComboBoxLists(sortConfig)}\n placeholder=\"\"\n selectedItem={{\n text: sortConfig.selectedItem.text,\n value: sortConfig.selectedItem.id,\n }}\n onSelect={handleSelectSortItem}\n shouldEnableKeyboardHighlighting={\n shouldEnableKeyboardHighlighting\n }\n />\n </StyledFilterContentControlWrapper>\n </StyledFilterContentLabeledRow>\n )}\n {comboboxConfig && (\n <StyledFilterContentLabeledRow>\n <StyledFilterContentLabel>\n {comboboxConfig.label}\n </StyledFilterContentLabel>\n <StyledFilterContentControlWrapper>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <ComboBox\n {...comboboxConfig}\n shouldEnableKeyboardHighlighting={\n comboboxConfig.shouldEnableKeyboardHighlighting ??\n shouldEnableKeyboardHighlighting\n }\n />\n </StyledFilterContentControlWrapper>\n </StyledFilterContentLabeledRow>\n )}\n {checkboxConfig && (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <Checkbox\n {...checkboxConfig}\n shouldEnableKeyboardHighlighting={\n checkboxConfig.shouldEnableKeyboardHighlighting ??\n shouldEnableKeyboardHighlighting\n }\n />\n )}\n </StyledFilterContent>\n </TextstringProvider>\n ),\n [\n checkboxConfig,\n comboboxConfig,\n filterButtonConfig,\n handleSelectSortItem,\n searchConfig,\n shouldEnableKeyboardHighlighting,\n sortConfig,\n ts.input.placeholder,\n ts.sort,\n ],\n );\n};\n\nFilterContent.displayName = 'FilterContent';\n\nexport default FilterContent;\n"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC1E,SACIC,iCAAiC,EACjCC,wBAAwB,EACxBC,6BAA6B,EAC7BC,mBAAmB,QAChB,wBAAwB;AAC/B,OAAOC,KAAK,MAAoB,mBAAmB;AACnD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,aAAa,MAAM,oCAAoC;AAC9D,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,+BAA+B;AAChG,OAAOC,WAAW,MAAM,gCAAgC;AAGxD,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,MAAMC,aAAq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AC/CA;EACH,EACJ,CAC8B,CACR,CAClC,EACAH,cAAc;EAAA;EACX;EACAvB,KAAA,CAAAwC,aAAA,CAAC3B,QAAQ,EAAA0C,QAAA,KACDhC,cAAc;IAClBG,gCAAgC,EAC5BH,cAAc,CAACG,gCAAgC,IAC/CA;EACH,EACJ,CAEY,CACL,CACvB,EACD,CACIH,cAAc,EACdC,cAAc,EACdF,kBAAkB,EAClBU,oBAAoB,EACpBZ,YAAY,EACZM,gCAAgC,EAChCL,UAAU,EACVO,EAAE,CAACqB,KAAK,CAACF,WAAW,EACpBnB,EAAE,CAAC4B,IAAI,CAEf,CAAC;AACL,CAAC;AAEDrC,aAAa,CAAC0C,WAAW,GAAG,eAAe;AAE3C,eAAe1C,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterContent.types.js","names":[],"sources":["../../../../../src/components/filter/filter-content/FilterContent.types.ts"],"sourcesContent":["import type {\n CheckboxConfig,\n ComboboxConfig,\n FilterButtonConfig,\n SearchConfig,\n SortConfig,\n} from '../../../types/filter';\n\n/**\n * Props for the `FilterContent` component.\n */\nexport type FilterContentProps = {\n /**\n * Search configuration for the optional search input.\n */\n searchConfig?: SearchConfig;\n /**\n * Configuration for the optional filter button group.\n */\n filterButtonConfig?: FilterButtonConfig;\n /**\n * Configuration for the optional sort combobox.\n */\n sortConfig?: SortConfig;\n /**\n * Configuration for the optional checkbox.\n */\n checkboxConfig?: CheckboxConfig;\n /**\n * Configuration for the optional labeled combobox.\n */\n comboboxConfig?: ComboboxConfig;\n /**\n * Whether the search input should receive focus when the filter opens.\n */\n shouldAutoFocus: boolean;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"FilterContent.types.js","names":[],"sources":["../../../../../src/components/filter/filter-content/FilterContent.types.ts"],"sourcesContent":["import type {\n CheckboxConfig,\n ComboboxConfig,\n FilterButtonConfig,\n SearchConfig,\n SortConfig,\n} from '../../../types/filter';\n\n/**\n * Props for the `FilterContent` component.\n */\nexport type FilterContentProps = {\n /**\n * Search configuration for the optional search input.\n */\n searchConfig?: SearchConfig;\n /**\n * Configuration for the optional filter button group.\n */\n filterButtonConfig?: FilterButtonConfig;\n /**\n * Configuration for the optional sort combobox.\n */\n sortConfig?: SortConfig;\n /**\n * Configuration for the optional checkbox.\n */\n checkboxConfig?: CheckboxConfig;\n /**\n * Configuration for the optional labeled combobox.\n */\n comboboxConfig?: ComboboxConfig;\n /**\n * Whether the search input should receive focus when the filter opens.\n */\n shouldAutoFocus: boolean;\n /**\n * Enables keyboard-only focus highlighting for controls that support it.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
1
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { FilterButtonItemShape, FilterButtonSize } from '../../types/filterButtons';
3
3
  import FilterButton from './filter-button/FilterButton';
4
4
  import { StyledFilterButton } from './FilterButtons.styles';
@@ -10,9 +10,22 @@ const FilterButtons = ({
10
10
  onSelect,
11
11
  items,
12
12
  shouldCalcCountForAll = false,
13
- size = FilterButtonSize.Normal
13
+ size = FilterButtonSize.Normal,
14
+ shouldEnableKeyboardHighlighting
14
15
  }) => {
15
16
  const [selectedIds, setSelectedIds] = useState(['all']);
17
+ const [focusedId, setFocusedId] = useState('all');
18
+ const buttonRefs = useRef({});
19
+ const keyboardNavigationItems = useMemo(() => [{
20
+ id: 'all',
21
+ isDisabled: false
22
+ }, ...items.map(({
23
+ id,
24
+ isDisabled
25
+ }) => ({
26
+ id,
27
+ isDisabled: Boolean(isDisabled)
28
+ }))], [items]);
16
29
 
17
30
  /**
18
31
  * This function set the selectedItemKey
@@ -41,6 +54,43 @@ const FilterButtons = ({
41
54
  onSelect(newIds.filter(selectedId => selectedId !== 'all'));
42
55
  }
43
56
  }, [onSelect, selectedIds]);
57
+ useEffect(() => {
58
+ const currentFocusedItem = keyboardNavigationItems.find(({
59
+ id
60
+ }) => id === focusedId);
61
+ if (currentFocusedItem && !currentFocusedItem.isDisabled) {
62
+ return;
63
+ }
64
+ const nextFocusable = keyboardNavigationItems.find(({
65
+ isDisabled
66
+ }) => !isDisabled);
67
+ if (nextFocusable) {
68
+ setFocusedId(nextFocusable.id);
69
+ }
70
+ }, [focusedId, keyboardNavigationItems]);
71
+ const handleArrowNavigate = useCallback((currentId, direction) => {
72
+ if (!shouldEnableKeyboardHighlighting || keyboardNavigationItems.length < 2) {
73
+ return;
74
+ }
75
+ const startIndex = keyboardNavigationItems.findIndex(({
76
+ id
77
+ }) => id === currentId);
78
+ if (startIndex < 0) {
79
+ return;
80
+ }
81
+ let attempts = 0;
82
+ let nextIndex = startIndex;
83
+ while (attempts < keyboardNavigationItems.length) {
84
+ nextIndex = (nextIndex + direction + keyboardNavigationItems.length) % keyboardNavigationItems.length;
85
+ const nextItem = keyboardNavigationItems[nextIndex];
86
+ if (nextItem && !nextItem.isDisabled) {
87
+ setFocusedId(nextItem.id);
88
+ buttonRefs.current[nextItem.id]?.focus();
89
+ return;
90
+ }
91
+ attempts += 1;
92
+ }
93
+ }, [keyboardNavigationItems, shouldEnableKeyboardHighlighting]);
44
94
  const reactItems = useMemo(() => {
45
95
  if (items.length === 0) {
46
96
  return null;
@@ -55,7 +105,14 @@ const FilterButtons = ({
55
105
  count: allButtonCount,
56
106
  isSelected: selectedIds.includes('all') || Array.isArray(selectedIds) && selectedIds.length === 0,
57
107
  size: size,
58
- onSelect: handleSelect
108
+ onSelect: handleSelect,
109
+ shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlighting,
110
+ onArrowNavigate: handleArrowNavigate,
111
+ onFocus: setFocusedId,
112
+ tabIndex: 0,
113
+ buttonRef: element => {
114
+ buttonRefs.current.all = element;
115
+ }
59
116
  }))];
60
117
  items.forEach(({
61
118
  icons,
@@ -76,11 +133,18 @@ const FilterButtons = ({
76
133
  shape: FilterButtonItemShape.Round,
77
134
  size: size,
78
135
  text: text,
79
- isDisabled: isDisabled
136
+ isDisabled: isDisabled,
137
+ shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlighting,
138
+ onArrowNavigate: handleArrowNavigate,
139
+ onFocus: setFocusedId,
140
+ tabIndex: isDisabled ? -1 : 0,
141
+ buttonRef: element => {
142
+ buttonRefs.current[id] = element;
143
+ }
80
144
  }));
81
145
  });
82
146
  return array;
83
- }, [allCount, handleSelect, items, selectedIds, shouldCalcCountForAll, size]);
147
+ }, [allCount, handleSelect, items, selectedIds, shouldCalcCountForAll, shouldEnableKeyboardHighlighting, handleArrowNavigate, size]);
84
148
  return useMemo(() => /*#__PURE__*/React.createElement(StyledFilterButton, null, reactItems), [reactItems]);
85
149
  };
86
150
  FilterButtons.displayName = 'FilterButtons';
@@ -1 +1 @@
1
- {"version":3,"file":"FilterButtons.js","names":["React","useCallback","useEffect","useMemo","useState","FilterButtonItemShape","FilterButtonSize","FilterButton","StyledFilterButton","AllButton","TextstringProvider","FilterButtons","allCount","selectedItemIds","onSelect","items","shouldCalcCountForAll","size","Normal","selectedIds","setSelectedIds","handleSelect","id","newIds","includes","filter","filteredId","length","selectedId","reactItems","allButtonCount","reduce","acc","item","count","array","createElement","libraryName","isSelected","Array","isArray","forEach","icons","text","color","isDisabled","push","key","shape","Round","displayName"],"sources":["../../../../src/components/filter-buttons/FilterButtons.tsx"],"sourcesContent":["import React, { FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem,\n} from '../../types/filterButtons';\nimport FilterButton from './filter-button/FilterButton';\nimport { StyledFilterButton } from './FilterButtons.styles';\nimport { AllButton } from './all-button/AllButton';\nimport { TextstringProvider } from '@chayns-components/textstring';\n\nexport type FilterButtonsProps = {\n /**\n * The number that should be displayed as count in the \"all\" button.\n */\n allCount?: number;\n /**\n * The items that should be displayed.\n */\n items: IFilterButtonItem[];\n /**\n * A function that should be executed when an item is selected.\n */\n onSelect?: (keys: string[]) => void;\n /**\n * The keys of items that should be selected.\n */\n selectedItemIds?: string[];\n /**\n * If true, the count of all items will be shown in the \"all\" button.\n */\n shouldCalcCountForAll?: boolean;\n /**\n * The size auf the filter buttons. Use the FilterButtonSize enum.\n */\n size?: FilterButtonSize;\n};\n\nconst FilterButtons: FC<FilterButtonsProps> = ({\n allCount,\n selectedItemIds,\n onSelect,\n items,\n shouldCalcCountForAll = false,\n size = FilterButtonSize.Normal,\n}) => {\n const [selectedIds, setSelectedIds] = useState<string[]>(['all']);\n\n /**\n * This function set the selectedItemKey\n */\n useEffect(() => {\n if (selectedItemIds) {\n setSelectedIds(selectedItemIds);\n }\n }, [selectedItemIds]);\n\n /**\n * Function to update the selected items\n */\n const handleSelect = useCallback(\n (id: string) => {\n let newIds: string[];\n\n if (id === 'all') {\n newIds = selectedIds.includes('all') ? ['all'] : [];\n } else {\n newIds = selectedIds.includes(id)\n ? selectedIds.filter((filteredId) => filteredId !== id)\n : [...selectedIds.filter((filteredId) => filteredId !== 'all'), id];\n }\n\n if (newIds.length === 0) {\n newIds = ['all'];\n }\n\n setSelectedIds(newIds);\n\n if (typeof onSelect === 'function') {\n onSelect(newIds.filter((selectedId) => selectedId !== 'all'));\n }\n },\n [onSelect, selectedIds],\n );\n\n const reactItems = useMemo(() => {\n if (items.length === 0) {\n return null;\n }\n\n let allButtonCount = allCount;\n\n if (typeof allButtonCount !== 'number' && shouldCalcCountForAll) {\n allButtonCount = items.reduce((acc, item) => acc + (item.count || 0), 0);\n }\n\n const array: ReactElement[] = [\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <AllButton\n count={allButtonCount}\n isSelected={\n selectedIds.includes('all') ||\n (Array.isArray(selectedIds) && selectedIds.length === 0)\n }\n size={size}\n onSelect={handleSelect}\n />\n </TextstringProvider>,\n ];\n\n items.forEach(({ icons, text, color, count, id, isDisabled }) => {\n array.push(\n <FilterButton\n color={color}\n icons={icons}\n id={id}\n key={id}\n count={count}\n onSelect={handleSelect}\n isSelected={selectedIds.includes(id)}\n shape={FilterButtonItemShape.Round}\n size={size}\n text={text}\n isDisabled={isDisabled}\n />,\n );\n });\n\n return array;\n }, [allCount, handleSelect, items, selectedIds, shouldCalcCountForAll, size]);\n\n return useMemo(() => <StyledFilterButton>{reactItems}</StyledFilterButton>, [reactItems]);\n};\n\nFilterButtons.displayName = 'FilterButtons';\n\nexport default FilterButtons;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAsBC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC1F,SACIC,qBAAqB,EACrBC,gBAAgB,QAEb,2BAA2B;AAClC,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,kBAAkB,QAAQ,+BAA+B;AA6BlE,MAAMC,aAAqC,GAAGA,CAAC;EAC3CC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,KAAK;EACLC,qBAAqB,GAAG,KAAK;EAC7BC,IAAI,GAAGX,gBAAgB,CAACY;AAC5B,CAAC,KAAK;EACF,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGhB,QAAQ,CAAW,CAAC,KAAK,CAAC,CAAC;;EAEjE;AACJ;AACA;EACIF,SAAS,CAAC,MAAM;IACZ,IAAIW,eAAe,EAAE;MACjBO,cAAc,CAACP,eAAe,CAAC;IACnC;EACJ,CAAC,EAAE,CAACA,eAAe,CAAC,CAAC;;EAErB;AACJ;AACA;EACI,MAAMQ,YAAY,GAAGpB,WAAW,CAC3BqB,EAAU,IAAK;IACZ,IAAIC,MAAgB;IAEpB,IAAID,EAAE,KAAK,KAAK,EAAE;MACdC,MAAM,GAAGJ,WAAW,CAACK,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;IACvD,CAAC,MAAM;MACHD,MAAM,GAAGJ,WAAW,CAACK,QAAQ,CAACF,EAAE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AQ,EAAEO;IAAa,CAC1B,CACe,CAAC,CACxB;IAEDN,KAAK,CAAC0B,OAAO,CAAC,CAAC;MAAEC,KAAK;MAAEC,IAAI;MAAEC,KAAK;MAAEV,KAAK;MAAEZ,EAAE;MAAEuB;IAAW,CAAC,KAAK;MAC7DV,KAAK,CAACW,IAAI,cACN9C,KAAA,CAAAoC,aAAA,CAAC7B,YAAY;QACTqC,KAAK,EAAEA,KAAM;QACbF,KAAK,EAAEA,KAAM;QACbpB,EAAE,EAAEA,EAAG;QACPyB,GAAG,EAAEzB,EAAG;QACRY,KAAK,EAAEA,KAAM;QACbpB,QAAQ,EAAEO,YAAa;QACvBiB,UAAU,EAAEnB,WAAW,CAACK,QAAQ,CAACF,EAAE,CAAE;QACrC0B,KAAK,EAAE3C,qBAAqB,CAAC4C,KAAM;QACnChC,IAAI,EAAEA,IAAK;QACX0B,IAAI,EAAEA,IAAK;QACXE,UAAU,EAAEA;MAAW,CAC1B,CACL,CAAC;IACL,CAAC,CAAC;IAEF,OAAOV,KAAK;EAChB,CAAC,EAAE,CAACvB,QAAQ,EAAES,YAAY,EAAEN,KAAK,EAAEI,WAAW,EAAEH,qBAAqB,EAAEC,IAAI,CAAC,CAAC;EAE7E,OAAOd,OAAO,CAAC,mBAAMH,KAAA,CAAAoC,aAAA,CAAC5B,kBAAkB,QAAEqB,UAA+B,CAAC,EAAE,CAACA,UAAU,CAAC,CAAC;AAC7F,CAAC;AAEDlB,aAAa,CAACuC,WAAW,GAAG,eAAe;AAE3C,eAAevC,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"FilterButtons.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","FilterButtonItemShape","FilterButtonSize","FilterButton","StyledFilterButton","AllButton","TextstringProvider","FilterButtons","allCount","selectedItemIds","onSelect","items","shouldCalcCountForAll","size","Normal","shouldEnableKeyboardHighlighting","selectedIds","setSelectedIds","focusedId","setFocusedId","buttonRefs","keyboardNavigationItems","id","isDisabled","map","Boolean","handleSelect","newIds","includes","filter","filteredId","length","selectedId","currentFocusedItem","find","nextFocusable","handleArrowNavigate","currentId","direction","startIndex","findIndex","attempts","nextIndex","nextItem","current","focus","reactItems","allButtonCount","reduce","acc","item","count","array","createElement","libraryName","isSelected","Array","isArray","onArrowNavigate","onFocus","tabIndex","buttonRef","element","all","forEach","icons","text","color","push","key","shape","Round","displayName"],"sources":["../../../../src/components/filter-buttons/FilterButtons.tsx"],"sourcesContent":["import React, { FC, ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem,\n} from '../../types/filterButtons';\nimport FilterButton from './filter-button/FilterButton';\nimport { StyledFilterButton } from './FilterButtons.styles';\nimport { AllButton } from './all-button/AllButton';\nimport { TextstringProvider } from '@chayns-components/textstring';\n\nexport type FilterButtonsProps = {\n /**\n * The number that should be displayed as count in the \"all\" button.\n */\n allCount?: number;\n /**\n * The items that should be displayed.\n */\n items: IFilterButtonItem[];\n /**\n * A function that should be executed when an item is selected.\n */\n onSelect?: (keys: string[]) => void;\n /**\n * The keys of items that should be selected.\n */\n selectedItemIds?: string[];\n /**\n * If true, the count of all items will be shown in the \"all\" button.\n */\n shouldCalcCountForAll?: boolean;\n /**\n * The size auf the filter buttons. Use the FilterButtonSize enum.\n */\n size?: FilterButtonSize;\n /**\n * Enables keyboard-only focus highlighting for filter buttons.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst FilterButtons: FC<FilterButtonsProps> = ({\n allCount,\n selectedItemIds,\n onSelect,\n items,\n shouldCalcCountForAll = false,\n size = FilterButtonSize.Normal,\n shouldEnableKeyboardHighlighting,\n}) => {\n const [selectedIds, setSelectedIds] = useState<string[]>(['all']);\n const [focusedId, setFocusedId] = useState<string>('all');\n const buttonRefs = useRef<Record<string, HTMLDivElement | null>>({});\n\n const keyboardNavigationItems = useMemo(\n () => [\n { id: 'all', isDisabled: false },\n ...items.map(({ id, isDisabled }) => ({ id, isDisabled: Boolean(isDisabled) })),\n ],\n [items],\n );\n\n /**\n * This function set the selectedItemKey\n */\n useEffect(() => {\n if (selectedItemIds) {\n setSelectedIds(selectedItemIds);\n }\n }, [selectedItemIds]);\n\n /**\n * Function to update the selected items\n */\n const handleSelect = useCallback(\n (id: string) => {\n let newIds: string[];\n\n if (id === 'all') {\n newIds = selectedIds.includes('all') ? ['all'] : [];\n } else {\n newIds = selectedIds.includes(id)\n ? selectedIds.filter((filteredId) => filteredId !== id)\n : [...selectedIds.filter((filteredId) => filteredId !== 'all'), id];\n }\n\n if (newIds.length === 0) {\n newIds = ['all'];\n }\n\n setSelectedIds(newIds);\n\n if (typeof onSelect === 'function') {\n onSelect(newIds.filter((selectedId) => selectedId !== 'all'));\n }\n },\n [onSelect, selectedIds],\n );\n\n useEffect(() => {\n const currentFocusedItem = keyboardNavigationItems.find(({ id }) => id === focusedId);\n\n if (currentFocusedItem && !currentFocusedItem.isDisabled) {\n return;\n }\n\n const nextFocusable = keyboardNavigationItems.find(({ isDisabled }) => !isDisabled);\n\n if (nextFocusable) {\n setFocusedId(nextFocusable.id);\n }\n }, [focusedId, keyboardNavigationItems]);\n\n const handleArrowNavigate = useCallback(\n (currentId: string, direction: -1 | 1) => {\n if (!shouldEnableKeyboardHighlighting || keyboardNavigationItems.length < 2) {\n return;\n }\n\n const startIndex = keyboardNavigationItems.findIndex(({ id }) => id === currentId);\n\n if (startIndex < 0) {\n return;\n }\n\n let attempts = 0;\n let nextIndex = startIndex;\n\n while (attempts < keyboardNavigationItems.length) {\n nextIndex =\n (nextIndex + direction + keyboardNavigationItems.length) %\n keyboardNavigationItems.length;\n\n const nextItem = keyboardNavigationItems[nextIndex];\n\n if (nextItem && !nextItem.isDisabled) {\n setFocusedId(nextItem.id);\n buttonRefs.current[nextItem.id]?.focus();\n return;\n }\n\n attempts += 1;\n }\n },\n [keyboardNavigationItems, shouldEnableKeyboardHighlighting],\n );\n\n const reactItems = useMemo(() => {\n if (items.length === 0) {\n return null;\n }\n\n let allButtonCount = allCount;\n\n if (typeof allButtonCount !== 'number' && shouldCalcCountForAll) {\n allButtonCount = items.reduce((acc, item) => acc + (item.count || 0), 0);\n }\n\n const array: ReactElement[] = [\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <AllButton\n count={allButtonCount}\n isSelected={\n selectedIds.includes('all') ||\n (Array.isArray(selectedIds) && selectedIds.length === 0)\n }\n size={size}\n onSelect={handleSelect}\n shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlighting}\n onArrowNavigate={handleArrowNavigate}\n onFocus={setFocusedId}\n tabIndex={0}\n buttonRef={(element) => {\n buttonRefs.current.all = element;\n }}\n />\n </TextstringProvider>,\n ];\n\n items.forEach(({ icons, text, color, count, id, isDisabled }) => {\n array.push(\n <FilterButton\n color={color}\n icons={icons}\n id={id}\n key={id}\n count={count}\n onSelect={handleSelect}\n isSelected={selectedIds.includes(id)}\n shape={FilterButtonItemShape.Round}\n size={size}\n text={text}\n isDisabled={isDisabled}\n shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlighting}\n onArrowNavigate={handleArrowNavigate}\n onFocus={setFocusedId}\n tabIndex={isDisabled ? -1 : 0}\n buttonRef={(element) => {\n buttonRefs.current[id] = element;\n }}\n />,\n );\n });\n\n return array;\n }, [\n allCount,\n handleSelect,\n items,\n selectedIds,\n shouldCalcCountForAll,\n shouldEnableKeyboardHighlighting,\n handleArrowNavigate,\n size,\n ]);\n\n return useMemo(() => <StyledFilterButton>{reactItems}</StyledFilterButton>, [reactItems]);\n};\n\nFilterButtons.displayName = 'FilterButtons';\n\nexport default FilterButtons;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAsBC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAClG,SACIC,qBAAqB,EACrBC,gBAAgB,QAEb,2BAA2B;AAClC,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,S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ChB,CAAC,EAAE,CACC5C,QAAQ,EACRkB,YAAY,EACZf,KAAK,EACLK,WAAW,EACXJ,qBAAqB,EACrBG,gCAAgC,EAChCqB,mBAAmB,EACnBvB,IAAI,CACP,CAAC;EAEF,OAAOf,OAAO,CAAC,mBAAMH,KAAA,CAAA0D,aAAA,CAACjD,kBAAkB,QAAE0C,UAA+B,CAAC,EAAE,CAACA,UAAU,CAAC,CAAC;AAC7F,CAAC;AAEDvC,aAAa,CAACiE,WAAW,GAAG,eAAe;AAE3C,eAAejE,aAAa","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  import React, { useCallback, useMemo } from 'react';
2
+ import { useKeyboardFocusHighlighting } from '../../../hooks/useKeyboardFocusHighlighting';
2
3
  import Icon from '../../icon/Icon';
3
4
  import { StyledFilterButtonItem, StyledFilterButtonItemBorder, StyledFilterButtonItemLabel, StyledFilterButtonItemLabelCount, StyledFilterButtonItemLabelText, StyledMotionFilterButtonItemBackground } from './FilterButton.styles';
4
5
  const FilterButton = ({
@@ -11,8 +12,14 @@ const FilterButton = ({
11
12
  isSelected,
12
13
  id,
13
14
  isDisabled,
15
+ shouldEnableKeyboardHighlighting,
16
+ tabIndex,
17
+ onFocus,
18
+ onArrowNavigate,
19
+ buttonRef,
14
20
  onSelect
15
21
  }) => {
22
+ const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlighting && !isDisabled);
16
23
  const handleClick = useCallback(event => {
17
24
  if (isDisabled) {
18
25
  return;
@@ -21,11 +28,42 @@ const FilterButton = ({
21
28
  event.stopPropagation();
22
29
  onSelect(id);
23
30
  }, [id, isDisabled, onSelect]);
31
+ const handleKeyDown = useCallback(event => {
32
+ if (isDisabled) {
33
+ return;
34
+ }
35
+ if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {
36
+ event.preventDefault();
37
+ onArrowNavigate?.(id, 1);
38
+ return;
39
+ }
40
+ if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {
41
+ event.preventDefault();
42
+ onArrowNavigate?.(id, -1);
43
+ return;
44
+ }
45
+ if (event.key === 'Enter' || event.key === ' ') {
46
+ event.preventDefault();
47
+ onSelect(id);
48
+ }
49
+ }, [id, isDisabled, onArrowNavigate, onSelect]);
50
+ const handleFocus = useCallback(() => {
51
+ onFocus?.(id);
52
+ }, [id, onFocus]);
24
53
  return useMemo(() => /*#__PURE__*/React.createElement(StyledFilterButtonItem, {
54
+ ref: buttonRef,
55
+ $shape: shape,
25
56
  $isSelected: isSelected,
26
57
  $isDisabled: isDisabled,
58
+ $shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
27
59
  $size: size,
28
- onClick: handleClick
60
+ onClick: handleClick,
61
+ onKeyDown: handleKeyDown,
62
+ onFocus: handleFocus,
63
+ role: shouldEnableKeyboardHighlighting ? 'button' : undefined,
64
+ tabIndex: !isDisabled ? tabIndex ?? 0 : -1,
65
+ "aria-pressed": shouldEnableKeyboardHighlighting ? isSelected : undefined,
66
+ "aria-disabled": shouldEnableKeyboardHighlighting ? isDisabled : undefined
29
67
  }, /*#__PURE__*/React.createElement(StyledFilterButtonItemLabel, null, icons && /*#__PURE__*/React.createElement(Icon, {
30
68
  icons: icons,
31
69
  size: 15
@@ -37,7 +75,7 @@ const FilterButton = ({
37
75
  $isSelected: isSelected,
38
76
  $shape: shape,
39
77
  $color: color
40
- })), [color, count, handleClick, icons, isDisabled, isSelected, shape, size, text]);
78
+ })), [color, buttonRef, count, handleClick, handleFocus, handleKeyDown, icons, isDisabled, isSelected, shape, shouldEnableKeyboardHighlighting, shouldShowKeyboardHighlighting, size, tabIndex, text]);
41
79
  };
42
80
  FilterButton.displayName = 'FilterButton';
43
81
  export default FilterButton;
@@ -1 +1 @@
1
- {"version":3,"file":"FilterButton.js","names":["React","useCallback","useMemo","Icon","StyledFilterButtonItem","StyledFilterButtonItemBorder","StyledFilterButtonItemLabel","StyledFilterButtonItemLabelCount","StyledFilterButtonItemLabelText","StyledMotionFilterButtonItemBackground","FilterButton","icons","size","shape","text","color","count","isSelected","id","isDisabled","onSelect","handleClick","event","preventDefault","stopPropagation","createElement","$isSelected","$isDisabled","$size","onClick","toLocaleString","$shape","$color","displayName"],"sources":["../../../../../src/components/filter-buttons/filter-button/FilterButton.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEvent, useCallback, useMemo } from 'react';\nimport type { FilterButtonItemShape, FilterButtonSize } from '../../../types/filterButtons';\nimport Icon from '../../icon/Icon';\nimport {\n StyledFilterButtonItem,\n StyledFilterButtonItemBorder,\n StyledFilterButtonItemLabel,\n StyledFilterButtonItemLabelCount,\n StyledFilterButtonItemLabelText,\n StyledMotionFilterButtonItemBackground,\n} from './FilterButton.styles';\n\nexport type FilterButtonProps = {\n color?: CSSProperties['color'];\n icons?: string[];\n isSelected: boolean;\n shape: FilterButtonItemShape;\n size: FilterButtonSize;\n count?: number;\n text: string;\n id: string;\n isDisabled?: boolean;\n onSelect: (key: string) => void;\n};\n\nconst FilterButton: FC<FilterButtonProps> = ({\n icons,\n size,\n shape,\n text,\n color,\n count,\n isSelected,\n id,\n isDisabled,\n onSelect,\n}) => {\n const handleClick = useCallback(\n (event: MouseEvent) => {\n if (isDisabled) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n onSelect(id);\n },\n [id, isDisabled, onSelect],\n );\n\n return useMemo(\n () => (\n <StyledFilterButtonItem\n $isSelected={isSelected}\n $isDisabled={isDisabled}\n $size={size}\n onClick={handleClick}\n >\n <StyledFilterButtonItemLabel>\n {icons && <Icon icons={icons} size={15} />}\n <StyledFilterButtonItemLabelText>{text}</StyledFilterButtonItemLabelText>\n {typeof count === 'number' && (\n <StyledFilterButtonItemLabelCount>\n {count.toLocaleString()}\n </StyledFilterButtonItemLabelCount>\n )}\n </StyledFilterButtonItemLabel>\n <StyledFilterButtonItemBorder\n $isSelected={isSelected}\n $shape={shape}\n $color={color}\n />\n <StyledMotionFilterButtonItemBackground\n $isSelected={isSelected}\n $shape={shape}\n $color={color}\n />\n </StyledFilterButtonItem>\n ),\n [color, count, handleClick, icons, isDisabled, isSelected, shape, size, text],\n );\n};\n\nFilterButton.displayName = 'FilterButton';\n\nexport default FilterButton;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAmCC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAElF,OAAOC,IAAI,MAAM,iBAAiB;AAClC,SACIC,sBAAsB,EACtBC,4BAA4B,EAC5BC,2BAA2B,EAC3BC,gCAAgC,EAChCC,+BAA+B,EAC/BC,sCAAsC,QACnC,uBAAuB;AAe9B,MAAMC,YAAmC,GAAGA,CAAC;EACzCC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,EAAE;EACFC,UAAU;EACVC;AACJ,CAAC,KAAK;EACF,MAAMC,WAAW,GAAGpB,WAAW,CAC1BqB,KAAiB,IAAK;IACnB,IAAIH,UAAU,EAAE;MACZ;IACJ;IAEAG,KAAK,CAACC,cAAc,CAAC,CAAC;IACtBD,KAAK,CAACE,eAAe,CAAC,CAAC;IAEvBJ,QAAQ,CAACF,EAAE,CAAC;EAChB,CAAC,EACD,CAACA,EAAE,EAAEC,UAAU,EAAEC,QAAQ,CAC7B,CAAC;EAED,OAAOlB,OAAO,CACV,mBACIF,KAAA,CAAAyB,aAAA,CAACrB,sBAAsB;IACnBsB,WAAW,EAAET,UAAW;IACxBU,WAAW,EAAER,UAAW;IACxBS,KAAK,EAAEhB,IAAK;IACZiB,OAAO,EAAER;EAAY,gBAErBrB,KAAA,CAAAyB,aAAA,CAACnB,2BAA2B,QACvBK,KAAK,iBAAIX,KAAA,CAAAyB,aAAA,CAACtB,IAAI;IAACQ,KAAK,EAAEA,KAAM;IAACC,IAAI,EAAE;EAAG,CAAE,CAAC,eAC1CZ,KAAA,CAAAyB,aAAA,CAACjB,+BAA+B,QAAEM,IAAsC,CAAC,EACxE,OAAOE,KAAK,KAAK,QAAQ,iBACtBhB,KAAA,CAAAyB,aAAA,CAAClB,gCAAgC,QAC5BS,KAAK,CAACc,cAAc,CAAC,CACQ,CAEb,CAAC,eAC9B9B,KAAA,CAAAyB,aAAA,CAACpB,4BAA4B;IACzBqB,WAAW,EAAET,UAAW;IACxBc,MAAM,EAAElB,KAAM;IACdmB,MAAM,EAAEjB;EAAM,CACjB,CAAC,eACFf,KAAA,CAAAyB,aAAA,CAAChB,sCAAsC;IACnCiB,WAAW,EAAET,UAAW;IACxBc,MAAM,EAAElB,KAAM;IACdmB,MAAM,EAAEjB;EAAM,CACjB,CACmB,CAC3B,EACD,CAACA,KAAK,EAAEC,KAAK,EAAEK,WAAW,EAAEV,KAAK,EAAEQ,UAAU,EAAEF,UAAU,EAAEJ,KAAK,EAAED,IAAI,EAAEE,IAAI,CAChF,CAAC;AACL,CAAC;AAEDJ,YAAY,CAACuB,WAAW,GAAG,cAAc;AAEzC,eAAevB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"FilterButton.js","names":["React","useCallback","useMemo","useKeyboardFocusHighlighting","Icon","StyledFilterButtonItem","StyledFilterButtonItemBorder","StyledFilterButtonItemLabel","StyledFilterButtonItemLabelCount","StyledFilterButtonItemLabelText","StyledMotionFilterButtonItemBackground","FilterButton","icons","size","shape","text","color","count","isSelected","id","isDisabled","shouldEnableKeyboardHighlighting","tabIndex","onFocus","onArrowNavigate","buttonRef","onSelect","shouldShowKeyboardHighlighting","handleClick","event","preventDefault","stopPropagation","handleKeyDown","key","handleFocus","createElement","ref","$shape","$isSelected","$isDisabled","$shouldShowKeyboardHighlighting","$size","onClick","onKeyDown","role","undefined","toLocaleString","$color","displayName"],"sources":["../../../../../src/components/filter-buttons/filter-button/FilterButton.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n FC,\n KeyboardEventHandler,\n MouseEvent,\n useCallback,\n useMemo,\n} from 'react';\nimport type { FilterButtonItemShape, FilterButtonSize } from '../../../types/filterButtons';\nimport { useKeyboardFocusHighlighting } from '../../../hooks/useKeyboardFocusHighlighting';\nimport Icon from '../../icon/Icon';\nimport {\n StyledFilterButtonItem,\n StyledFilterButtonItemBorder,\n StyledFilterButtonItemLabel,\n StyledFilterButtonItemLabelCount,\n StyledFilterButtonItemLabelText,\n StyledMotionFilterButtonItemBackground,\n} from './FilterButton.styles';\n\nexport type FilterButtonProps = {\n color?: CSSProperties['color'];\n icons?: string[];\n isSelected: boolean;\n shape: FilterButtonItemShape;\n size: FilterButtonSize;\n count?: number;\n text: string;\n id: string;\n isDisabled?: boolean;\n shouldEnableKeyboardHighlighting?: boolean;\n tabIndex?: number;\n onFocus?: (id: string) => void;\n onArrowNavigate?: (id: string, direction: -1 | 1) => void;\n buttonRef?: (element: HTMLDivElement | null) => void;\n onSelect: (key: string) => void;\n};\n\nconst FilterButton: FC<FilterButtonProps> = ({\n icons,\n size,\n shape,\n text,\n color,\n count,\n isSelected,\n id,\n isDisabled,\n shouldEnableKeyboardHighlighting,\n tabIndex,\n onFocus,\n onArrowNavigate,\n buttonRef,\n onSelect,\n}) => {\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !isDisabled,\n );\n\n const handleClick = useCallback(\n (event: MouseEvent) => {\n if (isDisabled) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n onSelect(id);\n },\n [id, isDisabled, onSelect],\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (isDisabled) {\n return;\n }\n\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n event.preventDefault();\n onArrowNavigate?.(id, 1);\n return;\n }\n\n if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n event.preventDefault();\n onArrowNavigate?.(id, -1);\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onSelect(id);\n }\n },\n [id, isDisabled, onArrowNavigate, onSelect],\n );\n\n const handleFocus = useCallback(() => {\n onFocus?.(id);\n }, [id, onFocus]);\n\n return useMemo(\n () => (\n <StyledFilterButtonItem\n ref={buttonRef}\n $shape={shape}\n $isSelected={isSelected}\n $isDisabled={isDisabled}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n $size={size}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n role={shouldEnableKeyboardHighlighting ? 'button' : undefined}\n tabIndex={!isDisabled ? (tabIndex ?? 0) : -1}\n aria-pressed={shouldEnableKeyboardHighlighting ? isSelected : undefined}\n aria-disabled={shouldEnableKeyboardHighlighting ? isDisabled : undefined}\n >\n <StyledFilterButtonItemLabel>\n {icons && <Icon icons={icons} size={15} />}\n <StyledFilterButtonItemLabelText>{text}</StyledFilterButtonItemLabelText>\n {typeof count === 'number' && (\n <StyledFilterButtonItemLabelCount>\n {count.toLocaleString()}\n </StyledFilterButtonItemLabelCount>\n )}\n </StyledFilterButtonItemLabel>\n <StyledFilterButtonItemBorder\n $isSelected={isSelected}\n $shape={shape}\n $color={color}\n />\n <StyledMotionFilterButtonItemBackground\n $isSelected={isSelected}\n $shape={shape}\n $color={color}\n />\n </StyledFilterButtonItem>\n ),\n [\n color,\n buttonRef,\n count,\n handleClick,\n handleFocus,\n handleKeyDown,\n icons,\n isDisabled,\n isSelected,\n shape,\n shouldEnableKeyboardHighlighting,\n shouldShowKeyboardHighlighting,\n size,\n tabIndex,\n text,\n ],\n );\n};\n\nFilterButton.displayName = 'FilterButton';\n\nexport default FilterButton;\n"],"mappings":"AAAA,OAAOA,KAAK,IAKRC,WAAW,EACXC,OAAO,QACJ,OAAO;AAEd,SAASC,4BAA4B,QAAQ,6CAA6C;AAC1F,OAAOC,IAAI,MAAM,iBAAiB;AAClC,SACIC,sBAAsB,EACtBC,4BAA4B,EAC5BC,2BAA2B,EAC3BC,gCAAgC,EAChCC,+BAA+B,EAC/BC,sCAAsC,QACnC,uBAAuB;AAoB9B,MAAMC,YAAmC,GAAGA,CAAC;EACzCC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,IA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AAsC;IACnC4B,WAAW,EAAEpB,UAAW;IACxBmB,MAAM,EAAEvB,KAAM;IACdiC,MAAM,EAAE/B;EAAM,CACjB,CACmB,CAC3B,EACD,CACIA,KAAK,EACLS,SAAS,EACTR,KAAK,EACLW,WAAW,EACXM,WAAW,EACXF,aAAa,EACbpB,KAAK,EACLQ,UAAU,EACVF,UAAU,EACVJ,KAAK,EACLO,gCAAgC,EAChCM,8BAA8B,EAC9Bd,IAAI,EACJS,QAAQ,EACRP,IAAI,CAEZ,CAAC;AACL,CAAC;AAEDJ,YAAY,CAACqC,WAAW,GAAG,cAAc;AAEzC,eAAerC,YAAY","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  import { motion } from 'motion/react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import { FilterButtonItemShape, FilterButtonSize } from '../../../types/filterButtons';
4
+ import { keyboardFocusHighlightingRingCss } from '../../../utils/keyboardFocusHighlighting.styles';
4
5
  export const StyledFilterButtonItem = styled.div`
5
6
  position: relative;
6
7
  line-height: 1;
@@ -27,6 +28,16 @@ export const StyledFilterButtonItem = styled.div`
27
28
  opacity: 0.2;
28
29
  `}
29
30
  }
31
+
32
+ ${({
33
+ $shouldShowKeyboardHighlighting,
34
+ $shape
35
+ }) => $shouldShowKeyboardHighlighting && css`
36
+ &:focus-visible {
37
+ ${keyboardFocusHighlightingRingCss};
38
+ border-radius: ${$shape === FilterButtonItemShape.Round ? 100 : 3}px;
39
+ }
40
+ `}
30
41
  `;
31
42
  export const StyledFilterButtonItemLabel = styled.div`
32
43
  display: flex;
@@ -1 +1 @@
1
- {"version":3,"file":"FilterButton.styles.js","names":["motion","styled","css","FilterButtonItemShape","FilterButtonSize","StyledFilterButtonItem","div","$isDisabled","$size","Normal","$isSelected","StyledFilterButtonItemLabel","StyledFilterButtonItemLabelText","p","theme","text","StyledFilterButtonItemLabelCount","StyledFilterButtonItemBorder","$shape","Round","$color","headline","StyledMotionFilterButtonItemBackground"],"sources":["../../../../../src/components/filter-buttons/filter-button/FilterButton.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport { FilterButtonItemShape, FilterButtonSize } from '../../../types/filterButtons';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledFilterButtonItemProps = WithTheme<{\n $size: FilterButtonSize;\n $isSelected: boolean;\n $isDisabled?: boolean;\n}>;\n\nexport const StyledFilterButtonItem = styled.div<StyledFilterButtonItemProps>`\n position: relative;\n line-height: 1;\n cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')};\n user-select: none;\n padding: ${({ $size }) => ($size === FilterButtonSize.Normal ? '8px 14px' : '4px 8px')};\n\n display: flex;\n align-items: center;\n\n opacity: ${({ $isDisabled }) => ($isDisabled ? '.6' : '1')};\n\n &:hover > div:last-child {\n ${({ $isSelected, $isDisabled }) =>\n !$isSelected &&\n !$isDisabled &&\n css`\n opacity: 0.2;\n `}\n }\n`;\n\nexport const StyledFilterButtonItemLabel = styled.div`\n display: flex;\n gap: 5px;\n align-items: baseline;\n position: relative;\n z-index: 1;\n`;\n\ntype StyledFilterButtonItemLabelTextProps = WithTheme<unknown>;\n\nexport const StyledFilterButtonItemLabelText = styled.p<StyledFilterButtonItemLabelTextProps>`\n color: ${({ theme }: StyledFilterButtonItemLabelTextProps) => theme.text};\n margin: 0;\n line-height: 1;\n`;\n\ntype StyledFilterButtonItemLabelCountProps = WithTheme<unknown>;\n\nexport const StyledFilterButtonItemLabelCount = styled.p<StyledFilterButtonItemLabelCountProps>`\n color: ${({ theme }: StyledFilterButtonItemLabelTextProps) => theme.text};\n margin: 0;\n line-height: 1;\n font-weight: bold;\n`;\n\ntype StyledFilterButtonItemBorderProps = WithTheme<{\n $shape: FilterButtonItemShape;\n $color: CSSProperties['color'];\n $isSelected: boolean;\n}>;\n\nexport const StyledFilterButtonItemBorder = styled.div<StyledFilterButtonItemBorderProps>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0.4;\n z-index: 0;\n border-radius: ${({ $shape }) => ($shape === FilterButtonItemShape.Round ? 100 : 3)}px;\n\n ${({ $color, theme, $isSelected }: StyledFilterButtonItemBorderProps) =>\n !$isSelected &&\n css`\n border-width: 1px;\n border-style: solid;\n border-color: ${$color ?? theme.headline};\n `};\n`;\n\ntype StyledFilterButtonItemBackgroundProps = WithTheme<{\n $shape: FilterButtonItemShape;\n $color: CSSProperties['color'];\n $isSelected: boolean;\n}>;\n\nexport const StyledMotionFilterButtonItemBackground = styled(\n motion.div,\n)<StyledFilterButtonItemBackgroundProps>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n opacity: ${({ $isSelected }) => ($isSelected ? 0.4 : 0)};\n transition: opacity 0.5s ease;\n border-radius: ${({ $shape }) => ($shape === FilterButtonItemShape.Round ? 100 : 3)}px;\n background-color: ${({ $color, theme }: StyledFilterButtonItemBackgroundProps) =>\n $color ?? theme.headline};\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AAErC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,8BAA8B;AAStF,OAAO,MAAMC,sBAAsB,GAAGJ,MAAM,CAACK,GAAgC;AAC7E;AACA;AACA,cAAc,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,SAAS,GAAG,SAAU;AACxE;AACA,eAAe,CAAC;EAAEC;AAAM,CAAC,KAAMA,KAAK,KAAKJ,gBAAgB,CAACK,MAAM,GAAG,UAAU,GAAG,SAAU;AAC1F;AACA;AACA;AACA;AACA,eAAe,CAAC;EAAEF;AAAY,CAAC,KAAMA,WAAW,GAAG,IAAI,GAAG,GAAI;AAC9D;AACA;AACA,UAAU,CAAC;EAAEG,WAAW;EAAEH;AAAY,CAAC,KAC3B,CAACG,WAAW,IACZ,CAACH,WAAW,IACZL,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styled","css","FilterButtonItemShape","FilterButtonSize","keyboardFocusHighlightingRingCss","StyledFilterButtonItem","div","$isDisabled","$size","Normal","$isSelected","$shouldShowKeyboardHighlighting","$shape","Round","StyledFilterButtonItemLabel","StyledFilterButtonItemLabelText","p","theme","text","StyledFilterButtonItemLabelCount","StyledFilterButtonItemBorder","$color","headline","StyledMotionFilterButtonItemBackground"],"sources":["../../../../../src/components/filter-buttons/filter-button/FilterButton.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport { FilterButtonItemShape, FilterButtonSize } from '../../../types/filterButtons';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\nimport { keyboardFocusHighlightingRingCss } from '../../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledFilterButtonItemProps = WithTheme<{\n $size: FilterButtonSize;\n $shape: FilterButtonItemShape;\n $isSelected: boolean;\n $isDisabled?: boolean;\n $shouldShowKeyboardHighlighting?: boolean;\n}>;\n\nexport const StyledFilterButtonItem = styled.div<StyledFilterButtonItemProps>`\n position: relative;\n line-height: 1;\n cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')};\n user-select: none;\n padding: ${({ $size }) => ($size === FilterButtonSize.Normal ? '8px 14px' : '4px 8px')};\n\n display: flex;\n align-items: center;\n\n opacity: ${({ $isDisabled }) => ($isDisabled ? '.6' : '1')};\n\n &:hover > div:last-child {\n ${({ $isSelected, $isDisabled }) =>\n !$isSelected &&\n !$isDisabled &&\n css`\n opacity: 0.2;\n `}\n }\n\n ${({ $shouldShowKeyboardHighlighting, $shape }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-visible {\n ${keyboardFocusHighlightingRingCss};\n border-radius: ${$shape === FilterButtonItemShape.Round ? 100 : 3}px;\n }\n `}\n`;\n\nexport const StyledFilterButtonItemLabel = styled.div`\n display: flex;\n gap: 5px;\n align-items: baseline;\n position: relative;\n z-index: 1;\n`;\n\ntype StyledFilterButtonItemLabelTextProps = WithTheme<unknown>;\n\nexport const StyledFilterButtonItemLabelText = styled.p<StyledFilterButtonItemLabelTextProps>`\n color: ${({ theme }: StyledFilterButtonItemLabelTextProps) => theme.text};\n margin: 0;\n line-height: 1;\n`;\n\ntype StyledFilterButtonItemLabelCountProps = WithTheme<unknown>;\n\nexport const StyledFilterButtonItemLabelCount = styled.p<StyledFilterButtonItemLabelCountProps>`\n color: ${({ theme }: StyledFilterButtonItemLabelTextProps) => theme.text};\n margin: 0;\n line-height: 1;\n font-weight: bold;\n`;\n\ntype StyledFilterButtonItemBorderProps = WithTheme<{\n $shape: FilterButtonItemShape;\n $color: CSSProperties['color'];\n $isSelected: boolean;\n}>;\n\nexport const StyledFilterButtonItemBorder = styled.div<StyledFilterButtonItemBorderProps>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0.4;\n z-index: 0;\n border-radius: ${({ $shape }) => ($shape === FilterButtonItemShape.Round ? 100 : 3)}px;\n\n ${({ $color, theme, $isSelected }: StyledFilterButtonItemBorderProps) =>\n !$isSelected &&\n css`\n border-width: 1px;\n border-style: solid;\n border-color: ${$color ?? theme.headline};\n `};\n`;\n\ntype StyledFilterButtonItemBackgroundProps = WithTheme<{\n $shape: FilterButtonItemShape;\n $color: CSSProperties['color'];\n $isSelected: boolean;\n}>;\n\nexport const StyledMotionFilterButtonItemBackground = styled(\n motion.div,\n)<StyledFilterButtonItemBackgroundProps>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n opacity: ${({ $isSelected }) => ($isSelected ? 0.4 : 0)};\n transition: opacity 0.5s ease;\n border-radius: ${({ $shape }) => ($shape === FilterButtonItemShape.Round ? 100 : 3)}px;\n background-color: ${({ $color, theme }: StyledFilterButtonItemBackgroundProps) =>\n $color ?? theme.headline};\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AAErC,OAAOC,MAAM,IAAIC,GAAG,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zF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,CAAC;EAAEM;AAAO,CAAC,KAAMA,MAAM,KAAKV,qBAAqB,CAACW,KAAK,GAAG,GAAG,GAAG,CAAE;AACvF;AACA,MAAM,CAAC;EAAEQ,MAAM;EAAEJ,KAAK;EAAEP;AAA+C,CAAC,KAChE,CAACA,WAAW,IACZT,GAAG;AACX;AACA;AACA,4BAA4BoB,MAAM,IAAIJ,KAAK,CAACK,QAAQ;AACpD,SAAS;AACT,CAAC;AAQD,OAAO,MAAMC,sCAAsC,GAAGvB,MAAM,CACxDD,MAAM,CAACO,GACX,CAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,CAAC;EAAEI;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D;AACA,qBAAqB,CAAC;EAAEE;AAAO,CAAC,KAAMA,MAAM,KAAKV,qBAAqB,CAACW,KAAK,GAAG,GAAG,GAAG,CAAE;AACvF,wBAAwB,CAAC;EAAEQ,MAAM;EAAEJ;AAA6C,CAAC,KACzEI,MAAM,IAAIJ,KAAK,CAACK,QAAQ;AAChC,CAAC","ignoreList":[]}
@@ -1,15 +1,29 @@
1
1
  import React, { useCallback, useState } from 'react';
2
+ import { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';
2
3
  import { StyledGridBottomRightImage, StyledGridImage, StyledGridLeftImage, StyledGridTopRightImage } from './GridImage.styles';
3
4
  const GridImage = ({
4
5
  background,
5
6
  images,
6
7
  shouldShowRoundImage,
7
8
  size,
8
- onClick
9
+ onClick,
10
+ shouldEnableKeyboardHighlighting
9
11
  }) => {
10
12
  const [hasLoadedLeftImage, setHasLoadedLeftImage] = useState(false);
11
13
  const [hasLoadedTopRightImage, setHasLoadedTopRightImage] = useState(false);
12
14
  const [hasLoadedBottomRightImage, setHasLoadedBottomRightImage] = useState(false);
15
+ const isClickable = typeof onClick === 'function';
16
+ const isKeyboardFocusable = isClickable && shouldEnableKeyboardHighlighting;
17
+ const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(shouldEnableKeyboardHighlighting);
18
+ const handleKeyDown = useCallback(event => {
19
+ if (!isClickable) {
20
+ return;
21
+ }
22
+ if (event.key === 'Enter' || event.key === ' ') {
23
+ event.preventDefault();
24
+ onClick?.(event);
25
+ }
26
+ }, [isClickable, onClick]);
13
27
  const handleLeftImageLoaded = useCallback(() => setHasLoadedLeftImage(true), []);
14
28
  const handleTopRightImageLoaded = useCallback(() => setHasLoadedTopRightImage(true), []);
15
29
  const handleBottomRightImageLoaded = useCallback(() => setHasLoadedBottomRightImage(true), []);
@@ -17,8 +31,12 @@ const GridImage = ({
17
31
  return /*#__PURE__*/React.createElement(StyledGridImage, {
18
32
  $background: background,
19
33
  $shouldShowRoundImage: shouldShowRoundImage,
34
+ $shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
20
35
  $size: size,
21
- onClick: typeof onClick === 'function' ? onClick : undefined
36
+ onClick: isClickable ? onClick : undefined,
37
+ onKeyDown: isKeyboardFocusable ? handleKeyDown : undefined,
38
+ tabIndex: isKeyboardFocusable ? 0 : -1,
39
+ role: isClickable ? 'button' : undefined
22
40
  }, /*#__PURE__*/React.createElement(StyledGridLeftImage, {
23
41
  $isHidden: isGridImageHidden,
24
42
  onLoad: handleLeftImageLoaded,
@@ -1 +1 @@
1
- {"version":3,"file":"GridImage.js","names":["React","useCallback","useState","StyledGridBottomRightImage","StyledGridImage","StyledGridLeftImage","StyledGridTopRightImage","GridImage","background","images","shouldShowRoundImage","size","onClick","hasLoadedLeftImage","setHasLoadedLeftImage","hasLoadedTopRightImage","setHasLoadedTopRightImage","hasLoadedBottomRightImage","setHasLoadedBottomRightImage","handleLeftImageLoaded","handleTopRightImageLoaded","handleBottomRightImageLoaded","isGridImageHidden","createElement","$background","$shouldShowRoundImage","$size","undefined","$isHidden","onLoad","src","displayName"],"sources":["../../../../src/components/grid-image/GridImage.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEventHandler, useCallback, useState } from 'react';\nimport {\n StyledGridBottomRightImage,\n StyledGridImage,\n StyledGridLeftImage,\n StyledGridTopRightImage,\n} from './GridImage.styles';\n\ntype GridImageProps = {\n /**\n * The background color of the image.\n */\n background?: CSSProperties['background'];\n /**\n * The images to be displayed in the `GridImage`. Only the first three images are displayed.\n */\n images: string[];\n /**\n * Function to be executed when the images are clicked.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Images of users should always be displayed in a round shape. Therefore, this property can be set to true.\n */\n shouldShowRoundImage?: boolean;\n /**\n * The size of the `GridImage` in pixels, which is set as both width and height.\n */\n size: number;\n};\n\nconst GridImage: FC<GridImageProps> = ({\n background,\n images,\n shouldShowRoundImage,\n size,\n onClick,\n}) => {\n const [hasLoadedLeftImage, setHasLoadedLeftImage] = useState(false);\n const [hasLoadedTopRightImage, setHasLoadedTopRightImage] = useState(false);\n const [hasLoadedBottomRightImage, setHasLoadedBottomRightImage] = useState(false);\n\n const handleLeftImageLoaded = useCallback(() => setHasLoadedLeftImage(true), []);\n\n const handleTopRightImageLoaded = useCallback(() => setHasLoadedTopRightImage(true), []);\n\n const handleBottomRightImageLoaded = useCallback(() => setHasLoadedBottomRightImage(true), []);\n\n const isGridImageHidden =\n !hasLoadedLeftImage || !hasLoadedTopRightImage || !hasLoadedBottomRightImage;\n\n return (\n <StyledGridImage\n $background={background}\n $shouldShowRoundImage={shouldShowRoundImage}\n $size={size}\n onClick={typeof onClick === 'function' ? onClick : undefined}\n >\n <StyledGridLeftImage\n $isHidden={isGridImageHidden}\n onLoad={handleLeftImageLoaded}\n $size={size}\n src={images[0]}\n />\n <StyledGridTopRightImage\n $isHidden={isGridImageHidden}\n onLoad={handleTopRightImageLoaded}\n $size={size}\n src={images[1]}\n />\n <StyledGridBottomRightImage\n $isHidden={isGridImageHidden}\n onLoad={handleBottomRightImageLoaded}\n src={images[2]}\n />\n </StyledGridImage>\n );\n};\n\nGridImage.displayName = 'GridImage';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,IAAK;IACZmB,GAAG,EAAErB,MAAM,CAAC,CAAC;EAAE,CAClB,CAAC,eACFT,KAAA,CAAAuB,aAAA,CAACjB,uBAAuB;IACpBsB,SAAS,EAAEN,iBAAkB;IAC7BO,MAAM,EAAET,yBAA0B;IAClCM,KAAK,EAAEf,IAAK;IACZmB,GAAG,EAAErB,MAAM,CAAC,CAAC;EAAE,CAClB,CAAC,eACFT,KAAA,CAAAuB,aAAA,CAACpB,0BAA0B;IACvByB,SAAS,EAAEN,iBAAkB;IAC7BO,MAAM,EAAER,4BAA6B;IACrCS,GAAG,EAAErB,MAAM,CAAC,CAAC;EAAE,CAClB,CACY,CAAC;AAE1B,CAAC;AAEDF,SAAS,CAACwB,WAAW,GAAG,WAAW;AAEnC,eAAexB,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"GridImage.js","names":["React","useCallback","useState","useKeyboardFocusHighlighting","StyledGridBottomRightImage","StyledGridImage","StyledGridLeftImage","StyledGridTopRightImage","GridImage","background","images","shouldShowRoundImage","size","onClick","shouldEnableKeyboardHighlighting","hasLoadedLeftImage","setHasLoadedLeftImage","hasLoadedTopRightImage","setHasLoadedTopRightImage","hasLoadedBottomRightImage","setHasLoadedBottomRightImage","isClickable","isKeyboardFocusable","shouldShowKeyboardHighlighting","handleKeyDown","event","key","preventDefault","handleLeftImageLoaded","handleTopRightImageLoaded","handleBottomRightImageLoaded","isGridImageHidden","createElement","$background","$shouldShowRoundImage","$shouldShowKeyboardHighlighting","$size","undefined","onKeyDown","tabIndex","role","$isHidden","onLoad","src","displayName"],"sources":["../../../../src/components/grid-image/GridImage.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n FC,\n KeyboardEventHandler,\n MouseEventHandler,\n MouseEvent,\n SyntheticEvent,\n useCallback,\n useState,\n} from 'react';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport {\n StyledGridBottomRightImage,\n StyledGridImage,\n StyledGridLeftImage,\n StyledGridTopRightImage,\n} from './GridImage.styles';\n\ntype GridImageProps = {\n /**\n * The background color of the image.\n */\n background?: CSSProperties['background'];\n /**\n * The images to be displayed in the `GridImage`. Only the first three images are displayed.\n */\n images: string[];\n /**\n * Function to be executed when the images are clicked.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Images of users should always be displayed in a round shape. Therefore, this property can be set to true.\n */\n shouldShowRoundImage?: boolean;\n /**\n * The size of the `GridImage` in pixels, which is set as both width and height.\n */\n size: number;\n /**\n * Enables keyboard-only focus highlighting for clickable GridImage instances.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst GridImage: FC<GridImageProps> = ({\n background,\n images,\n shouldShowRoundImage,\n size,\n onClick,\n shouldEnableKeyboardHighlighting,\n}) => {\n const [hasLoadedLeftImage, setHasLoadedLeftImage] = useState(false);\n const [hasLoadedTopRightImage, setHasLoadedTopRightImage] = useState(false);\n const [hasLoadedBottomRightImage, setHasLoadedBottomRightImage] = useState(false);\n\n const isClickable = typeof onClick === 'function';\n const isKeyboardFocusable = isClickable && shouldEnableKeyboardHighlighting;\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting,\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (!isClickable) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onClick?.(event as unknown as MouseEvent<HTMLDivElement>);\n }\n },\n [isClickable, onClick],\n );\n\n const handleLeftImageLoaded = useCallback(() => setHasLoadedLeftImage(true), []);\n\n const handleTopRightImageLoaded = useCallback(() => setHasLoadedTopRightImage(true), []);\n\n const handleBottomRightImageLoaded = useCallback(() => setHasLoadedBottomRightImage(true), []);\n\n const isGridImageHidden =\n !hasLoadedLeftImage || !hasLoadedTopRightImage || !hasLoadedBottomRightImage;\n\n return (\n <StyledGridImage\n $background={background}\n $shouldShowRoundImage={shouldShowRoundImage}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n $size={size}\n onClick={isClickable ? onClick : undefined}\n onKeyDown={isKeyboardFocusable ? handleKeyDown : undefined}\n tabIndex={isKeyboardFocusable ? 0 : -1}\n role={isClickable ? 'button' : undefined}\n >\n <StyledGridLeftImage\n $isHidden={isGridImageHidden}\n onLoad={handleLeftImageLoaded}\n $size={size}\n src={images[0]}\n />\n <StyledGridTopRightImage\n $isHidden={isGridImageHidden}\n onLoad={handleTopRightImageLoaded}\n $size={size}\n src={images[1]}\n />\n <StyledGridBottomRightImage\n $isHidden={isGridImageHidden}\n onLoad={handleBottomRightImageLoaded}\n src={images[2]}\n />\n </StyledGridImage>\n );\n};\n\nGridImage.displayName = 'GridImage';\n\nexport default GridImage;\n"],"mappings":"AAAA,OAAOA,KAAK,IAORC,WAAW,EACXC,QAAQ,QACL,OAAO;AACd,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SACIC,0BAA0B,EAC1BC,eAAe,EACfC,mBAAmB,EACnBC,uBAAuB,QACpB,oBAAoB;AA6B3B,MAAMC,SAA6B,GAAGA,CAAC;EACnCC,UAAU;EACVC,MAAM;EACNC,oBAAoB;EACpBC,IAAI;EACJC,OAAO;EACPC;AACJ,CAAC,KAAK;EACF,MAAM,CAACC,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGd,QAAQ,CAAC,KAAK,CAAC;EACnE,MAAM,CAACe,sBAAsB,EAAEC,yBAAyB,CAAC,GAAGhB,QAAQ,CAAC,KAAK,CAAC;EAC3E,MAAM,CAACiB,yBAAyB,EAAEC,4BAA4B,CAAC,GAAGlB,QAAQ,CAAC,KAAK,CAAC;EAEjF,MAAMmB,WAAW,GAAG,OAAOR,OAAO,KAAK,UAAU;EACjD,MAAMS,mBAAmB,GAAGD,WAAW,IAAIP,gCAAgC;EAC3E,MAAMS,8BAA8B,GAAGpB,4BAA4B,CAC/DW,gCACJ,CAAC;EAED,MAAMU,aAAa,GAAGvB,WAAW,CAC5BwB,KAAK,IAAK;IACP,IAAI,C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C,aAAA,CAACzB,uBAAuB;IACpBkC,SAAS,EAAEV,iBAAkB;IAC7BW,MAAM,EAAEb,yBAA0B;IAClCO,KAAK,EAAExB,IAAK;IACZ+B,GAAG,EAAEjC,MAAM,CAAC,CAAC;EAAE,CAClB,CAAC,eACFV,KAAA,CAAAgC,aAAA,CAAC5B,0BAA0B;IACvBqC,SAAS,EAAEV,iBAAkB;IAC7BW,MAAM,EAAEZ,4BAA6B;IACrCa,GAAG,EAAEjC,MAAM,CAAC,CAAC;EAAE,CAClB,CACY,CAAC;AAE1B,CAAC;AAEDF,SAAS,CAACoC,WAAW,GAAG,WAAW;AAEnC,eAAepC,SAAS","ignoreList":[]}
@@ -1,4 +1,5 @@
1
- import styled from 'styled-components';
1
+ import styled, { css } from 'styled-components';
2
+ import { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';
2
3
  export const StyledGridImage = styled.div`
3
4
  background: ${({
4
5
  $background,
@@ -20,6 +21,14 @@ export const StyledGridImage = styled.div`
20
21
  $size
21
22
  }) => $size}px;
22
23
  flex: 0 0 auto;
24
+
25
+ ${({
26
+ $shouldShowKeyboardHighlighting
27
+ }) => $shouldShowKeyboardHighlighting && css`
28
+ &:focus-visible {
29
+ ${keyboardFocusHighlightingRingCss}
30
+ }
31
+ `}
23
32
  `;
24
33
  export const StyledGridLeftImage = styled.img`
25
34
  border-right: ${({
@@ -1 +1 @@
1
- {"version":3,"file":"GridImage.styles.js","names":["styled","StyledGridImage","div","$background","theme","$shouldShowRoundImage","undefined","$size","StyledGridLeftImage","img","$isHidden","StyledGridTopRightImage","StyledGridBottomRightImage"],"sources":["../../../../src/components/grid-image/GridImage.styles.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGridImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldShowRoundImage?: boolean;\n $size: number;\n}>;\n\nexport const StyledGridImage = styled.div<StyledGridImageProps>`\n background: ${({ $background, theme }: StyledGridImageProps) =>\n $background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : undefined)};\n box-shadow: 0 0 0 1px rgba(${({ theme }: StyledGridImageProps) => theme['009-rgb']}, 0.08) inset;\n height: ${({ $size }) => $size}px;\n overflow: hidden;\n position: relative;\n transition: border-radius 0.3s ease;\n width: ${({ $size }) => $size}px;\n flex: 0 0 auto;\n`;\n\ntype StyledGridLeftImageProps = {\n $isHidden: boolean;\n $size: number;\n};\n\nexport const StyledGridLeftImage = styled.img<StyledGridLeftImageProps>`\n border-right: ${({ $size }) => $size / 40}px solid white;\n height: 100%;\n left: 0;\n object-fit: cover;\n opacity: ${({ $isHidden }) => ($isHidden ? 0 : 1)};\n position: absolute;\n top: 0;\n transition: opacity 0.4s ease;\n width: 60%;\n`;\n\ntype StyledGridTopRightImageProps = {\n $isHidden: boolean;\n $size: number;\n};\n\nexport const StyledGridTopRightImage = styled.img<StyledGridTopRightImageProps>`\n border-bottom: ${({ $size }) => $size / 40}px solid white;\n height: 50%;\n object-fit: cover;\n opacity: ${({ $isHidden }) => ($isHidden ? 0 : 1)};\n position: absolute;\n right: 0;\n top: 0;\n transition: opacity 0.3s ease;\n width: 40%;\n`;\n\ntype StyledGridBottomRightImageProps = {\n $isHidden: boolean;\n};\n\nexport const StyledGridBottomRightImage = styled.img<StyledGridBottomRightImageProps>`\n bottom: 0;\n height: 50%;\n object-fit: cover;\n opacity: ${({ $isHidden }) => ($isHidden ? 0 : 1)};\n position: absolute;\n right: 0;\n transition: opacity 0.3s ease;\n width: 40%;\n`;\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,mBAAmB;AAStC,OAAO,MAAMC,eAAe,GAAGD,MAAM,CAACE,GAAyB;AAC/D,kBAAkB,CAAC;EAAEC,WAAW;EAAEC;AAA4B,CAAC,KACvDD,WAAW,IAAI,QAAQC,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACnE,qBAAqB,CAAC;EAAEC;AAAsB,CAAC,KAAMA,qBAAqB,GAAG,KAAK,GAAGC,SAAU;AAC/F,iCAAiC,CAAC;EAAEF;AAA4B,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AACtF,cAAc,CAAC;EAAEG;AAAM,CAAC,KAAKA,KAAK;AAClC;AACA;AACA;AACA,aAAa,CAAC;EAAEA;AAAM,CAAC,KAAKA,KAAK;AACjC;AACA,CAAC;AAOD,OAAO,MAAMC,mBAAmB,GAAGR,MAAM,CAACS,GAA6B;AACvE,oBAAoB,CAAC;EAAEF;AAAM,CAAC,KAAKA,KAAK,GAAG,EAAE;AAC7C;AACA;AACA;AACA,eAAe,CAAC;EAAEG;AAAU,CAAC,KAAMA,SAAS,GAAG,CAAC,GAAG,CAAE;AACrD;AACA;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMC,uBAAuB,GAAGX,MAAM,CAACS,GAAiC;AAC/E,qBAAqB,CAAC;EAAEF;AAAM,CAAC,KAAKA,KAAK,GAAG,EAAE;AAC9C;AACA;AACA,eAAe,CAAC;EAAEG;AAAU,CAAC,KAAMA,SAAS,GAAG,CAAC,GAAG,CAAE;AACrD;AACA;AACA;AACA;AACA;AACA,CAAC;AAMD,OAAO,MAAME,0BAA0B,GAAGZ,MAAM,CAACS,GAAoC;AACrF;AACA;AACA;AACA,eAAe,CAAC;EAAEC;AAAU,CAAC,KAAMA,SAAS,GAAG,CAAC,GAAG,CAAE;AACrD;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"GridImage.styles.js","names":["styled","css","keyboardFocusHighlightingRingCss","StyledGridImage","div","$background","theme","$shouldShowRoundImage","undefined","$size","$shouldShowKeyboardHighlighting","StyledGridLeftImage","img","$isHidden","StyledGridTopRightImage","StyledGridBottomRightImage"],"sources":["../../../../src/components/grid-image/GridImage.styles.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledGridImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldShowRoundImage?: boolean;\n $shouldShowKeyboardHighlighting?: boolean;\n $size: number;\n}>;\n\nexport const StyledGridImage = styled.div<StyledGridImageProps>`\n background: ${({ $background, theme }: StyledGridImageProps) =>\n $background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : undefined)};\n box-shadow: 0 0 0 1px rgba(${({ theme }: StyledGridImageProps) => theme['009-rgb']}, 0.08) inset;\n height: ${({ $size }) => $size}px;\n overflow: hidden;\n position: relative;\n transition: border-radius 0.3s ease;\n width: ${({ $size }) => $size}px;\n flex: 0 0 auto;\n\n ${({ $shouldShowKeyboardHighlighting }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-visible {\n ${keyboardFocusHighlightingRingCss}\n }\n `}\n`;\n\ntype StyledGridLeftImageProps = {\n $isHidden: boolean;\n $size: number;\n};\n\nexport const StyledGridLeftImage = styled.img<StyledGridLeftImageProps>`\n border-right: ${({ $size }) => $size / 40}px solid white;\n height: 100%;\n left: 0;\n object-fit: cover;\n opacity: ${({ $isHidden }) => ($isHidden ? 0 : 1)};\n position: absolute;\n top: 0;\n transition: opacity 0.4s ease;\n width: 60%;\n`;\n\ntype StyledGridTopRightImageProps = {\n $isHidden: boolean;\n $size: number;\n};\n\nexport const StyledGridTopRightImage = styled.img<StyledGridTopRightImageProps>`\n border-bottom: ${({ $size }) => $size / 40}px solid white;\n height: 50%;\n object-fit: cover;\n opacity: ${({ $isHidden }) => ($isHidden ? 0 : 1)};\n position: absolute;\n right: 0;\n top: 0;\n transition: opacity 0.3s ease;\n width: 40%;\n`;\n\ntype StyledGridBottomRightImageProps = {\n $isHidden: boolean;\n};\n\nexport const StyledGridBottomRightImage = styled.img<StyledGridBottomRightImageProps>`\n bottom: 0;\n height: 50%;\n object-fit: cover;\n opacity: ${({ $isHidden }) => ($isHidden ? 0 : 1)};\n position: absolute;\n right: 0;\n transition: opacity 0.3s ease;\n width: 40%;\n`;\n"],"mappings":"AACA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,gCAAgC,QAAQ,8CAA8C;AAS/F,OAAO,MAAMC,eAAe,GAAGH,MAAM,CAACI,GAAyB;AAC/D,kBAAkB,CAAC;EAAEC,WAAW;EAAEC;AAA4B,CAAC,KACvDD,WAAW,IAAI,QAAQC,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACnE,qBAAqB,CAAC;EAAEC;AAAsB,CAAC,KAAMA,qBAAqB,GAAG,KAAK,GAAGC,SAAU;AAC/F,iCAAiC,CAAC;EAAEF;AAA4B,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AACtF,cAAc,CAAC;EAAEG;AAAM,CAAC,KAAKA,KAAK;AAClC;AACA;AACA;AACA,aAAa,CAAC;EAAEA;AAAM,CAAC,KAAKA,KAAK;AACjC;AACA;AACA,MAAM,CAAC;EAAEC;AAAgC,CAAC,KAClCA,+BAA+B,IAC/BT,GAAG;AACX;AACA,kBAAkBC,gCAAgC;AAClD;AACA,SAAS;AACT,CAAC;AAOD,OAAO,MAAMS,mBAAmB,GAAGX,MAAM,CAACY,GAA6B;AACvE,oBAAoB,CAAC;EAAEH;AAAM,CAAC,KAAKA,KAAK,GAAG,EAAE;AAC7C;AACA;AACA;AACA,eAAe,CAAC;EAAEI;AAAU,CAAC,KAAMA,SAAS,GAAG,CAAC,GAAG,CAAE;AACrD;AACA;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMC,uBAAuB,GAAGd,MAAM,CAACY,GAAiC;AAC/E,qBAAqB,CAAC;EAAEH;AAAM,CAAC,KAAKA,KAAK,GAAG,EAAE;AA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