@redneckz/wildless-cms-uni-blocks 0.14.533 → 0.14.535
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/migration-scripts/0.14.530.js +38 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +85 -47
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/bundle/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/bundle/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/bundle/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/bundle/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/dist/components/Carousel/Carousel.js +8 -3
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/dist/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/dist/components/Carousel/renderCarouselCards.js +3 -1
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/dist/components/StepsBlock/renderStepMobile.js +6 -19
- package/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/dist/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/dist/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/dist/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/dist/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/dist/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/dist/ui-kit/SwipeListControl/renderDotButton.js +13 -0
- package/dist/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.js +17 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +1 -0
- package/lib/components/Carousel/Carousel.js +8 -3
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/lib/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/lib/components/Carousel/renderCarouselCards.js +3 -1
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/lib/components/StepsBlock/renderStepMobile.js +6 -19
- package/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/lib/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/lib/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/lib/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/lib/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/lib/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/renderDotButton.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/renderDotButton.js +10 -0
- package/lib/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.js +14 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +91 -66
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/bundle/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/mobile/bundle/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/bundle/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/dist/components/Carousel/Carousel.js +8 -3
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js +3 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/dist/components/StepsBlock/renderStepMobile.js +6 -19
- package/mobile/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.js +13 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.js +17 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +8 -3
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js +3 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +1 -2
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/lib/components/StepsBlock/renderStepMobile.js +6 -19
- package/mobile/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.js +10 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.js +14 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/src/components/Carousel/Carousel.tsx +28 -17
- package/mobile/src/components/Carousel/CarouselContent.ts +2 -0
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +8 -1
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +7 -2
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +3 -1
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +0 -2
- package/mobile/src/components/StepsBlock/renderStep.tsx +1 -2
- package/mobile/src/components/StepsBlock/renderStepMobile.tsx +16 -38
- package/mobile/src/ui-kit/LinkButton/ButtonInner.tsx +2 -2
- package/mobile/src/ui-kit/SwipeListControl/NavButtonProp.ts +11 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +7 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListDots.tsx +69 -46
- package/mobile/src/ui-kit/SwipeListControl/SwipeListScrollButtons.tsx +9 -5
- package/mobile/src/ui-kit/SwipeListControl/renderDotButton.tsx +29 -0
- package/mobile/src/ui-kit/SwipeListControl/renderNavButton.tsx +33 -0
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +1 -1
- package/package.json +2 -2
- package/src/components/Carousel/Carousel.fixture.mobile.tsx +57 -0
- package/src/components/Carousel/Carousel.fixture.tsx +56 -0
- package/src/components/Carousel/Carousel.tsx +28 -17
- package/src/components/Carousel/CarouselContent.ts +2 -0
- package/src/components/Carousel/renderCarouselCards.tsx +8 -1
- package/src/components/ProductBlock/ProductBlock.tsx +7 -2
- package/src/components/ProductBlock/ProductBlockContent.ts +3 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +17 -84
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +0 -8
- package/src/components/StepsBlock/StepsBlockContent.ts +0 -2
- package/src/components/StepsBlock/renderStep.tsx +1 -2
- package/src/components/StepsBlock/renderStepMobile.tsx +16 -38
- package/src/ui-kit/LinkButton/ButtonInner.tsx +2 -2
- package/src/ui-kit/SwipeListControl/NavButtonProp.ts +11 -0
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +7 -1
- package/src/ui-kit/SwipeListControl/SwipeListDots.tsx +69 -46
- package/src/ui-kit/SwipeListControl/SwipeListScrollButtons.tsx +9 -5
- package/src/ui-kit/SwipeListControl/renderDotButton.tsx +29 -0
- package/src/ui-kit/SwipeListControl/renderNavButton.tsx +33 -0
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +1 -1
|
@@ -2,6 +2,7 @@ import '../../setup-fixture';
|
|
|
2
2
|
|
|
3
3
|
import { type Picture } from '../../model/Picture';
|
|
4
4
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
5
|
+
import { type ProductBlockContent } from '../ProductBlock/ProductBlockContent';
|
|
5
6
|
import { ProductGallery } from './ProductGallery';
|
|
6
7
|
|
|
7
8
|
const percentImage: Picture = {
|
|
@@ -14,24 +15,6 @@ const percentImage: Picture = {
|
|
|
14
15
|
alt: 'Ставка от 3,6% годовых',
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
const worker: Picture = {
|
|
18
|
-
src: 'money-2.png',
|
|
19
|
-
format: 'webp',
|
|
20
|
-
size: {
|
|
21
|
-
width: 280,
|
|
22
|
-
height: 280,
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const creditCard: Picture = {
|
|
27
|
-
src: 'credit-card-1.png',
|
|
28
|
-
format: 'webp',
|
|
29
|
-
size: {
|
|
30
|
-
width: 280,
|
|
31
|
-
height: 280,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
18
|
const __html = `
|
|
36
19
|
<ul>
|
|
37
20
|
<li>Потребительский кредит по специальной процентной ставке</li>
|
|
@@ -49,14 +32,14 @@ const buttons: LinkButtonContent[] = [
|
|
|
49
32
|
},
|
|
50
33
|
];
|
|
51
34
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
const productBlock: ProductBlockContent = {
|
|
36
|
+
title: 'Кредит по одному документу',
|
|
37
|
+
description: 'Ставка от 5,5% годовых',
|
|
38
|
+
headlineVersion: 'L',
|
|
39
|
+
__html,
|
|
40
|
+
buttons,
|
|
41
|
+
image: percentImage,
|
|
42
|
+
};
|
|
60
43
|
|
|
61
44
|
export default {
|
|
62
45
|
default: (
|
|
@@ -69,53 +52,28 @@ export default {
|
|
|
69
52
|
title: 'Кредит по одному документу',
|
|
70
53
|
description: 'Ставка от 5,5% годовых',
|
|
71
54
|
},
|
|
72
|
-
productBlock
|
|
73
|
-
title: 'Кредит по одному документу',
|
|
74
|
-
description: 'Ставка от 5,5% годовых',
|
|
75
|
-
headlineVersion: 'L',
|
|
76
|
-
__html,
|
|
77
|
-
buttons,
|
|
78
|
-
image: percentImage,
|
|
79
|
-
},
|
|
55
|
+
productBlock,
|
|
80
56
|
},
|
|
81
57
|
{
|
|
82
58
|
nav: {
|
|
83
59
|
title: 'Для людей в возрасте',
|
|
84
60
|
description: 'Ставка до 7% годовых',
|
|
85
61
|
},
|
|
86
|
-
productBlock
|
|
87
|
-
title: 'Ставка от 12,5% годовых на срок до 3 лет!',
|
|
88
|
-
headlineVersion: 'L',
|
|
89
|
-
__html,
|
|
90
|
-
buttons,
|
|
91
|
-
image: worker,
|
|
92
|
-
},
|
|
62
|
+
productBlock,
|
|
93
63
|
},
|
|
94
64
|
{
|
|
95
65
|
nav: {
|
|
96
66
|
title: 'Выгодно покупать',
|
|
97
67
|
description: 'Ставка от 5% годовых',
|
|
98
68
|
},
|
|
99
|
-
productBlock
|
|
100
|
-
title: 'Дополнительные бонусные баллы за покупки!',
|
|
101
|
-
headlineVersion: 'L',
|
|
102
|
-
__html,
|
|
103
|
-
buttons,
|
|
104
|
-
image: creditCard,
|
|
105
|
-
},
|
|
69
|
+
productBlock,
|
|
106
70
|
},
|
|
107
71
|
{
|
|
108
72
|
nav: {
|
|
109
73
|
title: 'Карты Unionpay',
|
|
110
74
|
description: '120 дней льготный период',
|
|
111
75
|
},
|
|
112
|
-
productBlock
|
|
113
|
-
title: 'Карты Unionpay',
|
|
114
|
-
headlineVersion: 'L',
|
|
115
|
-
__html,
|
|
116
|
-
buttons,
|
|
117
|
-
image: creditCard,
|
|
118
|
-
},
|
|
76
|
+
productBlock,
|
|
119
77
|
},
|
|
120
78
|
]}
|
|
121
79
|
/>
|
|
@@ -132,53 +90,28 @@ export default {
|
|
|
132
90
|
title: 'Кредит по одному документу',
|
|
133
91
|
description: 'Ставка от 5,5% годовых',
|
|
134
92
|
},
|
|
135
|
-
productBlock
|
|
136
|
-
title: 'Кредит по одному документу',
|
|
137
|
-
description: 'Кредит наличными без залога и поручительства, только по паспорту',
|
|
138
|
-
headlineVersion: 'L',
|
|
139
|
-
__html,
|
|
140
|
-
buttons: buttonsSecondary,
|
|
141
|
-
image: percentImage,
|
|
142
|
-
},
|
|
93
|
+
productBlock,
|
|
143
94
|
},
|
|
144
95
|
{
|
|
145
96
|
nav: {
|
|
146
97
|
title: 'Для людей в возрасте',
|
|
147
98
|
description: 'Ставка до 7% годовых',
|
|
148
99
|
},
|
|
149
|
-
productBlock
|
|
150
|
-
title: 'Ставка от 12,5% годовых на срок до 3 лет!',
|
|
151
|
-
headlineVersion: 'L',
|
|
152
|
-
__html,
|
|
153
|
-
buttons: buttonsSecondary,
|
|
154
|
-
image: worker,
|
|
155
|
-
},
|
|
100
|
+
productBlock,
|
|
156
101
|
},
|
|
157
102
|
{
|
|
158
103
|
nav: {
|
|
159
104
|
title: 'Выгодно покупать',
|
|
160
105
|
description: 'Ставка от 5% годовых',
|
|
161
106
|
},
|
|
162
|
-
productBlock
|
|
163
|
-
title: 'Дополнительные бонусные баллы за покупки!',
|
|
164
|
-
headlineVersion: 'L',
|
|
165
|
-
__html,
|
|
166
|
-
buttons: buttonsSecondary,
|
|
167
|
-
image: creditCard,
|
|
168
|
-
},
|
|
107
|
+
productBlock,
|
|
169
108
|
},
|
|
170
109
|
{
|
|
171
110
|
nav: {
|
|
172
111
|
title: 'Карты Unionpay',
|
|
173
112
|
description: '120 дней льготный период',
|
|
174
113
|
},
|
|
175
|
-
productBlock
|
|
176
|
-
title: 'Карты Unionpay',
|
|
177
|
-
headlineVersion: 'L',
|
|
178
|
-
__html,
|
|
179
|
-
buttons: buttonsSecondary,
|
|
180
|
-
image: creditCard,
|
|
181
|
-
},
|
|
114
|
+
productBlock,
|
|
182
115
|
},
|
|
183
116
|
]}
|
|
184
117
|
/>
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import { type Picture } from '../../model/Picture';
|
|
2
1
|
import '../../setup-fixture';
|
|
3
2
|
|
|
4
3
|
import { StepsBlock } from './StepsBlock';
|
|
5
4
|
import { type StepProps } from './StepsBlockContent';
|
|
6
5
|
|
|
7
|
-
const percentImage: Picture = {
|
|
8
|
-
src: '3-6-percent.png',
|
|
9
|
-
format: 'webp',
|
|
10
|
-
alt: 'Ставка от 3,6% годовых',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
6
|
const steps: StepProps[] = [
|
|
14
7
|
{
|
|
15
8
|
label: 'Заявка на кредит',
|
|
@@ -41,7 +34,6 @@ const STEPS_WITH_ICONS: StepProps[] = [
|
|
|
41
34
|
{
|
|
42
35
|
label: 'В офисах Россельхозбанка',
|
|
43
36
|
description: 'Откройте вклад',
|
|
44
|
-
image: percentImage,
|
|
45
37
|
},
|
|
46
38
|
];
|
|
47
39
|
|
|
@@ -2,7 +2,6 @@ import { type BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import { type BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import { type DescriptionProps, type LabelProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
-
import { type ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
5
|
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
7
6
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
8
7
|
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
@@ -12,7 +11,6 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
12
11
|
* @title Шаг
|
|
13
12
|
*/
|
|
14
13
|
export type StepProps = DescriptionProps &
|
|
15
|
-
ImageContent &
|
|
16
14
|
LabelProps &
|
|
17
15
|
RichTextProps &
|
|
18
16
|
IconProps &
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
3
2
|
import { type VNode } from '../../model/VNode';
|
|
4
3
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
5
4
|
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
@@ -43,7 +42,7 @@ export const renderStep =
|
|
|
43
42
|
{button?.text ? (
|
|
44
43
|
<LinkButton
|
|
45
44
|
className="box-border py-s w-full max-w-60 mt-auto"
|
|
46
|
-
version={version
|
|
45
|
+
version={version}
|
|
47
46
|
{...button}
|
|
48
47
|
>
|
|
49
48
|
{button?.text}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
2
2
|
import { type IconVersion } from '../../model/IconVersion';
|
|
3
|
-
import { type LinkButtonVersion } from '../../model/LinkButtonVersion';
|
|
4
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
5
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
@@ -17,14 +16,11 @@ const styleMap = STEPS_BLOCK_STYLE;
|
|
|
17
16
|
export const renderStepMobile =
|
|
18
17
|
(stepsSize: boolean, version: BlockVersion, stepVersion: BlockVersion) =>
|
|
19
18
|
(step: StepProps, i: number) => {
|
|
20
|
-
const { button
|
|
21
|
-
|
|
22
|
-
const styleStepMobile = button?.text && image?.src;
|
|
19
|
+
const { button } = step;
|
|
23
20
|
|
|
24
21
|
return (
|
|
25
22
|
<div key={String(i)} className="contents">
|
|
26
|
-
<div className=
|
|
27
|
-
{image?.src ? renderText(step) : null}
|
|
23
|
+
<div className="flex items-center relative flex-row">
|
|
28
24
|
<div className="overflow-hidden flex flex-shrink-0 items-center">
|
|
29
25
|
{renderIconArea(stepsSize, stepVersion)(step, i)}
|
|
30
26
|
</div>
|
|
@@ -33,11 +29,11 @@ export const renderStepMobile =
|
|
|
33
29
|
'min-h-6xl': stepsSize,
|
|
34
30
|
})}
|
|
35
31
|
>
|
|
36
|
-
{
|
|
37
|
-
{
|
|
32
|
+
{renderText(step)}
|
|
33
|
+
{button?.text ? (
|
|
38
34
|
<LinkButton
|
|
39
35
|
className="box-border py-s w-full max-w-60 mt-lg"
|
|
40
|
-
version={version
|
|
36
|
+
version={version}
|
|
41
37
|
{...button}
|
|
42
38
|
>
|
|
43
39
|
{button?.text}
|
|
@@ -55,15 +51,10 @@ const renderIconArea =
|
|
|
55
51
|
const isImg = Boolean(step?.icon?.src);
|
|
56
52
|
const iconAreaSize = getIconAreaSize(stepsSize, isImg);
|
|
57
53
|
const containerVersion = isImg ? stepVersion === 'transparent' : stepVersion;
|
|
58
|
-
const isImgSrc = step.image?.src;
|
|
59
54
|
|
|
60
55
|
return (
|
|
61
56
|
<BlockWrapper
|
|
62
|
-
className={style(
|
|
63
|
-
{ 'w-32': Boolean(isImgSrc) },
|
|
64
|
-
'z-10 mr-s flex justify-center content-center rounded-md',
|
|
65
|
-
!isImgSrc && iconAreaSize,
|
|
66
|
-
)}
|
|
57
|
+
className={style('z-10 mr-s flex justify-center content-center rounded-md', iconAreaSize)}
|
|
67
58
|
defaultPadding=""
|
|
68
59
|
version={containerVersion as BlockVersion}
|
|
69
60
|
>
|
|
@@ -75,14 +66,8 @@ const renderIconArea =
|
|
|
75
66
|
};
|
|
76
67
|
|
|
77
68
|
const renderText = (step: StepProps) => {
|
|
78
|
-
const visibleStyle = Boolean(step.button?.text && step.image?.src);
|
|
79
|
-
|
|
80
69
|
return (
|
|
81
|
-
<div
|
|
82
|
-
className={style({
|
|
83
|
-
'mb-lg w-full': visibleStyle,
|
|
84
|
-
})}
|
|
85
|
-
>
|
|
70
|
+
<div>
|
|
86
71
|
{step?.label ? (
|
|
87
72
|
<Paragraph size="text-l" align="text-left">
|
|
88
73
|
{step.label}
|
|
@@ -112,21 +97,15 @@ const renderIcon = ({
|
|
|
112
97
|
iconVersion: IconVersion;
|
|
113
98
|
i: number;
|
|
114
99
|
stepVersion: BlockVersion;
|
|
115
|
-
}) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
);
|
|
125
|
-
} else if (isIcon(step.image)) {
|
|
126
|
-
return <Img image={{ ...step.image, size: { width: 120, height: 120 } }} />;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return (
|
|
100
|
+
}) =>
|
|
101
|
+
isIcon(step?.icon) ? (
|
|
102
|
+
<Img
|
|
103
|
+
image={{ ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }}
|
|
104
|
+
imageClassName="max-w-full max-h-full"
|
|
105
|
+
width="24"
|
|
106
|
+
height="24"
|
|
107
|
+
/>
|
|
108
|
+
) : (
|
|
130
109
|
<span
|
|
131
110
|
className={style(
|
|
132
111
|
'text-h4',
|
|
@@ -136,4 +115,3 @@ const renderIcon = ({
|
|
|
136
115
|
{i + 1}
|
|
137
116
|
</span>
|
|
138
117
|
);
|
|
139
|
-
};
|
|
@@ -10,7 +10,7 @@ export const ButtonInner = JSX<LinkButtonProps>((props) => {
|
|
|
10
10
|
const iconHideStyle = isWithText(props) ? 'hidden lg:block' : '';
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
|
-
<div className={style(
|
|
13
|
+
<div className={style(buttonStyle(props), 'flex gap-xs')}>
|
|
14
14
|
{appendLeft ? (
|
|
15
15
|
<div className={style(iconHideStyle, iconStyleMap[version])}>{appendLeft}</div>
|
|
16
16
|
) : null}
|
|
@@ -27,7 +27,7 @@ export const ButtonInner = JSX<LinkButtonProps>((props) => {
|
|
|
27
27
|
);
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const buttonStyle = (props: LinkButtonContent) => {
|
|
31
31
|
const { version, aboveText, rounded } = props;
|
|
32
32
|
|
|
33
33
|
if (version === 'link') {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
|
|
2
|
+
import type { SwipeListControlType } from './SwipeListControlContent';
|
|
3
|
+
|
|
4
|
+
export interface DotProp {
|
|
5
|
+
activeIndex?: number;
|
|
6
|
+
onClick: (i: number) => void;
|
|
7
|
+
listType?: SwipeListControlType;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** @title Кнопка под слайдом */
|
|
11
|
+
export type NavButtonProp = TitleProps & DescriptionProps;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
3
3
|
import { style } from '../../utils/style';
|
|
4
|
+
import { type NavButtonProp } from './NavButtonProp';
|
|
4
5
|
import { SwipeListContainer, type SnapAlign } from './SwipeListContainer';
|
|
5
6
|
import { type SwipeListControlContent } from './SwipeListControlContent';
|
|
6
7
|
import { SwipeListDots } from './SwipeListDots';
|
|
@@ -24,6 +25,7 @@ interface SwipeListControlProps extends SwipeListControlContent {
|
|
|
24
25
|
snapAlign?: SnapAlign;
|
|
25
26
|
hasBlur?: boolean;
|
|
26
27
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
28
|
+
navButtons?: NavButtonProp[];
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
@@ -42,6 +44,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
42
44
|
showDots,
|
|
43
45
|
children,
|
|
44
46
|
onVisibleIndicesChange,
|
|
47
|
+
navButtons,
|
|
45
48
|
}) => {
|
|
46
49
|
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
47
50
|
|
|
@@ -71,14 +74,17 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
71
74
|
scroll={scroll}
|
|
72
75
|
hasBlur={hasBlur}
|
|
73
76
|
arrowsPadded={arrowsPadded}
|
|
77
|
+
isBottom={Boolean(navButtons?.length)}
|
|
74
78
|
/>
|
|
75
79
|
<SwipeListDots
|
|
76
80
|
className={style(!showDots && 'lg:hidden')}
|
|
77
|
-
containerRef={containerRef}
|
|
78
81
|
activeIndex={activeIndex}
|
|
79
82
|
dotCount={itemCount}
|
|
80
83
|
listType={listType}
|
|
81
84
|
version={version}
|
|
85
|
+
navButtons={navButtons}
|
|
86
|
+
containerRef={containerRef}
|
|
87
|
+
containerScroll={scroll}
|
|
82
88
|
/>
|
|
83
89
|
</div>
|
|
84
90
|
);
|
|
@@ -1,74 +1,97 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useMobileMode } from '../../hooks/useMobileMode';
|
|
2
4
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
3
5
|
import { style } from '../../utils/style';
|
|
6
|
+
import { type NavButtonProp } from './NavButtonProp';
|
|
7
|
+
import { renderDotButton } from './renderDotButton';
|
|
8
|
+
import { renderNavButton } from './renderNavButton';
|
|
9
|
+
import { SwipeListContainer } from './SwipeListContainer';
|
|
4
10
|
import { type SwipeListControlType } from './SwipeListControlContent';
|
|
11
|
+
import { useSwipeListScroll, type SwipeListScroll } from './useSwipeListScroll';
|
|
5
12
|
|
|
6
13
|
const containerStyles: Record<SwipeListControlType, string> = {
|
|
7
14
|
'horizontal-list': 'mx-auto mt-lg w-fit',
|
|
8
15
|
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
9
16
|
};
|
|
10
17
|
|
|
11
|
-
const activeDotStyles: Record<SwipeListControlType, string> = {
|
|
12
|
-
'horizontal-list': 'w-6',
|
|
13
|
-
'vertical-list': 'h-6',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const dotStyle =
|
|
17
|
-
'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white';
|
|
18
|
-
|
|
19
|
-
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
20
|
-
|
|
21
18
|
interface SwipeListDotsProps {
|
|
22
19
|
className?: string;
|
|
23
|
-
containerRef?: { current: HTMLDivElement | null };
|
|
24
20
|
activeIndex?: number;
|
|
25
21
|
dotCount?: number;
|
|
26
22
|
listType?: SwipeListControlType;
|
|
27
23
|
version?: BlockVersion;
|
|
24
|
+
navButtons?: NavButtonProp[];
|
|
25
|
+
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
26
|
+
containerRef?: { current: HTMLDivElement | null };
|
|
27
|
+
containerScroll?: SwipeListScroll;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
29
|
export const SwipeListDots = JSX<SwipeListDotsProps>(
|
|
31
30
|
({
|
|
32
31
|
className = '',
|
|
33
|
-
|
|
34
|
-
activeIndex,
|
|
32
|
+
activeIndex = 0,
|
|
35
33
|
dotCount = 0,
|
|
36
34
|
listType = 'horizontal-list',
|
|
37
35
|
version,
|
|
36
|
+
navButtons = [],
|
|
37
|
+
containerRef,
|
|
38
|
+
containerScroll,
|
|
38
39
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const isMobileMode = useMobileMode();
|
|
41
|
+
const [navRef, navScroll] = useSwipeListScroll<HTMLDivElement>({
|
|
42
|
+
itemCount: navButtons.length,
|
|
43
|
+
});
|
|
44
|
+
const scrollOption = getOptions(Boolean(navButtons?.length));
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (navButtons?.length && activeIndex >= 0 && navRef?.current) {
|
|
48
|
+
navScroll.scrollTo(activeIndex, scrollOption);
|
|
45
49
|
}
|
|
46
|
-
};
|
|
50
|
+
}, [activeIndex]);
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
52
|
+
const onChangeActiveIndex = useCallback(
|
|
53
|
+
(idx: number) => {
|
|
54
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
55
|
+
containerScroll?.scrollTo(idx, scrollOption);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[containerRef?.current],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
if (navButtons?.length && !isMobileMode) {
|
|
62
|
+
return (
|
|
63
|
+
<SwipeListContainer
|
|
64
|
+
containerRef={navRef}
|
|
65
|
+
snapAlign="snap-start"
|
|
66
|
+
itemClassName="h-36 flex items-stretch w-screen"
|
|
67
|
+
gap={8}
|
|
68
|
+
>
|
|
69
|
+
{navButtons.map(renderNavButton({ activeIndex, onClick: onChangeActiveIndex }))}
|
|
70
|
+
</SwipeListContainer>
|
|
71
|
+
);
|
|
72
|
+
} else if (dotCount) {
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
className={style(
|
|
76
|
+
'flex gap-xs',
|
|
77
|
+
containerStyles[listType],
|
|
78
|
+
version ? 'group' : '',
|
|
79
|
+
className,
|
|
80
|
+
{ 'pb-xl': navButtons?.length && isMobileMode },
|
|
81
|
+
)}
|
|
82
|
+
data-ver={version}
|
|
83
|
+
>
|
|
84
|
+
{Array.from({ length: dotCount })
|
|
85
|
+
.fill(null)
|
|
86
|
+
.map(renderDotButton({ activeIndex, onClick: onChangeActiveIndex, listType }))}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return null;
|
|
73
92
|
},
|
|
74
93
|
);
|
|
94
|
+
|
|
95
|
+
const getOptions = (isAuto = false): ScrollIntoViewOptions => ({
|
|
96
|
+
behavior: isAuto ? 'auto' : 'smooth',
|
|
97
|
+
});
|
|
@@ -4,31 +4,32 @@ import { ScrollLeftButton, ScrollRightButton } from '../LinkButton/ArrowButton';
|
|
|
4
4
|
import { type SwipeListScrollButtonsContent } from './SwipeListControlContent';
|
|
5
5
|
import { type SwipeListScroll } from './useSwipeListScroll';
|
|
6
6
|
|
|
7
|
-
const scrollButtonStyle = 'absolute top-[calc(50%-24px)] z-40';
|
|
8
7
|
const blurBaseStyle = 'absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none';
|
|
9
8
|
|
|
10
9
|
export interface SwipeListScrollButtonsProps extends SwipeListScrollButtonsContent {
|
|
11
10
|
className?: string;
|
|
12
11
|
scroll: SwipeListScroll;
|
|
13
12
|
hasBlur?: boolean;
|
|
13
|
+
isBottom?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const SwipeListScrollButtons = JSX<SwipeListScrollButtonsProps>(
|
|
17
|
-
({ className, scroll, hasBlur, arrowsPadded }) => {
|
|
17
|
+
({ className, scroll, hasBlur, arrowsPadded, isBottom }) => {
|
|
18
18
|
const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
|
|
19
|
+
const isArrowPadded = arrowsPadded && !isBottom;
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
|
-
<div className={
|
|
22
|
+
<div className={className}>
|
|
22
23
|
{hasBlur ? renderBlur(scroll) : null}
|
|
23
24
|
{canScrollLeft ? (
|
|
24
25
|
<ScrollLeftButton
|
|
25
|
-
className={style(
|
|
26
|
+
className={style(buttonStyle(isBottom), isArrowPadded ? 'left-1' : 'left-0')}
|
|
26
27
|
onClick={scrollLeft}
|
|
27
28
|
/>
|
|
28
29
|
) : null}
|
|
29
30
|
{canScrollRight ? (
|
|
30
31
|
<ScrollRightButton
|
|
31
|
-
className={style(
|
|
32
|
+
className={style(buttonStyle(isBottom), isArrowPadded ? 'right-1' : 'right-0')}
|
|
32
33
|
onClick={scrollRight}
|
|
33
34
|
/>
|
|
34
35
|
) : null}
|
|
@@ -54,3 +55,6 @@ const renderBlur = (scroll: SwipeListScroll) => (
|
|
|
54
55
|
) : null}
|
|
55
56
|
</div>
|
|
56
57
|
);
|
|
58
|
+
|
|
59
|
+
const buttonStyle = (isBottom = false) =>
|
|
60
|
+
style('absolute z-40', isBottom ? 'bottom-[56px]' : 'top-[calc(50%-24px)]');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { style } from '../../utils/style';
|
|
2
|
+
import type { DotProp } from './NavButtonProp';
|
|
3
|
+
import type { SwipeListControlType } from './SwipeListControlContent';
|
|
4
|
+
|
|
5
|
+
const activeDotStyles: Record<SwipeListControlType, string> = {
|
|
6
|
+
'horizontal-list': 'w-6',
|
|
7
|
+
'vertical-list': 'h-6',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const dotStyle =
|
|
11
|
+
'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white';
|
|
12
|
+
|
|
13
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
14
|
+
|
|
15
|
+
export const renderDotButton =
|
|
16
|
+
({ activeIndex, onClick, listType = 'horizontal-list' }: DotProp) =>
|
|
17
|
+
(_: any, idx: number) =>
|
|
18
|
+
(
|
|
19
|
+
<div
|
|
20
|
+
key={String(idx)}
|
|
21
|
+
className={style(
|
|
22
|
+
dotStyle,
|
|
23
|
+
idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle,
|
|
24
|
+
)}
|
|
25
|
+
role="button"
|
|
26
|
+
aria-hidden
|
|
27
|
+
onClick={() => onClick(idx)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { style } from '../../utils/style';
|
|
2
|
+
import { type DotProp, type NavButtonProp } from './NavButtonProp';
|
|
3
|
+
|
|
4
|
+
export const renderNavButton =
|
|
5
|
+
({ activeIndex, onClick }: DotProp) =>
|
|
6
|
+
(nav: NavButtonProp, i: number) => {
|
|
7
|
+
const isActive = i === activeIndex;
|
|
8
|
+
const btnClassName = isActive
|
|
9
|
+
? 'min-w-[350px] bg-white shadow-dark-blue border-none p-6'
|
|
10
|
+
: 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur';
|
|
11
|
+
const btnTitleClassName = isActive
|
|
12
|
+
? 'text-primary-text text-h6 py-xs'
|
|
13
|
+
: 'text-l pb-2xs text-secondary-text group-data-secondary:text-white';
|
|
14
|
+
const btnDescClassName = isActive ? 'text-l' : 'text-m group-data-secondary:text-white/80';
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
key={String(i)}
|
|
20
|
+
onClick={() => onClick(i)}
|
|
21
|
+
aria-label={nav?.title}
|
|
22
|
+
className={style(
|
|
23
|
+
'max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap',
|
|
24
|
+
btnClassName,
|
|
25
|
+
)}
|
|
26
|
+
>
|
|
27
|
+
<div className={btnTitleClassName}>{nav?.title}</div>
|
|
28
|
+
<div className={style('text-secondary-text font-light', btnDescClassName)}>
|
|
29
|
+
{nav?.description}
|
|
30
|
+
</div>
|
|
31
|
+
</button>
|
|
32
|
+
);
|
|
33
|
+
};
|