@meduza/ui-kit-2 0.4.15 → 0.5.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/package.json +12 -7
- package/src/Cover/index.tsx +2 -10
- package/src/DocumentItemsCount/DocumentItemsCount.module.css +12 -1
- package/src/DocumentItemsCount/DocumentItemsCount.test.tsx +9 -2
- package/src/DocumentItemsCount/index.tsx +3 -3
- package/src/Footnote/Footnote.module.css +6 -46
- package/src/Footnote/Footnote.stories.tsx +9 -26
- package/src/Image/Image.module.css +0 -11
- package/src/Meta/Meta.module.css +0 -5
- package/src/Meta/Meta.stories.module.css +0 -16
- package/src/Meta/Meta.stories.tsx +4 -51
- package/src/Meta/MetaContainer.tsx +0 -8
- package/src/Popover/Popover.module.css +29 -47
- package/src/Popover/Popover.stories.tsx +1 -25
- package/src/Popover/index.tsx +21 -1
- package/src/RawHtmlBlock/index.tsx +5 -0
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +1 -11
- package/src/RenderBlocks/index.tsx +1 -5
- package/src/RichTitle/RichTitle.module.css +6 -16
- package/src/ShopRelatedBlock/ShopRelatedBlock.module.css +210 -0
- package/src/ShopRelatedBlock/ShopRelatedBlock.stories.module.css +12 -0
- package/src/ShopRelatedBlock/ShopRelatedBlock.stories.tsx +52 -0
- package/src/ShopRelatedBlock/ShopRelatedBlock.test.tsx +20 -0
- package/src/ShopRelatedBlock/ShopRelatedBlock.types.ts +4 -0
- package/src/ShopRelatedBlock/index.tsx +120 -0
- package/src/ShopRelatedBlock/mock.json +153 -0
- package/src/SimpleBlock/SimpleBlock.types.ts +1 -0
- package/src/SimpleBlock/index.tsx +3 -1
- package/src/Tag/Tag.module.css +3 -8
- package/src/Tag/Tag.stories.tsx +3 -16
- package/src/Tag/Tag.types.ts +1 -7
- package/src/index.tsx +1 -1
- package/dist/AnnouncementInText/AnnouncementInText.types.d.ts +0 -4
- package/dist/AnnouncementInText/index.d.ts +0 -3
- package/dist/BookmarkButton/BookmarkButton.types.d.ts +0 -6
- package/dist/BookmarkButton/index.d.ts +0 -3
- package/dist/Button/Button.d.ts +0 -3
- package/dist/Button/Button.types.d.ts +0 -16
- package/dist/Button/ButtonLoader.d.ts +0 -2
- package/dist/Button/index.d.ts +0 -2
- package/dist/CardTitle/CardTitle.types.d.ts +0 -10
- package/dist/CardTitle/index.d.ts +0 -3
- package/dist/ChapterBlock/ChapterBlock.types.d.ts +0 -7
- package/dist/ChapterBlock/index.d.ts +0 -3
- package/dist/Cover/Cover.types.d.ts +0 -24
- package/dist/Cover/index.d.ts +0 -3
- package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +0 -7
- package/dist/DocumentItemsCount/index.d.ts +0 -3
- package/dist/DonatesTeaser/DonatesTeaser.types.d.ts +0 -4
- package/dist/DonatesTeaser/index.d.ts +0 -3
- package/dist/DotsOnImage/DotsOnImage.types.d.ts +0 -46
- package/dist/DotsOnImage/index.d.ts +0 -3
- package/dist/Dropdown/Dropdown.types.d.ts +0 -6
- package/dist/Dropdown/index.d.ts +0 -4
- package/dist/EmbedBlock/EmbedBlock.d.ts +0 -3
- package/dist/EmbedBlock/EmbedBlock.types.d.ts +0 -12
- package/dist/EmbedBlock/EmbedGif.d.ts +0 -3
- package/dist/EmbedBlock/IframeBlock.d.ts +0 -3
- package/dist/EmbedBlock/index.d.ts +0 -3
- package/dist/Footnote/Footnote.types.d.ts +0 -5
- package/dist/Footnote/index.d.ts +0 -3
- package/dist/GroupedBlock/GroupedBlock.types.d.ts +0 -4
- package/dist/GroupedBlock/index.d.ts +0 -3
- package/dist/HalfBlock/HalfBlock.types.d.ts +0 -4
- package/dist/HalfBlock/index.d.ts +0 -3
- package/dist/Image/Image.types.d.ts +0 -35
- package/dist/Image/RenderPicture.d.ts +0 -4
- package/dist/Image/index.d.ts +0 -3
- package/dist/ImportantLead/ImportantLead.types.d.ts +0 -4
- package/dist/ImportantLead/index.d.ts +0 -3
- package/dist/Lazy/Lazy.types.d.ts +0 -5
- package/dist/Lazy/index.d.ts +0 -3
- package/dist/ListBlock/ListBlock.types.d.ts +0 -10
- package/dist/ListBlock/index.d.ts +0 -3
- package/dist/MaterialNote/MaterialNote.types.d.ts +0 -13
- package/dist/MaterialNote/index.d.ts +0 -3
- package/dist/MaterialTitle/MaterialTitle.types.d.ts +0 -4
- package/dist/MaterialTitle/index.d.ts +0 -5
- package/dist/MediaCaption/MediaCaption.types.d.ts +0 -5
- package/dist/MediaCaption/index.d.ts +0 -3
- package/dist/Meta/Meta.mock.d.ts +0 -12
- package/dist/Meta/Meta.types.d.ts +0 -19
- package/dist/Meta/MetaContainer.d.ts +0 -3
- package/dist/Meta/index.d.ts +0 -3
- package/dist/MetaItem/MetaItem.types.d.ts +0 -7
- package/dist/MetaItem/index.d.ts +0 -3
- package/dist/MetaItemLive/MetaItemLive.types.d.ts +0 -3
- package/dist/MetaItemLive/index.d.ts +0 -3
- package/dist/Popover/Popover.types.d.ts +0 -5
- package/dist/Popover/index.d.ts +0 -3
- package/dist/QuoteBlock/QuoteBlock.types.d.ts +0 -6
- package/dist/QuoteBlock/index.d.ts +0 -3
- package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +0 -17
- package/dist/RawHtmlBlock/index.d.ts +0 -3
- package/dist/RelatedBlock/RelatedBlock.types.d.ts +0 -17
- package/dist/RelatedBlock/index.d.ts +0 -3
- package/dist/RelatedBook/RelatedBook.mock.d.ts +0 -65
- package/dist/RelatedBook/RelatedBook.types.d.ts +0 -4
- package/dist/RelatedBook/index.d.ts +0 -3
- package/dist/RelatedRichBlock/RelatedRichBlock.types.d.ts +0 -4
- package/dist/RelatedRichBlock/index.d.ts +0 -3
- package/dist/RenderBlocks/RenderBlocks.types.d.ts +0 -11
- package/dist/RenderBlocks/index.d.ts +0 -3
- package/dist/RichTitle/RichTitle.types.d.ts +0 -13
- package/dist/RichTitle/index.d.ts +0 -3
- package/dist/SensitiveBlock/SensitiveBlock.types.d.ts +0 -15
- package/dist/SensitiveBlock/index.d.ts +0 -3
- package/dist/SimpleBlock/SimpleBlock.types.d.ts +0 -4
- package/dist/SimpleBlock/index.d.ts +0 -3
- package/dist/SimpleTitle/SimpleTitle.types.d.ts +0 -9
- package/dist/SimpleTitle/index.d.ts +0 -3
- package/dist/SourceBlock/SourceBlock.types.d.ts +0 -15
- package/dist/SourceBlock/index.d.ts +0 -3
- package/dist/Spoiler/Spoiler.types.d.ts +0 -4
- package/dist/Spoiler/index.d.ts +0 -3
- package/dist/SvgSymbol/SvgSymbol.types.d.ts +0 -8
- package/dist/SvgSymbol/icons.d.ts +0 -167
- package/dist/SvgSymbol/index.d.ts +0 -3
- package/dist/Switcher/Switcher.types.d.ts +0 -12
- package/dist/Switcher/index.d.ts +0 -3
- package/dist/Table/Table.types.d.ts +0 -25
- package/dist/Table/index.d.ts +0 -3
- package/dist/Tag/Tag.types.d.ts +0 -12
- package/dist/Tag/index.d.ts +0 -3
- package/dist/Timestamp/Timestamp.types.d.ts +0 -5
- package/dist/Timestamp/index.d.ts +0 -4
- package/dist/Toolbar/Toolbar.d.ts +0 -3
- package/dist/Toolbar/Toolbar.types.d.ts +0 -8
- package/dist/Toolbar/ToolbarItem.d.ts +0 -3
- package/dist/Toolbar/index.d.ts +0 -2
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +0 -10
- package/dist/ToolbarButton/index.d.ts +0 -3
- package/dist/Tooltip/Tooltip.d.ts +0 -3
- package/dist/Tooltip/Tooltip.types.d.ts +0 -8
- package/dist/Tooltip/TooltipFooter.d.ts +0 -3
- package/dist/Tooltip/index.d.ts +0 -2
- package/dist/constants.d.ts +0 -41
- package/dist/index.d.ts +0 -45
- package/dist/types.d.ts +0 -20
- package/dist/ui-kit-2.cjs.development.js +0 -2639
- package/dist/ui-kit-2.cjs.development.js.map +0 -1
- package/dist/ui-kit-2.cjs.production.min.js +0 -2
- package/dist/ui-kit-2.cjs.production.min.js.map +0 -1
- package/dist/ui-kit-2.esm.js +0 -2585
- package/dist/ui-kit-2.esm.js.map +0 -1
- package/dist/ui-kit.css +0 -6068
- package/dist/utils/BlockContext.d.ts +0 -8
- package/dist/utils/DangerousHtml.d.ts +0 -8
- package/dist/utils/capitalizeFirstLetter.d.ts +0 -1
- package/dist/utils/converCase.d.ts +0 -2
- package/dist/utils/generateGradient.d.ts +0 -2
- package/dist/utils/getElementPositionRelativeToViewport.d.ts +0 -2
- package/dist/utils/makeClassName.d.ts +0 -3
- package/dist/utils/makeStyleContext.d.ts +0 -3
- package/dist/utils/pluralize.d.ts +0 -2
- package/dist/utils/postMessage.d.ts +0 -2
- package/dist/utils/viewportSize.d.ts +0 -6
- package/src/.DS_Store +0 -0
- package/src/Meta/Meta.mock.ts +0 -19
- package/src/RelatedBook/RelatedBook.mock.ts +0 -68
- package/src/RelatedBook/RelatedBook.module.css +0 -210
- package/src/RelatedBook/RelatedBook.stories.module.css +0 -5
- package/src/RelatedBook/RelatedBook.stories.tsx +0 -35
- package/src/RelatedBook/RelatedBook.test.tsx +0 -20
- package/src/RelatedBook/RelatedBook.types.ts +0 -4
- package/src/RelatedBook/index.tsx +0 -68
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const capitalizeFirstLetter: (string: string) => string;
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/Meta/Meta.mock.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const MetaMock = {
|
|
2
|
-
type: 'meta',
|
|
3
|
-
data: {
|
|
4
|
-
lang: 'ru',
|
|
5
|
-
components: [
|
|
6
|
-
{
|
|
7
|
-
type: 'string',
|
|
8
|
-
text: '42 страницы',
|
|
9
|
-
id: 'e19bcbc2fc5005393177a48818801a6e04e3a5e94aad52ed99f6d6addd4819e5'
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
type: 'string',
|
|
13
|
-
text: 'Сентябрь, 2023',
|
|
14
|
-
id: 'c5c779fd7088cda5667daedccd35c31e3fe70233e60941ae42965b7d1863302c'
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
id: '2-219b4aed9da90196465bd1c697b643ffffa219cbcdd325a8abcedc053c6649b0'
|
|
19
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export const RelatedBookMock = {
|
|
2
|
-
type: 'related_book',
|
|
3
|
-
data: {
|
|
4
|
-
url: 'book_landing/2023/09/13/testovyy-avtor',
|
|
5
|
-
cover: {
|
|
6
|
-
urls: {
|
|
7
|
-
w325: {
|
|
8
|
-
'1x': '//meduza.io/impro/D6driXI8j0K_j-YQVCRUQN8HW49p5I_7pDiKBiI07XI/resizing_type:fit/width:325/height:0/enlarge:1/quality:80/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.png',
|
|
9
|
-
'2x': '//meduza.io/impro/Z6f_I7RgoLm1qndCIVSeIbosuXLvb5wgQorVhzQbrTA/resizing_type:fit/width:650/height:0/enlarge:1/quality:80/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.png',
|
|
10
|
-
'1x_webp':
|
|
11
|
-
'//meduza.io/impro/SB0AN46D0ObVaIwyMv3Wj1VR0y9C2H-uSwyHkPtAbDI/resizing_type:fit/width:325/height:0/enlarge:1/quality:95/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.webp',
|
|
12
|
-
'2x_webp':
|
|
13
|
-
'//meduza.io/impro/iR5SsfQPNONtjHRLAdVPHYTpgKsyYZQWuxr4qOQ2WXo/resizing_type:fit/width:650/height:0/enlarge:1/quality:95/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.webp'
|
|
14
|
-
},
|
|
15
|
-
w600: {
|
|
16
|
-
'1x': '//meduza.io/impro/UoG3H-fSGcAX54b2btJT8HK69JHOXOCkR4nfgI5T8BE/resizing_type:fit/width:600/height:0/enlarge:1/quality:80/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.png',
|
|
17
|
-
'2x': '//meduza.io/impro/yLXyIx4_Bi9O1Gkbv-uxFIk-FmRfYR2DAZ1bpZgxlAs/resizing_type:fit/width:1200/height:0/enlarge:1/quality:80/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.png',
|
|
18
|
-
'1x_webp':
|
|
19
|
-
'//meduza.io/impro/LuunCbINkOTFj49bgrU7LfXrFqkmj6endeyG4cyao1U/resizing_type:fit/width:600/height:0/enlarge:1/quality:95/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.webp',
|
|
20
|
-
'2x_webp':
|
|
21
|
-
'//meduza.io/impro/PMsuWNtzhy6QCyOwkDXqELMZOAeSdCv_sN_lTYFaFYE/resizing_type:fit/width:1200/height:0/enlarge:1/quality:95/aHR0cHM6Ly9zZWNv/bmQubWVkdXphLmlv/L2ltYWdlL2F0dGFj/aG1lbnRzL2ltYWdl/cy8wMDQvNTYxLzg1/MS9vcmlnaW5hbC9j/bUd3ZVlRNlpmUHpJ/cnczNmdFbFRBLnBu/Zw.webp'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
blocks: [
|
|
26
|
-
{
|
|
27
|
-
type: 'tag',
|
|
28
|
-
data: {
|
|
29
|
-
text: 'Читайте также (это заг блока)',
|
|
30
|
-
theme: 'custom'
|
|
31
|
-
},
|
|
32
|
-
id: '0-12a13e7197cca39855b3f53299c6e4148bea63f4a7da0406be27c49f4b211702'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: 'rich_title',
|
|
36
|
-
data: {
|
|
37
|
-
first: 'Тестовый автор',
|
|
38
|
-
second: 'Тестовое название книги'
|
|
39
|
-
},
|
|
40
|
-
id: '1-87b217057d08b7f1a65dd75fb7a1e4e20a4119d40f7a4562fefc3591d2a02857'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: 'meta',
|
|
44
|
-
data: {
|
|
45
|
-
lang: 'ru',
|
|
46
|
-
components: [
|
|
47
|
-
{
|
|
48
|
-
type: 'string',
|
|
49
|
-
text: '300 страниц',
|
|
50
|
-
id: 'd06a9c997243be8443acd0dd1509a66dab38a112efc35f76933e9761721f88c6'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'string',
|
|
54
|
-
text: 'Сентябрь 2023',
|
|
55
|
-
id: '99a1c1c8d4da9ccb01453d01400cdcd63d989f92f8302e5ae5931e5da061cf9e'
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
id: '2-cf782d69edb4aa4fef3e01689750394759436881b849faee4021e7a421fcf251'
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
theme: {
|
|
63
|
-
background_color: '11,36,89',
|
|
64
|
-
text_color: '255,255,255'
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
id: '3-b790d1d4382de253a60ba2e36d274cdd528aa4c5c101c2901ce058f81569e9ec'
|
|
68
|
-
}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
@import '../vars.css';
|
|
2
|
-
|
|
3
|
-
.root {
|
|
4
|
-
position: relative;
|
|
5
|
-
z-index: 1;
|
|
6
|
-
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-flow: column nowrap;
|
|
9
|
-
flex-grow: 1;
|
|
10
|
-
|
|
11
|
-
width: 100%;
|
|
12
|
-
margin: 16px 0;
|
|
13
|
-
|
|
14
|
-
transition: opacity 0.2s;
|
|
15
|
-
text-decoration: none;
|
|
16
|
-
|
|
17
|
-
border-radius: 8px;
|
|
18
|
-
outline-width: 0;
|
|
19
|
-
background-color: #fff;
|
|
20
|
-
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
21
|
-
@media $portraitTablet {
|
|
22
|
-
margin: 25px 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.root:last-child {
|
|
27
|
-
margin-bottom: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.root:first-child {
|
|
31
|
-
margin-top: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.root:hover {
|
|
35
|
-
@media $landscapeTablet {
|
|
36
|
-
z-index: 10;
|
|
37
|
-
|
|
38
|
-
opacity: 0.95;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.container {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-flow: column nowrap;
|
|
45
|
-
flex-grow: 1;
|
|
46
|
-
|
|
47
|
-
border-radius: inherit;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.imageWrap {
|
|
51
|
-
position: relative;
|
|
52
|
-
|
|
53
|
-
width: 100%;
|
|
54
|
-
|
|
55
|
-
border-radius: 8px 8px 0 0;
|
|
56
|
-
|
|
57
|
-
@media $landscapeTablet {
|
|
58
|
-
min-height: 0;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.container {
|
|
63
|
-
background-color: var(--bgColor);
|
|
64
|
-
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.image {
|
|
68
|
-
position: relative;
|
|
69
|
-
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
justify-content: center;
|
|
73
|
-
|
|
74
|
-
transition: opacity 350ms ease;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.picture {
|
|
78
|
-
height: 160px;
|
|
79
|
-
|
|
80
|
-
box-shadow:
|
|
81
|
-
0 0 0 0 rgba(0, 0, 0, 0.1),
|
|
82
|
-
0 4px 8px 0 rgba(0, 0, 0, 0.1),
|
|
83
|
-
0 15px 15px 0 rgba(0, 0, 0, 0.09),
|
|
84
|
-
0 34px 20px 0 rgba(0, 0, 0, 0.05),
|
|
85
|
-
0 60px 24px 0 rgba(0, 0, 0, 0.01),
|
|
86
|
-
0 94px 26px 0 rgba(0, 0, 0, 0);
|
|
87
|
-
|
|
88
|
-
@media $landscapeTablet {
|
|
89
|
-
height: 200px;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.picture img {
|
|
94
|
-
display: block;
|
|
95
|
-
|
|
96
|
-
width: auto;
|
|
97
|
-
height: 100%;
|
|
98
|
-
|
|
99
|
-
object-fit: contain;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.tag {
|
|
103
|
-
display: flex;
|
|
104
|
-
|
|
105
|
-
margin-bottom: 6px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.contentWrap {
|
|
109
|
-
z-index: 1;
|
|
110
|
-
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
flex-grow: 1;
|
|
114
|
-
|
|
115
|
-
width: 100%;
|
|
116
|
-
padding: 0 15px;
|
|
117
|
-
|
|
118
|
-
@media $landscapeTablet {
|
|
119
|
-
padding: 0 15px;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.contentWrap {
|
|
124
|
-
@media $landscapeTablet {
|
|
125
|
-
justify-content: flex-end;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.content {
|
|
130
|
-
display: flex;
|
|
131
|
-
flex-direction: column;
|
|
132
|
-
flex-grow: 1;
|
|
133
|
-
|
|
134
|
-
padding: $gapSmall 0;
|
|
135
|
-
|
|
136
|
-
@media $landscapeTablet {
|
|
137
|
-
justify-content: flex-end;
|
|
138
|
-
|
|
139
|
-
padding: 15px 0;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.title {
|
|
144
|
-
max-width: 770px;
|
|
145
|
-
margin-bottom: 12px;
|
|
146
|
-
|
|
147
|
-
@media $mobile {
|
|
148
|
-
width: 100%;
|
|
149
|
-
min-width: 0;
|
|
150
|
-
margin-bottom: 15px;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.footer {
|
|
155
|
-
margin-top: auto;
|
|
156
|
-
|
|
157
|
-
color: #757575;
|
|
158
|
-
|
|
159
|
-
line-height: 14px;
|
|
160
|
-
|
|
161
|
-
fill: currentColor;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.imageWrap {
|
|
165
|
-
padding-top: 50px;
|
|
166
|
-
padding-bottom: 50px;
|
|
167
|
-
|
|
168
|
-
@media $landscapeTablet {
|
|
169
|
-
position: static;
|
|
170
|
-
|
|
171
|
-
flex-shrink: 0;
|
|
172
|
-
|
|
173
|
-
padding-top: 40px;
|
|
174
|
-
padding-bottom: 40px;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.content {
|
|
179
|
-
flex-shrink: 0;
|
|
180
|
-
|
|
181
|
-
padding-top: 0;
|
|
182
|
-
|
|
183
|
-
@media $landscapeTablet {
|
|
184
|
-
flex-grow: 0;
|
|
185
|
-
justify-content: flex-end;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.center {
|
|
190
|
-
width: 100%;
|
|
191
|
-
max-width: 650px;
|
|
192
|
-
margin-right: auto;
|
|
193
|
-
margin-left: auto;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.isLight .content {
|
|
197
|
-
color: #fff;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.isDark .content {
|
|
201
|
-
--tagColor: rgba(0, 0, 0, 0.6);
|
|
202
|
-
--metaText: rgba(0, 0, 0, 0.6);
|
|
203
|
-
--metaFill: currentColor;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.isLight .content {
|
|
207
|
-
--tagColor: rgba(254, 255, 255, 0.5);
|
|
208
|
-
--metaText: rgba(254, 255, 255, 0.5);
|
|
209
|
-
--metaFill: currentColor;
|
|
210
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { RelatedBook } from './'
|
|
3
|
-
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
4
|
-
|
|
5
|
-
import styles from './RelatedBook.stories.module.css'
|
|
6
|
-
import { RelatedBookMock } from './RelatedBook.mock'
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Main / RelatedBook',
|
|
10
|
-
component: RelatedBook,
|
|
11
|
-
parameters: {
|
|
12
|
-
themeWrapperSideBySide: true
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Example: React.FC = () => {
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<div className={styles.root}>
|
|
20
|
-
<RelatedBook block={RelatedBookMock} styleContext={['center']} />
|
|
21
|
-
</div>
|
|
22
|
-
</>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const Default: React.FC = () => (
|
|
27
|
-
<>
|
|
28
|
-
<PreviewWrapper theme="light">
|
|
29
|
-
<Example />
|
|
30
|
-
</PreviewWrapper>
|
|
31
|
-
<PreviewWrapper theme="dark">
|
|
32
|
-
<Example />
|
|
33
|
-
</PreviewWrapper>
|
|
34
|
-
</>
|
|
35
|
-
)
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { render } from '@testing-library/react'
|
|
3
|
-
import { RelatedBook } from './'
|
|
4
|
-
import { RelatedBookProps } from './RelatedBook.types'
|
|
5
|
-
|
|
6
|
-
import styles from './RelatedBook.module.css'
|
|
7
|
-
|
|
8
|
-
describe('RelatedBook', () => {
|
|
9
|
-
let props: RelatedBookProps
|
|
10
|
-
|
|
11
|
-
const renderComponent = () => render(<RelatedBook {...props} />)
|
|
12
|
-
|
|
13
|
-
it('should have root style', () => {
|
|
14
|
-
const { getByTestId } = renderComponent()
|
|
15
|
-
|
|
16
|
-
const relatedBook = getByTestId('related-book')
|
|
17
|
-
|
|
18
|
-
expect(relatedBook).toHaveClass(styles.root)
|
|
19
|
-
})
|
|
20
|
-
})
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { RelatedBookProps } from './RelatedBook.types'
|
|
3
|
-
import makeClassName, { ClassNames } from '../utils/makeClassName'
|
|
4
|
-
import { Link } from 'react-router-dom'
|
|
5
|
-
|
|
6
|
-
import styles from './RelatedBook.module.css'
|
|
7
|
-
import { RenderBlocks } from '../RenderBlocks'
|
|
8
|
-
import { Image } from '../Image'
|
|
9
|
-
import makeStyleContext from '../utils/makeStyleContext'
|
|
10
|
-
|
|
11
|
-
export const RelatedBook: React.FC<RelatedBookProps> = ({
|
|
12
|
-
block,
|
|
13
|
-
styleContext
|
|
14
|
-
}) => {
|
|
15
|
-
const theme = block.data.theme.text_color === '0,0,0' ? 'isDark' : 'isLight'
|
|
16
|
-
|
|
17
|
-
let classNames: ClassNames = [
|
|
18
|
-
[styles.root, true],
|
|
19
|
-
[styles[theme], theme],
|
|
20
|
-
[
|
|
21
|
-
styles[block.data.onlyOn],
|
|
22
|
-
!!block.data.onlyOn && !!styles[block.data.onlyOn]
|
|
23
|
-
]
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
if (styleContext) {
|
|
27
|
-
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const cssProps = {
|
|
31
|
-
'--bgColor': `rgb(${block.data.theme.background_color || '0, 0, 0'})`
|
|
32
|
-
} as React.CSSProperties
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<Link
|
|
36
|
-
to={`/${block.data.url}`}
|
|
37
|
-
className={makeClassName(classNames)}
|
|
38
|
-
style={cssProps}
|
|
39
|
-
>
|
|
40
|
-
<div className={styles.container}>
|
|
41
|
-
<div className={styles.imageWrap}>
|
|
42
|
-
<div className={styles.image}>
|
|
43
|
-
<picture className={styles.picture}>
|
|
44
|
-
<Image
|
|
45
|
-
optimized={block.data.cover.urls}
|
|
46
|
-
ratio={0}
|
|
47
|
-
display="narrow"
|
|
48
|
-
styleContext={['isStatic']}
|
|
49
|
-
lazy={true}
|
|
50
|
-
/>
|
|
51
|
-
</picture>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<div className={styles.contentWrap}>
|
|
55
|
-
<div className={styles.content}>
|
|
56
|
-
{block.data.blocks.map((item) => (
|
|
57
|
-
<RenderBlocks
|
|
58
|
-
key={item.id}
|
|
59
|
-
block={item}
|
|
60
|
-
styleContext={['isInMediaBlock', 'isInBookRelated', 'isCustom']}
|
|
61
|
-
/>
|
|
62
|
-
))}
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</Link>
|
|
67
|
-
)
|
|
68
|
-
}
|