@meduza/ui-kit-2 0.1.8 → 0.1.10
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/dist/Footnote/Footnote.stories.d.ts +10 -0
- package/dist/Footnote/Footnote.types.d.ts +5 -0
- package/dist/Footnote/index.d.ts +3 -0
- package/dist/Image/Image.types.d.ts +2 -2
- package/dist/MaterialNote/MaterialNote.stories.d.ts +2 -1
- package/dist/MaterialNote/MaterialNote.types.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/ui-kit-2.cjs.development.js +238 -210
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +238 -211
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +684 -577
- package/dist/utils/makeClassName.d.ts +2 -1
- package/dist/utils/makeStyleContext.d.ts +2 -1
- package/package.json +12 -4
- package/src/BookmarkButton/BookmarkButton.stories.tsx +1 -1
- package/src/BookmarkButton/index.tsx +2 -4
- package/src/Button/Button.stories.tsx +2 -2
- package/src/Button/Button.test.tsx +3 -3
- package/src/Button/index.tsx +3 -3
- package/src/CardTitle/CardTitle.stories.tsx +1 -1
- package/src/CardTitle/CardTitle.test.tsx +1 -1
- package/src/CardTitle/index.tsx +1 -2
- package/src/ChapterBlock/ChapterBlock.stories.tsx +1 -1
- package/src/ChapterBlock/ChapterBlock.test.tsx +1 -1
- package/src/ChapterBlock/index.tsx +1 -2
- package/src/Cover/Cover.stories.tsx +1 -1
- package/src/Cover/Cover.test.tsx +1 -1
- package/src/Cover/index.tsx +5 -6
- package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +1 -1
- package/src/DocumentItemsCount/DocumentItemsCount.test.tsx +1 -1
- package/src/DocumentItemsCount/index.tsx +0 -1
- package/src/DotsOnImage/DotsOnImage.module.css +13 -9
- package/src/DotsOnImage/DotsOnImage.stories.tsx +1 -1
- package/src/DotsOnImage/DotsOnImage.test.tsx +2 -1
- package/src/DotsOnImage/index.tsx +29 -17
- package/src/DotsOnImage/mock.json +4 -4
- package/src/Dropdown/index.tsx +2 -2
- package/src/EmbedBlock/EmbedBlock.module.css +1 -1
- package/src/EmbedBlock/EmbedBlock.stories.tsx +2 -2
- package/src/EmbedBlock/EmbedBlock.test.tsx +1 -1
- package/src/EmbedBlock/EmbedBlock.tsx +3 -8
- package/src/EmbedBlock/EmbedGif.tsx +0 -3
- package/src/EmbedBlock/IframeBlock.tsx +0 -1
- package/src/EmbedBlock/index.tsx +0 -1
- package/src/Footnote/Footnote.module.css +70 -0
- package/src/Footnote/Footnote.stories.module.css +5 -0
- package/src/Footnote/Footnote.stories.tsx +43 -0
- package/src/Footnote/Footnote.test.tsx +20 -0
- package/src/Footnote/Footnote.types.ts +5 -0
- package/src/Footnote/index.tsx +26 -0
- package/src/GroupedBlock/GroupedBlock.stories.tsx +1 -1
- package/src/GroupedBlock/GroupedBlock.test.tsx +1 -1
- package/src/GroupedBlock/index.tsx +4 -6
- package/src/HalfBlock/HalfBlock.stories.tsx +1 -1
- package/src/HalfBlock/HalfBlock.test.tsx +1 -1
- package/src/HalfBlock/index.tsx +3 -5
- package/src/Image/Image.stories.tsx +1 -1
- package/src/Image/Image.test.tsx +1 -1
- package/src/Image/Image.types.ts +2 -2
- package/src/Image/RenderPicture.tsx +1 -2
- package/src/Image/index.tsx +1 -4
- package/src/ImportantLead/ImportantLead.stories.tsx +1 -1
- package/src/ImportantLead/ImportantLead.test.tsx +1 -1
- package/src/ImportantLead/index.tsx +3 -5
- package/src/Lazy/Lazy.stories.tsx +3 -2
- package/src/Lazy/Lazy.test.tsx +1 -1
- package/src/Lazy/index.tsx +2 -4
- package/src/ListBlock/ListBlock.stories.tsx +2 -2
- package/src/ListBlock/ListBlock.test.tsx +1 -1
- package/src/ListBlock/index.tsx +2 -3
- package/src/MaterialNote/MaterialNote.stories.tsx +4 -3
- package/src/MaterialNote/MaterialNote.test.tsx +1 -1
- package/src/MaterialNote/MaterialNote.types.ts +2 -1
- package/src/MaterialNote/index.tsx +3 -3
- package/src/MaterialTitle/MaterialTitle.stories.tsx +1 -1
- package/src/MaterialTitle/MaterialTitle.test.tsx +1 -1
- package/src/MediaCaption/MediaCaption.stories.tsx +1 -1
- package/src/MediaCaption/MediaCaption.test.tsx +1 -1
- package/src/MediaCaption/index.tsx +2 -2
- package/src/Meta/Meta.stories.tsx +1 -1
- package/src/Meta/Meta.test.tsx +1 -1
- package/src/Meta/MetaContainer.tsx +2 -4
- package/src/Meta/index.tsx +2 -3
- package/src/MetaItem/MetaItem.stories.tsx +2 -2
- package/src/MetaItem/MetaItem.test.tsx +1 -1
- package/src/MetaItem/index.tsx +1 -3
- package/src/MetaItemLive/MetaItemLive.stories.tsx +2 -2
- package/src/MetaItemLive/MetaItemLive.test.tsx +1 -1
- package/src/MetaItemLive/index.tsx +1 -3
- package/src/Popover/Popover.module.css +36 -2
- package/src/Popover/Popover.stories.tsx +1 -1
- package/src/Popover/Popover.test.tsx +1 -1
- package/src/Popover/index.tsx +2 -3
- package/src/QuoteBlock/QuoteBlock.stories.tsx +1 -1
- package/src/QuoteBlock/QuoteBlock.test.tsx +1 -1
- package/src/QuoteBlock/index.tsx +2 -3
- package/src/RawHtmlBlock/RawHtmlBlock.stories.tsx +2 -2
- package/src/RawHtmlBlock/RawHtmlBlock.test.tsx +1 -1
- package/src/RawHtmlBlock/index.tsx +0 -2
- package/src/RelatedBlock/RelatedBlock.stories.tsx +1 -1
- package/src/RelatedBlock/RelatedBlock.test.tsx +1 -1
- package/src/RelatedBlock/index.tsx +2 -3
- package/src/RenderBlocks/RenderBlocks.stories.tsx +1 -1
- package/src/RenderBlocks/RenderBlocks.test.tsx +1 -1
- package/src/RenderBlocks/index.tsx +0 -1
- package/src/RichTitle/RichTitle.stories.tsx +1 -1
- package/src/RichTitle/RichTitle.test.tsx +1 -1
- package/src/RichTitle/index.tsx +2 -3
- package/src/SimpleBlock/FootnoteLink.css +7 -0
- package/src/SimpleBlock/SimpleBlock.stories.tsx +2 -2
- package/src/SimpleBlock/SimpleBlock.test.tsx +1 -1
- package/src/SimpleBlock/index.tsx +2 -3
- package/src/SimpleTitle/SimpleTitle.stories.tsx +1 -1
- package/src/SimpleTitle/SimpleTitle.test.tsx +1 -1
- package/src/SimpleTitle/index.tsx +2 -2
- package/src/SourceBlock/SourceBlock.stories.tsx +6 -6
- package/src/SourceBlock/SourceBlock.test.tsx +1 -1
- package/src/SourceBlock/index.tsx +6 -4
- package/src/SourceBlock/mock.json +15 -0
- package/src/Spoiler/Spoiler.stories.tsx +1 -1
- package/src/Spoiler/Spoiler.test.tsx +1 -1
- package/src/Spoiler/index.tsx +4 -5
- package/src/SvgSymbol/SvgSymbol.stories.tsx +6 -6
- package/src/SvgSymbol/SvgSymbol.test.tsx +1 -1
- package/src/SvgSymbol/index.tsx +2 -2
- package/src/Switcher/Switcher.stories.tsx +4 -4
- package/src/Switcher/Switcher.test.tsx +1 -1
- package/src/Switcher/index.tsx +1 -2
- package/src/Table/Table.stories.tsx +1 -1
- package/src/Table/Table.test.tsx +1 -1
- package/src/Table/index.tsx +2 -2
- package/src/Tag/Tag.stories.tsx +1 -3
- package/src/Tag/Tag.test.tsx +4 -4
- package/src/Tag/index.tsx +2 -2
- package/src/Timestamp/Timestamp.stories.tsx +1 -1
- package/src/Timestamp/Timestamp.test.tsx +1 -1
- package/src/Timestamp/index.tsx +0 -2
- package/src/Toolbar/Toolbar.stories.tsx +0 -1
- package/src/Toolbar/Toolbar.test.tsx +1 -1
- package/src/Toolbar/index.tsx +2 -3
- package/src/ToolbarButton/ToolbarButton.stories.tsx +2 -2
- package/src/ToolbarButton/ToolbarButton.test.tsx +1 -1
- package/src/ToolbarButton/index.tsx +2 -3
- package/src/_storybook/PreviewWrapper/index.tsx +1 -1
- package/src/index.tsx +1 -0
- package/src/utils/DangerousHtml.tsx +5 -7
- package/src/utils/generateGradient.ts +1 -1
- package/src/utils/makeClassName.ts +3 -1
- package/src/utils/makeStyleContext.ts +8 -4
- package/src/utils/toCamel.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
2
|
import { MetaItemLive } from './'
|
|
4
|
-
import { PreviewWrapper } from '_storybook/PreviewWrapper'
|
|
3
|
+
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
4
|
+
|
|
5
5
|
import styles from './MetaItemLive.stories.module.css'
|
|
6
6
|
|
|
7
7
|
export default {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { MetaItemLiveProps } from './MetaItemLive.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
5
|
-
|
|
3
|
+
import { makeClassName } from '../utils/makeClassName'
|
|
6
4
|
import styles from './MetaItemLive.module.css'
|
|
7
5
|
|
|
8
6
|
export const MetaItemLive: React.FC<MetaItemLiveProps> = ({
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
width: 100%;
|
|
14
14
|
height: 100%;
|
|
15
15
|
min-height: 120px;
|
|
16
|
-
padding: 10px
|
|
16
|
+
padding: 10px 0 0;
|
|
17
17
|
|
|
18
18
|
animation: fadeOut 250ms ease both 100ms;
|
|
19
19
|
|
|
20
20
|
opacity: 1;
|
|
21
|
+
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
line-height: 22px;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
.root.visible {
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
max-width: 420px;
|
|
45
48
|
min-height: 80px;
|
|
46
49
|
margin: 0 auto;
|
|
47
|
-
padding:
|
|
50
|
+
padding: 22px 20px 28px;
|
|
48
51
|
|
|
49
52
|
animation: disappear 350ms ease both;
|
|
50
53
|
}
|
|
@@ -97,6 +100,37 @@
|
|
|
97
100
|
animation: appear 350ms ease both;
|
|
98
101
|
}
|
|
99
102
|
|
|
103
|
+
.body {
|
|
104
|
+
font-family: $secondaryFont;
|
|
105
|
+
font-size: 16px;
|
|
106
|
+
line-height: 22px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.body h3 {
|
|
110
|
+
margin: 0 0 5px;
|
|
111
|
+
|
|
112
|
+
font-size: inherit;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
line-height: inherit;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.body p {
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.body p + p {
|
|
122
|
+
margin-top: 6px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.body a {
|
|
126
|
+
color: inherit;
|
|
127
|
+
box-shadow: inset 0 -1px $gold;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.body a:hover {
|
|
131
|
+
color: $gold;
|
|
132
|
+
}
|
|
133
|
+
|
|
100
134
|
@keyframes appear {
|
|
101
135
|
0% {
|
|
102
136
|
transform: translateY(100%);
|
package/src/Popover/index.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { PopoverProps } from './Popover.types'
|
|
3
|
-
import makeClassName from '../utils/makeClassName'
|
|
4
|
-
|
|
3
|
+
import { makeClassName } from '../utils/makeClassName'
|
|
5
4
|
import styles from './Popover.module.css'
|
|
6
5
|
|
|
7
6
|
export const Popover: React.FC<PopoverProps> = ({ children, onClose }) => {
|
|
@@ -71,7 +70,7 @@ export const Popover: React.FC<PopoverProps> = ({ children, onClose }) => {
|
|
|
71
70
|
height="100%"
|
|
72
71
|
/>
|
|
73
72
|
</svg>
|
|
74
|
-
{children}
|
|
73
|
+
<div className={styles.body}>{children}</div>
|
|
75
74
|
</div>
|
|
76
75
|
</div>
|
|
77
76
|
)
|
package/src/QuoteBlock/index.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { QuoteBlockProps } from './QuoteBlock.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
5
|
|
|
7
6
|
import styles from './QuoteBlock.module.css'
|
|
@@ -10,7 +9,7 @@ export const QuoteBlock: React.FC<QuoteBlockProps> = ({
|
|
|
10
9
|
block: { data },
|
|
11
10
|
styleContext
|
|
12
11
|
}) => {
|
|
13
|
-
let classNames:
|
|
12
|
+
let classNames: ClassNames = [[styles.root, true]]
|
|
14
13
|
|
|
15
14
|
if (styleContext) {
|
|
16
15
|
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
2
|
import { RawHtmlBlock } from './'
|
|
4
3
|
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
4
|
+
|
|
5
5
|
import styles from './RawHtmlBlock.stories.module.css'
|
|
6
6
|
|
|
7
7
|
import mock from './mock.json'
|
|
@@ -18,7 +18,7 @@ const Example: React.FC = () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<>
|
|
20
20
|
<div className={styles.root}>
|
|
21
|
-
{mock.blocks.map(item => (
|
|
21
|
+
{mock.blocks.map((item) => (
|
|
22
22
|
<RawHtmlBlock block={item} key={item.id} lightBox={null} />
|
|
23
23
|
))}
|
|
24
24
|
</div>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { RawHtmlBlockProps } from './RawHtmlBlock.types'
|
|
3
|
-
|
|
4
3
|
import { ImportantLead } from '../ImportantLead'
|
|
5
4
|
import { RenderBlocks } from '../RenderBlocks'
|
|
6
5
|
import { Spoiler } from '../Spoiler'
|
|
7
6
|
import { HalfBlock } from '../HalfBlock'
|
|
8
7
|
import { Cover } from '../Cover'
|
|
9
|
-
|
|
10
8
|
import { BlockProvider } from '../utils/BlockContext'
|
|
11
9
|
|
|
12
10
|
export const RawHtmlBlock: React.FC<RawHtmlBlockProps> = ({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { RelatedBlockProps } from './RelatedBlock.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
5
|
|
|
7
6
|
import styles from './RelatedBlock.module.css'
|
|
@@ -13,7 +12,7 @@ export const RelatedBlock: React.FC<RelatedBlockProps> = ({
|
|
|
13
12
|
},
|
|
14
13
|
styleContext
|
|
15
14
|
}) => {
|
|
16
|
-
let classNames:
|
|
15
|
+
let classNames: ClassNames = [
|
|
17
16
|
[styles.root, true],
|
|
18
17
|
[styles[onlyOn], true]
|
|
19
18
|
]
|
package/src/RichTitle/index.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { RichTitleProps } from './RichTitle.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
5
|
|
|
7
6
|
import styles from './RichTitle.module.css'
|
|
@@ -13,7 +12,7 @@ export const RichTitle: React.FC<RichTitleProps> = ({
|
|
|
13
12
|
},
|
|
14
13
|
styleContext
|
|
15
14
|
}) => {
|
|
16
|
-
let classNames:
|
|
15
|
+
let classNames: ClassNames = [
|
|
17
16
|
[styles.root, true],
|
|
18
17
|
[styles[onlyOn], true],
|
|
19
18
|
[styles.featured, !!featured]
|
|
@@ -32,3 +32,10 @@ span[data-body]:hover {
|
|
|
32
32
|
background-color: #5B5B5B;
|
|
33
33
|
box-shadow: inset 1px 0 #747474, inset 0 1px #747474, inset -1px 0 #747474, inset 0 -1px #747474;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
span[data-highlight='true'],
|
|
37
|
+
span[data-highlight='true']:hover {
|
|
38
|
+
background-color: #f4efe9;
|
|
39
|
+
box-shadow: inset 1px 0 #b88b58, inset 0 1px #b88b58, inset -1px 0 #b88b58,
|
|
40
|
+
inset 0 -1px #b88b58;
|
|
41
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
2
|
import { SimpleBlock } from './'
|
|
4
3
|
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
4
|
+
|
|
5
5
|
import styles from './SimpleBlock.stories.module.css'
|
|
6
6
|
|
|
7
7
|
import mock from './mock.json'
|
|
@@ -18,7 +18,7 @@ const Example: React.FC = () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<>
|
|
20
20
|
<div className={styles.root}>
|
|
21
|
-
{mock.blocks.map(item => (
|
|
21
|
+
{mock.blocks.map((item) => (
|
|
22
22
|
<SimpleBlock
|
|
23
23
|
block={item}
|
|
24
24
|
key={item.id}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { SimpleBlockProps } from './SimpleBlock.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
5
|
|
|
7
6
|
import styles from './SimpleBlock.module.css'
|
|
@@ -12,7 +11,7 @@ export const SimpleBlock: React.FC<SimpleBlockProps> = ({
|
|
|
12
11
|
}) => {
|
|
13
12
|
let TagName
|
|
14
13
|
|
|
15
|
-
let classNames:
|
|
14
|
+
let classNames: ClassNames = [
|
|
16
15
|
[styles[type], !!type && !!styles[type]],
|
|
17
16
|
[styles[onlyOn], true]
|
|
18
17
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { SimpleTitleProps } from './SimpleTitle.types'
|
|
3
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
4
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
5
5
|
|
|
6
6
|
import styles from './SimpleTitle.module.css'
|
|
@@ -12,7 +12,7 @@ export const SimpleTitle: React.FC<SimpleTitleProps> = ({
|
|
|
12
12
|
},
|
|
13
13
|
styleContext
|
|
14
14
|
}) => {
|
|
15
|
-
let classNames:
|
|
15
|
+
let classNames: ClassNames = [
|
|
16
16
|
[styles.root, true],
|
|
17
17
|
[styles[onlyOn], true]
|
|
18
18
|
]
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
2
|
import { SourceBlock } from './'
|
|
4
3
|
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
4
|
+
|
|
5
5
|
import styles from './SourceBlock.stories.module.css'
|
|
6
6
|
|
|
7
|
+
import mock from './mock.json'
|
|
8
|
+
|
|
7
9
|
export default {
|
|
8
10
|
title: 'Main / SourceBlock',
|
|
9
11
|
component: SourceBlock,
|
|
@@ -14,11 +16,9 @@ export default {
|
|
|
14
16
|
|
|
15
17
|
const Example: React.FC = () => {
|
|
16
18
|
return (
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
</div>
|
|
21
|
-
</>
|
|
19
|
+
<div className={styles.root}>
|
|
20
|
+
<SourceBlock block={mock} />
|
|
21
|
+
</div>
|
|
22
22
|
)
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { SourceBlockProps } from './SourceBlock.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
5
|
|
|
7
6
|
import styles from './SourceBlock.module.css'
|
|
8
7
|
|
|
9
8
|
export const SourceBlock: React.FC<SourceBlockProps> = ({
|
|
10
|
-
block: {
|
|
9
|
+
block: {
|
|
10
|
+
only_on: onlyOn,
|
|
11
|
+
data: { quote, origin, url }
|
|
12
|
+
},
|
|
11
13
|
styleContext
|
|
12
14
|
}) => {
|
|
13
|
-
let classNames:
|
|
15
|
+
let classNames: ClassNames = [
|
|
14
16
|
[styles.root, true],
|
|
15
17
|
[styles[onlyOn], true]
|
|
16
18
|
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "source",
|
|
3
|
+
"data": {
|
|
4
|
+
"quote": [
|
|
5
|
+
{
|
|
6
|
+
"type": "p",
|
|
7
|
+
"data": "«В свое время, в 1990-е, потребительская корзина позиционировалась как временная, кризисная мера. Полагали, что мы через короткое время сможем отказаться от этого подхода и перейти к определению бедности через медианные доходы граждан. Но мы прожили с этой временной мерой почти четверть века», — отмечает глава НИИ труда Дмитрий Платыгин.",
|
|
8
|
+
"length": 339
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"origin": "Коммерсант",
|
|
12
|
+
"url": "https://www.kommersant.ru/doc/4502584?from=main_1"
|
|
13
|
+
},
|
|
14
|
+
"id": "4-072f3b4143d3377d533e198d3ea1ac263959a79a114e81104ecb4ab02b3996e5"
|
|
15
|
+
}
|
package/src/Spoiler/index.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { useState, useRef } from 'react'
|
|
2
2
|
import { SpoilerProps } from './Spoiler.types'
|
|
3
|
-
|
|
4
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
4
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
6
|
-
import postMessage from '../utils/postMessage'
|
|
7
5
|
|
|
6
|
+
import postMessage from '../utils/postMessage'
|
|
8
7
|
import { RenderBlocks } from '../RenderBlocks'
|
|
9
8
|
import { Button } from '../Button'
|
|
10
9
|
import { SvgSymbol } from '../SvgSymbol'
|
|
@@ -39,7 +38,7 @@ export const Spoiler: React.FC<SpoilerProps> = ({
|
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
let classNames:
|
|
41
|
+
let classNames: ClassNames = [
|
|
43
42
|
[styles.root, true],
|
|
44
43
|
[styles[onlyOn], !!onlyOn],
|
|
45
44
|
[styles[display], !!display && styles[display]],
|
|
@@ -57,7 +56,7 @@ export const Spoiler: React.FC<SpoilerProps> = ({
|
|
|
57
56
|
<div ref={ref} className={makeClassName(classNames)} data-testid="spoiler">
|
|
58
57
|
<div className={styles.header}>{title && <h3>{title}</h3>}</div>
|
|
59
58
|
<div className={styles.body}>
|
|
60
|
-
{blocks.map(item => (
|
|
59
|
+
{blocks.map((item) => (
|
|
61
60
|
<RenderBlocks
|
|
62
61
|
key={item.id}
|
|
63
62
|
block={item}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
2
|
import { SvgSymbol } from './'
|
|
4
3
|
import { PreviewWrapper } from '../_storybook/PreviewWrapper'
|
|
5
|
-
import styles from './SvgSymbol.stories.module.css'
|
|
6
4
|
import { Icons } from './SvgSymbol.types'
|
|
7
5
|
|
|
6
|
+
import styles from './SvgSymbol.stories.module.css'
|
|
7
|
+
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Main / SvgSymbol',
|
|
10
10
|
component: SvgSymbol,
|
|
@@ -46,7 +46,7 @@ const Example: React.FC = () => {
|
|
|
46
46
|
<div className={styles.root}>
|
|
47
47
|
<h2>Кнопки соц. сетей и реакций</h2>
|
|
48
48
|
<div className={styles.row}>
|
|
49
|
-
{social.map(icon => (
|
|
49
|
+
{social.map((icon) => (
|
|
50
50
|
<span title={icon} key={`iconName-${icon}`} className={styles.icon}>
|
|
51
51
|
<SvgSymbol icon={icon} size="medium" />
|
|
52
52
|
</span>
|
|
@@ -55,7 +55,7 @@ const Example: React.FC = () => {
|
|
|
55
55
|
|
|
56
56
|
<h2>Мета</h2>
|
|
57
57
|
<div className={styles.row}>
|
|
58
|
-
{meta.map(icon => (
|
|
58
|
+
{meta.map((icon) => (
|
|
59
59
|
<span title={icon} key={`iconName-${icon}`} className={styles.icon}>
|
|
60
60
|
<SvgSymbol icon={icon} size="medium" />
|
|
61
61
|
</span>
|
|
@@ -64,7 +64,7 @@ const Example: React.FC = () => {
|
|
|
64
64
|
|
|
65
65
|
<h2>Плеер</h2>
|
|
66
66
|
<div className={styles.row}>
|
|
67
|
-
{podcast.map(icon => (
|
|
67
|
+
{podcast.map((icon) => (
|
|
68
68
|
<span title={icon} key={`iconName-${icon}`} className={styles.icon}>
|
|
69
69
|
<SvgSymbol icon={icon} size="medium" />
|
|
70
70
|
</span>
|
|
@@ -73,7 +73,7 @@ const Example: React.FC = () => {
|
|
|
73
73
|
|
|
74
74
|
<h2>Другие</h2>
|
|
75
75
|
<div className={styles.row}>
|
|
76
|
-
{other.map(icon => (
|
|
76
|
+
{other.map((icon) => (
|
|
77
77
|
<span title={icon} key={`iconName-${icon}`} className={styles.icon}>
|
|
78
78
|
<SvgSymbol icon={icon} size="medium" />
|
|
79
79
|
</span>
|
package/src/SvgSymbol/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { SvgSymbolProps } from './SvgSymbol.types'
|
|
3
|
-
import makeClassName from '../utils/makeClassName'
|
|
3
|
+
import { makeClassName } from '../utils/makeClassName'
|
|
4
|
+
import { icons } from './icons'
|
|
4
5
|
|
|
5
6
|
import styles from './SvgSymbol.module.css'
|
|
6
|
-
import { icons } from './icons'
|
|
7
7
|
|
|
8
8
|
export const SvgSymbol: React.FC<SvgSymbolProps> = ({
|
|
9
9
|
icon,
|