@meduza/ui-kit-2 0.1.25 → 0.1.27
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/RichTitle/RichTitle.types.d.ts +2 -0
- package/dist/ui-kit-2.cjs.development.js +13 -8
- 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 +13 -8
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1103 -1038
- package/package.json +1 -1
- package/src/Meta/Meta.module.css +1 -1
- package/src/RelatedBlock/index.tsx +1 -1
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +79 -18
- package/src/RelatedRichBlock/RelatedRichBlock.stories.tsx +0 -1
- package/src/RelatedRichBlock/index.tsx +7 -4
- package/src/RelatedRichBlock/mock.json +5 -5
- package/src/RichTitle/RichTitle.module.css +3 -5
- package/src/RichTitle/RichTitle.types.ts +1 -0
- package/src/RichTitle/index.tsx +3 -3
- package/src/Tag/Tag.module.css +7 -0
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +12 -0
package/package.json
CHANGED
package/src/Meta/Meta.module.css
CHANGED
|
@@ -7,15 +7,12 @@
|
|
|
7
7
|
display: block;
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
|
|
10
|
-
min-height: 434px;
|
|
11
|
-
|
|
12
10
|
text-decoration: none;
|
|
13
11
|
|
|
14
12
|
border-radius: 8px;
|
|
15
13
|
outline-width: 0;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
.root::before,
|
|
19
16
|
.root::after {
|
|
20
17
|
position: absolute;
|
|
21
18
|
z-index: 20;
|
|
@@ -30,11 +27,14 @@
|
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
.root::before {
|
|
33
|
-
|
|
30
|
+
display: block;
|
|
31
|
+
|
|
32
|
+
width: 100%;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
.root::after {
|
|
37
|
-
box-shadow: inset 0 4px #b88b59, inset 0 5px rgba(0, 0, 0, 0.2)
|
|
36
|
+
box-shadow: inset 0 4px #b88b59, inset 0 5px rgba(0, 0, 0, 0.2),
|
|
37
|
+
inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.root,
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
flex-flow: column nowrap;
|
|
80
80
|
justify-content: flex-end;
|
|
81
81
|
|
|
82
|
-
padding: 15px;
|
|
82
|
+
padding: 15px 15px 12px;
|
|
83
83
|
|
|
84
84
|
background-color: #f7f7f7;
|
|
85
85
|
|
|
86
|
-
@media $
|
|
86
|
+
@media $landscapeTablet {
|
|
87
87
|
position: absolute;
|
|
88
88
|
z-index: 10;
|
|
89
89
|
right: 0;
|
|
@@ -97,7 +97,15 @@
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
.
|
|
100
|
+
.isRich {
|
|
101
|
+
color: #000;
|
|
102
|
+
|
|
103
|
+
@media $landscapeTablet {
|
|
104
|
+
color: #fff;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
101
109
|
.isRich.hasGradient .body {
|
|
102
110
|
position: absolute;
|
|
103
111
|
z-index: 10;
|
|
@@ -113,23 +121,72 @@
|
|
|
113
121
|
.isCard {
|
|
114
122
|
color: #fff;
|
|
115
123
|
background-color: #191919;
|
|
124
|
+
|
|
125
|
+
@media $mobile {
|
|
126
|
+
min-height: 350px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.isCard .body {
|
|
131
|
+
background-color: transparent;
|
|
132
|
+
|
|
133
|
+
@media $mobile {
|
|
134
|
+
position: absolute;
|
|
135
|
+
z-index: 10;
|
|
136
|
+
right: 0;
|
|
137
|
+
bottom: 0;
|
|
138
|
+
left: 0;
|
|
139
|
+
|
|
140
|
+
min-height: 295px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.isCard::before {
|
|
145
|
+
@media $mobile {
|
|
146
|
+
padding-bottom: 66.66%;
|
|
147
|
+
|
|
148
|
+
content: '';
|
|
149
|
+
}
|
|
116
150
|
}
|
|
117
151
|
|
|
118
152
|
.isCard .cover {
|
|
153
|
+
position: relative;
|
|
154
|
+
|
|
155
|
+
width: 100%;
|
|
156
|
+
|
|
157
|
+
@media $mobile {
|
|
158
|
+
position: absolute;
|
|
159
|
+
top: 0;
|
|
160
|
+
bottom: 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.isCard .cover::before {
|
|
165
|
+
display: block;
|
|
166
|
+
|
|
167
|
+
padding-bottom: 78.50746269%;
|
|
168
|
+
|
|
169
|
+
content: '';
|
|
170
|
+
|
|
171
|
+
@media $mobile {
|
|
172
|
+
content: none;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.isCard .picture {
|
|
119
177
|
position: absolute;
|
|
120
|
-
top:
|
|
178
|
+
top: 50%;
|
|
121
179
|
left: 50%;
|
|
122
180
|
|
|
123
|
-
width:
|
|
181
|
+
width: 180px;
|
|
182
|
+
height: 180px;
|
|
124
183
|
|
|
125
|
-
transform: translate(-50%,
|
|
126
|
-
}
|
|
184
|
+
transform: translate(-50%, -50%);
|
|
127
185
|
|
|
128
|
-
|
|
129
|
-
|
|
186
|
+
@media $mobile {
|
|
187
|
+
top: 25%;
|
|
130
188
|
|
|
131
|
-
|
|
132
|
-
color: #fff;
|
|
189
|
+
transform: translate(-50%, -25%);
|
|
133
190
|
}
|
|
134
191
|
}
|
|
135
192
|
|
|
@@ -139,11 +196,15 @@
|
|
|
139
196
|
top: 15px;
|
|
140
197
|
left: 15px;
|
|
141
198
|
|
|
142
|
-
color:
|
|
199
|
+
color: rgba(255, 255, 255, 0.7);
|
|
143
200
|
|
|
144
|
-
|
|
201
|
+
font-size: 12px;
|
|
202
|
+
|
|
203
|
+
@media $landscapeTablet {
|
|
145
204
|
top: 20px;
|
|
146
205
|
left: 20px;
|
|
206
|
+
|
|
207
|
+
color: #fff;
|
|
147
208
|
}
|
|
148
209
|
}
|
|
149
210
|
|
|
@@ -37,7 +37,8 @@ export const RelatedRichBlock: React.FC<RelatedRichBlockProps> = ({
|
|
|
37
37
|
const cardType = `is${toCapitalize(layout)}`
|
|
38
38
|
|
|
39
39
|
useEffect(() => {
|
|
40
|
-
setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated')
|
|
40
|
+
// setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated')
|
|
41
|
+
setType('richRelated')
|
|
41
42
|
}, [])
|
|
42
43
|
|
|
43
44
|
const [ref, inView] = useInView({
|
|
@@ -107,7 +108,7 @@ export const RelatedRichBlock: React.FC<RelatedRichBlockProps> = ({
|
|
|
107
108
|
<a
|
|
108
109
|
data-testid="related-rich-block"
|
|
109
110
|
className={makeClassName(classNames)}
|
|
110
|
-
href={url}
|
|
111
|
+
href={`/${url}`}
|
|
111
112
|
target="_blank"
|
|
112
113
|
onClick={(): void => handleClick()}
|
|
113
114
|
ref={ref}
|
|
@@ -120,12 +121,14 @@ export const RelatedRichBlock: React.FC<RelatedRichBlockProps> = ({
|
|
|
120
121
|
)}
|
|
121
122
|
|
|
122
123
|
<div className={styles.tag}>
|
|
123
|
-
<Tag size="small" theme="inherit" styleContext="
|
|
124
|
+
<Tag size="small" theme="inherit" styleContext="richRelated">
|
|
124
125
|
{tag}
|
|
125
126
|
</Tag>
|
|
126
127
|
</div>
|
|
127
128
|
<div className={styles.cover}>
|
|
128
|
-
<
|
|
129
|
+
<div className={styles.picture}>
|
|
130
|
+
<Image optimized={urls} ratio={ratio} display="narrow" />
|
|
131
|
+
</div>
|
|
129
132
|
</div>
|
|
130
133
|
<div className={styles.body}>
|
|
131
134
|
{blocks.map((item) => (
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"only_on": "mobile"
|
|
20
20
|
},
|
|
21
21
|
"cover": {
|
|
22
|
-
"ratio": 1.
|
|
22
|
+
"ratio": 1.5,
|
|
23
23
|
"layout": "rich",
|
|
24
24
|
"urls": {
|
|
25
25
|
"w325": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"only_on": "desktop"
|
|
89
89
|
},
|
|
90
90
|
"cover": {
|
|
91
|
-
"ratio": 1.
|
|
91
|
+
"ratio": 1.5,
|
|
92
92
|
"layout": "rich",
|
|
93
93
|
"urls": {
|
|
94
94
|
"w325": {
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
{
|
|
115
115
|
"type": "rich_title",
|
|
116
116
|
"data": {
|
|
117
|
-
"first": "
|
|
118
|
-
"second": "
|
|
117
|
+
"first": "На HBO вышел сериал «Я исчезну во тьме» — о маньяке Джозефе Деанджело, которого не могли найти 40 лет",
|
|
118
|
+
"second": "Вот что мы узнали из первых эпизодов",
|
|
119
119
|
"as": "h3",
|
|
120
120
|
"featured": false
|
|
121
121
|
},
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"only_on": "desktop"
|
|
162
162
|
},
|
|
163
163
|
"cover": {
|
|
164
|
-
"ratio": 1.
|
|
164
|
+
"ratio": 1.5,
|
|
165
165
|
"layout": "rich",
|
|
166
166
|
"urls": {
|
|
167
167
|
"w325": {
|
|
@@ -85,18 +85,16 @@
|
|
|
85
85
|
line-height: 23px;
|
|
86
86
|
|
|
87
87
|
@media $landscapeTablet {
|
|
88
|
-
font-size:
|
|
89
|
-
line-height:
|
|
88
|
+
font-size: 1.3rem;
|
|
89
|
+
line-height: 1.6rem;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.isInMediaBlock:not(.featured) span {
|
|
94
94
|
font-size: 20px;
|
|
95
|
-
line-height: 23px;
|
|
96
95
|
|
|
97
96
|
@media $landscapeTablet {
|
|
98
|
-
font-size:
|
|
99
|
-
line-height: 32px;
|
|
97
|
+
font-size: 1.35rem;
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
|
package/src/RichTitle/index.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import styles from './RichTitle.module.css'
|
|
|
8
8
|
export const RichTitle: React.FC<RichTitleProps> = ({
|
|
9
9
|
block: {
|
|
10
10
|
only_on: onlyOn,
|
|
11
|
-
data: { featured, first, second }
|
|
11
|
+
data: { featured, first, second, as: TagName = 'h1' }
|
|
12
12
|
},
|
|
13
13
|
styleContext
|
|
14
14
|
}) => {
|
|
@@ -23,9 +23,9 @@ export const RichTitle: React.FC<RichTitleProps> = ({
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<
|
|
26
|
+
<TagName data-testid="rich-title" className={makeClassName(classNames)}>
|
|
27
27
|
{first}
|
|
28
28
|
{second && <span> {second}</span>}
|
|
29
|
-
</
|
|
29
|
+
</TagName>
|
|
30
30
|
)
|
|
31
31
|
}
|
package/src/Tag/Tag.module.css
CHANGED
|
@@ -64,9 +64,21 @@
|
|
|
64
64
|
format('woff');
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* set font-size as website */
|
|
68
|
+
html {
|
|
69
|
+
@media (min-width: 1000px) {
|
|
70
|
+
font-size: calc(100vw / 66.75);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (min-width: 1335px) {
|
|
74
|
+
font-size: 20px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
.root {
|
|
68
79
|
color: #000;
|
|
69
80
|
background: #fff;
|
|
81
|
+
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
.sideBySide {
|