@redneckz/wildless-cms-uni-blocks 0.5.1 → 0.5.3
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.
- package/bin/migrate.js +2 -0
- package/bin/migrateContentUnit.js +26 -0
- package/bin/migration-scripts/0.4.0.js +3 -0
- package/bin/migration-scripts/0.4.1.js +3 -0
- package/bin/migration-scripts/0.4.5.js +109 -0
- package/bin/migration-scripts/0.4.5.spec.ts +352 -0
- package/bin/migration-scripts/index.js +21 -0
- package/bin/utils.js +24 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +27 -25
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/CardTransfer/CardTransfer.js +7 -7
- package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/dist/components/PictureText/PictureText.js +1 -1
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +2 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/dist/components/Tabs/TabsContent.d.ts +8 -3
- package/dist/components/Tabs/renderGroupTab.js +1 -1
- package/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/dist/model/ButtonVersion.d.ts +2 -2
- package/dist/ui-kit/Button/Button.js +4 -1
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Button/Button.mobile.js +2 -0
- package/dist/ui-kit/Button/Button.mobile.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +3 -2
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Button/ButtonSection.js +3 -2
- package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/dist/ui-kit/{Tabs/TabsProps.js → CurrencyInput/CurrencyInputProps.js} +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/dist/ui-kit/Select/Select.js +1 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/CardTransfer/CardTransfer.js +7 -7
- package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/lib/components/PictureText/PictureText.js +1 -1
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +2 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/lib/components/Tabs/TabsContent.d.ts +8 -3
- package/lib/components/Tabs/renderGroupTab.js +1 -1
- package/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/lib/model/ButtonVersion.d.ts +2 -2
- package/lib/ui-kit/Button/Button.js +4 -1
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Button/Button.mobile.js +2 -0
- package/lib/ui-kit/Button/Button.mobile.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +3 -2
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Button/ButtonSection.js +3 -2
- package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/lib/ui-kit/Select/Select.js +1 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +9 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/CardTransfer/CardTransfer.js +7 -7
- package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/dist/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/mobile/dist/components/PictureText/PictureText.js +1 -1
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +2 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/mobile/dist/components/Tabs/TabsContent.d.ts +8 -3
- package/mobile/dist/components/Tabs/renderGroupTab.js +1 -1
- package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/dist/model/ButtonVersion.d.ts +2 -2
- package/mobile/dist/ui-kit/Button/Button.js +2 -0
- package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +3 -2
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.js +3 -2
- package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/mobile/dist/ui-kit/{Tabs/TabsProps.js → CurrencyInput/CurrencyInputProps.js} +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +1 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/components/CardTransfer/CardTransfer.js +7 -7
- package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/lib/components/CardTransfer/CardTransferContent.d.ts +7 -4
- package/mobile/lib/components/PictureText/PictureText.js +1 -1
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +2 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/RenderRadioButtons.js +1 -1
- package/mobile/lib/components/Tabs/TabsContent.d.ts +8 -3
- package/mobile/lib/components/Tabs/renderGroupTab.js +1 -1
- package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/lib/model/ButtonVersion.d.ts +2 -2
- package/mobile/lib/ui-kit/Button/Button.js +2 -0
- package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +3 -2
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.js +3 -2
- package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js +2 -0
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.d.ts +1 -18
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +2 -7
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +10 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js +2 -0
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +1 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/src/components/CardTransfer/CardTransfer.example.json +6 -0
- package/mobile/src/components/CardTransfer/CardTransfer.tsx +46 -37
- package/mobile/src/components/CardTransfer/CardTransferContent.ts +7 -4
- package/mobile/src/components/ContentPage/ContentPage.page.json +7 -1
- package/mobile/src/components/PictureText/PictureText.tsx +1 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +4 -2
- package/mobile/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
- package/mobile/src/components/Tabs/TabsContent.ts +8 -3
- package/mobile/src/components/Tabs/renderGroupTab.tsx +2 -1
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
- package/mobile/src/model/ButtonVersion.ts +2 -2
- package/mobile/src/ui-kit/Button/Button.tsx +2 -0
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +3 -2
- package/mobile/src/ui-kit/Button/ButtonSection.tsx +9 -4
- package/mobile/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
- package/mobile/src/ui-kit/Select/Select.tsx +1 -1
- package/package.json +5 -1
- package/src/components/CardTransfer/CardTransfer.example.json +6 -0
- package/src/components/CardTransfer/CardTransfer.tsx +46 -37
- package/src/components/CardTransfer/CardTransferContent.ts +7 -4
- package/src/components/ContentPage/ContentPage.page.json +7 -1
- package/src/components/PictureText/PictureText.tsx +1 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +1 -1
- package/src/components/ProductTile/ProductTile.tsx +4 -2
- package/src/components/SafeDepositRental/RenderRadioButtons.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
- package/src/components/Tabs/TabsContent.ts +8 -3
- package/src/components/Tabs/renderGroupTab.tsx +2 -1
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +9 -9
- package/src/model/ButtonVersion.ts +2 -2
- package/src/ui-kit/Button/Button.mobile.tsx +2 -0
- package/src/ui-kit/Button/Button.tsx +5 -3
- package/src/ui-kit/Button/ButtonInner.tsx +3 -2
- package/src/ui-kit/Button/ButtonSection.tsx +9 -4
- package/src/ui-kit/Button/buttonClassNameConstants.ts +2 -0
- package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
- package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
- package/src/ui-kit/Select/Select.tsx +1 -1
- package/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/dist/ui-kit/Tabs/Tabs.js +0 -17
- package/dist/ui-kit/Tabs/Tabs.js.map +0 -1
- package/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/lib/ui-kit/Tabs/Tabs.js +0 -15
- package/lib/ui-kit/Tabs/Tabs.js.map +0 -1
- package/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/lib/ui-kit/Tabs/TabsProps.js +0 -2
- package/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/mobile/dist/ui-kit/Tabs/Tabs.js +0 -17
- package/mobile/dist/ui-kit/Tabs/Tabs.js.map +0 -1
- package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/mobile/dist/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.d.ts +0 -2
- package/mobile/lib/ui-kit/Tabs/Tabs.js +0 -15
- package/mobile/lib/ui-kit/Tabs/Tabs.js.map +0 -1
- package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +0 -17
- package/mobile/lib/ui-kit/Tabs/TabsProps.js +0 -2
- package/mobile/lib/ui-kit/Tabs/TabsProps.js.map +0 -1
- package/mobile/src/ui-kit/Tabs/Tabs.tsx +0 -52
- package/mobile/src/ui-kit/Tabs/TabsProps.ts +0 -20
- package/src/ui-kit/Tabs/Tabs.tsx +0 -52
- package/src/ui-kit/Tabs/TabsProps.ts +0 -20
|
@@ -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>(
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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",
|
|
@@ -28,7 +28,7 @@ export const PictureText = JSX<PictureTextProps>(
|
|
|
28
28
|
}) => {
|
|
29
29
|
return (
|
|
30
30
|
<BlockWrapper
|
|
31
|
-
className={`relative font-sans
|
|
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]}`}>
|
|
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('
|
|
6
|
+
const [selectedOption, setSelectedOption] = useState('option2');
|
|
7
7
|
|
|
8
8
|
const onChange = (_: React.ChangeEvent<HTMLInputElement>) => setSelectedOption(_.target.value);
|
|
9
9
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { LinkProps } from '../../model/LinkProps';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @title Группа
|
|
5
|
+
*/
|
|
3
6
|
export interface GroupTab {
|
|
4
|
-
/** @default group */
|
|
5
7
|
type: 'group';
|
|
6
8
|
/** @title Тег */
|
|
7
9
|
ref?: string;
|
|
@@ -9,13 +11,16 @@ export interface GroupTab {
|
|
|
9
11
|
title?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @title Ссылка
|
|
16
|
+
*/
|
|
12
17
|
export type LinkTab = LinkProps & {
|
|
13
|
-
/** @default link */
|
|
14
18
|
type: 'link';
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
22
|
+
* @title Таб
|
|
23
|
+
* @default {"type": "group"}
|
|
19
24
|
*/
|
|
20
25
|
export type Tab = GroupTab | LinkTab;
|
|
21
26
|
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
} from './tabItemClasses';
|
|
10
10
|
import type { GroupTab } from './TabsContent';
|
|
11
11
|
|
|
12
|
-
const BADGE_CLASSES =
|
|
12
|
+
const BADGE_CLASSES =
|
|
13
|
+
'min-w-[22px] w-[22px] h-[22px] rounded-full text-xs ml-2 flex justify-center items-center';
|
|
13
14
|
const ACTIVE_BADGE_CLASSES = 'bg-white/30 text-white';
|
|
14
15
|
const INACTIVE_BADGE_CLASSES = 'bg-main-divider text-secondary-text group-hover:text-primary-main';
|
|
15
16
|
|
|
@@ -353,7 +353,7 @@ exports[`Blocks Footer should render block "Footer" without content 1`] = `
|
|
|
353
353
|
target="_blank"
|
|
354
354
|
>
|
|
355
355
|
<div
|
|
356
|
-
class="flex items-center justify-center gap-2 py-4 px-9
|
|
356
|
+
class="group flex items-center justify-center gap-2 py-4 px-9 "
|
|
357
357
|
>
|
|
358
358
|
<div>
|
|
359
359
|
<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
|
|
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)]"
|
|
@@ -894,7 +894,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
|
|
|
894
894
|
Город
|
|
895
895
|
</span>
|
|
896
896
|
<select
|
|
897
|
-
class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
897
|
+
class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
898
898
|
placeholder=""
|
|
899
899
|
style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
|
|
900
900
|
>
|
|
@@ -917,7 +917,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
|
|
|
917
917
|
Отделение
|
|
918
918
|
</span>
|
|
919
919
|
<select
|
|
920
|
-
class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
920
|
+
class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
921
921
|
placeholder=""
|
|
922
922
|
style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
|
|
923
923
|
>
|
|
@@ -991,7 +991,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
|
|
|
991
991
|
Размер
|
|
992
992
|
</span>
|
|
993
993
|
<select
|
|
994
|
-
class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
994
|
+
class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
995
995
|
placeholder=""
|
|
996
996
|
style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
|
|
997
997
|
>
|
|
@@ -1014,7 +1014,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
|
|
|
1014
1014
|
Параметры ячейки, мм (ВхШхД)
|
|
1015
1015
|
</span>
|
|
1016
1016
|
<select
|
|
1017
|
-
class="appearance-none h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
1017
|
+
class="appearance-none pl-0.5 h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer text-secondary-text"
|
|
1018
1018
|
placeholder=""
|
|
1019
1019
|
style="background: url(/icons/ArrowDownIcon.svg) no-repeat 50%;"
|
|
1020
1020
|
>
|
|
@@ -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"
|
|
@@ -1080,7 +1080,7 @@ exports[`Blocks SafeDepositRental should render block "SafeDepositRental" withou
|
|
|
1080
1080
|
role="button"
|
|
1081
1081
|
>
|
|
1082
1082
|
<div
|
|
1083
|
-
class="flex items-center justify-center gap-2 py-4 px-9
|
|
1083
|
+
class="group flex items-center justify-center gap-2 py-4 px-9 "
|
|
1084
1084
|
>
|
|
1085
1085
|
<div>
|
|
1086
1086
|
<div
|
|
@@ -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
|
|
|
@@ -24,7 +24,7 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const getButtonStyle = (props: ButtonInnerProps) => {
|
|
27
|
-
const { version, aboveText, rounded } = props;
|
|
27
|
+
const { className = '', version, aboveText, rounded } = props;
|
|
28
28
|
|
|
29
29
|
if (version === 'link') {
|
|
30
30
|
return '';
|
|
@@ -33,9 +33,10 @@ const getButtonStyle = (props: ButtonInnerProps) => {
|
|
|
33
33
|
const withTextStyle = `gap-2 ${aboveText ? 'py-2.5 px-7' : 'py-4 px-9'}`;
|
|
34
34
|
|
|
35
35
|
return [
|
|
36
|
-
'flex items-center justify-center',
|
|
36
|
+
'group flex items-center justify-center',
|
|
37
37
|
isWithText(props) ? withTextStyle : 'h-12 w-12',
|
|
38
38
|
rounded ? 'rounded-full' : '',
|
|
39
|
+
className,
|
|
39
40
|
].join(' ');
|
|
40
41
|
};
|
|
41
42
|
|
|
@@ -20,19 +20,24 @@ export const ButtonSection = JSX<ButtonSectionProps>(({ context, className = '',
|
|
|
20
20
|
) : null;
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
function renderButton(
|
|
23
|
+
function renderButton(
|
|
24
|
+
{ icon, iconRight, version = 'primary', ...button }: ButtonWithIconProps,
|
|
25
|
+
i: number,
|
|
26
|
+
) {
|
|
24
27
|
if (!button?.text) {
|
|
25
28
|
return null;
|
|
26
29
|
}
|
|
30
|
+
const imgStyle = version === 'primary' ? 'group-hover:text-black' : 'group-hover:text-white';
|
|
27
31
|
|
|
28
32
|
return icon ? (
|
|
29
33
|
<Button
|
|
30
34
|
key={String(i)}
|
|
31
|
-
appendLeft={<Img image={icon} width="24" height="24" asSVG />}
|
|
32
|
-
appendRight={<Img image={iconRight} width="24" height="24" asSVG />}
|
|
35
|
+
appendLeft={<Img imageClassName={imgStyle} image={icon} width="24" height="24" asSVG />}
|
|
36
|
+
appendRight={<Img imageClassName={imgStyle} image={iconRight} width="24" height="24" asSVG />}
|
|
37
|
+
version={version}
|
|
33
38
|
{...button}
|
|
34
39
|
/>
|
|
35
40
|
) : (
|
|
36
|
-
<Button key={String(i)} {...button} />
|
|
41
|
+
<Button key={String(i)} version={version} {...button} />
|
|
37
42
|
);
|
|
38
43
|
}
|
|
@@ -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=
|
|
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"
|
|
41
|
+
<span className="text-xl-light absolute right-4">₽</span>
|
|
66
42
|
</div>
|
|
67
43
|
</div>
|
|
68
44
|
);
|
|
@@ -16,7 +16,7 @@ export const Select = JSX<SelectProps>(
|
|
|
16
16
|
({ className = '', id, name, children, value, onChange }) => {
|
|
17
17
|
return (
|
|
18
18
|
<select
|
|
19
|
-
className={`appearance-none ${className}`}
|
|
19
|
+
className={`appearance-none pl-0.5 ${className}`}
|
|
20
20
|
style={selectStyle}
|
|
21
21
|
id={id}
|
|
22
22
|
name={name || id}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"./*.cjs": "./*.cjs"
|
|
56
56
|
},
|
|
57
57
|
"files": [
|
|
58
|
+
"bin",
|
|
58
59
|
"lib",
|
|
59
60
|
"mobile/lib",
|
|
60
61
|
"dist",
|
|
@@ -93,6 +94,7 @@
|
|
|
93
94
|
"lint": "eslint ./src",
|
|
94
95
|
"pretest": "npm run prepare && npm run lint",
|
|
95
96
|
"test": "jest --coverage",
|
|
97
|
+
"test:bin": "jest --config ./jest.config.bin.js",
|
|
96
98
|
"cosmos": "cosmos",
|
|
97
99
|
"cosmos:mobile": "cosmos --config cosmos.config.mobile.json",
|
|
98
100
|
"precosmos:export": "npm run build:icons",
|
|
@@ -121,6 +123,7 @@
|
|
|
121
123
|
"unified": "^10.1.2"
|
|
122
124
|
},
|
|
123
125
|
"devDependencies": {
|
|
126
|
+
"@babel/preset-env": "^7.19.4",
|
|
124
127
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
125
128
|
"@rollup/plugin-typescript": "^8.3.3",
|
|
126
129
|
"@size-limit/file": "^7.0.8",
|
|
@@ -132,6 +135,7 @@
|
|
|
132
135
|
"@typescript-eslint/experimental-utils": "^5.30.6",
|
|
133
136
|
"@typescript-eslint/parser": "^5.30.6",
|
|
134
137
|
"autoprefixer": "^10.4.7",
|
|
138
|
+
"babel-jest": "^28.1.3",
|
|
135
139
|
"copyfiles": "^2.4.1",
|
|
136
140
|
"css-loader": "^6.7.1",
|
|
137
141
|
"cssnano": "^5.1.11",
|
|
@@ -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>(
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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",
|