@lumx/react 2.1.8 → 2.1.9-alpha-thumbnail4
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/ImageBlock.js +0 -1
- package/esm/_internal/ImageBlock.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 +21 -2
- package/esm/_internal/Slider2.js.map +1 -1
- package/esm/_internal/Thumbnail2.js +61 -764
- 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 +0 -3
- package/esm/_internal/avatar.js.map +1 -1
- package/esm/_internal/comment-block.js +0 -3
- package/esm/_internal/comment-block.js.map +1 -1
- package/esm/_internal/image-block.js +0 -3
- package/esm/_internal/image-block.js.map +1 -1
- package/esm/_internal/link-preview.js +0 -3
- 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 +0 -3
- package/esm/_internal/mosaic.js.map +1 -1
- package/esm/_internal/post-block.js +0 -3
- package/esm/_internal/post-block.js.map +1 -1
- package/esm/_internal/slider.js +1 -2
- package/esm/_internal/slider.js.map +1 -1
- package/esm/_internal/thumbnail.js +0 -3
- package/esm/_internal/thumbnail.js.map +1 -1
- package/esm/_internal/user-block.js +0 -4
- package/esm/_internal/user-block.js.map +1 -1
- package/esm/index.js +1 -3
- 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/image-block/ImageBlock.tsx +0 -1
- package/src/components/message/Message.tsx +2 -2
- package/src/components/thumbnail/Thumbnail.stories.tsx +399 -59
- package/src/components/thumbnail/Thumbnail.test.tsx +6 -6
- package/src/components/thumbnail/Thumbnail.tsx +35 -34
- package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +6 -53
- package/src/components/thumbnail/useFocusPoint.ts +18 -10
- package/src/components/thumbnail/useImageLoad.ts +23 -22
- 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 +6 -0
- package/src/stories/knobs/image.ts +35 -3
- package/types.d.ts +2 -8
- package/esm/_internal/clamp.js +0 -22
- package/esm/_internal/clamp.js.map +0 -1
|
@@ -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,6 +23,12 @@ 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.
|
|
26
32
|
const { width, height } = entry.contentRect;
|
|
27
33
|
if (previousSize.current?.width === width && previousSize.current?.height === height) {
|
|
28
34
|
return;
|
|
@@ -6,18 +6,19 @@ 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';
|
|
9
10
|
const landscape3 = '/demo-assets/landscape3.jpg';
|
|
10
11
|
const portrait1 = '/demo-assets/portrait1.jpg';
|
|
12
|
+
const portrait1s200 = '/demo-assets/portrait1-s200.jpg';
|
|
11
13
|
const portrait2 = '/demo-assets/portrait2.jpg';
|
|
12
14
|
const portrait3 = '/demo-assets/portrait3.jpg';
|
|
13
15
|
const square1 = '/demo-assets/square1.jpg';
|
|
14
16
|
const square2 = '/demo-assets/square2.jpg';
|
|
15
17
|
|
|
16
18
|
export const AVATAR_IMAGES = { avatar1, avatar2, avatar3, avatar4 };
|
|
17
|
-
|
|
18
19
|
export const SQUARE_IMAGES = { square1, square2 };
|
|
19
|
-
export const LANDSCAPE_IMAGES = { landscape1, landscape2, landscape3 };
|
|
20
|
-
export const PORTRAIT_IMAGES = { portrait1, portrait2, portrait3 };
|
|
20
|
+
export const LANDSCAPE_IMAGES = { landscape1, landscape1s200, landscape2, landscape3 };
|
|
21
|
+
export const PORTRAIT_IMAGES = { portrait1, portrait1s200, portrait2, portrait3 };
|
|
21
22
|
|
|
22
23
|
export const IMAGES = { ...LANDSCAPE_IMAGES, ...PORTRAIT_IMAGES, ...SQUARE_IMAGES, ...AVATAR_IMAGES };
|
|
23
24
|
|
|
@@ -35,3 +36,34 @@ export const squareImageKnob = (name = 'Image', value = Object.values(SQUARE_IMA
|
|
|
35
36
|
|
|
36
37
|
export const imageKnob = (name = 'Image', value = Object.values(IMAGES)[0], groupId?: string) =>
|
|
37
38
|
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,6 +1233,8 @@ export interface ThumbnailProps extends GenericProps {
|
|
|
1237
1233
|
imgProps?: ImgHTMLProps;
|
|
1238
1234
|
/** Reference to the native <img> element. */
|
|
1239
1235
|
imgRef?: Ref<HTMLImageElement>;
|
|
1236
|
+
/** Set to true to force the display of the loading skeleton. */
|
|
1237
|
+
isLoading?: boolean;
|
|
1240
1238
|
/** Size variant of the component. */
|
|
1241
1239
|
size?: ThumbnailSize;
|
|
1242
1240
|
/** Image loading mode. */
|
|
@@ -2529,10 +2527,6 @@ export declare type UserBlockSize = Extract<Size, "s" | "m" | "l">;
|
|
|
2529
2527
|
export interface UserBlockProps extends GenericProps {
|
|
2530
2528
|
/** Props to pass to the avatar. */
|
|
2531
2529
|
avatarProps?: AvatarProps;
|
|
2532
|
-
/** Props to pass to the link wrapping the avatar thumbnail. */
|
|
2533
|
-
linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
2534
|
-
/** Custom react component for the link (can be used to inject react router Link). */
|
|
2535
|
-
linkAs?: "a" | any;
|
|
2536
2530
|
/** Simple action toolbar content. */
|
|
2537
2531
|
simpleAction?: ReactNode;
|
|
2538
2532
|
/** Multiple action toolbar content. */
|
package/esm/_internal/clamp.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clamp value in range.
|
|
3
|
-
*
|
|
4
|
-
* @param value Value to clamp.
|
|
5
|
-
* @param min Minimum value.
|
|
6
|
-
* @param max Maximum value.
|
|
7
|
-
* @return Clamped value.
|
|
8
|
-
*/
|
|
9
|
-
var clamp = function clamp(value, min, max) {
|
|
10
|
-
if (value < min) {
|
|
11
|
-
return min;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (value > max) {
|
|
15
|
-
return max;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return value;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { clamp as c };
|
|
22
|
-
//# sourceMappingURL=clamp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clamp.js","sources":["../../../src/utils/clamp.ts"],"sourcesContent":["/**\n * Clamp value in range.\n *\n * @param value Value to clamp.\n * @param min Minimum value.\n * @param max Maximum value.\n * @return Clamped value.\n */\nexport const clamp = (value: number, min: number, max: number): number => {\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n};\n"],"names":["clamp","value","min","max"],"mappings":"AAAA;;;;;;;;IAQaA,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAgBC,GAAhB,EAA6BC,GAA7B,EAAqD;AACtE,MAAIF,KAAK,GAAGC,GAAZ,EAAiB;AACb,WAAOA,GAAP;AACH;;AACD,MAAID,KAAK,GAAGE,GAAZ,EAAiB;AACb,WAAOA,GAAP;AACH;;AACD,SAAOF,KAAP;AACH;;;;"}
|