@redneckz/wildless-cms-uni-blocks 0.3.46 → 0.3.49
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 +67 -69
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/AccordionItem.js +2 -2
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/GracePeriod/GracePeriod.js +5 -3
- package/dist/components/GracePeriod/GracePeriod.js.map +1 -1
- package/dist/components/GracePeriod/GracePeriodContent.d.ts +15 -3
- package/dist/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabItem.d.ts +2 -2
- package/dist/components/NavigatorTabs/NavigatorTabItem.js +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabs.js +6 -9
- package/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabsContent.d.ts +2 -12
- package/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/renderBackwardButton.js +1 -1
- package/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/dist/components/ProductBlock/renderBenefit.js +1 -1
- package/dist/components/ProductBlock/renderBenefit.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +2 -3
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/dist/components/StepsBlock/StepsBlock.js +1 -1
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/Tile/Tile.js +4 -5
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/components/Tile/TileContent.d.ts +2 -2
- package/dist/types.d.ts +5 -1
- package/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/List/ListItem.js +2 -2
- package/dist/ui-kit/List/ListItem.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/BaseTile/getTileHeadingType.d.ts +1 -1
- package/lib/components/GracePeriod/GracePeriod.js +5 -3
- package/lib/components/GracePeriod/GracePeriod.js.map +1 -1
- package/lib/components/GracePeriod/GracePeriodContent.d.ts +15 -3
- package/lib/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabItem.d.ts +2 -2
- package/lib/components/NavigatorTabs/NavigatorTabItem.js +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabs.js +7 -10
- package/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabsContent.d.ts +2 -12
- package/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/renderBackwardButton.js +1 -1
- package/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/lib/components/ProductBlock/renderBenefit.js +1 -1
- package/lib/components/ProductBlock/renderBenefit.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +2 -3
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/lib/components/StepsBlock/StepsBlock.js +1 -1
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/Tile/Tile.js +4 -5
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/components/Tile/TileContent.d.ts +2 -2
- package/lib/types.d.ts +5 -1
- package/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/List/List.fixture.d.ts +4 -0
- package/lib/ui-kit/List/ListItem.js +2 -2
- package/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +3 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/GracePeriod/GracePeriod.js +5 -3
- package/mobile/dist/components/GracePeriod/GracePeriod.js.map +1 -1
- package/mobile/dist/components/GracePeriod/GracePeriodContent.d.ts +15 -3
- package/mobile/dist/components/NavigatorTabs/NavigatorTabItem.d.ts +2 -2
- package/mobile/dist/components/NavigatorTabs/NavigatorTabItem.js +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js +6 -9
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabsContent.d.ts +2 -12
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js +1 -1
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +2 -3
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/mobile/dist/components/Tile/Tile.js +4 -5
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
- package/mobile/dist/types.d.ts +5 -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/List/ListItem.js +2 -2
- package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/lib/components/GracePeriod/GracePeriod.js +5 -3
- package/mobile/lib/components/GracePeriod/GracePeriod.js.map +1 -1
- package/mobile/lib/components/GracePeriod/GracePeriodContent.d.ts +15 -3
- package/mobile/lib/components/NavigatorTabs/NavigatorTabItem.d.ts +2 -2
- package/mobile/lib/components/NavigatorTabs/NavigatorTabItem.js +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabItem.js.map +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js +7 -10
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabsContent.d.ts +2 -12
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js +1 -1
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +2 -3
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/mobile/lib/components/Tile/Tile.js +4 -5
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/lib/types.d.ts +5 -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/List/ListItem.js +2 -2
- package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +6 -6
- package/mobile/src/components/GracePeriod/GracePeriod.example.json +10 -5
- package/mobile/src/components/GracePeriod/GracePeriod.tsx +12 -6
- package/mobile/src/components/GracePeriod/GracePeriodContent.ts +15 -3
- package/mobile/src/components/NavigatorTabs/NavigatorTabItem.tsx +4 -4
- package/mobile/src/components/NavigatorTabs/NavigatorTabs.example.json +3 -3
- package/mobile/src/components/NavigatorTabs/NavigatorTabs.tsx +11 -14
- package/mobile/src/components/NavigatorTabs/NavigatorTabsContent.ts +2 -12
- package/mobile/src/components/ProductBlock/renderBackwardButton.tsx +1 -0
- package/mobile/src/components/ProductTile/ProductTile.example.json +1 -0
- package/mobile/src/components/ProductTile/ProductTile.tsx +3 -2
- package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -1
- package/mobile/src/components/Tile/Tile.example.json +1 -0
- package/mobile/src/components/Tile/Tile.tsx +4 -4
- package/mobile/src/components/Tile/TileContent.ts +2 -1
- package/mobile/src/types.ts +5 -1
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +1 -1
- package/mobile/src/ui-kit/List/ListItem.tsx +2 -2
- package/package.json +1 -1
- package/src/components/Accordion/AccordionItem.tsx +4 -2
- package/src/components/ContentPage/ContentPage.page.json +6 -6
- package/src/components/GracePeriod/GracePeriod.example.json +10 -5
- package/src/components/GracePeriod/GracePeriod.tsx +12 -6
- package/src/components/GracePeriod/GracePeriodContent.ts +15 -3
- package/src/components/LinkDocs/LinkDocsListItem.tsx +1 -1
- package/src/components/NavigatorTabs/NavigatorTabItem.tsx +4 -4
- package/src/components/NavigatorTabs/NavigatorTabs.example.json +3 -3
- package/src/components/NavigatorTabs/NavigatorTabs.fixture.tsx +6 -1
- package/src/components/NavigatorTabs/NavigatorTabs.tsx +11 -14
- package/src/components/NavigatorTabs/NavigatorTabsContent.ts +2 -12
- package/src/components/ProductBlock/ProductBlock.tsx +1 -1
- package/src/components/ProductBlock/renderBackwardButton.tsx +1 -0
- package/src/components/ProductBlock/renderBenefit.tsx +1 -1
- package/src/components/ProductTile/ProductTile.example.json +1 -0
- package/src/components/ProductTile/ProductTile.fixture.tsx +7 -2
- package/src/components/ProductTile/ProductTile.tsx +3 -2
- package/src/components/ProductTile/ProductTileContent.ts +2 -1
- package/src/components/StepsBlock/StepsBlock.tsx +1 -1
- package/src/components/Tile/Tile.example.json +1 -0
- package/src/components/Tile/Tile.fixture.tsx +6 -1
- package/src/components/Tile/Tile.tsx +4 -4
- package/src/components/Tile/TileContent.ts +2 -1
- package/src/types.ts +5 -1
- package/src/ui-kit/Button/ButtonInner.tsx +1 -1
- package/src/ui-kit/List/List.fixture.tsx +20 -0
- package/src/ui-kit/List/ListItem.tsx +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
|
|
4
|
-
export interface NavigatorTabItemProps extends
|
|
4
|
+
export interface NavigatorTabItemProps extends LinkProps {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
onClick?: (ev: MouseEvent) => void;
|
|
@@ -11,9 +11,9 @@ const TEXT_CLASSES = 'font-sans font-normal text-sm';
|
|
|
11
11
|
const LINK_CLASSES = 'flex-1 flex items-center justify-center cursor-pointer';
|
|
12
12
|
|
|
13
13
|
export const NavigatorTabItem = JSX<NavigatorTabItemProps>(
|
|
14
|
-
({ className = '',
|
|
14
|
+
({ className = '', text, active, children, onClick, href, target = '_self' }) => (
|
|
15
15
|
<a className={getLinkClasses(className, active)} target={target} href={href} onClick={onClick}>
|
|
16
|
-
<span className={getTextClasses(active)}>{
|
|
16
|
+
<span className={getTextClasses(active)}>{text || children}</span>
|
|
17
17
|
</a>
|
|
18
18
|
),
|
|
19
19
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"navigatorTabs": [
|
|
3
|
-
{ "
|
|
4
|
-
{ "
|
|
5
|
-
{ "
|
|
3
|
+
{ "text": "Таб 1", "href": "#tab1", "target": "_self" },
|
|
4
|
+
{ "text": "Таб 2", "href": "#tab2", "target": "_self" },
|
|
5
|
+
{ "text": "Ссылка", "href": "https://rshb.ru", "target": "_blank" }
|
|
6
6
|
]
|
|
7
7
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { LinkProps } from '../../model/LinkProps';
|
|
2
4
|
import type { UniBlockProps } from '../../types';
|
|
3
|
-
import { getHash
|
|
4
|
-
import type {
|
|
5
|
+
import { getHash } from '../../utils/url';
|
|
6
|
+
import type { ContentPageContext } from '../ContentPage/ContentPageContext';
|
|
5
7
|
import { NavigatorTabItem } from './NavigatorTabItem';
|
|
6
|
-
import type {
|
|
8
|
+
import type { NavigatorTabsContent } from './NavigatorTabsContent';
|
|
7
9
|
|
|
8
10
|
export interface TabsBlockProps extends UniBlockProps, NavigatorTabsContent {}
|
|
9
11
|
|
|
10
12
|
export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
11
13
|
({ className = '', navigatorTabs, context, anchor = null }) => {
|
|
12
|
-
const router = context.useRouter();
|
|
13
14
|
const href = globalThis.location?.href; // TODO: remove globalThis, use href from router
|
|
14
15
|
|
|
15
16
|
return (
|
|
@@ -17,13 +18,16 @@ export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
|
17
18
|
className={`sticky top-0 z-20 box-border flex gap-x-1 h-12 ${className}`}
|
|
18
19
|
id={anchor}
|
|
19
20
|
>
|
|
20
|
-
{navigatorTabs ? navigatorTabs.map(renderTab(
|
|
21
|
+
{navigatorTabs ? navigatorTabs.map(renderTab(context, href)) : null}
|
|
21
22
|
</section>
|
|
22
23
|
);
|
|
23
24
|
},
|
|
24
25
|
);
|
|
25
26
|
|
|
26
|
-
const renderTab = (
|
|
27
|
+
const renderTab = (context: ContentPageContext, href?: string) => (tab: LinkProps, i: number) => {
|
|
28
|
+
const { useRouter, handlerDecorator } = context;
|
|
29
|
+
const router = useRouter();
|
|
30
|
+
|
|
27
31
|
const hash = getHash(href);
|
|
28
32
|
const active = hash ? tab.href === hash : i === 0;
|
|
29
33
|
|
|
@@ -31,14 +35,7 @@ const renderTab = (href?: string, router?: Router) => (tab: NavigatorTab, i: num
|
|
|
31
35
|
<NavigatorTabItem
|
|
32
36
|
key={tab.href}
|
|
33
37
|
active={active}
|
|
34
|
-
|
|
35
|
-
{...tab}
|
|
38
|
+
{...useLink({ router, handlerDecorator }, tab)}
|
|
36
39
|
/>
|
|
37
40
|
);
|
|
38
41
|
};
|
|
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
|
-
};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @title Таб
|
|
3
|
-
*/
|
|
4
|
-
export interface NavigatorTab {
|
|
5
|
-
/** @title Название */
|
|
6
|
-
label?: string;
|
|
7
|
-
/** @title Якорь */
|
|
8
|
-
href?: string;
|
|
9
|
-
/** @title Таргет (target) */
|
|
10
|
-
target?: string;
|
|
11
|
-
}
|
|
1
|
+
import type { LinkProps } from '../../model/LinkProps';
|
|
12
2
|
|
|
13
3
|
/**
|
|
14
4
|
* @title Блок табов
|
|
@@ -18,5 +8,5 @@ export interface NavigatorTabsContent {
|
|
|
18
8
|
* @title Список табов
|
|
19
9
|
* @minItems 3
|
|
20
10
|
*/
|
|
21
|
-
navigatorTabs?:
|
|
11
|
+
navigatorTabs?: LinkProps[];
|
|
22
12
|
}
|
|
@@ -15,6 +15,7 @@ export function renderBackwardButton(
|
|
|
15
15
|
rounded
|
|
16
16
|
className="w-12 h-12 min-h-12 min-w-12 flex items-center justify-center mr-3"
|
|
17
17
|
ariaLabel={button?.text}
|
|
18
|
+
href={button?.href}
|
|
18
19
|
>
|
|
19
20
|
<Img className="w-4 h-4" image={button?.icon || { icon: 'ArrowLeftIcon' }} asSVG />
|
|
20
21
|
</Button>
|
|
@@ -6,7 +6,6 @@ import { Description } from '../../ui-kit/Description/Description';
|
|
|
6
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
8
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
9
|
-
import { getTileHeadingType } from '../BaseTile/getTileHeadingType';
|
|
10
9
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
|
|
11
10
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
|
|
12
11
|
import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
@@ -24,6 +23,7 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
24
23
|
context,
|
|
25
24
|
className = '',
|
|
26
25
|
title,
|
|
26
|
+
headingType = 'h3',
|
|
27
27
|
description,
|
|
28
28
|
benefits,
|
|
29
29
|
buttons,
|
|
@@ -43,7 +43,8 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
43
43
|
title={
|
|
44
44
|
title && (
|
|
45
45
|
<Heading
|
|
46
|
-
headingType={
|
|
46
|
+
headingType={headingType}
|
|
47
|
+
as="h3"
|
|
47
48
|
title={title}
|
|
48
49
|
className={`whitespace-pre-wrap max-w-[600px]`}
|
|
49
50
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
2
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
3
3
|
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
4
|
-
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
|
+
import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
|
|
5
5
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
6
|
import type { TextBenefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
7
7
|
|
|
@@ -9,6 +9,7 @@ import type { TextBenefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
|
9
9
|
* @title Продуктовая плитка
|
|
10
10
|
*/
|
|
11
11
|
export type ProductTileContent = HeadingContent &
|
|
12
|
+
HeadingTypeContent &
|
|
12
13
|
DescriptionContent &
|
|
13
14
|
ButtonContent &
|
|
14
15
|
ImageContent & {
|
|
@@ -7,7 +7,6 @@ import { Heading } from '../../ui-kit/Heading/Heading';
|
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
8
|
import { List } from '../../ui-kit/List/List';
|
|
9
9
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
10
|
-
import { getTileHeadingType } from '../BaseTile/getTileHeadingType';
|
|
11
10
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
|
|
12
11
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
|
|
13
12
|
import type { TileContent } from './TileContent';
|
|
@@ -25,6 +24,7 @@ export const Tile = JSX<TileProps>((props) => {
|
|
|
25
24
|
const {
|
|
26
25
|
context,
|
|
27
26
|
title,
|
|
27
|
+
headingType = 'h3',
|
|
28
28
|
description,
|
|
29
29
|
items,
|
|
30
30
|
children,
|
|
@@ -49,7 +49,7 @@ export const Tile = JSX<TileProps>((props) => {
|
|
|
49
49
|
title={
|
|
50
50
|
title && (
|
|
51
51
|
<Heading
|
|
52
|
-
headingType={
|
|
52
|
+
headingType={headingType}
|
|
53
53
|
as="h3"
|
|
54
54
|
title={title}
|
|
55
55
|
className={`whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
|
|
@@ -66,7 +66,7 @@ export const Tile = JSX<TileProps>((props) => {
|
|
|
66
66
|
>
|
|
67
67
|
{description && (
|
|
68
68
|
<Description
|
|
69
|
-
className="
|
|
69
|
+
className="max-w-[600px] text-title-new-sm font-light"
|
|
70
70
|
description={description}
|
|
71
71
|
/>
|
|
72
72
|
)}
|
|
@@ -81,7 +81,7 @@ function renderList(items, version) {
|
|
|
81
81
|
return items?.length ? (
|
|
82
82
|
<List
|
|
83
83
|
items={items}
|
|
84
|
-
itemClassName="text-title-
|
|
84
|
+
itemClassName="text-title-2xs font-light mt-2"
|
|
85
85
|
version={version === 'primary' ? 'tile' : 'tile-white'}
|
|
86
86
|
/>
|
|
87
87
|
) : null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
2
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
3
3
|
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
4
|
-
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
|
+
import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
|
|
5
5
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
6
|
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
7
|
|
|
@@ -9,6 +9,7 @@ import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
|
9
9
|
* @title Плитка
|
|
10
10
|
*/
|
|
11
11
|
export type TileContent = HeadingContent &
|
|
12
|
+
HeadingTypeContent &
|
|
12
13
|
DescriptionContent &
|
|
13
14
|
ListContent &
|
|
14
15
|
ButtonContent &
|
package/mobile/src/types.ts
CHANGED
|
@@ -2,7 +2,11 @@ import type { BlockContent } from './components/BlockContent';
|
|
|
2
2
|
import type { ContentPageContext } from './components/ContentPage/ContentPageContext';
|
|
3
3
|
import type { BlockVersion } from './model/BlockVersion';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @title Цветовая палитра
|
|
7
|
+
* @enumNames ["", "Частным клиентам", "Бизнес клиентам", "Экосистема Своё"]
|
|
8
|
+
*/
|
|
9
|
+
export type ColorPalette = '' | 'pc' | 'bc' | 'eo';
|
|
6
10
|
|
|
7
11
|
export interface BaseBlockDef {
|
|
8
12
|
type?: string;
|
|
@@ -14,7 +14,7 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
|
|
|
14
14
|
{isWithText(props) ? (
|
|
15
15
|
<div>
|
|
16
16
|
<div className="text-m-2xs font-light text-left">{aboveText}</div>
|
|
17
|
-
<div className="text-button
|
|
17
|
+
<div className="text-button text-left">{text}</div>
|
|
18
18
|
</div>
|
|
19
19
|
) : null}
|
|
20
20
|
</div>
|
|
@@ -15,8 +15,8 @@ const LIST_STYLE_CLASSES = {
|
|
|
15
15
|
primary: 'rounded-full inline-block mr-3 mt-2',
|
|
16
16
|
secondary: 'rounded-full inline-block mr-3 mt-2',
|
|
17
17
|
gray: 'rounded-full inline-block mr-3 mt-2',
|
|
18
|
-
tile: 'rounded-full inline-block mr-4',
|
|
19
|
-
'tile-white': 'rounded-full inline-block mr-4',
|
|
18
|
+
tile: 'rounded-full inline-block mr-4 mt-3',
|
|
19
|
+
'tile-white': 'rounded-full inline-block mr-4 mt-3',
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const LIST_DOT_STYLE_MAP: Record<ListItemVersion, string> = {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
3
4
|
import type { AccordionItemCommonProps } from './AccordionContent';
|
|
4
5
|
import { AccordionItemInner } from './AccordionItemInner';
|
|
5
6
|
import { useActiveHandler } from './useActiveHandler';
|
|
6
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
7
7
|
|
|
8
8
|
export interface AccordionItemProps extends AccordionItemCommonProps, UniBlockProps {}
|
|
9
9
|
|
|
@@ -23,7 +23,9 @@ export const AccordionItem = JSX<AccordionItemProps>(({ label, isExpanded, block
|
|
|
23
23
|
onClick={handleToggle}
|
|
24
24
|
>
|
|
25
25
|
<span className={`text-xl pr-2.5 font-medium`}>{label}</span>
|
|
26
|
-
{hasContent ?
|
|
26
|
+
{hasContent ? (
|
|
27
|
+
<Img image={icon} className="text-primary-main" width="24" height="24" asSVG />
|
|
28
|
+
) : null}
|
|
27
29
|
</button>
|
|
28
30
|
{hasContent ? (
|
|
29
31
|
<AccordionItemInner isExpanded={isActive} blocks={blocks} context={context} />
|
|
@@ -553,27 +553,27 @@
|
|
|
553
553
|
"content": {
|
|
554
554
|
"navigatorTabs": [
|
|
555
555
|
{
|
|
556
|
-
"
|
|
556
|
+
"text": "Калькулятор",
|
|
557
557
|
"href": "#calculator"
|
|
558
558
|
},
|
|
559
559
|
{
|
|
560
|
-
"
|
|
560
|
+
"text": "Преимущества",
|
|
561
561
|
"href": "#advantages"
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
|
-
"
|
|
564
|
+
"text": "Как оформить",
|
|
565
565
|
"href": "#howToApply"
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
|
-
"
|
|
568
|
+
"text": "Тарифы",
|
|
569
569
|
"href": "#tariffs"
|
|
570
570
|
},
|
|
571
571
|
{
|
|
572
|
-
"
|
|
572
|
+
"text": "Документы",
|
|
573
573
|
"href": "#documents"
|
|
574
574
|
},
|
|
575
575
|
{
|
|
576
|
-
"
|
|
576
|
+
"text": "Урожай",
|
|
577
577
|
"href": "https://rshb.ru/",
|
|
578
578
|
"target": "_blank"
|
|
579
579
|
}
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"src": "calendar/august.png",
|
|
13
13
|
"format": "webp",
|
|
14
14
|
"size": {
|
|
15
|
-
"width": 210
|
|
15
|
+
"width": 210,
|
|
16
|
+
"height": 190
|
|
16
17
|
},
|
|
17
18
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
18
19
|
}
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
"src": "calendar/september.png",
|
|
30
31
|
"format": "webp",
|
|
31
32
|
"size": {
|
|
32
|
-
"width": 210
|
|
33
|
+
"width": 210,
|
|
34
|
+
"height": 190
|
|
33
35
|
},
|
|
34
36
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
35
37
|
}
|
|
@@ -40,7 +42,8 @@
|
|
|
40
42
|
"src": "calendar/october.png",
|
|
41
43
|
"format": "webp",
|
|
42
44
|
"size": {
|
|
43
|
-
"width": 210
|
|
45
|
+
"width": 210,
|
|
46
|
+
"height": 190
|
|
44
47
|
},
|
|
45
48
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
46
49
|
}
|
|
@@ -57,7 +60,8 @@
|
|
|
57
60
|
"src": "calendar/november.png",
|
|
58
61
|
"format": "webp",
|
|
59
62
|
"size": {
|
|
60
|
-
"width": 210
|
|
63
|
+
"width": 210,
|
|
64
|
+
"height": 190
|
|
61
65
|
},
|
|
62
66
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
63
67
|
}
|
|
@@ -74,7 +78,8 @@
|
|
|
74
78
|
"src": "calendar/december.png",
|
|
75
79
|
"format": "webp",
|
|
76
80
|
"size": {
|
|
77
|
-
"width": 210
|
|
81
|
+
"width": 210,
|
|
82
|
+
"height": 190
|
|
78
83
|
},
|
|
79
84
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
80
85
|
}
|
|
@@ -21,17 +21,23 @@ export const GracePeriod = JSX<GracePeriodProps>(
|
|
|
21
21
|
|
|
22
22
|
const renderCalendar = (calendar) => {
|
|
23
23
|
const colCount =
|
|
24
|
-
calendar.reduce(
|
|
24
|
+
calendar.reduce(
|
|
25
|
+
(accumulator, currentValue) =>
|
|
26
|
+
currentValue?.month?.length ? accumulator + currentValue.month.length : accumulator,
|
|
27
|
+
0,
|
|
28
|
+
) || 1;
|
|
25
29
|
const colSize = 100 / colCount;
|
|
26
30
|
|
|
27
|
-
const mappedCalendar = calendar
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const mappedCalendar = calendar
|
|
32
|
+
.filter((_) => _?.month?.length)
|
|
33
|
+
.map((_) => ({
|
|
34
|
+
..._,
|
|
35
|
+
flexBasis: `${_.month.length * colSize}%`,
|
|
36
|
+
}));
|
|
31
37
|
|
|
32
38
|
return (
|
|
33
39
|
<div className="w-full flex flex-col justify-center mt-14">
|
|
34
|
-
<div className="flex w-full mb-3 font-light text-m-title-md
|
|
40
|
+
<div className="flex w-full mb-3 font-light text-m-title-md text-center">
|
|
35
41
|
{mappedCalendar.map((_) => renderMonthNames(_, colSize))}
|
|
36
42
|
</div>
|
|
37
43
|
<div className="flex w-full">
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
2
1
|
import type { Picture } from '../../model/Picture';
|
|
3
2
|
|
|
4
3
|
interface Month {
|
|
5
4
|
/** @title Название месяца */
|
|
6
5
|
name?: string;
|
|
7
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title Изображение календарного месяца
|
|
8
|
+
* @default
|
|
9
|
+
* {
|
|
10
|
+
* format: "webp",
|
|
11
|
+
* size: {
|
|
12
|
+
* width: 210,
|
|
13
|
+
* height: 190
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
8
17
|
image?: Picture;
|
|
9
18
|
}
|
|
10
19
|
|
|
11
20
|
interface CalendarItem {
|
|
21
|
+
/** @title Месяц */
|
|
12
22
|
month?: Month[];
|
|
13
23
|
/** @title Основной текст */
|
|
14
24
|
blackText?: string;
|
|
@@ -19,7 +29,9 @@ interface CalendarItem {
|
|
|
19
29
|
/**
|
|
20
30
|
* @title Льготный период
|
|
21
31
|
*/
|
|
22
|
-
export interface GracePeriodContent
|
|
32
|
+
export interface GracePeriodContent {
|
|
33
|
+
/** @title Заголовок */
|
|
34
|
+
title?: string;
|
|
23
35
|
/** @title Описание */
|
|
24
36
|
description?: string;
|
|
25
37
|
/** @title Календарь */
|
|
@@ -5,7 +5,7 @@ import { LinkDocsListItemBase } from './LinkDocsListItemBase';
|
|
|
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-2.5 min-w-6 min-h-6
|
|
8
|
+
iconClassName="mr-2.5 min-w-6 min-h-6"
|
|
9
9
|
textClassName="self-center font-light"
|
|
10
10
|
suffixClassName="text-secondary-text group-hover:text-primary-main"
|
|
11
11
|
doc={doc}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
|
|
4
|
-
export interface NavigatorTabItemProps extends
|
|
4
|
+
export interface NavigatorTabItemProps extends LinkProps {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
onClick?: (ev: MouseEvent) => void;
|
|
@@ -11,9 +11,9 @@ const TEXT_CLASSES = 'font-sans font-normal text-sm';
|
|
|
11
11
|
const LINK_CLASSES = 'flex-1 flex items-center justify-center cursor-pointer';
|
|
12
12
|
|
|
13
13
|
export const NavigatorTabItem = JSX<NavigatorTabItemProps>(
|
|
14
|
-
({ className = '',
|
|
14
|
+
({ className = '', text, active, children, onClick, href, target = '_self' }) => (
|
|
15
15
|
<a className={getLinkClasses(className, active)} target={target} href={href} onClick={onClick}>
|
|
16
|
-
<span className={getTextClasses(active)}>{
|
|
16
|
+
<span className={getTextClasses(active)}>{text || children}</span>
|
|
17
17
|
</a>
|
|
18
18
|
),
|
|
19
19
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"navigatorTabs": [
|
|
3
|
-
{ "
|
|
4
|
-
{ "
|
|
5
|
-
{ "
|
|
3
|
+
{ "text": "Таб 1", "href": "#tab1", "target": "_self" },
|
|
4
|
+
{ "text": "Таб 2", "href": "#tab2", "target": "_self" },
|
|
5
|
+
{ "text": "Ссылка", "href": "https://rshb.ru", "target": "_blank" }
|
|
6
6
|
]
|
|
7
7
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { context } from '../../setup-fixture';
|
|
2
2
|
import { NavigatorTabs } from './NavigatorTabs';
|
|
3
3
|
import tabsExample from './NavigatorTabs.example.json';
|
|
4
|
+
import type { NavigatorTabsContent } from './NavigatorTabsContent';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
default: (
|
|
7
8
|
<div className="container grid grid-cols-12">
|
|
8
|
-
<NavigatorTabs
|
|
9
|
+
<NavigatorTabs
|
|
10
|
+
context={context}
|
|
11
|
+
className="col-span-12"
|
|
12
|
+
{...(tabsExample as NavigatorTabsContent)}
|
|
13
|
+
/>
|
|
9
14
|
</div>
|
|
10
15
|
),
|
|
11
16
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { LinkProps } from '../../model/LinkProps';
|
|
2
4
|
import type { UniBlockProps } from '../../types';
|
|
3
|
-
import { getHash
|
|
4
|
-
import type {
|
|
5
|
+
import { getHash } from '../../utils/url';
|
|
6
|
+
import type { ContentPageContext } from '../ContentPage/ContentPageContext';
|
|
5
7
|
import { NavigatorTabItem } from './NavigatorTabItem';
|
|
6
|
-
import type {
|
|
8
|
+
import type { NavigatorTabsContent } from './NavigatorTabsContent';
|
|
7
9
|
|
|
8
10
|
export interface TabsBlockProps extends UniBlockProps, NavigatorTabsContent {}
|
|
9
11
|
|
|
10
12
|
export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
11
13
|
({ className = '', navigatorTabs, context, anchor = null }) => {
|
|
12
|
-
const router = context.useRouter();
|
|
13
14
|
const href = globalThis.location?.href; // TODO: remove globalThis, use href from router
|
|
14
15
|
|
|
15
16
|
return (
|
|
@@ -17,13 +18,16 @@ export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
|
17
18
|
className={`sticky top-0 z-20 box-border flex gap-x-1 h-12 ${className}`}
|
|
18
19
|
id={anchor}
|
|
19
20
|
>
|
|
20
|
-
{navigatorTabs ? navigatorTabs.map(renderTab(
|
|
21
|
+
{navigatorTabs ? navigatorTabs.map(renderTab(context, href)) : null}
|
|
21
22
|
</section>
|
|
22
23
|
);
|
|
23
24
|
},
|
|
24
25
|
);
|
|
25
26
|
|
|
26
|
-
const renderTab = (
|
|
27
|
+
const renderTab = (context: ContentPageContext, href?: string) => (tab: LinkProps, i: number) => {
|
|
28
|
+
const { useRouter, handlerDecorator } = context;
|
|
29
|
+
const router = useRouter();
|
|
30
|
+
|
|
27
31
|
const hash = getHash(href);
|
|
28
32
|
const active = hash ? tab.href === hash : i === 0;
|
|
29
33
|
|
|
@@ -31,14 +35,7 @@ const renderTab = (href?: string, router?: Router) => (tab: NavigatorTab, i: num
|
|
|
31
35
|
<NavigatorTabItem
|
|
32
36
|
key={tab.href}
|
|
33
37
|
active={active}
|
|
34
|
-
|
|
35
|
-
{...tab}
|
|
38
|
+
{...useLink({ router, handlerDecorator }, tab)}
|
|
36
39
|
/>
|
|
37
40
|
);
|
|
38
41
|
};
|
|
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
|
-
};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @title Таб
|
|
3
|
-
*/
|
|
4
|
-
export interface NavigatorTab {
|
|
5
|
-
/** @title Название */
|
|
6
|
-
label?: string;
|
|
7
|
-
/** @title Якорь */
|
|
8
|
-
href?: string;
|
|
9
|
-
/** @title Таргет (target) */
|
|
10
|
-
target?: string;
|
|
11
|
-
}
|
|
1
|
+
import type { LinkProps } from '../../model/LinkProps';
|
|
12
2
|
|
|
13
3
|
/**
|
|
14
4
|
* @title Блок табов
|
|
@@ -18,5 +8,5 @@ export interface NavigatorTabsContent {
|
|
|
18
8
|
* @title Список табов
|
|
19
9
|
* @minItems 3
|
|
20
10
|
*/
|
|
21
|
-
navigatorTabs?:
|
|
11
|
+
navigatorTabs?: LinkProps[];
|
|
22
12
|
}
|
|
@@ -37,7 +37,7 @@ export const ProductBlock = JSX<ProductBlockProps>((props) => {
|
|
|
37
37
|
className={`font-sans overflow-hidden pt-[50px] pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${productBlockStyleMap[version]} ${className}`}
|
|
38
38
|
id={anchor}
|
|
39
39
|
>
|
|
40
|
-
{backwardButton ? renderBackwardButton(backwardButton, version, 'mb-10 -mt-
|
|
40
|
+
{backwardButton?.text ? renderBackwardButton(backwardButton, version, 'mb-10 -mt-2.5') : null}
|
|
41
41
|
{breadcrumbs?.length ? (
|
|
42
42
|
<div className="text-xs mb-6">
|
|
43
43
|
{joinList(<span className={`mx-2 ${breadcrumbsStyleMap[version]}`}>/</span>)(
|
|
@@ -15,6 +15,7 @@ export function renderBackwardButton(
|
|
|
15
15
|
rounded
|
|
16
16
|
className="w-12 h-12 min-h-12 min-w-12 flex items-center justify-center mr-3"
|
|
17
17
|
ariaLabel={button?.text}
|
|
18
|
+
href={button?.href}
|
|
18
19
|
>
|
|
19
20
|
<Img className="w-4 h-4" image={button?.icon || { icon: 'ArrowLeftIcon' }} asSVG />
|
|
20
21
|
</Button>
|
|
@@ -20,7 +20,7 @@ export function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
|
20
20
|
<div key={String(i)} className="flex gap-4 items-center">
|
|
21
21
|
{benefit.icon ? (
|
|
22
22
|
<Img
|
|
23
|
-
className={`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border text-
|
|
23
|
+
className={`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border text-primary-text ${benefitIconBgStyleMap[version]}`}
|
|
24
24
|
image={benefit.icon}
|
|
25
25
|
width="24"
|
|
26
26
|
height="24"
|