@foxford/ui 2.59.0 → 2.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/components/Accordion/Accordion.js +1 -1
  2. package/components/Accordion/Accordion.js.map +1 -1
  3. package/components/Accordion/Accordion.mjs +1 -1
  4. package/components/Accordion/Accordion.mjs.map +1 -1
  5. package/components/ActionBtn/ActionBtn.js +1 -1
  6. package/components/Alert/Alert.js +1 -1
  7. package/components/Alert/Alert.js.map +1 -1
  8. package/components/Alert/Alert.mjs +1 -1
  9. package/components/Alert/Alert.mjs.map +1 -1
  10. package/components/Alert/CountdownCircle.js +1 -1
  11. package/components/Amount/Amount.js +1 -1
  12. package/components/Anchor/Anchor.js +1 -1
  13. package/components/Anchor/style.js +1 -1
  14. package/components/Anchor/style.js.map +1 -1
  15. package/components/Anchor/style.mjs +1 -1
  16. package/components/Anchor/style.mjs.map +1 -1
  17. package/components/Arrow/Arrow.js +1 -1
  18. package/components/Arrow/style.js +1 -1
  19. package/components/Arrow/style.js.map +1 -1
  20. package/components/Arrow/style.mjs +1 -1
  21. package/components/Arrow/style.mjs.map +1 -1
  22. package/components/ArrowBadge/ArrowBadge.js +1 -1
  23. package/components/Avatar/Avatar.js +1 -1
  24. package/components/Badge/Badge.js +1 -1
  25. package/components/Button/Button.js +1 -1
  26. package/components/Button/style.js +1 -1
  27. package/components/Button/style.js.map +1 -1
  28. package/components/Button/style.mjs +1 -1
  29. package/components/Button/style.mjs.map +1 -1
  30. package/components/Checkbox/Checkbox.js +1 -1
  31. package/components/Checkbox/Group.js +1 -1
  32. package/components/Checkbox/style.js +1 -1
  33. package/components/Checkbox/style.js.map +1 -1
  34. package/components/Checkbox/style.mjs +1 -1
  35. package/components/Checkbox/style.mjs.map +1 -1
  36. package/components/Chip/Chip.js +1 -1
  37. package/components/Chip/style.js +1 -1
  38. package/components/Chip/style.js.map +1 -1
  39. package/components/Chip/style.mjs +1 -1
  40. package/components/Chip/style.mjs.map +1 -1
  41. package/components/Container/Container.js +1 -1
  42. package/components/ContextMenu/ContextMenu.js +1 -1
  43. package/components/ContextMenu/Item.js +1 -1
  44. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js +1 -1
  45. package/components/ContextMenu.Multilevel/Controls.js +1 -1
  46. package/components/ContextMenu.Multilevel/Heading.js +1 -1
  47. package/components/ContextMenu.Multilevel/SubHeading.js +1 -1
  48. package/components/Dialog/Dialog.js +1 -1
  49. package/components/Dialog/Dialog.js.map +1 -1
  50. package/components/Dialog/Dialog.mjs.map +1 -1
  51. package/components/DialogComponent/DialogComponent.js +1 -1
  52. package/components/DialogComponent/DialogComponent.js.map +1 -1
  53. package/components/DialogComponent/DialogComponent.mjs +1 -1
  54. package/components/DialogComponent/DialogComponent.mjs.map +1 -1
  55. package/components/DialogComponent/DialogContainer.js +1 -1
  56. package/components/Dropdown/Dropdown.js +1 -1
  57. package/components/Dropdown/Dropdown.js.map +1 -1
  58. package/components/Dropdown/Dropdown.mjs +1 -1
  59. package/components/Dropdown/Dropdown.mjs.map +1 -1
  60. package/components/Dropdown/DropdownMenu.js +1 -1
  61. package/components/Dropdown/DropdownMenu.js.map +1 -1
  62. package/components/Dropdown/DropdownMenu.mjs +1 -1
  63. package/components/Dropdown/DropdownMenu.mjs.map +1 -1
  64. package/components/Dropdown/DropdownMenuNoOptions.js +1 -1
  65. package/components/Dropdown/style.js +1 -1
  66. package/components/Dropdown/style.js.map +1 -1
  67. package/components/Dropdown/style.mjs +1 -1
  68. package/components/Dropdown/style.mjs.map +1 -1
  69. package/components/FormInput/FormInput.js +1 -1
  70. package/components/FormInput/FormInput.js.map +1 -1
  71. package/components/FormInput/FormInput.mjs +1 -1
  72. package/components/FormInput/FormInput.mjs.map +1 -1
  73. package/components/FormInputLabel/FormInputLabel.js +1 -1
  74. package/components/FormInputLabel/style.js +1 -1
  75. package/components/FormInputLabel/style.js.map +1 -1
  76. package/components/FormInputLabel/style.mjs +1 -1
  77. package/components/FormInputLabel/style.mjs.map +1 -1
  78. package/components/FormLabel/FormLabel.js +1 -1
  79. package/components/FormLabel/style.js +1 -1
  80. package/components/FormLabel/style.js.map +1 -1
  81. package/components/FormLabel/style.mjs +1 -1
  82. package/components/FormLabel/style.mjs.map +1 -1
  83. package/components/Icon/Icon.js +1 -1
  84. package/components/Icon/Icon.js.map +1 -1
  85. package/components/Icon/Icon.mjs +1 -1
  86. package/components/Icon/Icon.mjs.map +1 -1
  87. package/components/Icon/list/icon-pack.js +1 -1
  88. package/components/Icon/list/icon-pack.js.map +1 -1
  89. package/components/Icon/list/icon-pack.mjs +1 -1
  90. package/components/Icon/list/icon-pack.mjs.map +1 -1
  91. package/components/IconButton/IconButton.js +1 -1
  92. package/components/IconButton/style.js +1 -1
  93. package/components/IconButton/style.js.map +1 -1
  94. package/components/IconButton/style.mjs +1 -1
  95. package/components/IconButton/style.mjs.map +1 -1
  96. package/components/Indicator/Indicator.js +1 -1
  97. package/components/Input/Input.js +1 -1
  98. package/components/Input/Input.js.map +1 -1
  99. package/components/Input/Input.mjs +1 -1
  100. package/components/Input/Input.mjs.map +1 -1
  101. package/components/Input/style.js +1 -1
  102. package/components/Input/style.js.map +1 -1
  103. package/components/Input/style.mjs +1 -1
  104. package/components/Input/style.mjs.map +1 -1
  105. package/components/Input.Phone/Input.Phone.js +1 -1
  106. package/components/Input.Phone/Input.Phone.js.map +1 -1
  107. package/components/Input.Phone/Input.Phone.mjs.map +1 -1
  108. package/components/InputCheckbox/InputCheckbox.js +1 -1
  109. package/components/InputRadio/InputRadio.js +1 -1
  110. package/components/ListItem/ListItem.js +1 -1
  111. package/components/Menu/Menu.js +1 -1
  112. package/components/Menu/Menu.js.map +1 -1
  113. package/components/Menu/Menu.mjs.map +1 -1
  114. package/components/MenuComponent/MenuComponent.js +1 -1
  115. package/components/MenuContainer/MenuContainer.js +1 -1
  116. package/components/MenuDivider/MenuDivider.js +1 -1
  117. package/components/MenuList/MenuList.js +1 -1
  118. package/components/Modal/Close.js +1 -1
  119. package/components/Modal/Modal.js +1 -1
  120. package/components/Modal/Modal.js.map +1 -1
  121. package/components/Modal/Modal.mjs.map +1 -1
  122. package/components/Modal/adapter.js +1 -1
  123. package/components/Notification/Notification.js +1 -1
  124. package/components/Paper/Paper.js +1 -1
  125. package/components/Popover/Popover.js +1 -1
  126. package/components/Popover/Popover.js.map +1 -1
  127. package/components/Popover/Popover.mjs.map +1 -1
  128. package/components/PopoverComponent/PopoverComponent.js +1 -1
  129. package/components/PopoverComponent/style.js +1 -1
  130. package/components/PopoverComponent/style.js.map +1 -1
  131. package/components/PopoverComponent/style.mjs +1 -1
  132. package/components/PopoverComponent/style.mjs.map +1 -1
  133. package/components/Progress/Progress.js +1 -1
  134. package/components/Progress/style.js +1 -1
  135. package/components/Progress/style.js.map +1 -1
  136. package/components/Progress/style.mjs +1 -1
  137. package/components/Progress/style.mjs.map +1 -1
  138. package/components/Progress.Circle/Progress.Circle.js +1 -1
  139. package/components/Progress.Segmented/Progress.Segmented.js +1 -1
  140. package/components/Radio/Group.js +1 -1
  141. package/components/Radio/Radio.js +1 -1
  142. package/components/Scrollable/Scrollable.js +1 -1
  143. package/components/Section/Section.js +1 -1
  144. package/components/Select/Select.js +1 -1
  145. package/components/Select/Select.js.map +1 -1
  146. package/components/Select/Select.mjs.map +1 -1
  147. package/components/Select/style.js +1 -1
  148. package/components/Select/style.js.map +1 -1
  149. package/components/Select/style.mjs +1 -1
  150. package/components/Select/style.mjs.map +1 -1
  151. package/components/Separator/Separator.js +1 -1
  152. package/components/Separator/SeparatorText.js +1 -1
  153. package/components/Skeleton/Skeleton.js +1 -1
  154. package/components/Spacer/Spacer.js +1 -1
  155. package/components/Spinner/Spinner.js +1 -1
  156. package/components/Switch/Knob.js +1 -1
  157. package/components/Switch/Switch.js +1 -1
  158. package/components/Switch/style.js +1 -1
  159. package/components/Switch/style.js.map +1 -1
  160. package/components/Switch/style.mjs +1 -1
  161. package/components/Switch/style.mjs.map +1 -1
  162. package/components/Switcher/Switcher.js +1 -1
  163. package/components/Switcher/style.js +1 -1
  164. package/components/Switcher/style.js.map +1 -1
  165. package/components/Switcher/style.mjs +1 -1
  166. package/components/Switcher/style.mjs.map +1 -1
  167. package/components/Tab/Tab.js +1 -1
  168. package/components/Tab/style.js +1 -1
  169. package/components/Tab/style.js.map +1 -1
  170. package/components/Tab/style.mjs +1 -1
  171. package/components/Tab/style.mjs.map +1 -1
  172. package/components/Tabs/Tabs.js +1 -1
  173. package/components/Tag/Tag.js +1 -1
  174. package/components/Text/Ellipsis.js +1 -1
  175. package/components/Text/Ellipsis.js.map +1 -1
  176. package/components/Text/Ellipsis.mjs +1 -1
  177. package/components/Text/Ellipsis.mjs.map +1 -1
  178. package/components/Text/Text.js +1 -1
  179. package/components/Text/style.js +1 -1
  180. package/components/Text/style.js.map +1 -1
  181. package/components/Text/style.mjs +1 -1
  182. package/components/Text/style.mjs.map +1 -1
  183. package/components/Text.Ellipse/Text.Ellipse.js +1 -1
  184. package/components/Text.Heading/Text.Heading.js +1 -1
  185. package/components/Textarea/Textarea.js +1 -1
  186. package/components/Textarea/Textarea.js.map +1 -1
  187. package/components/Textarea/Textarea.mjs +1 -1
  188. package/components/Textarea/Textarea.mjs.map +1 -1
  189. package/components/Tooltip/Tooltip.js +1 -1
  190. package/components/Tooltip/Tooltip.js.map +1 -1
  191. package/components/Tooltip/Tooltip.mjs +1 -1
  192. package/components/Tooltip/Tooltip.mjs.map +1 -1
  193. package/components/Tooltip/TooltipWrapper.js +1 -1
  194. package/components/Tooltip/default-constants.js.map +1 -1
  195. package/components/Tooltip/default-constants.mjs.map +1 -1
  196. package/components/TooltipComponent/TooltipComponent.js +1 -1
  197. package/components/TooltipComponent/style.js +1 -1
  198. package/components/TooltipComponent/style.js.map +1 -1
  199. package/components/TooltipComponent/style.mjs +1 -1
  200. package/components/TooltipComponent/style.mjs.map +1 -1
  201. package/components/Visibility/Visibility.js +1 -1
  202. package/dts/index.d.ts +273 -3560
  203. package/hocs/withMergedProps.js +1 -1
  204. package/hocs/withTranslation.js +1 -1
  205. package/hooks/useResizeObserver.js +2 -0
  206. package/hooks/useResizeObserver.js.map +1 -0
  207. package/hooks/useResizeObserver.mjs +2 -0
  208. package/hooks/useResizeObserver.mjs.map +1 -0
  209. package/package.json +16 -8
  210. package/theme/theme-provider.js +1 -1
  211. package/_virtual/ResizeObserver.js +0 -2
  212. package/_virtual/ResizeObserver.js.map +0 -1
  213. package/_virtual/ResizeObserver.mjs +0 -2
  214. package/_virtual/ResizeObserver.mjs.map +0 -1
  215. package/_virtual/_commonjsHelpers.js +0 -2
  216. package/_virtual/_commonjsHelpers.js.map +0 -1
  217. package/_virtual/_commonjsHelpers.mjs +0 -2
  218. package/_virtual/_commonjsHelpers.mjs.map +0 -1
  219. package/_virtual/index.js +0 -2
  220. package/_virtual/index.js.map +0 -1
  221. package/_virtual/index.mjs +0 -2
  222. package/_virtual/index.mjs.map +0 -1
  223. package/_virtual/index2.js +0 -2
  224. package/_virtual/index2.js.map +0 -1
  225. package/_virtual/index2.mjs +0 -2
  226. package/_virtual/index2.mjs.map +0 -1
  227. package/_virtual/index3.js +0 -2
  228. package/_virtual/index3.js.map +0 -1
  229. package/_virtual/index3.mjs +0 -2
  230. package/_virtual/index3.mjs.map +0 -1
  231. package/_virtual/index4.js +0 -2
  232. package/_virtual/index4.js.map +0 -1
  233. package/_virtual/index4.mjs +0 -2
  234. package/_virtual/index4.mjs.map +0 -1
  235. package/_virtual/index5.js +0 -2
  236. package/_virtual/index5.js.map +0 -1
  237. package/_virtual/index5.mjs +0 -2
  238. package/_virtual/index5.mjs.map +0 -1
  239. package/_virtual/index6.js +0 -2
  240. package/_virtual/index6.js.map +0 -1
  241. package/_virtual/index6.mjs +0 -2
  242. package/_virtual/index6.mjs.map +0 -1
  243. package/_virtual/index7.js +0 -2
  244. package/_virtual/index7.js.map +0 -1
  245. package/_virtual/index7.mjs +0 -2
  246. package/_virtual/index7.mjs.map +0 -1
  247. package/_virtual/index8.js +0 -2
  248. package/_virtual/index8.js.map +0 -1
  249. package/_virtual/index8.mjs +0 -2
  250. package/_virtual/index8.mjs.map +0 -1
  251. package/_virtual/purify.js +0 -2
  252. package/_virtual/purify.js.map +0 -1
  253. package/_virtual/purify.mjs +0 -2
  254. package/_virtual/purify.mjs.map +0 -1
  255. package/_virtual/tinycolor.js +0 -2
  256. package/_virtual/tinycolor.js.map +0 -1
  257. package/_virtual/tinycolor.mjs +0 -2
  258. package/_virtual/tinycolor.mjs.map +0 -1
  259. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/components.json.js +0 -2
  260. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/components.json.js.map +0 -1
  261. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/components.json.mjs +0 -2
  262. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/components.json.mjs.map +0 -1
  263. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CheckCircleFill/index.js +0 -2
  264. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CheckCircleFill/index.js.map +0 -1
  265. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CheckCircleFill/index.mjs +0 -2
  266. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CheckCircleFill/index.mjs.map +0 -1
  267. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.js +0 -2
  268. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.js.map +0 -1
  269. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.mjs +0 -2
  270. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.mjs.map +0 -1
  271. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/Close/index.js +0 -2
  272. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/Close/index.js.map +0 -1
  273. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/Close/index.mjs +0 -2
  274. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/Close/index.mjs.map +0 -1
  275. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CloseCirlceFill/index.js +0 -2
  276. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CloseCirlceFill/index.js.map +0 -1
  277. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CloseCirlceFill/index.mjs +0 -2
  278. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CloseCirlceFill/index.mjs.map +0 -1
  279. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.js +0 -2
  280. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.js.map +0 -1
  281. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.mjs +0 -2
  282. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.mjs.map +0 -1
  283. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/NotifFill/index.js +0 -2
  284. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/NotifFill/index.js.map +0 -1
  285. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/NotifFill/index.mjs +0 -2
  286. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/NotifFill/index.mjs.map +0 -1
  287. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ResizeHandle/index.js +0 -2
  288. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ResizeHandle/index.js.map +0 -1
  289. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ResizeHandle/index.mjs +0 -2
  290. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ResizeHandle/index.mjs.map +0 -1
  291. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/WarningTriangleFill/index.js +0 -2
  292. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/WarningTriangleFill/index.js.map +0 -1
  293. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/WarningTriangleFill/index.mjs +0 -2
  294. package/external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/WarningTriangleFill/index.mjs.map +0 -1
  295. package/external/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.js +0 -2
  296. package/external/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.js.map +0 -1
  297. package/external/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.mjs +0 -2
  298. package/external/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.mjs.map +0 -1
  299. package/external/.pnpm/fuse.js@7.0.0/node_modules/fuse.js/dist/fuse.js +0 -2
  300. package/external/.pnpm/fuse.js@7.0.0/node_modules/fuse.js/dist/fuse.js.map +0 -1
  301. package/external/.pnpm/fuse.js@7.0.0/node_modules/fuse.js/dist/fuse.mjs +0 -2
  302. package/external/.pnpm/fuse.js@7.0.0/node_modules/fuse.js/dist/fuse.mjs.map +0 -1
  303. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.js +0 -2
  304. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.js.map +0 -1
  305. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.mjs +0 -2
  306. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.mjs.map +0 -1
  307. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/url-alphabet/index.js +0 -2
  308. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/url-alphabet/index.js.map +0 -1
  309. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/url-alphabet/index.mjs +0 -2
  310. package/external/.pnpm/nanoid@5.0.9/node_modules/nanoid/url-alphabet/index.mjs.map +0 -1
  311. package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js +0 -2
  312. package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js.map +0 -1
  313. package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.mjs +0 -2
  314. package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.mjs.map +0 -1
  315. package/external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js +0 -2
  316. package/external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js.map +0 -1
  317. package/external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs +0 -2
  318. package/external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.mjs","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState } from 'react'\nimport { useTheme } from 'styled-components'\nimport DOMPurify from 'dompurify'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { SIZES } from './constants'\nimport { ICONS, ICONS_DEFAULT } from './list'\nimport * as Styled from './style'\nimport type { IconProps, SvgDynamicModule } from './types'\nimport { BackgroundWorker } from './bg-worker'\n\nconst COMPONENT_NAME = 'Icon'\n\nconst cache: Record<string, string | null> = {}\nconst retryAttempts = 3\nconst worker = new BackgroundWorker<{ xhr: XMLHttpRequest; url: string }>()\n\nworker.run(({ xhr, url }) => {\n xhr.open('GET', url)\n xhr.send()\n})\n\nconst fetchImage = async (url: string): Promise<string> => {\n let retries = 0\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.responseType = 'text'\n xhr.open('GET', url)\n xhr.send()\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 400) {\n const content = DOMPurify.sanitize(xhr.response)\n resolve(content)\n } else {\n reject(new Error(`Failed to load icon from \"${url}\".`))\n }\n }\n\n xhr.onerror = function () {\n retries++\n if (retries < retryAttempts) {\n worker.add({ url, xhr })\n }\n\n if (retries >= retryAttempts) {\n reject(new Error(`Failed to load icon from \"${url}\" after ${retryAttempts} attempts.`))\n }\n }\n })\n}\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 [IconProps](https://github.com/foxford/ui/blob/master/src/components/Icon/types.ts)\n */\nconst Icon: React.ForwardRefExoticComponent<IconProps> = withMergedProps<IconProps, HTMLSpanElement>(\n forwardRef((props, ref) => {\n const theme = useTheme()\n const { assetHost } = theme\n const { size = 'inherit', name = 'unknown', icon, preset, ...restProps } = props\n const cacheName = `${preset}_${name}`\n const [content, setContent] = useState<string | null>(cache[cacheName] ?? null)\n\n const className = useClassname(COMPONENT_NAME, restProps.className)\n\n const iconUrl: SvgDynamicModule | null | undefined =\n name === 'unknown' ? null : (preset === 'brand' ? ICONS : ICONS_DEFAULT)[name]\n\n useEffect(() => {\n if (!iconUrl) return\n if (cache[cacheName] && cache[cacheName] !== null) {\n setContent(cache[cacheName])\n return\n }\n\n if (cache[cacheName] === null) {\n document.addEventListener(\n `IconLoaded_${cacheName}`,\n (event: Event) => {\n const detail = (event as CustomEvent<{ name: string; content: string }>).detail\n if (detail && detail.name === name && detail.content) {\n setContent(detail.content)\n }\n },\n { once: true }\n )\n return\n }\n\n ;(async () => {\n cache[cacheName] = null\n\n const module = await iconUrl()\n const url = module?.default\n\n if (!url) return\n\n let content = ''\n\n try {\n content = await fetchImage(`${assetHost ?? ''}${url}`)\n cache[cacheName] = content\n setContent(content)\n document.dispatchEvent(new CustomEvent(`IconLoaded_${cacheName}`, { detail: { name, content } }))\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error)\n }\n })()\n }, [iconUrl, name, cacheName, assetHost])\n\n const contentProps = icon ? { children: icon } : { dangerouslySetInnerHTML: { __html: content } }\n\n return <Styled.Root {...restProps} size={size} className={className} ref={ref} {...contentProps} />\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Icon }\n"],"names":["cache","worker","BackgroundWorker","run","xhr","url","open","send","Icon","withMergedProps","forwardRef","props","ref","theme","useTheme","assetHost","size","name","icon","preset","restProps","cacheName","content","setContent","useState","className","useClassname","iconUrl","ICONS","ICONS_DEFAULT","useEffect","module","default","async","retries","Promise","resolve","reject","XMLHttpRequest","responseType","onload","status","DOMPurify","sanitize","response","Error","onerror","add","fetchImage","document","dispatchEvent","CustomEvent","detail","error","console","addEventListener","event","once","contentProps","children","dangerouslySetInnerHTML","__html","_jsx","Styled","displayName","sizes","SIZES"],"mappings":"mfAaA,MAAMA,MAAuC,CAAA,EAE7C,MAAMC,OAAS,IAAIC,iBAEnBD,OAAOE,KAAI,EAAGC,MAAKC,UACjBD,EAAIE,KAAK,MAAOD,GAChBD,EAAIG,MAAM,IA0CNC,MAAAA,KAAmDC,gBACvDC,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAQC,WACd,MAAMC,UAAEA,GAAcF,EACtB,MAAMG,KAAEA,EAAO,UAASC,KAAEA,EAAO,UAASC,K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EAAUI,EAAyDJ,OACrEA,GAAUA,EAAOnC,OAASA,GAAQmC,EAAO9B,SAC3CC,EAAW6B,EAAO9B,QACpB,GAEF,CAAEmC,MAAM,IAwBR,GACH,CAAC9B,EAASV,EAAMI,EAAWN,IAE9B,MAAM2C,EAAexC,EAAO,CAAEyC,SAAUzC,GAAS,CAAE0C,wBAAyB,CAAEC,OAAQvC,IAEtF,OAAOwC,IAACC,KAAW,IAAK3C,EAAWJ,KAAMA,EAAMS,UAAWA,EAAWb,IAAKA,KAAS8C,GAAgB,IAErG,CACEM,YA/GmB,OAgHnBC,MAAOC"}
1
+ {"version":3,"file":"Icon.mjs","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState } from 'react'\nimport { useTheme } from 'styled-components'\nimport DOMPurify from 'dompurify'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { SIZES } from './constants'\nimport { ICONS, ICONS_DEFAULT } from './list'\nimport * as Styled from './style'\nimport type { IconProps, SvgDynamicModule } from './types'\nimport { BackgroundWorker } from './bg-worker'\n\nconst COMPONENT_NAME = 'Icon'\n\nconst cache: Record<string, string | null> = {}\nconst retryAttempts = 3\nconst worker = new BackgroundWorker<{ xhr: XMLHttpRequest; url: string }>()\n\nworker.run(({ xhr, url }) => {\n xhr.open('GET', url)\n xhr.send()\n})\n\nconst fetchImage = async (url: string): Promise<string> => {\n let retries = 0\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.responseType = 'text'\n xhr.open('GET', url)\n xhr.send()\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 400) {\n const content = DOMPurify.sanitize(xhr.response)\n resolve(content)\n } else {\n reject(new Error(`Failed to load icon from \"${url}\".`))\n }\n }\n\n xhr.onerror = function () {\n retries++\n if (retries < retryAttempts) {\n worker.add({ url, xhr })\n }\n\n if (retries >= retryAttempts) {\n reject(new Error(`Failed to load icon from \"${url}\" after ${retryAttempts} attempts.`))\n }\n }\n })\n}\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 [IconProps](https://github.com/foxford/ui/blob/master/src/components/Icon/types.ts)\n */\nconst Icon: React.ForwardRefExoticComponent<IconProps> = withMergedProps<IconProps, HTMLSpanElement>(\n forwardRef((props, ref) => {\n const theme = useTheme()\n const { assetHost } = theme\n const { size = 'inherit', name = 'unknown', icon, preset, ...restProps } = props\n const cacheName = `${preset}_${name}`\n const [content, setContent] = useState<string | null>(cache[cacheName] ?? null)\n\n const className = useClassname(COMPONENT_NAME, restProps.className)\n\n const iconUrl: SvgDynamicModule | null | undefined =\n name === 'unknown' ? null : (preset === 'brand' ? ICONS : ICONS_DEFAULT)[name]\n\n useEffect(() => {\n if (!iconUrl) return\n if (cache[cacheName] && cache[cacheName] !== null) {\n setContent(cache[cacheName])\n return\n }\n\n if (cache[cacheName] === null) {\n document.addEventListener(\n `IconLoaded_${cacheName}`,\n (event: Event) => {\n const detail = (event as CustomEvent<{ name: string; content: string }>).detail\n if (detail && detail.name === name && detail.content) {\n setContent(detail.content)\n }\n },\n { once: true }\n )\n return\n }\n\n ;(async () => {\n cache[cacheName] = null\n\n const module = await iconUrl()\n const url = module?.default\n\n if (!url) return\n\n let content = ''\n\n try {\n content = await fetchImage(`${assetHost ?? ''}${url}`)\n cache[cacheName] = content\n setContent(content)\n document.dispatchEvent(new CustomEvent(`IconLoaded_${cacheName}`, { detail: { name, content } }))\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error)\n }\n })()\n }, [iconUrl, name, cacheName, assetHost])\n\n const contentProps = icon ? { children: icon } : { dangerouslySetInnerHTML: { __html: content } }\n\n return <Styled.Root {...restProps} size={size} className={className} ref={ref} {...contentProps} />\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Icon }\n"],"names":["cache","worker","BackgroundWorker","run","xhr","url","open","send","Icon","withMergedProps","forwardRef","props","ref","theme","useTheme","assetHost","size","name","icon","preset","restProps","cacheName","content","setContent","useState","className","useClassname","iconUrl","ICONS","ICONS_DEFAULT","useEffect","module","default","async","retries","Promise","resolve","reject","XMLHttpRequest","responseType","onload","status","DOMPurify","sanitize","response","Error","onerror","add","fetchImage","document","dispatchEvent","CustomEvent","detail","error","console","addEventListener","event","once","contentProps","children","dangerouslySetInnerHTML","__html","_jsx","Styled","displayName","sizes","SIZES"],"mappings":"ibAaA,MAAMA,MAAuC,CAAA,EAE7C,MAAMC,OAAS,IAAIC,iBAEnBD,OAAOE,KAAI,EAAGC,MAAKC,UACjBD,EAAIE,KAAK,MAAOD,GAChBD,EAAIG,MAAM,IA0CNC,MAAAA,KAAmDC,gBACvDC,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAQC,WACd,MAAMC,UAAEA,GAAcF,EACtB,MAAMG,KAAEA,EAAO,UAASC,KAAEA,EAAO,UAASC,KAAEA,EAAIC,OAAEA,KAAWC,GAAcT,EAC3E,MAAMU,EAAY,GAAGF,KAAUF,IAC/B,MAAOK,EAASC,GAAcC,SAAwBxB,MAAMqB,IAAc,MAE1E,MAAMI,EAAYC,aA1DC,OA0D4BN,EAAUK,WAEzD,MAAME,EACJV,IAAS,UAAY,MAAQE,IAAW,QAAUS,MAAQC,eAAeZ,GAE3Ea,WAAU,KACHH,IACD3B,MAAMqB,IAAcrB,MAAMqB,KAAe,KAC3CE,EAAWvB,MAAMqB,IAIfrB,MAAMqB,KAAe,KAcxB,WACCrB,MAAMqB,GAAa,KAEnB,MAAMU,QAAeJ,IACrB,MAAMtB,EAAM0B,GAAQC,QAEpB,IAAK3B,EAAK,OAEV,IAAIiB,EAAU,GAEd,IACEA,OApFSW,WACjB,IAAIC,EAAU,EACd,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,MAAMjC,EAAM,IAAIkC,eAChBlC,EAAImC,aAAe,OACnBnC,EAAIE,KAAK,MAAOD,GAChBD,EAAIG,OACJH,EAAIoC,OAAS,KACX,GAAIpC,EAAIqC,QAAU,KAAOrC,EAAIqC,OAAS,IAAK,CACzC,MAAMnB,EAAUoB,UAAUC,SAASvC,EAAIwC,UACvCR,EAAQd,EACV,MACEe,EAAO,IAAIQ,MAAM,6BAA6BxC,SAIlDD,EAAI0C,QAAU,KACZZ,IACIA,EA1BY,GA2BdjC,OAAO8C,IAAI,CAAE1C,MAAKD,QAGhB8B,GA9BY,GA+BdG,EAAO,IAAIQ,MAAM,6BAA6BxC,yBAEjD,GACD,EA0DsB2C,CAAW,GAAGjC,GAAa,KAAKV,KAChDL,MAAMqB,GAAaC,EACnBC,EAAWD,GACX2B,SAASC,cAAc,IAAIC,YAAY,cAAc9B,IAAa,CAAE+B,OAAQ,CAAEnC,OAAMK,aACrF,CAAC,MAAO+B,GAEPC,QAAQD,MAAMA,EAChB,CACD,EAnBA,GAbCJ,SAASM,iBACP,cAAclC,KACbmC,IACC,MAAMJ,EAAUI,EAAyDJ,OACrEA,GAAUA,EAAOnC,OAASA,GAAQmC,EAAO9B,SAC3CC,EAAW6B,EAAO9B,QACpB,GAEF,CAAEmC,MAAM,IAwBR,GACH,CAAC9B,EAASV,EAAMI,EAAWN,IAE9B,MAAM2C,EAAexC,EAAO,CAAEyC,SAAUzC,GAAS,CAAE0C,wBAAyB,CAAEC,OAAQvC,IAEtF,OAAOwC,IAACC,KAAW,IAAK3C,EAAWJ,KAAMA,EAAMS,UAAWA,EAAWb,IAAKA,KAAS8C,GAAgB,IAErG,CACEM,YA/GmB,OAgHnBC,MAAOC"}
@@ -1,2 +1,2 @@
1
- 'use strict';function _interopNamespace(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((c=>{if(c!=='default'){var o=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(r,c,o.get?o:{enumerable:!0,get:()=>e[c]})}})),r.default=e,Object.freeze(r)}const iconPackIcons=require('../../../external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/components.json.js').default.reduce(((e,r)=>(e[r.componentName.charAt(0).toLowerCase()+r.componentName.slice(1)]=()=>{return e=/* webpackMode: "eager" */'../../../assets/'.concat(r.fileName,'.svg'),Promise.resolve().then((()=>_interopNamespace(require(e))));var e},e)),{});exports.iconPackIcons=iconPackIcons;
1
+ 'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((r=>{if(r!=='default'){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}})),t.default=e,Object.freeze(t)}const iconPackIcons=_interopDefault(require('@foxford/icon-pack/components.json')).default.reduce(((e,t)=>(e[t.componentName.charAt(0).toLowerCase()+t.componentName.slice(1)]=()=>{return e=/* webpackMode: "eager" */'../../../assets/'.concat(t.fileName,'.svg'),Promise.resolve().then((()=>_interopNamespace(require(e))));var e},e)),{});exports.iconPackIcons=iconPackIcons;
2
2
  //# sourceMappingURL=icon-pack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-pack.js","sources":["../../../../../src/components/Icon/list/icon-pack.ts"],"sourcesContent":["/**\n * ALERT: Трогать этот код только вдумчиво\n * Используется плагин для ребэйза иконок из икон-пака, плагин работает с AST.\n * На конечный результат может влиять нейминг переменных.\n */\nimport IconPackIcons from '@foxford/icon-pack/components.json'\nimport type { IconName, SvgDynamicModule } from '../types'\n\nexport const iconPackIcons: Partial<Record<IconName, SvgDynamicModule>> = IconPackIcons.reduce<\n Record<IconName, SvgDynamicModule>\n>((acc, icon) => {\n const name = (icon.componentName.charAt(0).toLowerCase() + icon.componentName.slice(1)) as IconName\n // Должен быть ОТНОСИТЕЛЬНЫЙ ПУТЬ\n // данный подход позволяет работать в экосистеме webpack|rollap|vite одинаково, миную дефолтный механизмы резолвов\n acc[name] = () =>\n import(\n /* webpackMode: \"eager\" */ `../../../../node_modules/@foxford/icon-pack/icons/${icon.componentName}/${icon.fileName}.svg`\n )\n return acc\n}, {} as Record<IconName, SvgDynamicModule>)\n"],"names":["iconPackIcons","IconPackIcons","reduce","acc","icon","componentName","charAt","toLowerCase","slice"],"mappings":"qSAQO,MAAMA,0KAA6DC,QAAcC,QAEtF,CAACC,EAAKC,KAIND,EAHcC,EAAKC,cAAcC,OAAO,GAAGC,cAAgBH,EAAKC,cAAcG,MAAM,IAGxE,KACV,4IAAA,KAEC,EACIL,IACN,CAAwC"}
1
+ {"version":3,"file":"icon-pack.js","sources":["../../../../../src/components/Icon/list/icon-pack.ts"],"sourcesContent":["/**\n * ALERT: Трогать этот код только вдумчиво\n * Используется плагин для ребэйза иконок из икон-пака, плагин работает с AST.\n * На конечный результат может влиять нейминг переменных.\n */\nimport IconPackIcons from '@foxford/icon-pack/components.json'\nimport type { IconName, SvgDynamicModule } from '../types'\n\nexport const iconPackIcons: Partial<Record<IconName, SvgDynamicModule>> = IconPackIcons.reduce<\n Record<IconName, SvgDynamicModule>\n>((acc, icon) => {\n const name = (icon.componentName.charAt(0).toLowerCase() + icon.componentName.slice(1)) as IconName\n // Должен быть ОТНОСИТЕЛЬНЫЙ ПУТЬ\n // данный подход позволяет работать в экосистеме webpack|rollap|vite одинаково, миную дефолтный механизмы резолвов\n acc[name] = () =>\n import(\n /* webpackMode: \"eager\" */ `../../../../node_modules/@foxford/icon-pack/icons/${icon.componentName}/${icon.fileName}.svg`\n )\n return acc\n}, {} as Record<IconName, SvgDynamicModule>)\n"],"names":["iconPackIcons","IconPackIcons","reduce","acc","icon","componentName","charAt","toLowerCase","slice"],"mappings":"sWAQO,MAAMA,6EAA6DC,QAAcC,QAEtF,CAACC,EAAKC,KAIND,EAHcC,EAAKC,cAAcC,OAAO,GAAGC,cAAgBH,EAAKC,cAAcG,MAAM,IAGxE,KACV,4IAAA,KAEC,EACIL,IACN,CAAwC"}
@@ -1,2 +1,2 @@
1
- import IconPackIcons from'../../../external/.pnpm/@foxford_icon-pack@0.11.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/components.json.mjs';const iconPackIcons=IconPackIcons.reduce(((o,c)=>(o[c.componentName.charAt(0).toLowerCase()+c.componentName.slice(1)]=()=>import(/* webpackMode: "eager" */'../../../assets/'.concat(c.fileName,'.svg')),o)),{});export{iconPackIcons};
1
+ import IconPackIcons from'@foxford/icon-pack/components.json';const iconPackIcons=IconPackIcons.reduce(((o,c)=>(o[c.componentName.charAt(0).toLowerCase()+c.componentName.slice(1)]=()=>import(/* webpackMode: "eager" */'../../../assets/'.concat(c.fileName,'.svg')),o)),{});export{iconPackIcons};
2
2
  //# sourceMappingURL=icon-pack.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-pack.mjs","sources":["../../../../../src/components/Icon/list/icon-pack.ts"],"sourcesContent":["/**\n * ALERT: Трогать этот код только вдумчиво\n * Используется плагин для ребэйза иконок из икон-пака, плагин работает с AST.\n * На конечный результат может влиять нейминг переменных.\n */\nimport IconPackIcons from '@foxford/icon-pack/components.json'\nimport type { IconName, SvgDynamicModule } from '../types'\n\nexport const iconPackIcons: Partial<Record<IconName, SvgDynamicModule>> = IconPackIcons.reduce<\n Record<IconName, SvgDynamicModule>\n>((acc, icon) => {\n const name = (icon.componentName.charAt(0).toLowerCase() + icon.componentName.slice(1)) as IconName\n // Должен быть ОТНОСИТЕЛЬНЫЙ ПУТЬ\n // данный подход позволяет работать в экосистеме webpack|rollap|vite одинаково, миную дефолтный механизмы резолвов\n acc[name] = () =>\n import(\n /* webpackMode: \"eager\" */ `../../../../node_modules/@foxford/icon-pack/icons/${icon.componentName}/${icon.fileName}.svg`\n )\n return acc\n}, {} as Record<IconName, SvgDynamicModule>)\n"],"names":["iconPackIcons","IconPackIcons","reduce","acc","icon","componentName","charAt","toLowerCase","slice","import"],"mappings":"6KAQO,MAAMA,cAA6DC,cAAcC,QAEtF,CAACC,EAAKC,KAIND,EAHcC,EAAKC,cAAcC,OAAO,GAAGC,cAAgBH,EAAKC,cAAcG,MAAM,IAGxE,IACVC,+EAGKN,IACN,CAAwC"}
1
+ {"version":3,"file":"icon-pack.mjs","sources":["../../../../../src/components/Icon/list/icon-pack.ts"],"sourcesContent":["/**\n * ALERT: Трогать этот код только вдумчиво\n * Используется плагин для ребэйза иконок из икон-пака, плагин работает с AST.\n * На конечный результат может влиять нейминг переменных.\n */\nimport IconPackIcons from '@foxford/icon-pack/components.json'\nimport type { IconName, SvgDynamicModule } from '../types'\n\nexport const iconPackIcons: Partial<Record<IconName, SvgDynamicModule>> = IconPackIcons.reduce<\n Record<IconName, SvgDynamicModule>\n>((acc, icon) => {\n const name = (icon.componentName.charAt(0).toLowerCase() + icon.componentName.slice(1)) as IconName\n // Должен быть ОТНОСИТЕЛЬНЫЙ ПУТЬ\n // данный подход позволяет работать в экосистеме webpack|rollap|vite одинаково, миную дефолтный механизмы резолвов\n acc[name] = () =>\n import(\n /* webpackMode: \"eager\" */ `../../../../node_modules/@foxford/icon-pack/icons/${icon.componentName}/${icon.fileName}.svg`\n )\n return acc\n}, {} as Record<IconName, SvgDynamicModule>)\n"],"names":["iconPackIcons","IconPackIcons","reduce","acc","icon","componentName","charAt","toLowerCase","slice","import"],"mappings":"8DAQO,MAAMA,cAA6DC,cAAcC,QAEtF,CAACC,EAAKC,KAIND,EAHcC,EAAKC,cAAcC,OAAO,GAAGC,cAAgBH,EAAKC,cAAcG,MAAM,IAGxE,IACVC,+EAGKN,IACN,CAAwC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');const IconButton=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="m",type:s="button",iconProps:o={},icon:n,...i}=e;return require$$0.jsx(style.Root,{...i,size:t,type:s,ref:r,children:require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof n=='string'?n:void 0,icon:typeof n!='string'?n:void 0,...o})})})),{displayName:'IconButton',sizes:e=>e.square?constants.SIZES_SQUARE:constants.SIZES});exports.IconButton=IconButton;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');const IconButton=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:r="m",type:s="button",iconProps:n={},icon:o,...i}=e;return jsxRuntime.jsx(style.Root,{...i,size:r,type:s,ref:t,children:jsxRuntime.jsx(Icon.Icon,{preset:"brand",name:typeof o=='string'?o:void 0,icon:typeof o!='string'?o:void 0,...n})})})),{displayName:'IconButton',sizes:e=>e.square?constants.SIZES_SQUARE:constants.SIZES});exports.IconButton=IconButton;
2
2
  //# sourceMappingURL=IconButton.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var tinycolor=require('../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var focus=require('../../mixins/focus.js');var style=require('../../shared/utils/style.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const shouldForwardIconButtonProp=style.createShouldForwardProp((o=>!['square'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n &:hover {\n color: ${o.colorHover};\n background-color: ${o.backgroundColorHover};\n }\n &:active {\n color: ${o.colorActive};\n background-color: ${o.backgroundColorActive};\n }\n &:disabled {\n color: ${o.colorDisabled};\n background-color: ${o.backgroundColorDisabled};\n }\n`;const COLOR_SCHEMA={default:{primary:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:o.theme.colors['bg-oncolor-hover'],colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor.default(o.theme.colors['bg-oncolor-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-brand-primary-100'],colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:tinycolor.default(o.theme.colors['bg-brand-primary-100']).darken(5).toString(),colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor.default(o.theme.colors['bg-brand-primary-100']).darken(7).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors['bg-disabled-large'],...o.palette})))},contrast:{primary:styled.css(["",""],(o=>template({color:o.theme.colors['content-oncolor-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-oncolor-primary'],backgroundColorHover:o.theme.colors['bg-oncontrast-hover'],colorActive:o.theme.colors['content-oncolor-primary'],backgroundColorActive:tinycolor.default(o.theme.colors['bg-oncontrast-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-inverse'],backgroundColor:o.theme.colors['bg-contrast-active'],colorHover:o.theme.colors['content-onmain-inverse'],backgroundColorHover:tinycolor.default(o.theme.colors['bg-contrast-active']).lighten(7).toString(),colorActive:o.theme.colors['content-onmain-inverse'],backgroundColorActive:tinycolor.default(o.theme.colors['bg-contrast-active']).lighten(11).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors['bg-oncolor-disabled'],...o.palette})))}};const Root=styled__default.default.button.withConfig({shouldForwardProp:shouldForwardIconButtonProp}).attrs((o=>({dynamicSizeDeclaration:(r,e)=>({width:'1em',height:'1em',fontSize:typeof r=='string'?r:`${r}${e}`,borderRadius:o.square?'0.2em':'50%'})}))).withConfig({displayName:"IconButton__Root",componentId:"ui__sc-y4pwgp-0"})([""," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `),(o=>{const r=o.contrast?COLOR_SCHEMA.contrast:COLOR_SCHEMA.default;return o.secondary?r.secondary:r.primary}),focus.focus,responsiveSize.responsiveSize,responsiveMargin.responsiveMargin);exports.Root=Root;
1
+ 'use strict';var styled=require('styled-components');var tinycolor=require('tinycolor2');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var focus=require('../../mixins/focus.js');var style=require('../../shared/utils/style.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);var tinycolor__default=_interopDefault(tinycolor);const shouldForwardIconButtonProp=style.createShouldForwardProp((o=>!['square'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n &:hover {\n color: ${o.colorHover};\n background-color: ${o.backgroundColorHover};\n }\n &:active {\n color: ${o.colorActive};\n background-color: ${o.backgroundColorActive};\n }\n &:disabled {\n color: ${o.colorDisabled};\n background-color: ${o.backgroundColorDisabled};\n }\n`;const COLOR_SCHEMA={default:{primary:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:o.theme.colors['bg-oncolor-hover'],colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor__default.default(o.theme.colors['bg-oncolor-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-brand-primary-100'],colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:tinycolor__default.default(o.theme.colors['bg-brand-primary-100']).darken(5).toString(),colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor__default.default(o.theme.colors['bg-brand-primary-100']).darken(7).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors['bg-disabled-large'],...o.palette})))},contrast:{primary:styled.css(["",""],(o=>template({color:o.theme.colors['content-oncolor-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-oncolor-primary'],backgroundColorHover:o.theme.colors['bg-oncontrast-hover'],colorActive:o.theme.colors['content-oncolor-primary'],backgroundColorActive:tinycolor__default.default(o.theme.colors['bg-oncontrast-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-inverse'],backgroundColor:o.theme.colors['bg-contrast-active'],colorHover:o.theme.colors['content-onmain-inverse'],backgroundColorHover:tinycolor__default.default(o.theme.colors['bg-contrast-active']).lighten(7).toString(),colorActive:o.theme.colors['content-onmain-inverse'],backgroundColorActive:tinycolor__default.default(o.theme.colors['bg-contrast-active']).lighten(11).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors['bg-oncolor-disabled'],...o.palette})))}};const Root=styled__default.default.button.withConfig({shouldForwardProp:shouldForwardIconButtonProp}).attrs((o=>({dynamicSizeDeclaration:(r,e)=>({width:'1em',height:'1em',fontSize:typeof r=='string'?r:`${r}${e}`,borderRadius:o.square?'0.2em':'50%'})}))).withConfig({displayName:"IconButton__Root",componentId:"ui__sc-y4pwgp-0"})([""," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `),(o=>{const r=o.contrast?COLOR_SCHEMA.contrast:COLOR_SCHEMA.default;return o.secondary?r.secondary:r.primary}),focus.focus,responsiveSize.responsiveSize,responsiveMargin.responsiveMargin);exports.Root=Root;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/IconButton/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { CSSColor } from 'shared/types'\nimport type { IconButtonPalette, StyledIconButtonProps } from './types'\n\nconst shouldForwardIconButtonProp = createShouldForwardProp((propKey) => !['square'].includes(propKey))\n\nconst template = (palette: IconButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n background-color: ${palette.backgroundColorHover};\n }\n &:active {\n color: ${palette.colorActive};\n background-color: ${palette.backgroundColorActive};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n background-color: ${palette.backgroundColorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: props.theme.colors['bg-oncolor-hover'],\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncolor-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-brand-primary-100'],\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(5).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(7).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-disabled-large'],\n ...props.palette,\n })}\n `,\n },\n contrast: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-oncolor-primary'],\n backgroundColorHover: props.theme.colors['bg-oncontrast-hover'],\n colorActive: props.theme.colors['content-oncolor-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncontrast-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-inverse'],\n backgroundColor: props.theme.colors['bg-contrast-active'],\n colorHover: props.theme.colors['content-onmain-inverse'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-contrast-active']).lighten(7).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-inverse'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-contrast-active']).lighten(11).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.button\n .withConfig<StyledIconButtonProps>({\n shouldForwardProp: shouldForwardIconButtonProp,\n })\n .attrs<StyledIconButtonProps>(\n (props): Required<Pick<StyledIconButtonProps, 'dynamicSizeDeclaration'>> => ({\n dynamicSizeDeclaration: (size, sizeUnits) => ({\n width: '1em',\n height: '1em',\n fontSize: typeof size === 'string' ? size : `${size}${sizeUnits}`,\n borderRadius: props.square ? '0.2em' : '50%',\n }),\n })\n )`\n ${(props) => `\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `}\n\n ${(props) => {\n const schema = props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.secondary) return schema.secondary\n\n return schema.primary\n }}\n\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n`\n"],"names":["shouldForwardIconButtonProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","backgroundColorHover","colorActive","backgroundColorActive","colorDisabled","backgroundColorDisabled","COLOR_SCHEMA","default","primary","css","props","theme","colors","transparent","tinycolor","setAlpha","toString","secondary","darken","contrast","lighten","Root","styled","button","withConfig","shouldForwardProp","attrs","dynamicSizeDeclaration","size","sizeUnits","width","height","fontSize","borderRadius","square","displayName","componentId","disabled","schema","focus","responsiveSize","responsiveMargin"],"mappings":"keASA,MAAMA,4BAA8BC,MAAAA,yBAAyBC,IAAa,CAAC,UAAUC,SAASD,KAE9F,MAAME,SAAYC,GAA+B,cACtCA,EAAQC,+BACGD,EAAQE,6CAEjBF,EAAQG,sCACGH,EAAQI,wDAGnBJ,EAAQK,uCACGL,EAAQM,2DAGnBN,EAAQO,yCACGP,EAAQQ,kCAIhC,MAAMC,aAAe,CACnBC,QAAS,CACPC,QAASC,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDd,SAAS,CACPE,MAAOY,EAAMC,MAAMC,OAAO,2BAC1Bb,gBAAiBW,EAAMC,MAAMC,OAAOC,YACpCb,WAAYU,EAAMC,MAAMC,OAAO,0BAC/BX,qBAAsBS,EAAMC,MAAMC,OAAO,oBACzCV,YAAaQ,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a,UAASP,QAACG,EAAMC,MAAMC,OAAO,uBAAuBQ,QAAQ,GAAGJ,WACrFd,YAAaQ,EAAMC,MAAMC,OAAO,0BAChCT,sBAAuBW,UAASP,QAACG,EAAMC,MAAMC,OAAO,uBAAuBQ,QAAQ,IAAIJ,WACvFZ,cAAeM,EAAMC,MAAMC,OAAO,4BAClCP,wBAAyBK,EAAMC,MAAMC,OAAO,0BACzCF,EAAMb,cAMZ,MAAMwB,KAAOC,gBAAAA,QAAOC,OACxBC,WAAkC,CACjCC,kBAAmBjC,8BAEpBkC,OACEhB,IAA4E,CAC3EiB,uBAAwBA,CAACC,EAAMC,KAAe,CAC5CC,MAAO,MACPC,OAAQ,MACRC,gBAAiBJ,GAAS,SAAWA,EAAO,GAAGA,IAAOC,IACtDI,aAAcvB,EAAMwB,OAAS,QAAU,YAG5CV,WAAA,CAAAW,YAAA,mBAAAC,YAAA,mBAbiBd,CAajB,CAAA,GAAA,IAAA,IAAA,IAAA,IAAA,KACEZ,GAAU,iOAUDA,EAAM2B,SAAW,cAAgB,iGAK1C3B,IACD,MAAM4B,EAAS5B,EAAMS,SAAWb,aAAaa,SAAWb,aAAaC,QAErE,OAAIG,EAAMO,UAAkBqB,EAAOrB,UAE5BqB,EAAO9B,OAAO,GAGrB+B,MAAAA,MACAC,eAAAA,eACAC,iBAAgBA"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/IconButton/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { CSSColor } from 'shared/types'\nimport type { IconButtonPalette, StyledIconButtonProps } from './types'\n\nconst shouldForwardIconButtonProp = createShouldForwardProp((propKey) => !['square'].includes(propKey))\n\nconst template = (palette: IconButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n background-color: ${palette.backgroundColorHover};\n }\n &:active {\n color: ${palette.colorActive};\n background-color: ${palette.backgroundColorActive};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n background-color: ${palette.backgroundColorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: props.theme.colors['bg-oncolor-hover'],\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncolor-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-brand-primary-100'],\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(5).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(7).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-disabled-large'],\n ...props.palette,\n })}\n `,\n },\n contrast: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-oncolor-primary'],\n backgroundColorHover: props.theme.colors['bg-oncontrast-hover'],\n colorActive: props.theme.colors['content-oncolor-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncontrast-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-inverse'],\n backgroundColor: props.theme.colors['bg-contrast-active'],\n colorHover: props.theme.colors['content-onmain-inverse'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-contrast-active']).lighten(7).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-inverse'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-contrast-active']).lighten(11).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.button\n .withConfig<StyledIconButtonProps>({\n shouldForwardProp: shouldForwardIconButtonProp,\n })\n .attrs<StyledIconButtonProps>(\n (props): Required<Pick<StyledIconButtonProps, 'dynamicSizeDeclaration'>> => ({\n dynamicSizeDeclaration: (size, sizeUnits) => ({\n width: '1em',\n height: '1em',\n fontSize: typeof size === 'string' ? size : `${size}${sizeUnits}`,\n borderRadius: props.square ? '0.2em' : '50%',\n }),\n })\n )`\n ${(props) => `\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `}\n\n ${(props) => {\n const schema = props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.secondary) return schema.secondary\n\n return schema.primary\n }}\n\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n`\n"],"names":["shouldForwardIconButtonProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","backgroundColorHover","colorActive","backgroundColorActive","colorDisabled","backgroundColorDisabled","COLOR_SCHEMA","default","primary","css","props","theme","colors","transparent","tinycolor","setAlpha","toString","secondary","darken","contrast","lighten","Root","styled","button","withConfig","shouldForwardProp","attrs","dynamicSizeDeclaration","size","sizeUnits","width","height","fontSize","borderRadius","square","displayName","componentId","disabled","schema","focus","responsiveSize","responsiveMargin"],"mappings":"odASA,MAAMA,4BAA8BC,MAAAA,yBAAyBC,IAAa,CAAC,UAAUC,SAASD,KAE9F,MAAME,SAAYC,GAA+B,cACtCA,EAAQC,+BACGD,EAAQE,6CAEjBF,EAAQG,sCACGH,EAAQI,wDAGnBJ,EAAQK,uCACGL,EAAQM,2DAGnBN,EAAQO,yCACGP,EAAQQ,kCAIhC,MAAMC,aAAe,CACnBC,QAAS,CACPC,QAASC,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDd,SAAS,CACPE,MAAOY,EAAMC,MAAMC,OAAO,2BAC1Bb,gBAAiBW,EAAMC,MAAMC,OAAOC,YACpCb,WAAYU,EAAMC,MAAMC,OAAO,0BAC/BX,qBAAsBS,EAAMC,MAAMC,OAAO,oBACzCV,YAAaQ,EAAMC,MAAMC,OAAO,0BAChCT,sBAAuBW,mBAASP,QAACG,EAAMC,MAAMC,OAAO,qBACjDG,SAAS,KACTC,WACHZ,cAAeM,EAAMC,MAAMC,OAAO,oBAClCP,wBAAyBK,EAAMC,MAAMC,OAAOC,eACzCH,EAAMb,YAGfoB,UAAWR,OAAGA,IAAA,CAAA,GAAA,KACTC,GACDd,SAAS,CACPE,MAAOY,EAAMC,MAAMC,OAAO,0BAC1Bb,gBAAiBW,EAAMC,MAAMC,OAAO,wBACpCZ,WAAYU,EAAMC,MAAMC,OAAO,0BAC/BX,qBAAsBa,mBAASP,QAACG,EAAMC,MAAMC,OAAO,yBAAyBM,OAAO,GAAGF,WACtFd,YAAaQ,EAAMC,MAAMC,OAAO,0BAChCT,sBAAuBW,mBAASP,QAACG,EAAMC,MAAMC,OAAO,yBAAyBM,OAAO,GAAGF,WACvFZ,cAAeM,EAAMC,MAAMC,OAAO,oBAClCP,wBAAyBK,EAAMC,MAAMC,OAAO,wBACzCF,EAAM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,iOAUDA,EAAM2B,SAAW,cAAgB,iGAK1C3B,IACD,MAAM4B,EAAS5B,EAAMS,SAAWb,aAAaa,SAAWb,aAAaC,QAErE,OAAIG,EAAMO,UAAkBqB,EAAOrB,UAE5BqB,EAAO9B,OAAO,GAGrB+B,MAAAA,MACAC,eAAAA,eACAC,iBAAgBA"}
@@ -1,2 +1,2 @@
1
- import styled,{css}from'styled-components';import tinycolor from'../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';import{focus}from'../../mixins/focus.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';const shouldForwardIconButtonProp=createShouldForwardProp((o=>!['square'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n &:hover {\n color: ${o.colorHover};\n background-color: ${o.backgroundColorHover};\n }\n &:active {\n color: ${o.colorActive};\n background-color: ${o.backgroundColorActive};\n }\n &:disabled {\n color: ${o.colorDisabled};\n background-color: ${o.backgroundColorDisabled};\n }\n`;const COLOR_SCHEMA={default:{primary:css(["",""],(o=>template({color:o.theme.colors['content-onmain-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:o.theme.colors['bg-oncolor-hover'],colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor(o.theme.colors['bg-oncolor-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-brand-primary-100'],colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:tinycolor(o.theme.colors['bg-brand-primary-100']).darken(5).toString(),colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor(o.theme.colors['bg-brand-primary-100']).darken(7).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors['bg-disabled-large'],...o.palette})))},contrast:{primary:css(["",""],(o=>template({color:o.theme.colors['content-oncolor-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-oncolor-primary'],backgroundColorHover:o.theme.colors['bg-oncontrast-hover'],colorActive:o.theme.colors['content-oncolor-primary'],backgroundColorActive:tinycolor(o.theme.colors['bg-oncontrast-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:css(["",""],(o=>template({color:o.theme.colors['content-onmain-inverse'],backgroundColor:o.theme.colors['bg-contrast-active'],colorHover:o.theme.colors['content-onmain-inverse'],backgroundColorHover:tinycolor(o.theme.colors['bg-contrast-active']).lighten(7).toString(),colorActive:o.theme.colors['content-onmain-inverse'],backgroundColorActive:tinycolor(o.theme.colors['bg-contrast-active']).lighten(11).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors['bg-oncolor-disabled'],...o.palette})))}};const Root=styled.button.withConfig({shouldForwardProp:shouldForwardIconButtonProp}).attrs((o=>({dynamicSizeDeclaration:(r,e)=>({width:'1em',height:'1em',fontSize:typeof r=='string'?r:`${r}${e}`,borderRadius:o.square?'0.2em':'50%'})}))).withConfig({displayName:"IconButton__Root",componentId:"ui__sc-y4pwgp-0"})([""," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `),(o=>{const r=o.contrast?COLOR_SCHEMA.contrast:COLOR_SCHEMA.default;return o.secondary?r.secondary:r.primary}),focus,responsiveSize,responsiveMargin);export{Root};
1
+ import styled,{css}from'styled-components';import tinycolor from'tinycolor2';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';import{focus}from'../../mixins/focus.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';const shouldForwardIconButtonProp=createShouldForwardProp((o=>!['square'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n &:hover {\n color: ${o.colorHover};\n background-color: ${o.backgroundColorHover};\n }\n &:active {\n color: ${o.colorActive};\n background-color: ${o.backgroundColorActive};\n }\n &:disabled {\n color: ${o.colorDisabled};\n background-color: ${o.backgroundColorDisabled};\n }\n`;const COLOR_SCHEMA={default:{primary:css(["",""],(o=>template({color:o.theme.colors['content-onmain-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:o.theme.colors['bg-oncolor-hover'],colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor(o.theme.colors['bg-oncolor-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-brand-primary-100'],colorHover:o.theme.colors['content-onmain-primary'],backgroundColorHover:tinycolor(o.theme.colors['bg-brand-primary-100']).darken(5).toString(),colorActive:o.theme.colors['content-onmain-primary'],backgroundColorActive:tinycolor(o.theme.colors['bg-brand-primary-100']).darken(7).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColorDisabled:o.theme.colors['bg-disabled-large'],...o.palette})))},contrast:{primary:css(["",""],(o=>template({color:o.theme.colors['content-oncolor-tertiary'],backgroundColor:o.theme.colors.transparent,colorHover:o.theme.colors['content-oncolor-primary'],backgroundColorHover:o.theme.colors['bg-oncontrast-hover'],colorActive:o.theme.colors['content-oncolor-primary'],backgroundColorActive:tinycolor(o.theme.colors['bg-oncontrast-hover']).setAlpha(.12).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors.transparent,...o.palette}))),secondary:css(["",""],(o=>template({color:o.theme.colors['content-onmain-inverse'],backgroundColor:o.theme.colors['bg-contrast-active'],colorHover:o.theme.colors['content-onmain-inverse'],backgroundColorHover:tinycolor(o.theme.colors['bg-contrast-active']).lighten(7).toString(),colorActive:o.theme.colors['content-onmain-inverse'],backgroundColorActive:tinycolor(o.theme.colors['bg-contrast-active']).lighten(11).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColorDisabled:o.theme.colors['bg-oncolor-disabled'],...o.palette})))}};const Root=styled.button.withConfig({shouldForwardProp:shouldForwardIconButtonProp}).attrs((o=>({dynamicSizeDeclaration:(r,e)=>({width:'1em',height:'1em',fontSize:typeof r=='string'?r:`${r}${e}`,borderRadius:o.square?'0.2em':'50%'})}))).withConfig({displayName:"IconButton__Root",componentId:"ui__sc-y4pwgp-0"})([""," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `),(o=>{const r=o.contrast?COLOR_SCHEMA.contrast:COLOR_SCHEMA.default;return o.secondary?r.secondary:r.primary}),focus,responsiveSize,responsiveMargin);export{Root};
2
2
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/IconButton/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { CSSColor } from 'shared/types'\nimport type { IconButtonPalette, StyledIconButtonProps } from './types'\n\nconst shouldForwardIconButtonProp = createShouldForwardProp((propKey) => !['square'].includes(propKey))\n\nconst template = (palette: IconButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n background-color: ${palette.backgroundColorHover};\n }\n &:active {\n color: ${palette.colorActive};\n background-color: ${palette.backgroundColorActive};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n background-color: ${palette.backgroundColorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: props.theme.colors['bg-oncolor-hover'],\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncolor-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-brand-primary-100'],\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(5).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(7).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-disabled-large'],\n ...props.palette,\n })}\n `,\n },\n contrast: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-oncolor-primary'],\n backgroundColorHover: props.theme.colors['bg-oncontrast-hover'],\n colorActive: props.theme.colors['content-oncolor-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncontrast-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-inverse'],\n backgroundColor: props.theme.colors['bg-contrast-active'],\n colorHover: props.theme.colors['content-onmain-inverse'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-contrast-active']).lighten(7).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-inverse'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-contrast-active']).lighten(11).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.button\n .withConfig<StyledIconButtonProps>({\n shouldForwardProp: shouldForwardIconButtonProp,\n })\n .attrs<StyledIconButtonProps>(\n (props): Required<Pick<StyledIconButtonProps, 'dynamicSizeDeclaration'>> => ({\n dynamicSizeDeclaration: (size, sizeUnits) => ({\n width: '1em',\n height: '1em',\n fontSize: typeof size === 'string' ? size : `${size}${sizeUnits}`,\n borderRadius: props.square ? '0.2em' : '50%',\n }),\n })\n )`\n ${(props) => `\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `}\n\n ${(props) => {\n const schema = props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.secondary) return schema.secondary\n\n return schema.primary\n }}\n\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n`\n"],"names":["shouldForwardIconButtonProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","backgroundColorHover","colorActive","backgroundColorActive","colorDisabled","backgroundColorDisabled","COLOR_SCHEMA","default","primary","css","props","theme","colors","transparent","tinycolor","setAlpha","toString","secondary","darken","contrast","lighten","Root","styled","button","withConfig","shouldForwardProp","attrs","dynamicSizeDeclaration","size","sizeUnits","width","height","fontSize","borderRadius","square","displayName","componentId","disabled","schema","focus","responsiveSize","responsiveMargin"],"mappings":"wXASA,MAAMA,4BAA8BC,yBAAyBC,IAAa,CAAC,UAAUC,SAASD,KAE9F,MAAME,SAAYC,GAA+B,cACtCA,EAAQC,+BACGD,EAAQE,6CAEjBF,EAAQG,sCACGH,EAAQI,wDAGnBJ,EAAQK,uCACGL,EAAQM,2DAGnBN,EAAQO,yCACGP,EAAQQ,kCAIhC,MAAMC,aAAe,CACnBC,QAAS,CACPC,QAASC,IAAG,CAAA,GAAA,KACPC,GACDd,SAAS,CACPE,MAAOY,EAAMC,MAAMC,OAAO,2BAC1Bb,gBAAiBW,EAAMC,MAAMC,OAAOC,YACpCb,WAAYU,EAAMC,MAAMC,OAAO,0BAC/BX,qBAAsBS,EAAMC,MAAMC,OAAO,oBACzCV,YAAaQ,EAAMC,MAAMC,OAAO,0BAChCT,sBAAuBW,UAAUJ,EAAMC,MAAMC,OAAO,qBACjDG,SAAS,KACTC,WACHZ,cAAeM,EAAMC,MAAMC,OAAO,oBAClCP,wBAAyBK,EAAMC,MAAMC,OAAOC,eACzCH,EAAMb,YAGfoB,UAAWR,IAAG,CAAA,GAAA,KACTC,GACDd,SAAS,CACPE,MAAOY,EAAMC,MAAMC,OAAO,0BAC1Bb,gBAAiBW,EAAMC,MAAMC,OAAO,wBACpCZ,WAAYU,EAAMC,MAAMC,OAAO,0BAC/BX,qBAAsBa,UAAUJ,EAAMC,MAAMC,OAAO,yBAAyBM,OAAO,GAAGF,WACtFd,YAAaQ,EAAMC,MAAMC,OAAO,0BAChCT,sBAAuBW,UAAUJ,EAAMC,MAAMC,OAAO,yBAAyBM,OAAO,GAAGF,WACvFZ,cAAeM,EAAMC,MAAMC,OAAO,oBAClCP,wBAAyBK,EAAMC,MAAMC,OAAO,wBAC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gB,iGAK1C3B,IACD,MAAM4B,EAAS5B,EAAMS,SAAWb,aAAaa,SAAWb,aAAaC,QAErE,OAAIG,EAAMO,UAAkBqB,EAAOrB,UAE5BqB,EAAO9B,OAAO,GAGrB+B,MACAC,eACAC"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/IconButton/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { CSSColor } from 'shared/types'\nimport type { IconButtonPalette, StyledIconButtonProps } from './types'\n\nconst shouldForwardIconButtonProp = createShouldForwardProp((propKey) => !['square'].includes(propKey))\n\nconst template = (palette: IconButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n background-color: ${palette.backgroundColorHover};\n }\n &:active {\n color: ${palette.colorActive};\n background-color: ${palette.backgroundColorActive};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n background-color: ${palette.backgroundColorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: props.theme.colors['bg-oncolor-hover'],\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncolor-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-brand-primary-100'],\n colorHover: props.theme.colors['content-onmain-primary'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(5).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-brand-primary-100']).darken(7).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-disabled-large'],\n ...props.palette,\n })}\n `,\n },\n contrast: {\n primary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-tertiary'],\n backgroundColor: props.theme.colors.transparent,\n colorHover: props.theme.colors['content-oncolor-primary'],\n backgroundColorHover: props.theme.colors['bg-oncontrast-hover'],\n colorActive: props.theme.colors['content-oncolor-primary'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-oncontrast-hover'])\n .setAlpha(0.12)\n .toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledIconButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-inverse'],\n backgroundColor: props.theme.colors['bg-contrast-active'],\n colorHover: props.theme.colors['content-onmain-inverse'],\n backgroundColorHover: tinycolor(props.theme.colors['bg-contrast-active']).lighten(7).toString() as CSSColor,\n colorActive: props.theme.colors['content-onmain-inverse'],\n backgroundColorActive: tinycolor(props.theme.colors['bg-contrast-active']).lighten(11).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColorDisabled: props.theme.colors['bg-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.button\n .withConfig<StyledIconButtonProps>({\n shouldForwardProp: shouldForwardIconButtonProp,\n })\n .attrs<StyledIconButtonProps>(\n (props): Required<Pick<StyledIconButtonProps, 'dynamicSizeDeclaration'>> => ({\n dynamicSizeDeclaration: (size, sizeUnits) => ({\n width: '1em',\n height: '1em',\n fontSize: typeof size === 'string' ? size : `${size}${sizeUnits}`,\n borderRadius: props.square ? '0.2em' : '50%',\n }),\n })\n )`\n ${(props) => `\n box-sizing: border-box;\n appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n margin: 0;\n border: none;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n transition-property: background-color; \n transition-duration: 250ms;\n `}\n\n ${(props) => {\n const schema = props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.secondary) return schema.secondary\n\n return schema.primary\n }}\n\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n`\n"],"names":["shouldForwardIconButtonProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","backgroundColorHover","colorActive","backgroundColorActive","colorDisabled","backgroundColorDisabled","COLOR_SCHEMA","default","primary","css","props","theme","colors","transparent","tinycolor","setAlpha","toString","secondary","darken","contrast","lighten","Root","styled","button","withConfig","shouldForwardProp","attrs","dynamicSizeDeclaration","size","sizeUnits","width","height","fontSize","borderRadius","square","displayName","componentId","disabled","schema","focus","responsiveSize","responsiveMargin"],"mappings":"uTASA,MAAMA,4BAA8BC,yBAAyBC,IAAa,CAAC,UAAUC,SAASD,KAE9F,MAAME,SAAYC,GAA+B,cACtCA,EAAQC,+BACGD,EAAQE,6CAEjBF,EAAQG,sCACGH,EAAQI,wDAGnBJ,EAAQK,uCACGL,EAAQM,2DAGnBN,EAAQO,yCACGP,EAAQQ,kCAIhC,MAAMC,aAAe,CACnBC,QAAS,CACPC,QAASC,IAAG,CAAA,GAAA,KACPC,GACDd,SAAS,CACPE,MAAOY,EAAMC,MAAMC,OAAO,2BAC1Bb,gBAAiBW,EAAMC,MAAMC,OAAOC,YACpCb,WAAYU,EAAMC,MAAMC,OAAO,0BAC/BX,qBAAsBS,EAAMC,MAAMC,OAAO,oBACzCV,YAAaQ,EAAMC,MAAMC,OAAO,0BAChCT,sBAAuBW,UAAUJ,EAAMC,MAAMC,OAAO,qBACjDG,S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AAUJ,EAAMC,MAAMC,OAAO,uBAAuBQ,QAAQ,IAAIJ,WACvFZ,cAAeM,EAAMC,MAAMC,OAAO,4BAClCP,wBAAyBK,EAAMC,MAAMC,OAAO,0BACzCF,EAAMb,cAMZ,MAAMwB,KAAOC,OAAOC,OACxBC,WAAkC,CACjCC,kBAAmBjC,8BAEpBkC,OACEhB,IAA4E,CAC3EiB,uBAAwBA,CAACC,EAAMC,KAAe,CAC5CC,MAAO,MACPC,OAAQ,MACRC,gBAAiBJ,GAAS,SAAWA,EAAO,GAAGA,IAAOC,IACtDI,aAAcvB,EAAMwB,OAAS,QAAU,YAG5CV,WAAA,CAAAW,YAAA,mBAAAC,YAAA,mBAbiBd,CAajB,CAAA,GAAA,IAAA,IAAA,IAAA,IAAA,KACEZ,GAAU,iOAUDA,EAAM2B,SAAW,cAAgB,iGAK1C3B,IACD,MAAM4B,EAAS5B,EAAMS,SAAWb,aAAaa,SAAWb,aAAaC,QAErE,OAAIG,EAAMO,UAAkBqB,EAAOrB,UAE5BqB,EAAO9B,OAAO,GAGrB+B,MACAC,eACAC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Text=require('../Text/Text.js');const indicatorPropsWithContent=e=>e.children!==void 0&&e.children!==null||e.text!==void 0&&e.text!==null;const Indicator=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="m",textProps:i={},children:s,text:n,...o}=e;const a=indicatorPropsWithContent(e);return require$$0.jsx(style.Root,{...o,size:t,square:a,ref:r,children:require$$0.jsx(style.Foreground,{children:a&&require$$0.jsx(Text.Text,{as:"span",appearance:"body",size:"inherit",color:"inherit",whiteSpace:"nowrap",weight:700,lineHeight:1,marginTop:1,marginRight:"0.3em",marginLeft:"0.3em",...i,children:s??n})})})})),{displayName:'Indicator',sizes:e=>indicatorPropsWithContent(e)?constants.SIZES_SQUARE:constants.SIZES});exports.SIZES=constants.SIZES,exports.SIZES_SQUARE=constants.SIZES_SQUARE,exports.Indicator=Indicator;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Text=require('../Text/Text.js');const indicatorPropsWithContent=e=>e.children!==void 0&&e.children!==null||e.text!==void 0&&e.text!==null;const Indicator=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:r="m",textProps:s={},children:i,text:n,...o}=e;const a=indicatorPropsWithContent(e);return jsxRuntime.jsx(style.Root,{...o,size:r,square:a,ref:t,children:jsxRuntime.jsx(style.Foreground,{children:a&&jsxRuntime.jsx(Text.Text,{as:"span",appearance:"body",size:"inherit",color:"inherit",whiteSpace:"nowrap",weight:700,lineHeight:1,marginTop:1,marginRight:"0.3em",marginLeft:"0.3em",...s,children:i??n})})})})),{displayName:'Indicator',sizes:e=>indicatorPropsWithContent(e)?constants.SIZES_SQUARE:constants.SIZES});exports.SIZES=constants.SIZES,exports.SIZES_SQUARE=constants.SIZES_SQUARE,exports.Indicator=Indicator;
2
2
  //# sourceMappingURL=Indicator.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var styled=require('styled-components');var index_browser=require('../../external/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.js');var withMergedProps=require('../../hocs/withMergedProps.js');var constants$1=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Input_Phone=require('../Input.Phone/Input.Phone.js');var constants=require('../FormInputLabel/constants.js');var FormInputLabel=require('../FormInputLabel/FormInputLabel.js');var FormInput=require('../FormInput/FormInput.js');var IconButton=require('../IconButton/IconButton.js');const Input=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const t=styled.useTheme();const{size:o="m",rounded:n=!0,primary:a=!0,color:i="mineShaft",placeholderColor:s="silver",width:l=t.defaultInputControlsWidth,type:c="text",labelPosition:u="dynamic",iconProps:m={},controls:d={},addonButtonProps:g={},preset:p,className:b,style:f,sizeXXS:h,sizeXS:S,sizeS:X,sizeM:v,sizeL:L,sizeXL:C,sizeUnits:y,sizes:I,margin:R,marginXXS:B,marginXS:w,marginS:k,marginM:T,marginL:z,marginXL:M,marginTop:x,marginTopXXS:P,marginTopXS:$,marginTopS:F,marginTopM:q,marginTopL:j,marginTopXL:D,marginRight:E,marginRightXXS:O,marginRightXS:N,marginRightS:_,marginRightM:A,marginRightL:H,marginRightXL:Z,marginBottom:U,marginBottomXXS:V,marginBottomXS:W,marginBottomS:G,marginBottomM:J,marginBottomL:K,marginBottomXL:Q,marginLeft:Y,marginLeftXXS:ee,marginLeftXS:re,marginLeftS:te,marginLeftM:oe,marginLeftL:ne,marginLeftXL:ae,palette:ie,widthXXS:se,widthXS:le,widthS:ce,widthM:ue,widthL:me,widthXL:de,error:ge,success:pe,label:be,icon:fe,text:he,secondary:Se,contrast:Xe,onColored:ve,fluid:Le,disabled:Ce,inline:ye,inputRef:Ie,...Re}=e;const Be={size:o,sizeXXS:h,sizeXS:S,sizeS:X,sizeM:v,sizeL:L,sizeXL:C};const{icon:we,buttonProps:ke={}}=d.additional??{};const[Te,ze=(ke.onClick?void 0:we)]=Array.isArray(fe)?fe:[fe];const Me=g.icon??we;const xe=Boolean(Re.mask&&Re.alwaysShowMask);const Pe={color:ie.controlsColor,colorHover:ie.controlsColorHover,colorActive:ie.controlsColorActive,colorDisabled:ie.controlsColorDisabled,backgroundColor:ie.controlsBackgroundColor,backgroundColorHover:ie.controlsBackgroundColorHover,backgroundColorActive:ie.controlsBackgroundColorActive,backgroundColorDisabled:ie.controlsBackgroundColorDisabled};const $e=React.useRef(null);React.useImperativeHandle(r,(()=>$e.current),[]);const Fe=React.useRef(null);const qe=React.useRef(null);const je=React.useRef(null);const De=React.useMemo((()=>index_browser.nanoid()),[]);const[Ee,Oe]=React.useState((()=>{if(xe)return!0;const e=Re.value??Re.defaultValue;return typeof e=='string'&&e.length>0||typeof e=='number'}));const[Ne,_e]=React.useState((()=>{if(c!=='number'||Re.min===void 0)return!1;const{value:e=1/0,defaultValue:r=1/0}=Re;const t=typeof e=='number'?e:parseFloat(e);const o=typeof r=='number'?r:parseFloat(r);const n=typeof Re.min=='number'?Re.min:parseFloat(Re.min);return Math.min(t,o)<=n}));const[Ae,He]=React.useState((()=>{if(c!=='number'||Re.max===void 0)return!1;const{value:e=-1/0,defaultValue:r=-1/0}=Re;const t=typeof e=='number'?e:parseFloat(e);const o=typeof r=='number'?r:parseFloat(r);const n=typeof Re.max=='number'?Re.max:parseFloat(Re.max);return Math.max(t,o)>=n}));return React.useLayoutEffect((()=>{xe?Oe(!0):Re.value!==void 0&&Re.value!==null&&$e.current&&$e.current!==document.activeElement&&Oe(typeof Re.value=='string'&&Re.value.length>0||typeof Re.value=='number')}),[xe,Re.value]),p!=='brand'?require$$0.jsx(style.Root,{...Re,inputRef:Ie??(e=>{$e.current=e}),className:b,style:f,size:typeof o=='number'?o:void 0,rounded:n,color:i,placeholderColor:s,width:l,widthXXS:se,widthXS:le,widthS:ce,widthM:ue,widthL:me,widthXL:de,error:ge,type:c,fluid:Le,disabled:Ce}):require$$0.jsx(FormInputLabel.FormInputLabel,{...Be,className:b,style:f,sizeUnits:y,sizes:I,margin:R,marginXXS:B,marginXS:w,marginS:k,marginM:T,marginL:z,marginXL:M,marginTop:x,marginTopXXS:P,marginTopXS:$,marginTopS:F,marginTopM:q,marginTopL:j,marginTopXL:D,marginRight:E,marginRightXXS:O,marginRightXS:N,marginRightS:_,marginRightM:A,marginRightL:H,marginRightXL:Z,marginBottom:U,marginBottomXXS:V,marginBottomXS:W,marginBottomS:G,marginBottomM:J,marginBottomL:K,marginBottomXL:Q,marginLeft:Y,marginLeftXXS:ee,marginLeftXS:re,marginLeftS:te,marginLeftM:oe,marginLeftL:ne,marginLeftXL:ae,error:ge,success:pe,label:be,labelId:De,labelPosition:u,icon:[Te,ze],text:he,primary:a,secondary:Se,contrast:Xe,onColored:ve,disabled:Ce,inline:ye,active:Ee,palette:{color:Ce?ie.colorDisabled:ie.color,backgroundColor:Ce?ie.backgroundColorDisabled:ie.backgroundColor,backgroundColorHover:Ce?ie.backgroundColorDisabled:ie.backgroundColorHover,borderColor:Ce?ie.borderColorDisabled:ie.borderColor},iconProps:{color:Ce?'content-disabled':'content-onmain-tertiary',sizes:constants$1.SIZES_ICON,...Be,...m},onClick:()=>{$e.current&&$e.current.focus()},onFocus:e=>{e.target!==e.currentTarget&&Oe(!0)},onPointerDown:e=>{e.target!==$e.current&&e.target instanceof Node&&!Fe.current?.contains(e.target)&&!qe.current?.contains(e.target)&&!je.current?.contains(e.target)&&e.preventDefault()},onBlur:e=>{xe||!$e.current||e.currentTarget.contains(e.relatedTarget)||Oe(Boolean($e.current.value))},input:require$$0.jsx(FormInput.FormInput,{...Re,"aria-labelledby":be?De:void 0,ref:$e,type:c,disabled:Ce,palette:{color:ie.inputColor,placeholderColor:ie.inputPlaceholderColor,colorDisabled:ie.inputColorDisabled,placeholderColorDisabled:ie.inputPlaceholderColorDisabled},onChange:e=>{if(Re.onChange&&Re.onChange(e),c==='number'){const r=parseFloat(e.currentTarget.value);const t=r<=parseFloat(e.currentTarget.min);const o=r>=parseFloat(e.currentTarget.max);_e(t),He(o),(t||o)&&e.currentTarget.focus()}}}),addon:(g.onClick||ke.onClick)&&Me?require$$0.jsx(IconButton.IconButton,{ref:Fe,sizes:constants$1.SIZES_CONTROL,palette:Pe,...Be,...ke,...g,icon:Me,disabled:Ce||g.disabled||ke.disabled,marginLeft:12,onClick:e=>{e.stopPropagation(),Re.readOnly||(g.onClick&&g.onClick(e),ke.onClick&&ke.onClick(e))}}):void 0,controls:c==='number'?require$$0.jsxs(require$$0.Fragment,{children:[require$$0.jsx(IconButton.IconButton,{...Be,ref:qe,icon:"minus",sizes:constants$1.SIZES_CONTROL,palette:Pe,disabled:Ce||Ne,marginLeft:12,onClick:e=>{if(e.stopPropagation(),!Re.readOnly)try{if($e.current){Oe(!0);const e=$e.current.value;if($e.current.stepDown(),e!==$e.current.value){const e=new Event('input',{bubbles:!0});$e.current.dispatchEvent(e)}}}catch(e){console.error(e)}}}),require$$0.jsx(style.IconButtonSeparated,{...Be,ref:je,icon:"plus",sizes:constants$1.SIZES_CONTROL,palette:Pe,disabled:Ce||Ae,onClick:e=>{if(e.stopPropagation(),!Re.readOnly)try{if($e.current){Oe(!0);const e=$e.current.value;if($e.current.stepUp(),e!==$e.current.value){const e=new Event('input',{bubbles:!0});$e.current.dispatchEvent(e)}}}catch(e){console.error(e)}}})]}):void 0})})),{sizes:constants.SIZES,displayName:"Input"}),{Phone:Input_Phone.InputPhone});exports.COMPONENT_NAME="Input",exports.Input=Input;
1
+ 'use strict';var React=require('react');var styled=require('styled-components');var nanoid=require('nanoid');var withMergedProps=require('../../hocs/withMergedProps.js');var constants$1=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Input_Phone=require('../Input.Phone/Input.Phone.js');var constants=require('../FormInputLabel/constants.js');var FormInputLabel=require('../FormInputLabel/FormInputLabel.js');var FormInput=require('../FormInput/FormInput.js');var IconButton=require('../IconButton/IconButton.js');const Input=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((t,e)=>{const r=styled.useTheme();const{size:o="m",rounded:n=!0,primary:a=!0,color:i="mineShaft",placeholderColor:s="silver",width:l=r.defaultInputControlsWidth,type:c="text",labelPosition:u="dynamic",iconProps:m={},controls:g={},addonButtonProps:d={},preset:p,className:b,style:f,sizeXXS:h,sizeXS:S,sizeS:X,sizeM:v,sizeL:L,sizeXL:C,sizeUnits:R,sizes:y,margin:I,marginXXS:B,marginXS:x,marginS:k,marginM:j,marginL:T,marginXL:w,marginTop:z,marginTopXXS:M,marginTopXS:P,marginTopS:F,marginTopM:D,marginTopL:E,marginTopXL:O,marginRight:q,marginRightXXS:N,marginRightXS:A,marginRightS:H,marginRightM:_,marginRightL:Z,marginRightXL:$,marginBottom:U,marginBottomXXS:V,marginBottomXS:W,marginBottomS:G,marginBottomM:J,marginBottomL:K,marginBottomXL:Q,marginLeft:Y,marginLeftXXS:tt,marginLeftXS:et,marginLeftS:rt,marginLeftM:ot,marginLeftL:nt,marginLeftXL:at,palette:st,widthXXS:lt,widthXS:ct,widthS:ut,widthM:mt,widthL:gt,widthXL:dt,error:pt,success:bt,label:ft,icon:ht,text:St,secondary:Xt,contrast:vt,onColored:Lt,fluid:Ct,disabled:Rt,inline:yt,inputRef:It,...Bt}=t;const xt={size:o,sizeXXS:h,sizeXS:S,sizeS:X,sizeM:v,sizeL:L,sizeXL:C};const{icon:kt,buttonProps:jt={}}=g.additional??{};const[Tt,wt=(jt.onClick?void 0:kt)]=Array.isArray(ht)?ht:[ht];const zt=d.icon??kt;const Mt=Boolean(Bt.mask&&Bt.alwaysShowMask);const Pt={color:st.controlsColor,colorHover:st.controlsColorHover,colorActive:st.controlsColorActive,colorDisabled:st.controlsColorDisabled,backgroundColor:st.controlsBackgroundColor,backgroundColorHover:st.controlsBackgroundColorHover,backgroundColorActive:st.controlsBackgroundColorActive,backgroundColorDisabled:st.controlsBackgroundColorDisabled};const Ft=React.useRef(null);React.useImperativeHandle(e,(()=>Ft.current),[]);const Dt=React.useRef(null);const Et=React.useRef(null);const Ot=React.useRef(null);const qt=React.useMemo((()=>nanoid.nanoid()),[]);const[Nt,At]=React.useState((()=>{if(Mt)return!0;const t=Bt.value??Bt.defaultValue;return typeof t=='string'&&t.length>0||typeof t=='number'}));const[Ht,_t]=React.useState((()=>{if(c!=='number'||Bt.min===void 0)return!1;const{value:t=1/0,defaultValue:e=1/0}=Bt;const r=typeof t=='number'?t:parseFloat(t);const o=typeof e=='number'?e:parseFloat(e);const n=typeof Bt.min=='number'?Bt.min:parseFloat(Bt.min);return Math.min(r,o)<=n}));const[Zt,$t]=React.useState((()=>{if(c!=='number'||Bt.max===void 0)return!1;const{value:t=-1/0,defaultValue:e=-1/0}=Bt;const r=typeof t=='number'?t:parseFloat(t);const o=typeof e=='number'?e:parseFloat(e);const n=typeof Bt.max=='number'?Bt.max:parseFloat(Bt.max);return Math.max(r,o)>=n}));return React.useLayoutEffect((()=>{Mt?At(!0):Bt.value!==void 0&&Bt.value!==null&&Ft.current&&Ft.current!==document.activeElement&&At(typeof Bt.value=='string'&&Bt.value.length>0||typeof Bt.value=='number')}),[Mt,Bt.value]),p!=='brand'?jsxRuntime.jsx(style.Root,{...Bt,inputRef:It??(t=>{Ft.current=t}),className:b,style:f,size:typeof o=='number'?o:void 0,rounded:n,color:i,placeholderColor:s,width:l,widthXXS:lt,widthXS:ct,widthS:ut,widthM:mt,widthL:gt,widthXL:dt,error:pt,type:c,fluid:Ct,disabled:Rt}):jsxRuntime.jsx(FormInputLabel.FormInputLabel,{...xt,className:b,style:f,sizeUnits:R,sizes:y,margin:I,marginXXS:B,marginXS:x,marginS:k,marginM:j,marginL:T,marginXL:w,marginTop:z,marginTopXXS:M,marginTopXS:P,marginTopS:F,marginTopM:D,marginTopL:E,marginTopXL:O,marginRight:q,marginRightXXS:N,marginRightXS:A,marginRightS:H,marginRightM:_,marginRightL:Z,marginRightXL:$,marginBottom:U,marginBottomXXS:V,marginBottomXS:W,marginBottomS:G,marginBottomM:J,marginBottomL:K,marginBottomXL:Q,marginLeft:Y,marginLeftXXS:tt,marginLeftXS:et,marginLeftS:rt,marginLeftM:ot,marginLeftL:nt,marginLeftXL:at,error:pt,success:bt,label:ft,labelId:qt,labelPosition:u,icon:[Tt,wt],text:St,primary:a,secondary:Xt,contrast:vt,onColored:Lt,disabled:Rt,inline:yt,active:Nt,palette:{color:Rt?st.colorDisabled:st.color,backgroundColor:Rt?st.backgroundColorDisabled:st.backgroundColor,backgroundColorHover:Rt?st.backgroundColorDisabled:st.backgroundColorHover,borderColor:Rt?st.borderColorDisabled:st.borderColor},iconProps:{color:Rt?'content-disabled':'content-onmain-tertiary',sizes:constants$1.SIZES_ICON,...xt,...m},onClick:()=>{Ft.current&&Ft.current.focus()},onFocus:t=>{t.target!==t.currentTarget&&At(!0)},onPointerDown:t=>{t.target!==Ft.current&&t.target instanceof Node&&!Dt.current?.contains(t.target)&&!Et.current?.contains(t.target)&&!Ot.current?.contains(t.target)&&t.preventDefault()},onBlur:t=>{Mt||!Ft.current||t.currentTarget.contains(t.relatedTarget)||At(Boolean(Ft.current.value))},input:jsxRuntime.jsx(FormInput.FormInput,{...Bt,"aria-labelledby":ft?qt:void 0,ref:Ft,type:c,disabled:Rt,palette:{color:st.inputColor,placeholderColor:st.inputPlaceholderColor,colorDisabled:st.inputColorDisabled,placeholderColorDisabled:st.inputPlaceholderColorDisabled},onChange:t=>{if(Bt.onChange&&Bt.onChange(t),c==='number'){const e=parseFloat(t.currentTarget.value);const r=e<=parseFloat(t.currentTarget.min);const o=e>=parseFloat(t.currentTarget.max);_t(r),$t(o),(r||o)&&t.currentTarget.focus()}}}),addon:(d.onClick||jt.onClick)&&zt?jsxRuntime.jsx(IconButton.IconButton,{ref:Dt,sizes:constants$1.SIZES_CONTROL,palette:Pt,...xt,...jt,...d,icon:zt,disabled:Rt||d.disabled||jt.disabled,marginLeft:12,onClick:t=>{t.stopPropagation(),Bt.readOnly||(d.onClick&&d.onClick(t),jt.onClick&&jt.onClick(t))}}):void 0,controls:c==='number'?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(IconButton.IconButton,{...xt,ref:Et,icon:"minus",sizes:constants$1.SIZES_CONTROL,palette:Pt,disabled:Rt||Ht,marginLeft:12,onClick:t=>{if(t.stopPropagation(),!Bt.readOnly)try{if(Ft.current){At(!0);const t=Ft.current.value;if(Ft.current.stepDown(),t!==Ft.current.value){const t=new Event('input',{bubbles:!0});Ft.current.dispatchEvent(t)}}}catch(t){console.error(t)}}}),jsxRuntime.jsx(style.IconButtonSeparated,{...xt,ref:Ot,icon:"plus",sizes:constants$1.SIZES_CONTROL,palette:Pt,disabled:Rt||Zt,onClick:t=>{if(t.stopPropagation(),!Bt.readOnly)try{if(Ft.current){At(!0);const t=Ft.current.value;if(Ft.current.stepUp(),t!==Ft.current.value){const t=new Event('input',{bubbles:!0});Ft.current.dispatchEvent(t)}}}catch(t){console.error(t)}}})]}):void 0})})),{sizes:constants.SIZES,displayName:"Input"}),{Phone:Input_Phone.InputPhone});exports.COMPONENT_NAME="Input",exports.Input=Input;
2
2
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef, useState, useImperativeHandle, useRef, useLayoutEffect, useMemo } from 'react'\nimport { useTheme } from 'styled-components'\nimport { nanoid } from 'nanoid'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { FormInputLabel, SIZES } from 'components/FormInputLabel'\nimport { FormInput } from 'components/FormInput'\nimport { InputPhone } from 'components/Input.Phone'\nimport { IconButton } from 'components/IconButton'\nimport { SIZES_ICON, SIZES_CONTROL } from './constants'\nimport * as Styled from './style'\nimport type { InputProps } from './types'\n\nconst COMPONENT_NAME = 'Input'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<input\\> элемента и пропсы \"react-input-mask\" [v2.0.4](https://www.npmjs.com/package/react-input-mask/v/2.0.4?activeTab=readme).\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Можно передать \"ref\", который будет ассоциирован с \\<input\\>.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Input/types.ts).\n */\nconst Input: React.ForwardRefExoticComponent<InputProps> & { Phone: typeof InputPhone } = Object.assign(\n withMergedProps<InputProps, HTMLInputElement>(\n forwardRef((props, forwardedRef) => {\n const theme = useTheme()\n\n const {\n size = 'm',\n rounded = true,\n primary = true,\n color = 'mineShaft',\n placeholderColor = 'silver',\n width = theme.defaultInputControlsWidth,\n type = 'text',\n labelPosition = 'dynamic',\n iconProps = {},\n controls = {},\n addonButtonProps = {},\n preset,\n className,\n style,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n margin,\n marginXXS,\n marginXS,\n marginS,\n marginM,\n marginL,\n marginXL,\n marginTop,\n marginTopXXS,\n marginTopXS,\n marginTopS,\n marginTopM,\n marginTopL,\n marginTopXL,\n marginRight,\n marginRightXXS,\n marginRightXS,\n marginRightS,\n marginRightM,\n marginRightL,\n marginRightXL,\n marginBottom,\n marginBottomXXS,\n marginBottomXS,\n marginBottomS,\n marginBottomM,\n marginBottomL,\n marginBottomXL,\n marginLeft,\n marginLeftXXS,\n marginLeftXS,\n marginLeftS,\n marginLeftM,\n marginLeftL,\n marginLeftXL,\n palette,\n widthXXS,\n widthXS,\n widthS,\n widthM,\n widthL,\n widthXL,\n error,\n success,\n label,\n icon,\n text,\n secondary,\n contrast,\n onColored,\n fluid,\n disabled,\n inline,\n inputRef,\n ...inputProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const { icon: additionalControlIcon, buttonProps: additionalControlButtonProps = {} } = controls.additional ?? {}\n\n const [iconBefore, iconAfter = !additionalControlButtonProps.onClick ? additionalControlIcon : undefined] =\n Array.isArray(icon) ? icon : [icon]\n\n const addonControlIcon = addonButtonProps.icon ?? additionalControlIcon\n\n const inputAlwaysActive = Boolean(inputProps.mask && inputProps.alwaysShowMask)\n\n const controlPalette = {\n color: palette.controlsColor,\n colorHover: palette.controlsColorHover,\n colorActive: palette.controlsColorActive,\n colorDisabled: palette.controlsColorDisabled,\n backgroundColor: palette.controlsBackgroundColor,\n backgroundColorHover: palette.controlsBackgroundColorHover,\n backgroundColorActive: palette.controlsBackgroundColorActive,\n backgroundColorDisabled: palette.controlsBackgroundColorDisabled,\n }\n\n const ref = useRef<HTMLInputElement | null>(null)\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(forwardedRef, () => ref.current, [])\n\n const addonRef = useRef<HTMLButtonElement | null>(null)\n const minusRef = useRef<HTMLButtonElement | null>(null)\n const plusRef = useRef<HTMLButtonElement | null>(null)\n\n const inputLabelId = useMemo(() => nanoid(), [])\n\n const [inputActive, setInputActive] = useState(() => {\n if (inputAlwaysActive) return true\n\n const initValue = inputProps.value ?? inputProps.defaultValue\n\n return (typeof initValue === 'string' && initValue.length > 0) || typeof initValue === 'number'\n })\n\n const [minusDisabled, setMinusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.min === undefined) return false\n\n const { value = Infinity, defaultValue = Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const minValue = typeof inputProps.min === 'number' ? inputProps.min : parseFloat(inputProps.min)\n\n return Math.min(initValue, initDefaultValue) <= minValue\n })\n\n const [plusDisabled, setPlusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.max === undefined) return false\n\n const { value = -Infinity, defaultValue = -Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const maxValue = typeof inputProps.max === 'number' ? inputProps.max : parseFloat(inputProps.max)\n\n return Math.max(initValue, initDefaultValue) >= maxValue\n })\n\n useLayoutEffect(() => {\n if (inputAlwaysActive) {\n setInputActive(true)\n } else if (\n inputProps.value !== undefined &&\n inputProps.value !== null &&\n ref.current &&\n ref.current !== document.activeElement\n ) {\n setInputActive(\n (typeof inputProps.value === 'string' && inputProps.value.length > 0) ||\n typeof inputProps.value === 'number'\n )\n }\n }, [inputAlwaysActive, inputProps.value])\n\n if (preset !== 'brand') {\n return (\n <Styled.Root\n {...inputProps}\n inputRef={\n inputRef ??\n ((input) => {\n ref.current = input\n })\n }\n className={className}\n style={style}\n size={typeof size === 'number' ? size : undefined}\n rounded={rounded}\n color={color}\n placeholderColor={placeholderColor}\n width={width}\n widthXXS={widthXXS}\n widthXS={widthXS}\n widthS={widthS}\n widthM={widthM}\n widthL={widthL}\n widthXL={widthXL}\n error={error}\n type={type}\n fluid={fluid}\n disabled={disabled}\n />\n )\n }\n\n return (\n <FormInputLabel\n {...sizeProps}\n className={className}\n style={style}\n sizeUnits={sizeUnits}\n sizes={sizes}\n margin={margin}\n marginXXS={marginXXS}\n marginXS={marginXS}\n marginS={marginS}\n marginM={marginM}\n marginL={marginL}\n marginXL={marginXL}\n marginTop={marginTop}\n marginTopXXS={marginTopXXS}\n marginTopXS={marginTopXS}\n marginTopS={marginTopS}\n marginTopM={marginTopM}\n marginTopL={marginTopL}\n marginTopXL={marginTopXL}\n marginRight={marginRight}\n marginRightXXS={marginRightXXS}\n marginRightXS={marginRightXS}\n marginRightS={marginRightS}\n marginRightM={marginRightM}\n marginRightL={marginRightL}\n marginRightXL={marginRightXL}\n marginBottom={marginBottom}\n marginBottomXXS={marginBottomXXS}\n marginBottomXS={marginBottomXS}\n marginBottomS={marginBottomS}\n marginBottomM={marginBottomM}\n marginBottomL={marginBottomL}\n marginBottomXL={marginBottomXL}\n marginLeft={marginLeft}\n marginLeftXXS={marginLeftXXS}\n marginLeftXS={marginLeftXS}\n marginLeftS={marginLeftS}\n marginLeftM={marginLeftM}\n marginLeftL={marginLeftL}\n marginLeftXL={marginLeftXL}\n error={error}\n success={success}\n label={label}\n labelId={inputLabelId}\n labelPosition={labelPosition}\n icon={[iconBefore, iconAfter]}\n text={text}\n primary={primary}\n secondary={secondary}\n contrast={contrast}\n onColored={onColored}\n disabled={disabled}\n inline={inline}\n active={inputActive}\n palette={{\n color: disabled ? palette.colorDisabled : palette.color,\n backgroundColor: disabled ? palette.backgroundColorDisabled : palette.backgroundColor,\n backgroundColorHover: disabled ? palette.backgroundColorDisabled : palette.backgroundColorHover,\n borderColor: disabled ? palette.borderColorDisabled : palette.borderColor,\n }}\n iconProps={{\n color: disabled ? 'content-disabled' : 'content-onmain-tertiary',\n sizes: SIZES_ICON,\n ...sizeProps,\n ...iconProps,\n }}\n onClick={() => {\n if (ref.current) {\n ref.current.focus()\n }\n }}\n onFocus={(evt) => {\n if (evt.target !== evt.currentTarget) {\n setInputActive(true)\n }\n }}\n onPointerDown={(evt) => {\n if (\n evt.target === ref.current ||\n !(evt.target instanceof Node) ||\n addonRef.current?.contains(evt.target) ||\n minusRef.current?.contains(evt.target) ||\n plusRef.current?.contains(evt.target)\n ) {\n return\n }\n evt.preventDefault()\n }}\n onBlur={(evt) => {\n if (!inputAlwaysActive && ref.current && !evt.currentTarget.contains(evt.relatedTarget)) {\n setInputActive(Boolean(ref.current.value))\n }\n }}\n input={\n <FormInput\n {...inputProps}\n aria-labelledby={label ? inputLabelId : undefined}\n ref={ref}\n type={type}\n disabled={disabled}\n palette={{\n color: palette.inputColor,\n placeholderColor: palette.inputPlaceholderColor,\n colorDisabled: palette.inputColorDisabled,\n placeholderColorDisabled: palette.inputPlaceholderColorDisabled,\n }}\n onChange={(evt) => {\n if (inputProps.onChange) {\n inputProps.onChange(evt)\n }\n\n if (type === 'number') {\n const currentValue = parseFloat(evt.currentTarget.value)\n\n const minValueReached = currentValue <= parseFloat(evt.currentTarget.min)\n const maxValueReached = currentValue >= parseFloat(evt.currentTarget.max)\n\n setMinusDisabled(minValueReached)\n setPlusDisabled(maxValueReached)\n\n if (minValueReached || maxValueReached) {\n evt.currentTarget.focus()\n }\n }\n }}\n />\n }\n addon={\n (addonButtonProps.onClick || additionalControlButtonProps.onClick) && addonControlIcon ? (\n <IconButton\n ref={addonRef}\n sizes={SIZES_CONTROL}\n palette={controlPalette}\n {...sizeProps}\n {...additionalControlButtonProps}\n {...addonButtonProps}\n icon={addonControlIcon}\n disabled={disabled || addonButtonProps.disabled || additionalControlButtonProps.disabled}\n marginLeft={12}\n onClick={(evt) => {\n evt.stopPropagation()\n if (inputProps.readOnly) return\n\n if (addonButtonProps.onClick) addonButtonProps.onClick(evt)\n if (additionalControlButtonProps.onClick) additionalControlButtonProps.onClick(evt)\n }}\n />\n ) : undefined\n }\n controls={\n type === 'number' ? (\n <>\n <IconButton\n {...sizeProps}\n ref={minusRef}\n icon='minus'\n sizes={SIZES_CONTROL}\n palette={controlPalette}\n disabled={disabled || minusDisabled}\n marginLeft={12}\n onClick={(evt) => {\n evt.stopPropagation()\n if (inputProps.readOnly) return\n\n try {\n if (ref.current) {\n setInputActive(true)\n\n const prev = ref.current.value\n ref.current.stepDown()\n\n const decremented = ref.current.value\n if (prev !== decremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n />\n <Styled.IconButtonSeparated\n {...sizeProps}\n ref={plusRef}\n icon='plus'\n sizes={SIZES_CONTROL}\n palette={controlPalette}\n disabled={disabled || plusDisabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (inputProps.readOnly) return\n\n try {\n if (ref.current) {\n setInputActive(true)\n\n const prev = ref.current.value\n ref.current.stepUp()\n\n const incremented = ref.current.value\n if (prev !== incremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n />\n </>\n ) : undefined\n }\n />\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Phone: InputPhone,\n }\n)\n\nexport { Input, COMPONENT_NAME }\n"],"names":["Input","Object","assign","withMergedProps","forwardRef","props","forwardedRef","theme","useTheme","size","rounded","primary","color","placeholderColor","width","defaultInputControlsWidth","type","labelPosition","iconProps","controls","addonButtonProps","preset","className","style","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","margin","marginXXS","marginXS","marginS","marginM","marginL","marginXL","marginTop","marginTopXXS","marginTopXS","marginTopS","marginTopM","marginTopL","marginTopXL","marginRight","marginRightXXS","marginRightXS","marginRightS","marginRightM","marginRightL","marginRightXL","marginBottom","marginBottomXXS","marginBottomXS","marginBottomS","marginBottomM","marginBottomL","marginBottomXL","marginLeft","marginLeftXXS","marginLeftXS","marginLeftS","marginLeftM","marginLeftL","marginLeftXL","palette","widthXXS","widthXS","widthS","widthM","widthL","widthXL","error","success","label","icon","text","secondary","contrast","onColored","fluid","disabled","inline","inputRef","inputProps","sizeProps","additionalControlIcon","buttonProps","additionalControlButtonProps","additional","iconBefore","iconAfter","onClick","undefined","Array","isArray","addonControlIcon","inputAlwaysActive","Boolean","mask","alwaysShowMask","controlPalette","controlsColor","colorHover","controlsColorHover","colorActive","controlsColorActive","colorDisabled","controlsColorDisabled","backgroundColor","controlsBackgroundColor","backgroundColorHover","controlsBackgroundColorHover","backgroundColorActive","controlsBackgroundColorActive","backgroundColorDisabled","controlsBackgroundColorDisabled","ref","useRef","useImperativeHandle","current","addonRef","minusRef","plusRef","inputLabelId","useMemo","nanoid","inputActive","setInputActive","useState","initValue","value","defaultValue","length","minusDisabled","setMinusDisabled","min","Infinity","parseFloat","initDefaultValue","minValue","Math","plusDisabled","setPlusDisabled","max","maxValue","useLayoutEffect","document","activeElement","_jsx","Styled","input","FormInputLabel","labelId","active","borderColor","borderColorDisabled","SIZES_ICON","focus","onFocus","evt","target","currentTarget","onPointerDown","Node","contains","preventDefault","onBlur","relatedTarget","jsx","FormInput","inputColor","inputPlaceholderColor","inputColorDisabled","placeholderColorDisabled","inputPlaceholderColorDisabled","onChange","currentValue","minValueReached","maxValueReached","addon","IconButton","SIZES_CONTROL","stopPropagation","readOnly","_jsxs","_Fragment","children","prev","stepDown","event","Event","bubbles","dispatchEvent","err","console","stepUp","SIZES","displayName","Phone","InputPhone"],"mappings":"moBAwBA,MAAMA,MAAoFC,OAAOC,OAC/FC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAQC,OAAAA,WAEd,MAAMC,KACJA,EAAO,IAAGC,QACVA,GAAU,EAAIC,QACdA,GAAU,EAAIC,MACdA,EAAQ,YAAWC,iBACnBA,EAAmB,SAAQC,MAC3BA,EAAQP,EAAMQ,0BAAyBC,KACvCA,EAAO,OAAMC,cACbA,EAA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MAIzB,GAHAd,GAAIG,QAAQqE,WAGRD,IADgBvE,GAAIG,QAAQW,MACN,CACxB,MAAM2D,EAAQ,IAAIC,MAAM,QAAS,CAAEC,SAAS,IAC5C3E,GAAIG,QAAQyE,cAAcH,EAC5B,CACF,CACD,CAAC,MAAOI,GAEPC,QAAQ3H,MAAM0H,EAChB,KAGJ7C,WAAAoB,IAACnB,0BAA0B,IACrBjE,GACJgC,IAAKM,GACLhD,KAAK,OACL9C,MAAOyJ,YAAcA,cACrBrH,QAASoC,GACTpB,SAAUA,IAAY6D,GACtBlD,QAAUoE,IAER,GADAA,EAAIuB,mBACAnG,GAAWoG,SAEf,IACE,GAAInE,GAAIG,QAAS,CACfQ,IAAe,GAEf,MAAM4D,EAAOvE,GAAIG,QAAQW,MAIzB,GAHAd,GAAIG,QAAQ4E,SAGRR,IADgBvE,GAAIG,QAAQW,MACN,CACxB,MAAM2D,EAAQ,IAAIC,MAAM,QAAS,CAAEC,SAAS,IAC5C3E,GAAIG,QAAQyE,cAAcH,EAC5B,CACF,CACD,CAAC,MAAOI,GAEPC,QAAQ3H,MAAM0H,EAChB,aAIJrG,GAEN,IAGN,CACEhE,MAAOwK,UAAKA,MACZC,YAtbiB,UAybrB,CACEC,MAAOC,YAAAA,oCA1bY"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef, useState, useImperativeHandle, useRef, useLayoutEffect, useMemo } from 'react'\nimport { useTheme } from 'styled-components'\nimport { nanoid } from 'nanoid'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { FormInputLabel, SIZES } from 'components/FormInputLabel'\nimport { FormInput } from 'components/FormInput'\nimport { InputPhone } from 'components/Input.Phone'\nimport { IconButton } from 'components/IconButton'\nimport { SIZES_ICON, SIZES_CONTROL } from './constants'\nimport * as Styled from './style'\nimport type { InputProps } from './types'\n\nconst COMPONENT_NAME = 'Input'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<input\\> элемента.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Можно передать \"ref\", который будет ассоциирован с \\<input\\>.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Input/types.ts).\n */\nconst Input: React.ForwardRefExoticComponent<InputProps> & { Phone: typeof InputPhone } = Object.assign(\n withMergedProps<InputProps, HTMLInputElement>(\n forwardRef((props, forwardedRef) => {\n const theme = useTheme()\n\n const {\n size = 'm',\n rounded = true,\n primary = true,\n color = 'mineShaft',\n placeholderColor = 'silver',\n width = theme.defaultInputControlsWidth,\n type = 'text',\n labelPosition = 'dynamic',\n iconProps = {},\n controls = {},\n addonButtonProps = {},\n preset,\n className,\n style,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n margin,\n marginXXS,\n marginXS,\n marginS,\n marginM,\n marginL,\n marginXL,\n marginTop,\n marginTopXXS,\n marginTopXS,\n marginTopS,\n marginTopM,\n marginTopL,\n marginTopXL,\n marginRight,\n marginRightXXS,\n marginRightXS,\n marginRightS,\n marginRightM,\n marginRightL,\n marginRightXL,\n marginBottom,\n marginBottomXXS,\n marginBottomXS,\n marginBottomS,\n marginBottomM,\n marginBottomL,\n marginBottomXL,\n marginLeft,\n marginLeftXXS,\n marginLeftXS,\n marginLeftS,\n marginLeftM,\n marginLeftL,\n marginLeftXL,\n palette,\n widthXXS,\n widthXS,\n widthS,\n widthM,\n widthL,\n widthXL,\n error,\n success,\n label,\n icon,\n text,\n secondary,\n contrast,\n onColored,\n fluid,\n disabled,\n inline,\n inputRef,\n ...inputProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const { icon: additionalControlIcon, buttonProps: additionalControlButtonProps = {} } = controls.additional ?? {}\n\n const [iconBefore, iconAfter = !additionalControlButtonProps.onClick ? additionalControlIcon : undefined] =\n Array.isArray(icon) ? icon : [icon]\n\n const addonControlIcon = addonButtonProps.icon ?? additionalControlIcon\n\n const inputAlwaysActive = Boolean(inputProps.mask && inputProps.alwaysShowMask)\n\n const controlPalette = {\n color: palette.controlsColor,\n colorHover: palette.controlsColorHover,\n colorActive: palette.controlsColorActive,\n colorDisabled: palette.controlsColorDisabled,\n backgroundColor: palette.controlsBackgroundColor,\n backgroundColorHover: palette.controlsBackgroundColorHover,\n backgroundColorActive: palette.controlsBackgroundColorActive,\n backgroundColorDisabled: palette.controlsBackgroundColorDisabled,\n }\n\n const ref = useRef<HTMLInputElement | null>(null)\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(forwardedRef, () => ref.current, [])\n\n const addonRef = useRef<HTMLButtonElement | null>(null)\n const minusRef = useRef<HTMLButtonElement | null>(null)\n const plusRef = useRef<HTMLButtonElement | null>(null)\n\n const inputLabelId = useMemo(() => nanoid(), [])\n\n const [inputActive, setInputActive] = useState(() => {\n if (inputAlwaysActive) return true\n\n const initValue = inputProps.value ?? inputProps.defaultValue\n\n return (typeof initValue === 'string' && initValue.length > 0) || typeof initValue === 'number'\n })\n\n const [minusDisabled, setMinusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.min === undefined) return false\n\n const { value = Infinity, defaultValue = Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const minValue = typeof inputProps.min === 'number' ? inputProps.min : parseFloat(inputProps.min)\n\n return Math.min(initValue, initDefaultValue) <= minValue\n })\n\n const [plusDisabled, setPlusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.max === undefined) return false\n\n const { value = -Infinity, defaultValue = -Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const maxValue = typeof inputProps.max === 'number' ? inputProps.max : parseFloat(inputProps.max)\n\n return Math.max(initValue, initDefaultValue) >= maxValue\n })\n\n useLayoutEffect(() => {\n if (inputAlwaysActive) {\n setInputActive(true)\n } else if (\n inputProps.value !== undefined &&\n inputProps.value !== null &&\n ref.current &&\n ref.current !== document.activeElement\n ) {\n setInputActive(\n (typeof inputProps.value === 'string' && inputProps.value.length > 0) ||\n typeof inputProps.value === 'number'\n )\n }\n }, [inputAlwaysActive, inputProps.value])\n\n if (preset !== 'brand') {\n return (\n <Styled.Root\n {...inputProps}\n inputRef={\n inputRef ??\n ((input) => {\n ref.current = input\n })\n }\n className={className}\n style={style}\n size={typeof size === 'number' ? size : undefined}\n rounded={rounded}\n color={color}\n placeholderColor={placeholderColor}\n width={width}\n widthXXS={widthXXS}\n widthXS={widthXS}\n widthS={widthS}\n widthM={widthM}\n widthL={widthL}\n widthXL={widthXL}\n error={error}\n type={type}\n fluid={fluid}\n disabled={disabled}\n />\n )\n }\n\n return (\n <FormInputLabel\n {...sizeProps}\n className={className}\n style={style}\n sizeUnits={sizeUnits}\n sizes={sizes}\n margin={margin}\n marginXXS={marginXXS}\n marginXS={marginXS}\n marginS={marginS}\n marginM={marginM}\n marginL={marginL}\n marginXL={marginXL}\n marginTop={marginTop}\n marginTopXXS={marginTopXXS}\n marginTopXS={marginTopXS}\n marginTopS={marginTopS}\n marginTopM={marginTopM}\n marginTopL={marginTopL}\n marginTopXL={marginTopXL}\n marginRight={marginRight}\n marginRightXXS={marginRightXXS}\n marginRightXS={marginRightXS}\n marginRightS={marginRightS}\n marginRightM={marginRightM}\n marginRightL={marginRightL}\n marginRightXL={marginRightXL}\n marginBottom={marginBottom}\n marginBottomXXS={marginBottomXXS}\n marginBottomXS={marginBottomXS}\n marginBottomS={marginBottomS}\n marginBottomM={marginBottomM}\n marginBottomL={marginBottomL}\n marginBottomXL={marginBottomXL}\n marginLeft={marginLeft}\n marginLeftXXS={marginLeftXXS}\n marginLeftXS={marginLeftXS}\n marginLeftS={marginLeftS}\n marginLeftM={marginLeftM}\n marginLeftL={marginLeftL}\n marginLeftXL={marginLeftXL}\n error={error}\n success={success}\n label={label}\n labelId={inputLabelId}\n labelPosition={labelPosition}\n icon={[iconBefore, iconAfter]}\n text={text}\n primary={primary}\n secondary={secondary}\n contrast={contrast}\n onColored={onColored}\n disabled={disabled}\n inline={inline}\n active={inputActive}\n palette={{\n color: disabled ? palette.colorDisabled : palette.color,\n backgroundColor: disabled ? palette.backgroundColorDisabled : palette.backgroundColor,\n backgroundColorHover: disabled ? palette.backgroundColorDisabled : palette.backgroundColorHover,\n borderColor: disabled ? palette.borderColorDisabled : palette.borderColor,\n }}\n iconProps={{\n color: disabled ? 'content-disabled' : 'content-onmain-tertiary',\n sizes: SIZES_ICON,\n ...sizeProps,\n ...iconProps,\n }}\n onClick={() => {\n if (ref.current) {\n ref.current.focus()\n }\n }}\n onFocus={(evt) => {\n if (evt.target !== evt.currentTarget) {\n setInputActive(true)\n }\n }}\n onPointerDown={(evt) => {\n if (\n evt.target === ref.current ||\n !(evt.target instanceof Node) ||\n addonRef.current?.contains(evt.target) ||\n minusRef.current?.contains(evt.target) ||\n plusRef.current?.contains(evt.target)\n ) {\n return\n }\n evt.preventDefault()\n }}\n onBlur={(evt) => {\n if (!inputAlwaysActive && ref.current && !evt.currentTarget.contains(evt.relatedTarget)) {\n setInputActive(Boolean(ref.current.value))\n }\n }}\n input={\n <FormInput\n {...inputProps}\n aria-labelledby={label ? inputLabelId : undefined}\n ref={ref}\n type={type}\n disabled={disabled}\n palette={{\n color: palette.inputColor,\n placeholderColor: palette.inputPlaceholderColor,\n colorDisabled: palette.inputColorDisabled,\n placeholderColorDisabled: palette.inputPlaceholderColorDisabled,\n }}\n onChange={(evt) => {\n if (inputProps.onChange) {\n inputProps.onChange(evt)\n }\n\n if (type === 'number') {\n const currentValue = parseFloat(evt.currentTarget.value)\n\n const minValueReached = currentValue <= parseFloat(evt.currentTarget.min)\n const maxValueReached = currentValue >= parseFloat(evt.currentTarget.max)\n\n setMinusDisabled(minValueReached)\n setPlusDisabled(maxValueReached)\n\n if (minValueReached || maxValueReached) {\n evt.currentTarget.focus()\n }\n }\n }}\n />\n }\n addon={\n (addonButtonProps.onClick || additionalControlButtonProps.onClick) && addonControlIcon ? (\n <IconButton\n ref={addonRef}\n sizes={SIZES_CONTROL}\n palette={controlPalette}\n {...sizeProps}\n {...additionalControlButtonProps}\n {...addonButtonProps}\n icon={addonControlIcon}\n disabled={disabled || addonButtonProps.disabled || additionalControlButtonProps.disabled}\n marginLeft={12}\n onClick={(evt) => {\n evt.stopPropagation()\n if (inputProps.readOnly) return\n\n if (addonButtonProps.onClick) addonButtonProps.onClick(evt)\n if (additionalControlButtonProps.onClick) additionalControlButtonProps.onClick(evt)\n }}\n />\n ) : undefined\n }\n controls={\n type === 'number' ? (\n <>\n <IconButton\n {...sizeProps}\n ref={minusRef}\n icon='minus'\n sizes={SIZES_CONTROL}\n palette={controlPalette}\n disabled={disabled || minusDisabled}\n marginLeft={12}\n onClick={(evt) => {\n evt.stopPropagation()\n if (inputProps.readOnly) return\n\n try {\n if (ref.current) {\n setInputActive(true)\n\n const prev = ref.current.value\n ref.current.stepDown()\n\n const decremented = ref.current.value\n if (prev !== decremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n />\n <Styled.IconButtonSeparated\n {...sizeProps}\n ref={plusRef}\n icon='plus'\n sizes={SIZES_CONTROL}\n palette={controlPalette}\n disabled={disabled || plusDisabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (inputProps.readOnly) return\n\n try {\n if (ref.current) {\n setInputActive(true)\n\n const prev = ref.current.value\n ref.current.stepUp()\n\n const incremented = ref.current.value\n if (prev !== incremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n />\n </>\n ) : undefined\n }\n />\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Phone: InputPhone,\n }\n)\n\nexport { Input, COMPONENT_NAME }\n"],"names":["Input","Object","assign","withMergedProps","forwardRef","props","forwardedRef","theme","useTheme","size","rounded","primary","color","placeholderColor","width","defaultInputControlsWidth","type","labelPosition","iconProps","controls","addonButtonProps","preset","className","style","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","margin","marginXXS","marginXS","marginS","marginM","marginL","marginXL","marginTop","marginTopXXS","marginTopXS","marginTopS","marginTopM","marginTopL","marginTopXL","marginRight","marginRightXXS","marginRightXS","marginRightS","marginRightM","marginRightL","marginRightXL","marginBottom","marginBottomXXS","marginBottomXS","marginBottomS","marginBottomM","marginBottomL","marginBottomXL","marginLeft","marginLeftXXS","marginLeftXS","marginLeftS","marginLeftM","marginLeftL","marginLeftXL","palette","widthXXS","widthXS","widthS","widthM","widthL","widthXL","error","success","label","icon","text","secondary","contrast","onColored","fluid","disabled","inline","inputRef","inputProps","sizeProps","additionalControlIcon","buttonProps","additionalControlButtonProps","additional","iconBefore","iconAfter","onClick","undefined","Array","isArray","addonControlIcon","inputAlwaysActive","Boolean","mask","alwaysShowMask","controlPalette","controlsColor","colorHover","controlsColorHover","colorActive","controlsColorActive","colorDisabled","controlsColorDisabled","backgroundColor","controlsBackgroundColor","backgroundColorHover","controlsBackgroundColorHover","backgroundColorActive","controlsBackgroundColorActive","backgroundColorDisabled","controlsBackgroundColorDisabled","ref","useRef","useImperativeHandle","current","addonRef","minusRef","plusRef","inputLabelId","useMemo","nanoid","inputActive","setInputActive","useState","initValue","value","defaultValue","length","minusDisabled","setMinusDisabled","min","Infinity","parseFloat","initDefaultValue","minValue","Math","plusDisabled","setPlusDisabled","max","maxValue","useLayoutEffect","document","activeElement","_jsx","Styled","input","FormInputLabel","labelId","active","borderColor","borderColorDisabled","SIZES_ICON","focus","onFocus","evt","target","currentTarget","onPointerDown","Node","contains","preventDefault","onBlur","relatedTarget","jsx","FormInput","inputColor","inputPlaceholderColor","inputColorDisabled","placeholderColorDisabled","inputPlaceholderColorDisabled","onChange","currentValue","minValueReached","maxValueReached","addon","IconButton","SIZES_CONTROL","stopPropagation","readOnly","_jsxs","_Fragment","children","prev","stepDown","event","Event","bubbles","dispatchEvent","err","console","stepUp","SIZES","displayName","Phone","InputPhone"],"mappings":"4jBAwBA,MAAMA,MAAoFC,OAAOC,OAC/FC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAQC,OAAAA,WAEd,MAAMC,KACJA,EAAO,IAAGC,QACVA,GAAU,EAAIC,QACdA,GAAU,EAAIC,MACdA,EAAQ,YAAWC,iBACnBA,EAAmB,SAAQC,MAC3BA,EAAQP,EAAMQ,0BAAyBC,KACvCA,EAAO,OAAMC,cACbA,EAAgB,UAASC,UACzBA,EAAY,CAAE,EAAAC,SACdA,EAAW,CAAE,EAAAC,iBACbA,EAAmB,CAAE,EAAAC,OACrBA,EAAMC,UACNA,QACAC,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,MACTA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,UACRA,EAASC,aACTA,EAAYC,YACZA,EAAWC,WACXA,EAAUC,WACVA,EAAUC,WACVA,EAAUC,YACVA,EAAWC,YACXA,EAAWC,eACXA,EAAcC,cACdA,EAAaC,aACbA,EAAYC,aACZA,EAAYC,aACZA,EAAYC,cACZA,EAAaC,aACbA,EAAYC,gBACZA,EAAeC,eACfA,EAAcC,cACdA,EAAaC,cACbA,EAAaC,cACbA,EAAaC,eACbA,EAAcC,WACdA,EAAUC,cACVA,GAAaC,aACbA,GAAYC,YACZA,GAAWC,YACXA,GAAWC,YACXA,GAAWC,aACXA,GAAYC,QACZA,GAAOC,SACPA,GAAQC,QACRA,G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AAOwK,UAAKA,MACZC,YAtbiB,UAybrB,CACEC,MAAOC,YAAAA,oCA1bY"}
@@ -1,2 +1,2 @@
1
- import{forwardRef,useRef,useImperativeHandle,useMemo,useState,useLayoutEffect}from'react';import{useTheme}from'styled-components';import{nanoid}from'../../external/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES_ICON,SIZES_CONTROL}from'./constants.mjs';import{Root,IconButtonSeparated}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{InputPhone}from'../Input.Phone/Input.Phone.mjs';import{SIZES}from'../FormInputLabel/constants.mjs';import{FormInputLabel}from'../FormInputLabel/FormInputLabel.mjs';import{FormInput}from'../FormInput/FormInput.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const COMPONENT_NAME='Input';const Input=Object.assign(withMergedProps(forwardRef(((o,r)=>{const t=useTheme();const{size:e="m",rounded:n=!0,primary:a=!0,color:i="mineShaft",placeholderColor:s="silver",width:l=t.defaultInputControlsWidth,type:m="text",labelPosition:c="dynamic",iconProps:u={},controls:d={},addonButtonProps:g={},preset:p,className:f,style:b,sizeXXS:S,sizeXS:h,sizeS:X,sizeM:L,sizeL:C,sizeXL:v,sizeUnits:I,sizes:y,margin:B,marginXXS:R,marginXS:T,marginS:k,marginM:w,marginL:M,marginXL:z,marginTop:x,marginTopXXS:P,marginTopXS:F,marginTopS:j,marginTopM:E,marginTopL:O,marginTopXL:N,marginRight:D,marginRightXXS:_,marginRightXS:A,marginRightS:H,marginRightM:Z,marginRightL:U,marginRightXL:V,marginBottom:W,marginBottomXXS:q,marginBottomXS:G,marginBottomS:J,marginBottomM:K,marginBottomL:Q,marginBottomXL:Y,marginLeft:$,marginLeftXXS:oo,marginLeftXS:ro,marginLeftS:to,marginLeftM:eo,marginLeftL:no,marginLeftXL:ao,palette:io,widthXXS:so,widthXS:lo,widthS:mo,widthM:co,widthL:uo,widthXL:go,error:po,success:fo,label:bo,icon:So,text:ho,secondary:Xo,contrast:Lo,onColored:Co,fluid:vo,disabled:Io,inline:yo,inputRef:Bo,...Ro}=o;const To={size:e,sizeXXS:S,sizeXS:h,sizeS:X,sizeM:L,sizeL:C,sizeXL:v};const{icon:ko,buttonProps:wo={}}=d.additional??{};const[Mo,zo=(wo.onClick?void 0:ko)]=Array.isArray(So)?So:[So];const xo=g.icon??ko;const Po=Boolean(Ro.mask&&Ro.alwaysShowMask);const Fo={color:io.controlsColor,colorHover:io.controlsColorHover,colorActive:io.controlsColorActive,colorDisabled:io.controlsColorDisabled,backgroundColor:io.controlsBackgroundColor,backgroundColorHover:io.controlsBackgroundColorHover,backgroundColorActive:io.controlsBackgroundColorActive,backgroundColorDisabled:io.controlsBackgroundColorDisabled};const jo=useRef(null);useImperativeHandle(r,(()=>jo.current),[]);const Eo=useRef(null);const Oo=useRef(null);const No=useRef(null);const Do=useMemo((()=>nanoid()),[]);const[_o,Ao]=useState((()=>{if(Po)return!0;const o=Ro.value??Ro.defaultValue;return typeof o=='string'&&o.length>0||typeof o=='number'}));const[Ho,Zo]=useState((()=>{if(m!=='number'||Ro.min===void 0)return!1;const{value:o=1/0,defaultValue:r=1/0}=Ro;const t=typeof o=='number'?o:parseFloat(o);const e=typeof r=='number'?r:parseFloat(r);const n=typeof Ro.min=='number'?Ro.min:parseFloat(Ro.min);return Math.min(t,e)<=n}));const[Uo,Vo]=useState((()=>{if(m!=='number'||Ro.max===void 0)return!1;const{value:o=-1/0,defaultValue:r=-1/0}=Ro;const t=typeof o=='number'?o:parseFloat(o);const e=typeof r=='number'?r:parseFloat(r);const n=typeof Ro.max=='number'?Ro.max:parseFloat(Ro.max);return Math.max(t,e)>=n}));return useLayoutEffect((()=>{Po?Ao(!0):Ro.value!==void 0&&Ro.value!==null&&jo.current&&jo.current!==document.activeElement&&Ao(typeof Ro.value=='string'&&Ro.value.length>0||typeof Ro.value=='number')}),[Po,Ro.value]),p!=='brand'?jsx(Root,{...Ro,inputRef:Bo??(o=>{jo.current=o}),className:f,style:b,size:typeof e=='number'?e:void 0,rounded:n,color:i,placeholderColor:s,width:l,widthXXS:so,widthXS:lo,widthS:mo,widthM:co,widthL:uo,widthXL:go,error:po,type:m,fluid:vo,disabled:Io}):jsx(FormInputLabel,{...To,className:f,style:b,sizeUnits:I,sizes:y,margin:B,marginXXS:R,marginXS:T,marginS:k,marginM:w,marginL:M,marginXL:z,marginTop:x,marginTopXXS:P,marginTopXS:F,marginTopS:j,marginTopM:E,marginTopL:O,marginTopXL:N,marginRight:D,marginRightXXS:_,marginRightXS:A,marginRightS:H,marginRightM:Z,marginRightL:U,marginRightXL:V,marginBottom:W,marginBottomXXS:q,marginBottomXS:G,marginBottomS:J,marginBottomM:K,marginBottomL:Q,marginBottomXL:Y,marginLeft:$,marginLeftXXS:oo,marginLeftXS:ro,marginLeftS:to,marginLeftM:eo,marginLeftL:no,marginLeftXL:ao,error:po,success:fo,label:bo,labelId:Do,labelPosition:c,icon:[Mo,zo],text:ho,primary:a,secondary:Xo,contrast:Lo,onColored:Co,disabled:Io,inline:yo,active:_o,palette:{color:Io?io.colorDisabled:io.color,backgroundColor:Io?io.backgroundColorDisabled:io.backgroundColor,backgroundColorHover:Io?io.backgroundColorDisabled:io.backgroundColorHover,borderColor:Io?io.borderColorDisabled:io.borderColor},iconProps:{color:Io?'content-disabled':'content-onmain-tertiary',sizes:SIZES_ICON,...To,...u},onClick:()=>{jo.current&&jo.current.focus()},onFocus:o=>{o.target!==o.currentTarget&&Ao(!0)},onPointerDown:o=>{o.target!==jo.current&&o.target instanceof Node&&!Eo.current?.contains(o.target)&&!Oo.current?.contains(o.target)&&!No.current?.contains(o.target)&&o.preventDefault()},onBlur:o=>{Po||!jo.current||o.currentTarget.contains(o.relatedTarget)||Ao(Boolean(jo.current.value))},input:jsx(FormInput,{...Ro,"aria-labelledby":bo?Do:void 0,ref:jo,type:m,disabled:Io,palette:{color:io.inputColor,placeholderColor:io.inputPlaceholderColor,colorDisabled:io.inputColorDisabled,placeholderColorDisabled:io.inputPlaceholderColorDisabled},onChange:o=>{if(Ro.onChange&&Ro.onChange(o),m==='number'){const r=parseFloat(o.currentTarget.value);const t=r<=parseFloat(o.currentTarget.min);const e=r>=parseFloat(o.currentTarget.max);Zo(t),Vo(e),(t||e)&&o.currentTarget.focus()}}}),addon:(g.onClick||wo.onClick)&&xo?jsx(IconButton,{ref:Eo,sizes:SIZES_CONTROL,palette:Fo,...To,...wo,...g,icon:xo,disabled:Io||g.disabled||wo.disabled,marginLeft:12,onClick:o=>{o.stopPropagation(),Ro.readOnly||(g.onClick&&g.onClick(o),wo.onClick&&wo.onClick(o))}}):void 0,controls:m==='number'?jsxs(Fragment,{children:[jsx(IconButton,{...To,ref:Oo,icon:"minus",sizes:SIZES_CONTROL,palette:Fo,disabled:Io||Ho,marginLeft:12,onClick:o=>{if(o.stopPropagation(),!Ro.readOnly)try{if(jo.current){Ao(!0);const o=jo.current.value;if(jo.current.stepDown(),o!==jo.current.value){const o=new Event('input',{bubbles:!0});jo.current.dispatchEvent(o)}}}catch(o){console.error(o)}}}),jsx(IconButtonSeparated,{...To,ref:No,icon:"plus",sizes:SIZES_CONTROL,palette:Fo,disabled:Io||Uo,onClick:o=>{if(o.stopPropagation(),!Ro.readOnly)try{if(jo.current){Ao(!0);const o=jo.current.value;if(jo.current.stepUp(),o!==jo.current.value){const o=new Event('input',{bubbles:!0});jo.current.dispatchEvent(o)}}}catch(o){console.error(o)}}})]}):void 0})})),{sizes:SIZES,displayName:"Input"}),{Phone:InputPhone});export{COMPONENT_NAME,Input};
1
+ import{forwardRef,useRef,useImperativeHandle,useMemo,useState,useLayoutEffect}from'react';import{useTheme}from'styled-components';import{nanoid}from'nanoid';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES_ICON,SIZES_CONTROL}from'./constants.mjs';import{Root,IconButtonSeparated}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{InputPhone}from'../Input.Phone/Input.Phone.mjs';import{SIZES}from'../FormInputLabel/constants.mjs';import{FormInputLabel}from'../FormInputLabel/FormInputLabel.mjs';import{FormInput}from'../FormInput/FormInput.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const COMPONENT_NAME='Input';const Input=Object.assign(withMergedProps(forwardRef(((o,r)=>{const t=useTheme();const{size:e="m",rounded:n=!0,primary:a=!0,color:i="mineShaft",placeholderColor:s="silver",width:l=t.defaultInputControlsWidth,type:c="text",labelPosition:m="dynamic",iconProps:u={},controls:g={},addonButtonProps:d={},preset:p,className:f,style:b,sizeXXS:S,sizeXS:h,sizeS:X,sizeM:L,sizeL:C,sizeXL:v,sizeUnits:I,sizes:y,margin:B,marginXXS:R,marginXS:T,marginS:k,marginM:M,marginL:w,marginXL:z,marginTop:P,marginTopXXS:F,marginTopXS:x,marginTopS:j,marginTopM:E,marginTopL:O,marginTopXL:N,marginRight:D,marginRightXXS:A,marginRightXS:H,marginRightS:Z,marginRightM:_,marginRightL:U,marginRightXL:V,marginBottom:W,marginBottomXXS:q,marginBottomXS:G,marginBottomS:J,marginBottomM:K,marginBottomL:Q,marginBottomXL:Y,marginLeft:$,marginLeftXXS:oo,marginLeftXS:ro,marginLeftS:to,marginLeftM:eo,marginLeftL:no,marginLeftXL:ao,palette:io,widthXXS:so,widthXS:lo,widthS:co,widthM:mo,widthL:uo,widthXL:go,error:po,success:fo,label:bo,icon:So,text:ho,secondary:Xo,contrast:Lo,onColored:Co,fluid:vo,disabled:Io,inline:yo,inputRef:Bo,...Ro}=o;const To={size:e,sizeXXS:S,sizeXS:h,sizeS:X,sizeM:L,sizeL:C,sizeXL:v};const{icon:ko,buttonProps:Mo={}}=g.additional??{};const[wo,zo=(Mo.onClick?void 0:ko)]=Array.isArray(So)?So:[So];const Po=d.icon??ko;const Fo=Boolean(Ro.mask&&Ro.alwaysShowMask);const xo={color:io.controlsColor,colorHover:io.controlsColorHover,colorActive:io.controlsColorActive,colorDisabled:io.controlsColorDisabled,backgroundColor:io.controlsBackgroundColor,backgroundColorHover:io.controlsBackgroundColorHover,backgroundColorActive:io.controlsBackgroundColorActive,backgroundColorDisabled:io.controlsBackgroundColorDisabled};const jo=useRef(null);useImperativeHandle(r,(()=>jo.current),[]);const Eo=useRef(null);const Oo=useRef(null);const No=useRef(null);const Do=useMemo((()=>nanoid()),[]);const[Ao,Ho]=useState((()=>{if(Fo)return!0;const o=Ro.value??Ro.defaultValue;return typeof o=='string'&&o.length>0||typeof o=='number'}));const[Zo,_o]=useState((()=>{if(c!=='number'||Ro.min===void 0)return!1;const{value:o=1/0,defaultValue:r=1/0}=Ro;const t=typeof o=='number'?o:parseFloat(o);const e=typeof r=='number'?r:parseFloat(r);const n=typeof Ro.min=='number'?Ro.min:parseFloat(Ro.min);return Math.min(t,e)<=n}));const[Uo,Vo]=useState((()=>{if(c!=='number'||Ro.max===void 0)return!1;const{value:o=-1/0,defaultValue:r=-1/0}=Ro;const t=typeof o=='number'?o:parseFloat(o);const e=typeof r=='number'?r:parseFloat(r);const n=typeof Ro.max=='number'?Ro.max:parseFloat(Ro.max);return Math.max(t,e)>=n}));return useLayoutEffect((()=>{Fo?Ho(!0):Ro.value!==void 0&&Ro.value!==null&&jo.current&&jo.current!==document.activeElement&&Ho(typeof Ro.value=='string'&&Ro.value.length>0||typeof Ro.value=='number')}),[Fo,Ro.value]),p!=='brand'?jsx(Root,{...Ro,inputRef:Bo??(o=>{jo.current=o}),className:f,style:b,size:typeof e=='number'?e:void 0,rounded:n,color:i,placeholderColor:s,width:l,widthXXS:so,widthXS:lo,widthS:co,widthM:mo,widthL:uo,widthXL:go,error:po,type:c,fluid:vo,disabled:Io}):jsx(FormInputLabel,{...To,className:f,style:b,sizeUnits:I,sizes:y,margin:B,marginXXS:R,marginXS:T,marginS:k,marginM:M,marginL:w,marginXL:z,marginTop:P,marginTopXXS:F,marginTopXS:x,marginTopS:j,marginTopM:E,marginTopL:O,marginTopXL:N,marginRight:D,marginRightXXS:A,marginRightXS:H,marginRightS:Z,marginRightM:_,marginRightL:U,marginRightXL:V,marginBottom:W,marginBottomXXS:q,marginBottomXS:G,marginBottomS:J,marginBottomM:K,marginBottomL:Q,marginBottomXL:Y,marginLeft:$,marginLeftXXS:oo,marginLeftXS:ro,marginLeftS:to,marginLeftM:eo,marginLeftL:no,marginLeftXL:ao,error:po,success:fo,label:bo,labelId:Do,labelPosition:m,icon:[wo,zo],text:ho,primary:a,secondary:Xo,contrast:Lo,onColored:Co,disabled:Io,inline:yo,active:Ao,palette:{color:Io?io.colorDisabled:io.color,backgroundColor:Io?io.backgroundColorDisabled:io.backgroundColor,backgroundColorHover:Io?io.backgroundColorDisabled:io.backgroundColorHover,borderColor:Io?io.borderColorDisabled:io.borderColor},iconProps:{color:Io?'content-disabled':'content-onmain-tertiary',sizes:SIZES_ICON,...To,...u},onClick:()=>{jo.current&&jo.current.focus()},onFocus:o=>{o.target!==o.currentTarget&&Ho(!0)},onPointerDown:o=>{o.target!==jo.current&&o.target instanceof Node&&!Eo.current?.contains(o.target)&&!Oo.current?.contains(o.target)&&!No.current?.contains(o.target)&&o.preventDefault()},onBlur:o=>{Fo||!jo.current||o.currentTarget.contains(o.relatedTarget)||Ho(Boolean(jo.current.value))},input:jsx(FormInput,{...Ro,"aria-labelledby":bo?Do:void 0,ref:jo,type:c,disabled:Io,palette:{color:io.inputColor,placeholderColor:io.inputPlaceholderColor,colorDisabled:io.inputColorDisabled,placeholderColorDisabled:io.inputPlaceholderColorDisabled},onChange:o=>{if(Ro.onChange&&Ro.onChange(o),c==='number'){const r=parseFloat(o.currentTarget.value);const t=r<=parseFloat(o.currentTarget.min);const e=r>=parseFloat(o.currentTarget.max);_o(t),Vo(e),(t||e)&&o.currentTarget.focus()}}}),addon:(d.onClick||Mo.onClick)&&Po?jsx(IconButton,{ref:Eo,sizes:SIZES_CONTROL,palette:xo,...To,...Mo,...d,icon:Po,disabled:Io||d.disabled||Mo.disabled,marginLeft:12,onClick:o=>{o.stopPropagation(),Ro.readOnly||(d.onClick&&d.onClick(o),Mo.onClick&&Mo.onClick(o))}}):void 0,controls:c==='number'?jsxs(Fragment,{children:[jsx(IconButton,{...To,ref:Oo,icon:"minus",sizes:SIZES_CONTROL,palette:xo,disabled:Io||Zo,marginLeft:12,onClick:o=>{if(o.stopPropagation(),!Ro.readOnly)try{if(jo.current){Ho(!0);const o=jo.current.value;if(jo.current.stepDown(),o!==jo.current.value){const o=new Event('input',{bubbles:!0});jo.current.dispatchEvent(o)}}}catch(o){console.error(o)}}}),jsx(IconButtonSeparated,{...To,ref:No,icon:"plus",sizes:SIZES_CONTROL,palette:xo,disabled:Io||Uo,onClick:o=>{if(o.stopPropagation(),!Ro.readOnly)try{if(jo.current){Ho(!0);const o=jo.current.value;if(jo.current.stepUp(),o!==jo.current.value){const o=new Event('input',{bubbles:!0});jo.current.dispatchEvent(o)}}}catch(o){console.error(o)}}})]}):void 0})})),{sizes:SIZES,displayName:"Input"}),{Phone:InputPhone});export{COMPONENT_NAME,Input};
2
2
  //# sourceMappingURL=Input.mjs.map