@foxford/ui 2.59.0 → 2.61.0-beta-5e98b7f-20250131

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 +17 -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":"Input.mjs","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":["COMPONENT_NAME","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","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":"qsBAYMA,MAAAA,eAAiB,QAYvB,MAAMC,MAAoFC,OAAOC,OAC/FC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAQC,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,EAASC,MACTA,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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IAAIC,MAAM,QAAS,CAAEC,SAAS,IAC5C1E,GAAIG,QAAQwE,cAAcH,EAC5B,CACF,CACD,CAAC,MAAOI,GAEPC,QAAQ1H,MAAMyH,EAChB,aAIJpG,GAEN,IAGN,CACEhE,MAAOuK,MACPC,YAtbiB,UAybrB,CACEC,MAAOC"}
1
+ {"version":3,"file":"Input.mjs","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":["COMPONENT_NAME","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","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":"ooBAYMA,MAAAA,eAAiB,QAYvB,MAAMC,MAAoFC,OAAOC,OAC/FC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAQC,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,EAA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AChB,KAGJ5C,IAACC,oBAA0B,IACrBjE,GACJgC,IAAKM,GACLhD,KAAK,OACL9C,MAAOwJ,cACPpH,QAASoC,GACTpB,SAAUA,IAAY6D,GACtBlD,QAAUoE,IAER,GADAA,EAAIsB,mBACAlG,GAAWmG,SAEf,IACE,GAAIlE,GAAIG,QAAS,CACfQ,IAAe,GAEf,MAAM2D,EAAOtE,GAAIG,QAAQW,MAIzB,GAHAd,GAAIG,QAAQ2E,SAGRR,IADgBtE,GAAIG,QAAQW,MACN,CACxB,MAAM0D,EAAQ,IAAIC,MAAM,QAAS,CAAEC,SAAS,IAC5C1E,GAAIG,QAAQwE,cAAcH,EAC5B,CACF,CACD,CAAC,MAAOI,GAEPC,QAAQ1H,MAAMyH,EAChB,aAIJpG,GAEN,IAGN,CACEhE,MAAOuK,MACPC,YAtbiB,UAybrB,CACEC,MAAOC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var InputMask=require('react-input-mask');var tinycolor=require('../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js');var color=require('../../mixins/color.js');var responsiveProperty=require('../../mixins/responsive-property.js');var helpers=require('./helpers.js');var IconButton=require('../IconButton/IconButton.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);var InputMask__default=_interopDefault(InputMask);const errorStyle=styled.css(["border:1px solid ",";background-color:",";"],(e=>e.theme.colors.pomegranate),(e=>tinycolor.default(e.theme.colors.pomegranate).setAlpha(.1).toString()));const disabledStyle=styled.css(["background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;&:disabled{background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;}"]);const focusStyle=styled.css(["&:focus{border:1px solid ",";outline:none;}"],(e=>e.theme.colors.accent));const roundedStyle=styled.css(["border-radius:",";"],(e=>e.theme.borderRadius));const baseInputStyle=e=>styled.css(["box-sizing:border-box;display:block;background-color:",";border:solid 1px ",";width:auto;appearance:none;font-size:16px;",";&::placeholder{","}"," "," "," "," "," "," ",""],e.theme.colors.white,e.theme.colors.alto,e.color?color.color(e.color):null,e.placeholderColor?color.color(e.placeholderColor):null,focusStyle,e.disabled?disabledStyle:null,e.rounded?roundedStyle:null,e.width?responsiveProperty.property(helpers.chooseWidthValue(e.width),e.fluid&&e.width!=='auto'?'max-width':'width'):null,responsiveProperty.responsiveNamedProperty({sizes:{widthXS:e.widthXS,widthS:e.widthS,widthM:e.widthM,widthL:e.widthL,widthXL:e.widthXL},cssProperty:e.fluid&&e.width!=='auto'?'max-width':'width',customSizeHandler:helpers.chooseWidthValue}),e.fluid?styled.css(["width:100%;"]):null,e.error?errorStyle:null);const Root=styled__default.default(InputMask__default.default).withConfig({shouldForwardProp:e=>!['color','placeholderColor','rounded','fluid','error'].includes(e)&&!e.includes('width')}).withConfig({displayName:"Input__Root",componentId:"ui__sc-1gazj3c-0"})(["line-height:24px;padding:15px 20px 11px;",""],(e=>baseInputStyle(e)));const IconButtonSeparated=styled__default.default(IconButton.IconButton).withConfig({displayName:"Input__IconButtonSeparated",componentId:"ui__sc-1gazj3c-1"})(["",""],(e=>`\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${e.theme.colors['border-onmain-default-large']};\n }\n `));exports.IconButtonSeparated=IconButtonSeparated,exports.Root=Root,exports.baseInputStyle=baseInputStyle,exports.disabledStyle=disabledStyle,exports.errorStyle=errorStyle,exports.focusStyle=focusStyle,exports.roundedStyle=roundedStyle;
1
+ 'use strict';var styled=require('styled-components');var InputMask=require('react-input-mask');var tinycolor=require('tinycolor2');var color=require('../../mixins/color.js');var responsiveProperty=require('../../mixins/responsive-property.js');var helpers=require('./helpers.js');var IconButton=require('../IconButton/IconButton.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);var InputMask__default=_interopDefault(InputMask);var tinycolor__default=_interopDefault(tinycolor);const errorStyle=styled.css(["border:1px solid ",";background-color:",";"],(e=>e.theme.colors.pomegranate),(e=>tinycolor__default.default(e.theme.colors.pomegranate).setAlpha(.1).toString()));const disabledStyle=styled.css(["background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;&:disabled{background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;}"]);const focusStyle=styled.css(["&:focus{border:1px solid ",";outline:none;}"],(e=>e.theme.colors.accent));const roundedStyle=styled.css(["border-radius:",";"],(e=>e.theme.borderRadius));const baseInputStyle=e=>styled.css(["box-sizing:border-box;display:block;background-color:",";border:solid 1px ",";width:auto;appearance:none;font-size:16px;",";&::placeholder{","}"," "," "," "," "," "," ",""],e.theme.colors.white,e.theme.colors.alto,e.color?color.color(e.color):null,e.placeholderColor?color.color(e.placeholderColor):null,focusStyle,e.disabled?disabledStyle:null,e.rounded?roundedStyle:null,e.width?responsiveProperty.property(helpers.chooseWidthValue(e.width),e.fluid&&e.width!=='auto'?'max-width':'width'):null,responsiveProperty.responsiveNamedProperty({sizes:{widthXS:e.widthXS,widthS:e.widthS,widthM:e.widthM,widthL:e.widthL,widthXL:e.widthXL},cssProperty:e.fluid&&e.width!=='auto'?'max-width':'width',customSizeHandler:helpers.chooseWidthValue}),e.fluid?styled.css(["width:100%;"]):null,e.error?errorStyle:null);const Root=styled__default.default(InputMask__default.default).withConfig({shouldForwardProp:e=>!['color','placeholderColor','rounded','fluid','error'].includes(e)&&!e.includes('width')}).withConfig({displayName:"Input__Root",componentId:"ui__sc-1gazj3c-0"})(["line-height:24px;padding:15px 20px 11px;",""],(e=>baseInputStyle(e)));const IconButtonSeparated=styled__default.default(IconButton.IconButton).withConfig({displayName:"Input__IconButtonSeparated",componentId:"ui__sc-1gazj3c-1"})(["",""],(e=>`\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${e.theme.colors['border-onmain-default-large']};\n }\n `));exports.IconButtonSeparated=IconButtonSeparated,exports.Root=Root,exports.baseInputStyle=baseInputStyle,exports.disabledStyle=disabledStyle,exports.errorStyle=errorStyle,exports.focusStyle=focusStyle,exports.roundedStyle=roundedStyle;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Input/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport InputMask from 'react-input-mask'\nimport tinycolor from 'tinycolor2'\nimport type { StyledProps } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { property, responsiveNamedProperty } from 'mixins/responsive-property'\nimport { chooseWidthValue } from 'components/Input/helpers'\nimport { IconButton } from 'components/IconButton'\nimport type { StyledBaseInputProps } from './types'\n\nexport const errorStyle = css`\n border: 1px solid ${(props) => props.theme.colors.pomegranate};\n background-color: ${(props) => tinycolor(props.theme.colors.pomegranate).setAlpha(0.1).toString()};\n`\n\nexport const disabledStyle = css`\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n &:disabled {\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n }\n`\n\nexport const focusStyle = css`\n &:focus {\n border: 1px solid ${(props) => props.theme.colors.accent};\n outline: none;\n }\n`\n\nexport const roundedStyle = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const baseInputStyle = (\n props: StyledProps<\n Pick<\n StyledBaseInputProps,\n | 'color'\n | 'placeholderColor'\n | 'disabled'\n | 'rounded'\n | 'width'\n | 'widthXS'\n | 'widthS'\n | 'widthM'\n | 'widthL'\n | 'widthXL'\n | 'fluid'\n | 'error'\n >\n >\n) => css`\n box-sizing: border-box;\n display: block;\n background-color: ${props.theme.colors.white};\n border: solid 1px ${props.theme.colors.alto};\n width: auto;\n appearance: none;\n font-size: 16px;\n ${props.color ? color(props.color) : null};\n &::placeholder {\n ${props.placeholderColor ? color(props.placeholderColor) : null}\n }\n ${focusStyle}\n ${props.disabled ? disabledStyle : null}\n ${props.rounded ? roundedStyle : null}\n\n ${props.width\n ? property(chooseWidthValue(props.width), props.fluid && props.width !== 'auto' ? 'max-width' : 'width')\n : null}\n ${responsiveNamedProperty({\n sizes: {\n widthXS: props.widthXS,\n widthS: props.widthS,\n widthM: props.widthM,\n widthL: props.widthL,\n widthXL: props.widthXL,\n },\n cssProperty: props.fluid && props.width !== 'auto' ? 'max-width' : 'width',\n customSizeHandler: chooseWidthValue,\n })}\n ${props.fluid\n ? css`\n width: 100%;\n `\n : null}\n ${props.error ? errorStyle : null}\n`\n\nexport const Root: React.ComponentType<StyledBaseInputProps> = styled(InputMask).withConfig<StyledBaseInputProps>({\n shouldForwardProp: (prop) =>\n !['color', 'placeholderColor', 'rounded', 'fluid', 'error'].includes(prop) && !prop.includes('width'),\n})`\n line-height: 24px;\n padding: 15px 20px 11px;\n ${(props) => baseInputStyle(props)}\n`\n\nexport const IconButtonSeparated = styled(IconButton)`\n ${(props) => `\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${props.theme.colors['border-onmain-default-large']};\n }\n `}\n`\n"],"names":["errorStyle","css","props","theme","colors","pomegranate","tinycolor","default","setAlpha","toString","disabledStyle","focusStyle","accent","roundedStyle","borderRadius","baseInputStyle","white","alto","color","placeholderColor","disabled","rounded","width","property","chooseWidthValue","fluid","responsiveNamedProperty","sizes","widthXS","widthS","widthM","widthL","widthXL","cssProperty","customSizeHandler","error","Root","styled","InputMask","withConfig","shouldForwardProp","prop","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WC,WAAiC,CAChHC,kBAAoBC,IACjB,CAAC,QAAS,mBAAoB,UAAW,QAAS,SAASC,SAASD,KAAUA,EAAKC,SAAS,WAC/FH,WAAA,CAAAI,YAAA,cAAAC,YAAA,oBAH6DP,CAG7D,CAAA,2CAAA,KAGGnC,GAAUa,eAAeb,KAGvB,MAAM2C,oBAAsBR,gBAAM9B,QAACuC,uBAAWP,WAAA,CAAAI,YAAA,6BAAAC,YAAA,oBAAlBP,CAAkB,CAAA,GAAA,KAChDnC,GAAU,8PAYWA,EAAMC,MAAMC,OAAO"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Input/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport InputMask from 'react-input-mask'\nimport tinycolor from 'tinycolor2'\nimport type { StyledProps } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { property, responsiveNamedProperty } from 'mixins/responsive-property'\nimport { chooseWidthValue } from 'components/Input/helpers'\nimport { IconButton } from 'components/IconButton'\nimport type { StyledBaseInputProps } from './types'\n\nexport const errorStyle = css`\n border: 1px solid ${(props) => props.theme.colors.pomegranate};\n background-color: ${(props) => tinycolor(props.theme.colors.pomegranate).setAlpha(0.1).toString()};\n`\n\nexport const disabledStyle = css`\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n &:disabled {\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n }\n`\n\nexport const focusStyle = css`\n &:focus {\n border: 1px solid ${(props) => props.theme.colors.accent};\n outline: none;\n }\n`\n\nexport const roundedStyle = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const baseInputStyle = (\n props: StyledProps<\n Pick<\n StyledBaseInputProps,\n | 'color'\n | 'placeholderColor'\n | 'disabled'\n | 'rounded'\n | 'width'\n | 'widthXS'\n | 'widthS'\n | 'widthM'\n | 'widthL'\n | 'widthXL'\n | 'fluid'\n | 'error'\n >\n >\n) => css`\n box-sizing: border-box;\n display: block;\n background-color: ${props.theme.colors.white};\n border: solid 1px ${props.theme.colors.alto};\n width: auto;\n appearance: none;\n font-size: 16px;\n ${props.color ? color(props.color) : null};\n &::placeholder {\n ${props.placeholderColor ? color(props.placeholderColor) : null}\n }\n ${focusStyle}\n ${props.disabled ? disabledStyle : null}\n ${props.rounded ? roundedStyle : null}\n\n ${props.width\n ? property(chooseWidthValue(props.width), props.fluid && props.width !== 'auto' ? 'max-width' : 'width')\n : null}\n ${responsiveNamedProperty({\n sizes: {\n widthXS: props.widthXS,\n widthS: props.widthS,\n widthM: props.widthM,\n widthL: props.widthL,\n widthXL: props.widthXL,\n },\n cssProperty: props.fluid && props.width !== 'auto' ? 'max-width' : 'width',\n customSizeHandler: chooseWidthValue,\n })}\n ${props.fluid\n ? css`\n width: 100%;\n `\n : null}\n ${props.error ? errorStyle : null}\n`\n\nexport const Root: React.ComponentType<StyledBaseInputProps> = styled(InputMask).withConfig<StyledBaseInputProps>({\n shouldForwardProp: (prop) =>\n !['color', 'placeholderColor', 'rounded', 'fluid', 'error'].includes(prop) && !prop.includes('width'),\n})`\n line-height: 24px;\n padding: 15px 20px 11px;\n ${(props) => baseInputStyle(props)}\n`\n\nexport const IconButtonSeparated = styled(IconButton)`\n ${(props) => `\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${props.theme.colors['border-onmain-default-large']};\n }\n `}\n`\n"],"names":["errorStyle","css","props","theme","colors","pomegranate","tinycolor","default","setAlpha","toString","disabledStyle","focusStyle","accent","roundedStyle","borderRadius","baseInputStyle","white","alto","color","placeholderColor","disabled","rounded","width","property","chooseWidthValue","fluid","responsiveNamedProperty","sizes","widthXS","widthS","widthM","widthL","widthXL","cssProperty","customSizeHandler","error","Root","styled","InputMask","withConfig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9B,QAAC+B,4BAAWC,WAAiC,CAChHC,kBAAoBC,IACjB,CAAC,QAAS,mBAAoB,UAAW,QAAS,SAASC,SAASD,KAAUA,EAAKC,SAAS,WAC/FH,WAAA,CAAAI,YAAA,cAAAC,YAAA,oBAH6DP,CAG7D,CAAA,2CAAA,KAGGnC,GAAUa,eAAeb,KAGvB,MAAM2C,oBAAsBR,gBAAM9B,QAACuC,uBAAWP,WAAA,CAAAI,YAAA,6BAAAC,YAAA,oBAAlBP,CAAkB,CAAA,GAAA,KAChDnC,GAAU,8PAYWA,EAAMC,MAAMC,OAAO"}
@@ -1,2 +1,2 @@
1
- import styled,{css}from'styled-components';import InputMask from'react-input-mask';import tinycolor from'../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs';import{color}from'../../mixins/color.mjs';import{property,responsiveNamedProperty}from'../../mixins/responsive-property.mjs';import{chooseWidthValue}from'./helpers.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const errorStyle=css(["border:1px solid ",";background-color:",";"],(o=>o.theme.colors.pomegranate),(o=>tinycolor(o.theme.colors.pomegranate).setAlpha(.1).toString()));const disabledStyle=css(["background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;&:disabled{background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;}"]);const focusStyle=css(["&:focus{border:1px solid ",";outline:none;}"],(o=>o.theme.colors.accent));const roundedStyle=css(["border-radius:",";"],(o=>o.theme.borderRadius));const baseInputStyle=o=>css(["box-sizing:border-box;display:block;background-color:",";border:solid 1px ",";width:auto;appearance:none;font-size:16px;",";&::placeholder{","}"," "," "," "," "," "," ",""],o.theme.colors.white,o.theme.colors.alto,o.color?color(o.color):null,o.placeholderColor?color(o.placeholderColor):null,focusStyle,o.disabled?disabledStyle:null,o.rounded?roundedStyle:null,o.width?property(chooseWidthValue(o.width),o.fluid&&o.width!=='auto'?'max-width':'width'):null,responsiveNamedProperty({sizes:{widthXS:o.widthXS,widthS:o.widthS,widthM:o.widthM,widthL:o.widthL,widthXL:o.widthXL},cssProperty:o.fluid&&o.width!=='auto'?'max-width':'width',customSizeHandler:chooseWidthValue}),o.fluid?css(["width:100%;"]):null,o.error?errorStyle:null);const Root=styled(InputMask).withConfig({shouldForwardProp:o=>!['color','placeholderColor','rounded','fluid','error'].includes(o)&&!o.includes('width')}).withConfig({displayName:"Input__Root",componentId:"ui__sc-1gazj3c-0"})(["line-height:24px;padding:15px 20px 11px;",""],(o=>baseInputStyle(o)));const IconButtonSeparated=styled(IconButton).withConfig({displayName:"Input__IconButtonSeparated",componentId:"ui__sc-1gazj3c-1"})(["",""],(o=>`\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${o.theme.colors['border-onmain-default-large']};\n }\n `));export{IconButtonSeparated,Root,baseInputStyle,disabledStyle,errorStyle,focusStyle,roundedStyle};
1
+ import styled,{css}from'styled-components';import InputMask from'react-input-mask';import tinycolor from'tinycolor2';import{color}from'../../mixins/color.mjs';import{property,responsiveNamedProperty}from'../../mixins/responsive-property.mjs';import{chooseWidthValue}from'./helpers.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const errorStyle=css(["border:1px solid ",";background-color:",";"],(o=>o.theme.colors.pomegranate),(o=>tinycolor(o.theme.colors.pomegranate).setAlpha(.1).toString()));const disabledStyle=css(["background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;&:disabled{background-color:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.16);cursor:not-allowed;}"]);const focusStyle=css(["&:focus{border:1px solid ",";outline:none;}"],(o=>o.theme.colors.accent));const roundedStyle=css(["border-radius:",";"],(o=>o.theme.borderRadius));const baseInputStyle=o=>css(["box-sizing:border-box;display:block;background-color:",";border:solid 1px ",";width:auto;appearance:none;font-size:16px;",";&::placeholder{","}"," "," "," "," "," "," ",""],o.theme.colors.white,o.theme.colors.alto,o.color?color(o.color):null,o.placeholderColor?color(o.placeholderColor):null,focusStyle,o.disabled?disabledStyle:null,o.rounded?roundedStyle:null,o.width?property(chooseWidthValue(o.width),o.fluid&&o.width!=='auto'?'max-width':'width'):null,responsiveNamedProperty({sizes:{widthXS:o.widthXS,widthS:o.widthS,widthM:o.widthM,widthL:o.widthL,widthXL:o.widthXL},cssProperty:o.fluid&&o.width!=='auto'?'max-width':'width',customSizeHandler:chooseWidthValue}),o.fluid?css(["width:100%;"]):null,o.error?errorStyle:null);const Root=styled(InputMask).withConfig({shouldForwardProp:o=>!['color','placeholderColor','rounded','fluid','error'].includes(o)&&!o.includes('width')}).withConfig({displayName:"Input__Root",componentId:"ui__sc-1gazj3c-0"})(["line-height:24px;padding:15px 20px 11px;",""],(o=>baseInputStyle(o)));const IconButtonSeparated=styled(IconButton).withConfig({displayName:"Input__IconButtonSeparated",componentId:"ui__sc-1gazj3c-1"})(["",""],(o=>`\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${o.theme.colors['border-onmain-default-large']};\n }\n `));export{IconButtonSeparated,Root,baseInputStyle,disabledStyle,errorStyle,focusStyle,roundedStyle};
2
2
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/Input/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport InputMask from 'react-input-mask'\nimport tinycolor from 'tinycolor2'\nimport type { StyledProps } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { property, responsiveNamedProperty } from 'mixins/responsive-property'\nimport { chooseWidthValue } from 'components/Input/helpers'\nimport { IconButton } from 'components/IconButton'\nimport type { StyledBaseInputProps } from './types'\n\nexport const errorStyle = css`\n border: 1px solid ${(props) => props.theme.colors.pomegranate};\n background-color: ${(props) => tinycolor(props.theme.colors.pomegranate).setAlpha(0.1).toString()};\n`\n\nexport const disabledStyle = css`\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n &:disabled {\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n }\n`\n\nexport const focusStyle = css`\n &:focus {\n border: 1px solid ${(props) => props.theme.colors.accent};\n outline: none;\n }\n`\n\nexport const roundedStyle = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const baseInputStyle = (\n props: StyledProps<\n Pick<\n StyledBaseInputProps,\n | 'color'\n | 'placeholderColor'\n | 'disabled'\n | 'rounded'\n | 'width'\n | 'widthXS'\n | 'widthS'\n | 'widthM'\n | 'widthL'\n | 'widthXL'\n | 'fluid'\n | 'error'\n >\n >\n) => css`\n box-sizing: border-box;\n display: block;\n background-color: ${props.theme.colors.white};\n border: solid 1px ${props.theme.colors.alto};\n width: auto;\n appearance: none;\n font-size: 16px;\n ${props.color ? color(props.color) : null};\n &::placeholder {\n ${props.placeholderColor ? color(props.placeholderColor) : null}\n }\n ${focusStyle}\n ${props.disabled ? disabledStyle : null}\n ${props.rounded ? roundedStyle : null}\n\n ${props.width\n ? property(chooseWidthValue(props.width), props.fluid && props.width !== 'auto' ? 'max-width' : 'width')\n : null}\n ${responsiveNamedProperty({\n sizes: {\n widthXS: props.widthXS,\n widthS: props.widthS,\n widthM: props.widthM,\n widthL: props.widthL,\n widthXL: props.widthXL,\n },\n cssProperty: props.fluid && props.width !== 'auto' ? 'max-width' : 'width',\n customSizeHandler: chooseWidthValue,\n })}\n ${props.fluid\n ? css`\n width: 100%;\n `\n : null}\n ${props.error ? errorStyle : null}\n`\n\nexport const Root: React.ComponentType<StyledBaseInputProps> = styled(InputMask).withConfig<StyledBaseInputProps>({\n shouldForwardProp: (prop) =>\n !['color', 'placeholderColor', 'rounded', 'fluid', 'error'].includes(prop) && !prop.includes('width'),\n})`\n line-height: 24px;\n padding: 15px 20px 11px;\n ${(props) => baseInputStyle(props)}\n`\n\nexport const IconButtonSeparated = styled(IconButton)`\n ${(props) => `\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${props.theme.colors['border-onmain-default-large']};\n }\n `}\n`\n"],"names":["errorStyle","css","props","theme","colors","pomegranate","tinycolor","setAlpha","toString","disabledStyle","focusStyle","accent","roundedStyle","borderRadius","baseInputStyle","white","alto","color","placeholderColor","disabled","rounded","width","property","chooseWidthValue","fluid","responsiveNamedProperty","sizes","widthXS","widthS","widthM","widthL","widthXL","cssProperty","customSizeHandler","error","Root","styled","InputMask","withConfig","shouldForwardProp","prop","includes","displayName","componentId","IconButtonSeparated","IconButton"],"mappings":"0ZAUaA,WAAaC,IAAG,CAAA,oBAAA,qBAAA,MACNC,GAAUA,EAAMC,MAAMC,OAAOC,cAC7BH,GAAUI,UAAUJ,EAAMC,MAAMC,OAAOC,aAAaE,SAAS,IAAKC,aAG5EC,MAAAA,cAAgBR,IAW5B,CAAA,qOAEYS,MAAAA,WAAaT,qDAEDC,GAAUA,EAAMC,MAAMC,OAAOO,SAKzCC,MAAAA,aAAeX,IACRC,CAAAA,iBAAAA,MAAAA,GAAUA,EAAMC,MAAMU,eAGnC,MAAMC,eACXZ,GAiBGD,IAAG,CAAA,wDAAA,qBAAA,8CAAA,mBAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAGcC,EAAMC,MAAMC,OAAOW,MACnBb,EAAMC,MAAMC,OAAOY,KAIrCd,EAAMe,MAAQA,MAAMf,EAAMe,OAAS,KAEjCf,EAAMgB,iBAAmBD,MAAMf,EAAMgB,kBAAoB,KAE3DR,WACAR,EAAMiB,SAAWV,cAAgB,KACjCP,EAAMkB,QAAUR,aAAe,KAE/BV,EAAMmB,MACJC,SAASC,iBAAiBrB,EAAMmB,OAAQnB,EAAMsB,OAAStB,EAAMmB,QAAU,OAAS,YAAc,SAC9F,KACFI,wBAAwB,CACxBC,MAAO,CACLC,QAASzB,EAAMyB,QACfC,OAAQ1B,EAAM0B,OACdC,OAAQ3B,EAAM2B,OACdC,OAAQ5B,EAAM4B,OACdC,QAAS7B,EAAM6B,SAEjBC,YAAa9B,EAAMsB,OAAStB,EAAMmB,QAAU,OAAS,YAAc,QACnEY,kBAAmBV,mBAEnBrB,EAAMsB,MACJvB,IAAG,CAAA,gBAGH,KACFC,EAAMgC,MAAQlC,WAAa,MAGxB,MAAMmC,KAAkDC,OAAOC,WAAWC,WAAiC,CAChHC,kBAAoBC,IACjB,CAAC,QAAS,mBAAoB,UAAW,QAAS,SAASC,SAASD,KAAUA,EAAKC,SAAS,WAC/FH,WAAA,CAAAI,YAAA,cAAAC,YAAA,oBAH6DP,CAG7D,CAAA,2CAAA,KAGGlC,GAAUY,eAAeZ,KAGvB,MAAM0C,oBAAsBR,OAAOS,YAAWP,WAAA,CAAAI,YAAA,6BAAAC,YAAA,oBAAlBP,CAAkB,CAAA,GAAA,KAChDlC,GAAU,8PAYWA,EAAMC,MAAMC,OAAO"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/Input/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport InputMask from 'react-input-mask'\nimport tinycolor from 'tinycolor2'\nimport type { StyledProps } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { property, responsiveNamedProperty } from 'mixins/responsive-property'\nimport { chooseWidthValue } from 'components/Input/helpers'\nimport { IconButton } from 'components/IconButton'\nimport type { StyledBaseInputProps } from './types'\n\nexport const errorStyle = css`\n border: 1px solid ${(props) => props.theme.colors.pomegranate};\n background-color: ${(props) => tinycolor(props.theme.colors.pomegranate).setAlpha(0.1).toString()};\n`\n\nexport const disabledStyle = css`\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n &:disabled {\n background-color: rgba(0, 0, 0, 0.04);\n border-color: rgba(0, 0, 0, 0.04);\n color: rgba(0, 0, 0, 0.16);\n cursor: not-allowed;\n }\n`\n\nexport const focusStyle = css`\n &:focus {\n border: 1px solid ${(props) => props.theme.colors.accent};\n outline: none;\n }\n`\n\nexport const roundedStyle = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const baseInputStyle = (\n props: StyledProps<\n Pick<\n StyledBaseInputProps,\n | 'color'\n | 'placeholderColor'\n | 'disabled'\n | 'rounded'\n | 'width'\n | 'widthXS'\n | 'widthS'\n | 'widthM'\n | 'widthL'\n | 'widthXL'\n | 'fluid'\n | 'error'\n >\n >\n) => css`\n box-sizing: border-box;\n display: block;\n background-color: ${props.theme.colors.white};\n border: solid 1px ${props.theme.colors.alto};\n width: auto;\n appearance: none;\n font-size: 16px;\n ${props.color ? color(props.color) : null};\n &::placeholder {\n ${props.placeholderColor ? color(props.placeholderColor) : null}\n }\n ${focusStyle}\n ${props.disabled ? disabledStyle : null}\n ${props.rounded ? roundedStyle : null}\n\n ${props.width\n ? property(chooseWidthValue(props.width), props.fluid && props.width !== 'auto' ? 'max-width' : 'width')\n : null}\n ${responsiveNamedProperty({\n sizes: {\n widthXS: props.widthXS,\n widthS: props.widthS,\n widthM: props.widthM,\n widthL: props.widthL,\n widthXL: props.widthXL,\n },\n cssProperty: props.fluid && props.width !== 'auto' ? 'max-width' : 'width',\n customSizeHandler: chooseWidthValue,\n })}\n ${props.fluid\n ? css`\n width: 100%;\n `\n : null}\n ${props.error ? errorStyle : null}\n`\n\nexport const Root: React.ComponentType<StyledBaseInputProps> = styled(InputMask).withConfig<StyledBaseInputProps>({\n shouldForwardProp: (prop) =>\n !['color', 'placeholderColor', 'rounded', 'fluid', 'error'].includes(prop) && !prop.includes('width'),\n})`\n line-height: 24px;\n padding: 15px 20px 11px;\n ${(props) => baseInputStyle(props)}\n`\n\nexport const IconButtonSeparated = styled(IconButton)`\n ${(props) => `\n position: relative;\n margin-left: 9px;\n\n &::before {\n content: '';\n position: absolute;\n width: 1px;\n height: 60%;\n top: 50%;\n left: -5px;\n transform: translateY(-50%);\n background-color: ${props.theme.colors['border-onmain-default-large']};\n }\n `}\n`\n"],"names":["errorStyle","css","props","theme","colors","pomegranate","tinycolor","setAlpha","toString","disabledStyle","focusStyle","accent","roundedStyle","borderRadius","baseInputStyle","white","alto","color","placeholderColor","disabled","rounded","width","property","chooseWidthValue","fluid","responsiveNamedProperty","sizes","widthXS","widthS","widthM","widthL","widthXL","cssProperty","customSizeHandler","error","Root","styled","InputMask","withConfig","shouldForwardProp","prop","includes","displayName","componentId","IconButtonSeparated","IconButton"],"mappings":"yVAUaA,WAAaC,IAAG,CAAA,oBAAA,qBAAA,MACNC,GAAUA,EAAMC,MAAMC,OAAOC,cAC7BH,GAAUI,UAAUJ,EAAMC,MAAMC,OAAOC,aAAaE,SAAS,IAAKC,aAG5EC,MAAAA,cAAgBR,IAW5B,CAAA,qOAEYS,MAAAA,WAAaT,qDAEDC,GAAUA,EAAMC,MAAMC,OAAOO,SAKzCC,MAAAA,aAAeX,IACRC,CAAAA,iBAAAA,MAAAA,GAAUA,EAAMC,MAAMU,eAGnC,MAAMC,eACXZ,GAiBGD,IAAG,CAAA,wDAAA,qBAAA,8CAAA,mBAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAGcC,EAAMC,MAAMC,OAAOW,MACnBb,EAAMC,MAAMC,OAAOY,KAIrCd,EAAMe,MAAQA,MAAMf,EAAMe,OAAS,KAEjCf,EAAMgB,iBAAmBD,MAAMf,EAAMgB,kBAAoB,KAE3DR,WACAR,EAAMiB,SAAWV,cAAgB,KACjCP,EAAMkB,QAAUR,aAAe,KAE/BV,EAAMmB,MACJC,SAASC,iBAAiBrB,EAAMmB,OAAQnB,EAAMsB,OAAStB,EAAMmB,QAAU,OAAS,YAAc,SAC9F,KACFI,wBAAwB,CACxBC,MAAO,CACLC,QAASzB,EAAMyB,QACfC,OAAQ1B,EAAM0B,OACdC,OAAQ3B,EAAM2B,OACdC,OAAQ5B,EAAM4B,OACdC,QAAS7B,EAAM6B,SAEjBC,YAAa9B,EAAMsB,OAAStB,EAAMmB,QAAU,OAAS,YAAc,QACnEY,kBAAmBV,mBAEnBrB,EAAMsB,MACJvB,IAAG,CAAA,gBAGH,KACFC,EAAMgC,MAAQlC,WAAa,MAGxB,MAAMmC,KAAkDC,OAAOC,WAAWC,WAAiC,CAChHC,kBAAoBC,IACjB,CAAC,QAAS,mBAAoB,UAAW,QAAS,SAASC,SAASD,KAAUA,EAAKC,SAAS,WAC/FH,WAAA,CAAAI,YAAA,cAAAC,YAAA,oBAH6DP,CAG7D,CAAA,2CAAA,KAGGlC,GAAUY,eAAeZ,KAGvB,MAAM0C,oBAAsBR,OAAOS,YAAWP,WAAA,CAAAI,YAAA,6BAAAC,YAAA,oBAAlBP,CAAkB,CAAA,GAAA,KAChDlC,GAAU,8PAYWA,EAAMC,MAAMC,OAAO"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var Input=require('../Input/Input.js');var constants=require('./constants.js');var require$$0=require('react/jsx-runtime');const onlyNumbers=(t="")=>t.replace(constants.REGEXPS.NOT_NUMBERS,'');exports.InputPhone=class InputPhone extends React.PureComponent{static displayName='Input.Phone';static defaultProps={countryData:constants.COUNTRY_DATA,defaultMask:constants.DEFAULT_MASK,initialMask:constants.INITIAL_MASK,placeholder:'+9 (999) 999-99-99',rounded:!0,type:'text',color:'mineShaft',mask:'',placeholderColor:'silver'};constructor(t){super(t),this.autocorrectOf8=!0,this.autocorrectOf9=!0;const{mask:e}=this.getUpdates(t.value||'');this.state={mask:e,regexp:null}}componentDidUpdate(t){const{value:e}=this.props;e!==t.value&&this.change(e)}getUpdates=(t,e)=>{const{countryData:s,defaultMask:a,initialMask:n}=this.props;const r=onlyNumbers(t);let o=n;let c=null;let l=!1;let u=!1;if(!r)return{mask:o,numbers:r,startsFrom8:l,startsFrom9:u,regexp:c};let i=!1;for(let t=0;t<s.length;t++)r.startsWith(s[t][1])&&([,,o,c]=s[t],i=t===0||t===1);return l=i&&constants.REGEXPS.FROM_8.test(r)&&this.autocorrectOf8,u=(!o||r.length===constants.RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH&&e==='')&&this.autocorrectOf9&&constants.REGEXPS.FROM_9.test(r),l&&(o=constants.COUNTRY_DATA[0][2],this.autocorrectOf8=!1),u&&(o=constants.COUNTRY_DATA[0][2],this.autocorrectOf9=!1),o||(o=a),{mask:o,numbers:r,startsFrom8:l,startsFrom9:u,regexp:c}};change=t=>{const{mask:e}=this.getUpdates(t);this.setState({mask:e})};handleChange=t=>{t.persist();const{onChange:e,stripValue:s}=this.props;if(e){const a=t;s&&(a.target.value=onlyNumbers(t.target.value)),e(a)}};beforeMaskedValueChange=(t,e)=>{const{mask:s,numbers:a,startsFrom8:n,startsFrom9:r,regexp:o}=this.getUpdates(t.value,e.value);return this.setState({mask:s,regexp:o}),r?{selection:a.length===1?{start:5,end:5}:t.selection,value:t.value.replace(constants.REGEXPS.FROM_9,'+79$1')}:n?{selection:{start:2,end:2},value:t.value.replace(constants.REGEXPS.FROM_8,'+7$1')}:constants.REGEXPS.FILLED.test(e.value)&&a.length===1?{selection:{start:2,end:2},value:t.value}:!constants.REGEXPS.FILLED.test(e.value)&&constants.REGEXPS.FILLED.test(t.value)?{...t,selection:t.selection?{start:t.selection.start+1,end:t.selection.end+1}:null}:t};render(){const{countryData:t,defaultMask:e,initialMask:s,stripValue:a,...n}=this.props;const{mask:r,regexp:o}=this.state;return require$$0.jsx(Input.Input,{...n,beforeMaskedValueChange:this.beforeMaskedValueChange,mask:r,"data-regexp":o instanceof RegExp?o.toString():void 0,onChange:this.handleChange})}};
1
+ 'use strict';var React=require('react');var Input=require('../Input/Input.js');var constants=require('./constants.js');var jsxRuntime=require('react/jsx-runtime');const onlyNumbers=(t="")=>t.replace(constants.REGEXPS.NOT_NUMBERS,'');exports.InputPhone=class InputPhone extends React.PureComponent{static displayName='Input.Phone';static defaultProps={countryData:constants.COUNTRY_DATA,defaultMask:constants.DEFAULT_MASK,initialMask:constants.INITIAL_MASK,placeholder:'+9 (999) 999-99-99',rounded:!0,type:'text',color:'mineShaft',mask:'',placeholderColor:'silver'};constructor(t){super(t),this.autocorrectOf8=!0,this.autocorrectOf9=!0;const{mask:e}=this.getUpdates(t.value||'');this.state={mask:e,regexp:null}}componentDidUpdate(t){const{value:e}=this.props;e!==t.value&&this.change(e)}getUpdates=(t,e)=>{const{countryData:s,defaultMask:a,initialMask:n}=this.props;const r=onlyNumbers(t);let o=n;let c=null;let l=!1;let u=!1;if(!r)return{mask:o,numbers:r,startsFrom8:l,startsFrom9:u,regexp:c};let i=!1;for(let t=0;t<s.length;t++)r.startsWith(s[t][1])&&([,,o,c]=s[t],i=t===0||t===1);return l=i&&constants.REGEXPS.FROM_8.test(r)&&this.autocorrectOf8,u=(!o||r.length===constants.RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH&&e==='')&&this.autocorrectOf9&&constants.REGEXPS.FROM_9.test(r),l&&(o=constants.COUNTRY_DATA[0][2],this.autocorrectOf8=!1),u&&(o=constants.COUNTRY_DATA[0][2],this.autocorrectOf9=!1),o||(o=a),{mask:o,numbers:r,startsFrom8:l,startsFrom9:u,regexp:c}};change=t=>{const{mask:e}=this.getUpdates(t);this.setState({mask:e})};handleChange=t=>{t.persist();const{onChange:e,stripValue:s}=this.props;if(e){const a=t;s&&(a.target.value=onlyNumbers(t.target.value)),e(a)}};beforeMaskedValueChange=(t,e)=>{const{mask:s,numbers:a,startsFrom8:n,startsFrom9:r,regexp:o}=this.getUpdates(t.value,e.value);return this.setState({mask:s,regexp:o}),r?{selection:a.length===1?{start:5,end:5}:t.selection,value:t.value.replace(constants.REGEXPS.FROM_9,'+79$1')}:n?{selection:{start:2,end:2},value:t.value.replace(constants.REGEXPS.FROM_8,'+7$1')}:constants.REGEXPS.FILLED.test(e.value)&&a.length===1?{selection:{start:2,end:2},value:t.value}:!constants.REGEXPS.FILLED.test(e.value)&&constants.REGEXPS.FILLED.test(t.value)?{...t,selection:t.selection?{start:t.selection.start+1,end:t.selection.end+1}:null}:t};render(){const{countryData:t,defaultMask:e,initialMask:s,stripValue:a,...n}=this.props;const{mask:r,regexp:o}=this.state;return jsxRuntime.jsx(Input.Input,{...n,beforeMaskedValueChange:this.beforeMaskedValueChange,mask:r,"data-regexp":o instanceof RegExp?o.toString():void 0,onChange:this.handleChange})}};
2
2
  //# sourceMappingURL=Input.Phone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.Phone.js","sources":["../../../../src/components/Input.Phone/Input.Phone.tsx"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport { PureComponent } from 'react'\nimport type { InputState } from 'react-input-mask'\nimport { Input } from '../Input/Input'\nimport type { InputProps } from '../Input'\nimport {\n COUNTRY_DATA,\n DEFAULT_MASK,\n INITIAL_MASK,\n REGEXPS,\n RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH,\n} from './constants'\n\nconst onlyNumbers = (value = ''): string => value.replace(REGEXPS.NOT_NUMBERS, '')\n\nexport interface InputPhoneProps extends InputProps {\n /**\n * Settings for different country codes\n */\n countryData?: string[][]\n /**\n * Default field mask that is set when none of the countryData prop matches\n */\n defaultMask?: string\n /**\n * The default field mask when the phone field is empty is required to enable autocomplete in\n * the browser\n */\n initialMask?: string\n /** If event should return stripped phone value (not for redux forms) */\n stripValue?: boolean\n}\n\ninterface InputPhoneState {\n mask: string\n regexp?: RegExp | null\n}\n\n/**\n * Расширен:\n * - `InputProps`\n */\nexport class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {\n static displayName = 'Input.Phone'\n static defaultProps = {\n countryData: COUNTRY_DATA,\n defaultMask: DEFAULT_MASK,\n initialMask: INITIAL_MASK,\n placeholder: '+9 (999) 999-99-99',\n rounded: true,\n type: 'text',\n color: 'mineShaft',\n mask: '',\n placeholderColor: 'silver',\n }\n\n autocorrectOf8: boolean\n autocorrectOf9: boolean\n\n constructor(props: typeof InputPhone.defaultProps & InputPhoneProps) {\n super(props)\n\n this.autocorrectOf8 = true\n this.autocorrectOf9 = true\n\n const { mask } = this.getUpdates(props.value || '')\n\n this.state = { mask, regexp: null }\n }\n\n componentDidUpdate(nextProps: InputPhoneProps) {\n const { value } = this.props\n\n if (value !== nextProps.value) {\n this.change(value)\n }\n }\n\n getUpdates = (\n value: InputPhoneProps['value'],\n prevValue: InputPhoneProps['value'] = undefined\n ): {\n mask: string\n numbers: string\n startsFrom8: boolean\n startsFrom9: boolean\n regexp: RegExp | null\n } => {\n const { countryData, defaultMask, initialMask } = this.props\n const numbers = onlyNumbers(value as string)\n\n let mask = initialMask\n let regexp = null\n let startsFrom8 = false\n let startsFrom9 = false\n\n if (!numbers)\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n\n let isRussian = false\n\n for (let i = 0; i < countryData.length; i++) {\n if (numbers.startsWith(countryData[i][1])) {\n ;[, , mask, regexp] = countryData[i]\n isRussian = i === 0 || i === 1\n }\n }\n\n startsFrom8 = isRussian && REGEXPS.FROM_8.test(numbers) && this.autocorrectOf8\n startsFrom9 =\n (!mask || (numbers.length === RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH && prevValue === '')) &&\n this.autocorrectOf9 &&\n REGEXPS.FROM_9.test(numbers)\n\n if (startsFrom8) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf8 = false\n }\n\n if (startsFrom9) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf9 = false\n }\n\n if (!mask) {\n mask = defaultMask\n }\n\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n }\n\n change = (phone: InputPhoneProps['value']) => {\n const { mask } = this.getUpdates(phone)\n\n this.setState({ mask })\n }\n\n handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n e.persist()\n\n const { onChange, stripValue } = this.props\n\n if (onChange) {\n const _e = e\n if (stripValue) _e.target.value = onlyNumbers(e.target.value)\n onChange(_e)\n }\n }\n\n beforeMaskedValueChange = (newState: InputState, oldState: InputState) => {\n const { mask, numbers, startsFrom8, startsFrom9, regexp } = this.getUpdates(newState.value, oldState.value)\n\n this.setState({ mask, regexp })\n\n /**\n * For the correct caret position, when the user enters 9 in the phone field and it's replaced\n * by '+7 (9'\n */\n if (startsFrom9) {\n return {\n selection: numbers.length === 1 ? { start: 5, end: 5 } : newState.selection,\n value: newState.value.replace(REGEXPS.FROM_9, '+79$1'),\n }\n }\n\n if (startsFrom8) {\n return { selection: { start: 2, end: 2 }, value: newState.value.replace(REGEXPS.FROM_8, '+7$1') }\n }\n\n if (REGEXPS.FILLED.test(oldState.value) && numbers.length === 1) {\n return { selection: { start: 2, end: 2 }, value: newState.value }\n }\n\n if (!REGEXPS.FILLED.test(oldState.value) && REGEXPS.FILLED.test(newState.value)) {\n return {\n ...newState,\n selection: newState.selection ? { start: newState.selection.start + 1, end: newState.selection.end + 1 } : null,\n }\n }\n\n return newState\n }\n\n render() {\n const {\n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n countryData,\n defaultMask,\n initialMask,\n stripValue,\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n ...props\n } = this.props\n const { mask, regexp } = this.state\n\n return (\n <Input\n {...props}\n beforeMaskedValueChange={this.beforeMaskedValueChange}\n mask={mask}\n data-regexp={regexp instanceof RegExp ? regexp.toString() : undefined}\n onChange={this.handleChange}\n />\n )\n }\n}\n"],"names":["onlyNumbers","value","replace","REGEXPS","NOT_NUMBERS","InputPhone","PureComponent","static","countryData","COUNTRY_DATA","defaultMask","DEFAULT_MASK","initialMask","INITIAL_MASK","placeholder","rounded","type","color","mask","placeholderColor","constructor","props","super","this","autocorrectOf8","autocorrectOf9","getUpdates","state","regexp","componentDidUpdate","nextProps","change","prevValue","numbers","startsFrom8","startsFrom9","isRussian","i","length","startsWith","FROM_8","test","RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH","FROM_9","phone","setState","handleChange","e","persist","onChange","stripValue","_e","target","beforeMaskedValueChange","newState","oldState","selection","start","end","FILLED","render","_jsx","Input","RegExp","toString","undefined"],"mappings":"mKAaA,MAAMA,YAAcA,CAACC,EAAQ,KAAeA,EAAMC,QAAQC,UAAOA,QAACC,YAAa,uBA6BxE,MAAMC,mBAAmBC,MAAAA,cAC9BC,mBAAqB,cACrBA,oBAAsB,CACpBC,YAAaC,UAAYA,aACzBC,YAAaC,UAAYA,aACzBC,YAAaC,UAAYA,aACzBC,YAAa,qBACbC,SAAS,EACTC,KAAM,OACNC,MAAO,YACPC,KAAM,GACNC,iBAAkB,UAMpBC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,gBAAiB,EACtBD,KAAKE,gBAAiB,EAEtB,MAAMP,KAAEA,GAASK,KAAKG,WAAWL,EAAMpB,OAAS,IAEhDsB,KAAKI,MAAQ,CAAET,OAAMU,OAAQ,KAC/B,CAEAC,kBAAAA,CAAmBC,GACjB,MAAM7B,MAAEA,GAAUsB,KAAKF,MAEnBpB,IAAU6B,EAAU7B,OACtBsB,KAAKQ,OAAO9B,EAEhB,CAEAyB,WAAaA,CACXzB,EACA+B,KAQA,MAAMxB,YAAEA,EAAWE,YAAEA,EAAWE,YAAEA,GAAgBW,KAAKF,MACvD,MAAMY,EAAUjC,YAAYC,GAE5B,IAAIiB,EAAON,EACX,IAAIgB,EAAS,KACb,IAAIM,GAAc,EAClB,IAAIC,GAAc,EAElB,IAAKF,EACH,MAAO,CACLf,OACAe,UACAC,cACAC,cACAP,UAGJ,IAAIQ,GAAY,EAEhB,IAAK,IAAIC,EAAI,EAAGA,EAAI7B,EAAY8B,OAA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D,MAAMC,QAAQC,UAAOA,QAACqC,OAAQ,SAGtFrC,UAAOA,QAACwD,OAAOlB,KAAKc,EAAStD,QAAUgC,EAAQK,SAAW,EACrD,CAAEkB,UAAW,CAAEC,MAAO,EAAGC,IAAK,GAAKzD,MAAOqD,EAASrD,QAGvDE,UAAOA,QAACwD,OAAOlB,KAAKc,EAAStD,QAAUE,UAAAA,QAAQwD,OAAOlB,KAAKa,EAASrD,OAChE,IACFqD,EACHE,UAAWF,EAASE,UAAY,CAAEC,MAAOH,EAASE,UAAUC,MAAQ,EAAGC,IAAKJ,EAASE,UAAUE,IAAM,GAAM,MAIxGJ,CAAQ,EAGjBM,MAAAA,GACE,MAAMpD,YAEJA,EAAWE,YACXA,EAAWE,YACXA,EAAWsC,WACXA,KAEG7B,GACDE,KAAKF,MACT,MAAMH,KAAEA,EAAIU,OAAEA,GAAWL,KAAKI,MAE9B,OACEkC,WAAAA,IAACC,MAAAA,MAAK,IACAzC,EACJgC,wBAAyB9B,KAAK8B,wBAC9BnC,KAAMA,EACN,cAAaU,aAAkBmC,OAASnC,EAAOoC,gBAAaC,EAC5DhB,SAAU1B,KAAKuB,cAGrB"}
1
+ {"version":3,"file":"Input.Phone.js","sources":["../../../../src/components/Input.Phone/Input.Phone.tsx"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport { PureComponent } from 'react'\nimport type { InputMaskState } from 'shared/interfaces'\nimport { Input } from '../Input/Input'\nimport type { InputProps } from '../Input'\nimport {\n COUNTRY_DATA,\n DEFAULT_MASK,\n INITIAL_MASK,\n REGEXPS,\n RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH,\n} from './constants'\n\nconst onlyNumbers = (value = ''): string => value.replace(REGEXPS.NOT_NUMBERS, '')\n\nexport interface InputPhoneProps extends InputProps {\n /**\n * Settings for different country codes\n */\n countryData?: string[][]\n /**\n * Default field mask that is set when none of the countryData prop matches\n */\n defaultMask?: string\n /**\n * The default field mask when the phone field is empty is required to enable autocomplete in\n * the browser\n */\n initialMask?: string\n /** If event should return stripped phone value (not for redux forms) */\n stripValue?: boolean\n}\n\ninterface InputPhoneState {\n mask: string\n regexp?: RegExp | null\n}\n\n/**\n * Расширен:\n * - `InputProps`\n */\nexport class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {\n static displayName = 'Input.Phone'\n static defaultProps = {\n countryData: COUNTRY_DATA,\n defaultMask: DEFAULT_MASK,\n initialMask: INITIAL_MASK,\n placeholder: '+9 (999) 999-99-99',\n rounded: true,\n type: 'text',\n color: 'mineShaft',\n mask: '',\n placeholderColor: 'silver',\n }\n\n autocorrectOf8: boolean\n autocorrectOf9: boolean\n\n constructor(props: typeof InputPhone.defaultProps & InputPhoneProps) {\n super(props)\n\n this.autocorrectOf8 = true\n this.autocorrectOf9 = true\n\n const { mask } = this.getUpdates(props.value || '')\n\n this.state = { mask, regexp: null }\n }\n\n componentDidUpdate(nextProps: InputPhoneProps) {\n const { value } = this.props\n\n if (value !== nextProps.value) {\n this.change(value)\n }\n }\n\n getUpdates = (\n value: InputPhoneProps['value'],\n prevValue: InputPhoneProps['value'] = undefined\n ): {\n mask: string\n numbers: string\n startsFrom8: boolean\n startsFrom9: boolean\n regexp: RegExp | null\n } => {\n const { countryData, defaultMask, initialMask } = this.props\n const numbers = onlyNumbers(value as string)\n\n let mask = initialMask\n let regexp = null\n let startsFrom8 = false\n let startsFrom9 = false\n\n if (!numbers)\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n\n let isRussian = false\n\n for (let i = 0; i < countryData.length; i++) {\n if (numbers.startsWith(countryData[i][1])) {\n ;[, , mask, regexp] = countryData[i]\n isRussian = i === 0 || i === 1\n }\n }\n\n startsFrom8 = isRussian && REGEXPS.FROM_8.test(numbers) && this.autocorrectOf8\n startsFrom9 =\n (!mask || (numbers.length === RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH && prevValue === '')) &&\n this.autocorrectOf9 &&\n REGEXPS.FROM_9.test(numbers)\n\n if (startsFrom8) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf8 = false\n }\n\n if (startsFrom9) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf9 = false\n }\n\n if (!mask) {\n mask = defaultMask\n }\n\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n }\n\n change = (phone: InputPhoneProps['value']) => {\n const { mask } = this.getUpdates(phone)\n\n this.setState({ mask })\n }\n\n handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n e.persist()\n\n const { onChange, stripValue } = this.props\n\n if (onChange) {\n const _e = e\n if (stripValue) _e.target.value = onlyNumbers(e.target.value)\n onChange(_e)\n }\n }\n\n beforeMaskedValueChange = (newState: InputMaskState, oldState: InputMaskState) => {\n const { mask, numbers, startsFrom8, startsFrom9, regexp } = this.getUpdates(newState.value, oldState.value)\n\n this.setState({ mask, regexp })\n\n /**\n * For the correct caret position, when the user enters 9 in the phone field and it's replaced\n * by '+7 (9'\n */\n if (startsFrom9) {\n return {\n selection: numbers.length === 1 ? { start: 5, end: 5 } : newState.selection,\n value: newState.value.replace(REGEXPS.FROM_9, '+79$1'),\n }\n }\n\n if (startsFrom8) {\n return { selection: { start: 2, end: 2 }, value: newState.value.replace(REGEXPS.FROM_8, '+7$1') }\n }\n\n if (REGEXPS.FILLED.test(oldState.value) && numbers.length === 1) {\n return { selection: { start: 2, end: 2 }, value: newState.value }\n }\n\n if (!REGEXPS.FILLED.test(oldState.value) && REGEXPS.FILLED.test(newState.value)) {\n return {\n ...newState,\n selection: newState.selection ? { start: newState.selection.start + 1, end: newState.selection.end + 1 } : null,\n }\n }\n\n return newState\n }\n\n render() {\n const {\n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n countryData,\n defaultMask,\n initialMask,\n stripValue,\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n ...props\n } = this.props\n const { mask, regexp } = this.state\n\n return (\n <Input\n {...props}\n beforeMaskedValueChange={this.beforeMaskedValueChange}\n mask={mask}\n data-regexp={regexp instanceof RegExp ? regexp.toString() : undefined}\n onChange={this.handleChange}\n />\n )\n }\n}\n"],"names":["onlyNumbers","value","replace","REGEXPS","NOT_NUMBERS","InputPhone","PureComponent","static","countryData","COUNTRY_DATA","defaultMask","DEFAULT_MASK","initialMask","INITIAL_MASK","placeholder","rounded","type","color","mask","placeholderColor","constructor","props","super","this","autocorrectOf8","autocorrectOf9","getUpdates","state","regexp","componentDidUpdate","nextProps","change","prevValue","numbers","startsFrom8","startsFrom9","isRussian","i","length","startsWith","FROM_8","test","RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH","FROM_9","phone","setState","handleChange","e","persist","onChange","stripValue","_e","target","beforeMaskedValueChange","newState","oldState","selection","start","end","FILLED","render","_jsx","Input","RegExp","toString","undefined"],"mappings":"mKAaA,MAAMA,YAAcA,CAACC,EAAQ,KAAeA,EAAMC,QAAQC,UAAOA,QAACC,YAAa,uBA6BxE,MAAMC,mBAAmBC,MAAAA,cAC9BC,mBAAqB,cACrBA,oBAAsB,CACpBC,YAAaC,UAAYA,aACzBC,YAAaC,UAAYA,aACzBC,YAAaC,UAAYA,aACzBC,YAAa,qBACbC,SAAS,EACTC,KAAM,OACNC,MAAO,YACPC,KAAM,GACNC,iBAAkB,UAMpBC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,gBAAiB,EACtBD,KAAKE,gBAAiB,EAEtB,MAAMP,KAAEA,GAASK,KAAKG,WAAWL,EAAMpB,OAAS,IAEhDsB,KAAKI,MAAQ,CAAET,OAAMU,OAAQ,KAC/B,CAEAC,kBAAAA,CAAmBC,GACjB,MAAM7B,MAAEA,GAAUsB,KAAKF,MAEnBpB,IAAU6B,EAAU7B,OACtBsB,KAAKQ,OAAO9B,EAEhB,CAEAyB,WAAaA,CACXzB,EACA+B,KAQA,MAAMxB,YAAEA,EAAWE,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D,OAQrG,OANAsB,KAAKsB,SAAS,CAAE3B,OAAMU,WAMlBO,EACK,CACLqB,UAAWvB,EAAQK,SAAW,EAAI,CAAEmB,MAAO,EAAGC,IAAK,GAAMJ,EAASE,UAClEvD,MAAOqD,EAASrD,MAAMC,QAAQC,UAAOA,QAACwC,OAAQ,UAI9CT,EACK,CAAEsB,UAAW,CAAEC,MAAO,EAAGC,IAAK,GAAKzD,MAAOqD,EAASrD,MAAMC,QAAQC,UAAOA,QAACqC,OAAQ,SAGtFrC,UAAOA,QAACwD,OAAOlB,KAAKc,EAAStD,QAAUgC,EAAQK,SAAW,EACrD,CAAEkB,UAAW,CAAEC,MAAO,EAAGC,IAAK,GAAKzD,MAAOqD,EAASrD,QAGvDE,UAAOA,QAACwD,OAAOlB,KAAKc,EAAStD,QAAUE,UAAAA,QAAQwD,OAAOlB,KAAKa,EAASrD,OAChE,IACFqD,EACHE,UAAWF,EAASE,UAAY,CAAEC,MAAOH,EAASE,UAAUC,MAAQ,EAAGC,IAAKJ,EAASE,UAAUE,IAAM,GAAM,MAIxGJ,CAAQ,EAGjBM,MAAAA,GACE,MAAMpD,YAEJA,EAAWE,YACXA,EAAWE,YACXA,EAAWsC,WACXA,KAEG7B,GACDE,KAAKF,MACT,MAAMH,KAAEA,EAAIU,OAAEA,GAAWL,KAAKI,MAE9B,OACEkC,WAAAA,IAACC,MAAAA,MAAK,IACAzC,EACJgC,wBAAyB9B,KAAK8B,wBAC9BnC,KAAMA,EACN,cAAaU,aAAkBmC,OAASnC,EAAOoC,gBAAaC,EAC5DhB,SAAU1B,KAAKuB,cAGrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.Phone.mjs","sources":["../../../../src/components/Input.Phone/Input.Phone.tsx"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport { PureComponent } from 'react'\nimport type { InputState } from 'react-input-mask'\nimport { Input } from '../Input/Input'\nimport type { InputProps } from '../Input'\nimport {\n COUNTRY_DATA,\n DEFAULT_MASK,\n INITIAL_MASK,\n REGEXPS,\n RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH,\n} from './constants'\n\nconst onlyNumbers = (value = ''): string => value.replace(REGEXPS.NOT_NUMBERS, '')\n\nexport interface InputPhoneProps extends InputProps {\n /**\n * Settings for different country codes\n */\n countryData?: string[][]\n /**\n * Default field mask that is set when none of the countryData prop matches\n */\n defaultMask?: string\n /**\n * The default field mask when the phone field is empty is required to enable autocomplete in\n * the browser\n */\n initialMask?: string\n /** If event should return stripped phone value (not for redux forms) */\n stripValue?: boolean\n}\n\ninterface InputPhoneState {\n mask: string\n regexp?: RegExp | null\n}\n\n/**\n * Расширен:\n * - `InputProps`\n */\nexport class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {\n static displayName = 'Input.Phone'\n static defaultProps = {\n countryData: COUNTRY_DATA,\n defaultMask: DEFAULT_MASK,\n initialMask: INITIAL_MASK,\n placeholder: '+9 (999) 999-99-99',\n rounded: true,\n type: 'text',\n color: 'mineShaft',\n mask: '',\n placeholderColor: 'silver',\n }\n\n autocorrectOf8: boolean\n autocorrectOf9: boolean\n\n constructor(props: typeof InputPhone.defaultProps & InputPhoneProps) {\n super(props)\n\n this.autocorrectOf8 = true\n this.autocorrectOf9 = true\n\n const { mask } = this.getUpdates(props.value || '')\n\n this.state = { mask, regexp: null }\n }\n\n componentDidUpdate(nextProps: InputPhoneProps) {\n const { value } = this.props\n\n if (value !== nextProps.value) {\n this.change(value)\n }\n }\n\n getUpdates = (\n value: InputPhoneProps['value'],\n prevValue: InputPhoneProps['value'] = undefined\n ): {\n mask: string\n numbers: string\n startsFrom8: boolean\n startsFrom9: boolean\n regexp: RegExp | null\n } => {\n const { countryData, defaultMask, initialMask } = this.props\n const numbers = onlyNumbers(value as string)\n\n let mask = initialMask\n let regexp = null\n let startsFrom8 = false\n let startsFrom9 = false\n\n if (!numbers)\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n\n let isRussian = false\n\n for (let i = 0; i < countryData.length; i++) {\n if (numbers.startsWith(countryData[i][1])) {\n ;[, , mask, regexp] = countryData[i]\n isRussian = i === 0 || i === 1\n }\n }\n\n startsFrom8 = isRussian && REGEXPS.FROM_8.test(numbers) && this.autocorrectOf8\n startsFrom9 =\n (!mask || (numbers.length === RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH && prevValue === '')) &&\n this.autocorrectOf9 &&\n REGEXPS.FROM_9.test(numbers)\n\n if (startsFrom8) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf8 = false\n }\n\n if (startsFrom9) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf9 = false\n }\n\n if (!mask) {\n mask = defaultMask\n }\n\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n }\n\n change = (phone: InputPhoneProps['value']) => {\n const { mask } = this.getUpdates(phone)\n\n this.setState({ mask })\n }\n\n handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n e.persist()\n\n const { onChange, stripValue } = this.props\n\n if (onChange) {\n const _e = e\n if (stripValue) _e.target.value = onlyNumbers(e.target.value)\n onChange(_e)\n }\n }\n\n beforeMaskedValueChange = (newState: InputState, oldState: InputState) => {\n const { mask, numbers, startsFrom8, startsFrom9, regexp } = this.getUpdates(newState.value, oldState.value)\n\n this.setState({ mask, regexp })\n\n /**\n * For the correct caret position, when the user enters 9 in the phone field and it's replaced\n * by '+7 (9'\n */\n if (startsFrom9) {\n return {\n selection: numbers.length === 1 ? { start: 5, end: 5 } : newState.selection,\n value: newState.value.replace(REGEXPS.FROM_9, '+79$1'),\n }\n }\n\n if (startsFrom8) {\n return { selection: { start: 2, end: 2 }, value: newState.value.replace(REGEXPS.FROM_8, '+7$1') }\n }\n\n if (REGEXPS.FILLED.test(oldState.value) && numbers.length === 1) {\n return { selection: { start: 2, end: 2 }, value: newState.value }\n }\n\n if (!REGEXPS.FILLED.test(oldState.value) && REGEXPS.FILLED.test(newState.value)) {\n return {\n ...newState,\n selection: newState.selection ? { start: newState.selection.start + 1, end: newState.selection.end + 1 } : null,\n }\n }\n\n return newState\n }\n\n render() {\n const {\n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n countryData,\n defaultMask,\n initialMask,\n stripValue,\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n ...props\n } = this.props\n const { mask, regexp } = this.state\n\n return (\n <Input\n {...props}\n beforeMaskedValueChange={this.beforeMaskedValueChange}\n mask={mask}\n data-regexp={regexp instanceof RegExp ? regexp.toString() : undefined}\n onChange={this.handleChange}\n />\n )\n }\n}\n"],"names":["onlyNumbers","value","replace","REGEXPS","NOT_NUMBERS","InputPhone","PureComponent","static","countryData","COUNTRY_DATA","defaultMask","DEFAULT_MASK","initialMask","INITIAL_MASK","placeholder","rounded","type","color","mask","placeholderColor","constructor","props","super","this","autocorrectOf8","autocorrectOf9","getUpdates","state","regexp","componentDidUpdate","nextProps","change","prevValue","numbers","startsFrom8","startsFrom9","isRussian","i","length","startsWith","FROM_8","test","RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH","FROM_9","phone","setState","handleChange","e","persist","onChange","stripValue","_e","target","beforeMaskedValueChange","newState","oldState","selection","start","end","FILLED","render","_jsx","Input","RegExp","toString","undefined"],"mappings":"+NAaA,MAAMA,YAAcA,CAACC,EAAQ,KAAeA,EAAMC,QAAQC,QAAQC,YAAa,IA6BxE,MAAMC,mBAAmBC,cAC9BC,mBAAqB,cACrBA,oBAAsB,CACpBC,YAAaC,aACbC,YAAaC,aACbC,YAAaC,aACbC,YAAa,qBACbC,SAAS,EACTC,KAAM,OACNC,MAAO,YACPC,KAAM,GACNC,iBAAkB,UAMpBC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,gBAAiB,EACtBD,KAAKE,gBAAiB,EAEtB,MAAMP,KAAEA,GAASK,KAAKG,WAAWL,EAAMpB,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* eslint-disable no-use-before-define */\nimport { PureComponent } from 'react'\nimport type { InputMaskState } from 'shared/interfaces'\nimport { Input } from '../Input/Input'\nimport type { InputProps } from '../Input'\nimport {\n COUNTRY_DATA,\n DEFAULT_MASK,\n INITIAL_MASK,\n REGEXPS,\n RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH,\n} from './constants'\n\nconst onlyNumbers = (value = ''): string => value.replace(REGEXPS.NOT_NUMBERS, '')\n\nexport interface InputPhoneProps extends InputProps {\n /**\n * Settings for different country codes\n */\n countryData?: string[][]\n /**\n * Default field mask that is set when none of the countryData prop matches\n */\n defaultMask?: string\n /**\n * The default field mask when the phone field is empty is required to enable autocomplete in\n * the browser\n */\n initialMask?: string\n /** If event should return stripped phone value (not for redux forms) */\n stripValue?: boolean\n}\n\ninterface InputPhoneState {\n mask: string\n regexp?: RegExp | null\n}\n\n/**\n * Расширен:\n * - `InputProps`\n */\nexport class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {\n static displayName = 'Input.Phone'\n static defaultProps = {\n countryData: COUNTRY_DATA,\n defaultMask: DEFAULT_MASK,\n initialMask: INITIAL_MASK,\n placeholder: '+9 (999) 999-99-99',\n rounded: true,\n type: 'text',\n color: 'mineShaft',\n mask: '',\n placeholderColor: 'silver',\n }\n\n autocorrectOf8: boolean\n autocorrectOf9: boolean\n\n constructor(props: typeof InputPhone.defaultProps & InputPhoneProps) {\n super(props)\n\n this.autocorrectOf8 = true\n this.autocorrectOf9 = true\n\n const { mask } = this.getUpdates(props.value || '')\n\n this.state = { mask, regexp: null }\n }\n\n componentDidUpdate(nextProps: InputPhoneProps) {\n const { value } = this.props\n\n if (value !== nextProps.value) {\n this.change(value)\n }\n }\n\n getUpdates = (\n value: InputPhoneProps['value'],\n prevValue: InputPhoneProps['value'] = undefined\n ): {\n mask: string\n numbers: string\n startsFrom8: boolean\n startsFrom9: boolean\n regexp: RegExp | null\n } => {\n const { countryData, defaultMask, initialMask } = this.props\n const numbers = onlyNumbers(value as string)\n\n let mask = initialMask\n let regexp = null\n let startsFrom8 = false\n let startsFrom9 = false\n\n if (!numbers)\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n\n let isRussian = false\n\n for (let i = 0; i < countryData.length; i++) {\n if (numbers.startsWith(countryData[i][1])) {\n ;[, , mask, regexp] = countryData[i]\n isRussian = i === 0 || i === 1\n }\n }\n\n startsFrom8 = isRussian && REGEXPS.FROM_8.test(numbers) && this.autocorrectOf8\n startsFrom9 =\n (!mask || (numbers.length === RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH && prevValue === '')) &&\n this.autocorrectOf9 &&\n REGEXPS.FROM_9.test(numbers)\n\n if (startsFrom8) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf8 = false\n }\n\n if (startsFrom9) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf9 = false\n }\n\n if (!mask) {\n mask = defaultMask\n }\n\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n }\n\n change = (phone: InputPhoneProps['value']) => {\n const { mask } = this.getUpdates(phone)\n\n this.setState({ mask })\n }\n\n handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n e.persist()\n\n const { onChange, stripValue } = this.props\n\n if (onChange) {\n const _e = e\n if (stripValue) _e.target.value = onlyNumbers(e.target.value)\n onChange(_e)\n }\n }\n\n beforeMaskedValueChange = (newState: InputMaskState, oldState: InputMaskState) => {\n const { mask, numbers, startsFrom8, startsFrom9, regexp } = this.getUpdates(newState.value, oldState.value)\n\n this.setState({ mask, regexp })\n\n /**\n * For the correct caret position, when the user enters 9 in the phone field and it's replaced\n * by '+7 (9'\n */\n if (startsFrom9) {\n return {\n selection: numbers.length === 1 ? { start: 5, end: 5 } : newState.selection,\n value: newState.value.replace(REGEXPS.FROM_9, '+79$1'),\n }\n }\n\n if (startsFrom8) {\n return { selection: { start: 2, end: 2 }, value: newState.value.replace(REGEXPS.FROM_8, '+7$1') }\n }\n\n if (REGEXPS.FILLED.test(oldState.value) && numbers.length === 1) {\n return { selection: { start: 2, end: 2 }, value: newState.value }\n }\n\n if (!REGEXPS.FILLED.test(oldState.value) && REGEXPS.FILLED.test(newState.value)) {\n return {\n ...newState,\n selection: newState.selection ? { start: newState.selection.start + 1, end: newState.selection.end + 1 } : null,\n }\n }\n\n return newState\n }\n\n render() {\n const {\n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n countryData,\n defaultMask,\n initialMask,\n stripValue,\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n ...props\n } = this.props\n const { mask, regexp } = this.state\n\n return (\n <Input\n {...props}\n beforeMaskedValueChange={this.beforeMaskedValueChange}\n mask={mask}\n data-regexp={regexp instanceof RegExp ? regexp.toString() : undefined}\n onChange={this.handleChange}\n />\n )\n }\n}\n"],"names":["onlyNumbers","value","replace","REGEXPS","NOT_NUMBERS","InputPhone","PureComponent","static","countryData","COUNTRY_DATA","defaultMask","DEFAULT_MASK","initialMask","INITIAL_MASK","placeholder","rounded","type","color","mask","placeholderColor","constructor","props","super","this","autocorrectOf8","autocorrectOf9","getUpdates","state","regexp","componentDidUpdate","nextProps","change","prevValue","numbers","startsFrom8","startsFrom9","isRussian","i","length","startsWith","FROM_8","test","RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH","FROM_9","phone","setState","handleChange","e","persist","onChange","stripValue","_e","target","beforeMaskedValueChange","newState","oldState","selection","start","end","FILLED","render","_jsx","Input","RegExp","toString","undefined"],"mappings":"+NAaA,MAAMA,YAAcA,CAACC,EAAQ,KAAeA,EAAMC,QAAQC,QAAQC,YAAa,IA6BxE,MAAMC,mBAAmBC,cAC9BC,mBAAqB,cACrBA,oBAAsB,CACpBC,YAAaC,aACbC,YAAaC,aACbC,YAAaC,aACbC,YAAa,qBACbC,SAAS,EACTC,KAAM,OACNC,MAAO,Y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AAaU,aAAkBmC,OAASnC,EAAOoC,gBAAaC,EAC5DhB,SAAU1B,KAAKuB,cAGrB"}
@@ -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');const InputCheckbox=withMergedProps.withMergedProps(React.forwardRef((({size:e="m",sizeXXS:s,sizeXS:r,sizeS:t,sizeM:i,sizeL:n,sizeXL:a,sizes:o,sizeUnits:c,preset:l,inline:u,error:p,success:d,contrast:z,onColored:h,palette:x,style:y,indeterminate:I,className:q,disabled:$,...b},C)=>require$$0.jsxs(style.Root,{size:e,sizeXXS:s,sizeXS:r,sizeS:t,sizeM:i,sizeL:n,sizeXL:a,sizes:o,sizeUnits:c,preset:l,inline:u,error:p,success:d,contrast:z,onColored:h,palette:x,style:y,indeterminate:I,className:q,disabled:$,children:[require$$0.jsx(style.Input,{...b,disabled:$,type:"checkbox",ref:C}),require$$0.jsx(style.InputMask,{children:require$$0.jsx(I===!0?style.InputIndeterminate:style.InputChecked,{})})]}))),{displayName:"InputCheckbox",sizes:constants.SIZES});exports.COMPONENT_NAME="InputCheckbox",exports.InputCheckbox=InputCheckbox;
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');const InputCheckbox=withMergedProps.withMergedProps(React.forwardRef((({size:e="m",sizeXXS:s,sizeXS:t,sizeS:i,sizeM:r,sizeL:n,sizeXL:a,sizes:o,sizeUnits:c,preset:l,inline:u,error:p,success:d,contrast:z,onColored:x,palette:h,style:j,indeterminate:m,className:y,disabled:I,...b},C)=>jsxRuntime.jsxs(style.Root,{size:e,sizeXXS:s,sizeXS:t,sizeS:i,sizeM:r,sizeL:n,sizeXL:a,sizes:o,sizeUnits:c,preset:l,inline:u,error:p,success:d,contrast:z,onColored:x,palette:h,style:j,indeterminate:m,className:y,disabled:I,children:[jsxRuntime.jsx(style.Input,{...b,disabled:I,type:"checkbox",ref:C}),jsxRuntime.jsx(style.InputMask,{children:jsxRuntime.jsx(m===!0?style.InputIndeterminate:style.InputChecked,{})})]}))),{displayName:"InputCheckbox",sizes:constants.SIZES});exports.COMPONENT_NAME="InputCheckbox",exports.InputCheckbox=InputCheckbox;
2
2
  //# sourceMappingURL=InputCheckbox.js.map
@@ -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');const InputRadio=withMergedProps.withMergedProps(React.forwardRef((({size:e="m",sizeXXS:s,sizeXS:r,sizeS:i,sizeM:t,sizeL:a,sizeXL:o,sizes:n,sizeUnits:d,preset:l,inline:u,error:c,success:p,contrast:z,onColored:q,palette:y,style:M,className:R,disabled:I,...S},X)=>require$$0.jsxs(style.Root,{size:e,sizeXXS:s,sizeXS:r,sizeS:i,sizeM:t,sizeL:a,sizeXL:o,sizes:n,sizeUnits:d,preset:l,inline:u,error:c,success:p,contrast:z,onColored:q,palette:y,style:M,className:R,disabled:I,children:[require$$0.jsx(style.Input,{...S,disabled:I,type:"radio",ref:X}),require$$0.jsx(style.InputMask,{})]}))),{displayName:"InputRadio",sizes:constants.SIZES});exports.COMPONENT_NAME="InputRadio",exports.InputRadio=InputRadio;
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');const InputRadio=withMergedProps.withMergedProps(React.forwardRef((({size:e="m",sizeXXS:s,sizeXS:t,sizeS:i,sizeM:r,sizeL:a,sizeXL:n,sizes:o,sizeUnits:d,preset:l,inline:u,error:c,success:p,contrast:z,onColored:R,palette:j,style:x,className:m,disabled:y,...M},I)=>jsxRuntime.jsxs(style.Root,{size:e,sizeXXS:s,sizeXS:t,sizeS:i,sizeM:r,sizeL:a,sizeXL:n,sizes:o,sizeUnits:d,preset:l,inline:u,error:c,success:p,contrast:z,onColored:R,palette:j,style:x,className:m,disabled:y,children:[jsxRuntime.jsx(style.Input,{...M,disabled:y,type:"radio",ref:I}),jsxRuntime.jsx(style.InputMask,{})]}))),{displayName:"InputRadio",sizes:constants.SIZES});exports.COMPONENT_NAME="InputRadio",exports.InputRadio=InputRadio;
2
2
  //# sourceMappingURL=InputRadio.js.map
@@ -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 Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');var Icon=require('../Icon/Icon.js');const ListItem=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="s",borderRadius:i=0,mediaBorderRadius:s="50%",controlPosition:o="left",captionPosition:n="bottom",ellipsis:a=!0,iconProps:c={},textProps:l={},captionProps:d={},sizeXXS:p,sizeXS:u,sizeS:$,sizeM:x,sizeL:h,sizeXL:q,text:j,children:y,control:m,icon:f,media:z,caption:b,addon:S,onColored:g,disabled:I,loading:R,...v}=e;let P;let T;m&&(P='label'),v.href&&(P='a'),v.as&&(P=v.as),P||(T='button'),v.type&&(T=v.type);const L={size:t,sizeXXS:p,sizeXS:u,sizeS:$,sizeM:x,sizeL:h,sizeXL:q};const M={onColored:g,disabled:I};const X=typeof m=='object'&&typeof m.props=='object'&&m.props!==null?m.props:{};const[k,w]=Array.isArray(f)?f:[f];const C={appearance:'body',size:'inherit',color:'inherit',ellipsis:a};const E={appearance:'body',size:.9,sizeUnits:'em',color:'inherit',ellipsis:a};return require$$0.jsx(style.Root,{...L,...M,...v,as:P,type:T,borderRadius:i,mediaBorderRadius:s,ref:r,children:typeof y=='function'?y({textProps:C,captionProps:E}):require$$0.jsx(require$$0.Fragment,{children:require$$0.jsxs(require$$0.Fragment,R?{children:[z&&require$$0.jsx(style.Media,{children:require$$0.jsx(Skeleton.Skeleton,{width:"100%",height:"100%",borderRadius:"inherit"})}),require$$0.jsx(style.Content,{children:require$$0.jsx(Skeleton.Skeleton,{width:"100%",borderRadius:4,children:require$$0.jsx(Text.Text,{...C,...l})})})]}:{children:[m&&o==='left'&&(typeof m=='function'?m({...L,...M}):React.cloneElement(m,{...L,...M,...X})),k&&require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof k=='string'?k:void 0,icon:typeof k!='string'?k:void 0,...c}),z&&require$$0.jsx(style.Media,{children:React.isValidElement(z)?z:require$$0.jsx(style.Img,{alt:"",...z})}),(y||j||b)&&require$$0.jsxs(style.Content,{children:[b&&n==='top'&&require$$0.jsx(Text.Text,{as:"span",...E,...d,children:b}),(y||j)&&require$$0.jsx(Text.Text,{as:"span",...C,...l,children:y??j}),b&&n==='bottom'&&require$$0.jsx(Text.Text,{as:"span",...E,...d,children:b})]}),S,w&&require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof w=='string'?w:void 0,icon:typeof w!='string'?w:void 0,...c}),m&&o==='right'&&(typeof m=='function'?m({...L,...M}):React.cloneElement(m,{...L,...M,...X}))]})})})})),{displayName:'ListItem',sizes:constants.SIZES});exports.ListItem=ListItem;
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 Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');var Icon=require('../Icon/Icon.js');const ListItem=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="s",borderRadius:i=0,mediaBorderRadius:n="50%",controlPosition:o="left",captionPosition:r="bottom",ellipsis:a=!0,iconProps:c={},textProps:l={},captionProps:d={},sizeXXS:x,sizeXS:p,sizeS:j,sizeM:u,sizeL:m,sizeXL:R,text:h,children:y,control:f,icon:z,media:b,caption:S,addon:g,onColored:I,disabled:v,loading:P,...T}=e;let q;let L;f&&(q='label'),T.href&&(q='a'),T.as&&(q=T.as),q||(L='button'),T.type&&(L=T.type);const M={size:s,sizeXXS:x,sizeXS:p,sizeS:j,sizeM:u,sizeL:m,sizeXL:R};const X={onColored:I,disabled:v};const k=typeof f=='object'&&typeof f.props=='object'&&f.props!==null?f.props:{};const[w,C]=Array.isArray(z)?z:[z];const E={appearance:'body',size:'inherit',color:'inherit',ellipsis:a};const A={appearance:'body',size:.9,sizeUnits:'em',color:'inherit',ellipsis:a};return jsxRuntime.jsx(style.Root,{...M,...X,...T,as:q,type:L,borderRadius:i,mediaBorderRadius:n,ref:t,children:typeof y=='function'?y({textProps:E,captionProps:A}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,P?{children:[b&&jsxRuntime.jsx(style.Media,{children:jsxRuntime.jsx(Skeleton.Skeleton,{width:"100%",height:"100%",borderRadius:"inherit"})}),jsxRuntime.jsx(style.Content,{children:jsxRuntime.jsx(Skeleton.Skeleton,{width:"100%",borderRadius:4,children:jsxRuntime.jsx(Text.Text,{...E,...l})})})]}:{children:[f&&o==='left'&&(typeof f=='function'?f({...M,...X}):React.cloneElement(f,{...M,...X,...k})),w&&jsxRuntime.jsx(Icon.Icon,{preset:"brand",name:typeof w=='string'?w:void 0,icon:typeof w!='string'?w:void 0,...c}),b&&jsxRuntime.jsx(style.Media,{children:React.isValidElement(b)?b:jsxRuntime.jsx(style.Img,{alt:"",...b})}),(y||h||S)&&jsxRuntime.jsxs(style.Content,{children:[S&&r==='top'&&jsxRuntime.jsx(Text.Text,{as:"span",...A,...d,children:S}),(y||h)&&jsxRuntime.jsx(Text.Text,{as:"span",...E,...l,children:y??h}),S&&r==='bottom'&&jsxRuntime.jsx(Text.Text,{as:"span",...A,...d,children:S})]}),g,C&&jsxRuntime.jsx(Icon.Icon,{preset:"brand",name:typeof C=='string'?C:void 0,icon:typeof C!='string'?C:void 0,...c}),f&&o==='right'&&(typeof f=='function'?f({...M,...X}):React.cloneElement(f,{...M,...X,...k}))]})})})})),{displayName:'ListItem',sizes:constants.SIZES});exports.ListItem=ListItem;
2
2
  //# sourceMappingURL=ListItem.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var require$$0=require('react/jsx-runtime');var MenuComponent=require('../MenuComponent/MenuComponent.js');var MenuList=require('../MenuList/MenuList.js');var MenuContainer=require('../MenuContainer/MenuContainer.js');var MenuDivider=require('../MenuDivider/MenuDivider.js');var constants=require('../MenuComponent/constants.js');var Tooltip=require('../Tooltip/Tooltip.js');const Menu=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:n="m",disableFlip:t=!0,offset:s=8,placement:i="bottom-start",styles:o={},sizeXXS:a,sizeXS:u,sizeS:c,sizeM:p,sizeL:l,sizeXL:M,sizes:d,sizeUnits:m,render:z,primary:v,secondary:f,palette:C,autoFocus:q,disableAutoFocus:L,...j}=e;const b={size:n,sizeXXS:a,sizeXS:u,sizeS:c,sizeM:p,sizeL:l,sizeXL:M,sizes:d,sizeUnits:m};const g=React.useRef(null);return require$$0.jsx(Tooltip.Tooltip,{...j,ref:r,preset:"brand",hideArrow:!0,getPopper:(e,r)=>{e.state.elements.reference instanceof HTMLElement&&(g.current=e.state.elements.reference),j.getPopper&&j.getPopper(e,r)},callback:(e,r)=>{e==='close'&&g.current instanceof HTMLElement&&dom.focusFirstFocusable(g.current),j.callback&&j.callback(e,r)},disableFlip:t,offset:s,placement:i,styles:ramda.mergeDeepLeft(o,f?{floater:{filter:'none'},wrapper:{cursor:'pointer'}}:{wrapper:{cursor:'pointer'}}),component:require$$0.jsx(MenuComponent.MenuComponent,{...b,autoFocus:q,disableAutoFocus:L,primary:v,secondary:f,palette:C,children:z})})})),{displayName:'Menu',sizes:constants.SIZES}),{Component:MenuComponent.MenuComponent,List:MenuList.MenuList,Container:MenuContainer.MenuContainer,Divider:MenuDivider.MenuDivider});exports.Menu=Menu;
1
+ 'use strict';var React=require('react');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var jsxRuntime=require('react/jsx-runtime');var MenuComponent=require('../MenuComponent/MenuComponent.js');var MenuList=require('../MenuList/MenuList.js');var MenuContainer=require('../MenuContainer/MenuContainer.js');var MenuDivider=require('../MenuDivider/MenuDivider.js');var constants=require('../MenuComponent/constants.js');var Tooltip=require('../Tooltip/Tooltip.js');const Menu=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:n="m",disableFlip:t=!0,offset:s=8,placement:i="bottom-start",styles:o={},sizeXXS:a,sizeXS:u,sizeS:c,sizeM:p,sizeL:l,sizeXL:M,sizes:m,sizeUnits:d,render:z,primary:v,secondary:f,palette:j,autoFocus:C,disableAutoFocus:L,...b}=e;const q={size:n,sizeXXS:a,sizeXS:u,sizeS:c,sizeM:p,sizeL:l,sizeXL:M,sizes:m,sizeUnits:d};const g=React.useRef(null);return jsxRuntime.jsx(Tooltip.Tooltip,{...b,ref:r,preset:"brand",hideArrow:!0,getPopper:(e,r)=>{e.state.elements.reference instanceof HTMLElement&&(g.current=e.state.elements.reference),b.getPopper&&b.getPopper(e,r)},callback:(e,r)=>{e==='close'&&g.current instanceof HTMLElement&&dom.focusFirstFocusable(g.current),b.callback&&b.callback(e,r)},disableFlip:t,offset:s,placement:i,styles:ramda.mergeDeepLeft(o,f?{floater:{filter:'none'},wrapper:{cursor:'pointer'}}:{wrapper:{cursor:'pointer'}}),component:jsxRuntime.jsx(MenuComponent.MenuComponent,{...q,autoFocus:C,disableAutoFocus:L,primary:v,secondary:f,palette:j,children:z})})})),{displayName:'Menu',sizes:constants.SIZES}),{Component:MenuComponent.MenuComponent,List:MenuList.MenuList,Container:MenuContainer.MenuContainer,Divider:MenuDivider.MenuDivider});exports.Menu=Menu;
2
2
  //# sourceMappingURL=Menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const trigger = useRef<HTMLElement | null>(null)\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={mergeDeepLeft(\n styles,\n secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","restProps","sizeProps","trigger","useRef","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","mergeDeepLeft","floater","filter","wrapper","cursor","component","jsx","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"oiBAuBA,MAAMA,KAKFC,OAAOC,OACTC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,KACGC,GACDrB,EAEJ,MAAMsB,EAAY,CAChBpB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAMS,EAAUC,aAA2B,MAE3C,OACEC,WAAAA,IAACC,QAAAA,QAAO,IACFL,EACJpB,IAAKA,EACL0B,OAAO,QACPC,WAAS,EACTC,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CZ,EAAQa,QAAUN,EAAOE,MAAMC,SAASC,WAGtCb,EAAUQ,WACZR,EAAUQ,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAWf,EAAQa,mBAAmBD,aACnDK,wBAAoBjB,EAAQa,SAG1Bf,EAAUgB,UACZhB,EAAUgB,SAASC,EAAQC,EAC7B,EAEFpC,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQmC,MAAAA,cACNnC,EACAW,EACI,CAAEyB,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,aAE3BC,UACErB,WAAAsB,IAACC,4BAAa,IACR1B,EACJH,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ+B,SAEhBlC,KAGL,IAGN,CACEmC,YA1GiB,OA2GjBrC,MAAOsC,UAAAA,QAGX,CACEC,UAAWJ,cAAaA,cACxBK,KAAMC,SAAQA,SACdC,UAAWC,cAAaA,cACxBC,QAASC,YAAAA"}
1
+ {"version":3,"file":"Menu.js","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component based on [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const trigger = useRef<HTMLElement | null>(null)\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={mergeDeepLeft(\n styles,\n secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","restProps","sizeProps","trigger","useRef","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","mergeDeepLeft","floater","filter","wrapper","cursor","component","jsx","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"oiBAuBA,MAAMA,KAKFC,OAAOC,OACTC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,KACGC,GACDrB,EAEJ,MAAMsB,EAAY,CAChBpB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAMS,EAAUC,aAA2B,MAE3C,OACEC,WAAAA,IAACC,QAAAA,QAAO,IACFL,EACJpB,IAAKA,EACL0B,OAAO,QACPC,WAAS,EACTC,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CZ,EAAQa,QAAUN,EAAOE,MAAMC,SAASC,WAGtCb,EAAUQ,WACZR,EAAUQ,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAWf,EAAQa,mBAAmBD,aACnDK,wBAAoBjB,EAAQa,SAG1Bf,EAAUgB,UACZhB,EAAUgB,SAASC,EAAQC,EAC7B,EAEFpC,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQmC,MAAAA,cACNnC,EACAW,EACI,CAAEyB,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,aAE3BC,UACErB,WAAAsB,IAACC,4BAAa,IACR1B,EACJH,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ+B,SAEhBlC,KAGL,IAGN,CACEmC,YA1GiB,OA2GjBrC,MAAOsC,UAAAA,QAGX,CACEC,UAAWJ,cAAaA,cACxBK,KAAMC,SAAQA,SACdC,UAAWC,cAAaA,cACxBC,QAASC,YAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.mjs","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const trigger = useRef<HTMLElement | null>(null)\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={mergeDeepLeft(\n styles,\n secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","restProps","sizeProps","trigger","useRef","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","mergeDeepLeft","floater","filter","wrapper","cursor","component","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"kiBAuBA,MAAMA,KAKFC,OAAOC,OACTC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,KACGC,GACDrB,EAEJ,MAAMsB,EAAY,CAChBpB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAMS,EAAUC,OAA2B,MAE3C,OACEC,IAACC,QAAO,IACFL,EACJpB,IAAKA,EACL0B,OAAO,QACPC,WAAS,EACTC,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CZ,EAAQa,QAAUN,EAAOE,MAAMC,SAASC,WAGtCb,EAAUQ,WACZR,EAAUQ,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAWf,EAAQa,mBAAmBD,aACnDK,oBAAoBjB,EAAQa,SAG1Bf,EAAUgB,UACZhB,EAAUgB,SAASC,EAAQC,EAC7B,EAEFpC,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQmC,cACNnC,EACAW,EACI,CAAEyB,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,aAE3BC,UACErB,IAACsB,cAAa,IACRzB,EACJH,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ8B,SAEhBjC,KAGL,IAGN,CACEkC,YA1GiB,OA2GjBpC,MAAOqC,QAGX,CACEC,UAAWJ,cACXK,KAAMC,SACNC,UAAWC,cACXC,QAASC"}
1
+ {"version":3,"file":"Menu.mjs","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component based on [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const trigger = useRef<HTMLElement | null>(null)\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={mergeDeepLeft(\n styles,\n secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","restProps","sizeProps","trigger","useRef","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","mergeDeepLeft","floater","filter","wrapper","cursor","component","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"kiBAuBA,MAAMA,KAKFC,OAAOC,OACTC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,KACGC,GACDrB,EAEJ,MAAMsB,EAAY,CAChBpB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAMS,EAAUC,OAA2B,MAE3C,OACEC,IAACC,QAAO,IACFL,EACJpB,IAAKA,EACL0B,OAAO,QACPC,WAAS,EACTC,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CZ,EAAQa,QAAUN,EAAOE,MAAMC,SAASC,WAGtCb,EAAUQ,WACZR,EAAUQ,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAWf,EAAQa,mBAAmBD,aACnDK,oBAAoBjB,EAAQa,SAG1Bf,EAAUgB,UACZhB,EAAUgB,SAASC,EAAQC,EAC7B,EAEFpC,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQmC,cACNnC,EACAW,EACI,CAAEyB,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,aAE3BC,UACErB,IAACsB,cAAa,IACRzB,EACJH,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ8B,SAEhBjC,KAGL,IAGN,CACEkC,YA1GiB,OA2GjBpC,MAAOqC,QAGX,CACEC,UAAWJ,cACXK,KAAMC,SACNC,UAAWC,cACXC,QAASC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');const noop=()=>{};const MenuComponent=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:t="m",closeFn:o=noop,sizeXXS:r,sizeXS:n,sizeS:i,sizeM:c,sizeL:u,sizeXL:a,children:l,autoFocus:p,disableAutoFocus:d,showCloseButton:m,closeButtonProps:z,...S}=e;const R=React.useRef(null);React.useImperativeHandle(s,(()=>R.current),[]),React.useEffect((()=>{const e=setTimeout((()=>{!d&&R.current&&dom.focusFirstFocusable(R.current)}),0);return()=>{clearTimeout(e)}}),[p,d]);const f={size:t,sizeXXS:r,sizeXS:n,sizeS:i,sizeM:c,sizeL:u,sizeXL:a};const h={showCloseButton:m,closeButtonProps:z,closeFn:o};const M=React.isValidElement(l)&&typeof l.props=='object'&&l.props!==null?l.props:{};return require$$0.jsx(style.Root,{...S,...f,ref:R,children:React.isValidElement(l)?React.cloneElement(l,{...f,...h,...M}):typeof l=='function'?l({...f,...h}):void 0})})),{displayName:'MenuComponent',sizes:constants.SIZES});exports.SIZES=constants.SIZES,exports.MenuComponent=MenuComponent;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');const noop=()=>{};const MenuComponent=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:t="m",closeFn:o=noop,sizeXXS:r,sizeXS:n,sizeS:i,sizeM:c,sizeL:u,sizeXL:a,children:l,autoFocus:p,disableAutoFocus:m,showCloseButton:d,closeButtonProps:z,...R}=e;const S=React.useRef(null);React.useImperativeHandle(s,(()=>S.current),[]),React.useEffect((()=>{const e=setTimeout((()=>{!m&&S.current&&dom.focusFirstFocusable(S.current)}),0);return()=>{clearTimeout(e)}}),[p,m]);const f={size:t,sizeXXS:r,sizeXS:n,sizeS:i,sizeM:c,sizeL:u,sizeXL:a};const h={showCloseButton:d,closeButtonProps:z,closeFn:o};const M=React.isValidElement(l)&&typeof l.props=='object'&&l.props!==null?l.props:{};return jsxRuntime.jsx(style.Root,{...R,...f,ref:S,children:React.isValidElement(l)?React.cloneElement(l,{...f,...h,...M}):typeof l=='function'?l({...f,...h}):void 0})})),{displayName:'MenuComponent',sizes:constants.SIZES});exports.SIZES=constants.SIZES,exports.MenuComponent=MenuComponent;
2
2
  //# sourceMappingURL=MenuComponent.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var style=require('./style.js');var require$$0=require('react/jsx-runtime');exports.MenuContainer=React.forwardRef(((e,r)=>{const{closeButtonProps:s={},children:t,showCloseButton:o,closeFn:i,...n}=e;return require$$0.jsxs(style.Root,{...n,ref:r,children:[o&&require$$0.jsx(style.CloseButton,{square:!0,size:"m",icon:"close",...s,onClick:e=>{i&&i(),s.onClick&&s.onClick(e)}}),t]})}));
1
+ 'use strict';var React=require('react');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');exports.MenuContainer=React.forwardRef(((e,s)=>{const{closeButtonProps:t={},children:r,showCloseButton:o,closeFn:n,...i}=e;return jsxRuntime.jsxs(style.Root,{...i,ref:s,children:[o&&jsxRuntime.jsx(style.CloseButton,{square:!0,size:"m",icon:"close",...t,onClick:e=>{n&&n(),t.onClick&&t.onClick(e)}}),r]})}));
2
2
  //# sourceMappingURL=MenuContainer.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var useMergedPalette=require('../../hooks/useMergedPalette.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Text=require('../Text/Text.js');exports.MenuDivider=React.forwardRef(((e,r)=>{const{textProps:t={},children:s,text:i,...a}=e;const o=useMergedPalette.useMergedPalette(a);return require$$0.jsxs(style.Root,{...a,palette:o,ref:r,children:[(s||i)&&require$$0.jsx(Text.Text,{appearance:"body",size:"xs",color:"inherit",marginTop:8,marginBottom:4,...t,children:s??i}),require$$0.jsx(style.HorizontalLine,{})]})}));
1
+ 'use strict';var React=require('react');var useMergedPalette=require('../../hooks/useMergedPalette.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Text=require('../Text/Text.js');exports.MenuDivider=React.forwardRef(((e,t)=>{const{textProps:r={},children:s,text:i,...a}=e;const n=useMergedPalette.useMergedPalette(a);return jsxRuntime.jsxs(style.Root,{...a,palette:n,ref:t,children:[(s||i)&&jsxRuntime.jsx(Text.Text,{appearance:"body",size:"xs",color:"inherit",marginTop:8,marginBottom:4,...r,children:s??i}),jsxRuntime.jsx(style.HorizontalLine,{})]})}));
2
2
  //# sourceMappingURL=MenuDivider.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var dom=require('../../shared/utils/dom.js');var constants=require('../../shared/constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');const HOT_KEYS=[...constants.keyboardKeys.ArrowUp.key,...constants.keyboardKeys.ArrowDown.key];exports.MenuList=React.forwardRef(((e,s)=>{const{role:r="list",gap:t=4,size:i,sizeXXS:n,sizeXS:o,sizeS:l,sizeM:a,sizeL:c,sizeXL:d,sizeUnits:p,sizes:u,...y}=e;const z={size:i,sizeXXS:n,sizeXS:o,sizeS:l,sizeM:a,sizeL:c,sizeXL:d,sizeUnits:p,sizes:u};const h=React.isValidElement(y.children)&&y.children.type===React.Fragment&&typeof y.children.props=='object'&&y.children.props!==null?y.children.props.children:y.children;return require$$0.jsx(style.Root,{...y,role:r,gap:t,onKeyDown:e=>{if(y.onKeyDown&&y.onKeyDown(e),HOT_KEYS.includes(e.key)){e.preventDefault();const s=[...e.currentTarget.children];let r=s.findIndex((s=>s.contains(e.target)));do{r=constants.keyboardKeys.ArrowUp.validate(e.key)?--r:++r,r<0?r=s.length-1:r>s.length-1&&(r=0)}while(!(s[r]instanceof HTMLElement&&dom.focusFirstFocusable(s[r])))}},ref:s,children:React.Children.map(h,((e,s)=>React.isValidElement(e)?require$$0.jsx("li",{children:React.cloneElement(e,{...z,...typeof e.props=='object'&&e.props!==null?e.props:{}})},s):e===null||e===void 0||typeof e=='boolean'?e:require$$0.jsx("li",{children:e},s)))})}));
1
+ 'use strict';var React=require('react');var dom=require('../../shared/utils/dom.js');var constants=require('../../shared/constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');const HOT_KEYS=[...constants.keyboardKeys.ArrowUp.key,...constants.keyboardKeys.ArrowDown.key];exports.MenuList=React.forwardRef(((e,s)=>{const{role:t="list",gap:n=4,size:r,sizeXXS:i,sizeXS:o,sizeS:l,sizeM:a,sizeL:c,sizeXL:d,sizeUnits:p,sizes:u,...y}=e;const z={size:r,sizeXXS:i,sizeXS:o,sizeS:l,sizeM:a,sizeL:c,sizeXL:d,sizeUnits:p,sizes:u};const h=React.isValidElement(y.children)&&y.children.type===React.Fragment&&typeof y.children.props=='object'&&y.children.props!==null?y.children.props.children:y.children;return jsxRuntime.jsx(style.Root,{...y,role:t,gap:n,onKeyDown:e=>{if(y.onKeyDown&&y.onKeyDown(e),HOT_KEYS.includes(e.key)){e.preventDefault();const s=[...e.currentTarget.children];let t=s.findIndex((s=>s.contains(e.target)));do{t=constants.keyboardKeys.ArrowUp.validate(e.key)?--t:++t,t<0?t=s.length-1:t>s.length-1&&(t=0)}while(!(s[t]instanceof HTMLElement&&dom.focusFirstFocusable(s[t])))}},ref:s,children:React.Children.map(h,((e,s)=>React.isValidElement(e)?jsxRuntime.jsx("li",{children:React.cloneElement(e,{...z,...typeof e.props=='object'&&e.props!==null?e.props:{}})},s):e===null||e===void 0||typeof e=='boolean'?e:jsxRuntime.jsx("li",{children:e},s)))})}));
2
2
  //# sourceMappingURL=MenuList.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');exports.ModalClose=({className:e,onClick:r})=>require$$0.jsx(style.ModalClose,{className:e,onClick:r,children:require$$0.jsx(Icon.Icon,{name:"tinyCross",color:"#D9D9D9"})});
1
+ 'use strict';var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');exports.ModalClose=({className:e,onClick:s})=>jsxRuntime.jsx(style.ModalClose,{className:e,onClick:s,children:jsxRuntime.jsx(Icon.Icon,{name:"tinyCross",color:"#D9D9D9"})});
2
2
  //# sourceMappingURL=Close.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var ReactModal=require('react-modal');var Close=require('./Close.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ReactModal__default=_interopDefault(ReactModal);function Modal(e){const{blurredOverlay:l,children:o,closeTimeoutMS:a,contentLabel:r,isOpen:t,onAfterOpen:s,onRequestClose:n,overlayClassName:d,role:i,shouldCloseOnOverlayClick:u,width:c,valign:m,className:M,style:v,zIndex:y}=e;return require$$0.jsx(style.Modal,{blurredOverlay:l,closeTimeoutMS:a,contentLabel:r,isOpen:Boolean(t),onAfterOpen:s,onRequestClose:n,portalClassName:M,overlayClassName:d,bodyOpenClassName:"modal--open",role:i,zIndex:y,valign:m,width:c,shouldCloseOnOverlayClick:u,children:require$$0.jsx("div",{style:v,children:o})})}typeof window!='undefined'&&(()=>{const e=document.body;e&&e instanceof HTMLElement&&ReactModal__default.default.setAppElement(e)})(),Modal.defaultProps={blurredOverlay:!1,closeTimeoutMS:0,zIndex:9e3,contentLabel:'',isOpen:!1,role:'dialog',shouldCloseOnOverlayClick:!0,width:'m',valign:'center',className:'modal'},Modal.Close=Close.ModalClose,Modal.displayName='Modal',exports.Modal=Modal;
1
+ 'use strict';var ReactModal=require('react-modal');var Close=require('./Close.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ReactModal__default=_interopDefault(ReactModal);function Modal(e){const{blurredOverlay:l,children:o,closeTimeoutMS:a,contentLabel:t,isOpen:s,onAfterOpen:n,onRequestClose:r,overlayClassName:d,role:i,shouldCloseOnOverlayClick:u,width:c,valign:m,className:M,style:v,zIndex:y}=e;return jsxRuntime.jsx(style.Modal,{blurredOverlay:l,closeTimeoutMS:a,contentLabel:t,isOpen:Boolean(s),onAfterOpen:n,onRequestClose:r,portalClassName:M,overlayClassName:d,bodyOpenClassName:"modal--open",role:i,zIndex:y,valign:m,width:c,shouldCloseOnOverlayClick:u,children:jsxRuntime.jsx("div",{style:v,children:o})})}typeof window!='undefined'&&(()=>{const e=document.body;e&&e instanceof HTMLElement&&ReactModal__default.default.setAppElement(e)})(),Modal.defaultProps={blurredOverlay:!1,closeTimeoutMS:0,zIndex:9e3,contentLabel:'',isOpen:!1,role:'dialog',shouldCloseOnOverlayClick:!0,width:'m',valign:'center',className:'modal'},Modal.Close=Close.ModalClose,Modal.displayName='Modal',exports.Modal=Modal;
2
2
  //# sourceMappingURL=Modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import ReactModal, { Classes } from 'react-modal'\nimport { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport { BaseProps } from 'shared/interfaces'\nimport { ModalClose } from './Close'\nimport * as Styled from './style'\n\nfunction setAppModalElement() {\n const appElement = document.body\n\n if (appElement && appElement instanceof HTMLElement) ReactModal.setAppElement(appElement)\n}\n\n// eslint-disable-next-line prettier/prettier\nif (typeof window !== 'undefined') {\n setAppModalElement()\n}\n\nexport interface ModalProps extends BaseProps, ResponsiveNamedProperty<'width'> {\n /**\n * Primary content.\n */\n /**\n * Boolean indicating if the overlay background should be blurred\n */\n blurredOverlay?: boolean\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Modal class name\n */\n className?: string\n /**\n * Number indicating the milliseconds to wait before closing the modal.\n */\n closeTimeoutMS?: number\n /**\n * String indicating how the content container should be announced to screenreaders\n */\n contentLabel?: string\n /**\n * Boolean describing if the modal should be shown or not.\n */\n isOpen?: boolean\n /**\n * Function that will be run after the modal has opened.\n */\n onAfterOpen?(): void\n /**\n * Function that will be run when the modal is requested to be closed, prior to actually closing.\n */\n onRequestClose?(): void\n /**\n * Custom overlay CSS class name\n */\n overlayClassName?: string | Classes\n /**\n * String indicating the role of the modal, allowing the 'dialog' role to be applied if desired.\n */\n role?: string\n /**\n * Boolean indicating if the overlay should close the modal\n */\n shouldCloseOnOverlayClick?: boolean\n /**\n * Vertical align\n */\n valign?: 'top' | 'center' | 'bottom'\n /**\n * z-index\n */\n zIndex?: number\n}\n\nModal.defaultProps = {\n blurredOverlay: false,\n closeTimeoutMS: 0,\n zIndex: 9000,\n contentLabel: '',\n isOpen: false,\n role: 'dialog',\n shouldCloseOnOverlayClick: true,\n width: 'm',\n valign: 'center',\n className: 'modal',\n}\n\nModal.Close = ModalClose\nModal.displayName = 'Modal'\n\n/**\n * Основан на [react-modal](https://github.com/reactjs/react-modal).\n *\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width'>`](#/Миксины)\n */\nexport function Modal(props: ModalProps) {\n const {\n blurredOverlay,\n children,\n closeTimeoutMS,\n contentLabel,\n isOpen,\n onAfterOpen,\n onRequestClose,\n overlayClassName,\n role,\n shouldCloseOnOverlayClick,\n width,\n valign,\n className,\n style,\n zIndex,\n } = props\n\n return (\n <Styled.Modal\n blurredOverlay={blurredOverlay}\n closeTimeoutMS={closeTimeoutMS}\n contentLabel={contentLabel}\n isOpen={Boolean(isOpen)}\n onAfterOpen={onAfterOpen}\n onRequestClose={onRequestClose}\n portalClassName={className}\n overlayClassName={overlayClassName}\n bodyOpenClassName='modal--open'\n role={role}\n zIndex={zIndex}\n valign={valign}\n width={width}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n >\n <div style={style}>{children}</div>\n </Styled.Modal>\n )\n}\n"],"names":["Modal","props","blurredOverlay","children","closeTimeoutMS","contentLabel","isOpen","onAfterOpen","onRequestClose","overlayClassName","role","shouldCloseOnOverlayClick","width","valign","className","style","zIndex","_jsx","Styled","Boolean","portalClassName","bodyOpenClassName","jsx","window","appElement","document","body","HTMLElement","ReactModal","setAppElement","setAppModalElement","defaultProps","Close","ModalClose","displayName"],"mappings":"oRAkGO,SAASA,MAAMC,GACpB,MAAMC,eACJA,EAAcC,SACdA,EAAQC,eACRA,EAAcC,aACdA,EAAYC,OACZA,EAAMC,YACNA,EAAWC,eACXA,EAAcC,iBACdA,EAAgBC,KAChBA,EAAIC,0BACJA,EAAyBC,MACzBA,EAAKC,OACLA,EAAMC,UACNA,QACAC,EAAKC,OACLA,GACEf,EAEJ,OACEgB,WAAAA,IAACC,MAAAA,MAAY,CACXhB,eAAgBA,EAChBE,eAAgBA,EAChBC,aAAcA,EACdC,OAAQa,QAAQb,GAChBC,YAAaA,EACbC,eAAgBA,EAChBY,gBAAiBN,EACjBL,iBAAkBA,EAClBY,kBAAkB,cAClBX,KAAMA,EACNM,OAAQA,EACRH,OAAQA,EACRD,MAAOA,EACPD,0BAA2BA,EAA0BR,SAErDc,WAAAK,IAAA,MAAA,CAAKP,MAAOA,EAAMZ,SAAEA,KAG1B,QA5HWoB,QAAW,aAPtB,MACE,MAAMC,EAAaC,SAASC,KAExBF,GAAcA,aAAsBG,aAAaC,oBAAAA,QAAWC,cAAcL,EAChF,EAIEM,GA6DF9B,MAAM+B,aAAe,CACnB7B,gBAAgB,EAChBE,eAAgB,EAChBY,OAAQ,IACRX,aAAc,GACdC,QAAQ,EACRI,KAAM,SACNC,2BAA2B,EAC3BC,MAAO,IACPC,OAAQ,SACRC,UAAW,SAGbd,MAAMgC,MAAQC,MAAAA,WACdjC,MAAMkC,YAAc"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import ReactModal from 'react-modal'\nimport { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport { BaseProps } from 'shared/interfaces'\nimport { ModalClose } from './Close'\nimport * as Styled from './style'\n\nfunction setAppModalElement() {\n const appElement = document.body\n\n if (appElement && appElement instanceof HTMLElement) ReactModal.setAppElement(appElement)\n}\n\n// eslint-disable-next-line prettier/prettier\nif (typeof window !== 'undefined') {\n setAppModalElement()\n}\n\nexport interface ModalProps extends BaseProps, ResponsiveNamedProperty<'width'> {\n /**\n * Primary content.\n */\n /**\n * Boolean indicating if the overlay background should be blurred\n */\n blurredOverlay?: boolean\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Modal class name\n */\n className?: string\n /**\n * Number indicating the milliseconds to wait before closing the modal.\n */\n closeTimeoutMS?: number\n /**\n * String indicating how the content container should be announced to screenreaders\n */\n contentLabel?: string\n /**\n * Boolean describing if the modal should be shown or not.\n */\n isOpen?: boolean\n /**\n * Function that will be run after the modal has opened.\n */\n onAfterOpen?(): void\n /**\n * Function that will be run when the modal is requested to be closed, prior to actually closing.\n */\n onRequestClose?(): void\n /**\n * Custom overlay CSS class name\n */\n overlayClassName?: string | { base: string; afterOpen: string; beforeClose: string }\n /**\n * String indicating the role of the modal, allowing the 'dialog' role to be applied if desired.\n */\n role?: string\n /**\n * Boolean indicating if the overlay should close the modal\n */\n shouldCloseOnOverlayClick?: boolean\n /**\n * Vertical align\n */\n valign?: 'top' | 'center' | 'bottom'\n /**\n * z-index\n */\n zIndex?: number\n}\n\nModal.defaultProps = {\n blurredOverlay: false,\n closeTimeoutMS: 0,\n zIndex: 9000,\n contentLabel: '',\n isOpen: false,\n role: 'dialog',\n shouldCloseOnOverlayClick: true,\n width: 'm',\n valign: 'center',\n className: 'modal',\n}\n\nModal.Close = ModalClose\nModal.displayName = 'Modal'\n\n/**\n * Основан на [react-modal](https://github.com/reactjs/react-modal).\n *\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width'>`](#/Миксины)\n */\nexport function Modal(props: ModalProps) {\n const {\n blurredOverlay,\n children,\n closeTimeoutMS,\n contentLabel,\n isOpen,\n onAfterOpen,\n onRequestClose,\n overlayClassName,\n role,\n shouldCloseOnOverlayClick,\n width,\n valign,\n className,\n style,\n zIndex,\n } = props\n\n return (\n <Styled.Modal\n blurredOverlay={blurredOverlay}\n closeTimeoutMS={closeTimeoutMS}\n contentLabel={contentLabel}\n isOpen={Boolean(isOpen)}\n onAfterOpen={onAfterOpen}\n onRequestClose={onRequestClose}\n portalClassName={className}\n overlayClassName={overlayClassName}\n bodyOpenClassName='modal--open'\n role={role}\n zIndex={zIndex}\n valign={valign}\n width={width}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n >\n <div style={style}>{children}</div>\n </Styled.Modal>\n )\n}\n"],"names":["Modal","props","blurredOverlay","children","closeTimeoutMS","contentLabel","isOpen","onAfterOpen","onRequestClose","overlayClassName","role","shouldCloseOnOverlayClick","width","valign","className","style","zIndex","_jsx","Styled","Boolean","portalClassName","bodyOpenClassName","jsx","window","appElement","document","body","HTMLElement","ReactModal","setAppElement","setAppModalElement","defaultProps","Close","ModalClose","displayName"],"mappings":"oRAkGO,SAASA,MAAMC,GACpB,MAAMC,eACJA,EAAcC,SACdA,EAAQC,eACRA,EAAcC,aACdA,EAAYC,OACZA,EAAMC,YACNA,EAAWC,eACXA,EAAcC,iBACdA,EAAgBC,KAChBA,EAAIC,0BACJA,EAAyBC,MACzBA,EAAKC,OACLA,EAAMC,UACNA,QACAC,EAAKC,OACLA,GACEf,EAEJ,OACEgB,WAAAA,IAACC,MAAAA,MAAY,CACXhB,eAAgBA,EAChBE,eAAgBA,EAChBC,aAAcA,EACdC,OAAQa,QAAQb,GAChBC,YAAaA,EACbC,eAAgBA,EAChBY,gBAAiBN,EACjBL,iBAAkBA,EAClBY,kBAAkB,cAClBX,KAAMA,EACNM,OAAQA,EACRH,OAAQA,EACRD,MAAOA,EACPD,0BAA2BA,EAA0BR,SAErDc,WAAAK,IAAA,MAAA,CAAKP,MAAOA,EAAMZ,SAAEA,KAG1B,QA5HWoB,QAAW,aAPtB,MACE,MAAMC,EAAaC,SAASC,KAExBF,GAAcA,aAAsBG,aAAaC,oBAAAA,QAAWC,cAAcL,EAChF,EAIEM,GA6DF9B,MAAM+B,aAAe,CACnB7B,gBAAgB,EAChBE,eAAgB,EAChBY,OAAQ,IACRX,aAAc,GACdC,QAAQ,EACRI,KAAM,SACNC,2BAA2B,EAC3BC,MAAO,IACPC,OAAQ,SACRC,UAAW,SAGbd,MAAMgC,MAAQC,MAAAA,WACdjC,MAAMkC,YAAc"}