@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.
Files changed (153) hide show
  1. package/dist/Footnote/Footnote.stories.d.ts +10 -0
  2. package/dist/Footnote/Footnote.types.d.ts +5 -0
  3. package/dist/Footnote/index.d.ts +3 -0
  4. package/dist/Image/Image.types.d.ts +2 -2
  5. package/dist/MaterialNote/MaterialNote.stories.d.ts +2 -1
  6. package/dist/MaterialNote/MaterialNote.types.d.ts +2 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/ui-kit-2.cjs.development.js +238 -210
  9. package/dist/ui-kit-2.cjs.development.js.map +1 -1
  10. package/dist/ui-kit-2.cjs.production.min.js +1 -1
  11. package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
  12. package/dist/ui-kit-2.esm.js +238 -211
  13. package/dist/ui-kit-2.esm.js.map +1 -1
  14. package/dist/ui-kit.css +684 -577
  15. package/dist/utils/makeClassName.d.ts +2 -1
  16. package/dist/utils/makeStyleContext.d.ts +2 -1
  17. package/package.json +12 -4
  18. package/src/BookmarkButton/BookmarkButton.stories.tsx +1 -1
  19. package/src/BookmarkButton/index.tsx +2 -4
  20. package/src/Button/Button.stories.tsx +2 -2
  21. package/src/Button/Button.test.tsx +3 -3
  22. package/src/Button/index.tsx +3 -3
  23. package/src/CardTitle/CardTitle.stories.tsx +1 -1
  24. package/src/CardTitle/CardTitle.test.tsx +1 -1
  25. package/src/CardTitle/index.tsx +1 -2
  26. package/src/ChapterBlock/ChapterBlock.stories.tsx +1 -1
  27. package/src/ChapterBlock/ChapterBlock.test.tsx +1 -1
  28. package/src/ChapterBlock/index.tsx +1 -2
  29. package/src/Cover/Cover.stories.tsx +1 -1
  30. package/src/Cover/Cover.test.tsx +1 -1
  31. package/src/Cover/index.tsx +5 -6
  32. package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +1 -1
  33. package/src/DocumentItemsCount/DocumentItemsCount.test.tsx +1 -1
  34. package/src/DocumentItemsCount/index.tsx +0 -1
  35. package/src/DotsOnImage/DotsOnImage.module.css +13 -9
  36. package/src/DotsOnImage/DotsOnImage.stories.tsx +1 -1
  37. package/src/DotsOnImage/DotsOnImage.test.tsx +2 -1
  38. package/src/DotsOnImage/index.tsx +29 -17
  39. package/src/DotsOnImage/mock.json +4 -4
  40. package/src/Dropdown/index.tsx +2 -2
  41. package/src/EmbedBlock/EmbedBlock.module.css +1 -1
  42. package/src/EmbedBlock/EmbedBlock.stories.tsx +2 -2
  43. package/src/EmbedBlock/EmbedBlock.test.tsx +1 -1
  44. package/src/EmbedBlock/EmbedBlock.tsx +3 -8
  45. package/src/EmbedBlock/EmbedGif.tsx +0 -3
  46. package/src/EmbedBlock/IframeBlock.tsx +0 -1
  47. package/src/EmbedBlock/index.tsx +0 -1
  48. package/src/Footnote/Footnote.module.css +70 -0
  49. package/src/Footnote/Footnote.stories.module.css +5 -0
  50. package/src/Footnote/Footnote.stories.tsx +43 -0
  51. package/src/Footnote/Footnote.test.tsx +20 -0
  52. package/src/Footnote/Footnote.types.ts +5 -0
  53. package/src/Footnote/index.tsx +26 -0
  54. package/src/GroupedBlock/GroupedBlock.stories.tsx +1 -1
  55. package/src/GroupedBlock/GroupedBlock.test.tsx +1 -1
  56. package/src/GroupedBlock/index.tsx +4 -6
  57. package/src/HalfBlock/HalfBlock.stories.tsx +1 -1
  58. package/src/HalfBlock/HalfBlock.test.tsx +1 -1
  59. package/src/HalfBlock/index.tsx +3 -5
  60. package/src/Image/Image.stories.tsx +1 -1
  61. package/src/Image/Image.test.tsx +1 -1
  62. package/src/Image/Image.types.ts +2 -2
  63. package/src/Image/RenderPicture.tsx +1 -2
  64. package/src/Image/index.tsx +1 -4
  65. package/src/ImportantLead/ImportantLead.stories.tsx +1 -1
  66. package/src/ImportantLead/ImportantLead.test.tsx +1 -1
  67. package/src/ImportantLead/index.tsx +3 -5
  68. package/src/Lazy/Lazy.stories.tsx +3 -2
  69. package/src/Lazy/Lazy.test.tsx +1 -1
  70. package/src/Lazy/index.tsx +2 -4
  71. package/src/ListBlock/ListBlock.stories.tsx +2 -2
  72. package/src/ListBlock/ListBlock.test.tsx +1 -1
  73. package/src/ListBlock/index.tsx +2 -3
  74. package/src/MaterialNote/MaterialNote.stories.tsx +4 -3
  75. package/src/MaterialNote/MaterialNote.test.tsx +1 -1
  76. package/src/MaterialNote/MaterialNote.types.ts +2 -1
  77. package/src/MaterialNote/index.tsx +3 -3
  78. package/src/MaterialTitle/MaterialTitle.stories.tsx +1 -1
  79. package/src/MaterialTitle/MaterialTitle.test.tsx +1 -1
  80. package/src/MediaCaption/MediaCaption.stories.tsx +1 -1
  81. package/src/MediaCaption/MediaCaption.test.tsx +1 -1
  82. package/src/MediaCaption/index.tsx +2 -2
  83. package/src/Meta/Meta.stories.tsx +1 -1
  84. package/src/Meta/Meta.test.tsx +1 -1
  85. package/src/Meta/MetaContainer.tsx +2 -4
  86. package/src/Meta/index.tsx +2 -3
  87. package/src/MetaItem/MetaItem.stories.tsx +2 -2
  88. package/src/MetaItem/MetaItem.test.tsx +1 -1
  89. package/src/MetaItem/index.tsx +1 -3
  90. package/src/MetaItemLive/MetaItemLive.stories.tsx +2 -2
  91. package/src/MetaItemLive/MetaItemLive.test.tsx +1 -1
  92. package/src/MetaItemLive/index.tsx +1 -3
  93. package/src/Popover/Popover.module.css +36 -2
  94. package/src/Popover/Popover.stories.tsx +1 -1
  95. package/src/Popover/Popover.test.tsx +1 -1
  96. package/src/Popover/index.tsx +2 -3
  97. package/src/QuoteBlock/QuoteBlock.stories.tsx +1 -1
  98. package/src/QuoteBlock/QuoteBlock.test.tsx +1 -1
  99. package/src/QuoteBlock/index.tsx +2 -3
  100. package/src/RawHtmlBlock/RawHtmlBlock.stories.tsx +2 -2
  101. package/src/RawHtmlBlock/RawHtmlBlock.test.tsx +1 -1
  102. package/src/RawHtmlBlock/index.tsx +0 -2
  103. package/src/RelatedBlock/RelatedBlock.stories.tsx +1 -1
  104. package/src/RelatedBlock/RelatedBlock.test.tsx +1 -1
  105. package/src/RelatedBlock/index.tsx +2 -3
  106. package/src/RenderBlocks/RenderBlocks.stories.tsx +1 -1
  107. package/src/RenderBlocks/RenderBlocks.test.tsx +1 -1
  108. package/src/RenderBlocks/index.tsx +0 -1
  109. package/src/RichTitle/RichTitle.stories.tsx +1 -1
  110. package/src/RichTitle/RichTitle.test.tsx +1 -1
  111. package/src/RichTitle/index.tsx +2 -3
  112. package/src/SimpleBlock/FootnoteLink.css +7 -0
  113. package/src/SimpleBlock/SimpleBlock.stories.tsx +2 -2
  114. package/src/SimpleBlock/SimpleBlock.test.tsx +1 -1
  115. package/src/SimpleBlock/index.tsx +2 -3
  116. package/src/SimpleTitle/SimpleTitle.stories.tsx +1 -1
  117. package/src/SimpleTitle/SimpleTitle.test.tsx +1 -1
  118. package/src/SimpleTitle/index.tsx +2 -2
  119. package/src/SourceBlock/SourceBlock.stories.tsx +6 -6
  120. package/src/SourceBlock/SourceBlock.test.tsx +1 -1
  121. package/src/SourceBlock/index.tsx +6 -4
  122. package/src/SourceBlock/mock.json +15 -0
  123. package/src/Spoiler/Spoiler.stories.tsx +1 -1
  124. package/src/Spoiler/Spoiler.test.tsx +1 -1
  125. package/src/Spoiler/index.tsx +4 -5
  126. package/src/SvgSymbol/SvgSymbol.stories.tsx +6 -6
  127. package/src/SvgSymbol/SvgSymbol.test.tsx +1 -1
  128. package/src/SvgSymbol/index.tsx +2 -2
  129. package/src/Switcher/Switcher.stories.tsx +4 -4
  130. package/src/Switcher/Switcher.test.tsx +1 -1
  131. package/src/Switcher/index.tsx +1 -2
  132. package/src/Table/Table.stories.tsx +1 -1
  133. package/src/Table/Table.test.tsx +1 -1
  134. package/src/Table/index.tsx +2 -2
  135. package/src/Tag/Tag.stories.tsx +1 -3
  136. package/src/Tag/Tag.test.tsx +4 -4
  137. package/src/Tag/index.tsx +2 -2
  138. package/src/Timestamp/Timestamp.stories.tsx +1 -1
  139. package/src/Timestamp/Timestamp.test.tsx +1 -1
  140. package/src/Timestamp/index.tsx +0 -2
  141. package/src/Toolbar/Toolbar.stories.tsx +0 -1
  142. package/src/Toolbar/Toolbar.test.tsx +1 -1
  143. package/src/Toolbar/index.tsx +2 -3
  144. package/src/ToolbarButton/ToolbarButton.stories.tsx +2 -2
  145. package/src/ToolbarButton/ToolbarButton.test.tsx +1 -1
  146. package/src/ToolbarButton/index.tsx +2 -3
  147. package/src/_storybook/PreviewWrapper/index.tsx +1 -1
  148. package/src/index.tsx +1 -0
  149. package/src/utils/DangerousHtml.tsx +5 -7
  150. package/src/utils/generateGradient.ts +1 -1
  151. package/src/utils/makeClassName.ts +3 -1
  152. package/src/utils/makeStyleContext.ts +8 -4
  153. 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,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { MetaItemLive } from './'
5
4
  import { MetaItemLiveProps } from './MetaItemLive.types'
5
+
6
6
  import styles from './MetaItemLive.module.css'
7
7
 
8
8
  describe('Meta Item Live', () => {
@@ -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 10px 0;
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: 15px 20px 40px;
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%);
@@ -1,8 +1,8 @@
1
1
  import React, { useState } from 'react'
2
-
3
2
  import { Popover } from './'
4
3
  import { Button } from '../Button'
5
4
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
5
+
6
6
  import styles from './Popover.stories.module.css'
7
7
 
8
8
  export default {
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { Popover } from './'
5
4
  import { PopoverProps } from './Popover.types'
5
+
6
6
  import styles from './Popover.module.css'
7
7
 
8
8
  describe('Popover', () => {
@@ -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
  )
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { QuoteBlock } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './QuoteBlock.stories.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { QuoteBlock } from './'
5
4
  import { QuoteBlockProps } from './QuoteBlock.types'
5
+
6
6
  import styles from './QuoteBlock.module.css'
7
7
 
8
8
  describe('Quote Block', () => {
@@ -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: (string[] | string | boolean)[][] = [[styles.root, true]]
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,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { RawHtmlBlock } from './'
5
4
  import { RawHtmlBlockProps } from './RawHtmlBlock.types'
5
+
6
6
  import styles from './RawHtmlBlock.module.css'
7
7
 
8
8
  describe('Raw Html Block', () => {
@@ -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,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { RelatedBlock } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './RelatedBlock.stories.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { RelatedBlock } from './'
5
4
  import { RelatedBlockProps } from './RelatedBlock.types'
5
+
6
6
  import styles from './RelatedBlock.module.css'
7
7
 
8
8
  describe('Related Block', () => {
@@ -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: (string[] | string | boolean)[][] = [
15
+ let classNames: ClassNames = [
17
16
  [styles.root, true],
18
17
  [styles[onlyOn], true]
19
18
  ]
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { RenderBlocks } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './RenderBlocks.stories.module.css'
6
6
 
7
7
  export default {
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { RenderBlocks } from './'
5
4
  import { RenderBlocksProps } from './RenderBlocks.types'
5
+
6
6
  import styles from './RenderBlocks.module.css'
7
7
 
8
8
  describe('Render Blocks', () => {
@@ -1,6 +1,5 @@
1
1
  import React from 'react'
2
2
  import { RenderBlocksProps } from './RenderBlocks.types'
3
-
4
3
  import { Tag } from '../Tag'
5
4
  import { SimpleTitle } from '../SimpleTitle'
6
5
  import { RichTitle } from '../RichTitle'
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { RichTitle } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './RichTitle.stories.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { RichTitle } from './'
5
4
  import { RichTitleProps } from './RichTitle.types'
5
+
6
6
  import styles from './RichTitle.module.css'
7
7
 
8
8
  describe('Rich Title', () => {
@@ -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: (string[] | string | boolean)[][] = [
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,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { SimpleBlock } from './'
5
4
  import { SimpleBlockProps } from './SimpleBlock.types'
5
+
6
6
  import styles from './SimpleBlock.module.css'
7
7
 
8
8
  describe('Simple Block', () => {
@@ -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: (string[] | string | boolean)[][] = [
14
+ let classNames: ClassNames = [
16
15
  [styles[type], !!type && !!styles[type]],
17
16
  [styles[onlyOn], true]
18
17
  ]
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { SimpleTitle } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './SimpleTitle.stories.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { SimpleTitle } from './'
5
4
  import { SimpleTitleProps } from './SimpleTitle.types'
5
+
6
6
  import styles from './SimpleTitle.module.css'
7
7
 
8
8
  describe('Simple Title', () => {
@@ -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: (string[] | string | boolean)[][] = [
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
- <div className={styles.root}>
19
- <SourceBlock />
20
- </div>
21
- </>
19
+ <div className={styles.root}>
20
+ <SourceBlock block={mock} />
21
+ </div>
22
22
  )
23
23
  }
24
24
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { SourceBlock } from './'
5
4
  import { SourceBlockProps } from './SourceBlock.types'
5
+
6
6
  import styles from './SourceBlock.module.css'
7
7
 
8
8
  describe('Source Block', () => {
@@ -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: { only_on: onlyOn, quote, origin, url },
9
+ block: {
10
+ only_on: onlyOn,
11
+ data: { quote, origin, url }
12
+ },
11
13
  styleContext
12
14
  }) => {
13
- let classNames: (string[] | string | boolean)[][] = [
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
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { Spoiler } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './Spoiler.stories.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { Spoiler } from './'
5
4
  import { SpoilerProps } from './Spoiler.types'
5
+
6
6
  import styles from './Spoiler.module.css'
7
7
 
8
8
  describe('Spoiler', () => {
@@ -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: (string[] | string | boolean)[][] = [
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>
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render, RenderResult } from '@testing-library/react'
3
-
4
3
  import { SvgSymbol } from './'
5
4
  import { SvgSymbolProps } from './SvgSymbol.types'
5
+
6
6
  import styles from './SvgSymbol.module.css'
7
7
 
8
8
  describe('Svg Symbol', () => {
@@ -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,