@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 +1 @@
1
- {"version":3,"file":"Input.js","names":["React","forwardRef","useCallback","useContext","useEffect","useImperativeHandle","useMemo","useRef","useState","useTheme","useElementSize","AreaContext","Icon","StyledInput","StyledInputContent","StyledInputContentWrapper","StyledInputField","StyledInputIconWrapper","StyledInputLabel","StyledInputRightElement","StyledMotionInputClearIcon","StyledMotionInputLabelWrapper","ContentCardType","useCursorRepaint","Tooltip","InputSize","Input","leftElement","inputMode","isDisabled","onBlur","onChange","onFocus","onKeyDown","onPaste","placeholder","color","rightElement","shouldShowOnlyBottomBorder","shouldRemainPlaceholder","shouldShowClearIcon","shouldShowCenteredContent","size","Medium","type","value","disabledHint","shouldUseAutoFocus","isInvalid","shouldPreventPlaceholderAnimation","id","shouldShowTransparentBackground","autoComplete","ref","hasValue","setHasValue","placeholderWidth","setPlaceholderWidth","areaProvider","theme","inputRef","placeholderRef","placeholderSize","width","handleClearIconClick","current","target","shouldShowBorder","props","style","backgroundColor","undefined","handleInputFieldChange","event","focus","blur","internalColor","contentCardType","Error","Success","Warning","includes","shouldChangeColor","labelPosition","right","top","bottom","Small","left","inputElement","createElement","className","$isDisabled","$shouldShowTransparentBackground","$backgroundColor","$isInvalid","$shouldRoundRightCorners","$shouldShowOnlyBottomBorder","$size","$borderColor","border","$color","$placeholderWidth","disabled","onClick","preventDefault","stopPropagation","autoFocus","$shouldShowCenteredContent","animate","opacity","fontSize","Number","initial","layout","transition","duration","icons","wrong","item","text","shouldUseFullWidth","displayName"],"sources":["../../../../src/components/input/Input.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n CSSProperties,\n FocusEventHandler,\n forwardRef,\n HTMLInputTypeAttribute,\n KeyboardEventHandler,\n type ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { useElementSize } from '../../hooks/element';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport {\n StyledInput,\n StyledInputContent,\n StyledInputContentWrapper,\n StyledInputField,\n StyledInputIconWrapper,\n StyledInputLabel,\n StyledInputRightElement,\n StyledMotionInputClearIcon,\n StyledMotionInputLabelWrapper,\n} from './Input.styles';\nimport { ContentCardType } from '../../types/contentCard';\nimport { useCursorRepaint } from '../../hooks/resize';\nimport Tooltip from '../tooltip/Tooltip';\n\nexport interface InputRef {\n focus: VoidFunction;\n blur: VoidFunction;\n}\n\ntype InputMode =\n | 'email'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'none'\n | 'numeric'\n | 'decimal'\n | undefined;\n\ntype AutoComplete =\n | 'on'\n | 'off'\n | 'name'\n | 'username'\n | 'email'\n | 'new-password'\n | 'current-password'\n | 'tel'\n | 'url'\n | 'street-address'\n | 'postal-code'\n | 'country'\n | undefined;\n\nexport enum InputSize {\n Small = 'small',\n Medium = 'medium',\n}\n\ninterface Color {\n placeholder?: CSSProperties['color'];\n border?: CSSProperties['borderColor'];\n}\n\nexport type InputProps = {\n /**\n * If set and the input is disabled, the input will display a tooltip with this message.\n */\n disabledHint?: string;\n /**\n * An element to be displayed on the left side of the input field\n */\n leftElement?: ReactNode;\n /**\n * The id of the input\n */\n id?: string;\n /**\n * Defines the input mode of the input\n */\n inputMode?: InputMode;\n /**\n * Defines the auto Complete of the input\n */\n autoComplete?: AutoComplete;\n /**\n * Disables the input so that it cannot be changed anymore\n */\n isDisabled?: boolean;\n /**\n * If true, the input field is marked as invalid\n */\n isInvalid?: boolean;\n /**\n * Function that is executed when the input field loses focus\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when content is pasted into the input field\n */\n onPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Placeholder for the input field\n */\n placeholder?: ReactNode;\n /**\n * Colors for different parts of the input. You can set the color of the placeholder and the border color.\n */\n color?: Color;\n /**\n * An element that should be displayed on the right side of the Input.\n */\n rightElement?: ReactElement;\n /**\n * Whether the placeholder animation should be prevented.\n */\n shouldPreventPlaceholderAnimation?: boolean;\n /**\n * Whether the placeholder should remain at its position if a value is typed.\n */\n shouldRemainPlaceholder?: boolean;\n /**\n * Whether the content should be displayed centered inside the input.\n */\n shouldShowCenteredContent?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the input field\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether only the bottom border should be displayed\n */\n shouldShowOnlyBottomBorder?: boolean;\n /**\n * Whether the background should be transparent.\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the input field is focused when the component is mounted\n */\n shouldUseAutoFocus?: boolean;\n /**\n * The size of the input field\n */\n size?: InputSize;\n /**\n * Input type set for an input element (e.g. 'text', 'number' or 'password')\n */\n type?: HTMLInputTypeAttribute;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n};\n\nconst Input = forwardRef<InputRef, InputProps>(\n (\n {\n leftElement,\n inputMode,\n isDisabled,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onPaste,\n placeholder,\n color,\n rightElement,\n shouldShowOnlyBottomBorder,\n shouldRemainPlaceholder = false,\n shouldShowClearIcon = false,\n shouldShowCenteredContent = false,\n size = InputSize.Medium,\n type = 'text',\n value,\n disabledHint,\n shouldUseAutoFocus = false,\n isInvalid = false,\n shouldPreventPlaceholderAnimation = false,\n id,\n shouldShowTransparentBackground = false,\n autoComplete,\n },\n ref,\n ) => {\n const [hasValue, setHasValue] = useState(typeof value === 'string' && value !== '');\n const [placeholderWidth, setPlaceholderWidth] = useState(0);\n\n const areaProvider = useContext(AreaContext);\n\n const theme = useTheme() as Theme;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const placeholderRef = useRef<HTMLLabelElement>(null);\n\n useCursorRepaint(inputRef);\n\n const placeholderSize = useElementSize(placeholderRef);\n\n useEffect(() => {\n if (placeholderSize && shouldShowOnlyBottomBorder) {\n setPlaceholderWidth(placeholderSize.width + 5);\n }\n }, [placeholderSize, shouldShowOnlyBottomBorder]);\n\n const handleClearIconClick = useCallback(() => {\n if (inputRef.current) {\n inputRef.current.value = '';\n\n setHasValue(false);\n\n if (typeof onChange === 'function') {\n onChange({ target: inputRef.current } as ChangeEvent<HTMLInputElement>);\n }\n }\n }, [onChange]);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const shouldShowBorder = rightElement?.props?.style?.backgroundColor === undefined;\n\n const handleInputFieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value !== '');\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [onChange],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => inputRef.current?.focus(),\n blur: () => inputRef.current?.blur(),\n }),\n [],\n );\n\n useEffect(() => {\n if (typeof value === 'string') {\n setHasValue(value !== '');\n }\n }, [value]);\n\n let backgroundColor: CSSProperties['backgroundColor'] | undefined;\n let internalColor: CSSProperties['color'] | undefined;\n\n if (shouldShowTransparentBackground) {\n backgroundColor = 'transparent';\n } else if (\n areaProvider.contentCardType &&\n [ContentCardType.Error, ContentCardType.Success, ContentCardType.Warning].includes(\n areaProvider.contentCardType,\n )\n ) {\n backgroundColor = 'white';\n internalColor = '#555';\n } else if (areaProvider.shouldChangeColor) {\n backgroundColor = theme['000'];\n }\n\n const labelPosition = useMemo(() => {\n if (hasValue && !shouldRemainPlaceholder && !shouldPreventPlaceholderAnimation) {\n return shouldShowOnlyBottomBorder\n ? { right: 3, top: -1.5 }\n : { bottom: size === InputSize.Small ? -4 : -10, right: -6 };\n }\n\n return { left: -1, top: -1.5 };\n }, [\n hasValue,\n shouldPreventPlaceholderAnimation,\n shouldRemainPlaceholder,\n shouldShowOnlyBottomBorder,\n size,\n ]);\n\n const inputElement = useMemo(\n () => (\n <StyledInput className=\"beta-chayns-input\" $isDisabled={isDisabled}>\n <StyledInputContentWrapper\n $shouldShowTransparentBackground={shouldShowTransparentBackground}\n $backgroundColor={backgroundColor}\n $isInvalid={isInvalid}\n $shouldRoundRightCorners={shouldShowBorder}\n $shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n $size={size}\n $borderColor={color?.border}\n >\n {leftElement && (\n <StyledInputIconWrapper>{leftElement}</StyledInputIconWrapper>\n )}\n <StyledInputContent\n $shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n >\n <StyledInputField\n $color={internalColor}\n $placeholderWidth={placeholderWidth}\n id={id}\n disabled={isDisabled}\n onBlur={onBlur}\n onChange={handleInputFieldChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n onPaste={onPaste}\n ref={inputRef}\n type={type}\n value={value}\n autoFocus={shouldUseAutoFocus}\n inputMode={inputMode}\n autoComplete={autoComplete}\n $isInvalid={isInvalid}\n $shouldShowCenteredContent={shouldShowCenteredContent}\n />\n <StyledMotionInputLabelWrapper\n animate={\n shouldPreventPlaceholderAnimation\n ? {\n opacity: hasValue ? 0 : 1,\n }\n : {\n fontSize:\n hasValue &&\n !shouldShowOnlyBottomBorder &&\n !shouldRemainPlaceholder\n ? '9px'\n : `${Number(theme.fontSize)}px`,\n }\n }\n initial={false}\n layout\n ref={placeholderRef}\n style={{ ...labelPosition }}\n transition={{\n type: 'tween',\n duration: shouldPreventPlaceholderAnimation ? 0 : 0.1,\n }}\n >\n <StyledInputLabel\n $color={color?.placeholder}\n $isInvalid={isInvalid}\n >\n {placeholder}\n </StyledInputLabel>\n </StyledMotionInputLabelWrapper>\n </StyledInputContent>\n {shouldShowClearIcon && (\n <StyledMotionInputClearIcon\n $shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n $size={size}\n animate={{ opacity: hasValue ? 1 : 0 }}\n initial={false}\n onClick={handleClearIconClick}\n transition={{ type: 'tween' }}\n >\n <Icon\n icons={['fa fa-times']}\n color={isInvalid ? theme.wrong : undefined}\n />\n </StyledMotionInputClearIcon>\n )}\n {rightElement && shouldShowBorder && rightElement}\n </StyledInputContentWrapper>\n {rightElement && !shouldShowBorder && (\n <StyledInputRightElement>{rightElement}</StyledInputRightElement>\n )}\n </StyledInput>\n ),\n [\n isDisabled,\n shouldShowTransparentBackground,\n backgroundColor,\n isInvalid,\n shouldShowBorder,\n shouldShowOnlyBottomBorder,\n size,\n leftElement,\n internalColor,\n placeholderWidth,\n id,\n onBlur,\n handleInputFieldChange,\n onFocus,\n onKeyDown,\n onPaste,\n type,\n value,\n shouldUseAutoFocus,\n inputMode,\n autoComplete,\n shouldShowCenteredContent,\n shouldPreventPlaceholderAnimation,\n hasValue,\n shouldRemainPlaceholder,\n theme.fontSize,\n theme.wrong,\n labelPosition,\n color?.placeholder,\n placeholder,\n shouldShowClearIcon,\n handleClearIconClick,\n rightElement,\n ],\n );\n\n if (isDisabled && typeof disabledHint === 'string') {\n return (\n <Tooltip item={{ text: disabledHint }} shouldUseFullWidth>\n {inputElement}\n </Tooltip>\n );\n }\n\n return inputElement;\n },\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"mappings":"AAAA,OAAOA,KAAK,IAKRC,UAAU,EAKVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,WAAW,QAAQ,sCAAsC;AAElE,OAAOC,IAAI,MAAM,cAAc;AAC/B,SACIC,WAAW,EACXC,kBAAkB,EAClBC,yBAAyB,EACzBC,gBAAgB,EAChBC,sBAAsB,EACtBC,gBAAgB,EAChBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,6BAA6B,QAC1B,gBAAgB;AACvB,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,OAAOC,OAAO,MAAM,oBAAoB;AAiCxC,WAAYC,SAA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,IAAI,EACJC,KAAK,EACLE,kBAAkB,EAClBnB,SAAS,EACTwB,YAAY,EACZX,yBAAyB,EACzBQ,iCAAiC,EACjCK,QAAQ,EACRf,uBAAuB,EACvBoB,KAAK,CAACoD,QAAQ,EACdpD,KAAK,CAAC2D,KAAK,EACXnC,aAAa,EACb/C,KAAK,EAAED,WAAW,EAClBA,WAAW,EACXK,mBAAmB,EACnBwB,oBAAoB,EACpB3B,YAAY,CAEpB,CAAC;EAED,IAAIR,UAAU,IAAI,OAAOiB,YAAY,KAAK,QAAQ,EAAE;IAChD,oBACI9C,KAAA,CAAA0F,aAAA,CAAClE,OAAO;MAAC+F,IAAI,EAAE;QAAEC,IAAI,EAAE1E;MAAa,CAAE;MAAC2E,kBAAkB;IAAA,GACpDhC,YACI,CAAC;EAElB;EAEA,OAAOA,YAAY;AACvB,CACJ,CAAC;AAED/D,KAAK,CAACgG,WAAW,GAAG,OAAO;AAE3B,eAAehG,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Input.js","names":["React","forwardRef","useCallback","useContext","useEffect","useImperativeHandle","useMemo","useRef","useState","useTheme","useElementSize","AreaContext","Icon","StyledInput","StyledInputContent","StyledInputContentWrapper","StyledInputField","StyledInputIconWrapper","StyledInputLabel","StyledInputRightElement","StyledMotionInputClearIcon","StyledMotionInputLabelWrapper","ContentCardType","useCursorRepaint","Tooltip","useKeyboardFocusHighlighting","InputSize","Input","leftElement","inputMode","isDisabled","onBlur","onChange","onFocus","onKeyDown","onPaste","placeholder","color","rightElement","shouldShowOnlyBottomBorder","shouldRemainPlaceholder","shouldShowClearIcon","shouldShowCenteredContent","size","Medium","type","value","disabledHint","shouldUseAutoFocus","isInvalid","shouldPreventPlaceholderAnimation","id","shouldShowTransparentBackground","autoComplete","shouldEnableKeyboardHighlighting","ref","hasValue","setHasValue","placeholderWidth","setPlaceholderWidth","areaProvider","theme","inputRef","placeholderRef","placeholderSize","width","handleClearIconClick","current","target","handleClearIconKeyDown","event","key","preventDefault","focus","shouldShowBorder","props","style","backgroundColor","undefined","handleInputFieldChange","blur","internalColor","contentCardType","Error","Success","Warning","includes","shouldChangeColor","shouldShowKeyboardHighlighting","borderColor","border","placeholderColor","labelPosition","right","top","bottom","Small","left","inputElement","createElement","className","$isDisabled","$shouldShowTransparentBackground","$backgroundColor","$isInvalid","$shouldRoundRightCorners","$shouldShowOnlyBottomBorder","$size","$borderColor","$shouldShowKeyboardHighlighting","$color","$placeholderWidth","disabled","onClick","stopPropagation","autoFocus","$shouldShowCenteredContent","animate","opacity","fontSize","Number","initial","layout","transition","duration","tabIndex","role","icons","wrong","$isInline","item","text","shouldUseFullWidth","displayName"],"sources":["../../../../src/components/input/Input.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n CSSProperties,\n FocusEventHandler,\n forwardRef,\n HTMLInputTypeAttribute,\n KeyboardEventHandler,\n type ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { useElementSize } from '../../hooks/element';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport {\n StyledInput,\n StyledInputContent,\n StyledInputContentWrapper,\n StyledInputField,\n StyledInputIconWrapper,\n StyledInputLabel,\n StyledInputRightElement,\n StyledMotionInputClearIcon,\n StyledMotionInputLabelWrapper,\n} from './Input.styles';\nimport { ContentCardType } from '../../types/contentCard';\nimport { useCursorRepaint } from '../../hooks/resize';\nimport Tooltip from '../tooltip/Tooltip';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\n\nexport interface InputRef {\n focus: VoidFunction;\n blur: VoidFunction;\n}\n\ntype InputMode =\n | 'email'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'none'\n | 'numeric'\n | 'decimal'\n | undefined;\n\ntype AutoComplete =\n | 'on'\n | 'off'\n | 'name'\n | 'username'\n | 'email'\n | 'new-password'\n | 'current-password'\n | 'tel'\n | 'url'\n | 'street-address'\n | 'postal-code'\n | 'country'\n | undefined;\n\nexport enum InputSize {\n Small = 'small',\n Medium = 'medium',\n}\n\ninterface Color {\n placeholder?: CSSProperties['color'];\n border?: CSSProperties['borderColor'];\n}\n\nexport type InputProps = {\n /**\n * If set and the input is disabled, the input will display a tooltip with this message.\n */\n disabledHint?: string;\n /**\n * An element to be displayed on the left side of the input field\n */\n leftElement?: ReactNode;\n /**\n * The id of the input\n */\n id?: string;\n /**\n * Defines the input mode of the input\n */\n inputMode?: InputMode;\n /**\n * Defines the auto Complete of the input\n */\n autoComplete?: AutoComplete;\n /**\n * Disables the input so that it cannot be changed anymore\n */\n isDisabled?: boolean;\n /**\n * If true, the input field is marked as invalid\n */\n isInvalid?: boolean;\n /**\n * Function that is executed when the input field loses focus\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when content is pasted into the input field\n */\n onPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Placeholder for the input field\n */\n placeholder?: ReactNode;\n /**\n * Colors for different parts of the input. You can set the color of the placeholder and the border color.\n */\n color?: Color;\n /**\n * An element that should be displayed on the right side of the Input.\n */\n rightElement?: ReactElement;\n /**\n * Whether the placeholder animation should be prevented.\n */\n shouldPreventPlaceholderAnimation?: boolean;\n /**\n * Whether the placeholder should remain at its position if a value is typed.\n */\n shouldRemainPlaceholder?: boolean;\n /**\n * Whether the content should be displayed centered inside the input.\n */\n shouldShowCenteredContent?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the input field\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether only the bottom border should be displayed\n */\n shouldShowOnlyBottomBorder?: boolean;\n /**\n * Whether the background should be transparent.\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the input field is focused when the component is mounted\n */\n shouldUseAutoFocus?: boolean;\n /**\n * The size of the input field\n */\n size?: InputSize;\n /**\n * Input type set for an input element (e.g. 'text', 'number' or 'password')\n */\n type?: HTMLInputTypeAttribute;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst Input = forwardRef<InputRef, InputProps>(\n (\n {\n leftElement,\n inputMode,\n isDisabled,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onPaste,\n placeholder,\n color,\n rightElement,\n shouldShowOnlyBottomBorder,\n shouldRemainPlaceholder = false,\n shouldShowClearIcon = false,\n shouldShowCenteredContent = false,\n size = InputSize.Medium,\n type = 'text',\n value,\n disabledHint,\n shouldUseAutoFocus = false,\n isInvalid = false,\n shouldPreventPlaceholderAnimation = false,\n id,\n shouldShowTransparentBackground = false,\n autoComplete,\n shouldEnableKeyboardHighlighting,\n },\n ref,\n ) => {\n const [hasValue, setHasValue] = useState(typeof value === 'string' && value !== '');\n const [placeholderWidth, setPlaceholderWidth] = useState(0);\n\n const areaProvider = useContext(AreaContext);\n\n const theme = useTheme() as Theme;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const placeholderRef = useRef<HTMLLabelElement>(null);\n\n useCursorRepaint(inputRef);\n\n const placeholderSize = useElementSize(placeholderRef);\n\n useEffect(() => {\n if (placeholderSize && shouldShowOnlyBottomBorder) {\n setPlaceholderWidth(placeholderSize.width + 5);\n }\n }, [placeholderSize, shouldShowOnlyBottomBorder]);\n\n const handleClearIconClick = useCallback(() => {\n if (inputRef.current) {\n inputRef.current.value = '';\n\n setHasValue(false);\n\n if (typeof onChange === 'function') {\n onChange({ target: inputRef.current } as ChangeEvent<HTMLInputElement>);\n }\n }\n }, [onChange]);\n\n const handleClearIconKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClearIconClick();\n inputRef.current?.focus();\n }\n },\n [handleClearIconClick],\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const shouldShowBorder = rightElement?.props?.style?.backgroundColor === undefined;\n\n const handleInputFieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value !== '');\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [onChange],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => inputRef.current?.focus(),\n blur: () => inputRef.current?.blur(),\n }),\n [],\n );\n\n useEffect(() => {\n if (typeof value === 'string') {\n setHasValue(value !== '');\n }\n }, [value]);\n\n let backgroundColor: CSSProperties['backgroundColor'] | undefined;\n let internalColor: CSSProperties['color'] | undefined;\n\n if (shouldShowTransparentBackground) {\n backgroundColor = 'transparent';\n } else if (\n areaProvider.contentCardType &&\n [ContentCardType.Error, ContentCardType.Success, ContentCardType.Warning].includes(\n areaProvider.contentCardType,\n )\n ) {\n backgroundColor = 'white';\n internalColor = '#555';\n } else if (areaProvider.shouldChangeColor) {\n backgroundColor = theme['000'];\n }\n\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting && !isDisabled,\n );\n\n const borderColor = color?.border;\n const placeholderColor = color?.placeholder;\n\n const labelPosition = useMemo(() => {\n if (hasValue && !shouldRemainPlaceholder && !shouldPreventPlaceholderAnimation) {\n return shouldShowOnlyBottomBorder\n ? { right: 3, top: -1.5 }\n : { bottom: size === InputSize.Small ? -4 : -10, right: -6 };\n }\n\n return { left: -1, top: -1.5 };\n }, [\n hasValue,\n shouldPreventPlaceholderAnimation,\n shouldRemainPlaceholder,\n shouldShowOnlyBottomBorder,\n size,\n ]);\n\n const inputElement = useMemo(\n () => (\n <StyledInput className=\"beta-chayns-input\" $isDisabled={isDisabled}>\n <StyledInputContentWrapper\n $shouldShowTransparentBackground={shouldShowTransparentBackground}\n $backgroundColor={backgroundColor}\n $isInvalid={isInvalid}\n $shouldRoundRightCorners={shouldShowBorder}\n $shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n $size={size}\n $borderColor={borderColor}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n >\n {leftElement && (\n <StyledInputIconWrapper>{leftElement}</StyledInputIconWrapper>\n )}\n <StyledInputContent\n $shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n >\n <StyledInputField\n $color={internalColor}\n $placeholderWidth={placeholderWidth}\n id={id}\n disabled={isDisabled}\n onBlur={onBlur}\n onChange={handleInputFieldChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n onPaste={onPaste}\n ref={inputRef}\n type={type}\n value={value}\n autoFocus={shouldUseAutoFocus}\n inputMode={inputMode}\n autoComplete={autoComplete}\n $isInvalid={isInvalid}\n $shouldShowCenteredContent={shouldShowCenteredContent}\n />\n <StyledMotionInputLabelWrapper\n animate={\n shouldPreventPlaceholderAnimation\n ? {\n opacity: hasValue ? 0 : 1,\n }\n : {\n fontSize:\n hasValue &&\n !shouldShowOnlyBottomBorder &&\n !shouldRemainPlaceholder\n ? '9px'\n : `${Number(theme.fontSize)}px`,\n }\n }\n initial={false}\n layout\n ref={placeholderRef}\n style={{ ...labelPosition }}\n transition={{\n type: 'tween',\n duration: shouldPreventPlaceholderAnimation ? 0 : 0.1,\n }}\n >\n <StyledInputLabel $color={placeholderColor} $isInvalid={isInvalid}>\n {placeholder}\n </StyledInputLabel>\n </StyledMotionInputLabelWrapper>\n </StyledInputContent>\n {shouldShowClearIcon && (\n <StyledMotionInputClearIcon\n $shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n $size={size}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n animate={{ opacity: hasValue ? 1 : 0 }}\n initial={false}\n onClick={handleClearIconClick}\n onKeyDown={handleClearIconKeyDown}\n tabIndex={\n shouldEnableKeyboardHighlighting && hasValue && !isDisabled\n ? 0\n : -1\n }\n role={shouldEnableKeyboardHighlighting ? 'button' : undefined}\n aria-hidden={!hasValue}\n transition={{ type: 'tween' }}\n >\n <Icon\n icons={['fa fa-times']}\n color={isInvalid ? theme.wrong : undefined}\n />\n </StyledMotionInputClearIcon>\n )}\n {rightElement && shouldShowBorder && (\n <StyledInputRightElement $isInline>\n {rightElement}\n </StyledInputRightElement>\n )}\n </StyledInputContentWrapper>\n {rightElement && !shouldShowBorder && (\n <StyledInputRightElement>{rightElement}</StyledInputRightElement>\n )}\n </StyledInput>\n ),\n [\n isDisabled,\n shouldShowTransparentBackground,\n backgroundColor,\n isInvalid,\n shouldShowBorder,\n shouldShowOnlyBottomBorder,\n size,\n leftElement,\n internalColor,\n placeholderWidth,\n id,\n onBlur,\n handleInputFieldChange,\n onFocus,\n onKeyDown,\n onPaste,\n type,\n value,\n shouldUseAutoFocus,\n inputMode,\n autoComplete,\n shouldShowCenteredContent,\n shouldPreventPlaceholderAnimation,\n hasValue,\n shouldRemainPlaceholder,\n theme.fontSize,\n theme.wrong,\n labelPosition,\n borderColor,\n placeholderColor,\n placeholder,\n shouldShowClearIcon,\n handleClearIconClick,\n handleClearIconKeyDown,\n rightElement,\n shouldEnableKeyboardHighlighting,\n shouldShowKeyboardHighlighting,\n ],\n );\n\n if (isDisabled && typeof disabledHint === 'string') {\n return (\n <Tooltip item={{ text: disabledHint }} shouldUseFullWidth>\n {inputElement}\n </Tooltip>\n );\n }\n\n return inputElement;\n },\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"mappings":"AAAA,OAAOA,KAAK,IAKRC,UAAU,EAKVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SA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EACtB9C,OAAO,EACPC,SAAS,EACTC,OAAO,EACPU,IAAI,EACJC,KAAK,EACLE,kBAAkB,EAClBnB,SAAS,EACTwB,YAAY,EACZX,yBAAyB,EACzBQ,iCAAiC,EACjCM,QAAQ,EACRhB,uBAAuB,EACvBqB,KAAK,CAAC0D,QAAQ,EACd1D,KAAK,CAACmE,KAAK,EACXpC,aAAa,EACbH,WAAW,EACXE,gBAAgB,EAChBvD,WAAW,EACXK,mBAAmB,EACnByB,oBAAoB,EACpBG,sBAAsB,EACtB/B,YAAY,EACZgB,gCAAgC,EAChCkC,8BAA8B,CAEtC,CAAC;EAED,IAAI1D,UAAU,IAAI,OAAOiB,YAAY,KAAK,QAAQ,EAAE;IAChD,oBACI/C,KAAA,CAAAmG,aAAA,CAAC3E,OAAO;MAAC0G,IAAI,EAAE;QAAEC,IAAI,EAAEpF;MAAa,CAAE;MAACqF,kBAAkB;IAAA,GACpDlC,YACI,CAAC;EAElB;EAEA,OAAOA,YAAY;AACvB,CACJ,CAAC;AAEDvE,KAAK,CAAC0G,WAAW,GAAG,OAAO;AAE3B,eAAe1G,KAAK","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import { motion } from 'motion/react';
2
2
  import styled, { css } from 'styled-components';
3
+ import { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';
3
4
  export const StyledInput = styled.div`
4
5
  opacity: ${({
5
6
  $isDisabled
@@ -89,6 +90,15 @@ export const StyledInputContentWrapper = styled.div`
89
90
  border-right: none;
90
91
  `;
91
92
  }}
93
+
94
+ ${({
95
+ $shouldShowKeyboardHighlighting
96
+ }) => $shouldShowKeyboardHighlighting && css`
97
+ &:focus-within {
98
+ transition: none;
99
+ ${keyboardFocusHighlightingRingCss}
100
+ }
101
+ `}
92
102
  `;
93
103
  export const StyledInputContent = styled.div`
94
104
  display: flex;
@@ -161,6 +171,15 @@ export const StyledMotionInputClearIcon = styled(motion.div)`
161
171
  width: ${({
162
172
  $size
163
173
  }) => $size === 'medium' ? '40px' : '30px'};
174
+
175
+ ${({
176
+ $shouldShowKeyboardHighlighting
177
+ }) => $shouldShowKeyboardHighlighting && css`
178
+ &:focus-visible {
179
+ transition: none;
180
+ ${keyboardFocusHighlightingRingCss}
181
+ }
182
+ `}
164
183
  `;
165
184
  export const StyledInputIconWrapper = styled.div`
166
185
  align-items: baseline;
@@ -170,9 +189,20 @@ export const StyledInputIconWrapper = styled.div`
170
189
  margin-left: 10px;
171
190
  `;
172
191
  export const StyledInputRightElement = styled.div`
173
- border-bottom-right-radius: 3px;
174
- border-top-right-radius: 3px;
175
- overflow: hidden;
176
192
  flex: 0 0 auto;
193
+ overflow: hidden;
194
+ min-width: 28px;
195
+ text-align: center;
196
+
197
+ ${({
198
+ $isInline
199
+ }) => !$isInline && css`
200
+ border-bottom-right-radius: 3px;
201
+ border-top-right-radius: 3px;
202
+ `}
203
+
204
+ .beta-chayns-icon:focus-visible::after {
205
+ transform: translate(-50%, -50%) scale(0.78);
206
+ }
177
207
  `;
178
208
  //# sourceMappingURL=Input.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.styles.js","names":["motion","styled","css","StyledInput","div","$isDisabled","StyledInputContentWrapper","theme","$backgroundColor","$isInvalid","$shouldShowTransparentBackground","$borderColor","wrong","colorMode","$size","$shouldShowOnlyBottomBorder","$shouldRoundRightCorners","StyledInputContent","StyledInputField","input","$color","text","$placeholderWidth","$shouldShowCenteredContent","StyledMotionInputLabelWrapper","label","StyledMotionInputElement","StyledInputLabel","StyledMotionInputClearIcon","StyledInputIconWrapper","StyledInputRightElement"],"sources":["../../../../src/components/input/Input.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { InputSize } from './Input';\nimport { CSSProperties } from 'react';\n\ntype StyledInputProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledInput = styled.div<StyledInputProps>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n display: flex;\n width: 100%;\n`;\n\ntype StyledInputContentWrapperProps = WithTheme<{\n $backgroundColor?: CSSProperties['backgroundColor'];\n $shouldRoundRightCorners: boolean;\n $shouldShowOnlyBottomBorder?: boolean;\n $isInvalid?: boolean;\n $size: InputSize;\n $shouldShowTransparentBackground: boolean;\n $borderColor?: CSSProperties['borderColor'];\n}>;\n\nexport const StyledInputContentWrapper = styled.div<StyledInputContentWrapperProps>`\n align-items: center;\n background-color: ${({ theme, $backgroundColor }: StyledInputContentWrapperProps) =>\n $backgroundColor ?? theme['100']};\n border: 1px solid transparent;\n color: ${({ theme }: StyledInputContentWrapperProps) => theme['006']};\n display: flex;\n justify-content: space-between;\n width: 100%;\n transition: opacity 0.3s ease;\n\n ${({ theme, $isInvalid, $shouldShowTransparentBackground, $borderColor }) => {\n if ($borderColor)\n return css`\n border-color: ${$borderColor};\n `;\n if ($isInvalid) {\n return css`\n border-color: ${theme.wrong};\n `;\n }\n\n if ($shouldShowTransparentBackground) {\n if (theme.colorMode === 'dark') {\n return css`\n border-color: rgba(255, 255, 255, 0.5);\n `;\n }\n\n return css`\n border-color: rgba(0, 0, 0, 0.5);\n `;\n }\n\n return css`\n border-color: rgba(160, 160, 160, 0.3);\n `;\n }}\n\n ${({ $size }) =>\n $size === 'small' &&\n css`\n height: 32px;\n `}\n\n ${({ $shouldShowOnlyBottomBorder, $size }) =>\n !$shouldShowOnlyBottomBorder &&\n css`\n min-height: ${$size === 'medium' ? '42px' : '32px'};\n `}\n\n ${({ $shouldRoundRightCorners, $shouldShowOnlyBottomBorder, theme }) => {\n if ($shouldShowOnlyBottomBorder) {\n return css`\n border-top: none;\n border-right: none;\n border-left: none;\n background-color: transparent;\n border-color: ${theme['408']};\n `;\n }\n\n if ($shouldRoundRightCorners) {\n return css`\n border-radius: 3px;\n `;\n }\n\n return css`\n border-bottom-left-radius: 3px;\n border-top-left-radius: 3px;\n border-right: none;\n `;\n }}\n`;\n\ntype StyledInputContentProps = WithTheme<{ $shouldShowOnlyBottomBorder?: boolean }>;\n\nexport const StyledInputContent = styled.div<StyledInputContentProps>`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n margin: ${({ $shouldShowOnlyBottomBorder }) =>\n !$shouldShowOnlyBottomBorder ? '8px 10px' : '4px 0'};\n position: relative;\n`;\n\ntype StyledInputFieldProps = WithTheme<{\n $color?: CSSProperties['color'];\n $isInvalid?: boolean;\n $placeholderWidth: number;\n $shouldShowCenteredContent: boolean;\n}>;\n\nexport const StyledInputField = styled.input<StyledInputFieldProps>`\n background: none;\n border: none;\n color: ${({ theme, $color, $isInvalid }: StyledInputFieldProps) =>\n $color ?? ($isInvalid ? theme.wrong : theme.text)};\n padding: 0;\n width: ${({ $placeholderWidth }) => `calc(100% - ${$placeholderWidth}px)`};\n line-height: 1em;\n\n ${({ $shouldShowCenteredContent }) =>\n $shouldShowCenteredContent &&\n css`\n text-align: center;\n `}\n`;\n\nexport const StyledMotionInputLabelWrapper = styled(motion.label)`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n max-width: 100%;\n`;\n\nexport const StyledMotionInputElement = styled(motion.div)`\n display: flex;\n`;\n\ntype StyledInputLabelProps = WithTheme<{\n $color?: CSSProperties['color'];\n $isInvalid?: boolean;\n}>;\n\nexport const StyledInputLabel = styled.label<StyledInputLabelProps>`\n line-height: 1.3;\n pointer-events: none;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ${({ theme, $color, $isInvalid }: StyledInputLabelProps) =>\n $color ?? ($isInvalid ? theme.wrong : `rgba(${theme['text-rgb'] ?? ''}, 0.45)`)};\n`;\n\ntype StyledMotionInputClearIconProps = WithTheme<{\n $shouldShowOnlyBottomBorder?: boolean;\n $size: InputSize;\n}>;\n\nexport const StyledMotionInputClearIcon = styled(motion.div)<StyledMotionInputClearIconProps>`\n align-items: center;\n border-left: ${({ $shouldShowOnlyBottomBorder }) =>\n $shouldShowOnlyBottomBorder ? 'none' : '1px solid rgba(160, 160, 160, 0.3)'};\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n height: ${({ $size }) => ($size === 'medium' ? '40px' : '30px')};\n justify-content: center;\n width: ${({ $size }) => ($size === 'medium' ? '40px' : '30px')};\n`;\n\nexport const StyledInputIconWrapper = styled.div`\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n margin-left: 10px;\n`;\n\nexport const StyledInputRightElement = styled.div`\n border-bottom-right-radius: 3px;\n border-top-right-radius: 3px;\n overflow: hidden;\n flex: 0 0 auto;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAO/C,OAAO,MAAMC,WAAW,GAAGF,MAAM,CAACG,GAAqB;AACvD,eAAe,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D;AACA;AACA,CAAC;AAYD,OAAO,MAAMC,yBAAyB,GAAGL,MAAM,CAACG,GAAmC;AACnF;AACA,wBAAwB,CAAC;EAAEG,KAAK;EAAEC;AAAiD,CAAC,KAC5EA,gBAAgB,IAAID,KAAK,CAAC,KAAK,CAAC;AACxC;AACA,aAAa,CAAC;EAAEA;AAAsC,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC;EAAEA,KAAK;EAAEE,UAAU;EAAEC,gCAAgC;EAAEC;AAAa,CAAC,KAAK;EACzE,IAAIA,YAAY,EACZ,OAAOT,GAAG;AACtB,gCAAgCS,YAAY;AAC5C,aAAa;EACL,IAAIF,UAAU,EAAE;IACZ,OAAOP,GAAG;AACtB,gCAAgCK,KAAK,CAACK,KAAK;AAC3C,aAAa;EACL;EAEA,IAAIF,gCAAgC,EAAE;IAClC,IAAIH,KAAK,CAACM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M,CAAC;EAAEC;AAA2B,CAAC,KAC7BA,0BAA0B,IAC1BrB,GAAG;AACX;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMsB,6BAA6B,GAAGvB,MAAM,CAACD,MAAM,CAACyB,KAAK,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,wBAAwB,GAAGzB,MAAM,CAACD,MAAM,CAACI,GAAG,CAAC;AAC1D;AACA,CAAC;AAOD,OAAO,MAAMuB,gBAAgB,GAAG1B,MAAM,CAACwB,KAA4B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,CAAC;EAAElB,KAAK;EAAEa,MAAM;EAAEX;AAAkC,CAAC,KAC1DW,MAAM,KAAKX,UAAU,GAAGF,KAAK,CAACK,KAAK,GAAG,QAAQL,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC;AACvF,CAAC;AAOD,OAAO,MAAMqB,0BAA0B,GAAG3B,MAAM,CAACD,MAAM,CAACI,GAAG,CAAkC;AAC7F;AACA,mBAAmB,CAAC;EAAEW;AAA4B,CAAC,KAC3CA,2BAA2B,GAAG,MAAM,GAAG,oCAAoC;AACnF;AACA;AACA;AACA,cAAc,CAAC;EAAED;AAAM,CAAC,KAAMA,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAO;AACnE;AACA,aAAa,CAAC;EAAEA;AAAM,CAAC,KAAMA,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAO;AAClE,CAAC;AAED,OAAO,MAAMe,sBAAsB,GAAG5B,MAAM,CAACG,GAAG;AAChD;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAM0B,uBAAuB,GAAG7B,MAAM,CAACG,GAAG;AACjD;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Input.styles.js","names":["motion","styled","css","keyboardFocusHighlightingRingCss","StyledInput","div","$isDisabled","StyledInputContentWrapper","theme","$backgroundColor","$isInvalid","$shouldShowTransparentBackground","$borderColor","wrong","colorMode","$size","$shouldShowOnlyBottomBorder","$shouldRoundRightCorners","$shouldShowKeyboardHighlighting","StyledInputContent","StyledInputField","input","$color","text","$placeholderWidth","$shouldShowCenteredContent","StyledMotionInputLabelWrapper","label","StyledMotionInputElement","StyledInputLabel","StyledMotionInputClearIcon","StyledInputIconWrapper","StyledInputRightElement","$isInline"],"sources":["../../../../src/components/input/Input.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { InputSize } from './Input';\nimport { CSSProperties } from 'react';\nimport { keyboardFocusHighlightingRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledInputProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledInput = styled.div<StyledInputProps>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n display: flex;\n width: 100%;\n`;\n\ntype StyledInputContentWrapperProps = WithTheme<{\n $backgroundColor?: CSSProperties['backgroundColor'];\n $shouldRoundRightCorners: boolean;\n $shouldShowOnlyBottomBorder?: boolean;\n $isInvalid?: boolean;\n $size: InputSize;\n $shouldShowTransparentBackground: boolean;\n $borderColor?: CSSProperties['borderColor'];\n $shouldShowKeyboardHighlighting: boolean;\n}>;\n\nexport const StyledInputContentWrapper = styled.div<StyledInputContentWrapperProps>`\n align-items: center;\n background-color: ${({ theme, $backgroundColor }: StyledInputContentWrapperProps) =>\n $backgroundColor ?? theme['100']};\n border: 1px solid transparent;\n color: ${({ theme }: StyledInputContentWrapperProps) => theme['006']};\n display: flex;\n justify-content: space-between;\n width: 100%;\n transition: opacity 0.3s ease;\n\n ${({ theme, $isInvalid, $shouldShowTransparentBackground, $borderColor }) => {\n if ($borderColor)\n return css`\n border-color: ${$borderColor};\n `;\n if ($isInvalid) {\n return css`\n border-color: ${theme.wrong};\n `;\n }\n\n if ($shouldShowTransparentBackground) {\n if (theme.colorMode === 'dark') {\n return css`\n border-color: rgba(255, 255, 255, 0.5);\n `;\n }\n\n return css`\n border-color: rgba(0, 0, 0, 0.5);\n `;\n }\n\n return css`\n border-color: rgba(160, 160, 160, 0.3);\n `;\n }}\n\n ${({ $size }) =>\n $size === 'small' &&\n css`\n height: 32px;\n `}\n\n ${({ $shouldShowOnlyBottomBorder, $size }) =>\n !$shouldShowOnlyBottomBorder &&\n css`\n min-height: ${$size === 'medium' ? '42px' : '32px'};\n `}\n\n ${({ $shouldRoundRightCorners, $shouldShowOnlyBottomBorder, theme }) => {\n if ($shouldShowOnlyBottomBorder) {\n return css`\n border-top: none;\n border-right: none;\n border-left: none;\n background-color: transparent;\n border-color: ${theme['408']};\n `;\n }\n\n if ($shouldRoundRightCorners) {\n return css`\n border-radius: 3px;\n `;\n }\n\n return css`\n border-bottom-left-radius: 3px;\n border-top-left-radius: 3px;\n border-right: none;\n `;\n }}\n\n ${({ $shouldShowKeyboardHighlighting }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-within {\n transition: none;\n ${keyboardFocusHighlightingRingCss}\n }\n `}\n`;\n\ntype StyledInputContentProps = WithTheme<{ $shouldShowOnlyBottomBorder?: boolean }>;\n\nexport const StyledInputContent = styled.div<StyledInputContentProps>`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n margin: ${({ $shouldShowOnlyBottomBorder }) =>\n !$shouldShowOnlyBottomBorder ? '8px 10px' : '4px 0'};\n position: relative;\n`;\n\ntype StyledInputFieldProps = WithTheme<{\n $color?: CSSProperties['color'];\n $isInvalid?: boolean;\n $placeholderWidth: number;\n $shouldShowCenteredContent: boolean;\n}>;\n\nexport const StyledInputField = styled.input<StyledInputFieldProps>`\n background: none;\n border: none;\n color: ${({ theme, $color, $isInvalid }: StyledInputFieldProps) =>\n $color ?? ($isInvalid ? theme.wrong : theme.text)};\n padding: 0;\n width: ${({ $placeholderWidth }) => `calc(100% - ${$placeholderWidth}px)`};\n line-height: 1em;\n\n ${({ $shouldShowCenteredContent }) =>\n $shouldShowCenteredContent &&\n css`\n text-align: center;\n `}\n`;\n\nexport const StyledMotionInputLabelWrapper = styled(motion.label)`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n max-width: 100%;\n`;\n\nexport const StyledMotionInputElement = styled(motion.div)`\n display: flex;\n`;\n\ntype StyledInputLabelProps = WithTheme<{\n $color?: CSSProperties['color'];\n $isInvalid?: boolean;\n}>;\n\nexport const StyledInputLabel = styled.label<StyledInputLabelProps>`\n line-height: 1.3;\n pointer-events: none;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: ${({ theme, $color, $isInvalid }: StyledInputLabelProps) =>\n $color ?? ($isInvalid ? theme.wrong : `rgba(${theme['text-rgb'] ?? ''}, 0.45)`)};\n`;\n\ntype StyledMotionInputClearIconProps = WithTheme<{\n $shouldShowOnlyBottomBorder?: boolean;\n $size: InputSize;\n $shouldShowKeyboardHighlighting: boolean;\n}>;\n\nexport const StyledMotionInputClearIcon = styled(motion.div)<StyledMotionInputClearIconProps>`\n align-items: center;\n border-left: ${({ $shouldShowOnlyBottomBorder }) =>\n $shouldShowOnlyBottomBorder ? 'none' : '1px solid rgba(160, 160, 160, 0.3)'};\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n height: ${({ $size }) => ($size === 'medium' ? '40px' : '30px')};\n justify-content: center;\n width: ${({ $size }) => ($size === 'medium' ? '40px' : '30px')};\n\n ${({ $shouldShowKeyboardHighlighting }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-visible {\n transition: none;\n ${keyboardFocusHighlightingRingCss}\n }\n `}\n`;\n\nexport const StyledInputIconWrapper = styled.div`\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n margin-left: 10px;\n`;\n\ntype StyledInputRightElementProps = {\n $isInline?: boolean;\n};\n\nexport const StyledInputRightElement = styled.div<StyledInputRightElementProps>`\n flex: 0 0 auto;\n overflow: hidden;\n min-width: 28px;\n text-align: center;\n\n ${({ $isInline }) =>\n !$isInline &&\n css`\n border-bottom-right-radius: 3px;\n border-top-right-radius: 3px;\n `}\n\n .beta-chayns-icon:focus-visible::after {\n transform: translate(-50%, -50%) scale(0.78);\n }\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAI/C,SAASC,gCAAgC,QAAQ,8CAA8C;AAI/F,OAAO,MAAMC,WAAW,GAAGH,MAAM,CAACI,GAAqB;AACvD,eAAe,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D;AACA;AACA,CAAC;AAaD,OAAO,MAAMC,yBAAyB,GAAGN,MAAM,CAACI,GAAmC;AACnF;AACA,wBAAwB,CAAC;EAAEG,KAAK;EAAEC;AAAiD,CAAC,KAC5EA,gBAAgB,IAAID,KAAK,CAAC,KAAK,CAAC;AACxC;AACA,aAAa,CAAC;EAAEA;AAAsC,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC;EAAEA,KAAK;EAAEE,UAAU;EAAEC,gCAAgC;EAAEC;AAAa,CAAC,KAAK;EACzE,IAAIA,YAAY,EACZ,OAAOV,GAAG;AACtB,gCAAgCU,YAAY;AAC5C,aAAa;EACL,IAAIF,UAAU,EAAE;IACZ,OAAOR,GAAG;AACtB,gCAAgCM,KAAK,CAACK,KAAK;AAC3C,aAAa;EACL;EAEA,IAAIF,gCAAgC,EAAE;IAClC,IAAIH,KAAK,CAACM,SAAS,KAAK,MAAM,EAAE;MAC5B,OAAOZ,GAAG;AAC1B;AACA,iBAAiB;IACL;IAEA,OAAOA,GAAG;AACtB;AACA,aAAa;EACL;EAEA,OAAOA,GAAG;AAClB;AACA,SAAS;AACL,CAAC;A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,CAAC;EAAE4B;AAAU,CAAC,KACZ,CAACA,SAAS,IACV/B,GAAG;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,24 +1,39 @@
1
1
  import { c as _c } from "react-compiler-runtime";
2
2
  import { AnimatePresence, MotionConfig } from 'motion/react';
3
3
  import React, { useCallback, useMemo, useState } from 'react';
4
+ import { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';
5
+ import { useUuid } from '../../hooks/uuid';
4
6
  import { shouldShowExpandIndicator } from './List.utils';
5
7
  export const ListContext = /*#__PURE__*/React.createContext({
6
8
  isAnyItemExpandable: false,
7
9
  isWrapped: false,
8
10
  openItemUuid: undefined,
9
- updateOpenItemUuid: () => {}
11
+ updateOpenItemUuid: () => {},
12
+ shouldEnableKeyboardHighlighting: false,
13
+ listGroupUuid: undefined,
14
+ listItemUuids: undefined,
15
+ registerListItemUuid: undefined,
16
+ unregisterListItemUuid: undefined,
17
+ activeListItemUuid: undefined,
18
+ updateActiveListItemUuid: undefined
10
19
  });
11
20
  ListContext.displayName = 'ListContext';
12
21
  const List = t0 => {
13
22
  "use memo";
14
23
 
15
- const $ = _c(13);
24
+ const $ = _c(24);
16
25
  const {
17
26
  children,
18
- isWrapped: t1
27
+ isWrapped: t1,
28
+ shouldEnableKeyboardHighlighting
19
29
  } = t0;
20
30
  const isWrapped = t1 === undefined ? false : t1;
31
+ const colorScheme = useColorScheme();
32
+ const shouldEnableKeyboardHighlightingEffective = shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;
21
33
  const [openItemUuid, setOpenItemUuid] = useState(undefined);
34
+ const [listItemUuids, setListItemUuids] = useState();
35
+ const [activeListItemUuid, setActiveListItemUuid] = useState(undefined);
36
+ const listGroupUuid = useUuid();
22
37
  let t2;
23
38
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24
39
  t2 = (uuid, t3) => {
@@ -38,63 +53,134 @@ const List = t0 => {
38
53
  }
39
54
  const updateOpenItemUuid = t2;
40
55
  let t3;
41
- if ($[1] !== children) {
42
- t3 = shouldShowExpandIndicator(children);
43
- $[1] = children;
56
+ if ($[1] !== listGroupUuid) {
57
+ t3 = uuids => {
58
+ if (typeof document === "undefined") {
59
+ return uuids;
60
+ }
61
+ const domOrderedUuids = Array.from(document.querySelectorAll(`[data-uuid^="${listGroupUuid}---"]`)).map(_temp).filter(_temp2);
62
+ return domOrderedUuids.filter(uuid_1 => uuids.includes(uuid_1));
63
+ };
64
+ $[1] = listGroupUuid;
44
65
  $[2] = t3;
45
66
  } else {
46
67
  t3 = $[2];
47
68
  }
69
+ const sortListItemUuidsByDom = t3;
48
70
  let t4;
49
- if ($[3] !== isWrapped || $[4] !== openItemUuid || $[5] !== t3) {
50
- t4 = {
51
- isAnyItemExpandable: t3,
71
+ if ($[3] !== sortListItemUuidsByDom) {
72
+ t4 = uuid_2 => {
73
+ setListItemUuids(t5 => {
74
+ const currentListItemUuids = t5 === undefined ? [] : t5;
75
+ const nextListItemUuids = currentListItemUuids.includes(uuid_2) ? currentListItemUuids : [...currentListItemUuids, uuid_2];
76
+ return sortListItemUuidsByDom(nextListItemUuids);
77
+ });
78
+ };
79
+ $[3] = sortListItemUuidsByDom;
80
+ $[4] = t4;
81
+ } else {
82
+ t4 = $[4];
83
+ }
84
+ const registerListItemUuid = t4;
85
+ let t5;
86
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
87
+ t5 = uuid_3 => {
88
+ setListItemUuids(t6 => {
89
+ const currentListItemUuids_0 = t6 === undefined ? [] : t6;
90
+ return currentListItemUuids_0.filter(currentUuid => currentUuid !== uuid_3);
91
+ });
92
+ };
93
+ $[5] = t5;
94
+ } else {
95
+ t5 = $[5];
96
+ }
97
+ const unregisterListItemUuid = t5;
98
+ let t6;
99
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
100
+ t6 = uuid_4 => {
101
+ setActiveListItemUuid(uuid_4);
102
+ };
103
+ $[6] = t6;
104
+ } else {
105
+ t6 = $[6];
106
+ }
107
+ const updateActiveListItemUuid = t6;
108
+ let t7;
109
+ if ($[7] !== children) {
110
+ t7 = shouldShowExpandIndicator(children);
111
+ $[7] = children;
112
+ $[8] = t7;
113
+ } else {
114
+ t7 = $[8];
115
+ }
116
+ let t8;
117
+ if ($[9] !== activeListItemUuid || $[10] !== isWrapped || $[11] !== listGroupUuid || $[12] !== listItemUuids || $[13] !== openItemUuid || $[14] !== registerListItemUuid || $[15] !== shouldEnableKeyboardHighlightingEffective || $[16] !== t7) {
118
+ t8 = {
119
+ isAnyItemExpandable: t7,
52
120
  isWrapped,
53
121
  openItemUuid,
54
- updateOpenItemUuid
122
+ updateOpenItemUuid,
123
+ shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlightingEffective,
124
+ listGroupUuid,
125
+ listItemUuids,
126
+ registerListItemUuid,
127
+ unregisterListItemUuid,
128
+ activeListItemUuid,
129
+ updateActiveListItemUuid
55
130
  };
56
- $[3] = isWrapped;
57
- $[4] = openItemUuid;
58
- $[5] = t3;
59
- $[6] = t4;
131
+ $[9] = activeListItemUuid;
132
+ $[10] = isWrapped;
133
+ $[11] = listGroupUuid;
134
+ $[12] = listItemUuids;
135
+ $[13] = openItemUuid;
136
+ $[14] = registerListItemUuid;
137
+ $[15] = shouldEnableKeyboardHighlightingEffective;
138
+ $[16] = t7;
139
+ $[17] = t8;
60
140
  } else {
61
- t4 = $[6];
141
+ t8 = $[17];
62
142
  }
63
- const providerValue = t4;
64
- let t5;
65
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
66
- t5 = {
143
+ const providerValue = t8;
144
+ let t9;
145
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
146
+ t9 = {
67
147
  type: "tween"
68
148
  };
69
- $[7] = t5;
149
+ $[18] = t9;
70
150
  } else {
71
- t5 = $[7];
151
+ t9 = $[18];
72
152
  }
73
- let t6;
74
- if ($[8] !== children) {
75
- t6 = /*#__PURE__*/React.createElement(MotionConfig, {
76
- transition: t5
153
+ let t10;
154
+ if ($[19] !== children) {
155
+ t10 = /*#__PURE__*/React.createElement(MotionConfig, {
156
+ transition: t9
77
157
  }, /*#__PURE__*/React.createElement(AnimatePresence, {
78
158
  initial: false
79
159
  }, children));
80
- $[8] = children;
81
- $[9] = t6;
160
+ $[19] = children;
161
+ $[20] = t10;
82
162
  } else {
83
- t6 = $[9];
163
+ t10 = $[20];
84
164
  }
85
- let t7;
86
- if ($[10] !== providerValue || $[11] !== t6) {
87
- t7 = /*#__PURE__*/React.createElement(ListContext.Provider, {
165
+ let t11;
166
+ if ($[21] !== providerValue || $[22] !== t10) {
167
+ t11 = /*#__PURE__*/React.createElement(ListContext.Provider, {
88
168
  value: providerValue
89
- }, t6);
90
- $[10] = providerValue;
91
- $[11] = t6;
92
- $[12] = t7;
169
+ }, t10);
170
+ $[21] = providerValue;
171
+ $[22] = t10;
172
+ $[23] = t11;
93
173
  } else {
94
- t7 = $[12];
174
+ t11 = $[23];
95
175
  }
96
- return t7;
176
+ return t11;
97
177
  };
98
178
  List.displayName = 'List';
99
179
  export default List;
180
+ function _temp(element) {
181
+ return element.getAttribute("data-uuid")?.split("---")[1];
182
+ }
183
+ function _temp2(uuid_0) {
184
+ return Boolean(uuid_0);
185
+ }
100
186
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","names":["AnimatePresence","MotionConfig","React","useCallback","useMemo","useState","shouldShowExpandIndicator","ListContext","createContext","isAnyItemExpandable","isWrapped","openItemUuid","undefined","updateOpenItemUuid","displayName","List","t0","$","_c","children","t1","setOpenItemUuid","t2","Symbol","for","uuid","t3","shouldOnlyOpen","currentOpenItemUuid","t4","providerValue","t5","type","t6","createElement","transition","initial","t7","Provider"],"sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'motion/react';\nimport React, { FC, ReactNode, useCallback, useMemo, useState } from 'react';\nimport { shouldShowExpandIndicator } from './List.utils';\n\ninterface IListContext {\n isAnyItemExpandable: boolean;\n isWrapped: boolean;\n openItemUuid: string | undefined;\n updateOpenItemUuid: (uuid: string, options?: { shouldOnlyOpen?: boolean }) => void;\n}\n\nexport const ListContext = React.createContext<IListContext>({\n isAnyItemExpandable: false,\n isWrapped: false,\n openItemUuid: undefined,\n updateOpenItemUuid: () => {},\n});\n\nListContext.displayName = 'ListContext';\n\ntype ListProps = {\n /**\n * The items of the list\n */\n children: ReactNode;\n /**\n * This value must be set for nested AccordionGroup components. This adjusts the style of\n * the head and the padding of the content accordions.\n */\n isWrapped?: boolean;\n};\n\nconst List: FC<ListProps> = ({ children, isWrapped = false }) => {\n 'use memo';\n\n const [openItemUuid, setOpenItemUuid] = useState<IListContext['openItemUuid']>(undefined);\n\n const updateOpenItemUuid = useCallback<IListContext['updateOpenItemUuid']>(\n (uuid, { shouldOnlyOpen } = {}) => {\n setOpenItemUuid((currentOpenItemUuid) => {\n if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {\n return undefined;\n }\n\n return uuid;\n });\n },\n [setOpenItemUuid],\n );\n\n const providerValue = useMemo<IListContext>(\n () => ({\n isAnyItemExpandable: shouldShowExpandIndicator(children),\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n }),\n [children, isWrapped, openItemUuid, updateOpenItemUuid],\n );\n\n return (\n <ListContext.Provider value={providerValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AnimatePresence initial={false}>{children}</AnimatePresence>\n </MotionConfig>\n </ListContext.Provider>\n );\n};\n\nList.displayName = 'List';\n\nexport default List;\n"],"mappings":";AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAC5D,OAAOC,KAAK,IAAmBC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5E,SAASC,yBAAyB,QAAQ,cAAc;AASxD,OAAO,MAAMC,WAAW,gBAAGL,KAAK,CAACM,aAAa,CAAe;EACzDC,mBAAmB,EAAE,KAAK;EAC1BC,SAA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ouldShowExpandIndicator","ListContext","createContext","isAnyItemExpandable","isWrapped","openItemUuid","undefined","updateOpenItemUuid","shouldEnableKeyboardHighlighting","listGroupUuid","listItemUuids","registerListItemUuid","unregisterListItemUuid","activeListItemUuid","updateActiveListItemUuid","displayName","List","t0","$","_c","children","t1","colorScheme","shouldEnableKeyboardHighlightingEffective","setOpenItemUuid","setListItemUuids","setActiveListItemUuid","t2","Symbol","for","uuid","t3","shouldOnlyOpen","currentOpenItemUuid","uuids","document","domOrderedUuids","Array","from","querySelectorAll","map","_temp","filter","_temp2","uuid_1","includes","sortListItemUuidsByDom","t4","uuid_2","t5","currentListItemUuids","nextListItemUuids","uuid_3","t6","currentListItemUuids_0","currentUuid","uuid_4","t7","t8","providerValue","t9","type","t10","createElement","transition","initial","t11","Provider","element","getAttribute","split","uuid_0","Boolean"],"sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'motion/react';\nimport React, { FC, ReactNode, useCallback, useMemo, useState } from 'react';\nimport { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { useUuid } from '../../hooks/uuid';\nimport { shouldShowExpandIndicator } from './List.utils';\n\ninterface IListContext {\n isAnyItemExpandable: boolean;\n isWrapped: boolean;\n openItemUuid: string | undefined;\n updateOpenItemUuid: (uuid: string, options?: { shouldOnlyOpen?: boolean }) => void;\n shouldEnableKeyboardHighlighting: boolean;\n listGroupUuid?: string;\n listItemUuids?: string[];\n registerListItemUuid?: (uuid: string) => void;\n unregisterListItemUuid?: (uuid: string) => void;\n activeListItemUuid?: string;\n updateActiveListItemUuid?: (uuid?: string) => void;\n}\n\nexport const ListContext = React.createContext<IListContext>({\n isAnyItemExpandable: false,\n isWrapped: false,\n openItemUuid: undefined,\n updateOpenItemUuid: () => {},\n shouldEnableKeyboardHighlighting: false,\n listGroupUuid: undefined,\n listItemUuids: undefined,\n registerListItemUuid: undefined,\n unregisterListItemUuid: undefined,\n activeListItemUuid: undefined,\n updateActiveListItemUuid: undefined,\n});\n\nListContext.displayName = 'ListContext';\n\ntype ListProps = {\n /**\n * The items of the list\n */\n children: ReactNode;\n /**\n * This value must be set for nested AccordionGroup components. This adjusts the style of\n * the head and the padding of the content accordions.\n */\n isWrapped?: boolean;\n /**\n * Enables keyboard-only focus highlighting and arrow-key navigation within the list.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst List: FC<ListProps> = ({ children, isWrapped = false, shouldEnableKeyboardHighlighting }) => {\n 'use memo';\n\n const colorScheme = useColorScheme();\n const shouldEnableKeyboardHighlightingEffective =\n shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;\n\n const [openItemUuid, setOpenItemUuid] = useState<IListContext['openItemUuid']>(undefined);\n const [listItemUuids, setListItemUuids] = useState<string[]>();\n const [activeListItemUuid, setActiveListItemUuid] =\n useState<IListContext['activeListItemUuid']>(undefined);\n\n const listGroupUuid = useUuid();\n\n const updateOpenItemUuid = useCallback<IListContext['updateOpenItemUuid']>(\n (uuid, { shouldOnlyOpen } = {}) => {\n setOpenItemUuid((currentOpenItemUuid) => {\n if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {\n return undefined;\n }\n\n return uuid;\n });\n },\n [setOpenItemUuid],\n );\n\n const sortListItemUuidsByDom = useCallback(\n (uuids: string[]) => {\n if (typeof document === 'undefined') {\n return uuids;\n }\n\n const domOrderedUuids = Array.from(\n document.querySelectorAll<HTMLElement>(`[data-uuid^=\"${listGroupUuid}---\"]`),\n )\n .map((element) => element.getAttribute('data-uuid')?.split('---')[1])\n .filter((uuid): uuid is string => Boolean(uuid));\n\n return domOrderedUuids.filter((uuid) => uuids.includes(uuid));\n },\n [listGroupUuid],\n );\n\n const registerListItemUuid = useCallback(\n (uuid: string) => {\n setListItemUuids((currentListItemUuids = []) => {\n const nextListItemUuids = currentListItemUuids.includes(uuid)\n ? currentListItemUuids\n : [...currentListItemUuids, uuid];\n\n return sortListItemUuidsByDom(nextListItemUuids);\n });\n },\n [sortListItemUuidsByDom],\n );\n\n const unregisterListItemUuid = useCallback((uuid: string) => {\n setListItemUuids((currentListItemUuids = []) =>\n currentListItemUuids.filter((currentUuid) => currentUuid !== uuid),\n );\n }, []);\n\n const updateActiveListItemUuid = useCallback((uuid?: string) => {\n setActiveListItemUuid(uuid);\n }, []);\n\n const providerValue = useMemo<IListContext>(\n () => ({\n isAnyItemExpandable: shouldShowExpandIndicator(children),\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n shouldEnableKeyboardHighlighting: shouldEnableKeyboardHighlightingEffective,\n listGroupUuid,\n listItemUuids,\n registerListItemUuid,\n unregisterListItemUuid,\n activeListItemUuid,\n updateActiveListItemUuid,\n }),\n [\n children,\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n shouldEnableKeyboardHighlightingEffective,\n listGroupUuid,\n listItemUuids,\n registerListItemUuid,\n unregisterListItemUuid,\n activeListItemUuid,\n updateActiveListItemUuid,\n ],\n );\n\n return (\n <ListContext.Provider value={providerValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AnimatePresence initial={false}>{children}</AnimatePresence>\n </MotionConfig>\n </ListContext.Provider>\n );\n};\n\nList.displayName = 'List';\n\nexport default List;\n"],"mappings":";AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAC5D,OAAOC,KAAK,IAAmBC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5E,SAASC,cAAc,QAAQ,8CAA8C;AAC7E,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,yBAAyB,QAAQ,cAAc;AAgBxD,OAAO,MAAMC,WAAW,gBAAGP,KAAK,CAACQ,aAAa,CAAe;EACzDC,mBAAmB,EAAE,KAAK;EAC1BC,SAAS,EAAE,KAAK;EAChBC,YAAY,EAAEC,SAAS;EACvBC,kBAAkB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC5BC,gCAAgC,EAAE,KAAK;EACvCC,aAAa,EAAEH,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AW,GAAG,MAAM;AAEzB,eAAeC,IAAI;AA3GS,SAAAyB,MAAA2B,OAAA;EAAA,OAoCMA,OAAO,CAAAC,YAAa,CAAC,WAAkB,CAAC,EAAAC,KAAO,CAAN,KAAQ,CAAC;AAAA;AApCxD,SAAA3B,OAAA4B,MAAA;EAAA,OAqCsBC,OAAO,CAAC1C,MAAI,CAAC;AAAA","ignoreList":[]}
@@ -14,4 +14,103 @@ export const shouldShowExpandIndicator = node => Children.toArray(node).some(chi
14
14
  }
15
15
  return false;
16
16
  });
17
+ const LEFT_ELEMENT_FOCUSABLE_SELECTOR = '[data-left-element="true"] a[href], [data-left-element="true"] button, [data-left-element="true"] input, [data-left-element="true"] select, [data-left-element="true"] textarea, [data-left-element="true"] [tabindex], [data-left-element="true"] [contenteditable="true"]';
18
+ const RIGHT_ELEMENT_FOCUSABLE_SELECTOR = '[data-right-element="true"] a[href], [data-right-element="true"] button, [data-right-element="true"] input, [data-right-element="true"] select, [data-right-element="true"] textarea, [data-right-element="true"] [tabindex], [data-right-element="true"] [contenteditable="true"]';
19
+ const getFocusableElements = (root, selector) => Array.from(root.querySelectorAll(selector)).filter(element => !element.hasAttribute('disabled') && element.getAttribute('tabindex') !== '-1');
20
+ const getFocusedElementIndex = (elements, targetElement) => {
21
+ if (!targetElement || elements.length === 0) {
22
+ return -1;
23
+ }
24
+ return elements.findIndex(element => element === targetElement || element.contains(targetElement));
25
+ };
26
+ export const handleHorizontalArrowNavigation = ({
27
+ event,
28
+ currentListItemElement,
29
+ targetElement,
30
+ isCurrentListItemTarget
31
+ }) => {
32
+ if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft') {
33
+ return false;
34
+ }
35
+ const focusableLeftElements = getFocusableElements(currentListItemElement, LEFT_ELEMENT_FOCUSABLE_SELECTOR);
36
+ const focusableRightElements = getFocusableElements(currentListItemElement, RIGHT_ELEMENT_FOCUSABLE_SELECTOR);
37
+ const focusedLeftElementIndex = getFocusedElementIndex(focusableLeftElements, targetElement);
38
+ if (focusedLeftElementIndex !== -1) {
39
+ event.preventDefault();
40
+ if (event.key === 'ArrowLeft') {
41
+ const previousLeftElement = focusableLeftElements[focusedLeftElementIndex - 1];
42
+ if (previousLeftElement) {
43
+ previousLeftElement.focus();
44
+ } else {
45
+ currentListItemElement.focus();
46
+ }
47
+ return true;
48
+ }
49
+ const nextLeftElement = focusableLeftElements[focusedLeftElementIndex + 1];
50
+ if (nextLeftElement) {
51
+ nextLeftElement.focus();
52
+ } else if (focusableRightElements.length > 0) {
53
+ focusableRightElements[0]?.focus();
54
+ }
55
+ return true;
56
+ }
57
+ const focusedRightElementIndex = getFocusedElementIndex(focusableRightElements, targetElement);
58
+ if (focusedRightElementIndex !== -1) {
59
+ event.preventDefault();
60
+ if (event.key === 'ArrowRight') {
61
+ focusableRightElements[focusedRightElementIndex + 1]?.focus();
62
+ return true;
63
+ }
64
+ const previousRightElement = focusableRightElements[focusedRightElementIndex - 1];
65
+ if (previousRightElement) {
66
+ previousRightElement.focus();
67
+ } else if (focusableLeftElements.length > 0) {
68
+ focusableLeftElements[focusableLeftElements.length - 1]?.focus();
69
+ } else {
70
+ currentListItemElement.focus();
71
+ }
72
+ return true;
73
+ }
74
+ if (isCurrentListItemTarget) {
75
+ if (event.key === 'ArrowLeft' && focusableLeftElements.length > 0) {
76
+ event.preventDefault();
77
+ focusableLeftElements[focusableLeftElements.length - 1]?.focus();
78
+ return true;
79
+ }
80
+ if (event.key === 'ArrowRight' && focusableRightElements.length > 0) {
81
+ event.preventDefault();
82
+ focusableRightElements[0]?.focus();
83
+ return true;
84
+ }
85
+ }
86
+ return false;
87
+ };
88
+ export const handleVerticalListGroupNavigation = ({
89
+ event,
90
+ isCurrentListItemTarget,
91
+ isInKeyboardNavigationGroup,
92
+ listItemUuids,
93
+ currentUuid,
94
+ listGroupUuid,
95
+ updateActiveListItemUuid
96
+ }) => {
97
+ if (!isCurrentListItemTarget || !isInKeyboardNavigationGroup || !listItemUuids?.length || event.key !== 'ArrowDown' && event.key !== 'ArrowUp') {
98
+ return false;
99
+ }
100
+ event.preventDefault();
101
+ const currentIndex = listItemUuids.indexOf(currentUuid);
102
+ if (currentIndex === -1) {
103
+ return true;
104
+ }
105
+ const nextIndex = event.key === 'ArrowDown' ? (currentIndex + 1) % listItemUuids.length : (currentIndex - 1 + listItemUuids.length) % listItemUuids.length;
106
+ const nextListItemUuid = listItemUuids[nextIndex];
107
+ if (nextListItemUuid && nextListItemUuid !== currentUuid && typeof listGroupUuid === 'string' && typeof updateActiveListItemUuid === 'function') {
108
+ const nextListItemElement = document.querySelector(`[data-uuid="${listGroupUuid}---${nextListItemUuid}"]`);
109
+ if (nextListItemElement) {
110
+ updateActiveListItemUuid(nextListItemUuid);
111
+ nextListItemElement.focus();
112
+ }
113
+ }
114
+ return true;
115
+ };
17
116
  //# sourceMappingURL=List.utils.js.map