@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
@@ -0,0 +1,43 @@
1
+ import React from 'react'
2
+ import { Footnote } from './'
3
+ import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
+ import styles from './Footnote.stories.module.css'
6
+
7
+ export default {
8
+ title: 'Main / Footnote',
9
+ component: Footnote,
10
+ parameters: {
11
+ themeWrapperSideBySide: true
12
+ }
13
+ }
14
+
15
+ const Example: React.FC = () => {
16
+ return (
17
+ <>
18
+ <div className={styles.root}>
19
+ <Footnote onClose={(): void => alert('Handle Close')}>
20
+ <h3>Заголовок лвлвлдфова выа вовофдывлоа</h3>
21
+ <p>
22
+ «Я видел истинного Дональда Трампа, наблюдал за ним. Это обманщик,
23
+ притворщик и задира. Настоящий паршивец! Все его слова абсурдны
24
+ и&nbsp;направлены на скандал. Рейган когда-то сказал Горбачёву:
25
+ «Мистер Горбачёв, развалите эту стену!», а&nbsp;Трамп собирается
26
+ взводить стену между Америкой и Мексикой.
27
+ </p>
28
+ </Footnote>
29
+ </div>
30
+ </>
31
+ )
32
+ }
33
+
34
+ export const Default: React.FC = () => (
35
+ <>
36
+ <PreviewWrapper theme="light">
37
+ <Example />
38
+ </PreviewWrapper>
39
+ <PreviewWrapper theme="dark">
40
+ <Example />
41
+ </PreviewWrapper>
42
+ </>
43
+ )
@@ -0,0 +1,20 @@
1
+ import React from 'react'
2
+ import { render } from '@testing-library/react'
3
+ import { Footnote } from './'
4
+ import { FootnoteProps } from './Footnote.types'
5
+
6
+ import styles from './Footnote.module.css'
7
+
8
+ describe('Footnote', () => {
9
+ let props: FootnoteProps
10
+
11
+ const renderComponent = () => render(<Footnote {...props} />)
12
+
13
+ it('should have root style', () => {
14
+ const { getByTestId } = renderComponent()
15
+
16
+ const footnote = getByTestId('footnote')
17
+
18
+ expect(footnote).toHaveClass(styles.root)
19
+ })
20
+ })
@@ -0,0 +1,5 @@
1
+ import React from 'react'
2
+ export interface FootnoteProps {
3
+ children: React.ReactNode | JSX.Element[] | JSX.Element
4
+ onClose: () => void
5
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react'
2
+ import { FootnoteProps } from './Footnote.types'
3
+ import makeClassName from '../utils/makeClassName'
4
+
5
+ import { SvgSymbol } from '../SvgSymbol'
6
+
7
+ import styles from './Footnote.module.css'
8
+
9
+ export const Footnote: React.FC<FootnoteProps> = ({ children, onClose }) => {
10
+ return (
11
+ <div
12
+ data-testid="footnote"
13
+ className={makeClassName([[styles.root, true]])}
14
+ >
15
+ <button
16
+ className={styles.dismiss}
17
+ type="button"
18
+ onClick={(): void => onClose()}
19
+ >
20
+ <SvgSymbol icon="cross" size="unset" />
21
+ </button>
22
+
23
+ <div className={styles.body}>{children}</div>
24
+ </div>
25
+ )
26
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { GroupedBlock } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './GroupedBlock.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 { GroupedBlock } from './'
5
4
  import { GroupedBlockProps } from './GroupedBlock.types'
5
+
6
6
  import styles from './GroupedBlock.module.css'
7
7
 
8
8
  describe('Grouped Block', () => {
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
2
  import { GroupedBlockProps } from './GroupedBlock.types'
3
-
4
- import makeClassName from '../utils/makeClassName'
3
+ import { makeClassName, ClassNames } from '../utils/makeClassName'
5
4
  import makeStyleContext from '../utils/makeStyleContext'
6
-
7
5
  import { EmbedBlockContainer } from '../EmbedBlock'
8
6
  import { MediaCaption } from '../MediaCaption'
9
7
 
@@ -14,15 +12,15 @@ export const GroupedBlock: React.FC<GroupedBlockProps> = ({
14
12
  block: { only_on: onlyOn },
15
13
  styleContext
16
14
  }) => {
17
- const maxHeight = Math.min(...block.data.map(item => item.data.height))
15
+ const maxHeight = Math.min(...block.data.map((item) => item.data.height))
18
16
 
19
17
  const normalizedBoxesWidth = block.data.map(
20
- item => item.data.width / (item.data.height / maxHeight)
18
+ (item) => item.data.width / (item.data.height / maxHeight)
21
19
  )
22
20
 
23
21
  const sumWidth = normalizedBoxesWidth.reduce((sum, x) => sum + x)
24
22
 
25
- let classNames: (string[] | string | boolean)[][] = [
23
+ let classNames: ClassNames = [
26
24
  [styles.root, true],
27
25
  [styles[onlyOn], true],
28
26
  [styles.hasFigcaption, block.cc === 'default'],
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { HalfBlock } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './HalfBlock.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 { HalfBlock } from './'
5
4
  import { HalfBlockProps } from './HalfBlock.types'
5
+
6
6
  import styles from './HalfBlock.module.css'
7
7
 
8
8
  describe('Half Block', () => {
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
2
  import { HalfBlockProps } from './HalfBlock.types'
3
-
4
- import makeClassName from '../utils/makeClassName'
3
+ import { makeClassName, ClassNames } from '../utils/makeClassName'
5
4
  import makeStyleContext from '../utils/makeStyleContext'
6
-
7
5
  import { RenderBlocks } from '../RenderBlocks'
8
6
  import { Image } from '../Image'
9
7
  import { MediaCaption } from '../MediaCaption'
@@ -20,7 +18,7 @@ export const HalfBlock: React.FC<HalfBlockProps> = ({
20
18
  },
21
19
  styleContext
22
20
  }) => {
23
- let classNames: (string[] | string | boolean)[][] = [
21
+ let classNames: ClassNames = [
24
22
  [styles.root, true],
25
23
  [styles[onlyOn], true]
26
24
  ]
@@ -36,7 +34,7 @@ export const HalfBlock: React.FC<HalfBlockProps> = ({
36
34
  <Image optimized={optimized} ratio={ratio} display="super_full" />
37
35
  </div>
38
36
  <div className={styles.body}>
39
- {data.blocks.map(item => (
37
+ {data.blocks.map((item) => (
40
38
  <RenderBlocks key={item.id} block={item} styleContext={['rich']} />
41
39
  ))}
42
40
  </div>
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { Image } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './Image.stories.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { Image } from './'
4
+
5
5
  import styles from './Image.module.css'
6
6
 
7
7
  import mock from './mock.json'
@@ -18,14 +18,14 @@ export interface ImageProps {
18
18
  }
19
19
  width?: number
20
20
  height?: number
21
- source?: object
21
+ source?: string[]
22
22
  lazy?: boolean
23
23
  fullscreen?: boolean
24
24
  ratio?: number
25
25
  }
26
26
 
27
27
  export interface PictureProps {
28
- source?: object
28
+ source?: string[]
29
29
  optimized?: {
30
30
  original?: string
31
31
  w325: OptimizedImageItem
@@ -1,6 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { PictureProps } from './Image.types'
3
-
4
3
  import { imageBreakpoints, imageConditionalKeys } from '../constants'
5
4
  import { toCamel } from '../utils/toCamel'
6
5
 
@@ -31,7 +30,7 @@ export const RenderPicture: React.FC<PictureProps> = ({
31
30
  )}
32
31
 
33
32
  {optimized &&
34
- keys.map(key => {
33
+ keys.map((key) => {
35
34
  const breakpoint = optimized[`w${key}`]
36
35
 
37
36
  if (!breakpoint) {
@@ -1,13 +1,10 @@
1
1
  import React, { useContext } from 'react'
2
2
  import { ImageProps } from './Image.types'
3
-
4
- import makeClassName from '../utils/makeClassName'
5
-
3
+ import { makeClassName } from '../utils/makeClassName'
6
4
  import BlockContext from '../utils/BlockContext'
7
5
  import viewportSize from '../utils/viewportSize'
8
6
  import postMessage from '../utils/postMessage'
9
7
  import { MediaQuerySizes } from '../constants'
10
-
11
8
  import { Lazy } from '../Lazy'
12
9
  import RenderPicture from './RenderPicture'
13
10
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { ImportantLead } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './ImportantLead.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 { ImportantLead } from './'
5
4
  import { ImportantLeadProps } from './ImportantLead.types'
5
+
6
6
  import styles from './ImportantLead.module.css'
7
7
 
8
8
  describe('Important Lead', () => {
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
2
  import { ImportantLeadProps } from './ImportantLead.types'
3
-
4
- import makeClassName from '../utils/makeClassName'
3
+ import { makeClassName, ClassNames } from '../utils/makeClassName'
5
4
  import makeStyleContext from '../utils/makeStyleContext'
6
-
7
5
  import { RenderBlocks } from '../RenderBlocks'
8
6
 
9
7
  import styles from './ImportantLead.module.css'
@@ -12,7 +10,7 @@ export const ImportantLead: React.FC<ImportantLeadProps> = ({
12
10
  block: { only_on: onlyOn, data },
13
11
  styleContext
14
12
  }) => {
15
- let classNames: (string[] | string | boolean)[][] = [
13
+ let classNames: ClassNames = [
16
14
  [styles.root, true],
17
15
  [styles[onlyOn], !!onlyOn]
18
16
  ]
@@ -23,7 +21,7 @@ export const ImportantLead: React.FC<ImportantLeadProps> = ({
23
21
 
24
22
  return (
25
23
  <div data-testid="important-lead" className={makeClassName(classNames)}>
26
- {data.map(item => (
24
+ {data.map((item) => (
27
25
  <RenderBlocks
28
26
  key={item.id}
29
27
  block={item}
@@ -1,11 +1,12 @@
1
1
  import React from 'react'
2
-
3
2
  import { Lazy } from './'
4
3
  import { Image } from '../Image'
5
4
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
6
- import mock from '../Image/mock.json'
5
+
7
6
  import styles from './Lazy.stories.module.css'
8
7
 
8
+ import mock from '../Image/mock.json'
9
+
9
10
  export default {
10
11
  title: 'Main / Lazy',
11
12
  component: Lazy,
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { Lazy } from './'
5
4
  import { LazyProps } from './Lazy.types'
5
+
6
6
  import styles from './Lazy.module.css'
7
7
 
8
8
  describe('Lazy', () => {
@@ -1,12 +1,10 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useInView } from 'react-intersection-observer'
3
-
4
- import makeClassName from '../utils/makeClassName'
3
+ import { makeClassName } from '../utils/makeClassName'
4
+ import { LazyProps } from './Lazy.types'
5
5
 
6
6
  import styles from './Lazy.module.css'
7
7
 
8
- import { LazyProps } from './Lazy.types'
9
-
10
8
  export const Lazy: React.FC<LazyProps> = ({ children, threshold }) => {
11
9
  const [ref, inView, entry] = useInView({
12
10
  threshold: threshold || 0
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { ListBlock } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './ListBlock.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
  <ListBlock block={item} key={item.id} />
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 { ListBlock } from './'
5
4
  import { ListBlockProps } from './ListBlock.types'
5
+
6
6
  import styles from './ListBlock.module.css'
7
7
 
8
8
  describe('List Block', () => {
@@ -1,7 +1,6 @@
1
1
  import React from 'react'
2
2
  import { ListBlockProps } from './ListBlock.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 './ListBlock.module.css'
@@ -12,7 +11,7 @@ export const ListBlock: React.FC<ListBlockProps> = ({
12
11
  }) => {
13
12
  const TagName = type
14
13
 
15
- let classNames: (string[] | string | boolean)[][] = [
14
+ let classNames: ClassNames = [
16
15
  [styles.root, true],
17
16
  [styles[onlyOn], true],
18
17
  [styles[type], !!type && !!styles[type]]
@@ -1,10 +1,11 @@
1
1
  import React from 'react'
2
-
3
2
  import { MaterialNote } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+ import { MaterialNoteProps } from 'src/MaterialNote/MaterialNote.types'
5
+
5
6
  import styles from './MaterialNote.stories.module.css'
6
7
 
7
- import mock from './mock'
8
+ import mock from './mock.json'
8
9
 
9
10
  export default {
10
11
  title: 'Main / MaterialNote',
@@ -18,7 +19,7 @@ const Example: React.FC = () => {
18
19
  return (
19
20
  <>
20
21
  <div className={styles.root}>
21
- <MaterialNote block={mock} />
22
+ <MaterialNote block={mock as MaterialNoteProps['block']} />
22
23
  </div>
23
24
  </>
24
25
  )
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { MaterialNote } from './'
5
4
  import { MaterialNoteProps } from './MaterialNote.types'
5
+
6
6
  import styles from './MaterialNote.module.css'
7
7
 
8
8
  describe('Material Note', () => {
@@ -3,10 +3,11 @@ export interface MaterialNoteProps {
3
3
  data: {
4
4
  data: string
5
5
  id: string
6
- lenght: number
6
+ length: number
7
7
  type: 'note_caption' | 'note_credit'
8
8
  }[]
9
9
  id: string
10
+ type: string
10
11
  }
11
12
  styleContext?: string | string[]
12
13
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { MaterialNoteProps } from './MaterialNote.types'
3
3
  import makeStyleContext from '../utils/makeStyleContext'
4
- import makeClassName from '../utils/makeClassName'
4
+ import { makeClassName, ClassNames } from '../utils/makeClassName'
5
5
 
6
6
  import styles from './MaterialNote.module.css'
7
7
 
@@ -9,7 +9,7 @@ export const MaterialNote: React.FC<MaterialNoteProps> = ({
9
9
  block: { data },
10
10
  styleContext
11
11
  }) => {
12
- let classNames: (string[] | string | boolean)[][] = [[styles.root, true]]
12
+ let classNames: ClassNames = [[styles.root, true]]
13
13
 
14
14
  if (styleContext) {
15
15
  classNames = makeStyleContext(classNames, styleContext, styles)
@@ -18,7 +18,7 @@ export const MaterialNote: React.FC<MaterialNoteProps> = ({
18
18
  return (
19
19
  <div data-testid="material-note" className={makeClassName(classNames)}>
20
20
  {data &&
21
- data.map(item => (
21
+ data.map((item) => (
22
22
  <p
23
23
  className={styles[item.type]}
24
24
  key={item.id}
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { MaterialTitle, Primary, Secondary } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './MaterialTitle.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 { MaterialTitle } from './'
5
4
  import { MaterialTitleProps } from './MaterialTitle.types'
5
+
6
6
  import styles from './MaterialTitle.module.css'
7
7
 
8
8
  describe('Material Title', () => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { MediaCaption } from './'
4
3
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './MediaCaption.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 { MediaCaption } from './'
5
4
  import { MediaCaptionProps } from './MediaCaption.types'
5
+
6
6
  import styles from './MediaCaption.module.css'
7
7
 
8
8
  describe('Media Caption', () => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { MediaCaptionProps } from './MediaCaption.types'
3
3
  import makeStyleContext from '../utils/makeStyleContext'
4
- import makeClassName from '../utils/makeClassName'
4
+ import { makeClassName, ClassNames } from '../utils/makeClassName'
5
5
 
6
6
  import styles from './MediaCaption.module.css'
7
7
 
@@ -10,7 +10,7 @@ export const MediaCaption: React.FC<MediaCaptionProps> = ({
10
10
  caption,
11
11
  styleContext
12
12
  }) => {
13
- let classNames: (string[] | string | boolean)[][] = [[styles.root, true]]
13
+ let classNames: ClassNames = [[styles.root, true]]
14
14
 
15
15
  if (styleContext) {
16
16
  classNames = makeStyleContext(classNames, styleContext, styles)
@@ -1,5 +1,4 @@
1
1
  import React from 'react'
2
-
3
2
  import { Meta } from './'
4
3
  import { MetaItem } from '../MetaItem'
5
4
  import { MetaItemLive } from '../MetaItemLive'
@@ -7,6 +6,7 @@ import { DocumentItemsCount } from '../DocumentItemsCount'
7
6
  import { Timestamp } from '../Timestamp'
8
7
  import { SvgSymbol } from '../SvgSymbol'
9
8
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
9
+
10
10
  import styles from './Meta.stories.module.css'
11
11
 
12
12
  export default {
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
-
4
3
  import { Meta } from './'
5
4
  import { MetaProps } from './Meta.types'
5
+
6
6
  import styles from './Meta.module.css'
7
7
 
8
8
  describe('Meta', () => {
@@ -1,11 +1,9 @@
1
1
  import React from 'react'
2
2
  import { MetaContainerProps } from './Meta.types'
3
-
4
3
  import { Meta } from './'
5
4
  import { MetaItem } from '../MetaItem'
6
5
  import { MetaItemLive } from '../MetaItemLive'
7
6
  import { DocumentItemsCount } from '../DocumentItemsCount'
8
-
9
7
  import { BookmarkButton } from '../BookmarkButton'
10
8
  import { Timestamp } from '../Timestamp'
11
9
  import { SvgSymbol } from '../SvgSymbol'
@@ -29,7 +27,7 @@ export const MetaContainer: React.FC<MetaContainerProps> = ({
29
27
  const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1
30
28
  const isSlides = styleContext && styleContext.indexOf('slide') !== -1
31
29
 
32
- const hasSource = !!components.find(item => item.type === 'source_name')
30
+ const hasSource = !!components.find((item) => item.type === 'source_name')
33
31
 
34
32
  return (
35
33
  <Meta
@@ -38,7 +36,7 @@ export const MetaContainer: React.FC<MetaContainerProps> = ({
38
36
  onlyOn={block.only_on}
39
37
  hasSource={hasSource}
40
38
  >
41
- {components.map(component => {
39
+ {components.map((component) => {
42
40
  switch (component.type) {
43
41
  case 'source_name': {
44
42
  return (
@@ -1,8 +1,7 @@
1
1
  import React from 'react'
2
2
  import { MetaProps } from './Meta.types'
3
-
4
3
  import makeStyleContext from '../utils/makeStyleContext'
5
- import makeClassName from '../utils/makeClassName'
4
+ import { makeClassName, ClassNames } from '../utils/makeClassName'
6
5
 
7
6
  import styles from './Meta.module.css'
8
7
 
@@ -13,7 +12,7 @@ export const Meta: React.FC<MetaProps> = ({
13
12
  onlyOn,
14
13
  styleContext
15
14
  }) => {
16
- let classNames: (string[] | string | boolean)[][] = [
15
+ let classNames: ClassNames = [
17
16
  [styles.root, true],
18
17
  [styles[theme], !!theme && !!styles[theme]],
19
18
  [styles[onlyOn], !!onlyOn],
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
-
3
2
  import { MetaItem } from './'
4
- import { PreviewWrapper } from '_storybook/PreviewWrapper'
3
+ import { PreviewWrapper } from '../_storybook/PreviewWrapper'
4
+
5
5
  import styles from './MetaItem.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 { MetaItem } from './'
5
4
  import { MetaItemProps } from './MetaItem.types'
5
+
6
6
  import styles from './MetaItem.module.css'
7
7
 
8
8
  describe('Meta Item', () => {
@@ -1,8 +1,6 @@
1
1
  import React from 'react'
2
2
  import { MetaItemProps } from './MetaItem.types'
3
-
4
- import makeClassName from '../utils/makeClassName'
5
-
3
+ import { makeClassName } from '../utils/makeClassName'
6
4
  import styles from './MetaItem.module.css'
7
5
 
8
6
  export const MetaItem: React.FC<MetaItemProps> = ({