@redneckz/wildless-cms-uni-blocks 0.3.47 → 0.3.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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +25 -29
- package/bundle/bundle.umd.min.js +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/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 +2 -3
- 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/lib/common.css +1 -1
- package/lib/components/BaseTile/getTileHeadingType.d.ts +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/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 +2 -3
- 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/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- 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/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 +2 -3
- 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/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/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 +2 -3
- 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/src/components/ContentPage/ContentPage.page.json +6 -6
- 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/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 +2 -2
- 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/package.json +1 -1
- package/src/components/ContentPage/ContentPage.page.json +6 -6
- 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/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 +5 -0
- package/src/components/Tile/Tile.tsx +2 -2
- package/src/components/Tile/TileContent.ts +2 -1
- package/src/types.ts +5 -1
- package/src/ui-kit/Button/ButtonInner.tsx +1 -1
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import {
|
|
3
|
+
import { useLink } from '../../hooks/useLink.js';
|
|
4
|
+
import { getHash } from '../../utils/url.js';
|
|
4
5
|
import { NavigatorTabItem } from './NavigatorTabItem.js';
|
|
5
6
|
export const NavigatorTabs = JSX(({ className = '', navigatorTabs, context, anchor = null }) => {
|
|
6
|
-
const router = context.useRouter();
|
|
7
7
|
const href = globalThis.location?.href; // TODO: remove globalThis, use href from router
|
|
8
|
-
return (_jsx("section", { className: `sticky top-0 z-20 box-border flex gap-x-1 h-12 ${className}`, id: anchor, children: navigatorTabs ? navigatorTabs.map(renderTab(
|
|
8
|
+
return (_jsx("section", { className: `sticky top-0 z-20 box-border flex gap-x-1 h-12 ${className}`, id: anchor, children: navigatorTabs ? navigatorTabs.map(renderTab(context, href)) : null }));
|
|
9
9
|
});
|
|
10
|
-
const renderTab = (
|
|
10
|
+
const renderTab = (context, href) => (tab, i) => {
|
|
11
|
+
const { useRouter, handlerDecorator } = context;
|
|
12
|
+
const router = useRouter();
|
|
11
13
|
const hash = getHash(href);
|
|
12
14
|
const active = hash ? tab.href === hash : i === 0;
|
|
13
|
-
return (_jsx(NavigatorTabItem, { active: active,
|
|
14
|
-
};
|
|
15
|
-
const handleRoute = (router, href) => {
|
|
16
|
-
if (isURL(href))
|
|
17
|
-
return; // if href if full URL - move to HTML href action, do not touch router
|
|
18
|
-
router?.replace(href || '');
|
|
15
|
+
return (_jsx(NavigatorTabItem, { active: active, ...useLink({ router, handlerDecorator }, tab) }, tab.href));
|
|
19
16
|
};
|
|
20
17
|
//# sourceMappingURL=NavigatorTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigatorTabs.js","sourceRoot":"","sources":["../../../src/components/NavigatorTabs/NavigatorTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigatorTabs.js","sourceRoot":"","sources":["../../../src/components/NavigatorTabs/NavigatorTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAC9B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE,EAAE;IAC5D,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,gDAAgD;IAExF,OAAO,CACL,kBACE,SAAS,EAAE,kDAAkD,SAAS,EAAE,EACxE,EAAE,EAAE,MAAM,YAET,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAC3D,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,OAA2B,EAAE,IAAa,EAAE,EAAE,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;IAC9F,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAChD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAElD,OAAO,CACL,KAAC,gBAAgB,IAEf,MAAM,EAAE,MAAM,KACV,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,GAAG,CAAC,IAFzC,GAAG,CAAC,IAAI,CAGb,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -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
|
* @title Блок табов
|
|
14
4
|
*/
|
|
@@ -17,5 +7,5 @@ export interface NavigatorTabsContent {
|
|
|
17
7
|
* @title Список табов
|
|
18
8
|
* @minItems 3
|
|
19
9
|
*/
|
|
20
|
-
navigatorTabs?:
|
|
10
|
+
navigatorTabs?: LinkProps[];
|
|
21
11
|
}
|
|
@@ -5,15 +5,14 @@ import { Description } from '../../ui-kit/Description/Description.js';
|
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
7
7
|
import { BaseTile } from '../BaseTile/BaseTile.js';
|
|
8
|
-
import { getTileHeadingType } from '../BaseTile/getTileHeadingType.js';
|
|
9
8
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight.js';
|
|
10
9
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding.js';
|
|
11
10
|
const productTileStyleMap = {
|
|
12
11
|
primary: 'bg-white text-primary-text',
|
|
13
12
|
secondary: 'bg-primary-main text-white',
|
|
14
13
|
};
|
|
15
|
-
export const ProductTile = JSX(({ context, className = '', title, description, benefits, buttons, image, version = 'primary', anchor = null, }) => {
|
|
16
|
-
return (_jsx("section", { className: `bg-white overflow-hidden text-primary-text font-sans p-9 box-border ${className} ${productTileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, id: anchor, children: _jsxs(BaseTile, { context: context, title: title && (_jsx(Heading, { headingType:
|
|
14
|
+
export const ProductTile = JSX(({ context, className = '', title, headingType = 'h3', description, benefits, buttons, image, version = 'primary', anchor = null, }) => {
|
|
15
|
+
return (_jsx("section", { className: `bg-white overflow-hidden text-primary-text font-sans p-9 box-border ${className} ${productTileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, id: anchor, children: _jsxs(BaseTile, { context: context, title: title && (_jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap max-w-[600px]` })), buttons: buttons?.length ? (_jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, image: image?.src && _jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description && _jsx(Description, { className: "mt-4 max-w-[600px]", description: description }), _jsxs("div", { className: "flex mt-5 mb-1", children: [benefits?.length ? (_jsx("div", { className: "mr-8", children: benefits.map(renderBenefitLabel) })) : null, benefits?.length ? (_jsx("div", { className: "pt-1", children: benefits.map((_, i) => renderBenefitDescription(_, i, version)) })) : null] })] }) }));
|
|
17
16
|
});
|
|
18
17
|
function renderBenefitLabel(benefit, i) {
|
|
19
18
|
return (_jsx("div", { className: `text-xl font-medium ${i ? 'mt-2.5' : ''}`, children: benefit.label }, String(i)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,E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C,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,YACvE,OAAO,CAAC,KAAK,IADN,MAAM,CAAC,CAAC,CAAC,CAEb,CACP,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAgB,EAAE,CAAS,EAAE,OAAO,GAAG,SAAS;IAChF,MAAM,aAAa,GAAiC;QAClD,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,OAAO,CACL,cAAqB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,YACnF,OAAO,CAAC,WAAW,IADZ,MAAM,CAAC,CAAC,CAAC,CAEb,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
/**
|
|
8
8
|
* @title Продуктовая плитка
|
|
9
9
|
*/
|
|
10
|
-
export declare type ProductTileContent = HeadingContent & DescriptionContent & ButtonContent & ImageContent & {
|
|
10
|
+
export declare type ProductTileContent = HeadingContent & HeadingTypeContent & DescriptionContent & ButtonContent & ImageContent & {
|
|
11
11
|
version?: BlockVersion;
|
|
12
12
|
/**
|
|
13
13
|
* @title Преимущества
|
|
@@ -6,7 +6,6 @@ import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
7
7
|
import { List } from '../../ui-kit/List/List.js';
|
|
8
8
|
import { BaseTile } from '../BaseTile/BaseTile.js';
|
|
9
|
-
import { getTileHeadingType } from '../BaseTile/getTileHeadingType.js';
|
|
10
9
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight.js';
|
|
11
10
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding.js';
|
|
12
11
|
const tileStyleMap = {
|
|
@@ -14,8 +13,8 @@ const tileStyleMap = {
|
|
|
14
13
|
secondary: 'bg-primary-main text-white',
|
|
15
14
|
};
|
|
16
15
|
export const Tile = JSX((props) => {
|
|
17
|
-
const { context, title, description, items, children, buttons, image, className = '', version = 'primary', role, anchor = null, } = props;
|
|
18
|
-
return (_jsx("section", { className: `overflow-hidden font-sans p-9 pr-3 box-border ${className} ${tileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, role: role, id: anchor, children: _jsxs(BaseTile, { context: context, title: title && (_jsx(Heading, { headingType:
|
|
16
|
+
const { context, title, headingType = 'h3', description, items, children, buttons, image, className = '', version = 'primary', role, anchor = null, } = props;
|
|
17
|
+
return (_jsx("section", { className: `overflow-hidden font-sans p-9 pr-3 box-border ${className} ${tileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, role: role, id: anchor, children: _jsxs(BaseTile, { context: context, title: title && (_jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
|
|
19
18
|
${version === 'primary' ? 'text-primary-text' : ''}` })), buttons: buttons?.length ? (_jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, image: image?.src && _jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description && (_jsx(Description, { className: "max-w-[600px] text-title-new-sm font-light", description: description })), children, renderList(items, version)] }) }));
|
|
20
19
|
});
|
|
21
20
|
function renderList(items, version) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAOtE,MAAM,YAAY,GAAiC;IACjD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAY,CAAC,KAAK,EAAE,EAAE;IAC3C,MAAM,EACJ,OAAO,EACP,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,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,MAAM,CAAC,CAAC,CAAC,CACrB,KAAC,IAAI,IACH,KAAK,EAAE,KAAK,EACZ,aAAa,EAAC,gCAAgC,EAC9C,OAAO,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,GACtD,CACH,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
/**
|
|
8
8
|
* @title Плитка
|
|
9
9
|
*/
|
|
10
|
-
export declare type TileContent = HeadingContent & DescriptionContent & ListContent & ButtonContent & ImageContent & {
|
|
10
|
+
export declare type TileContent = HeadingContent & HeadingTypeContent & DescriptionContent & ListContent & ButtonContent & ImageContent & {
|
|
11
11
|
version?: BlockVersion;
|
|
12
12
|
};
|
package/mobile/lib/types.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
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
|
+
* @title Цветовая палитра
|
|
6
|
+
* @enumNames ["", "Частным клиентам", "Бизнес клиентам", "Экосистема Своё"]
|
|
7
|
+
*/
|
|
8
|
+
export declare type ColorPalette = '' | 'pc' | 'bc' | 'eo';
|
|
5
9
|
export interface BaseBlockDef {
|
|
6
10
|
type?: string;
|
|
7
11
|
style?: string[];
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
export const ButtonInner = JSX((props) => {
|
|
4
4
|
const { text, aboveText, appendLeft } = props;
|
|
5
|
-
return (_jsxs("div", { className: getButtonStyle(props), children: [appendLeft ? appendLeft : null, isWithText(props) ? (_jsxs("div", { children: [_jsx("div", { className: "text-m-2xs font-light text-left", children: aboveText }), _jsx("div", { className: "text-button
|
|
5
|
+
return (_jsxs("div", { className: getButtonStyle(props), children: [appendLeft ? appendLeft : null, isWithText(props) ? (_jsxs("div", { children: [_jsx("div", { className: "text-m-2xs font-light text-left", children: aboveText }), _jsx("div", { className: "text-button text-left", children: text })] })) : null] }));
|
|
6
6
|
});
|
|
7
7
|
const getButtonStyle = (props) => {
|
|
8
8
|
const { version, aboveText, rounded } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonInner.js","sourceRoot":"","sources":["../../../src/ui-kit/Button/ButtonInner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAmB,CAAC,KAAK,EAAE,EAAE;IACzD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO,CACL,eAAK,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,aAClC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAC9B,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACnB,0BACE,cAAK,SAAS,EAAC,iCAAiC,YAAE,SAAS,GAAO,EAClE,cAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"ButtonInner.js","sourceRoot":"","sources":["../../../src/ui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AU,CAAC,CAAC"}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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' : ''}
|
|
@@ -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>
|
package/package.json
CHANGED
|
@@ -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
|
}
|
|
@@ -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
|
};
|