@redneckz/wildless-cms-uni-blocks 0.3.18 → 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/README.md +43 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +93 -19
- 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/cosmos-static/icons/ArrowsRewindRight.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/BaseTile/BaseTile.js +1 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/Blocks.d.ts +2 -0
- package/dist/components/Blocks.js +4 -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/components/ProductBlock/ProductBlockContent.d.ts +7 -1
- package/dist/components/ProductBlock/ProductBlockInner.js +9 -2
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductGallery/ProductGalleryContent.d.ts +1 -1
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +5 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +32 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +30 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.js +2 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +1 -0
- package/dist/icons/IconName.d.ts +5 -2
- package/dist/icons/IconName.js +4 -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/dist/ui-kit/Heading/Heading.js +2 -2
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- 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/BaseTile.js +1 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/BaseTile/getTileHeadingType.d.ts +1 -1
- package/lib/components/Blocks.d.ts +2 -0
- package/lib/components/Blocks.js +4 -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/components/ProductBlock/ProductBlockContent.d.ts +7 -1
- package/lib/components/ProductBlock/ProductBlockInner.js +9 -2
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductGallery/ProductGalleryContent.d.ts +1 -1
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +5 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.fixture.d.ts +4 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +30 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +30 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js +2 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +1 -0
- package/lib/icons/IconName.d.ts +5 -2
- package/lib/icons/IconName.js +4 -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/lib/ui-kit/Heading/Heading.js +2 -2
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +17 -12
- 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/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
- 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/components/ProductBlock/ProductBlockContent.d.ts +7 -1
- package/mobile/dist/components/ProductGallery/ProductGalleryContent.d.ts +1 -1
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +5 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +32 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +30 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.js +2 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +5 -2
- package/mobile/dist/icons/IconName.js +4 -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/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
- 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/components/ProductBlock/ProductBlockContent.d.ts +7 -1
- package/mobile/lib/components/ProductGallery/ProductGalleryContent.d.ts +1 -1
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +5 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +30 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +30 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js +2 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +5 -2
- package/mobile/lib/icons/IconName.js +4 -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/common.css +0 -30
- 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/BaseTile/BaseTile.tsx +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/components/ProductBlock/ProductBlockContent.ts +7 -1
- package/mobile/src/components/ProductGallery/ProductGalleryContent.ts +1 -1
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +22 -0
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +98 -0
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +32 -0
- package/mobile/src/components/Tile/Tile.example.json +1 -3
- package/mobile/src/icons/ArrowDownIcon.svg +4 -0
- package/mobile/src/icons/ArrowUpIcon.svg +4 -0
- package/mobile/src/icons/ArrowsRewindRight.svg +16 -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/common.css +0 -30
- 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/BaseTile/BaseTile.tsx +1 -1
- package/src/components/Blocks.ts +4 -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/components/ProductBlock/ProductBlockContent.ts +7 -1
- package/src/components/ProductBlock/ProductBlockInner.tsx +23 -15
- package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +2 -2
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +4 -4
- package/src/components/ProductGallery/ProductGalleryContent.ts +1 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +22 -0
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.fixture.tsx +114 -0
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +98 -0
- package/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +32 -0
- package/src/components/Tile/Tile.example.json +1 -3
- package/src/icons/ArrowDownIcon.svg +4 -0
- package/src/icons/ArrowUpIcon.svg +4 -0
- package/src/icons/ArrowsRewindRight.svg +16 -0
- package/src/icons/IconName.ts +154 -4
- 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/src/ui-kit/Heading/Heading.tsx +2 -2
- 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,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
package/src/common.css
CHANGED
|
@@ -22,26 +22,6 @@
|
|
|
22
22
|
}
|
|
23
23
|
/* Ecosystem own | Yellow */
|
|
24
24
|
[data-theme='eo'] {
|
|
25
|
-
--color-primary-main: 221, 182, 61;
|
|
26
|
-
--color-primary-hover: 187, 151, 39;
|
|
27
|
-
--color-primary-active: 126, 99, 12;
|
|
28
|
-
--color-secondary-hover: 241, 236, 221;
|
|
29
|
-
--color-secondary-active: 229, 222, 199;
|
|
30
|
-
--color-gradient-from: 141, 189, 76; /* TODO: change color to theme eo */
|
|
31
|
-
--color-gradient-to: 69, 172, 69; /* TODO: change color to theme eo */
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
[data-theme='eo2'] {
|
|
35
|
-
--color-primary-main: 255, 204, 0;
|
|
36
|
-
--color-primary-hover: 187, 151, 39;
|
|
37
|
-
--color-primary-active: 126, 99, 12;
|
|
38
|
-
--color-secondary-hover: 241, 236, 221;
|
|
39
|
-
--color-secondary-active: 229, 222, 199;
|
|
40
|
-
--color-gradient-from: 141, 189, 76; /* TODO: change color to theme eo */
|
|
41
|
-
--color-gradient-to: 69, 172, 69; /* TODO: change color to theme eo */
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[data-theme='eo3'] {
|
|
45
25
|
--color-primary-main: 225, 186, 30;
|
|
46
26
|
--color-primary-hover: 187, 151, 39;
|
|
47
27
|
--color-primary-active: 126, 99, 12;
|
|
@@ -51,16 +31,6 @@
|
|
|
51
31
|
--color-gradient-to: 69, 172, 69; /* TODO: change color to theme eo */
|
|
52
32
|
}
|
|
53
33
|
|
|
54
|
-
[data-theme='eo4'] {
|
|
55
|
-
--color-primary-main: 233, 191, 23;
|
|
56
|
-
--color-primary-hover: 187, 151, 39;
|
|
57
|
-
--color-primary-active: 126, 99, 12;
|
|
58
|
-
--color-secondary-hover: 241, 236, 221;
|
|
59
|
-
--color-secondary-active: 229, 222, 199;
|
|
60
|
-
--color-gradient-from: 141, 189, 76; /* TODO: change color to theme eo */
|
|
61
|
-
--color-gradient-to: 69, 172, 69; /* TODO: change color to theme eo */
|
|
62
|
-
}
|
|
63
|
-
|
|
64
34
|
@tailwind components;
|
|
65
35
|
@tailwind utilities;
|
|
66
36
|
|
|
@@ -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
|
};
|
|
@@ -1,109 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { HeadlineContent } from '../Headline/HeadlineContent';
|
|
3
|
-
import type { LinkDocsContent } from '../LinkDocs/LinkDocsContent';
|
|
4
|
-
import type { MiniGalleryContent } from '../MiniGallery/MiniGalleryContent';
|
|
5
|
-
import type { PictureTextContent } from '../PictureText/PictureTextContent';
|
|
6
|
-
import type { ProductBlockContent } from '../ProductBlock/ProductBlockContent';
|
|
7
|
-
import type { ProductTileContent } from '../ProductTile/ProductTileContent';
|
|
8
|
-
import type { TextBlockContent } from '../TextBlock/TextBlockContent';
|
|
9
|
-
import type { TileContent } from '../Tile/TileContent';
|
|
10
|
-
import type { LinkListContent } from '../LinkList/LinkListContent';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @title Тип блока
|
|
14
|
-
*/
|
|
15
|
-
export type AccordionBlockType =
|
|
16
|
-
| 'Headline'
|
|
17
|
-
| 'LinkDocs'
|
|
18
|
-
| 'TextBlock'
|
|
19
|
-
| 'PictureText'
|
|
20
|
-
| 'Tile'
|
|
21
|
-
| 'ProductTile'
|
|
22
|
-
| 'ProductBlock'
|
|
23
|
-
| 'Gallery'
|
|
24
|
-
| 'MiniGallery'
|
|
25
|
-
| 'LinkList';
|
|
26
|
-
|
|
27
|
-
interface AccordionBlockDef {
|
|
28
|
-
accordionBlockType: AccordionBlockType;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @title Заголовок
|
|
33
|
-
*/
|
|
34
|
-
export type HeadlineAccordionBlockDef = HeadlineContent & AccordionBlockDef;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @title Список документов
|
|
38
|
-
*/
|
|
39
|
-
export type LinkDocsAccordionBlockDef = LinkDocsContent & AccordionBlockDef;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @title Текстовый блок
|
|
43
|
-
*/
|
|
44
|
-
export type TextBlockAccordionBlockDef = TextBlockContent & AccordionBlockDef;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @title Картинка с текстом
|
|
48
|
-
*/
|
|
49
|
-
export type PictureTextAccordionBlockDef = PictureTextContent & AccordionBlockDef;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @title Продуктовый блок
|
|
53
|
-
*/
|
|
54
|
-
export type ProductBlockAccordionBlockDef = ProductBlockContent & AccordionBlockDef;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @title Плитка
|
|
58
|
-
*/
|
|
59
|
-
export type TileAccordionBlockDef = TileContent & AccordionBlockDef;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @title Продуктовая плитка
|
|
63
|
-
*/
|
|
64
|
-
export type ProductTileAccordionBlockDef = ProductTileContent & AccordionBlockDef;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @title Галлерея
|
|
68
|
-
*/
|
|
69
|
-
export type GalleryAccordionBlockDef = GalleryContent & AccordionBlockDef;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @title Мини-галлерея
|
|
73
|
-
*/
|
|
74
|
-
export type MiniGalleryAccordionBlockDef = MiniGalleryContent & AccordionBlockDef;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @title Список ссылок
|
|
78
|
-
*/
|
|
79
|
-
export type LinkListAccordionBlockDef = LinkListContent & AccordionBlockDef;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @title Выберите блок
|
|
83
|
-
*/
|
|
84
|
-
export type EmptyOption = null;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @title Содержимое аккордеона
|
|
88
|
-
*/
|
|
89
|
-
export type AccordionBlockProps =
|
|
90
|
-
| EmptyOption
|
|
91
|
-
| HeadlineAccordionBlockDef
|
|
92
|
-
| LinkDocsAccordionBlockDef
|
|
93
|
-
| TextBlockAccordionBlockDef
|
|
94
|
-
| PictureTextAccordionBlockDef
|
|
95
|
-
| ProductBlockAccordionBlockDef
|
|
96
|
-
| TileAccordionBlockDef
|
|
97
|
-
| ProductTileAccordionBlockDef
|
|
98
|
-
| GalleryAccordionBlockDef
|
|
99
|
-
| MiniGalleryAccordionBlockDef
|
|
100
|
-
| LinkListAccordionBlockDef;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* @title Количество колонок
|
|
104
|
-
* @enumNames ["1 колонка", "2 колонки"]
|
|
105
|
-
*/
|
|
106
|
-
export type ColumnsCount = 1 | 2;
|
|
1
|
+
import type { BlockDef, ColumnsCount } from '../../ui-kit/BlocksList/BlocksListProps';
|
|
107
2
|
|
|
108
3
|
/**
|
|
109
4
|
* @title Элемент списка
|
|
@@ -115,13 +10,12 @@ export interface AccordionItemCommonProps {
|
|
|
115
10
|
*/
|
|
116
11
|
label?: string;
|
|
117
12
|
/** @title Блоки */
|
|
118
|
-
blocks?:
|
|
13
|
+
blocks?: BlockDef[];
|
|
119
14
|
/**
|
|
120
15
|
* @title Отображать/скрывать обводку элемента
|
|
121
16
|
* @default false
|
|
122
17
|
*/
|
|
123
18
|
bordered?: boolean; // TODO: только для мобильной версии
|
|
124
|
-
|
|
125
19
|
columns?: ColumnsCount;
|
|
126
20
|
}
|
|
127
21
|
|
|
@@ -3,12 +3,12 @@ import type { UniBlockProps } from '../../types';
|
|
|
3
3
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
4
|
import type { AccordionItemCommonProps } from './AccordionContent';
|
|
5
5
|
import { AccordionItemInner } from './AccordionItemInner';
|
|
6
|
-
import {
|
|
6
|
+
import { useActiveHandler } from './utils/useActiveHandler';
|
|
7
7
|
|
|
8
8
|
export interface AccordionItemProps extends AccordionItemCommonProps, UniBlockProps {}
|
|
9
9
|
|
|
10
10
|
export const AccordionItem = JSX<AccordionItemProps>(({ label, blocks, bordered, context }) => {
|
|
11
|
-
const { hasContent, icon, handleToggle } =
|
|
11
|
+
const { hasContent, icon, handleToggle } = useActiveHandler({
|
|
12
12
|
context,
|
|
13
13
|
blocks,
|
|
14
14
|
});
|
|
@@ -3,12 +3,12 @@ import type { UniBlockProps } from '../../types';
|
|
|
3
3
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
4
|
import type { AccordionItemCommonProps } from './AccordionContent';
|
|
5
5
|
import { AccordionItemInner } from './AccordionItemInner';
|
|
6
|
-
import {
|
|
6
|
+
import { useActiveHandler } from './utils/useActiveHandler';
|
|
7
7
|
|
|
8
8
|
export interface AccordionItemProps extends AccordionItemCommonProps, UniBlockProps {}
|
|
9
9
|
|
|
10
10
|
export const AccordionItem = JSX<AccordionItemProps>(({ label, blocks, columns, context }) => {
|
|
11
|
-
const { hasContent, icon, handleToggle } =
|
|
11
|
+
const { hasContent, icon, handleToggle } = useActiveHandler({
|
|
12
12
|
context,
|
|
13
13
|
blocks,
|
|
14
14
|
});
|
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { JSXBlock } from '../ContentPage/ContentPage';
|
|
3
|
-
import type { ContentPageContext } from '../ContentPage/ContentPageContext';
|
|
4
|
-
import { AccordionBlocks } from './AccordionBlocks';
|
|
5
|
-
import type { AccordionBlockProps } from './AccordionContent';
|
|
6
2
|
import type { AccordionItemProps } from './AccordionItem';
|
|
3
|
+
import { renderBlocksList } from '../../ui-kit/BlocksList/renderBlocksList';
|
|
7
4
|
|
|
8
5
|
export const AccordionItemInner = JSX<AccordionItemProps>(({ blocks, context }) => {
|
|
6
|
+
const className = 'mb-5 last:mb-0 first:mt-2';
|
|
7
|
+
const columns = 1;
|
|
9
8
|
return (
|
|
10
9
|
<div className="transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0">
|
|
11
|
-
{
|
|
10
|
+
{renderBlocksList({ context, className, columns, blocks })}
|
|
12
11
|
</div>
|
|
13
12
|
);
|
|
14
13
|
});
|
|
15
|
-
|
|
16
|
-
const renderBlock = (context: ContentPageContext) => (block: AccordionBlockProps, i: number) => {
|
|
17
|
-
const type = block?.accordionBlockType;
|
|
18
|
-
if (!type || !(type in AccordionBlocks)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const AccordionBlock: JSXBlock = AccordionBlocks[type];
|
|
23
|
-
return (
|
|
24
|
-
<div className="mb-5 last:mb-0 first:mt-2" key={`block_${i}`}>
|
|
25
|
-
<AccordionBlock context={context} {...block} className="!p-0" />
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
};
|