@redneckz/wildless-cms-uni-blocks 0.2.45 → 0.2.48
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/dist/BenefitsBlock.d.ts +2 -2
- package/dist/BenefitsBlock.js +2 -2
- package/dist/BenefitsBlock.js.map +1 -1
- package/dist/Blocks.d.ts +13 -0
- package/dist/Blocks.js +11 -7
- package/dist/Blocks.js.map +1 -1
- package/dist/ContentPage.d.ts +2 -2
- package/dist/ContentPage.js +4 -4
- package/dist/ContentPage.js.map +1 -1
- package/dist/ContentPageContext.d.ts +6 -3
- package/dist/ExchangeRateTile.d.ts +7 -0
- package/dist/ExchangeRateTile.js +32 -0
- package/dist/ExchangeRateTile.js.map +1 -0
- package/dist/Footer/Contacts.d.ts +2 -2
- package/dist/Footer/Footer.d.ts +3 -4
- package/dist/Footer/Footer.js +2 -2
- package/dist/Footer/Footer.js.map +1 -1
- package/dist/Footer/FooterLink.d.ts +2 -2
- package/dist/Footer/Sitemap.d.ts +2 -2
- package/dist/Footer/Sitemap.js +2 -1
- package/dist/Footer/Sitemap.js.map +1 -1
- package/dist/Footer/SocialMedia.d.ts +2 -2
- package/dist/Footer/SocialMedia.js +5 -5
- package/dist/Footer/SocialMedia.js.map +1 -1
- package/dist/Footer/index.d.ts +1 -1
- package/dist/Header/Header.d.ts +2 -2
- package/dist/Header/Header.js +3 -2
- package/dist/Header/Header.js.map +1 -1
- package/dist/Icons/DollarIcon.d.ts +1 -0
- package/dist/Icons/DollarIcon.js +6 -0
- package/dist/Icons/DollarIcon.js.map +1 -0
- package/dist/Icons/EuroIcon.d.ts +1 -0
- package/dist/Icons/EuroIcon.js +6 -0
- package/dist/Icons/EuroIcon.js.map +1 -0
- package/dist/Icons/index.d.ts +17 -16
- package/dist/Icons/index.js +26 -22
- package/dist/Icons/index.js.map +1 -1
- package/dist/Img.js +1 -1
- package/dist/Img.js.map +1 -1
- package/dist/LikeControl.d.ts +2 -2
- package/dist/LikeControl.js.map +1 -1
- package/dist/MobileAppTile.d.ts +8 -0
- package/dist/MobileAppTile.js +9 -0
- package/dist/MobileAppTile.js.map +1 -0
- package/dist/Placeholder.d.ts +3 -1
- package/dist/Placeholder.js +9 -2
- package/dist/Placeholder.js.map +1 -1
- package/dist/ProductBlock.d.ts +2 -2
- package/dist/ProductBlock.js +1 -1
- package/dist/ProductBlock.js.map +1 -1
- package/dist/ProductBlockInner.d.ts +2 -2
- package/dist/ProductGallery.d.ts +2 -2
- package/dist/ProductGallery.js +2 -2
- package/dist/ProductGallery.js.map +1 -1
- package/dist/ProjectSettings.d.ts +18 -0
- package/dist/ProjectSettings.js +30 -0
- package/dist/ProjectSettings.js.map +1 -0
- package/dist/StepsBlock.d.ts +2 -2
- package/dist/StepsBlock.js +2 -2
- package/dist/StepsBlock.js.map +1 -1
- package/dist/Tile.d.ts +2 -2
- package/dist/Tile.js +15 -7
- package/dist/Tile.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +3 -10
- package/dist/ui-kit/Button.js +1 -1
- package/dist/ui-kit/Button.js.map +1 -1
- package/dist/ui-kit/SearchBar.d.ts +2 -2
- package/dist/ui-kit/SearchBar.js.map +1 -1
- package/dist/useSitemap.d.ts +3 -0
- package/dist/useSitemap.js +16 -0
- package/dist/useSitemap.js.map +1 -0
- package/lib/BenefitsBlock.d.ts +2 -2
- package/lib/BenefitsBlock.js +2 -2
- package/lib/BenefitsBlock.js.map +1 -1
- package/lib/Blocks.d.ts +13 -0
- package/lib/Blocks.js +8 -4
- package/lib/Blocks.js.map +1 -1
- package/lib/ContentPage.d.ts +2 -2
- package/lib/ContentPage.js +4 -4
- package/lib/ContentPage.js.map +1 -1
- package/lib/ContentPageContext.d.ts +6 -3
- package/lib/ExchangeRateTile.d.ts +7 -0
- package/lib/ExchangeRateTile.js +30 -0
- package/lib/ExchangeRateTile.js.map +1 -0
- package/lib/Footer/Contacts.d.ts +2 -2
- package/lib/Footer/Footer.d.ts +3 -4
- package/lib/Footer/Footer.js +2 -2
- package/lib/Footer/Footer.js.map +1 -1
- package/lib/Footer/FooterLink.d.ts +2 -2
- package/lib/Footer/Sitemap.d.ts +2 -2
- package/lib/Footer/Sitemap.js +2 -1
- package/lib/Footer/Sitemap.js.map +1 -1
- package/lib/Footer/SocialMedia.d.ts +2 -2
- package/lib/Footer/SocialMedia.js +5 -5
- package/lib/Footer/SocialMedia.js.map +1 -1
- package/lib/Footer/index.d.ts +1 -1
- package/lib/Header/Header.d.ts +2 -2
- package/lib/Header/Header.js +3 -2
- package/lib/Header/Header.js.map +1 -1
- package/lib/Icons/DollarIcon.d.ts +1 -0
- package/lib/Icons/DollarIcon.js +3 -0
- package/lib/Icons/DollarIcon.js.map +1 -0
- package/lib/Icons/EuroIcon.d.ts +1 -0
- package/lib/Icons/EuroIcon.js +3 -0
- package/lib/Icons/EuroIcon.js.map +1 -0
- package/lib/Icons/index.d.ts +17 -16
- package/lib/Icons/index.js +17 -16
- package/lib/Icons/index.js.map +1 -1
- package/lib/Img.js +1 -1
- package/lib/Img.js.map +1 -1
- package/lib/LikeControl.d.ts +2 -2
- package/lib/LikeControl.js.map +1 -1
- package/lib/MobileAppTile.d.ts +8 -0
- package/lib/MobileAppTile.js +7 -0
- package/lib/MobileAppTile.js.map +1 -0
- package/lib/Placeholder.d.ts +3 -1
- package/lib/Placeholder.js +9 -2
- package/lib/Placeholder.js.map +1 -1
- package/lib/ProductBlock.d.ts +2 -2
- package/lib/ProductBlock.js +1 -1
- package/lib/ProductBlock.js.map +1 -1
- package/lib/ProductBlockInner.d.ts +2 -2
- package/lib/ProductGallery.d.ts +2 -2
- package/lib/ProductGallery.js +2 -2
- package/lib/ProductGallery.js.map +1 -1
- package/lib/ProjectSettings.d.ts +18 -0
- package/lib/ProjectSettings.js +28 -0
- package/lib/ProjectSettings.js.map +1 -0
- package/lib/StepsBlock.d.ts +2 -2
- package/lib/StepsBlock.js +2 -2
- package/lib/StepsBlock.js.map +1 -1
- package/lib/Tile.d.ts +2 -2
- package/lib/Tile.js +15 -7
- package/lib/Tile.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +3 -10
- package/lib/ui-kit/Button.js +1 -1
- package/lib/ui-kit/Button.js.map +1 -1
- package/lib/ui-kit/SearchBar.d.ts +2 -2
- package/lib/ui-kit/SearchBar.js.map +1 -1
- package/lib/useSitemap.d.ts +3 -0
- package/lib/useSitemap.js +13 -0
- package/lib/useSitemap.js.map +1 -0
- package/package.json +3 -2
- package/src/BenefitsBlock.fixture.tsx +34 -0
- package/src/BenefitsBlock.tsx +45 -0
- package/src/Blocks.ts +36 -0
- package/src/ContentPage.fixture.tsx +38 -0
- package/src/ContentPage.page.json +540 -0
- package/src/ContentPage.tsx +83 -0
- package/src/ContentPageContext.tsx +34 -0
- package/src/ContentPageHead.tsx +26 -0
- package/src/ExchangeRateTile.fixture.tsx +11 -0
- package/src/ExchangeRateTile.tsx +80 -0
- package/src/Footer/Contacts.tsx +71 -0
- package/src/Footer/Footer.fixture.tsx +265 -0
- package/src/Footer/Footer.tsx +47 -0
- package/src/Footer/FooterLink.ts +6 -0
- package/src/Footer/HorizontalNavigation.tsx +46 -0
- package/src/Footer/Sitemap.tsx +55 -0
- package/src/Footer/SocialMedia.tsx +46 -0
- package/src/Footer/TextInformation.tsx +50 -0
- package/src/Footer/index.ts +2 -0
- package/src/Header/Header.fixture.tsx +21 -0
- package/src/Header/Header.tsx +55 -0
- package/src/Header/HeaderContent.ts +6 -0
- package/src/Header/HeaderSecondaryMenu.tsx +42 -0
- package/src/Header/HeaderSecondaryMenuButton.tsx +21 -0
- package/src/Header/index.ts +3 -0
- package/src/Header/isSubItemActive.ts +9 -0
- package/src/Header/isTopItemActive.ts +13 -0
- package/src/Icons/ActualBalanceIcon.tsx +202 -0
- package/src/Icons/CalendarIcon.tsx +19 -0
- package/src/Icons/ClockIcon.tsx +212 -0
- package/src/Icons/ComfortableCompIcon.tsx +379 -0
- package/src/Icons/DollarIcon.tsx +12 -0
- package/src/Icons/EmptyWalletIcon.tsx +25 -0
- package/src/Icons/EuroIcon.tsx +12 -0
- package/src/Icons/GridIcon.tsx +9 -0
- package/src/Icons/LoupeIcon.tsx +11 -0
- package/src/Icons/NewDocIcon.tsx +262 -0
- package/src/Icons/OkIcon.tsx +8 -0
- package/src/Icons/PassSendIcon.tsx +250 -0
- package/src/Icons/PercentageSquareIcon.tsx +18 -0
- package/src/Icons/ProfileIcon.tsx +18 -0
- package/src/Icons/SignDocsIcon.tsx +295 -0
- package/src/Icons/TelegramIcon.tsx +8 -0
- package/src/Icons/VKIcon.tsx +10 -0
- package/src/Icons/index.ts +17 -0
- package/src/Img.tsx +22 -0
- package/src/LikeControl.fixture.tsx +5 -0
- package/src/LikeControl.tsx +23 -0
- package/src/MobileAppTile.fixture.tsx +15 -0
- package/src/MobileAppTile.tsx +34 -0
- package/src/Placeholder.fixture.tsx +5 -0
- package/src/Placeholder.tsx +33 -0
- package/src/ProductBlock.fixture.tsx +95 -0
- package/src/ProductBlock.tsx +15 -0
- package/src/ProductBlockInner.tsx +110 -0
- package/src/ProductGallery.fixture.tsx +138 -0
- package/src/ProductGallery.tsx +90 -0
- package/src/ProjectSettings.ts +38 -0
- package/src/StepsBlock.fixture.tsx +23 -0
- package/src/StepsBlock.tsx +51 -0
- package/src/Tile.fixture.tsx +124 -0
- package/src/Tile.tsx +89 -0
- package/src/api/LikeAPI.ts +141 -0
- package/src/common.css +39 -0
- package/src/content-page-repository/ContentPageRepository.ts +38 -0
- package/src/content-page-repository/TransformationOptions.ts +4 -0
- package/src/content-page-repository/index.ts +1 -0
- package/src/content-page-repository/mapJSON.spec.ts +28 -0
- package/src/content-page-repository/mapJSON.ts +23 -0
- package/src/content-page-repository/transformContentPage.ts +26 -0
- package/src/content-page-repository/transformMarkdown.ts +10 -0
- package/src/content-page-repository/transformPicture.ts +61 -0
- package/src/cosmos.decorator.tsx +19 -0
- package/src/index.ts +19 -0
- package/src/mergeTopItems.spec.ts +20 -0
- package/src/mergeTopItems.ts +13 -0
- package/src/setup-fixture.ts +49 -0
- package/src/types.ts +94 -0
- package/src/ui-kit/BlockItem.fixture.tsx +5 -0
- package/src/ui-kit/BlockItem.tsx +36 -0
- package/src/ui-kit/Breadcrumb.tsx +26 -0
- package/src/ui-kit/Button.fixture.tsx +113 -0
- package/src/ui-kit/Button.tsx +66 -0
- package/src/ui-kit/HeaderItem.fixture.tsx +8 -0
- package/src/ui-kit/HeaderItem.tsx +25 -0
- package/src/ui-kit/LikeButton.fixture.tsx +6 -0
- package/src/ui-kit/LikeButton.tsx +41 -0
- package/src/ui-kit/Logo.fixture.tsx +5 -0
- package/src/ui-kit/Logo.tsx +35 -0
- package/src/ui-kit/SVG.tsx +32 -0
- package/src/ui-kit/SearchBar.tsx +33 -0
- package/src/ui-kit/TopItem.fixture.tsx +8 -0
- package/src/ui-kit/TopItem.tsx +37 -0
- package/src/useLink.ts +28 -0
- package/src/useSitemap.ts +17 -0
- package/src/utils/url.ts +22 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import '../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { Button } from './Button';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
all: (
|
|
7
|
+
<div className="font-sans overflow-hidden">
|
|
8
|
+
<div>
|
|
9
|
+
<p>Private clients</p>
|
|
10
|
+
<div className="flex gap-6" data-theme="pc">
|
|
11
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Primary" version="primary" />
|
|
12
|
+
<Button
|
|
13
|
+
href="https://www.rshb.ru/"
|
|
14
|
+
target="_blank"
|
|
15
|
+
text="Secondary"
|
|
16
|
+
version="secondary"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<p>Business clients</p>
|
|
22
|
+
<div className="flex gap-6" data-theme="bc">
|
|
23
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Primary" version="primary" />
|
|
24
|
+
<Button
|
|
25
|
+
href="https://www.rshb.ru/"
|
|
26
|
+
target="_blank"
|
|
27
|
+
text="Secondary"
|
|
28
|
+
version="secondary"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<p>Ecosystem own</p>
|
|
34
|
+
<div className="flex gap-6" data-theme="eo">
|
|
35
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Primary" version="primary" />
|
|
36
|
+
<Button
|
|
37
|
+
href="https://www.rshb.ru/"
|
|
38
|
+
target="_blank"
|
|
39
|
+
text="Secondary"
|
|
40
|
+
version="secondary"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<p>Disabled</p>
|
|
46
|
+
<div className="flex gap-6">
|
|
47
|
+
<Button
|
|
48
|
+
href="https://www.rshb.ru/"
|
|
49
|
+
target="_blank"
|
|
50
|
+
text="Primary"
|
|
51
|
+
version="primary"
|
|
52
|
+
disabled
|
|
53
|
+
/>
|
|
54
|
+
<Button
|
|
55
|
+
href="https://www.rshb.ru/"
|
|
56
|
+
target="_blank"
|
|
57
|
+
text="Secondary"
|
|
58
|
+
version="secondary"
|
|
59
|
+
disabled
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
),
|
|
65
|
+
'primary (Private clients)': (
|
|
66
|
+
<div data-theme="pc">
|
|
67
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Сайт РСХБ" version="primary" />
|
|
68
|
+
</div>
|
|
69
|
+
),
|
|
70
|
+
'secondary (Private clients)': (
|
|
71
|
+
<div data-theme="pc">
|
|
72
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Сайт РСХБ" version="secondary" />
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
'primary (Business clients)': (
|
|
76
|
+
<div data-theme="bc">
|
|
77
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Сайт РСХБ" version="primary" />
|
|
78
|
+
</div>
|
|
79
|
+
),
|
|
80
|
+
'secondary (Business clients)': (
|
|
81
|
+
<div data-theme="bc">
|
|
82
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Сайт РСХБ" version="secondary" />
|
|
83
|
+
</div>
|
|
84
|
+
),
|
|
85
|
+
'primary (Ecosystem own)': (
|
|
86
|
+
<div data-theme="eo">
|
|
87
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Сайт РСХБ" version="primary" />
|
|
88
|
+
</div>
|
|
89
|
+
),
|
|
90
|
+
'secondary (Ecosystem own)': (
|
|
91
|
+
<div data-theme="eo">
|
|
92
|
+
<Button href="https://www.rshb.ru/" target="_blank" text="Сайт РСХБ" version="secondary" />
|
|
93
|
+
</div>
|
|
94
|
+
),
|
|
95
|
+
'primary (disabled)': (
|
|
96
|
+
<Button
|
|
97
|
+
href="https://www.rshb.ru/"
|
|
98
|
+
target="_blank"
|
|
99
|
+
text="Сайт РСХБ"
|
|
100
|
+
version="primary"
|
|
101
|
+
disabled
|
|
102
|
+
/>
|
|
103
|
+
),
|
|
104
|
+
'secondary (disabled)': (
|
|
105
|
+
<Button
|
|
106
|
+
href="https://www.rshb.ru/"
|
|
107
|
+
target="_blank"
|
|
108
|
+
text="Сайт РСХБ"
|
|
109
|
+
version="secondary"
|
|
110
|
+
disabled
|
|
111
|
+
/>
|
|
112
|
+
),
|
|
113
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { LinkContent } from '../types';
|
|
3
|
+
|
|
4
|
+
type ButtonVersion = 'primary' | 'secondary';
|
|
5
|
+
export interface ButtonProps extends LinkContent {
|
|
6
|
+
className?: string;
|
|
7
|
+
onClick?: (ev: MouseEvent) => any;
|
|
8
|
+
version?: ButtonVersion;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
disabled?: Boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const buttonStyleMap: Record<ButtonVersion, string> = {
|
|
14
|
+
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
15
|
+
secondary:
|
|
16
|
+
'text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const buttonDisabledStyleMap: Record<ButtonVersion, string> = {
|
|
20
|
+
primary: 'bg-secondary-dark text-secondary-text',
|
|
21
|
+
secondary: 'bg-secondary-light text-secondary-text',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const styleButton = 'inline-block rounded-md px-9 py-3.5 text-center font-sans';
|
|
25
|
+
|
|
26
|
+
export const Button = JSX<ButtonProps>(
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
text,
|
|
30
|
+
href,
|
|
31
|
+
target,
|
|
32
|
+
onClick,
|
|
33
|
+
children,
|
|
34
|
+
disabled,
|
|
35
|
+
version = 'primary',
|
|
36
|
+
ariaLabel,
|
|
37
|
+
}) => {
|
|
38
|
+
if (disabled) {
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
role="button"
|
|
42
|
+
aria-disabled="true"
|
|
43
|
+
aria-label={ariaLabel}
|
|
44
|
+
tabindex="-1"
|
|
45
|
+
className={`${styleButton} select-none ${buttonDisabledStyleMap[version]} ${
|
|
46
|
+
className || ''
|
|
47
|
+
}`}
|
|
48
|
+
>
|
|
49
|
+
<span className="text-sm font-medium">{text || children}</span>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<a
|
|
56
|
+
className={`${styleButton} no-underline ${buttonStyleMap[version]} ${className || ''}`}
|
|
57
|
+
href={href}
|
|
58
|
+
target={target}
|
|
59
|
+
onClick={onClick}
|
|
60
|
+
aria-label={ariaLabel}
|
|
61
|
+
>
|
|
62
|
+
<span className="text-sm font-medium">{text || children}</span>
|
|
63
|
+
</a>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { HeaderItem } from './HeaderItem';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
default: <HeaderItem href="https://www.rshb.ru/" target="_blank" text="Россельхозбанк" />,
|
|
7
|
+
active: <HeaderItem href="https://www.rshb.ru/" target="_blank" text="Россельхозбанк" active />,
|
|
8
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { TopItemProps } from './TopItem';
|
|
3
|
+
|
|
4
|
+
export type HeaderItemProps = TopItemProps;
|
|
5
|
+
|
|
6
|
+
export const HeaderItem = JSX<HeaderItemProps>(
|
|
7
|
+
({ className, text, href, target, active, onClick, children }) => {
|
|
8
|
+
const textStyle = active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main';
|
|
9
|
+
return (
|
|
10
|
+
<a
|
|
11
|
+
className={`relative inline-block bg-transparent text-center no-underline ${
|
|
12
|
+
className || ''
|
|
13
|
+
}`}
|
|
14
|
+
href={href}
|
|
15
|
+
target={target}
|
|
16
|
+
onClick={onClick}
|
|
17
|
+
>
|
|
18
|
+
<span className={`font-sans font-normal text-base ${textStyle}`}>{text || children}</span>
|
|
19
|
+
{active ? (
|
|
20
|
+
<div className="absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main" />
|
|
21
|
+
) : null}
|
|
22
|
+
</a>
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
3
|
+
export interface LikeButtonProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
onClick?: (ev: MouseEvent) => any;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const LikeButton = JSX<LikeButtonProps>(({ className, onClick, ariaLabel }) => (
|
|
10
|
+
<button
|
|
11
|
+
type="button"
|
|
12
|
+
className={`border-0 w-[36px] bg-inherit cursor-pointer ${className || ''}`}
|
|
13
|
+
onClick={onClick}
|
|
14
|
+
aria-label={ariaLabel}
|
|
15
|
+
>
|
|
16
|
+
{renderLikeIcon()}
|
|
17
|
+
</button>
|
|
18
|
+
));
|
|
19
|
+
|
|
20
|
+
const renderLikeIcon = () => {
|
|
21
|
+
const params = {
|
|
22
|
+
stroke: '#292D32',
|
|
23
|
+
strokeLinecap: 'round',
|
|
24
|
+
strokeLinejoin: 'round',
|
|
25
|
+
strokeWidth: '1.5',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
30
|
+
<path
|
|
31
|
+
{...params}
|
|
32
|
+
strokeMiterlimit="10"
|
|
33
|
+
d="M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"
|
|
34
|
+
/>
|
|
35
|
+
<path
|
|
36
|
+
{...params}
|
|
37
|
+
d="M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"
|
|
38
|
+
/>
|
|
39
|
+
</svg>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { SVG } from './SVG';
|
|
3
|
+
|
|
4
|
+
export interface LogoProps {
|
|
5
|
+
className: string;
|
|
6
|
+
href: string;
|
|
7
|
+
targetBlank: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const LOGO_PATHS = [
|
|
11
|
+
'm13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z',
|
|
12
|
+
'M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z',
|
|
13
|
+
'M33.93 35.53c.3-.41.6-.85.87-1.3v-2.66h-.87v3.96Zm2.54-4.92c.12-.4.24-.78.34-1.16h-2.88v.7h.43c.77-.02 1.63-.03 2.11.46Zm-19.19-1.27h-.78v7.91h.78v-7.9Z',
|
|
14
|
+
'M14.7 27.83h2.58c.67 0 1.14.14 1.4.4.27.25.4.72.4 1.38v7.4c0 .66-.12 1.12-.4 1.38-.4.41-1.16.41-1.78.41l-.4-.01v3.5l.78.14v-2.88c1.2 0 1.97-.4 2.34-1.22v4.29h.26l.5-.01V29.74c0-.68.13-1.16.4-1.43.25-.27.72-.4 1.37-.4.67 0 1.65-.1 2.16.4.26.27.38.76.38 1.43v3.8h-1.77v-4.06h-.77v12.99c.26-.03.5-.07.77-.12V34.3h1.77v7.64c.36-.1.72-.21 1.08-.34v-7c0-.8.19-1.4 1-1.67l-.9-4.87h1.8l.3 5.31h.22l.3-5.31h1.88l-1.01 4.87c.84.3 1.01.81 1.01 1.66v4.53a16.63 16.63 0 0 0 1.5-1.27v-9.83h5.25l.1-.72H24.93l.17.89c-.38-.72-1.12-1.08-2.2-1.08h-.77c-1.3 0-2.1.52-2.4 1.55-.27-1.08-1.1-1.62-2.46-1.62h-3.36v14.52c.26.09.52.18.78.25V27.84Zm16.29 5.58-.85-.8.85-4.37v5.17Z',
|
|
15
|
+
'M27.66 40.79c.27-.14.55-.28.8-.43v-5.98h-.8v6.4Z',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const Logo = JSX<Partial<LogoProps>>(({ className, href, children, targetBlank }) => {
|
|
19
|
+
return (
|
|
20
|
+
<a
|
|
21
|
+
className={`inline-flex items-center font-sans no-underline ${className || ''}`}
|
|
22
|
+
href={href || 'https://rshb.ru/'}
|
|
23
|
+
target={targetBlank ? '_blank' : '_self'}
|
|
24
|
+
>
|
|
25
|
+
<SVG
|
|
26
|
+
className="text-primary-main w-10"
|
|
27
|
+
viewBox="0 0 40 45"
|
|
28
|
+
paths={LOGO_PATHS.map((d) => ({ d }))}
|
|
29
|
+
/>
|
|
30
|
+
<span className="text-black text-base font-medium ml-2.5">
|
|
31
|
+
{children || 'Россельхозбанк'}
|
|
32
|
+
</span>
|
|
33
|
+
</a>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
3
|
+
interface SVGPathOptions {
|
|
4
|
+
fill?: string;
|
|
5
|
+
stroke?: string;
|
|
6
|
+
strokeLinecap?: string;
|
|
7
|
+
strokeLinejoin?: string;
|
|
8
|
+
strokeWidth?: string;
|
|
9
|
+
strokeMiterlimit?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface SVGPath extends SVGPathOptions {
|
|
13
|
+
d: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface SVGProps extends SVGPathOptions {
|
|
17
|
+
className?: string;
|
|
18
|
+
viewBox?: string;
|
|
19
|
+
paths: SVGPath[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const SVG = JSX<SVGProps>(
|
|
23
|
+
({ className, viewBox, fill = 'none', paths, ...commonOptions }) => {
|
|
24
|
+
return (
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" className={className} viewBox={viewBox} fill={fill}>
|
|
26
|
+
{paths.map(({ d, fill, ...options }, i) => (
|
|
27
|
+
<path key={i} d={d} fill={fill || 'currentColor'} {...commonOptions} {...options} />
|
|
28
|
+
))}
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../types';
|
|
3
|
+
import { LoupeIcon } from '../Icons/index';
|
|
4
|
+
|
|
5
|
+
export const SearchBar = JSX<UniBlockProps>(({ className, context }) => {
|
|
6
|
+
const search = context.useSearch();
|
|
7
|
+
return (
|
|
8
|
+
<form className={`relative ${className || ''}`}>
|
|
9
|
+
<div className="absolute rounded-l-full h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5">
|
|
10
|
+
<div className="w-[24px] h-[24px]">{LoupeIcon()}</div>
|
|
11
|
+
<span className="font-sans font-normal text-sm text-secondary-text">Поиск по сайту</span>
|
|
12
|
+
</div>
|
|
13
|
+
<input
|
|
14
|
+
className="pl-[170px] w-full font-sans font-normal text-sm border border-solid border-main-divider rounded-full h-full box-border outline-none"
|
|
15
|
+
value={search.term}
|
|
16
|
+
onChange={(e) => search.setTerm(e.target.value)}
|
|
17
|
+
type="text"
|
|
18
|
+
placeholder="Поиск по сайту"
|
|
19
|
+
name="s"
|
|
20
|
+
/>
|
|
21
|
+
<button
|
|
22
|
+
type="submit"
|
|
23
|
+
className="absolute font-sans font-normal text-sm cursor-pointer bg-transparent hover:bg-primary-hover active:bg-primary-active text-primary-main hover:text-white border-none px-5 rounded-r-full h-full top-0 right-0 outline-none"
|
|
24
|
+
onClick={(e) => {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
console.log('click');
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
Найти
|
|
30
|
+
</button>
|
|
31
|
+
</form>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import { TopItem } from './TopItem';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
default: <TopItem href="https://www.rshb.ru/" target="_blank" text="Экосистема Своё" />,
|
|
7
|
+
active: <TopItem href="https://www.rshb.ru/" target="_blank" text="Экосистема Своё" active />,
|
|
8
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { LinkContent } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface TopItemContent extends LinkContent {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface TopItemProps extends TopItemContent {
|
|
9
|
+
className?: string;
|
|
10
|
+
flat?: boolean;
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
onClick?: (ev: MouseEvent) => any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const TopItem = JSX<TopItemProps>(
|
|
16
|
+
({ className, text, href, target, active, flat, onClick, children, ariaLabel }) => {
|
|
17
|
+
const linkStyle = active ? 'border-primary-main rounded-3xl' : 'border-transparent';
|
|
18
|
+
const textStyle = active
|
|
19
|
+
? 'text-primary-main'
|
|
20
|
+
: `${flat ? 'text-primary-text' : 'text-secondary-text'} hover:text-primary-main`;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<a
|
|
24
|
+
className={`inline-block border border-solid bg-transparent text-center no-underline ${
|
|
25
|
+
flat ? '' : 'px-4 py-2'
|
|
26
|
+
} ${linkStyle} ${className || ''}`}
|
|
27
|
+
href={href}
|
|
28
|
+
target={target}
|
|
29
|
+
onClick={onClick}
|
|
30
|
+
rel="noopener noreferrer"
|
|
31
|
+
aria-label={ariaLabel}
|
|
32
|
+
>
|
|
33
|
+
<span className={`font-sans font-normal text-sm ${textStyle}`}>{text || children}</span>
|
|
34
|
+
</a>
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
);
|
package/src/useLink.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HandlerDecorator, Router } from './ContentPageContext';
|
|
2
|
+
import type { LinkContent } from './types';
|
|
3
|
+
import { isURL, toRelativeHref } from './utils/url';
|
|
4
|
+
|
|
5
|
+
const defaultHandlerDecorator: HandlerDecorator = (handler, targetContent) => handler;
|
|
6
|
+
|
|
7
|
+
export function useLink(
|
|
8
|
+
{
|
|
9
|
+
router,
|
|
10
|
+
handlerDecorator = defaultHandlerDecorator,
|
|
11
|
+
}: { router: Router; handlerDecorator?: HandlerDecorator },
|
|
12
|
+
link: Partial<LinkContent>,
|
|
13
|
+
) {
|
|
14
|
+
const href = toRelativeHref(link.href, router.href);
|
|
15
|
+
return {
|
|
16
|
+
...link,
|
|
17
|
+
href,
|
|
18
|
+
ariaLabel: link.text,
|
|
19
|
+
onClick: handlerDecorator((ev: MouseEvent) => {
|
|
20
|
+
const isLocalHref = href && !isURL(href);
|
|
21
|
+
const isLocalTarget = !link.target || link.target === '_self';
|
|
22
|
+
if (isLocalHref && isLocalTarget) {
|
|
23
|
+
ev.preventDefault();
|
|
24
|
+
router.push(href);
|
|
25
|
+
}
|
|
26
|
+
}, link),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AsyncDataHook } from './ContentPageContext';
|
|
2
|
+
import type { HeaderContent } from './Header/index';
|
|
3
|
+
import { projectSettings } from './ProjectSettings';
|
|
4
|
+
|
|
5
|
+
export function useSitemap(useAsyncData: AsyncDataHook): HeaderContent {
|
|
6
|
+
const { data } = useAsyncData(sitemapURL(), fetchSitemap);
|
|
7
|
+
return data || {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async function fetchSitemap(): Promise<HeaderContent> {
|
|
11
|
+
const response = await fetch(sitemapURL());
|
|
12
|
+
return await response.json();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function sitemapURL() {
|
|
16
|
+
return `/wcms-resources/${projectSettings.SITEMAP || 'sitemap'}.json`;
|
|
17
|
+
}
|
package/src/utils/url.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const isURL = (href?: string) => href?.includes('//');
|
|
2
|
+
|
|
3
|
+
export const withoutQuery = (href?: string) => (href || '').replace(/\/?\?.*/, '');
|
|
4
|
+
|
|
5
|
+
export const getOrigin = (href?: string) => {
|
|
6
|
+
if (isURL(href)) {
|
|
7
|
+
const url = href!;
|
|
8
|
+
const protoSeparator = '://';
|
|
9
|
+
const endOfProto = url.indexOf(protoSeparator);
|
|
10
|
+
const endOfOrigin = url.indexOf('/', endOfProto + protoSeparator.length);
|
|
11
|
+
return endOfOrigin !== -1 ? url.substring(0, endOfOrigin) : url;
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const toRelativeHref = (href?: string, baseURL?: string) => {
|
|
17
|
+
if (!href) {
|
|
18
|
+
return href;
|
|
19
|
+
}
|
|
20
|
+
const origin = getOrigin(baseURL);
|
|
21
|
+
return origin ? href.replace(origin, '') || '/' : href;
|
|
22
|
+
};
|