@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
- import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{abbreviateCaption}from'./utils.mjs';import{SIZES_SQUARE,SIZES}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_MAPPING_RULES}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx,Fragment}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const Avatar=withMergedProps(forwardRef(((t,e)=>{const{size:r="m",textProps:o={},children:s,text:i,...a}=t;const n=typeof r!='string'||a.preset!=='default'&&r!=='sm'?r:SIZES_MAPPING_RULES[r]??r;return jsx(Root,{...a,size:n,ref:e,children:a.loading?jsx(Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):jsx(Fragment,{children:s??(!a.src&&jsx(Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...o,children:abbreviateCaption(i||a.title||'')}))})})})),{displayName:'Avatar',sizes:t=>t.preset==='brand'?t.square?SIZES_SQUARE:SIZES:SIZES_DEFAULT});export{Avatar,SIZES,SIZES_SQUARE};
1
+ import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{abbreviateCaption}from'./utils.mjs';import{SIZES_SQUARE,SIZES}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_MAPPING_RULES}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const Avatar=withMergedProps(forwardRef(((t,e)=>{const{size:r="m",textProps:o={},children:s,text:i,...a}=t;const m=typeof r!='string'||a.preset!=='default'&&r!=='sm'?r:SIZES_MAPPING_RULES[r]??r;return jsx(Root,{...a,size:m,ref:e,children:a.loading?jsx(Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):s??(!a.src&&jsx(Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...o,children:abbreviateCaption(i||a.title||'')}))})})),{displayName:'Avatar',sizes:t=>t.preset==='brand'?t.square?SIZES_SQUARE:SIZES:SIZES_DEFAULT});export{Avatar,SIZES,SIZES_SQUARE};
2
2
  //# sourceMappingURL=Avatar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.mjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? SIZES_MAPPING_RULES[size] ?? size\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n <>\n {children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n ))}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","_Fragment","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"wZAsBMA,MAAAA,OAAuDC,gBAC3DC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADAO,oBAAoBP,IAASA,EAGnC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE5DP,IAAAQ,SAAA,CAAAd,SACGA,KACGE,EAAUa,KACVT,IAACU,KAAI,CACHN,GAAG,OACHO,WAAW,UACXnB,KAAK,UACLoB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNtB,EAASC,SAEZsB,kBAAkBrB,GAAQC,EAAUqB,OAAS,UAK5C,IAGlB,CACEC,YAhDmB,SAiDnBC,MAAQ7B,GACFA,EAAMQ,SAAW,QACZR,EAAM8B,OAASC,aAAeC,MAGhCC"}
1
+ {"version":3,"file":"Avatar.mjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef<HTMLSpanElement, MergedProps<AvatarProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? (SIZES_MAPPING_RULES[size] ?? size)\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n (children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n )))\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"+YAuBMA,MAAAA,OAAuDC,gBAC3DC,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADCO,oBAAoBP,IAASA,EAGpC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE3Db,KACCE,EAAUY,KACVR,IAACS,KAAI,CACHL,GAAG,OACHM,WAAW,UACXlB,KAAK,UACLmB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNrB,EAASC,SAEZqB,kBAAkBpB,GAAQC,EAAUoB,OAAS,QAIxC,IAGlB,CACEC,YA9CmB,SA+CnBC,MAAQ5B,GACFA,EAAMQ,SAAW,QACZR,EAAM6B,OAASC,aAAeC,MAGhCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"uCAAkCA,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,WAC7BD,GAAgBG,OAAOC,cAAcH,GAEzC,CAEA,OAAOD,CAAY,GAClB,KAAO"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n // eslint-disable-next-line no-param-reassign\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"uCAAkCA,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,WAE7BD,GAAgBG,OAAOC,cAAcH,GAEzC,CAEA,OAAOD,CAAY,GAClB,KAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["abbreviateCaption","caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"AAAO,MAAMA,kBAAqBC,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,WAC7BD,GAAgBG,OAAOC,cAAcH,GAEzC,CAEA,OAAOD,CAAY,GAClB,KAAO"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n // eslint-disable-next-line no-param-reassign\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["abbreviateCaption","caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"AAAO,MAAMA,kBAAqBC,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,WAE7BD,GAAgBG,OAAOC,cAAcH,GAEzC,CAEA,OAAOD,CAAY,GAClB,KAAO"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var style=require('./style.js');var constants=require('./constants.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Badge=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:s="s",borderRadius:t=3,textProps:i={},iconProps:n={},children:o,content:c,icon:a,...d}=e;const[x,u]=Array.isArray(a)?a:[a];const j={as:'span',size:'inherit',color:'inherit',marginLeft:x?'0.25em':void 0,marginRight:u?'0.25em':void 0};const p={color:'inherit'};return jsxRuntime.jsx(style.Root,{...d,size:s,borderRadius:t,ref:r,children:typeof o=='function'?o({baseTextProps:j,textProps:i,iconBaseProps:p,iconProps:n,icon:a}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[x&&jsxRuntime.jsx(Icon.Icon,{name:typeof x=='string'?x:void 0,icon:typeof x!='string'?x:void 0,...p,...n}),(o||c)&&jsxRuntime.jsx(Text.Text,{...j,...i,children:o||c}),u&&jsxRuntime.jsx(Icon.Icon,{name:typeof u=='string'?u:void 0,icon:typeof u!='string'?u:void 0,...p,...n})]})})})),{displayName:'Badge',sizes:e=>e.round?constants.SIZES_ROUND:constants.SIZES});exports.Badge=Badge;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var style=require('./style.js');var constants=require('./constants.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Badge=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:s="s",borderRadius:t=3,textProps:n={},iconProps:i={},children:o,content:c,icon:a,...d}=e;const[u,x]=Array.isArray(a)?a:[a];const j={as:'span',size:'inherit',color:'inherit',marginLeft:u?'0.25em':void 0,marginRight:x?'0.25em':void 0};const p={color:'inherit'};return jsxRuntime.jsx(style.Root,{...d,size:s,borderRadius:t,ref:r,children:typeof o=='function'?o({baseTextProps:j,textProps:n,iconBaseProps:p,iconProps:i,icon:a}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u?jsxRuntime.jsx(Icon.Icon,{name:typeof u=='string'?u:void 0,icon:typeof u!='string'?u:void 0,...p,...i}):null,o||c?jsxRuntime.jsx(Text.Text,{...j,...n,children:o||c}):null,x?jsxRuntime.jsx(Icon.Icon,{name:typeof x=='string'?x:void 0,icon:typeof x!='string'?x:void 0,...p,...i}):null]})})})),{displayName:'Badge',sizes:e=>e.round?constants.SIZES_ROUND:constants.SIZES});exports.Badge=Badge;
2
2
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before && (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n {(children || content) && (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n )}\n {after && (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"iSAsBO,MAAMA,MAAqDC,gBAAAA,gBAChEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,WAAAA,IAACC,MAAAA,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,WAAAC,KAAAC,oBAAA,CAAAnB,SACGI,CAAAA,GACCW,WAAAK,IAACC,UAAI,CACHC,YAAalB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,KAGNC,GAAYC,IACZc,WAAAA,IAACQ,KAAAA,KAAI,IAAKf,KAAmBV,EAASE,SACnCA,GAAYC,IAGhBI,GACCU,WAAAK,IAACC,UAAI,CACHC,YAAajB,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,QAKA,IAGlB,CACEyB,YArEmB,QAsEnBC,MAAQ/B,GAAWA,EAAMgC,MAAQC,UAAWA,YAAGC,UAAAA"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"iSAuBO,MAAMA,MAAqDC,gBAAAA,gBAChEC,MAAAA,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,WAAAA,IAACC,MAAAA,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,WAAAC,KAAAC,oBAAA,CAAAnB,SACGI,CAAAA,EACCW,WAAAK,IAACC,UAAI,CACHC,YAAalB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,WAAAA,IAACQ,KAAAA,KAAI,IAAKf,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,WAAAA,IAACM,KAAAA,KAAI,CACHC,YAAajB,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEyB,YArEmB,QAsEnBC,MAAQ/B,GAAWA,EAAMgC,MAAQC,UAAWA,YAAGC,UAAAA"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Root}from'./style.mjs';import{SIZES_ROUND,SIZES}from'./constants.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const Badge=withMergedProps(forwardRef(((o,r)=>{const{size:e="s",borderRadius:t=3,textProps:s={},iconProps:i={},children:n,content:c,icon:m,...a}=o;const[d,p]=Array.isArray(m)?m:[m];const f={as:'span',size:'inherit',color:'inherit',marginLeft:d?'0.25em':void 0,marginRight:p?'0.25em':void 0};const x={color:'inherit'};return jsx(Root,{...a,size:e,borderRadius:t,ref:r,children:typeof n=='function'?n({baseTextProps:f,textProps:s,iconBaseProps:x,iconProps:i,icon:m}):jsxs(Fragment,{children:[d&&jsx(Icon,{name:typeof d=='string'?d:void 0,icon:typeof d!='string'?d:void 0,...x,...i}),(n||c)&&jsx(Text,{...f,...s,children:n||c}),p&&jsx(Icon,{name:typeof p=='string'?p:void 0,icon:typeof p!='string'?p:void 0,...x,...i})]})})})),{displayName:'Badge',sizes:o=>o.round?SIZES_ROUND:SIZES});export{Badge};
1
+ import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Root}from'./style.mjs';import{SIZES_ROUND,SIZES}from'./constants.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const Badge=withMergedProps(forwardRef(((o,r)=>{const{size:e="s",borderRadius:t=3,textProps:s={},iconProps:i={},children:n,content:c,icon:m,...a}=o;const[d,p]=Array.isArray(m)?m:[m];const f={as:'span',size:'inherit',color:'inherit',marginLeft:d?'0.25em':void 0,marginRight:p?'0.25em':void 0};const x={color:'inherit'};return jsx(Root,{...a,size:e,borderRadius:t,ref:r,children:typeof n=='function'?n({baseTextProps:f,textProps:s,iconBaseProps:x,iconProps:i,icon:m}):jsxs(Fragment,{children:[d?jsx(Icon,{name:typeof d=='string'?d:void 0,icon:typeof d!='string'?d:void 0,...x,...i}):null,n||c?jsx(Text,{...f,...s,children:n||c}):null,p?jsx(Icon,{name:typeof p=='string'?p:void 0,icon:typeof p!='string'?p:void 0,...x,...i}):null]})})})),{displayName:'Badge',sizes:o=>o.round?SIZES_ROUND:SIZES});export{Badge};
2
2
  //# sourceMappingURL=Badge.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before && (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n {(children || content) && (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n )}\n {after && (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"8RAsBO,MAAMA,MAAqDC,gBAChEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,IAACC,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,KAAAC,SAAA,CAAAlB,SACGI,CAAAA,GACCW,IAACI,KAAI,CACHC,YAAahB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,KAGNC,GAAYC,IACZc,IAACM,KAAI,IAAKb,KAAmBV,EAASE,SACnCA,GAAYC,IAGhBI,GACCU,IAACI,KAAI,CACHC,YAAaf,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,QAKA,IAGlB,CACEuB,YArEmB,QAsEnBC,MAAQ7B,GAAWA,EAAM8B,MAAQC,YAAcC"}
1
+ {"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"8RAuBO,MAAMA,MAAqDC,gBAChEC,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,IAACC,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,KAAAC,SAAA,CAAAlB,SACGI,CAAAA,EACCW,IAACI,KAAI,CACHC,YAAahB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,IAACM,KAAI,IAAKb,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,IAACI,KAAI,CACHC,YAAaf,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEuB,YArEmB,QAsEnBC,MAAQ7B,GAAWA,EAAM8B,MAAQC,YAAcC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var styled=require('styled-components');var useClassname=require('../../hooks/useClassname.js');var withMergedProps=require('../../hocs/withMergedProps.js');var hooks=require('./hooks.js');var constants=require('./constants.js');var defaultConstants=require('./default-constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Button=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{let{size:t="m",inline:n=!0,rounded:o=!0,color:r="accent",fontColor:a="white",textProps:i={},iconProps:c={},as:u,className:l,children:d,content:m,fontWeight:p,icon:x,innerRef:h,...j}=e;const f=styled.useTheme();j.preset!=='default'||typeof t!='string'||j.round||(j={...defaultConstants.PROPS_BY_SIZE[t]??{},...j}),j.href&&(u='a'),j.to&&(u=f.link),j.disabled&&(u='button'),j.primary&&(r='primary'),j.secondary&&(r='atlantis');const R=useClassname.useClassname("Button",l);const y=useClassname.useClassname("Button");const S=hooks.useComputedRel(f,j);const g=hooks.useComputedLinkProps(u,j);let[v,I]=Array.isArray(x)?x:[x];j.success&&(v='checkFill',I=null),j.preset==='brand'&&j.loading&&(v=jsxRuntime.jsx(style.LoaderIcon,{}),I=null);const C={as:'span',size:'inherit',color:'inherit',weight:p??(j.preset==='brand'?800:600),lineHeight:j.preset==='brand'?1.2:1,marginLeft:v?'0.25em':void 0,marginRight:I?'0.25em':void 0};const P={as:'span',color:'inherit'};return jsxRuntime.jsx(style.Root,{...j,...g,size:t,inline:n,color:r,fontColor:a,rounded:o,rel:S,as:u,className:R,ref:s??h,children:typeof d=='function'?d({baseTextProps:C,textProps:i,iconBaseProps:P,iconProps:c,icon:[v,I]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v&&jsxRuntime.jsx(Icon.Icon,{className:"icon",name:typeof v=='string'?v:void 0,icon:typeof v!='string'?v:void 0,...P,...c}),(d||m)&&jsxRuntime.jsx(Text.Text,{className:`${y}__content`,...C,...i,children:d||m}),I&&jsxRuntime.jsx(Icon.Icon,{className:"icon",name:typeof I=='string'?I:void 0,icon:typeof I!='string'?I:void 0,...P,...c})]})})})),{displayName:"Button",sizes:e=>{let s=e.preset==='brand'?constants.SIZES:defaultConstants.SIZES_DEFAULT;return e.round&&(s=e.preset==='brand'?constants.SIZES_ROUND:defaultConstants.SIZES_ROUND_DEFAULT),s}});exports.SIZES=constants.SIZES,exports.SIZES_ROUND=constants.SIZES_ROUND,exports.Button=Button,exports.COMPONENT_NAME="Button";
1
+ 'use strict';var React=require('react');var styled=require('styled-components');var useClassname=require('../../hooks/useClassname.js');var withMergedProps=require('../../hocs/withMergedProps.js');var hooks=require('./hooks.js');var constants=require('./constants.js');var defaultConstants=require('./default-constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Button=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{let{size:t="m",inline:n=!0,rounded:o=!0,color:r="accent",fontColor:a="white",textProps:i={},iconProps:c={},as:l,className:u,children:d,content:m,fontWeight:p,icon:x,innerRef:h,...j}=e;const f=styled.useTheme();j.preset!=='default'||typeof t!='string'||j.round||(j={...defaultConstants.PROPS_BY_SIZE[t]??{},...j}),j.href&&(l='a'),j.to&&(l=f.link),j.disabled&&(l='button'),j.primary&&(r='primary'),j.secondary&&(r='atlantis');const R=useClassname.useClassname("Button",u);const y=useClassname.useClassname("Button");const S=hooks.useComputedRel(f,j);const g=hooks.useComputedLinkProps(l,j);let[v,I]=Array.isArray(x)?x:[x];j.success&&(v='checkFill',I=null),j.preset==='brand'&&j.loading&&(v=jsxRuntime.jsx(style.LoaderIcon,{}),I=null);const C={as:'span',size:'inherit',color:'inherit',weight:p??(j.preset==='brand'?800:600),lineHeight:j.preset==='brand'?1.2:1,marginLeft:v?'0.25em':void 0,marginRight:I?'0.25em':void 0};const P={as:'span',color:'inherit'};return jsxRuntime.jsx(style.Root,{...j,...g,size:t,inline:n,color:r,fontColor:a,rounded:o,rel:S,as:l,className:R,ref:s??h,children:typeof d=='function'?d({baseTextProps:C,textProps:i,iconBaseProps:P,iconProps:c,icon:[v,I]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v?jsxRuntime.jsx(Icon.Icon,{className:"icon",name:typeof v=='string'?v:void 0,icon:typeof v!='string'?v:void 0,...P,...c}):null,d||m?jsxRuntime.jsx(Text.Text,{className:`${y}__content`,...C,...i,children:d||m}):null,I?jsxRuntime.jsx(Icon.Icon,{className:"icon",name:typeof I=='string'?I:void 0,icon:typeof I!='string'?I:void 0,...P,...c}):null]})})})),{displayName:"Button",sizes:e=>{let s=e.preset==='brand'?constants.SIZES:defaultConstants.SIZES_DEFAULT;return e.round&&(s=e.preset==='brand'?constants.SIZES_ROUND:defaultConstants.SIZES_ROUND_DEFAULT),s}});exports.SIZES=constants.SIZES,exports.SIZES_ROUND=constants.SIZES_ROUND,exports.Button=Button,exports.COMPONENT_NAME="Button";
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before && (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n {(children || content) && (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n )}\n {after && (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"wdA0BMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAW,CAACC,EAAOC,KACjB,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,OAAAA,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,iBAAAA,cAAcpB,IAAS,CAAA,KACVe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aAAAA,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,0BA/CH,UAgDnB,MAAME,EAAMC,MAAAA,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,MAAAA,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,WAAAC,IAACC,qBACVP,EAAQ,MAGV,MAAMQ,EAA2B,CAC/BpC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPyC,OAAQhC,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D2B,WAAY9B,EAAUG,SAAW,QAAU,IAAM,EACjD4B,WAAYZ,EAAS,cAAWa,EAChCC,YAAab,EAAQ,cAAWY,GAGlC,MAAME,EAA2B,CAAE1C,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,WAAAA,IAACE,MAAAA,KAAW,IACN3B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPiC,gBACAtC,YACA4C,gBACA3C,YACAO,KAAM,CAACqB,EAAQC,KAGjBe,WAAAC,KAAAC,oBAAA,CAAA1C,SACGwB,CAAAA,GACCM,WAAAC,IAACY,UAAI,CACH5C,UAAU,OACV6C,YAAapB,GAAW,SAAWA,OAASa,EAC5ClC,YAAaqB,GAAW,SAAWA,OAASa,KACxCE,KACA3C,KAGNI,GAAYC,IACZ6B,WAAAA,IAACe,KAAAA,KAAI,CAAC9C,UAAW,GAAGoB,gBAA8Bc,KAAmBtC,EAASK,SAC3EA,GAAYC,IAGhBwB,GACCK,WAAAC,IAACY,UAAI,CACH5C,UAAU,OACV6C,YAAanB,GAAU,SAAWA,OAAQY,EAC1ClC,YAAasB,GAAU,SAAWA,OAAQY,KACtCE,KACA3C,QAKA,IAGlB,CACEkD,YAhImB,SAiInBC,MAAQ3D,IACN,IAAI2D,EAAQ3D,EAAMoB,SAAW,QAAUwC,UAAAA,MAAQC,iBAAAA,cAG/C,OAFI7D,EAAMqB,QAAOsC,EAAQ3D,EAAMoB,SAAW,QAAU0C,UAAWA,YAAGC,sCAE3DJ,CAAK,yHArIK"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"wdA6BMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,OAAAA,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,iBAAAA,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aAAAA,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,0BA/CH,UAgDnB,MAAME,EAAMC,MAAAA,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,MAAAA,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,WAAAC,IAACC,qBACVP,EAAQ,MAGV,MAAMQ,EAA2B,CAC/BpC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPyC,OAAQhC,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D2B,WAAY9B,EAAUG,SAAW,QAAU,IAAM,EACjD4B,WAAYZ,EAAS,cAAWa,EAChCC,YAAab,EAAQ,cAAWY,GAGlC,MAAME,EAA2B,CAAE1C,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,WAAAA,IAACE,MAAAA,KAAW,IACN3B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPiC,gBACAtC,YACA4C,gBACA3C,YACAO,KAAM,CAACqB,EAAQC,KAGjBe,WAAAC,KAAAC,oBAAA,CAAA1C,SACGwB,CAAAA,EACCM,WAAAC,IAACY,UAAI,CACH5C,UAAU,OACV6C,YAAapB,GAAW,SAAWA,OAASa,EAC5ClC,YAAaqB,GAAW,SAAWA,OAASa,KACxCE,KACA3C,IAEJ,KACHI,GAAYC,EACX6B,WAAAA,IAACe,KAAAA,KAAI,CAAC9C,UAAW,GAAGoB,gBAA8Bc,KAAmBtC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,WAAAA,IAACa,KAAAA,KAAI,CACH5C,UAAU,OACV6C,YAAanB,GAAU,SAAWA,OAAQY,EAC1ClC,YAAasB,GAAU,SAAWA,OAAQY,KACtCE,KACA3C,IAEJ,SAGI,IAGlB,CACEkD,YAhImB,SAiInBC,MAAQ3D,IACN,IAAI2D,EAAQ3D,EAAMoB,SAAW,QAAUwC,UAAAA,MAAQC,iBAAAA,cAG/C,OAFI7D,EAAMqB,QAAOsC,EAAQ3D,EAAMoB,SAAW,QAAU0C,UAAWA,YAAGC,sCAE3DJ,CAAK,yHArIK"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{useTheme}from'styled-components';import{useClassname}from'../../hooks/useClassname.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useComputedRel,useComputedLinkProps}from'./hooks.mjs';import{SIZES,SIZES_ROUND}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_ROUND_DEFAULT,PROPS_BY_SIZE}from'./default-constants.mjs';import{Root,LoaderIcon}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const COMPONENT_NAME='Button';const Button=withMergedProps(forwardRef(((o,e)=>{let{size:t="m",inline:s=!0,rounded:r=!0,color:n="accent",fontColor:i="white",textProps:a={},iconProps:m={},as:c,className:p,children:l,content:d,fontWeight:u,icon:f,innerRef:S,...h}=o;const E=useTheme();h.preset!=='default'||typeof t!='string'||h.round||(h={...PROPS_BY_SIZE[t]??{},...h}),h.href&&(c='a'),h.to&&(c=E.link),h.disabled&&(c='button'),h.primary&&(n='primary'),h.secondary&&(n='atlantis');const I=useClassname("Button",p);const g=useClassname("Button");const j=useComputedRel(E,h);const x=useComputedLinkProps(c,h);let[N,P]=Array.isArray(f)?f:[f];h.success&&(N='checkFill',P=null),h.preset==='brand'&&h.loading&&(N=jsx(LoaderIcon,{}),P=null);const _={as:'span',size:'inherit',color:'inherit',weight:u??(h.preset==='brand'?800:600),lineHeight:h.preset==='brand'?1.2:1,marginLeft:N?'0.25em':void 0,marginRight:P?'0.25em':void 0};const R={as:'span',color:'inherit'};return jsx(Root,{...h,...x,size:t,inline:s,color:n,fontColor:i,rounded:r,rel:j,as:c,className:I,ref:e??S,children:typeof l=='function'?l({baseTextProps:_,textProps:a,iconBaseProps:R,iconProps:m,icon:[N,P]}):jsxs(Fragment,{children:[N&&jsx(Icon,{className:"icon",name:typeof N=='string'?N:void 0,icon:typeof N!='string'?N:void 0,...R,...m}),(l||d)&&jsx(Text,{className:`${g}__content`,..._,...a,children:l||d}),P&&jsx(Icon,{className:"icon",name:typeof P=='string'?P:void 0,icon:typeof P!='string'?P:void 0,...R,...m})]})})})),{displayName:"Button",sizes:o=>{let e=o.preset==='brand'?SIZES:SIZES_DEFAULT;return o.round&&(e=o.preset==='brand'?SIZES_ROUND:SIZES_ROUND_DEFAULT),e}});export{Button,COMPONENT_NAME,SIZES,SIZES_ROUND};
1
+ import{forwardRef}from'react';import{useTheme}from'styled-components';import{useClassname}from'../../hooks/useClassname.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useComputedRel,useComputedLinkProps}from'./hooks.mjs';import{SIZES,SIZES_ROUND}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_ROUND_DEFAULT,PROPS_BY_SIZE}from'./default-constants.mjs';import{Root,LoaderIcon}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const COMPONENT_NAME='Button';const Button=withMergedProps(forwardRef(((o,e)=>{let{size:t="m",inline:s=!0,rounded:n=!0,color:r="accent",fontColor:i="white",textProps:a={},iconProps:m={},as:c,className:l,children:p,content:d,fontWeight:u,icon:f,innerRef:S,...h}=o;const E=useTheme();h.preset!=='default'||typeof t!='string'||h.round||(h={...PROPS_BY_SIZE[t]??{},...h}),h.href&&(c='a'),h.to&&(c=E.link),h.disabled&&(c='button'),h.primary&&(r='primary'),h.secondary&&(r='atlantis');const I=useClassname("Button",l);const g=useClassname("Button");const j=useComputedRel(E,h);const x=useComputedLinkProps(c,h);let[N,P]=Array.isArray(f)?f:[f];h.success&&(N='checkFill',P=null),h.preset==='brand'&&h.loading&&(N=jsx(LoaderIcon,{}),P=null);const _={as:'span',size:'inherit',color:'inherit',weight:u??(h.preset==='brand'?800:600),lineHeight:h.preset==='brand'?1.2:1,marginLeft:N?'0.25em':void 0,marginRight:P?'0.25em':void 0};const R={as:'span',color:'inherit'};return jsx(Root,{...h,...x,size:t,inline:s,color:r,fontColor:i,rounded:n,rel:j,as:c,className:I,ref:e??S,children:typeof p=='function'?p({baseTextProps:_,textProps:a,iconBaseProps:R,iconProps:m,icon:[N,P]}):jsxs(Fragment,{children:[N?jsx(Icon,{className:"icon",name:typeof N=='string'?N:void 0,icon:typeof N!='string'?N:void 0,...R,...m}):null,p||d?jsx(Text,{className:`${g}__content`,..._,...a,children:p||d}):null,P?jsx(Icon,{className:"icon",name:typeof P=='string'?P:void 0,icon:typeof P!='string'?P:void 0,...R,...m}):null]})})})),{displayName:"Button",sizes:o=>{let e=o.preset==='brand'?SIZES:SIZES_DEFAULT;return o.round&&(e=o.preset==='brand'?SIZES_ROUND:SIZES_ROUND_DEFAULT),e}});export{Button,COMPONENT_NAME,SIZES,SIZES_ROUND};
2
2
  //# sourceMappingURL=Button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before && (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n {(children || content) && (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n )}\n {after && (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["COMPONENT_NAME","Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"0hBAcMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAW,CAACC,EAAOC,KACjB,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,cAAcpB,IAAS,CAAA,KACVe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,aA/CH,UAgDnB,MAAME,EAAMC,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,IAACC,eACVN,EAAQ,MAGV,MAAMO,EAA2B,CAC/BnC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPwC,OAAQ/B,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D0B,WAAY7B,EAAUG,SAAW,QAAU,IAAM,EACjD2B,WAAYX,EAAS,cAAWY,EAChCC,YAAaZ,EAAQ,cAAWW,GAGlC,MAAME,EAA2B,CAAEzC,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,IAACC,KAAW,IACN1B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPgC,gBACArC,YACA2C,gBACA1C,YACAO,KAAM,CAACqB,EAAQC,KAGjBc,KAAAC,SAAA,CAAAxC,SACGwB,CAAAA,GACCM,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAalB,GAAW,SAAWA,OAASY,EAC5CjC,YAAaqB,GAAW,SAAWA,OAASY,KACxCE,KACA1C,KAGNI,GAAYC,IACZ6B,IAACa,KAAI,CAAC5C,UAAW,GAAGoB,gBAA8Ba,KAAmBrC,EAASK,SAC3EA,GAAYC,IAGhBwB,GACCK,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAajB,GAAU,SAAWA,OAAQW,EAC1CjC,YAAasB,GAAU,SAAWA,OAAQW,KACtCE,KACA1C,QAKA,IAGlB,CACEgD,YAhImB,SAiInBC,MAAQzD,IACN,IAAIyD,EAAQzD,EAAMoB,SAAW,QAAUsC,MAAQC,cAG/C,OAFI3D,EAAMqB,QAAOoC,EAAQzD,EAAMoB,SAAW,QAAUwC,YAAcC,qBAE3DJ,CAAK"}
1
+ {"version":3,"file":"Button.mjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["COMPONENT_NAME","Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"0hBAiBMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,aA/CH,UAgDnB,MAAME,EAAMC,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,IAACC,eACVN,EAAQ,MAGV,MAAMO,EAA2B,CAC/BnC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPwC,OAAQ/B,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D0B,WAAY7B,EAAUG,SAAW,QAAU,IAAM,EACjD2B,WAAYX,EAAS,cAAWY,EAChCC,YAAaZ,EAAQ,cAAWW,GAGlC,MAAME,EAA2B,CAAEzC,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,IAACC,KAAW,IACN1B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPgC,gBACArC,YACA2C,gBACA1C,YACAO,KAAM,CAACqB,EAAQC,KAGjBc,KAAAC,SAAA,CAAAxC,SACGwB,CAAAA,EACCM,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAalB,GAAW,SAAWA,OAASY,EAC5CjC,YAAaqB,GAAW,SAAWA,OAASY,KACxCE,KACA1C,IAEJ,KACHI,GAAYC,EACX6B,IAACa,KAAI,CAAC5C,UAAW,GAAGoB,gBAA8Ba,KAAmBrC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAajB,GAAU,SAAWA,OAAQW,EAC1CjC,YAAasB,GAAU,SAAWA,OAAQW,KACtCE,KACA1C,IAEJ,SAGI,IAGlB,CACEgD,YAhImB,SAiInBC,MAAQzD,IACN,IAAIyD,EAAQzD,EAAMoB,SAAW,QAAUsC,MAAQC,cAG/C,OAFI3D,EAAMqB,QAAOoC,EAAQzD,EAAMoB,SAAW,QAAUwC,YAAcC,qBAE3DJ,CAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["_as","config","props","undefined","disabled","href","to","target","theme","relBuilder","utils","rel","autoRel"],"mappings":"0CAmBO,CAA8BA,EAAwBC,KAC3D,IAAIC,EAAQ,CAAA,EAEZ,OAAIF,SAAQG,GAAaF,EAAOG,WAE5BJ,IAAQ,IACVE,EAAQ,CAAEG,KAAMJ,EAAOI,MAAQJ,EAAOK,GAAIC,OAAQN,EAAOM,eACzCP,GAAQ,WACxBE,EAAQ,CAAEI,GAAIL,EAAOK,IAAML,EAAOI,QALaH,CASnD,yBA5BO,CAAwBM,EAAqBP,KAClD,MAAMQ,EAAaD,EAAME,OAAOD,WAEhC,IAAIE,EAUJ,OARIV,EAAOI,OACTM,EAAMV,EAAOU,KAERA,GAAOF,GAAcR,EAAOW,UAAYX,EAAOI,MAAQJ,EAAOK,MACjEK,EAAMF,EAAWR,EAAOI,MAAQJ,EAAOK,GAAIL,EAAOM,UAI/CI,CACT"}
1
+ {"version":3,"file":"hooks.js","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["_as","config","props","undefined","disabled","href","to","target","theme","relBuilder","utils","rel","autoRel"],"mappings":"0CAmBO,CAA8BA,EAAwBC,KAC3D,IAAIC,EAAQ,CAAA,EAEZ,OAAIF,SAAQG,GAAaF,EAAOG,WAE5BJ,IAAQ,IACVE,EAAQ,CAAEG,KAAMJ,EAAOI,MAAQJ,EAAOK,GAAIC,OAAQN,EAAOM,eACzCP,GAAQ,WACxBE,EAAQ,CAAEI,GAAIL,EAAOK,IAAML,EAAOI,QALaH,CASnD,yBA5BO,CAAwBM,EAAqBP,KAClD,MAAMQ,EAAaD,EAAME,OAAOD,WAEhC,IAAIE,EAUJ,OARIV,EAAOI,OACTM,EAAMV,EAAOU,KAERA,GAAOF,GAAcR,EAAOW,UAAYX,EAAOI,MAAQJ,EAAOK,MACjEK,EAAMF,EAAWR,EAAOI,MAAQJ,EAAOK,GAAIL,EAAOM,UAI/CI,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.mjs","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["useComputedRel","theme","config","relBuilder","utils","rel","href","autoRel","to","target","useComputedLinkProps","_as","props","undefined","disabled"],"mappings":"AAGO,SAASA,eAAeC,EAAqBC,GAClD,MAAMC,EAAaF,EAAMG,OAAOD,WAEhC,IAAIE,EAUJ,OARIH,EAAOI,OACTD,EAAMH,EAAOG,KAERA,GAAOF,GAAcD,EAAOK,UAAYL,EAAOI,MAAQJ,EAAOM,MACjEH,EAAMF,EAAWD,EAAOI,MAAQJ,EAAOM,GAAIN,EAAOO,UAI/CJ,CACT,CAEO,SAASK,qBAAqBC,EAAwBT,GAC3D,IAAIU,EAAQ,CAAA,EAEZ,OAAID,SAAQE,GAAaX,EAAOY,WAE5BH,IAAQ,IACVC,EAAQ,CAAEN,KAAMJ,EAAOI,MAAQJ,EAAOM,GAAIC,OAAQP,EAAOO,eACzCE,GAAQ,WACxBC,EAAQ,CAAEJ,GAAIN,EAAOM,IAAMN,EAAOI,QALaM,CASnD"}
1
+ {"version":3,"file":"hooks.mjs","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["useComputedRel","theme","config","relBuilder","utils","rel","href","autoRel","to","target","useComputedLinkProps","_as","props","undefined","disabled"],"mappings":"AAGO,SAASA,eAAeC,EAAqBC,GAClD,MAAMC,EAAaF,EAAMG,OAAOD,WAEhC,IAAIE,EAUJ,OARIH,EAAOI,OACTD,EAAMH,EAAOG,KAERA,GAAOF,GAAcD,EAAOK,UAAYL,EAAOI,MAAQJ,EAAOM,MACjEH,EAAMF,EAAWD,EAAOI,MAAQJ,EAAOM,GAAIN,EAAOO,UAI/CJ,CACT,CAEO,SAASK,qBAAqBC,EAAwBT,GAC3D,IAAIU,EAAQ,CAAA,EAEZ,OAAID,SAAQE,GAAaX,EAAOY,WAE5BH,IAAQ,IACVC,EAAQ,CAAEN,KAAMJ,EAAOI,MAAQJ,EAAOM,GAAIC,OAAQP,EAAOO,eACzCE,GAAQ,WACxBC,EAAQ,CAAEJ,GAAIN,EAAOM,IAAMN,EAAOI,QALaM,CASnD"}