@redneckz/wildless-cms-uni-blocks 0.13.4 → 0.13.5

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 (223) hide show
  1. package/bin/migration-scripts/0.13.4.js +30 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +110 -85
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Carousel/CarouselContent.d.ts +6 -0
  6. package/bundle/components/Carousel/renderCarouselCards.d.ts +3 -1
  7. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
  8. package/bundle/ui-kit/Input/InputProps.d.ts +1 -0
  9. package/bundle/ui-kit/List/ListContent.d.ts +2 -2
  10. package/bundle/ui-kit/Select/Select.d.ts +1 -0
  11. package/dist/components/ApplicationForm/ApplicationFormCredit.js +2 -1
  12. package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  13. package/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
  14. package/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  15. package/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  16. package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  17. package/dist/components/ApplicationForm/renderCreditParameters.js +1 -1
  18. package/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  19. package/dist/components/ApplicationForm/renderRegion.js +1 -1
  20. package/dist/components/ApplicationForm/renderRegion.js.map +1 -1
  21. package/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
  22. package/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  23. package/dist/components/Carousel/Carousel.js +2 -2
  24. package/dist/components/Carousel/Carousel.js.map +1 -1
  25. package/dist/components/Carousel/CarouselContent.d.ts +6 -0
  26. package/dist/components/Carousel/renderCarouselCards.d.ts +3 -1
  27. package/dist/components/Carousel/renderCarouselCards.js +12 -3
  28. package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
  29. package/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  30. package/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
  31. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
  32. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +1 -1
  33. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -1
  34. package/dist/components/Headline/headlineVersionStyles.js +1 -1
  35. package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  36. package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  37. package/dist/ui-kit/Input/Input.js +2 -2
  38. package/dist/ui-kit/Input/Input.js.map +1 -1
  39. package/dist/ui-kit/Input/InputProps.d.ts +1 -0
  40. package/dist/ui-kit/List/List.js +2 -0
  41. package/dist/ui-kit/List/List.js.map +1 -1
  42. package/dist/ui-kit/List/ListContent.d.ts +2 -2
  43. package/dist/ui-kit/List/ListItem.js +1 -0
  44. package/dist/ui-kit/List/ListItem.js.map +1 -1
  45. package/dist/ui-kit/Select/Select.d.ts +1 -0
  46. package/dist/ui-kit/Select/Select.js +18 -4
  47. package/dist/ui-kit/Select/Select.js.map +1 -1
  48. package/lib/common.css +1 -1
  49. package/lib/components/ApplicationForm/ApplicationFormCredit.js +2 -1
  50. package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  51. package/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
  52. package/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  53. package/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  54. package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  55. package/lib/components/ApplicationForm/renderCreditParameters.js +1 -1
  56. package/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  57. package/lib/components/ApplicationForm/renderRegion.js +1 -1
  58. package/lib/components/ApplicationForm/renderRegion.js.map +1 -1
  59. package/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
  60. package/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  61. package/lib/components/Carousel/Carousel.js +2 -2
  62. package/lib/components/Carousel/Carousel.js.map +1 -1
  63. package/lib/components/Carousel/CarouselContent.d.ts +6 -0
  64. package/lib/components/Carousel/renderCarouselCards.d.ts +3 -1
  65. package/lib/components/Carousel/renderCarouselCards.js +12 -3
  66. package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
  67. package/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  68. package/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
  69. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
  70. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +1 -1
  71. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -1
  72. package/lib/components/Headline/headlineVersionStyles.js +1 -1
  73. package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  74. package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  75. package/lib/ui-kit/Input/Input.js +2 -2
  76. package/lib/ui-kit/Input/Input.js.map +1 -1
  77. package/lib/ui-kit/Input/InputProps.d.ts +1 -0
  78. package/lib/ui-kit/List/List.js +2 -0
  79. package/lib/ui-kit/List/List.js.map +1 -1
  80. package/lib/ui-kit/List/ListContent.d.ts +2 -2
  81. package/lib/ui-kit/List/ListItem.js +1 -0
  82. package/lib/ui-kit/List/ListItem.js.map +1 -1
  83. package/lib/ui-kit/Select/Select.d.ts +1 -0
  84. package/lib/ui-kit/Select/Select.js +19 -5
  85. package/lib/ui-kit/Select/Select.js.map +1 -1
  86. package/mobile/bundle/bundle.umd.js +111 -22
  87. package/mobile/bundle/bundle.umd.min.js +1 -1
  88. package/mobile/bundle/components/Carousel/CarouselContent.d.ts +6 -0
  89. package/mobile/bundle/components/Carousel/renderCarouselCards.d.ts +3 -1
  90. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
  91. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +1 -0
  92. package/mobile/bundle/ui-kit/List/ListContent.d.ts +2 -2
  93. package/mobile/bundle/ui-kit/Select/Select.d.ts +1 -0
  94. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +2 -1
  95. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  96. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
  97. package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  98. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  99. package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  100. package/mobile/dist/components/ApplicationForm/renderCreditParameters.js +1 -1
  101. package/mobile/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  102. package/mobile/dist/components/ApplicationForm/renderRegion.js +1 -1
  103. package/mobile/dist/components/ApplicationForm/renderRegion.js.map +1 -1
  104. package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
  105. package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  106. package/mobile/dist/components/Carousel/Carousel.js +2 -2
  107. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  108. package/mobile/dist/components/Carousel/CarouselContent.d.ts +6 -0
  109. package/mobile/dist/components/Carousel/renderCarouselCards.d.ts +3 -1
  110. package/mobile/dist/components/Carousel/renderCarouselCards.js +12 -3
  111. package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
  112. package/mobile/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  113. package/mobile/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
  114. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
  115. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  116. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  117. package/mobile/dist/components/Footer/buttonSizeStyles.js +1 -1
  118. package/mobile/dist/components/Headline/headlineVersionStyles.js +1 -1
  119. package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  120. package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  121. package/mobile/dist/ui-kit/Input/Input.js +2 -2
  122. package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
  123. package/mobile/dist/ui-kit/Input/InputProps.d.ts +1 -0
  124. package/mobile/dist/ui-kit/List/List.js +2 -0
  125. package/mobile/dist/ui-kit/List/List.js.map +1 -1
  126. package/mobile/dist/ui-kit/List/ListContent.d.ts +2 -2
  127. package/mobile/dist/ui-kit/List/ListItem.js +1 -0
  128. package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
  129. package/mobile/dist/ui-kit/Select/Select.d.ts +1 -0
  130. package/mobile/dist/ui-kit/Select/Select.js +18 -4
  131. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  132. package/mobile/lib/common.css +1 -1
  133. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +2 -1
  134. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  135. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
  136. package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
  137. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
  138. package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
  139. package/mobile/lib/components/ApplicationForm/renderCreditParameters.js +1 -1
  140. package/mobile/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
  141. package/mobile/lib/components/ApplicationForm/renderRegion.js +1 -1
  142. package/mobile/lib/components/ApplicationForm/renderRegion.js.map +1 -1
  143. package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
  144. package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
  145. package/mobile/lib/components/Carousel/Carousel.js +2 -2
  146. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  147. package/mobile/lib/components/Carousel/CarouselContent.d.ts +6 -0
  148. package/mobile/lib/components/Carousel/renderCarouselCards.d.ts +3 -1
  149. package/mobile/lib/components/Carousel/renderCarouselCards.js +12 -3
  150. package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
  151. package/mobile/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  152. package/mobile/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
  153. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
  154. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  155. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  156. package/mobile/lib/components/Footer/buttonSizeStyles.js +1 -1
  157. package/mobile/lib/components/Headline/headlineVersionStyles.js +1 -1
  158. package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  159. package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  160. package/mobile/lib/ui-kit/Input/Input.js +2 -2
  161. package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
  162. package/mobile/lib/ui-kit/Input/InputProps.d.ts +1 -0
  163. package/mobile/lib/ui-kit/List/List.js +2 -0
  164. package/mobile/lib/ui-kit/List/List.js.map +1 -1
  165. package/mobile/lib/ui-kit/List/ListContent.d.ts +2 -2
  166. package/mobile/lib/ui-kit/List/ListItem.js +1 -0
  167. package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
  168. package/mobile/lib/ui-kit/Select/Select.d.ts +1 -0
  169. package/mobile/lib/ui-kit/Select/Select.js +19 -5
  170. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  171. package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +2 -1
  172. package/mobile/src/components/ApplicationForm/PhoneInputControl.tsx +1 -0
  173. package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +1 -1
  174. package/mobile/src/components/ApplicationForm/renderCreditParameters.tsx +2 -2
  175. package/mobile/src/components/ApplicationForm/renderRegion.tsx +1 -0
  176. package/mobile/src/components/ApplicationForm/renderRegionDepartment.tsx +1 -0
  177. package/mobile/src/components/Carousel/Carousel.example.json +2 -1
  178. package/mobile/src/components/Carousel/Carousel.tsx +2 -1
  179. package/mobile/src/components/Carousel/CarouselContent.ts +7 -0
  180. package/mobile/src/components/Carousel/renderCarouselCards.tsx +20 -4
  181. package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  182. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +7 -7
  183. package/mobile/src/components/Footer/buttonSizeStyles.ts +1 -1
  184. package/mobile/src/components/Headline/headlineVersionStyles.ts +1 -1
  185. package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  186. package/mobile/src/ui-kit/Input/Input.tsx +2 -0
  187. package/mobile/src/ui-kit/Input/InputProps.ts +1 -0
  188. package/mobile/src/ui-kit/List/List.tsx +2 -0
  189. package/mobile/src/ui-kit/List/ListContent.ts +2 -2
  190. package/mobile/src/ui-kit/List/ListItem.tsx +1 -0
  191. package/mobile/src/ui-kit/Select/Select.tsx +46 -12
  192. package/package.json +1 -1
  193. package/src/components/ApplicationForm/ApplicationFormCredit.tsx +2 -1
  194. package/src/components/ApplicationForm/PhoneInputControl.tsx +1 -0
  195. package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +1 -1
  196. package/src/components/ApplicationForm/renderCreditParameters.tsx +2 -2
  197. package/src/components/ApplicationForm/renderRegion.tsx +1 -0
  198. package/src/components/ApplicationForm/renderRegionDepartment.tsx +1 -0
  199. package/src/components/Carousel/Carousel.example.json +2 -1
  200. package/src/components/Carousel/Carousel.fixture.tsx +2 -0
  201. package/src/components/Carousel/Carousel.tsx +2 -1
  202. package/src/components/Carousel/CarouselContent.ts +7 -0
  203. package/src/components/Carousel/renderCarouselCards.tsx +20 -4
  204. package/src/components/CarouselLinks/CarouselLinks.fixture.tsx +12 -9
  205. package/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  206. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +1 -1
  207. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.tsx +7 -7
  208. package/src/components/Headline/headlineVersionStyles.ts +1 -1
  209. package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  210. package/src/ui-kit/Input/Input.tsx +2 -0
  211. package/src/ui-kit/Input/InputProps.ts +1 -0
  212. package/src/ui-kit/List/List.tsx +2 -0
  213. package/src/ui-kit/List/ListContent.ts +2 -2
  214. package/src/ui-kit/List/ListItem.tsx +1 -0
  215. package/src/ui-kit/Select/Select.tsx +46 -12
  216. package/bundle/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
  217. package/dist/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
  218. package/dist/components/Footer/buttonSizeStyles.mobile.js +0 -7
  219. package/dist/components/Footer/buttonSizeStyles.mobile.js.map +0 -1
  220. package/lib/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
  221. package/lib/components/Footer/buttonSizeStyles.mobile.js +0 -5
  222. package/lib/components/Footer/buttonSizeStyles.mobile.js.map +0 -1
  223. package/src/components/Footer/buttonSizeStyles.mobile.ts +0 -6
@@ -685,7 +685,7 @@
685
685
  };
686
686
  };
687
687
 
688
- const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, }) => {
688
+ const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, }) => {
689
689
  const handleChange = useCallback((e) => {
690
690
  onChange && onChange(e.target?.value || '');
691
691
  }, [onChange]);
@@ -693,7 +693,7 @@
693
693
  const validStyle = valid
694
694
  ? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
695
695
  : 'border-error';
696
- return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
696
+ return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern, autoFocus: autoFocus }, key)] }), children] }));
697
697
  });
698
698
 
699
699
  const InputControl = JSX(({ className, label, value = '', error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
@@ -717,7 +717,7 @@
717
717
  return (jsx(Input, { onChange: handleChange, onFocus: (event) => handleChange(event?.target?.value || ''), ...inputProps, children: children }));
718
718
  });
719
719
 
720
- const PhoneInputControl = JSX(({ className, label, value, error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(PhoneInput, { "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
720
+ const PhoneInputControl = JSX(({ className, label, value, error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(PhoneInput, { "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
721
721
 
722
722
  const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
723
723
 
@@ -776,6 +776,70 @@
776
776
  return targetRef;
777
777
  }
778
778
 
779
+ const JARO_WINKLER_P = 0.1;
780
+ const JARO_WINKLER_MAX_L = 4;
781
+ const jaroWinklerDistance = (s1) => (s2) => {
782
+ if (s1 === s2) {
783
+ return 1;
784
+ }
785
+ if (!s1 || !s2) {
786
+ return 0;
787
+ }
788
+ const { m, s1Matches, s2Matches } = computeM(s1, s2);
789
+ if (m === 0) {
790
+ return 0;
791
+ }
792
+ const t = computeT(s1, s2, { s1Matches, s2Matches });
793
+ const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
794
+ const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
795
+ return jaroWeight + winklerWeight * (1 - jaroWeight);
796
+ };
797
+ function computeM(s1, s2) {
798
+ const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
799
+ const s1Matches = new Array(s1.length);
800
+ const s2Matches = new Array(s2.length);
801
+ let m = 0;
802
+ for (let i = 0; i < s1.length; i++) {
803
+ const low = Math.max(0, i - range);
804
+ const high = Math.min(i + range, s2.length - 1);
805
+ for (let j = low; j <= high; j++) {
806
+ if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
807
+ continue;
808
+ }
809
+ m++;
810
+ s1Matches[i] = true;
811
+ s2Matches[j] = true;
812
+ }
813
+ }
814
+ return { m, s1Matches, s2Matches };
815
+ }
816
+ function computeT(s1, s2, { s1Matches, s2Matches }) {
817
+ let t = 0;
818
+ for (let i = 0, k = 0; i < s1.length; i++) {
819
+ if (!s1Matches[i]) {
820
+ continue;
821
+ }
822
+ let j = k;
823
+ for (; j < s2.length; j++) {
824
+ if (s2Matches[j]) {
825
+ k = j + 1;
826
+ break;
827
+ }
828
+ }
829
+ if (s1[i] !== s2[j]) {
830
+ t++;
831
+ }
832
+ }
833
+ return t;
834
+ }
835
+ function computePrefixL(s1, s2) {
836
+ let prefixL = 0;
837
+ while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
838
+ prefixL++;
839
+ }
840
+ return prefixL;
841
+ }
842
+
779
843
  const svgUseStyleMap = {
780
844
  normal: '',
781
845
  color: 'text-primary-main',
@@ -796,16 +860,28 @@
796
860
  const getSvgSize = (width) => (width ? '' : 'w-full h-full');
797
861
  const Background = JSX(({ className, children }) => className ? jsx("div", { className: className, children: children }) : children);
798
862
 
799
- const Select = JSX(({ className = '', label, options = [], value, valid = true, isBorder = true, placeholder = '', onChange, }) => {
863
+ const Select = JSX(({ className = '', label, options = [], value, valid = true, isBorder = true, placeholder = '', onChange, isSearch = false, }) => {
800
864
  const [isOpen, { setFalse: close, toggle }] = useBool();
801
- const wrapperRef = useOutsideClick(close);
802
- const handleChange = useCallback((option) => {
865
+ const [searchValue, setSearchValue] = useState('');
866
+ const reset = useCallback(() => {
803
867
  close();
868
+ setSearchValue('');
869
+ }, []);
870
+ const wrapperRef = useOutsideClick(reset);
871
+ const handleChange = useCallback((option) => {
872
+ reset();
804
873
  onChange && onChange(option);
805
874
  }, [onChange]);
806
875
  const isSelected = (option) => option.key === value?.key;
807
- return (jsxs("div", { className: className, ref: wrapperRef, children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null, jsxs("div", { className: style('relative', isOpen ? 'z-20' : 'z-10'), children: [jsxs("div", { className: style('text-l flex justify-between items-center text-primary-text cursor-pointer', getBorderStyle(isBorder, valid)), onClick: toggle, children: [jsx("p", { className: "p-m pr-3xl h-14 overflow-hidden text-ellipsis whitespace-nowrap", children: formatOption(value) || placeholder }), jsx(Icon, { className: style('absolute right-3', isOpen ? '' : 'rotate-180'), name: "ArrowUpIcon", width: "16", height: "16" })] }), options?.length ? (jsx("div", { className: style('h-0', isOpen ? '' : 'overflow-hidden'), children: jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: options.map(renderOption(handleChange, isOpen, isSelected)) }) })) : null] })] }));
876
+ return (jsxs("div", { className: className, ref: wrapperRef, children: [renderLabel(label), jsxs("div", { className: style('relative', isOpen ? 'z-20' : 'z-10'), children: [jsxs("div", { className: style('text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10', getBorderStyle(isBorder, valid)), onClick: toggle, children: [jsx("p", { className: "p-m pr-3xl h-14 overflow-hidden text-ellipsis whitespace-nowrap", children: formatOption(value) || placeholder }), jsx(Icon, { className: style('absolute right-3', isOpen ? '' : 'rotate-180'), name: "ArrowUpIcon", width: "16", height: "16" })] }), isSearch ? renderSearch(isOpen, searchValue, setSearchValue) : null, options?.length ? (jsx("div", { className: style('h-0', isOpen ? '' : 'overflow-hidden'), children: jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: getFilteredOptions(options, searchValue).map(renderOption(handleChange, isOpen, isSelected)) }) })) : null] })] }));
808
877
  });
878
+ const renderLabel = (label) => label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null;
879
+ const getFilteredOptions = (options, searchValue) => {
880
+ return searchValue
881
+ ? options.filter((_) => jaroWinklerDistance(_.text?.toLowerCase())(searchValue.toLowerCase()) >= 0.6)
882
+ : options;
883
+ };
884
+ const renderSearch = (isOpen, searchValue, setSearchValue) => isOpen ? (jsx("div", { className: style('absolute top-0 w-full h-full z-20'), children: jsx(Input, { type: "text", autoFocus: true, value: searchValue, onChange: setSearchValue }) })) : null;
809
885
  const renderOption = (handleChange, isOpen, isSelected) => (option, i) => (jsxs("div", { onClick: () => {
810
886
  handleChange(option);
811
887
  }, className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", children: [jsx("span", { className: "min-h-6", children: formatOption(option) }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: style('absolute right-4 pt-3xs', isSelected(option) && isOpen ? '' : 'hidden') })] }, String(i)));
@@ -867,7 +943,7 @@
867
943
 
868
944
  const renderBusinessCardDataOrganization = (field) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-lg", children: [jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] })] }));
869
945
 
870
- const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }));
946
+ const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }));
871
947
 
872
948
  const initialFormState$3 = {
873
949
  name: '',
@@ -919,7 +995,7 @@
919
995
  const MAX_CREDIT_TERM = 180;
920
996
  const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
921
997
 
922
- const renderCreditDataOrganization = (field) => (jsxs("div", { className: "pb-2xs border-b border-b-main-divider sm:flex sm:justify-between sm:gap-lg sm:border-none sm:pb-0", children: [jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...withValidator(field('annualRevenue'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field('mail') })] })] }));
998
+ const renderCreditDataOrganization = (field) => (jsxs("div", { className: "pb-2xs border-b border-b-main-divider sm:flex sm:justify-between sm:gap-lg sm:border-none sm:pb-0", children: [jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...withValidator(field('annualRevenue'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field('mail') })] })] }));
923
999
 
924
1000
  const useNormalizedInput = (props, { normalize, format }) => {
925
1001
  const { value, onFocus, onBlur, onChange } = props;
@@ -982,9 +1058,9 @@
982
1058
  const closestValue = (list) => (_) => list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
983
1059
  const renderRangeCaption = (items) => (jsx("div", { className: "flex justify-between my-xs", children: items.map((item, i) => (jsx(Text, { size: "text-s", font: "font-light", color: "text-secondary-text", children: item }, String(i)))) }));
984
1060
 
985
- const renderCreditParameters = (field) => (jsxs("div", { className: "border-b border-b-main-divider sm:flex sm:justify-between gap-lg sm:border-none", children: [jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD" }) }), jsx(InputRange, { items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })] }), jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432" }) }), jsx(InputRange, { items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })] })] }));
1061
+ const renderCreditParameters = (field) => (jsxs("div", { className: "border-b border-b-main-divider sm:flex sm:justify-between gap-lg sm:border-none", children: [jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0443\u043C\u043C\u0430, \u20BD" }) }), jsx(InputRange, { items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })] }), jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432" }) }), jsx(InputRange, { items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })] })] }));
986
1062
 
987
- const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-m sm:mb-2xl sm:border-none sm:pb-0", children: [jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
1063
+ const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-m sm:mb-2xl sm:border-none sm:pb-0", children: [jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
988
1064
  key: branchCode,
989
1065
  text: address,
990
1066
  })), ...withValidator(field('department'), defaultValidator) }) })] }));
@@ -1000,6 +1076,7 @@
1000
1076
  annualRevenue: '',
1001
1077
  };
1002
1078
  const creditValidator = objectValidator({
1079
+ fullName: defaultValidator,
1003
1080
  annualRevenue: defaultValidator,
1004
1081
  inn: innValidator,
1005
1082
  name: nameValidator,
@@ -1026,7 +1103,7 @@
1026
1103
  const [formState, { field, ...formProps }] = useForm(initialFormState$2, handleSubmit);
1027
1104
  const regions = useGetRegions();
1028
1105
  const branches = useBranches(formState.region?.key).filter((branch) => branch?.address);
1029
- return (jsxs("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u0440\u0435\u0434\u0438\u0442\u0430", className: "sm:text-center" }), renderCreditParameters(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "sm:text-center" }), renderCreditDataOrganization(field), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", className: "sm:text-center" }), renderRegionDepartment({ regions, branches, field }), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
1106
+ return (jsxs("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B", className: "sm:text-center" }), renderCreditParameters(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "sm:text-center" }), renderCreditDataOrganization(field), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", className: "sm:text-center" }), renderRegionDepartment({ regions, branches, field }), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
1030
1107
  });
1031
1108
 
1032
1109
  const initialFormState$1 = {
@@ -1277,7 +1354,7 @@
1277
1354
  },
1278
1355
  XS: {
1279
1356
  title: { headingType: 'h5', as: 'h2' },
1280
- descriptionSize: 'text-l',
1357
+ descriptionSize: 'text-m',
1281
1358
  descriptionWeight: 'font-light',
1282
1359
  descriptionStyle: 'mt-xs',
1283
1360
  },
@@ -2416,13 +2493,21 @@
2416
2493
  const renderCardHighlight = ({ className, text = 'ХИТ' } = {}) => (jsxs("div", { className: style('w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]', className), children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "24", height: "24" }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: text })] }));
2417
2494
 
2418
2495
  const cardBaseStyle = 'relative h-full';
2419
- const renderCarouselCards = ({ noCardBorder, activeIndex, ...rest }) => {
2496
+ const CARD_SIZE_MAP = {
2497
+ normal: 'sm:min-w-96',
2498
+ big: 'sm:min-w-[515px]',
2499
+ };
2500
+ const renderCarouselCards = ({ noCardBorder, activeIndex, cardSize = 'normal', ...rest }) => {
2420
2501
  const { blocks: childBlocks } = rest.block || {};
2421
2502
  const someCardsHighlighted = childBlocks?.some(isCardHighlighted);
2422
2503
  return renderChildren({
2423
2504
  ...rest,
2424
2505
  renderProps: (block, options, blockIndex) => (jsxs("div", { className: cardWrapperStyle(block, { someCardsHighlighted }), children: [renderBlock$1(block, options, {
2425
- className: cardStyle(block, { someCardsHighlighted, showBorder: !noCardBorder }),
2506
+ className: cardStyle(block, {
2507
+ someCardsHighlighted,
2508
+ showBorder: !noCardBorder,
2509
+ cardSize,
2510
+ }),
2426
2511
  blockIndex,
2427
2512
  isActive: blockIndex === activeIndex,
2428
2513
  }), isCardHighlighted(block)
@@ -2431,11 +2516,12 @@
2431
2516
  });
2432
2517
  };
2433
2518
  const cardWrapperStyle = (_, { someCardsHighlighted }) => style(cardBaseStyle, someCardsHighlighted && (isCardHighlighted(_) ? 'pt-3xl' : 'pt-3xl sm:pt-16'));
2434
- const cardStyle = (_, { someCardsHighlighted, showBorder }) => style(cardBaseStyle, 'min-w-80 sm:min-w-96', someCardsHighlighted && (isCardHighlighted(_) ? 'pt-3xl sm:pt-16' : 'pt-3xl'), showBorder &&
2519
+ const cardStyle = (_, { someCardsHighlighted, showBorder, cardSize = 'normal', }) => style(cardBaseStyle, 'min-w-80', CARD_SIZE_MAP[cardSize], // TODO fix для RecommendationCard
2520
+ someCardsHighlighted && (isCardHighlighted(_) ? 'pt-3xl sm:pt-16' : 'pt-3xl'), showBorder &&
2435
2521
  'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider');
2436
2522
  const isCardHighlighted = (_) => _?.content && 'isHighlighting' in _.content && _.content.isHighlighting;
2437
2523
 
2438
- const Carousel = JSX(({ className, itemCount, visibleItemCount = 0, noCardBorder, isAlignCenter, showDots, arrowsPadded = true, isGap = true, ...rest }) => {
2524
+ const Carousel = JSX(({ className, itemCount, visibleItemCount = 0, noCardBorder, isAlignCenter, showDots, arrowsPadded = true, isGap = true, cardSize = 'normal', ...rest }) => {
2439
2525
  const { blocks: childBlocks = [] } = rest.block || {};
2440
2526
  const count = itemCount || childBlocks?.length;
2441
2527
  const [activeIndex, { inc: increaseActiveIndex, dec: decreaseActiveIndex }] = useCarouselControls({
@@ -2446,7 +2532,7 @@
2446
2532
  const [dotsActiveIndex] = scroll.visibleIndicesRange;
2447
2533
  // TODO Remove
2448
2534
  const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
2449
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: style(isAlignCenter ? 'flex justify-center' : '', 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : undefined, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderCarouselCards({ noCardBorder, activeIndex, ...rest }) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: count, listType: "horizontal-list" })) : null] }) }));
2535
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: style(isAlignCenter ? 'flex justify-center' : '', 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : undefined, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderCarouselCards({ noCardBorder, activeIndex, cardSize, ...rest }) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: count, listType: "horizontal-list" })) : null] }) }));
2450
2536
  });
2451
2537
  Carousel.childrenTypes = [
2452
2538
  'CarouselCard',
@@ -2511,7 +2597,7 @@
2511
2597
  const BaseTile = JSX(({ className, defaultPadding, padding, title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col gap-3xl font-sans overflow-hidden', padding || defaultPadding, className), children: [title ? jsx("div", { className: "relative", children: title }) : null, jsxs("div", { className: "grow relative flex flex-wrap @xl:flex-nowrap justify-around @xl:justify-between items-stretch gap-3xl", children: [renderImageContainer(leftImage, { imageAlign }), jsxs("div", { className: style('flex flex-col gap-3xl max-w-[600px] @xl:max-w-[728px]', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), backImage ? (jsx("div", { className: "mx-auto sm:absolute sm:-z-10 sm:-bottom-4 sm:-right-4", children: backImage })) : null, buttons] }), renderImageContainer(rightImage, { className: '-order-1 @xl:order-1', imageAlign })] })] })));
2512
2598
  const renderImageContainer = (image, { className, imageAlign }) => {
2513
2599
  //TODO Спорное решение
2514
- const fullWidth = image?.props?.image.size?.width > 400;
2600
+ const fullWidth = image?.props?.image?.size?.width > 400;
2515
2601
  return image ? (jsx("div", { className: style('flex-shrink-0', fullWidth ? 'w-full @xl:w-auto' : '', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
2516
2602
  };
2517
2603
 
@@ -2535,7 +2621,7 @@
2535
2621
  const CarouselLinks = JSX(({ className, additionalDescription, description, links, title, maxLinksCount = 10, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col sm:flex-row w-full overflow-hidden', className), ...rest, children: [jsxs("div", { className: "mr-xl flex-auto", children: [jsx(Headline, { isEmbedded: true, title: title, description: description, as: "h1", align: "text-left" }), additionalDescription ? (jsx(Headline, { className: "pt-m", description: additionalDescription, align: "text-left", isEmbedded: true })) : null] }), links?.length ? renderLinks(links, maxLinksCount) : null] })));
2536
2622
  const renderLinks = (links, maxLinksCount) => {
2537
2623
  const itemCount = Math.ceil(links.length / maxLinksCount);
2538
- return (jsx(Carousel, { className: "sm:w-2/3 w-full p-0 sm:p-xs", version: "secondary", itemCount: itemCount, arrowsPadded: false, showDots: false, children: new Array(itemCount).fill(null).map((_, groupIndex) => (jsx("div", { className: style('flex flex-wrap self-start w-full sm:w-[672px]'), children: links
2624
+ return (jsx(Carousel, { className: "@container-normal sm:w-2/3 w-full p-0 sm:p-xs", version: "secondary", itemCount: itemCount, arrowsPadded: false, showDots: false, children: new Array(itemCount).fill(null).map((_, groupIndex) => (jsx("div", { className: style('flex flex-wrap self-start w-full sm:w-[672px]'), children: links
2539
2625
  .slice(groupIndex * maxLinksCount, (groupIndex + 1) * maxLinksCount)
2540
2626
  .map((link, index) => (jsx(CarouselLinkButton, { className: "sm:m-2xs", ...link }, String(index)))) }, String(groupIndex)))) }));
2541
2627
  };
@@ -2544,15 +2630,18 @@
2544
2630
  L: 'w-1.5 h-1.5 mr-m',
2545
2631
  M: 'w-1.5 h-1.5 mr-s',
2546
2632
  S: 'w-1 h-1 mr-xs',
2633
+ XS: 'w-1 h-1 mr-xs',
2547
2634
  };
2548
2635
  const ListItem = JSX(({ className, isDotted = true, children, size = 'M' }) => (jsxs("div", { className: style('font-sans flex', className), role: "listitem", children: [isDotted ? (jsx("div", { className: "shrink-0", children: jsx("div", { className: style('align-middle inline-block rounded-full bg-primary-text group-data-secondary:bg-white', DOT_SIZE_MAP[size]) }) })) : null, jsx("span", { children: children })] })));
2549
2636
 
2550
2637
  const TEXT_SIZE_MAP = {
2638
+ XS: 'text-m font-light',
2551
2639
  S: 'text-l font-light',
2552
2640
  M: 'text-h6',
2553
2641
  L: 'text-h5',
2554
2642
  };
2555
2643
  const ITEM_INDENT_MAP = {
2644
+ XS: 'ml-2xs',
2556
2645
  S: 'ml-xs',
2557
2646
  M: 'ml-s',
2558
2647
  L: 'ml-m',
@@ -3194,70 +3283,6 @@
3194
3283
  return firstCol.map((firstEl, rowIndex) => [firstEl, ...restCols.map((col) => col[rowIndex])]);
3195
3284
  }
3196
3285
 
3197
- const JARO_WINKLER_P = 0.1;
3198
- const JARO_WINKLER_MAX_L = 4;
3199
- const jaroWinklerDistance = (s1) => (s2) => {
3200
- if (s1 === s2) {
3201
- return 1;
3202
- }
3203
- if (!s1 || !s2) {
3204
- return 0;
3205
- }
3206
- const { m, s1Matches, s2Matches } = computeM(s1, s2);
3207
- if (m === 0) {
3208
- return 0;
3209
- }
3210
- const t = computeT(s1, s2, { s1Matches, s2Matches });
3211
- const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
3212
- const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
3213
- return jaroWeight + winklerWeight * (1 - jaroWeight);
3214
- };
3215
- function computeM(s1, s2) {
3216
- const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
3217
- const s1Matches = new Array(s1.length);
3218
- const s2Matches = new Array(s2.length);
3219
- let m = 0;
3220
- for (let i = 0; i < s1.length; i++) {
3221
- const low = Math.max(0, i - range);
3222
- const high = Math.min(i + range, s2.length - 1);
3223
- for (let j = low; j <= high; j++) {
3224
- if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
3225
- continue;
3226
- }
3227
- m++;
3228
- s1Matches[i] = true;
3229
- s2Matches[j] = true;
3230
- }
3231
- }
3232
- return { m, s1Matches, s2Matches };
3233
- }
3234
- function computeT(s1, s2, { s1Matches, s2Matches }) {
3235
- let t = 0;
3236
- for (let i = 0, k = 0; i < s1.length; i++) {
3237
- if (!s1Matches[i]) {
3238
- continue;
3239
- }
3240
- let j = k;
3241
- for (; j < s2.length; j++) {
3242
- if (s2Matches[j]) {
3243
- k = j + 1;
3244
- break;
3245
- }
3246
- }
3247
- if (s1[i] !== s2[j]) {
3248
- t++;
3249
- }
3250
- }
3251
- return t;
3252
- }
3253
- function computePrefixL(s1, s2) {
3254
- let prefixL = 0;
3255
- while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
3256
- prefixL++;
3257
- }
3258
- return prefixL;
3259
- }
3260
-
3261
3286
  const joinMaps = (aggregate, emptyVal) => (acc, map) => {
3262
3287
  for (const [key, b] of map) {
3263
3288
  acc.set(key, aggregate(acc.get(key) || emptyVal, b));
@@ -5190,7 +5215,7 @@
5190
5215
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
5191
5216
  }
5192
5217
 
5193
- const packageVersion = "0.13.4";
5218
+ const packageVersion = "0.13.5";
5194
5219
 
5195
5220
  exports.Blocks = Blocks;
5196
5221
  exports.ContentPage = ContentPage;