@redneckz/wildless-cms-uni-blocks 0.3.20 → 0.3.21
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 +51 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/ArrowDownIcon.svg +1 -0
- package/cosmos-static/icons/ArrowUpIcon.svg +1 -0
- package/dist/components/Accordion/AccordionContent.d.ts +2 -72
- package/dist/components/Accordion/AccordionItem.js +2 -2
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/Accordion/AccordionItem.mobile.js +2 -2
- package/dist/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/dist/components/Accordion/AccordionItemInner.js +3 -11
- package/dist/components/Accordion/AccordionItemInner.js.map +1 -1
- package/dist/components/Accordion/AccordionItemInner.mobile.js +4 -10
- package/dist/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
- package/{lib/components/Accordion/utils/isActiveHandler.d.ts → dist/components/Accordion/utils/useActiveHandler.d.ts} +1 -1
- package/{mobile/dist/components/Accordion/utils/isActiveHandler.js → dist/components/Accordion/utils/useActiveHandler.js} +4 -4
- package/dist/components/Accordion/utils/useActiveHandler.js.map +1 -0
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/OtherProducts/OtherProducts.d.ts +5 -0
- package/dist/components/OtherProducts/OtherProducts.js +9 -0
- package/dist/components/OtherProducts/OtherProducts.js.map +1 -0
- package/dist/components/OtherProducts/OtherProductsContent.d.ts +36 -0
- package/dist/components/OtherProducts/OtherProductsContent.js +2 -0
- package/dist/components/OtherProducts/OtherProductsContent.js.map +1 -0
- package/dist/components/OtherProducts/OtherProductsItem.d.ts +5 -0
- package/dist/components/OtherProducts/OtherProductsItem.js +16 -0
- package/dist/components/OtherProducts/OtherProductsItem.js.map +1 -0
- package/dist/components/OtherProducts/OtherProductsItemInner.d.ts +2 -0
- package/dist/components/OtherProducts/OtherProductsItemInner.js +10 -0
- package/dist/components/OtherProducts/OtherProductsItemInner.js.map +1 -0
- package/dist/components/OtherProducts/utils/useActiveHandler.d.ts +9 -0
- package/dist/components/OtherProducts/utils/useActiveHandler.js +21 -0
- package/dist/components/OtherProducts/utils/useActiveHandler.js.map +1 -0
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -0
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/BlocksList/BlocksListProps.d.ts +71 -0
- package/dist/ui-kit/BlocksList/BlocksListProps.js +2 -0
- package/dist/ui-kit/BlocksList/BlocksListProps.js.map +1 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.d.ts +12 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.js +25 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -0
- package/dist/ui-kit/BlocksList/renderBlocksList.d.ts +11 -0
- package/dist/ui-kit/BlocksList/renderBlocksList.js +17 -0
- package/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.fixture.d.ts +0 -1
- package/lib/components/Accordion/AccordionContent.d.ts +2 -72
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/Accordion/AccordionItem.mobile.js +2 -2
- package/lib/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/lib/components/Accordion/AccordionItemInner.js +3 -11
- package/lib/components/Accordion/AccordionItemInner.js.map +1 -1
- package/lib/components/Accordion/AccordionItemInner.mobile.js +4 -10
- package/lib/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
- package/{mobile/dist/components/Accordion/utils/isActiveHandler.d.ts → lib/components/Accordion/utils/useActiveHandler.d.ts} +1 -1
- package/{mobile/lib/components/Accordion/utils/isActiveHandler.js → lib/components/Accordion/utils/useActiveHandler.js} +2 -2
- package/lib/components/Accordion/utils/useActiveHandler.js.map +1 -0
- package/lib/components/BaseTile/getTileHeadingType.d.ts +1 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/OtherProducts/OtherProducts.d.ts +5 -0
- package/lib/components/OtherProducts/OtherProducts.fixture.d.ts +5 -0
- package/lib/components/OtherProducts/OtherProducts.js +7 -0
- package/lib/components/OtherProducts/OtherProducts.js.map +1 -0
- package/lib/components/OtherProducts/OtherProductsContent.d.ts +36 -0
- package/lib/components/OtherProducts/OtherProductsContent.js +2 -0
- package/lib/components/OtherProducts/OtherProductsContent.js.map +1 -0
- package/lib/components/OtherProducts/OtherProductsItem.d.ts +5 -0
- package/lib/components/OtherProducts/OtherProductsItem.js +14 -0
- package/lib/components/OtherProducts/OtherProductsItem.js.map +1 -0
- package/lib/components/OtherProducts/OtherProductsItemInner.d.ts +2 -0
- package/lib/components/OtherProducts/OtherProductsItemInner.js +8 -0
- package/lib/components/OtherProducts/OtherProductsItemInner.js.map +1 -0
- package/lib/components/OtherProducts/utils/useActiveHandler.d.ts +9 -0
- package/lib/components/OtherProducts/utils/useActiveHandler.js +18 -0
- package/lib/components/OtherProducts/utils/useActiveHandler.js.map +1 -0
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -0
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/BlocksList/BlocksListProps.d.ts +71 -0
- package/lib/ui-kit/BlocksList/BlocksListProps.js +2 -0
- package/lib/ui-kit/BlocksList/BlocksListProps.js.map +1 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.d.ts +12 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.js +23 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -0
- package/lib/ui-kit/BlocksList/renderBlocksList.d.ts +11 -0
- package/lib/ui-kit/BlocksList/renderBlocksList.js +13 -0
- package/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +16 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Accordion/AccordionContent.d.ts +2 -72
- package/mobile/dist/components/Accordion/AccordionItem.js +2 -2
- package/mobile/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/dist/components/Accordion/AccordionItemInner.js +4 -10
- package/mobile/dist/components/Accordion/AccordionItemInner.js.map +1 -1
- package/mobile/{lib/components/Accordion/utils/isActiveHandler.d.ts → dist/components/Accordion/utils/useActiveHandler.d.ts} +1 -1
- package/{dist/components/Accordion/utils/isActiveHandler.js → mobile/dist/components/Accordion/utils/useActiveHandler.js} +4 -4
- package/mobile/dist/components/Accordion/utils/useActiveHandler.js.map +1 -0
- package/mobile/dist/components/OtherProducts/OtherProducts.d.ts +5 -0
- package/mobile/dist/components/OtherProducts/OtherProducts.js +9 -0
- package/mobile/dist/components/OtherProducts/OtherProducts.js.map +1 -0
- package/mobile/dist/components/OtherProducts/OtherProductsContent.d.ts +36 -0
- package/mobile/dist/components/OtherProducts/OtherProductsContent.js +2 -0
- package/mobile/dist/components/OtherProducts/OtherProductsContent.js.map +1 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItem.d.ts +5 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItem.js +16 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItem.js.map +1 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItemInner.d.ts +2 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItemInner.js +10 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItemInner.js.map +1 -0
- package/mobile/dist/components/OtherProducts/utils/useActiveHandler.d.ts +9 -0
- package/mobile/dist/components/OtherProducts/utils/useActiveHandler.js +21 -0
- package/mobile/dist/components/OtherProducts/utils/useActiveHandler.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -0
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/BlocksList/BlocksListProps.d.ts +71 -0
- package/mobile/dist/ui-kit/BlocksList/BlocksListProps.js +2 -0
- package/mobile/dist/ui-kit/BlocksList/BlocksListProps.js.map +1 -0
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.d.ts +12 -0
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js +25 -0
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -0
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.d.ts +11 -0
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js +17 -0
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -0
- package/mobile/lib/components/Accordion/AccordionContent.d.ts +2 -72
- package/mobile/lib/components/Accordion/AccordionItem.js +2 -2
- package/mobile/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionItemInner.js +4 -10
- package/mobile/lib/components/Accordion/AccordionItemInner.js.map +1 -1
- package/{dist/components/Accordion/utils/isActiveHandler.d.ts → mobile/lib/components/Accordion/utils/useActiveHandler.d.ts} +1 -1
- package/{lib/components/Accordion/utils/isActiveHandler.js → mobile/lib/components/Accordion/utils/useActiveHandler.js} +2 -2
- package/mobile/lib/components/Accordion/utils/useActiveHandler.js.map +1 -0
- package/mobile/lib/components/OtherProducts/OtherProducts.d.ts +5 -0
- package/mobile/lib/components/OtherProducts/OtherProducts.js +7 -0
- package/mobile/lib/components/OtherProducts/OtherProducts.js.map +1 -0
- package/mobile/lib/components/OtherProducts/OtherProductsContent.d.ts +36 -0
- package/mobile/lib/components/OtherProducts/OtherProductsContent.js +2 -0
- package/mobile/lib/components/OtherProducts/OtherProductsContent.js.map +1 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItem.d.ts +5 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItem.js +14 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItem.js.map +1 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItemInner.d.ts +2 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItemInner.js +8 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItemInner.js.map +1 -0
- package/mobile/lib/components/OtherProducts/utils/useActiveHandler.d.ts +9 -0
- package/mobile/lib/components/OtherProducts/utils/useActiveHandler.js +18 -0
- package/mobile/lib/components/OtherProducts/utils/useActiveHandler.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -0
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/BlocksList/BlocksListProps.d.ts +71 -0
- package/mobile/lib/ui-kit/BlocksList/BlocksListProps.js +2 -0
- package/mobile/lib/ui-kit/BlocksList/BlocksListProps.js.map +1 -0
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.d.ts +12 -0
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js +23 -0
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -0
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.d.ts +11 -0
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js +13 -0
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -0
- package/mobile/src/components/Accordion/Accordion.example.json +6 -6
- package/mobile/src/components/Accordion/AccordionContent.ts +2 -108
- package/mobile/src/components/Accordion/AccordionItem.tsx +2 -2
- package/mobile/src/components/Accordion/AccordionItemInner.tsx +4 -19
- package/mobile/src/components/Accordion/utils/{isActiveHandler.ts → useActiveHandler.ts} +1 -1
- package/mobile/src/components/OtherProducts/OtherProducts.example.json +50 -0
- package/mobile/src/components/OtherProducts/OtherProducts.tsx +20 -0
- package/mobile/src/components/OtherProducts/OtherProductsContent.ts +38 -0
- package/mobile/src/components/OtherProducts/OtherProductsItem.tsx +36 -0
- package/mobile/src/components/OtherProducts/OtherProductsItemInner.tsx +14 -0
- package/mobile/src/components/OtherProducts/utils/useActiveHandler.ts +23 -0
- package/mobile/src/icons/ArrowDownIcon.svg +4 -0
- package/mobile/src/icons/ArrowUpIcon.svg +4 -0
- package/mobile/src/icons/IconName.ts +4 -3
- package/mobile/src/ui-kit/BlocksList/BlocksListProps.ts +106 -0
- package/mobile/src/ui-kit/BlocksList/EmbeddableBlocks.tsx +23 -0
- package/mobile/src/ui-kit/BlocksList/renderBlocksList.tsx +30 -0
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.example.json +6 -6
- package/src/components/Accordion/Accordion.fixture.mobile.tsx +13 -13
- package/src/components/Accordion/Accordion.fixture.tsx +28 -93
- package/src/components/Accordion/AccordionContent.ts +2 -108
- package/src/components/Accordion/AccordionItem.mobile.tsx +2 -2
- package/src/components/Accordion/AccordionItem.tsx +2 -2
- package/src/components/Accordion/AccordionItemInner.mobile.tsx +4 -19
- package/src/components/Accordion/AccordionItemInner.tsx +4 -25
- package/src/components/Accordion/utils/{isActiveHandler.ts → useActiveHandler.ts} +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/OtherProducts/OtherProducts.example.json +50 -0
- package/src/components/OtherProducts/OtherProducts.fixture.tsx +137 -0
- package/src/components/OtherProducts/OtherProducts.tsx +20 -0
- package/src/components/OtherProducts/OtherProductsContent.ts +38 -0
- package/src/components/OtherProducts/OtherProductsItem.tsx +36 -0
- package/src/components/OtherProducts/OtherProductsItemInner.tsx +14 -0
- package/src/components/OtherProducts/utils/useActiveHandler.ts +23 -0
- package/src/icons/ArrowDownIcon.svg +4 -0
- package/src/icons/ArrowUpIcon.svg +4 -0
- package/src/icons/IconName.ts +6 -1
- package/src/ui-kit/BlocksList/BlocksListProps.ts +106 -0
- package/src/ui-kit/BlocksList/EmbeddableBlocks.tsx +23 -0
- package/src/ui-kit/BlocksList/renderBlocksList.tsx +30 -0
- package/dist/components/Accordion/AccordionBlocks.d.ts +0 -12
- package/dist/components/Accordion/AccordionBlocks.js +0 -25
- package/dist/components/Accordion/AccordionBlocks.js.map +0 -1
- package/dist/components/Accordion/utils/isActiveHandler.js.map +0 -1
- package/lib/components/Accordion/AccordionBlocks.d.ts +0 -12
- package/lib/components/Accordion/AccordionBlocks.js +0 -23
- package/lib/components/Accordion/AccordionBlocks.js.map +0 -1
- package/lib/components/Accordion/utils/isActiveHandler.js.map +0 -1
- package/mobile/dist/components/Accordion/AccordionBlocks.d.ts +0 -12
- package/mobile/dist/components/Accordion/AccordionBlocks.js +0 -25
- package/mobile/dist/components/Accordion/AccordionBlocks.js.map +0 -1
- package/mobile/dist/components/Accordion/utils/isActiveHandler.js.map +0 -1
- package/mobile/lib/components/Accordion/AccordionBlocks.d.ts +0 -12
- package/mobile/lib/components/Accordion/AccordionBlocks.js +0 -23
- package/mobile/lib/components/Accordion/AccordionBlocks.js.map +0 -1
- package/mobile/lib/components/Accordion/utils/isActiveHandler.js.map +0 -1
- package/mobile/src/components/Accordion/AccordionBlocks.tsx +0 -23
- package/src/components/Accordion/AccordionBlocks.tsx +0 -23
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useActiveHandler } from './utils/useActiveHandler';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import type { blockItemCommonProps } from './OtherProductsContent';
|
|
5
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
6
|
+
import { OtherProductsItemInner } from './OtherProductsItemInner';
|
|
7
|
+
|
|
8
|
+
export interface BlockItemProps extends blockItemCommonProps, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
export const OtherProductsItem = JSX<BlockItemProps>(({ label, blocks, columns, context }) => {
|
|
11
|
+
const { hasContent, icon, handleToggle, isActive } = useActiveHandler({
|
|
12
|
+
context,
|
|
13
|
+
blocks,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="border-0 border-b border-solid border-main-divider">
|
|
18
|
+
{hasContent ? (
|
|
19
|
+
<OtherProductsItemInner
|
|
20
|
+
columns={columns}
|
|
21
|
+
blocks={blocks}
|
|
22
|
+
context={context}
|
|
23
|
+
isActive={isActive}
|
|
24
|
+
/>
|
|
25
|
+
) : null}
|
|
26
|
+
<button
|
|
27
|
+
className={`border-none bg-primary-main px-0 py-[25px] text-center w-full font-sans text-white text-base
|
|
28
|
+
${hasContent ? 'group cursor-pointer' : ''}`}
|
|
29
|
+
onClick={handleToggle}
|
|
30
|
+
>
|
|
31
|
+
<span className="pr-3">{isActive ? 'Скрыть' : label}</span>
|
|
32
|
+
{hasContent ? <Icon name={icon} width="20" height="20" asSVG /> : null}
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockItemProps } from './OtherProductsItem';
|
|
3
|
+
import { renderBlocksList } from '../../ui-kit/BlocksList/renderBlocksList';
|
|
4
|
+
|
|
5
|
+
export const OtherProductsItemInner = JSX<BlockItemProps>(({ blocks, columns = 1, context }) => {
|
|
6
|
+
const className = 'box-border p-5';
|
|
7
|
+
return (
|
|
8
|
+
<div className="transition-all duration-300 max-h-0 overflow-hidden">
|
|
9
|
+
<div className={`box-border w-full p-9 ${columns > 1 ? 'flex flex-wrap' : ''}`}>
|
|
10
|
+
{renderBlocksList({ context, className, columns, blocks })}
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IconName } from '../../../icons/IconName';
|
|
2
|
+
|
|
3
|
+
export const useActiveHandler = ({ context, blocks }) => {
|
|
4
|
+
const [isActive, setIsActive] = context.useState(false);
|
|
5
|
+
const hasContent = blocks?.length;
|
|
6
|
+
const icon: IconName = isActive ? 'ArrowUpIcon' : 'ArrowDownIcon';
|
|
7
|
+
|
|
8
|
+
const getContentBlock = ({ currentTarget }) => currentTarget.previousSibling;
|
|
9
|
+
|
|
10
|
+
const handleToggle = (e: MouseEvent) => {
|
|
11
|
+
if (!hasContent) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
setIsActive(!isActive);
|
|
16
|
+
const contentBlock = getContentBlock(e);
|
|
17
|
+
contentBlock.style.maxHeight = contentBlock.style.maxHeight
|
|
18
|
+
? null
|
|
19
|
+
: `${contentBlock.scrollHeight}px`;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return { isActive, hasContent, icon, handleToggle };
|
|
23
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M13.8416 10.709L11.6582 12.8923C11.0166 13.534 9.96657 13.534 9.3249 12.8923L3.8999 7.45898" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M17.1001 7.45898L16.2334 8.32565" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M13.3416 9.29163L11.1582 7.10829C10.5166 6.46662 9.46657 6.46662 8.8249 7.10829L3.3999 12.5416" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M16.6001 12.5416L15.7334 11.675" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
// Generated. Do not touch
|
|
3
|
+
/* eslint-disable max-lines */
|
|
3
4
|
|
|
4
5
|
export enum IconMap {
|
|
5
|
-
ActualBalanceIcon = "ActualBalanceIcon", AppleIcon = "AppleIcon", ArrowsRewindRight = "ArrowsRewindRight", AtmIcon = "AtmIcon", BankIcon = "BankIcon", BurgerIcon = "BurgerIcon", BurgerIconWhite = "BurgerIconWhite", Calendar2Icon = "Calendar2Icon", CalendarCircleIcon = "CalendarCircleIcon", CalendarIcon = "CalendarIcon", CalendarTickIcon = "CalendarTickIcon", CalendarWhiteIcon = "CalendarWhiteIcon", CardIcon = "CardIcon", CardPosIcon = "CardPosIcon", CardTickIcon = "CardTickIcon", CardWithGemIcon = "CardWithGemIcon", ChartSquareIcon = "ChartSquareIcon", ClockIcon = "ClockIcon", CloseIcon = "CloseIcon", ComfortableCompIcon = "ComfortableCompIcon", CreditCardsIcon = "CreditCardsIcon", DiscountShapeIcon = "DiscountShapeIcon", DocIcon = "DocIcon", DocIconMonoColor = "DocIconMonoColor", DocumentTextIcon = "DocumentTextIcon", DollarIcon = "DollarIcon", EarthIcon = "EarthIcon", EmptyWalletChangeIcon = "EmptyWalletChangeIcon", EmptyWalletIcon = "EmptyWalletIcon", EmptyWalletWhiteIcon = "EmptyWalletWhiteIcon", EuroIcon = "EuroIcon", GeolocationIcon = "GeolocationIcon", GlassIcon = "GlassIcon", GlobalIcon = "GlobalIcon", GpsIcon = "GpsIcon", GridIcon = "GridIcon", GridIconWhite = "GridIconWhite", InterestGrowthIcon = "InterestGrowthIcon", InterestIcon = "InterestIcon", JCBIcon = "JCBIcon", LoupeIcon = "LoupeIcon", MasterCardIcon = "MasterCardIcon", MinusIcon = "MinusIcon", MirIcon = "MirIcon", MoneyIcon = "MoneyIcon", MoneyInsuranceIcon = "MoneyInsuranceIcon", MonitorMobileIcon = "MonitorMobileIcon", NewDocIcon = "NewDocIcon", OfficeIcon = "OfficeIcon", OkIcon = "OkIcon", PassSendIcon = "PassSendIcon", PercentageRoundIcon = "PercentageRoundIcon", PercentageSquareIcon = "PercentageSquareIcon", PercentageSquareWhiteIcon = "PercentageSquareWhiteIcon", PersonalCardIcon = "PersonalCardIcon", PlayMarketIcon = "PlayMarketIcon", PlusIcon = "PlusIcon", Profile2UserIcon = "Profile2UserIcon", ProfileIcon = "ProfileIcon", RoundRubleIcon = "RoundRubleIcon", SafeIcon = "SafeIcon", ShieldTickIcon = "ShieldTickIcon", SignDocsIcon = "SignDocsIcon", SmallClockIcon = "SmallClockIcon", TelegramIcon = "TelegramIcon", UnionPayIcon = "UnionPayIcon", UserTickIcon = "UserTickIcon", VisaIcon = "VisaIcon", VKIcon = "VKIcon", WalletAdd2Icon = "WalletAdd2Icon", WalletAddIcon = "WalletAddIcon", WalletIcon = "WalletIcon", WalletWithMoneyIcon = "WalletWithMoneyIcon"
|
|
6
|
+
ActualBalanceIcon = "ActualBalanceIcon", AppleIcon = "AppleIcon", ArrowDownIcon = "ArrowDownIcon", ArrowsRewindRight = "ArrowsRewindRight", ArrowUpIcon = "ArrowUpIcon", AtmIcon = "AtmIcon", BankIcon = "BankIcon", BurgerIcon = "BurgerIcon", BurgerIconWhite = "BurgerIconWhite", Calendar2Icon = "Calendar2Icon", CalendarCircleIcon = "CalendarCircleIcon", CalendarIcon = "CalendarIcon", CalendarTickIcon = "CalendarTickIcon", CalendarWhiteIcon = "CalendarWhiteIcon", CardIcon = "CardIcon", CardPosIcon = "CardPosIcon", CardTickIcon = "CardTickIcon", CardWithGemIcon = "CardWithGemIcon", ChartSquareIcon = "ChartSquareIcon", ClockIcon = "ClockIcon", CloseIcon = "CloseIcon", ComfortableCompIcon = "ComfortableCompIcon", CreditCardsIcon = "CreditCardsIcon", DiscountShapeIcon = "DiscountShapeIcon", DocIcon = "DocIcon", DocIconMonoColor = "DocIconMonoColor", DocumentTextIcon = "DocumentTextIcon", DollarIcon = "DollarIcon", EarthIcon = "EarthIcon", EmptyWalletChangeIcon = "EmptyWalletChangeIcon", EmptyWalletIcon = "EmptyWalletIcon", EmptyWalletWhiteIcon = "EmptyWalletWhiteIcon", EuroIcon = "EuroIcon", GeolocationIcon = "GeolocationIcon", GlassIcon = "GlassIcon", GlobalIcon = "GlobalIcon", GpsIcon = "GpsIcon", GridIcon = "GridIcon", GridIconWhite = "GridIconWhite", InterestGrowthIcon = "InterestGrowthIcon", InterestIcon = "InterestIcon", JCBIcon = "JCBIcon", LoupeIcon = "LoupeIcon", MasterCardIcon = "MasterCardIcon", MinusIcon = "MinusIcon", MirIcon = "MirIcon", MoneyIcon = "MoneyIcon", MoneyInsuranceIcon = "MoneyInsuranceIcon", MonitorMobileIcon = "MonitorMobileIcon", NewDocIcon = "NewDocIcon", OfficeIcon = "OfficeIcon", OkIcon = "OkIcon", PassSendIcon = "PassSendIcon", PercentageRoundIcon = "PercentageRoundIcon", PercentageSquareIcon = "PercentageSquareIcon", PercentageSquareWhiteIcon = "PercentageSquareWhiteIcon", PersonalCardIcon = "PersonalCardIcon", PlayMarketIcon = "PlayMarketIcon", PlusIcon = "PlusIcon", Profile2UserIcon = "Profile2UserIcon", ProfileIcon = "ProfileIcon", RoundRubleIcon = "RoundRubleIcon", SafeIcon = "SafeIcon", ShieldTickIcon = "ShieldTickIcon", SignDocsIcon = "SignDocsIcon", SmallClockIcon = "SmallClockIcon", TelegramIcon = "TelegramIcon", UnionPayIcon = "UnionPayIcon", UserTickIcon = "UserTickIcon", VisaIcon = "VisaIcon", VKIcon = "VKIcon", WalletAdd2Icon = "WalletAdd2Icon", WalletAddIcon = "WalletAddIcon", WalletIcon = "WalletIcon", WalletWithMoneyIcon = "WalletWithMoneyIcon"
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -10,7 +11,7 @@ export enum IconMap {
|
|
|
10
11
|
* @title Иконка
|
|
11
12
|
* @enumNames [
|
|
12
13
|
* "",
|
|
13
|
-
* "Деньги", "Лого «Apple»", "ArrowsRewindRight", "Банкомат", "Банк", "Бургер", "Бургер (белый)", "Календарь 2", "Скруглённый календарь", "Календарь", "Календарь с галочкой", "Календарь белый", "Кред. карта", "Кред. карта под наклоном", "Кред. карта с галочкой", "Карта с драгоценностями", "Деньги внутри кошелька", "Часы", "Крестик", "Кресло", "Кредитные карты", "Скидка", "Документ", "Документ (одноцветный)", "Документ с текстом", "Доллар", "Земля", "Пустой кошелёк с возвратом", "Пустой кошелёк", "Пустой кошелёк (белый)", "Евро", "Геолокация", "Зеркало", "Глобус", "Gps", "Сетка", "Сетка (белая)", "Диаграмма роста", "Скидка", "JCB", "Лупа", "MasterCard", "Минус", "МИР", "Деньги", "Денежное страхование", "Монитор и мобильный", "Новый документ", "Офис", "Лого «Одноклассники»", "Бизнес", "Проценты (круг.)", "Проценты", "Проценты белые", "Персональная карта", "Лого «PlayMarket»", "Плюс", "Профиль, 2 персоны", "Профиль", "Рубль (круг.)", "Сейф", "Безопасность", "Подписанные документы", "Маленькие часы", "Лого «Telegram»", "UnionPay", "Пользователь", "Visa", "Лого «VK»", "Пополнение карты", "Кошелёк с плюсом", "Кошелёк", "Кошелёк с деньгами"
|
|
14
|
+
* "Деньги", "Лого «Apple»", "ArrowDownIcon", "ArrowsRewindRight", "ArrowUpIcon", "Банкомат", "Банк", "Бургер", "Бургер (белый)", "Календарь 2", "Скруглённый календарь", "Календарь", "Календарь с галочкой", "Календарь белый", "Кред. карта", "Кред. карта под наклоном", "Кред. карта с галочкой", "Карта с драгоценностями", "Деньги внутри кошелька", "Часы", "Крестик", "Кресло", "Кредитные карты", "Скидка", "Документ", "Документ (одноцветный)", "Документ с текстом", "Доллар", "Земля", "Пустой кошелёк с возвратом", "Пустой кошелёк", "Пустой кошелёк (белый)", "Евро", "Геолокация", "Зеркало", "Глобус", "Gps", "Сетка", "Сетка (белая)", "Диаграмма роста", "Скидка", "JCB", "Лупа", "MasterCard", "Минус", "МИР", "Деньги", "Денежное страхование", "Монитор и мобильный", "Новый документ", "Офис", "Лого «Одноклассники»", "Бизнес", "Проценты (круг.)", "Проценты", "Проценты белые", "Персональная карта", "Лого «PlayMarket»", "Плюс", "Профиль, 2 персоны", "Профиль", "Рубль (круг.)", "Сейф", "Безопасность", "Подписанные документы", "Маленькие часы", "Лого «Telegram»", "UnionPay", "Пользователь", "Visa", "Лого «VK»", "Пополнение карты", "Кошелёк с плюсом", "Кошелёк", "Кошелёк с деньгами"
|
|
14
15
|
* ]
|
|
15
16
|
*/
|
|
16
|
-
export type IconName = "" | "ActualBalanceIcon" | "AppleIcon" | "ArrowsRewindRight" | "AtmIcon" | "BankIcon" | "BurgerIcon" | "BurgerIconWhite" | "Calendar2Icon" | "CalendarCircleIcon" | "CalendarIcon" | "CalendarTickIcon" | "CalendarWhiteIcon" | "CardIcon" | "CardPosIcon" | "CardTickIcon" | "CardWithGemIcon" | "ChartSquareIcon" | "ClockIcon" | "CloseIcon" | "ComfortableCompIcon" | "CreditCardsIcon" | "DiscountShapeIcon" | "DocIcon" | "DocIconMonoColor" | "DocumentTextIcon" | "DollarIcon" | "EarthIcon" | "EmptyWalletChangeIcon" | "EmptyWalletIcon" | "EmptyWalletWhiteIcon" | "EuroIcon" | "GeolocationIcon" | "GlassIcon" | "GlobalIcon" | "GpsIcon" | "GridIcon" | "GridIconWhite" | "InterestGrowthIcon" | "InterestIcon" | "JCBIcon" | "LoupeIcon" | "MasterCardIcon" | "MinusIcon" | "MirIcon" | "MoneyIcon" | "MoneyInsuranceIcon" | "MonitorMobileIcon" | "NewDocIcon" | "OfficeIcon" | "OkIcon" | "PassSendIcon" | "PercentageRoundIcon" | "PercentageSquareIcon" | "PercentageSquareWhiteIcon" | "PersonalCardIcon" | "PlayMarketIcon" | "PlusIcon" | "Profile2UserIcon" | "ProfileIcon" | "RoundRubleIcon" | "SafeIcon" | "ShieldTickIcon" | "SignDocsIcon" | "SmallClockIcon" | "TelegramIcon" | "UnionPayIcon" | "UserTickIcon" | "VisaIcon" | "VKIcon" | "WalletAdd2Icon" | "WalletAddIcon" | "WalletIcon" | "WalletWithMoneyIcon";
|
|
17
|
+
export type IconName = "" | "ActualBalanceIcon" | "AppleIcon" | "ArrowDownIcon" | "ArrowsRewindRight" | "ArrowUpIcon" | "AtmIcon" | "BankIcon" | "BurgerIcon" | "BurgerIconWhite" | "Calendar2Icon" | "CalendarCircleIcon" | "CalendarIcon" | "CalendarTickIcon" | "CalendarWhiteIcon" | "CardIcon" | "CardPosIcon" | "CardTickIcon" | "CardWithGemIcon" | "ChartSquareIcon" | "ClockIcon" | "CloseIcon" | "ComfortableCompIcon" | "CreditCardsIcon" | "DiscountShapeIcon" | "DocIcon" | "DocIconMonoColor" | "DocumentTextIcon" | "DollarIcon" | "EarthIcon" | "EmptyWalletChangeIcon" | "EmptyWalletIcon" | "EmptyWalletWhiteIcon" | "EuroIcon" | "GeolocationIcon" | "GlassIcon" | "GlobalIcon" | "GpsIcon" | "GridIcon" | "GridIconWhite" | "InterestGrowthIcon" | "InterestIcon" | "JCBIcon" | "LoupeIcon" | "MasterCardIcon" | "MinusIcon" | "MirIcon" | "MoneyIcon" | "MoneyInsuranceIcon" | "MonitorMobileIcon" | "NewDocIcon" | "OfficeIcon" | "OkIcon" | "PassSendIcon" | "PercentageRoundIcon" | "PercentageSquareIcon" | "PercentageSquareWhiteIcon" | "PersonalCardIcon" | "PlayMarketIcon" | "PlusIcon" | "Profile2UserIcon" | "ProfileIcon" | "RoundRubleIcon" | "SafeIcon" | "ShieldTickIcon" | "SignDocsIcon" | "SmallClockIcon" | "TelegramIcon" | "UnionPayIcon" | "UserTickIcon" | "VisaIcon" | "VKIcon" | "WalletAdd2Icon" | "WalletAddIcon" | "WalletIcon" | "WalletWithMoneyIcon";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { GalleryContent } from '../../components/Gallery/GalleryContent';
|
|
2
|
+
import type { HeadlineContent } from '../../components/Headline/HeadlineContent';
|
|
3
|
+
import type { LinkDocsContent } from '../../components/LinkDocs/LinkDocsContent';
|
|
4
|
+
import type { MiniGalleryContent } from '../../components/MiniGallery/MiniGalleryContent';
|
|
5
|
+
import type { PictureTextContent } from '../../components/PictureText/PictureTextContent';
|
|
6
|
+
import type { ProductBlockContent } from '../../components/ProductBlock/ProductBlockContent';
|
|
7
|
+
import type { ProductTileContent } from '../../components/ProductTile/ProductTileContent';
|
|
8
|
+
import type { TextBlockContent } from '../../components/TextBlock/TextBlockContent';
|
|
9
|
+
import type { TileContent } from '../../components/Tile/TileContent';
|
|
10
|
+
import type { LinkListContent } from '../../components/LinkList/LinkListContent';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title Количество колонок
|
|
14
|
+
* @enumNames ["1 колонка", "2 колонки"]
|
|
15
|
+
*/
|
|
16
|
+
export type ColumnsCount = 1 | 2;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @title Тип блока
|
|
20
|
+
*/
|
|
21
|
+
export type BlockDefType =
|
|
22
|
+
| 'Headline'
|
|
23
|
+
| 'LinkDocs'
|
|
24
|
+
| 'TextBlock'
|
|
25
|
+
| 'PictureText'
|
|
26
|
+
| 'Tile'
|
|
27
|
+
| 'ProductTile'
|
|
28
|
+
| 'ProductBlock'
|
|
29
|
+
| 'Gallery'
|
|
30
|
+
| 'MiniGallery'
|
|
31
|
+
| 'LinkList';
|
|
32
|
+
|
|
33
|
+
interface BaseBlockDef {
|
|
34
|
+
blockListType: BlockDefType;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @title Заголовок
|
|
39
|
+
*/
|
|
40
|
+
export type HeadlineBlockListDef = HeadlineContent & BaseBlockDef;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @title Список документов
|
|
44
|
+
*/
|
|
45
|
+
export type LinkDocsBlockListDef = LinkDocsContent & BaseBlockDef;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @title Текстовый блок
|
|
49
|
+
*/
|
|
50
|
+
export type TextBlockBlockListDef = TextBlockContent & BaseBlockDef;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @title Картинка с текстом
|
|
54
|
+
*/
|
|
55
|
+
export type PictureTextBlockListDef = PictureTextContent & BaseBlockDef;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @title Продуктовый блок
|
|
59
|
+
*/
|
|
60
|
+
export type ProductBlockBlockListDef = ProductBlockContent & BaseBlockDef;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @title Плитка
|
|
64
|
+
*/
|
|
65
|
+
export type TileBlockListDef = TileContent & BaseBlockDef;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @title Продуктовая плитка
|
|
69
|
+
*/
|
|
70
|
+
export type ProductTileBlockListDef = ProductTileContent & BaseBlockDef;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @title Галлерея
|
|
74
|
+
*/
|
|
75
|
+
export type GalleryBlockListDef = GalleryContent & BaseBlockDef;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @title Мини-галлерея
|
|
79
|
+
*/
|
|
80
|
+
export type MiniGalleryBlockListDef = MiniGalleryContent & BaseBlockDef;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @title Список ссылок
|
|
84
|
+
*/
|
|
85
|
+
export type LinkListBlockListDef = LinkListContent & BaseBlockDef;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @title Выберите блок
|
|
89
|
+
*/
|
|
90
|
+
export type EmptyOption = null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @title Содержимое блока
|
|
94
|
+
*/
|
|
95
|
+
export type BlockDef =
|
|
96
|
+
| EmptyOption
|
|
97
|
+
| HeadlineBlockListDef
|
|
98
|
+
| LinkDocsBlockListDef
|
|
99
|
+
| TextBlockBlockListDef
|
|
100
|
+
| PictureTextBlockListDef
|
|
101
|
+
| ProductBlockBlockListDef
|
|
102
|
+
| TileBlockListDef
|
|
103
|
+
| ProductTileBlockListDef
|
|
104
|
+
| GalleryBlockListDef
|
|
105
|
+
| MiniGalleryBlockListDef
|
|
106
|
+
| LinkListBlockListDef;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Headline } from '../../components/Headline/Headline';
|
|
2
|
+
import { LinkDocs } from '../../components/LinkDocs/LinkDocs';
|
|
3
|
+
import { PictureText } from '../../components/PictureText/PictureText';
|
|
4
|
+
import { ProductBlock } from '../../components/ProductBlock/ProductBlock';
|
|
5
|
+
import { TextBlock } from '../../components/TextBlock/TextBlock';
|
|
6
|
+
import { Tile } from '../../components/Tile/Tile';
|
|
7
|
+
import { ProductTile } from '../../components/ProductTile/ProductTile';
|
|
8
|
+
import { Gallery } from '../../components/Gallery/Gallery';
|
|
9
|
+
import { MiniGallery } from '../../components/MiniGallery/MiniGallery';
|
|
10
|
+
import { LinkList } from '../../components/LinkList/LinkList';
|
|
11
|
+
|
|
12
|
+
export const EmbeddableBlocks = {
|
|
13
|
+
Headline,
|
|
14
|
+
LinkDocs,
|
|
15
|
+
TextBlock,
|
|
16
|
+
PictureText,
|
|
17
|
+
ProductBlock,
|
|
18
|
+
Tile,
|
|
19
|
+
ProductTile,
|
|
20
|
+
Gallery,
|
|
21
|
+
MiniGallery,
|
|
22
|
+
LinkList,
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JSXBlock } from '../../components/ContentPage/ContentPage';
|
|
2
|
+
import type { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
3
|
+
import type { BlockDef, ColumnsCount } from './BlocksListProps';
|
|
4
|
+
import { EmbeddableBlocks } from './EmbeddableBlocks';
|
|
5
|
+
|
|
6
|
+
type EmbeddableBlocksProps = {
|
|
7
|
+
blocks?: BlockDef[];
|
|
8
|
+
context: ContentPageContext;
|
|
9
|
+
columns?: ColumnsCount;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const renderBlocksList = ({ blocks, context, className, columns }: EmbeddableBlocksProps) =>
|
|
14
|
+
blocks?.length ? blocks.map(renderBlock({ context, className, columns })) : null;
|
|
15
|
+
|
|
16
|
+
export const renderBlock =
|
|
17
|
+
({ context, columns, className }: EmbeddableBlocksProps) =>
|
|
18
|
+
(block: BlockDef, i: number) => {
|
|
19
|
+
const type = block?.blockListType;
|
|
20
|
+
if (!type || !(type in EmbeddableBlocks)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const columnsCountClass = columns === 2 ? 'w-1/2' : '';
|
|
24
|
+
const EmbeddedBlock: JSXBlock = EmbeddableBlocks[type];
|
|
25
|
+
return (
|
|
26
|
+
<div className={`${className} ${columnsCountClass}`} key={`block_${i}`}>
|
|
27
|
+
<EmbeddedBlock context={context} {...block} className="!p-0" />
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
"label": "Аккордеон 1",
|
|
6
6
|
"blocks": [
|
|
7
7
|
{
|
|
8
|
-
"
|
|
8
|
+
"blockListType": "TextBlock",
|
|
9
9
|
"title": "Текстовый блок",
|
|
10
10
|
"description": "Описание текстового блока"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
"
|
|
13
|
+
"blockListType": "TextBlock",
|
|
14
14
|
"title": "Текстовый блок №2",
|
|
15
15
|
"description": "Описание текстового блока №2"
|
|
16
16
|
}
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"label": "Аккордеон 2",
|
|
21
21
|
"blocks": [
|
|
22
22
|
{
|
|
23
|
-
"
|
|
23
|
+
"blockListType": "TextBlock",
|
|
24
24
|
"title": "Текстовый блок",
|
|
25
25
|
"description": "Описание текстового блока"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"
|
|
28
|
+
"blockListType": "TextBlock",
|
|
29
29
|
"title": "Текстовый блок №2",
|
|
30
30
|
"description": "Описание текстового блока №2"
|
|
31
31
|
}
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"label": "Аккордеон 3",
|
|
36
36
|
"blocks": [
|
|
37
37
|
{
|
|
38
|
-
"
|
|
38
|
+
"blockListType": "TextBlock",
|
|
39
39
|
"title": "Текстовый блок",
|
|
40
40
|
"description": "Описание текстового блока"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
"
|
|
43
|
+
"blockListType": "TextBlock",
|
|
44
44
|
"title": "Текстовый блок №2",
|
|
45
45
|
"description": "Описание текстового блока №2"
|
|
46
46
|
}
|
|
@@ -6,29 +6,29 @@ import { TEXT_BLOCK } from '../TextBlock/TextBlock.fixture';
|
|
|
6
6
|
import type { AccordionProps } from './Accordion';
|
|
7
7
|
import { Accordion } from './Accordion';
|
|
8
8
|
import type {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from '
|
|
9
|
+
HeadlineBlockListDef,
|
|
10
|
+
LinkDocsBlockListDef,
|
|
11
|
+
PictureTextBlockListDef,
|
|
12
|
+
TextBlockBlockListDef,
|
|
13
|
+
} from '../../ui-kit/BlocksList/BlocksListProps';
|
|
14
14
|
|
|
15
|
-
const TEXT_BLOCK_ACCORDION_BLOCK:
|
|
16
|
-
|
|
15
|
+
const TEXT_BLOCK_ACCORDION_BLOCK: TextBlockBlockListDef = {
|
|
16
|
+
blockListType: 'TextBlock',
|
|
17
17
|
...TEXT_BLOCK,
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const HEADLINE_ACCORDION_BLOCK:
|
|
21
|
-
|
|
20
|
+
const HEADLINE_ACCORDION_BLOCK: HeadlineBlockListDef = {
|
|
21
|
+
blockListType: 'Headline',
|
|
22
22
|
...HEADLINE,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const PICTURE_TEXT_ACCORDION_BLOCK:
|
|
26
|
-
|
|
25
|
+
const PICTURE_TEXT_ACCORDION_BLOCK: PictureTextBlockListDef = {
|
|
26
|
+
blockListType: 'PictureText',
|
|
27
27
|
...PICTURE_TEXT,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const LINK_DOCS_ACCORDION_BLOCK:
|
|
31
|
-
|
|
30
|
+
const LINK_DOCS_ACCORDION_BLOCK: LinkDocsBlockListDef = {
|
|
31
|
+
blockListType: 'LinkDocs',
|
|
32
32
|
...linkDocsContentExample,
|
|
33
33
|
title: '',
|
|
34
34
|
};
|
|
@@ -4,77 +4,60 @@ import { HEADLINE } from '../Headline/Headline.fixture';
|
|
|
4
4
|
import { linkDocsContentExample } from '../LinkDocs/linkDocsContentExample';
|
|
5
5
|
import { defaultProps as MINI_GALLERY } from '../MiniGallery/MiniGallery.fixture';
|
|
6
6
|
import { PICTURE_TEXT } from '../PictureText/PictureText.fixture';
|
|
7
|
-
import {
|
|
8
|
-
import { PRODUCT_TILE, PRODUCT_PENSION_TILE } from '../ProductTile/ProductTile.fixture';
|
|
7
|
+
import { PRODUCT_TILE } from '../ProductTile/ProductTile.fixture';
|
|
9
8
|
import { TEXT_BLOCK } from '../TextBlock/TextBlock.fixture';
|
|
10
|
-
import { TILE
|
|
9
|
+
import { TILE } from '../Tile/Tile.fixture';
|
|
11
10
|
import type { AccordionProps } from './Accordion';
|
|
12
11
|
import { Accordion } from './Accordion';
|
|
13
12
|
import type {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
accordionBlockType: 'TextBlock',
|
|
13
|
+
GalleryBlockListDef,
|
|
14
|
+
HeadlineBlockListDef,
|
|
15
|
+
LinkDocsBlockListDef,
|
|
16
|
+
MiniGalleryBlockListDef,
|
|
17
|
+
PictureTextBlockListDef,
|
|
18
|
+
ProductTileBlockListDef,
|
|
19
|
+
TextBlockBlockListDef,
|
|
20
|
+
TileBlockListDef,
|
|
21
|
+
} from '../../ui-kit/BlocksList/BlocksListProps';
|
|
22
|
+
|
|
23
|
+
const TEXT_BLOCK_ACCORDION_BLOCK: TextBlockBlockListDef = {
|
|
24
|
+
blockListType: 'TextBlock',
|
|
27
25
|
...TEXT_BLOCK,
|
|
28
26
|
};
|
|
29
27
|
|
|
30
|
-
const HEADLINE_ACCORDION_BLOCK:
|
|
31
|
-
|
|
28
|
+
const HEADLINE_ACCORDION_BLOCK: HeadlineBlockListDef = {
|
|
29
|
+
blockListType: 'Headline',
|
|
32
30
|
...HEADLINE,
|
|
33
31
|
};
|
|
34
32
|
|
|
35
|
-
const PICTURE_TEXT_ACCORDION_BLOCK:
|
|
36
|
-
|
|
33
|
+
const PICTURE_TEXT_ACCORDION_BLOCK: PictureTextBlockListDef = {
|
|
34
|
+
blockListType: 'PictureText',
|
|
37
35
|
...PICTURE_TEXT,
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
...PRODUCT_BLOCK,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const LINK_DOCS_ACCORDION_BLOCK: LinkDocsAccordionBlockDef = {
|
|
46
|
-
accordionBlockType: 'LinkDocs',
|
|
38
|
+
const LINK_DOCS_ACCORDION_BLOCK: LinkDocsBlockListDef = {
|
|
39
|
+
blockListType: 'LinkDocs',
|
|
47
40
|
...linkDocsContentExample,
|
|
48
41
|
title: '',
|
|
49
42
|
};
|
|
50
43
|
|
|
51
|
-
const TILES_ACCORDION_BLOCK:
|
|
52
|
-
|
|
44
|
+
const TILES_ACCORDION_BLOCK: TileBlockListDef = {
|
|
45
|
+
blockListType: 'Tile',
|
|
53
46
|
...TILE,
|
|
54
47
|
};
|
|
55
48
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
...TILE_PREMIUM,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const PRODUCT_TILES_ACCORDION_BLOCK: ProductTileAccordionBlockDef = {
|
|
62
|
-
accordionBlockType: 'ProductTile',
|
|
49
|
+
const PRODUCT_TILES_ACCORDION_BLOCK: ProductTileBlockListDef = {
|
|
50
|
+
blockListType: 'ProductTile',
|
|
63
51
|
...PRODUCT_TILE,
|
|
64
52
|
};
|
|
65
53
|
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
...PRODUCT_PENSION_TILE,
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const GALLERY_ACCORDION_BLOCK: GalleryAccordionBlockDef = {
|
|
72
|
-
accordionBlockType: 'Gallery',
|
|
54
|
+
const GALLERY_ACCORDION_BLOCK: GalleryBlockListDef = {
|
|
55
|
+
blockListType: 'Gallery',
|
|
73
56
|
...GALLERY,
|
|
74
57
|
};
|
|
75
58
|
|
|
76
|
-
const MINI_GALLERY_ACCORDION_BLOCK:
|
|
77
|
-
|
|
59
|
+
const MINI_GALLERY_ACCORDION_BLOCK: MiniGalleryBlockListDef = {
|
|
60
|
+
blockListType: 'MiniGallery',
|
|
78
61
|
...MINI_GALLERY,
|
|
79
62
|
};
|
|
80
63
|
|
|
@@ -116,58 +99,10 @@ const propsBlock: AccordionProps = {
|
|
|
116
99
|
],
|
|
117
100
|
};
|
|
118
101
|
|
|
119
|
-
const propsTwoColumns: AccordionProps = {
|
|
120
|
-
context,
|
|
121
|
-
accordionItems: [
|
|
122
|
-
{
|
|
123
|
-
label: 'Другие продукты Россельхозбанка 1',
|
|
124
|
-
blocks: [
|
|
125
|
-
TILES_PREMIUM_ACCORDION_BLOCK,
|
|
126
|
-
TILES_PREMIUM_ACCORDION_BLOCK,
|
|
127
|
-
TILES_ACCORDION_BLOCK,
|
|
128
|
-
TILES_ACCORDION_BLOCK,
|
|
129
|
-
],
|
|
130
|
-
columns: 2,
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
label: 'Другие продукты Россельхозбанка 2',
|
|
134
|
-
blocks: [
|
|
135
|
-
PRODUCT_TILES_ACCORDION_BLOCK,
|
|
136
|
-
PRODUCT_TILES_ACCORDION_BLOCK,
|
|
137
|
-
PRODUCT_PENSION_TILES__ACCORDION_BLOCK,
|
|
138
|
-
PRODUCT_PENSION_TILES__ACCORDION_BLOCK,
|
|
139
|
-
],
|
|
140
|
-
columns: 2,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
label: 'Другие продукты Россельхозбанка 3',
|
|
144
|
-
blocks: [PRODUCT_BLOCK_ACCORDION_BLOCK, PRODUCT_BLOCK_ACCORDION_BLOCK],
|
|
145
|
-
columns: 2,
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
{
|
|
149
|
-
label: 'Другие продукты Россельхозбанка 4',
|
|
150
|
-
blocks: [
|
|
151
|
-
TEXT_BLOCK_ACCORDION_BLOCK,
|
|
152
|
-
TEXT_BLOCK_ACCORDION_BLOCK,
|
|
153
|
-
TEXT_BLOCK_ACCORDION_BLOCK,
|
|
154
|
-
TEXT_BLOCK_ACCORDION_BLOCK,
|
|
155
|
-
],
|
|
156
|
-
columns: 2,
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
};
|
|
160
|
-
|
|
161
102
|
export default {
|
|
162
103
|
default: (
|
|
163
104
|
<div className="container grid grid-cols-12">
|
|
164
105
|
<Accordion className="col-span-12" {...propsBlock} />
|
|
165
106
|
</div>
|
|
166
107
|
),
|
|
167
|
-
|
|
168
|
-
'two columns': (
|
|
169
|
-
<div className="container grid grid-cols-12">
|
|
170
|
-
<Accordion className="col-span-12" {...propsTwoColumns} />
|
|
171
|
-
</div>
|
|
172
|
-
),
|
|
173
108
|
};
|