@redneckz/wildless-cms-uni-blocks 0.3.35 → 0.3.36
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 +123 -79
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Blocks.js +1 -1
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ComparisonTable/HeaderCell.js +1 -1
- package/dist/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/dist/components/ComparisonTable/TableCell.js +1 -1
- package/dist/components/ContentPage/ContentPage.js +10 -3
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/CreditCalculator/renderButton.js +8 -1
- package/dist/components/CreditCalculator/renderButton.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.js +5 -6
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/dist/components/Gallery/GalleryContainer.js +2 -2
- package/dist/components/Gallery/GalleryContainer.js.map +1 -1
- package/dist/components/Gallery/GalleryInner.js +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +4 -1
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsList.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsList.js +1 -1
- package/dist/components/LinkDocs/LinkDocsList.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabItem.js +4 -4
- package/dist/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabs.d.ts +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabs.js +11 -6
- package/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabsContent.d.ts +3 -1
- package/dist/components/ProductBlock/renderBackwardButton.js +1 -1
- package/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/dist/components/Recommendation/RecommendationCard.js +2 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/Recommendation/RecommendationContent.d.ts +4 -0
- package/dist/components/StepsBlock/StepsBlock.js +6 -5
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -0
- package/dist/components/TariffsTable/TariffsTableCell.js +2 -1
- package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTableTileCell.js +2 -1
- package/dist/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
- package/dist/components/TariffsTable/utils/getButtonAriaLabel.d.ts +2 -0
- package/dist/components/TariffsTable/utils/getButtonAriaLabel.js +6 -0
- package/dist/components/TariffsTable/utils/getButtonAriaLabel.js.map +1 -0
- package/dist/components/Tile/Tile.js +1 -1
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/hooks/useLink.d.ts +1 -1
- package/dist/hooks/useLink.js +1 -1
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/ui-kit/Button/Button.js +6 -1
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.d.ts +2 -1
- package/dist/ui-kit/Heading/Heading.js +3 -3
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.mobile.d.ts +2 -1
- package/dist/ui-kit/Heading/Heading.mobile.js +2 -2
- package/dist/ui-kit/Heading/Heading.mobile.js.map +1 -1
- package/dist/utils/changeHashOnScroll.d.ts +2 -0
- package/dist/utils/changeHashOnScroll.js +16 -0
- package/dist/utils/changeHashOnScroll.js.map +1 -0
- package/dist/utils/tableFunc.d.ts +2 -0
- package/dist/utils/tableFunc.js +8 -0
- package/dist/utils/tableFunc.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +1 -1
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ComparisonTable/HeaderCell.js +1 -1
- package/lib/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/lib/components/ComparisonTable/TableCell.js +1 -1
- package/lib/components/ContentPage/ContentPage.js +10 -3
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/CreditCalculator/renderButton.js +8 -1
- package/lib/components/CreditCalculator/renderButton.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.js +5 -6
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/lib/components/Gallery/GalleryContainer.js +2 -2
- package/lib/components/Gallery/GalleryContainer.js.map +1 -1
- package/lib/components/Gallery/GalleryInner.js +1 -1
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +4 -1
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsList.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsList.js +1 -1
- package/lib/components/LinkDocs/LinkDocsList.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabItem.js +4 -4
- package/lib/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabs.d.ts +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabs.js +12 -7
- package/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabsContent.d.ts +3 -1
- package/lib/components/ProductBlock/renderBackwardButton.js +1 -1
- package/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +2 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/Recommendation/RecommendationContent.d.ts +4 -0
- package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +2 -0
- package/lib/components/StepsBlock/StepsBlock.js +6 -5
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -0
- package/lib/components/TariffsTable/TariffsTableCell.js +2 -1
- package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTableTileCell.js +2 -1
- package/lib/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
- package/lib/components/TariffsTable/utils/getButtonAriaLabel.d.ts +2 -0
- package/lib/components/TariffsTable/utils/getButtonAriaLabel.js +3 -0
- package/lib/components/TariffsTable/utils/getButtonAriaLabel.js.map +1 -0
- package/lib/components/Tile/Tile.js +1 -1
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/hooks/useLink.d.ts +1 -1
- package/lib/hooks/useLink.js +1 -1
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/ui-kit/Button/Button.js +6 -1
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.d.ts +2 -1
- package/lib/ui-kit/Heading/Heading.js +3 -3
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.mobile.d.ts +2 -1
- package/lib/ui-kit/Heading/Heading.mobile.js +2 -2
- package/lib/ui-kit/Heading/Heading.mobile.js.map +1 -1
- package/lib/utils/changeHashOnScroll.d.ts +2 -0
- package/lib/utils/changeHashOnScroll.js +13 -0
- package/lib/utils/changeHashOnScroll.js.map +1 -0
- package/lib/utils/tableFunc.d.ts +2 -0
- package/lib/utils/tableFunc.js +5 -0
- package/lib/utils/tableFunc.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +28 -7
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js +10 -3
- package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/dist/components/CreditCalculator/renderButton.js +8 -1
- package/mobile/dist/components/CreditCalculator/renderButton.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryCardInner.js +5 -6
- package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryContainer.js +2 -2
- package/mobile/dist/components/Gallery/GalleryContainer.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryInner.js +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +4 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsList.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsList.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsList.js.map +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabItem.js +4 -4
- package/mobile/dist/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.d.ts +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js +11 -6
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabsContent.d.ts +3 -1
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js +1 -1
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js +2 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/components/Recommendation/RecommendationContent.d.ts +4 -0
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -0
- package/mobile/dist/components/TariffsTable/TariffsTableCell.js +2 -1
- package/mobile/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableTileCell.js +2 -1
- package/mobile/dist/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
- package/mobile/dist/components/TariffsTable/utils/getButtonAriaLabel.d.ts +2 -0
- package/mobile/dist/components/TariffsTable/utils/getButtonAriaLabel.js +6 -0
- package/mobile/dist/components/TariffsTable/utils/getButtonAriaLabel.js.map +1 -0
- package/mobile/dist/components/Tile/Tile.js +1 -1
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/hooks/useLink.d.ts +1 -1
- package/mobile/dist/hooks/useLink.js +1 -1
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/ui-kit/Heading/Heading.d.ts +2 -1
- package/mobile/dist/ui-kit/Heading/Heading.js +2 -2
- package/mobile/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/dist/utils/changeHashOnScroll.d.ts +2 -0
- package/mobile/dist/utils/changeHashOnScroll.js +16 -0
- package/mobile/dist/utils/changeHashOnScroll.js.map +1 -0
- package/mobile/dist/utils/tableFunc.d.ts +2 -0
- package/mobile/dist/utils/tableFunc.js +8 -0
- package/mobile/dist/utils/tableFunc.js.map +1 -0
- package/mobile/lib/components/ContentPage/ContentPage.js +10 -3
- package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/lib/components/CreditCalculator/renderButton.js +8 -1
- package/mobile/lib/components/CreditCalculator/renderButton.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryCardInner.js +5 -6
- package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryContainer.js +2 -2
- package/mobile/lib/components/Gallery/GalleryContainer.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryInner.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +4 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsList.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsList.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsList.js.map +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabItem.js +4 -4
- package/mobile/lib/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.d.ts +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js +12 -7
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabsContent.d.ts +3 -1
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js +1 -1
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js +2 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/components/Recommendation/RecommendationContent.d.ts +4 -0
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -0
- package/mobile/lib/components/TariffsTable/TariffsTableCell.js +2 -1
- package/mobile/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableTileCell.js +2 -1
- package/mobile/lib/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
- package/mobile/lib/components/TariffsTable/utils/getButtonAriaLabel.d.ts +2 -0
- package/mobile/lib/components/TariffsTable/utils/getButtonAriaLabel.js +3 -0
- package/mobile/lib/components/TariffsTable/utils/getButtonAriaLabel.js.map +1 -0
- package/mobile/lib/components/Tile/Tile.js +1 -1
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/hooks/useLink.d.ts +1 -1
- package/mobile/lib/hooks/useLink.js +1 -1
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/ui-kit/Heading/Heading.d.ts +2 -1
- package/mobile/lib/ui-kit/Heading/Heading.js +2 -2
- package/mobile/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/lib/utils/changeHashOnScroll.d.ts +2 -0
- package/mobile/lib/utils/changeHashOnScroll.js +13 -0
- package/mobile/lib/utils/changeHashOnScroll.js.map +1 -0
- package/mobile/lib/utils/tableFunc.d.ts +2 -0
- package/mobile/lib/utils/tableFunc.js +5 -0
- package/mobile/lib/utils/tableFunc.js.map +1 -0
- package/mobile/src/components/ContentPage/ContentPage.page.json +94 -234
- package/mobile/src/components/ContentPage/ContentPage.tsx +14 -2
- package/mobile/src/components/CreditCalculator/renderButton.tsx +11 -1
- package/mobile/src/components/Footer/FooterContent.ts +0 -1
- package/mobile/src/components/Gallery/GalleryCardInner.tsx +6 -7
- package/mobile/src/components/Gallery/GalleryContainer.tsx +2 -2
- package/mobile/src/components/Gallery/GalleryInner.tsx +1 -1
- package/mobile/src/components/Header/HeaderSubMenu.tsx +12 -2
- package/mobile/src/components/LinkDocs/LinkDocsList.tsx +3 -3
- package/mobile/src/components/NavigatorTabs/NavigatorTabItem.tsx +7 -5
- package/mobile/src/components/NavigatorTabs/NavigatorTabs.example.json +3 -3
- package/mobile/src/components/NavigatorTabs/NavigatorTabs.tsx +17 -9
- package/mobile/src/components/NavigatorTabs/NavigatorTabsContent.ts +3 -1
- package/mobile/src/components/ProductBlock/renderBackwardButton.tsx +1 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +2 -1
- package/mobile/src/components/Recommendation/RecommendationContent.ts +4 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -0
- package/mobile/src/components/TariffsTable/TariffsTableCell.tsx +2 -0
- package/mobile/src/components/TariffsTable/TariffsTableTileCell.tsx +2 -0
- package/mobile/src/components/TariffsTable/utils/getButtonAriaLabel.ts +5 -0
- package/mobile/src/components/Tile/Tile.tsx +1 -0
- package/mobile/src/hooks/useLink.ts +1 -1
- package/mobile/src/ui-kit/Heading/Heading.tsx +5 -2
- package/mobile/src/utils/changeHashOnScroll.ts +15 -0
- package/mobile/src/utils/tableFunc.ts +8 -0
- package/package.json +1 -1
- package/src/components/Blocks.ts +1 -1
- package/src/components/ComparisonTable/HeaderCell.tsx +1 -1
- package/src/components/ComparisonTable/TableCell.tsx +1 -1
- package/src/components/ContentPage/ContentPage.page.json +94 -234
- package/src/components/ContentPage/ContentPage.tsx +14 -2
- package/src/components/CreditCalculator/renderButton.tsx +11 -1
- package/src/components/Footer/FooterContent.ts +0 -1
- package/src/components/Gallery/GalleryCardInner.tsx +6 -7
- package/src/components/Gallery/GalleryContainer.tsx +2 -2
- package/src/components/Gallery/GalleryInner.tsx +1 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/HeaderSubMenu.tsx +12 -2
- package/src/components/LinkDocs/LinkDocsList.tsx +3 -3
- package/src/components/LinkDocs/LinkDocsListItem.tsx +3 -3
- package/src/components/NavigatorTabs/NavigatorTabItem.tsx +7 -5
- package/src/components/NavigatorTabs/NavigatorTabs.example.json +3 -3
- package/src/components/NavigatorTabs/NavigatorTabs.tsx +17 -9
- package/src/components/NavigatorTabs/NavigatorTabsContent.ts +3 -1
- package/src/components/ProductBlock/renderBackwardButton.tsx +1 -0
- package/src/components/Recommendation/RecommendationCard.tsx +2 -1
- package/src/components/Recommendation/RecommendationContent.ts +4 -0
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +59 -0
- package/src/components/StepsBlock/StepsBlock.tsx +34 -11
- package/src/components/StepsBlock/StepsBlockContent.ts +3 -0
- package/src/components/TariffsTable/TariffsTableCell.tsx +2 -0
- package/src/components/TariffsTable/TariffsTableTileCell.tsx +2 -0
- package/src/components/TariffsTable/utils/getButtonAriaLabel.ts +5 -0
- package/src/components/Tile/Tile.tsx +1 -0
- package/src/hooks/useLink.ts +1 -1
- package/src/ui-kit/Button/Button.tsx +20 -15
- package/src/ui-kit/Heading/Heading.mobile.tsx +5 -2
- package/src/ui-kit/Heading/Heading.tsx +6 -3
- package/src/utils/changeHashOnScroll.ts +15 -0
- package/src/utils/tableFunc.ts +8 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX, PropsWithChildren } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { BlockDef, ContentPageDef, UniBlockProps } from '../../types';
|
|
3
|
+
import { changeHashOnScroll } from '../../utils/changeHashOnScroll';
|
|
3
4
|
import type { BlockContent } from '../BlockContent';
|
|
4
5
|
import { LikeControl } from '../LikeControl/LikeControl';
|
|
5
6
|
import { Placeholder } from '../Placeholder/Placeholder';
|
|
@@ -41,17 +42,26 @@ const defaultBlockDecorator: BlockDecorator = ({ blockClassName, block, render }
|
|
|
41
42
|
|
|
42
43
|
export const ContentPage = JSX<ContentPageProps>(
|
|
43
44
|
({
|
|
44
|
-
className,
|
|
45
|
+
className = '',
|
|
45
46
|
context,
|
|
46
47
|
blocksRegistry,
|
|
47
48
|
data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' },
|
|
48
49
|
blockDecorator = defaultBlockDecorator,
|
|
49
50
|
}) => {
|
|
50
51
|
const { header } = slots;
|
|
52
|
+
const router = context.useRouter();
|
|
53
|
+
|
|
54
|
+
// listener is for NavigatorTabs
|
|
55
|
+
globalThis.addEventListener('load', () => {
|
|
56
|
+
const sectionsWithAnchors = globalThis.document.querySelectorAll('section[id]');
|
|
57
|
+
globalThis.document.addEventListener('scroll', () =>
|
|
58
|
+
changeHashOnScroll(router, sectionsWithAnchors),
|
|
59
|
+
);
|
|
60
|
+
});
|
|
51
61
|
|
|
52
62
|
return (
|
|
53
63
|
<section
|
|
54
|
-
className={`relative ${style2className(pageStyle)} ${className
|
|
64
|
+
className={`relative ${style2className(pageStyle)} ${className}`}
|
|
55
65
|
data-theme={colorPalette}
|
|
56
66
|
>
|
|
57
67
|
{header?.blocks?.length ? (
|
|
@@ -73,6 +83,7 @@ export const ContentPage = JSX<ContentPageProps>(
|
|
|
73
83
|
{likeControl && (
|
|
74
84
|
<div className="flex items-end absolute bottom-0 right-0 h-full pointer-events-none">
|
|
75
85
|
<LikeControl
|
|
86
|
+
key="LikeControl"
|
|
76
87
|
className="rounded-tl-lg sticky bottom-0 pointer-events-auto"
|
|
77
88
|
context={context}
|
|
78
89
|
/>
|
|
@@ -100,6 +111,7 @@ function renderBlock(
|
|
|
100
111
|
const { version, content, anchor } = props.block;
|
|
101
112
|
return (
|
|
102
113
|
<BlockComponent
|
|
114
|
+
key={`${type}-${i}`}
|
|
103
115
|
className={props.blockClassName}
|
|
104
116
|
version={version}
|
|
105
117
|
context={context}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { tableFunc } from '../../utils/tableFunc';
|
|
2
|
+
|
|
3
|
+
const func = tableFunc<number, string>([
|
|
4
|
+
[(_) => _ === 1, 'год'],
|
|
5
|
+
[(_) => _ <= 4, 'года'],
|
|
6
|
+
[() => true, 'лет'],
|
|
7
|
+
]);
|
|
8
|
+
|
|
1
9
|
export function renderButton(number: number, i: number, handleClick: (number: number) => void) {
|
|
10
|
+
const string = func(number);
|
|
11
|
+
|
|
2
12
|
return (
|
|
3
13
|
<button
|
|
4
14
|
key={String(i)}
|
|
@@ -6,7 +16,7 @@ export function renderButton(number: number, i: number, handleClick: (number: nu
|
|
|
6
16
|
onClick={() => handleClick(number)}
|
|
7
17
|
>
|
|
8
18
|
<span className="font-semibold text-sm">
|
|
9
|
-
{number} {
|
|
19
|
+
{number} {string}
|
|
10
20
|
</span>
|
|
11
21
|
</button>
|
|
12
22
|
);
|
|
@@ -7,9 +7,9 @@ import type { GalleryCard, GalleryItem } from './GalleryContent';
|
|
|
7
7
|
|
|
8
8
|
export const GalleryCardInner = JSX<GalleryCard>(
|
|
9
9
|
({ title, description, image, items, button, version }) => {
|
|
10
|
-
const titleStyleClasses = getTitleStyle(version
|
|
10
|
+
const titleStyleClasses = getTitleStyle(version);
|
|
11
11
|
return (
|
|
12
|
-
<div className="h-full flex flex-col justify-between">
|
|
12
|
+
<div className="h-full flex flex-col justify-between text-center">
|
|
13
13
|
<div>
|
|
14
14
|
{image?.src ? (
|
|
15
15
|
<div className="flex justify-center">
|
|
@@ -18,7 +18,7 @@ export const GalleryCardInner = JSX<GalleryCard>(
|
|
|
18
18
|
) : null}
|
|
19
19
|
{title ? renderCardTitle(title, titleStyleClasses) : null}
|
|
20
20
|
{description ? (
|
|
21
|
-
<div className={`font-
|
|
21
|
+
<div className={`font-light text-m-md-new ${title ? 'mt-2' : ''}`}>{description}</div>
|
|
22
22
|
) : null}
|
|
23
23
|
{items?.length ? renderItems(items, version) : null}
|
|
24
24
|
</div>
|
|
@@ -39,7 +39,7 @@ function renderButton(button) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function renderCardTitle(title: string, className: string) {
|
|
42
|
-
return <div className={`
|
|
42
|
+
return <div className={`text-xl m-0 ${className}`}>{title}</div>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function renderItems(items: GalleryItem[], version: BlockVersion = 'primary') {
|
|
@@ -55,9 +55,8 @@ function renderItems(items: GalleryItem[], version: BlockVersion = 'primary') {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
function getTitleStyle(version
|
|
59
|
-
return `
|
|
58
|
+
function getTitleStyle(version) {
|
|
59
|
+
return `text-xl m-0
|
|
60
60
|
${version !== 'secondary' ? 'text-primary-text' : ''}
|
|
61
|
-
${!description && !items?.length ? 'text-center' : ''}
|
|
62
61
|
`;
|
|
63
62
|
}
|
|
@@ -25,7 +25,7 @@ export const GalleryContainer = JSX<GalleryContainerProps>(
|
|
|
25
25
|
<div className="flex flex-col items-center mb-8">
|
|
26
26
|
{title ? <Heading headingType="h2" className="text-center" title={title} /> : null}
|
|
27
27
|
{description ? (
|
|
28
|
-
<div className="font-
|
|
28
|
+
<div className="font-light text-md max-w-[600px] mt-2.5">{description}</div>
|
|
29
29
|
) : null}
|
|
30
30
|
</div>
|
|
31
31
|
<div
|
|
@@ -45,7 +45,7 @@ export const GalleryContainer = JSX<GalleryContainerProps>(
|
|
|
45
45
|
function renderCard({ card, version }: GalleryCardData, i: number) {
|
|
46
46
|
return (
|
|
47
47
|
<section
|
|
48
|
-
className={`box-border border-solid border
|
|
48
|
+
className={`box-border border-solid border border-main-stroke p-6 mx-2 flex flex-col justify-between
|
|
49
49
|
items-stretch ${cardStyleMap[version]} ${
|
|
50
50
|
cardVersionMap[card.version ?? 'primary']
|
|
51
51
|
} w-full col-span-4`}
|
|
@@ -27,7 +27,7 @@ export const GalleryInner = JSX<GalleryInnerProps>(
|
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<section
|
|
30
|
-
className={`relative font-sans text-primary-text bg-white p-[
|
|
30
|
+
className={`relative font-sans text-primary-text bg-white p-[42px] overflow-hidden ${className}`}
|
|
31
31
|
id={anchor}
|
|
32
32
|
>
|
|
33
33
|
<GalleryContainer
|
|
@@ -70,10 +70,16 @@ const renderDotsSubMenu = ({
|
|
|
70
70
|
<button
|
|
71
71
|
className="flex justify-between items-center cursor-pointer h-6 ml-6"
|
|
72
72
|
onClick={toggleSubMenu}
|
|
73
|
+
aria-label={`${subMenuIsShow ? 'Скрыть другие разделы' : 'Показать другие разделы'}`}
|
|
73
74
|
>
|
|
74
|
-
{Array(3)
|
|
75
|
+
{Array(3)
|
|
76
|
+
.fill(0)
|
|
77
|
+
.map((_, i) => renderDot(i))}
|
|
75
78
|
</button>
|
|
76
|
-
<div
|
|
79
|
+
<div
|
|
80
|
+
className={`flex flex-col rounded-md bg-white p-6 pb-2 ${subMenuIsShow ? '' : 'hidden'}`}
|
|
81
|
+
aria-hidden={!subMenuIsShow}
|
|
82
|
+
>
|
|
77
83
|
{renderDotsSubMenuItems(subItems, router, handlerDecorator)}
|
|
78
84
|
</div>
|
|
79
85
|
</div>
|
|
@@ -91,3 +97,7 @@ const renderDotsSubMenuItems = (subItems, router, handlerDecorator) =>
|
|
|
91
97
|
{_.text}
|
|
92
98
|
</a>
|
|
93
99
|
));
|
|
100
|
+
|
|
101
|
+
const renderDot = (i: number) => (
|
|
102
|
+
<div key={String(i)} className="w-[3px] h-[3px] rounded bg-black mr-1" />
|
|
103
|
+
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { LinkDocsListItem } from './LinkDocsListItem';
|
|
3
|
-
import type { LinkColumnsMode, LinkDocsItem } from './LinkDocsContent';
|
|
4
2
|
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import type { LinkColumnsMode, LinkDocsItem } from './LinkDocsContent';
|
|
4
|
+
import { LinkDocsListItem } from './LinkDocsListItem';
|
|
5
5
|
|
|
6
6
|
export interface LinkDocsListProps {
|
|
7
7
|
className?: string;
|
|
@@ -21,7 +21,7 @@ export const LinkDocsList = JSX<LinkDocsListProps>(
|
|
|
21
21
|
role="listitem"
|
|
22
22
|
>
|
|
23
23
|
<LinkDocsListItem
|
|
24
|
-
className="group flex
|
|
24
|
+
className="group flex align-middle h-fit w-fit text-primary-text no-underline hover:text-primary-main"
|
|
25
25
|
doc={doc}
|
|
26
26
|
icon={icon}
|
|
27
27
|
/>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { LinkDocsListItemBase } from './LinkDocsListItemBase';
|
|
3
2
|
import type { LinkDocsListItemProps } from './LinkDocsListItemBase';
|
|
3
|
+
import { LinkDocsListItemBase } from './LinkDocsListItemBase';
|
|
4
4
|
|
|
5
5
|
export const LinkDocsListItem = JSX<LinkDocsListItemProps>(({ className = '', doc, icon }) => (
|
|
6
6
|
<LinkDocsListItemBase
|
|
7
7
|
className={`flex h-full box-border ${className}`}
|
|
8
|
-
iconClassName="mr-
|
|
9
|
-
textClassName="self-center"
|
|
8
|
+
iconClassName="mr-3.5 min-w-6 min-h-6 text-primary-text"
|
|
9
|
+
textClassName="self-center font-light"
|
|
10
10
|
suffixClassName="text-secondary-text group-hover:text-primary-main"
|
|
11
11
|
doc={doc}
|
|
12
12
|
icon={icon}
|
|
@@ -8,22 +8,24 @@ export interface NavigatorTabItemProps extends NavigatorTab {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const TEXT_CLASSES = 'font-sans font-normal text-sm';
|
|
11
|
-
const LINK_CLASSES = 'flex-1 flex items-center justify-center';
|
|
11
|
+
const LINK_CLASSES = 'flex-1 flex items-center justify-center cursor-pointer';
|
|
12
12
|
|
|
13
13
|
export const NavigatorTabItem = JSX<NavigatorTabItemProps>(
|
|
14
|
-
({ className = '', label, active, children, onClick,
|
|
15
|
-
<a className={getLinkClasses(className, active)} href={
|
|
14
|
+
({ className = '', label, active, children, onClick, href, target = '_self' }) => (
|
|
15
|
+
<a className={getLinkClasses(className, active)} target={target} href={href} onClick={onClick}>
|
|
16
16
|
<span className={getTextClasses(active)}>{label || children}</span>
|
|
17
17
|
</a>
|
|
18
18
|
),
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
const getLinkClasses = (className: string, active?: boolean) => {
|
|
22
|
-
const classes = active ? 'bg-primary-main' : 'bg-white';
|
|
22
|
+
const classes = active ? 'bg-primary-main' : 'group bg-white';
|
|
23
|
+
|
|
23
24
|
return `${classes} ${LINK_CLASSES} ${className}`;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
const getTextClasses = (active?: boolean) => {
|
|
27
|
-
const classes = active ? 'text-white' : 'text-secondary-text hover:text-primary-main';
|
|
28
|
+
const classes = active ? 'text-white' : 'text-secondary-text group-hover:text-primary-main ';
|
|
29
|
+
|
|
28
30
|
return `${classes} ${TEXT_CLASSES}`;
|
|
29
31
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"navigatorTabs": [
|
|
3
|
-
{ "label": "Tab1", "
|
|
4
|
-
{ "label": "Tab2", "
|
|
5
|
-
{ "label": "
|
|
3
|
+
{ "label": "Tab1", "href": "#tab1" },
|
|
4
|
+
{ "label": "Tab2", "href": "#tab2" },
|
|
5
|
+
{ "label": "Link", "href": "https://rshb.ru", "target": "_blank" }
|
|
6
6
|
]
|
|
7
7
|
}
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
|
-
import { getHash } from '../../utils/url';
|
|
3
|
+
import { getHash, isURL } from '../../utils/url';
|
|
4
4
|
import type { Router } from '../ContentPage/ContentPageContext';
|
|
5
5
|
import { NavigatorTabItem } from './NavigatorTabItem';
|
|
6
6
|
import type { NavigatorTab, NavigatorTabsContent } from './NavigatorTabsContent';
|
|
7
7
|
|
|
8
|
-
export interface TabsBlockProps extends
|
|
8
|
+
export interface TabsBlockProps extends UniBlockProps, NavigatorTabsContent {}
|
|
9
9
|
|
|
10
10
|
export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
11
11
|
({ className = '', navigatorTabs, context, anchor = null }) => {
|
|
12
12
|
const router = context.useRouter();
|
|
13
|
-
const
|
|
13
|
+
const href = globalThis.location.href;
|
|
14
|
+
|
|
14
15
|
return (
|
|
15
16
|
<section
|
|
16
17
|
className={`sticky top-0 z-20 box-border flex gap-x-1 h-12 ${className}`}
|
|
17
18
|
id={anchor}
|
|
18
19
|
>
|
|
19
|
-
{navigatorTabs ? navigatorTabs.map(renderTab(
|
|
20
|
+
{navigatorTabs ? navigatorTabs.map(renderTab(href, router)) : null}
|
|
20
21
|
</section>
|
|
21
22
|
);
|
|
22
23
|
},
|
|
23
24
|
);
|
|
24
25
|
|
|
25
|
-
const renderTab = (
|
|
26
|
-
const
|
|
27
|
-
const active = hash ?
|
|
26
|
+
const renderTab = (href?: string, router?: Router) => (tab: NavigatorTab, i: number) => {
|
|
27
|
+
const hash = getHash(href);
|
|
28
|
+
const active = hash ? tab.href === hash : i === 0;
|
|
29
|
+
|
|
28
30
|
return (
|
|
29
31
|
<NavigatorTabItem
|
|
30
|
-
key={tab.
|
|
32
|
+
key={tab.href}
|
|
31
33
|
active={active}
|
|
32
|
-
onClick={() => router
|
|
34
|
+
onClick={() => handleRoute(router, tab.href)}
|
|
33
35
|
{...tab}
|
|
34
36
|
/>
|
|
35
37
|
);
|
|
36
38
|
};
|
|
39
|
+
|
|
40
|
+
const handleRoute = (router?: Router, href?: string) => {
|
|
41
|
+
if (isURL(href)) return; // if href if full URL - move to HTML href action, do not touch router
|
|
42
|
+
|
|
43
|
+
router?.replace(href || '');
|
|
44
|
+
};
|
|
@@ -18,6 +18,7 @@ export function renderBackwardButton(text: string, version: BlockVersion, classN
|
|
|
18
18
|
<Button
|
|
19
19
|
rounded
|
|
20
20
|
className={`w-12 h-12 min-h-12 max-h-12 flex items-center justify-center mr-3 ${backwardBgStyleMap[version]}`}
|
|
21
|
+
ariaLabel={text}
|
|
21
22
|
>
|
|
22
23
|
<Img
|
|
23
24
|
className={`w-4 h-4 min-w-4 min-h-4 rounded-full box-border ${backwardIconStyleMap[version]}`}
|
|
@@ -6,6 +6,7 @@ import { BaseTile } from '../BaseTile/BaseTile';
|
|
|
6
6
|
import { SocialMedia } from '../Footer/SocialMedia';
|
|
7
7
|
import type { UniBlockProps } from '../../types';
|
|
8
8
|
import type { RecommendationCardTypes } from './RecommendationContent';
|
|
9
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
9
10
|
|
|
10
11
|
export interface RecommendationCardProps extends RecommendationCardTypes, UniBlockProps {}
|
|
11
12
|
|
|
@@ -21,7 +22,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
|
21
22
|
className="flex justify-between"
|
|
22
23
|
title={
|
|
23
24
|
title ? (
|
|
24
|
-
<h4 className=
|
|
25
|
+
<Heading headingType="h4" as="h3" className="font-normal mb-3.5" title={title} />
|
|
25
26
|
) : null
|
|
26
27
|
}
|
|
27
28
|
image={image?.src && <Img className="mt-auto ml-7" image={image} />}
|
|
@@ -31,6 +31,65 @@ export default {
|
|
|
31
31
|
/>
|
|
32
32
|
</div>
|
|
33
33
|
),
|
|
34
|
+
'steps-img': (
|
|
35
|
+
<div className="container grid grid-cols-12">
|
|
36
|
+
<StepsBlock
|
|
37
|
+
className="col-span-12"
|
|
38
|
+
context={context}
|
|
39
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
40
|
+
showLines={false}
|
|
41
|
+
steps={[
|
|
42
|
+
{
|
|
43
|
+
label: 'В мобильном приложении или интернет-банке',
|
|
44
|
+
description: 'Для всех клиентов Россельхозбанка',
|
|
45
|
+
icon: { icon: 'SignDocsIcon' },
|
|
46
|
+
button: { text: 'Войти в интернет-банк' },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'Через Госуслуги',
|
|
50
|
+
description: 'При наличии данных в Единой биометрической системе',
|
|
51
|
+
icon: { icon: 'ClockIcon' },
|
|
52
|
+
button: { text: 'Оформить' },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'В офисах Россельхозбанка',
|
|
56
|
+
description: 'Откройте вклад',
|
|
57
|
+
icon: { icon: 'ComfortableCompIcon' },
|
|
58
|
+
button: { text: 'Офисы на карте' },
|
|
59
|
+
},
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
),
|
|
64
|
+
'steps-with-btn': (
|
|
65
|
+
<div className="container grid grid-cols-12">
|
|
66
|
+
<StepsBlock
|
|
67
|
+
className="col-span-12"
|
|
68
|
+
context={context}
|
|
69
|
+
title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
|
|
70
|
+
showLines={false}
|
|
71
|
+
steps={[
|
|
72
|
+
{
|
|
73
|
+
label: 'В мобильном приложении или интернет-банке',
|
|
74
|
+
description: 'Для всех клиентов Россельхозбанка',
|
|
75
|
+
icon: { icon: 'SignDocsIcon' },
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: 'Через Госуслуги',
|
|
79
|
+
description: 'При наличии данных в Единой биометрической системе',
|
|
80
|
+
icon: { icon: 'ClockIcon' },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'В офисах Россельхозбанка',
|
|
84
|
+
description: 'Откройте вклад',
|
|
85
|
+
icon: { icon: 'ComfortableCompIcon' },
|
|
86
|
+
},
|
|
87
|
+
]}
|
|
88
|
+
button={{ text: 'Отправить заявку' }}
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
),
|
|
92
|
+
|
|
34
93
|
'4 steps': (
|
|
35
94
|
<div className="container grid grid-cols-12">
|
|
36
95
|
<StepsBlock
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
3
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
4
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
6
|
import { joinList } from '../../utils/joinList';
|
|
6
7
|
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
@@ -8,7 +9,7 @@ import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
|
8
9
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
9
10
|
|
|
10
11
|
export const StepsBlock = JSX<StepsBlockProps>(
|
|
11
|
-
({ className = '', title, showLines = true, steps = [], anchor = null }) => {
|
|
12
|
+
({ className = '', title, showLines = true, steps = [], button, anchor = null }) => {
|
|
12
13
|
const shortGaps = steps.length > 3;
|
|
13
14
|
|
|
14
15
|
return (
|
|
@@ -32,10 +33,19 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
32
33
|
)(steps.map(renderStepIcon))}
|
|
33
34
|
</div>
|
|
34
35
|
<div className={`flex justify-between ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`}>
|
|
35
|
-
{steps.map(renderStepTitle)}
|
|
36
|
+
{steps.map((step, i) => renderStepTitle(step, i, Boolean(button?.text)))}
|
|
36
37
|
</div>
|
|
37
38
|
</div>
|
|
38
39
|
) : null}
|
|
40
|
+
{button?.text ? (
|
|
41
|
+
<Button
|
|
42
|
+
className="box-border mt-[43px] py-3 h-12 w-full max-w-[240px]"
|
|
43
|
+
version="primary"
|
|
44
|
+
href="#"
|
|
45
|
+
>
|
|
46
|
+
{button.text}
|
|
47
|
+
</Button>
|
|
48
|
+
) : null}
|
|
39
49
|
</section>
|
|
40
50
|
);
|
|
41
51
|
},
|
|
@@ -46,25 +56,38 @@ const renderStepIcon = (step: Step, i: number) => {
|
|
|
46
56
|
<div key={String(i)} className="flex flex-col items-center text-center relative">
|
|
47
57
|
<div className="h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10">
|
|
48
58
|
{(step.icon?.icon && <Img image={step.icon} width="48" height="48" />) || (
|
|
49
|
-
<span className="font-
|
|
59
|
+
<span className="font-normal text-title-sm text-secondary-text">{i + 1}</span>
|
|
50
60
|
)}
|
|
51
61
|
</div>
|
|
52
62
|
</div>
|
|
53
63
|
);
|
|
54
64
|
};
|
|
55
65
|
|
|
56
|
-
const renderStepTitle = (step: Step, i: number) => {
|
|
66
|
+
const renderStepTitle = (step: Step, i: number, isMainButton: boolean) => {
|
|
57
67
|
return (
|
|
58
68
|
<div
|
|
59
69
|
key={String(i)}
|
|
60
|
-
className="flex flex-col items-center text-center relative w-[276px] whitespace-pre-line overflow-hidden"
|
|
70
|
+
className="flex flex-col items-center justify-between text-center relative w-[276px] whitespace-pre-line overflow-hidden"
|
|
61
71
|
>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
<div>
|
|
73
|
+
{step.label && <div className="font-normal text-xl m-0 mt-4">{step.label}</div>}
|
|
74
|
+
{step.description && (
|
|
75
|
+
<div
|
|
76
|
+
className={`font-light text-base text-secondary-text ${step.label ? 'mt-2' : 'mt-4'}`}
|
|
77
|
+
>
|
|
78
|
+
{step.description}
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
{step?.button?.text && !isMainButton ? (
|
|
83
|
+
<Button
|
|
84
|
+
className="box-border mt-[38px] py-3 h-12 w-full max-w-[240px]"
|
|
85
|
+
version="primary"
|
|
86
|
+
href="#"
|
|
87
|
+
>
|
|
88
|
+
{step.button.text}
|
|
89
|
+
</Button>
|
|
90
|
+
) : null}
|
|
68
91
|
</div>
|
|
69
92
|
);
|
|
70
93
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
2
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
3
|
import type { Picture } from '../../model/Picture';
|
|
4
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @title Шаг
|
|
@@ -11,6 +12,7 @@ export interface Step {
|
|
|
11
12
|
/** @title Описание */
|
|
12
13
|
description?: string;
|
|
13
14
|
icon?: Picture;
|
|
15
|
+
button?: ButtonProps;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
/**
|
|
@@ -29,6 +31,7 @@ export interface StepsBlockContent {
|
|
|
29
31
|
* @maxItems 4
|
|
30
32
|
*/
|
|
31
33
|
steps?: Step[];
|
|
34
|
+
button?: ButtonProps;
|
|
32
35
|
/** @title Размер шагов (моб.) */
|
|
33
36
|
size?: SizeVersion; // TODO: mobile content
|
|
34
37
|
version?: BlockVersion; // TODO: mobile content
|
|
@@ -4,6 +4,7 @@ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import { List } from '../../ui-kit/List/List';
|
|
6
6
|
import type { TariffsTableCellData, TariffsTableList } from './TariffsTableContent';
|
|
7
|
+
import { getButtonAriaLabel } from './utils/getButtonAriaLabel';
|
|
7
8
|
|
|
8
9
|
export interface TariffsTableCellProps {
|
|
9
10
|
cell: TariffsTableCellData[];
|
|
@@ -53,6 +54,7 @@ const renderButtons = (buttons: ButtonWithIconProps[]) => (
|
|
|
53
54
|
<Button
|
|
54
55
|
className={`${idx > 0 && rounded ? 'ml-3' : ''} w-12 h-12`}
|
|
55
56
|
key={String(idx)}
|
|
57
|
+
ariaLabel={getButtonAriaLabel(icon)}
|
|
56
58
|
rounded={rounded}
|
|
57
59
|
appendLeft={icon ? <Img image={icon} width="24px" height="24px" asSVG /> : null}
|
|
58
60
|
{...buttonProps}
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
TariffsTableList,
|
|
10
10
|
TariffsTableTileCellProps,
|
|
11
11
|
} from './TariffsTableContent';
|
|
12
|
+
import { getButtonAriaLabel } from './utils/getButtonAriaLabel';
|
|
12
13
|
|
|
13
14
|
export const TariffsTableTileCell = JSX<TariffsTableTileCellProps>(({ header, data }) => {
|
|
14
15
|
return (
|
|
@@ -52,6 +53,7 @@ const renderButtons = (buttons: ButtonWithIconProps[]) => (
|
|
|
52
53
|
<Button
|
|
53
54
|
className={`mt-3 ${idx > 0 && rounded ? 'ml-2.5' : ''} ${icon ? 'w-12 h-12' : ''}`}
|
|
54
55
|
key={String(idx)}
|
|
56
|
+
ariaLabel={getButtonAriaLabel(icon)}
|
|
55
57
|
rounded={rounded}
|
|
56
58
|
appendLeft={icon ? <Img image={icon} width="24px" height="24px" asSVG /> : null}
|
|
57
59
|
{...buttonProps}
|
|
@@ -50,6 +50,7 @@ export const Tile = JSX<TileProps>((props) => {
|
|
|
50
50
|
title && (
|
|
51
51
|
<Heading
|
|
52
52
|
headingType={getTileHeadingType(className)}
|
|
53
|
+
as="h3"
|
|
53
54
|
title={title}
|
|
54
55
|
className={`whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
|
|
55
56
|
${version === 'primary' ? 'text-primary-text' : ''}`}
|
package/src/hooks/useLink.ts
CHANGED
|
@@ -16,7 +16,7 @@ export function useLink(
|
|
|
16
16
|
return {
|
|
17
17
|
...link,
|
|
18
18
|
href,
|
|
19
|
-
|
|
19
|
+
'aria-label': link.text,
|
|
20
20
|
onClick: handlerDecorator((ev: MouseEvent) => {
|
|
21
21
|
const isLocalHref = href && !isURL(href);
|
|
22
22
|
const isLocalTarget = !link.target || link.target === '_self';
|
|
@@ -45,21 +45,26 @@ export const RegularButton = JSX<ButtonCommonProps>(
|
|
|
45
45
|
children,
|
|
46
46
|
onClick,
|
|
47
47
|
...rest
|
|
48
|
-
}) =>
|
|
49
|
-
<a
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
}) => {
|
|
49
|
+
// Pick Button props to prevent forwarding into HTML <a> tag leading to errors being printed in console.
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
|
+
const { aboveText, appendLeft, ...linkProps } = rest;
|
|
52
|
+
return (
|
|
53
|
+
<a
|
|
54
|
+
className={`${buttonStyle} inline-block cursor-pointer no-underline ${
|
|
55
|
+
buttonStyleMap[version] || ''
|
|
56
|
+
} ${rounded ? 'rounded-full' : 'rounded-md'} ${className || ''}`}
|
|
57
|
+
href={href}
|
|
58
|
+
target={target}
|
|
59
|
+
onClick={onClick}
|
|
60
|
+
aria-label={ariaLabel}
|
|
61
|
+
role={href ? 'link' : 'button'}
|
|
62
|
+
{...linkProps}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</a>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
63
68
|
);
|
|
64
69
|
|
|
65
70
|
const DisabledButton = JSX<ButtonCommonProps>(
|