@foxford/ui 2.76.1-beta-3d975b5-20250715 → 2.77.0-beta-90a741d-20250807

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. package/LICENSE +27 -0
  2. package/components/Accordion/Accordion.js +1 -1
  3. package/components/Accordion/Accordion.js.map +1 -1
  4. package/components/Accordion/Accordion.mjs +1 -1
  5. package/components/Accordion/Accordion.mjs.map +1 -1
  6. package/components/Accordion/hooks.js +1 -1
  7. package/components/Accordion/hooks.js.map +1 -1
  8. package/components/Accordion/hooks.mjs +1 -1
  9. package/components/Accordion/hooks.mjs.map +1 -1
  10. package/components/AccordionItem/AccordionItem.js +1 -1
  11. package/components/AccordionItem/AccordionItem.js.map +1 -1
  12. package/components/AccordionItem/AccordionItem.mjs +1 -1
  13. package/components/AccordionItem/AccordionItem.mjs.map +1 -1
  14. package/components/ActionBtn/ActionBtn.js +1 -1
  15. package/components/ActionBtn/ActionBtn.js.map +1 -1
  16. package/components/ActionBtn/ActionBtn.mjs +1 -1
  17. package/components/ActionBtn/ActionBtn.mjs.map +1 -1
  18. package/components/ActionBtn/style.js.map +1 -1
  19. package/components/ActionBtn/style.mjs.map +1 -1
  20. package/components/Alert/Alert.js +1 -1
  21. package/components/Alert/Alert.js.map +1 -1
  22. package/components/Alert/Alert.mjs +1 -1
  23. package/components/Alert/Alert.mjs.map +1 -1
  24. package/components/Amount/Amount.js +1 -1
  25. package/components/Amount/Amount.js.map +1 -1
  26. package/components/Amount/Amount.mjs +1 -1
  27. package/components/Amount/Amount.mjs.map +1 -1
  28. package/components/Amount/data/index.js.map +1 -1
  29. package/components/Amount/data/index.mjs.map +1 -1
  30. package/components/Amount/style.js.map +1 -1
  31. package/components/Amount/style.mjs.map +1 -1
  32. package/components/Anchor/Anchor.js +1 -1
  33. package/components/Anchor/Anchor.js.map +1 -1
  34. package/components/Anchor/Anchor.mjs +1 -1
  35. package/components/Anchor/Anchor.mjs.map +1 -1
  36. package/components/Arrow/Arrow.js.map +1 -1
  37. package/components/Arrow/Arrow.mjs.map +1 -1
  38. package/components/ArrowBadge/ArrowBadge.js.map +1 -1
  39. package/components/ArrowBadge/ArrowBadge.mjs.map +1 -1
  40. package/components/AspectRatio/style.js.map +1 -1
  41. package/components/AspectRatio/style.mjs.map +1 -1
  42. package/components/Avatar/Avatar.js +1 -1
  43. package/components/Avatar/Avatar.js.map +1 -1
  44. package/components/Avatar/Avatar.mjs +1 -1
  45. package/components/Avatar/Avatar.mjs.map +1 -1
  46. package/components/Avatar/utils.js.map +1 -1
  47. package/components/Avatar/utils.mjs.map +1 -1
  48. package/components/Badge/Badge.js +1 -1
  49. package/components/Badge/Badge.js.map +1 -1
  50. package/components/Badge/Badge.mjs +1 -1
  51. package/components/Badge/Badge.mjs.map +1 -1
  52. package/components/Button/Button.js +1 -1
  53. package/components/Button/Button.js.map +1 -1
  54. package/components/Button/Button.mjs +1 -1
  55. package/components/Button/Button.mjs.map +1 -1
  56. package/components/Button/hooks.js.map +1 -1
  57. package/components/Button/hooks.mjs.map +1 -1
  58. package/components/Button/style.js.map +1 -1
  59. package/components/Button/style.mjs.map +1 -1
  60. package/components/Checkbox/Checkbox.js +1 -1
  61. package/components/Checkbox/Checkbox.js.map +1 -1
  62. package/components/Checkbox/Checkbox.mjs +1 -1
  63. package/components/Checkbox/Checkbox.mjs.map +1 -1
  64. package/components/Chip/Chip.js +1 -1
  65. package/components/Chip/Chip.js.map +1 -1
  66. package/components/Chip/Chip.mjs +1 -1
  67. package/components/Chip/Chip.mjs.map +1 -1
  68. package/components/Container/Container.js.map +1 -1
  69. package/components/Container/Container.mjs.map +1 -1
  70. package/components/Container/style.js.map +1 -1
  71. package/components/Container/style.mjs.map +1 -1
  72. package/components/ContextMenu/ContextMenu.js +1 -1
  73. package/components/ContextMenu/ContextMenu.js.map +1 -1
  74. package/components/ContextMenu/ContextMenu.mjs +1 -1
  75. package/components/ContextMenu/ContextMenu.mjs.map +1 -1
  76. package/components/ContextMenu/Item.js.map +1 -1
  77. package/components/ContextMenu/Item.mjs.map +1 -1
  78. package/components/ContextMenu/style.js.map +1 -1
  79. package/components/ContextMenu/style.mjs.map +1 -1
  80. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js +1 -1
  81. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js.map +1 -1
  82. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs +1 -1
  83. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs.map +1 -1
  84. package/components/ContextMenu.Multilevel/Controls.js.map +1 -1
  85. package/components/ContextMenu.Multilevel/Controls.mjs.map +1 -1
  86. package/components/Dialog/Dialog.js.map +1 -1
  87. package/components/Dialog/Dialog.mjs.map +1 -1
  88. package/components/DialogComponent/DialogComponent.js +1 -1
  89. package/components/DialogComponent/DialogComponent.js.map +1 -1
  90. package/components/DialogComponent/DialogComponent.mjs +1 -1
  91. package/components/DialogComponent/DialogComponent.mjs.map +1 -1
  92. package/components/DialogComponent/style.js.map +1 -1
  93. package/components/DialogComponent/style.mjs.map +1 -1
  94. package/components/Divider/style.js.map +1 -1
  95. package/components/Divider/style.mjs.map +1 -1
  96. package/components/Dropdown/Dropdown.js +1 -1
  97. package/components/Dropdown/Dropdown.js.map +1 -1
  98. package/components/Dropdown/Dropdown.mjs +1 -1
  99. package/components/Dropdown/Dropdown.mjs.map +1 -1
  100. package/components/Dropdown/DropdownMenuNoOptions.js +1 -1
  101. package/components/Dropdown/DropdownMenuNoOptions.js.map +1 -1
  102. package/components/Dropdown/DropdownMenuNoOptions.mjs +1 -1
  103. package/components/Dropdown/DropdownMenuNoOptions.mjs.map +1 -1
  104. package/components/Dropdown/hooks.js.map +1 -1
  105. package/components/Dropdown/hooks.mjs.map +1 -1
  106. package/components/FormInput/FormInput.js.map +1 -1
  107. package/components/FormInput/FormInput.mjs.map +1 -1
  108. package/components/FormInputLabel/FormInputLabel.js +1 -1
  109. package/components/FormInputLabel/FormInputLabel.js.map +1 -1
  110. package/components/FormInputLabel/FormInputLabel.mjs +1 -1
  111. package/components/FormInputLabel/FormInputLabel.mjs.map +1 -1
  112. package/components/FormLabel/FormLabel.js +1 -1
  113. package/components/FormLabel/FormLabel.js.map +1 -1
  114. package/components/FormLabel/FormLabel.mjs +1 -1
  115. package/components/FormLabel/FormLabel.mjs.map +1 -1
  116. package/components/Icon/Icon.js +1 -1
  117. package/components/Icon/Icon.js.map +1 -1
  118. package/components/Icon/Icon.mjs +1 -1
  119. package/components/Icon/Icon.mjs.map +1 -1
  120. package/components/Icon/bg-worker.js.map +1 -1
  121. package/components/Icon/bg-worker.mjs.map +1 -1
  122. package/components/Icon/list/default.js.map +1 -1
  123. package/components/Icon/list/default.mjs.map +1 -1
  124. package/components/Icon/list/icon-pack.js.map +1 -1
  125. package/components/Icon/list/icon-pack.mjs.map +1 -1
  126. package/components/IconButton/IconButton.js.map +1 -1
  127. package/components/IconButton/IconButton.mjs.map +1 -1
  128. package/components/Indicator/Indicator.js +1 -1
  129. package/components/Indicator/Indicator.js.map +1 -1
  130. package/components/Indicator/Indicator.mjs +1 -1
  131. package/components/Indicator/Indicator.mjs.map +1 -1
  132. package/components/Input/Input.js.map +1 -1
  133. package/components/Input/Input.mjs.map +1 -1
  134. package/components/Input/helpers.js.map +1 -1
  135. package/components/Input/helpers.mjs.map +1 -1
  136. package/components/Input.Phone/Input.Phone.js.map +1 -1
  137. package/components/Input.Phone/Input.Phone.mjs.map +1 -1
  138. package/components/InputCheckbox/InputCheckbox.js.map +1 -1
  139. package/components/InputCheckbox/InputCheckbox.mjs.map +1 -1
  140. package/components/InputRadio/InputRadio.js.map +1 -1
  141. package/components/InputRadio/InputRadio.mjs.map +1 -1
  142. package/components/ListItem/ListItem.js +1 -1
  143. package/components/ListItem/ListItem.js.map +1 -1
  144. package/components/ListItem/ListItem.mjs +1 -1
  145. package/components/ListItem/ListItem.mjs.map +1 -1
  146. package/components/Menu/Menu.js.map +1 -1
  147. package/components/Menu/Menu.mjs.map +1 -1
  148. package/components/MenuComponent/MenuComponent.js.map +1 -1
  149. package/components/MenuComponent/MenuComponent.mjs.map +1 -1
  150. package/components/MenuComponent/style.js +1 -1
  151. package/components/MenuComponent/style.js.map +1 -1
  152. package/components/MenuComponent/style.mjs +1 -1
  153. package/components/MenuComponent/style.mjs.map +1 -1
  154. package/components/MenuContainer/MenuContainer.js +1 -1
  155. package/components/MenuContainer/MenuContainer.js.map +1 -1
  156. package/components/MenuContainer/MenuContainer.mjs +1 -1
  157. package/components/MenuContainer/MenuContainer.mjs.map +1 -1
  158. package/components/MenuDivider/MenuDivider.js +1 -1
  159. package/components/MenuDivider/MenuDivider.js.map +1 -1
  160. package/components/MenuDivider/MenuDivider.mjs +1 -1
  161. package/components/MenuDivider/MenuDivider.mjs.map +1 -1
  162. package/components/MenuList/MenuList.js.map +1 -1
  163. package/components/MenuList/MenuList.mjs.map +1 -1
  164. package/components/Modal/Modal.js.map +1 -1
  165. package/components/Modal/Modal.mjs.map +1 -1
  166. package/components/Modal/adapter.js.map +1 -1
  167. package/components/Modal/adapter.mjs.map +1 -1
  168. package/components/Modal/style.js +1 -1
  169. package/components/Modal/style.js.map +1 -1
  170. package/components/Modal/style.mjs +1 -1
  171. package/components/Modal/style.mjs.map +1 -1
  172. package/components/Notification/Notification.js +1 -1
  173. package/components/Notification/Notification.js.map +1 -1
  174. package/components/Notification/Notification.mjs +1 -1
  175. package/components/Notification/Notification.mjs.map +1 -1
  176. package/components/Paper/Paper.js.map +1 -1
  177. package/components/Paper/Paper.mjs.map +1 -1
  178. package/components/Paper/style.js.map +1 -1
  179. package/components/Paper/style.mjs.map +1 -1
  180. package/components/Popover/Popover.js.map +1 -1
  181. package/components/Popover/Popover.mjs.map +1 -1
  182. package/components/PopoverComponent/PopoverComponent.js +1 -1
  183. package/components/PopoverComponent/PopoverComponent.js.map +1 -1
  184. package/components/PopoverComponent/PopoverComponent.mjs +1 -1
  185. package/components/PopoverComponent/PopoverComponent.mjs.map +1 -1
  186. package/components/Progress/Progress.js.map +1 -1
  187. package/components/Progress/Progress.mjs.map +1 -1
  188. package/components/Progress/style.js +1 -1
  189. package/components/Progress/style.js.map +1 -1
  190. package/components/Progress/style.mjs +1 -1
  191. package/components/Progress/style.mjs.map +1 -1
  192. package/components/Progress.Circle/Progress.Circle.js +1 -1
  193. package/components/Progress.Circle/Progress.Circle.js.map +1 -1
  194. package/components/Progress.Circle/Progress.Circle.mjs +1 -1
  195. package/components/Progress.Circle/Progress.Circle.mjs.map +1 -1
  196. package/components/Progress.Circle/style.js +1 -1
  197. package/components/Progress.Circle/style.js.map +1 -1
  198. package/components/Progress.Circle/style.mjs +1 -1
  199. package/components/Progress.Circle/style.mjs.map +1 -1
  200. package/components/Progress.Segmented/Progress.Segmented.js.map +1 -1
  201. package/components/Progress.Segmented/Progress.Segmented.mjs.map +1 -1
  202. package/components/Progress.Segmented/style.js.map +1 -1
  203. package/components/Progress.Segmented/style.mjs.map +1 -1
  204. package/components/ProgressCircle/ProgressCircle.js +1 -1
  205. package/components/ProgressCircle/ProgressCircle.js.map +1 -1
  206. package/components/ProgressCircle/ProgressCircle.mjs +1 -1
  207. package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
  208. package/components/ProgressCircle/style.js +1 -1
  209. package/components/ProgressCircle/style.js.map +1 -1
  210. package/components/ProgressCircle/style.mjs +1 -1
  211. package/components/ProgressCircle/style.mjs.map +1 -1
  212. package/components/ProgressLine/ProgressLine.js +1 -1
  213. package/components/ProgressLine/ProgressLine.js.map +1 -1
  214. package/components/ProgressLine/ProgressLine.mjs +1 -1
  215. package/components/ProgressLine/ProgressLine.mjs.map +1 -1
  216. package/components/Radio/Group.js.map +1 -1
  217. package/components/Radio/Group.mjs.map +1 -1
  218. package/components/Radio/Radio.js +1 -1
  219. package/components/Radio/Radio.js.map +1 -1
  220. package/components/Radio/Radio.mjs +1 -1
  221. package/components/Radio/Radio.mjs.map +1 -1
  222. package/components/Radio/style.js.map +1 -1
  223. package/components/Radio/style.mjs.map +1 -1
  224. package/components/Scrollable/Scrollable.js +1 -1
  225. package/components/Scrollable/Scrollable.js.map +1 -1
  226. package/components/Scrollable/Scrollable.mjs +1 -1
  227. package/components/Scrollable/Scrollable.mjs.map +1 -1
  228. package/components/Section/Section.js.map +1 -1
  229. package/components/Section/Section.mjs.map +1 -1
  230. package/components/Section/style.js +1 -1
  231. package/components/Section/style.js.map +1 -1
  232. package/components/Section/style.mjs +1 -1
  233. package/components/Section/style.mjs.map +1 -1
  234. package/components/Select/Select.js.map +1 -1
  235. package/components/Select/Select.mjs.map +1 -1
  236. package/components/Select/style.js +1 -1
  237. package/components/Select/style.js.map +1 -1
  238. package/components/Select/style.mjs +1 -1
  239. package/components/Select/style.mjs.map +1 -1
  240. package/components/Separator/Separator.js.map +1 -1
  241. package/components/Separator/Separator.mjs.map +1 -1
  242. package/components/Separator/SeparatorText.js.map +1 -1
  243. package/components/Separator/SeparatorText.mjs.map +1 -1
  244. package/components/Separator/style.js +1 -1
  245. package/components/Separator/style.js.map +1 -1
  246. package/components/Separator/style.mjs +1 -1
  247. package/components/Separator/style.mjs.map +1 -1
  248. package/components/Spacer/Spacer.js.map +1 -1
  249. package/components/Spacer/Spacer.mjs.map +1 -1
  250. package/components/Spacer/style.js.map +1 -1
  251. package/components/Spacer/style.mjs.map +1 -1
  252. package/components/Spinner/Spinner.js.map +1 -1
  253. package/components/Spinner/Spinner.mjs.map +1 -1
  254. package/components/Spinner/style.js +1 -1
  255. package/components/Spinner/style.js.map +1 -1
  256. package/components/Spinner/style.mjs +1 -1
  257. package/components/Spinner/style.mjs.map +1 -1
  258. package/components/Switch/Switch.js.map +1 -1
  259. package/components/Switch/Switch.mjs.map +1 -1
  260. package/components/Switcher/style.js.map +1 -1
  261. package/components/Switcher/style.mjs.map +1 -1
  262. package/components/Tab/Tab.js +1 -1
  263. package/components/Tab/Tab.js.map +1 -1
  264. package/components/Tab/Tab.mjs +1 -1
  265. package/components/Tab/Tab.mjs.map +1 -1
  266. package/components/TabList/TabList.js +1 -1
  267. package/components/TabList/TabList.js.map +1 -1
  268. package/components/TabList/TabList.mjs +1 -1
  269. package/components/TabList/TabList.mjs.map +1 -1
  270. package/components/TabList/TabListMenuTab.js +1 -1
  271. package/components/TabList/TabListMenuTab.js.map +1 -1
  272. package/components/TabList/TabListMenuTab.mjs +1 -1
  273. package/components/TabList/TabListMenuTab.mjs.map +1 -1
  274. package/components/TabList/TabListPanel.js.map +1 -1
  275. package/components/TabList/TabListPanel.mjs.map +1 -1
  276. package/components/TabList/hooks.js +1 -1
  277. package/components/TabList/hooks.js.map +1 -1
  278. package/components/TabList/hooks.mjs +1 -1
  279. package/components/TabList/hooks.mjs.map +1 -1
  280. package/components/TabList/style.js +1 -1
  281. package/components/TabList/style.js.map +1 -1
  282. package/components/TabList/style.mjs +1 -1
  283. package/components/TabList/style.mjs.map +1 -1
  284. package/components/TabListTab/TabListTab.js.map +1 -1
  285. package/components/TabListTab/TabListTab.mjs.map +1 -1
  286. package/components/TabListTab/style.js +1 -1
  287. package/components/TabListTab/style.js.map +1 -1
  288. package/components/TabListTab/style.mjs +1 -1
  289. package/components/TabListTab/style.mjs.map +1 -1
  290. package/components/Tabs/Tabs.js.map +1 -1
  291. package/components/Tabs/Tabs.mjs.map +1 -1
  292. package/components/Tabs/style.js +1 -1
  293. package/components/Tabs/style.js.map +1 -1
  294. package/components/Tabs/style.mjs +1 -1
  295. package/components/Tabs/style.mjs.map +1 -1
  296. package/components/Tag/Tag.js +1 -1
  297. package/components/Tag/Tag.js.map +1 -1
  298. package/components/Tag/Tag.mjs +1 -1
  299. package/components/Tag/Tag.mjs.map +1 -1
  300. package/components/Tag/style.js +1 -1
  301. package/components/Tag/style.js.map +1 -1
  302. package/components/Tag/style.mjs +1 -1
  303. package/components/Tag/style.mjs.map +1 -1
  304. package/components/Text/Ellipsis.js +1 -1
  305. package/components/Text/Ellipsis.js.map +1 -1
  306. package/components/Text/Ellipsis.mjs +1 -1
  307. package/components/Text/Ellipsis.mjs.map +1 -1
  308. package/components/Text/Text.js.map +1 -1
  309. package/components/Text/Text.mjs.map +1 -1
  310. package/components/Text/style.js.map +1 -1
  311. package/components/Text/style.mjs.map +1 -1
  312. package/components/Text.Ellipse/Text.Ellipse.js +1 -1
  313. package/components/Text.Ellipse/Text.Ellipse.js.map +1 -1
  314. package/components/Text.Ellipse/Text.Ellipse.mjs +1 -1
  315. package/components/Text.Ellipse/Text.Ellipse.mjs.map +1 -1
  316. package/components/Textarea/Textarea.js +1 -1
  317. package/components/Textarea/Textarea.js.map +1 -1
  318. package/components/Textarea/Textarea.mjs +1 -1
  319. package/components/Textarea/Textarea.mjs.map +1 -1
  320. package/components/Tooltip/Tooltip.js.map +1 -1
  321. package/components/Tooltip/Tooltip.mjs.map +1 -1
  322. package/components/Tooltip/TooltipWrapper.js.map +1 -1
  323. package/components/Tooltip/TooltipWrapper.mjs.map +1 -1
  324. package/components/TooltipComponent/TooltipComponent.js +1 -1
  325. package/components/TooltipComponent/TooltipComponent.js.map +1 -1
  326. package/components/TooltipComponent/TooltipComponent.mjs +1 -1
  327. package/components/TooltipComponent/TooltipComponent.mjs.map +1 -1
  328. package/dts/index.d.ts +2630 -2557
  329. package/hocs/withMergedProps.js.map +1 -1
  330. package/hocs/withMergedProps.mjs.map +1 -1
  331. package/hocs/withTranslation.js +1 -1
  332. package/hocs/withTranslation.js.map +1 -1
  333. package/hocs/withTranslation.mjs +1 -1
  334. package/hocs/withTranslation.mjs.map +1 -1
  335. package/hooks/use-config-priority.js.map +1 -1
  336. package/hooks/use-config-priority.mjs +1 -1
  337. package/hooks/use-config-priority.mjs.map +1 -1
  338. package/hooks/useClickOutside.js.map +1 -1
  339. package/hooks/useClickOutside.mjs.map +1 -1
  340. package/hooks/useMergedPalette.js +1 -1
  341. package/hooks/useMergedPalette.js.map +1 -1
  342. package/hooks/useMergedPalette.mjs +1 -1
  343. package/hooks/useMergedPalette.mjs.map +1 -1
  344. package/hooks/useMergedProps.js.map +1 -1
  345. package/hooks/useMergedProps.mjs.map +1 -1
  346. package/hooks/useMergedSizes.js.map +1 -1
  347. package/hooks/useMergedSizes.mjs.map +1 -1
  348. package/hooks/useResizeObserver.js.map +1 -1
  349. package/hooks/useResizeObserver.mjs.map +1 -1
  350. package/hooks/useScrollMonitor.js +1 -1
  351. package/hooks/useScrollMonitor.js.map +1 -1
  352. package/hooks/useScrollMonitor.mjs +1 -1
  353. package/hooks/useScrollMonitor.mjs.map +1 -1
  354. package/hooks/useScrollThresholds.js.map +1 -1
  355. package/hooks/useScrollThresholds.mjs.map +1 -1
  356. package/mixins/color.js.map +1 -1
  357. package/mixins/color.mjs.map +1 -1
  358. package/mixins/create-responsive-props.js.map +1 -1
  359. package/mixins/create-responsive-props.mjs.map +1 -1
  360. package/mixins/display.js.map +1 -1
  361. package/mixins/display.mjs.map +1 -1
  362. package/mixins/responsive-margin.js.map +1 -1
  363. package/mixins/responsive-margin.mjs.map +1 -1
  364. package/mixins/responsive-property.js +1 -1
  365. package/mixins/responsive-property.js.map +1 -1
  366. package/mixins/responsive-property.mjs +1 -1
  367. package/mixins/responsive-property.mjs.map +1 -1
  368. package/mixins/screen.js +1 -1
  369. package/mixins/screen.js.map +1 -1
  370. package/mixins/screen.mjs +1 -1
  371. package/mixins/screen.mjs.map +1 -1
  372. package/mixins/shared.js +4 -4
  373. package/mixins/shared.js.map +1 -1
  374. package/mixins/shared.mjs +4 -4
  375. package/mixins/shared.mjs.map +1 -1
  376. package/mixins/vAlign.js.map +1 -1
  377. package/mixins/vAlign.mjs.map +1 -1
  378. package/package.json +7 -7
  379. package/shared/enums/sizeInput.js.map +1 -1
  380. package/shared/enums/sizeInput.mjs.map +1 -1
  381. package/shared/resize-observer.js.map +1 -1
  382. package/shared/resize-observer.mjs.map +1 -1
  383. package/shared/utils/colors.js.map +1 -1
  384. package/shared/utils/colors.mjs.map +1 -1
  385. package/shared/utils/dom.js.map +1 -1
  386. package/shared/utils/dom.mjs.map +1 -1
  387. package/shared/utils/react.js.map +1 -1
  388. package/shared/utils/react.mjs.map +1 -1
  389. package/shared/utils/rel-builder.js +1 -1
  390. package/shared/utils/rel-builder.js.map +1 -1
  391. package/shared/utils/rel-builder.mjs +1 -1
  392. package/shared/utils/rel-builder.mjs.map +1 -1
  393. package/theme/colors-dark.js.map +1 -1
  394. package/theme/colors-dark.mjs.map +1 -1
  395. package/theme/colors-light.js.map +1 -1
  396. package/theme/colors-light.mjs.map +1 -1
  397. package/theme/colors.js.map +1 -1
  398. package/theme/colors.mjs.map +1 -1
  399. package/theme/global-styled.js.map +1 -1
  400. package/theme/global-styled.mjs.map +1 -1
  401. package/theme/theme-provider.js.map +1 -1
  402. package/theme/theme-provider.mjs.map +1 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var color=require('../../mixins/color.js');var responsiveProperty=require('../../mixins/responsive-property.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const borderColor=o=>styled.css(["border-bottom:1px solid ",";"],o);const Root=styled__default.default.div.withConfig({shouldForwardProp:o=>o==='children'}).withConfig({displayName:"Tabs__Root",componentId:"ui__sc-ggtlgu-0"})(["color:rgba(247,247,247,1);display:flex;align-items:flex-end;justify-content:center;flex-direction:row;"," "," ",""],(o=>o.borderColor&&!o.noBorder?color.color(o.borderColor,borderColor):null),(o=>o.color?color.color(o.color):null),responsiveProperty.responsiveProperty('width'));const Inner=styled__default.default.div.withConfig({displayName:"Tabs__Inner",componentId:"ui__sc-ggtlgu-1"})(["position:relative;display:block;width:auto;height:auto;padding:0;margin:0 -20px;box-sizing:border-box;background:transparent;overflow:visible;max-width:100%;width:100%;&::before,&::after{position:absolute;top:0;bottom:0;display:block;content:'';width:","px;height:100%;}&::before{left:0;background:linear-gradient(-90deg,rgba(247,247,247,0) 0%,currentColor 100%);}&::after{right:0;background:linear-gradient(90deg,rgba(247,247,247,0) 0%,currentColor 100%);}"],20);const Content=styled__default.default.div.withConfig({displayName:"Tabs__Content",componentId:"ui__sc-ggtlgu-2"})(["position:relative;z-index:1;display:block;padding:0;margin:0 auto;white-space:nowrap;box-sizing:border-box;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;color:",";scrollbar-width:none;&::-webkit-scrollbar{height:0;background:transparent;visibility:hidden;}&::-webkit-scrollbar-thumb{height:0px;background:transparent;visibility:hidden;}",""],(o=>o.theme.colors.mineShaft),(o=>o.noBorder?styled.css(["display:flex;justify-content:space-between;width:100%;"]):null));exports.Content=Content,exports.Inner=Inner,exports.Root=Root;
1
+ 'use strict';var styled=require('styled-components');var color=require('../../mixins/color.js');var responsiveProperty=require('../../mixins/responsive-property.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const borderColor=o=>styled.css(["border-bottom:1px solid ",";"],o);const Root=styled__default.default.div.withConfig({shouldForwardProp:o=>o==='children'}).withConfig({displayName:"Tabs__Root",componentId:"ui__sc-ggtlgu-0"})(["color:rgba(247,247,247,1);display:flex;align-items:flex-end;justify-content:center;flex-direction:row;"," "," ",""],(o=>o.borderColor&&!o.noBorder?color.color(o.borderColor,borderColor):null),(o=>o.color?color.color(o.color):null),responsiveProperty.responsiveProperty('width'));const Inner=styled__default.default.div.withConfig({displayName:"Tabs__Inner",componentId:"ui__sc-ggtlgu-1"})(["position:relative;display:block;height:auto;padding:0;margin:0 -20px;box-sizing:border-box;background:transparent;overflow:visible;max-width:100%;width:100%;&::before,&::after{position:absolute;top:0;bottom:0;display:block;content:'';width:","px;height:100%;}&::before{left:0;background:linear-gradient(-90deg,rgba(247,247,247,0) 0%,currentcolor 100%);}&::after{right:0;background:linear-gradient(90deg,rgba(247,247,247,0) 0%,currentcolor 100%);}"],20);const Content=styled__default.default.div.withConfig({displayName:"Tabs__Content",componentId:"ui__sc-ggtlgu-2"})(["position:relative;z-index:1;display:block;padding:0;margin:0 auto;white-space:nowrap;box-sizing:border-box;overflow:auto hidden;-webkit-overflow-scrolling:touch;color:",";scrollbar-width:none;&::-webkit-scrollbar{height:0;background:transparent;visibility:hidden;}&::-webkit-scrollbar-thumb{height:0;background:transparent;visibility:hidden;}",""],(o=>o.theme.colors.mineShaft),(o=>o.noBorder?styled.css(["display:flex;justify-content:space-between;width:100%;"]):null));exports.Content=Content,exports.Inner=Inner,exports.Root=Root;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Tabs/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { responsiveProperty } from 'mixins/responsive-property'\nimport { TabsProps } from './Tabs'\n\nconst BEFORE_AFTER_SHADOW_WIDTH = 20\n\nconst borderColor = (color: string) => css`\n border-bottom: 1px solid ${color};\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => prop === 'children',\n})<Pick<TabsProps, 'noBorder' | 'borderColor' | 'color' | 'width'>>`\n color: rgba(247, 247, 247, 1);\n display: flex;\n align-items: flex-end;\n justify-content: center;\n flex-direction: row;\n ${(props) => (props.borderColor && !props.noBorder ? color(props.borderColor, borderColor) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n ${responsiveProperty('width')}\n`\n\nexport const Inner = styled.div`\n position: relative;\n display: block;\n width: auto;\n height: auto;\n padding: 0;\n margin: 0 -20px;\n box-sizing: border-box;\n background: transparent;\n overflow: visible;\n max-width: 100%;\n width: 100%;\n &::before,\n &::after {\n position: absolute;\n top: 0;\n bottom: 0;\n display: block;\n content: '';\n width: ${BEFORE_AFTER_SHADOW_WIDTH}px;\n height: 100%;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(-90deg, rgba(247, 247, 247, 0) 0%, currentColor 100%);\n }\n\n &::after {\n right: 0;\n background: linear-gradient(90deg, rgba(247, 247, 247, 0) 0%, currentColor 100%);\n }\n`\n\nexport const Content = styled.div<Pick<TabsProps, 'noBorder'>>`\n position: relative;\n z-index: 1;\n display: block;\n padding: 0;\n margin: 0 auto;\n white-space: nowrap;\n box-sizing: border-box;\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n color: ${(props) => props.theme.colors.mineShaft};\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n height: 0;\n background: transparent;\n visibility: hidden;\n }\n\n &::-webkit-scrollbar-thumb {\n height: 0px;\n background: transparent;\n visibility: hidden;\n }\n\n ${(props) =>\n props.noBorder\n ? css`\n display: flex;\n justify-content: space-between;\n width: 100%;\n `\n : null}\n`\n"],"names":["borderColor","color","css","Root","styled","div","withConfig","shouldForwardProp","prop","displayName","componentId","props","noBorder","responsiveProperty","Inner","Content","theme","colors","mineShaft"],"mappings":"mRAOA,MAAMA,YAAeC,GAAkBC,WAAG,CAAA,2BAAA,KACbD,GAGtB,MAAME,KAAOC,gBAAAA,QAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAASA,IAAS,aACtCF,WAAA,CAAAG,YAAA,aAAAC,YAAA,mBAFkBN,CAElB,CAAA,yGAAA,IAAA,IAAA,KAMGO,GAAWA,EAAMX,cAAgBW,EAAMC,SAAWX,MAAAA,MAAMU,EAAMX,YAAaA,aAAe,OAC1FW,GAAWA,EAAMV,MAAQA,YAAMU,EAAMV,OAAS,MAC/CY,mBAAkBA,mBAAC,gBAGVC,MAAQV,gBAAAA,QAAOC,IAAGC,WAAA,CAAAG,YAAA,cAAAC,YAAA,mBAAVN,CAAU,CAAA,8PAAA,+MAnBG,UAqDrBW,QAAUX,gBAAAA,QAAOC,IAAGC,WAAA,CAAAG,YAAA,gBAAAC,YAAA,mBAAVN,CAAU,CAAA,uLAAA,iLAAA,KAWrBO,GAAUA,EAAMK,MAAMC,OAAOC,YAepCP,GACDA,EAAMC,SACFV,OAAAA,IAAG,CAAA,2DAKH"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Tabs/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { responsiveProperty } from 'mixins/responsive-property'\nimport type { TabsProps } from './Tabs'\n\nconst BEFORE_AFTER_SHADOW_WIDTH = 20\n\nconst borderColor = (value: string) => css`\n border-bottom: 1px solid ${value};\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => prop === 'children',\n})<Pick<TabsProps, 'noBorder' | 'borderColor' | 'color' | 'width'>>`\n color: rgba(247, 247, 247, 1);\n display: flex;\n align-items: flex-end;\n justify-content: center;\n flex-direction: row;\n ${(props) => (props.borderColor && !props.noBorder ? color(props.borderColor, borderColor) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n ${responsiveProperty('width')}\n`\n\nexport const Inner = styled.div`\n position: relative;\n display: block;\n height: auto;\n padding: 0;\n margin: 0 -20px;\n box-sizing: border-box;\n background: transparent;\n overflow: visible;\n max-width: 100%;\n width: 100%;\n &::before,\n &::after {\n position: absolute;\n top: 0;\n bottom: 0;\n display: block;\n content: '';\n width: ${BEFORE_AFTER_SHADOW_WIDTH}px;\n height: 100%;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(-90deg, rgba(247, 247, 247, 0) 0%, currentcolor 100%);\n }\n\n &::after {\n right: 0;\n background: linear-gradient(90deg, rgba(247, 247, 247, 0) 0%, currentcolor 100%);\n }\n`\n\nexport const Content = styled.div<Pick<TabsProps, 'noBorder'>>`\n position: relative;\n z-index: 1;\n display: block;\n padding: 0;\n margin: 0 auto;\n white-space: nowrap;\n box-sizing: border-box;\n overflow: auto hidden;\n -webkit-overflow-scrolling: touch;\n color: ${(props) => props.theme.colors.mineShaft};\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n height: 0;\n background: transparent;\n visibility: hidden;\n }\n\n &::-webkit-scrollbar-thumb {\n height: 0;\n background: transparent;\n visibility: hidden;\n }\n\n ${(props) =>\n props.noBorder\n ? css`\n display: flex;\n justify-content: space-between;\n width: 100%;\n `\n : null}\n`\n"],"names":["borderColor","value","css","Root","styled","div","withConfig","shouldForwardProp","prop","displayName","componentId","props","noBorder","color","responsiveProperty","Inner","Content","theme","colors","mineShaft"],"mappings":"mRAOA,MAAMA,YAAeC,GAAkBC,WAAG,CAAA,2BAAA,KACbD,GAGtB,MAAME,KAAOC,gBAAAA,QAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAASA,IAAS,aACtCF,WAAA,CAAAG,YAAA,aAAAC,YAAA,mBAFkBN,CAElB,CAAA,yGAAA,IAAA,IAAA,KAMGO,GAAWA,EAAMX,cAAgBW,EAAMC,SAAWC,MAAAA,MAAMF,EAAMX,YAAaA,aAAe,OAC1FW,GAAWA,EAAME,MAAQA,YAAMF,EAAME,OAAS,MAC/CC,mBAAkBA,mBAAC,gBAGVC,MAAQX,gBAAAA,QAAOC,IAAGC,WAAA,CAAAG,YAAA,cAAAC,YAAA,mBAAVN,CAAU,CAAA,mPAAA,+MAnBG,UAoDrBY,QAAUZ,gBAAAA,QAAOC,IAAGC,WAAA,CAAAG,YAAA,gBAAAC,YAAA,mBAAVN,CAAU,CAAA,0KAAA,+KAAA,KAUrBO,GAAUA,EAAMM,MAAMC,OAAOC,YAepCR,GACDA,EAAMC,SACFV,OAAAA,IAAG,CAAA,2DAKH"}
@@ -1,2 +1,2 @@
1
- import styled,{css}from'styled-components';import{color}from'../../mixins/color.mjs';import{responsiveProperty}from'../../mixins/responsive-property.mjs';const borderColor=o=>css(["border-bottom:1px solid ",";"],o);const Root=styled.div.withConfig({shouldForwardProp:o=>o==='children'}).withConfig({displayName:"Tabs__Root",componentId:"ui__sc-ggtlgu-0"})(["color:rgba(247,247,247,1);display:flex;align-items:flex-end;justify-content:center;flex-direction:row;"," "," ",""],(o=>o.borderColor&&!o.noBorder?color(o.borderColor,borderColor):null),(o=>o.color?color(o.color):null),responsiveProperty('width'));const Inner=styled.div.withConfig({displayName:"Tabs__Inner",componentId:"ui__sc-ggtlgu-1"})(["position:relative;display:block;width:auto;height:auto;padding:0;margin:0 -20px;box-sizing:border-box;background:transparent;overflow:visible;max-width:100%;width:100%;&::before,&::after{position:absolute;top:0;bottom:0;display:block;content:'';width:","px;height:100%;}&::before{left:0;background:linear-gradient(-90deg,rgba(247,247,247,0) 0%,currentColor 100%);}&::after{right:0;background:linear-gradient(90deg,rgba(247,247,247,0) 0%,currentColor 100%);}"],20);const Content=styled.div.withConfig({displayName:"Tabs__Content",componentId:"ui__sc-ggtlgu-2"})(["position:relative;z-index:1;display:block;padding:0;margin:0 auto;white-space:nowrap;box-sizing:border-box;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;color:",";scrollbar-width:none;&::-webkit-scrollbar{height:0;background:transparent;visibility:hidden;}&::-webkit-scrollbar-thumb{height:0px;background:transparent;visibility:hidden;}",""],(o=>o.theme.colors.mineShaft),(o=>o.noBorder?css(["display:flex;justify-content:space-between;width:100%;"]):null));export{Content,Inner,Root};
1
+ import styled,{css}from'styled-components';import{color}from'../../mixins/color.mjs';import{responsiveProperty}from'../../mixins/responsive-property.mjs';const borderColor=o=>css(["border-bottom:1px solid ",";"],o);const Root=styled.div.withConfig({shouldForwardProp:o=>o==='children'}).withConfig({displayName:"Tabs__Root",componentId:"ui__sc-ggtlgu-0"})(["color:rgba(247,247,247,1);display:flex;align-items:flex-end;justify-content:center;flex-direction:row;"," "," ",""],(o=>o.borderColor&&!o.noBorder?color(o.borderColor,borderColor):null),(o=>o.color?color(o.color):null),responsiveProperty('width'));const Inner=styled.div.withConfig({displayName:"Tabs__Inner",componentId:"ui__sc-ggtlgu-1"})(["position:relative;display:block;height:auto;padding:0;margin:0 -20px;box-sizing:border-box;background:transparent;overflow:visible;max-width:100%;width:100%;&::before,&::after{position:absolute;top:0;bottom:0;display:block;content:'';width:","px;height:100%;}&::before{left:0;background:linear-gradient(-90deg,rgba(247,247,247,0) 0%,currentcolor 100%);}&::after{right:0;background:linear-gradient(90deg,rgba(247,247,247,0) 0%,currentcolor 100%);}"],20);const Content=styled.div.withConfig({displayName:"Tabs__Content",componentId:"ui__sc-ggtlgu-2"})(["position:relative;z-index:1;display:block;padding:0;margin:0 auto;white-space:nowrap;box-sizing:border-box;overflow:auto hidden;-webkit-overflow-scrolling:touch;color:",";scrollbar-width:none;&::-webkit-scrollbar{height:0;background:transparent;visibility:hidden;}&::-webkit-scrollbar-thumb{height:0;background:transparent;visibility:hidden;}",""],(o=>o.theme.colors.mineShaft),(o=>o.noBorder?css(["display:flex;justify-content:space-between;width:100%;"]):null));export{Content,Inner,Root};
2
2
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/Tabs/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { responsiveProperty } from 'mixins/responsive-property'\nimport { TabsProps } from './Tabs'\n\nconst BEFORE_AFTER_SHADOW_WIDTH = 20\n\nconst borderColor = (color: string) => css`\n border-bottom: 1px solid ${color};\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => prop === 'children',\n})<Pick<TabsProps, 'noBorder' | 'borderColor' | 'color' | 'width'>>`\n color: rgba(247, 247, 247, 1);\n display: flex;\n align-items: flex-end;\n justify-content: center;\n flex-direction: row;\n ${(props) => (props.borderColor && !props.noBorder ? color(props.borderColor, borderColor) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n ${responsiveProperty('width')}\n`\n\nexport const Inner = styled.div`\n position: relative;\n display: block;\n width: auto;\n height: auto;\n padding: 0;\n margin: 0 -20px;\n box-sizing: border-box;\n background: transparent;\n overflow: visible;\n max-width: 100%;\n width: 100%;\n &::before,\n &::after {\n position: absolute;\n top: 0;\n bottom: 0;\n display: block;\n content: '';\n width: ${BEFORE_AFTER_SHADOW_WIDTH}px;\n height: 100%;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(-90deg, rgba(247, 247, 247, 0) 0%, currentColor 100%);\n }\n\n &::after {\n right: 0;\n background: linear-gradient(90deg, rgba(247, 247, 247, 0) 0%, currentColor 100%);\n }\n`\n\nexport const Content = styled.div<Pick<TabsProps, 'noBorder'>>`\n position: relative;\n z-index: 1;\n display: block;\n padding: 0;\n margin: 0 auto;\n white-space: nowrap;\n box-sizing: border-box;\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n color: ${(props) => props.theme.colors.mineShaft};\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n height: 0;\n background: transparent;\n visibility: hidden;\n }\n\n &::-webkit-scrollbar-thumb {\n height: 0px;\n background: transparent;\n visibility: hidden;\n }\n\n ${(props) =>\n props.noBorder\n ? css`\n display: flex;\n justify-content: space-between;\n width: 100%;\n `\n : null}\n`\n"],"names":["borderColor","color","css","Root","styled","div","withConfig","shouldForwardProp","prop","displayName","componentId","props","noBorder","responsiveProperty","Inner","Content","theme","colors","mineShaft"],"mappings":"0JAOA,MAAMA,YAAeC,GAAkBC,IAAG,CAAA,2BAAA,KACbD,GAGtB,MAAME,KAAOC,OAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAASA,IAAS,aACtCF,WAAA,CAAAG,YAAA,aAAAC,YAAA,mBAFkBN,CAElB,CAAA,yGAAA,IAAA,IAAA,KAMGO,GAAWA,EAAMX,cAAgBW,EAAMC,SAAWX,MAAMU,EAAMX,YAAaA,aAAe,OAC1FW,GAAWA,EAAMV,MAAQA,MAAMU,EAAMV,OAAS,MAC/CY,mBAAmB,gBAGVC,MAAQV,OAAOC,IAAGC,WAAA,CAAAG,YAAA,cAAAC,YAAA,mBAAVN,CAAU,CAAA,8PAAA,+MAnBG,UAqDrBW,QAAUX,OAAOC,IAAGC,WAAA,CAAAG,YAAA,gBAAAC,YAAA,mBAAVN,CAAU,CAAA,uLAAA,iLAAA,KAWrBO,GAAUA,EAAMK,MAAMC,OAAOC,YAepCP,GACDA,EAAMC,SACFV,IAAG,CAAA,2DAKH"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/Tabs/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { responsiveProperty } from 'mixins/responsive-property'\nimport type { TabsProps } from './Tabs'\n\nconst BEFORE_AFTER_SHADOW_WIDTH = 20\n\nconst borderColor = (value: string) => css`\n border-bottom: 1px solid ${value};\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => prop === 'children',\n})<Pick<TabsProps, 'noBorder' | 'borderColor' | 'color' | 'width'>>`\n color: rgba(247, 247, 247, 1);\n display: flex;\n align-items: flex-end;\n justify-content: center;\n flex-direction: row;\n ${(props) => (props.borderColor && !props.noBorder ? color(props.borderColor, borderColor) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n ${responsiveProperty('width')}\n`\n\nexport const Inner = styled.div`\n position: relative;\n display: block;\n height: auto;\n padding: 0;\n margin: 0 -20px;\n box-sizing: border-box;\n background: transparent;\n overflow: visible;\n max-width: 100%;\n width: 100%;\n &::before,\n &::after {\n position: absolute;\n top: 0;\n bottom: 0;\n display: block;\n content: '';\n width: ${BEFORE_AFTER_SHADOW_WIDTH}px;\n height: 100%;\n }\n\n &::before {\n left: 0;\n background: linear-gradient(-90deg, rgba(247, 247, 247, 0) 0%, currentcolor 100%);\n }\n\n &::after {\n right: 0;\n background: linear-gradient(90deg, rgba(247, 247, 247, 0) 0%, currentcolor 100%);\n }\n`\n\nexport const Content = styled.div<Pick<TabsProps, 'noBorder'>>`\n position: relative;\n z-index: 1;\n display: block;\n padding: 0;\n margin: 0 auto;\n white-space: nowrap;\n box-sizing: border-box;\n overflow: auto hidden;\n -webkit-overflow-scrolling: touch;\n color: ${(props) => props.theme.colors.mineShaft};\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n height: 0;\n background: transparent;\n visibility: hidden;\n }\n\n &::-webkit-scrollbar-thumb {\n height: 0;\n background: transparent;\n visibility: hidden;\n }\n\n ${(props) =>\n props.noBorder\n ? css`\n display: flex;\n justify-content: space-between;\n width: 100%;\n `\n : null}\n`\n"],"names":["borderColor","value","css","Root","styled","div","withConfig","shouldForwardProp","prop","displayName","componentId","props","noBorder","color","responsiveProperty","Inner","Content","theme","colors","mineShaft"],"mappings":"0JAOA,MAAMA,YAAeC,GAAkBC,IAAG,CAAA,2BAAA,KACbD,GAGtB,MAAME,KAAOC,OAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAASA,IAAS,aACtCF,WAAA,CAAAG,YAAA,aAAAC,YAAA,mBAFkBN,CAElB,CAAA,yGAAA,IAAA,IAAA,KAMGO,GAAWA,EAAMX,cAAgBW,EAAMC,SAAWC,MAAMF,EAAMX,YAAaA,aAAe,OAC1FW,GAAWA,EAAME,MAAQA,MAAMF,EAAME,OAAS,MAC/CC,mBAAmB,gBAGVC,MAAQX,OAAOC,IAAGC,WAAA,CAAAG,YAAA,cAAAC,YAAA,mBAAVN,CAAU,CAAA,mPAAA,+MAnBG,UAoDrBY,QAAUZ,OAAOC,IAAGC,WAAA,CAAAG,YAAA,gBAAAC,YAAA,mBAAVN,CAAU,CAAA,0KAAA,+KAAA,KAUrBO,GAAUA,EAAMM,MAAMC,OAAOC,YAepCR,GACDA,EAAMC,SACFV,IAAG,CAAA,2DAKH"}
@@ -1,2 +1,2 @@
1
- 'use strict';var colors=require('../../theme/colors.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');function TagInput(e){return jsxRuntime.jsx(Tag,{as:"input",...e})}function Tag(e){const{as:t,textProps:n,content:s,children:i,htmlFor:a,id:l,name:o,inputType:r,value:u,disabled:c,onChange:d,onClick:p,inverse:h,checked:m,...g}=e;return jsxRuntime.jsxs(style.Root,{as:t==='input'?'label':t,inverse:h,checked:m,disabled:c,onClick:t!=='input'?p:void 0,...t==='label'?{htmlFor:a}:{},...t==='button'?{type:'button'}:{},...t==='input'?{htmlFor:l||o}:{},...g,children:[t==='input'?jsxRuntime.jsx("input",{id:l||o,name:o,type:r||'checkbox',tabIndex:0,onChange:e=>(e.persist(),d&&d(e)),onClick:e=>(e.persist(),p&&p(e)),defaultChecked:e.defaultChecked,checked:m,value:u,disabled:c,hidden:!0}):null,i,jsxRuntime.jsx(style.Text,{size:14,forwardedAs:"span",color:m&&!h?colors.DefaultColorNames.white:colors.DefaultColorNames.mineShaft,...n,children:s})]})}Tag.defaultProps={display:'inline-block',as:'button',height:40},TagInput.defaultProps={display:'inline-block',height:40},Tag.Input=TagInput,Tag.displayName='Tag',exports.Tag=Tag;
1
+ 'use strict';var colors=require('../../theme/colors.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');function Tag(e){const{as:t,textProps:n,content:s,children:i,htmlFor:a,id:l,name:o,inputType:r,value:u,disabled:c,onChange:d,onClick:p,inverse:h,checked:m,...g}=e;return jsxRuntime.jsxs(style.Root,{as:t==='input'?'label':t,inverse:h,checked:m,disabled:c,onClick:t!=='input'?p:void 0,...t==='label'?{htmlFor:a}:{},...t==='button'?{type:'button'}:{},...t==='input'?{htmlFor:l||o}:{},...g,children:[t==='input'?jsxRuntime.jsx("input",{id:l||o,name:o,type:r||'checkbox',tabIndex:0,onChange:e=>(e.persist(),d&&d(e)),onClick:e=>(e.persist(),p&&p(e)),defaultChecked:e.defaultChecked,checked:m,value:u,disabled:c,hidden:!0}):null,i,jsxRuntime.jsx(style.Text,{size:14,forwardedAs:"span",color:m&&!h?colors.DefaultColorNames.white:colors.DefaultColorNames.mineShaft,...n,children:s})]})}function TagInput(e){return jsxRuntime.jsx(Tag,{as:"input",...e})}Tag.defaultProps={display:'inline-block',as:'button',height:40},TagInput.defaultProps={display:'inline-block',height:40},Tag.Input=TagInput,Tag.displayName='Tag',exports.Tag=Tag;
2
2
  //# sourceMappingURL=Tag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport { ColorProperty } from 'mixins/color'\nimport { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { TextProps } from 'components/Text'\nimport { DefaultColorNames } from 'theme/colors'\nimport * as Styled from './style'\n\nexport interface TagProps\n extends BaseProps,\n DisplayProperty,\n ColorProperty,\n ResponsiveNamedProperty<'height'>,\n ResponsiveNamedProperty<'width'> {\n as?: 'button' | 'div' | 'input' | 'label'\n /**\n * Field id\n */\n id?: string\n /**\n * Field name\n */\n name?: string\n /**\n * Input type\n */\n inputType?: 'checkbox' | 'radio'\n /**\n * On change handler\n */\n onChange?(_e: React.ChangeEvent<HTMLInputElement>): void\n /**\n * On click handler\n */\n onClick?(_e: React.MouseEvent<HTMLInputElement>): void\n /**\n * Whether or not Radio is checked\n */\n defaultChecked?: boolean\n /**\n * Value\n */\n value?: string | number\n /** Children are placed before Text */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /** Inner Text content */\n content?: React.ReactNode\n /** Inner Text component props */\n textProps?: TextProps\n /** Checked state */\n checked?: boolean\n /** Disabled state */\n disabled?: boolean\n /** Error state */\n error?: boolean\n /** If as = 'label' could provide for */\n htmlFor?: string\n /**\n * inverse\n */\n inverse?: boolean\n /**\n * Size\n */\n size?: 'l' | 'm' | 's' | 'xs'\n}\n\nTag.defaultProps = {\n display: 'inline-block',\n as: 'button',\n height: 40,\n}\n\nTagInput.defaultProps = {\n display: 'inline-block',\n height: 40,\n}\n\n// Prevent brakechanges\nTag.Input = TagInput\n\nTag.displayName = 'Tag'\n\nfunction TagInput(props: typeof TagInput.defaultProps & TagProps) {\n return <Tag as='input' {...props} />\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'height'>`](#/Миксины)\n */\nexport function Tag(props: typeof Tag.defaultProps & TagProps) {\n const {\n as,\n textProps,\n content,\n children,\n htmlFor,\n id,\n name,\n inputType,\n value,\n disabled,\n onChange,\n onClick,\n inverse,\n checked,\n ...restProps\n } = props\n\n const buttonProps = as === 'button' ? { type: 'button' } : {}\n const labelProps = as === 'label' ? { htmlFor } : {}\n const inputProps = as === 'input' ? { htmlFor: id || name } : {}\n\n return (\n <Styled.Root\n as={as === 'input' ? 'label' : as}\n inverse={inverse}\n checked={checked}\n disabled={disabled}\n onClick={as !== 'input' ? onClick : undefined}\n {...labelProps}\n {...buttonProps}\n {...inputProps}\n {...restProps}\n >\n {as === 'input' ? (\n <input\n id={id || name}\n name={name}\n type={inputType || 'checkbox'}\n tabIndex={0}\n onChange={(e) => {\n e.persist()\n\n return onChange && onChange(e)\n }}\n onClick={(e) => {\n e.persist()\n\n return onClick && onClick(e)\n }}\n defaultChecked={props.defaultChecked}\n checked={checked}\n value={value}\n disabled={disabled}\n hidden\n />\n ) : null}\n {children}\n <Styled.Text\n size={14}\n forwardedAs='span'\n color={checked && !inverse ? DefaultColorNames.white : DefaultColorNames.mineShaft}\n {...textProps}\n >\n {content}\n </Styled.Text>\n </Styled.Root>\n )\n}\n"],"names":["TagInput","props","_jsx","Tag","as","textProps","content","children","htmlFor","id","name","inputType","value","disabled","onChange","onClick","inverse","checked","restProps","_jsxs","Styled","undefined","type","tabIndex","e","persist","defaultChecked","hidden","size","forwardedAs","color","DefaultColorNames","white","mineShaft","defaultProps","display","height","Input","displayName"],"mappings":"qIAsFA,SAASA,SAASC,GAChB,OAAOC,WAAAA,IAACC,IAAG,CAACC,GAAG,WAAYH,GAC7B,CAUO,SAASE,IAAIF,GAClB,MAAMG,GACJA,EAAEC,UACFA,EAASC,QACTA,EAAOC,SACPA,EAAQC,QACRA,EAAOC,GACPA,EAAEC,KACFA,EAAIC,UACJA,EAASC,MACTA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACDjB,EAMJ,OACEkB,WAAAA,KAACC,MAAAA,KAAW,CACVhB,GAAIA,IAAO,QAAU,QAAUA,EAC/BY,QAASA,EACTC,QAASA,EACTJ,SAAUA,EACVE,QAASX,IAAO,QAAUW,OAAUM,KATrBjB,IAAO,QAAU,CAAEI,WAAY,MAD9BJ,IAAO,SAAW,CAAEkB,KAAM,UAAa,MAExClB,IAAO,QAAU,CAAEI,QAASC,GAAMC,GAAS,MAYtDQ,EAASX,SAEZH,CAAAA,IAAO,QACNF,WAAAA,IAAA,QAAA,CACEO,GAAIA,GAAMC,EACVA,KAAMA,EACNY,KAAMX,GAAa,WACnBY,SAAU,EACVT,SAAWU,IACTA,EAAEC,UAEKX,GAAYA,EAASU,IAE9BT,QAAUS,IACRA,EAAEC,UAEKV,GAAWA,EAAQS,IAE5BE,eAAgBzB,EAAMyB,eACtBT,QAASA,EACTL,MAAOA,EACPC,SAAUA,EACVc,QAAM,IAEN,KACHpB,EACDL,WAAAA,IAACkB,MAAAA,KAAW,CACVQ,KAAM,GACNC,YAAY,OACZC,MAAOb,IAAYD,EAAUe,OAAAA,kBAAkBC,MAAQD,OAAAA,kBAAkBE,aACrE5B,EAASE,SAEZD,MAIT,CAjGAH,IAAI+B,aAAe,CACjBC,QAAS,eACT/B,GAAI,SACJgC,OAAQ,IAGVpC,SAASkC,aAAe,CACtBC,QAAS,eACTC,OAAQ,IAIVjC,IAAIkC,MAAQrC,SAEZG,IAAImC,YAAc"}
1
+ {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { ColorProperty } from 'mixins/color'\nimport type { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { TextProps } from 'components/Text'\nimport { DefaultColorNames } from 'theme/colors'\nimport * as Styled from './style'\n\nexport interface TagProps\n extends BaseProps,\n DisplayProperty,\n ColorProperty,\n ResponsiveNamedProperty<'height'>,\n ResponsiveNamedProperty<'width'> {\n as?: 'button' | 'div' | 'input' | 'label'\n /**\n * Field id\n */\n id?: string\n /**\n * Field name\n */\n name?: string\n /**\n * Input type\n */\n inputType?: 'checkbox' | 'radio'\n /**\n * On change handler\n */\n onChange?(_e: React.ChangeEvent<HTMLInputElement>): void\n /**\n * On click handler\n */\n onClick?(_e: React.MouseEvent<HTMLInputElement>): void\n /**\n * Whether or not Radio is checked\n */\n defaultChecked?: boolean\n /**\n * Value\n */\n value?: string | number\n /** Children are placed before Text */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /** Inner Text content */\n content?: React.ReactNode\n /** Inner Text component props */\n textProps?: TextProps\n /** Checked state */\n checked?: boolean\n /** Disabled state */\n disabled?: boolean\n /** Error state */\n error?: boolean\n /** If as = 'label' could provide for */\n htmlFor?: string\n /**\n * inverse\n */\n inverse?: boolean\n /**\n * Size\n */\n size?: 'l' | 'm' | 's' | 'xs'\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'height'>`](#/Миксины)\n */\nfunction Tag(props: typeof Tag.defaultProps & TagProps) {\n const {\n as,\n textProps,\n content,\n children,\n htmlFor,\n id,\n name,\n inputType,\n value,\n disabled,\n onChange,\n onClick,\n inverse,\n checked,\n ...restProps\n } = props\n\n const buttonProps = as === 'button' ? { type: 'button' } : {}\n const labelProps = as === 'label' ? { htmlFor } : {}\n const inputProps = as === 'input' ? { htmlFor: id || name } : {}\n\n return (\n <Styled.Root\n as={as === 'input' ? 'label' : as}\n inverse={inverse}\n checked={checked}\n disabled={disabled}\n onClick={as !== 'input' ? onClick : undefined}\n {...labelProps}\n {...buttonProps}\n {...inputProps}\n {...restProps}\n >\n {as === 'input' ? (\n <input\n id={id || name}\n name={name}\n type={inputType || 'checkbox'}\n tabIndex={0}\n onChange={(e) => {\n e.persist()\n\n return onChange && onChange(e)\n }}\n onClick={(e) => {\n e.persist()\n\n return onClick && onClick(e)\n }}\n defaultChecked={props.defaultChecked}\n checked={checked}\n value={value}\n disabled={disabled}\n hidden\n />\n ) : null}\n {children}\n <Styled.Text\n size={14}\n forwardedAs='span'\n color={checked && !inverse ? DefaultColorNames.white : DefaultColorNames.mineShaft}\n {...textProps}\n >\n {content}\n </Styled.Text>\n </Styled.Root>\n )\n}\n\nfunction TagInput(props: typeof TagInput.defaultProps & TagProps) {\n return <Tag as='input' {...props} />\n}\n\nTag.defaultProps = {\n display: 'inline-block',\n as: 'button',\n height: 40,\n}\n\nTagInput.defaultProps = {\n display: 'inline-block',\n height: 40,\n}\n\nTag.Input = TagInput\n\nTag.displayName = 'Tag'\n\nexport { Tag }\n"],"names":["Tag","props","as","textProps","content","children","htmlFor","id","name","inputType","value","disabled","onChange","onClick","inverse","checked","restProps","_jsxs","Styled","undefined","type","_jsx","tabIndex","e","persist","defaultChecked","hidden","size","forwardedAs","color","DefaultColorNames","white","mineShaft","TagInput","defaultProps","display","height","Input","displayName"],"mappings":"qIA8EA,SAASA,IAAIC,GACX,MAAMC,GACJA,EAAEC,UACFA,EAASC,QACTA,EAAOC,SACPA,EAAQC,QACRA,EAAOC,GACPA,EAAEC,KACFA,EAAIC,UACJA,EAASC,MACTA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACDf,EAMJ,OACEgB,WAAAA,KAACC,MAAAA,KAAW,CACVhB,GAAIA,IAAO,QAAU,QAAUA,EAC/BY,QAASA,EACTC,QAASA,EACTJ,SAAUA,EACVE,QAASX,IAAO,QAAUW,OAAUM,KATrBjB,IAAO,QAAU,CAAEI,WAAY,MAD9BJ,IAAO,SAAW,CAAEkB,KAAM,UAAa,MAExClB,IAAO,QAAU,CAAEI,QAASC,GAAMC,GAAS,MAYtDQ,EAASX,SAEZH,CAAAA,IAAO,QACNmB,WAAAA,IAAA,QAAA,CACEd,GAAIA,GAAMC,EACVA,KAAMA,EACNY,KAAMX,GAAa,WACnBa,SAAU,EACVV,SAAWW,IACTA,EAAEC,UAEKZ,GAAYA,EAASW,IAE9BV,QAAUU,IACRA,EAAEC,UAEKX,GAAWA,EAAQU,IAE5BE,eAAgBxB,EAAMwB,eACtBV,QAASA,EACTL,MAAOA,EACPC,SAAUA,EACVe,QAAM,IAEN,KACHrB,EACDgB,WAAAA,IAACH,MAAAA,KAAW,CACVS,KAAM,GACNC,YAAY,OACZC,MAAOd,IAAYD,EAAUgB,OAAAA,kBAAkBC,MAAQD,OAAAA,kBAAkBE,aACrE7B,EAASE,SAEZD,MAIT,CAEA,SAAS6B,SAAShC,GAChB,OAAOoB,WAAAA,IAACrB,IAAG,CAACE,GAAG,WAAYD,GAC7B,CAEAD,IAAIkC,aAAe,CACjBC,QAAS,eACTjC,GAAI,SACJkC,OAAQ,IAGVH,SAASC,aAAe,CACtBC,QAAS,eACTC,OAAQ,IAGVpC,IAAIqC,MAAQJ,SAEZjC,IAAIsC,YAAc"}
@@ -1,2 +1,2 @@
1
- import{DefaultColorNames}from'../../theme/colors.mjs';import{Root,Text}from'./style.mjs';import{jsx,jsxs}from'react/jsx-runtime';function TagInput(e){return jsx(Tag,{as:"input",...e})}function Tag(e){const{as:t,textProps:n,content:a,children:o,htmlFor:i,id:l,name:s,inputType:r,value:d,disabled:u,onChange:p,onClick:c,inverse:h,checked:m,...f}=e;return jsxs(Root,{as:t==='input'?'label':t,inverse:h,checked:m,disabled:u,onClick:t!=='input'?c:void 0,...t==='label'?{htmlFor:i}:{},...t==='button'?{type:'button'}:{},...t==='input'?{htmlFor:l||s}:{},...f,children:[t==='input'?jsx("input",{id:l||s,name:s,type:r||'checkbox',tabIndex:0,onChange:e=>(e.persist(),p&&p(e)),onClick:e=>(e.persist(),c&&c(e)),defaultChecked:e.defaultChecked,checked:m,value:d,disabled:u,hidden:!0}):null,o,jsx(Text,{size:14,forwardedAs:"span",color:m&&!h?DefaultColorNames.white:DefaultColorNames.mineShaft,...n,children:a})]})}Tag.defaultProps={display:'inline-block',as:'button',height:40},TagInput.defaultProps={display:'inline-block',height:40},Tag.Input=TagInput,Tag.displayName='Tag';export{Tag};
1
+ import{DefaultColorNames}from'../../theme/colors.mjs';import{Root,Text}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';function Tag(e){const{as:t,textProps:n,content:a,children:o,htmlFor:i,id:l,name:s,inputType:r,value:d,disabled:u,onChange:p,onClick:c,inverse:h,checked:m,...f}=e;return jsxs(Root,{as:t==='input'?'label':t,inverse:h,checked:m,disabled:u,onClick:t!=='input'?c:void 0,...t==='label'?{htmlFor:i}:{},...t==='button'?{type:'button'}:{},...t==='input'?{htmlFor:l||s}:{},...f,children:[t==='input'?jsx("input",{id:l||s,name:s,type:r||'checkbox',tabIndex:0,onChange:e=>(e.persist(),p&&p(e)),onClick:e=>(e.persist(),c&&c(e)),defaultChecked:e.defaultChecked,checked:m,value:d,disabled:u,hidden:!0}):null,o,jsx(Text,{size:14,forwardedAs:"span",color:m&&!h?DefaultColorNames.white:DefaultColorNames.mineShaft,...n,children:a})]})}function TagInput(e){return jsx(Tag,{as:"input",...e})}Tag.defaultProps={display:'inline-block',as:'button',height:40},TagInput.defaultProps={display:'inline-block',height:40},Tag.Input=TagInput,Tag.displayName='Tag';export{Tag};
2
2
  //# sourceMappingURL=Tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.mjs","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport { ColorProperty } from 'mixins/color'\nimport { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { TextProps } from 'components/Text'\nimport { DefaultColorNames } from 'theme/colors'\nimport * as Styled from './style'\n\nexport interface TagProps\n extends BaseProps,\n DisplayProperty,\n ColorProperty,\n ResponsiveNamedProperty<'height'>,\n ResponsiveNamedProperty<'width'> {\n as?: 'button' | 'div' | 'input' | 'label'\n /**\n * Field id\n */\n id?: string\n /**\n * Field name\n */\n name?: string\n /**\n * Input type\n */\n inputType?: 'checkbox' | 'radio'\n /**\n * On change handler\n */\n onChange?(_e: React.ChangeEvent<HTMLInputElement>): void\n /**\n * On click handler\n */\n onClick?(_e: React.MouseEvent<HTMLInputElement>): void\n /**\n * Whether or not Radio is checked\n */\n defaultChecked?: boolean\n /**\n * Value\n */\n value?: string | number\n /** Children are placed before Text */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /** Inner Text content */\n content?: React.ReactNode\n /** Inner Text component props */\n textProps?: TextProps\n /** Checked state */\n checked?: boolean\n /** Disabled state */\n disabled?: boolean\n /** Error state */\n error?: boolean\n /** If as = 'label' could provide for */\n htmlFor?: string\n /**\n * inverse\n */\n inverse?: boolean\n /**\n * Size\n */\n size?: 'l' | 'm' | 's' | 'xs'\n}\n\nTag.defaultProps = {\n display: 'inline-block',\n as: 'button',\n height: 40,\n}\n\nTagInput.defaultProps = {\n display: 'inline-block',\n height: 40,\n}\n\n// Prevent brakechanges\nTag.Input = TagInput\n\nTag.displayName = 'Tag'\n\nfunction TagInput(props: typeof TagInput.defaultProps & TagProps) {\n return <Tag as='input' {...props} />\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'height'>`](#/Миксины)\n */\nexport function Tag(props: typeof Tag.defaultProps & TagProps) {\n const {\n as,\n textProps,\n content,\n children,\n htmlFor,\n id,\n name,\n inputType,\n value,\n disabled,\n onChange,\n onClick,\n inverse,\n checked,\n ...restProps\n } = props\n\n const buttonProps = as === 'button' ? { type: 'button' } : {}\n const labelProps = as === 'label' ? { htmlFor } : {}\n const inputProps = as === 'input' ? { htmlFor: id || name } : {}\n\n return (\n <Styled.Root\n as={as === 'input' ? 'label' : as}\n inverse={inverse}\n checked={checked}\n disabled={disabled}\n onClick={as !== 'input' ? onClick : undefined}\n {...labelProps}\n {...buttonProps}\n {...inputProps}\n {...restProps}\n >\n {as === 'input' ? (\n <input\n id={id || name}\n name={name}\n type={inputType || 'checkbox'}\n tabIndex={0}\n onChange={(e) => {\n e.persist()\n\n return onChange && onChange(e)\n }}\n onClick={(e) => {\n e.persist()\n\n return onClick && onClick(e)\n }}\n defaultChecked={props.defaultChecked}\n checked={checked}\n value={value}\n disabled={disabled}\n hidden\n />\n ) : null}\n {children}\n <Styled.Text\n size={14}\n forwardedAs='span'\n color={checked && !inverse ? DefaultColorNames.white : DefaultColorNames.mineShaft}\n {...textProps}\n >\n {content}\n </Styled.Text>\n </Styled.Root>\n )\n}\n"],"names":["TagInput","props","_jsx","Tag","as","textProps","content","children","htmlFor","id","name","inputType","value","disabled","onChange","onClick","inverse","checked","restProps","_jsxs","Styled","undefined","type","tabIndex","e","persist","defaultChecked","hidden","size","forwardedAs","color","DefaultColorNames","white","mineShaft","defaultProps","display","height","Input","displayName"],"mappings":"iIAsFA,SAASA,SAASC,GAChB,OAAOC,IAACC,IAAG,CAACC,GAAG,WAAYH,GAC7B,CAUO,SAASE,IAAIF,GAClB,MAAMG,GACJA,EAAEC,UACFA,EAASC,QACTA,EAAOC,SACPA,EAAQC,QACRA,EAAOC,GACPA,EAAEC,KACFA,EAAIC,UACJA,EAASC,MACTA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACDjB,EAMJ,OACEkB,KAACC,KAAW,CACVhB,GAAIA,IAAO,QAAU,QAAUA,EAC/BY,QAASA,EACTC,QAASA,EACTJ,SAAUA,EACVE,QAASX,IAAO,QAAUW,OAAUM,KATrBjB,IAAO,QAAU,CAAEI,WAAY,MAD9BJ,IAAO,SAAW,CAAEkB,KAAM,UAAa,MAExClB,IAAO,QAAU,CAAEI,QAASC,GAAMC,GAAS,MAYtDQ,EAASX,SAEZH,CAAAA,IAAO,QACNF,IAAA,QAAA,CACEO,GAAIA,GAAMC,EACVA,KAAMA,EACNY,KAAMX,GAAa,WACnBY,SAAU,EACVT,SAAWU,IACTA,EAAEC,UAEKX,GAAYA,EAASU,IAE9BT,QAAUS,IACRA,EAAEC,UAEKV,GAAWA,EAAQS,IAE5BE,eAAgBzB,EAAMyB,eACtBT,QAASA,EACTL,MAAOA,EACPC,SAAUA,EACVc,QAAM,IAEN,KACHpB,EACDL,IAACkB,KAAW,CACVQ,KAAM,GACNC,YAAY,OACZC,MAAOb,IAAYD,EAAUe,kBAAkBC,MAAQD,kBAAkBE,aACrE5B,EAASE,SAEZD,MAIT,CAjGAH,IAAI+B,aAAe,CACjBC,QAAS,eACT/B,GAAI,SACJgC,OAAQ,IAGVpC,SAASkC,aAAe,CACtBC,QAAS,eACTC,OAAQ,IAIVjC,IAAIkC,MAAQrC,SAEZG,IAAImC,YAAc"}
1
+ {"version":3,"file":"Tag.mjs","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { ColorProperty } from 'mixins/color'\nimport type { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { TextProps } from 'components/Text'\nimport { DefaultColorNames } from 'theme/colors'\nimport * as Styled from './style'\n\nexport interface TagProps\n extends BaseProps,\n DisplayProperty,\n ColorProperty,\n ResponsiveNamedProperty<'height'>,\n ResponsiveNamedProperty<'width'> {\n as?: 'button' | 'div' | 'input' | 'label'\n /**\n * Field id\n */\n id?: string\n /**\n * Field name\n */\n name?: string\n /**\n * Input type\n */\n inputType?: 'checkbox' | 'radio'\n /**\n * On change handler\n */\n onChange?(_e: React.ChangeEvent<HTMLInputElement>): void\n /**\n * On click handler\n */\n onClick?(_e: React.MouseEvent<HTMLInputElement>): void\n /**\n * Whether or not Radio is checked\n */\n defaultChecked?: boolean\n /**\n * Value\n */\n value?: string | number\n /** Children are placed before Text */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /** Inner Text content */\n content?: React.ReactNode\n /** Inner Text component props */\n textProps?: TextProps\n /** Checked state */\n checked?: boolean\n /** Disabled state */\n disabled?: boolean\n /** Error state */\n error?: boolean\n /** If as = 'label' could provide for */\n htmlFor?: string\n /**\n * inverse\n */\n inverse?: boolean\n /**\n * Size\n */\n size?: 'l' | 'm' | 's' | 'xs'\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'height'>`](#/Миксины)\n */\nfunction Tag(props: typeof Tag.defaultProps & TagProps) {\n const {\n as,\n textProps,\n content,\n children,\n htmlFor,\n id,\n name,\n inputType,\n value,\n disabled,\n onChange,\n onClick,\n inverse,\n checked,\n ...restProps\n } = props\n\n const buttonProps = as === 'button' ? { type: 'button' } : {}\n const labelProps = as === 'label' ? { htmlFor } : {}\n const inputProps = as === 'input' ? { htmlFor: id || name } : {}\n\n return (\n <Styled.Root\n as={as === 'input' ? 'label' : as}\n inverse={inverse}\n checked={checked}\n disabled={disabled}\n onClick={as !== 'input' ? onClick : undefined}\n {...labelProps}\n {...buttonProps}\n {...inputProps}\n {...restProps}\n >\n {as === 'input' ? (\n <input\n id={id || name}\n name={name}\n type={inputType || 'checkbox'}\n tabIndex={0}\n onChange={(e) => {\n e.persist()\n\n return onChange && onChange(e)\n }}\n onClick={(e) => {\n e.persist()\n\n return onClick && onClick(e)\n }}\n defaultChecked={props.defaultChecked}\n checked={checked}\n value={value}\n disabled={disabled}\n hidden\n />\n ) : null}\n {children}\n <Styled.Text\n size={14}\n forwardedAs='span'\n color={checked && !inverse ? DefaultColorNames.white : DefaultColorNames.mineShaft}\n {...textProps}\n >\n {content}\n </Styled.Text>\n </Styled.Root>\n )\n}\n\nfunction TagInput(props: typeof TagInput.defaultProps & TagProps) {\n return <Tag as='input' {...props} />\n}\n\nTag.defaultProps = {\n display: 'inline-block',\n as: 'button',\n height: 40,\n}\n\nTagInput.defaultProps = {\n display: 'inline-block',\n height: 40,\n}\n\nTag.Input = TagInput\n\nTag.displayName = 'Tag'\n\nexport { Tag }\n"],"names":["Tag","props","as","textProps","content","children","htmlFor","id","name","inputType","value","disabled","onChange","onClick","inverse","checked","restProps","_jsxs","Styled","undefined","type","_jsx","tabIndex","e","persist","defaultChecked","hidden","size","forwardedAs","color","DefaultColorNames","white","mineShaft","TagInput","defaultProps","display","height","Input","displayName"],"mappings":"iIA8EA,SAASA,IAAIC,GACX,MAAMC,GACJA,EAAEC,UACFA,EAASC,QACTA,EAAOC,SACPA,EAAQC,QACRA,EAAOC,GACPA,EAAEC,KACFA,EAAIC,UACJA,EAASC,MACTA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACDf,EAMJ,OACEgB,KAACC,KAAW,CACVhB,GAAIA,IAAO,QAAU,QAAUA,EAC/BY,QAASA,EACTC,QAASA,EACTJ,SAAUA,EACVE,QAASX,IAAO,QAAUW,OAAUM,KATrBjB,IAAO,QAAU,CAAEI,WAAY,MAD9BJ,IAAO,SAAW,CAAEkB,KAAM,UAAa,MAExClB,IAAO,QAAU,CAAEI,QAASC,GAAMC,GAAS,MAYtDQ,EAASX,SAEZH,CAAAA,IAAO,QACNmB,IAAA,QAAA,CACEd,GAAIA,GAAMC,EACVA,KAAMA,EACNY,KAAMX,GAAa,WACnBa,SAAU,EACVV,SAAWW,IACTA,EAAEC,UAEKZ,GAAYA,EAASW,IAE9BV,QAAUU,IACRA,EAAEC,UAEKX,GAAWA,EAAQU,IAE5BE,eAAgBxB,EAAMwB,eACtBV,QAASA,EACTL,MAAOA,EACPC,SAAUA,EACVe,QAAM,IAEN,KACHrB,EACDgB,IAACH,KAAW,CACVS,KAAM,GACNC,YAAY,OACZC,MAAOd,IAAYD,EAAUgB,kBAAkBC,MAAQD,kBAAkBE,aACrE7B,EAASE,SAEZD,MAIT,CAEA,SAAS6B,SAAShC,GAChB,OAAOoB,IAACrB,IAAG,CAACE,GAAG,WAAYD,GAC7B,CAEAD,IAAIkC,aAAe,CACjBC,QAAS,eACTjC,GAAI,SACJkC,OAAQ,IAGVH,SAASC,aAAe,CACtBC,QAAS,eACTC,OAAQ,IAGVpC,IAAIqC,MAAQJ,SAEZjC,IAAIsC,YAAc"}
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var display=require('../../mixins/display.js');var responsiveProperty=require('../../mixins/responsive-property.js');var color=require('../../mixins/color.js');var Text$1=require('../Text/Text.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const WIDTHS={l:220,m:182,s:100,xs:60};const active=styled.css(["border-color:transparent;background-color:currentColor;"]);const Text=styled__default.default(Text$1.Text).withConfig({displayName:"Tag__Text",componentId:"ui__sc-3oi44j-0"})(["display:inline-block;vertical-align:middle;white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden;vertical-align:middle;transition:color 0.25s ease;"]);const disabled=styled.css(["cursor:not-allowed;background-color:rgba(0,0,0,0.04);","{color:rgba(0,0,0,0.16);}"],Text);const Root=styled__default.default.button.withConfig({shouldForwardProp:e=>['children','htmlFor','className','style','onClick'].includes(e)}).withConfig({displayName:"Tag__Root",componentId:"ui__sc-3oi44j-1"})(["padding:0px 16px;margin-bottom:10px;border-radius:3px;background-color:",";border:1px solid ",";box-sizing:border-box;vertical-align:middle;transition:color 0.25s ease,background 0.25s ease,border-color 0.25s ease;cursor:pointer;text-align:center;touch-action:manipulation;min-width:60px;"," "," "," "," "," "," "," "," &:not(:last-child){margin-right:20px;}"," "," &:disabled{","}",""],(e=>e.theme.colors.white),(e=>e.theme.colors.whiteGray),(e=>e.size?responsiveProperty.property((e=>e.width==='auto'?'auto':typeof e.width=='number'?e.width:e.size&&WIDTHS[e.size]?WIDTHS[e.size]:'auto')(e),'width'):null),(e=>e.height?responsiveProperty.property(e.height,'line-height'):null),(e=>e.height?responsiveProperty.property(e.height,'height'):null),(({heightXS:e,heightS:t,heightM:o,heightL:i,heightXL:r})=>responsiveProperty.responsiveNamedProperty({sizes:{heightXS:e,heightS:t,heightM:o,heightL:i,heightXL:r},cssProperty:'height'})),(e=>e.width?responsiveProperty.property(e.width,'width'):null),(({widthXS:e,widthS:t,widthM:o,widthL:i,widthXL:r})=>responsiveProperty.responsiveNamedProperty({sizes:{widthXS:e,widthS:t,widthM:o,widthL:i,widthXL:r},cssProperty:'width'})),(e=>e.display?display.display(e.display):null),(e=>e.color?color.color(e.color):null),(e=>e.disabled?null:styled.css(["&:hover:not(:disabled){border-color:currentColor;}&:active:not(:disabled){"," ","{color:",";}}"],active,Text,(e=>e.theme.colors.white))),(e=>e.inverse||e.checked?active:null),disabled,(e=>e.disabled?disabled:null));exports.Root=Root,exports.Text=Text;
1
+ 'use strict';var styled=require('styled-components');var display=require('../../mixins/display.js');var responsiveProperty=require('../../mixins/responsive-property.js');var color=require('../../mixins/color.js');var Text$1=require('../Text/Text.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const WIDTHS={l:220,m:182,s:100,xs:60};const active=styled.css(["border-color:transparent;background-color:currentcolor;"]);const Text=styled__default.default(Text$1.Text).withConfig({displayName:"Tag__Text",componentId:"ui__sc-3oi44j-0"})(["display:inline-block;white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden;vertical-align:middle;transition:color 0.25s ease;"]);const disabled=styled.css(["cursor:not-allowed;background-color:rgba(0,0,0,0.04);","{color:rgba(0,0,0,0.16);}"],Text);const Root=styled__default.default.button.withConfig({shouldForwardProp:e=>['children','htmlFor','className','style','onClick'].includes(e)}).withConfig({displayName:"Tag__Root",componentId:"ui__sc-3oi44j-1"})(["padding:0 16px;margin-bottom:10px;border-radius:3px;background-color:",";border:1px solid ",";box-sizing:border-box;vertical-align:middle;transition:color 0.25s ease,background 0.25s ease,border-color 0.25s ease;cursor:pointer;text-align:center;touch-action:manipulation;min-width:60px;"," "," "," "," "," "," "," "," &:not(:last-child){margin-right:20px;}"," "," &:disabled{","}",""],(e=>e.theme.colors.white),(e=>e.theme.colors.whiteGray),(e=>e.size?responsiveProperty.property((e=>e.width==='auto'?'auto':typeof e.width=='number'?e.width:e.size&&WIDTHS[e.size]?WIDTHS[e.size]:'auto')(e),'width'):null),(e=>e.height?responsiveProperty.property(e.height,'line-height'):null),(e=>e.height?responsiveProperty.property(e.height,'height'):null),(({heightXS:e,heightS:t,heightM:o,heightL:i,heightXL:r})=>responsiveProperty.responsiveNamedProperty({sizes:{heightXS:e,heightS:t,heightM:o,heightL:i,heightXL:r},cssProperty:'height'})),(e=>e.width?responsiveProperty.property(e.width,'width'):null),(({widthXS:e,widthS:t,widthM:o,widthL:i,widthXL:r})=>responsiveProperty.responsiveNamedProperty({sizes:{widthXS:e,widthS:t,widthM:o,widthL:i,widthXL:r},cssProperty:'width'})),(e=>e.display?display.display(e.display):null),(e=>e.color?color.color(e.color):null),(e=>e.disabled?null:styled.css(["&:hover:not(:disabled){border-color:currentcolor;}&:active:not(:disabled){"," ","{color:",";}}"],active,Text,(({theme:e})=>e.colors.white))),(e=>e.inverse||e.checked?active:null),disabled,(e=>e.disabled?disabled:null));exports.Root=Root,exports.Text=Text;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Tag/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { display } from 'mixins/display'\nimport { property, PossibleValues, responsiveNamedProperty } from 'mixins/responsive-property'\nimport { color } from 'mixins/color'\nimport { Text as UiText } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport { TagProps } from './Tag'\n\nconst WIDTHS: Record<Partial<Exclude<TagProps['size'], 'auto' | undefined>>, number> = {\n l: 220,\n m: 182,\n s: 100,\n xs: 60,\n}\n\nconst chooseWidthValue = (props: TagProps): PossibleValues => {\n if (props.width === 'auto') return 'auto'\n if (typeof props.width === 'number') return props.width\n\n if (props.size && WIDTHS[props.size]) return WIDTHS[props.size]\n\n return 'auto'\n}\n\nconst active = css`\n border-color: transparent;\n background-color: currentColor;\n`\n\nexport const Text = styled(UiText)<TextProps>`\n display: inline-block;\n vertical-align: middle;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 100%;\n overflow: hidden;\n vertical-align: middle;\n transition: color 0.25s ease;\n`\n\nconst disabled = css`\n cursor: not-allowed;\n background-color: rgba(0, 0, 0, 0.04);\n ${Text} {\n color: rgba(0, 0, 0, 0.16);\n }\n`\n\nexport const Root = styled.button.withConfig<TagProps>({\n shouldForwardProp: (prop) => ['children', 'htmlFor', 'className', 'style', 'onClick'].includes(prop),\n})`\n padding: 0px 16px;\n margin-bottom: 10px;\n border-radius: 3px;\n background-color: ${(props) => props.theme.colors.white};\n border: 1px solid ${(props) => props.theme.colors.whiteGray};\n box-sizing: border-box;\n vertical-align: middle;\n transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;\n cursor: pointer;\n text-align: center;\n touch-action: manipulation;\n min-width: 60px;\n\n ${(props) => (props.size ? property(chooseWidthValue(props), 'width') : null)}\n ${(props) => (props.height ? property(props.height, 'line-height') : null)}\n ${(props) => (props.height ? property(props.height, 'height') : null)}\n ${({ heightXS, heightS, heightM, heightL, heightXL }) =>\n responsiveNamedProperty({ sizes: { heightXS, heightS, heightM, heightL, heightXL }, cssProperty: 'height' })}\n\n ${(props) => (props.width ? property(props.width, 'width') : null)}\n ${({ widthXS, widthS, widthM, widthL, widthXL }) =>\n responsiveNamedProperty({ sizes: { widthXS, widthS, widthM, widthL, widthXL }, cssProperty: 'width' })}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n\n &:not(:last-child) {\n margin-right: 20px;\n }\n\n ${(props) =>\n !props.disabled\n ? css`\n &:hover:not(:disabled) {\n border-color: currentColor;\n }\n &:active:not(:disabled) {\n ${active}\n ${Text} {\n color: ${(props) => props.theme.colors.white};\n }\n }\n `\n : null}\n\n ${(props) => (props.inverse || props.checked ? active : null)}\n\n &:disabled {\n ${disabled}\n }\n ${(props) => (props.disabled ? disabled : null)}\n`\n"],"names":["WIDTHS","l","m","s","xs","active","css","Text","styled","default","UiText","withConfig","displayName","componentId","disabled","Root","button","shouldForwardProp","prop","includes","props","theme","colors","white","whiteGray","size","property","width","chooseWidthValue","height","heightXS","heightS","heightM","heightL","heightXL","responsiveNamedProperty","sizes","cssProperty","widthXS","widthS","widthM","widthL","widthXL","display","color","inverse","checked"],"mappings":"wWAQA,MAAMA,OAAiF,CACrFC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHC,GAAI,IAYN,MAAMC,OAASC,OAAGA,IAGjB,CAAA,4DAEM,MAAMC,KAAOC,gBAAMC,QAACC,aAAOC,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAAdL,CASnB,CAAA,2KAED,MAAMM,SAAWR,OAAGA,IAAA,CAAA,wDAAA,6BAGhBC,MAKG,MAAMQ,KAAOP,gBAAAA,QAAOQ,OAAOL,WAAqB,CACrDM,kBAAoBC,GAAS,CAAC,WAAY,UAAW,YAAa,QAAS,WAAWC,SAASD,KAC/FP,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAFkBL,CAElB,CAAA,0EAAA,qBAAA,oMAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,0CAAA,IAAA,eAAA,IAAA,KAIqBY,GAAUA,EAAMC,MAAMC,OAAOC,QAC7BH,GAAUA,EAAMC,MAAMC,OAAOE,YAS/CJ,GAAWA,EAAMK,KAAOC,mBAAQA,SAjDXN,IACpBA,EAAMO,QAAU,OAAe,cACxBP,EAAMO,OAAU,SAAiBP,EAAMO,MAE9CP,EAAMK,MAAQzB,OAAOoB,EAAMK,MAAczB,OAAOoB,EAAMK,MAEnD,OA2C6BG,CAAiBR,GAAQ,SAAW,OACrEA,GAAWA,EAAMS,OAASH,mBAAQA,SAACN,EAAMS,OAAQ,eAAiB,OAClET,GAAWA,EAAMS,OAASH,mBAAQA,SAACN,EAAMS,OAAQ,UAAY,OAC9D,EAAGC,WAAUC,UAASC,UAASC,UAASC,cACxCC,2CAAwB,CAAEC,MAAO,CAAEN,WAAUC,UAASC,UAASC,UAASC,YAAYG,YAAa,aAEhGjB,GAAWA,EAAMO,MAAQD,mBAAAA,SAASN,EAAMO,MAAO,SAAW,OACzD,EAAGW,UAASC,SAAQC,SAAQC,SAAQC,aACtCP,2CAAwB,CAAEC,MAAO,CAAEE,UAASC,SAAQC,SAAQC,SAAQC,WAAWL,YAAa,YAE3FjB,GAAWA,EAAMuB,QAAUA,QAAOA,QAACvB,EAAMuB,SAAW,OACpDvB,GAAWA,EAAMwB,MAAQA,MAAKA,MAACxB,EAAMwB,OAAS,OAM9CxB,GACAA,EAAMN,SAYH,KAXAR,OAAAA,IAAG,CAAA,6EAAA,IAAA,UAAA,OAKGD,OACAE,MACUa,GAAUA,EAAMC,MAAMC,OAAOC,UAMhDH,GAAWA,EAAMyB,SAAWzB,EAAM0B,QAAUzC,OAAS,MAGpDS,UAEDM,GAAWA,EAAMN,SAAWA,SAAW"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Tag/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { display } from 'mixins/display'\nimport { property, responsiveNamedProperty } from 'mixins/responsive-property'\nimport type { PossibleValues } from 'mixins/responsive-property'\nimport { color } from 'mixins/color'\nimport { Text as UiText } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport type { TagProps } from './Tag'\n\nconst WIDTHS: Record<Partial<Exclude<TagProps['size'], 'auto' | undefined>>, number> = {\n l: 220,\n m: 182,\n s: 100,\n xs: 60,\n}\n\nconst chooseWidthValue = (props: TagProps): PossibleValues => {\n if (props.width === 'auto') return 'auto'\n if (typeof props.width === 'number') return props.width\n\n if (props.size && WIDTHS[props.size]) return WIDTHS[props.size]\n\n return 'auto'\n}\n\nconst active = css`\n border-color: transparent;\n background-color: currentcolor;\n`\n\nexport const Text = styled(UiText)<TextProps>`\n display: inline-block;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 100%;\n overflow: hidden;\n vertical-align: middle;\n transition: color 0.25s ease;\n`\n\nconst disabled = css`\n cursor: not-allowed;\n background-color: rgba(0, 0, 0, 0.04);\n ${Text} {\n color: rgba(0, 0, 0, 0.16);\n }\n`\n\nexport const Root = styled.button.withConfig<TagProps>({\n shouldForwardProp: (prop) => ['children', 'htmlFor', 'className', 'style', 'onClick'].includes(prop),\n})`\n padding: 0 16px;\n margin-bottom: 10px;\n border-radius: 3px;\n background-color: ${(props) => props.theme.colors.white};\n border: 1px solid ${(props) => props.theme.colors.whiteGray};\n box-sizing: border-box;\n vertical-align: middle;\n transition:\n color 0.25s ease,\n background 0.25s ease,\n border-color 0.25s ease;\n cursor: pointer;\n text-align: center;\n touch-action: manipulation;\n min-width: 60px;\n\n ${(props) => (props.size ? property(chooseWidthValue(props), 'width') : null)}\n ${(props) => (props.height ? property(props.height, 'line-height') : null)}\n ${(props) => (props.height ? property(props.height, 'height') : null)}\n ${({ heightXS, heightS, heightM, heightL, heightXL }) =>\n responsiveNamedProperty({ sizes: { heightXS, heightS, heightM, heightL, heightXL }, cssProperty: 'height' })}\n\n ${(props) => (props.width ? property(props.width, 'width') : null)}\n ${({ widthXS, widthS, widthM, widthL, widthXL }) =>\n responsiveNamedProperty({ sizes: { widthXS, widthS, widthM, widthL, widthXL }, cssProperty: 'width' })}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n\n &:not(:last-child) {\n margin-right: 20px;\n }\n\n ${(props) =>\n !props.disabled\n ? css`\n &:hover:not(:disabled) {\n border-color: currentcolor;\n }\n &:active:not(:disabled) {\n ${active}\n ${Text} {\n color: ${({ theme }) => theme.colors.white};\n }\n }\n `\n : null}\n\n ${(props) => (props.inverse || props.checked ? active : null)}\n\n &:disabled {\n ${disabled}\n }\n ${(props) => (props.disabled ? disabled : null)}\n`\n"],"names":["WIDTHS","l","m","s","xs","active","css","Text","styled","default","UiText","withConfig","displayName","componentId","disabled","Root","button","shouldForwardProp","prop","includes","props","theme","colors","white","whiteGray","size","property","width","chooseWidthValue","height","heightXS","heightS","heightM","heightL","heightXL","responsiveNamedProperty","sizes","cssProperty","widthXS","widthS","widthM","widthL","widthXL","display","color","inverse","checked"],"mappings":"wWASA,MAAMA,OAAiF,CACrFC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHC,GAAI,IAYN,MAAMC,OAASC,OAAGA,IAGjB,CAAA,4DAEM,MAAMC,KAAOC,gBAAMC,QAACC,aAAOC,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAAdL,CAQnB,CAAA,qJAED,MAAMM,SAAWR,OAAGA,IAAA,CAAA,wDAAA,6BAGhBC,MAKG,MAAMQ,KAAOP,gBAAAA,QAAOQ,OAAOL,WAAqB,CACrDM,kBAAoBC,GAAS,CAAC,WAAY,UAAW,YAAa,QAAS,WAAWC,SAASD,KAC/FP,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAFkBL,CAElB,CAAA,wEAAA,qBAAA,oMAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,0CAAA,IAAA,eAAA,IAAA,KAIqBY,GAAUA,EAAMC,MAAMC,OAAOC,QAC7BH,GAAUA,EAAMC,MAAMC,OAAOE,YAY/CJ,GAAWA,EAAMK,KAAOC,mBAAQA,SAnDXN,IACpBA,EAAMO,QAAU,OAAe,cACxBP,EAAMO,OAAU,SAAiBP,EAAMO,MAE9CP,EAAMK,MAAQzB,OAAOoB,EAAMK,MAAczB,OAAOoB,EAAMK,MAEnD,OA6C6BG,CAAiBR,GAAQ,SAAW,OACrEA,GAAWA,EAAMS,OAASH,mBAAQA,SAACN,EAAMS,OAAQ,eAAiB,OAClET,GAAWA,EAAMS,OAASH,mBAAQA,SAACN,EAAMS,OAAQ,UAAY,OAC9D,EAAGC,WAAUC,UAASC,UAASC,UAASC,cACxCC,2CAAwB,CAAEC,MAAO,CAAEN,WAAUC,UAASC,UAASC,UAASC,YAAYG,YAAa,aAEhGjB,GAAWA,EAAMO,MAAQD,mBAAAA,SAASN,EAAMO,MAAO,SAAW,OACzD,EAAGW,UAASC,SAAQC,SAAQC,SAAQC,aACtCP,2CAAwB,CAAEC,MAAO,CAAEE,UAASC,SAAQC,SAAQC,SAAQC,WAAWL,YAAa,YAE3FjB,GAAWA,EAAMuB,QAAUA,QAAOA,QAACvB,EAAMuB,SAAW,OACpDvB,GAAWA,EAAMwB,MAAQA,MAAKA,MAACxB,EAAMwB,OAAS,OAM9CxB,GACAA,EAAMN,SAYH,KAXAR,OAAAA,uGAKMD,OACAE,MACS,EAAGc,WAAYA,EAAMC,OAAOC,UAM9CH,GAAWA,EAAMyB,SAAWzB,EAAM0B,QAAUzC,OAAS,MAGpDS,UAEDM,GAAWA,EAAMN,SAAWA,SAAW"}
@@ -1,2 +1,2 @@
1
- import styled,{css}from'styled-components';import{display}from'../../mixins/display.mjs';import{property,responsiveNamedProperty}from'../../mixins/responsive-property.mjs';import{color}from'../../mixins/color.mjs';import{Text as Text$1}from'../Text/Text.mjs';const WIDTHS={l:220,m:182,s:100,xs:60};const active=css(["border-color:transparent;background-color:currentColor;"]);const Text=styled(Text$1).withConfig({displayName:"Tag__Text",componentId:"ui__sc-3oi44j-0"})(["display:inline-block;vertical-align:middle;white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden;vertical-align:middle;transition:color 0.25s ease;"]);const disabled=css(["cursor:not-allowed;background-color:rgba(0,0,0,0.04);","{color:rgba(0,0,0,0.16);}"],Text);const Root=styled.button.withConfig({shouldForwardProp:e=>['children','htmlFor','className','style','onClick'].includes(e)}).withConfig({displayName:"Tag__Root",componentId:"ui__sc-3oi44j-1"})(["padding:0px 16px;margin-bottom:10px;border-radius:3px;background-color:",";border:1px solid ",";box-sizing:border-box;vertical-align:middle;transition:color 0.25s ease,background 0.25s ease,border-color 0.25s ease;cursor:pointer;text-align:center;touch-action:manipulation;min-width:60px;"," "," "," "," "," "," "," "," &:not(:last-child){margin-right:20px;}"," "," &:disabled{","}",""],(e=>e.theme.colors.white),(e=>e.theme.colors.whiteGray),(e=>e.size?property((e=>e.width==='auto'?'auto':typeof e.width=='number'?e.width:e.size&&WIDTHS[e.size]?WIDTHS[e.size]:'auto')(e),'width'):null),(e=>e.height?property(e.height,'line-height'):null),(e=>e.height?property(e.height,'height'):null),(({heightXS:e,heightS:o,heightM:i,heightL:t,heightXL:r})=>responsiveNamedProperty({sizes:{heightXS:e,heightS:o,heightM:i,heightL:t,heightXL:r},cssProperty:'height'})),(e=>e.width?property(e.width,'width'):null),(({widthXS:e,widthS:o,widthM:i,widthL:t,widthXL:r})=>responsiveNamedProperty({sizes:{widthXS:e,widthS:o,widthM:i,widthL:t,widthXL:r},cssProperty:'width'})),(e=>e.display?display(e.display):null),(e=>e.color?color(e.color):null),(e=>e.disabled?null:css(["&:hover:not(:disabled){border-color:currentColor;}&:active:not(:disabled){"," ","{color:",";}}"],active,Text,(e=>e.theme.colors.white))),(e=>e.inverse||e.checked?active:null),disabled,(e=>e.disabled?disabled:null));export{Root,Text};
1
+ import styled,{css}from'styled-components';import{display}from'../../mixins/display.mjs';import{property,responsiveNamedProperty}from'../../mixins/responsive-property.mjs';import{color}from'../../mixins/color.mjs';import{Text as Text$1}from'../Text/Text.mjs';const WIDTHS={l:220,m:182,s:100,xs:60};const active=css(["border-color:transparent;background-color:currentcolor;"]);const Text=styled(Text$1).withConfig({displayName:"Tag__Text",componentId:"ui__sc-3oi44j-0"})(["display:inline-block;white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden;vertical-align:middle;transition:color 0.25s ease;"]);const disabled=css(["cursor:not-allowed;background-color:rgba(0,0,0,0.04);","{color:rgba(0,0,0,0.16);}"],Text);const Root=styled.button.withConfig({shouldForwardProp:o=>['children','htmlFor','className','style','onClick'].includes(o)}).withConfig({displayName:"Tag__Root",componentId:"ui__sc-3oi44j-1"})(["padding:0 16px;margin-bottom:10px;border-radius:3px;background-color:",";border:1px solid ",";box-sizing:border-box;vertical-align:middle;transition:color 0.25s ease,background 0.25s ease,border-color 0.25s ease;cursor:pointer;text-align:center;touch-action:manipulation;min-width:60px;"," "," "," "," "," "," "," "," &:not(:last-child){margin-right:20px;}"," "," &:disabled{","}",""],(o=>o.theme.colors.white),(o=>o.theme.colors.whiteGray),(o=>o.size?property((o=>o.width==='auto'?'auto':typeof o.width=='number'?o.width:o.size&&WIDTHS[o.size]?WIDTHS[o.size]:'auto')(o),'width'):null),(o=>o.height?property(o.height,'line-height'):null),(o=>o.height?property(o.height,'height'):null),(({heightXS:o,heightS:e,heightM:t,heightL:i,heightXL:r})=>responsiveNamedProperty({sizes:{heightXS:o,heightS:e,heightM:t,heightL:i,heightXL:r},cssProperty:'height'})),(o=>o.width?property(o.width,'width'):null),(({widthXS:o,widthS:e,widthM:t,widthL:i,widthXL:r})=>responsiveNamedProperty({sizes:{widthXS:o,widthS:e,widthM:t,widthL:i,widthXL:r},cssProperty:'width'})),(o=>o.display?display(o.display):null),(o=>o.color?color(o.color):null),(o=>o.disabled?null:css(["&:hover:not(:disabled){border-color:currentcolor;}&:active:not(:disabled){"," ","{color:",";}}"],active,Text,(({theme:o})=>o.colors.white))),(o=>o.inverse||o.checked?active:null),disabled,(o=>o.disabled?disabled:null));export{Root,Text};
2
2
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/Tag/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { display } from 'mixins/display'\nimport { property, PossibleValues, responsiveNamedProperty } from 'mixins/responsive-property'\nimport { color } from 'mixins/color'\nimport { Text as UiText } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport { TagProps } from './Tag'\n\nconst WIDTHS: Record<Partial<Exclude<TagProps['size'], 'auto' | undefined>>, number> = {\n l: 220,\n m: 182,\n s: 100,\n xs: 60,\n}\n\nconst chooseWidthValue = (props: TagProps): PossibleValues => {\n if (props.width === 'auto') return 'auto'\n if (typeof props.width === 'number') return props.width\n\n if (props.size && WIDTHS[props.size]) return WIDTHS[props.size]\n\n return 'auto'\n}\n\nconst active = css`\n border-color: transparent;\n background-color: currentColor;\n`\n\nexport const Text = styled(UiText)<TextProps>`\n display: inline-block;\n vertical-align: middle;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 100%;\n overflow: hidden;\n vertical-align: middle;\n transition: color 0.25s ease;\n`\n\nconst disabled = css`\n cursor: not-allowed;\n background-color: rgba(0, 0, 0, 0.04);\n ${Text} {\n color: rgba(0, 0, 0, 0.16);\n }\n`\n\nexport const Root = styled.button.withConfig<TagProps>({\n shouldForwardProp: (prop) => ['children', 'htmlFor', 'className', 'style', 'onClick'].includes(prop),\n})`\n padding: 0px 16px;\n margin-bottom: 10px;\n border-radius: 3px;\n background-color: ${(props) => props.theme.colors.white};\n border: 1px solid ${(props) => props.theme.colors.whiteGray};\n box-sizing: border-box;\n vertical-align: middle;\n transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;\n cursor: pointer;\n text-align: center;\n touch-action: manipulation;\n min-width: 60px;\n\n ${(props) => (props.size ? property(chooseWidthValue(props), 'width') : null)}\n ${(props) => (props.height ? property(props.height, 'line-height') : null)}\n ${(props) => (props.height ? property(props.height, 'height') : null)}\n ${({ heightXS, heightS, heightM, heightL, heightXL }) =>\n responsiveNamedProperty({ sizes: { heightXS, heightS, heightM, heightL, heightXL }, cssProperty: 'height' })}\n\n ${(props) => (props.width ? property(props.width, 'width') : null)}\n ${({ widthXS, widthS, widthM, widthL, widthXL }) =>\n responsiveNamedProperty({ sizes: { widthXS, widthS, widthM, widthL, widthXL }, cssProperty: 'width' })}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n\n &:not(:last-child) {\n margin-right: 20px;\n }\n\n ${(props) =>\n !props.disabled\n ? css`\n &:hover:not(:disabled) {\n border-color: currentColor;\n }\n &:active:not(:disabled) {\n ${active}\n ${Text} {\n color: ${(props) => props.theme.colors.white};\n }\n }\n `\n : null}\n\n ${(props) => (props.inverse || props.checked ? active : null)}\n\n &:disabled {\n ${disabled}\n }\n ${(props) => (props.disabled ? disabled : null)}\n`\n"],"names":["WIDTHS","l","m","s","xs","active","css","Text","styled","UiText","withConfig","displayName","componentId","disabled","Root","button","shouldForwardProp","prop","includes","props","theme","colors","white","whiteGray","size","property","width","chooseWidthValue","height","heightXS","heightS","heightM","heightL","heightXL","responsiveNamedProperty","sizes","cssProperty","widthXS","widthS","widthM","widthL","widthXL","display","color","inverse","checked"],"mappings":"mQAQA,MAAMA,OAAiF,CACrFC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHC,GAAI,IAYN,MAAMC,OAASC,IAGd,CAAA,4DAEM,MAAMC,KAAOC,OAAOC,QAAOC,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAAdJ,CASnB,CAAA,2KAED,MAAMK,SAAWP,IAAG,CAAA,wDAAA,6BAGhBC,MAKG,MAAMO,KAAON,OAAOO,OAAOL,WAAqB,CACrDM,kBAAoBC,GAAS,CAAC,WAAY,UAAW,YAAa,QAAS,WAAWC,SAASD,KAC/FP,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAFkBJ,CAElB,CAAA,0EAAA,qBAAA,oMAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,0CAAA,IAAA,eAAA,IAAA,KAIqBW,GAAUA,EAAMC,MAAMC,OAAOC,QAC7BH,GAAUA,EAAMC,MAAMC,OAAOE,YAS/CJ,GAAWA,EAAMK,KAAOC,SAjDHN,IACpBA,EAAMO,QAAU,OAAe,cACxBP,EAAMO,OAAU,SAAiBP,EAAMO,MAE9CP,EAAMK,MAAQxB,OAAOmB,EAAMK,MAAcxB,OAAOmB,EAAMK,MAEnD,OA2C6BG,CAAiBR,GAAQ,SAAW,OACrEA,GAAWA,EAAMS,OAASH,SAASN,EAAMS,OAAQ,eAAiB,OAClET,GAAWA,EAAMS,OAASH,SAASN,EAAMS,OAAQ,UAAY,OAC9D,EAAGC,WAAUC,UAASC,UAASC,UAASC,cACxCC,wBAAwB,CAAEC,MAAO,CAAEN,WAAUC,UAASC,UAASC,UAASC,YAAYG,YAAa,aAEhGjB,GAAWA,EAAMO,MAAQD,SAASN,EAAMO,MAAO,SAAW,OACzD,EAAGW,UAASC,SAAQC,SAAQC,SAAQC,aACtCP,wBAAwB,CAAEC,MAAO,CAAEE,UAASC,SAAQC,SAAQC,SAAQC,WAAWL,YAAa,YAE3FjB,GAAWA,EAAMuB,QAAUA,QAAQvB,EAAMuB,SAAW,OACpDvB,GAAWA,EAAMwB,MAAQA,MAAMxB,EAAMwB,OAAS,OAM9CxB,GACAA,EAAMN,SAYH,KAXAP,IAAG,CAAA,6EAAA,IAAA,UAAA,OAKGD,OACAE,MACUY,GAAUA,EAAMC,MAAMC,OAAOC,UAMhDH,GAAWA,EAAMyB,SAAWzB,EAAM0B,QAAUxC,OAAS,MAGpDQ,UAEDM,GAAWA,EAAMN,SAAWA,SAAW"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/Tag/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { display } from 'mixins/display'\nimport { property, responsiveNamedProperty } from 'mixins/responsive-property'\nimport type { PossibleValues } from 'mixins/responsive-property'\nimport { color } from 'mixins/color'\nimport { Text as UiText } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport type { TagProps } from './Tag'\n\nconst WIDTHS: Record<Partial<Exclude<TagProps['size'], 'auto' | undefined>>, number> = {\n l: 220,\n m: 182,\n s: 100,\n xs: 60,\n}\n\nconst chooseWidthValue = (props: TagProps): PossibleValues => {\n if (props.width === 'auto') return 'auto'\n if (typeof props.width === 'number') return props.width\n\n if (props.size && WIDTHS[props.size]) return WIDTHS[props.size]\n\n return 'auto'\n}\n\nconst active = css`\n border-color: transparent;\n background-color: currentcolor;\n`\n\nexport const Text = styled(UiText)<TextProps>`\n display: inline-block;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 100%;\n overflow: hidden;\n vertical-align: middle;\n transition: color 0.25s ease;\n`\n\nconst disabled = css`\n cursor: not-allowed;\n background-color: rgba(0, 0, 0, 0.04);\n ${Text} {\n color: rgba(0, 0, 0, 0.16);\n }\n`\n\nexport const Root = styled.button.withConfig<TagProps>({\n shouldForwardProp: (prop) => ['children', 'htmlFor', 'className', 'style', 'onClick'].includes(prop),\n})`\n padding: 0 16px;\n margin-bottom: 10px;\n border-radius: 3px;\n background-color: ${(props) => props.theme.colors.white};\n border: 1px solid ${(props) => props.theme.colors.whiteGray};\n box-sizing: border-box;\n vertical-align: middle;\n transition:\n color 0.25s ease,\n background 0.25s ease,\n border-color 0.25s ease;\n cursor: pointer;\n text-align: center;\n touch-action: manipulation;\n min-width: 60px;\n\n ${(props) => (props.size ? property(chooseWidthValue(props), 'width') : null)}\n ${(props) => (props.height ? property(props.height, 'line-height') : null)}\n ${(props) => (props.height ? property(props.height, 'height') : null)}\n ${({ heightXS, heightS, heightM, heightL, heightXL }) =>\n responsiveNamedProperty({ sizes: { heightXS, heightS, heightM, heightL, heightXL }, cssProperty: 'height' })}\n\n ${(props) => (props.width ? property(props.width, 'width') : null)}\n ${({ widthXS, widthS, widthM, widthL, widthXL }) =>\n responsiveNamedProperty({ sizes: { widthXS, widthS, widthM, widthL, widthXL }, cssProperty: 'width' })}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : null)}\n\n &:not(:last-child) {\n margin-right: 20px;\n }\n\n ${(props) =>\n !props.disabled\n ? css`\n &:hover:not(:disabled) {\n border-color: currentcolor;\n }\n &:active:not(:disabled) {\n ${active}\n ${Text} {\n color: ${({ theme }) => theme.colors.white};\n }\n }\n `\n : null}\n\n ${(props) => (props.inverse || props.checked ? active : null)}\n\n &:disabled {\n ${disabled}\n }\n ${(props) => (props.disabled ? disabled : null)}\n`\n"],"names":["WIDTHS","l","m","s","xs","active","css","Text","styled","UiText","withConfig","displayName","componentId","disabled","Root","button","shouldForwardProp","prop","includes","props","theme","colors","white","whiteGray","size","property","width","chooseWidthValue","height","heightXS","heightS","heightM","heightL","heightXL","responsiveNamedProperty","sizes","cssProperty","widthXS","widthS","widthM","widthL","widthXL","display","color","inverse","checked"],"mappings":"mQASA,MAAMA,OAAiF,CACrFC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHC,GAAI,IAYN,MAAMC,OAASC,IAGd,CAAA,4DAEM,MAAMC,KAAOC,OAAOC,QAAOC,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAAdJ,CAQnB,CAAA,qJAED,MAAMK,SAAWP,IAAG,CAAA,wDAAA,6BAGhBC,MAKG,MAAMO,KAAON,OAAOO,OAAOL,WAAqB,CACrDM,kBAAoBC,GAAS,CAAC,WAAY,UAAW,YAAa,QAAS,WAAWC,SAASD,KAC/FP,WAAA,CAAAC,YAAA,YAAAC,YAAA,mBAFkBJ,CAElB,CAAA,wEAAA,qBAAA,oMAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,0CAAA,IAAA,eAAA,IAAA,KAIqBW,GAAUA,EAAMC,MAAMC,OAAOC,QAC7BH,GAAUA,EAAMC,MAAMC,OAAOE,YAY/CJ,GAAWA,EAAMK,KAAOC,SAnDHN,IACpBA,EAAMO,QAAU,OAAe,cACxBP,EAAMO,OAAU,SAAiBP,EAAMO,MAE9CP,EAAMK,MAAQxB,OAAOmB,EAAMK,MAAcxB,OAAOmB,EAAMK,MAEnD,OA6C6BG,CAAiBR,GAAQ,SAAW,OACrEA,GAAWA,EAAMS,OAASH,SAASN,EAAMS,OAAQ,eAAiB,OAClET,GAAWA,EAAMS,OAASH,SAASN,EAAMS,OAAQ,UAAY,OAC9D,EAAGC,WAAUC,UAASC,UAASC,UAASC,cACxCC,wBAAwB,CAAEC,MAAO,CAAEN,WAAUC,UAASC,UAASC,UAASC,YAAYG,YAAa,aAEhGjB,GAAWA,EAAMO,MAAQD,SAASN,EAAMO,MAAO,SAAW,OACzD,EAAGW,UAASC,SAAQC,SAAQC,SAAQC,aACtCP,wBAAwB,CAAEC,MAAO,CAAEE,UAASC,SAAQC,SAAQC,SAAQC,WAAWL,YAAa,YAE3FjB,GAAWA,EAAMuB,QAAUA,QAAQvB,EAAMuB,SAAW,OACpDvB,GAAWA,EAAMwB,MAAQA,MAAMxB,EAAMwB,OAAS,OAM9CxB,GACAA,EAAMN,SAYH,KAXAP,uGAKMD,OACAE,MACS,EAAGa,WAAYA,EAAMC,OAAOC,UAM9CH,GAAWA,EAAMyB,SAAWzB,EAAM0B,QAAUxC,OAAS,MAGpDQ,UAEDM,GAAWA,EAAMN,SAAWA,SAAW"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var useMergedPalette=require('../../hooks/useMergedPalette.js');var useResizeObserver=require('../../hooks/useResizeObserver.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');exports.Ellipsis=e=>{const{lines:t=1,defaultExpanded:s=!1,expandable:n=!1,expandButtonProps:r={},children:i,expanded:l,underline:u,onExpandedChange:a}=e;const{captionExpanded:c="Свернуть",captionCollapsed:o="Развернуть",...d}=r;const x=React.useRef(null);const R=React.useRef(null);const h=useMergedPalette.useMergedPalette(d);const[p,g]=React.useState(null);const[j,v]=React.useState(l??s);const f=React.useCallback((e=>{if(R.current)if(j){const s=Math.round(e.clientHeight/R.current.clientHeight);g(s>t)}else{const t=Math.round(e.scrollHeight/R.current.clientHeight);const s=Math.round(e.clientHeight/R.current.clientHeight);g(t>s)}}),[t,j]);return useResizeObserver.useResizeObserver({enabled:n,target:x,onResize:f}),React.useLayoutEffect((()=>{l!==void 0&&(v(l),a&&a(l))}),[l,a]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(style.TextEllipsis,{ref:x,lines:t,expanded:j,underline:u,children:[n&&jsxRuntime.jsx(style.LineHeight,{ref:R,children:" "}),i]}),n&&p===!0&&jsxRuntime.jsx(style.ExpandButton,{...d,type:"button",palette:h,onClick:e=>{if(d.onClick&&d.onClick(e),l===void 0){const e=!j;v(e),a&&a(e)}},children:j?c:o})]})};
1
+ 'use strict';var React=require('react');var useMergedPalette=require('../../hooks/useMergedPalette.js');var useResizeObserver=require('../../hooks/useResizeObserver.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');exports.Ellipsis=e=>{const{lines:t=1,defaultExpanded:s=!1,expandable:n=!1,expandButtonProps:r={},children:i,expanded:l,underline:u,onExpandedChange:a}=e;const{captionExpanded:c="Свернуть",captionCollapsed:o="Развернуть",...d}=r;const x=React.useRef(null);const R=React.useRef(null);const h=useMergedPalette.useMergedPalette(d);const[p,g]=React.useState(null);const[j,v]=React.useState(l??s);const f=React.useCallback((e=>{if(R.current)if(j){const s=Math.round(e.clientHeight/R.current.clientHeight);g(s>t)}else{const t=Math.round(e.scrollHeight/R.current.clientHeight);const s=Math.round(e.clientHeight/R.current.clientHeight);g(t>s)}}),[t,j]);return useResizeObserver.useResizeObserver({enabled:n,target:x,onResize:f}),React.useLayoutEffect((()=>{l!==void 0&&(v(l),a&&a(l))}),[l,a]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(style.TextEllipsis,{ref:x,lines:t,expanded:j,underline:u,children:[n?jsxRuntime.jsx(style.LineHeight,{ref:R,children:" "}):null,i]}),n&&p===!0?jsxRuntime.jsx(style.ExpandButton,{...d,type:"button",palette:h,onClick:e=>{if(d.onClick&&d.onClick(e),l===void 0){const e=!j;v(e),a&&a(e)}},children:j?c:o}):null]})};
2
2
  //# sourceMappingURL=Ellipsis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ellipsis.js","sources":["../../../../src/components/Text/Ellipsis.tsx"],"sourcesContent":["import { useState, useLayoutEffect, useRef, useCallback } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { useResizeObserver } from 'hooks/useResizeObserver'\nimport type { Nullable } from 'shared/types'\nimport type { EllipsisProps, ExpandButtonProps } from './types'\nimport * as Styled from './style'\n\nconst Ellipsis = (props: EllipsisProps) => {\n const {\n lines = 1,\n defaultExpanded = false,\n expandable = false,\n expandButtonProps = {} as ExpandButtonProps,\n children,\n expanded,\n underline,\n onExpandedChange,\n } = props\n\n const { captionExpanded = 'Свернуть', captionCollapsed = 'Развернуть', ...restExpandButtonProps } = expandButtonProps\n\n const textRef = useRef<HTMLSpanElement>(null)\n const lineHeightRef = useRef<HTMLSpanElement>(null)\n\n const expandButtonPalette = useMergedPalette(restExpandButtonProps)\n\n const [expandButtonVisible, setExpandButtonVisible] = useState<Nullable<boolean>>(null)\n const [textExpanded, setTextExpanded] = useState<boolean>(expanded ?? defaultExpanded)\n\n const handleExpandButtonVisibility = useCallback(\n (e: HTMLSpanElement) => {\n if (!lineHeightRef.current) return\n\n if (textExpanded) {\n const linesTotalCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > lines)\n } else {\n const linesTotalCount = Math.round(e.scrollHeight / lineHeightRef.current.clientHeight)\n const linesVisibleCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > linesVisibleCount)\n }\n },\n [lines, textExpanded]\n )\n\n useResizeObserver({\n enabled: expandable,\n target: textRef,\n onResize: handleExpandButtonVisibility,\n })\n\n useLayoutEffect(() => {\n if (expanded !== undefined) {\n setTextExpanded(expanded)\n if (onExpandedChange) onExpandedChange(expanded)\n }\n }, [expanded, onExpandedChange])\n\n return (\n <>\n <Styled.TextEllipsis ref={textRef} lines={lines} expanded={textExpanded} underline={underline}>\n {expandable && <Styled.LineHeight ref={lineHeightRef}>&nbsp;</Styled.LineHeight>}\n {children}\n </Styled.TextEllipsis>\n {expandable && expandButtonVisible === true && (\n <Styled.ExpandButton\n {...restExpandButtonProps}\n type='button'\n palette={expandButtonPalette}\n onClick={(evt) => {\n if (restExpandButtonProps.onClick) restExpandButtonProps.onClick(evt)\n\n if (expanded === undefined) {\n const update = !textExpanded\n\n setTextExpanded(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n }}\n >\n {textExpanded ? captionExpanded : captionCollapsed}\n </Styled.ExpandButton>\n )}\n </>\n )\n}\n\nexport { Ellipsis }\n"],"names":["props","lines","defaultExpanded","expandable","expandButtonProps","children","expanded","underline","onExpandedChange","captionExpanded","captionCollapsed","restExpandButtonProps","textRef","useRef","lineHeightRef","expandButtonPalette","useMergedPalette","expandButtonVisible","setExpandButtonVisible","useState","textExpanded","setTextExpanded","handleExpandButtonVisibility","useCallback","e","current","linesTotalCount","Math","round","clientHeight","scrollHeight","linesVisibleCount","useResizeObserver","enabled","target","onResize","useLayoutEffect","undefined","_jsxs","_Fragment","jsxs","Styled","ref","_jsx","jsx","type","palette","onClick","evt","update"],"mappings":"uQAOkBA,IAChB,MAAMC,MACJA,EAAQ,EAACC,gBACTA,GAAkB,EAAKC,WACvBA,GAAa,EAAKC,kBAClBA,EAAoB,CAAuB,EAAAC,SAC3CA,EAAQC,SACRA,EAAQC,UACRA,EAASC,iBACTA,GACER,EAEJ,MAAMS,gBAAEA,EAAkB,WAAUC,iBAAEA,EAAmB,gBAAiBC,GAA0BP,EAEpG,MAAMQ,EAAUC,aAAwB,MACxC,MAAMC,EAAgBD,aAAwB,MAE9C,MAAME,EAAsBC,kCAAiBL,GAE7C,MAAOM,EAAqBC,GAA0BC,MAAQA,SAAoB,MAClF,MAAOC,EAAcC,GAAmBF,MAAAA,SAAkBb,GAAYJ,GAEtE,MAAMoB,EAA+BC,MAAWA,aAC7CC,IACC,GAAKV,EAAcW,QAEnB,GAAIL,EAAc,CAChB,MAAMM,EAAkBC,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE1EX,EAAuBQ,EAAkBzB,EAC3C,KAAO,CACL,MAAMyB,EAAkBC,KAAKC,MAAMJ,EAAEM,aAAehB,EAAcW,QAAQI,cAC1E,MAAME,EAAoBJ,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE5EX,EAAuBQ,EAAkBK,EAC3C,IAEF,CAAC9B,EAAOmB,IAgBV,OAbAY,oCAAkB,CAChBC,QAAS9B,EACT+B,OAAQtB,EACRuB,SAAUb,IAGZc,MAAAA,iBAAgB,KACV9B,SAAa+B,IACfhB,EAAgBf,GACZE,GAAkBA,EAAiBF,GACzC,GACC,CAACA,EAAUE,IAGZ8B,WAAAA,KAAAC,WAAAA,SAAA,CAAAlC,SACEiC,CAAAA,WAAAE,KAACC,mBAAmB,CAACC,IAAK9B,EAASX,MAAOA,EAAOK,SAAUc,EAAcb,UAAWA,EAAUF,UAC3FF,GAAcwC,WAAAC,IAACH,iBAAiB,CAACC,IAAK5B,EAAcT,SAAC,MACrDA,KAEFF,GAAcc,KAAwB,GACrC0B,WAAAA,IAACF,MAAAA,aAAmB,IACd9B,EACJkC,KAAK,SACLC,QAAS/B,EACTgC,QAAUC,IAGR,GAFIrC,EAAsBoC,SAASpC,EAAsBoC,QAAQC,GAE7D1C,SAAa+B,EAAW,CAC1B,MAAMY,GAAU7B,EAEhBC,EAAgB4B,GACZzC,GAAkBA,EAAiByC,EACzC,GACA5C,SAEDe,EAAeX,EAAkBC,MAGrC"}
1
+ {"version":3,"file":"Ellipsis.js","sources":["../../../../src/components/Text/Ellipsis.tsx"],"sourcesContent":["import { useState, useLayoutEffect, useRef, useCallback } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { useResizeObserver } from 'hooks/useResizeObserver'\nimport type { Nullable } from 'shared/types'\nimport type { EllipsisProps, ExpandButtonProps } from './types'\nimport * as Styled from './style'\n\nconst Ellipsis = (props: EllipsisProps) => {\n const {\n lines = 1,\n defaultExpanded = false,\n expandable = false,\n expandButtonProps = {} as ExpandButtonProps,\n children,\n expanded,\n underline,\n onExpandedChange,\n } = props\n\n const { captionExpanded = 'Свернуть', captionCollapsed = 'Развернуть', ...restExpandButtonProps } = expandButtonProps\n\n const textRef = useRef<HTMLSpanElement>(null)\n const lineHeightRef = useRef<HTMLSpanElement>(null)\n\n const expandButtonPalette = useMergedPalette(restExpandButtonProps)\n\n const [expandButtonVisible, setExpandButtonVisible] = useState<Nullable<boolean>>(null)\n const [textExpanded, setTextExpanded] = useState<boolean>(expanded ?? defaultExpanded)\n\n const handleExpandButtonVisibility = useCallback(\n (e: HTMLSpanElement) => {\n if (!lineHeightRef.current) return\n\n if (textExpanded) {\n const linesTotalCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > lines)\n } else {\n const linesTotalCount = Math.round(e.scrollHeight / lineHeightRef.current.clientHeight)\n const linesVisibleCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > linesVisibleCount)\n }\n },\n [lines, textExpanded]\n )\n\n useResizeObserver({\n enabled: expandable,\n target: textRef,\n onResize: handleExpandButtonVisibility,\n })\n\n useLayoutEffect(() => {\n if (expanded !== undefined) {\n setTextExpanded(expanded)\n if (onExpandedChange) onExpandedChange(expanded)\n }\n }, [expanded, onExpandedChange])\n\n return (\n <>\n <Styled.TextEllipsis ref={textRef} lines={lines} expanded={textExpanded} underline={underline}>\n {expandable ? <Styled.LineHeight ref={lineHeightRef}>&nbsp;</Styled.LineHeight> : null}\n {children}\n </Styled.TextEllipsis>\n {expandable && expandButtonVisible === true ? (\n <Styled.ExpandButton\n {...restExpandButtonProps}\n type='button'\n palette={expandButtonPalette}\n onClick={(evt) => {\n if (restExpandButtonProps.onClick) restExpandButtonProps.onClick(evt)\n\n if (expanded === undefined) {\n const update = !textExpanded\n\n setTextExpanded(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n }}\n >\n {textExpanded ? captionExpanded : captionCollapsed}\n </Styled.ExpandButton>\n ) : null}\n </>\n )\n}\n\nexport { Ellipsis }\n"],"names":["props","lines","defaultExpanded","expandable","expandButtonProps","children","expanded","underline","onExpandedChange","captionExpanded","captionCollapsed","restExpandButtonProps","textRef","useRef","lineHeightRef","expandButtonPalette","useMergedPalette","expandButtonVisible","setExpandButtonVisible","useState","textExpanded","setTextExpanded","handleExpandButtonVisibility","useCallback","e","current","linesTotalCount","Math","round","clientHeight","scrollHeight","linesVisibleCount","useResizeObserver","enabled","target","onResize","useLayoutEffect","undefined","_jsxs","_Fragment","jsxs","Styled","ref","_jsx","jsx","type","palette","onClick","evt","update"],"mappings":"uQAOkBA,IAChB,MAAMC,MACJA,EAAQ,EAACC,gBACTA,GAAkB,EAAKC,WACvBA,GAAa,EAAKC,kBAClBA,EAAoB,CAAuB,EAAAC,SAC3CA,EAAQC,SACRA,EAAQC,UACRA,EAASC,iBACTA,GACER,EAEJ,MAAMS,gBAAEA,EAAkB,WAAUC,iBAAEA,EAAmB,gBAAiBC,GAA0BP,EAEpG,MAAMQ,EAAUC,aAAwB,MACxC,MAAMC,EAAgBD,aAAwB,MAE9C,MAAME,EAAsBC,kCAAiBL,GAE7C,MAAOM,EAAqBC,GAA0BC,MAAQA,SAAoB,MAClF,MAAOC,EAAcC,GAAmBF,MAAAA,SAAkBb,GAAYJ,GAEtE,MAAMoB,EAA+BC,MAAWA,aAC7CC,IACC,GAAKV,EAAcW,QAEnB,GAAIL,EAAc,CAChB,MAAMM,EAAkBC,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE1EX,EAAuBQ,EAAkBzB,EAC3C,KAAO,CACL,MAAMyB,EAAkBC,KAAKC,MAAMJ,EAAEM,aAAehB,EAAcW,QAAQI,cAC1E,MAAME,EAAoBJ,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE5EX,EAAuBQ,EAAkBK,EAC3C,IAEF,CAAC9B,EAAOmB,IAgBV,OAbAY,oCAAkB,CAChBC,QAAS9B,EACT+B,OAAQtB,EACRuB,SAAUb,IAGZc,MAAAA,iBAAgB,KACV9B,SAAa+B,IACfhB,EAAgBf,GACZE,GAAkBA,EAAiBF,GACzC,GACC,CAACA,EAAUE,IAGZ8B,WAAAA,KAAAC,WAAAA,SAAA,CAAAlC,SACEiC,CAAAA,WAAAE,KAACC,mBAAmB,CAACC,IAAK9B,EAASX,MAAOA,EAAOK,SAAUc,EAAcb,UAAWA,EAAUF,UAC3FF,EAAawC,WAAAC,IAACH,iBAAiB,CAACC,IAAK5B,EAAcT,SAAC,MAA6B,KACjFA,KAEFF,GAAcc,KAAwB,EACrC0B,WAAAA,IAACF,MAAAA,aAAmB,IACd9B,EACJkC,KAAK,SACLC,QAAS/B,EACTgC,QAAUC,IAGR,GAFIrC,EAAsBoC,SAASpC,EAAsBoC,QAAQC,GAE7D1C,SAAa+B,EAAW,CAC1B,MAAMY,GAAU7B,EAEhBC,EAAgB4B,GACZzC,GAAkBA,EAAiByC,EACzC,GACA5C,SAEDe,EAAeX,EAAkBC,IAElC,OACH"}
@@ -1,2 +1,2 @@
1
- import{useRef,useState,useCallback,useLayoutEffect}from'react';import{useMergedPalette}from'../../hooks/useMergedPalette.mjs';import{useResizeObserver}from'../../hooks/useResizeObserver.mjs';import{TextEllipsis,LineHeight,ExpandButton}from'./style.mjs';import{jsxs,Fragment,jsx}from'react/jsx-runtime';const Ellipsis=e=>{const{lines:t=1,defaultExpanded:n=!1,expandable:s=!1,expandButtonProps:i={},children:r,expanded:o,underline:l,onExpandedChange:c}=e;const{captionExpanded:a="Свернуть",captionCollapsed:u="Развернуть",...d}=i;const p=useRef(null);const h=useRef(null);const x=useMergedPalette(d);const[f,m]=useState(null);const[g,E]=useState(o??n);const j=useCallback((e=>{if(h.current)if(g){const n=Math.round(e.clientHeight/h.current.clientHeight);m(n>t)}else{const t=Math.round(e.scrollHeight/h.current.clientHeight);const n=Math.round(e.clientHeight/h.current.clientHeight);m(t>n)}}),[t,g]);return useResizeObserver({enabled:s,target:p,onResize:j}),useLayoutEffect((()=>{o!==void 0&&(E(o),c&&c(o))}),[o,c]),jsxs(Fragment,{children:[jsxs(TextEllipsis,{ref:p,lines:t,expanded:g,underline:l,children:[s&&jsx(LineHeight,{ref:h,children:" "}),r]}),s&&f===!0&&jsx(ExpandButton,{...d,type:"button",palette:x,onClick:e=>{if(d.onClick&&d.onClick(e),o===void 0){const e=!g;E(e),c&&c(e)}},children:g?a:u})]})};export{Ellipsis};
1
+ import{useRef,useState,useCallback,useLayoutEffect}from'react';import{useMergedPalette}from'../../hooks/useMergedPalette.mjs';import{useResizeObserver}from'../../hooks/useResizeObserver.mjs';import{TextEllipsis,LineHeight,ExpandButton}from'./style.mjs';import{jsxs,Fragment,jsx}from'react/jsx-runtime';const Ellipsis=e=>{const{lines:t=1,defaultExpanded:n=!1,expandable:s=!1,expandButtonProps:i={},children:l,expanded:r,underline:o,onExpandedChange:c}=e;const{captionExpanded:u="Свернуть",captionCollapsed:a="Развернуть",...d}=i;const p=useRef(null);const h=useRef(null);const x=useMergedPalette(d);const[f,m]=useState(null);const[g,E]=useState(r??n);const j=useCallback((e=>{if(h.current)if(g){const n=Math.round(e.clientHeight/h.current.clientHeight);m(n>t)}else{const t=Math.round(e.scrollHeight/h.current.clientHeight);const n=Math.round(e.clientHeight/h.current.clientHeight);m(t>n)}}),[t,g]);return useResizeObserver({enabled:s,target:p,onResize:j}),useLayoutEffect((()=>{r!==void 0&&(E(r),c&&c(r))}),[r,c]),jsxs(Fragment,{children:[jsxs(TextEllipsis,{ref:p,lines:t,expanded:g,underline:o,children:[s?jsx(LineHeight,{ref:h,children:" "}):null,l]}),s&&f===!0?jsx(ExpandButton,{...d,type:"button",palette:x,onClick:e=>{if(d.onClick&&d.onClick(e),r===void 0){const e=!g;E(e),c&&c(e)}},children:g?u:a}):null]})};export{Ellipsis};
2
2
  //# sourceMappingURL=Ellipsis.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ellipsis.mjs","sources":["../../../../src/components/Text/Ellipsis.tsx"],"sourcesContent":["import { useState, useLayoutEffect, useRef, useCallback } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { useResizeObserver } from 'hooks/useResizeObserver'\nimport type { Nullable } from 'shared/types'\nimport type { EllipsisProps, ExpandButtonProps } from './types'\nimport * as Styled from './style'\n\nconst Ellipsis = (props: EllipsisProps) => {\n const {\n lines = 1,\n defaultExpanded = false,\n expandable = false,\n expandButtonProps = {} as ExpandButtonProps,\n children,\n expanded,\n underline,\n onExpandedChange,\n } = props\n\n const { captionExpanded = 'Свернуть', captionCollapsed = 'Развернуть', ...restExpandButtonProps } = expandButtonProps\n\n const textRef = useRef<HTMLSpanElement>(null)\n const lineHeightRef = useRef<HTMLSpanElement>(null)\n\n const expandButtonPalette = useMergedPalette(restExpandButtonProps)\n\n const [expandButtonVisible, setExpandButtonVisible] = useState<Nullable<boolean>>(null)\n const [textExpanded, setTextExpanded] = useState<boolean>(expanded ?? defaultExpanded)\n\n const handleExpandButtonVisibility = useCallback(\n (e: HTMLSpanElement) => {\n if (!lineHeightRef.current) return\n\n if (textExpanded) {\n const linesTotalCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > lines)\n } else {\n const linesTotalCount = Math.round(e.scrollHeight / lineHeightRef.current.clientHeight)\n const linesVisibleCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > linesVisibleCount)\n }\n },\n [lines, textExpanded]\n )\n\n useResizeObserver({\n enabled: expandable,\n target: textRef,\n onResize: handleExpandButtonVisibility,\n })\n\n useLayoutEffect(() => {\n if (expanded !== undefined) {\n setTextExpanded(expanded)\n if (onExpandedChange) onExpandedChange(expanded)\n }\n }, [expanded, onExpandedChange])\n\n return (\n <>\n <Styled.TextEllipsis ref={textRef} lines={lines} expanded={textExpanded} underline={underline}>\n {expandable && <Styled.LineHeight ref={lineHeightRef}>&nbsp;</Styled.LineHeight>}\n {children}\n </Styled.TextEllipsis>\n {expandable && expandButtonVisible === true && (\n <Styled.ExpandButton\n {...restExpandButtonProps}\n type='button'\n palette={expandButtonPalette}\n onClick={(evt) => {\n if (restExpandButtonProps.onClick) restExpandButtonProps.onClick(evt)\n\n if (expanded === undefined) {\n const update = !textExpanded\n\n setTextExpanded(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n }}\n >\n {textExpanded ? captionExpanded : captionCollapsed}\n </Styled.ExpandButton>\n )}\n </>\n )\n}\n\nexport { Ellipsis }\n"],"names":["Ellipsis","props","lines","defaultExpanded","expandable","expandButtonProps","children","expanded","underline","onExpandedChange","captionExpanded","captionCollapsed","restExpandButtonProps","textRef","useRef","lineHeightRef","expandButtonPalette","useMergedPalette","expandButtonVisible","setExpandButtonVisible","useState","textExpanded","setTextExpanded","handleExpandButtonVisibility","useCallback","e","current","linesTotalCount","Math","round","clientHeight","scrollHeight","linesVisibleCount","useResizeObserver","enabled","target","onResize","useLayoutEffect","undefined","_jsxs","_Fragment","Styled","ref","_jsx","type","palette","onClick","evt","update"],"mappings":"8SAOMA,MAAAA,SAAYC,IAChB,MAAMC,MACJA,EAAQ,EAACC,gBACTA,GAAkB,EAAKC,WACvBA,GAAa,EAAKC,kBAClBA,EAAoB,CAAuB,EAAAC,SAC3CA,EAAQC,SACRA,EAAQC,UACRA,EAASC,iBACTA,GACER,EAEJ,MAAMS,gBAAEA,EAAkB,WAAUC,iBAAEA,EAAmB,gBAAiBC,GAA0BP,EAEpG,MAAMQ,EAAUC,OAAwB,MACxC,MAAMC,EAAgBD,OAAwB,MAE9C,MAAME,EAAsBC,iBAAiBL,GAE7C,MAAOM,EAAqBC,GAA0BC,SAA4B,MAClF,MAAOC,EAAcC,GAAmBF,SAAkBb,GAAYJ,GAEtE,MAAMoB,EAA+BC,aAClCC,IACC,GAAKV,EAAcW,QAEnB,GAAIL,EAAc,CAChB,MAAMM,EAAkBC,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE1EX,EAAuBQ,EAAkBzB,EAC3C,KAAO,CACL,MAAMyB,EAAkBC,KAAKC,MAAMJ,EAAEM,aAAehB,EAAcW,QAAQI,cAC1E,MAAME,EAAoBJ,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE5EX,EAAuBQ,EAAkBK,EAC3C,IAEF,CAAC9B,EAAOmB,IAgBV,OAbAY,kBAAkB,CAChBC,QAAS9B,EACT+B,OAAQtB,EACRuB,SAAUb,IAGZc,iBAAgB,KACV9B,SAAa+B,IACfhB,EAAgBf,GACZE,GAAkBA,EAAiBF,GACzC,GACC,CAACA,EAAUE,IAGZ8B,KAAAC,SAAA,CAAAlC,SACEiC,CAAAA,KAACE,aAAmB,CAACC,IAAK7B,EAASX,MAAOA,EAAOK,SAAUc,EAAcb,UAAWA,EAAUF,UAC3FF,GAAcuC,IAACF,WAAiB,CAACC,IAAK3B,EAAcT,SAAC,MACrDA,KAEFF,GAAcc,KAAwB,GACrCyB,IAACF,aAAmB,IACd7B,EACJgC,KAAK,SACLC,QAAS7B,EACT8B,QAAUC,IAGR,GAFInC,EAAsBkC,SAASlC,EAAsBkC,QAAQC,GAE7DxC,SAAa+B,EAAW,CAC1B,MAAMU,GAAU3B,EAEhBC,EAAgB0B,GACZvC,GAAkBA,EAAiBuC,EACzC,GACA1C,SAEDe,EAAeX,EAAkBC,MAGrC"}
1
+ {"version":3,"file":"Ellipsis.mjs","sources":["../../../../src/components/Text/Ellipsis.tsx"],"sourcesContent":["import { useState, useLayoutEffect, useRef, useCallback } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { useResizeObserver } from 'hooks/useResizeObserver'\nimport type { Nullable } from 'shared/types'\nimport type { EllipsisProps, ExpandButtonProps } from './types'\nimport * as Styled from './style'\n\nconst Ellipsis = (props: EllipsisProps) => {\n const {\n lines = 1,\n defaultExpanded = false,\n expandable = false,\n expandButtonProps = {} as ExpandButtonProps,\n children,\n expanded,\n underline,\n onExpandedChange,\n } = props\n\n const { captionExpanded = 'Свернуть', captionCollapsed = 'Развернуть', ...restExpandButtonProps } = expandButtonProps\n\n const textRef = useRef<HTMLSpanElement>(null)\n const lineHeightRef = useRef<HTMLSpanElement>(null)\n\n const expandButtonPalette = useMergedPalette(restExpandButtonProps)\n\n const [expandButtonVisible, setExpandButtonVisible] = useState<Nullable<boolean>>(null)\n const [textExpanded, setTextExpanded] = useState<boolean>(expanded ?? defaultExpanded)\n\n const handleExpandButtonVisibility = useCallback(\n (e: HTMLSpanElement) => {\n if (!lineHeightRef.current) return\n\n if (textExpanded) {\n const linesTotalCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > lines)\n } else {\n const linesTotalCount = Math.round(e.scrollHeight / lineHeightRef.current.clientHeight)\n const linesVisibleCount = Math.round(e.clientHeight / lineHeightRef.current.clientHeight)\n\n setExpandButtonVisible(linesTotalCount > linesVisibleCount)\n }\n },\n [lines, textExpanded]\n )\n\n useResizeObserver({\n enabled: expandable,\n target: textRef,\n onResize: handleExpandButtonVisibility,\n })\n\n useLayoutEffect(() => {\n if (expanded !== undefined) {\n setTextExpanded(expanded)\n if (onExpandedChange) onExpandedChange(expanded)\n }\n }, [expanded, onExpandedChange])\n\n return (\n <>\n <Styled.TextEllipsis ref={textRef} lines={lines} expanded={textExpanded} underline={underline}>\n {expandable ? <Styled.LineHeight ref={lineHeightRef}>&nbsp;</Styled.LineHeight> : null}\n {children}\n </Styled.TextEllipsis>\n {expandable && expandButtonVisible === true ? (\n <Styled.ExpandButton\n {...restExpandButtonProps}\n type='button'\n palette={expandButtonPalette}\n onClick={(evt) => {\n if (restExpandButtonProps.onClick) restExpandButtonProps.onClick(evt)\n\n if (expanded === undefined) {\n const update = !textExpanded\n\n setTextExpanded(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n }}\n >\n {textExpanded ? captionExpanded : captionCollapsed}\n </Styled.ExpandButton>\n ) : null}\n </>\n )\n}\n\nexport { Ellipsis }\n"],"names":["Ellipsis","props","lines","defaultExpanded","expandable","expandButtonProps","children","expanded","underline","onExpandedChange","captionExpanded","captionCollapsed","restExpandButtonProps","textRef","useRef","lineHeightRef","expandButtonPalette","useMergedPalette","expandButtonVisible","setExpandButtonVisible","useState","textExpanded","setTextExpanded","handleExpandButtonVisibility","useCallback","e","current","linesTotalCount","Math","round","clientHeight","scrollHeight","linesVisibleCount","useResizeObserver","enabled","target","onResize","useLayoutEffect","undefined","_jsxs","_Fragment","Styled","ref","_jsx","type","palette","onClick","evt","update"],"mappings":"8SAOMA,MAAAA,SAAYC,IAChB,MAAMC,MACJA,EAAQ,EAACC,gBACTA,GAAkB,EAAKC,WACvBA,GAAa,EAAKC,kBAClBA,EAAoB,CAAuB,EAAAC,SAC3CA,EAAQC,SACRA,EAAQC,UACRA,EAASC,iBACTA,GACER,EAEJ,MAAMS,gBAAEA,EAAkB,WAAUC,iBAAEA,EAAmB,gBAAiBC,GAA0BP,EAEpG,MAAMQ,EAAUC,OAAwB,MACxC,MAAMC,EAAgBD,OAAwB,MAE9C,MAAME,EAAsBC,iBAAiBL,GAE7C,MAAOM,EAAqBC,GAA0BC,SAA4B,MAClF,MAAOC,EAAcC,GAAmBF,SAAkBb,GAAYJ,GAEtE,MAAMoB,EAA+BC,aAClCC,IACC,GAAKV,EAAcW,QAEnB,GAAIL,EAAc,CAChB,MAAMM,EAAkBC,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE1EX,EAAuBQ,EAAkBzB,EAC3C,KAAO,CACL,MAAMyB,EAAkBC,KAAKC,MAAMJ,EAAEM,aAAehB,EAAcW,QAAQI,cAC1E,MAAME,EAAoBJ,KAAKC,MAAMJ,EAAEK,aAAef,EAAcW,QAAQI,cAE5EX,EAAuBQ,EAAkBK,EAC3C,IAEF,CAAC9B,EAAOmB,IAgBV,OAbAY,kBAAkB,CAChBC,QAAS9B,EACT+B,OAAQtB,EACRuB,SAAUb,IAGZc,iBAAgB,KACV9B,SAAa+B,IACfhB,EAAgBf,GACZE,GAAkBA,EAAiBF,GACzC,GACC,CAACA,EAAUE,IAGZ8B,KAAAC,SAAA,CAAAlC,SACEiC,CAAAA,KAACE,aAAmB,CAACC,IAAK7B,EAASX,MAAOA,EAAOK,SAAUc,EAAcb,UAAWA,EAAUF,UAC3FF,EAAauC,IAACF,WAAiB,CAACC,IAAK3B,EAAcT,SAAC,MAA6B,KACjFA,KAEFF,GAAcc,KAAwB,EACrCyB,IAACF,aAAmB,IACd7B,EACJgC,KAAK,SACLC,QAAS7B,EACT8B,QAAUC,IAGR,GAFInC,EAAsBkC,SAASlC,EAAsBkC,QAAQC,GAE7DxC,SAAa+B,EAAW,CAC1B,MAAMU,GAAU3B,EAEhBC,EAAgB0B,GACZvC,GAAkBA,EAAiBuC,EACzC,GACA1C,SAEDe,EAAeX,EAAkBC,IAElC,OACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport { Ellipsis } from './Ellipsis'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLElement>(\n forwardRef((props, ref) => {\n const textProps = props.appearance ? { ...APPEARANCE[props.appearance], ...props } : props\n\n const {\n size = 'm',\n weight = 'normal',\n lineHeight = 'm',\n fontStyle = 'normal',\n className,\n content,\n children,\n ellipsis,\n expandButtonProps,\n onExpandedChange,\n ...restProps\n } = textProps\n\n const ellipsisProps = typeof ellipsis === 'object' && ellipsis !== null ? ellipsis : {}\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n ellipsis={ellipsis}\n ref={ref}\n >\n {ellipsis ? (\n <Ellipsis\n {...ellipsisProps}\n underline={restProps.underline}\n expandButtonProps={expandButtonProps}\n onExpandedChange={onExpandedChange}\n >\n {children || content}\n </Ellipsis>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (typeof props.appearance === 'string') {\n return SIZES[props.appearance] ?? SIZES_DEFAULT\n }\n\n return SIZES_DEFAULT\n },\n }\n ),\n {\n Heading: TextHeading,\n Ellipse: TextEllipse,\n }\n )\n\nexport { Text, COMPONENT_NAME }\n"],"names":["Text","Object","assign","withMergedProps","forwardRef","props","ref","textProps","appearance","APPEARANCE","size","weight","lineHeight","fontStyle","className","content","children","ellipsis","expandButtonProps","onExpandedChange","restProps","ellipsisProps","textClassName","useClassname","_jsx","Styled","jsx","Ellipsis","underline","displayName","sizes","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"seAuBA,MAAMA,KACJC,OAAOC,OACLC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAYF,EAAMG,WAAa,IAAKC,UAAUA,WAACJ,EAAMG,eAAgBH,GAAUA,EAErF,MAAMK,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,WACjBA,EAAa,IAAGC,UAChBA,EAAY,SAAQC,UACpBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,iBACjBA,KACGC,GACDb,EAEJ,MAAMc,SAAuBJ,GAAa,UAAYA,IAAa,KAAOA,EAAW,GAErF,MAAMK,EAAgBC,aAAAA,aAlCP,OAkCoCT,GAEnD,OACEU,WAAAA,IAACC,MAAAA,KAAW,IACNL,EACJV,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWQ,EACXL,SAAUA,EACVX,IAAKA,EAAIU,SAERC,EACCO,WAAAE,IAACC,kBAAQ,IACHN,EACJO,UAAWR,EAAUQ,UACrBV,kBAAmBA,EACnBC,iBAAkBA,EAAiBH,SAElCA,GAAYD,IAGfC,GAAYD,GAEF,IAGlB,CACEc,YA/De,OAgEfC,MAAQzB,UACKA,EAAMG,YAAe,SACvBuB,gBAAM1B,EAAMG,aAAewB,iBAAAA,cAG7BA,iCAIb,CACEC,QAASC,aAAWA,YACpBC,QAASC,aAAAA,qCA3EQ"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport { Ellipsis } from './Ellipsis'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLElement>(\n forwardRef<HTMLElement, MergedProps<TextProps>>((props, ref) => {\n const textProps = props.appearance ? { ...APPEARANCE[props.appearance], ...props } : props\n\n const {\n size = 'm',\n weight = 'normal',\n lineHeight = 'm',\n fontStyle = 'normal',\n className,\n content,\n children,\n ellipsis,\n expandButtonProps,\n onExpandedChange,\n ...restProps\n } = textProps\n\n const ellipsisProps = typeof ellipsis === 'object' && ellipsis !== null ? ellipsis : {}\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n ellipsis={ellipsis}\n ref={ref}\n >\n {ellipsis ? (\n <Ellipsis\n {...ellipsisProps}\n underline={restProps.underline}\n expandButtonProps={expandButtonProps}\n onExpandedChange={onExpandedChange}\n >\n {children || content}\n </Ellipsis>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (typeof props.appearance === 'string') {\n return SIZES[props.appearance] ?? SIZES_DEFAULT\n }\n\n return SIZES_DEFAULT\n },\n }\n ),\n {\n Heading: TextHeading,\n Ellipse: TextEllipse,\n }\n )\n\nexport { Text, COMPONENT_NAME }\n"],"names":["Text","Object","assign","withMergedProps","forwardRef","props","ref","textProps","appearance","APPEARANCE","size","weight","lineHeight","fontStyle","className","content","children","ellipsis","expandButtonProps","onExpandedChange","restProps","ellipsisProps","textClassName","useClassname","_jsx","Styled","jsx","Ellipsis","underline","displayName","sizes","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"seAwBA,MAAMA,KACJC,OAAOC,OACLC,gBAAAA,gBACEC,MAAAA,YAAgD,CAACC,EAAOC,KACtD,MAAMC,EAAYF,EAAMG,WAAa,IAAKC,UAAUA,WAACJ,EAAMG,eAAgBH,GAAUA,EAErF,MAAMK,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,WACjBA,EAAa,IAAGC,UAChBA,EAAY,SAAQC,UACpBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,iBACjBA,KACGC,GACDb,EAEJ,MAAMc,SAAuBJ,GAAa,UAAYA,IAAa,KAAOA,EAAW,GAErF,MAAMK,EAAgBC,aAAAA,aAlCP,OAkCoCT,GAEnD,OACEU,WAAAA,IAACC,MAAAA,KAAW,IACNL,EACJV,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWQ,EACXL,SAAUA,EACVX,IAAKA,EAAIU,SAERC,EACCO,WAAAE,IAACC,kBAAQ,IACHN,EACJO,UAAWR,EAAUQ,UACrBV,kBAAmBA,EACnBC,iBAAkBA,EAAiBH,SAElCA,GAAYD,IAGfC,GAAYD,GAEF,IAGlB,CACEc,YA/De,OAgEfC,MAAQzB,UACKA,EAAMG,YAAe,SACvBuB,gBAAM1B,EAAMG,aAAewB,iBAAAA,cAG7BA,iCAIb,CACEC,QAASC,aAAWA,YACpBC,QAASC,aAAAA,qCA3EQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.mjs","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport { Ellipsis } from './Ellipsis'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLElement>(\n forwardRef((props, ref) => {\n const textProps = props.appearance ? { ...APPEARANCE[props.appearance], ...props } : props\n\n const {\n size = 'm',\n weight = 'normal',\n lineHeight = 'm',\n fontStyle = 'normal',\n className,\n content,\n children,\n ellipsis,\n expandButtonProps,\n onExpandedChange,\n ...restProps\n } = textProps\n\n const ellipsisProps = typeof ellipsis === 'object' && ellipsis !== null ? ellipsis : {}\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n ellipsis={ellipsis}\n ref={ref}\n >\n {ellipsis ? (\n <Ellipsis\n {...ellipsisProps}\n underline={restProps.underline}\n expandButtonProps={expandButtonProps}\n onExpandedChange={onExpandedChange}\n >\n {children || content}\n </Ellipsis>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (typeof props.appearance === 'string') {\n return SIZES[props.appearance] ?? SIZES_DEFAULT\n }\n\n return SIZES_DEFAULT\n },\n }\n ),\n {\n Heading: TextHeading,\n Ellipse: TextEllipse,\n }\n )\n\nexport { Text, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Text","Object","assign","withMergedProps","forwardRef","props","ref","textProps","appearance","APPEARANCE","size","weight","lineHeight","fontStyle","className","content","children","ellipsis","expandButtonProps","onExpandedChange","restProps","ellipsisProps","textClassName","useClassname","_jsx","Styled","Ellipsis","underline","displayName","sizes","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"4cAWMA,MAAAA,eAAiB,OAYvB,MAAMC,KACJC,OAAOC,OACLC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAYF,EAAMG,WAAa,IAAKC,WAAWJ,EAAMG,eAAgBH,GAAUA,EAErF,MAAMK,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,WACjBA,EAAa,IAAGC,UAChBA,EAAY,SAAQC,UACpBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,iBACjBA,KACGC,GACDb,EAEJ,MAAMc,SAAuBJ,GAAa,UAAYA,IAAa,KAAOA,EAAW,GAErF,MAAMK,EAAgBC,aAlCP,OAkCoCT,GAEnD,OACEU,IAACC,KAAW,IACNL,EACJV,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWQ,EACXL,SAAUA,EACVX,IAAKA,EAAIU,SAERC,EACCO,IAACE,SAAQ,IACHL,EACJM,UAAWP,EAAUO,UACrBT,kBAAmBA,EACnBC,iBAAkBA,EAAiBH,SAElCA,GAAYD,IAGfC,GAAYD,GAEF,IAGlB,CACEa,YA/De,OAgEfC,MAAQxB,UACKA,EAAMG,YAAe,SACvBsB,MAAMzB,EAAMG,aAAeuB,cAG7BA,gBAIb,CACEC,QAASC,YACTC,QAASC"}
1
+ {"version":3,"file":"Text.mjs","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport { Ellipsis } from './Ellipsis'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLElement>(\n forwardRef<HTMLElement, MergedProps<TextProps>>((props, ref) => {\n const textProps = props.appearance ? { ...APPEARANCE[props.appearance], ...props } : props\n\n const {\n size = 'm',\n weight = 'normal',\n lineHeight = 'm',\n fontStyle = 'normal',\n className,\n content,\n children,\n ellipsis,\n expandButtonProps,\n onExpandedChange,\n ...restProps\n } = textProps\n\n const ellipsisProps = typeof ellipsis === 'object' && ellipsis !== null ? ellipsis : {}\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n ellipsis={ellipsis}\n ref={ref}\n >\n {ellipsis ? (\n <Ellipsis\n {...ellipsisProps}\n underline={restProps.underline}\n expandButtonProps={expandButtonProps}\n onExpandedChange={onExpandedChange}\n >\n {children || content}\n </Ellipsis>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (typeof props.appearance === 'string') {\n return SIZES[props.appearance] ?? SIZES_DEFAULT\n }\n\n return SIZES_DEFAULT\n },\n }\n ),\n {\n Heading: TextHeading,\n Ellipse: TextEllipse,\n }\n )\n\nexport { Text, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Text","Object","assign","withMergedProps","forwardRef","props","ref","textProps","appearance","APPEARANCE","size","weight","lineHeight","fontStyle","className","content","children","ellipsis","expandButtonProps","onExpandedChange","restProps","ellipsisProps","textClassName","useClassname","_jsx","Styled","Ellipsis","underline","displayName","sizes","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"4cAYMA,MAAAA,eAAiB,OAYvB,MAAMC,KACJC,OAAOC,OACLC,gBACEC,YAAgD,CAACC,EAAOC,KACtD,MAAMC,EAAYF,EAAMG,WAAa,IAAKC,WAAWJ,EAAMG,eAAgBH,GAAUA,EAErF,MAAMK,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,WACjBA,EAAa,IAAGC,UAChBA,EAAY,SAAQC,UACpBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,iBACjBA,KACGC,GACDb,EAEJ,MAAMc,SAAuBJ,GAAa,UAAYA,IAAa,KAAOA,EAAW,GAErF,MAAMK,EAAgBC,aAlCP,OAkCoCT,GAEnD,OACEU,IAACC,KAAW,IACNL,EACJV,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWQ,EACXL,SAAUA,EACVX,IAAKA,EAAIU,SAERC,EACCO,IAACE,SAAQ,IACHL,EACJM,UAAWP,EAAUO,UACrBT,kBAAmBA,EACnBC,iBAAkBA,EAAiBH,SAElCA,GAAYD,IAGfC,GAAYD,GAEF,IAGlB,CACEa,YA/De,OAgEfC,MAAQxB,UACKA,EAAMG,YAAe,SACvBsB,MAAMzB,EAAMG,aAAeuB,cAG7BA,gBAIb,CACEC,QAASC,YACTC,QAASC"}
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color, CSSColor } from 'shared/types'\nimport type { StyledTextProps, ExpandButtonPalette, StyledTextEllipsisProps, StyledExpandButtonProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'whiteSpace',\n 'wordBreak',\n 'underline',\n 'ellipsis',\n ].includes(propKey)\n)\n\nconst template = (palette: ExpandButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n primary: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n contrast: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n padding: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${props.lineHeight ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight] ?? props.lineHeight};` : ''}\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${(props) =>\n props.underline &&\n !props.ellipsis &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n\nexport const TextEllipsis = styled.span.withConfig<StyledTextEllipsisProps>({\n shouldForwardProp: (propKey) => !['lines', 'expanded', 'underline'].includes(propKey),\n})`\n box-sizing: border-box;\n display: block;\n position: relative;\n\n ${(props) =>\n !props.expanded &&\n `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${props.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n\n ${(props) =>\n props.underline &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n`\n\nexport const LineHeight = styled.span`\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n`\n\nexport const ExpandButton = styled.button.withConfig<StyledExpandButtonProps>({\n shouldForwardProp: (propKey) => !['contrast', 'palette'].includes(propKey),\n})`\n box-sizing: border-box;\n appearance: none;\n padding: 0;\n border: 0;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n font-style: inherit;\n margin-top: 0.2em;\n text-decoration-line: underline;\n text-decoration-style: dashed;\n text-underline-offset: 0.3em;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${(props) => (props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.primary)}\n\n ${focus}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","colorDisabled","COLOR_SCHEMA","primary","css","props","theme","colors","tinycolor","default","lighten","toString","transparent","contrast","darken","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","whiteSpace","wordBreak","underlineLinks","underline","ellipsis","responsiveSize","responsiveMargin","display","textColor","TextEllipsis","span","expanded","lines","LineHeight","ExpandButton","button","focus"],"mappings":"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"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color, CSSColor } from 'shared/types'\nimport type { StyledTextProps, ExpandButtonPalette, StyledTextEllipsisProps, StyledExpandButtonProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'whiteSpace',\n 'wordBreak',\n 'underline',\n 'ellipsis',\n ].includes(propKey)\n)\n\nconst template = (palette: ExpandButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n primary: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n contrast: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n padding: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight as keyof typeof WEIGHT_MAP] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${\n props.lineHeight\n ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight as keyof typeof LINE_HEIGHT_MAP] ?? props.lineHeight};`\n : ''\n }\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${(props) =>\n props.underline &&\n !props.ellipsis &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n\nexport const TextEllipsis = styled.span.withConfig<StyledTextEllipsisProps>({\n shouldForwardProp: (propKey) => !['lines', 'expanded', 'underline'].includes(propKey),\n})`\n box-sizing: border-box;\n display: block;\n position: relative;\n\n ${(props) =>\n !props.expanded &&\n `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${props.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n\n ${(props) =>\n props.underline &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n`\n\nexport const LineHeight = styled.span`\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n`\n\nexport const ExpandButton = styled.button.withConfig<StyledExpandButtonProps>({\n shouldForwardProp: (propKey) => !['contrast', 'palette'].includes(propKey),\n})`\n box-sizing: border-box;\n appearance: none;\n padding: 0;\n border: 0;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n font-style: inherit;\n margin-top: 0.2em;\n text-decoration-line: underline;\n text-decoration-style: dashed;\n text-underline-offset: 0.3em;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${(props) => (props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.primary)}\n\n ${focus}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","colorDisabled","COLOR_SCHEMA","primary","css","props","theme","colors","tinycolor","default","lighten","toString","transparent","contrast","darken","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","whiteSpace","wordBreak","underlineLinks","underline","ellipsis","responsiveSize","responsiveMargin","display","textColor","TextEllipsis","span","expanded","lines","LineHeight","ExpandButton","button","focus"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color, CSSColor } from 'shared/types'\nimport type { StyledTextProps, ExpandButtonPalette, StyledTextEllipsisProps, StyledExpandButtonProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'whiteSpace',\n 'wordBreak',\n 'underline',\n 'ellipsis',\n ].includes(propKey)\n)\n\nconst template = (palette: ExpandButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n primary: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n contrast: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n padding: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${props.lineHeight ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight] ?? props.lineHeight};` : ''}\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${(props) =>\n props.underline &&\n !props.ellipsis &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n\nexport const TextEllipsis = styled.span.withConfig<StyledTextEllipsisProps>({\n shouldForwardProp: (propKey) => !['lines', 'expanded', 'underline'].includes(propKey),\n})`\n box-sizing: border-box;\n display: block;\n position: relative;\n\n ${(props) =>\n !props.expanded &&\n `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${props.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n\n ${(props) =>\n props.underline &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n`\n\nexport const LineHeight = styled.span`\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n`\n\nexport const ExpandButton = styled.button.withConfig<StyledExpandButtonProps>({\n shouldForwardProp: (propKey) => !['contrast', 'palette'].includes(propKey),\n})`\n box-sizing: border-box;\n appearance: none;\n padding: 0;\n border: 0;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n font-style: inherit;\n margin-top: 0.2em;\n text-decoration-line: underline;\n text-decoration-style: dashed;\n text-underline-offset: 0.3em;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${(props) => (props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.primary)}\n\n ${focus}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","colorDisabled","COLOR_SCHEMA","primary","css","props","theme","colors","tinycolor","lighten","toString","transparent","contrast","darken","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","whiteSpace","wordBreak","underlineLinks","underline","ellipsis","responsiveSize","responsiveMargin","display","textColor","TextEllipsis","span","expanded","lines","LineHeight","ExpandButton","button","focus"],"mappings":"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"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color, CSSColor } from 'shared/types'\nimport type { StyledTextProps, ExpandButtonPalette, StyledTextEllipsisProps, StyledExpandButtonProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'whiteSpace',\n 'wordBreak',\n 'underline',\n 'ellipsis',\n ].includes(propKey)\n)\n\nconst template = (palette: ExpandButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n primary: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n contrast: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n padding: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight as keyof typeof WEIGHT_MAP] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${\n props.lineHeight\n ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight as keyof typeof LINE_HEIGHT_MAP] ?? props.lineHeight};`\n : ''\n }\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${(props) =>\n props.underline &&\n !props.ellipsis &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n\nexport const TextEllipsis = styled.span.withConfig<StyledTextEllipsisProps>({\n shouldForwardProp: (propKey) => !['lines', 'expanded', 'underline'].includes(propKey),\n})`\n box-sizing: border-box;\n display: block;\n position: relative;\n\n ${(props) =>\n !props.expanded &&\n `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${props.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n\n ${(props) =>\n props.underline &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n`\n\nexport const LineHeight = styled.span`\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n`\n\nexport const ExpandButton = styled.button.withConfig<StyledExpandButtonProps>({\n shouldForwardProp: (propKey) => !['contrast', 'palette'].includes(propKey),\n})`\n box-sizing: border-box;\n appearance: none;\n padding: 0;\n border: 0;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n font-style: inherit;\n margin-top: 0.2em;\n text-decoration-line: underline;\n text-decoration-style: dashed;\n text-underline-offset: 0.3em;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${(props) => (props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.primary)}\n\n ${focus}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","colorDisabled","COLOR_SCHEMA","primary","css","props","theme","colors","tinycolor","lighten","toString","transparent","contrast","darken","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","whiteSpace","wordBreak","underlineLinks","underline","ellipsis","responsiveSize","responsiveMargin","display","textColor","TextEllipsis","span","expanded","lines","LineHeight","ExpandButton","button","focus"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var Spacer=require('../Spacer/Spacer.js');var Anchor=require('../Anchor/Anchor.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Text=require('../Text/Text.js');exports.TextEllipse=class TextEllipse extends React.Component{static displayName='Text.Ellipse';constructor(e){super(e),this.state={isUnFolded:!1,isEllipsed:!1}}componentDidUpdate({content:e}){e!==this.props.content&&this.state.isUnFolded&&this.toggle()}getContent=e=>{const{content:t,chars:s=0}=this.props;if(!t)return'';let{isEllipsed:i}=this.state;let r=typeof t=='string'?'':[];if(this.state.isUnFolded)r=t;else if(typeof r=='string')i=s!==0&&t.length>s,r=i&&s!==0?`${t.slice(0,s)}...`:t;else{let e=s;for(let s=0;s<t.length;s++){if(!(e-t[s].length>0)){i=!0,r[s]=`${t[s].slice(0,e)}...`;break}e-=t[s].length,r[s]=t[s]}}return this.state.isEllipsed!==i&&setTimeout((()=>this.setState({isEllipsed:i}))),typeof r=='string'?jsxRuntime.jsx(Text.Text,{...e,children:this.getQuted(r)}):jsxRuntime.jsx(style.Ul,{children:r.map(((t,s)=>jsxRuntime.jsx(style.Li,{children:jsxRuntime.jsx(Text.Text,{...e,display:"inline",children:t})},s)))})};getQuted=e=>this.props.quoted?`«${e}»`:e;toggle=()=>{this.setState({isUnFolded:!this.state.isUnFolded})};render(){const{className:e="",style:t,moreText:s="Читать полностью",lessText:i="Свернуть",showToggler:r=!0,...n}=this.props;const{isUnFolded:l,isEllipsed:o}=this.state;return jsxRuntime.jsxs("div",{className:e,style:t,children:[this.getContent(n),r&&o&&jsxRuntime.jsx(Spacer.Spacer,{marginTop:16,marginBottom:1,children:jsxRuntime.jsx(Anchor.Anchor,{pseudo:!0,onClick:this.toggle,children:l?i:s})})]})}};
1
+ 'use strict';var React=require('react');var Spacer=require('../Spacer/Spacer.js');var Anchor=require('../Anchor/Anchor.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Text=require('../Text/Text.js');exports.TextEllipse=class TextEllipse extends React.Component{static displayName='Text.Ellipse';constructor(e){super(e),this.state={isUnFolded:!1,isEllipsed:!1}}componentDidUpdate({content:e}){e!==this.props.content&&this.state.isUnFolded&&this.toggle()}getContent=e=>{const{content:t,chars:s=0}=this.props;if(!t)return'';let{isEllipsed:i}=this.state;let r=typeof t=='string'?'':[];if(this.state.isUnFolded)r=t;else if(typeof r=='string')i=s!==0&&t.length>s,r=i&&s!==0?`${t.slice(0,s)}...`:t;else{let e=s;for(let s=0;s<t.length;s++){if(!(e-t[s].length>0)){i=!0,r[s]=`${t[s].slice(0,e)}...`;break}e-=t[s].length,r[s]=t[s]}}return this.state.isEllipsed!==i&&setTimeout((()=>this.setState({isEllipsed:i}))),typeof r=='string'?jsxRuntime.jsx(Text.Text,{...e,children:this.getQuted(r)}):jsxRuntime.jsx(style.Ul,{children:r.map(((t,s)=>jsxRuntime.jsx(style.Li,{children:jsxRuntime.jsx(Text.Text,{...e,display:"inline",children:t})},s)))})};getQuted=e=>this.props.quoted?`«${e}»`:e;toggle=()=>{this.setState({isUnFolded:!this.state.isUnFolded})};render(){const{className:e="",style:t,moreText:s="Читать полностью",lessText:i="Свернуть",showToggler:r=!0,...n}=this.props;const{isUnFolded:l,isEllipsed:o}=this.state;return jsxRuntime.jsxs("div",{className:e,style:t,children:[this.getContent(n),r&&o?jsxRuntime.jsx(Spacer.Spacer,{marginTop:16,marginBottom:1,children:jsxRuntime.jsx(Anchor.Anchor,{pseudo:!0,onClick:this.toggle,children:l?i:s})}):null]})}};
2
2
  //# sourceMappingURL=Text.Ellipse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.Ellipse.js","sources":["../../../../src/components/Text.Ellipse/Text.Ellipse.tsx"],"sourcesContent":["import { Component } from 'react'\nimport type { TextProps } from 'components/Text'\nimport { Spacer } from '../Spacer/Spacer'\nimport { Anchor } from '../Anchor/Anchor'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nexport interface TextEllipseProps extends Omit<TextProps, 'content'> {\n /** Toggle text for folded state */\n moreText?: string\n /** Toggle text for unfolded state */\n lessText?: string\n /** Classname */\n className?: string\n /** Text content */\n content: string | string[]\n /** Characters quantity for ellipsed text */\n chars?: number\n /** Wrap text in quotes */\n quoted?: boolean\n /** Flag to show toggler */\n showToggler?: boolean\n}\n\ninterface TextEllipseState {\n isUnFolded: boolean\n isEllipsed: boolean\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`ResponsiveNamedProperty<'size'>`](#/Миксины)\n */\nexport class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {\n static displayName = 'Text.Ellipse'\n\n constructor(props: TextEllipseProps) {\n super(props)\n\n this.state = {\n isUnFolded: false,\n isEllipsed: false,\n }\n }\n\n componentDidUpdate({ content }: TextEllipseProps) {\n if (content !== this.props.content && this.state.isUnFolded) {\n this.toggle()\n }\n }\n\n getContent = (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler' | 'content'>) => {\n const { content, chars = 0 } = this.props\n\n if (!content) return ''\n\n let { isEllipsed } = this.state\n let text: string | string[] = typeof content === 'string' ? '' : []\n\n if (!this.state.isUnFolded) {\n if (typeof text === 'string') {\n isEllipsed = chars !== 0 && content.length > chars\n\n text = isEllipsed && chars !== 0 ? `${content.slice(0, chars)}...` : content\n } else {\n let leftChars = chars\n\n for (let index = 0; index < content.length; index++) {\n if (leftChars - content[index].length > 0) {\n leftChars -= content[index].length\n\n text[index] = content[index]\n } else {\n isEllipsed = true\n text[index] = `${content[index].slice(0, leftChars)}...`\n\n break\n }\n }\n }\n } else {\n text = content\n }\n\n if (this.state.isEllipsed !== isEllipsed) setTimeout(() => this.setState({ isEllipsed }))\n\n return typeof text === 'string' ? (\n <Text {...props}>{this.getQuted(text)}</Text>\n ) : (\n <Styled.Ul>\n {text.map((item, index) => (\n <Styled.Li key={index}>\n <Text {...props} display='inline'>\n {item}\n </Text>\n </Styled.Li>\n ))}\n </Styled.Ul>\n )\n }\n\n getQuted = (content: string) => (this.props.quoted ? `«${content}»` : content)\n\n toggle = () => {\n this.setState({ isUnFolded: !this.state.isUnFolded })\n }\n\n render() {\n const {\n className = '',\n style,\n moreText = 'Читать полностью',\n lessText = 'Свернуть',\n showToggler = true,\n ...restProps\n } = this.props\n const { isUnFolded, isEllipsed } = this.state\n\n return (\n <div className={className} style={style}>\n {this.getContent(restProps)}\n {showToggler && isEllipsed && (\n <Spacer marginTop={16} marginBottom={1}>\n <Anchor pseudo onClick={this.toggle}>\n {isUnFolded ? lessText : moreText}\n </Anchor>\n </Spacer>\n )}\n </div>\n )\n }\n}\n"],"names":["TextEllipse","Component","static","constructor","props","super","this","state","isUnFolded","isEllipsed","componentDidUpdate","content","toggle","getContent","chars","text","length","slice","leftChars","index","setTimeout","setState","_jsx","Text","children","getQuted","jsx","Styled","map","item","display","quoted","render","className","style","moreText","lessText","showToggler","restProps","_jsxs","Spacer","marginTop","marginBottom","Anchor","pseudo","onClick"],"mappings":"gQAoCO,MAAMA,oBAAoBC,MAAAA,UAC/BC,mBAAqB,eAErBC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,MAAQ,CACXC,YAAY,EACZC,YAAY,EAEhB,CAEAC,kBAAAA,EAAmBC,QAAEA,IACfA,IAAYL,KAAKF,MAAMO,SAAWL,KAAKC,MAAMC,YAC/CF,KAAKM,QAET,CAEAC,WAAcT,IACZ,MAAMO,QAAEA,EAAOG,MAAEA,EAAQ,GAAMR,KAAKF,MAEpC,IAAKO,EAAS,MAAO,GAErB,IAAIF,WAAEA,GAAeH,KAAKC,MAC1B,IAAIQ,SAAiCJ,GAAY,SAAW,GAAK,GAEjE,GAAKL,KAAKC,MAAMC,WAsBdO,EAAOJ,OArBP,UAAWI,GAAS,SAClBN,EAAaK,IAAU,GAAKH,EAAQK,OAASF,EAE7CC,EAAON,GAAcK,IAAU,EAAI,GAAGH,EAAQM,MAAM,EAAGH,QAAcH,MAChE,CACL,IAAIO,EAAYJ,EAEhB,IAAK,IAAIK,EAAQ,EAAGA,EAAQR,EAAQK,OAAQG,IAAS,CACnD,KAAID,EAAYP,EAAQQ,GAAOH,OAAS,GAIjC,CACLP,GAAa,EACbM,EAAKI,GAAS,GAAGR,EAAQQ,GAAOF,MAAM,EAAGC,QAEzC,KACF,CAREA,GAAaP,EAAQQ,GAAOH,OAE5BD,EAAKI,GAASR,EAAQQ,EAO1B,CACF,CAOF,OAFIb,KAAKC,MAAME,aAAeA,GAAYW,YAAW,IAAMd,KAAKe,SAAS,CAAEZ,wBAE7DM,GAAS,SACrBO,WAAAA,IAACC,KAAAA,KAAI,IAAKnB,EAAKoB,SAAGlB,KAAKmB,SAASV,KAEhCO,WAAAI,IAACC,SAAS,CAAAH,SACPT,EAAKa,KAAI,CAACC,EAAMV,IACfG,WAAAI,IAACC,SAAS,CAAAH,SACRF,WAAAI,IAACH,UAAI,IAAKnB,EAAO0B,QAAQ,SAAQN,SAC9BK,KAFWV,MAOrB,EAGHM,SAAYd,GAAqBL,KAAKF,MAAM2B,OAAS,IAAIpB,KAAaA,EAEtEC,OAASA,KACPN,KAAKe,SAAS,CAAEb,YAAaF,KAAKC,MAAMC,YAAa,EAGvDwB,MAAAA,GACE,MAAMC,UACJA,EAAY,GAAEC,MACdA,EAAKC,SACLA,EAAW,mBAAkBC,SAC7BA,EAAW,WAAUC,YACrBA,GAAc,KACXC,GACDhC,KAAKF,MACT,MAAMI,WAAEA,EAAUC,WAAEA,GAAeH,KAAKC,MAExC,OACEgC,WAAAA,KAAA,MAAA,CAAKN,UAAWA,EAAWC,MAAOA,EAAMV,SACrC,CAAAlB,KAAKO,WAAWyB,GAChBD,GAAe5B,GACda,WAAAI,IAACc,cAAM,CAACC,UAAW,GAAIC,aAAc,EAAElB,SACrCF,WAAAI,IAACiB,cAAM,CAACC,QAAM,EAACC,QAASvC,KAAKM,OAAOY,SACjChB,EAAa4B,EAAWD,QAMrC"}
1
+ {"version":3,"file":"Text.Ellipse.js","sources":["../../../../src/components/Text.Ellipse/Text.Ellipse.tsx"],"sourcesContent":["import { Component } from 'react'\nimport type { TextProps } from 'components/Text'\nimport { Spacer } from '../Spacer/Spacer'\nimport { Anchor } from '../Anchor/Anchor'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nexport interface TextEllipseProps extends Omit<TextProps, 'content'> {\n /** Toggle text for folded state */\n moreText?: string\n /** Toggle text for unfolded state */\n lessText?: string\n /** Classname */\n className?: string\n /** Text content */\n content: string | string[]\n /** Characters quantity for ellipsed text */\n chars?: number\n /** Wrap text in quotes */\n quoted?: boolean\n /** Flag to show toggler */\n showToggler?: boolean\n}\n\ninterface TextEllipseState {\n isUnFolded: boolean\n isEllipsed: boolean\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`ResponsiveNamedProperty<'size'>`](#/Миксины)\n */\nexport class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {\n static displayName = 'Text.Ellipse'\n\n constructor(props: TextEllipseProps) {\n super(props)\n\n this.state = {\n isUnFolded: false,\n isEllipsed: false,\n }\n }\n\n componentDidUpdate({ content }: TextEllipseProps) {\n if (content !== this.props.content && this.state.isUnFolded) {\n this.toggle()\n }\n }\n\n getContent = (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler' | 'content'>) => {\n const { content, chars = 0 } = this.props\n\n if (!content) return ''\n\n let { isEllipsed } = this.state\n let text: string | string[] = typeof content === 'string' ? '' : []\n\n if (!this.state.isUnFolded) {\n if (typeof text === 'string') {\n isEllipsed = chars !== 0 && content.length > chars\n\n text = isEllipsed && chars !== 0 ? `${content.slice(0, chars)}...` : content\n } else {\n let leftChars = chars\n\n for (let index = 0; index < content.length; index++) {\n if (leftChars - content[index].length > 0) {\n leftChars -= content[index].length\n\n text[index] = content[index]\n } else {\n isEllipsed = true\n text[index] = `${content[index].slice(0, leftChars)}...`\n\n break\n }\n }\n }\n } else {\n text = content\n }\n\n if (this.state.isEllipsed !== isEllipsed) setTimeout(() => this.setState({ isEllipsed }))\n\n return typeof text === 'string' ? (\n <Text {...props}>{this.getQuted(text)}</Text>\n ) : (\n <Styled.Ul>\n {text.map((item, index) => (\n <Styled.Li key={index}>\n <Text {...props} display='inline'>\n {item}\n </Text>\n </Styled.Li>\n ))}\n </Styled.Ul>\n )\n }\n\n getQuted = (content: string) => (this.props.quoted ? `«${content}»` : content)\n\n toggle = () => {\n this.setState({ isUnFolded: !this.state.isUnFolded })\n }\n\n render() {\n const {\n className = '',\n style,\n moreText = 'Читать полностью',\n lessText = 'Свернуть',\n showToggler = true,\n ...restProps\n } = this.props\n const { isUnFolded, isEllipsed } = this.state\n\n return (\n <div className={className} style={style}>\n {this.getContent(restProps)}\n {showToggler && isEllipsed ? (\n <Spacer marginTop={16} marginBottom={1}>\n {/* eslint-disable-next-line react/jsx-handler-names */}\n <Anchor pseudo onClick={this.toggle}>\n {isUnFolded ? lessText : moreText}\n </Anchor>\n </Spacer>\n ) : null}\n </div>\n )\n }\n}\n"],"names":["TextEllipse","Component","static","constructor","props","super","this","state","isUnFolded","isEllipsed","componentDidUpdate","content","toggle","getContent","chars","text","length","slice","leftChars","index","setTimeout","setState","_jsx","Text","children","getQuted","jsx","Styled","map","item","display","quoted","render","className","style","moreText","lessText","showToggler","restProps","_jsxs","Spacer","marginTop","marginBottom","Anchor","pseudo","onClick"],"mappings":"gQAoCO,MAAMA,oBAAoBC,MAAAA,UAC/BC,mBAAqB,eAErBC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,MAAQ,CACXC,YAAY,EACZC,YAAY,EAEhB,CAEAC,kBAAAA,EAAmBC,QAAEA,IACfA,IAAYL,KAAKF,MAAMO,SAAWL,KAAKC,MAAMC,YAC/CF,KAAKM,QAET,CAEAC,WAAcT,IACZ,MAAMO,QAAEA,EAAOG,MAAEA,EAAQ,GAAMR,KAAKF,MAEpC,IAAKO,EAAS,MAAO,GAErB,IAAIF,WAAEA,GAAeH,KAAKC,MAC1B,IAAIQ,SAAiCJ,GAAY,SAAW,GAAK,GAEjE,GAAKL,KAAKC,MAAMC,WAsBdO,EAAOJ,OArBP,UAAWI,GAAS,SAClBN,EAAaK,IAAU,GAAKH,EAAQK,OAASF,EAE7CC,EAAON,GAAcK,IAAU,EAAI,GAAGH,EAAQM,MAAM,EAAGH,QAAcH,MAChE,CACL,IAAIO,EAAYJ,EAEhB,IAAK,IAAIK,EAAQ,EAAGA,EAAQR,EAAQK,OAAQG,IAAS,CACnD,KAAID,EAAYP,EAAQQ,GAAOH,OAAS,GAIjC,CACLP,GAAa,EACbM,EAAKI,GAAS,GAAGR,EAAQQ,GAAOF,MAAM,EAAGC,QAEzC,KACF,CAREA,GAAaP,EAAQQ,GAAOH,OAE5BD,EAAKI,GAASR,EAAQQ,EAO1B,CACF,CAOF,OAFIb,KAAKC,MAAME,aAAeA,GAAYW,YAAW,IAAMd,KAAKe,SAAS,CAAEZ,wBAE7DM,GAAS,SACrBO,WAAAA,IAACC,KAAAA,KAAI,IAAKnB,EAAKoB,SAAGlB,KAAKmB,SAASV,KAEhCO,WAAAI,IAACC,SAAS,CAAAH,SACPT,EAAKa,KAAI,CAACC,EAAMV,IACfG,WAAAI,IAACC,SAAS,CAAAH,SACRF,WAAAI,IAACH,UAAI,IAAKnB,EAAO0B,QAAQ,SAAQN,SAC9BK,KAFWV,MAOrB,EAGHM,SAAYd,GAAqBL,KAAKF,MAAM2B,OAAS,IAAIpB,KAAaA,EAEtEC,OAASA,KACPN,KAAKe,SAAS,CAAEb,YAAaF,KAAKC,MAAMC,YAAa,EAGvDwB,MAAAA,GACE,MAAMC,UACJA,EAAY,GAAEC,MACdA,EAAKC,SACLA,EAAW,mBAAkBC,SAC7BA,EAAW,WAAUC,YACrBA,GAAc,KACXC,GACDhC,KAAKF,MACT,MAAMI,WAAEA,EAAUC,WAAEA,GAAeH,KAAKC,MAExC,OACEgC,WAAAA,KAAA,MAAA,CAAKN,UAAWA,EAAWC,MAAOA,EAAMV,SACrC,CAAAlB,KAAKO,WAAWyB,GAChBD,GAAe5B,EACda,WAAAI,IAACc,cAAM,CAACC,UAAW,GAAIC,aAAc,EAAElB,SAErCF,WAAAI,IAACiB,cAAM,CAACC,QAAM,EAACC,QAASvC,KAAKM,OAAOY,SACjChB,EAAa4B,EAAWD,MAG3B,OAGV"}
@@ -1,2 +1,2 @@
1
- import{Component}from'react';import{Spacer}from'../Spacer/Spacer.mjs';import{Anchor}from'../Anchor/Anchor.mjs';import{Ul,Li}from'./style.mjs';import{jsx,jsxs}from'react/jsx-runtime';import{Text}from'../Text/Text.mjs';class TextEllipse extends Component{static displayName='Text.Ellipse';constructor(t){super(t),this.state={isUnFolded:!1,isEllipsed:!1}}componentDidUpdate({content:t}){t!==this.props.content&&this.state.isUnFolded&&this.toggle()}getContent=t=>{const{content:e,chars:s=0}=this.props;if(!e)return'';let{isEllipsed:i}=this.state;let o=typeof e=='string'?'':[];if(this.state.isUnFolded)o=e;else if(typeof o=='string')i=s!==0&&e.length>s,o=i&&s!==0?`${e.slice(0,s)}...`:e;else{let t=s;for(let s=0;s<e.length;s++){if(!(t-e[s].length>0)){i=!0,o[s]=`${e[s].slice(0,t)}...`;break}t-=e[s].length,o[s]=e[s]}}return this.state.isEllipsed!==i&&setTimeout((()=>this.setState({isEllipsed:i}))),typeof o=='string'?jsx(Text,{...t,children:this.getQuted(o)}):jsx(Ul,{children:o.map(((e,s)=>jsx(Li,{children:jsx(Text,{...t,display:"inline",children:e})},s)))})};getQuted=t=>this.props.quoted?`«${t}»`:t;toggle=()=>{this.setState({isUnFolded:!this.state.isUnFolded})};render(){const{className:t="",style:e,moreText:s="Читать полностью",lessText:i="Свернуть",showToggler:o=!0,...l}=this.props;const{isUnFolded:r,isEllipsed:n}=this.state;return jsxs("div",{className:t,style:e,children:[this.getContent(l),o&&n&&jsx(Spacer,{marginTop:16,marginBottom:1,children:jsx(Anchor,{pseudo:!0,onClick:this.toggle,children:r?i:s})})]})}}export{TextEllipse};
1
+ import{Component}from'react';import{Spacer}from'../Spacer/Spacer.mjs';import{Anchor}from'../Anchor/Anchor.mjs';import{Ul,Li}from'./style.mjs';import{jsx,jsxs}from'react/jsx-runtime';import{Text}from'../Text/Text.mjs';class TextEllipse extends Component{static displayName='Text.Ellipse';constructor(t){super(t),this.state={isUnFolded:!1,isEllipsed:!1}}componentDidUpdate({content:t}){t!==this.props.content&&this.state.isUnFolded&&this.toggle()}getContent=t=>{const{content:e,chars:s=0}=this.props;if(!e)return'';let{isEllipsed:i}=this.state;let l=typeof e=='string'?'':[];if(this.state.isUnFolded)l=e;else if(typeof l=='string')i=s!==0&&e.length>s,l=i&&s!==0?`${e.slice(0,s)}...`:e;else{let t=s;for(let s=0;s<e.length;s++){if(!(t-e[s].length>0)){i=!0,l[s]=`${e[s].slice(0,t)}...`;break}t-=e[s].length,l[s]=e[s]}}return this.state.isEllipsed!==i&&setTimeout((()=>this.setState({isEllipsed:i}))),typeof l=='string'?jsx(Text,{...t,children:this.getQuted(l)}):jsx(Ul,{children:l.map(((e,s)=>jsx(Li,{children:jsx(Text,{...t,display:"inline",children:e})},s)))})};getQuted=t=>this.props.quoted?`«${t}»`:t;toggle=()=>{this.setState({isUnFolded:!this.state.isUnFolded})};render(){const{className:t="",style:e,moreText:s="Читать полностью",lessText:i="Свернуть",showToggler:l=!0,...o}=this.props;const{isUnFolded:n,isEllipsed:r}=this.state;return jsxs("div",{className:t,style:e,children:[this.getContent(o),l&&r?jsx(Spacer,{marginTop:16,marginBottom:1,children:jsx(Anchor,{pseudo:!0,onClick:this.toggle,children:n?i:s})}):null]})}}export{TextEllipse};
2
2
  //# sourceMappingURL=Text.Ellipse.mjs.map