@redneckz/wildless-cms-uni-blocks 0.13.0 → 0.13.2
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/bundle.umd.js +33 -22
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/model/HeadlineType.d.ts +1 -1
- package/bundle/ui-kit/TabsControl/TabItemInner.d.ts +6 -0
- package/dist/components/Blocks.mobile.js +17 -13
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/MortgageFiltration/MortgageFiltration.js +5 -5
- package/dist/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/dist/components/Tabs/Tabs.js +6 -6
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/model/HeadlineType.d.ts +1 -1
- package/dist/ui-kit/BaseFiltration/checkShouldRenderBlock.js +2 -4
- package/dist/ui-kit/BaseFiltration/checkShouldRenderBlock.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItem.js +15 -29
- package/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItemInner.d.ts +6 -0
- package/dist/ui-kit/TabsControl/TabItemInner.js +33 -0
- package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -0
- package/lib/components/Blocks.mobile.js +17 -13
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/MortgageFiltration/MortgageFiltration.js +5 -5
- package/lib/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +6 -6
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/model/HeadlineType.d.ts +1 -1
- package/lib/ui-kit/BaseFiltration/checkShouldRenderBlock.js +2 -4
- package/lib/ui-kit/BaseFiltration/checkShouldRenderBlock.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItem.js +15 -29
- package/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItemInner.d.ts +6 -0
- package/lib/ui-kit/TabsControl/TabItemInner.js +31 -0
- package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +98 -79
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/model/HeadlineType.d.ts +1 -1
- package/mobile/bundle/ui-kit/TabsControl/TabItemInner.d.ts +6 -0
- package/mobile/dist/components/Blocks.js +17 -13
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/MortgageFiltration/MortgageFiltration.js +5 -5
- package/mobile/dist/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +6 -6
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/model/HeadlineType.d.ts +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/checkShouldRenderBlock.js +2 -4
- package/mobile/dist/ui-kit/BaseFiltration/checkShouldRenderBlock.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItem.js +15 -29
- package/mobile/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.d.ts +6 -0
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +33 -0
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -0
- package/mobile/lib/components/Blocks.js +17 -13
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/MortgageFiltration/MortgageFiltration.js +5 -5
- package/mobile/lib/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +6 -6
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/model/HeadlineType.d.ts +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/checkShouldRenderBlock.js +2 -4
- package/mobile/lib/ui-kit/BaseFiltration/checkShouldRenderBlock.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItem.js +15 -29
- package/mobile/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.d.ts +6 -0
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +31 -0
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -0
- package/mobile/src/components/Blocks.ts +17 -13
- package/mobile/src/components/MortgageFiltration/MortgageFiltration.tsx +6 -6
- package/mobile/src/components/Tabs/Tabs.tsx +12 -9
- package/mobile/src/model/HeadlineType.ts +1 -1
- package/mobile/src/ui-kit/BaseFiltration/checkShouldRenderBlock.ts +2 -4
- package/mobile/src/ui-kit/TabsControl/TabItem.tsx +18 -57
- package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +69 -0
- package/package.json +1 -1
- package/src/components/Blocks.mobile.ts +17 -13
- package/src/components/MortgageFiltration/MortgageFiltration.tsx +6 -6
- package/src/components/Tabs/Tabs.tsx +12 -9
- package/src/model/HeadlineType.ts +1 -1
- package/src/ui-kit/BaseFiltration/checkShouldRenderBlock.ts +2 -4
- package/src/ui-kit/TabsControl/TabItem.tsx +18 -57
- package/src/ui-kit/TabsControl/TabItemInner.tsx +69 -0
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
4
|
import { useLink } from '../../hooks/useLink.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
default: 'px-xs',
|
|
8
|
-
underlined: 'px-m',
|
|
9
|
-
rounded: 'px-lg rounded-md',
|
|
10
|
-
};
|
|
11
|
-
const tabTextStyle = 'text-secondary-text hover:text-primary-main';
|
|
12
|
-
const activeTabTextStyleMap = {
|
|
13
|
-
default: 'text-black sm:text-white',
|
|
14
|
-
underlined: 'text-primary-main border-b-2',
|
|
15
|
-
rounded: 'text-white',
|
|
16
|
-
};
|
|
17
|
-
const tabBgStyleMap = {
|
|
18
|
-
default: 'bg-white',
|
|
19
|
-
underlined: 'bg-white',
|
|
20
|
-
rounded: 'bg-transparent',
|
|
21
|
-
};
|
|
22
|
-
const activeTabBgStyleMap = {
|
|
23
|
-
default: 'sm:bg-primary-main',
|
|
24
|
-
underlined: 'bg-white',
|
|
25
|
-
rounded: 'bg-primary-main',
|
|
26
|
-
};
|
|
27
|
-
export const TabItem = JSX(({ item = {}, isActive, onClick, type = 'default' }) => {
|
|
5
|
+
import { TabItemInner } from './TabItemInner.js';
|
|
6
|
+
export const TabItem = JSX((props) => props?.item?.href ? _jsx(LinkTabItem, { ...props }) : _jsx(ButtonTabItem, { ...props }));
|
|
7
|
+
const LinkTabItem = JSX((props) => {
|
|
28
8
|
const link = useLink();
|
|
29
|
-
const handleClick = () => {
|
|
9
|
+
const handleClick = useCallback(() => {
|
|
10
|
+
props.onClick && props.onClick(props.item || {});
|
|
11
|
+
}, [props.onClick, props.item]);
|
|
12
|
+
const { onClick, ...item } = link({ ...props.item, onClick: handleClick });
|
|
13
|
+
return _jsx(TabItemInner, { ...props, tag: "a", item: item, onClick: onClick });
|
|
14
|
+
});
|
|
15
|
+
// TODO: Update handlerDecorator (support buttons?)
|
|
16
|
+
const ButtonTabItem = JSX(({ item = {}, onClick, ...rest }) => {
|
|
17
|
+
const handleClick = useCallback(() => {
|
|
30
18
|
onClick && onClick(item);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const Tag = item.href ? 'a' : 'div';
|
|
34
|
-
return (_jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tab", "aria-selected": isActive, ...linkProps, children: _jsx("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: _jsx(Text, { size: "text-m", children: text }) }) }));
|
|
19
|
+
}, [onClick, item]);
|
|
20
|
+
return _jsx(TabItemInner, { item: item, onClick: handleClick, ...rest });
|
|
35
21
|
});
|
|
36
22
|
//# sourceMappingURL=TabItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TabItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAc9C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAe,CAAC,KAAK,EAAE,EAAE,CACjD,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,OAAK,KAAK,GAAI,CAAC,CAAC,CAAC,KAAC,aAAa,OAAK,KAAK,GAAI,CAC9E,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,CAAe,CAAC,KAAK,EAAE,EAAE;IAC9C,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAE3E,OAAO,KAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AAC3E,CAAC,CAAC,CAAC;AAEH,mDAAmD;AACnD,MAAM,aAAa,GAAG,GAAG,CAAe,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC1E,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,KAAM,IAAI,GAAI,CAAC;AACtE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { style } from '../../utils/style.js';
|
|
4
|
+
import { Text } from '../Text/Text.js';
|
|
5
|
+
const tabPaddingStyleMap = {
|
|
6
|
+
default: 'px-xs',
|
|
7
|
+
underlined: 'px-m',
|
|
8
|
+
rounded: 'px-lg rounded-md',
|
|
9
|
+
};
|
|
10
|
+
const tabTextStyle = 'text-secondary-text hover:text-primary-main';
|
|
11
|
+
const activeTabTextStyleMap = {
|
|
12
|
+
default: 'text-black sm:text-white',
|
|
13
|
+
underlined: 'text-primary-main border-b-2',
|
|
14
|
+
rounded: 'text-white',
|
|
15
|
+
};
|
|
16
|
+
const tabBgStyleMap = {
|
|
17
|
+
default: 'bg-white',
|
|
18
|
+
underlined: 'bg-white',
|
|
19
|
+
rounded: 'bg-transparent',
|
|
20
|
+
};
|
|
21
|
+
const activeTabBgStyleMap = {
|
|
22
|
+
default: 'sm:bg-primary-main',
|
|
23
|
+
underlined: 'bg-white',
|
|
24
|
+
rounded: 'bg-primary-main',
|
|
25
|
+
};
|
|
26
|
+
export const TabItemInner = JSX(({ tag = 'div', item = {}, isActive, type = 'default', onClick }) => {
|
|
27
|
+
const Tag = tag;
|
|
28
|
+
const { text, ...link } = item;
|
|
29
|
+
return (_jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tab", "aria-selected": isActive, onClick: onClick, ...link, children: _jsx("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: _jsx(Text, { size: "text-m", children: text }) }) }));
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=TabItemInner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabItemInner.js","sourceRoot":"","sources":["../../../src/ui-kit/TabsControl/TabItemInner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,MAAM,kBAAkB,GAA4B;IAClD,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,kBAAkB;CAC5B,CAAC;AAEF,MAAM,YAAY,GAAG,6CAA6C,CAAC;AAEnE,MAAM,qBAAqB,GAA4B;IACrD,OAAO,EAAE,0BAA0B;IACnC,UAAU,EAAE,8BAA8B;IAC1C,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,aAAa,GAA4B;IAC7C,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,gBAAgB;CAC1B,CAAC;AAEF,MAAM,mBAAmB,GAA4B;IACnD,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AAMF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAClE,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAE/B,OAAO,CACL,KAAC,GAAG,IACF,SAAS,EAAE,KAAK,CACd,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,kBAAkB,CAAC,IAAI,CAAC,EACxB,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAC3D,EACD,IAAI,EAAC,KAAK,mBACK,QAAQ,EACvB,OAAO,EAAE,OAAO,KACZ,IAAI,YAER,cACE,SAAS,EAAE,KAAK,CACd,QAAQ,EACR,kCAAkC,EAClC,+BAA+B,EAC/B,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CACtD,YAED,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,YAAE,IAAI,GAAQ,GAC7B,GACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -2417,6 +2417,62 @@
|
|
|
2417
2417
|
|
|
2418
2418
|
const CarouselBankHistoryCard = JSX(({ title, description, className }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", children: jsx(Headline, { headlineVersion: "XS", title: title, description: description, align: "text-left", className: "text-primary-text", isPadding: false }) })));
|
|
2419
2419
|
|
|
2420
|
+
const titleSize = 'XS';
|
|
2421
|
+
|
|
2422
|
+
const layerBaseStyle = 'z-10 border border-solid w-full h-full';
|
|
2423
|
+
const layerStyle = style(layerBaseStyle, 'absolute hidden sm:block border-transparent');
|
|
2424
|
+
const CarouselCard = JSX(({ className, title, description, button, ...rest }) => (jsx(BlockWrapper, { className: style('sm:pl-12 sm:pb-9', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { className: "relative", children: [jsx("div", { className: style(layerStyle, 'top-9 right-12 bg-green-dark') }), jsx("div", { className: style(layerStyle, 'top-6 right-8 bg-green') }), jsx("div", { className: style(layerStyle, 'top-3 right-4 bg-green-light') }), jsxs("div", { className: style(layerBaseStyle, 'relative p-10 bg-white border-green-light'), children: [jsx(Headline, { title: title, description: description, headlineVersion: titleSize, align: "text-left", isPadding: false }), renderButtonsSection([button], {
|
|
2425
|
+
className: 'mt-6xl sm:justify-center',
|
|
2426
|
+
isVertical: true,
|
|
2427
|
+
})] })] }) })));
|
|
2428
|
+
|
|
2429
|
+
const cardStyleMap = {
|
|
2430
|
+
black: 'bg-black',
|
|
2431
|
+
white: 'bg-white',
|
|
2432
|
+
};
|
|
2433
|
+
const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-left', className), defaultPadding: "p-2xl", ...rest, children: [image?.src ? jsx(Img, { className: "flex justify-center mb-xl", image: image }) : null, jsx(Headline, { title: title, description: description, headlineVersion: "XS", isPadding: false, align: "text-left", className: "mb-m" }), colors?.length ? (jsxs("div", { className: "flex text-secondary-text mb-m", children: [jsx("div", { className: "mr-xs", children: jsx(Text, { size: "text-s", align: "text-left", font: "font-light", children: "\u0426\u0432\u0435\u0442\u0430:" }) }), colors.map(renderColorOption)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null, renderButtonsSection([button], { buttonClassName: 'w-full mt-lg' })] })));
|
|
2434
|
+
const renderColorOption = (color, i) => (jsx("div", { role: "figure", className: `w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${cardStyleMap[color]}` }, String(i)));
|
|
2435
|
+
|
|
2436
|
+
const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
|
|
2437
|
+
const link = useLink({ isRemote });
|
|
2438
|
+
const linkProps = link({ href, target });
|
|
2439
|
+
const Tag = href ? 'a' : 'div';
|
|
2440
|
+
return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), children: children }));
|
|
2441
|
+
});
|
|
2442
|
+
|
|
2443
|
+
const DOT_SIZE_MAP = {
|
|
2444
|
+
L: 'w-1.5 h-1.5 mr-m',
|
|
2445
|
+
M: 'w-1.5 h-1.5 mr-s',
|
|
2446
|
+
S: 'w-1 h-1 mr-xs',
|
|
2447
|
+
};
|
|
2448
|
+
const ListItem = JSX(({ className, isDotted = true, children, size = 'M' }) => (jsxs("div", { className: style('font-sans flex', className), role: "listitem", children: [isDotted ? (jsx("div", { className: "shrink-0", children: jsx("div", { className: style('align-middle inline-block rounded-full bg-primary-text group-data-secondary:bg-white', DOT_SIZE_MAP[size]) }) })) : null, jsx("span", { children: children })] })));
|
|
2449
|
+
|
|
2450
|
+
const TEXT_SIZE_MAP = {
|
|
2451
|
+
S: 'text-l font-light',
|
|
2452
|
+
M: 'text-h6',
|
|
2453
|
+
L: 'text-h5',
|
|
2454
|
+
};
|
|
2455
|
+
const ITEM_INDENT_MAP = {
|
|
2456
|
+
S: 'ml-xs',
|
|
2457
|
+
M: 'ml-s',
|
|
2458
|
+
L: 'ml-m',
|
|
2459
|
+
};
|
|
2460
|
+
const List = JSX(({ className, hasIndent, isDotted, items, listItemSize = 'M' }) => items?.length ? (jsx("section", { className: style('flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text', TEXT_SIZE_MAP[listItemSize], hasIndent ? ITEM_INDENT_MAP[listItemSize] : '', className), role: "list", children: items.map((item, i) => (jsx(ListItem, { isDotted: isDotted, size: listItemSize, children: item }, String(i)))) })) : null);
|
|
2461
|
+
|
|
2462
|
+
const alignTextStyle = 'text-left';
|
|
2463
|
+
|
|
2464
|
+
const CarouselProductCard = JSX(({ additionalDescription, align = alignTextStyle, button = {}, className = '', description, headlineSmallVersion = 'H6', href, icon, isDotted = true, isButtonFullWidth = true, isImageFullWidth = false, isTopPosition = false, items = [], target, title, version = 'primary', ...rest }) => {
|
|
2465
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col justify-between', align, className), defaultPadding: "p-0", version: version, ...rest, children: [jsxs(LinkWrapper, { className: "p-m flex flex-col gap-xs", href: href, target: target, children: [renderCardTitle(headlineSmallVersion, title), renderDescription$2(description), renderItems(items, isDotted, version), renderAdditionalDescription(additionalDescription), renderImage$2(icon, isImageFullWidth, isTopPosition)] }), renderButtonsSection([button], {
|
|
2466
|
+
className: style('p-m pt-0', isButtonFullWidth ? '' : 'self-center'),
|
|
2467
|
+
isVertical: isButtonFullWidth,
|
|
2468
|
+
})] }));
|
|
2469
|
+
});
|
|
2470
|
+
const renderImage$2 = (image, isImageFullWidth, isTopPosition) => (jsxs("div", { className: style('flex gap-lg', isTopPosition ? 'order-first' : 'order-last', !isImageFullWidth ? 'justify-center' : ''), children: [image?.src ? jsx(Img, { className: "shrink-0", image: image }) : null, image?.icon ? (jsx(Img, { className: style('shrink-0', !isImageFullWidth ? 'w-8 h-8 min-w-8' : ''), image: image })) : null] }));
|
|
2471
|
+
const renderCardTitle = (headlineSmallVersion, title) => title ? jsx(Text, { size: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) : null;
|
|
2472
|
+
const renderDescription$2 = (description) => description ? jsx(Paragraph, { size: "text-l", children: description }) : null;
|
|
2473
|
+
const renderAdditionalDescription = (additionalDescription) => additionalDescription ? (jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text group-data-secondary:text-white/80", children: additionalDescription })) : null;
|
|
2474
|
+
const renderItems = (items, isDotted, version = 'primary') => items?.length ? (jsx(List, { className: style('text-s', version === 'primary' ? '!text-secondary-text' : ''), items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted, listItemSize: "S" })) : null;
|
|
2475
|
+
|
|
2420
2476
|
const imageAlignmentMap = {
|
|
2421
2477
|
start: 'self-start',
|
|
2422
2478
|
center: 'self-center',
|
|
@@ -2464,25 +2520,6 @@
|
|
|
2464
2520
|
|
|
2465
2521
|
const BenefitsList = JSX(({ isTabularBenefits, ...rest }) => isTabularBenefits ? jsx(TabularBenefitsList, { ...rest }) : jsx(DefaultBenefitsList, { ...rest }));
|
|
2466
2522
|
|
|
2467
|
-
const DOT_SIZE_MAP = {
|
|
2468
|
-
L: 'w-1.5 h-1.5 mr-m',
|
|
2469
|
-
M: 'w-1.5 h-1.5 mr-s',
|
|
2470
|
-
S: 'w-1 h-1 mr-xs',
|
|
2471
|
-
};
|
|
2472
|
-
const ListItem = JSX(({ className, isDotted = true, children, size = 'M' }) => (jsxs("div", { className: style('font-sans flex', className), role: "listitem", children: [isDotted ? (jsx("div", { className: "shrink-0", children: jsx("div", { className: style('align-middle inline-block rounded-full bg-primary-text group-data-secondary:bg-white', DOT_SIZE_MAP[size]) }) })) : null, jsx("span", { children: children })] })));
|
|
2473
|
-
|
|
2474
|
-
const TEXT_SIZE_MAP = {
|
|
2475
|
-
S: 'text-l font-light',
|
|
2476
|
-
M: 'text-h6',
|
|
2477
|
-
L: 'text-h5',
|
|
2478
|
-
};
|
|
2479
|
-
const ITEM_INDENT_MAP = {
|
|
2480
|
-
S: 'ml-xs',
|
|
2481
|
-
M: 'ml-s',
|
|
2482
|
-
L: 'ml-m',
|
|
2483
|
-
};
|
|
2484
|
-
const List = JSX(({ className, hasIndent, isDotted, items, listItemSize = 'M' }) => items?.length ? (jsx("section", { className: style('flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text', TEXT_SIZE_MAP[listItemSize], hasIndent ? ITEM_INDENT_MAP[listItemSize] : '', className), role: "list", children: items.map((item, i) => (jsx(ListItem, { isDotted: isDotted, size: listItemSize, children: item }, String(i)))) })) : null);
|
|
2485
|
-
|
|
2486
2523
|
const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
|
|
2487
2524
|
const renderTag = (tag, key) => (jsx("div", { className: "py-2 px-2.5 border-solid border rounded-md border-gray", role: "listitem", children: jsx(Text, { size: "text-m", font: "font-light", children: tag }) }, String(key)));
|
|
2488
2525
|
|
|
@@ -2493,13 +2530,6 @@
|
|
|
2493
2530
|
});
|
|
2494
2531
|
const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
|
|
2495
2532
|
|
|
2496
|
-
const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
|
|
2497
|
-
const link = useLink({ isRemote });
|
|
2498
|
-
const linkProps = link({ href, target });
|
|
2499
|
-
const Tag = href ? 'a' : 'div';
|
|
2500
|
-
return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), children: children }));
|
|
2501
|
-
});
|
|
2502
|
-
|
|
2503
2533
|
const CarouselProgramsCard = JSX(({ className, title, icon, list, href, target, ...rest }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-3xl", ...rest, children: jsx(LinkWrapper, { className: "flex items-center h-full", href: href, target: target, children: jsx(BaseProductTile, { title: title, headlineVersion: "XS", image: icon, imageOptions: { directionRight: false, imageAlign: 'center' }, benefits: list?.map((_) => ({
|
|
2504
2534
|
type: 'default',
|
|
2505
2535
|
label: _.title,
|
|
@@ -2583,36 +2613,6 @@
|
|
|
2583
2613
|
const renderFoldButton$1 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
2584
2614
|
const renderHitIcon = () => (jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22" }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
|
|
2585
2615
|
|
|
2586
|
-
const titleSize = 'XS';
|
|
2587
|
-
|
|
2588
|
-
const layerBaseStyle = 'z-10 border border-solid w-full h-full';
|
|
2589
|
-
const layerStyle = style(layerBaseStyle, 'absolute hidden sm:block border-transparent');
|
|
2590
|
-
const CarouselCard = JSX(({ className, title, description, button, ...rest }) => (jsx(BlockWrapper, { className: style('sm:pl-12 sm:pb-9', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { className: "relative", children: [jsx("div", { className: style(layerStyle, 'top-9 right-12 bg-green-dark') }), jsx("div", { className: style(layerStyle, 'top-6 right-8 bg-green') }), jsx("div", { className: style(layerStyle, 'top-3 right-4 bg-green-light') }), jsxs("div", { className: style(layerBaseStyle, 'relative p-10 bg-white border-green-light'), children: [jsx(Headline, { title: title, description: description, headlineVersion: titleSize, align: "text-left", isPadding: false }), renderButtonsSection([button], {
|
|
2591
|
-
className: 'mt-6xl sm:justify-center',
|
|
2592
|
-
isVertical: true,
|
|
2593
|
-
})] })] }) })));
|
|
2594
|
-
|
|
2595
|
-
const cardStyleMap = {
|
|
2596
|
-
black: 'bg-black',
|
|
2597
|
-
white: 'bg-white',
|
|
2598
|
-
};
|
|
2599
|
-
const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-left', className), defaultPadding: "p-2xl", ...rest, children: [image?.src ? jsx(Img, { className: "flex justify-center mb-xl", image: image }) : null, jsx(Headline, { title: title, description: description, headlineVersion: "XS", isPadding: false, align: "text-left", className: "mb-m" }), colors?.length ? (jsxs("div", { className: "flex text-secondary-text mb-m", children: [jsx("div", { className: "mr-xs", children: jsx(Text, { size: "text-s", align: "text-left", font: "font-light", children: "\u0426\u0432\u0435\u0442\u0430:" }) }), colors.map(renderColorOption)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null, renderButtonsSection([button], { buttonClassName: 'w-full mt-lg' })] })));
|
|
2600
|
-
const renderColorOption = (color, i) => (jsx("div", { role: "figure", className: `w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${cardStyleMap[color]}` }, String(i)));
|
|
2601
|
-
|
|
2602
|
-
const alignTextStyle = 'text-left';
|
|
2603
|
-
|
|
2604
|
-
const CarouselProductCard = JSX(({ additionalDescription, align = alignTextStyle, button = {}, className = '', description, headlineSmallVersion = 'H6', href, icon, isDotted = true, isButtonFullWidth = true, isImageFullWidth = false, isTopPosition = false, items = [], target, title, version = 'primary', ...rest }) => {
|
|
2605
|
-
return (jsxs(BlockWrapper, { className: style('flex flex-col justify-between', align, className), defaultPadding: "p-0", version: version, ...rest, children: [jsxs(LinkWrapper, { className: "p-m flex flex-col gap-xs", href: href, target: target, children: [renderCardTitle(headlineSmallVersion, title), renderDescription$2(description), renderItems(items, isDotted, version), renderAdditionalDescription(additionalDescription), renderImage$2(icon, isImageFullWidth, isTopPosition)] }), renderButtonsSection([button], {
|
|
2606
|
-
className: style('p-m pt-0', isButtonFullWidth ? '' : 'self-center'),
|
|
2607
|
-
isVertical: isButtonFullWidth,
|
|
2608
|
-
})] }));
|
|
2609
|
-
});
|
|
2610
|
-
const renderImage$2 = (image, isImageFullWidth, isTopPosition) => (jsxs("div", { className: style('flex gap-lg', isTopPosition ? 'order-first' : 'order-last', !isImageFullWidth ? 'justify-center' : ''), children: [image?.src ? jsx(Img, { className: "shrink-0", image: image }) : null, image?.icon ? (jsx(Img, { className: style('shrink-0', !isImageFullWidth ? 'w-8 h-8 min-w-8' : ''), image: image })) : null] }));
|
|
2611
|
-
const renderCardTitle = (headlineSmallVersion, title) => title ? jsx(Text, { size: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) : null;
|
|
2612
|
-
const renderDescription$2 = (description) => description ? jsx(Paragraph, { size: "text-l", children: description }) : null;
|
|
2613
|
-
const renderAdditionalDescription = (additionalDescription) => additionalDescription ? (jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text group-data-secondary:text-white/80", children: additionalDescription })) : null;
|
|
2614
|
-
const renderItems = (items, isDotted, version = 'primary') => items?.length ? (jsx(List, { className: style('text-s', version === 'primary' ? '!text-secondary-text' : ''), items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted, listItemSize: "S" })) : null;
|
|
2615
|
-
|
|
2616
2616
|
const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
2617
2617
|
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
2618
2618
|
|
|
@@ -3105,6 +3105,8 @@
|
|
|
3105
3105
|
.map((s) => s.productBlock)
|
|
3106
3106
|
.map((_, i) => (jsx("div", { className: "box-border h-full", role: "listitem", children: jsx(BaseProductTile, { className: "px-5 h-full", headlineVersion: "L", ..._, ...rest }) }, String(i)))) }) })));
|
|
3107
3107
|
|
|
3108
|
+
const ProductTile = JSX(({ className, padding, headlineVersion = 'S', isTabularBenefits = true, additionalDescription, imageOptions, ...rest }) => (jsx(BlockWrapper, { className: className, padding: "p-0", ...rest, children: jsx(BaseProductTile, { className: "h-full", defaultPadding: "p-xl", padding: padding, headlineVersion: headlineVersion, isTabularBenefits: isTabularBenefits, imageOptions: { isBackground: true, ...imageOptions }, ...rest, children: additionalDescription ? (jsx(Paragraph, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: additionalDescription })) : null }) })));
|
|
3109
|
+
|
|
3108
3110
|
const RichTextBlock = JSX((props) => {
|
|
3109
3111
|
const { __html, richVersion, ...rest } = props;
|
|
3110
3112
|
return (jsx(BlockWrapper, { defaultPadding: "p-0", ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) }));
|
|
@@ -3564,14 +3566,27 @@
|
|
|
3564
3566
|
underlined: 'bg-white',
|
|
3565
3567
|
rounded: 'bg-primary-main',
|
|
3566
3568
|
};
|
|
3567
|
-
const
|
|
3569
|
+
const TabItemInner = JSX(({ tag = 'div', item = {}, isActive, type = 'default', onClick }) => {
|
|
3570
|
+
const Tag = tag;
|
|
3571
|
+
const { text, ...link } = item;
|
|
3572
|
+
return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tab", "aria-selected": isActive, onClick: onClick, ...link, children: jsx("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: jsx(Text, { size: "text-m", children: text }) }) }));
|
|
3573
|
+
});
|
|
3574
|
+
|
|
3575
|
+
const TabItem = JSX((props) => props?.item?.href ? jsx(LinkTabItem, { ...props }) : jsx(ButtonTabItem, { ...props }));
|
|
3576
|
+
const LinkTabItem = JSX((props) => {
|
|
3568
3577
|
const link = useLink();
|
|
3569
|
-
const handleClick = () => {
|
|
3578
|
+
const handleClick = useCallback(() => {
|
|
3579
|
+
props.onClick && props.onClick(props.item || {});
|
|
3580
|
+
}, [props.onClick, props.item]);
|
|
3581
|
+
const { onClick, ...item } = link({ ...props.item, onClick: handleClick });
|
|
3582
|
+
return jsx(TabItemInner, { ...props, tag: "a", item: item, onClick: onClick });
|
|
3583
|
+
});
|
|
3584
|
+
// TODO: Update handlerDecorator (support buttons?)
|
|
3585
|
+
const ButtonTabItem = JSX(({ item = {}, onClick, ...rest }) => {
|
|
3586
|
+
const handleClick = useCallback(() => {
|
|
3570
3587
|
onClick && onClick(item);
|
|
3571
|
-
};
|
|
3572
|
-
|
|
3573
|
-
const Tag = item.href ? 'a' : 'div';
|
|
3574
|
-
return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tab", "aria-selected": isActive, ...linkProps, children: jsx("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: jsx(Text, { size: "text-m", children: text }) }) }));
|
|
3588
|
+
}, [onClick, item]);
|
|
3589
|
+
return jsx(TabItemInner, { item: item, onClick: handleClick, ...rest });
|
|
3575
3590
|
});
|
|
3576
3591
|
|
|
3577
3592
|
const renderTab = (activeTab, onClick, type) => (tab, i) => (jsx(TabItem, { isActive: tab === activeTab, onClick: onClick, type: type, item: tab }, String(i)));
|
|
@@ -3600,7 +3615,7 @@
|
|
|
3600
3615
|
};
|
|
3601
3616
|
|
|
3602
3617
|
const Tabs = JSX(({ className = '', isSticky, tabs = [], tabsMode, ...rest }) => {
|
|
3603
|
-
const
|
|
3618
|
+
const tabsControlItems = useMemo(() => tabs.map(normalizeTab), [tabs]);
|
|
3604
3619
|
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
3605
3620
|
useEffect(() => {
|
|
3606
3621
|
if (!tabs || !tabs[0]) {
|
|
@@ -3615,15 +3630,15 @@
|
|
|
3615
3630
|
}
|
|
3616
3631
|
}, [tabs, activeTabIndex]);
|
|
3617
3632
|
const handleChange = useCallback((_) => {
|
|
3618
|
-
const index =
|
|
3633
|
+
const index = tabsControlItems.indexOf(_);
|
|
3619
3634
|
setActiveTabIndex(index);
|
|
3620
3635
|
fireTabEvent(tabs[index]);
|
|
3621
|
-
}, []);
|
|
3636
|
+
}, [tabs, tabsControlItems]);
|
|
3622
3637
|
return (jsx(BlockWrapper, { className: style(isSticky ? 'sticky top-1 z-20' : '', className), defaultPadding: "p-0", ...rest, children: renderTabs({
|
|
3623
|
-
items:
|
|
3624
|
-
|
|
3625
|
-
value: normalizedTabs[activeTabIndex],
|
|
3638
|
+
items: tabsControlItems,
|
|
3639
|
+
value: tabsControlItems[activeTabIndex],
|
|
3626
3640
|
tabsMode,
|
|
3641
|
+
onChange: handleChange,
|
|
3627
3642
|
}) }));
|
|
3628
3643
|
});
|
|
3629
3644
|
const fireTabEvent = (tab) => {
|
|
@@ -3687,19 +3702,25 @@
|
|
|
3687
3702
|
return (jsx("ul", { className: style('text-secondary-text group-data-secondary:text-white/80', listStyle), children: items.map((_, i) => (jsx("li", { children: jsx(Text, { size: "text-s", font: "font-light", children: _ }) }, `listItem-${i}`))) }));
|
|
3688
3703
|
};
|
|
3689
3704
|
|
|
3705
|
+
const Tile = JSX(({ className, padding, headlineVersion = 'S', listItemSize = 'M', ...rest }) => (jsx(BlockWrapper, { className: className, padding: "p-0", ...rest, children: jsx(BaseProductTile, { className: "h-full", defaultPadding: "p-xl", padding: padding, headlineVersion: headlineVersion, listItemSize: listItemSize, ...rest }) })));
|
|
3706
|
+
|
|
3690
3707
|
const Blocks = {
|
|
3691
3708
|
ApplicationForm,
|
|
3692
|
-
|
|
3709
|
+
BenefitsBlock,
|
|
3693
3710
|
BonusBenefitsBlock,
|
|
3711
|
+
ButtonsBlock,
|
|
3694
3712
|
Calculator,
|
|
3695
3713
|
CardTransfer,
|
|
3696
3714
|
Carousel,
|
|
3715
|
+
CarouselBankHistoryCard,
|
|
3697
3716
|
CarouselCard,
|
|
3698
3717
|
CarouselCatalogCard,
|
|
3699
3718
|
CarouselProductCard,
|
|
3700
|
-
|
|
3719
|
+
CarouselProgramsCard,
|
|
3720
|
+
CarouselRecommendationCard,
|
|
3701
3721
|
CarouselTariffsCard,
|
|
3702
3722
|
ComparisonTable,
|
|
3723
|
+
ExchangeRateTile,
|
|
3703
3724
|
Footer,
|
|
3704
3725
|
Header,
|
|
3705
3726
|
Headline,
|
|
@@ -3710,19 +3731,17 @@
|
|
|
3710
3731
|
PictureText,
|
|
3711
3732
|
Placeholder,
|
|
3712
3733
|
ProductBlock,
|
|
3734
|
+
ProductGallery,
|
|
3735
|
+
ProductTile,
|
|
3736
|
+
RichTextBlock,
|
|
3737
|
+
RollupItem,
|
|
3738
|
+
SafeDepositRental,
|
|
3713
3739
|
StepsBlock,
|
|
3714
3740
|
Tabs,
|
|
3715
3741
|
TariffsTable,
|
|
3716
3742
|
TextBlock,
|
|
3717
|
-
|
|
3718
|
-
RollupItem,
|
|
3719
|
-
SafeDepositRental,
|
|
3743
|
+
Tile,
|
|
3720
3744
|
VerticalLayout,
|
|
3721
|
-
CarouselRecommendationCard,
|
|
3722
|
-
ExchangeRateTile,
|
|
3723
|
-
CarouselProgramsCard,
|
|
3724
|
-
ProductGallery,
|
|
3725
|
-
BenefitsBlock,
|
|
3726
3745
|
};
|
|
3727
3746
|
|
|
3728
3747
|
const debounce = (fn, delay = 600) => {
|
|
@@ -3928,7 +3947,7 @@
|
|
|
3928
3947
|
|
|
3929
3948
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
3930
3949
|
|
|
3931
|
-
const packageVersion = "0.13.
|
|
3950
|
+
const packageVersion = "0.13.2";
|
|
3932
3951
|
|
|
3933
3952
|
exports.Blocks = Blocks;
|
|
3934
3953
|
exports.ContentPage = ContentPage;
|