@salutejs/plasma-new-hope 0.76.2-canary.1184.8705168480.0 → 0.76.3-canary.1178.8720542914.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (411) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  3. package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  4. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  5. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  6. package/cjs/components/Calendar/hoc/withRange.js +1 -1
  7. package/cjs/components/Calendar/hoc/withRange.js.map +1 -1
  8. package/cjs/components/Calendar/hooks/useKeyNavigation.js +19 -19
  9. package/cjs/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  10. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  11. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  12. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  13. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  14. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  15. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  16. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  17. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  18. package/cjs/components/Chip/Chip.css +2 -0
  19. package/cjs/components/Chip/Chip.js +16 -4
  20. package/cjs/components/Chip/Chip.js.map +1 -1
  21. package/cjs/components/Chip/Chip.tokens.js +5 -0
  22. package/cjs/components/Chip/Chip.tokens.js.map +1 -1
  23. package/cjs/components/Chip/variations/_pilled/base.js +9 -0
  24. package/cjs/components/Chip/variations/_pilled/base.js.map +1 -0
  25. package/cjs/components/Chip/variations/_pilled/base_3kce4h.css +1 -0
  26. package/cjs/components/Combobox/Combobox.css +2 -0
  27. package/cjs/components/Combobox/Combobox.js +5 -5
  28. package/cjs/components/Combobox/Combobox.js.map +1 -1
  29. package/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  30. package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
  31. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.css +2 -0
  32. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  33. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  34. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +2 -0
  35. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  36. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  37. package/cjs/components/Drawer/DrawerContext.js +1 -1
  38. package/cjs/components/Drawer/DrawerContext.js.map +1 -1
  39. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  40. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  41. package/cjs/components/Modal/ModalContext.js +1 -1
  42. package/cjs/components/Modal/ModalContext.js.map +1 -1
  43. package/cjs/components/Overlay/Overlay.js +1 -1
  44. package/cjs/components/Overlay/Overlay.js.map +1 -1
  45. package/cjs/components/Pagination/Pagination.css +2 -0
  46. package/cjs/components/Pagination/Pagination.js +2 -2
  47. package/cjs/components/Pagination/Pagination.js.map +1 -1
  48. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  49. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  50. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -0
  51. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  52. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  53. package/cjs/components/Popover/Popover.js +7 -7
  54. package/cjs/components/Popover/Popover.js.map +1 -1
  55. package/cjs/components/Popup/Popup.js +1 -1
  56. package/cjs/components/Popup/Popup.js.map +1 -1
  57. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  58. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  59. package/cjs/components/Select/Select.css +2 -0
  60. package/cjs/components/Select/Select.js +5 -5
  61. package/cjs/components/Select/Select.js.map +1 -1
  62. package/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  63. package/cjs/components/Select/hooks/useKeyNavigation.js.map +1 -1
  64. package/cjs/components/Select/ui/SelectChip/SelectChip.css +2 -0
  65. package/cjs/components/Select/ui/SelectChip/SelectChip.js +1 -1
  66. package/cjs/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  67. package/cjs/components/Select/ui/SelectTarget/SelectTarget.css +2 -0
  68. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  69. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  70. package/cjs/components/Select/utils/index.js +2 -2
  71. package/cjs/components/Select/utils/index.js.map +1 -1
  72. package/cjs/components/Tabs/TabsContext.js +2 -1
  73. package/cjs/components/Tabs/TabsContext.js.map +1 -1
  74. package/cjs/components/Tabs/ui/TabItem/TabItem.js +1 -1
  75. package/cjs/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  76. package/cjs/components/Tabs/ui/Tabs/Tabs.js +2 -2
  77. package/cjs/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  78. package/cjs/components/TextArea/TextArea.js +1 -1
  79. package/cjs/components/TextArea/TextArea.js.map +1 -1
  80. package/cjs/components/TextField/TextField.js +2 -2
  81. package/cjs/components/TextField/TextField.js.map +1 -1
  82. package/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  83. package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  84. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -0
  85. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  86. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  87. package/cjs/components/Toast/ToastProvider/ToastProvider.js +2 -2
  88. package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  89. package/cjs/components/Tooltip/Tooltip.js +1 -1
  90. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  91. package/cjs/index.css +2 -0
  92. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
  93. package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  94. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  95. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  96. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  97. package/es/components/Calendar/hoc/withRange.js +1 -1
  98. package/es/components/Calendar/hoc/withRange.js.map +1 -1
  99. package/es/components/Calendar/hooks/useKeyNavigation.js +19 -19
  100. package/es/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  101. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  102. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  103. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  104. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  105. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  106. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  107. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  108. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  109. package/es/components/Chip/Chip.css +2 -0
  110. package/es/components/Chip/Chip.js +17 -5
  111. package/es/components/Chip/Chip.js.map +1 -1
  112. package/es/components/Chip/Chip.tokens.js +5 -1
  113. package/es/components/Chip/Chip.tokens.js.map +1 -1
  114. package/es/components/Chip/variations/_pilled/base.js +5 -0
  115. package/es/components/Chip/variations/_pilled/base.js.map +1 -0
  116. package/es/components/Chip/variations/_pilled/base_3kce4h.css +1 -0
  117. package/es/components/Combobox/Combobox.css +2 -0
  118. package/es/components/Combobox/Combobox.js +5 -5
  119. package/es/components/Combobox/Combobox.js.map +1 -1
  120. package/es/components/Combobox/hooks/useFocusController.js +9 -9
  121. package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
  122. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.css +2 -0
  123. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  124. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  125. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +2 -0
  126. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  127. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  128. package/es/components/Drawer/DrawerContext.js +1 -1
  129. package/es/components/Drawer/DrawerContext.js.map +1 -1
  130. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  131. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  132. package/es/components/Modal/ModalContext.js +1 -1
  133. package/es/components/Modal/ModalContext.js.map +1 -1
  134. package/es/components/Overlay/Overlay.js +1 -1
  135. package/es/components/Overlay/Overlay.js.map +1 -1
  136. package/es/components/Pagination/Pagination.css +2 -0
  137. package/es/components/Pagination/Pagination.js +2 -2
  138. package/es/components/Pagination/Pagination.js.map +1 -1
  139. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  140. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  141. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -0
  142. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  143. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  144. package/es/components/Popover/Popover.js +7 -7
  145. package/es/components/Popover/Popover.js.map +1 -1
  146. package/es/components/Popup/Popup.js +1 -1
  147. package/es/components/Popup/Popup.js.map +1 -1
  148. package/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  149. package/es/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  150. package/es/components/Select/Select.css +2 -0
  151. package/es/components/Select/Select.js +5 -5
  152. package/es/components/Select/Select.js.map +1 -1
  153. package/es/components/Select/hooks/useKeyNavigation.js +12 -12
  154. package/es/components/Select/hooks/useKeyNavigation.js.map +1 -1
  155. package/es/components/Select/ui/SelectChip/SelectChip.css +2 -0
  156. package/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  157. package/es/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  158. package/es/components/Select/ui/SelectTarget/SelectTarget.css +2 -0
  159. package/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  160. package/es/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  161. package/es/components/Select/utils/index.js +2 -2
  162. package/es/components/Select/utils/index.js.map +1 -1
  163. package/es/components/Tabs/TabsContext.js +2 -1
  164. package/es/components/Tabs/TabsContext.js.map +1 -1
  165. package/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  166. package/es/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  167. package/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  168. package/es/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  169. package/es/components/TextArea/TextArea.js +1 -1
  170. package/es/components/TextArea/TextArea.js.map +1 -1
  171. package/es/components/TextField/TextField.js +2 -2
  172. package/es/components/TextField/TextField.js.map +1 -1
  173. package/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  174. package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  175. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -0
  176. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  177. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  178. package/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  179. package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  180. package/es/components/Tooltip/Tooltip.js +1 -1
  181. package/es/components/Tooltip/Tooltip.js.map +1 -1
  182. package/es/index.css +2 -0
  183. package/package.json +11 -11
  184. package/styled-components/cjs/components/Avatar/Avatar.js +1 -1
  185. package/styled-components/cjs/components/Avatar/Avatar.styles.js +1 -1
  186. package/styled-components/cjs/components/AvatarGroup/AvatarGroup.js +1 -1
  187. package/styled-components/cjs/components/Badge/Badge.js +1 -1
  188. package/styled-components/cjs/components/Badge/Badge.styles.js +1 -1
  189. package/styled-components/cjs/components/Button/Button.js +2 -2
  190. package/styled-components/cjs/components/Button/Button.styles.js +1 -1
  191. package/styled-components/cjs/components/ButtonGroup/ButtonGroup.js +1 -1
  192. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -2
  193. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
  194. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -2
  195. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
  196. package/styled-components/cjs/components/Calendar/hoc/withRange.js +2 -2
  197. package/styled-components/cjs/components/Calendar/hooks/useKeyNavigation.js +20 -20
  198. package/styled-components/cjs/components/Calendar/store/reducer.js +1 -1
  199. package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.js +1 -1
  200. package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  201. package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  202. package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -2
  203. package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -2
  204. package/styled-components/cjs/components/Cell/Cell.js +1 -1
  205. package/styled-components/cjs/components/Cell/Cell.styles.js +1 -1
  206. package/styled-components/cjs/components/Checkbox/Checkbox.js +1 -1
  207. package/styled-components/cjs/components/Chip/Chip.js +17 -5
  208. package/styled-components/cjs/components/Chip/Chip.styles.js +1 -1
  209. package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +2 -2
  210. package/styled-components/cjs/components/Chip/Chip.tokens.js +5 -1
  211. package/styled-components/cjs/components/Chip/variations/_pilled/base.js +9 -0
  212. package/styled-components/cjs/components/Chip/variations/_pilled/tokens.json +4 -0
  213. package/styled-components/cjs/components/Combobox/Combobox.js +6 -6
  214. package/styled-components/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  215. package/styled-components/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +2 -2
  216. package/styled-components/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +7 -7
  217. package/styled-components/cjs/components/Counter/Counter.js +1 -1
  218. package/styled-components/cjs/components/Divider/Divider.js +2 -2
  219. package/styled-components/cjs/components/Drawer/Drawer.js +1 -1
  220. package/styled-components/cjs/components/Drawer/DrawerContext.js +1 -1
  221. package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +1 -1
  222. package/styled-components/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  223. package/styled-components/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  224. package/styled-components/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  225. package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -1
  226. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +1 -1
  227. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +1 -1
  228. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +1 -1
  229. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +1 -1
  230. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -4
  231. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -1
  232. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -1
  233. package/styled-components/cjs/components/Grid/Grid.js +2 -2
  234. package/styled-components/cjs/components/Grid/ui/Col/Col.js +2 -2
  235. package/styled-components/cjs/components/Grid/ui/Row/Row.js +1 -1
  236. package/styled-components/cjs/components/Grid/utils/index.js +1 -1
  237. package/styled-components/cjs/components/Header/HeaderRoot/HeaderRoot.js +1 -1
  238. package/styled-components/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +1 -1
  239. package/styled-components/cjs/components/Header/ui/HeaderLogo/HeaderLogo.js +1 -1
  240. package/styled-components/cjs/components/Header/ui/HeaderTitleWrapper/HeaderTitleWrapper.js +1 -1
  241. package/styled-components/cjs/components/Image/Image.js +2 -2
  242. package/styled-components/cjs/components/Image/Image.styles.js +1 -1
  243. package/styled-components/cjs/components/Indicator/Indicator.js +1 -1
  244. package/styled-components/cjs/components/Link/Link.js +1 -1
  245. package/styled-components/cjs/components/Modal/Modal.js +1 -1
  246. package/styled-components/cjs/components/Modal/ModalContext.js +1 -1
  247. package/styled-components/cjs/components/Modal/hooks/useModal.js +1 -1
  248. package/styled-components/cjs/components/Notification/Notification.js +1 -1
  249. package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
  250. package/styled-components/cjs/components/Notification/NotificationsPortal.js +1 -1
  251. package/styled-components/cjs/components/Notification/NotificationsStore.js +1 -1
  252. package/styled-components/cjs/components/Overlay/Overlay.js +2 -2
  253. package/styled-components/cjs/components/Pagination/Pagination.js +3 -3
  254. package/styled-components/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +2 -2
  255. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  256. package/styled-components/cjs/components/Panel/Panel.js +2 -2
  257. package/styled-components/cjs/components/Panel/ui/PanelContent/PanelContent.js +1 -1
  258. package/styled-components/cjs/components/Panel/ui/PanelFooter/PanelFooter.js +1 -1
  259. package/styled-components/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -1
  260. package/styled-components/cjs/components/Popover/Popover.js +9 -9
  261. package/styled-components/cjs/components/Popup/Popup.js +2 -2
  262. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  263. package/styled-components/cjs/components/Popup/PopupRoot.js +1 -1
  264. package/styled-components/cjs/components/Popup/hooks/usePopup.js +1 -1
  265. package/styled-components/cjs/components/Progress/Progress.js +1 -1
  266. package/styled-components/cjs/components/Progress/Progress.styles.js +1 -1
  267. package/styled-components/cjs/components/Radiobox/Radiobox.js +1 -1
  268. package/styled-components/cjs/components/SSRProvider/SSRProvider.js +1 -1
  269. package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -1
  270. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +1 -1
  271. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.styles.js +1 -1
  272. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +3 -3
  273. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.styles.js +1 -1
  274. package/styled-components/cjs/components/Select/Select.js +6 -6
  275. package/styled-components/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  276. package/styled-components/cjs/components/Select/ui/SelectChip/SelectChip.js +2 -2
  277. package/styled-components/cjs/components/Select/ui/SelectTarget/SelectTarget.js +3 -3
  278. package/styled-components/cjs/components/Select/utils/index.js +3 -3
  279. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +1 -1
  280. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -1
  281. package/styled-components/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +1 -1
  282. package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -2
  283. package/styled-components/cjs/components/Skeleton/hoc/withSkeleton.js +1 -1
  284. package/styled-components/cjs/components/Spinner/Spinner.js +1 -1
  285. package/styled-components/cjs/components/Spinner/Spinner.styles.js +1 -1
  286. package/styled-components/cjs/components/Spinner/utils/index.js +1 -1
  287. package/styled-components/cjs/components/Switch/Switch.js +1 -1
  288. package/styled-components/cjs/components/Tabs/TabsContext.js +3 -2
  289. package/styled-components/cjs/components/Tabs/createTabsController.js +1 -1
  290. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.js +2 -2
  291. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.styles.js +1 -1
  292. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.js +3 -3
  293. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.styles.js +1 -1
  294. package/styled-components/cjs/components/TextArea/TextArea.js +2 -2
  295. package/styled-components/cjs/components/TextField/TextField.js +3 -3
  296. package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  297. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +2 -2
  298. package/styled-components/cjs/components/Toast/Toast.js +2 -2
  299. package/styled-components/cjs/components/Toast/Toast.styles.js +1 -1
  300. package/styled-components/cjs/components/Toast/ToastController.js +2 -2
  301. package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +3 -3
  302. package/styled-components/cjs/components/Toolbar/Toolbar.js +1 -1
  303. package/styled-components/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  304. package/styled-components/cjs/components/Tooltip/Tooltip.js +2 -2
  305. package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +2 -2
  306. package/styled-components/cjs/components/Typography/Old/TypographyOld.js +2 -2
  307. package/styled-components/cjs/components/Typography/Typography.js +2 -2
  308. package/styled-components/cjs/engines/common.js +1 -1
  309. package/styled-components/cjs/engines/styled-components.js +1 -1
  310. package/styled-components/cjs/examples/_helpers.js +1 -1
  311. package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.config.js +10 -7
  312. package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.stories.tsx +18 -2
  313. package/styled-components/cjs/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  314. package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.config.js +10 -7
  315. package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.stories.tsx +18 -2
  316. package/styled-components/cjs/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  317. package/styled-components/cjs/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  318. package/styled-components/cjs/mixins/applySpacing.js +1 -1
  319. package/styled-components/cjs/mixins/typography.js +1 -1
  320. package/styled-components/es/components/Button/Button.js +1 -1
  321. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  322. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  323. package/styled-components/es/components/Calendar/hoc/withRange.js +1 -1
  324. package/styled-components/es/components/Calendar/hooks/useKeyNavigation.js +20 -20
  325. package/styled-components/es/components/Calendar/store/reducer.js +1 -1
  326. package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  327. package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  328. package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  329. package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  330. package/styled-components/es/components/Chip/Chip.js +17 -5
  331. package/styled-components/es/components/Chip/Chip.template-doc.mdx +2 -2
  332. package/styled-components/es/components/Chip/Chip.tokens.js +4 -0
  333. package/styled-components/es/components/Chip/variations/_pilled/base.js +3 -0
  334. package/styled-components/es/components/Chip/variations/_pilled/tokens.json +4 -0
  335. package/styled-components/es/components/Combobox/Combobox.js +5 -5
  336. package/styled-components/es/components/Combobox/hooks/useFocusController.js +9 -9
  337. package/styled-components/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  338. package/styled-components/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  339. package/styled-components/es/components/Divider/Divider.js +1 -1
  340. package/styled-components/es/components/Drawer/DrawerContext.js +1 -1
  341. package/styled-components/es/components/Drawer/hooks/useDrawer.js +1 -1
  342. package/styled-components/es/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  343. package/styled-components/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  344. package/styled-components/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  345. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -3
  346. package/styled-components/es/components/Grid/Grid.js +1 -1
  347. package/styled-components/es/components/Grid/ui/Col/Col.js +1 -1
  348. package/styled-components/es/components/Grid/utils/index.js +1 -1
  349. package/styled-components/es/components/Image/Image.js +1 -1
  350. package/styled-components/es/components/Modal/ModalContext.js +1 -1
  351. package/styled-components/es/components/Modal/hooks/useModal.js +1 -1
  352. package/styled-components/es/components/Notification/NotificationsStore.js +1 -1
  353. package/styled-components/es/components/Overlay/Overlay.js +1 -1
  354. package/styled-components/es/components/Pagination/Pagination.js +2 -2
  355. package/styled-components/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  356. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  357. package/styled-components/es/components/Panel/Panel.js +1 -1
  358. package/styled-components/es/components/Popover/Popover.js +8 -8
  359. package/styled-components/es/components/Popup/Popup.js +1 -1
  360. package/styled-components/es/components/Popup/hooks/usePopup.js +1 -1
  361. package/styled-components/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  362. package/styled-components/es/components/Select/Select.js +5 -5
  363. package/styled-components/es/components/Select/hooks/useKeyNavigation.js +12 -12
  364. package/styled-components/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  365. package/styled-components/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  366. package/styled-components/es/components/Select/utils/index.js +3 -3
  367. package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -1
  368. package/styled-components/es/components/Skeleton/hoc/withSkeleton.js +1 -1
  369. package/styled-components/es/components/Spinner/utils/index.js +1 -1
  370. package/styled-components/es/components/Tabs/TabsContext.js +3 -2
  371. package/styled-components/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  372. package/styled-components/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  373. package/styled-components/es/components/TextArea/TextArea.js +1 -1
  374. package/styled-components/es/components/TextField/TextField.js +2 -2
  375. package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  376. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  377. package/styled-components/es/components/Toast/Toast.js +1 -1
  378. package/styled-components/es/components/Toast/ToastController.js +1 -1
  379. package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  380. package/styled-components/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  381. package/styled-components/es/components/Tooltip/Tooltip.js +1 -1
  382. package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +1 -1
  383. package/styled-components/es/components/Typography/Old/TypographyOld.js +1 -1
  384. package/styled-components/es/components/Typography/Typography.js +1 -1
  385. package/styled-components/es/engines/common.js +1 -1
  386. package/styled-components/es/examples/_helpers.js +1 -1
  387. package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.config.js +10 -7
  388. package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.stories.tsx +18 -2
  389. package/styled-components/es/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  390. package/styled-components/es/examples/plasma_web/components/Chip/Chip.config.js +10 -7
  391. package/styled-components/es/examples/plasma_web/components/Chip/Chip.stories.tsx +18 -2
  392. package/styled-components/es/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  393. package/styled-components/es/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  394. package/styled-components/es/mixins/applySpacing.js +1 -1
  395. package/styled-components/es/mixins/typography.js +1 -1
  396. package/types/components/Chip/Chip.d.ts +4 -0
  397. package/types/components/Chip/Chip.d.ts.map +1 -1
  398. package/types/components/Chip/Chip.tokens.d.ts +4 -0
  399. package/types/components/Chip/Chip.tokens.d.ts.map +1 -1
  400. package/types/components/Chip/Chip.types.d.ts +6 -0
  401. package/types/components/Chip/Chip.types.d.ts.map +1 -1
  402. package/types/components/Chip/variations/_pilled/base.d.ts +2 -0
  403. package/types/components/Chip/variations/_pilled/base.d.ts.map +1 -0
  404. package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts +4 -1
  405. package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts.map +1 -1
  406. package/types/examples/plasma_b2c/components/Chip/Chip.d.ts +4 -1
  407. package/types/examples/plasma_b2c/components/Chip/Chip.d.ts.map +1 -1
  408. package/types/examples/plasma_web/components/Chip/Chip.config.d.ts +4 -1
  409. package/types/examples/plasma_web/components/Chip/Chip.config.d.ts.map +1 -1
  410. package/types/examples/plasma_web/components/Chip/Chip.d.ts +4 -1
  411. package/types/examples/plasma_web/components/Chip/Chip.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useYears } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex, StyledYear, StyledYearRoot } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n startYear,\n selectIndexes,\n outerRefs,\n onChangeYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears(currentDate, startYear);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { year } = event.currentTarget.dataset;\n onChangeYear(Number(year));\n },\n [onChangeYear],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(({ yearValue, isSelected, isCurrent }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = !isSelected && isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledYearRoot\n className={cx(selectedClass, currentClass, classes.selectableItem)}\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n tabIndex={i === selectIndexes?.[0] && j === selectIndexes?.[1] ? 0 : -1}\n onClick={handleOnChangeYear}\n data-year={yearValue}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledYear-${i}-${j}`}\n aria-label={String(yearValue)}\n >\n <StyledYear>{yearValue}</StyledYear>\n </StyledYearRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","startYear","selectIndexes","outerRefs","onChangeYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeYear","useCallback","event","nativeEvent","stopImmediatePropagation","year","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledYearRoot","className","cx","selectableItem","ref","tabIndex","onClick","concat","String","StyledYear"],"mappings":";;;;;;;AASA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAQlD;AAAA,EAAA,IAPIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAAC,SAAA,GAA0BC,QAAQ,CAACT,WAAW,EAAEE,SAAS,CAAC;IAAAQ,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAnDI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AACtB,EAAA,IAAMI,WAAW,GAAGC,MAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,MAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,kBAAkB,GAAGC,WAAW,CAClC,UAACC,KAAuC,EAAK;AACzC;AACZ;AACA;AACA;AACA;AACYA,IAAAA,KAAK,CAACC,WAAW,CAACC,wBAAwB,EAAE,CAAA;IAE5C,IAAQC,IAAI,GAAKH,KAAK,CAACI,aAAa,CAACC,OAAO,CAApCF,IAAI,CAAA;AACZjB,IAAAA,YAAY,CAACoB,MAAM,CAACH,IAAI,CAAC,CAAC,CAAA;AAC9B,GAAC,EACD,CAACjB,YAAY,CACjB,CAAC,CAAA;EAED,IAAMqB,OAAO,GAAGR,WAAW,CACvB,UAACS,OAAuB,EAAEC,CAAS,E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AA,CAAAC,aAAA,CAACgB,cAAc,EAAA;QACXC,SAAS,EAAEC,EAAE,CAACR,aAAa,EAAEI,YAAY,EAAEH,OAAO,CAACQ,cAAc,CAAE;QACnEC,GAAG,EAAE,SAAAA,GAAAA,CAAC5B,OAAuB,EAAA;AAAA,UAAA,OAAKD,OAAO,CAACC,OAAO,EAAEC,CAAC,EAAEC,CAAC,CAAC,CAAA;SAAC;QACzD2B,QAAQ,EAAE5B,CAAC,MAAKzB,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAI0B,IAAAA,CAAC,MAAK1B,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAG,GAAA,CAAC,GAAG,CAAC,CAAE;AACxEsD,QAAAA,OAAO,EAAExC,kBAAmB;AAC5B,QAAA,WAAA,EAAWyB,SAAU;AACrB,QAAA,eAAA,EAAeC,UAAW;AAC1BN,QAAAA,IAAI,EAAC,UAAU;QACfG,GAAG,EAAA,aAAA,CAAAkB,MAAA,CAAgB9B,CAAC,OAAA8B,MAAA,CAAI7B,CAAC,CAAG;QAC5B,YAAY8B,EAAAA,MAAM,CAACjB,SAAS,CAAA;OAE5BR,eAAAA,KAAA,CAAAC,aAAA,CAACyB,UAAU,EAAElB,IAAAA,EAAAA,SAAsB,CACvB,CAAC,CAAA;AAEzB,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
1
+ {"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useYears } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex, StyledYear, StyledYearRoot } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n startYear,\n selectIndexes,\n outerRefs,\n onChangeYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears(currentDate, startYear);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { year } = event.currentTarget.dataset;\n onChangeYear(Number(year));\n },\n [onChangeYear],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(({ yearValue, isSelected, isCurrent }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = !isSelected && isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledYearRoot\n className={cx(selectedClass, currentClass, classes.selectableItem)}\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n tabIndex={i === selectIndexes?.[0] && j === selectIndexes?.[1] ? 0 : -1}\n onClick={handleOnChangeYear}\n data-year={yearValue}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledYear-${i}-${j}`}\n aria-label={String(yearValue)}\n >\n <StyledYear>{yearValue}</StyledYear>\n </StyledYearRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","startYear","selectIndexes","outerRefs","onChangeYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeYear","useCallback","event","nativeEvent","stopImmediatePropagation","year","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledYearRoot","className","cx","selectableItem","ref","tabIndex","onClick","concat","String","StyledYear"],"mappings":";;;;;;;AASA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAQlD;AAAA,EAAA,IAPIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAAC,SAAA,GAA0BC,QAAQ,CAACT,WAAW,EAAEE,SAAS,CAAC;IAAAQ,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAnDI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AACtB,EAAA,IAAMI,WAAW,GAAGC,MAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,MAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,kBAAkB,GAAGC,WAAW,CAClC,UAACC,KAAuC,EAAK;AACzC;AACZ;AACA;AACA;AACA;AACYA,IAAAA,KAAK,CAACC,WAAW,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B,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
@@ -10,6 +10,8 @@
10
10
 
11
11
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
12
12
 
13
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
14
+
13
15
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
14
16
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
15
17
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@@ -1,15 +1,17 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useMemo } from 'react';
3
3
  import { IconClose } from '../_Icon/Icons/IconClose.js';
4
+ import { cx } from '../../utils/index.js';
4
5
  import { base as base$1 } from './variations/_view/base.js';
5
6
  import { base as base$2 } from './variations/_size/base.js';
6
7
  import { base as base$3 } from './variations/_disabled/base.js';
7
8
  import { base as base$4 } from './variations/_readonly/base.js';
8
9
  import { base as base$5 } from './variations/_focused/base.js';
10
+ import { base as base$6 } from './variations/_pilled/base.js';
9
11
  import { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles.js';
10
- import { tokens } from './Chip.tokens.js';
12
+ import { tokens, classes } from './Chip.tokens.js';
11
13
 
12
- var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "onClear", "onClick", "readOnly", "disabled"];
14
+ var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "className", "onClear", "onClick", "pilled", "readOnly", "disabled"];
13
15
  var chipRoot = function chipRoot(Root) {
14
16
  return /*#__PURE__*/forwardRef(function (props, ref) {
15
17
  var children = props.children,
@@ -18,20 +20,24 @@ var chipRoot = function chipRoot(Root) {
18
20
  contentRight = props.contentRight,
19
21
  contentClearButton = props.contentClearButton,
20
22
  size = props.size,
23
+ className = props.className,
21
24
  onClear = props.onClear,
22
25
  onClick = props.onClick,
26
+ _props$pilled = props.pilled,
27
+ pilled = _props$pilled === void 0 ? false : _props$pilled,
23
28
  _props$readOnly = props.readOnly,
24
29
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
25
30
  _props$disabled = props.disabled,
26
31
  disabled = _props$disabled === void 0 ? false : _props$disabled,
27
32
  rest = _objectWithoutProperties(props, _excluded);
28
33
  var txt = !text && typeof children === 'string' ? children : text;
34
+ var pilledClass = pilled ? classes.pilled : undefined;
29
35
  var handleClick = function handleClick(event) {
30
36
  if (disabled || readOnly) {
31
37
  return;
32
38
  }
33
- onClick === null || onClick === void 0 || onClick(event);
34
- onClear === null || onClear === void 0 || onClear();
39
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
40
+ onClear === null || onClear === void 0 ? void 0 : onClear();
35
41
  };
36
42
  var ClearContent = useMemo(function () {
37
43
  return contentClearButton || /*#__PURE__*/React.createElement(StyledContentClear, null, /*#__PURE__*/React.createElement(IconClose, {
@@ -42,9 +48,11 @@ var chipRoot = function chipRoot(Root) {
42
48
  return /*#__PURE__*/React.createElement(Root, _extends({
43
49
  type: "button",
44
50
  ref: ref,
51
+ className: cx(pilledClass, className),
45
52
  tabIndex: readOnly ? -1 : 0,
46
53
  onClick: handleClick,
47
54
  disabled: disabled,
55
+ pilled: pilled,
48
56
  readOnly: !disabled && readOnly,
49
57
  size: size
50
58
  }, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), ClearContent);
@@ -72,10 +80,14 @@ var chipConfig = {
72
80
  },
73
81
  focused: {
74
82
  css: base$5
83
+ },
84
+ pilled: {
85
+ css: base$6,
86
+ attrs: true
75
87
  }
76
88
  },
77
89
  defaults: {
78
- view: 'primary',
90
+ view: 'default',
79
91
  size: 'm'
80
92
  }
81
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n size,\n onClear,\n onClick,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const ClearContent = useMemo(() => {\n return (\n contentClearButton || (\n <StyledContentClear>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n )\n );\n }, [contentClearButton, tokens.closeIconSize]);\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {ClearContent}\n </Root>\n );\n });\n\nexport const chipConfig = {\n name: 'Chip',\n tag: 'button',\n layout: chipRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readonlyCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","size","onClear","onClick","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","handleClick","event","ClearContent","useMemo","React","createElement","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","_extends","type","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;IAcaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,UAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAWRF,KAAK,CAXLE,QAAQ;MACRC,IAAI,GAUJH,KAAK,CAVLG,IAAI;MACJC,WAAW,GASXJ,KAAK,CATLI,WAAW;MACXC,YAAY,GAQZL,KAAK,CARLK,YAAY;MACZC,kBAAkB,GAOlBN,KAAK,CAPLM,kBAAkB;MAClBC,IAAI,GAMJP,KAAK,CANLO,IAAI;MACJC,OAAO,GAKPR,KAAK,CALLQ,OAAO;MACPC,OAAO,GAIPT,KAAK,CAJLS,OAAO;MAAAC,eAAA,GAIPV,KAAK,CAHLW,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,eAAA,GAGhBZ,KAAK,CAFLa,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;AACbE,MAAAA,IAAI,GAAAC,wBAAA,CACPf,KAAK,EAAAgB,SAAA,CAAA,CAAA;AAET,IAAA,IAAMC,GAAG,GAAG,CAACd,IAAI,IAAI,OAAOD,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGC,IAAI,CAAA;AAEnE,IAAA,IAAMe,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAA0C,EAAK;MAChE,IAAIN,QAAQ,IAAIF,QAAQ,EAAE;AACtB,QAAA,OAAA;AACJ,OAAA;AAEAF,MAAAA,OAAO,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,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMgB,UAAU,GAAG;AACtBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,MAAM,EAAE1C,QAAQ;AAChB2C,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDrC,IAAAA,IAAI,EAAE;AACFoC,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDhC,IAAAA,QAAQ,EAAE;AACN8B,MAAAA,GAAG,EAAEG,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDpC,IAAAA,QAAQ,EAAE;AACNgC,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDE,IAAAA,OAAO,EAAE;AACLN,MAAAA,GAAG,EAAEO,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNT,IAAAA,IAAI,EAAE,SAAS;AACfnC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n size,\n className,\n onClear,\n onClick,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const ClearContent = useMemo(() => {\n return (\n contentClearButton || (\n <StyledContentClear>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n )\n );\n }, [contentClearButton, tokens.closeIconSize]);\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {ClearContent}\n </Root>\n );\n });\n\nexport const chipConfig = {\n name: 'Chip',\n tag: 'button',\n layout: chipRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readonlyCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","size","className","onClear","onClick","_props$pilled","pilled","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","pilledClass","classes","undefined","handleClick","event","ClearContent","useMemo","React","createElement","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","_extends","type","cx","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;IAgBaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,UAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAaRF,KAAK,CAbLE,QAAQ;MACRC,IAAI,GAYJH,KAAK,CAZLG,IAAI;MACJC,WAAW,GAWXJ,KAAK,CAXLI,WAAW;MACXC,YAAY,GAUZL,KAAK,CAVLK,YAAY;MACZC,kBAAkB,GASlBN,KAAK,CATLM,kBAAkB;MAClBC,IAAI,GAQJP,KAAK,CARLO,IAAI;MACJC,SAAS,GAOTR,KAAK,CAPLQ,SAAS;MACTC,OAAO,GAMPT,KAAK,CANLS,OAAO;MACPC,OAAO,GAKPV,KAAK,CALLU,OAAO;MAAAC,aAAA,GAKPX,KAAK,CAJLY,MAAM;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,eAAA,GAIdb,KAAK,CAHLc,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,eAAA,GAGhBf,KAAK,CAFLgB,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;AACbE,MAAAA,IAAI,GAAAC,wBAAA,CACPlB,KAAK,EAAAmB,SAAA,CAAA,CAAA;AAET,IAAA,IAAMC,GAAG,GAAG,CAACjB,IAAI,IAAI,OAAOD,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGC,IAAI,CAAA;I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1,6 @@
1
+ var classes = {
2
+ pilled: 'chip-pilled'
3
+ };
1
4
  var tokens = {
2
5
  background: '--plasma-chip-background',
3
6
  color: '--plasma-chip-color',
@@ -15,6 +18,7 @@ var tokens = {
15
18
  outlineSize: '--plasma-chip-outline-size',
16
19
  closeIconColor: '--plasma-chip-close-icon-color',
17
20
  borderRadius: '--plasma-chip-border-radius',
21
+ pilledBorderRadius: '--plasma-chip-pilled-border-radius',
18
22
  width: '--plasma-chip-width',
19
23
  height: '--plasma-chip-height',
20
24
  paddingTop: '--plasma-chip-padding-top',
@@ -37,5 +41,5 @@ var tokens = {
37
41
  clearContentMarginRight: '--plasma-chip-clear-content-margin-right'
38
42
  };
39
43
 
40
- export { tokens };
44
+ export { classes, tokens };
41
45
  //# sourceMappingURL=Chip.tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.tokens.js","sources":["../../../src/components/Chip/Chip.tokens.ts"],"sourcesContent":["export const tokens = {\n background: '--plasma-chip-background',\n color: '--plasma-chip-color',\n backgroundHover: '--plasma-chip-background-hover',\n colorHover: '--plasma-chip-color-hover',\n scaleHover: '--plasma-chip-scale-hover',\n backgroundReadOnly: '--plasma-chip-background-readonly',\n colorReadOnly: '--plasma-chip-color-readonly',\n backgroundReadOnlyHover: '--plasma-chip-background-readonly-hover',\n colorReadOnlyHover: '--plasma-chip-color-readonly-hover',\n backgroundActive: '--plasma-chip-background-active',\n colorActive: '--plasma-chip-color-active',\n scaleActive: '--plasma-chip-scale-active',\n focusColor: '--plasma-chip-focus-color',\n outlineSize: '--plasma-chip-outline-size',\n closeIconColor: '--plasma-chip-close-icon-color',\n\n borderRadius: '--plasma-chip-border-radius',\n width: '--plasma-chip-width',\n height: '--plasma-chip-height',\n paddingTop: '--plasma-chip-padding-top',\n paddingRight: '--plasma-chip-padding-right',\n paddingBottom: '--plasma-chip-padding-bottom',\n paddingLeft: '--plasma-chip-padding-left',\n closeIconSize: '--plasma-chip-close-icon-size',\n\n disabledOpacity: '--plasma-chip-disabled-opacity',\n\n fontFamily: '--plasma-chip-font-family',\n fontSize: '--plasma-chip-font-size',\n fontStyle: '--plasma-chip-font-style',\n fontWeight: '--plasma-chip-font-weight',\n letterSpacing: '--plasma-chip-letter-spacing',\n lineHeight: '--plasma-chip-lineheight',\n\n leftContentMarginLeft: '--plasma-chip-left-content-margin-left',\n leftContentMarginRight: '--plasma-chip-left-content-margin-right',\n rightContentMarginLeft: '--plasma-chip-right-content-margin-left',\n rightContentMarginRight: '--plasma-chip-right-content-margin-right',\n clearContentMarginLeft: '--plasma-chip-clear-content-margin-left',\n clearContentMarginRight: '--plasma-chip-clear-content-margin-right',\n};\n"],"names":["tokens","background","color","backgroundHover","colorHover","scaleHover","backgroundReadOnly","colorReadOnly","backgroundReadOnlyHover","colorReadOnlyHover","backgroundActive","colorActive","scaleActive","focusColor","outlineSize","closeIconColor","borderRadius","width","height","paddingTop","paddingRight","paddingBottom","paddingLeft","closeIconSize","disabledOpacity","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","leftContentMarginLeft","leftContentMarginRight","rightContentMarginLeft","rightContentMarginRight","clearContentMarginLeft","clearContentMarginRight"],"mappings":"AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,0BAA0B;AACtCC,EAAAA,KAAK,EAAE,qBAAqB;AAC5BC,EAAAA,eAAe,EAAE,gCAAgC;AACjDC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,kBAAkB,EAAE,mCAAmC;AACvDC,EAAAA,aAAa,EAAE,8BAA8B;AAC7CC,EAAAA,uBAAuB,EAAE,yCAAyC;AAClEC,EAAAA,kBAAkB,EAAE,oCAAoC;AACxDC,EAAAA,gBAAgB,EAAE,iCAAiC;AACnDC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,cAAc,EAAE,gCAAgC;AAEhDC,EAAAA,YAAY,EAAE,6BAA6B;AAC3CC,EAAAA,KAAK,EAAE,qBAAqB;AAC5BC,EAAAA,MAAM,EAAE,sBAAsB;AAC9BC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,YAAY,EAAE,6BAA6B;AAC3CC,EAAAA,aAAa,EAAE,8BAA8B;AAC7CC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,aAAa,EAAE,+BAA+B;AAE9CC,EAAAA,eAAe,EAAE,gCAAgC;AAEjDC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,QAAQ,EAAE,yBAAyB;AACnCC,EAAAA,SAAS,EAAE,0BAA0B;AACrCC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,aAAa,EAAE,8BAA8B;AAC7CC,EAAAA,UAAU,EAAE,0BAA0B;AAEtCC,EAAAA,qBAAqB,EAAE,wCAAwC;AAC/DC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,uBAAuB,EAAE,0CAA0C;AACnEC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,uBAAuB,EAAE,0CAAA;AAC7B;;;;"}
1
+ {"version":3,"file":"Chip.tokens.js","sources":["../../../src/components/Chip/Chip.tokens.ts"],"sourcesContent":["export const classes = {\n pilled: 'chip-pilled',\n};\n\nexport const tokens = {\n background: '--plasma-chip-background',\n color: '--plasma-chip-color',\n backgroundHover: '--plasma-chip-background-hover',\n colorHover: '--plasma-chip-color-hover',\n scaleHover: '--plasma-chip-scale-hover',\n backgroundReadOnly: '--plasma-chip-background-readonly',\n colorReadOnly: '--plasma-chip-color-readonly',\n backgroundReadOnlyHover: '--plasma-chip-background-readonly-hover',\n colorReadOnlyHover: '--plasma-chip-color-readonly-hover',\n backgroundActive: '--plasma-chip-background-active',\n colorActive: '--plasma-chip-color-active',\n scaleActive: '--plasma-chip-scale-active',\n focusColor: '--plasma-chip-focus-color',\n outlineSize: '--plasma-chip-outline-size',\n closeIconColor: '--plasma-chip-close-icon-color',\n\n borderRadius: '--plasma-chip-border-radius',\n pilledBorderRadius: '--plasma-chip-pilled-border-radius',\n width: '--plasma-chip-width',\n height: '--plasma-chip-height',\n paddingTop: '--plasma-chip-padding-top',\n paddingRight: '--plasma-chip-padding-right',\n paddingBottom: '--plasma-chip-padding-bottom',\n paddingLeft: '--plasma-chip-padding-left',\n closeIconSize: '--plasma-chip-close-icon-size',\n\n disabledOpacity: '--plasma-chip-disabled-opacity',\n\n fontFamily: '--plasma-chip-font-family',\n fontSize: '--plasma-chip-font-size',\n fontStyle: '--plasma-chip-font-style',\n fontWeight: '--plasma-chip-font-weight',\n letterSpacing: '--plasma-chip-letter-spacing',\n lineHeight: '--plasma-chip-lineheight',\n\n leftContentMarginLeft: '--plasma-chip-left-content-margin-left',\n leftContentMarginRight: '--plasma-chip-left-content-margin-right',\n rightContentMarginLeft: '--plasma-chip-right-content-margin-left',\n rightContentMarginRight: '--plasma-chip-right-content-margin-right',\n clearContentMarginLeft: '--plasma-chip-clear-content-margin-left',\n clearContentMarginRight: '--plasma-chip-clear-content-margin-right',\n};\n"],"names":["classes","pilled","tokens","background","color","backgroundHover","colorHover","scaleHover","backgroundReadOnly","colorReadOnly","backgroundReadOnlyHover","colorReadOnlyHover","backgroundActive","colorActive","scaleActive","focusColor","outlineSize","closeIconColor","borderRadius","pilledBorderRadius","width","height","paddingTop","paddingRight","paddingBottom","paddingLeft","closeIconSize","disabledOpacity","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","leftContentMarginLeft","leftContentMarginRight","rightContentMarginLeft","rightContentMarginRight","clearContentMarginLeft","clearContentMarginRight"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,MAAM,EAAE,aAAA;AACZ,EAAC;AAEM,IAAMC,MAAM,GA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,EAAAA,uBAAuB,EAAE,0CAA0C;AACnEC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,uBAAuB,EAAE,0CAAA;AAC7B;;;;"}
@@ -0,0 +1,5 @@
1
+ import './base_3kce4h.css';
2
+ var base = "bvcavwi";
3
+
4
+ export { base };
5
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/Chip/variations/_pilled/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../Chip.tokens';\n\nexport const base = css`\n &.${String(classes.pilled)} {\n border-radius: var(${tokens.pilledBorderRadius});\n }\n`;\n"],"names":["base"],"mappings":"AAIO,IAAMA,IAAI,GAIhB;;;;"}
@@ -0,0 +1 @@
1
+ .bvcavwi.chip-pilled{border-radius:var(--plasma-chip-pilled-border-radius);}
@@ -35,6 +35,8 @@
35
35
 
36
36
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
37
37
 
38
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
39
+
38
40
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
39
41
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
40
42
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@@ -129,12 +129,12 @@ var comboboxRoot = function comboboxRoot(Root) {
129
129
  if (rest.valueType === 'multiple') {
130
130
  var _rest$onChangeValue;
131
131
  var _newSelected = getNewSelected(rest.value, newValue, rest.valueType);
132
- (_rest$onChangeValue = rest.onChangeValue) === null || _rest$onChangeValue === void 0 || _rest$onChangeValue.call(rest, _newSelected);
132
+ (_rest$onChangeValue = rest.onChangeValue) === null || _rest$onChangeValue === void 0 ? void 0 : _rest$onChangeValue.call(rest, _newSelected);
133
133
  return;
134
134
  }
135
135
  var newSelected = getNewSelected(rest.value, newValue, 'single');
136
- (_rest$onChangeValue2 = rest.onChangeValue) === null || _rest$onChangeValue2 === void 0 || _rest$onChangeValue2.call(rest, newSelected);
137
- onInnerToggle === null || onInnerToggle === void 0 || onInnerToggle(false, event);
136
+ (_rest$onChangeValue2 = rest.onChangeValue) === null || _rest$onChangeValue2 === void 0 ? void 0 : _rest$onChangeValue2.call(rest, newSelected);
137
+ onInnerToggle === null || onInnerToggle === void 0 ? void 0 : onInnerToggle(false, event);
138
138
  closedWithoutChanges.current = false;
139
139
  };
140
140
  var onClickChildrenItem = function onClickChildrenItem(event) {
@@ -148,7 +148,7 @@ var comboboxRoot = function comboboxRoot(Root) {
148
148
  if (rest.valueType !== 'multiple') {
149
149
  return;
150
150
  }
151
- (_rest$onChangeValue3 = rest.onChangeValue) === null || _rest$onChangeValue3 === void 0 || _rest$onChangeValue3.call(rest, newValue);
151
+ (_rest$onChangeValue3 = rest.onChangeValue) === null || _rest$onChangeValue3 === void 0 ? void 0 : _rest$onChangeValue3.call(rest, newValue);
152
152
  };
153
153
  var _useKeyNavigation = useKeyNavigation({
154
154
  controlledRefs: controlledRefs,
@@ -175,7 +175,7 @@ var comboboxRoot = function comboboxRoot(Root) {
175
175
  setInnerOpened(newOpened !== null && newOpened !== void 0 ? newOpened : true);
176
176
  };
177
177
  var onKeyDownHandle = function onKeyDownHandle(event) {
178
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
178
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
179
179
  onKeyDownTarget(event);
180
180
  };
181
181
  return /*#__PURE__*/React.createElement(StyledRoot, {
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import React, { Children, forwardRef, useEffect, useRef, useState } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { getPlacements } from '../Dropdown/utils';\nimport { getChildren, getNewSelected, getValues } from '../Select/utils';\nimport { useKeyNavigation } from '../Select/hooks';\nimport { useDidMountEffect, useForceUpdate } from '../../hooks';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { ComboboxTarget } from './ui';\nimport { ComboboxItemNotFound, StyledPopover, StyledRoot, StyledCombobox, StyledNativeSelect } from './Combobox.styles';\nimport type { ComboboxPrimitiveValue, ComboboxProps } from './Combobox.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, ComboboxProps>) =>\n forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n name,\n form,\n readOnly,\n disabled,\n label,\n placeholder,\n id,\n children,\n role,\n view,\n size,\n frame,\n usePortal,\n negativeResultContent = 'Элементы не найдены',\n enumerationType = 'comma',\n opened = false,\n placement = 'bottom',\n onToggle,\n onKeyDown,\n filterFunction,\n ...rest\n },\n outerRootRef,\n ) => {\n const forceUpdate = useForceUpdate();\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const { valueType = 'single', value } = rest;\n const offset = [0, 4] as [number, number];\n\n const [ref, setRef] = useState<HTMLInputElement | null>(null);\n\n const targetRef = useRef<HTMLInputElement>(null);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n const comboboxRef = useRef<HTMLDivElement>(null);\n const itemsRefs = useRef<Array<HTMLDivElement>>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef<HTMLInputElement>(targetRef, outerRootRef);\n const controlledRefs = { targetRef, chipsRefs, selectRef: comboboxRef, itemsRefs, inputRef };\n\n const [innerOpened, setInnerOpened] = useState(opened);\n const [search, setSearch] = useState<string | undefined>('');\n const [filterValue, setFilterValue] = useState(search);\n\n // INFO: нужно высчитывать для корректной работы портала\n const dynamicTargetWidth = targetRef.current?.offsetWidth;\n\n // INFO: Из-за того, что классы передаются через ref,\n // состояние пропсов после изменения view, size\n // всегда предыдущее, поэтому нужно делать форс-ререндер\n useDidMountEffect(() => {\n forceUpdate();\n }, [view, size]);\n\n useEffect(() => {\n if (disabled || readOnly) {\n return;\n }\n\n setInnerOpened(opened);\n }, [opened, disabled, readOnly]);\n\n useEffect(() => {\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (opened) {\n setFilterValue('');\n }\n }, []);\n\n const onInnerToggle = (openValue: boolean, event: React.SyntheticEvent | Event) => {\n if (disabled || readOnly) {\n return;\n }\n\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (!innerOpened) {\n setFilterValue('');\n }\n\n if (onToggle) {\n onToggle(openValue, event);\n\n return;\n }\n\n setInnerOpened(openValue);\n };\n\n const closedWithoutChanges = useRef(true);\n\n const updateValue = (item: HTMLElement, event: React.SyntheticEvent | Event) => {\n const {\n dataset: { value: newValue },\n } = item;\n\n if (rest.valueType === 'multiple') {\n const newSelected = getNewSelected(rest.value, newValue, rest.valueType);\n rest.onChangeValue?.(newSelected);\n\n return;\n }\n\n const newSelected = getNewSelected(rest.value, newValue, 'single');\n\n rest.onChangeValue?.(newSelected);\n\n onInnerToggle?.(false, event);\n\n closedWithoutChanges.current = false;\n };\n\n const onClickChildrenItem = (event: React.MouseEvent<HTMLDivElement>) => {\n // INFO: Для корректной работы компонента Popper\n event.stopPropagation();\n\n const item = event.currentTarget as HTMLElement;\n\n updateValue(item, event);\n };\n\n const onChangeChipValue = (newValue?: Array<ComboboxPrimitiveValue>) => {\n if (rest.valueType !== 'multiple') {\n return;\n }\n\n rest.onChangeValue?.(newValue);\n };\n\n const { onKeyDownTarget, onKeyDownSelect } = useKeyNavigation({\n controlledRefs,\n opened: innerOpened,\n enumerationType,\n valueType,\n componentType: 'combobox',\n value,\n search: filterValue,\n updateOpened: onInnerToggle,\n updateValue,\n });\n\n const childrenArray = Children.toArray(children) as React.ReactElement[];\n\n const childrenMemo = getChildren(\n childrenArray,\n { onClick: onClickChildrenItem, childrenRefs: itemsRefs },\n value,\n filterValue,\n filterFunction,\n ).filter(Boolean);\n\n const values = getValues(childrenArray, value);\n\n const onSearch = (newSearch?: string, newOpened?: boolean) => {\n setSearch(newSearch);\n setFilterValue(newSearch);\n setInnerOpened(newOpened ?? true);\n };\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n onKeyDownTarget(event);\n };\n\n return (\n <StyledRoot ref={comboboxRef}>\n <StyledNativeSelect\n aria-invalid=\"false\"\n aria-hidden=\"true\"\n aria-readonly={readOnly}\n tabIndex={-1}\n form={form}\n name={name}\n value={`${value}`}\n disabled={disabled || readOnly}\n />\n <StyledPopover\n role={role}\n isOpen={innerOpened}\n onToggle={onInnerToggle}\n target={\n <ComboboxTarget\n opened={innerOpened}\n values={values}\n label={label}\n placeholder={placeholder}\n search={search}\n enumerationType={enumerationType}\n valueType={valueType}\n readOnly={readOnly}\n disabled={disabled}\n size={size}\n closedWithoutChanges={closedWithoutChanges}\n ref={handleRef}\n chipsRefs={chipsRefs}\n inputRef={inputRef}\n id={innerId}\n onChange={onChangeChipValue}\n onSearch={onSearch}\n onKeyDown={onKeyDownHandle}\n {...rest}\n />\n }\n className={cx(ref?.classList.toString())} // INFO: Прокидываем стили для Popover\n id={innerId}\n offset={offset}\n placement={getPlacements(placement)}\n usePortal={usePortal}\n selectWidth={dynamicTargetWidth}\n frame={frame}\n trigger=\"click\"\n isFocusTrapped={false}\n preventOverflow={false}\n closeOnEsc={false}\n closeOnOverlayClick\n >\n <Root ref={setRef} view={view} size={size}>\n <StyledCombobox onKeyDown={onKeyDownSelect}>\n {childrenMemo.length ? (\n childrenMemo\n ) : (\n <ComboboxItemNotFound>{negativeResultContent}</ComboboxItemNotFound>\n )}\n </StyledCombobox>\n </Root>\n </StyledPopover>\n </StyledRoot>\n );\n },\n );\n\nexport const comboboxConfig = {\n name: 'Combobox',\n tag: 'div',\n layout: comboboxRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["comboboxRoot","Root","forwardRef","_ref","outerRootRef","_targetRef$current","name","form","readOnly","disabled","label","placeholder","id","children","role","view","size","frame","usePortal","_ref$negativeResultCo","negativeResultContent","_ref$enumerationType","enumerationType","_ref$opened","opened","_ref$placement","placement","onToggle","onKeyDown","filterFunction","rest","_objectWithoutProperties","_excluded","forceUpdate","useForceUpdate","uniqId","safeUseId","innerId","_rest$valueType","valueType","value","offset","_useState","useState","_useState2","_slicedToArray","ref","setRef","targetRef","useRef","chipsRefs","comboboxRef","itemsRefs","inputRef","handleRef","useForkRef","controlledRefs","selectRef","_useState3","_useState4","innerOpened","setInnerOpened","_useState5","_useState6","search","setSearch","_useState7","_useState8","filterValue","setFilterValue","dynamicTargetWidth","current","offsetWidth","useDidMountEffect","useEffect","onInnerToggle","openValue","event","closedWithoutChanges","updateValue","item","_rest$onChangeValue2","newValue","dataset","_rest$onChangeValue","newSelected","getNewSelected","onChangeValue","call","onClickChildrenItem","stopPropagation","currentTarget","onChangeChipValue","_rest$onChangeValue3","_useKeyNavigation","useKeyNavigation","componentType","updateOpened","onKeyDownTarget","onKeyDownSelect","childrenArray","Children","toArray","childrenMemo","getChildren","onClick","childrenRefs","filter","Boolean","values","getValues","onSearch","newSearch","newOpened","onKeyDownHandle","React","createElement","StyledRoot","StyledNativeSelect","tabIndex","concat","StyledPopover","isOpen","target","ComboboxTarget","_extends","onChange","className","cx","classList","toString","getPlacements","selectWidth","trigger","isFocusTrapped","preventOverflow","closeOnEsc","closeOnOverlayClick","StyledCombobox","length","ComboboxItemNotFound","comboboxConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;IACaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAAgD,EAAA;AAAA,EAAA,oBACzEC,UAAU,CACN,UAAAC,IAAA,EAwBIC,YAAY,EACX;AAAA,IAAA,IAAAC,kBAAA,CAAA;AAAA,IAAA,IAvBGC,IAAI,GAAAH,IAAA,CAAJG,IAAI;MACJC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;MACJC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,KAAK,GAAAP,IAAA,CAALO,KAAK;MACLC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;MACXC,EAAE,GAAAT,IAAA,CAAFS,EAAE;MACFC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;MACRC,IAA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["import React, { Children, forwardRef, useEffect, useRef, useState } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { getPlacements } from '../Dropdown/utils';\nimport { getChildren, getNewSelected, getValues } from '../Select/utils';\nimport { useKeyNavigation } from '../Select/hooks';\nimport { useDidMountEffect, useForceUpdate } from '../../hooks';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { ComboboxTarget } from './ui';\nimport { ComboboxItemNotFound, StyledPopover, StyledRoot, StyledCombobox, StyledNativeSelect } from './Combobox.styles';\nimport type { ComboboxPrimitiveValue, ComboboxProps } from './Combobox.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, ComboboxProps>) =>\n forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n name,\n form,\n readOnly,\n disabled,\n label,\n placeholder,\n id,\n children,\n role,\n view,\n size,\n frame,\n usePortal,\n negativeResultContent = 'Элементы не найдены',\n enumerationType = 'comma',\n opened = false,\n placement = 'bottom',\n onToggle,\n onKeyDown,\n filterFunction,\n ...rest\n },\n outerRootRef,\n ) => {\n const forceUpdate = useForceUpdate();\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const { valueType = 'single', value } = rest;\n const offset = [0, 4] as [number, number];\n\n const [ref, setRef] = useState<HTMLInputElement | null>(null);\n\n const targetRef = useRef<HTMLInputElement>(null);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n const comboboxRef = useRef<HTMLDivElement>(null);\n const itemsRefs = useRef<Array<HTMLDivElement>>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef<HTMLInputElement>(targetRef, outerRootRef);\n const controlledRefs = { targetRef, chipsRefs, selectRef: comboboxRef, itemsRefs, inputRef };\n\n const [innerOpened, setInnerOpened] = useState(opened);\n const [search, setSearch] = useState<string | undefined>('');\n const [filterValue, setFilterValue] = useState(search);\n\n // INFO: нужно высчитывать для корректной работы портала\n const dynamicTargetWidth = targetRef.current?.offsetWidth;\n\n // INFO: Из-за того, что классы передаются через ref,\n // состояние пропсов после изменения view, size\n // всегда предыдущее, поэтому нужно делать форс-ререндер\n useDidMountEffect(() => {\n forceUpdate();\n }, [view, size]);\n\n useEffect(() => {\n if (disabled || readOnly) {\n return;\n }\n\n setInnerOpened(opened);\n }, [opened, disabled, readOnly]);\n\n useEffect(() => {\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (opened) {\n setFilterValue('');\n }\n }, []);\n\n const onInnerToggle = (openValue: boolean, event: React.SyntheticEvent | Event) => {\n if (disabled || readOnly) {\n return;\n }\n\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (!innerOpened) {\n setFilterValue('');\n }\n\n if (onToggle) {\n onToggle(openValue, event);\n\n return;\n }\n\n setInnerOpened(openValue);\n };\n\n const closedWithoutChanges = useRef(true);\n\n const updateValue = (item: HTMLElement, event: React.SyntheticEvent | Event) => {\n const {\n dataset: { value: newValue },\n } = item;\n\n if (rest.valueType === 'multiple') {\n const newSelected = getNewSelected(rest.value, newValue, rest.valueType);\n rest.onChangeValue?.(newSelected);\n\n return;\n }\n\n const newSelected = getNewSelected(rest.value, newValue, 'single');\n\n rest.onChangeValue?.(newSelected);\n\n onInnerToggle?.(false, event);\n\n closedWithoutChanges.current = false;\n };\n\n const onClickChildrenItem = (event: React.MouseEvent<HTMLDivElement>) => {\n // INFO: Для корректной работы компонента Popper\n event.stopPropagation();\n\n const item = event.currentTarget as HTMLElement;\n\n updateValue(item, event);\n };\n\n const onChangeChipValue = (newValue?: Array<ComboboxPrimitiveValue>) => {\n if (rest.valueType !== 'multiple') {\n return;\n }\n\n rest.onChangeValue?.(newValue);\n };\n\n const { onKeyDownTarget, onKeyDownSelect } = useKeyNavigation({\n controlledRefs,\n opened: innerOpened,\n enumerationType,\n valueType,\n componentType: 'combobox',\n value,\n search: filterValue,\n updateOpened: onInnerToggle,\n updateValue,\n });\n\n const childrenArray = Children.toArray(children) as React.ReactElement[];\n\n const childrenMemo = getChildren(\n childrenArray,\n { onClick: onClickChildrenItem, childrenRefs: itemsRefs },\n value,\n filterValue,\n filterFunction,\n ).filter(Boolean);\n\n const values = getValues(childrenArray, value);\n\n const onSearch = (newSearch?: string, newOpened?: boolean) => {\n setSearch(newSearch);\n setFilterValue(newSearch);\n setInnerOpened(newOpened ?? true);\n };\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n onKeyDownTarget(event);\n };\n\n return (\n <StyledRoot ref={comboboxRef}>\n <StyledNativeSelect\n aria-invalid=\"false\"\n aria-hidden=\"true\"\n aria-readonly={readOnly}\n tabIndex={-1}\n form={form}\n name={name}\n value={`${value}`}\n disabled={disabled || readOnly}\n />\n <StyledPopover\n role={role}\n isOpen={innerOpened}\n onToggle={onInnerToggle}\n target={\n <ComboboxTarget\n opened={innerOpened}\n values={values}\n label={label}\n placeholder={placeholder}\n search={search}\n enumerationType={enumerationType}\n valueType={valueType}\n readOnly={readOnly}\n disabled={disabled}\n size={size}\n closedWithoutChanges={closedWithoutChanges}\n ref={handleRef}\n chipsRefs={chipsRefs}\n inputRef={inputRef}\n id={innerId}\n onChange={onChangeChipValue}\n onSearch={onSearch}\n onKeyDown={onKeyDownHandle}\n {...rest}\n />\n }\n className={cx(ref?.classList.toString())} // INFO: Прокидываем стили для Popover\n id={innerId}\n offset={offset}\n placement={getPlacements(placement)}\n usePortal={usePortal}\n selectWidth={dynamicTargetWidth}\n frame={frame}\n trigger=\"click\"\n isFocusTrapped={false}\n preventOverflow={false}\n closeOnEsc={false}\n closeOnOverlayClick\n >\n <Root ref={setRef} view={view} size={size}>\n <StyledCombobox onKeyDown={onKeyDownSelect}>\n {childrenMemo.length ? (\n childrenMemo\n ) : (\n <ComboboxItemNotFound>{negativeResultContent}</ComboboxItemNotFound>\n )}\n </StyledCombobox>\n </Root>\n </StyledPopover>\n </StyledRoot>\n );\n },\n );\n\nexport const comboboxConfig = {\n name: 'Combobox',\n tag: 'div',\n layout: comboboxRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["comboboxRoot","Root","forwardRef","_ref","outerRootRef","_targetRef$current","name","form","readOnly","disabled","label","placeholder","id","children","role","view","size","frame","usePortal","_ref$negativeResultCo","negativeResultContent","_ref$enumerationType","enumerationType","_ref$opened","opened","_ref$placement","placement","onToggle","onKeyDown","filterFunction","rest","_objectWithoutProperties","_excluded","forceUpdate","useForceUpdate","uniqId","safeUseId","innerId","_rest$valueType","valueType","value","offset","_useState","useState","_useState2","_slicedToArray","ref","setRef","targetRef","useRef","chipsRefs","comboboxRef","itemsRefs","inputRef","handleRef","useForkRef","controlledRefs","selectRef","_useState3","_useState4","innerOpened","setInnerOpened","_useState5","_useState6","search","setSearch","_useState7","_useState8","filterValue","setFilterValue","dynamicTargetWidth","current","offsetWidth","useDidMountEffect","useEffect","onInnerToggle","openValue","event","closedWithoutChanges","updateValue","item","_rest$onChangeValue2","newValue","dataset","_rest$onChangeValue","newSelected","getNewSelected","onChangeValue","call","onClickChildrenItem","stopPropagation","currentTarget","onChangeChipValue","_rest$onChangeValue3","_useKeyNavigation","useKeyNavigation","componentType","updateOpened","onKeyDownTarget","onKeyDownSelect","childrenArray","Children","toArray","childrenMemo","getChildren","onClick","childrenRefs","filter","Boolean","values","getValues","onSearch","newSearch","newOpened","onKeyDownHandle","React","createElement","StyledRoot","StyledNativeSelect","tabIndex","concat","StyledPopover","isOpen","target","ComboboxTarget","_extends","onChange","className","cx","classList","toString","getPlacements","selectWidth","trigger","isFocusTrapped","preventOverflow","closeOnEsc","closeOnOverlayClick","StyledCombobox","length","ComboboxItemNotFound","comboboxConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;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AAExH,IAAAA,EAAAA,qBAA4C,CAE3D,CACd,CACK,CACP,CAAC,CAAA;AAErB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMyH,cAAc,GAAG;AAC1BvI,EAAAA,IAAI,EAAE,UAAU;AAChBwI,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE/I,YAAY;AACpBgJ,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRlI,IAAAA,IAAI,EAAE;AACFmI,MAAAA,GAAG,EAAEC,IAAAA;KACR;AACDnI,IAAAA,IAAI,EAAE;AACFkI,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtI,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
@@ -25,14 +25,14 @@ var useFocusController = function useFocusController(_ref) {
25
25
  if (!opened) {
26
26
  var _contentRef$current;
27
27
  updateFocused(false);
28
- (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.scrollTo({
28
+ (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.scrollTo({
29
29
  left: 0
30
30
  });
31
31
  }
32
32
  var hasFocusAfterClose = prevOpened !== undefined && !opened && !(closedWithoutChanges !== null && closedWithoutChanges !== void 0 && closedWithoutChanges.current);
33
33
  if (opened || hasFocusAfterClose) {
34
34
  var _inputRef$current;
35
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
35
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
36
36
  }
37
37
 
38
38
  // INFO: Помогает определить, произошло ли закрытие выпадающего меню при выборе значения.
@@ -47,7 +47,7 @@ var useFocusController = function useFocusController(_ref) {
47
47
  var valuesCount = (values === null || values === void 0 ? void 0 : values.length) || 0;
48
48
  if ((opened || prevOpened) && prevValuesCount < valuesCount) {
49
49
  var _inputRef$current2;
50
- (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.focus();
50
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
51
51
  }
52
52
  }, [values, readOnly]);
53
53
  useDidMountEffect(function () {
@@ -83,16 +83,16 @@ var useFocusController = function useFocusController(_ref) {
83
83
  return;
84
84
  }
85
85
  if (valueType === 'single') {
86
- updateSearch === null || updateSearch === void 0 || updateSearch(newSearch, false);
86
+ updateSearch === null || updateSearch === void 0 ? void 0 : updateSearch(newSearch, false);
87
87
  }
88
88
  if (valueType === 'multiple') {
89
- updateSearch === null || updateSearch === void 0 || updateSearch('', false);
89
+ updateSearch === null || updateSearch === void 0 ? void 0 : updateSearch('', false);
90
90
  }
91
91
  }, [updateSearch, values, opened, hasValue, textContent, valueType]);
92
92
  var onClickText = function onClickText(event) {
93
93
  var _inputRef$current3;
94
- onChipClick === null || onChipClick === void 0 || onChipClick(event);
95
- (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || _inputRef$current3.focus();
94
+ onChipClick === null || onChipClick === void 0 ? void 0 : onChipClick(event);
95
+ (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.focus();
96
96
  };
97
97
  var onFocusInput = function onFocusInput() {
98
98
  var _contentRef$current2, _contentRef$current3;
@@ -106,10 +106,10 @@ var useFocusController = function useFocusController(_ref) {
106
106
  if (valueType === 'single') {
107
107
  setTimeout(function () {
108
108
  var _inputRef$current4;
109
- (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 || _inputRef$current4.select();
109
+ (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.select();
110
110
  });
111
111
  }
112
- (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.scrollTo({
112
+ (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 ? void 0 : _contentRef$current2.scrollTo({
113
113
  left: (_contentRef$current3 = contentRef.current) === null || _contentRef$current3 === void 0 ? void 0 : _contentRef$current3.scrollWidth
114
114
  });
115
115
  updateFocused(true);
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusController.js","sources":["../../../../src/components/Combobox/hooks/useFocusController.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useDidMountEffect, usePreviousValue } from '../../../hooks';\nimport type { UseFocusControllerProps } from '../Combobox.types';\n\nexport const useFocusController = ({\n controlledRefs: { contentRef, inputHelperRef, inputRef },\n opened,\n hasValue,\n textContent,\n search,\n values,\n readOnly,\n valueType,\n closedWithoutChanges,\n updateSearch,\n updateFocused,\n onChipClick,\n}: UseFocusControllerProps) => {\n const prevSearch = usePreviousValue(search);\n const prevValues = usePreviousValue(values);\n const prevOpened = usePreviousValue(opened);\n\n useDidMountEffect(() => {\n if (!opened) {\n updateFocused(false);\n contentRef.current?.scrollTo({ left: 0 });\n }\n\n const hasFocusAfterClose = prevOpened !== undefined && !opened && !closedWithoutChanges?.current;\n\n if (opened || hasFocusAfterClose) {\n inputRef.current?.focus();\n }\n\n // INFO: Помогает определить, произошло ли закрытие выпадающего меню при выборе значения.\n // Нужно для того, чтобы не фокусироваться на инпуте\n // ОЧЕНЬ не нравится это решение, но оно работает\n if (closedWithoutChanges?.current === false) {\n closedWithoutChanges.current = true;\n }\n }, [opened]);\n\n useDidMountEffect(() => {\n const prevValuesCount = prevValues?.length || 0;\n const valuesCount = values?.length || 0;\n\n if ((opened || prevOpened) && prevValuesCount < valuesCount) {\n inputRef.current?.focus();\n }\n }, [values, readOnly]);\n\n useDidMountEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n // INFO: Для multiple\n if (search === '') {\n inputRef.current.style.flex = '1';\n }\n\n // INFO: Для single\n if (!opened && prevSearch !== search) {\n inputRef.current.style.flex = '1';\n }\n\n // INFO: Для кейсов, когда значение вырезано\n if (!inputRef.current.value.length) {\n inputRef.current.style.flex = '1';\n return;\n }\n\n if (valueType === 'multiple' && inputHelperRef.current) {\n const { clientWidth } = inputHelperRef.current;\n inputRef.current.style.flex = `1 0 ${clientWidth}px`;\n }\n }, [readOnly, search, valueType]);\n\n useEffect(() => {\n const newSearch = hasValue ? textContent : '';\n\n // INFO: Заполнить поле input при первой инициализации\n if (prevOpened !== undefined && opened) {\n return;\n }\n\n if (valueType === 'single') {\n updateSearch?.(newSearch, false);\n }\n\n if (valueType === 'multiple') {\n updateSearch?.('', false);\n }\n }, [updateSearch, values, opened, hasValue, textContent, valueType]);\n\n const onClickText = (event: React.MouseEvent<HTMLButtonElement>) => {\n onChipClick?.(event);\n inputRef.current?.focus();\n };\n\n const onFocusInput = () => {\n if (readOnly) {\n return;\n }\n\n // INFO: Жёсткий хак, нужный для корректного выделения всей строки после выбора значения.\n // Проблема возникает из-за очередности срабатывания useEffect, который сначала вызывает фокус\n // на элемент, а потом обновляет состояние inputRef\n if (valueType === 'single') {\n setTimeout(() => {\n inputRef.current?.select();\n });\n }\n\n contentRef.current?.scrollTo({ left: contentRef.current?.scrollWidth });\n\n updateFocused(true);\n };\n\n const onBlurInput = () => {\n if (!opened) {\n updateFocused(false);\n }\n };\n\n return { onClickText, onFocusInput, onBlurInput } as const;\n};\n"],"names":["useFocusController","_ref","_ref$controlledRefs","controlledRefs","contentRef","inputHelperRef","inputRef","opened","hasValue","textContent","search","values","readOnly","valueType","closedWithoutChanges","updateSearch","updateFocused","onChipClick","prevSearch","usePreviousValue","prevValues","prevOpened","useDidMountEffect","_contentRef$current","current","scrollTo","left","hasFocusAfterClose","undefined","_inputRef$current","focus","prevValuesCount","length","valuesCount","_inputRef$current2","style","flex","value","clientWidth","concat","useEffect","newSearch","onClickText","event","_inputRef$current3","onFocusInput","_contentRef$current2","_contentRef$current3","setTimeout","_inputRef$current4","select","scrollWidth","onBlurInput"],"mappings":";;;;IAKaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC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U,CAACoB,OAAO,MAAAsB,IAAAA,IAAAA,oBAAA,KAAlBA,KAAAA,CAAAA,IAAAA,oBAAA,CAAoBrB,QAAQ,CAAC;MAAEC,IAAI,EAAA,CAAAqB,oBAAA,GAAE3C,UAAU,CAACoB,OAAO,MAAAuB,IAAAA,IAAAA,oBAAA,KAAlBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,oBAAA,CAAoBI,WAAAA;AAAY,KAAC,CAAC,CAAA;IAEvEnC,aAAa,CAAC,IAAI,CAAC,CAAA;GACtB,CAAA;AAED,EAAA,IAAMoC,WAAW,GAAG,SAAdA,WAAWA,GAAS;IACtB,IAAI,CAAC7C,MAAM,EAAE;MACTS,aAAa,CAAC,KAAK,CAAC,CAAA;AACxB,KAAA;GACH,CAAA;EAED,OAAO;AAAE0B,IAAAA,WAAW,EAAXA,WAAW;AAAEG,IAAAA,YAAY,EAAZA,YAAY;AAAEO,IAAAA,WAAW,EAAXA,WAAAA;GAAa,CAAA;AACrD;;;;"}
1
+ {"version":3,"file":"useFocusController.js","sources":["../../../../src/components/Combobox/hooks/useFocusController.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useDidMountEffect, usePreviousValue } from '../../../hooks';\nimport type { UseFocusControllerProps } from '../Combobox.types';\n\nexport const useFocusController = ({\n controlledRefs: { contentRef, inputHelperRef, inputRef },\n opened,\n hasValue,\n textContent,\n search,\n values,\n readOnly,\n valueType,\n closedWithoutChanges,\n updateSearch,\n updateFocused,\n onChipClick,\n}: UseFocusControllerProps) => {\n const prevSearch = usePreviousValue(search);\n const prevValues = usePreviousValue(values);\n const prevOpened = usePreviousValue(opened);\n\n useDidMountEffect(() => {\n if (!opened) {\n updateFocused(false);\n contentRef.current?.scrollTo({ left: 0 });\n }\n\n const hasFocusAfterClose = prevOpened !== undefined && !opened && !closedWithoutChanges?.current;\n\n if (opened || hasFocusAfterClose) {\n inputRef.current?.focus();\n }\n\n // INFO: Помогает определить, произошло ли закрытие выпадающего меню при выборе значения.\n // Нужно для того, чтобы не фокусироваться на инпуте\n // ОЧЕНЬ не нравится это решение, но оно работает\n if (closedWithoutChanges?.current === false) {\n closedWithoutChanges.current = true;\n }\n }, [opened]);\n\n useDidMountEffect(() => {\n const prevValuesCount = prevValues?.length || 0;\n const valuesCount = values?.length || 0;\n\n if ((opened || prevOpened) && prevValuesCount < valuesCount) {\n inputRef.current?.focus();\n }\n }, [values, readOnly]);\n\n useDidMountEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n // INFO: Для multiple\n if (search === '') {\n inputRef.current.style.flex = '1';\n }\n\n // INFO: Для single\n if (!opened && prevSearch !== search) {\n inputRef.current.style.flex = '1';\n }\n\n // INFO: Для кейсов, когда значение вырезано\n if (!inputRef.current.value.length) {\n inputRef.current.style.flex = '1';\n return;\n }\n\n if (valueType === 'multiple' && inputHelperRef.current) {\n const { clientWidth } = inputHelperRef.current;\n inputRef.current.style.flex = `1 0 ${clientWidth}px`;\n }\n }, [readOnly, search, valueType]);\n\n useEffect(() => {\n const newSearch = hasValue ? textContent : '';\n\n // INFO: Заполнить поле input при первой инициализации\n if (prevOpened !== undefined && opened) {\n return;\n }\n\n if (valueType === 'single') {\n updateSearch?.(newSearch, false);\n }\n\n if (valueType === 'multiple') {\n updateSearch?.('', false);\n }\n }, [updateSearch, values, opened, hasValue, textContent, valueType]);\n\n const onClickText = (event: React.MouseEvent<HTMLButtonElement>) => {\n onChipClick?.(event);\n inputRef.current?.focus();\n };\n\n const onFocusInput = () => {\n if (readOnly) {\n return;\n }\n\n // INFO: Жёсткий хак, нужный для корректного выделения всей строки после выбора значения.\n // Проблема возникает из-за очередности срабатывания useEffect, который сначала вызывает фокус\n // на элемент, а потом обновляет состояние inputRef\n if (valueType === 'single') {\n setTimeout(() => {\n inputRef.current?.select();\n });\n }\n\n contentRef.current?.scrollTo({ left: contentRef.current?.scrollWidth });\n\n updateFocused(true);\n };\n\n const onBlurInput = () => {\n if (!opened) {\n updateFocused(false);\n }\n };\n\n return { onClickText, onFocusInput, onBlurInput } as const;\n};\n"],"names":["useFocusController","_ref","_ref$controlledRefs","controlledRefs","contentRef","inputHelperRef","inputRef","opened","hasValue","textContent","search","values","readOnly","valueType","closedWithoutChanges","updateSearch","updateFocused","onChipClick","prevSearch","usePreviousValue","prevValues","prevOpened","useDidMountEffect","_contentRef$current","current","scrollTo","left","hasFocusAfterClose","undefined","_inputRef$current","focus","prevValuesCount","length","valuesCount","_inputRef$current2","style","flex","value","clientWidth","concat","useEffect","newSearch","onClickText","event","_inputRef$current3","onFocusInput","_contentRef$current2","_contentRef$current3","setTimeout","_inputRef$current4","select","scrollWidth","onBlurInput"],"mappings":";;;;IAKaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAaA;AAAA,EAAA,IAAAC,mBAAA,GAAAD,IAAA,CAZ3BE,cAAc;IAAIC,UAAU,GAAAF,mBAAA,CAAVE,UAAU;IAAEC,cAAc,GAAAH,mBAAA,CAAdG,cAAc;IAAEC,QAAQ,GAAAJ,mBAAA,CAARI,QAAQ;IACtDC,MAAM,GAAAN,IAAA,CAANM,MAAM;IACNC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,MAAM,GAAAT,IAAA,CAANS,MAAM;IACNC,MAAM,GAAAV,IAAA,CAANU,MAAM;IACNC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IACRC,SAAS,GAAAZ,IAAA,CAATY,SAAS;IACTC,oBAAoB,GAAAb,IAAA,CAApBa,oBAAoB;IACpBC,YAAY,GAAAd,IAAA,CAAZc,YAAY;IACZC,aAAa,GAAAf,IAAA,CAAbe,aAAa;IACbC,WAAW,GAAAhB,IAAA,CAAXgB,WAAW,CAAA;AAEX,EAAA,IAAMC,UAAU,GAAGC,gBAAgB,CAACT,MAAM,CAAC,CAAA;AAC3C,EAAA,IAAMU,UAAU,GAAGD,gBAAgB,CAACR,MAAM,CAAC,CAAA;AAC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,EAAXA,WAAAA;GAAa,CAAA;AACrD;;;;"}
@@ -10,6 +10,8 @@
10
10
 
11
11
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
12
12
 
13
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
14
+
13
15
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
14
16
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
15
17
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@@ -17,7 +17,7 @@ var ComboboxChip = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
17
  return onClear(value, text);
18
18
  };
19
19
  var onKeyDownHandle = function onKeyDownHandle(event) {
20
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(value, text, index, event);
20
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(value, text, index, event);
21
21
  };
22
22
  return /*#__PURE__*/React.createElement(StyledChip, {
23
23
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"ComboboxChip.js","sources":["../../../../../src/components/Combobox/ui/ComboboxChip/ComboboxChip.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { StyledChip } from './ComboboxChip.styles';\nimport type { ComboboxChipProps } from './ComboboxChip.types';\n\n/**\n * Чип, отображающий выбранный элемент\n */\nexport const ComboboxChip = forwardRef<HTMLButtonElement, ComboboxChipProps>(\n ({ value, text, index, disabled, readOnly, onClick, onClear, onKeyDown }, ref) => {\n const onClearHandle = () => onClear(value, text);\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(value, text, index, event);\n };\n\n return (\n <StyledChip\n ref={ref}\n tabIndex={-1}\n disabled={disabled}\n readOnly={readOnly}\n onClick={onClick}\n onClear={onClearHandle}\n onKeyDown={onKeyDownHandle}\n text={`${text}`}\n />\n );\n },\n);\n"],"names":["ComboboxChip","forwardRef","_ref","ref","value","text","index","disabled","readOnly","onClick","onClear","onKeyDown","onClearHandle","onKeyDownHandle","event","React","createElement","StyledChip","tabIndex","concat"],"mappings":";;;AAKA;AACA;AACA;AACO,IAAMA,YAAY,gBAAGC,UAAU,CAClC,UAAAC,IAAA,EAA0EC,GAAG,EAAK;AAAA,EAAA,IAA/EC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAEC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAEC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IAAEC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IAAEC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IAAEC,SAAS,GAAAT,IAAA,CAATS,SAAS,CAAA;AAClE,EAAA,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,GAAA;AAAA,IAAA,OAASF,OAAO,CAACN,KAAK,EAAEC,IAAI,CAAC,CAAA;AAAA,GAAA,CAAA;AAEhD,EAAA,IAAMQ,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,KAA6C,EAAK;AACvEH,IAAAA,SAAS,KAATA,IAAAA,IAAAA,SAAS,KAATA,KAAAA,CAAAA,IAAAA,SAAS,CAAGP,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEQ,KAAK,CAAC,CAAA;GACzC,CAAA;AAED,EAAA,oBACIC,KAAA,CAAAC,aAAA,CAACC,UAAU,EAAA;AACPd,IAAAA,GAAG,EAAEA,GAAI;IACTe,QAAQ,EAAE,CAAC,CAAE;AACbX,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,OAAO,EAAEE,aAAc;AACvBD,IAAAA,SAAS,EAAEE,eAAgB;IAC3BR,IAAI,EAAA,EAAA,CAAAc,MAAA,CAAKd,IAAI,CAAA;AAAG,GACnB,CAAC,CAAA;AAEV,CACJ;;;;"}
1
+ {"version":3,"file":"ComboboxChip.js","sources":["../../../../../src/components/Combobox/ui/ComboboxChip/ComboboxChip.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { StyledChip } from './ComboboxChip.styles';\nimport type { ComboboxChipProps } from './ComboboxChip.types';\n\n/**\n * Чип, отображающий выбранный элемент\n */\nexport const ComboboxChip = forwardRef<HTMLButtonElement, ComboboxChipProps>(\n ({ value, text, index, disabled, readOnly, onClick, onClear, onKeyDown }, ref) => {\n const onClearHandle = () => onClear(value, text);\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(value, text, index, event);\n };\n\n return (\n <StyledChip\n ref={ref}\n tabIndex={-1}\n disabled={disabled}\n readOnly={readOnly}\n onClick={onClick}\n onClear={onClearHandle}\n onKeyDown={onKeyDownHandle}\n text={`${text}`}\n />\n );\n },\n);\n"],"names":["ComboboxChip","forwardRef","_ref","ref","value","text","index","disabled","readOnly","onClick","onClear","onKeyDown","onClearHandle","onKeyDownHandle","event","React","createElement","StyledChip","tabIndex","concat"],"mappings":";;;AAKA;AACA;AACA;AACO,IAAMA,YAAY,gBAAGC,UAAU,CAClC,UAAAC,IAAA,EAA0EC,GAAG,EAAK;AAAA,EAAA,IAA/EC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAEC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAEC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IAAEC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IAAEC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IAAEC,SAAS,GAAAT,IAAA,CAATS,SAAS,CAAA;AAClE,EAAA,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,GAAA;AAAA,IAAA,OAASF,OAAO,CAACN,KAAK,EAAEC,IAAI,CAAC,CAAA;AAAA,GAAA,CAAA;AAEhD,EAAA,IAAMQ,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,KAA6C,EAAK;AACvEH,IAAAA,SAAS,KAATA,IAAAA,IAAAA,SAAS,KAATA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,SAAS,CAAGP,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEQ,KAAK,CAAC,CAAA;GACzC,CAAA;AAED,EAAA,oBACIC,KAAA,CAAAC,aAAA,CAACC,UAAU,EAAA;AACPd,IAAAA,GAAG,EAAEA,GAAI;IACTe,QAAQ,EAAE,CAAC,CAAE;AACbX,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,OAAO,EAAEE,aAAc;AACvBD,IAAAA,SAAS,EAAEE,eAAgB;IAC3BR,IAAI,EAAA,EAAA,CAAAc,MAAA,CAAKd,IAAI,CAAA;AAAG,GACnB,CAAC,CAAA;AAEV,CACJ;;;;"}
@@ -8,6 +8,8 @@
8
8
 
9
9
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
10
10
 
11
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
12
+
11
13
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
12
14
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
13
15
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@@ -103,8 +103,8 @@ var ComboboxTarget = /*#__PURE__*/forwardRef(function (_ref, ref) {
103
103
  itemValue = _ref9[0];
104
104
  return itemValue;
105
105
  });
106
- chipsRefs === null || chipsRefs === void 0 || chipsRefs.current.splice(index, 1);
107
- onChange === null || onChange === void 0 || onChange(newValue);
106
+ chipsRefs === null || chipsRefs === void 0 ? void 0 : chipsRefs.current.splice(index, 1);
107
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
108
108
  };
109
109
  var onChipKeyDown = function onChipKeyDown(value, text, index, event) {
110
110
  var code = event.code;
@@ -127,13 +127,13 @@ var ComboboxTarget = /*#__PURE__*/forwardRef(function (_ref, ref) {
127
127
  itemValue = _ref11[0];
128
128
  return itemValue;
129
129
  });
130
- newValue === null || newValue === void 0 || newValue.pop();
131
- chipsRefs === null || chipsRefs === void 0 || chipsRefs.current.pop();
132
- onChange === null || onChange === void 0 || onChange(newValue);
130
+ newValue === null || newValue === void 0 ? void 0 : newValue.pop();
131
+ chipsRefs === null || chipsRefs === void 0 ? void 0 : chipsRefs.current.pop();
132
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
133
133
  }
134
134
  };
135
135
  var onChangeInput = function onChangeInput(event) {
136
- onSearch === null || onSearch === void 0 || onSearch(event.currentTarget.value);
136
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(event.currentTarget.value);
137
137
  };
138
138
  var onWheel = function onWheel(event) {
139
139
  var deltaY = event.deltaY;