@lumx/react 2.1.9-alpha-thumbnail → 2.1.9
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/esm/_internal/Avatar2.js +1 -5
- package/esm/_internal/Avatar2.js.map +1 -1
- package/esm/_internal/DragHandle.js +1 -1
- package/esm/_internal/DragHandle.js.map +1 -1
- package/esm/_internal/Flag2.js +1 -3
- package/esm/_internal/Flag2.js.map +1 -1
- package/esm/_internal/Icon2.js +9 -1
- package/esm/_internal/Icon2.js.map +1 -1
- package/esm/_internal/List2.js.map +1 -1
- package/esm/_internal/Message2.js +2 -2
- package/esm/_internal/Message2.js.map +1 -1
- package/esm/_internal/Slider2.js +2 -21
- package/esm/_internal/Slider2.js.map +1 -1
- package/esm/_internal/Thumbnail2.js +787 -81
- package/esm/_internal/Thumbnail2.js.map +1 -1
- package/esm/_internal/UserBlock.js +14 -45
- package/esm/_internal/UserBlock.js.map +1 -1
- package/esm/_internal/avatar.js +3 -0
- package/esm/_internal/avatar.js.map +1 -1
- package/esm/_internal/clamp.js +22 -0
- package/esm/_internal/clamp.js.map +1 -0
- package/esm/_internal/comment-block.js +3 -0
- package/esm/_internal/comment-block.js.map +1 -1
- package/esm/_internal/image-block.js +3 -0
- package/esm/_internal/image-block.js.map +1 -1
- package/esm/_internal/link-preview.js +3 -0
- package/esm/_internal/link-preview.js.map +1 -1
- package/esm/_internal/mdi.js +2 -2
- package/esm/_internal/mdi.js.map +1 -1
- package/esm/_internal/mosaic.js +3 -0
- package/esm/_internal/mosaic.js.map +1 -1
- package/esm/_internal/post-block.js +3 -0
- package/esm/_internal/post-block.js.map +1 -1
- package/esm/_internal/slider.js +2 -1
- package/esm/_internal/slider.js.map +1 -1
- package/esm/_internal/thumbnail.js +3 -0
- package/esm/_internal/thumbnail.js.map +1 -1
- package/esm/_internal/user-block.js +2 -1
- package/esm/_internal/user-block.js.map +1 -1
- package/esm/index.js +3 -2
- package/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/avatar/Avatar.tsx +0 -8
- package/src/components/drag-handle/DragHandle.tsx +5 -1
- package/src/components/flag/Flag.test.tsx +1 -2
- package/src/components/flag/Flag.tsx +2 -10
- package/src/components/flag/__snapshots__/Flag.test.tsx.snap +0 -15
- package/src/components/icon/Icon.tsx +10 -1
- package/src/components/message/Message.tsx +2 -2
- package/src/components/thumbnail/Thumbnail.stories.tsx +42 -347
- package/src/components/thumbnail/Thumbnail.test.tsx +2 -20
- package/src/components/thumbnail/Thumbnail.tsx +45 -73
- package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +6 -53
- package/src/components/thumbnail/useFocusPoint.ts +10 -18
- package/src/components/thumbnail/useImageLoad.ts +22 -23
- package/src/components/user-block/UserBlock.stories.tsx +4 -30
- package/src/components/user-block/UserBlock.tsx +16 -41
- package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +145 -244
- package/src/hooks/useOnResize.ts +0 -6
- package/src/stories/knobs/image.ts +3 -35
- package/types.d.ts +0 -14
|
@@ -3,37 +3,41 @@
|
|
|
3
3
|
exports[`<UserBlock> Snapshots and structure should render story 'InList' 1`] = `
|
|
4
4
|
Array [
|
|
5
5
|
<div
|
|
6
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light
|
|
6
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
7
7
|
onMouseEnter={[Function]}
|
|
8
8
|
onMouseLeave={[Function]}
|
|
9
9
|
>
|
|
10
|
-
<
|
|
11
|
-
alt="Avatar"
|
|
12
|
-
badge={
|
|
13
|
-
<Badge
|
|
14
|
-
color="blue"
|
|
15
|
-
>
|
|
16
|
-
<Icon
|
|
17
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
18
|
-
/>
|
|
19
|
-
</Badge>
|
|
20
|
-
}
|
|
10
|
+
<div
|
|
21
11
|
className="lumx-user-block__avatar"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
>
|
|
13
|
+
<Avatar
|
|
14
|
+
alt="Avatar"
|
|
15
|
+
badge={
|
|
16
|
+
<Badge
|
|
17
|
+
color="blue"
|
|
18
|
+
>
|
|
19
|
+
<Icon
|
|
20
|
+
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
21
|
+
/>
|
|
22
|
+
</Badge>
|
|
23
|
+
}
|
|
24
|
+
image="/demo-assets/avatar1.jpg"
|
|
25
|
+
onClick={[Function]}
|
|
26
|
+
size="m"
|
|
27
|
+
tabIndex={0}
|
|
28
|
+
theme="light"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
27
31
|
<div
|
|
28
32
|
className="lumx-user-block__wrapper"
|
|
29
33
|
>
|
|
30
|
-
<
|
|
31
|
-
className="lumx-user-block__name
|
|
34
|
+
<span
|
|
35
|
+
className="lumx-user-block__name"
|
|
32
36
|
onClick={[Function]}
|
|
33
|
-
|
|
37
|
+
tabIndex={0}
|
|
34
38
|
>
|
|
35
39
|
Emmitt O. Lum
|
|
36
|
-
</
|
|
40
|
+
</span>
|
|
37
41
|
<div
|
|
38
42
|
className="lumx-user-block__fields"
|
|
39
43
|
>
|
|
@@ -53,37 +57,41 @@ Array [
|
|
|
53
57
|
</div>
|
|
54
58
|
</div>,
|
|
55
59
|
<div
|
|
56
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light
|
|
60
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
57
61
|
onMouseEnter={[Function]}
|
|
58
62
|
onMouseLeave={[Function]}
|
|
59
63
|
>
|
|
60
|
-
<
|
|
61
|
-
alt="Avatar"
|
|
62
|
-
badge={
|
|
63
|
-
<Badge
|
|
64
|
-
color="blue"
|
|
65
|
-
>
|
|
66
|
-
<Icon
|
|
67
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
68
|
-
/>
|
|
69
|
-
</Badge>
|
|
70
|
-
}
|
|
64
|
+
<div
|
|
71
65
|
className="lumx-user-block__avatar"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
>
|
|
67
|
+
<Avatar
|
|
68
|
+
alt="Avatar"
|
|
69
|
+
badge={
|
|
70
|
+
<Badge
|
|
71
|
+
color="blue"
|
|
72
|
+
>
|
|
73
|
+
<Icon
|
|
74
|
+
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
75
|
+
/>
|
|
76
|
+
</Badge>
|
|
77
|
+
}
|
|
78
|
+
image="/demo-assets/avatar2.jpg"
|
|
79
|
+
onClick={[Function]}
|
|
80
|
+
size="m"
|
|
81
|
+
tabIndex={0}
|
|
82
|
+
theme="light"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
77
85
|
<div
|
|
78
86
|
className="lumx-user-block__wrapper"
|
|
79
87
|
>
|
|
80
|
-
<
|
|
81
|
-
className="lumx-user-block__name
|
|
88
|
+
<span
|
|
89
|
+
className="lumx-user-block__name"
|
|
82
90
|
onClick={[Function]}
|
|
83
|
-
|
|
91
|
+
tabIndex={0}
|
|
84
92
|
>
|
|
85
93
|
Emmitt O. Lum
|
|
86
|
-
</
|
|
94
|
+
</span>
|
|
87
95
|
<div
|
|
88
96
|
className="lumx-user-block__fields"
|
|
89
97
|
>
|
|
@@ -103,37 +111,41 @@ Array [
|
|
|
103
111
|
</div>
|
|
104
112
|
</div>,
|
|
105
113
|
<div
|
|
106
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light
|
|
114
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
107
115
|
onMouseEnter={[Function]}
|
|
108
116
|
onMouseLeave={[Function]}
|
|
109
117
|
>
|
|
110
|
-
<
|
|
111
|
-
alt="Avatar"
|
|
112
|
-
badge={
|
|
113
|
-
<Badge
|
|
114
|
-
color="blue"
|
|
115
|
-
>
|
|
116
|
-
<Icon
|
|
117
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
118
|
-
/>
|
|
119
|
-
</Badge>
|
|
120
|
-
}
|
|
118
|
+
<div
|
|
121
119
|
className="lumx-user-block__avatar"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
>
|
|
121
|
+
<Avatar
|
|
122
|
+
alt="Avatar"
|
|
123
|
+
badge={
|
|
124
|
+
<Badge
|
|
125
|
+
color="blue"
|
|
126
|
+
>
|
|
127
|
+
<Icon
|
|
128
|
+
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
129
|
+
/>
|
|
130
|
+
</Badge>
|
|
131
|
+
}
|
|
132
|
+
image="/demo-assets/avatar3.jpg"
|
|
133
|
+
onClick={[Function]}
|
|
134
|
+
size="m"
|
|
135
|
+
tabIndex={0}
|
|
136
|
+
theme="light"
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
127
139
|
<div
|
|
128
140
|
className="lumx-user-block__wrapper"
|
|
129
141
|
>
|
|
130
|
-
<
|
|
131
|
-
className="lumx-user-block__name
|
|
142
|
+
<span
|
|
143
|
+
className="lumx-user-block__name"
|
|
132
144
|
onClick={[Function]}
|
|
133
|
-
|
|
145
|
+
tabIndex={0}
|
|
134
146
|
>
|
|
135
147
|
Emmitt O. Lum
|
|
136
|
-
</
|
|
148
|
+
</span>
|
|
137
149
|
<div
|
|
138
150
|
className="lumx-user-block__fields"
|
|
139
151
|
>
|
|
@@ -158,53 +170,61 @@ Array [
|
|
|
158
170
|
exports[`<UserBlock> Snapshots and structure should render story 'Sizes' 1`] = `
|
|
159
171
|
Array [
|
|
160
172
|
<div
|
|
161
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-s lumx-user-block--theme-light
|
|
173
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-s lumx-user-block--theme-light"
|
|
162
174
|
onMouseEnter={[Function]}
|
|
163
175
|
onMouseLeave={[Function]}
|
|
164
176
|
>
|
|
165
|
-
<
|
|
166
|
-
alt="Avatar"
|
|
177
|
+
<div
|
|
167
178
|
className="lumx-user-block__avatar"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
179
|
+
>
|
|
180
|
+
<Avatar
|
|
181
|
+
alt="Avatar"
|
|
182
|
+
image="/demo-assets/avatar1.jpg"
|
|
183
|
+
onClick={[Function]}
|
|
184
|
+
size="s"
|
|
185
|
+
tabIndex={0}
|
|
186
|
+
theme="light"
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
173
189
|
<div
|
|
174
190
|
className="lumx-user-block__wrapper"
|
|
175
191
|
>
|
|
176
|
-
<
|
|
177
|
-
className="lumx-user-block__name
|
|
192
|
+
<span
|
|
193
|
+
className="lumx-user-block__name"
|
|
178
194
|
onClick={[Function]}
|
|
179
|
-
|
|
195
|
+
tabIndex={0}
|
|
180
196
|
>
|
|
181
197
|
Emmitt O. Lum
|
|
182
|
-
</
|
|
198
|
+
</span>
|
|
183
199
|
</div>
|
|
184
200
|
</div>,
|
|
185
201
|
<div
|
|
186
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light
|
|
202
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light"
|
|
187
203
|
onMouseEnter={[Function]}
|
|
188
204
|
onMouseLeave={[Function]}
|
|
189
205
|
>
|
|
190
|
-
<
|
|
191
|
-
alt="Avatar"
|
|
206
|
+
<div
|
|
192
207
|
className="lumx-user-block__avatar"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
208
|
+
>
|
|
209
|
+
<Avatar
|
|
210
|
+
alt="Avatar"
|
|
211
|
+
image="/demo-assets/avatar1.jpg"
|
|
212
|
+
onClick={[Function]}
|
|
213
|
+
size="m"
|
|
214
|
+
tabIndex={0}
|
|
215
|
+
theme="light"
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
198
218
|
<div
|
|
199
219
|
className="lumx-user-block__wrapper"
|
|
200
220
|
>
|
|
201
|
-
<
|
|
202
|
-
className="lumx-user-block__name
|
|
221
|
+
<span
|
|
222
|
+
className="lumx-user-block__name"
|
|
203
223
|
onClick={[Function]}
|
|
204
|
-
|
|
224
|
+
tabIndex={0}
|
|
205
225
|
>
|
|
206
226
|
Emmitt O. Lum
|
|
207
|
-
</
|
|
227
|
+
</span>
|
|
208
228
|
<div
|
|
209
229
|
className="lumx-user-block__fields"
|
|
210
230
|
>
|
|
@@ -224,28 +244,32 @@ Array [
|
|
|
224
244
|
</div>
|
|
225
245
|
</div>,
|
|
226
246
|
<div
|
|
227
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-l lumx-user-block--theme-light
|
|
247
|
+
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-l lumx-user-block--theme-light"
|
|
228
248
|
onMouseEnter={[Function]}
|
|
229
249
|
onMouseLeave={[Function]}
|
|
230
250
|
>
|
|
231
|
-
<
|
|
232
|
-
alt="Avatar"
|
|
251
|
+
<div
|
|
233
252
|
className="lumx-user-block__avatar"
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
253
|
+
>
|
|
254
|
+
<Avatar
|
|
255
|
+
alt="Avatar"
|
|
256
|
+
image="/demo-assets/avatar1.jpg"
|
|
257
|
+
onClick={[Function]}
|
|
258
|
+
size="l"
|
|
259
|
+
tabIndex={0}
|
|
260
|
+
theme="light"
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
239
263
|
<div
|
|
240
264
|
className="lumx-user-block__wrapper"
|
|
241
265
|
>
|
|
242
|
-
<
|
|
243
|
-
className="lumx-user-block__name
|
|
266
|
+
<span
|
|
267
|
+
className="lumx-user-block__name"
|
|
244
268
|
onClick={[Function]}
|
|
245
|
-
|
|
269
|
+
tabIndex={0}
|
|
246
270
|
>
|
|
247
271
|
Emmitt O. Lum
|
|
248
|
-
</
|
|
272
|
+
</span>
|
|
249
273
|
<div
|
|
250
274
|
className="lumx-user-block__fields"
|
|
251
275
|
>
|
|
@@ -273,27 +297,34 @@ exports[`<UserBlock> Snapshots and structure should render story 'WithBadge' 1`]
|
|
|
273
297
|
onMouseEnter={[Function]}
|
|
274
298
|
onMouseLeave={[Function]}
|
|
275
299
|
>
|
|
276
|
-
<
|
|
277
|
-
alt="Avatar"
|
|
278
|
-
badge={
|
|
279
|
-
<Badge
|
|
280
|
-
color="blue"
|
|
281
|
-
>
|
|
282
|
-
<Icon
|
|
283
|
-
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
284
|
-
/>
|
|
285
|
-
</Badge>
|
|
286
|
-
}
|
|
300
|
+
<div
|
|
287
301
|
className="lumx-user-block__avatar"
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
302
|
+
>
|
|
303
|
+
<Avatar
|
|
304
|
+
alt="Avatar"
|
|
305
|
+
badge={
|
|
306
|
+
<Badge
|
|
307
|
+
color="blue"
|
|
308
|
+
>
|
|
309
|
+
<Icon
|
|
310
|
+
icon="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"
|
|
311
|
+
/>
|
|
312
|
+
</Badge>
|
|
313
|
+
}
|
|
314
|
+
image="/demo-assets/avatar1.jpg"
|
|
315
|
+
onClick={[Function]}
|
|
316
|
+
size="m"
|
|
317
|
+
tabIndex={0}
|
|
318
|
+
theme="light"
|
|
319
|
+
/>
|
|
320
|
+
</div>
|
|
292
321
|
<div
|
|
293
322
|
className="lumx-user-block__wrapper"
|
|
294
323
|
>
|
|
295
324
|
<span
|
|
296
325
|
className="lumx-user-block__name"
|
|
326
|
+
onClick={[Function]}
|
|
327
|
+
tabIndex={0}
|
|
297
328
|
>
|
|
298
329
|
Emmitt O. Lum
|
|
299
330
|
</span>
|
|
@@ -316,133 +347,3 @@ exports[`<UserBlock> Snapshots and structure should render story 'WithBadge' 1`]
|
|
|
316
347
|
</div>
|
|
317
348
|
</div>
|
|
318
349
|
`;
|
|
319
|
-
|
|
320
|
-
exports[`<UserBlock> Snapshots and structure should render story 'WithLinks' 1`] = `
|
|
321
|
-
Array [
|
|
322
|
-
<div
|
|
323
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-s lumx-user-block--theme-light lumx-user-block--is-clickable"
|
|
324
|
-
onMouseEnter={[Function]}
|
|
325
|
-
onMouseLeave={[Function]}
|
|
326
|
-
>
|
|
327
|
-
<Avatar
|
|
328
|
-
alt="Avatar"
|
|
329
|
-
className="lumx-user-block__avatar"
|
|
330
|
-
image="/demo-assets/avatar1.jpg"
|
|
331
|
-
linkProps={
|
|
332
|
-
Object {
|
|
333
|
-
"href": "https://www.lumapps.com",
|
|
334
|
-
"target": "_blank",
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
onClick={[Function]}
|
|
338
|
-
size="s"
|
|
339
|
-
theme="light"
|
|
340
|
-
/>
|
|
341
|
-
<div
|
|
342
|
-
className="lumx-user-block__wrapper"
|
|
343
|
-
>
|
|
344
|
-
<a
|
|
345
|
-
className="lumx-user-block__name lumx-user-block__name--is-clickable"
|
|
346
|
-
href="https://www.lumapps.com"
|
|
347
|
-
target="_blank"
|
|
348
|
-
>
|
|
349
|
-
Emmitt O. Lum
|
|
350
|
-
</a>
|
|
351
|
-
</div>
|
|
352
|
-
</div>,
|
|
353
|
-
<div
|
|
354
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-m lumx-user-block--theme-light lumx-user-block--is-clickable"
|
|
355
|
-
onMouseEnter={[Function]}
|
|
356
|
-
onMouseLeave={[Function]}
|
|
357
|
-
>
|
|
358
|
-
<Avatar
|
|
359
|
-
alt="Avatar"
|
|
360
|
-
className="lumx-user-block__avatar"
|
|
361
|
-
image="/demo-assets/avatar1.jpg"
|
|
362
|
-
linkProps={
|
|
363
|
-
Object {
|
|
364
|
-
"href": "https://www.lumapps.com",
|
|
365
|
-
"target": "_blank",
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
onClick={[Function]}
|
|
369
|
-
size="m"
|
|
370
|
-
theme="light"
|
|
371
|
-
/>
|
|
372
|
-
<div
|
|
373
|
-
className="lumx-user-block__wrapper"
|
|
374
|
-
>
|
|
375
|
-
<a
|
|
376
|
-
className="lumx-user-block__name lumx-user-block__name--is-clickable"
|
|
377
|
-
href="https://www.lumapps.com"
|
|
378
|
-
target="_blank"
|
|
379
|
-
>
|
|
380
|
-
Emmitt O. Lum
|
|
381
|
-
</a>
|
|
382
|
-
<div
|
|
383
|
-
className="lumx-user-block__fields"
|
|
384
|
-
>
|
|
385
|
-
<span
|
|
386
|
-
className="lumx-user-block__field"
|
|
387
|
-
key="0"
|
|
388
|
-
>
|
|
389
|
-
Creative developer
|
|
390
|
-
</span>
|
|
391
|
-
<span
|
|
392
|
-
className="lumx-user-block__field"
|
|
393
|
-
key="1"
|
|
394
|
-
>
|
|
395
|
-
Denpasar
|
|
396
|
-
</span>
|
|
397
|
-
</div>
|
|
398
|
-
</div>
|
|
399
|
-
</div>,
|
|
400
|
-
<div
|
|
401
|
-
className="lumx-user-block lumx-user-block--orientation-horizontal lumx-user-block--size-l lumx-user-block--theme-light lumx-user-block--is-clickable"
|
|
402
|
-
onMouseEnter={[Function]}
|
|
403
|
-
onMouseLeave={[Function]}
|
|
404
|
-
>
|
|
405
|
-
<Avatar
|
|
406
|
-
alt="Avatar"
|
|
407
|
-
className="lumx-user-block__avatar"
|
|
408
|
-
image="/demo-assets/avatar1.jpg"
|
|
409
|
-
linkProps={
|
|
410
|
-
Object {
|
|
411
|
-
"href": "https://www.lumapps.com",
|
|
412
|
-
"target": "_blank",
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
onClick={[Function]}
|
|
416
|
-
size="l"
|
|
417
|
-
theme="light"
|
|
418
|
-
/>
|
|
419
|
-
<div
|
|
420
|
-
className="lumx-user-block__wrapper"
|
|
421
|
-
>
|
|
422
|
-
<a
|
|
423
|
-
className="lumx-user-block__name lumx-user-block__name--is-clickable"
|
|
424
|
-
href="https://www.lumapps.com"
|
|
425
|
-
target="_blank"
|
|
426
|
-
>
|
|
427
|
-
Emmitt O. Lum
|
|
428
|
-
</a>
|
|
429
|
-
<div
|
|
430
|
-
className="lumx-user-block__fields"
|
|
431
|
-
>
|
|
432
|
-
<span
|
|
433
|
-
className="lumx-user-block__field"
|
|
434
|
-
key="0"
|
|
435
|
-
>
|
|
436
|
-
Creative developer
|
|
437
|
-
</span>
|
|
438
|
-
<span
|
|
439
|
-
className="lumx-user-block__field"
|
|
440
|
-
key="1"
|
|
441
|
-
>
|
|
442
|
-
Denpasar
|
|
443
|
-
</span>
|
|
444
|
-
</div>
|
|
445
|
-
</div>
|
|
446
|
-
</div>,
|
|
447
|
-
]
|
|
448
|
-
`;
|
package/src/hooks/useOnResize.ts
CHANGED
|
@@ -23,12 +23,6 @@ export function useOnResize(element: HTMLElement | Falsy, update: RefObject<Call
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// Do not update on first resize.
|
|
27
|
-
if (previousSize.current && previousSize.current.height <= 1) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Do not update if size hasn't really changed.
|
|
32
26
|
const { width, height } = entry.contentRect;
|
|
33
27
|
if (previousSize.current?.width === width && previousSize.current?.height === height) {
|
|
34
28
|
return;
|
|
@@ -6,19 +6,18 @@ const avatar3 = '/demo-assets/avatar3.jpg';
|
|
|
6
6
|
const avatar4 = '/demo-assets/avatar4.jpg';
|
|
7
7
|
const landscape1 = '/demo-assets/landscape1.jpg';
|
|
8
8
|
const landscape2 = '/demo-assets/landscape2.jpg';
|
|
9
|
-
const landscape1s200 = '/demo-assets/landscape1-s200.jpg';
|
|
10
9
|
const landscape3 = '/demo-assets/landscape3.jpg';
|
|
11
10
|
const portrait1 = '/demo-assets/portrait1.jpg';
|
|
12
|
-
const portrait1s200 = '/demo-assets/portrait1-s200.jpg';
|
|
13
11
|
const portrait2 = '/demo-assets/portrait2.jpg';
|
|
14
12
|
const portrait3 = '/demo-assets/portrait3.jpg';
|
|
15
13
|
const square1 = '/demo-assets/square1.jpg';
|
|
16
14
|
const square2 = '/demo-assets/square2.jpg';
|
|
17
15
|
|
|
18
16
|
export const AVATAR_IMAGES = { avatar1, avatar2, avatar3, avatar4 };
|
|
17
|
+
|
|
19
18
|
export const SQUARE_IMAGES = { square1, square2 };
|
|
20
|
-
export const LANDSCAPE_IMAGES = { landscape1,
|
|
21
|
-
export const PORTRAIT_IMAGES = { portrait1,
|
|
19
|
+
export const LANDSCAPE_IMAGES = { landscape1, landscape2, landscape3 };
|
|
20
|
+
export const PORTRAIT_IMAGES = { portrait1, portrait2, portrait3 };
|
|
22
21
|
|
|
23
22
|
export const IMAGES = { ...LANDSCAPE_IMAGES, ...PORTRAIT_IMAGES, ...SQUARE_IMAGES, ...AVATAR_IMAGES };
|
|
24
23
|
|
|
@@ -36,34 +35,3 @@ export const squareImageKnob = (name = 'Image', value = Object.values(SQUARE_IMA
|
|
|
36
35
|
|
|
37
36
|
export const imageKnob = (name = 'Image', value = Object.values(IMAGES)[0], groupId?: string) =>
|
|
38
37
|
select(name, IMAGES, value, groupId);
|
|
39
|
-
|
|
40
|
-
type Size = { width: number; height: number };
|
|
41
|
-
|
|
42
|
-
export const AVATAR_IMAGE_SIZES: Record<keyof typeof AVATAR_IMAGES, Size> = {
|
|
43
|
-
avatar1: { width: 128, height: 128 },
|
|
44
|
-
avatar2: { width: 150, height: 150 },
|
|
45
|
-
avatar3: { width: 128, height: 128 },
|
|
46
|
-
avatar4: { width: 128, height: 128 },
|
|
47
|
-
};
|
|
48
|
-
export const SQUARE_IMAGE_SIZES: Record<keyof typeof SQUARE_IMAGES, Size> = {
|
|
49
|
-
square1: { width: 72, height: 72 },
|
|
50
|
-
square2: { width: 300, height: 300 },
|
|
51
|
-
};
|
|
52
|
-
export const LANDSCAPE_IMAGE_SIZES: Record<keyof typeof LANDSCAPE_IMAGES, Size> = {
|
|
53
|
-
landscape1: { width: 800, height: 546 },
|
|
54
|
-
landscape1s200: { width: 200, height: 150 },
|
|
55
|
-
landscape2: { width: 800, height: 600 },
|
|
56
|
-
landscape3: { width: 640, height: 480 },
|
|
57
|
-
};
|
|
58
|
-
export const PORTRAIT_IMAGE_SIZES: Record<keyof typeof PORTRAIT_IMAGES, Size> = {
|
|
59
|
-
portrait1: { width: 275, height: 500 },
|
|
60
|
-
portrait1s200: { width: 200, height: 364 },
|
|
61
|
-
portrait2: { width: 350, height: 500 },
|
|
62
|
-
portrait3: { width: 300, height: 500 },
|
|
63
|
-
};
|
|
64
|
-
export const IMAGE_SIZES: Record<keyof typeof IMAGES, Size> = {
|
|
65
|
-
...LANDSCAPE_IMAGE_SIZES,
|
|
66
|
-
...PORTRAIT_IMAGE_SIZES,
|
|
67
|
-
...SQUARE_IMAGE_SIZES,
|
|
68
|
-
...AVATAR_IMAGE_SIZES,
|
|
69
|
-
};
|
package/types.d.ts
CHANGED
|
@@ -440,10 +440,6 @@ export interface AvatarProps extends GenericProps {
|
|
|
440
440
|
theme?: Theme;
|
|
441
441
|
/** Props to pass to the thumbnail (minus those already set by the Avatar props). */
|
|
442
442
|
thumbnailProps?: Omit<ThumbnailProps, "image" | "alt" | "size" | "theme" | "align" | "fillHeight" | "variant" | "aspectRatio">;
|
|
443
|
-
/** Props to pass to the link wrapping the thumbnail. */
|
|
444
|
-
linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
445
|
-
/** Custom react component for the link (can be used to inject react router Link). */
|
|
446
|
-
linkAs?: "a" | any;
|
|
447
443
|
}
|
|
448
444
|
/**
|
|
449
445
|
* Avatar component.
|
|
@@ -1237,8 +1233,6 @@ export interface ThumbnailProps extends GenericProps {
|
|
|
1237
1233
|
imgProps?: ImgHTMLProps;
|
|
1238
1234
|
/** Reference to the native <img> element. */
|
|
1239
1235
|
imgRef?: Ref<HTMLImageElement>;
|
|
1240
|
-
/** Set to true to force the display of the loading skeleton. */
|
|
1241
|
-
isLoading?: boolean;
|
|
1242
1236
|
/** Size variant of the component. */
|
|
1243
1237
|
size?: ThumbnailSize;
|
|
1244
1238
|
/** Image loading mode. */
|
|
@@ -1251,10 +1245,6 @@ export interface ThumbnailProps extends GenericProps {
|
|
|
1251
1245
|
theme?: Theme;
|
|
1252
1246
|
/** Variant of the component. */
|
|
1253
1247
|
variant?: ThumbnailVariant;
|
|
1254
|
-
/** Props to pass to the link wrapping the thumbnail. */
|
|
1255
|
-
linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
1256
|
-
/** Custom react component for the link (can be used to inject react router Link). */
|
|
1257
|
-
linkAs?: "a" | any;
|
|
1258
1248
|
}
|
|
1259
1249
|
/**
|
|
1260
1250
|
* Thumbnail component.
|
|
@@ -2531,10 +2521,6 @@ export declare type UserBlockSize = Extract<Size, "s" | "m" | "l">;
|
|
|
2531
2521
|
export interface UserBlockProps extends GenericProps {
|
|
2532
2522
|
/** Props to pass to the avatar. */
|
|
2533
2523
|
avatarProps?: AvatarProps;
|
|
2534
|
-
/** Props to pass to the link wrapping the avatar thumbnail. */
|
|
2535
|
-
linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
2536
|
-
/** Custom react component for the link (can be used to inject react router Link). */
|
|
2537
|
-
linkAs?: "a" | any;
|
|
2538
2524
|
/** Simple action toolbar content. */
|
|
2539
2525
|
simpleAction?: ReactNode;
|
|
2540
2526
|
/** Multiple action toolbar content. */
|