@meduza/ui-kit-2 0.1.27 → 0.1.29
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-2.cjs.development.js +9 -5
- 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 +9 -5
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1037 -1019
- package/package.json +1 -1
- package/src/Meta/Meta.module.css +2 -1
- package/src/Meta/MetaContainer.tsx +8 -1
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +47 -22
- package/src/RelatedRichBlock/index.tsx +11 -8
- package/src/RelatedRichBlock/mock.json +9 -0
- package/src/Tag/Tag.module.css +4 -1
package/package.json
CHANGED
package/src/Meta/Meta.module.css
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
.isInMaterial {
|
|
21
21
|
width: 100%;
|
|
22
22
|
|
|
23
|
-
color:
|
|
23
|
+
color: rgba(0, 0, 0, 0.4);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.podcast {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
color: rgba(255, 255, 255, 0.7);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.center.isInMediaBlock,
|
|
34
35
|
.center.half {
|
|
35
36
|
@media $landscapeTablet {
|
|
36
37
|
text-align: left;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { toCamel } from '../utils/converCase'
|
|
3
|
+
|
|
2
4
|
import { MetaContainerProps } from './Meta.types'
|
|
3
5
|
import { Meta } from './'
|
|
4
6
|
import { MetaItem } from '../MetaItem'
|
|
@@ -8,6 +10,8 @@ import { BookmarkButton } from '../BookmarkButton'
|
|
|
8
10
|
import { Timestamp } from '../Timestamp'
|
|
9
11
|
import { SvgSymbol } from '../SvgSymbol'
|
|
10
12
|
|
|
13
|
+
import { TimestampProps } from '../Timestamp/Timestamp.types'
|
|
14
|
+
|
|
11
15
|
import styles from './Meta.module.css'
|
|
12
16
|
|
|
13
17
|
export const MetaContainer: React.FC<MetaContainerProps> = ({
|
|
@@ -68,6 +72,9 @@ export const MetaContainer: React.FC<MetaContainerProps> = ({
|
|
|
68
72
|
)
|
|
69
73
|
}
|
|
70
74
|
case 'datetime': {
|
|
75
|
+
const format = (toCamel(component.format) ||
|
|
76
|
+
'date') as TimestampProps['type']
|
|
77
|
+
|
|
71
78
|
return (
|
|
72
79
|
<MetaItem
|
|
73
80
|
hasSource={hasSource}
|
|
@@ -77,7 +84,7 @@ export const MetaContainer: React.FC<MetaContainerProps> = ({
|
|
|
77
84
|
>
|
|
78
85
|
<Timestamp
|
|
79
86
|
publishedAt={component.datetime}
|
|
80
|
-
type=
|
|
87
|
+
type={format || 'date'}
|
|
81
88
|
locale={lang}
|
|
82
89
|
/>
|
|
83
90
|
</MetaItem>
|
|
@@ -66,20 +66,12 @@
|
|
|
66
66
|
height: 150px;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.isRich .overlayHeader {
|
|
70
|
-
background: linear-gradient(
|
|
71
|
-
180deg,
|
|
72
|
-
rgba(0, 0, 0, 0.5) 0%,
|
|
73
|
-
rgba(0, 0, 0, 0) 97%
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
69
|
.body {
|
|
78
70
|
display: flex;
|
|
79
71
|
flex-flow: column nowrap;
|
|
80
72
|
justify-content: flex-end;
|
|
81
73
|
|
|
82
|
-
padding:
|
|
74
|
+
padding: 12px 15px 12px;
|
|
83
75
|
|
|
84
76
|
background-color: #f7f7f7;
|
|
85
77
|
|
|
@@ -105,17 +97,38 @@
|
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
99
|
|
|
108
|
-
|
|
109
100
|
.isRich.hasGradient .body {
|
|
101
|
+
@media $landscapeTablet {
|
|
102
|
+
position: absolute;
|
|
103
|
+
z-index: 10;
|
|
104
|
+
right: 0;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
|
|
108
|
+
min-height: 295px;
|
|
109
|
+
|
|
110
|
+
background-color: transparent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.isRich .picture {
|
|
115
|
+
position: relative;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.isRich .picture::after {
|
|
110
119
|
position: absolute;
|
|
111
120
|
z-index: 10;
|
|
112
|
-
right:
|
|
121
|
+
right: 1px;
|
|
113
122
|
bottom: 0;
|
|
114
|
-
left:
|
|
123
|
+
left: 1px;
|
|
115
124
|
|
|
116
|
-
|
|
125
|
+
content: '';
|
|
117
126
|
|
|
118
|
-
|
|
127
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
128
|
+
|
|
129
|
+
@media $mobile {
|
|
130
|
+
content: '';
|
|
131
|
+
}
|
|
119
132
|
}
|
|
120
133
|
|
|
121
134
|
.isCard {
|
|
@@ -193,7 +206,8 @@
|
|
|
193
206
|
.tag {
|
|
194
207
|
position: absolute;
|
|
195
208
|
z-index: 10;
|
|
196
|
-
top:
|
|
209
|
+
top: 14px;
|
|
210
|
+
right: 15px;
|
|
197
211
|
left: 15px;
|
|
198
212
|
|
|
199
213
|
color: rgba(255, 255, 255, 0.7);
|
|
@@ -201,23 +215,34 @@
|
|
|
201
215
|
font-size: 12px;
|
|
202
216
|
|
|
203
217
|
@media $landscapeTablet {
|
|
204
|
-
top:
|
|
218
|
+
top: 16px;
|
|
219
|
+
right: 20px;
|
|
205
220
|
left: 20px;
|
|
206
|
-
|
|
207
|
-
color: #fff;
|
|
208
221
|
}
|
|
209
222
|
}
|
|
210
223
|
|
|
224
|
+
.center {
|
|
225
|
+
width: 100%;
|
|
226
|
+
max-width: 650px;
|
|
227
|
+
margin-right: auto;
|
|
228
|
+
margin-left: auto;
|
|
229
|
+
}
|
|
230
|
+
|
|
211
231
|
/* Themes */
|
|
212
232
|
|
|
213
|
-
.isRich.dark
|
|
214
|
-
.isRich.dark .tag {
|
|
233
|
+
.isRich.dark {
|
|
215
234
|
color: #000;
|
|
216
235
|
}
|
|
217
236
|
|
|
237
|
+
.isRich.dark .tag {
|
|
238
|
+
color: rgba(0, 0, 0, 0.7);
|
|
239
|
+
}
|
|
240
|
+
|
|
218
241
|
.isRich.light {
|
|
219
|
-
|
|
220
|
-
|
|
242
|
+
@media $mobile {
|
|
243
|
+
color: #fff;
|
|
244
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
245
|
+
}
|
|
221
246
|
}
|
|
222
247
|
|
|
223
248
|
/* Display */
|
|
@@ -78,18 +78,21 @@ export const RelatedRichBlock: React.FC<RelatedRichBlockProps> = ({
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (gradients) {
|
|
81
|
-
const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light']
|
|
82
|
-
|
|
83
|
-
classNames = makeStyleContext(classNames, theme, styles)
|
|
84
|
-
|
|
85
81
|
styleHeader.backgroundImage = generateGradient(
|
|
86
82
|
gradients.bg_rgb,
|
|
87
83
|
'mediaBlockTop'
|
|
88
84
|
)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
|
|
86
|
+
const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light']
|
|
87
|
+
classNames = makeStyleContext(classNames, theme, styles)
|
|
88
|
+
|
|
89
|
+
if (onlyOn === 'desktop') {
|
|
90
|
+
|
|
91
|
+
style.backgroundImage = generateGradient(
|
|
92
|
+
gradients.bg_rgb,
|
|
93
|
+
'mediaBlockBottom'
|
|
94
|
+
)
|
|
95
|
+
}
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
if (type === 'unset') {
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"2x_webp": "http://meduza.io/impro/MbBIK4vj9YMr8INLi6GMIYF4muqHFCWV0b1rxhhM6aI/fill/0/0/ce/1/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNi8w/ODcvNTU2L2VsYXJn/ZS9FXzN1R1dudnNz/WHpndEowNS1fUmZ3/LmpwZw.webp"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
"gradients": {
|
|
39
|
+
"text_rgb": "0,0,0",
|
|
40
|
+
"bg_rgb": "171,209,171"
|
|
41
|
+
},
|
|
38
42
|
"tag": "Читайте также"
|
|
39
43
|
},
|
|
40
44
|
"blocks": [
|
|
@@ -55,6 +59,7 @@
|
|
|
55
59
|
"components": [
|
|
56
60
|
{
|
|
57
61
|
"type": "datetime",
|
|
62
|
+
"format": "fromNow",
|
|
58
63
|
"datetime": 1600593764,
|
|
59
64
|
"id": "7639a7d1455a1ca907de0fc98a22b017e23f30e7df15b0739c78418848d674b5"
|
|
60
65
|
}
|
|
@@ -128,6 +133,7 @@
|
|
|
128
133
|
"components": [
|
|
129
134
|
{
|
|
130
135
|
"type": "datetime",
|
|
136
|
+
"format": "fromNow",
|
|
131
137
|
"datetime": 1600593764,
|
|
132
138
|
"id": "7639a7d1455a1ca907de0fc98a22b017e23f30e7df15b0739c78418848d674b5"
|
|
133
139
|
}
|
|
@@ -201,6 +207,7 @@
|
|
|
201
207
|
"components": [
|
|
202
208
|
{
|
|
203
209
|
"type": "datetime",
|
|
210
|
+
"format": "fromNow",
|
|
204
211
|
"datetime": 1600593764,
|
|
205
212
|
"id": "7639a7d1455a1ca907de0fc98a22b017e23f30e7df15b0739c78418848d674b5"
|
|
206
213
|
}
|
|
@@ -274,6 +281,7 @@
|
|
|
274
281
|
"components": [
|
|
275
282
|
{
|
|
276
283
|
"type": "datetime",
|
|
284
|
+
"format": "fromNow",
|
|
277
285
|
"datetime": 1600593764,
|
|
278
286
|
"id": "7639a7d1455a1ca907de0fc98a22b017e23f30e7df15b0739c78418848d674b5"
|
|
279
287
|
}
|
|
@@ -340,6 +348,7 @@
|
|
|
340
348
|
"components": [
|
|
341
349
|
{
|
|
342
350
|
"type": "datetime",
|
|
351
|
+
"format": "fromNow",
|
|
343
352
|
"datetime": 1600593764,
|
|
344
353
|
"id": "7639a7d1455a1ca907de0fc98a22b017e23f30e7df15b0739c78418848d674b5"
|
|
345
354
|
}
|