@meduza/ui-kit-2 0.1.18 → 0.1.20
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/Cover/Cover.types.d.ts +21 -1
- package/dist/DotsOnImage/DotsOnImage.types.d.ts +1 -1
- package/dist/Image/Image.types.d.ts +1 -6
- package/dist/ListBlock/ListBlock.stories.d.ts +2 -1
- package/dist/ListBlock/ListBlock.types.d.ts +7 -1
- package/dist/RelatedBlock/RelatedBlock.types.d.ts +14 -1
- package/dist/RelatedRichBlock/RelatedRichBlock.stories.d.ts +10 -0
- package/dist/RelatedRichBlock/RelatedRichBlock.types.d.ts +4 -0
- package/dist/RelatedRichBlock/index.d.ts +3 -0
- package/dist/RichTitle/RichTitle.types.d.ts +8 -1
- package/dist/SimpleTitle/SimpleTitle.types.d.ts +6 -1
- package/dist/SourceBlock/SourceBlock.types.d.ts +12 -1
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/ui-kit-2.cjs.development.js +97 -7
- 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 +97 -8
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1240 -1042
- package/dist/utils/converCase.d.ts +2 -0
- package/dist/utils/generateGradient.d.ts +1 -1
- package/package.json +4 -1
- package/src/.DS_Store +0 -0
- package/src/BookmarkButton/BookmarkButton.test.tsx +17 -4
- package/src/Button/Button.module.css +2 -0
- package/src/CardTitle/CardTitle.test.tsx +4 -3
- package/src/ChapterBlock/ChapterBlock.test.tsx +4 -3
- package/src/Cover/Cover.test.tsx +3 -3
- package/src/Cover/Cover.types.ts +22 -1
- package/src/Cover/index.tsx +1 -1
- package/src/DocumentItemsCount/DocumentItemsCount.test.tsx +4 -3
- package/src/DotsOnImage/DotsOnImage.test.tsx +4 -2
- package/src/DotsOnImage/DotsOnImage.types.ts +1 -1
- package/src/EmbedBlock/EmbedBlock.test.tsx +16 -3
- package/src/EmbedBlock/index.tsx +1 -1
- package/src/GroupedBlock/GroupedBlock.test.tsx +5 -3
- package/src/HalfBlock/HalfBlock.test.tsx +4 -3
- package/src/Image/Image.test.tsx +3 -0
- package/src/Image/Image.types.ts +1 -6
- package/src/Image/RenderPicture.tsx +1 -1
- package/src/ImportantLead/ImportantLead.test.tsx +10 -8
- package/src/ImportantLead/mock.json +6 -0
- package/src/Lazy/Lazy.test.tsx +3 -0
- package/src/ListBlock/ListBlock.stories.tsx +2 -1
- package/src/ListBlock/ListBlock.test.tsx +8 -4
- package/src/ListBlock/ListBlock.types.ts +6 -1
- package/src/ListBlock/index.tsx +1 -1
- package/src/ListBlock/mock.json +1 -1
- package/src/MaterialNote/MaterialNote.test.tsx +4 -3
- package/src/Meta/Meta.module.css +1 -1
- package/src/QuoteBlock/QuoteBlock.test.tsx +4 -3
- package/src/RawHtmlBlock/RawHtmlBlock.test.tsx +18 -9
- package/src/RawHtmlBlock/mock.json +6 -0
- package/src/RelatedBlock/RelatedBlock.test.tsx +4 -3
- package/src/RelatedBlock/RelatedBlock.types.ts +14 -1
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +165 -0
- package/src/RelatedRichBlock/RelatedRichBlock.stories.module.css +12 -0
- package/src/RelatedRichBlock/RelatedRichBlock.stories.tsx +55 -0
- package/src/RelatedRichBlock/RelatedRichBlock.test.tsx +20 -0
- package/src/RelatedRichBlock/RelatedRichBlock.types.ts +4 -0
- package/src/RelatedRichBlock/index.tsx +105 -0
- package/src/RelatedRichBlock/mock.json +354 -0
- package/src/RenderBlocks/RenderBlocks.stories.tsx +4 -1
- package/src/RenderBlocks/RenderBlocks.test.tsx +15 -9
- package/src/RenderBlocks/mock.json +10 -0
- package/src/RichTitle/RichTitle.module.css +37 -7
- package/src/RichTitle/RichTitle.test.tsx +4 -3
- package/src/RichTitle/RichTitle.types.ts +8 -1
- package/src/SimpleBlock/SimpleBlock.test.tsx +16 -9
- package/src/SimpleBlock/mock.json +6 -0
- package/src/SimpleTitle/SimpleTitle.test.tsx +4 -3
- package/src/SimpleTitle/SimpleTitle.types.ts +6 -1
- package/src/SourceBlock/SourceBlock.test.tsx +4 -3
- package/src/SourceBlock/SourceBlock.types.ts +13 -1
- package/src/Spoiler/Spoiler.test.tsx +4 -3
- package/src/Table/Table.test.tsx +3 -3
- package/src/Timestamp/Timestamp.test.tsx +4 -3
- package/src/ToolbarButton/ToolbarButton.test.tsx +8 -3
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +3 -1
- package/src/index.tsx +1 -0
- package/src/types.ts +6 -0
- package/src/utils/{toCamel.ts → converCase.ts} +3 -0
- package/src/utils/generateGradient.ts +21 -15
- package/dist/utils/toCamel.d.ts +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import { Timestamp } from './'
|
|
4
|
-
import { TimestampProps } from './Timestamp.types'
|
|
4
|
+
// import { TimestampProps } from './Timestamp.types'
|
|
5
5
|
|
|
6
6
|
import styles from './Timestamp.module.css'
|
|
7
7
|
|
|
8
8
|
describe('Timestamp', () => {
|
|
9
|
-
let props: TimestampProps
|
|
9
|
+
// let props: TimestampProps
|
|
10
10
|
|
|
11
|
-
const renderComponent = () =>
|
|
11
|
+
const renderComponent = () =>
|
|
12
|
+
render(<Timestamp publishedAt={1526024185} type="fromNow" />)
|
|
12
13
|
|
|
13
14
|
it('should have root style', () => {
|
|
14
15
|
const { getByTestId } = renderComponent()
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import { ToolbarButton } from './'
|
|
4
|
-
import { ToolbarButtonProps } from './ToolbarButton.types'
|
|
4
|
+
// import { ToolbarButtonProps } from './ToolbarButton.types'
|
|
5
5
|
|
|
6
6
|
import styles from './ToolbarButton.module.css'
|
|
7
7
|
|
|
8
8
|
describe('Toolbar Button', () => {
|
|
9
|
-
let props: ToolbarButtonProps
|
|
9
|
+
// let props: ToolbarButtonProps
|
|
10
10
|
|
|
11
|
-
const renderComponent = () =>
|
|
11
|
+
const renderComponent = () =>
|
|
12
|
+
render(
|
|
13
|
+
<ToolbarButton type="fb" onClick={(): void => alert('Hello Button')}>
|
|
14
|
+
42
|
|
15
|
+
</ToolbarButton>
|
|
16
|
+
)
|
|
12
17
|
|
|
13
18
|
it('should have root style', () => {
|
|
14
19
|
const { getByTestId } = renderComponent()
|
package/src/index.tsx
CHANGED
package/src/types.ts
ADDED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
const generateGradient = (color: string): string => {
|
|
2
|
-
const
|
|
3
|
-
[
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
const generateGradient = (color: string, type: string): string => {
|
|
2
|
+
const steps = {
|
|
3
|
+
mediaBlockBottom: [
|
|
4
|
+
[0, 7],
|
|
5
|
+
[0.08, 12],
|
|
6
|
+
[0.16, 17],
|
|
7
|
+
[0.22, 21],
|
|
8
|
+
[0.32, 26],
|
|
9
|
+
[0.42, 32],
|
|
10
|
+
[0.52, 38],
|
|
11
|
+
[0.62, 47],
|
|
12
|
+
[0.72, 57],
|
|
13
|
+
[0.82, 65],
|
|
14
|
+
[1, 82]
|
|
15
|
+
],
|
|
16
|
+
mediaBlockTop: [
|
|
17
|
+
[0.5, 0],
|
|
18
|
+
[0, 97]
|
|
19
|
+
]
|
|
20
|
+
}
|
|
15
21
|
|
|
16
|
-
const gradient =
|
|
22
|
+
const gradient = steps[type].map((i) => `rgba(${color}, ${i[0]}) ${i[1]}%`)
|
|
17
23
|
|
|
18
24
|
return `linear-gradient(-180deg, ${gradient})`
|
|
19
25
|
}
|
package/dist/utils/toCamel.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const toCamel: (s: string) => string;
|