@redneckz/wildless-cms-uni-blocks 0.5.0 → 0.5.2

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 (126) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +19 -19
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/CardTransfer/CardTransfer.js +7 -7
  5. package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  6. package/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
  7. package/dist/components/ContentPage/normalizePage.d.ts +1 -27
  8. package/dist/components/ContentPage/normalizePage.js.map +1 -1
  9. package/dist/components/PictureText/PictureText.js +1 -1
  10. package/dist/components/PictureText/PictureText.js.map +1 -1
  11. package/dist/components/ProductTile/ProductTile.js +2 -2
  12. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  13. package/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  14. package/dist/model/ButtonVersion.d.ts +2 -2
  15. package/dist/ui-kit/Button/Button.js +4 -1
  16. package/dist/ui-kit/Button/Button.js.map +1 -1
  17. package/dist/ui-kit/Button/Button.mobile.js +2 -0
  18. package/dist/ui-kit/Button/Button.mobile.js.map +1 -1
  19. package/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
  20. package/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  21. package/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  22. package/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  23. package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  24. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  25. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
  26. package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  27. package/lib/common.css +1 -1
  28. package/lib/components/CardTransfer/CardTransfer.js +7 -7
  29. package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  30. package/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
  31. package/lib/components/ContentPage/normalizePage.d.ts +1 -27
  32. package/lib/components/ContentPage/normalizePage.js.map +1 -1
  33. package/lib/components/PictureText/PictureText.js +1 -1
  34. package/lib/components/PictureText/PictureText.js.map +1 -1
  35. package/lib/components/ProductTile/ProductTile.js +2 -2
  36. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  37. package/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  38. package/lib/model/ButtonVersion.d.ts +2 -2
  39. package/lib/ui-kit/Button/Button.js +4 -1
  40. package/lib/ui-kit/Button/Button.js.map +1 -1
  41. package/lib/ui-kit/Button/Button.mobile.js +2 -0
  42. package/lib/ui-kit/Button/Button.mobile.js.map +1 -1
  43. package/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
  44. package/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  45. package/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  46. package/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  47. package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  48. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  49. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
  50. package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  51. package/mobile/bundle/bundle.umd.js +2 -0
  52. package/mobile/bundle/bundle.umd.min.js +1 -1
  53. package/mobile/dist/components/CardTransfer/CardTransfer.js +7 -7
  54. package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  55. package/mobile/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
  56. package/mobile/dist/components/ContentPage/normalizePage.d.ts +1 -19
  57. package/mobile/dist/components/ContentPage/normalizePage.js.map +1 -1
  58. package/mobile/dist/components/PictureText/PictureText.js +1 -1
  59. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  60. package/mobile/dist/components/ProductTile/ProductTile.js +2 -2
  61. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  62. package/mobile/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  63. package/mobile/dist/model/ButtonVersion.d.ts +2 -2
  64. package/mobile/dist/ui-kit/Button/Button.js +2 -0
  65. package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
  66. package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
  67. package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  68. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  69. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  70. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  71. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  72. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
  73. package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  74. package/mobile/lib/components/CardTransfer/CardTransfer.js +7 -7
  75. package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  76. package/mobile/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
  77. package/mobile/lib/components/ContentPage/normalizePage.d.ts +1 -19
  78. package/mobile/lib/components/ContentPage/normalizePage.js.map +1 -1
  79. package/mobile/lib/components/PictureText/PictureText.js +1 -1
  80. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  81. package/mobile/lib/components/ProductTile/ProductTile.js +2 -2
  82. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  83. package/mobile/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
  84. package/mobile/lib/model/ButtonVersion.d.ts +2 -2
  85. package/mobile/lib/ui-kit/Button/Button.js +2 -0
  86. package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
  87. package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
  88. package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
  89. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
  90. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
  91. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
  92. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
  93. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
  94. package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
  95. package/mobile/src/components/CardTransfer/CardTransfer.example.json +6 -0
  96. package/mobile/src/components/CardTransfer/CardTransfer.tsx +46 -37
  97. package/mobile/src/components/CardTransfer/CardTransferContent.ts +7 -4
  98. package/mobile/src/components/ContentPage/ContentPage.page.json +7 -1
  99. package/mobile/src/components/ContentPage/normalizePage.ts +2 -1
  100. package/mobile/src/components/PictureText/PictureText.tsx +1 -1
  101. package/mobile/src/components/ProductTile/ProductTile.tsx +4 -2
  102. package/mobile/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
  103. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +3 -3
  104. package/mobile/src/model/ButtonVersion.ts +2 -2
  105. package/mobile/src/ui-kit/Button/Button.tsx +2 -0
  106. package/mobile/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
  107. package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
  108. package/mobile/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
  109. package/package.json +1 -1
  110. package/src/components/CardTransfer/CardTransfer.example.json +6 -0
  111. package/src/components/CardTransfer/CardTransfer.tsx +46 -37
  112. package/src/components/CardTransfer/CardTransferContent.ts +7 -4
  113. package/src/components/ContentPage/ContentPage.page.json +7 -1
  114. package/src/components/ContentPage/normalizePage.ts +2 -1
  115. package/src/components/PictureText/PictureText.tsx +1 -1
  116. package/src/components/ProductGallery/ProductGallery.fixture.tsx +1 -1
  117. package/src/components/ProductTile/ProductTile.tsx +4 -2
  118. package/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
  119. package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
  120. package/src/components/__snapshots__/Blocks.spec.tsx.snap +3 -3
  121. package/src/model/ButtonVersion.ts +2 -2
  122. package/src/ui-kit/Button/Button.mobile.tsx +2 -0
  123. package/src/ui-kit/Button/Button.tsx +5 -3
  124. package/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
  125. package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
  126. package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrencyInputProps.js","sourceRoot":"","sources":["../../../src/ui-kit/CurrencyInput/CurrencyInputProps.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Укажите сумму перевода",
3
+ "label": "Сумма перевода",
4
+ "buttonText": "Далее",
5
+ "placeholder": "1500"
6
+ }
@@ -10,13 +10,13 @@ import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonCla
10
10
  import { getDisabledButtonClasses } from '../../ui-kit/Button/getDisabledButtonClasses';
11
11
 
12
12
  const AMOUNT_KEY = 'amount';
13
- const INPUT_LABEL = 'Сумма перевода';
14
- const BUTTON_TEXT = 'Далее';
15
- const PLACEHOLDER = '1500';
16
- const TITLE = 'Укажите сумму перевода';
17
-
18
13
  const FORM_URL = 'https://www.rshb.ru/p2p/';
19
14
 
15
+ const DEFAULT_TITLE = 'Укажите сумму перевода';
16
+ const DEFAULT_LABEL = 'Сумма перевода';
17
+ const DEFAULT_PLACEHOLDER = '1500';
18
+ const DEFAULT_BUTTON_TEXT = 'Далее';
19
+
20
20
  const BUTTON_CLASS_PARAMS: GetButtonClassParams = {
21
21
  version: 'primary',
22
22
  className: 'w-full h-[56px] px-9 mt-6',
@@ -24,36 +24,45 @@ const BUTTON_CLASS_PARAMS: GetButtonClassParams = {
24
24
 
25
25
  export interface CardTransferProps extends CardTransferContent, UniBlockProps {}
26
26
 
27
- export const CardTransfer = JSX<CardTransferProps>(({ className = '', title = TITLE, ...rest }) => {
28
- const [value, setValue] = useState<string>('');
29
- const isDisabled = !Number(value);
27
+ export const CardTransfer = JSX<CardTransferProps>(
28
+ ({
29
+ className = '',
30
+ title = DEFAULT_TITLE,
31
+ label = DEFAULT_LABEL,
32
+ placeholder = DEFAULT_PLACEHOLDER,
33
+ buttonText = DEFAULT_BUTTON_TEXT,
34
+ ...rest
35
+ }) => {
36
+ const [value, setValue] = useState<string>('');
37
+ const isDisabled = !Number(value);
30
38
 
31
- return (
32
- <BlockWrapper
33
- className={`p-[50px] flex flex-col items-center font-sans bg-white ${className}`}
34
- {...rest}
35
- >
36
- {title ? <Heading className="max-w-[684px] pb-9" headingType="h2" title={title} /> : null}
37
- <form className="w-[468px]" method="POST" action={FORM_URL}>
38
- <CurrencyInput
39
- name={AMOUNT_KEY}
40
- value={value}
41
- onChange={setValue}
42
- placeholder={PLACEHOLDER}
43
- label={INPUT_LABEL}
44
- />
45
- <button
46
- type="submit"
47
- className={
48
- isDisabled
49
- ? getDisabledButtonClasses(BUTTON_CLASS_PARAMS)
50
- : getRegularButtonClasses(BUTTON_CLASS_PARAMS)
51
- }
52
- disabled={isDisabled}
53
- >
54
- {BUTTON_TEXT}
55
- </button>
56
- </form>
57
- </BlockWrapper>
58
- );
59
- });
39
+ return (
40
+ <BlockWrapper
41
+ className={`p-[50px] flex flex-col items-center font-sans bg-white ${className}`}
42
+ {...rest}
43
+ >
44
+ {title ? <Heading className="max-w-[684px] pb-9" headingType="h2" title={title} /> : null}
45
+ <form className="w-[468px]" method="POST" action={FORM_URL}>
46
+ <CurrencyInput
47
+ name={AMOUNT_KEY}
48
+ value={value}
49
+ onChange={setValue}
50
+ placeholder={placeholder}
51
+ label={label}
52
+ />
53
+ <button
54
+ type="submit"
55
+ className={
56
+ isDisabled
57
+ ? getDisabledButtonClasses(BUTTON_CLASS_PARAMS)
58
+ : getRegularButtonClasses(BUTTON_CLASS_PARAMS)
59
+ }
60
+ disabled={isDisabled}
61
+ >
62
+ {buttonText}
63
+ </button>
64
+ </form>
65
+ </BlockWrapper>
66
+ );
67
+ },
68
+ );
@@ -2,9 +2,12 @@
2
2
  * @title Перевод с карты на карту
3
3
  */
4
4
  export type CardTransferContent = {
5
- /**
6
- * @title Заголовок
7
- * @hidden
8
- */
5
+ /** @title Заголовок */
9
6
  title?: string;
7
+ /** @title Название поля */
8
+ label?: string;
9
+ /** @title Плейсхолдер поля */
10
+ placeholder?: string;
11
+ /** @title Текст кнопки */
12
+ buttonText?: string;
10
13
  };
@@ -2199,7 +2199,13 @@
2199
2199
  },
2200
2200
  {
2201
2201
  "type": "CardTransfer",
2202
- "style": ["col-span-12"]
2202
+ "style": ["col-span-12"],
2203
+ "content": {
2204
+ "title": "Укажите сумму перевода",
2205
+ "label": "Сумма перевода",
2206
+ "buttonText": "Далее",
2207
+ "placeholder": "1500"
2208
+ }
2203
2209
  },
2204
2210
  {
2205
2211
  "type": "SafeDepositRental",
@@ -3,7 +3,8 @@ import { BlocksRegistry } from './ContentPage';
3
3
  import { filterBlocks } from './filterBlocks';
4
4
 
5
5
  export const normalizePage =
6
- (blocksRegistry: BlocksRegistry) => (contentPage: ContentPageDef | undefined | null) => {
6
+ (blocksRegistry: BlocksRegistry) =>
7
+ (contentPage: ContentPageDef | undefined | null): ContentPageDef | undefined => {
7
8
  if (!contentPage) {
8
9
  return undefined;
9
10
  }
@@ -28,7 +28,7 @@ export const PictureText = JSX<PictureTextProps>(
28
28
  }) => {
29
29
  return (
30
30
  <BlockWrapper
31
- className={`relative font-sans p-14 ${VersionStyleMap[version]} ${className}`}
31
+ className={`relative font-sans py-12 px-28 ${VersionStyleMap[version]} ${className}`}
32
32
  context={context}
33
33
  {...rest}
34
34
  >
@@ -36,7 +36,7 @@ export const ProductTile = JSX<ProductTileProps>(
36
36
  >
37
37
  <Headline
38
38
  context={context}
39
- className={`!p-0 z-10 ${title || description ? 'mb-3.5' : ''}`}
39
+ className={`!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`}
40
40
  as="h2"
41
41
  title={title}
42
42
  description={description}
@@ -99,6 +99,8 @@ function renderAdditionalDescription(additionalDescription: string, version = 'p
99
99
  };
100
100
 
101
101
  return (
102
- <div className={`text-m-light mt-2.5 ${descStyleMap[version]}`}>{additionalDescription}</div>
102
+ <div className={`text-m-light mt-2.5 z-10 ${descStyleMap[version]}`}>
103
+ {additionalDescription}
104
+ </div>
103
105
  );
104
106
  }
@@ -3,7 +3,7 @@ import { useState } from '@redneckz/uni-jsx/lib/hooks/core';
3
3
  import { Radio } from '../../ui-kit/Radio/Radio';
4
4
 
5
5
  export const RenderRadioButtons = JSX(() => {
6
- const [selectedOption, setSelectedOption] = useState('option1');
6
+ const [selectedOption, setSelectedOption] = useState('option2');
7
7
 
8
8
  const onChange = (_: React.ChangeEvent<HTMLInputElement>) => setSelectedOption(_.target.value);
9
9
 
@@ -695,7 +695,7 @@ exports[`Blocks OtherProducts should render block "OtherProducts" without conten
695
695
 
696
696
  exports[`Blocks PictureText should render block "PictureText" without content 1`] = `
697
697
  <section
698
- class="relative font-sans p-14 bg-white text-primary-text "
698
+ class="relative font-sans py-12 px-28 bg-white text-primary-text "
699
699
  >
700
700
  <section
701
701
  class="font-sans flex flex-col p-[50px] gap-3 bg-white !p-0"
@@ -801,7 +801,7 @@ exports[`Blocks ProductTile should render block "ProductTile" without content 1`
801
801
  class="overflow-hidden font-sans p-9 box-border relative justify-between grid bg-white text-primary-text pr-[9.4rem] min-h-[360px]"
802
802
  >
803
803
  <section
804
- class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0 z-10 "
804
+ class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0 !bg-transparent z-10 "
805
805
  />
806
806
  <div
807
807
  class="z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline max-w-[calc(100%-186px)]"
@@ -1044,7 +1044,6 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1044
1044
  class="flex items-center relative cursor-pointer"
1045
1045
  >
1046
1046
  <input
1047
- checked=""
1048
1047
  class="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main"
1049
1048
  name="contractType"
1050
1049
  type="radio"
@@ -1062,6 +1061,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1062
1061
  class="flex items-center relative cursor-pointer"
1063
1062
  >
1064
1063
  <input
1064
+ checked=""
1065
1065
  class="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main"
1066
1066
  name="contractType"
1067
1067
  type="radio"
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
3
  * @default primary
4
- * @enumNames ["Основная", "Второстепенная", "Ссылка"]
4
+ * @enumNames ["Основная", "Второстепенная", "Белая", "Ссылка"]
5
5
  */
6
- export type ButtonVersion = 'primary' | 'secondary' | 'link';
6
+ export type ButtonVersion = 'primary' | 'secondary' | 'white' | 'link';
@@ -10,12 +10,14 @@ const buttonStyleMap: Record<ButtonVersion, string> = {
10
10
  primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
11
11
  secondary:
12
12
  'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
13
+ white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white',
13
14
  link: 'text-primary-main',
14
15
  };
15
16
 
16
17
  const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
17
18
  primary: 'bg-secondary-dark text-secondary-text',
18
19
  secondary: 'bg-secondary-light text-secondary-text',
20
+ white: 'bg-white text-primary-text',
19
21
  link: '',
20
22
  };
21
23
 
@@ -4,12 +4,14 @@ export const buttonStyleMap: Record<ButtonVersion, string> = {
4
4
  primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
5
5
  secondary:
6
6
  'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
7
+ white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white',
7
8
  link: '',
8
9
  };
9
10
 
10
11
  export const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
11
12
  primary: 'bg-secondary-dark text-secondary-text',
12
13
  secondary: 'bg-secondary-light text-secondary-text',
14
+ white: 'bg-white text-primary-text',
13
15
  link: '',
14
16
  };
15
17
 
@@ -1,37 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { clamp } from '../../utils/clamp';
3
-
4
- // ISO 4217 codes
5
- /**
6
- * @title Валюта
7
- * @enumNames ["Рубль", "Доллар", "Евро"]
8
- * @default "RUB"
9
- */
10
- type Currency = 'RUB' | 'USD' | 'EUR';
11
-
12
- const CurrencyMap: Record<Currency, string> = {
13
- RUB: '₽',
14
- USD: '$',
15
- EUR: '€',
16
- };
17
-
18
- type CurrencyInputProps = {
19
- className?: string;
20
- label?: string;
21
- currency?: Currency;
22
- onChange?: (value: string) => void;
23
- name?: string;
24
- value?: string;
25
- placeholder?: string;
26
- minValue?: number;
27
- maxValue?: number;
28
- };
3
+ import type { CurrencyInputProps } from './CurrencyInputProps';
29
4
 
30
5
  export const CurrencyInput = JSX<CurrencyInputProps>(
31
6
  ({
32
7
  className = '',
33
8
  label,
34
- currency = 'RUB',
35
9
  onChange,
36
10
  value = '',
37
11
  minValue = 0,
@@ -55,14 +29,16 @@ export const CurrencyInput = JSX<CurrencyInputProps>(
55
29
  <div className="h-[56px] relative flex items-center">
56
30
  <input
57
31
  type="number"
58
- className="text-l pl-4 pr-8 w-full h-full rounded-md border border-solid border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text"
32
+ className={
33
+ 'text-l pl-4 pr-8 w-full h-full rounded-md border border-solid border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text'
34
+ }
59
35
  onChange={handleChange}
60
36
  value={value}
61
37
  min={minValue}
62
38
  max={maxValue}
63
39
  {...inputProps}
64
40
  />
65
- <span className="text-xl-light absolute right-4">{CurrencyMap[currency]}</span>
41
+ <span className="text-xl-light absolute right-4">₽</span>
66
42
  </div>
67
43
  </div>
68
44
  );
@@ -0,0 +1,10 @@
1
+ export type CurrencyInputProps = {
2
+ className?: string;
3
+ label?: string;
4
+ onChange?: (value: string) => void;
5
+ name?: string;
6
+ value?: string;
7
+ placeholder?: string;
8
+ minValue?: number;
9
+ maxValue?: number;
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -0,0 +1,6 @@
1
+ {
2
+ "title": "Укажите сумму перевода",
3
+ "label": "Сумма перевода",
4
+ "buttonText": "Далее",
5
+ "placeholder": "1500"
6
+ }
@@ -10,13 +10,13 @@ import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonCla
10
10
  import { getDisabledButtonClasses } from '../../ui-kit/Button/getDisabledButtonClasses';
11
11
 
12
12
  const AMOUNT_KEY = 'amount';
13
- const INPUT_LABEL = 'Сумма перевода';
14
- const BUTTON_TEXT = 'Далее';
15
- const PLACEHOLDER = '1500';
16
- const TITLE = 'Укажите сумму перевода';
17
-
18
13
  const FORM_URL = 'https://www.rshb.ru/p2p/';
19
14
 
15
+ const DEFAULT_TITLE = 'Укажите сумму перевода';
16
+ const DEFAULT_LABEL = 'Сумма перевода';
17
+ const DEFAULT_PLACEHOLDER = '1500';
18
+ const DEFAULT_BUTTON_TEXT = 'Далее';
19
+
20
20
  const BUTTON_CLASS_PARAMS: GetButtonClassParams = {
21
21
  version: 'primary',
22
22
  className: 'w-full h-[56px] px-9 mt-6',
@@ -24,36 +24,45 @@ const BUTTON_CLASS_PARAMS: GetButtonClassParams = {
24
24
 
25
25
  export interface CardTransferProps extends CardTransferContent, UniBlockProps {}
26
26
 
27
- export const CardTransfer = JSX<CardTransferProps>(({ className = '', title = TITLE, ...rest }) => {
28
- const [value, setValue] = useState<string>('');
29
- const isDisabled = !Number(value);
27
+ export const CardTransfer = JSX<CardTransferProps>(
28
+ ({
29
+ className = '',
30
+ title = DEFAULT_TITLE,
31
+ label = DEFAULT_LABEL,
32
+ placeholder = DEFAULT_PLACEHOLDER,
33
+ buttonText = DEFAULT_BUTTON_TEXT,
34
+ ...rest
35
+ }) => {
36
+ const [value, setValue] = useState<string>('');
37
+ const isDisabled = !Number(value);
30
38
 
31
- return (
32
- <BlockWrapper
33
- className={`p-[50px] flex flex-col items-center font-sans bg-white ${className}`}
34
- {...rest}
35
- >
36
- {title ? <Heading className="max-w-[684px] pb-9" headingType="h2" title={title} /> : null}
37
- <form className="w-[468px]" method="POST" action={FORM_URL}>
38
- <CurrencyInput
39
- name={AMOUNT_KEY}
40
- value={value}
41
- onChange={setValue}
42
- placeholder={PLACEHOLDER}
43
- label={INPUT_LABEL}
44
- />
45
- <button
46
- type="submit"
47
- className={
48
- isDisabled
49
- ? getDisabledButtonClasses(BUTTON_CLASS_PARAMS)
50
- : getRegularButtonClasses(BUTTON_CLASS_PARAMS)
51
- }
52
- disabled={isDisabled}
53
- >
54
- {BUTTON_TEXT}
55
- </button>
56
- </form>
57
- </BlockWrapper>
58
- );
59
- });
39
+ return (
40
+ <BlockWrapper
41
+ className={`p-[50px] flex flex-col items-center font-sans bg-white ${className}`}
42
+ {...rest}
43
+ >
44
+ {title ? <Heading className="max-w-[684px] pb-9" headingType="h2" title={title} /> : null}
45
+ <form className="w-[468px]" method="POST" action={FORM_URL}>
46
+ <CurrencyInput
47
+ name={AMOUNT_KEY}
48
+ value={value}
49
+ onChange={setValue}
50
+ placeholder={placeholder}
51
+ label={label}
52
+ />
53
+ <button
54
+ type="submit"
55
+ className={
56
+ isDisabled
57
+ ? getDisabledButtonClasses(BUTTON_CLASS_PARAMS)
58
+ : getRegularButtonClasses(BUTTON_CLASS_PARAMS)
59
+ }
60
+ disabled={isDisabled}
61
+ >
62
+ {buttonText}
63
+ </button>
64
+ </form>
65
+ </BlockWrapper>
66
+ );
67
+ },
68
+ );
@@ -2,9 +2,12 @@
2
2
  * @title Перевод с карты на карту
3
3
  */
4
4
  export type CardTransferContent = {
5
- /**
6
- * @title Заголовок
7
- * @hidden
8
- */
5
+ /** @title Заголовок */
9
6
  title?: string;
7
+ /** @title Название поля */
8
+ label?: string;
9
+ /** @title Плейсхолдер поля */
10
+ placeholder?: string;
11
+ /** @title Текст кнопки */
12
+ buttonText?: string;
10
13
  };
@@ -2199,7 +2199,13 @@
2199
2199
  },
2200
2200
  {
2201
2201
  "type": "CardTransfer",
2202
- "style": ["col-span-12"]
2202
+ "style": ["col-span-12"],
2203
+ "content": {
2204
+ "title": "Укажите сумму перевода",
2205
+ "label": "Сумма перевода",
2206
+ "buttonText": "Далее",
2207
+ "placeholder": "1500"
2208
+ }
2203
2209
  },
2204
2210
  {
2205
2211
  "type": "SafeDepositRental",
@@ -3,7 +3,8 @@ import { BlocksRegistry } from './ContentPage';
3
3
  import { filterBlocks } from './filterBlocks';
4
4
 
5
5
  export const normalizePage =
6
- (blocksRegistry: BlocksRegistry) => (contentPage: ContentPageDef | undefined | null) => {
6
+ (blocksRegistry: BlocksRegistry) =>
7
+ (contentPage: ContentPageDef | undefined | null): ContentPageDef | undefined => {
7
8
  if (!contentPage) {
8
9
  return undefined;
9
10
  }
@@ -28,7 +28,7 @@ export const PictureText = JSX<PictureTextProps>(
28
28
  }) => {
29
29
  return (
30
30
  <BlockWrapper
31
- className={`relative font-sans p-14 ${VersionStyleMap[version]} ${className}`}
31
+ className={`relative font-sans py-12 px-28 ${VersionStyleMap[version]} ${className}`}
32
32
  context={context}
33
33
  {...rest}
34
34
  >
@@ -50,7 +50,7 @@ const buttonsSecondary: ButtonWithIconProps[] = [
50
50
  href: 'https://rshb.ru',
51
51
  text: 'Подробнее',
52
52
  target: '_blank',
53
- version: 'secondary',
53
+ version: 'white',
54
54
  },
55
55
  ];
56
56
 
@@ -36,7 +36,7 @@ export const ProductTile = JSX<ProductTileProps>(
36
36
  >
37
37
  <Headline
38
38
  context={context}
39
- className={`!p-0 z-10 ${title || description ? 'mb-3.5' : ''}`}
39
+ className={`!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`}
40
40
  as="h2"
41
41
  title={title}
42
42
  description={description}
@@ -99,6 +99,8 @@ function renderAdditionalDescription(additionalDescription: string, version = 'p
99
99
  };
100
100
 
101
101
  return (
102
- <div className={`text-m-light mt-2.5 ${descStyleMap[version]}`}>{additionalDescription}</div>
102
+ <div className={`text-m-light mt-2.5 z-10 ${descStyleMap[version]}`}>
103
+ {additionalDescription}
104
+ </div>
103
105
  );
104
106
  }
@@ -3,7 +3,7 @@ import { useState } from '@redneckz/uni-jsx/lib/hooks/core';
3
3
  import { Radio } from '../../ui-kit/Radio/Radio';
4
4
 
5
5
  export const RenderRadioButtons = JSX(() => {
6
- const [selectedOption, setSelectedOption] = useState('option1');
6
+ const [selectedOption, setSelectedOption] = useState('option2');
7
7
 
8
8
  const onChange = (_: React.ChangeEvent<HTMLInputElement>) => setSelectedOption(_.target.value);
9
9
 
@@ -90,6 +90,8 @@ export default {
90
90
  text: 'Отправить заявку',
91
91
  href: 'https://www.rshb.ru/',
92
92
  target: '_blank',
93
+ icon: { icon: 'ComfortableCompIcon' },
94
+ iconRight: { icon: 'ComfortableCompIcon' },
93
95
  }}
94
96
  />
95
97
  </div>
@@ -695,7 +695,7 @@ exports[`Blocks OtherProducts should render block "OtherProducts" without conten
695
695
 
696
696
  exports[`Blocks PictureText should render block "PictureText" without content 1`] = `
697
697
  <section
698
- class="relative font-sans p-14 bg-white text-primary-text "
698
+ class="relative font-sans py-12 px-28 bg-white text-primary-text "
699
699
  >
700
700
  <section
701
701
  class="font-sans flex flex-col p-[50px] gap-3 bg-white !p-0"
@@ -801,7 +801,7 @@ exports[`Blocks ProductTile should render block "ProductTile" without content 1`
801
801
  class="overflow-hidden font-sans p-9 box-border relative justify-between grid bg-white text-primary-text pr-[9.4rem] min-h-[360px]"
802
802
  >
803
803
  <section
804
- class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0 z-10 "
804
+ class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0 !bg-transparent z-10 "
805
805
  />
806
806
  <div
807
807
  class="z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline max-w-[calc(100%-186px)]"
@@ -1044,7 +1044,6 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1044
1044
  class="flex items-center relative cursor-pointer"
1045
1045
  >
1046
1046
  <input
1047
- checked=""
1048
1047
  class="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main"
1049
1048
  name="contractType"
1050
1049
  type="radio"
@@ -1062,6 +1061,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
1062
1061
  class="flex items-center relative cursor-pointer"
1063
1062
  >
1064
1063
  <input
1064
+ checked=""
1065
1065
  class="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main"
1066
1066
  name="contractType"
1067
1067
  type="radio"
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
3
  * @default primary
4
- * @enumNames ["Основная", "Второстепенная", "Ссылка"]
4
+ * @enumNames ["Основная", "Второстепенная", "Белая", "Ссылка"]
5
5
  */
6
- export type ButtonVersion = 'primary' | 'secondary' | 'link';
6
+ export type ButtonVersion = 'primary' | 'secondary' | 'white' | 'link';
@@ -10,12 +10,14 @@ const buttonStyleMap: Record<ButtonVersion, string> = {
10
10
  primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
11
11
  secondary:
12
12
  'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
13
+ white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white',
13
14
  link: 'text-primary-main',
14
15
  };
15
16
 
16
17
  const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
17
18
  primary: 'bg-secondary-dark text-secondary-text',
18
19
  secondary: 'bg-secondary-light text-secondary-text',
20
+ white: 'bg-white text-primary-text',
19
21
  link: '',
20
22
  };
21
23
 
@@ -6,7 +6,9 @@ import { getDisabledButtonClasses } from './getDisabledButtonClasses';
6
6
 
7
7
  export const Button = JSX<ButtonWithIconProps>((props) => {
8
8
  const { text, aboveText, appendLeft, appendRight, children, disabled, rounded, ...rest } = props;
9
-
9
+ // its non valid HTML attribute. Must be excluded from "rest"
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ const { asSVG, iconRight, icon, ...usedProps } = rest;
10
12
  const buttonInner = children ?? (
11
13
  <ButtonInner
12
14
  text={text}
@@ -18,11 +20,11 @@ export const Button = JSX<ButtonWithIconProps>((props) => {
18
20
  );
19
21
 
20
22
  return disabled ? (
21
- <DisabledButton rounded={rounded} {...rest}>
23
+ <DisabledButton rounded={rounded} {...usedProps}>
22
24
  {buttonInner}
23
25
  </DisabledButton>
24
26
  ) : (
25
- <RegularButton rounded={rounded} {...rest}>
27
+ <RegularButton rounded={rounded} {...usedProps}>
26
28
  {buttonInner}
27
29
  </RegularButton>
28
30
  );