@salutejs/plasma-new-hope 0.174.0-canary.1497.11463811587.0 → 0.174.0-canary.1497.11480463527.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (475) hide show
  1. package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -1
  2. package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -1
  3. package/cjs/components/Attach/Attach.js +3 -4
  4. package/cjs/components/Attach/Attach.js.map +1 -1
  5. package/cjs/components/Attach/components/AttachButton/AttachButton.js +0 -1
  6. package/cjs/components/Attach/components/AttachButton/AttachButton.js.map +1 -1
  7. package/cjs/components/Attach/ui/Button/Button.styles.js +0 -1
  8. package/cjs/components/Attach/ui/Button/Button.styles.js.map +1 -1
  9. package/cjs/components/Attach/ui/Cell/Cell.styles.js +0 -2
  10. package/cjs/components/Attach/ui/Cell/Cell.styles.js.map +1 -1
  11. package/cjs/components/Attach/ui/IconButton/IconButton.styles.js +0 -1
  12. package/cjs/components/Attach/ui/IconButton/IconButton.styles.js.map +1 -1
  13. package/cjs/components/Attach/utils/getFileicon.js +3 -4
  14. package/cjs/components/Attach/utils/getFileicon.js.map +1 -1
  15. package/cjs/components/Attach/utils/index.js +0 -3
  16. package/cjs/components/Attach/utils/index.js.map +1 -1
  17. package/cjs/components/Autocomplete/Autocomplete.js +5 -6
  18. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  19. package/cjs/components/Autocomplete/Autocomplete.styles.js +2 -3
  20. package/cjs/components/Autocomplete/Autocomplete.styles.js.map +1 -1
  21. package/cjs/components/Autocomplete/ui/TextField/TextField.styles.js +1 -2
  22. package/cjs/components/Autocomplete/ui/TextField/TextField.styles.js.map +1 -1
  23. package/cjs/components/Avatar/Avatar.js +2 -3
  24. package/cjs/components/Avatar/Avatar.js.map +1 -1
  25. package/cjs/components/Breadcrumbs/Breadcrumbs.styles.js +2 -4
  26. package/cjs/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
  27. package/cjs/components/Button/Button.styles.js +0 -3
  28. package/cjs/components/Button/Button.styles.js.map +1 -1
  29. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +5 -5
  30. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +8 -8
  31. package/cjs/components/Calendar/hooks/useDays.js +2 -2
  32. package/cjs/components/Calendar/hooks/useKeyNavigation.js +1 -1
  33. package/cjs/components/Calendar/hooks/useMonths.js +2 -2
  34. package/cjs/components/Calendar/hooks/useQuarters.js +2 -2
  35. package/cjs/components/Calendar/hooks/useYears.js +2 -2
  36. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  37. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +5 -6
  38. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  39. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +0 -1
  40. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
  41. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +4 -4
  42. package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +4 -4
  43. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +4 -4
  44. package/cjs/components/Combobox/ComboboxNew/Combobox.js +11 -12
  45. package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  46. package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +2 -4
  47. package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
  48. package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +0 -2
  49. package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
  50. package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js +1 -2
  51. package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
  52. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +5 -6
  53. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  54. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -3
  55. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  56. package/cjs/components/Combobox/ComboboxNew/ui/Target/Target.styles.js +1 -2
  57. package/cjs/components/Combobox/ComboboxNew/ui/Target/Target.styles.js.map +1 -1
  58. package/cjs/components/Combobox/ComboboxOld/Combobox.css +1 -1
  59. package/cjs/components/Combobox/ComboboxOld/Combobox.js +4 -11
  60. package/cjs/components/Combobox/ComboboxOld/Combobox.js.map +1 -1
  61. package/cjs/components/Combobox/ComboboxOld/Combobox.styles.js +0 -1
  62. package/cjs/components/Combobox/ComboboxOld/Combobox.styles.js.map +1 -1
  63. package/cjs/components/Combobox/ComboboxOld/hooks/useFocusController.js +0 -1
  64. package/cjs/components/Combobox/ComboboxOld/hooks/useFocusController.js.map +1 -1
  65. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js +1 -2
  66. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js.map +1 -1
  67. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +1 -1
  68. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js +1 -11
  69. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js.map +1 -1
  70. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +1 -1
  71. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js +1 -11
  72. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js.map +1 -1
  73. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +1 -1
  74. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js +1 -11
  75. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js.map +1 -1
  76. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +1 -1
  77. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js +1 -11
  78. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js.map +1 -1
  79. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js +0 -2
  80. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  81. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.js +1 -1
  82. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js +1 -2
  83. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js.map +1 -1
  84. package/cjs/components/DatePicker/DatePickerBase.styles.js +1 -7
  85. package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -1
  86. package/cjs/components/DatePicker/RangeDate/RangeDate.js +1 -1
  87. package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +0 -1
  88. package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -1
  89. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +1 -2
  90. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
  91. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +2 -5
  92. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -1
  93. package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +0 -1
  94. package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -1
  95. package/cjs/components/Drawer/Drawer.js +5 -10
  96. package/cjs/components/Drawer/Drawer.js.map +1 -1
  97. package/cjs/components/Drawer/Drawer.styles.js +0 -4
  98. package/cjs/components/Drawer/Drawer.styles.js.map +1 -1
  99. package/cjs/components/Drawer/hooks/useDrawer.js +0 -4
  100. package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
  101. package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +0 -7
  102. package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js.map +1 -1
  103. package/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +0 -7
  104. package/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js.map +1 -1
  105. package/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +0 -3
  106. package/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js.map +1 -1
  107. package/cjs/components/Dropdown/Dropdown.css +1 -1
  108. package/cjs/components/Dropdown/Dropdown.js +3 -9
  109. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  110. package/cjs/components/Dropdown/Dropdown.styles.js +1 -1
  111. package/cjs/components/Dropdown/{Dropdown.styles_18f0qpm.css → Dropdown.styles_1ix6io8.css} +1 -1
  112. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  113. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -8
  114. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  115. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +1 -1
  116. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
  117. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  118. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -3
  119. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  120. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -2
  121. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -1
  122. package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +0 -1
  123. package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -1
  124. package/cjs/components/Editable/Editable.js +3 -4
  125. package/cjs/components/Editable/Editable.js.map +1 -1
  126. package/cjs/components/Editable/utils/clearSelection.js +0 -2
  127. package/cjs/components/Editable/utils/clearSelection.js.map +1 -1
  128. package/cjs/components/Editable/utils/selectText.js +0 -2
  129. package/cjs/components/Editable/utils/selectText.js.map +1 -1
  130. package/cjs/components/EmptyState/EmptyState.styles.js +1 -2
  131. package/cjs/components/EmptyState/EmptyState.styles.js.map +1 -1
  132. package/cjs/components/IconButton/IconButton.js +1 -1
  133. package/cjs/components/IconButton/IconButton.styles.js +0 -8
  134. package/cjs/components/IconButton/IconButton.styles.js.map +1 -1
  135. package/cjs/components/Modal/Modal.js +6 -8
  136. package/cjs/components/Modal/Modal.js.map +1 -1
  137. package/cjs/components/Modal/hooks/useModal.js +0 -4
  138. package/cjs/components/Modal/hooks/useModal.js.map +1 -1
  139. package/cjs/components/Notification/Notification.styles.js +2 -3
  140. package/cjs/components/Notification/Notification.styles.js.map +1 -1
  141. package/cjs/components/Notification/NotificationsPortal.js +3 -4
  142. package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
  143. package/cjs/components/Pagination/Pagination.styles.js +1 -2
  144. package/cjs/components/Pagination/Pagination.styles.js.map +1 -1
  145. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -2
  146. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
  147. package/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -2
  148. package/cjs/components/Panel/ui/PanelHeader/PanelHeader.js.map +1 -1
  149. package/cjs/components/Panel/ui/PanelHeader/PanelHeader.styles.js +1 -2
  150. package/cjs/components/Panel/ui/PanelHeader/PanelHeader.styles.js.map +1 -1
  151. package/cjs/components/Popover/Popover.js +1 -1
  152. package/cjs/components/Popup/Popup.js +2 -2
  153. package/cjs/components/Popup/PopupContext.js +1 -1
  154. package/cjs/components/Range/Range.styles.js +0 -1
  155. package/cjs/components/Range/Range.styles.js.map +1 -1
  156. package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +4 -5
  157. package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
  158. package/cjs/components/Select/Select.js +11 -12
  159. package/cjs/components/Select/Select.js.map +1 -1
  160. package/cjs/components/Select/Select.styles.js +2 -5
  161. package/cjs/components/Select/Select.styles.js.map +1 -1
  162. package/cjs/components/Select/hooks/usePathMaps.js +0 -2
  163. package/cjs/components/Select/hooks/usePathMaps.js.map +1 -1
  164. package/cjs/components/Select/ui/Inner/Inner.js +1 -2
  165. package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
  166. package/cjs/components/Select/ui/Inner/ui/Item/Item.js +4 -5
  167. package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
  168. package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +0 -1
  169. package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  170. package/cjs/components/Select/ui/Target/ui/Button/Button.js +1 -1
  171. package/cjs/components/Select/ui/Target/ui/Button/Button.styles.js +1 -3
  172. package/cjs/components/Select/ui/Target/ui/Button/Button.styles.js.map +1 -1
  173. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +2 -2
  174. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -4
  175. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  176. package/cjs/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js +1 -2
  177. package/cjs/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js.map +1 -1
  178. package/cjs/components/Select/utils/getButtonLabel.js +0 -2
  179. package/cjs/components/Select/utils/getButtonLabel.js.map +1 -1
  180. package/cjs/components/Sheet/Sheet.js +3 -3
  181. package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +2 -4
  182. package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
  183. package/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +2 -4
  184. package/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js.map +1 -1
  185. package/cjs/components/Slider/Slider.js +0 -8
  186. package/cjs/components/Slider/Slider.js.map +1 -1
  187. package/cjs/components/Slider/components/Double/Double.js +1 -2
  188. package/cjs/components/Slider/components/Double/Double.js.map +1 -1
  189. package/cjs/components/Slider/components/Double/Double.styles.js +0 -1
  190. package/cjs/components/Slider/components/Double/Double.styles.js.map +1 -1
  191. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +0 -3
  192. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
  193. package/cjs/components/Slider/components/Single/Single.js +1 -2
  194. package/cjs/components/Slider/components/Single/Single.js.map +1 -1
  195. package/cjs/components/Slider/components/SliderBase/SliderBase.js +1 -1
  196. package/cjs/components/Steps/Steps.js +1 -1
  197. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +0 -1
  198. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  199. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +2 -3
  200. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
  201. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +2 -3
  202. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
  203. package/cjs/components/TextArea/TextArea.js +2 -2
  204. package/cjs/components/TextArea/TextArea.styles.js +2 -3
  205. package/cjs/components/TextArea/TextArea.styles.js.map +1 -1
  206. package/cjs/components/TextArea/ui/Hint/Hint.js +1 -2
  207. package/cjs/components/TextArea/ui/Hint/Hint.js.map +1 -1
  208. package/cjs/components/TextField/TextField.js +3 -3
  209. package/cjs/components/TextField/TextField.styles.js +1 -2
  210. package/cjs/components/TextField/TextField.styles.js.map +1 -1
  211. package/cjs/components/TextField/ui/Hint/Hint.js +1 -2
  212. package/cjs/components/TextField/ui/Hint/Hint.js.map +1 -1
  213. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -2
  214. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
  215. package/cjs/components/Toast/Toast.styles.js +1 -1
  216. package/cjs/components/Toast/ToastController.js +1 -1
  217. package/cjs/components/Toast/utils.js +1 -2
  218. package/cjs/components/Toast/utils.js.map +1 -1
  219. package/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  220. package/cjs/components/Tooltip/Tooltip.js +2 -3
  221. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  222. package/cjs/engines/index.js +0 -2
  223. package/cjs/engines/index.js.map +1 -1
  224. package/cjs/hooks/useIsomorphicLayoutEffect.js +0 -1
  225. package/cjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  226. package/cjs/index.css +1 -1
  227. package/cjs/index.js +48 -51
  228. package/cjs/index.js.map +1 -1
  229. package/cjs/utils/index.js +0 -5
  230. package/cjs/utils/index.js.map +1 -1
  231. package/emotion/cjs/components/Dropdown/Dropdown.tokens.js +1 -1
  232. package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
  233. package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
  234. package/emotion/es/components/Dropdown/Dropdown.tokens.js +1 -1
  235. package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
  236. package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
  237. package/emotion/package.json +2 -1
  238. package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -1
  239. package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -1
  240. package/es/components/Attach/Attach.js +3 -4
  241. package/es/components/Attach/Attach.js.map +1 -1
  242. package/es/components/Attach/components/AttachButton/AttachButton.js +0 -1
  243. package/es/components/Attach/components/AttachButton/AttachButton.js.map +1 -1
  244. package/es/components/Attach/ui/Button/Button.styles.js +0 -1
  245. package/es/components/Attach/ui/Button/Button.styles.js.map +1 -1
  246. package/es/components/Attach/ui/Cell/Cell.styles.js +0 -2
  247. package/es/components/Attach/ui/Cell/Cell.styles.js.map +1 -1
  248. package/es/components/Attach/ui/IconButton/IconButton.styles.js +0 -1
  249. package/es/components/Attach/ui/IconButton/IconButton.styles.js.map +1 -1
  250. package/es/components/Attach/utils/getFileicon.js +3 -4
  251. package/es/components/Attach/utils/getFileicon.js.map +1 -1
  252. package/es/components/Attach/utils/index.js +0 -3
  253. package/es/components/Attach/utils/index.js.map +1 -1
  254. package/es/components/Autocomplete/Autocomplete.js +5 -6
  255. package/es/components/Autocomplete/Autocomplete.js.map +1 -1
  256. package/es/components/Autocomplete/Autocomplete.styles.js +2 -3
  257. package/es/components/Autocomplete/Autocomplete.styles.js.map +1 -1
  258. package/es/components/Autocomplete/ui/TextField/TextField.styles.js +1 -2
  259. package/es/components/Autocomplete/ui/TextField/TextField.styles.js.map +1 -1
  260. package/es/components/Avatar/Avatar.js +2 -3
  261. package/es/components/Avatar/Avatar.js.map +1 -1
  262. package/es/components/Breadcrumbs/Breadcrumbs.styles.js +2 -4
  263. package/es/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
  264. package/es/components/Button/Button.styles.js +0 -3
  265. package/es/components/Button/Button.styles.js.map +1 -1
  266. package/es/components/Calendar/CalendarBase/CalendarBase.js +5 -5
  267. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +8 -8
  268. package/es/components/Calendar/hooks/useDays.js +2 -2
  269. package/es/components/Calendar/hooks/useKeyNavigation.js +1 -1
  270. package/es/components/Calendar/hooks/useMonths.js +2 -2
  271. package/es/components/Calendar/hooks/useQuarters.js +2 -2
  272. package/es/components/Calendar/hooks/useYears.js +2 -2
  273. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  274. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +5 -6
  275. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  276. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +0 -1
  277. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
  278. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +4 -4
  279. package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +4 -4
  280. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +4 -4
  281. package/es/components/Combobox/ComboboxNew/Combobox.js +11 -12
  282. package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  283. package/es/components/Combobox/ComboboxNew/Combobox.styles.js +2 -4
  284. package/es/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
  285. package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +0 -2
  286. package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
  287. package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js +1 -2
  288. package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
  289. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +5 -6
  290. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  291. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -3
  292. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  293. package/es/components/Combobox/ComboboxNew/ui/Target/Target.styles.js +1 -2
  294. package/es/components/Combobox/ComboboxNew/ui/Target/Target.styles.js.map +1 -1
  295. package/es/components/Combobox/ComboboxOld/Combobox.css +1 -1
  296. package/es/components/Combobox/ComboboxOld/Combobox.js +4 -11
  297. package/es/components/Combobox/ComboboxOld/Combobox.js.map +1 -1
  298. package/es/components/Combobox/ComboboxOld/Combobox.styles.js +0 -1
  299. package/es/components/Combobox/ComboboxOld/Combobox.styles.js.map +1 -1
  300. package/es/components/Combobox/ComboboxOld/hooks/useFocusController.js +0 -1
  301. package/es/components/Combobox/ComboboxOld/hooks/useFocusController.js.map +1 -1
  302. package/es/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js +1 -2
  303. package/es/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js.map +1 -1
  304. package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +1 -1
  305. package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js +1 -11
  306. package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js.map +1 -1
  307. package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +1 -1
  308. package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js +1 -11
  309. package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js.map +1 -1
  310. package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +1 -1
  311. package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js +1 -11
  312. package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js.map +1 -1
  313. package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +1 -1
  314. package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js +1 -11
  315. package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js.map +1 -1
  316. package/es/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js +0 -2
  317. package/es/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  318. package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.js +1 -1
  319. package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js +1 -2
  320. package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js.map +1 -1
  321. package/es/components/DatePicker/DatePickerBase.styles.js +1 -7
  322. package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -1
  323. package/es/components/DatePicker/RangeDate/RangeDate.js +1 -1
  324. package/es/components/DatePicker/RangeDate/RangeDate.styles.js +0 -1
  325. package/es/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -1
  326. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +1 -2
  327. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
  328. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +2 -5
  329. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -1
  330. package/es/components/DatePicker/SingleDate/SingleDate.styles.js +0 -1
  331. package/es/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -1
  332. package/es/components/Drawer/Drawer.js +5 -10
  333. package/es/components/Drawer/Drawer.js.map +1 -1
  334. package/es/components/Drawer/Drawer.styles.js +0 -4
  335. package/es/components/Drawer/Drawer.styles.js.map +1 -1
  336. package/es/components/Drawer/hooks/useDrawer.js +0 -4
  337. package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
  338. package/es/components/Drawer/ui/DrawerContent/DrawerContent.js +0 -7
  339. package/es/components/Drawer/ui/DrawerContent/DrawerContent.js.map +1 -1
  340. package/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +0 -7
  341. package/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js.map +1 -1
  342. package/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +0 -3
  343. package/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js.map +1 -1
  344. package/es/components/Dropdown/Dropdown.css +1 -1
  345. package/es/components/Dropdown/Dropdown.js +3 -9
  346. package/es/components/Dropdown/Dropdown.js.map +1 -1
  347. package/es/components/Dropdown/Dropdown.styles.js +1 -1
  348. package/es/components/Dropdown/{Dropdown.styles_18f0qpm.css → Dropdown.styles_1ix6io8.css} +1 -1
  349. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  350. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -8
  351. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  352. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +1 -1
  353. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
  354. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  355. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -3
  356. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  357. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -2
  358. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -1
  359. package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +0 -1
  360. package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -1
  361. package/es/components/Editable/Editable.js +3 -4
  362. package/es/components/Editable/Editable.js.map +1 -1
  363. package/es/components/Editable/utils/clearSelection.js +0 -2
  364. package/es/components/Editable/utils/clearSelection.js.map +1 -1
  365. package/es/components/Editable/utils/selectText.js +0 -2
  366. package/es/components/Editable/utils/selectText.js.map +1 -1
  367. package/es/components/EmptyState/EmptyState.styles.js +1 -2
  368. package/es/components/EmptyState/EmptyState.styles.js.map +1 -1
  369. package/es/components/IconButton/IconButton.js +1 -1
  370. package/es/components/IconButton/IconButton.styles.js +0 -8
  371. package/es/components/IconButton/IconButton.styles.js.map +1 -1
  372. package/es/components/Modal/Modal.js +6 -8
  373. package/es/components/Modal/Modal.js.map +1 -1
  374. package/es/components/Modal/hooks/useModal.js +0 -4
  375. package/es/components/Modal/hooks/useModal.js.map +1 -1
  376. package/es/components/Notification/Notification.styles.js +2 -3
  377. package/es/components/Notification/Notification.styles.js.map +1 -1
  378. package/es/components/Notification/NotificationsPortal.js +3 -4
  379. package/es/components/Notification/NotificationsPortal.js.map +1 -1
  380. package/es/components/Pagination/Pagination.styles.js +1 -2
  381. package/es/components/Pagination/Pagination.styles.js.map +1 -1
  382. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -2
  383. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
  384. package/es/components/Panel/ui/PanelHeader/PanelHeader.js +1 -2
  385. package/es/components/Panel/ui/PanelHeader/PanelHeader.js.map +1 -1
  386. package/es/components/Panel/ui/PanelHeader/PanelHeader.styles.js +1 -2
  387. package/es/components/Panel/ui/PanelHeader/PanelHeader.styles.js.map +1 -1
  388. package/es/components/Popover/Popover.js +1 -1
  389. package/es/components/Popup/Popup.js +2 -2
  390. package/es/components/Popup/PopupContext.js +1 -1
  391. package/es/components/Range/Range.styles.js +0 -1
  392. package/es/components/Range/Range.styles.js.map +1 -1
  393. package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +4 -5
  394. package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
  395. package/es/components/Select/Select.js +11 -12
  396. package/es/components/Select/Select.js.map +1 -1
  397. package/es/components/Select/Select.styles.js +2 -5
  398. package/es/components/Select/Select.styles.js.map +1 -1
  399. package/es/components/Select/hooks/usePathMaps.js +0 -2
  400. package/es/components/Select/hooks/usePathMaps.js.map +1 -1
  401. package/es/components/Select/ui/Inner/Inner.js +1 -2
  402. package/es/components/Select/ui/Inner/Inner.js.map +1 -1
  403. package/es/components/Select/ui/Inner/ui/Item/Item.js +4 -5
  404. package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
  405. package/es/components/Select/ui/Inner/ui/Item/Item.styles.js +0 -1
  406. package/es/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  407. package/es/components/Select/ui/Target/ui/Button/Button.js +1 -1
  408. package/es/components/Select/ui/Target/ui/Button/Button.styles.js +1 -3
  409. package/es/components/Select/ui/Target/ui/Button/Button.styles.js.map +1 -1
  410. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +2 -2
  411. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -4
  412. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  413. package/es/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js +1 -2
  414. package/es/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js.map +1 -1
  415. package/es/components/Select/utils/getButtonLabel.js +0 -2
  416. package/es/components/Select/utils/getButtonLabel.js.map +1 -1
  417. package/es/components/Sheet/Sheet.js +3 -3
  418. package/es/components/Skeleton/LineSkeleton/LineSkeleton.js +2 -4
  419. package/es/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
  420. package/es/components/Skeleton/RectSkeleton/RectSkeleton.js +2 -4
  421. package/es/components/Skeleton/RectSkeleton/RectSkeleton.js.map +1 -1
  422. package/es/components/Slider/Slider.js +0 -8
  423. package/es/components/Slider/Slider.js.map +1 -1
  424. package/es/components/Slider/components/Double/Double.js +1 -2
  425. package/es/components/Slider/components/Double/Double.js.map +1 -1
  426. package/es/components/Slider/components/Double/Double.styles.js +0 -1
  427. package/es/components/Slider/components/Double/Double.styles.js.map +1 -1
  428. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +0 -3
  429. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
  430. package/es/components/Slider/components/Single/Single.js +1 -2
  431. package/es/components/Slider/components/Single/Single.js.map +1 -1
  432. package/es/components/Slider/components/SliderBase/SliderBase.js +1 -1
  433. package/es/components/Steps/Steps.js +1 -1
  434. package/es/components/Steps/ui/StepItem/StepItem.styles.js +0 -1
  435. package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  436. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +2 -3
  437. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
  438. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +2 -3
  439. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
  440. package/es/components/TextArea/TextArea.js +2 -2
  441. package/es/components/TextArea/TextArea.styles.js +2 -3
  442. package/es/components/TextArea/TextArea.styles.js.map +1 -1
  443. package/es/components/TextArea/ui/Hint/Hint.js +1 -2
  444. package/es/components/TextArea/ui/Hint/Hint.js.map +1 -1
  445. package/es/components/TextField/TextField.js +3 -3
  446. package/es/components/TextField/TextField.styles.js +1 -2
  447. package/es/components/TextField/TextField.styles.js.map +1 -1
  448. package/es/components/TextField/ui/Hint/Hint.js +1 -2
  449. package/es/components/TextField/ui/Hint/Hint.js.map +1 -1
  450. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -2
  451. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
  452. package/es/components/Toast/Toast.styles.js +1 -1
  453. package/es/components/Toast/ToastController.js +1 -1
  454. package/es/components/Toast/utils.js +1 -2
  455. package/es/components/Toast/utils.js.map +1 -1
  456. package/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  457. package/es/components/Tooltip/Tooltip.js +2 -3
  458. package/es/components/Tooltip/Tooltip.js.map +1 -1
  459. package/es/engines/index.js +0 -2
  460. package/es/engines/index.js.map +1 -1
  461. package/es/hooks/useIsomorphicLayoutEffect.js +0 -1
  462. package/es/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  463. package/es/index.css +1 -1
  464. package/es/index.js +21 -24
  465. package/es/index.js.map +1 -1
  466. package/es/utils/index.js +0 -3
  467. package/es/utils/index.js.map +1 -1
  468. package/package.json +5 -2
  469. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +1 -1
  470. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +4 -4
  471. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +4 -4
  472. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -1
  473. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +4 -4
  474. package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +4 -4
  475. package/styled-components/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentGroup.js","sources":["../../../../../src/components/Segment/ui/SegmentGroup/SegmentGroup.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport type { RefObject, MutableRefObject } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../engines/types';\nimport {\n IconDisclosureLeftWithOffset,\n IconDisclosureRightWithOffset,\n IconDisclosureDownWithOffset,\n IconDisclosureUpWithOffset,\n} from '../../../_Icon';\nimport { classes, tokens } from '../../tokens';\nimport { cx } from '../../../../utils';\nimport { useSegmentInner } from '../../SegmentProvider/SegmentProvider';\n\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport { base as filledBackgroundCSS } from './variations/_filledBackgound/base';\nimport { base as stretchCSS } from './variations/_stretch/base';\nimport { base as orientationCSS } from './variations/_orientation/base';\nimport type { SegmentGroupProps } from './SegmentGroup.types';\nimport {\n StyledContent,\n StyledContentWrapper,\n base,\n StyledLeftArrow,\n StyledRightArrow,\n StyledTopArrow,\n StyledBottomArrow,\n} from './SegmentGroup.styles';\n\nenum Keys {\n end = 35,\n home = 36,\n left = 37,\n right = 39,\n}\n\nexport const getChildNodes = (wrapper: HTMLElement | null) => {\n const container = wrapper?.firstChild;\n return container ? (Array.from(container?.childNodes) as HTMLElement[]) : [];\n};\n\nexport const segmentGroupRoot = (Root: RootProps<HTMLDivElement, SegmentGroupProps>) =>\n forwardRef<HTMLDivElement, SegmentGroupProps>((props, outerRef) => {\n const {\n id,\n selectionMode,\n pilled,\n stretch,\n clip = true,\n orientation = 'horizontal',\n filledBackground = false,\n hasBackground = false,\n disabled = false,\n size,\n view,\n children,\n ...rest\n } = props;\n\n const scrollRef = useRef<HTMLElement | null>(null);\n const trackRef = useRef<HTMLElement | null>(null);\n const leftArrowRef = useRef<HTMLButtonElement | null>(null);\n\n const { setSelectionMode, setDisabledGroup } = useSegmentInner();\n\n const [firstItemVisible, setFirstItemVisible] = useState(true);\n const [lastItemVisible, setLastItemVisible] = useState(true);\n\n const uniqId = safeUseId();\n const segmentGroupId = id || uniqId;\n\n const canClip = clip && !stretch;\n\n const isVertical = orientation === 'vertical';\n const stretchClass =\n (clip ? firstItemVisible && lastItemVisible : true) && stretch ? classes.segmentStretch : undefined;\n\n const orientationClass = isVertical ? classes.segmentVertical : undefined;\n const clipScrollClass = canClip ? classes.segmentGroupClipScroll : undefined;\n\n const pilledAttr = (view !== 'clear' || hasBackground) && pilled;\n const filledBackgroundAttr = (view !== 'clear' && filledBackground) || hasBackground;\n\n const pilledClass = pilledAttr ? classes.segmentPilled : undefined;\n const filledClass = filledBackgroundAttr ? classes.segmentGroupFilledBackground : undefined;\n\n const onPrev = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const childNodes = getChildNodes(scrollRef.current);\n\n const scrollLeft = Math.round(scrollRef.current.scrollLeft);\n const firstOverflowingTab = childNodes\n .slice()\n .reverse()\n .find((child: HTMLElement | null) => {\n if (!child || child.offsetLeft === undefined) {\n return;\n }\n const tabStartX = child.offsetLeft;\n\n return tabStartX < scrollLeft;\n });\n\n firstOverflowingTab?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [disabled, scrollRef]);\n\n const onNext = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollRight = Math.round(scrollRef.current.scrollLeft + scrollRef.current.clientWidth);\n\n const childNodes = getChildNodes(scrollRef.current);\n\n const lastOverflowingChild = childNodes.find((child) => {\n if (!child || child.offsetLeft === undefined) {\n return;\n }\n const tabEndX = child.offsetLeft + child.offsetWidth;\n\n return tabEndX > scrollRight;\n });\n\n lastOverflowingChild?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [disabled, scrollRef]);\n\n const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n const childNodes = getChildNodes(scrollRef?.current);\n\n const index = childNodes.findIndex((child) => document.activeElement === child);\n\n const minIndex = 0;\n const maxIndex = childNodes.length - 1;\n let nextIndex: number;\n\n switch (event.keyCode) {\n case Keys.end:\n nextIndex = maxIndex;\n break;\n case Keys.left:\n nextIndex = index > minIndex ? index - 1 : index;\n break;\n case Keys.right:\n nextIndex = index < maxIndex ? index + 1 : index;\n break;\n case Keys.home:\n nextIndex = minIndex;\n break;\n default:\n return;\n }\n\n if (nextIndex !== index) {\n event.preventDefault();\n childNodes[nextIndex]?.focus();\n childNodes[nextIndex]?.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }, []);\n\n const handleScroll = useCallback(\n (event: React.UIEvent<HTMLElement>): void => {\n event.stopPropagation?.();\n\n if (!canClip) {\n setFirstItemVisible(true);\n setLastItemVisible(true);\n return;\n }\n\n if (isVertical) {\n const maxScrollTop = event.currentTarget.scrollHeight - event.currentTarget.clientHeight;\n const scrollTop = Math.round(event.currentTarget.scrollTop);\n\n setFirstItemVisible(scrollTop <= 0);\n setLastItemVisible(scrollTop >= maxScrollTop);\n return;\n }\n\n const maxScrollLeft = event.currentTarget.scrollWidth - event.currentTarget.clientWidth;\n const scrollLeft = Math.round(event.currentTarget.scrollLeft);\n\n setFirstItemVisible(scrollLeft <= 0);\n setLastItemVisible(scrollLeft >= maxScrollLeft);\n },\n [isVertical, canClip],\n );\n\n useEffect(() => {\n handleScroll(({ currentTarget: scrollRef.current } as unknown) as React.UIEvent<HTMLElement>);\n }, [handleScroll]);\n\n useEffect(() => {\n if (!canClip) {\n setLastItemVisible(true);\n return;\n }\n\n setLastItemVisible(\n isVertical\n ? scrollRef.current?.scrollHeight === scrollRef.current?.clientHeight\n : scrollRef.current?.scrollWidth === scrollRef.current?.clientWidth,\n );\n }, [isVertical, canClip]);\n\n // Этот хук компенсирует появление левой/верхней стрелки при прокрутке\n useEffect(() => {\n if (firstItemVisible || !scrollRef.current || !leftArrowRef.current) {\n return;\n }\n\n if (isVertical) {\n scrollRef.current.scrollTo({\n top: Math.round(scrollRef.current.scrollTop + leftArrowRef.current.clientHeight),\n });\n return;\n }\n\n scrollRef.current.scrollTo({\n left: Math.round(scrollRef.current.scrollLeft + leftArrowRef.current.clientWidth),\n });\n }, [firstItemVisible, isVertical]);\n\n const PreviousButton = useMemo(() => {\n const ArrowNode = isVertical ? StyledTopArrow : StyledLeftArrow;\n return (\n <ArrowNode\n type=\"button\"\n aria-label=\"Предыдущий сегмент\"\n onClick={onPrev}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n {isVertical ? (\n <IconDisclosureUpWithOffset color={`var(${tokens.arrowColor})`} size=\"s\" />\n ) : (\n <IconDisclosureLeftWithOffset color={`var(${tokens.arrowColor})`} />\n )}\n </ArrowNode>\n );\n }, [onPrev, isVertical]);\n\n const NextButton = useMemo(() => {\n const ArrowNode = isVertical ? StyledBottomArrow : StyledRightArrow;\n return (\n <ArrowNode\n type=\"button\"\n aria-label=\"Следующий сегмент\"\n onClick={onNext}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n {isVertical ? (\n <IconDisclosureDownWithOffset color={`var(${tokens.arrowColor})`} size=\"s\" />\n ) : (\n <IconDisclosureRightWithOffset color={`var(${tokens.arrowColor})`} />\n )}\n </ArrowNode>\n );\n }, [onNext, isVertical]);\n\n useEffect(() => {\n selectionMode && setSelectionMode(selectionMode);\n setDisabledGroup(disabled);\n }, [selectionMode, disabled]);\n\n return (\n <Root\n view={view}\n size={size}\n orientation={orientation}\n id={segmentGroupId}\n ref={outerRef}\n filledBackground={filledBackgroundAttr}\n disabled={disabled}\n pilled={pilledAttr}\n className={cx(pilledClass, filledClass, stretchClass, orientationClass)}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper\n className={cx(clipScrollClass)}\n ref={scrollRef as RefObject<HTMLDivElement>}\n onScroll={handleScroll}\n >\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>{children}</StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n );\n });\n\nexport const segmentGroupConfig = {\n name: 'SegmentGroup',\n tag: 'div',\n layout: segmentGroupRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n stretch: {\n css: stretchCSS,\n attrs: true,\n },\n orientation: {\n css: orientationCSS,\n },\n filledBackground: {\n css: filledBackgroundCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'clear',\n size: 'xs',\n },\n};\n"],"names":["Keys","getChildNodes","wrapper","container","firstChild","Array","from","childNodes","segmentGroupRoot","Root","forwardRef","props","outerRef","id","selectionMode","pilled","stretch","_props$clip","clip","_props$orientation","orientation","_props$filledBackgrou","filledBackground","_props$hasBackground","hasBackground","_props$disabled","disabled","size","view","children","rest","_objectWithoutProperties","_excluded","scrollRef","useRef","trackRef","leftArrowRef","_useSegmentInner","useSegmentInner","setSelectionMode","setDisabledGroup","_useState","useState","_useState2","_slicedToArray","firstItemVisible","setFirstItemVisible","_useState3","_useState4","lastItemVisible","setLastItemVisible","uniqId","safeUseId","segmentGroupId","canClip","isVertical","stretchClass","classes","segmentStretch","undefined","orientationClass","segmentVertical","clipScrollClass","segmentGroupClipScroll","pilledAttr","filledBackgroundAttr","pilledClass","segmentPilled","filledClass","segmentGroupFilledBackground","onPrev","useCallback","current","scrollLeft","Math","round","firstOverflowingTab","slice","reverse","find","child","offsetLeft","tabStartX","scrollIntoView","block","inline","onNext","scrollRight","clientWidth","lastOverflowingChild","tabEndX","offsetWidth","onKeyDown","event","index","findIndex","document","activeElement","minIndex","maxIndex","length","nextIndex","keyCode","end","left","right","home","_childNodes$nextIndex","_childNodes$nextIndex2","preventDefault","focus","behavior","handleScroll","_event$stopPropagatio","stopPropagation","call","maxScrollTop","currentTarget","scrollHeight","clientHeight","scrollTop","maxScrollLeft","scrollWidth","useEffect","_scrollRef$current","_scrollRef$current2","_scrollRef$current3","_scrollRef$current4","scrollTo","top","PreviousButton","useMemo","ArrowNode","StyledTopArrow","StyledLeftArrow","React","createElement","type","onClick","tabIndex","IconDisclosureUpWithOffset","color","concat","tokens","arrowColor","IconDisclosureLeftWithOffset","NextButton","StyledBottomArrow","StyledRightArrow","IconDisclosureDownWithOffset","IconDisclosureRightWithOffset","_extends","ref","className","cx","StyledContentWrapper","onScroll","StyledContent","segmentGroupConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","pilledCSS","stretchCSS","orientationCSS","filledBackgroundCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+B+B,IAE1BA,IAAI,0BAAJA,IAAI,EAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,KAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA,GAAA,OAAA,CAAA;AAAA,EAAA,OAAJA,IAAI,CAAA;AAAA,CAAA,CAAJA,IAAI,IAAA,EAAA,CAAA,CAAA;IAOIC,aAAa,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B,CAACoB,eAAe,IAAIiG,UACnB,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMY,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEzJ,gBAAgB;AACxB0J,EAAAA,IAAI,EAAJA,wBAAI;AACJC,EAAAA,UAAU,EAAE;AACRxI,IAAAA,IAAI,EAAE;AACFyI,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDzI,IAAAA,IAAI,EAAE;AACFwI,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACD5I,IAAAA,QAAQ,EAAE;AACN0I,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDzJ,IAAAA,MAAM,EAAE;AACJqJ,MAAAA,GAAG,EAAEK,WAAS;AACdD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDxJ,IAAAA,OAAO,EAAE;AACLoJ,MAAAA,GAAG,EAAEM,WAAU;AACfF,MAAAA,KAAK,EAAE,IAAA;KACV;AACDpJ,IAAAA,WAAW,EAAE;AACTgJ,MAAAA,GAAG,EAAEO,WAAAA;KACR;AACDrJ,IAAAA,gBAAgB,EAAE;AACd8I,MAAAA,GAAG,EAAEQ,WAAmB;AACxBJ,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDK,EAAAA,QAAQ,EAAE;AACNjJ,IAAAA,IAAI,EAAE,OAAO;AACbD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;;;"}
1
+ {"version":3,"file":"SegmentGroup.js","sources":["../../../../../src/components/Segment/ui/SegmentGroup/SegmentGroup.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport type { RefObject, MutableRefObject } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../engines/types';\nimport {\n IconDisclosureLeftWithOffset,\n IconDisclosureRightWithOffset,\n IconDisclosureDownWithOffset,\n IconDisclosureUpWithOffset,\n} from '../../../_Icon';\nimport { classes, tokens } from '../../tokens';\nimport { cx } from '../../../../utils';\nimport { useSegmentInner } from '../../SegmentProvider/SegmentProvider';\n\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport { base as filledBackgroundCSS } from './variations/_filledBackgound/base';\nimport { base as stretchCSS } from './variations/_stretch/base';\nimport { base as orientationCSS } from './variations/_orientation/base';\nimport type { SegmentGroupProps } from './SegmentGroup.types';\nimport {\n StyledContent,\n StyledContentWrapper,\n base,\n StyledLeftArrow,\n StyledRightArrow,\n StyledTopArrow,\n StyledBottomArrow,\n} from './SegmentGroup.styles';\n\nenum Keys {\n end = 35,\n home = 36,\n left = 37,\n right = 39,\n}\n\nexport const getChildNodes = (wrapper: HTMLElement | null) => {\n const container = wrapper?.firstChild;\n return container ? (Array.from(container?.childNodes) as HTMLElement[]) : [];\n};\n\nexport const segmentGroupRoot = (Root: RootProps<HTMLDivElement, SegmentGroupProps>) =>\n forwardRef<HTMLDivElement, SegmentGroupProps>((props, outerRef) => {\n const {\n id,\n selectionMode,\n pilled,\n stretch,\n clip = true,\n orientation = 'horizontal',\n filledBackground = false,\n hasBackground = false,\n disabled = false,\n size,\n view,\n children,\n ...rest\n } = props;\n\n const scrollRef = useRef<HTMLElement | null>(null);\n const trackRef = useRef<HTMLElement | null>(null);\n const leftArrowRef = useRef<HTMLButtonElement | null>(null);\n\n const { setSelectionMode, setDisabledGroup } = useSegmentInner();\n\n const [firstItemVisible, setFirstItemVisible] = useState(true);\n const [lastItemVisible, setLastItemVisible] = useState(true);\n\n const uniqId = safeUseId();\n const segmentGroupId = id || uniqId;\n\n const canClip = clip && !stretch;\n\n const isVertical = orientation === 'vertical';\n const stretchClass =\n (clip ? firstItemVisible && lastItemVisible : true) && stretch ? classes.segmentStretch : undefined;\n\n const orientationClass = isVertical ? classes.segmentVertical : undefined;\n const clipScrollClass = canClip ? classes.segmentGroupClipScroll : undefined;\n\n const pilledAttr = (view !== 'clear' || hasBackground) && pilled;\n const filledBackgroundAttr = (view !== 'clear' && filledBackground) || hasBackground;\n\n const pilledClass = pilledAttr ? classes.segmentPilled : undefined;\n const filledClass = filledBackgroundAttr ? classes.segmentGroupFilledBackground : undefined;\n\n const onPrev = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const childNodes = getChildNodes(scrollRef.current);\n\n const scrollLeft = Math.round(scrollRef.current.scrollLeft);\n const firstOverflowingTab = childNodes\n .slice()\n .reverse()\n .find((child: HTMLElement | null) => {\n if (!child || child.offsetLeft === undefined) {\n return;\n }\n const tabStartX = child.offsetLeft;\n\n return tabStartX < scrollLeft;\n });\n\n firstOverflowingTab?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [disabled, scrollRef]);\n\n const onNext = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollRight = Math.round(scrollRef.current.scrollLeft + scrollRef.current.clientWidth);\n\n const childNodes = getChildNodes(scrollRef.current);\n\n const lastOverflowingChild = childNodes.find((child) => {\n if (!child || child.offsetLeft === undefined) {\n return;\n }\n const tabEndX = child.offsetLeft + child.offsetWidth;\n\n return tabEndX > scrollRight;\n });\n\n lastOverflowingChild?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [disabled, scrollRef]);\n\n const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n const childNodes = getChildNodes(scrollRef?.current);\n\n const index = childNodes.findIndex((child) => document.activeElement === child);\n\n const minIndex = 0;\n const maxIndex = childNodes.length - 1;\n let nextIndex: number;\n\n switch (event.keyCode) {\n case Keys.end:\n nextIndex = maxIndex;\n break;\n case Keys.left:\n nextIndex = index > minIndex ? index - 1 : index;\n break;\n case Keys.right:\n nextIndex = index < maxIndex ? index + 1 : index;\n break;\n case Keys.home:\n nextIndex = minIndex;\n break;\n default:\n return;\n }\n\n if (nextIndex !== index) {\n event.preventDefault();\n childNodes[nextIndex]?.focus();\n childNodes[nextIndex]?.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }, []);\n\n const handleScroll = useCallback(\n (event: React.UIEvent<HTMLElement>): void => {\n event.stopPropagation?.();\n\n if (!canClip) {\n setFirstItemVisible(true);\n setLastItemVisible(true);\n return;\n }\n\n if (isVertical) {\n const maxScrollTop = event.currentTarget.scrollHeight - event.currentTarget.clientHeight;\n const scrollTop = Math.round(event.currentTarget.scrollTop);\n\n setFirstItemVisible(scrollTop <= 0);\n setLastItemVisible(scrollTop >= maxScrollTop);\n return;\n }\n\n const maxScrollLeft = event.currentTarget.scrollWidth - event.currentTarget.clientWidth;\n const scrollLeft = Math.round(event.currentTarget.scrollLeft);\n\n setFirstItemVisible(scrollLeft <= 0);\n setLastItemVisible(scrollLeft >= maxScrollLeft);\n },\n [isVertical, canClip],\n );\n\n useEffect(() => {\n handleScroll(({ currentTarget: scrollRef.current } as unknown) as React.UIEvent<HTMLElement>);\n }, [handleScroll]);\n\n useEffect(() => {\n if (!canClip) {\n setLastItemVisible(true);\n return;\n }\n\n setLastItemVisible(\n isVertical\n ? scrollRef.current?.scrollHeight === scrollRef.current?.clientHeight\n : scrollRef.current?.scrollWidth === scrollRef.current?.clientWidth,\n );\n }, [isVertical, canClip]);\n\n // Этот хук компенсирует появление левой/верхней стрелки при прокрутке\n useEffect(() => {\n if (firstItemVisible || !scrollRef.current || !leftArrowRef.current) {\n return;\n }\n\n if (isVertical) {\n scrollRef.current.scrollTo({\n top: Math.round(scrollRef.current.scrollTop + leftArrowRef.current.clientHeight),\n });\n return;\n }\n\n scrollRef.current.scrollTo({\n left: Math.round(scrollRef.current.scrollLeft + leftArrowRef.current.clientWidth),\n });\n }, [firstItemVisible, isVertical]);\n\n const PreviousButton = useMemo(() => {\n const ArrowNode = isVertical ? StyledTopArrow : StyledLeftArrow;\n return (\n <ArrowNode\n type=\"button\"\n aria-label=\"Предыдущий сегмент\"\n onClick={onPrev}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n {isVertical ? (\n <IconDisclosureUpWithOffset color={`var(${tokens.arrowColor})`} size=\"s\" />\n ) : (\n <IconDisclosureLeftWithOffset color={`var(${tokens.arrowColor})`} />\n )}\n </ArrowNode>\n );\n }, [onPrev, isVertical]);\n\n const NextButton = useMemo(() => {\n const ArrowNode = isVertical ? StyledBottomArrow : StyledRightArrow;\n return (\n <ArrowNode\n type=\"button\"\n aria-label=\"Следующий сегмент\"\n onClick={onNext}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n {isVertical ? (\n <IconDisclosureDownWithOffset color={`var(${tokens.arrowColor})`} size=\"s\" />\n ) : (\n <IconDisclosureRightWithOffset color={`var(${tokens.arrowColor})`} />\n )}\n </ArrowNode>\n );\n }, [onNext, isVertical]);\n\n useEffect(() => {\n selectionMode && setSelectionMode(selectionMode);\n setDisabledGroup(disabled);\n }, [selectionMode, disabled]);\n\n return (\n <Root\n view={view}\n size={size}\n orientation={orientation}\n id={segmentGroupId}\n ref={outerRef}\n filledBackground={filledBackgroundAttr}\n disabled={disabled}\n pilled={pilledAttr}\n className={cx(pilledClass, filledClass, stretchClass, orientationClass)}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper\n className={cx(clipScrollClass)}\n ref={scrollRef as RefObject<HTMLDivElement>}\n onScroll={handleScroll}\n >\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>{children}</StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n );\n });\n\nexport const segmentGroupConfig = {\n name: 'SegmentGroup',\n tag: 'div',\n layout: segmentGroupRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n stretch: {\n css: stretchCSS,\n attrs: true,\n },\n orientation: {\n css: orientationCSS,\n },\n filledBackground: {\n css: filledBackgroundCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'clear',\n size: 'xs',\n },\n};\n"],"names":["Keys","getChildNodes","wrapper","container","firstChild","Array","from","childNodes","segmentGroupRoot","Root","forwardRef","props","outerRef","id","selectionMode","pilled","stretch","_props$clip","clip","_props$orientation","orientation","_props$filledBackgrou","filledBackground","_props$hasBackground","hasBackground","_props$disabled","disabled","size","view","children","rest","_objectWithoutProperties","_excluded","scrollRef","useRef","trackRef","leftArrowRef","_useSegmentInner","useSegmentInner","setSelectionMode","setDisabledGroup","_useState","useState","_useState2","_slicedToArray","firstItemVisible","setFirstItemVisible","_useState3","_useState4","lastItemVisible","setLastItemVisible","uniqId","safeUseId","segmentGroupId","canClip","isVertical","stretchClass","classes","segmentStretch","undefined","orientationClass","segmentVertical","clipScrollClass","segmentGroupClipScroll","pilledAttr","filledBackgroundAttr","pilledClass","segmentPilled","filledClass","segmentGroupFilledBackground","onPrev","useCallback","current","scrollLeft","Math","round","firstOverflowingTab","slice","reverse","find","child","offsetLeft","tabStartX","scrollIntoView","block","inline","onNext","scrollRight","clientWidth","lastOverflowingChild","tabEndX","offsetWidth","onKeyDown","event","index","findIndex","document","activeElement","minIndex","maxIndex","length","nextIndex","keyCode","end","left","right","home","_childNodes$nextIndex","_childNodes$nextIndex2","preventDefault","focus","behavior","handleScroll","_event$stopPropagatio","stopPropagation","call","maxScrollTop","currentTarget","scrollHeight","clientHeight","scrollTop","maxScrollLeft","scrollWidth","useEffect","_scrollRef$current","_scrollRef$current2","_scrollRef$current3","_scrollRef$current4","scrollTo","top","PreviousButton","useMemo","ArrowNode","StyledTopArrow","StyledLeftArrow","React","createElement","type","onClick","tabIndex","IconDisclosureUpWithOffset","color","concat","tokens","arrowColor","IconDisclosureLeftWithOffset","NextButton","StyledBottomArrow","StyledRightArrow","IconDisclosureDownWithOffset","IconDisclosureRightWithOffset","_extends","ref","className","cx","StyledContentWrapper","onScroll","StyledContent","segmentGroupConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","pilledCSS","stretchCSS","orientationCSS","filledBackgroundCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+B+B,IAE1BA,IAAI,0BAAJA,IAAI,EAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,KAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA,GAAA,OAAA,CAAA;AAAA,EAAA,OAAJA,IAAI,CAAA;AAAA,CAAA,CAAJA,IAAI,IAAA,EAAA,CAAA,CAAA;IAOIC,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,OAA2B,EAAK;EAC1D,IAAMC,SAAS,GAAGD,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,CAAEE,UAAU,CAAA;AACrC,EAAA,OAAOD,SAAS,GAAIE,KAAK,CAACC,IAAI,CAACH,SAAS,KAATA,IAAAA,IAAAA,SAAS,uBAATA,SAAS,CAAEI,UAAU,CAAC,GAAqB,EAAE,CAAA;AAChF,EAAC;IAEYC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAkD,EAAA;AAAA,EAAA,oBAC/EC,gBAAU,CAAoC,UAACC,KAAK,EAAEC,QAAQ,EAAK;AAC/D,IAAA,IACIC,EAAE,GAaFF,KAAK,C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ACV;AACDzJ,IAAAA,MAAM,EAAE;AACJqJ,MAAAA,GAAG,EAAEK,WAAS;AACdD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDxJ,IAAAA,OAAO,EAAE;AACLoJ,MAAAA,GAAG,EAAEM,WAAU;AACfF,MAAAA,KAAK,EAAE,IAAA;KACV;AACDpJ,IAAAA,WAAW,EAAE;AACTgJ,MAAAA,GAAG,EAAEO,WAAAA;KACR;AACDrJ,IAAAA,gBAAgB,EAAE;AACd8I,MAAAA,GAAG,EAAEQ,WAAmB;AACxBJ,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDK,EAAAA,QAAQ,EAAE;AACNjJ,IAAAA,IAAI,EAAE,OAAO;AACbD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;;;"}
@@ -4,25 +4,24 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- require('../../utils/react.js');
8
- var isEmpty = require('../../utils/isEmpty.js');
9
- var getPopoverPlacement = require('../../utils/getPopoverPlacement.js');
10
- var useOutsideClick = require('../../hooks/useOutsideClick.js');
11
7
  var useKeyboardNavigation = require('./hooks/useKeyboardNavigation.js');
8
+ var usePathMaps = require('./hooks/usePathMaps.js');
9
+ var Select_styles = require('./Select.styles.js');
10
+ var base = require('./variations/_view/base.js');
11
+ var base$1 = require('./variations/_size/base.js');
12
12
  var initialItemsTransform = require('./utils/initialItemsTransform.js');
13
+ var pathReducer = require('./reducers/pathReducer.js');
14
+ var focusedPathReducer = require('./reducers/focusedPathReducer.js');
15
+ var focusedChipIndexReducer = require('./reducers/focusedChipIndexReducer.js');
16
+ var useOutsideClick = require('../../hooks/useOutsideClick.js');
17
+ var isEmpty = require('../../utils/isEmpty.js');
13
18
  var updateDescendants = require('./utils/updateDescendants.js');
14
19
  var updateAncestors = require('./utils/updateAncestors.js');
15
20
  var updateSingleAncestors = require('./utils/updateSingleAncestors.js');
16
21
  var getView = require('./utils/getView.js');
17
- var Inner = require('./ui/Inner/Inner.js');
22
+ var getPopoverPlacement = require('../../utils/getPopoverPlacement.js');
18
23
  var Target = require('./ui/Target/Target.js');
19
- var pathReducer = require('./reducers/pathReducer.js');
20
- var focusedPathReducer = require('./reducers/focusedPathReducer.js');
21
- var focusedChipIndexReducer = require('./reducers/focusedChipIndexReducer.js');
22
- var usePathMaps = require('./hooks/usePathMaps.js');
23
- var Select_styles = require('./Select.styles.js');
24
- var base = require('./variations/_view/base.js');
25
- var base$1 = require('./variations/_size/base.js');
24
+ var Inner = require('./ui/Inner/Inner.js');
26
25
 
27
26
  var _excluded = ["value", "onChange", "target", "items", "placement", "label", "labelPlacement", "placeholder", "helperText", "disabled", "view", "size", "listOverflow", "listHeight", "listWidth", "contentLeft", "onScrollBottom", "chipView", "variant", "portal", "renderValue", "renderItem", "status", "onItemSelect", "separator", "closeAfterSelect"];
28
27
  var Context = /*#__PURE__*/React.createContext({});
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { isEmpty, getPlacements } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, getView } from './utils';\nimport { Inner, Target } from './ui';\nimport { pathReducer, focusedPathReducer, focusedChipIndexReducer } from './reducers';\nimport { usePathMaps } from './hooks/usePathMaps';\nimport { StyledPopover, Ul, base, OuterLabel, HelperText } from './Select.styles';\nimport type { ItemContext, MergedSelectProps } from './Select.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { MergedDropdownNodeTransformed } from './ui/Inner/ui/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список. Поддерживает выбор одного или нескольких значений.\n */\nexport const selectRoot = (Root: RootProps<HTMLButtonElement, Omit<MergedSelectProps, 'items'>>) =>\n forwardRef<HTMLButtonElement, MergedSelectProps>((props, ref) => {\n const {\n value: outerValue,\n onChange: outerOnChange,\n target = 'textfield-like',\n items,\n placement = 'bottom',\n label,\n labelPlacement = 'outer',\n placeholder,\n helperText,\n disabled = false,\n view,\n size,\n listOverflow,\n listHeight,\n listWidth,\n contentLeft,\n onScrollBottom,\n chipView,\n variant = 'normal',\n portal,\n renderValue,\n renderItem,\n status,\n onItemSelect,\n separator,\n closeAfterSelect: outerCloseAfterSelect,\n ...rest\n } = props;\n\n const [internalValue, setInternalValue] = useState<string | number | Array<string | number>>(\n outerValue || props.multiselect ? [] : '',\n );\n\n const value = outerValue || internalValue;\n\n const onChange = (e: string | number | Array<string | number>) => {\n if (outerOnChange) {\n outerOnChange(e as any);\n }\n\n setInternalValue(e);\n };\n\n const transformedItems = useMemo(() => initialItemsTransform(items || []), [items]);\n\n const [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] = usePathMaps(transformedItems);\n\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [focusedChipIndex, dispatchFocusedChipIndex] = useReducer(focusedChipIndexReducer, null);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const closeAfterSelect = outerCloseAfterSelect ?? !props.multiselect;\n\n const targetRef = useOutsideClick<HTMLDivElement>(() => {\n if (focusedChipIndex != null) {\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n });\n\n const handleToggle = (opened: boolean) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n };\n\n const handleCheckboxChange = (item: MergedDropdownNodeTransformed) => {\n if (props.multiselect) {\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value)) {\n checkedCopy.set(item.value, true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value, false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string | number> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value);\n }\n });\n\n if (closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(newValues);\n }\n }\n };\n\n const handleItemClick = (item: MergedDropdownNodeTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (!isEmpty(item?.items)) {\n return;\n }\n\n if (props.multiselect) {\n handleCheckboxChange(item);\n } else {\n if (e) {\n e.stopPropagation();\n }\n\n const checkedCopy = new Map(checked);\n\n const isCurrentChecked = checkedCopy.get(item.value);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isCurrentChecked) {\n checkedCopy.set(item.value, 'done');\n updateSingleAncestors(item, checkedCopy, 'dot');\n }\n\n if (closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(isCurrentChecked ? '' : item.value);\n }\n\n if (onItemSelect) {\n onItemSelect(item, e!);\n }\n }\n };\n\n const handleChipClick = (currentValue: string) => {\n handleCheckboxChange(valueToItemMap.get(currentValue)!);\n };\n\n const handlePressDown = (item: MergedDropdownNodeTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (props.multiselect) {\n handleCheckboxChange(item);\n }\n };\n\n const handleScroll = (e: React.UIEvent<HTMLUListElement>) => {\n if (!onScrollBottom) return;\n\n const { target } = e;\n\n if (\n (target as HTMLElement).scrollHeight - (target as HTMLElement).scrollTop ===\n (target as HTMLElement).clientHeight\n ) {\n onScrollBottom(e);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n value,\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleToggle,\n handlePressDown,\n focusedChipIndex,\n dispatchFocusedChipIndex,\n valueToItemMap,\n multiselect: props.multiselect,\n isTargetAmount: props.isTargetAmount,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n // В данном эффекте мы следим за изменениями value и вносим коррективы в дерево чекбоксов.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value) || typeof value === 'number') {\n if (Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value, 'done');\n updateSingleAncestors(valueToItemMap.get(value)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n }, [value]);\n\n return (\n <Root ref={ref} size={size} view={status ? getView(status) : view} chipView={chipView} {...(rest as any)}>\n {label && labelPlacement === 'outer' && target !== 'button-like' && <OuterLabel>{label}</OuterLabel>}\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiselect: props.multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n valueToItemMap,\n }}\n >\n <StyledPopover\n ref={targetRef}\n opened={isCurrentListOpen}\n placement={getPlacements(placement)}\n usePortal={Boolean(portal)}\n frame={portal}\n onToggle={handleToggle}\n trigger=\"click\"\n target={\n <Target\n opened={isCurrentListOpen}\n value={value}\n valueToItemMap={valueToItemMap}\n focusedPath={focusedPath}\n focusedToValueMap={focusedToValueMap}\n onChipClick={handleChipClick}\n label={label}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n focusedChipIndex={focusedChipIndex}\n labelPlacement={labelPlacement}\n selectProps={props}\n size={size}\n contentLeft={contentLeft}\n disabled={disabled}\n renderValue={renderValue}\n />\n }\n preventOverflow={false}\n closeOnOverlayClick\n listWidth={listWidth}\n >\n {items && (\n <Root size={size} {...(rest as any)}>\n <Ul\n role=\"tree\"\n id=\"tree_level_1\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n onScroll={handleScroll}\n listWidth={listWidth}\n >\n {transformedItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </Root>\n )}\n </StyledPopover>\n </Context.Provider>\n {helperText && target === 'textfield-like' && <HelperText>{helperText}</HelperText>}\n </Root>\n );\n });\n\nexport const selectConfig = {\n name: 'Select',\n tag: 'div',\n layout: selectRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n chipView: 'default',\n size: 'm',\n },\n};\n"],"names":["Context","createContext","selectRoot","Root","forwardRef","props","ref","outerValue","value","outerOnChange","onChange","_props$target","target","items","_props$placement","placement","label","_props$labelPlacement","labelPlacement","placeholder","helperText","_props$disabled","disabled","view","size","listOverflow","listHeight","listWidth","contentLeft","onScrollBottom","chipView","_props$variant","variant","portal","renderValue","renderItem","status","onItemSelect","outerCloseAfterSelect","closeAfterSelect","rest","_objectWithoutProperties","_excluded","_useState","useState","multiselect","_useState2","_slicedToArray","internalValue","setInternalValue","e","transformedItems","useMemo","initialItemsTransform","_usePathMaps","usePathMaps","_usePathMaps2","pathMap","focusedToValueMap","valueToCheckedMap","valueToItemMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useReducer5","focusedChipIndexReducer","_useReducer6","focusedChipIndex","dispatchFocusedChipIndex","_useState3","_useState4","checked","setChecked","targetRef","useOutsideClick","type","handleToggle","opened","handleCheckboxChange","item","checkedCopy","Map","get","set","updateDescendants","updateAncestors","newValues","forEach","key","push","handleItemClick","isEmpty","stopPropagation","isCurrentChecked","_","updateSingleAncestors","handleChipClick","currentValue","handlePressDown","handleScroll","scrollHeight","scrollTop","clientHeight","_useKeyNavigation","useKeyNavigation","isTargetAmount","onKeyDown","isCurrentListOpen","Boolean","useLayoutEffect","Array","isArray","val","React","createElement","_extends","getView","OuterLabel","Provider","StyledPopover","getPlacements","usePortal","frame","onToggle","trigger","Target","onChipClick","selectProps","preventOverflow","closeOnOverlayClick","Ul","role","id","onScroll","map","index","Inner","concat","currentLevel","HelperText","selectConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAoE,EAAA;AAAA,EAAA,oBAC3FC,gBAAU,CAAuC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAC7D,IAAA,IACWC,UAAU,GA2BjBF,KAAK,CA3BLG,KAAK,CAAA;MACKC,aAAa,GA0BvBJ,KAAK,CA1BLK,QAAQ,CAAA;MAAAC,aAAA,GA0BRN,KAAK,CAzBLO,MAAM,CAAA;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,gBAAgB,GAAAA,aAAA,CAAA;MACzBE,KAAK,GAwBLR,KAAK,CAxBLQ,KAAK,CAAA;MAAAC,gBAAA,GAwBLT,KAAK,CAvBLU,SAAS,CAAA;AAATA,MAAAA,SAAS,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,gBAAA,CAAA;MACpBE,KAAK,GAsBLX,KAAK,CAtBLW,KAAK,CAAA;MAAAC,qBAAA,GAsBLZ,KAAK,CArBLa,cAAc,CAAA;AAAdA,MAAAA,cAAc,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,qBAAA,C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AAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAErJ,UAAU;AAClBsJ,EAAAA,IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACRlI,IAAAA,IAAI,EAAE;AACFmI,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDnI,IAAAA,IAAI,EAAE;AACFkI,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtI,IAAAA,IAAI,EAAE,SAAS;AACfO,IAAAA,QAAQ,EAAE,SAAS;AACnBN,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { isEmpty, getPlacements } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, getView } from './utils';\nimport { Inner, Target } from './ui';\nimport { pathReducer, focusedPathReducer, focusedChipIndexReducer } from './reducers';\nimport { usePathMaps } from './hooks/usePathMaps';\nimport { StyledPopover, Ul, base, OuterLabel, HelperText } from './Select.styles';\nimport type { ItemContext, MergedSelectProps } from './Select.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { MergedDropdownNodeTransformed } from './ui/Inner/ui/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список. Поддерживает выбор одного или нескольких значений.\n */\nexport const selectRoot = (Root: RootProps<HTMLButtonElement, Omit<MergedSelectProps, 'items'>>) =>\n forwardRef<HTMLButtonElement, MergedSelectProps>((props, ref) => {\n const {\n value: outerValue,\n onChange: outerOnChange,\n target = 'textfield-like',\n items,\n placement = 'bottom',\n label,\n labelPlacement = 'outer',\n placeholder,\n helperText,\n disabled = false,\n view,\n size,\n listOverflow,\n listHeight,\n listWidth,\n contentLeft,\n onScrollBottom,\n chipView,\n variant = 'normal',\n portal,\n renderValue,\n renderItem,\n status,\n onItemSelect,\n separator,\n closeAfterSelect: outerCloseAfterSelect,\n ...rest\n } = props;\n\n const [internalValue, setInternalValue] = useState<string | number | Array<string | number>>(\n outerValue || props.multiselect ? [] : '',\n );\n\n const value = outerValue || internalValue;\n\n const onChange = (e: string | number | Array<string | number>) => {\n if (outerOnChange) {\n outerOnChange(e as any);\n }\n\n setInternalValue(e);\n };\n\n const transformedItems = useMemo(() => initialItemsTransform(items || []), [items]);\n\n const [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] = usePathMaps(transformedItems);\n\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [focusedChipIndex, dispatchFocusedChipIndex] = useReducer(focusedChipIndexReducer, null);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const closeAfterSelect = outerCloseAfterSelect ?? !props.multiselect;\n\n const targetRef = useOutsideClick<HTMLDivElement>(() => {\n if (focusedChipIndex != null) {\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n });\n\n const handleToggle = (opened: boolean) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n };\n\n const handleCheckboxChange = (item: MergedDropdownNodeTransformed) => {\n if (props.multiselect) {\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value)) {\n checkedCopy.set(item.value, true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value, false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string | number> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value);\n }\n });\n\n if (closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(newValues);\n }\n }\n };\n\n const handleItemClick = (item: MergedDropdownNodeTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (!isEmpty(item?.items)) {\n return;\n }\n\n if (props.multiselect) {\n handleCheckboxChange(item);\n } else {\n if (e) {\n e.stopPropagation();\n }\n\n const checkedCopy = new Map(checked);\n\n const isCurrentChecked = checkedCopy.get(item.value);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isCurrentChecked) {\n checkedCopy.set(item.value, 'done');\n updateSingleAncestors(item, checkedCopy, 'dot');\n }\n\n if (closeAfterSelect) {\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n }\n\n if (onChange) {\n onChange(isCurrentChecked ? '' : item.value);\n }\n\n if (onItemSelect) {\n onItemSelect(item, e!);\n }\n }\n };\n\n const handleChipClick = (currentValue: string) => {\n handleCheckboxChange(valueToItemMap.get(currentValue)!);\n };\n\n const handlePressDown = (item: MergedDropdownNodeTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (props.multiselect) {\n handleCheckboxChange(item);\n }\n };\n\n const handleScroll = (e: React.UIEvent<HTMLUListElement>) => {\n if (!onScrollBottom) return;\n\n const { target } = e;\n\n if (\n (target as HTMLElement).scrollHeight - (target as HTMLElement).scrollTop ===\n (target as HTMLElement).clientHeight\n ) {\n onScrollBottom(e);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n value,\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleToggle,\n handlePressDown,\n focusedChipIndex,\n dispatchFocusedChipIndex,\n valueToItemMap,\n multiselect: props.multiselect,\n isTargetAmount: props.isTargetAmount,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n // В данном эффекте мы следим за изменениями value и вносим коррективы в дерево чекбоксов.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value) || typeof value === 'number') {\n if (Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value, 'done');\n updateSingleAncestors(valueToItemMap.get(value)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n }, [value]);\n\n return (\n <Root ref={ref} size={size} view={status ? getView(status) : view} chipView={chipView} {...(rest as any)}>\n {label && labelPlacement === 'outer' && target !== 'button-like' && <OuterLabel>{label}</OuterLabel>}\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiselect: props.multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n valueToItemMap,\n }}\n >\n <StyledPopover\n ref={targetRef}\n opened={isCurrentListOpen}\n placement={getPlacements(placement)}\n usePortal={Boolean(portal)}\n frame={portal}\n onToggle={handleToggle}\n trigger=\"click\"\n target={\n <Target\n opened={isCurrentListOpen}\n value={value}\n valueToItemMap={valueToItemMap}\n focusedPath={focusedPath}\n focusedToValueMap={focusedToValueMap}\n onChipClick={handleChipClick}\n label={label}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n focusedChipIndex={focusedChipIndex}\n labelPlacement={labelPlacement}\n selectProps={props}\n size={size}\n contentLeft={contentLeft}\n disabled={disabled}\n renderValue={renderValue}\n />\n }\n preventOverflow={false}\n closeOnOverlayClick\n listWidth={listWidth}\n >\n {items && (\n <Root size={size} {...(rest as any)}>\n <Ul\n role=\"tree\"\n id=\"tree_level_1\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n onScroll={handleScroll}\n listWidth={listWidth}\n >\n {transformedItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </Root>\n )}\n </StyledPopover>\n </Context.Provider>\n {helperText && target === 'textfield-like' && <HelperText>{helperText}</HelperText>}\n </Root>\n );\n });\n\nexport const selectConfig = {\n name: 'Select',\n tag: 'div',\n layout: selectRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n chipView: 'default',\n size: 'm',\n },\n};\n"],"names":["Context","createContext","selectRoot","Root","forwardRef","props","ref","outerValue","value","outerOnChange","onChange","_props$target","target","items","_props$placement","placement","label","_props$labelPlacement","labelPlacement","placeholder","helperText","_props$disabled","disabled","view","size","listOverflow","listHeight","listWidth","contentLeft","onScrollBottom","chipView","_props$variant","variant","portal","renderValue","renderItem","status","onItemSelect","outerCloseAfterSelect","closeAfterSelect","rest","_objectWithoutProperties","_excluded","_useState","useState","multiselect","_useState2","_slicedToArray","internalValue","setInternalValue","e","transformedItems","useMemo","initialItemsTransform","_usePathMaps","usePathMaps","_usePathMaps2","pathMap","focusedToValueMap","valueToCheckedMap","valueToItemMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useReducer5","focusedChipIndexReducer","_useReducer6","focusedChipIndex","dispatchFocusedChipIndex","_useState3","_useState4","checked","setChecked","targetRef","useOutsideClick","type","handleToggle","opened","handleCheckboxChange","item","checkedCopy","Map","get","set","updateDescendants","updateAncestors","newValues","forEach","key","push","handleItemClick","isEmpty","stopPropagation","isCurrentChecked","_","updateSingleAncestors","handleChipClick","currentValue","handlePressDown","handleScroll","scrollHeight","scrollTop","clientHeight","_useKeyNavigation","useKeyNavigation","isTargetAmount","onKeyDown","isCurrentListOpen","Boolean","useLayoutEffect","Array","isArray","val","React","createElement","_extends","getView","OuterLabel","Provider","StyledPopover","getPlacements","usePortal","frame","onToggle","trigger","Target","onChipClick","selectProps","preventOverflow","closeOnOverlayClick","Ul","role","id","onScroll","map","index","Inner","concat","currentLevel","HelperText","selectConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAiBaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAoE,EAAA;AAAA,EAAA,oBAC3FC,gBAAU,CAAuC,UAACC,KAAK,EAAEC,GAAG,EAAK;AAC7D,IAAA,IACWC,UAAU,GA2BjBF,KAAK,CA3BLG,KAAK,CAAA;MACKC,aAAa,GA0BvBJ,KAAK,CA1BLK,QAAQ,CAAA;MAAAC,aAAA,GA0BRN,KAAK,CAzBLO,MAAM,CAAA;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,gBAAgB,GAAAA,aAAA,CAAA;MACzBE,KAAK,GAwBLR,KAAK,CAxBLQ,KAAK,CAAA;MAAAC,gBAAA,GAwBLT,KAAK,CAvBLU,SAAS,CAAA;AAATA,MAAAA,SAAS,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,gBAAA,CAAA;MACpBE,KAAK,GAsBLX,KAAK,CAtBLW,KAAK,CAAA;MAAAC,qBAAA,GAsBLZ,KAAK,CArBLa,cAAc,CAAA;AAAdA,MAAAA,cAAc,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,qBAAA,CAAA;MACxBE,WAAW,GAoBXd,KAAK,CApBLc,WAAW,CAAA;MACXC,UAAU,GAmBVf,KAAK,CAnBLe,UAAU,CAAA;MAAAC,eAAA,GAmBVhB,KAAK,CAlBLiB,QAAQ,CAAA;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA,CAAA;MAChB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,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtI,IAAAA,IAAI,EAAE,SAAS;AACfO,IAAAA,QAAQ,EAAE,SAAS;AACnBN,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;;"}
@@ -4,13 +4,10 @@ import './Select.styles_1nzals0.css';
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var react = require('@linaria/react');
7
- require('@linaria/core');
7
+ var Select_tokens = require('./Select.tokens.js');
8
+ var getCorrectHeight = require('./utils/getCorrectHeight.js');
8
9
  var common = require('../../engines/common.js');
9
10
  var Popover$1 = require('../Popover/Popover.js');
10
- var getCorrectHeight = require('./utils/getCorrectHeight.js');
11
- require('react');
12
- require('../../utils/react.js');
13
- var Select_tokens = require('./Select.tokens.js');
14
11
 
15
12
  var Popover = /*#__PURE__*/common.component(Popover$1.popoverConfig);
16
13
  var _exp = function _exp() {
@@ -1 +1 @@
1
- {"version":3,"file":"Select.styles.js","sources":["../../../src/components/Select/Select.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { component } from '../../engines';\nimport { popoverClasses, popoverConfig } from '../Popover';\n\nimport { getCorrectHeight } from './utils';\nimport { SelectProps } from './Select.types';\nimport { tokens, constants } from './Select.tokens';\n\nconst Popover = component(popoverConfig);\n\nexport const StyledPopover = styled(Popover)<{ listWidth?: SelectProps['listWidth'] }>`\n .${String(popoverClasses.root)} {\n width: ${({ listWidth }) => listWidth || '100%'};\n }\n\n .${String(popoverClasses.target)} {\n width: 100%;\n }\n`;\n\nexport const Ul = styled.ul<{\n listOverflow?: SelectProps['listOverflow'];\n listHeight?: SelectProps['listHeight'];\n listWidth?: SelectProps['listWidth'];\n isInnerUl?: boolean;\n}>`\n box-sizing: border-box;\n\n background: var(${constants.background});\n box-shadow: ${constants.boxShadow};\n\n border-radius: var(${tokens.borderRadius});\n width: ${({ listWidth }) => listWidth || '100%'};\n height: ${({ listHeight }) => (listHeight ? getCorrectHeight(listHeight) : 'auto')};\n overflow: ${({ listOverflow }) => listOverflow || 'initial'};\n border: var(${tokens.popoverBorderWidth}) solid var(${tokens.popoverBorderColor});\n\n margin: ${({ isInnerUl }) => (isInnerUl ? `calc(var(${tokens.padding}) * -1) 0 0 var(${tokens.padding})` : 0)};\n padding: var(${tokens.padding});\n`;\n\nexport const base = css`\n .${popoverClasses.wrapper}, .${popoverClasses.target} {\n display: block;\n }\n`;\n\nexport const OuterLabel = styled.label`\n display: block;\n margin-bottom: var(${tokens.labelOffset});\n color: var(${constants.textfieldOuterLabelColor});\n\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n\nexport const HelperText = styled.div`\n margin-top: var(${tokens.helperTextOffset});\n color: var(${tokens.helperTextColor});\n font-family: var(${constants.fontFamily});\n font-size: var(${constants.fontSize});\n font-style: var(${constants.fontStyle});\n font-weight: var(${constants.fontWeight});\n letter-spacing: var(${constants.fontLetterSpacing});\n line-height: var(${constants.fontLineHeight});\n`;\n"],"names":["Popover","component","popoverConfig","_exp","_exp3","_ref","listWidth","StyledPopover","styled","name","class","propsAsIs","vars","_exp8","_ref2","_exp9","_ref3","listHeight","getCorrectHeight","_exp10","_ref4","listOverflow","_exp13","_ref5","isInnerUl","concat","tokens","padding","Ul","base","OuterLabel","HelperText"],"mappings":";;;;;;;;;;;;;AAUA,IAAMA,OAAO,gBAAGC,gBAAS,CAACC,uBAAa,CAAC,CAAA;AAAC,IAAAC,IAAA,GATvBA,SASuBA,IAAAA,GAAA;AAAA,EAAA,OAELH,OAAO,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAI,KAAA,GAXzBA,SAWyBA,KAAAA,GAAA;AAAA,EAAA,OAE1B,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,SAA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AA,KAAAA,CAAAA,SAAAA,CAAAA;AAAAA,IAAAA,OAAiBA,SAAS,GAAA,WAAA,CAAAC,MAAA,CAAeC,oBAAM,CAACC,OAAQ,EAAAF,kBAAAA,CAAAA,CAAAA,MAAA,CAAkBC,oBAAM,CAACC,OAAQ,SAAK,CAAE,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAjB1G,IAAMC,EAAE,gBAAGpB,YAAM,CAAA,IAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,IAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAYXC,KAAsC,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cACrCE,KAAwE,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cACtEI,MAA+C,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cAGjDG,MAAmG,EAAA,CAAA;AAAA,GAAA;AAAA,CAEhH,EAAA;AAEM,IAAMO,IAAI,GAIhB,UAAA;AAEM,IAAMC,UAAU,gBAAGtB,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAW/B,EAAA;AAEM,IAAMoB,UAAU,gBAAGvB,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAS/B;;;;;;;;"}
1
+ {"version":3,"file":"Select.styles.js","sources":["../../../src/components/Select/Select.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { component } from '../../engines';\nimport { popoverClasses, popoverConfig } from '../Popover';\n\nimport { getCorrectHeight } from './utils';\nimport { SelectProps } from './Select.types';\nimport { tokens, constants } from './Select.tokens';\n\nconst Popover = component(popoverConfig);\n\nexport const StyledPopover = styled(Popover)<{ listWidth?: SelectProps['listWidth'] }>`\n .${String(popoverClasses.root)} {\n width: ${({ listWidth }) => listWidth || '100%'};\n }\n\n .${String(popoverClasses.target)} {\n width: 100%;\n }\n`;\n\nexport const Ul = styled.ul<{\n listOverflow?: SelectProps['listOverflow'];\n listHeight?: SelectProps['listHeight'];\n listWidth?: SelectProps['listWidth'];\n isInnerUl?: boolean;\n}>`\n box-sizing: border-box;\n\n background: var(${constants.background});\n box-shadow: ${constants.boxShadow};\n\n border-radius: var(${tokens.borderRadius});\n width: ${({ listWidth }) => listWidth || '100%'};\n height: ${({ listHeight }) => (listHeight ? getCorrectHeight(listHeight) : 'auto')};\n overflow: ${({ listOverflow }) => listOverflow || 'initial'};\n border: var(${tokens.popoverBorderWidth}) solid var(${tokens.popoverBorderColor});\n\n margin: ${({ isInnerUl }) => (isInnerUl ? `calc(var(${tokens.padding}) * -1) 0 0 var(${tokens.padding})` : 0)};\n padding: var(${tokens.padding});\n`;\n\nexport const base = css`\n .${popoverClasses.wrapper}, .${popoverClasses.target} {\n display: block;\n }\n`;\n\nexport const OuterLabel = styled.label`\n display: block;\n margin-bottom: var(${tokens.labelOffset});\n color: var(${constants.textfieldOuterLabelColor});\n\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n\nexport const HelperText = styled.div`\n margin-top: var(${tokens.helperTextOffset});\n color: var(${tokens.helperTextColor});\n font-family: var(${constants.fontFamily});\n font-size: var(${constants.fontSize});\n font-style: var(${constants.fontStyle});\n font-weight: var(${constants.fontWeight});\n letter-spacing: var(${constants.fontLetterSpacing});\n line-height: var(${constants.fontLineHeight});\n`;\n"],"names":["Popover","component","popoverConfig","_exp","_exp3","_ref","listWidth","StyledPopover","styled","name","class","propsAsIs","vars","_exp8","_ref2","_exp9","_ref3","listHeight","getCorrectHeight","_exp10","_ref4","listOverflow","_exp13","_ref5","isInnerUl","concat","tokens","padding","Ul","base","OuterLabel","HelperText"],"mappings":";;;;;;;;;;AAUA,IAAMA,OAAO,gBAAGC,gBAAS,CAACC,uBAAa,CAAC,CAAA;AAAC,IAAAC,IAAA,GATvBA,SASuBA,IAAAA,GAAA;AAAA,EAAA,OAELH,OAAO,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAI,KAAA,GAXzBA,SAWyBA,KAAAA,GAAA;AAAA,EAAA,OAE1B,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,SAAAA,GAAAA,IAAAA,CAAAA,SAAAA,CAAAA;IAAAA,OAAgBA,SAAS,IAAI,MAAM,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAFhD,IAAMC,aAAa,gBAAGC,YAAM,CAAAL,IAAA,EAAA,CAAA,CAAA;AAAAM,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAElBR,KAAsC,EAAA,CAAA;AAAA,GAAA;AAAA,CAMtD,EAAA;AAAC,IAAAS,KAAA,GAnBgBA,SAmBhBA,KAAAA,GAAA;AAAA,EAAA,OAcW,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGR,SAAAA,GAAAA,KAAAA,CAAAA,SAAAA,CAAAA;IAAAA,OAAgBA,SAAS,IAAI,MAAM,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAS,KAAA,GAjCjCA,SAiCiCA,KAAAA,GAAA;AAAA,EAAA,OACrC,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGC,UAAAA,GAAAA,KAAAA,CAAAA,UAAAA,CAAAA;AAAAA,IAAAA,OAAk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AAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAW/B,EAAA;AAEM,IAAMoB,UAAU,gBAAGvB,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAS/B;;;;;;;;"}
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('react');
6
- require('../../../utils/react.js');
7
5
  var isEmpty = require('../../../utils/isEmpty.js');
8
6
 
9
7
  // Рекурсивно проходим по дереву items и создаем 4 мапы: открытых путей, фокусов, выбранных элементов и айтемов.
@@ -1 +1 @@
1
- {"version":3,"file":"usePathMaps.js","sources":["../../../../src/components/Select/hooks/usePathMaps.ts"],"sourcesContent":["import { isEmpty } from '../../../utils';\nimport { MergedSelectProps } from '../Select.types';\nimport { MergedDropdownNodeTransformed } from '../ui/Inner/ui/Item/Item.types';\n\nexport type PathMapType = Map<string | number, number>;\nexport type FocusedToValueMapType = Map<string, MergedDropdownNodeTransformed>;\nexport type ValueToCheckedMapType = Map<\n MergedDropdownNodeTransformed['value'],\n boolean | 'done' | 'dot' | 'indeterminate'\n>;\nexport type ValueToItemMapType = Map<MergedDropdownNodeTransformed['value'], MergedDropdownNodeTransformed>;\n\n// Рекурсивно проходим по дереву items и создаем 4 мапы: открытых путей, фокусов, выбранных элементов и айтемов.\nexport const usePathMaps = (items: MergedSelectProps['items']) => {\n const pathMap: PathMapType = new Map();\n const focusedToValueMap: FocusedToValueMapType = new Map();\n const valueToCheckedMap: ValueToCheckedMapType = new Map();\n const valueToItemMap: ValueToItemMapType = new Map();\n\n pathMap.set('root', items?.length || 0);\n\n const rec = (items: MergedSelectProps['items'], prevIndex = '') => {\n items?.forEach((item: MergedDropdownNodeTransformed, index: number) => {\n const { value, items: innerItems } = item;\n\n const currIndex = `${prevIndex}/${index}`.replace(/^(\\/)/, '');\n focusedToValueMap.set(currIndex, item);\n\n valueToCheckedMap.set(value, false);\n\n if (isEmpty(innerItems) || !innerItems) {\n valueToItemMap.set(value, item);\n } else {\n pathMap.set(value, innerItems.length);\n rec(innerItems, currIndex);\n }\n });\n };\n rec(items);\n\n return [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] as [\n PathMapType,\n FocusedToValueMapType,\n ValueToCheckedMapType,\n ValueToItemMapType,\n ];\n};\n"],"names":["usePathMaps","items","pathMap","Map","focusedToValueMap","valueToCheckedMap","valueToItemMap","set","length","rec","prevIndex","arguments","undefined","forEach","item","index","value","innerItems","currIndex","concat","replace","isEmpty"],"mappings":";;;;;;;;AAYA;IACaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAAiC,EAAK;AAC9D,EAAA,IAAMC,OAAoB,GAAG,IAAIC,GAAG,EAAE,CAAA;AACtC,EAAA,IAAMC,iBAAwC,GAAG,IAAID,GAAG,EAAE,CAAA;AAC1D,EAAA,IAAME,iBAAwC,GAAG,IAAIF,GAAG,EAAE,CAAA;AAC1D,EAAA,IAAMG,cAAkC,GAAG,IAAIH,GAAG,EAAE,CAAA;AAEpDD,EAAAA,OAAO,CAACK,GAAG,CAAC,MAAM,EAAE,CAAAN,KAAK,KAALA,IAAAA,IAAAA,KAAK,uBAALA,KAAK,CAAEO,MAAM,KAAI,CAAC,CAAC,CAAA;AAEvC,EAAA,IAAMC,GAAG,GAAG,SAANA,GAAGA,CAAIR,KAAiC,EAAqB;AAAA,IAAA,IAAnBS,SAAS,GAAAC,SAAA,CAAAH,MAAA,GAAA,CAAA,IAAAG,SAAA,CAAA,CAAA,CAAA,KAAAC,SAAA,GAAAD,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;IAC1DV,KAAK,KAAA,IAAA,IAALA,KAAK,KAAA,KAAA,CAAA,IAALA,KAAK,CAAEY,OAAO,CAAC,UAACC,IAAmC,EAAEC,KAAa,EAAK;AACnE,MAAA,IAAQC,KAAK,GAAwBF,IAAI,CAAjCE,KAAK;QAASC,UAAU,GAAKH,IAAI,CAA1Bb,KAAK,CAAA;AAEpB,MAAA,IAAMiB,SAAS,GAAG,EAAA,CAAAC,MAAA,CAAGT,SAAS,EAAAS,GAAAA,CAAAA,CAAAA,MAAA,CAAIJ,KAAK,EAAGK,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAC9DhB,MAAAA,iBAAiB,CAACG,GAAG,CAACW,SAAS,EAAEJ,IAAI,CAAC,CAAA;AAEtCT,MAAAA,iBAAiB,CAACE,GAAG,CAACS,KAAK,EAAE,KAAK,CAAC,CAAA;AAEnC,MAAA,IAAIK,eAAO,CAACJ,UAAU,CAAC,IAAI,CAACA,UAAU,EAAE;AACpCX,QAAAA,cAAc,CAACC,GAAG,CAACS,KAAK,EAAEF,IAAI,CAAC,CAAA;AACnC,OAAC,MAAM;QACHZ,OAAO,CAACK,GAAG,CAACS,KAAK,EAAEC,UAAU,CAACT,MAAM,CAAC,CAAA;AACrCC,QAAAA,GAAG,CAACQ,UAAU,EAAEC,SAAS,CAAC,CAAA;AAC9B,OAAA;AACJ,KAAC,CAAC,CAAA;GACL,CAAA;EACDT,GAAG,CAACR,KAAK,CAAC,CAAA;EAEV,OAAO,CAACC,OAAO,EAAEE,iBAAiB,EAAEC,iBAAiB,EAAEC,cAAc,CAAC,CAAA;AAM1E;;;;"}
1
+ {"version":3,"file":"usePathMaps.js","sources":["../../../../src/components/Select/hooks/usePathMaps.ts"],"sourcesContent":["import { isEmpty } from '../../../utils';\nimport { MergedSelectProps } from '../Select.types';\nimport { MergedDropdownNodeTransformed } from '../ui/Inner/ui/Item/Item.types';\n\nexport type PathMapType = Map<string | number, number>;\nexport type FocusedToValueMapType = Map<string, MergedDropdownNodeTransformed>;\nexport type ValueToCheckedMapType = Map<\n MergedDropdownNodeTransformed['value'],\n boolean | 'done' | 'dot' | 'indeterminate'\n>;\nexport type ValueToItemMapType = Map<MergedDropdownNodeTransformed['value'], MergedDropdownNodeTransformed>;\n\n// Рекурсивно проходим по дереву items и создаем 4 мапы: открытых путей, фокусов, выбранных элементов и айтемов.\nexport const usePathMaps = (items: MergedSelectProps['items']) => {\n const pathMap: PathMapType = new Map();\n const focusedToValueMap: FocusedToValueMapType = new Map();\n const valueToCheckedMap: ValueToCheckedMapType = new Map();\n const valueToItemMap: ValueToItemMapType = new Map();\n\n pathMap.set('root', items?.length || 0);\n\n const rec = (items: MergedSelectProps['items'], prevIndex = '') => {\n items?.forEach((item: MergedDropdownNodeTransformed, index: number) => {\n const { value, items: innerItems } = item;\n\n const currIndex = `${prevIndex}/${index}`.replace(/^(\\/)/, '');\n focusedToValueMap.set(currIndex, item);\n\n valueToCheckedMap.set(value, false);\n\n if (isEmpty(innerItems) || !innerItems) {\n valueToItemMap.set(value, item);\n } else {\n pathMap.set(value, innerItems.length);\n rec(innerItems, currIndex);\n }\n });\n };\n rec(items);\n\n return [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] as [\n PathMapType,\n FocusedToValueMapType,\n ValueToCheckedMapType,\n ValueToItemMapType,\n ];\n};\n"],"names":["usePathMaps","items","pathMap","Map","focusedToValueMap","valueToCheckedMap","valueToItemMap","set","length","rec","prevIndex","arguments","undefined","forEach","item","index","value","innerItems","currIndex","concat","replace","isEmpty"],"mappings":";;;;;;AAYA;IACaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAAiC,EAAK;AAC9D,EAAA,IAAMC,OAAoB,GAAG,IAAIC,GAAG,EAAE,CAAA;AACtC,EAAA,IAAMC,iBAAwC,GAAG,IAAID,GAAG,EAAE,CAAA;AAC1D,EAAA,IAAME,iBAAwC,GAAG,IAAIF,GAAG,EAAE,CAAA;AAC1D,EAAA,IAAMG,cAAkC,GAAG,IAAIH,GAAG,EAAE,CAAA;AAEpDD,EAAAA,OAAO,CAACK,GAAG,CAAC,MAAM,EAAE,CAAAN,KAAK,KAALA,IAAAA,IAAAA,KAAK,uBAALA,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B,EAAEC,cAAc,CAAC,CAAA;AAM1E;;;;"}
@@ -3,9 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- require('../../../../utils/react.js');
7
- var isEmpty = require('../../../../utils/isEmpty.js');
8
6
  var Select_styles = require('../../Select.styles.js');
7
+ var isEmpty = require('../../../../utils/isEmpty.js');
9
8
  var Item = require('./ui/Item/Item.js');
10
9
 
11
10
  var Inner = function Inner(_ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"Inner.js","sources":["../../../../../src/components/Select/ui/Inner/Inner.tsx"],"sourcesContent":["import React from 'react';\nimport type { FC } from 'react';\n\nimport { isEmpty } from '../../../../utils';\nimport { Ul, StyledPopover } from '../../Select.styles';\n\nimport type { MergedDropdownNodeTransformed } from './ui/Item/Item.types';\nimport { Item } from './ui';\nimport { InnerProps } from './Inner.type';\n\nexport const Inner: FC<InnerProps> = ({ item, currentLevel, path, dispatchPath, index, listWidth }) => {\n const handleToggle = (opened: boolean): void => {\n if (opened) {\n dispatchPath({ type: 'changed_on_level', value: item.value.toString(), level: currentLevel + 1 });\n } else {\n dispatchPath({ type: 'cut_by_level', level: currentLevel + 1 });\n }\n };\n\n const isCurrentListOpen = path[currentLevel + 1] === item.value.toString();\n\n const listId = `tree_level_${currentLevel + 2}`;\n const nextLevel = currentLevel + 1;\n\n if (!isEmpty(item?.items)) {\n return (\n <StyledPopover\n opened={isCurrentListOpen}\n usePortal={false}\n placement=\"right-start\"\n trigger=\"click\"\n target={\n <Item\n item={item}\n path={path}\n currentLevel={currentLevel}\n index={index}\n ariaControls={listId}\n ariaExpanded={isCurrentListOpen}\n ariaLevel={nextLevel}\n ariaLabel={item.label}\n />\n }\n onToggle={handleToggle}\n isFocusTrapped={false}\n preventOverflow={false}\n >\n <Ul role=\"group\" id={listId} isInnerUl listWidth={listWidth}>\n {item.items?.map((innerItem: MergedDropdownNodeTransformed, innerIndex: number) => (\n <Inner\n key={`${innerIndex}/${currentLevel}`}\n item={innerItem}\n currentLevel={nextLevel}\n path={path}\n dispatchPath={dispatchPath}\n index={innerIndex}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </StyledPopover>\n );\n }\n\n return <Item item={item} path={path} index={index} currentLevel={currentLevel} ariaLevel={nextLevel} />;\n};\n"],"names":["Inner","_ref","item","currentLevel","path","dispatchPath","index","listWidth","handleToggle","opened","type","value","toString","level","isCurrentListOpen","listId","concat","nextLevel","isEmpty","items","_item$items","React","createElement","StyledPopover","usePortal","placement","trigger","target","Item","ariaControls","ariaExpanded","ariaLevel","ariaLabel","label","onToggle","isFocusTrapped","preventOverflow","Ul","role","id","isInnerUl","map","innerItem","innerIndex","key"],"mappings":";;;;;;;;;;IAUaA,KAAqB,GAAG,SAAxBA,KAAqBA,CAAAC,IAAA,EAAqE;AAAA,EAAA,IAA/DC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAEC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IAAEC,KAAK,GAAAL,IAAA,CAALK,KAAK;IAAEC,SAAS,GAAAN,IAAA,CAATM,SAAS,CAAA;AAC5F,EAAA,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,MAAe,EAAW;AAC5C,IAAA,IAAIA,MAAM,EAAE;AACRJ,MAAAA,YAAY,CAAC;AAAEK,QAAAA,IAAI,EAAE,kBAAkB;AAAEC,QAAAA,KAAK,EAAET,IAAI,CAACS,KAAK,CAACC,QAAQ,EAAE;QAAEC,KAAK,EAAEV,YAAY,GAAG,CAAA;AAAE,OAAC,CAAC,CAAA;AACrG,KAAC,MAAM;AACHE,MAAAA,YAAY,CAAC;AAAEK,QAAAA,IAAI,EAAE,cAAc;QAAEG,KAAK,EAAEV,YAAY,GAAG,CAAA;AAAE,OAAC,CAAC,CAAA;AACnE,KAAA;GACH,CAAA;AAED,EAAA,IAAMW,i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MAAAA,SAAS,EAAEA,SAAAA;AAAU,KAAA,EAAA,CAAAa,WAAA,GACvDlB,IAAI,CAACiB,KAAK,MAAAC,IAAAA,IAAAA,WAAA,KAAVA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,WAAA,CAAYqB,GAAG,CAAC,UAACC,SAAwC,EAAEC,UAAkB,EAAA;AAAA,MAAA,oBAC1EtB,KAAA,CAAAC,aAAA,CAACtB,KAAK,EAAA;QACF4C,GAAG,EAAA,EAAA,CAAA5B,MAAA,CAAK2B,UAAU,OAAA3B,MAAA,CAAIb,YAAY,CAAG;AACrCD,QAAAA,IAAI,EAAEwC,SAAU;AAChBvC,QAAAA,YAAY,EAAEc,SAAU;AACxBb,QAAAA,IAAI,EAAEA,IAAK;AACXC,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,KAAK,EAAEqC,UAAW;AAClBpC,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;KACL,CACD,CACO,CAAC,CAAA;AAExB,GAAA;AAEA,EAAA,oBAAOc,KAAA,CAAAC,aAAA,CAACM,SAAI,EAAA;AAAC1B,IAAAA,IAAI,EAAEA,IAAK;AAACE,IAAAA,IAAI,EAAEA,IAAK;AAACE,IAAAA,KAAK,EAAEA,KAAM;AAACH,IAAAA,YAAY,EAAEA,YAAa;AAAC4B,IAAAA,SAAS,EAAEd,SAAAA;AAAU,GAAE,CAAC,CAAA;AAC3G;;;;"}
1
+ {"version":3,"file":"Inner.js","sources":["../../../../../src/components/Select/ui/Inner/Inner.tsx"],"sourcesContent":["import React from 'react';\nimport type { FC } from 'react';\n\nimport { isEmpty } from '../../../../utils';\nimport { Ul, StyledPopover } from '../../Select.styles';\n\nimport type { MergedDropdownNodeTransformed } from './ui/Item/Item.types';\nimport { Item } from './ui';\nimport { InnerProps } from './Inner.type';\n\nexport const Inner: FC<InnerProps> = ({ item, currentLevel, path, dispatchPath, index, listWidth }) => {\n const handleToggle = (opened: boolean): void => {\n if (opened) {\n dispatchPath({ type: 'changed_on_level', value: item.value.toString(), level: currentLevel + 1 });\n } else {\n dispatchPath({ type: 'cut_by_level', level: currentLevel + 1 });\n }\n };\n\n const isCurrentListOpen = path[currentLevel + 1] === item.value.toString();\n\n const listId = `tree_level_${currentLevel + 2}`;\n const nextLevel = currentLevel + 1;\n\n if (!isEmpty(item?.items)) {\n return (\n <StyledPopover\n opened={isCurrentListOpen}\n usePortal={false}\n placement=\"right-start\"\n trigger=\"click\"\n target={\n <Item\n item={item}\n path={path}\n currentLevel={currentLevel}\n index={index}\n ariaControls={listId}\n ariaExpanded={isCurrentListOpen}\n ariaLevel={nextLevel}\n ariaLabel={item.label}\n />\n }\n onToggle={handleToggle}\n isFocusTrapped={false}\n preventOverflow={false}\n >\n <Ul role=\"group\" id={listId} isInnerUl listWidth={listWidth}>\n {item.items?.map((innerItem: MergedDropdownNodeTransformed, innerIndex: number) => (\n <Inner\n key={`${innerIndex}/${currentLevel}`}\n item={innerItem}\n currentLevel={nextLevel}\n path={path}\n dispatchPath={dispatchPath}\n index={innerIndex}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </StyledPopover>\n );\n }\n\n return <Item item={item} path={path} index={index} currentLevel={currentLevel} ariaLevel={nextLevel} />;\n};\n"],"names":["Inner","_ref","item","currentLevel","path","dispatchPath","index","listWidth","handleToggle","opened","type","value","toString","level","isCurrentListOpen","listId","concat","nextLevel","isEmpty","items","_item$items","React","createElement","StyledPopover","usePortal","placement","trigger","target","Item","ariaControls","ariaExpanded","ariaLevel","ariaLabel","label","onToggle","isFocusTrapped","preventOverflow","Ul","role","id","isInnerUl","map","innerItem","innerIndex","key"],"mappings":";;;;;;;;;IAUaA,KAAqB,GAAG,SAAxBA,KAAqBA,CAAAC,IAAA,EAAqE;AAAA,EAAA,IAA/DC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,IAAI,GAAAH,IAAA,CAAJG,I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B,GAAA;AAEA,EAAA,oBAAOc,KAAA,CAAAC,aAAA,CAACM,SAAI,EAAA;AAAC1B,IAAAA,IAAI,EAAEA,IAAK;AAACE,IAAAA,IAAI,EAAEA,IAAK;AAACE,IAAAA,KAAK,EAAEA,KAAM;AAACH,IAAAA,YAAY,EAAEA,YAAa;AAAC4B,IAAAA,SAAS,EAAEd,SAAAA;AAAU,GAAE,CAAC,CAAA;AAC3G;;;;"}
@@ -3,15 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var sizeToIconSize = require('../../../../utils/sizeToIconSize.js');
7
- var index = require('../../../../../../utils/index.js');
8
6
  var Select_tokens = require('../../../../Select.tokens.js');
9
- require('@linaria/react');
10
- var IconDone = require('../../../../../_Icon/Icons/IconDone.js');
11
- var IconDisclosureRightCentered = require('../../../../../_Icon/Icons/IconDisclosureRightCentered.js');
7
+ var index = require('../../../../../../utils/index.js');
12
8
  var Select = require('../../../../Select.js');
13
9
  var Item_styles = require('./Item.styles.js');
10
+ var IconDone = require('../../../../../_Icon/Icons/IconDone.js');
11
+ var sizeToIconSize = require('../../../../utils/sizeToIconSize.js');
14
12
  var isEmpty = require('../../../../../../utils/isEmpty.js');
13
+ var IconDisclosureRightCentered = require('../../../../../_Icon/Icons/IconDisclosureRightCentered.js');
15
14
 
16
15
  var _StyledIndicator;
17
16
  var Item = function Item(_ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sources":["../../../../../../../src/components/Select/ui/Inner/ui/Item/Item.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC, useContext } from 'react';\n\nimport { sizeToIconSize } from '../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { IconDisclosureRightCentered, IconDone } from '../../../../../_Icon';\nimport { Context } from '../../../../Select';\n\nimport { ItemProps } from './Item.types';\nimport {\n StyledContentLeft,\n StyledContentRight,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n StyledCheckbox,\n IconWrapper,\n StyledIndicator,\n StyledCheckboxWrapper,\n} from './Item.styles';\n\nexport const Item: FC<ItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n}) => {\n const { value, label, disabled, isDisabled, color, contentLeft, contentRight } = item;\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n valueToItemMap,\n } = useContext(Context);\n\n const itemDisabled = Boolean(disabled || isDisabled);\n\n const isDisabledClassName = itemDisabled ? classes.dropdownItemIsDisabled : undefined;\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (itemDisabled) return;\n\n e.stopPropagation();\n\n handleCheckboxChange(item);\n };\n\n const handleClick = (e: React.MouseEvent<HTMLElement>) => {\n if (itemDisabled) {\n e.stopPropagation();\n return;\n }\n\n handleItemClick(item, e);\n };\n\n return (\n <Wrapper\n className={cx(isDisabledClassName, focusedClass, activeClass)}\n id={value.toString()}\n ref={ref}\n onClick={handleClick}\n variant={variant}\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n role=\"treeitem\"\n >\n <IconWrapper variant={variant}>\n {multiselect && (\n <StyledCheckboxWrapper onClick={(e) => e.stopPropagation()}>\n <StyledCheckbox\n checked={Boolean(checked.get(item.value))}\n indeterminate={checked.get(item.value) === 'indeterminate'}\n onChange={handleChange}\n className={classes.selectItemCheckbox}\n />\n </StyledCheckboxWrapper>\n )}\n\n {!multiselect && checked.get(item.value) === 'dot' && <StyledIndicator size=\"s\" view=\"default\" />}\n\n {!multiselect && checked.get(item.value) === 'done' && (\n <IconDone size={sizeToIconSize(size, variant)} color=\"inherit\" />\n )}\n </IconWrapper>\n\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n\n <StyledText color={color}>{(renderItem && renderItem(valueToItemMap.get(value)!)) || label}</StyledText>\n\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n\n {!isEmpty(item.items) && (\n <DisclosureIconWrapper>\n <IconDisclosureRightCentered size={sizeToIconSize(size, variant)} color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n );\n};\n"],"names":["Item","_ref","item","path","currentLevel","index","ariaControls","ariaExpanded","ariaLevel","ariaLabel","value","label","disabled","isDisabled","color","contentLeft","contentRight","ref","useRef","_useContext","useContext","Context","focusedPath","checked","multiselect","size","handleCheckboxChange","handleItemClick","variant","renderItem","valueToItemMap","itemDisabled","Boolean","isDisabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useEffect","current","scrollIntoView","behavior","block","inline","handleChange","e","stopPropagation","handleClick","React","createElement","Wrapper","className","cx","id","toString","onClick","role","IconWrapper","StyledCheckboxWrapper","StyledCheckbox","get","indeterminate","onChange","selectItemCheckbox","_StyledIndicator","StyledIndicator","view","IconDone","sizeToIconSize","StyledContentLeft","StyledText","StyledContentRight","isEmpty","items","DisclosureIconWrapper","IconDisclosureRightCentered"],"mappings":";;;;;;;;;;;;;;;;IAqBaA,IAAmB,GAAG,SAAtBA,IAAmBA,CAAAC,IAAA,EAS1B;AAAA,EAAA,IARFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,OAAK,GAAAJ,IAAA,CAALI,KAAK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I,EAAC,GAAG;AAAC6C,IAAAA,IAAI,EAAC,SAAA;GAAW,CAAC,IAEhG,CAAC9C,WAAW,IAAID,OAAO,CAACyC,GAAG,CAAC9D,IAAI,CAACQ,KAAK,CAAC,KAAK,MAAM,iBAC/C0C,KAAA,CAAAC,aAAA,CAACkB,iBAAQ,EAAA;AAAC9C,IAAAA,IAAI,EAAE+C,6BAAc,CAAC/C,IAAI,EAAEG,OAAO,CAAE;AAACd,IAAAA,KAAK,EAAC,SAAA;AAAS,GAAE,CAE3D,CAAC,EAEbC,WAAW,iBAAIqC,KAAA,CAAAC,aAAA,CAACoB,6BAAiB,EAAA,IAAA,EAAE1D,WAA+B,CAAC,eAEpEqC,KAAA,CAAAC,aAAA,CAACqB,sBAAU,EAAA;AAAC5D,IAAAA,KAAK,EAAEA,KAAAA;GAASe,EAAAA,UAAU,IAAIA,UAAU,CAACC,cAAc,CAACkC,GAAG,CAACtD,KAAK,CAAE,CAAC,IAAKC,KAAkB,CAAC,EAEvGK,YAAY,iBAAIoC,KAAA,CAAAC,aAAA,CAACsB,8BAAkB,QAAE3D,YAAiC,CAAC,EAEvE,CAAC4D,eAAO,CAAC1E,IAAI,CAAC2E,KAAK,CAAC,iBACjBzB,KAAA,CAAAC,aAAA,CAACyB,iCAAqB,EAAA,IAAA,eAClB1B,KAAA,CAAAC,aAAA,CAAC0B,uDAA2B,EAAA;AAACtD,IAAAA,IAAI,EAAE+C,6BAAc,CAAC/C,IAAI,EAAEG,OAAO,CAAE;AAACd,IAAAA,KAAK,EAAC,SAAA;GAAW,CAChE,CAEtB,CAAC,CAAA;AAElB;;;;"}
1
+ {"version":3,"file":"Item.js","sources":["../../../../../../../src/components/Select/ui/Inner/ui/Item/Item.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC, useContext } from 'react';\n\nimport { sizeToIconSize } from '../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { IconDisclosureRightCentered, IconDone } from '../../../../../_Icon';\nimport { Context } from '../../../../Select';\n\nimport { ItemProps } from './Item.types';\nimport {\n StyledContentLeft,\n StyledContentRight,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n StyledCheckbox,\n IconWrapper,\n StyledIndicator,\n StyledCheckboxWrapper,\n} from './Item.styles';\n\nexport const Item: FC<ItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n}) => {\n const { value, label, disabled, isDisabled, color, contentLeft, contentRight } = item;\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n valueToItemMap,\n } = useContext(Context);\n\n const itemDisabled = Boolean(disabled || isDisabled);\n\n const isDisabledClassName = itemDisabled ? classes.dropdownItemIsDisabled : undefined;\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (itemDisabled) return;\n\n e.stopPropagation();\n\n handleCheckboxChange(item);\n };\n\n const handleClick = (e: React.MouseEvent<HTMLElement>) => {\n if (itemDisabled) {\n e.stopPropagation();\n return;\n }\n\n handleItemClick(item, e);\n };\n\n return (\n <Wrapper\n className={cx(isDisabledClassName, focusedClass, activeClass)}\n id={value.toString()}\n ref={ref}\n onClick={handleClick}\n variant={variant}\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n role=\"treeitem\"\n >\n <IconWrapper variant={variant}>\n {multiselect && (\n <StyledCheckboxWrapper onClick={(e) => e.stopPropagation()}>\n <StyledCheckbox\n checked={Boolean(checked.get(item.value))}\n indeterminate={checked.get(item.value) === 'indeterminate'}\n onChange={handleChange}\n className={classes.selectItemCheckbox}\n />\n </StyledCheckboxWrapper>\n )}\n\n {!multiselect && checked.get(item.value) === 'dot' && <StyledIndicator size=\"s\" view=\"default\" />}\n\n {!multiselect && checked.get(item.value) === 'done' && (\n <IconDone size={sizeToIconSize(size, variant)} color=\"inherit\" />\n )}\n </IconWrapper>\n\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n\n <StyledText color={color}>{(renderItem && renderItem(valueToItemMap.get(value)!)) || label}</StyledText>\n\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n\n {!isEmpty(item.items) && (\n <DisclosureIconWrapper>\n <IconDisclosureRightCentered size={sizeToIconSize(size, variant)} color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n );\n};\n"],"names":["Item","_ref","item","path","currentLevel","index","ariaControls","ariaExpanded","ariaLevel","ariaLabel","value","label","disabled","isDisabled","color","contentLeft","contentRight","ref","useRef","_useContext","useContext","Context","focusedPath","checked","multiselect","size","handleCheckboxChange","handleItemClick","variant","renderItem","valueToItemMap","itemDisabled","Boolean","isDisabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useEffect","current","scrollIntoView","behavior","block","inline","handleChange","e","stopPropagation","handleClick","React","createElement","Wrapper","className","cx","id","toString","onClick","role","IconWrapper","StyledCheckboxWrapper","StyledCheckbox","get","indeterminate","onChange","selectItemCheckbox","_StyledIndicator","StyledIndicator","view","IconDone","sizeToIconSize","StyledContentLeft","StyledText","StyledContentRight","isEmpty","items","DisclosureIconWrapper","IconDisclosureRightCentered"],"mappings":";;;;;;;;;;;;;;;IAqBaA,IAAmB,GAAG,SAAtBA,IAAmBA,CAAAC,IAAA,EAS1B;AAAA,EAAA,IARFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,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AK,KAAK,KAAA0D,gBAAA,KAAAA,gBAAA,gBAAIhB,KAAA,CAAAC,aAAA,CAACgB,2BAAe,EAAA;AAAC5C,IAAAA,IAAI,EAAC,GAAG;AAAC6C,IAAAA,IAAI,EAAC,SAAA;GAAW,CAAC,IAEhG,CAAC9C,WAAW,IAAID,OAAO,CAACyC,GAAG,CAAC9D,IAAI,CAACQ,KAAK,CAAC,KAAK,MAAM,iBAC/C0C,KAAA,CAAAC,aAAA,CAACkB,iBAAQ,EAAA;AAAC9C,IAAAA,IAAI,EAAE+C,6BAAc,CAAC/C,IAAI,EAAEG,OAAO,CAAE;AAACd,IAAAA,KAAK,EAAC,SAAA;AAAS,GAAE,CAE3D,CAAC,EAEbC,WAAW,iBAAIqC,KAAA,CAAAC,aAAA,CAACoB,6BAAiB,EAAA,IAAA,EAAE1D,WAA+B,CAAC,eAEpEqC,KAAA,CAAAC,aAAA,CAACqB,sBAAU,EAAA;AAAC5D,IAAAA,KAAK,EAAEA,KAAAA;GAASe,EAAAA,UAAU,IAAIA,UAAU,CAACC,cAAc,CAACkC,GAAG,CAACtD,KAAK,CAAE,CAAC,IAAKC,KAAkB,CAAC,EAEvGK,YAAY,iBAAIoC,KAAA,CAAAC,aAAA,CAACsB,8BAAkB,QAAE3D,YAAiC,CAAC,EAEvE,CAAC4D,eAAO,CAAC1E,IAAI,CAAC2E,KAAK,CAAC,iBACjBzB,KAAA,CAAAC,aAAA,CAACyB,iCAAqB,EAAA,IAAA,eAClB1B,KAAA,CAAAC,aAAA,CAAC0B,uDAA2B,EAAA;AAACtD,IAAAA,IAAI,EAAE+C,6BAAc,CAAC/C,IAAI,EAAEG,OAAO,CAAE;AAACd,IAAAA,KAAK,EAAC,SAAA;GAAW,CAChE,CAEtB,CAAC,CAAA;AAElB;;;;"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var react = require('@linaria/react');
7
7
  var Select_tokens = require('../../../../Select.tokens.js');
8
- require('@linaria/core');
9
8
  var common = require('../../../../../../engines/common.js');
10
9
  var Checkbox$1 = require('../../../../../Checkbox/Checkbox.js');
11
10
  var Indicator$1 = require('../../../../../Indicator/Indicator.js');
@@ -1 +1 @@
1
- {"version":3,"file":"Item.styles.js","sources":["../../../../../../../src/components/Select/ui/Inner/ui/Item/Item.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens, constants } from '../../../../Select.tokens';\nimport { addFocus, applyEllipsis } from '../../../../../../mixins';\nimport { component, mergeConfig } from '../../../../../../engines';\nimport { checkboxConfig, checkboxTokens } from '../../../../../Checkbox';\nimport { indicatorConfig, indicatorTokens } from '../../../../../Indicator';\nimport type { SelectProps } from '../../../../Select.types';\n\nconst mergedCheckboxConfig = mergeConfig(checkboxConfig);\nconst Checkbox = component(mergedCheckboxConfig);\n\nexport const StyledCheckbox = styled(Checkbox)`\n ${checkboxTokens.triggerSize}: var(${tokens.checkboxTriggerSize});\n ${checkboxTokens.triggerBorderRadius}: var(${tokens.checkboxTriggerBorderRadius});\n ${checkboxTokens.fillColor}: var(${tokens.checkboxFillColor});\n ${checkboxTokens.iconColor}: var(${tokens.checkboxIconColor});\n ${checkboxTokens.triggerBorderColor}: var(${tokens.checkboxTriggerBorderColor});\n`;\n\nconst mergedIndicatorConfig = mergeConfig(indicatorConfig);\nconst Indicator = component(mergedIndicatorConfig);\n\nexport const StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.indicatorSize});\n ${indicatorTokens.color}: var(${tokens.checkboxFillColor});\n`;\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n`;\n\nexport const DisclosureIconWrapper = styled.div`\n line-height: 0;\n color: var(${constants.disclosureIconColor});\n\n &:hover {\n color: var(${constants.disclosureIconColorHover});\n }\n`;\n\nexport const IconWrapper = styled.div<{ variant: SelectProps['variant'] }>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`};\n height: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`};\n margin: var(${tokens.itemIconMargin});\n line-height: 0;\n color: var(${tokens.checkboxFillColor});\n\n & .${classes.selectItemCheckbox} {\n --plasma-checkbox-trigger-size: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.checkboxTriggerSizeTight : tokens.checkboxTriggerSize})`};\n --plasma-checkbox-trigger-border-radius: ${({ variant }) =>\n `var(${\n variant === 'tight' ? tokens.checkboxTriggerBorderRadiusTight : tokens.checkboxTriggerBorderRadius\n })`};\n }\n`;\n\nexport const StyledText = styled.div<{ color?: string }>`\n ${applyEllipsis()};\n flex: 1;\n color: ${({ color }) => color || 'inherit'};\n`;\n\nexport const Wrapper = styled.li<{ variant: SelectProps['variant'] }>`\n display: flex;\n align-items: center;\n min-height: var(${tokens.itemHeight});\n margin: 0;\n box-sizing: content-box;\n padding: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding})`};\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n background: var(${constants.itemBackground});\n color: var(--text-primary);\n border-radius: var(${tokens.itemBorderRadius});\n user-select: none;\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsActive} {\n background: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: ${constants.opacity};\n cursor: not-allowed;\n }\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${constants.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n customFocusRules: `\n &.${classes.dropdownItemIsFocused}:before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(${constants.focusColor});\n }\n `,\n })};\n`;\n\nexport const StyledCheckboxWrapper = styled.span``;\n"],"names":["mergedCheckboxConfig","mergeConfig","checkboxConfig","Checkbox","component","_exp","StyledCheckbox","styled","name","class","propsAsIs","mergedIndicatorConfig","indicatorConfig","Indicator","_exp12","StyledIndicator","StyledContentLeft","StyledContentRight","DisclosureIconWrapper","_exp20","_ref","variant","tokens","itemIconSizeTight","itemIconSize","_exp24","_ref2","checkboxTriggerSizeTight","checkboxTriggerSize","_exp25","_ref3","checkboxTriggerBorderRadiusTight","checkboxTriggerBorderRadius","IconWrapper","vars","_exp27","_ref4","color","StyledText","_exp29","_ref5","itemPaddingTight","itemPadding","Wrapper","StyledCheckboxWrapper"],"mappings":";;;;;;;;;;;AASA,IAAMA,oBAAoB,gBAAGC,kBAAW,CAACC,yBAAc,CAAC,CAAA;AACxD,IAAMC,QAAQ,gBAAGC,gBAAS,CAACJ,oBAAoB,CAAC,CAAA;AAAC,IAAAK,IAAA,GAT/BA,SAS+BA,IAAAA,GAAA;AAAA,EAAA,OAEZF,QAAQ,CAAA;AAAA,CAAA,CAAA;AAAtC,IAAMG,cAAc,gBAAGC,YAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,gBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CAMnC,EAAA;AAED,IAAMC,qBAAqB,gBAAGV,kBAAW,CAACW,2BAAe,CAAC,CAAA;AAC1D,IAAMC,SAAS,gBAAGT,gBAAS,CAACO,qBAAqB,CAAC,CAAA;AAAC,IAAAG,MAAA,GApBjCA,SAoBiCA,MAAAA,GAAA;AAAA,EAAA,OAEbD,SAAS,CAAA;AAAA,CAAA,CAAA;AAAxC,IAAME,eAAe,gBAAGR,YAAM,CAAAO,MA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AA,IAAA,WAAA,EAAA,cAGnBC,MAAiC,EAAA,CAAA;AAAA,GAAA;AAAA,CAC7C,EAAA;AAAC,IAAAI,MAAA,GArEgBA,SAqEhBA,MAAAA,GAAA;AAAA,EAAA,OAQa,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGnB,OAAAA,GAAAA,KAAAA,CAAAA,OAAAA,CAAAA;AAAAA,IAAAA,OAAAA,MAAAA,CAAAA,MAAAA,CAAqBA,OAAO,KAAK,OAAO,GAAGC,oBAAM,CAACmB,gBAAgB,GAAGnB,oBAAM,CAACoB,WAAY,EAAA,GAAA,CAAA,CAAA;GAAE,CAAA;AAAA,CAAA,CAAA;AANrG,IAAMC,OAAO,gBAAGpC,YAAM,CAAA,IAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,SAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAwB,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAMdK,MAA6F,EAAA,CAAA;AAAA,GAAA;AAAA,CA2C3G,EAAA;AAEM,IAAMK,qBAAqB,gBAAGrC,YAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,uBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAAO;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Item.styles.js","sources":["../../../../../../../src/components/Select/ui/Inner/ui/Item/Item.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens, constants } from '../../../../Select.tokens';\nimport { addFocus, applyEllipsis } from '../../../../../../mixins';\nimport { component, mergeConfig } from '../../../../../../engines';\nimport { checkboxConfig, checkboxTokens } from '../../../../../Checkbox';\nimport { indicatorConfig, indicatorTokens } from '../../../../../Indicator';\nimport type { SelectProps } from '../../../../Select.types';\n\nconst mergedCheckboxConfig = mergeConfig(checkboxConfig);\nconst Checkbox = component(mergedCheckboxConfig);\n\nexport const StyledCheckbox = styled(Checkbox)`\n ${checkboxTokens.triggerSize}: var(${tokens.checkboxTriggerSize});\n ${checkboxTokens.triggerBorderRadius}: var(${tokens.checkboxTriggerBorderRadius});\n ${checkboxTokens.fillColor}: var(${tokens.checkboxFillColor});\n ${checkboxTokens.iconColor}: var(${tokens.checkboxIconColor});\n ${checkboxTokens.triggerBorderColor}: var(${tokens.checkboxTriggerBorderColor});\n`;\n\nconst mergedIndicatorConfig = mergeConfig(indicatorConfig);\nconst Indicator = component(mergedIndicatorConfig);\n\nexport const StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.indicatorSize});\n ${indicatorTokens.color}: var(${tokens.checkboxFillColor});\n`;\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n`;\n\nexport const DisclosureIconWrapper = styled.div`\n line-height: 0;\n color: var(${constants.disclosureIconColor});\n\n &:hover {\n color: var(${constants.disclosureIconColorHover});\n }\n`;\n\nexport const IconWrapper = styled.div<{ variant: SelectProps['variant'] }>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`};\n height: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`};\n margin: var(${tokens.itemIconMargin});\n line-height: 0;\n color: var(${tokens.checkboxFillColor});\n\n & .${classes.selectItemCheckbox} {\n --plasma-checkbox-trigger-size: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.checkboxTriggerSizeTight : tokens.checkboxTriggerSize})`};\n --plasma-checkbox-trigger-border-radius: ${({ variant }) =>\n `var(${\n variant === 'tight' ? tokens.checkboxTriggerBorderRadiusTight : tokens.checkboxTriggerBorderRadius\n })`};\n }\n`;\n\nexport const StyledText = styled.div<{ color?: string }>`\n ${applyEllipsis()};\n flex: 1;\n color: ${({ color }) => color || 'inherit'};\n`;\n\nexport const Wrapper = styled.li<{ variant: SelectProps['variant'] }>`\n display: flex;\n align-items: center;\n min-height: var(${tokens.itemHeight});\n margin: 0;\n box-sizing: content-box;\n padding: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding})`};\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n background: var(${constants.itemBackground});\n color: var(--text-primary);\n border-radius: var(${tokens.itemBorderRadius});\n user-select: none;\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsActive} {\n background: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: ${constants.opacity};\n cursor: not-allowed;\n }\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${constants.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n customFocusRules: `\n &.${classes.dropdownItemIsFocused}:before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(${constants.focusColor});\n }\n `,\n })};\n`;\n\nexport const StyledCheckboxWrapper = styled.span``;\n"],"names":["mergedCheckboxConfig","mergeConfig","checkboxConfig","Checkbox","component","_exp","StyledCheckbox","styled","name","class","propsAsIs","mergedIndicatorConfig","indicatorConfig","Indicator","_exp12","StyledIndicator","StyledContentLeft","StyledContentRight","DisclosureIconWrapper","_exp20","_ref","variant","tokens","itemIconSizeTight","itemIconSize","_exp24","_ref2","checkboxTriggerSizeTight","checkboxTriggerSize","_exp25","_ref3","checkboxTriggerBorderRadiusTight","checkboxTriggerBorderRadius","IconWrapper","vars","_exp27","_ref4","color","StyledText","_exp29","_ref5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,EAAA,SAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAwB,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAMdK,MAA6F,EAAA,CAAA;AAAA,GAAA;AAAA,CA2C3G,EAAA;AAEM,IAAMK,qBAAqB,gBAAGrC,YAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,uBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAAO;;;;;;;;;;;;"}
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var index = require('../../../../../../utils/index.js');
7
7
  var Select_tokens = require('../../../../Select.tokens.js');
8
+ var Button_styles = require('./Button.styles.js');
8
9
  var sizeToIconSize = require('../../../../utils/sizeToIconSize.js');
9
10
  var getButtonLabel = require('../../../../utils/getButtonLabel.js');
10
- var Button_styles = require('./Button.styles.js');
11
11
 
12
12
  var Button = function Button(_ref) {
13
13
  var opened = _ref.opened,