@redneckz/wildless-cms-uni-blocks 0.7.4 → 0.7.6

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 (445) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +246 -49
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Calculator/BusinessDepositCalculatorForm.d.ts +5 -0
  5. package/bundle/components/Calculator/CalculatorContent.d.ts +14 -1
  6. package/bundle/components/Calculator/EmbeddableCalcBlocks.d.ts +3 -1
  7. package/bundle/components/Calculator/Rate.d.ts +2 -0
  8. package/bundle/components/Calculator/UnknownRate.d.ts +4 -0
  9. package/bundle/components/Calculator/constants.d.ts +10 -0
  10. package/bundle/components/Calculator/renderDaysInput.d.ts +8 -0
  11. package/bundle/components/Calculator/renderInterestPayment.d.ts +2 -0
  12. package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +27 -0
  13. package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +2 -5
  14. package/bundle/components/Tabs/LinkTab.d.ts +1 -0
  15. package/bundle/components/Tabs/ScrollableTabs.d.ts +8 -0
  16. package/bundle/components/Tabs/TabsContent.d.ts +12 -0
  17. package/bundle/components/Tabs/renderGroupTab.d.ts +2 -2
  18. package/bundle/components/Tabs/renderTab.d.ts +2 -1
  19. package/bundle/components/Tabs/tabItemClasses.d.ts +6 -1
  20. package/bundle/icons/IconName.d.ts +4 -2
  21. package/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +1 -0
  22. package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  23. package/bundle/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +15 -0
  24. package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  25. package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +2 -9
  26. package/cosmos-static/icons/PercentIcon.svg +1 -0
  27. package/dist/components/Calculator/BonusCalculatorForm.js +2 -1
  28. package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  29. package/dist/components/Calculator/BusinessDepositCalculatorForm.d.ts +5 -0
  30. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +48 -0
  31. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -0
  32. package/dist/components/Calculator/CalculatorContent.d.ts +14 -1
  33. package/dist/components/Calculator/CalculatorValueBlock.js +3 -1
  34. package/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
  35. package/dist/components/Calculator/CreditCalculatorForm.js +2 -1
  36. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  37. package/dist/components/Calculator/DepositCalculatorForm.js +5 -15
  38. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  39. package/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +3 -1
  40. package/dist/components/Calculator/EmbeddableCalcBlocks.js +2 -0
  41. package/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
  42. package/dist/components/Calculator/Rate.d.ts +2 -0
  43. package/dist/components/Calculator/Rate.js +3 -1
  44. package/dist/components/Calculator/Rate.js.map +1 -1
  45. package/dist/components/Calculator/UnknownRate.d.ts +4 -0
  46. package/dist/components/Calculator/UnknownRate.js +9 -0
  47. package/dist/components/Calculator/UnknownRate.js.map +1 -0
  48. package/dist/components/Calculator/constants.d.ts +10 -0
  49. package/dist/components/Calculator/constants.js +21 -1
  50. package/dist/components/Calculator/constants.js.map +1 -1
  51. package/dist/components/Calculator/renderCalculatorBlock.js +1 -1
  52. package/dist/components/Calculator/renderCalculatorBlock.js.map +1 -1
  53. package/dist/components/Calculator/renderDaysInput.d.ts +8 -0
  54. package/dist/components/Calculator/renderDaysInput.js +16 -0
  55. package/dist/components/Calculator/renderDaysInput.js.map +1 -0
  56. package/dist/components/Calculator/renderFootnote.js +2 -1
  57. package/dist/components/Calculator/renderFootnote.js.map +1 -1
  58. package/dist/components/Calculator/renderInterestPayment.d.ts +2 -0
  59. package/dist/components/Calculator/renderInterestPayment.js +22 -0
  60. package/dist/components/Calculator/renderInterestPayment.js.map +1 -0
  61. package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +27 -0
  62. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +49 -0
  63. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  64. package/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  65. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  66. package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +2 -2
  67. package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -1
  68. package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +2 -5
  69. package/dist/components/Tabs/LinkTab.d.ts +1 -0
  70. package/dist/components/Tabs/LinkTab.js +2 -2
  71. package/dist/components/Tabs/LinkTab.js.map +1 -1
  72. package/dist/components/Tabs/ScrollableTabs.d.ts +8 -0
  73. package/dist/components/Tabs/ScrollableTabs.js +24 -0
  74. package/dist/components/Tabs/ScrollableTabs.js.map +1 -0
  75. package/dist/components/Tabs/Tabs.js +9 -2
  76. package/dist/components/Tabs/Tabs.js.map +1 -1
  77. package/dist/components/Tabs/TabsContent.d.ts +12 -0
  78. package/dist/components/Tabs/renderGroupTab.d.ts +2 -2
  79. package/dist/components/Tabs/renderGroupTab.js +12 -4
  80. package/dist/components/Tabs/renderGroupTab.js.map +1 -1
  81. package/dist/components/Tabs/renderTab.d.ts +2 -1
  82. package/dist/components/Tabs/renderTab.js +4 -6
  83. package/dist/components/Tabs/renderTab.js.map +1 -1
  84. package/dist/components/Tabs/tabItemClasses.d.ts +6 -1
  85. package/dist/components/Tabs/tabItemClasses.js +61 -2
  86. package/dist/components/Tabs/tabItemClasses.js.map +1 -1
  87. package/dist/icons/IconName.d.ts +4 -2
  88. package/dist/icons/IconName.js +3 -1
  89. package/dist/icons/IconName.js.map +1 -1
  90. package/dist/setup-fixture.js +0 -1
  91. package/dist/setup-fixture.js.map +1 -1
  92. package/dist/ui-kit/Checkbox/Checkbox.js +5 -5
  93. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  94. package/dist/ui-kit/Checkbox/CheckboxProps.d.ts +1 -0
  95. package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  96. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  97. package/dist/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +15 -0
  98. package/dist/ui-kit/SwipeListControl/SwipeListControlContent.js +2 -0
  99. package/dist/ui-kit/SwipeListControl/SwipeListControlContent.js.map +1 -0
  100. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  101. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  102. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  103. package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +2 -9
  104. package/dist/utils/addSpacesBetweenNumbers.js +1 -1
  105. package/dist/utils/addSpacesBetweenNumbers.js.map +1 -1
  106. package/lib/common.css +1 -1
  107. package/lib/components/Calculator/BonusCalculatorForm.js +2 -1
  108. package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  109. package/lib/components/Calculator/BusinessDepositCalculatorForm.d.ts +5 -0
  110. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +46 -0
  111. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -0
  112. package/lib/components/Calculator/Calculator.fixture.d.ts +1 -0
  113. package/lib/components/Calculator/CalculatorContent.d.ts +14 -1
  114. package/lib/components/Calculator/CalculatorValueBlock.js +3 -1
  115. package/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
  116. package/lib/components/Calculator/CreditCalculatorForm.js +2 -1
  117. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  118. package/lib/components/Calculator/DepositCalculatorForm.js +5 -15
  119. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  120. package/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +3 -1
  121. package/lib/components/Calculator/EmbeddableCalcBlocks.js +2 -0
  122. package/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
  123. package/lib/components/Calculator/Rate.d.ts +2 -0
  124. package/lib/components/Calculator/Rate.js +3 -1
  125. package/lib/components/Calculator/Rate.js.map +1 -1
  126. package/lib/components/Calculator/UnknownRate.d.ts +4 -0
  127. package/lib/components/Calculator/UnknownRate.js +7 -0
  128. package/lib/components/Calculator/UnknownRate.js.map +1 -0
  129. package/lib/components/Calculator/constants.d.ts +10 -0
  130. package/lib/components/Calculator/constants.js +20 -0
  131. package/lib/components/Calculator/constants.js.map +1 -1
  132. package/lib/components/Calculator/renderCalculatorBlock.js +1 -1
  133. package/lib/components/Calculator/renderCalculatorBlock.js.map +1 -1
  134. package/lib/components/Calculator/renderDaysInput.d.ts +8 -0
  135. package/lib/components/Calculator/renderDaysInput.js +13 -0
  136. package/lib/components/Calculator/renderDaysInput.js.map +1 -0
  137. package/lib/components/Calculator/renderFootnote.js +2 -1
  138. package/lib/components/Calculator/renderFootnote.js.map +1 -1
  139. package/lib/components/Calculator/renderInterestPayment.d.ts +2 -0
  140. package/lib/components/Calculator/renderInterestPayment.js +19 -0
  141. package/lib/components/Calculator/renderInterestPayment.js.map +1 -0
  142. package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +27 -0
  143. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +46 -0
  144. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  145. package/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  146. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  147. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +1 -0
  148. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +2 -2
  149. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -1
  150. package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +2 -5
  151. package/lib/components/Tabs/LinkTab.d.ts +1 -0
  152. package/lib/components/Tabs/LinkTab.js +3 -3
  153. package/lib/components/Tabs/LinkTab.js.map +1 -1
  154. package/lib/components/Tabs/ScrollableTabs.d.ts +8 -0
  155. package/lib/components/Tabs/ScrollableTabs.js +22 -0
  156. package/lib/components/Tabs/ScrollableTabs.js.map +1 -0
  157. package/lib/components/Tabs/Tabs.fixture.d.ts +1 -0
  158. package/lib/components/Tabs/Tabs.js +9 -2
  159. package/lib/components/Tabs/Tabs.js.map +1 -1
  160. package/lib/components/Tabs/TabsContent.d.ts +12 -0
  161. package/lib/components/Tabs/renderGroupTab.d.ts +2 -2
  162. package/lib/components/Tabs/renderGroupTab.js +13 -5
  163. package/lib/components/Tabs/renderGroupTab.js.map +1 -1
  164. package/lib/components/Tabs/renderTab.d.ts +2 -1
  165. package/lib/components/Tabs/renderTab.js +4 -6
  166. package/lib/components/Tabs/renderTab.js.map +1 -1
  167. package/lib/components/Tabs/tabItemClasses.d.ts +6 -1
  168. package/lib/components/Tabs/tabItemClasses.js +58 -1
  169. package/lib/components/Tabs/tabItemClasses.js.map +1 -1
  170. package/lib/icons/IconName.d.ts +4 -2
  171. package/lib/icons/IconName.js +3 -1
  172. package/lib/icons/IconName.js.map +1 -1
  173. package/lib/setup-fixture.js +0 -1
  174. package/lib/setup-fixture.js.map +1 -1
  175. package/lib/ui-kit/Checkbox/Checkbox.js +5 -5
  176. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  177. package/lib/ui-kit/Checkbox/CheckboxProps.d.ts +1 -0
  178. package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  179. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  180. package/lib/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +15 -0
  181. package/lib/ui-kit/SwipeListControl/SwipeListControlContent.js +2 -0
  182. package/lib/ui-kit/SwipeListControl/SwipeListControlContent.js.map +1 -0
  183. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  184. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  185. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  186. package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +2 -9
  187. package/lib/utils/addSpacesBetweenNumbers.js +1 -1
  188. package/lib/utils/addSpacesBetweenNumbers.js.map +1 -1
  189. package/mobile/bundle/bundle.umd.js +2 -2
  190. package/mobile/bundle/bundle.umd.min.js +1 -1
  191. package/mobile/bundle/components/Calculator/BusinessDepositCalculatorForm.d.ts +5 -0
  192. package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +14 -1
  193. package/mobile/bundle/components/Calculator/EmbeddableCalcBlocks.d.ts +3 -1
  194. package/mobile/bundle/components/Calculator/Rate.d.ts +2 -0
  195. package/mobile/bundle/components/Calculator/UnknownRate.d.ts +4 -0
  196. package/mobile/bundle/components/Calculator/constants.d.ts +10 -0
  197. package/mobile/bundle/components/Calculator/renderDaysInput.d.ts +8 -0
  198. package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +2 -0
  199. package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +27 -0
  200. package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +2 -5
  201. package/mobile/bundle/components/Tabs/LinkTab.d.ts +1 -0
  202. package/mobile/bundle/components/Tabs/ScrollableTabs.d.ts +8 -0
  203. package/mobile/bundle/components/Tabs/TabsContent.d.ts +12 -0
  204. package/mobile/bundle/components/Tabs/renderGroupTab.d.ts +2 -2
  205. package/mobile/bundle/components/Tabs/renderTab.d.ts +2 -1
  206. package/mobile/bundle/components/Tabs/tabItemClasses.d.ts +6 -1
  207. package/mobile/bundle/icons/IconName.d.ts +4 -2
  208. package/mobile/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +1 -0
  209. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  210. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +15 -0
  211. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  212. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +2 -9
  213. package/mobile/dist/components/Calculator/BonusCalculatorForm.js +2 -1
  214. package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  215. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.d.ts +5 -0
  216. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +48 -0
  217. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -0
  218. package/mobile/dist/components/Calculator/CalculatorContent.d.ts +14 -1
  219. package/mobile/dist/components/Calculator/CalculatorValueBlock.js +3 -1
  220. package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
  221. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +2 -1
  222. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  223. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +5 -15
  224. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  225. package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +3 -1
  226. package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js +2 -0
  227. package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
  228. package/mobile/dist/components/Calculator/Rate.d.ts +2 -0
  229. package/mobile/dist/components/Calculator/Rate.js +3 -1
  230. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  231. package/mobile/dist/components/Calculator/UnknownRate.d.ts +4 -0
  232. package/mobile/dist/components/Calculator/UnknownRate.js +9 -0
  233. package/mobile/dist/components/Calculator/UnknownRate.js.map +1 -0
  234. package/mobile/dist/components/Calculator/constants.d.ts +10 -0
  235. package/mobile/dist/components/Calculator/constants.js +21 -1
  236. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  237. package/mobile/dist/components/Calculator/renderCalculatorBlock.js +1 -1
  238. package/mobile/dist/components/Calculator/renderCalculatorBlock.js.map +1 -1
  239. package/mobile/dist/components/Calculator/renderDaysInput.d.ts +8 -0
  240. package/mobile/dist/components/Calculator/renderDaysInput.js +16 -0
  241. package/mobile/dist/components/Calculator/renderDaysInput.js.map +1 -0
  242. package/mobile/dist/components/Calculator/renderFootnote.js +2 -1
  243. package/mobile/dist/components/Calculator/renderFootnote.js.map +1 -1
  244. package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +2 -0
  245. package/mobile/dist/components/Calculator/renderInterestPayment.js +22 -0
  246. package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -0
  247. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +27 -0
  248. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +49 -0
  249. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  250. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
  251. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  252. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +2 -2
  253. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -1
  254. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +2 -5
  255. package/mobile/dist/components/Tabs/LinkTab.d.ts +1 -0
  256. package/mobile/dist/components/Tabs/LinkTab.js +2 -2
  257. package/mobile/dist/components/Tabs/LinkTab.js.map +1 -1
  258. package/mobile/dist/components/Tabs/ScrollableTabs.d.ts +8 -0
  259. package/mobile/dist/components/Tabs/ScrollableTabs.js +24 -0
  260. package/mobile/dist/components/Tabs/ScrollableTabs.js.map +1 -0
  261. package/mobile/dist/components/Tabs/Tabs.js +9 -2
  262. package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
  263. package/mobile/dist/components/Tabs/TabsContent.d.ts +12 -0
  264. package/mobile/dist/components/Tabs/renderGroupTab.d.ts +2 -2
  265. package/mobile/dist/components/Tabs/renderGroupTab.js +12 -4
  266. package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
  267. package/mobile/dist/components/Tabs/renderTab.d.ts +2 -1
  268. package/mobile/dist/components/Tabs/renderTab.js +4 -6
  269. package/mobile/dist/components/Tabs/renderTab.js.map +1 -1
  270. package/mobile/dist/components/Tabs/tabItemClasses.d.ts +6 -1
  271. package/mobile/dist/components/Tabs/tabItemClasses.js +61 -2
  272. package/mobile/dist/components/Tabs/tabItemClasses.js.map +1 -1
  273. package/mobile/dist/icons/IconName.d.ts +4 -2
  274. package/mobile/dist/icons/IconName.js +3 -1
  275. package/mobile/dist/icons/IconName.js.map +1 -1
  276. package/mobile/dist/setup-fixture.js +0 -1
  277. package/mobile/dist/setup-fixture.js.map +1 -1
  278. package/mobile/dist/ui-kit/Checkbox/Checkbox.js +5 -5
  279. package/mobile/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  280. package/mobile/dist/ui-kit/Checkbox/CheckboxProps.d.ts +1 -0
  281. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  282. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  283. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +15 -0
  284. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlContent.js +2 -0
  285. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlContent.js.map +1 -0
  286. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  287. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  288. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  289. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +2 -9
  290. package/mobile/dist/utils/addSpacesBetweenNumbers.js +1 -1
  291. package/mobile/dist/utils/addSpacesBetweenNumbers.js.map +1 -1
  292. package/mobile/lib/components/Calculator/BonusCalculatorForm.js +2 -1
  293. package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  294. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.d.ts +5 -0
  295. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +46 -0
  296. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -0
  297. package/mobile/lib/components/Calculator/CalculatorContent.d.ts +14 -1
  298. package/mobile/lib/components/Calculator/CalculatorValueBlock.js +3 -1
  299. package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
  300. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +2 -1
  301. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  302. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +5 -15
  303. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  304. package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +3 -1
  305. package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js +2 -0
  306. package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
  307. package/mobile/lib/components/Calculator/Rate.d.ts +2 -0
  308. package/mobile/lib/components/Calculator/Rate.js +3 -1
  309. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  310. package/mobile/lib/components/Calculator/UnknownRate.d.ts +4 -0
  311. package/mobile/lib/components/Calculator/UnknownRate.js +7 -0
  312. package/mobile/lib/components/Calculator/UnknownRate.js.map +1 -0
  313. package/mobile/lib/components/Calculator/constants.d.ts +10 -0
  314. package/mobile/lib/components/Calculator/constants.js +20 -0
  315. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  316. package/mobile/lib/components/Calculator/renderCalculatorBlock.js +1 -1
  317. package/mobile/lib/components/Calculator/renderCalculatorBlock.js.map +1 -1
  318. package/mobile/lib/components/Calculator/renderDaysInput.d.ts +8 -0
  319. package/mobile/lib/components/Calculator/renderDaysInput.js +13 -0
  320. package/mobile/lib/components/Calculator/renderDaysInput.js.map +1 -0
  321. package/mobile/lib/components/Calculator/renderFootnote.js +2 -1
  322. package/mobile/lib/components/Calculator/renderFootnote.js.map +1 -1
  323. package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +2 -0
  324. package/mobile/lib/components/Calculator/renderInterestPayment.js +19 -0
  325. package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -0
  326. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +27 -0
  327. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +46 -0
  328. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  329. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
  330. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  331. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +2 -2
  332. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -1
  333. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +2 -5
  334. package/mobile/lib/components/Tabs/LinkTab.d.ts +1 -0
  335. package/mobile/lib/components/Tabs/LinkTab.js +3 -3
  336. package/mobile/lib/components/Tabs/LinkTab.js.map +1 -1
  337. package/mobile/lib/components/Tabs/ScrollableTabs.d.ts +8 -0
  338. package/mobile/lib/components/Tabs/ScrollableTabs.js +22 -0
  339. package/mobile/lib/components/Tabs/ScrollableTabs.js.map +1 -0
  340. package/mobile/lib/components/Tabs/Tabs.js +9 -2
  341. package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
  342. package/mobile/lib/components/Tabs/TabsContent.d.ts +12 -0
  343. package/mobile/lib/components/Tabs/renderGroupTab.d.ts +2 -2
  344. package/mobile/lib/components/Tabs/renderGroupTab.js +13 -5
  345. package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
  346. package/mobile/lib/components/Tabs/renderTab.d.ts +2 -1
  347. package/mobile/lib/components/Tabs/renderTab.js +4 -6
  348. package/mobile/lib/components/Tabs/renderTab.js.map +1 -1
  349. package/mobile/lib/components/Tabs/tabItemClasses.d.ts +6 -1
  350. package/mobile/lib/components/Tabs/tabItemClasses.js +58 -1
  351. package/mobile/lib/components/Tabs/tabItemClasses.js.map +1 -1
  352. package/mobile/lib/icons/IconName.d.ts +4 -2
  353. package/mobile/lib/icons/IconName.js +3 -1
  354. package/mobile/lib/icons/IconName.js.map +1 -1
  355. package/mobile/lib/setup-fixture.js +0 -1
  356. package/mobile/lib/setup-fixture.js.map +1 -1
  357. package/mobile/lib/ui-kit/Checkbox/Checkbox.js +5 -5
  358. package/mobile/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  359. package/mobile/lib/ui-kit/Checkbox/CheckboxProps.d.ts +1 -0
  360. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  361. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  362. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +15 -0
  363. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlContent.js +2 -0
  364. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlContent.js.map +1 -0
  365. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  366. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  367. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  368. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +2 -9
  369. package/mobile/lib/utils/addSpacesBetweenNumbers.js +1 -1
  370. package/mobile/lib/utils/addSpacesBetweenNumbers.js.map +1 -1
  371. package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +2 -1
  372. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +133 -0
  373. package/mobile/src/components/Calculator/CalculatorContent.ts +18 -0
  374. package/mobile/src/components/Calculator/CalculatorValueBlock.tsx +17 -5
  375. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +2 -1
  376. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +8 -21
  377. package/mobile/src/components/Calculator/EmbeddableCalcBlocks.tsx +6 -0
  378. package/mobile/src/components/Calculator/Rate.tsx +34 -12
  379. package/mobile/src/components/Calculator/UnknownRate.tsx +24 -0
  380. package/mobile/src/components/Calculator/constants.ts +23 -1
  381. package/mobile/src/components/Calculator/renderCalculatorBlock.tsx +1 -1
  382. package/mobile/src/components/Calculator/renderDaysInput.tsx +36 -0
  383. package/mobile/src/components/Calculator/renderFootnote.tsx +7 -1
  384. package/mobile/src/components/Calculator/renderInterestPayment.tsx +40 -0
  385. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +109 -0
  386. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  387. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +2 -2
  388. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +2 -5
  389. package/mobile/src/components/Tabs/LinkTab.tsx +5 -13
  390. package/mobile/src/components/Tabs/ScrollableTabs.tsx +55 -0
  391. package/mobile/src/components/Tabs/Tabs.tsx +26 -4
  392. package/mobile/src/components/Tabs/TabsContent.ts +13 -0
  393. package/mobile/src/components/Tabs/renderGroupTab.tsx +30 -20
  394. package/mobile/src/components/Tabs/renderTab.tsx +8 -5
  395. package/mobile/src/components/Tabs/tabItemClasses.ts +65 -1
  396. package/mobile/src/icons/IconName.ts +5 -5
  397. package/mobile/src/icons/PercentIcon.svg +373 -0
  398. package/mobile/src/setup-fixture.ts +0 -1
  399. package/mobile/src/ui-kit/Checkbox/Checkbox.tsx +37 -29
  400. package/mobile/src/ui-kit/Checkbox/CheckboxProps.ts +1 -0
  401. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +2 -1
  402. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlContent.ts +17 -0
  403. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +3 -2
  404. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +2 -9
  405. package/mobile/src/utils/addSpacesBetweenNumbers.ts +1 -1
  406. package/package.json +1 -1
  407. package/src/components/Calculator/BonusCalculatorForm.tsx +2 -1
  408. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +133 -0
  409. package/src/components/Calculator/Calculator.fixture.tsx +29 -0
  410. package/src/components/Calculator/CalculatorContent.ts +18 -0
  411. package/src/components/Calculator/CalculatorValueBlock.tsx +17 -5
  412. package/src/components/Calculator/CreditCalculatorForm.tsx +2 -1
  413. package/src/components/Calculator/DepositCalculatorForm.tsx +8 -21
  414. package/src/components/Calculator/EmbeddableCalcBlocks.tsx +6 -0
  415. package/src/components/Calculator/Rate.tsx +34 -12
  416. package/src/components/Calculator/UnknownRate.tsx +24 -0
  417. package/src/components/Calculator/constants.ts +23 -1
  418. package/src/components/Calculator/renderCalculatorBlock.tsx +1 -1
  419. package/src/components/Calculator/renderDaysInput.tsx +36 -0
  420. package/src/components/Calculator/renderFootnote.tsx +7 -1
  421. package/src/components/Calculator/renderInterestPayment.tsx +40 -0
  422. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +109 -0
  423. package/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
  424. package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +18 -1
  425. package/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +2 -2
  426. package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +2 -5
  427. package/src/components/Tabs/LinkTab.tsx +5 -13
  428. package/src/components/Tabs/ScrollableTabs.tsx +55 -0
  429. package/src/components/Tabs/Tabs.fixture.tsx +22 -0
  430. package/src/components/Tabs/Tabs.tsx +26 -4
  431. package/src/components/Tabs/TabsContent.ts +13 -0
  432. package/src/components/Tabs/renderGroupTab.tsx +30 -20
  433. package/src/components/Tabs/renderTab.tsx +8 -5
  434. package/src/components/Tabs/tabItemClasses.ts +65 -1
  435. package/src/icons/IconName.ts +5 -1
  436. package/src/icons/PercentIcon.svg +373 -0
  437. package/src/setup-fixture.ts +0 -1
  438. package/src/ui-kit/Checkbox/Checkbox.tsx +37 -29
  439. package/src/ui-kit/Checkbox/CheckboxProps.ts +1 -0
  440. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +2 -1
  441. package/src/ui-kit/SwipeListControl/SwipeListControlContent.ts +17 -0
  442. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +3 -2
  443. package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +2 -9
  444. package/src/utils/addSpacesBetweenNumbers.ts +1 -1
  445. package/tailwind.config.cjs +1 -0
@@ -861,9 +861,9 @@
861
861
  return isVisible ? (jsxs("div", { children: [canDec ? (jsx(ArrowButton, { className: `absolute z-50 ${btnClass[0]} ${className}`, onClick: dec, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left", disabled: !canDec })) : null, canInc ? (jsx(ArrowButton, { className: `absolute z-50 rotate-180 ${btnClass[1]} ${className}`, onClick: inc, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right", disabled: !canInc })) : null] })) : null;
862
862
  }
863
863
 
864
- const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', { maximumSignificantDigits: 3 }).format(number);
864
+ const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', {}).format(number);
865
865
 
866
- const CalculatorValueBlock = JSX(({ title, value, postfix = '', prefix, className = '' }) => (jsxs("div", { className: `mb-7 ${className}`, children: [title ? jsx("div", { className: "text-l-light text-secondary-text", children: title }) : null, value ? (jsxs("div", { className: "text-h3", children: [prefix, " ", addSpacesBetweenNumbers(Math.round(value)), " ", postfix] })) : null] })));
866
+ const CalculatorValueBlock = JSX(({ title, value, postfix = '', prefix, className = '' }) => (jsxs("div", { className: style('mb-7', className), children: [title ? (jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title })) : null, value ? (jsx("div", { children: jsxs(Text, { size: "text-h3", children: [prefix, " ", addSpacesBetweenNumbers(Math.round(value)), " ", postfix] }) })) : (jsx("div", { children: jsx(Text, { size: "text-h3", children: "-" }) }))] })));
867
867
 
868
868
  const DEFAULT_MIN_SUM = 60000;
869
869
  const DEFAULT_MAX_SUM = 2000000;
@@ -871,6 +871,13 @@
871
871
  const DEFAULT_MIN_MONTHS = 13;
872
872
  const DEFAULT_MAX_MONTHS = 60;
873
873
  const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
874
+ const BUSINESS_DEFAULT_SUM = 100000;
875
+ const BUSINESS_MIN_DAYS = 1;
876
+ const BUSINESS_MAX_DAYS = 1095;
877
+ const BUSINESS_RATE_MIN_DAYS = 30; // порог количества дней, при которых ставка не доступна
878
+ const BUSINESS_OPERATING_MIN_DAYS = 90;
879
+ const BUSINESS_OPERATING_MAX_DAYS = 730;
880
+ const BUSINESS_DEFAULT_DAYS = 90;
874
881
  const MONTHS_IN_YEAR = 12;
875
882
  const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR * 100;
876
883
  const DEFAULT_CREDIT_CALCULATOR_PARAMS = {
@@ -907,13 +914,26 @@
907
914
  rate: 5.9,
908
915
  isMonthlyInterestPayment: true,
909
916
  };
917
+ const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
918
+ minSum: 1000,
919
+ maxSum: 500000,
920
+ minDays: BUSINESS_MIN_DAYS,
921
+ maxDays: BUSINESS_MAX_DAYS,
922
+ rate: 5.9,
923
+ isMonthlyInterestPayment: true,
924
+ isReplenished: false,
925
+ isPartialWithdrawal: false,
926
+ isSmallBusiness: false,
927
+ depositeName: "Депозит 'Стабильный'",
928
+ };
910
929
  const CREDIT_CALC_DEFAULT_DIR = 'credit-calculator-data';
911
930
  const BONUS_CALC_DEFAULT_DIR = 'bonus-calculator-data';
912
931
  const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
932
+ const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
913
933
 
914
- const Rate = JSX(({ rate, title = 'Ставка', unit, rateBlockClassName }) => (jsxs("div", { children: [jsx("div", { className: "text-l-light text-secondary-text", children: title }), jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: `block gradient-color-text font-mohave text-title-huge pr-6 -mt-4 ${rateBlockClassName}`, children: String(rate).replace('.', ',') }), unit ? jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit }) : ''] })] })));
934
+ const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate).replace('.', ',') }), unit ? (jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
915
935
 
916
- const renderFootnote = (text) => text ? jsx("p", { className: "text-s-light text-secondary-text mt-7", children: text }) : null;
936
+ const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
917
937
 
918
938
  const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
919
939
 
@@ -1067,7 +1087,7 @@
1067
1087
  restExpenseValue,
1068
1088
  };
1069
1089
  const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } = useBonusCalculatorParams(userInputParams, sourceBookDir);
1070
- return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма покупок в категории путешествия, ₽', {
1090
+ return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма покупок в категории путешествия, ₽', {
1071
1091
  minSum: minSumTravel,
1072
1092
  maxSum: maxSumTravel,
1073
1093
  moneyValue: travelExpenseValue,
@@ -1095,15 +1115,118 @@
1095
1115
  fill: 'white',
1096
1116
  },
1097
1117
  ];
1098
- const Checkbox = JSX(({ className, text, checked, isRadio, onChange }) => {
1099
- return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", children: [jsx("input", { className: `peer appearance-none w-5 h-5 border-solid cursor-pointer group-hover/box:border-primary-hover
1100
- ${isRadio ? 'rounded-full border-2' : 'rounded checked:bg-primary-main border'}
1101
- ${checked ? 'border-black' : 'border-gray'}
1102
- checked:border-primary-main m-0`, type: "checkbox", onChange: (e) => onChange && onChange(e.target.checked), checked: checked }), isRadio ? (jsx("div", { className: "left-1 w-3 h-3 rounded-full bg-primary-main hidden absolute peer-checked:block" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-1 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" })), text ? jsx("span", { className: "font-sans ml-3 text-l-light", children: text }) : null] }) }));
1118
+ const Checkbox = JSX(({ className, text, checked, disabled, isRadio, onChange }) => {
1119
+ return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", children: [jsx("input", { className: style('peer appearance-none w-5 h-5 border-solid cursor-pointer checked:border-primary-main m-0', isRadio
1120
+ ? 'rounded-full border-2'
1121
+ : 'rounded checked:bg-primary-main disabled:bg-main-disabled border', checked ? 'border-black' : 'border-gray', disabled ? '' : 'group-hover/box:border-primary-hover'), type: "checkbox", onChange: (e) => onChange && onChange(e.target.checked), checked: checked, disabled: disabled }), isRadio ? (jsx("div", { className: "left-1 w-3 h-3 rounded-full bg-primary-main hidden absolute peer-checked:block" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-1 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" })), text ? jsx("span", { className: "font-sans ml-3 text-l-light", children: text }) : null] }) }));
1103
1122
  });
1104
1123
 
1124
+ const STEP_DAYS = 1;
1125
+ function renderDaysInput(title, params, callback) {
1126
+ const { minDays, maxDays, daysValue } = params;
1127
+ const daysText = (days) => {
1128
+ const text = Number(days) % 10 === 1 ? 'дня' : 'дней';
1129
+ return `${days} ${text}`;
1130
+ };
1131
+ return (jsx(InputRange, { className: "mt-7", title: title, items: [`От ${daysText(minDays)}`, `До ${daysText(maxDays)}`], min: minDays, max: maxDays, step: STEP_DAYS, value: clamp(daysValue, minDays, maxDays), onChange: callback }));
1132
+ }
1133
+
1105
1134
  const RadioButtonGroup = JSX(({ items, checkedItem, onChange: onChangeCheckedItem }) => (jsx("div", { className: "flex flex-col gap-3", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, checked: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
1106
1135
 
1136
+ const EVERY_MONTH = 'everyMonth';
1137
+ const AT_END_TERM = 'atEndTerm';
1138
+ const depositTypeItems = [
1139
+ {
1140
+ id: EVERY_MONTH,
1141
+ text: 'Ежемесячно',
1142
+ },
1143
+ {
1144
+ id: AT_END_TERM,
1145
+ text: 'В конце срока',
1146
+ },
1147
+ ];
1148
+ function renderInterestPayment(isMonthlyInterestPayment, callback, title) {
1149
+ return (jsxs("div", { children: [title ? (jsx(Text, { color: "text-secondary-text", font: "font-light", children: title })) : null, jsx("div", { className: "mt-3", children: jsx(RadioButtonGroup, { items: depositTypeItems, checkedItem: isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM, onChange: (text) => callback && callback(text === EVERY_MONTH) }) })] }));
1150
+ }
1151
+
1152
+ const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-1 pt-1 pl-5 pb-1.5", children: jsx(ImgInner, { image: { icon: 'PercentIcon' }, width: "90", height: "85", asSVG: true }) }), jsx("div", { className: "w-[250px] mt-3.5", children: jsxs(Paragraph, { size: "text-xl-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
1153
+
1154
+ const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDir) => {
1155
+ const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isSmallBusiness, isMonthlyInterestPayment, } = userInputParams;
1156
+ const data = useCalculatorParams(sourceBookDir || BUSINESS_DEPOSIT_CALC_DEFAULT_DIR);
1157
+ const isOperatingDeposit = isReplenished || isPartialWithdrawal;
1158
+ const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
1159
+ if (daysValue <= BUSINESS_RATE_MIN_DAYS) {
1160
+ return {
1161
+ ...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
1162
+ ...userInputParams,
1163
+ isDisabledOperatingDeposit,
1164
+ rate: 0,
1165
+ };
1166
+ }
1167
+ const businessDepositCalculatorSourceBookParams = data?.rows?.find((_) => {
1168
+ return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
1169
+ isSmallBusiness === _.isSmallBusiness &&
1170
+ (isOperatingDeposit
1171
+ ? _.isReplenished && _.isPartialWithdrawal
1172
+ : !_.isReplenished && !_.isPartialWithdrawal));
1173
+ }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
1174
+ const { rate } = businessDepositCalculatorSourceBookParams;
1175
+ const income = getDepositIncome$1(rate, userInputParams);
1176
+ const finalSum = moneyValue + income;
1177
+ return {
1178
+ ...businessDepositCalculatorSourceBookParams,
1179
+ ...userInputParams,
1180
+ isDisabledOperatingDeposit,
1181
+ income,
1182
+ finalSum,
1183
+ };
1184
+ };
1185
+ const getDepositIncome$1 = (rate, userInputParams) => {
1186
+ const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
1187
+ /*
1188
+ Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
1189
+ */
1190
+ if (isMonthlyInterestPayment) {
1191
+ return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, daysValue / 30) - moneyValue);
1192
+ }
1193
+ else {
1194
+ return Math.round((moneyValue * rate * daysValue) / 365 / 100);
1195
+ }
1196
+ };
1197
+
1198
+ const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
1199
+ const [moneyValue, setMoneyValue] = useState(BUSINESS_DEFAULT_SUM);
1200
+ const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1201
+ const [daysValue, setDaysValue] = useState(BUSINESS_DEFAULT_DAYS);
1202
+ const handleDaysValue = useCallback((_) => setDaysValue(_), []);
1203
+ const [isReplenished, toggleIsReplenished] = useState(false);
1204
+ const handleIsReplenished = useCallback((_) => toggleIsReplenished(_), []);
1205
+ const [isPartialWithdrawal, toggleIsPartialWithdrawal] = useState(false);
1206
+ const handleIsPartialWithdrawal = useCallback((_) => toggleIsPartialWithdrawal(_), []);
1207
+ const [isSmallBusiness, toggleIsSmallBusiness] = useState(false);
1208
+ const handleIsSmallBusiness = useCallback((_) => toggleIsSmallBusiness(_), []);
1209
+ const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
1210
+ const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
1211
+ const userInputParams = {
1212
+ moneyValue,
1213
+ daysValue,
1214
+ isReplenished,
1215
+ isPartialWithdrawal,
1216
+ isSmallBusiness,
1217
+ isMonthlyInterestPayment,
1218
+ };
1219
+ const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
1220
+ const { income, finalSum, rate, depositeName } = calculatorParams;
1221
+ return (jsxs("section", { className: className, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "w-[486px]", children: [renderWantedSumInput('Сумма вклада, ₽', calculatorParams, handleMoneyValue), renderDaysInput('Срок вклада, дни', calculatorParams, handleDaysValue), jsxs("div", { className: "mt-7 flex justify-between", children: [renderBusinessDepositParamsForm({
1222
+ ...calculatorParams,
1223
+ handleIsReplenished,
1224
+ handleIsPartialWithdrawal,
1225
+ handleIsSmallBusiness,
1226
+ }), renderInterestPayment(isMonthlyInterestPayment, handleIsMonthlyInterestPayment, 'Выплата процентов')] })] }), rate ? (jsx(Rate, { rate: rate, depositeName: depositeName, isShowDepositeName: isShowDepositeName, rateBlockClassName: "tracking-[-25px]", unit: "%" })) : (jsx(UnknownRate, {})), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), jsx("div", { className: "mt-7", children: renderFootnote(footnote) })] })] }), jsx("div", { className: "mt-5", children: renderFootnote(bottomFootnote) })] }));
1227
+ });
1228
+ const renderBusinessDepositParamsForm = ({ isDisabledOperatingDeposit, isReplenished, isPartialWithdrawal, isSmallBusiness, handleIsReplenished, handleIsPartialWithdrawal, handleIsSmallBusiness, }) => (jsxs("div", { children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: isDisabledOperatingDeposit, checked: isReplenished, onChange: handleIsReplenished }), jsx(Checkbox, { className: "mt-3", disabled: isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", checked: isPartialWithdrawal, onChange: handleIsPartialWithdrawal }), jsx(Checkbox, { className: "mt-3", text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043C\u0430\u043B\u044B\u043C \u043F\u0440\u0435\u0434\u043F\u0440\u0438\u044F\u0442\u0438\u0435\u043C", checked: isSmallBusiness, onChange: handleIsSmallBusiness })] }));
1229
+
1107
1230
  const STEP_MONTHS = 1;
1108
1231
  function renderMonthsInput(title, params, callback) {
1109
1232
  const { minMonths, maxMonths, monthsValue } = params;
@@ -1178,13 +1301,13 @@
1178
1301
  monthsValue,
1179
1302
  };
1180
1303
  const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir);
1181
- return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма кредита, ₽', { ...calculatorParams, step: 500 }, handleMoneyValue), renderMonthsInput('Срок кредита, месяцев', calculatorParams, handleMonthsValue), jsxs("div", { className: "mt-7", children: [jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", checked: isSalaryClient, onChange: toggleIsSalaryClient }), jsx(Checkbox, { className: "mt-3", text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", checked: isStateEmployee, onChange: toggleIsStateEmployee }), jsx(Checkbox, { className: "mt-3", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsurance, onChange: toggleIsInsurance })] })] }), jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: calculatorParams.finalRate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: isAnnuity ? 'Ежемесячный платеж' : 'Платёж в первый месяц', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), jsx(RadioButtonGroup, { items: paymentTypeItems, checkedItem: isAnnuity ? ANNUITY : DIFFERENTIAL, onChange: (text) => toggleIsAnnuity(text === ANNUITY) }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1304
+ return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма кредита, ₽', { ...calculatorParams, step: 500 }, handleMoneyValue), renderMonthsInput('Срок кредита, месяцев', calculatorParams, handleMonthsValue), jsxs("div", { className: "mt-7", children: [jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", checked: isSalaryClient, onChange: toggleIsSalaryClient }), jsx(Checkbox, { className: "mt-3", text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", checked: isStateEmployee, onChange: toggleIsStateEmployee }), jsx(Checkbox, { className: "mt-3", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsurance, onChange: toggleIsInsurance })] })] }), jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: calculatorParams.finalRate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: isAnnuity ? 'Ежемесячный платеж' : 'Платёж в первый месяц', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), jsx(RadioButtonGroup, { items: paymentTypeItems, checkedItem: isAnnuity ? ANNUITY : DIFFERENTIAL, onChange: (text) => toggleIsAnnuity(text === ANNUITY) }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1182
1305
  });
1183
1306
 
1184
1307
  const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
1185
1308
  const { isMonthlyInterestPayment, moneyValue } = userInputParams;
1186
1309
  const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
1187
- const depositCalculatorSourceBookParams = data?.rows.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment) ||
1310
+ const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment) ||
1188
1311
  DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
1189
1312
  const { rate } = depositCalculatorSourceBookParams;
1190
1313
  const income = getDepositIncome(rate, userInputParams);
@@ -1204,23 +1327,12 @@
1204
1327
  }
1205
1328
  };
1206
1329
 
1207
- const EVERY_MONTH = 'everyMonth';
1208
- const AT_END_TERM = 'atEndTerm';
1209
- const depositTypeItems = [
1210
- {
1211
- id: EVERY_MONTH,
1212
- text: 'Ежемесячно',
1213
- },
1214
- {
1215
- id: AT_END_TERM,
1216
- text: 'В конце срока',
1217
- },
1218
- ];
1219
1330
  const DepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote }) => {
1220
1331
  const [moneyValue, setMoneyValue] = useState(DEFAULT_SUM);
1221
1332
  const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1222
1333
  const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
1223
1334
  const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
1335
+ const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
1224
1336
  const userInputParams = {
1225
1337
  moneyValue,
1226
1338
  monthsValue,
@@ -1229,16 +1341,17 @@
1229
1341
  const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
1230
1342
  const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir);
1231
1343
  const { income, finalSum, rate } = calculatorParams;
1232
- return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма вклада, ₽', {
1344
+ return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма вклада, ₽', {
1233
1345
  ...calculatorParams,
1234
1346
  }, handleMoneyValue), renderMonthsInput('Срок вклада, месяцев', {
1235
1347
  ...calculatorParams,
1236
- }, handleMonthsValue)] }), jsx(Rate, { rate: rate || 1, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [income ? (jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" })) : null, finalSum ? (jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" })) : null, jsx(RadioButtonGroup, { items: depositTypeItems, checkedItem: isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM, onChange: (text) => toggleIsMonthlyInterestPayment(text === EVERY_MONTH) }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1348
+ }, handleMonthsValue)] }), jsx(Rate, { rate: rate || 1, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [income ? (jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" })) : null, finalSum ? (jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" })) : null, renderInterestPayment(isMonthlyInterestPayment, handleIsMonthlyInterestPayment), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
1237
1349
  });
1238
1350
 
1239
1351
  const EmbeddableCalcBlocks = {
1240
1352
  CreditCalculatorForm,
1241
1353
  DepositCalculatorForm,
1354
+ BusinessDepositCalculatorForm,
1242
1355
  BonusCalculatorForm,
1243
1356
  };
1244
1357
 
@@ -1248,7 +1361,7 @@
1248
1361
  return null;
1249
1362
  }
1250
1363
  const EmbeddedBlock = EmbeddableCalcBlocks[type];
1251
- return (jsx("section", { className: "box-border relative bg-white flex shrink-0 self-start basis-full", role: "listitem", children: jsxs("div", { className: "box-border p-9 w-full", children: [block?.title ? jsx(Heading, { className: "text-center mb-6", title: block.title }) : null, jsx(EmbeddedBlock, { ...block, className: "flex justify-between" })] }) }, String(i)));
1364
+ return (jsx("section", { className: "box-border relative bg-white flex shrink-0 self-start basis-full", role: "listitem", children: jsxs("div", { className: "box-border p-9 w-full", children: [block?.title ? jsx(Heading, { className: "text-center mb-6", title: block.title }) : null, jsx(EmbeddedBlock, { ...block })] }) }, String(i)));
1252
1365
  };
1253
1366
 
1254
1367
  const Calculator = JSX(({ className = '', calculatorTabs = [], ...rest }) => {
@@ -1493,7 +1606,7 @@
1493
1606
 
1494
1607
  const ITEMS_GAP = 4;
1495
1608
  const blurBaseStyle = 'absolute top-0 bottom-0 z-50 w-[84px] pointer-events-none';
1496
- const scrollButtonStyle = 'absolute top-[calc(50%-12px)] z-50';
1609
+ const scrollButtonStyle$1 = 'absolute top-[calc(50%-12px)] z-50';
1497
1610
  const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, isPadding = true, ...rest }) => {
1498
1611
  const { blocks: childBlocks } = rest.block || {};
1499
1612
  const count = itemCount || childBlocks?.length || 0;
@@ -1513,7 +1626,7 @@
1513
1626
  'CarouselTariffsCard',
1514
1627
  'CarouselInvestmentCard',
1515
1628
  ];
1516
- const renderScrollButtons = ({ scrollLeft, scrollRight, canScrollLeft, canScrollRight, }) => (jsxs("div", { children: [canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle} left-8`, onClick: scrollLeft })) : null, canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle} right-8`, onClick: scrollRight })) : null] }));
1629
+ const renderScrollButtons = ({ scrollLeft, scrollRight, canScrollLeft, canScrollRight, }) => (jsxs("div", { children: [canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle$1} left-8`, onClick: scrollLeft })) : null, canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle$1} right-8`, onClick: scrollRight })) : null] }));
1517
1630
  const getPaddingStyle = (isPadding) => (isPadding ? 'p-12' : '');
1518
1631
 
1519
1632
  const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
@@ -3486,7 +3599,7 @@
3486
3599
  'horizontal-list': 'w-6',
3487
3600
  'vertical-list': 'h-6',
3488
3601
  };
3489
- const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300';
3602
+ const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300 group-data-secondary:bg-white';
3490
3603
  const inactiveDotStyle = 'w-2 h-2 opacity-30';
3491
3604
  const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list' }) => {
3492
3605
  const handleClick = (idx) => {
@@ -3517,68 +3630,147 @@
3517
3630
  return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
3518
3631
  });
3519
3632
 
3520
- const SwipeListControlBlock = JSX(({ gap, listType, padding, showDots, options, ...rest }) => {
3521
- return (jsx(BlockWrapper, { ...rest, children: jsx(SwipeListControl, { gap: gap, listType: listType, padding: padding, showDots: showDots, children: renderChildren({ ...rest, options }) }) }));
3633
+ const SwipeListControlBlock = JSX(({ listType, showDots, options, ...rest }) => {
3634
+ return (jsx(BlockWrapper, { ...rest, children: jsx(SwipeListControl, { listType: listType, showDots: showDots, children: renderChildren({ ...rest, options }) }) }));
3522
3635
  });
3523
3636
  SwipeListControlBlock.childrenTypes = {
3524
3637
  exclude: ['SwipeListControlBlock'],
3525
3638
  };
3526
3639
 
3527
3640
  const LINK_CLASSES = 'h-12 flex-1 flex items-center justify-center cursor-pointer';
3528
- const ACTIVE_LINK_CLASSES = 'bg-primary-main';
3529
3641
  const INACTIVE_LINK_CLASSES = 'group/btn bg-white';
3530
- const TEXT_CLASSES = 'font-sans text-m';
3642
+ const SCROLLABLE_ACTIVE_LINK_CLASSES = 'bg-white text-primary-main';
3643
+ const WIDESCREEN_ACTIVE_LINK_CLASSES = 'bg-primary-main text-white';
3644
+ const TEXT_CLASSES = 'font-sans text-m text-center';
3531
3645
  const ACTIVE_TEXT_CLASSES = 'text-white';
3532
3646
  const INACTIVE_TEXT_CLASSES = 'text-secondary-text group-hover/btn:text-primary-main';
3647
+ const WHITE_ACTIVE_TEXT_CLASSES = 'text-primary-main';
3648
+ const GROUP_TAB_CLASSES = {
3649
+ div: {
3650
+ scrollable: {
3651
+ active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
3652
+ default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
3653
+ },
3654
+ default: {
3655
+ active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
3656
+ default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES} whitespace-nowrap`,
3657
+ },
3658
+ },
3659
+ text: {
3660
+ scrollable: {
3661
+ active: `h-full border-0 border-b-2`,
3662
+ default: ``,
3663
+ },
3664
+ default: {
3665
+ active: '',
3666
+ default: '',
3667
+ },
3668
+ },
3669
+ };
3670
+ const LINK_TAB_CLASSES = {
3671
+ link: {
3672
+ scrollable: {
3673
+ active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
3674
+ default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
3675
+ },
3676
+ default: {
3677
+ active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES}`,
3678
+ default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
3679
+ },
3680
+ },
3681
+ text: {
3682
+ scrollable: {
3683
+ active: `${TEXT_CLASSES} flex items-center h-full border-0 border-b-2 ${WHITE_ACTIVE_TEXT_CLASSES}`,
3684
+ default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
3685
+ },
3686
+ default: {
3687
+ active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES}`,
3688
+ default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
3689
+ },
3690
+ },
3691
+ };
3692
+ const getGroupTabClassName = (type, active, isScrollable) => {
3693
+ const styleType = isScrollable ? 'scrollable' : 'default';
3694
+ const styleActive = active ? 'active' : 'default';
3695
+ return GROUP_TAB_CLASSES[type][styleType][styleActive];
3696
+ };
3697
+ const getLinkTabClassName = (type, active, isScrollable) => {
3698
+ const styleType = isScrollable ? 'scrollable' : 'default';
3699
+ const styleActive = active ? 'active' : 'default';
3700
+ return LINK_TAB_CLASSES[type][styleType][styleActive];
3701
+ };
3533
3702
 
3534
3703
  const LinkTab = JSX((props) => {
3535
- const { tab, currentTab } = props;
3704
+ const { tab, currentTab, isScrollable = false } = props;
3536
3705
  const active = currentTab?.type === 'link' && currentTab.href === tab.href;
3537
3706
  const link = useLink();
3538
3707
  const adjustedProps = link(tab);
3539
- return (jsx("a", { role: "tab", className: `${LINK_CLASSES} ${active ? ACTIVE_LINK_CLASSES : INACTIVE_LINK_CLASSES}`, target: tab.target, href: adjustedProps.href, onClick: adjustedProps.onClick, children: jsx("span", { className: `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`, children: tab.text }) }));
3708
+ return (jsx("a", { role: "tab", className: getLinkTabClassName('link', active, isScrollable), target: tab.target, href: adjustedProps.href, onClick: adjustedProps.onClick, children: jsx("span", { className: getLinkTabClassName('text', active, isScrollable), children: tab.text }) }));
3540
3709
  });
3541
3710
 
3542
3711
  const BADGE_CLASSES = 'min-w-[22px] h-[22px] rounded-full text-xs ml-2 flex justify-center items-center';
3543
3712
  const ACTIVE_BADGE_CLASSES = 'bg-white/30 text-white';
3544
3713
  const INACTIVE_BADGE_CLASSES = 'bg-main-divider text-secondary-text group-hover/btn:text-primary-main';
3545
- const renderGroupTab = ({ page, currentTab, showCounter, onClick }) => (tab, i) => {
3714
+ const renderGroupTab = ({ page, currentTab, showCounter, onClick, isScrollable = false }) => (tab, i) => {
3546
3715
  const active = currentTab === tab;
3547
3716
  const count = tab.ref && page?.blocks
3548
3717
  ? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
3549
3718
  : 0;
3550
- return (jsx("div", { className: `${LINK_CLASSES} ${active ? ACTIVE_LINK_CLASSES : INACTIVE_LINK_CLASSES}`, role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: "flex flex-1 items-center justify-center", children: [tab?.title ? renderTitle$2(tab.title, active) : null, showCounter && count ? renderCount(count, active) : null] }) }, String(i)));
3719
+ return (jsx("div", { className: getGroupTabClassName('div', active, isScrollable), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: `flex flex-1 items-center justify-center ${getGroupTabClassName('text', active, isScrollable)}`, children: [renderTitle$2(tab.title, active, isScrollable), renderCount(showCounter, count, active)] }) }, `group-${String(i)}`));
3720
+ };
3721
+ const renderTitle$2 = (title, active, isScrollable) => {
3722
+ const activeClassName = active ? WHITE_ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES;
3723
+ const titleClassName = isScrollable
3724
+ ? `${TEXT_CLASSES} ${activeClassName}`
3725
+ : `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`;
3726
+ return title ? jsx("h3", { className: titleClassName, children: title }) : null;
3727
+ };
3728
+ const renderCount = (showCounter, count, active) => {
3729
+ return showCounter && count ? (jsx("div", { className: `${BADGE_CLASSES} ${active ? ACTIVE_BADGE_CLASSES : INACTIVE_BADGE_CLASSES}`, children: count })) : null;
3551
3730
  };
3552
- const renderTitle$2 = (title, active) => (jsx("h3", { className: `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`, children: title }));
3553
- const renderCount = (count, active) => (jsx("div", { className: `${BADGE_CLASSES} ${active ? ACTIVE_BADGE_CLASSES : INACTIVE_BADGE_CLASSES}`, children: count }));
3554
3731
 
3555
- const renderTab = ({ page, currentTab, showCounter, onClick }) =>
3556
- // Linter doesn't understand that switch processes all cases
3557
- // eslint-disable-next-line consistent-return
3558
- (tab, i) => {
3732
+ const renderTab = ({ page, currentTab, showCounter, onClick, isScrollable = false }) => (tab, i) => {
3559
3733
  const type = tab.type;
3560
3734
  if (!(type === 'group' || type === 'link')) {
3561
3735
  return null;
3562
3736
  }
3563
3737
  switch (type) {
3564
3738
  case 'group':
3565
- return renderGroupTab({ page, currentTab, showCounter, onClick })(tab, i);
3739
+ return renderGroupTab({ page, currentTab, showCounter, onClick, isScrollable })(tab, i);
3566
3740
  case 'link': {
3567
- return jsx(LinkTab, { tab: tab, currentTab: currentTab }, String(i));
3741
+ return (jsx(LinkTab, { tab: tab, currentTab: currentTab, isScrollable: isScrollable }, String(i)));
3568
3742
  }
3569
3743
  default:
3570
3744
  assertUnreachable(type);
3571
3745
  }
3746
+ return null;
3572
3747
  };
3573
3748
 
3749
+ const scrollButtonStyle = 'absolute z-50 top-0';
3750
+ const ScrollableTabs = JSX((props) => {
3751
+ const { tabs, onClick, currentTab, page, showCounter } = props;
3752
+ const [containerRef, scroll] = useSwipeListScroll({
3753
+ itemCount: tabs?.length || 0,
3754
+ isCyclic: false,
3755
+ });
3756
+ return (jsxs("div", { className: "relative max-w-full m-auto", children: [jsx("div", { className: `font-sans max-w-full w-full overflow-hidden relative bg-white`, children: jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: tabs?.map(renderTab({
3757
+ onClick,
3758
+ currentTab,
3759
+ showCounter,
3760
+ page,
3761
+ isScrollable: true,
3762
+ })) }) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle} left-6`, onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle} rotate-180 right-6`, onClick: scroll.scrollRight })) : null] }));
3763
+ });
3764
+
3574
3765
  const Tabs = JSX((props) => {
3575
- const { className = '', tabs, showCounter, isSticky, ...rest } = props;
3766
+ const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
3576
3767
  const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
3577
3768
  useEffect(() => EventBus.inst.subscribe('tab', (event) => {
3578
3769
  const tab = tabs?.find(checkTab(event));
3579
3770
  if (event.type === 'link' && tab) {
3580
3771
  setCurrentTab(tab);
3581
3772
  }
3773
+ return [];
3582
3774
  }), [tabs]);
3583
3775
  useEffect(() => currentTab?.type === 'group'
3584
3776
  ? EventBus.inst.subject('tab', { label: currentTab.ref })
@@ -3589,7 +3781,12 @@
3589
3781
  }
3590
3782
  setCurrentTab(selectedTab);
3591
3783
  }, []);
3592
- return (jsx(BlockWrapper, { className: `${isSticky ? 'sticky top-1 z-20 ' : ''}box-border flex gap-x-1 ${className}`, role: "tablist", ...rest, children: tabs?.map(renderTab({ onClick: handleClick, currentTab, showCounter, ...rest })) }));
3784
+ return (jsx(BlockWrapper, { className: `relative box-border flex gap-x-1 w-full ${isSticky ? 'sticky top-1 z-20 ' : ''} ${className}`, role: "tablist", ...rest, children: tabsMode === 'scrollable' ? (jsx(ScrollableTabs, { tabs: tabs, onClick: handleClick, currentTab: currentTab, showCounter: showCounter, ...rest })) : (tabs?.map(renderTab({
3785
+ onClick: handleClick,
3786
+ currentTab,
3787
+ showCounter,
3788
+ ...rest,
3789
+ }))) }));
3593
3790
  });
3594
3791
  const checkTab = (event) => (_) => _.type === 'link' && _.href === `#${event.label}`;
3595
3792
 
@@ -4001,7 +4198,7 @@
4001
4198
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
4002
4199
  }
4003
4200
 
4004
- const packageVersion = "0.7.4";
4201
+ const packageVersion = "0.7.6";
4005
4202
 
4006
4203
  exports.Blocks = Blocks;
4007
4204
  exports.ContentPage = ContentPage;