@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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.25",
2
+ "version": "0.1.27",
3
3
  "license": "MIT",
4
4
  "description": "UIKit for Meduza",
5
5
  "repository": "https://github.com/meduza-corp/ui-kit-2.git",
@@ -5,7 +5,7 @@
5
5
 
6
6
  font-family: $secondaryFont;
7
7
  font-size: 12px;
8
- line-height: 14px;
8
+ line-height: 15px;
9
9
 
10
10
  fill: inherit;
11
11
  }
@@ -26,7 +26,7 @@ export const RelatedBlock: React.FC<RelatedBlockProps> = ({
26
26
 
27
27
  const handleClick = (url) => {
28
28
  if (trackClick) {
29
- postMessage('simpleRelated', 'click', url)
29
+ postMessage('simpleRelated', url, 'click')
30
30
  }
31
31
  }
32
32
 
@@ -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
- border: 1px solid rgba(0, 0, 0, 0.1);
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 $mobile {
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
- .isCard .body,
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: 17.2811059908%;
178
+ top: 50%;
121
179
  left: 50%;
122
180
 
123
- width: 170px;
181
+ width: 180px;
182
+ height: 180px;
124
183
 
125
- transform: translate(-50%, 0);
126
- }
184
+ transform: translate(-50%, -50%);
127
185
 
128
- .isRich {
129
- color: #000;
186
+ @media $mobile {
187
+ top: 25%;
130
188
 
131
- @media $landscapeTablet {
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: #fff;
199
+ color: rgba(255, 255, 255, 0.7);
143
200
 
144
- @media $mobile {
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
 
@@ -17,7 +17,6 @@ const Example: React.FC = () => {
17
17
  return (
18
18
  <>
19
19
  <div className={styles.root}>
20
- <div style={{ height: '1000px' }}></div>
21
20
  <div className={styles.card}>
22
21
  <RelatedRichBlock block={mock.rich} styleContext={['no_mods']} />
23
22
  </div>
@@ -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="rich">
124
+ <Tag size="small" theme="inherit" styleContext="richRelated">
124
125
  {tag}
125
126
  </Tag>
126
127
  </div>
127
128
  <div className={styles.cover}>
128
- <Image optimized={urls} ratio={ratio} display="narrow" />
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.4976958525,
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.4976958525,
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": "2 «Если кто-нибудь видит меня и слышит, пожалуйста, распространите это видео любым способом! Чтобы я существовал!»",
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.4976958525,
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: 26px;
89
- line-height: 32px;
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: 27px;
99
- line-height: 32px;
97
+ font-size: 1.35rem;
100
98
  }
101
99
  }
102
100
 
@@ -5,6 +5,7 @@ export interface RichTitleProps {
5
5
  featured?: boolean
6
6
  first: string
7
7
  second?: string
8
+ as?: keyof JSX.IntrinsicElements
8
9
  }
9
10
  }
10
11
  styleContext?: string[] | string
@@ -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
- <h1 data-testid="rich-title" className={makeClassName(classNames)}>
26
+ <TagName data-testid="rich-title" className={makeClassName(classNames)}>
27
27
  {first}
28
28
  {second && <span> {second}</span>}
29
- </h1>
29
+ </TagName>
30
30
  )
31
31
  }
@@ -83,6 +83,13 @@
83
83
  }
84
84
  }
85
85
 
86
+ .richRelated {
87
+ @media $landscapeTablet {
88
+ font-size: 14px;
89
+ line-height: 16px;
90
+ }
91
+ }
92
+
86
93
  .slide,
87
94
  .game,
88
95
  .card,
@@ -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 {