@chayns-components/core 5.3.10 → 5.3.12-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 +119 -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 +111 -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":"Icon.js","names":["_clsx","_interopRequireDefault","require","_react","_icon","_Icon","_styledComponents","e","__esModule","default","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","tabIndex","size","shouldStopPropagation","theme","useTheme","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","getStackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","clsx","createElement","StyledIconWrapper","$isDisabled","undefined","$isOnClick","$size","map","iconStyle","themedIcon","replace","iconClasses","StyledIcon","$color","includes","$fontSize","$isStacked","key","displayName","_default","exports"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * @optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n /**\n * Optional tab index for the icon.\n */\n tabIndex?: number;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n tabIndex,\n size = 15,\n shouldStopPropagation,\n}) => {\n const theme = useTheme() as Theme;\n\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n tabIndex={tabIndex}\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={typeof onClick === 'function' && !isDisabled ? handleClick : undefined}\n $isOnClick={typeof onClick === 'function' && !isDisabled}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n $size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n const iconStyle = `${(theme?.iconStyle as string) ?? 'fa-regular'} `;\n const themedIcon = icon?.replace(/^fa\\s/, iconStyle);\n\n const iconClasses = clsx(themedIcon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAA6C,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAoG7C,MAAMG,IAAmB,GAAGA,CAAC;EACzBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPC,aAAa;EACbC,WAAW;EACXC,QAAQ;EACRC,IA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eyboardFocusHighlighting","_ColorSchemeProvider","_Icon","_styledComponents","e","__esModule","default","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","tabIndex","size","shouldStopPropagation","shouldEnableKeyboardHighlighting","theme","useTheme","colorScheme","useColorScheme","shouldEnableKeyboardHighlightingEffective","isClickable","shouldShowKeyboardHighlighting","useKeyboardFocusHighlighting","handleClick","event","stopPropagation","handleDoubleClick","handleKeyDown","key","preventDefault","maxStackSizeFactor","forEach","icon","stackSizeFactor","getStackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","clsx","createElement","StyledIconWrapper","$isDisabled","undefined","$isOnClick","onKeyDown","$shouldShowKeyboardHighlighting","$size","role","map","iconStyle","themedIcon","replace","iconClasses","StyledIcon","$color","includes","$fontSize","$isStacked","displayName","_default","exports"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, KeyboardEventHandler, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { useColorScheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledIcon as StyledIconElement, StyledIconWrapper } from './Icon.styles';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * @optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n /**\n * Optional tab index for the icon.\n */\n tabIndex?: number;\n /**\n * Enables keyboard-only focus highlighting for clickable icons.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n tabIndex,\n size = 15,\n shouldStopPropagation,\n shouldEnableKeyboardHighlighting,\n}) => {\n const theme = useTheme() as Theme;\n const colorScheme = useColorScheme();\n const shouldEnableKeyboardHighlightingEffective =\n shouldEnableKeyboardHighlighting ?? colorScheme?.shouldEnableKeyboardHighlighting ?? false;\n\n const isClickable = typeof onClick === 'function' && !isDisabled;\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlightingEffective && isClickable,\n );\n\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLSpanElement> = (event) => {\n if (!isClickable) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick(event as unknown as React.MouseEvent<HTMLSpanElement>);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n tabIndex={\n shouldEnableKeyboardHighlightingEffective && isClickable\n ? (tabIndex ?? 0)\n : tabIndex\n }\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={isClickable ? handleClick : undefined}\n $isOnClick={isClickable}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n onKeyDown={shouldEnableKeyboardHighlightingEffective ? handleKeyDown : undefined}\n $shouldShowKeyboardHighlighting={shouldShowKeyboardHighlighting}\n $size={size}\n role={isClickable ? 'button' : undefined}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n const iconStyle = `${(theme?.iconStyle as string) ?? 'fa-regular'} `;\n const themedIcon = icon?.replace(/^fa\\s/, iconStyle);\n\n const iconClasses = clsx(themedIcon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIconElement\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAA6C,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAwG7C,MAAMG,IAAmB,GAAGA,CAAC;EACzBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPC,aAAa;EACbC,WAAW;EACXC,QAAQ;EACRC,IAAI,GAAG,EAAE;EACTC,qBAAqB;EACrBC;AACJ,CAAC,KAAK;EACF,MAAMC,KAAK,GAAG,IAAAC,0BAAQ,EAAC,CAAU;EACjC,MAAMC,WAAW,GAAG,IAAAC,mCAAc,E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oBACIhD,MAAA,CAAAQ,OAAA,CAAAqC,aAAA,CAACzC,KAAA,CAAAuD,UAAiB;MACdjD,SAAS,EAAEgD,WAAY;MACvBE,MAAM,EAAEtB,IAAI,CAACuB,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,GAAGlD,KAAM;MACtDmD,SAAS,EAAG,CAACvB,eAAe,IAAI,CAAC,IAAIH,kBAAkB,GAAIlB,IAAK;MAChE6C,UAAU,EAAEtB,oBAAqB;MACjCP,GAAG,EAAEI,IAAK;MACVc,KAAK,EAAElC;IAAK,CACf,CAAC;EAEV,CAAC,CACc,CAAC;AAE5B,CAAC;AAEDT,IAAI,CAACuD,WAAW,GAAG,MAAM;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1D,OAAA,GAEXC,IAAI","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.StyledUnicodeIcon = exports.StyledIconWrapper = exports.StyledIcon = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ var _keyboardFocusHighlighting = require("../../utils/keyboardFocusHighlighting.styles");
8
9
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
10
  const StyledIconWrapper = exports.StyledIconWrapper = _styledComponents.default.span`
10
11
  align-items: center;
@@ -26,6 +27,28 @@ const StyledIconWrapper = exports.StyledIconWrapper = _styledComponents.default.
26
27
  $size
27
28
  }) => `${$size}px`};
28
29
 
30
+ ${({
31
+ $shouldShowKeyboardHighlighting,
32
+ $size
33
+ }) => $shouldShowKeyboardHighlighting && (0, _styledComponents.css)`
34
+ &:focus-visible {
35
+ outline: none;
36
+ color: inherit;
37
+ }
38
+
39
+ &:focus-visible::after {
40
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingCircleRingCss};
41
+ content: '';
42
+ position: absolute;
43
+ top: 50%;
44
+ left: 50%;
45
+ width: ${$size + 14}px;
46
+ height: ${$size + 14}px;
47
+ transform: translate(-50%, -50%);
48
+ pointer-events: none;
49
+ }
50
+ `}
51
+
29
52
  // To insure that stacked icons have the same size as normal icons.
30
53
  &&.fa-stack {
31
54
  height: fit-content;
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledIconWrapper","exports","styled","span","$isDisabled","$isOnClick","$size","StyledIcon","$color","theme","iconColor","text","$isStacked","undefined","$fontSize","css","StyledUnicodeIcon","headline","$icon","iconStyle"],"sources":["../../../../src/components/icon/Icon.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledIconWrapperProps = {\n $isDisabled?: boolean;\n $isOnClick: boolean;\n $size: number;\n};\n\nexport const StyledIconWrapper = styled.span<StyledIconWrapperProps>`\n align-items: center;\n cursor: ${({ $isDisabled, $isOnClick }) =>\n $isOnClick && !$isDisabled ? 'pointer' : 'inherit'};\n display: inline-flex;\n min-height: ${({ $size }) => `${$size}px`};\n justify-content: center;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n transition: opacity 0.3s ease;\n min-width: ${({ $size }) => `${$size}px`};\n\n // To insure that stacked icons have the same size as normal icons.\n &&.fa-stack {\n height: fit-content;\n width: fit-content;\n line-height: ${({ $size }) => $size}px;\n }\n`;\n\ntype StyledIconProps = WithTheme<{\n $fontSize: number;\n $isStacked?: boolean;\n $color?: string;\n $size: number;\n}>;\n\nexport const StyledIcon = styled.i<StyledIconProps>`\n color: ${({ $color, theme }: StyledIconProps) => $color || theme.iconColor || theme.text};\n display: ${({ $isStacked }) => ($isStacked ? undefined : 'inline-flex')};\n font-size: ${({ $fontSize }) => `${$fontSize}px`};\n\n ${({ $fontSize, $size }) =>\n $fontSize !== $size &&\n css`\n top: 50%;\n transform: translateY(-50%);\n `}\n`;\n\ntype StyledUnicodeIconProps = WithTheme<{ $icon: string }>;\n\nexport const StyledUnicodeIcon = styled.i<StyledUnicodeIconProps>`\n align-items: center;\n justify-content: center;\n display: flex;\n color: ${({ theme }: StyledUnicodeIconProps) => theme.iconColor || theme.headline};\n\n &:before {\n content: ${({ $icon }) => `\"\\\\${$icon}\" !important`};\n }\n &:after {\n content: ${({ theme, $icon }) => {\n if (theme.iconStyle === 'fa-duotone') {\n return `\"\\\\${$icon}\" !important`;\n }\n return '';\n }};\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CA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CAAC,KAAK,GAAGA,SAAS,IAAI;AACpD;AACA,MAAM,CAAC;EAAEA,SAAS;EAAER;AAAM,CAAC,KACnBQ,SAAS,KAAKR,KAAK,IACnB,IAAAS,qBAAG;AACX;AACA;AACA,SAAS;AACT,CAAC;AAIM,MAAMC,iBAAiB,GAAAf,OAAA,CAAAe,iBAAA,GAAGd,yBAAM,CAACd,CAAyB;AACjE;AACA;AACA;AACA,aAAa,CAAC;EAAEqB;AAA8B,CAAC,KAAKA,KAAK,CAACC,SAAS,IAAID,KAAK,CAACQ,QAAQ;AACrF;AACA;AACA,mBAAmB,CAAC;EAAEC;AAAM,CAAC,KAAK,MAAMA,KAAK,cAAc;AAC3D;AACA;AACA,mBAAmB,CAAC;EAAET,KAAK;EAAES;AAAM,CAAC,KAAK;EAC7B,IAAIT,KAAK,CAACU,SAAS,KAAK,YAAY,EAAE;IAClC,OAAO,MAAMD,KAAK,cAAc;EACpC;EACA,OAAO,EAAE;AACb,CAAC;AACT;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Icon.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_keyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledIconWrapper","exports","styled","span","$isDisabled","$isOnClick","$size","$shouldShowKeyboardHighlighting","css","keyboardFocusHighlightingCircleRingCss","StyledIcon","$color","theme","iconColor","text","$isStacked","undefined","$fontSize","StyledUnicodeIcon","headline","$icon","iconStyle"],"sources":["../../../../src/components/icon/Icon.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { keyboardFocusHighlightingCircleRingCss } from '../../utils/keyboardFocusHighlighting.styles';\n\ntype StyledIconWrapperProps = {\n $isDisabled?: boolean;\n $isOnClick: boolean;\n $size: number;\n $shouldShowKeyboardHighlighting?: boolean;\n};\n\nexport const StyledIconWrapper = styled.span<StyledIconWrapperProps>`\n align-items: center;\n cursor: ${({ $isDisabled, $isOnClick }) =>\n $isOnClick && !$isDisabled ? 'pointer' : 'inherit'};\n display: inline-flex;\n min-height: ${({ $size }) => `${$size}px`};\n justify-content: center;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n transition: opacity 0.3s ease;\n min-width: ${({ $size }) => `${$size}px`};\n\n ${({ $shouldShowKeyboardHighlighting, $size }) =>\n $shouldShowKeyboardHighlighting &&\n css`\n &:focus-visible {\n outline: none;\n color: inherit;\n }\n\n &:focus-visible::after {\n ${keyboardFocusHighlightingCircleRingCss};\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ${$size + 14}px;\n height: ${$size + 14}px;\n transform: translate(-50%, -50%);\n pointer-events: none;\n }\n `}\n\n // To insure that stacked icons have the same size as normal icons.\n &&.fa-stack {\n height: fit-content;\n width: fit-content;\n line-height: ${({ $size }) => $size}px;\n }\n`;\n\ntype StyledIconProps = WithTheme<{\n $fontSize: number;\n $isStacked?: boolean;\n $color?: string;\n $size: number;\n}>;\n\nexport const StyledIcon = styled.i<StyledIconProps>`\n color: ${({ $color, theme }: StyledIconProps) => $color || theme.iconColor || theme.text};\n display: ${({ $isStacked }) => ($isStacked ? undefined : 'inline-flex')};\n font-size: ${({ $fontSize }) => `${$fontSize}px`};\n\n ${({ $fontSize, $size }) =>\n $fontSize !== $size &&\n css`\n top: 50%;\n transform: translateY(-50%);\n `}\n`;\n\ntype StyledUnicodeIconProps = WithTheme<{ $icon: string }>;\n\nexport const StyledUnicodeIcon = styled.i<StyledUnicodeIconProps>`\n align-items: center;\n justify-content: center;\n display: flex;\n color: ${({ theme }: StyledUnicodeIconProps) => theme.iconColor || theme.headline};\n\n &:before {\n content: ${({ $icon }) => `\"\\\\${$icon}\" !important`};\n }\n &:after {\n content: ${({ theme, $icon }) => {\n if (theme.iconStyle === 'fa-duotone') {\n return `\"\\\\${$icon}\" !important`;\n }\n return '';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,KAAK,CAACO,QAAQ;AACrF;AACA;AACA,mBAAmB,CAAC;EAAEC;AAAM,CAAC,KAAK,MAAMA,KAAK,cAAc;AAC3D;AACA;AACA,mBAAmB,CAAC;EAAER,KAAK;EAAEQ;AAAM,CAAC,KAAK;EAC7B,IAAIR,KAAK,CAACS,SAAS,KAAK,YAAY,EAAE;IAClC,OAAO,MAAMD,KAAK,cAAc;EACpC;EACA,OAAO,EAAE;AACb,CAAC;AACT;AACA,CAAC","ignoreList":[]}
@@ -13,6 +13,7 @@ var _Input = require("./Input.styles");
13
13
  var _contentCard = require("../../types/contentCard");
14
14
  var _resize = require("../../hooks/resize");
15
15
  var _Tooltip = _interopRequireDefault(require("../tooltip/Tooltip"));
16
+ var _useKeyboardFocusHighlighting = require("../../hooks/useKeyboardFocusHighlighting");
16
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
19
  let InputSize = exports.InputSize = /*#__PURE__*/function (InputSize) {
@@ -45,7 +46,8 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
45
46
  shouldPreventPlaceholderAnimation = false,
46
47
  id,
47
48
  shouldShowTransparentBackground = false,
48
- autoComplete
49
+ autoComplete,
50
+ shouldEnableKeyboardHighlighting
49
51
  }, ref) => {
50
52
  var _rightElement$props;
51
53
  const [hasValue, setHasValue] = (0, _react.useState)(typeof value === 'string' && value !== '');
@@ -72,6 +74,14 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
72
74
  }
73
75
  }
74
76
  }, [onChange]);
77
+ const handleClearIconKeyDown = (0, _react.useCallback)(event => {
78
+ if (event.key === 'Enter' || event.key === ' ') {
79
+ var _inputRef$current;
80
+ event.preventDefault();
81
+ handleClearIconClick();
82
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
83
+ }
84
+ }, [handleClearIconClick]);
75
85
 
76
86
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
77
87
  const shouldShowBorder = (rightElement === null || rightElement === void 0 || (_rightElement$props = rightElement.props) === null || _rightElement$props === void 0 || (_rightElement$props = _rightElement$props.style) === null || _rightElement$props === void 0 ? void 0 : _rightElement$props.backgroundColor) === undefined;
@@ -83,12 +93,12 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
83
93
  }, [onChange]);
84
94
  (0, _react.useImperativeHandle)(ref, () => ({
85
95
  focus: () => {
86
- var _inputRef$current;
87
- return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
96
+ var _inputRef$current2;
97
+ return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
88
98
  },
89
99
  blur: () => {
90
- var _inputRef$current2;
91
- return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
100
+ var _inputRef$current3;
101
+ return (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.blur();
92
102
  }
93
103
  }), []);
94
104
  (0, _react.useEffect)(() => {
@@ -106,6 +116,9 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
106
116
  } else if (areaProvider.shouldChangeColor) {
107
117
  backgroundColor = theme['000'];
108
118
  }
119
+ const shouldShowKeyboardHighlighting = (0, _useKeyboardFocusHighlighting.useKeyboardFocusHighlighting)(shouldEnableKeyboardHighlighting && !isDisabled);
120
+ const borderColor = color === null || color === void 0 ? void 0 : color.border;
121
+ const placeholderColor = color === null || color === void 0 ? void 0 : color.placeholder;
109
122
  const labelPosition = (0, _react.useMemo)(() => {
110
123
  if (hasValue && !shouldRemainPlaceholder && !shouldPreventPlaceholderAnimation) {
111
124
  return shouldShowOnlyBottomBorder ? {
@@ -131,7 +144,8 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
131
144
  $shouldRoundRightCorners: shouldShowBorder,
132
145
  $shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder,
133
146
  $size: size,
134
- $borderColor: color === null || color === void 0 ? void 0 : color.border
147
+ $borderColor: borderColor,
148
+ $shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting
135
149
  }, leftElement && /*#__PURE__*/_react.default.createElement(_Input.StyledInputIconWrapper, null, leftElement), /*#__PURE__*/_react.default.createElement(_Input.StyledInputContent, {
136
150
  $shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder
137
151
  }, /*#__PURE__*/_react.default.createElement(_Input.StyledInputField, {
@@ -173,23 +187,30 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
173
187
  duration: shouldPreventPlaceholderAnimation ? 0 : 0.1
174
188
  }
175
189
  }, /*#__PURE__*/_react.default.createElement(_Input.StyledInputLabel, {
176
- $color: color === null || color === void 0 ? void 0 : color.placeholder,
190
+ $color: placeholderColor,
177
191
  $isInvalid: isInvalid
178
192
  }, placeholder))), shouldShowClearIcon && /*#__PURE__*/_react.default.createElement(_Input.StyledMotionInputClearIcon, {
179
193
  $shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder,
180
194
  $size: size,
195
+ $shouldShowKeyboardHighlighting: shouldShowKeyboardHighlighting,
181
196
  animate: {
182
197
  opacity: hasValue ? 1 : 0
183
198
  },
184
199
  initial: false,
185
200
  onClick: handleClearIconClick,
201
+ onKeyDown: handleClearIconKeyDown,
202
+ tabIndex: shouldEnableKeyboardHighlighting && hasValue && !isDisabled ? 0 : -1,
203
+ role: shouldEnableKeyboardHighlighting ? 'button' : undefined,
204
+ "aria-hidden": !hasValue,
186
205
  transition: {
187
206
  type: 'tween'
188
207
  }
189
208
  }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
190
209
  icons: ['fa fa-times'],
191
210
  color: isInvalid ? theme.wrong : undefined
192
- })), rightElement && shouldShowBorder && rightElement), rightElement && !shouldShowBorder && /*#__PURE__*/_react.default.createElement(_Input.StyledInputRightElement, null, rightElement)), [isDisabled, shouldShowTransparentBackground, backgroundColor, isInvalid, shouldShowBorder, shouldShowOnlyBottomBorder, size, leftElement, internalColor, placeholderWidth, id, onBlur, handleInputFieldChange, onFocus, onKeyDown, onPaste, type, value, shouldUseAutoFocus, inputMode, autoComplete, shouldShowCenteredContent, shouldPreventPlaceholderAnimation, hasValue, shouldRemainPlaceholder, theme.fontSize, theme.wrong, labelPosition, color === null || color === void 0 ? void 0 : color.placeholder, placeholder, shouldShowClearIcon, handleClearIconClick, rightElement]);
211
+ })), rightElement && shouldShowBorder && /*#__PURE__*/_react.default.createElement(_Input.StyledInputRightElement, {
212
+ $isInline: true
213
+ }, rightElement)), rightElement && !shouldShowBorder && /*#__PURE__*/_react.default.createElement(_Input.StyledInputRightElement, null, rightElement)), [isDisabled, shouldShowTransparentBackground, backgroundColor, isInvalid, shouldShowBorder, shouldShowOnlyBottomBorder, size, leftElement, internalColor, placeholderWidth, id, onBlur, handleInputFieldChange, onFocus, onKeyDown, onPaste, type, value, shouldUseAutoFocus, inputMode, autoComplete, shouldShowCenteredContent, shouldPreventPlaceholderAnimation, hasValue, shouldRemainPlaceholder, theme.fontSize, theme.wrong, labelPosition, borderColor, placeholderColor, placeholder, shouldShowClearIcon, handleClearIconClick, handleClearIconKeyDown, rightElement, shouldEnableKeyboardHighlighting, shouldShowKeyboardHighlighting]);
193
214
  if (isDisabled && typeof disabledHint === 'string') {
194
215
  return /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
195
216
  item: {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_element","_AreaContextProvider","_Icon","_interopRequireDefault","_Input","_contentCard","_resize","_Tooltip","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","InputSize","exports","Input","forwardRef","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","_rightElement$props","hasValue","setHasValue","useState","placeholderWidth","setPlaceholderWidth","areaProvider","useContext","AreaContext","theme","useTheme","inputRef","useRef","placeholderRef","useCursorRepaint","placeholderSize","useElementSize","useEffect","width","handleClearIconClick","useCallback","current","target","shouldShowBorder","props","style","backgroundColor","undefined","handleInputFieldChange","event","useImperativeHandle","focus","_inputRef$current","blur","_inputRef$current2","internalColor","contentCardType","ContentCardType","Error","Success","Warning","includes","shouldChangeColor","labelPosition","useMemo","right","top","bottom","Small","left","inputElement","createElement","StyledInput","className","$isDisabled","StyledInputContentWrapper","$shouldShowTransparentBackground","$backgroundColor","$isInvalid","$shouldRoundRightCorners","$shouldShowOnlyBottomBorder","$size","$borderColor","border","StyledInputIconWrapper","StyledInputContent","StyledInputField","$color","$placeholderWidth","disabled","onClick","preventDefault","stopPropagation","autoFocus","$shouldShowCenteredContent","StyledMotionInputLabelWrapper","animate","opacity","fontSize","Number","initial","layout","transition","duration","StyledInputLabel","StyledMotionInputClearIcon","icons","wrong","StyledInputRightElement","item","text","shouldUseFullWidth","displayName","_default"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAkBA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA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E;MAACmG,kBAAkB;IAAA,GACpDzC,YACI,CAAC;EAElB;EAEA,OAAOA,YAAY;AACvB,CACJ,CAAC;AAED/E,KAAK,CAACyH,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAAA3H,OAAA,CAAAlB,OAAA,GAEbmB,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Input.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_element","_AreaContextProvider","_Icon","_interopRequireDefault","_Input","_contentCard","_resize","_Tooltip","_useKeyboardFocusHighlighting","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","InputSize","exports","Input","forwardRef","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","_rightElement$props","hasValue","setHasValue","useState","placeholderWidth","setPlaceholderWidth","areaProvider","useContext","AreaContext","theme","useTheme","inputRef","useRef","placeholderRef","useCursorRepaint","placeholderSize","useElementSize","useEffect","width","handleClearIconClick","useCallback","current","target","handleClearIconKeyDown","event","key","_inputRef$current","preventDefault","focus","shouldShowBorder","props","style","backgroundColor","undefined","handleInputFieldChange","useImperativeHandle","_inputRef$current2","blur","_inputRef$current3","internalColor","contentCardType","ContentCardType","Error","Success","Warning","includes","shouldChangeColor","shouldShowKeyboardHighlighting","useKeyboardFocusHighlighting","borderColor","border","placeholderColor","labelPosition","useMemo","right","top","bottom","Small","left","inputElement","createElement","StyledInput","className","$isDisabled","StyledInputContentWrapper","$shouldShowTransparentBackground","$backgroundColor","$isInvalid","$shouldRoundRightCorners","$shouldShowOnlyBottomBorder","$size","$borderColor","$shouldShowKeyboardHighlighting","StyledInputIconWrapper","StyledInputContent","StyledInputField","$color","$placeholderWidth","disabled","onClick","stopPropagation","autoFocus","$shouldShowCenteredContent","StyledMotionInputLabelWrapper","animate","opacity","fontSize","Number","initial","layout","transition","duration","StyledInputLabel","StyledMotionInputClearIcon","tabIndex","role","icons","wrong","StyledInputRightElement","$isInline","item","text","shouldUseFullWidth","displayName","_default"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAkBA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAWA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAJ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BAAgB,iBAC9B7F,MAAA,CAAAe,OAAA,CAAA6G,aAAA,CAACpH,MAAA,CAAA0J,uBAAuB,QAAEpH,YAAsC,CAE3D,CAChB,EACD,CACIR,UAAU,EACVsB,+BAA+B,EAC/BoC,eAAe,EACfvC,SAAS,EACToC,gBAAgB,EAChB9C,0BAA0B,EAC1BI,IAAI,EACJf,WAAW,EACXmE,aAAa,EACbnC,gBAAgB,EAChBT,EAAE,EACFpB,MAAM,EACN2D,sBAAsB,EACtBzD,OAAO,EACPC,SAAS,EACTC,OAAO,EACPU,IAAI,EACJC,KAAK,EACLE,kBAAkB,EAClBnB,SAAS,EACTwB,YAAY,EACZX,yBAAyB,EACzBQ,iCAAiC,EACjCO,QAAQ,EACRjB,uBAAuB,EACvByB,KAAK,CAAC6E,QAAQ,EACd7E,KAAK,CAACwF,KAAK,EACX7C,aAAa,EACbH,WAAW,EACXE,gBAAgB,EAChBvE,WAAW,EACXK,mBAAmB,EACnBkC,oBAAoB,EACpBI,sBAAsB,EACtBzC,YAAY,EACZgB,gCAAgC,EAChCiD,8BAA8B,CAEtC,CAAC;EAED,IAAIzE,UAAU,IAAI,OAAOiB,YAAY,KAAK,QAAQ,EAAE;IAChD,oBACIvD,MAAA,CAAAe,OAAA,CAAA6G,aAAA,CAACjH,QAAA,CAAAI,OAAO;MAACqJ,IAAI,EAAE;QAAEC,IAAI,EAAE9G;MAAa,CAAE;MAAC+G,kBAAkB;IAAA,GACpD3C,YACI,CAAC;EAElB;EAEA,OAAOA,YAAY;AACvB,CACJ,CAAC;AAEDzF,KAAK,CAACqI,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAAAvI,OAAA,CAAAlB,OAAA,GAEbmB,KAAK","ignoreList":[]}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.StyledMotionInputLabelWrapper = exports.StyledMotionInputElement = exports.StyledMotionInputClearIcon = exports.StyledInputRightElement = exports.StyledInputLabel = exports.StyledInputIconWrapper = exports.StyledInputField = exports.StyledInputContentWrapper = exports.StyledInputContent = exports.StyledInput = void 0;
7
7
  var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+ var _keyboardFocusHighlighting = require("../../utils/keyboardFocusHighlighting.styles");
9
10
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
11
  const StyledInput = exports.StyledInput = _styledComponents.default.div`
11
12
  opacity: ${({
@@ -96,6 +97,15 @@ const StyledInputContentWrapper = exports.StyledInputContentWrapper = _styledCom
96
97
  border-right: none;
97
98
  `;
98
99
  }}
100
+
101
+ ${({
102
+ $shouldShowKeyboardHighlighting
103
+ }) => $shouldShowKeyboardHighlighting && (0, _styledComponents.css)`
104
+ &:focus-within {
105
+ transition: none;
106
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingRingCss}
107
+ }
108
+ `}
99
109
  `;
100
110
  const StyledInputContent = exports.StyledInputContent = _styledComponents.default.div`
101
111
  display: flex;
@@ -168,6 +178,15 @@ const StyledMotionInputClearIcon = exports.StyledMotionInputClearIcon = (0, _sty
168
178
  width: ${({
169
179
  $size
170
180
  }) => $size === 'medium' ? '40px' : '30px'};
181
+
182
+ ${({
183
+ $shouldShowKeyboardHighlighting
184
+ }) => $shouldShowKeyboardHighlighting && (0, _styledComponents.css)`
185
+ &:focus-visible {
186
+ transition: none;
187
+ ${_keyboardFocusHighlighting.keyboardFocusHighlightingRingCss}
188
+ }
189
+ `}
171
190
  `;
172
191
  const StyledInputIconWrapper = exports.StyledInputIconWrapper = _styledComponents.default.div`
173
192
  align-items: baseline;
@@ -177,9 +196,20 @@ const StyledInputIconWrapper = exports.StyledInputIconWrapper = _styledComponent
177
196
  margin-left: 10px;
178
197
  `;
179
198
  const StyledInputRightElement = exports.StyledInputRightElement = _styledComponents.default.div`
180
- border-bottom-right-radius: 3px;
181
- border-top-right-radius: 3px;
182
- overflow: hidden;
183
199
  flex: 0 0 auto;
200
+ overflow: hidden;
201
+ min-width: 28px;
202
+ text-align: center;
203
+
204
+ ${({
205
+ $isInline
206
+ }) => !$isInline && (0, _styledComponents.css)`
207
+ border-bottom-right-radius: 3px;
208
+ border-top-right-radius: 3px;
209
+ `}
210
+
211
+ .beta-chayns-icon:focus-visible::after {
212
+ transform: translate(-50%, -50%) scale(0.78);
213
+ }
184
214
  `;
185
215
  //# sourceMappingURL=Input.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledInput","exports","styled","div","$isDisabled","StyledInputContentWrapper","theme","$backgroundColor","$isInvalid","$shouldShowTransparentBackground","$borderColor","css","wrong","colorMode","$size","$shouldShowOnlyBottomBorder","$shouldRoundRightCorners","StyledInputContent","StyledInputField","input","$color","text","$placeholderWidth","$shouldShowCenteredContent","StyledMotionInputLabelWrapper","motion","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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MA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{"version":3,"file":"Input.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_keyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledInput","exports","styled","div","$isDisabled","StyledInputContentWrapper","theme","$backgroundColor","$isInvalid","$shouldShowTransparentBackground","$borderColor","css","wrong","colorMode","$size","$shouldShowOnlyBottomBorder","$shouldRoundRightCorners","$shouldShowKeyboardHighlighting","keyboardFocusHighlightingRingCss","StyledInputContent","StyledInputField","input","$color","text","$placeholderWidth","$shouldShowCenteredContent","StyledMotionInputLabelWrapper","motion","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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAIA,IAAAG,0BAAA,GAAAH,OAAA;AAAgG,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,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