@redneckz/wildless-cms-uni-blocks 0.3.29 → 0.3.32
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/README.md +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +70 -55
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/Accordion.js +2 -6
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +3 -3
- package/dist/components/Accordion/AccordionItem.js +4 -11
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/Accordion/AccordionItem.mobile.js +6 -3
- package/dist/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/dist/components/Accordion/AccordionItemInner.js +2 -2
- package/dist/components/Accordion/AccordionItemInner.js.map +1 -1
- package/dist/components/Accordion/AccordionItemInner.mobile.js +2 -3
- package/dist/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
- package/dist/components/Footer/MediaButton.js +1 -1
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/dist/components/PictureText/PictureText.js +8 -4
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +7 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/dist/components/Recommendation/Recommendation.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +8 -2
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +10 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/dist/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.d.ts +8 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.js +17 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.js.map +1 -0
- package/dist/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/dist/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.js +1 -1
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/dist/ui-kit/Tabs/Tabs.js +1 -1
- package/dist/ui-kit/Tabs/Tabs.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.js +2 -6
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/AccordionContent.d.ts +3 -3
- package/lib/components/Accordion/AccordionItem.js +4 -11
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/Accordion/AccordionItem.mobile.js +6 -3
- package/lib/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/lib/components/Accordion/AccordionItemInner.js +2 -2
- package/lib/components/Accordion/AccordionItemInner.js.map +1 -1
- package/lib/components/Accordion/AccordionItemInner.mobile.js +2 -3
- package/lib/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
- package/lib/components/Footer/MediaButton.js +1 -1
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/lib/components/PictureText/PictureText.js +8 -4
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/PictureTextContent.d.ts +7 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.fixture.d.ts +1 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/lib/components/Recommendation/Recommendation.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +1 -0
- package/lib/components/StepsBlock/StepsBlock.js +8 -2
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +10 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/lib/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.d.ts +8 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.js +15 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.js.map +1 -0
- package/lib/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/lib/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.js +1 -1
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +3 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +4 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/lib/ui-kit/Tabs/Tabs.js +1 -1
- package/lib/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +87 -189
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Accordion/AccordionContent.d.ts +3 -3
- package/mobile/dist/components/Accordion/AccordionItem.js +6 -3
- package/mobile/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/dist/components/Accordion/AccordionItemInner.js +2 -3
- package/mobile/dist/components/Accordion/AccordionItemInner.js.map +1 -1
- package/mobile/dist/components/Footer/MediaButton.js +1 -1
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/mobile/dist/components/PictureText/PictureText.js +8 -4
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureTextContent.d.ts +7 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/mobile/dist/components/Recommendation/Recommendation.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +10 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.d.ts +0 -4
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js +0 -8
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -1
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.js +1 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionContent.d.ts +3 -3
- package/mobile/lib/components/Accordion/AccordionItem.js +6 -3
- package/mobile/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionItemInner.js +2 -3
- package/mobile/lib/components/Accordion/AccordionItemInner.js.map +1 -1
- package/mobile/lib/components/Footer/MediaButton.js +1 -1
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/mobile/lib/components/PictureText/PictureText.js +8 -4
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureTextContent.d.ts +7 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/mobile/lib/components/Recommendation/Recommendation.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +10 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.d.ts +0 -4
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js +0 -8
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -1
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.js +1 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/src/components/Accordion/Accordion.example.json +3 -0
- package/mobile/src/components/Accordion/AccordionContent.ts +4 -5
- package/mobile/src/components/Accordion/AccordionItem.tsx +32 -27
- package/mobile/src/components/Accordion/AccordionItemInner.tsx +8 -11
- package/mobile/src/components/Footer/MediaButton.tsx +1 -1
- package/mobile/src/components/Header/Header.example.json +3 -0
- package/mobile/src/components/OtherProducts/OtherProductsContent.ts +3 -12
- package/mobile/src/components/PictureText/PictureText.example.json +2 -0
- package/mobile/src/components/PictureText/PictureText.tsx +33 -7
- package/mobile/src/components/PictureText/PictureTextContent.ts +7 -0
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
- package/mobile/src/components/Recommendation/Recommendation.tsx +1 -1
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +14 -5
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -2
- package/mobile/src/components/TextBlock/TextBlockContent.ts +1 -1
- package/mobile/src/ui-kit/BlocksList/EmbeddableBlocks.tsx +0 -8
- package/mobile/src/ui-kit/BlocksList/renderBlocksList.tsx +4 -12
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +18 -0
- package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +10 -2
- package/mobile/src/ui-kit/Tabs/Tabs.tsx +1 -1
- package/package.json +2 -3
- package/src/components/Accordion/Accordion.example.json +3 -0
- package/src/components/Accordion/Accordion.fixture.mobile.tsx +1 -0
- package/src/components/Accordion/Accordion.fixture.tsx +2 -0
- package/src/components/Accordion/Accordion.tsx +4 -17
- package/src/components/Accordion/AccordionContent.ts +4 -5
- package/src/components/Accordion/AccordionItem.mobile.tsx +32 -27
- package/src/components/Accordion/AccordionItem.tsx +23 -49
- package/src/components/Accordion/AccordionItemInner.mobile.tsx +8 -11
- package/src/components/Accordion/AccordionItemInner.tsx +8 -10
- package/src/components/Footer/MediaButton.tsx +1 -1
- package/src/components/Header/Header.example.json +3 -0
- package/src/components/Header/Header.tsx +8 -1
- package/src/components/MobileAppTile/MobileAppTile.tsx +3 -3
- package/src/components/OtherProducts/OtherProducts.fixture.tsx +61 -6
- package/src/components/OtherProducts/OtherProductsContent.ts +3 -12
- package/src/components/PictureText/PictureText.example.json +2 -0
- package/src/components/PictureText/PictureText.tsx +33 -7
- package/src/components/PictureText/PictureTextContent.ts +7 -0
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.fixture.tsx +74 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
- package/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
- package/src/components/Recommendation/Recommendation.tsx +1 -1
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +14 -0
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +14 -5
- package/src/components/StepsBlock/StepsBlock.tsx +13 -6
- package/src/components/StepsBlock/StepsBlockContent.ts +3 -2
- package/src/components/TextBlock/TextBlockContent.ts +1 -1
- package/src/ui-kit/BlocksList/EmbeddableBlocks.mobile.tsx +15 -0
- package/src/ui-kit/BlocksList/renderBlocksList.tsx +4 -12
- package/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/src/ui-kit/Heading/Heading.tsx +1 -3
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +24 -6
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +18 -0
- package/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +10 -2
- package/src/ui-kit/Tabs/Tabs.tsx +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { BlockVersion } from '../../model/BlockVersion';
|
|
3
2
|
import type { UniBlockProps } from '../../types';
|
|
4
3
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
5
4
|
import type { AccordionItemCommonProps } from './AccordionContent';
|
|
@@ -8,52 +7,27 @@ import { useActiveHandler } from './useActiveHandler';
|
|
|
8
7
|
|
|
9
8
|
export interface AccordionItemProps extends AccordionItemCommonProps, UniBlockProps {}
|
|
10
9
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export const AccordionItem = JSX<AccordionItemProps>(({ label, isExpanded, blocks, context }) => {
|
|
11
|
+
const { isActive, hasContent, icon, handleToggle } = useActiveHandler({
|
|
12
|
+
context,
|
|
13
|
+
blocks,
|
|
14
|
+
initialState: isExpanded,
|
|
15
|
+
});
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
buttonStyleMap[version]
|
|
34
|
-
}
|
|
35
|
-
${hasContent ? 'group cursor-pointer' : ''}`}
|
|
36
|
-
onClick={handleToggle}
|
|
37
|
-
>
|
|
38
|
-
<span
|
|
39
|
-
className={`text-xl pr-2.5 font-medium ${
|
|
40
|
-
hasContent ? buttonHoverStyleMap[version] : ''
|
|
41
|
-
}`}
|
|
42
|
-
>
|
|
43
|
-
{label}
|
|
44
|
-
</span>
|
|
45
|
-
{hasContent ? <Icon name={icon} width="24" height="24" asSVG /> : null}
|
|
46
|
-
</button>
|
|
47
|
-
{hasContent ? (
|
|
48
|
-
<AccordionItemInner
|
|
49
|
-
isExpanded={isActive}
|
|
50
|
-
columns={columns}
|
|
51
|
-
blocks={blocks}
|
|
52
|
-
version={version}
|
|
53
|
-
context={context}
|
|
54
|
-
/>
|
|
55
|
-
) : null}
|
|
56
|
-
</li>
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
);
|
|
17
|
+
return (
|
|
18
|
+
<li className="border-0 border-b border-solid border-main-divider last:border-b-0">
|
|
19
|
+
<button
|
|
20
|
+
className={`border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans
|
|
21
|
+
${hasContent ? 'group cursor-pointer' : ''}
|
|
22
|
+
`}
|
|
23
|
+
onClick={handleToggle}
|
|
24
|
+
>
|
|
25
|
+
<span className={`text-xl pr-2.5 font-medium`}>{label}</span>
|
|
26
|
+
{hasContent ? <Icon name={icon} width="24" height="24" asSVG /> : null}
|
|
27
|
+
</button>
|
|
28
|
+
{hasContent ? (
|
|
29
|
+
<AccordionItemInner isExpanded={isActive} blocks={blocks} context={context} />
|
|
30
|
+
) : null}
|
|
31
|
+
</li>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
@@ -2,14 +2,11 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { AccordionItemProps } from './AccordionItem';
|
|
3
3
|
import { renderBlocksList } from '../../ui-kit/BlocksList/renderBlocksList';
|
|
4
4
|
|
|
5
|
-
export const AccordionItemInner = JSX<AccordionItemProps>(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
);
|
|
14
|
-
},
|
|
15
|
-
);
|
|
5
|
+
export const AccordionItemInner = JSX<AccordionItemProps>(({ blocks, context }) => {
|
|
6
|
+
const className = 'mb-5 last:mb-0 first:mt-2';
|
|
7
|
+
return (
|
|
8
|
+
<div className="transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0">
|
|
9
|
+
{renderBlocksList({ context, className, blocks })}
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -2,13 +2,11 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { AccordionItemProps } from './AccordionItem';
|
|
3
3
|
import { renderBlocksList } from '../../ui-kit/BlocksList/renderBlocksList';
|
|
4
4
|
|
|
5
|
-
export const AccordionItemInner = JSX<AccordionItemProps>(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
);
|
|
5
|
+
export const AccordionItemInner = JSX<AccordionItemProps>(({ blocks, context }) => {
|
|
6
|
+
const className = 'mb-5 last:mb-0 pb-5';
|
|
7
|
+
return (
|
|
8
|
+
<div className="transition-all duration-300 max-h-0 overflow-hidden">
|
|
9
|
+
{renderBlocksList({ context, className, blocks })}
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -32,7 +32,7 @@ export const MediaButton = JSX<MediaButtonProps>(({ href }) => {
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<a
|
|
35
|
-
className="flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[
|
|
35
|
+
className="flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[40px] h-[40px] box-border hover:text-primary-main"
|
|
36
36
|
href={href}
|
|
37
37
|
aria-label={label}
|
|
38
38
|
target="_blank"
|
|
@@ -20,7 +20,14 @@ const BORDER_COLORS: Record<BgColorVersion, string> = {
|
|
|
20
20
|
export interface HeaderProps extends HeaderContent, UniBlockProps {}
|
|
21
21
|
|
|
22
22
|
export const Header = JSX<HeaderProps>(
|
|
23
|
-
({
|
|
23
|
+
({
|
|
24
|
+
className,
|
|
25
|
+
defaultLocation = 'Москва',
|
|
26
|
+
bgColor = 'bg-white',
|
|
27
|
+
context,
|
|
28
|
+
topItems,
|
|
29
|
+
anchor = null,
|
|
30
|
+
}) => {
|
|
24
31
|
const router = context.useRouter();
|
|
25
32
|
const sitemap = useSitemap(context.useAsyncData);
|
|
26
33
|
const { handlerDecorator } = context;
|
|
@@ -33,13 +33,13 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
33
33
|
<Heading
|
|
34
34
|
headingType={getTileHeadingType(className)}
|
|
35
35
|
title={title}
|
|
36
|
-
className={`whitespace-pre-wrap max-w-[600px]`}
|
|
36
|
+
className={`whitespace-pre-wrap max-w-[600px] mb-7`}
|
|
37
37
|
/>
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
buttons={
|
|
41
41
|
buttons?.length ? (
|
|
42
|
-
<ButtonSection context={context} buttons={buttons} className="flex mt-
|
|
42
|
+
<ButtonSection context={context} buttons={buttons} className="flex mt-7 gap-4" />
|
|
43
43
|
) : null
|
|
44
44
|
}
|
|
45
45
|
>
|
|
@@ -56,7 +56,7 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
56
56
|
/>
|
|
57
57
|
</a>
|
|
58
58
|
)}
|
|
59
|
-
<span className="font-
|
|
59
|
+
<span className="font-light text-secondary-text ml-4">
|
|
60
60
|
Наведите камеру телефона на QR-код и скачайте приложение
|
|
61
61
|
</span>
|
|
62
62
|
</div>
|
|
@@ -3,13 +3,24 @@ import { PRODUCT_BLOCK } from '../ProductBlock/ProductBlock.fixture';
|
|
|
3
3
|
import { PRODUCT_TILE, PRODUCT_PENSION_TILE } from '../ProductTile/ProductTile.fixture';
|
|
4
4
|
import { TEXT_BLOCK } from '../TextBlock/TextBlock.fixture';
|
|
5
5
|
import { TILE, TILE_PREMIUM } from '../Tile/Tile.fixture';
|
|
6
|
-
import
|
|
6
|
+
import { HEADLINE } from '../Headline/Headline.fixture';
|
|
7
|
+
import { PICTURE_TEXT } from '../PictureText/PictureText.fixture';
|
|
8
|
+
import { linkDocsContentExample } from '../LinkDocs/linkDocsContentExample';
|
|
9
|
+
import { defaultProps as GALLERY } from '../Gallery/Gallery.fixture';
|
|
10
|
+
import { defaultProps as MINI_GALLERY } from '../MiniGallery/MiniGallery.fixture';
|
|
7
11
|
import { OtherProducts } from './OtherProducts';
|
|
12
|
+
import type { OtherProductsProps } from './OtherProducts';
|
|
13
|
+
|
|
8
14
|
import type {
|
|
9
15
|
ProductBlockBlockListDef,
|
|
10
16
|
ProductTileBlockListDef,
|
|
11
17
|
TextBlockBlockListDef,
|
|
12
18
|
TileBlockListDef,
|
|
19
|
+
GalleryBlockListDef,
|
|
20
|
+
HeadlineBlockListDef,
|
|
21
|
+
LinkDocsBlockListDef,
|
|
22
|
+
MiniGalleryBlockListDef,
|
|
23
|
+
PictureTextBlockListDef,
|
|
13
24
|
} from '../../ui-kit/BlocksList/BlocksListProps';
|
|
14
25
|
|
|
15
26
|
const TEXT_BLOCK_OTHER_BLOCK: TextBlockBlockListDef = {
|
|
@@ -42,11 +53,36 @@ const PRODUCT_PENSION_TILES__OTHER_BLOCK: ProductTileBlockListDef = {
|
|
|
42
53
|
...PRODUCT_PENSION_TILE,
|
|
43
54
|
};
|
|
44
55
|
|
|
56
|
+
const HEADLINE_OTHER_BLOCK: HeadlineBlockListDef = {
|
|
57
|
+
blockListType: 'Headline',
|
|
58
|
+
...HEADLINE,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const PICTURE_TEXT_OTHER_BLOCK: PictureTextBlockListDef = {
|
|
62
|
+
blockListType: 'PictureText',
|
|
63
|
+
...PICTURE_TEXT,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const LINK_DOCS_OTHER_BLOCK: LinkDocsBlockListDef = {
|
|
67
|
+
blockListType: 'LinkDocs',
|
|
68
|
+
...linkDocsContentExample,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const GALLERY_OTHER_BLOCK: GalleryBlockListDef = {
|
|
72
|
+
blockListType: 'Gallery',
|
|
73
|
+
...GALLERY,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const MINI_GALLERY_OTHER_BLOCK: MiniGalleryBlockListDef = {
|
|
77
|
+
blockListType: 'MiniGallery',
|
|
78
|
+
...MINI_GALLERY,
|
|
79
|
+
};
|
|
80
|
+
|
|
45
81
|
const propsBlock: OtherProductsProps = {
|
|
46
82
|
context,
|
|
47
83
|
blockItems: [
|
|
48
84
|
{
|
|
49
|
-
label: '
|
|
85
|
+
label: 'OtherProducts №1 Tiles',
|
|
50
86
|
blocks: [
|
|
51
87
|
TILES_PREMIUM_OTHER_BLOCK,
|
|
52
88
|
TILES_PREMIUM_OTHER_BLOCK,
|
|
@@ -55,7 +91,7 @@ const propsBlock: OtherProductsProps = {
|
|
|
55
91
|
],
|
|
56
92
|
},
|
|
57
93
|
{
|
|
58
|
-
label: '
|
|
94
|
+
label: 'OtherProducts №2 Product_Tiles',
|
|
59
95
|
blocks: [
|
|
60
96
|
PRODUCT_TILES_OTHER_BLOCK,
|
|
61
97
|
PRODUCT_TILES_OTHER_BLOCK,
|
|
@@ -64,12 +100,11 @@ const propsBlock: OtherProductsProps = {
|
|
|
64
100
|
],
|
|
65
101
|
},
|
|
66
102
|
{
|
|
67
|
-
label: '
|
|
103
|
+
label: 'OtherProducts №3 Product_Block',
|
|
68
104
|
blocks: [PRODUCT_BLOCK_OTHER_BLOCK, PRODUCT_BLOCK_OTHER_BLOCK],
|
|
69
105
|
},
|
|
70
|
-
|
|
71
106
|
{
|
|
72
|
-
label: '
|
|
107
|
+
label: 'OtherProducts №4 Text_Block',
|
|
73
108
|
blocks: [
|
|
74
109
|
TEXT_BLOCK_OTHER_BLOCK,
|
|
75
110
|
TEXT_BLOCK_OTHER_BLOCK,
|
|
@@ -77,6 +112,26 @@ const propsBlock: OtherProductsProps = {
|
|
|
77
112
|
TEXT_BLOCK_OTHER_BLOCK,
|
|
78
113
|
],
|
|
79
114
|
},
|
|
115
|
+
{
|
|
116
|
+
label: 'OtherProducts №5 Picture_Text',
|
|
117
|
+
blocks: [PICTURE_TEXT_OTHER_BLOCK],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: 'OtherProducts №6 Headline',
|
|
121
|
+
blocks: [HEADLINE_OTHER_BLOCK],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: 'OtherProducts №7 Link_Docs',
|
|
125
|
+
blocks: [LINK_DOCS_OTHER_BLOCK],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: 'OtherProducts №8 Gallery',
|
|
129
|
+
blocks: [GALLERY_OTHER_BLOCK],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: 'OtherProducts №9 Mini_Gallery',
|
|
133
|
+
blocks: [MINI_GALLERY_OTHER_BLOCK],
|
|
134
|
+
},
|
|
80
135
|
],
|
|
81
136
|
};
|
|
82
137
|
|
|
@@ -15,11 +15,6 @@ export interface blockItemCommonProps {
|
|
|
15
15
|
isExpanded?: boolean;
|
|
16
16
|
/** @title Блоки */
|
|
17
17
|
blocks?: BlockDef[];
|
|
18
|
-
/**
|
|
19
|
-
* @title Отображать/скрывать обводку элемента
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
bordered?: boolean; // TODO: только для мобильной версии
|
|
23
18
|
columns?: ColumnsCount;
|
|
24
19
|
}
|
|
25
20
|
|
|
@@ -29,13 +24,9 @@ export interface blockItemCommonProps {
|
|
|
29
24
|
export interface OtherProductsContent {
|
|
30
25
|
/** @title Заголовок */
|
|
31
26
|
title?: string;
|
|
32
|
-
/** @title Список */
|
|
33
|
-
blockItems?: blockItemCommonProps[];
|
|
34
|
-
/** @title Подзаголовок */
|
|
35
|
-
description?: string; // TODO: только для мобильной версии
|
|
36
27
|
/**
|
|
37
|
-
* @title
|
|
38
|
-
* @
|
|
28
|
+
* @title Список
|
|
29
|
+
* @maxItems 10
|
|
39
30
|
*/
|
|
40
|
-
|
|
31
|
+
blockItems?: blockItemCommonProps[];
|
|
41
32
|
}
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
3
|
import type { PictureTextContent } from './PictureTextContent';
|
|
4
4
|
|
|
5
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
5
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
7
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
7
8
|
import { Img } from '../../ui-kit/Img/Img';
|
|
@@ -9,18 +10,33 @@ import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
|
9
10
|
|
|
10
11
|
export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
|
|
11
12
|
|
|
13
|
+
const pictureTextStyleMap: Record<BlockVersion, string> = {
|
|
14
|
+
primary: 'bg-white text-primary-text',
|
|
15
|
+
secondary: 'bg-primary-main text-white',
|
|
16
|
+
};
|
|
17
|
+
|
|
12
18
|
export const PictureText = JSX<PictureTextProps>(
|
|
13
|
-
({
|
|
19
|
+
({
|
|
20
|
+
className = '',
|
|
21
|
+
title,
|
|
22
|
+
image,
|
|
23
|
+
benefits,
|
|
24
|
+
version = 'primary',
|
|
25
|
+
directionRight = false,
|
|
26
|
+
anchor = null,
|
|
27
|
+
}) => {
|
|
14
28
|
return (
|
|
15
29
|
<section
|
|
16
|
-
className={`relative font-sans
|
|
30
|
+
className={`relative font-sans p-14 ${pictureTextStyleMap[version]} ${className}`}
|
|
17
31
|
id={anchor}
|
|
18
32
|
>
|
|
19
33
|
<Heading headingType="h2" className="text-center" title={title} />
|
|
20
34
|
<div className={'flex justify-center mt-9'}>
|
|
21
|
-
{image?.src && <Img className=
|
|
35
|
+
{image?.src && <Img className={directionRight ? 'order-2 ml-6' : 'mr-6'} image={image} />}
|
|
22
36
|
{benefits?.length ? (
|
|
23
|
-
<div className="flex flex-col">
|
|
37
|
+
<div className="flex flex-col">
|
|
38
|
+
{benefits.map((_, i) => renderBenefit(_, i, version))}
|
|
39
|
+
</div>
|
|
24
40
|
) : null}
|
|
25
41
|
</div>
|
|
26
42
|
</section>
|
|
@@ -28,7 +44,7 @@ export const PictureText = JSX<PictureTextProps>(
|
|
|
28
44
|
},
|
|
29
45
|
);
|
|
30
46
|
|
|
31
|
-
function renderBenefit(benefit: Benefit, i: number) {
|
|
47
|
+
function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
32
48
|
return (
|
|
33
49
|
<div key={String(i)} className="flex flex-row mb-8">
|
|
34
50
|
{benefit.icon && (
|
|
@@ -42,10 +58,20 @@ function renderBenefit(benefit: Benefit, i: number) {
|
|
|
42
58
|
)}
|
|
43
59
|
<div className="flex gap-1 flex-col h-full ml-5 max-w-[490px]">
|
|
44
60
|
{benefit.label && (
|
|
45
|
-
<div
|
|
61
|
+
<div
|
|
62
|
+
className={`font-medium text-xl m-0 ${
|
|
63
|
+
version === 'primary' ? 'text-primary-text' : ''
|
|
64
|
+
}`}
|
|
65
|
+
>
|
|
66
|
+
{benefit.label}
|
|
67
|
+
</div>
|
|
46
68
|
)}
|
|
47
69
|
{benefit.description && (
|
|
48
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
className={`font-normal text-sm ${version === 'primary' ? 'text-secondary-text' : ''}`}
|
|
72
|
+
>
|
|
73
|
+
{benefit.description}
|
|
74
|
+
</div>
|
|
49
75
|
)}
|
|
50
76
|
</div>
|
|
51
77
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
1
2
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
2
3
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
3
4
|
import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
@@ -8,6 +9,12 @@ export type TitleWithImageContent = HeadingContent & ImageContent;
|
|
|
8
9
|
* @title Картинка с текстом
|
|
9
10
|
*/
|
|
10
11
|
export interface PictureTextContent extends TitleWithImageContent {
|
|
12
|
+
version?: BlockVersion;
|
|
11
13
|
/** @title Список преимуществ */
|
|
12
14
|
benefits?: Benefit[];
|
|
15
|
+
/**
|
|
16
|
+
* @title Картинка справа/текст слева
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
directionRight?: boolean;
|
|
13
20
|
}
|
|
@@ -38,6 +38,15 @@ const items = [
|
|
|
38
38
|
'Кредитный лимит до 5 млн рублей',
|
|
39
39
|
];
|
|
40
40
|
const buttons: ButtonWithIconProps[] = [
|
|
41
|
+
{
|
|
42
|
+
href: 'https://rshb.ru',
|
|
43
|
+
text: 'Подробнее',
|
|
44
|
+
target: '_blank',
|
|
45
|
+
version: 'primary',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const buttonsSecondary: ButtonWithIconProps[] = [
|
|
41
50
|
{
|
|
42
51
|
href: 'https://rshb.ru',
|
|
43
52
|
text: 'Подробнее',
|
|
@@ -60,7 +69,6 @@ export default {
|
|
|
60
69
|
},
|
|
61
70
|
productBlock: {
|
|
62
71
|
title: 'Кредит по одному документу',
|
|
63
|
-
// description: 'Кредит наличными без залога и поручительства, только по паспорту',
|
|
64
72
|
headingType: 'h2',
|
|
65
73
|
items,
|
|
66
74
|
buttons,
|
|
@@ -111,4 +119,69 @@ export default {
|
|
|
111
119
|
/>
|
|
112
120
|
</div>
|
|
113
121
|
),
|
|
122
|
+
primary: (
|
|
123
|
+
<div className="container grid grid-cols-12">
|
|
124
|
+
<ProductGalleryGreen
|
|
125
|
+
className="col-span-12"
|
|
126
|
+
context={context}
|
|
127
|
+
version={'secondary'}
|
|
128
|
+
slides={[
|
|
129
|
+
{
|
|
130
|
+
nav: {
|
|
131
|
+
title: 'Кредит по одному документу',
|
|
132
|
+
description: 'Ставка от 5,5% годовых',
|
|
133
|
+
},
|
|
134
|
+
productBlock: {
|
|
135
|
+
title: 'Кредит по одному документу',
|
|
136
|
+
// description: 'Кредит наличными без залога и поручительства, только по паспорту',
|
|
137
|
+
headingType: 'h2',
|
|
138
|
+
items,
|
|
139
|
+
buttons: buttonsSecondary,
|
|
140
|
+
image: percentImage,
|
|
141
|
+
backgroundText: '3,6',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
nav: {
|
|
146
|
+
title: 'Для людей в возрасте',
|
|
147
|
+
description: 'Ставка до 7% годовых',
|
|
148
|
+
},
|
|
149
|
+
productBlock: {
|
|
150
|
+
title: 'Ставка от 12,5% годовых на срок до 3 лет!',
|
|
151
|
+
headingType: 'h2',
|
|
152
|
+
items,
|
|
153
|
+
buttons: buttonsSecondary,
|
|
154
|
+
image: worker,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
nav: {
|
|
159
|
+
title: 'Выгодно покупать',
|
|
160
|
+
description: 'Ставка от 5% годовых',
|
|
161
|
+
},
|
|
162
|
+
productBlock: {
|
|
163
|
+
title: 'Дополнительные бонусные баллы за покупки!',
|
|
164
|
+
headingType: 'h2',
|
|
165
|
+
items,
|
|
166
|
+
buttons: buttonsSecondary,
|
|
167
|
+
image: creditCard,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
nav: {
|
|
172
|
+
title: 'Карты Unionpay',
|
|
173
|
+
description: '120 дней льготный период',
|
|
174
|
+
},
|
|
175
|
+
productBlock: {
|
|
176
|
+
title: 'Карты Unionpay',
|
|
177
|
+
headingType: 'h2',
|
|
178
|
+
items,
|
|
179
|
+
buttons: buttonsSecondary,
|
|
180
|
+
image: creditCard,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
]}
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
),
|
|
114
187
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
4
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
5
|
import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
|
|
5
6
|
import { ProductBlockInner } from '../ProductBlock/ProductBlockInner';
|
|
@@ -7,23 +8,39 @@ import type { ProductGalleryGreenContent } from './ProductGalleryGreenContent';
|
|
|
7
8
|
|
|
8
9
|
export interface ProductGalleryProps extends ProductGalleryGreenContent, UniBlockProps {}
|
|
9
10
|
|
|
11
|
+
const productGalleryGreenStyleMap: Record<BlockVersion, string> = {
|
|
12
|
+
primary: 'bg-white text-primary-text',
|
|
13
|
+
secondary: 'bg-primary-main text-white',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const productBlockStyleMap: Record<BlockVersion, string> = {
|
|
17
|
+
primary: 'text-secondary-text',
|
|
18
|
+
secondary: 'text-white/80',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const productSlideStyleMap: Record<BlockVersion, string> = {
|
|
22
|
+
primary: 'bg-white text-primary-text',
|
|
23
|
+
secondary: 'bg-primary-main text-white',
|
|
24
|
+
};
|
|
25
|
+
|
|
10
26
|
export const ProductGalleryGreen = JSX<ProductGalleryProps>(
|
|
11
|
-
({ className = '', context, slides = [], anchor = null }) => {
|
|
27
|
+
({ className = '', context, slides = [], version = 'primary', duration = 0, anchor = null }) => {
|
|
12
28
|
const galleryNav = slides.map((s) => s.nav);
|
|
13
29
|
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
14
30
|
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
15
31
|
|
|
16
32
|
return (
|
|
17
33
|
<section
|
|
18
|
-
className={`box-border pt-[70px] relative font-sans overflow-hidden bg-primary-main w-100 ${className}`}
|
|
19
34
|
id={anchor}
|
|
35
|
+
className={`box-border pt-[70px] overflow-hidden relative font-sans w-100 ${className}
|
|
36
|
+
${productGalleryGreenStyleMap[version]}`}
|
|
20
37
|
>
|
|
21
38
|
<div
|
|
22
39
|
className="flex duration-1000 pb-14"
|
|
23
40
|
style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
|
|
24
41
|
role="list"
|
|
25
42
|
>
|
|
26
|
-
{galleryBlocks.map((_, i) => renderProductBlock(_, i, context))}
|
|
43
|
+
{galleryBlocks.map((_, i) => renderProductBlock({ ..._, version }, i, context))}
|
|
27
44
|
</div>
|
|
28
45
|
|
|
29
46
|
<div className="flex items-center absolute bottom-6 left-0 right-0 px-9 box-border">
|
|
@@ -33,6 +50,8 @@ export const ProductGalleryGreen = JSX<ProductGalleryProps>(
|
|
|
33
50
|
i,
|
|
34
51
|
activeSlideIndex,
|
|
35
52
|
onClick: () => setActiveSlideIndex(i),
|
|
53
|
+
version,
|
|
54
|
+
duration,
|
|
36
55
|
}),
|
|
37
56
|
)}
|
|
38
57
|
</div>
|
|
@@ -42,6 +61,9 @@ export const ProductGalleryGreen = JSX<ProductGalleryProps>(
|
|
|
42
61
|
);
|
|
43
62
|
|
|
44
63
|
function renderProductBlock(block: ProductBlockInnerContent, i: number, context) {
|
|
64
|
+
const { version } = block;
|
|
65
|
+
const additionalClass = version ? productBlockStyleMap[version] : '';
|
|
66
|
+
|
|
45
67
|
return (
|
|
46
68
|
<section
|
|
47
69
|
key={String(i)}
|
|
@@ -55,10 +77,9 @@ function renderProductBlock(block: ProductBlockInnerContent, i: number, context)
|
|
|
55
77
|
</div>
|
|
56
78
|
) : null}
|
|
57
79
|
<ProductBlockInner
|
|
58
|
-
className=
|
|
80
|
+
className={`pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem] z-[1] ${additionalClass}`}
|
|
59
81
|
context={context}
|
|
60
82
|
textBlockClassName="mb-[154px]"
|
|
61
|
-
version="secondary"
|
|
62
83
|
{...block}
|
|
63
84
|
/>
|
|
64
85
|
<Icon
|
|
@@ -72,32 +93,34 @@ function renderProductBlock(block: ProductBlockInnerContent, i: number, context)
|
|
|
72
93
|
);
|
|
73
94
|
}
|
|
74
95
|
|
|
75
|
-
function renderNavButton({ slide, i, activeSlideIndex, onClick }) {
|
|
96
|
+
function renderNavButton({ slide, i, activeSlideIndex, onClick, version, duration }) {
|
|
76
97
|
const isActiveBtn = i === activeSlideIndex;
|
|
77
98
|
const btnClassName = isActiveBtn
|
|
78
|
-
? 'bg-white shadow-dark-blue/42 h-[102px] w-[354px] min-w-[354px] max-w-[354px] p-0'
|
|
79
|
-
:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
: 'text-m-base text-white';
|
|
86
|
-
|
|
99
|
+
? 'bg-white shadow-dark-blue/42 h-[102px] w-[354px] min-w-[354px] max-w-[354px] p-0 border-none'
|
|
100
|
+
: `min-w-[277px] px-0 pt-4 pb-[23px] hover:py-[26px] hover:py-[26px] ease-in duration-300
|
|
101
|
+
${productSlideStyleMap[version]}`;
|
|
102
|
+
const btnTitleClassName = isActiveBtn ? 'text-primary-text' : productBlockStyleMap[version];
|
|
103
|
+
const btnDescClassName = isActiveBtn ? 'text-secondary-text' : productBlockStyleMap[version];
|
|
104
|
+
const additionalBorder = version === 'secondary' ? 'border-white/50' : '';
|
|
105
|
+
const progressBarClassName = isActiveBtn ? 'animate-slide' : '';
|
|
87
106
|
return (
|
|
88
107
|
<button
|
|
89
108
|
type="button"
|
|
90
109
|
key={String(i)}
|
|
91
110
|
onClick={onClick}
|
|
92
111
|
aria-label={slide?.title}
|
|
93
|
-
className={`box-border font-sans group relative overflow-hidden border-
|
|
94
|
-
|
|
112
|
+
className={`box-border font-sans group relative overflow-hidden border-[1px] cursor-pointer text-left mx-1 grow basis-0 backdrop-blur-sm
|
|
113
|
+
${btnClassName} ${additionalBorder}
|
|
95
114
|
`}
|
|
96
115
|
>
|
|
97
116
|
<div className="border-0 px-6">
|
|
98
117
|
<div className={`font-medium ${btnTitleClassName}`}>{slide?.title}</div>
|
|
99
118
|
<div className={`text-secondary-text ${btnDescClassName}`}>{slide.description}</div>
|
|
100
119
|
</div>
|
|
120
|
+
<div
|
|
121
|
+
className={`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${progressBarClassName}`}
|
|
122
|
+
style={{ animationDuration: `${duration}s`, animationFillMode: 'forwards' }}
|
|
123
|
+
></div>
|
|
101
124
|
</button>
|
|
102
125
|
);
|
|
103
126
|
}
|