@redneckz/wildless-cms-uni-blocks 0.5.1 → 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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +19 -19
- 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/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/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/CurrencyInput/CurrencyInputProps.js +2 -0
- package/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- 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/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/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/mobile/bundle/bundle.umd.js +2 -0
- 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/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/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/CurrencyInput/CurrencyInputProps.js +2 -0
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.js.map +1 -0
- 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/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/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/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/__snapshots__/Blocks.spec.tsx.snap +3 -3
- package/mobile/src/model/ButtonVersion.ts +2 -2
- package/mobile/src/ui-kit/Button/Button.tsx +2 -0
- 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/package.json +1 -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/__snapshots__/Blocks.spec.tsx.snap +3 -3
- 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/buttonClassNameConstants.ts +2 -0
- package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +5 -29
- package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +10 -0
|
@@ -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
|
|
|
@@ -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)]"
|
|
@@ -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=
|
|
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
|
);
|
package/package.json
CHANGED
|
@@ -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
|
|
|
@@ -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)]"
|
|
@@ -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} {...
|
|
23
|
+
<DisabledButton rounded={rounded} {...usedProps}>
|
|
22
24
|
{buttonInner}
|
|
23
25
|
</DisabledButton>
|
|
24
26
|
) : (
|
|
25
|
-
<RegularButton rounded={rounded} {...
|
|
27
|
+
<RegularButton rounded={rounded} {...usedProps}>
|
|
26
28
|
{buttonInner}
|
|
27
29
|
</RegularButton>
|
|
28
30
|
);
|
|
@@ -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
|
);
|