@meduza/ui-kit-2 0.4.6 → 0.4.7

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/ui-kit.css CHANGED
@@ -1171,7 +1171,6 @@
1171
1171
  }
1172
1172
  @media only screen and (min-width: 64em) {
1173
1173
  .Tag-module_large__EKMu6 {
1174
-
1175
1174
  font-size: 14px;
1176
1175
  line-height: 16px;
1177
1176
  letter-spacing: 1px;
@@ -1192,11 +1191,13 @@
1192
1191
  .Tag-module_inherit__z21c- {
1193
1192
  color: inherit;
1194
1193
  }
1194
+ .Tag-module_custom__NU9-e {
1195
+ color: var(--tagColor);
1196
+ }
1195
1197
  @media only screen and (min-width: 64em) {
1196
1198
  .Tag-module_is1to1__V-fH5,
1197
1199
  .Tag-module_is1to2__b9Obh,
1198
1200
  .Tag-module_isInSuperBlock__wrFUY {
1199
-
1200
1201
  font-size: 12px;
1201
1202
  line-height: 20px;
1202
1203
  letter-spacing: 1px;
@@ -1205,7 +1206,6 @@
1205
1206
  @media only screen and (min-width: 64em) {
1206
1207
  .Tag-module_is1to3__vZT-R,
1207
1208
  .Tag-module_is1to4__MBh5V {
1208
-
1209
1209
  font-size: 10px;
1210
1210
  line-height: 15px;
1211
1211
  letter-spacing: 0.5px;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.6",
2
+ "version": "0.4.7",
3
3
  "license": "MIT",
4
4
  "description": "UIKit for Meduza",
5
5
  "repository": "https://github.com/meduza-corp/ui-kit-2.git",
@@ -0,0 +1,19 @@
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
+ }
@@ -4,4 +4,20 @@
4
4
  display: block;
5
5
 
6
6
  font-family: $secondaryFont;
7
+
8
+ display: flex;
9
+ flex-flow: column nowrap;
10
+
11
+ gap: 40px;
12
+ }
13
+
14
+ .root h3 {
15
+ font-size: 20px;
16
+ font-weight: bold;
17
+ }
18
+
19
+ .layout {
20
+ display: flex;
21
+ flex-flow: column nowrap;
22
+ gap: 20px;
7
23
  }
@@ -8,6 +8,8 @@ import { SvgSymbol } from '../SvgSymbol'
8
8
  import { PreviewWrapper } from '../_storybook/PreviewWrapper'
9
9
 
10
10
  import styles from './Meta.stories.module.css'
11
+ import { MetaContainer } from './MetaContainer'
12
+ import { MetaMock } from './Meta.mock'
11
13
 
12
14
  export default {
13
15
  title: 'Main / Meta',
@@ -19,8 +21,8 @@ export default {
19
21
 
20
22
  const Example: React.FC = () => {
21
23
  return (
22
- <>
23
- <div className={styles.root}>
24
+ <div className={styles.root}>
25
+ <div className={styles.layout}>
24
26
  <h3>В карточке</h3>
25
27
  <Meta>
26
28
  <MetaItem>
@@ -38,7 +40,7 @@ const Example: React.FC = () => {
38
40
  ))}
39
41
  </Meta>
40
42
  </div>
41
- <div className={styles.root}>
43
+ <div className={styles.layout}>
42
44
  <h3>В материале</h3>
43
45
 
44
46
  <Meta styleContext="isInMaterial">
@@ -52,8 +54,19 @@ const Example: React.FC = () => {
52
54
  <Timestamp publishedAt={1558353600} type="date" locale="en" />
53
55
  </MetaItem>
54
56
  </Meta>
57
+ <div className={styles.layout}>
58
+ <h3>Блочная</h3>
59
+ <MetaContainer
60
+ block={MetaMock}
61
+ lang="ru"
62
+ styleContext={[]}
63
+ isRead={false}
64
+ isListened={false}
65
+ isInBookmarks={false}
66
+ />
67
+ </div>
55
68
  </div>
56
- </>
69
+ </div>
57
70
  )
58
71
  }
59
72
 
@@ -133,6 +133,14 @@ export const MetaContainer: React.FC<MetaContainerProps> = ({
133
133
  )
134
134
  }
135
135
 
136
+ case 'string': {
137
+ return (
138
+ <MetaItem bullets key={component.id}>
139
+ {component.text}
140
+ </MetaItem>
141
+ )
142
+ }
143
+
136
144
  default: {
137
145
  return null
138
146
  }
@@ -28,7 +28,6 @@
28
28
 
29
29
  .large {
30
30
  @media $landscapeTablet {
31
-
32
31
  font-size: 14px;
33
32
  line-height: 16px;
34
33
  letter-spacing: 1px;
@@ -55,11 +54,14 @@
55
54
  color: inherit;
56
55
  }
57
56
 
57
+ .custom {
58
+ color: var(--tagColor);
59
+ }
60
+
58
61
  .is1to1,
59
62
  .is1to2,
60
63
  .isInSuperBlock {
61
64
  @media $landscapeTablet {
62
-
63
65
  font-size: 12px;
64
66
  line-height: 20px;
65
67
  letter-spacing: 1px;
@@ -69,7 +71,6 @@
69
71
  .is1to3,
70
72
  .is1to4 {
71
73
  @media $landscapeTablet {
72
-
73
74
  font-size: 10px;
74
75
  line-height: 15px;
75
76
  letter-spacing: 0.5px;
@@ -14,21 +14,34 @@ export default {
14
14
  }
15
15
 
16
16
  const Example: React.FC = () => {
17
- const tags: { theme: TagThemes; size: TagSizes; title: string }[] = [
17
+ const tags: {
18
+ theme: TagThemes
19
+ size: TagSizes
20
+ title: string
21
+ color?: string
22
+ }[] = [
18
23
  { theme: 'dark', size: 'small', title: 'Новости' },
19
24
  { theme: 'gold', size: 'small', title: 'Новости' },
20
25
  { theme: 'gray', size: 'small', title: 'Новости' },
21
26
  { theme: 'light', size: 'small', title: 'Новости' },
27
+ { theme: 'custom', size: 'small', title: 'Новости', color: '250,0,255' },
22
28
  { theme: 'dark', size: 'large', title: 'Новости' },
23
29
  { theme: 'gold', size: 'large', title: 'Новости' },
24
30
  { theme: 'gray', size: 'large', title: 'Новости' },
25
- { theme: 'light', size: 'large', title: 'Новости' }
31
+ { theme: 'light', size: 'large', title: 'Новости' },
32
+ { theme: 'custom', size: 'large', title: 'Новости', color: '250,0,255' }
26
33
  ]
27
34
  return (
28
35
  <>
29
36
  <div className={styles.root}>
30
37
  {tags.map((tag) => (
31
- <div key={`tagSize-${tag.theme}-${tag.size}`}>
38
+ <div
39
+ key={`tagSize-${tag.theme}-${tag.size}`}
40
+ style={
41
+ tag.color &&
42
+ ({ '--tagColor': `rgb(${tag.color})` } as React.CSSProperties)
43
+ }
44
+ >
32
45
  <Tag size={tag.size} theme={tag.theme} styleContext="rich">
33
46
  {tag.title}
34
47
  </Tag>
@@ -2,7 +2,13 @@ import React from 'react'
2
2
 
3
3
  export type TagSizes = 'small' | 'large'
4
4
 
5
- export type TagThemes = 'dark' | 'gold' | 'gray' | 'light' | 'inherit'
5
+ export type TagThemes =
6
+ | 'dark'
7
+ | 'gold'
8
+ | 'gray'
9
+ | 'light'
10
+ | 'custom'
11
+ | 'inherit'
6
12
 
7
13
  export type TagStyleContexts = 'isInToolbar' | 'isInSpoiler' | 'isInDropdown'
8
14