@meduza/ui-kit-2 0.1.27 → 0.1.28
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 +1140 -1125
- 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 +42 -19
- 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,14 +66,6 @@
|
|
|
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;
|
|
@@ -105,17 +97,36 @@
|
|
|
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;
|
|
121
|
+
top: 0;
|
|
112
122
|
right: 0;
|
|
113
123
|
bottom: 0;
|
|
114
124
|
left: 0;
|
|
115
125
|
|
|
116
|
-
|
|
126
|
+
content: '';
|
|
117
127
|
|
|
118
|
-
|
|
128
|
+
border-radius: 8px 8px 0 0;
|
|
129
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
119
130
|
}
|
|
120
131
|
|
|
121
132
|
.isCard {
|
|
@@ -193,7 +204,8 @@
|
|
|
193
204
|
.tag {
|
|
194
205
|
position: absolute;
|
|
195
206
|
z-index: 10;
|
|
196
|
-
top:
|
|
207
|
+
top: 14px;
|
|
208
|
+
right: 15px;
|
|
197
209
|
left: 15px;
|
|
198
210
|
|
|
199
211
|
color: rgba(255, 255, 255, 0.7);
|
|
@@ -201,23 +213,34 @@
|
|
|
201
213
|
font-size: 12px;
|
|
202
214
|
|
|
203
215
|
@media $landscapeTablet {
|
|
204
|
-
top:
|
|
216
|
+
top: 16px;
|
|
217
|
+
right: 20px;
|
|
205
218
|
left: 20px;
|
|
206
|
-
|
|
207
|
-
color: #fff;
|
|
208
219
|
}
|
|
209
220
|
}
|
|
210
221
|
|
|
222
|
+
.center {
|
|
223
|
+
width: 100%;
|
|
224
|
+
max-width: 650px;
|
|
225
|
+
margin-right: auto;
|
|
226
|
+
margin-left: auto;
|
|
227
|
+
}
|
|
228
|
+
|
|
211
229
|
/* Themes */
|
|
212
230
|
|
|
213
|
-
.isRich.dark
|
|
214
|
-
.isRich.dark .tag {
|
|
231
|
+
.isRich.dark {
|
|
215
232
|
color: #000;
|
|
216
233
|
}
|
|
217
234
|
|
|
235
|
+
.isRich.dark .tag {
|
|
236
|
+
color: rgba(0, 0, 0, 0.7);
|
|
237
|
+
}
|
|
238
|
+
|
|
218
239
|
.isRich.light {
|
|
219
|
-
|
|
220
|
-
|
|
240
|
+
@media $mobile {
|
|
241
|
+
color: #fff;
|
|
242
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
243
|
+
}
|
|
221
244
|
}
|
|
222
245
|
|
|
223
246
|
/* 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
|
}
|