@lumx/react 2.1.9-alpha-thumbnail → 2.1.9-alpha-thumbnail5

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.
Files changed (48) hide show
  1. package/esm/_internal/Avatar2.js +1 -5
  2. package/esm/_internal/Avatar2.js.map +1 -1
  3. package/esm/_internal/DragHandle.js +1 -1
  4. package/esm/_internal/DragHandle.js.map +1 -1
  5. package/esm/_internal/Flag2.js +1 -3
  6. package/esm/_internal/Flag2.js.map +1 -1
  7. package/esm/_internal/Icon2.js +9 -1
  8. package/esm/_internal/Icon2.js.map +1 -1
  9. package/esm/_internal/ImageBlock.js +0 -1
  10. package/esm/_internal/ImageBlock.js.map +1 -1
  11. package/esm/_internal/List2.js.map +1 -1
  12. package/esm/_internal/Message2.js +2 -2
  13. package/esm/_internal/Message2.js.map +1 -1
  14. package/esm/_internal/Thumbnail2.js +20 -12
  15. package/esm/_internal/Thumbnail2.js.map +1 -1
  16. package/esm/_internal/UserBlock.js +14 -45
  17. package/esm/_internal/UserBlock.js.map +1 -1
  18. package/esm/_internal/user-block.js +0 -2
  19. package/esm/_internal/user-block.js.map +1 -1
  20. package/esm/index.js +0 -1
  21. package/esm/index.js.map +1 -1
  22. package/package.json +4 -4
  23. package/src/components/avatar/Avatar.tsx +0 -8
  24. package/src/components/avatar/__snapshots__/Avatar.test.tsx.snap +30 -30
  25. package/src/components/drag-handle/DragHandle.tsx +5 -1
  26. package/src/components/flag/Flag.test.tsx +1 -2
  27. package/src/components/flag/Flag.tsx +2 -10
  28. package/src/components/flag/__snapshots__/Flag.test.tsx.snap +0 -15
  29. package/src/components/icon/Icon.tsx +10 -1
  30. package/src/components/image-block/ImageBlock.tsx +0 -1
  31. package/src/components/image-block/__snapshots__/ImageBlock.test.tsx.snap +1 -1
  32. package/src/components/message/Message.tsx +2 -2
  33. package/src/components/mosaic/__snapshots__/Mosaic.test.tsx.snap +30 -30
  34. package/src/components/post-block/__snapshots__/PostBlock.test.tsx.snap +1 -1
  35. package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +10 -10
  36. package/src/components/table/__snapshots__/Table.test.tsx.snap +3 -3
  37. package/src/components/thumbnail/Thumbnail.stories.tsx +79 -47
  38. package/src/components/thumbnail/Thumbnail.test.tsx +0 -6
  39. package/src/components/thumbnail/Thumbnail.tsx +20 -10
  40. package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +39 -116
  41. package/src/components/user-block/UserBlock.stories.tsx +4 -30
  42. package/src/components/user-block/UserBlock.tsx +16 -41
  43. package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +145 -244
  44. package/src/hooks/useOnResize.ts +0 -6
  45. package/src/stories/generated/List/Demos.stories.tsx +2 -0
  46. package/types.d.ts +0 -8
  47. package/src/components/thumbnail/useClickable.ts +0 -26
  48. package/src/components/thumbnail/useFocusPoint.ts +0 -162
@@ -15,7 +15,7 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
15
15
  align="left"
16
16
  alt="Image 1"
17
17
  aspectRatio="free"
18
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
18
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
19
19
  fillHeight={true}
20
20
  image="/demo-assets/landscape1.jpg"
21
21
  loading="lazy"
@@ -30,9 +30,9 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
30
30
  align="left"
31
31
  alt="Image 2"
32
32
  aspectRatio="free"
33
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
33
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
34
34
  fillHeight={true}
35
- image="/demo-assets/landscape2.jpg"
35
+ image="/demo-assets/landscape1-s200.jpg"
36
36
  loading="lazy"
37
37
  theme="light"
38
38
  />
@@ -45,9 +45,9 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
45
45
  align="left"
46
46
  alt="Image 3"
47
47
  aspectRatio="free"
48
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
48
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
49
49
  fillHeight={true}
50
- image="/demo-assets/landscape3.jpg"
50
+ image="/demo-assets/landscape2.jpg"
51
51
  loading="lazy"
52
52
  theme="light"
53
53
  />
@@ -60,9 +60,9 @@ exports[`<Mosaic> Snapshots and structure should render story FiveThumbnails 1`]
60
60
  align="left"
61
61
  alt="Image 4"
62
62
  aspectRatio="free"
63
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
63
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
64
64
  fillHeight={true}
65
- image="/demo-assets/portrait1.jpg"
65
+ image="/demo-assets/landscape3.jpg"
66
66
  loading="lazy"
67
67
  theme="light"
68
68
  />
@@ -94,7 +94,7 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
94
94
  align="left"
95
95
  alt="Image 1"
96
96
  aspectRatio="free"
97
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
97
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
98
98
  fillHeight={true}
99
99
  image="/demo-assets/landscape1.jpg"
100
100
  loading="lazy"
@@ -109,9 +109,9 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
109
109
  align="left"
110
110
  alt="Image 2"
111
111
  aspectRatio="free"
112
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
112
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
113
113
  fillHeight={true}
114
- image="/demo-assets/landscape2.jpg"
114
+ image="/demo-assets/landscape1-s200.jpg"
115
115
  loading="lazy"
116
116
  theme="light"
117
117
  />
@@ -124,9 +124,9 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
124
124
  align="left"
125
125
  alt="Image 3"
126
126
  aspectRatio="free"
127
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
127
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
128
128
  fillHeight={true}
129
- image="/demo-assets/landscape3.jpg"
129
+ image="/demo-assets/landscape2.jpg"
130
130
  loading="lazy"
131
131
  theme="light"
132
132
  />
@@ -139,9 +139,9 @@ exports[`<Mosaic> Snapshots and structure should render story FourThumbnails 1`]
139
139
  align="left"
140
140
  alt="Image 4"
141
141
  aspectRatio="free"
142
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
142
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
143
143
  fillHeight={true}
144
- image="/demo-assets/portrait1.jpg"
144
+ image="/demo-assets/landscape3.jpg"
145
145
  loading="lazy"
146
146
  theme="light"
147
147
  />
@@ -165,7 +165,7 @@ exports[`<Mosaic> Snapshots and structure should render story OneThumbnail 1`] =
165
165
  align="left"
166
166
  alt="Image 1"
167
167
  aspectRatio="free"
168
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
168
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
169
169
  fillHeight={true}
170
170
  image="/demo-assets/landscape1.jpg"
171
171
  loading="lazy"
@@ -191,7 +191,7 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
191
191
  align="left"
192
192
  alt="Image 1"
193
193
  aspectRatio="free"
194
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
194
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
195
195
  fillHeight={true}
196
196
  image="/demo-assets/landscape1.jpg"
197
197
  loading="lazy"
@@ -207,9 +207,9 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
207
207
  align="left"
208
208
  alt="Image 2"
209
209
  aspectRatio="free"
210
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
210
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
211
211
  fillHeight={true}
212
- image="/demo-assets/landscape2.jpg"
212
+ image="/demo-assets/landscape1-s200.jpg"
213
213
  loading="lazy"
214
214
  onClick={[Function]}
215
215
  theme="light"
@@ -223,9 +223,9 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
223
223
  align="left"
224
224
  alt="Image 3"
225
225
  aspectRatio="free"
226
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
226
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
227
227
  fillHeight={true}
228
- image="/demo-assets/landscape3.jpg"
228
+ image="/demo-assets/landscape2.jpg"
229
229
  loading="lazy"
230
230
  onClick={[Function]}
231
231
  theme="light"
@@ -239,9 +239,9 @@ exports[`<Mosaic> Snapshots and structure should render story SixThumbnails 1`]
239
239
  align="left"
240
240
  alt="Image 4"
241
241
  aspectRatio="free"
242
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
242
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
243
243
  fillHeight={true}
244
- image="/demo-assets/portrait1.jpg"
244
+ image="/demo-assets/landscape3.jpg"
245
245
  loading="lazy"
246
246
  onClick={[Function]}
247
247
  theme="light"
@@ -274,7 +274,7 @@ exports[`<Mosaic> Snapshots and structure should render story ThreeThumbnails 1`
274
274
  align="left"
275
275
  alt="Image 1"
276
276
  aspectRatio="free"
277
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
277
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
278
278
  fillHeight={true}
279
279
  image="/demo-assets/landscape1.jpg"
280
280
  loading="lazy"
@@ -289,9 +289,9 @@ exports[`<Mosaic> Snapshots and structure should render story ThreeThumbnails 1`
289
289
  align="left"
290
290
  alt="Image 2"
291
291
  aspectRatio="free"
292
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
292
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
293
293
  fillHeight={true}
294
- image="/demo-assets/landscape2.jpg"
294
+ image="/demo-assets/landscape1-s200.jpg"
295
295
  loading="lazy"
296
296
  theme="light"
297
297
  />
@@ -304,9 +304,9 @@ exports[`<Mosaic> Snapshots and structure should render story ThreeThumbnails 1`
304
304
  align="left"
305
305
  alt="Image 3"
306
306
  aspectRatio="free"
307
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
307
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
308
308
  fillHeight={true}
309
- image="/demo-assets/landscape3.jpg"
309
+ image="/demo-assets/landscape2.jpg"
310
310
  loading="lazy"
311
311
  theme="light"
312
312
  />
@@ -330,7 +330,7 @@ exports[`<Mosaic> Snapshots and structure should render story TwoThumbnails 1`]
330
330
  align="left"
331
331
  alt="Image 1"
332
332
  aspectRatio="free"
333
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
333
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
334
334
  fillHeight={true}
335
335
  image="/demo-assets/landscape1.jpg"
336
336
  loading="lazy"
@@ -345,9 +345,9 @@ exports[`<Mosaic> Snapshots and structure should render story TwoThumbnails 1`]
345
345
  align="left"
346
346
  alt="Image 2"
347
347
  aspectRatio="free"
348
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
348
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
349
349
  fillHeight={true}
350
- image="/demo-assets/landscape2.jpg"
350
+ image="/demo-assets/landscape1-s200.jpg"
351
351
  loading="lazy"
352
352
  theme="light"
353
353
  />
@@ -9,7 +9,7 @@ exports[`<PostBlock> Snapshots and structure should render story 'Default' 1`] =
9
9
  >
10
10
  <Thumbnail
11
11
  alt="Landscape"
12
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
12
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
13
13
  image="/demo-assets/landscape1.jpg"
14
14
  loading="lazy"
15
15
  theme="light"
@@ -39,13 +39,13 @@ Array [
39
39
  />
40
40
  </SlideshowItem>
41
41
  <SlideshowItem
42
- key="/demo-assets/landscape2.jpg-1"
42
+ key="/demo-assets/landscape1-s200.jpg-1"
43
43
  >
44
44
  <ImageBlock
45
45
  align="left"
46
46
  alt="Image 2"
47
47
  captionPosition="below"
48
- image="/demo-assets/landscape2.jpg"
48
+ image="/demo-assets/landscape1-s200.jpg"
49
49
  theme="light"
50
50
  thumbnailProps={
51
51
  Object {
@@ -55,13 +55,13 @@ Array [
55
55
  />
56
56
  </SlideshowItem>
57
57
  <SlideshowItem
58
- key="/demo-assets/landscape3.jpg-2"
58
+ key="/demo-assets/landscape2.jpg-2"
59
59
  >
60
60
  <ImageBlock
61
61
  align="left"
62
62
  alt="Image 3"
63
63
  captionPosition="below"
64
- image="/demo-assets/landscape3.jpg"
64
+ image="/demo-assets/landscape2.jpg"
65
65
  theme="light"
66
66
  thumbnailProps={
67
67
  Object {
@@ -71,13 +71,13 @@ Array [
71
71
  />
72
72
  </SlideshowItem>
73
73
  <SlideshowItem
74
- key="/demo-assets/portrait1.jpg-3"
74
+ key="/demo-assets/landscape3.jpg-3"
75
75
  >
76
76
  <ImageBlock
77
77
  align="left"
78
78
  alt="Image 4"
79
79
  captionPosition="below"
80
- image="/demo-assets/portrait1.jpg"
80
+ image="/demo-assets/landscape3.jpg"
81
81
  theme="light"
82
82
  thumbnailProps={
83
83
  Object {
@@ -87,13 +87,13 @@ Array [
87
87
  />
88
88
  </SlideshowItem>
89
89
  <SlideshowItem
90
- key="/demo-assets/portrait2.jpg-4"
90
+ key="/demo-assets/portrait1.jpg-4"
91
91
  >
92
92
  <ImageBlock
93
93
  align="left"
94
94
  alt="Image 5"
95
95
  captionPosition="below"
96
- image="/demo-assets/portrait2.jpg"
96
+ image="/demo-assets/portrait1.jpg"
97
97
  theme="light"
98
98
  thumbnailProps={
99
99
  Object {
@@ -103,13 +103,13 @@ Array [
103
103
  />
104
104
  </SlideshowItem>
105
105
  <SlideshowItem
106
- key="/demo-assets/portrait3.jpg-5"
106
+ key="/demo-assets/portrait1-s200.jpg-5"
107
107
  >
108
108
  <ImageBlock
109
109
  align="left"
110
110
  alt="Image 6"
111
111
  captionPosition="below"
112
- image="/demo-assets/portrait3.jpg"
112
+ image="/demo-assets/portrait1-s200.jpg"
113
113
  theme="light"
114
114
  thumbnailProps={
115
115
  Object {
@@ -60,7 +60,7 @@ exports[`<Table> Snapshots and structure should render story 'Default' 1`] = `
60
60
  alt="Frozen yogurt"
61
61
  aspectRatio="square"
62
62
  className="lumx-spacing-margin-right-big"
63
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
63
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
64
64
  image="/demo-assets/landscape1.jpg"
65
65
  loading="lazy"
66
66
  size="m"
@@ -129,7 +129,7 @@ exports[`<Table> Snapshots and structure should render story 'Default' 1`] = `
129
129
  alt="Ice cream sandwich"
130
130
  aspectRatio="square"
131
131
  className="lumx-spacing-margin-right-big"
132
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
132
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
133
133
  image="/demo-assets/landscape2.jpg"
134
134
  loading="lazy"
135
135
  size="m"
@@ -198,7 +198,7 @@ exports[`<Table> Snapshots and structure should render story 'Default' 1`] = `
198
198
  alt="Eclair"
199
199
  aspectRatio="square"
200
200
  className="lumx-spacing-margin-right-big"
201
- fallback="M21,5V11.59L18,8.58L14,12.59L10,8.59L6,12.59L3,9.58V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5M18,11.42L21,14.43V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V12.42L6,15.41L10,11.41L14,15.41"
201
+ fallback="M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z"
202
202
  image="/demo-assets/landscape3.jpg"
203
203
  loading="lazy"
204
204
  size="m"
@@ -20,19 +20,6 @@ import { sizeKnob } from '@lumx/react/stories/knobs/sizeKnob';
20
20
  import { action } from '@storybook/addon-actions';
21
21
  import classNames from 'classnames';
22
22
 
23
- const knobAspectRatio = () => {
24
- const ratiosProps = {
25
- Original: {},
26
- 'Original (with natural size)': { imgNaturalSize: { width: 800, height: 600 } },
27
- 'Free (with fill height)': { aspectRatio: AspectRatio.free },
28
- Horizontal: { aspectRatio: AspectRatio.horizontal },
29
- Wide: { aspectRatio: AspectRatio.wide },
30
- Vertical: { aspectRatio: AspectRatio.vertical },
31
- Square: { aspectRatio: AspectRatio.square },
32
- } as const;
33
- return select('Aspect ratio', ratiosProps as any, ratiosProps.Original as any);
34
- };
35
-
36
23
  export default { title: 'LumX components/thumbnail/Thumbnail' };
37
24
 
38
25
  /** Default thumbnail props (editable via knobs) */
@@ -44,27 +31,28 @@ export const Default = ({ theme }: any) => {
44
31
  undefined,
45
32
  );
46
33
  const aspectRatio = enumKnob('Aspect ratio', [undefined, ...Object.values(AspectRatio)], undefined);
47
- const crossOrigin = enumKnob('CORS', [undefined, 'anonymous', 'use-credentials'] as const, undefined);
48
34
  const fillHeight = boolean('Fill Height', false);
49
35
  const focusPoint = { x: focusKnob('Focus X'), y: focusKnob('Focus Y') };
50
36
  const image = imageKnob('Image', IMAGES.landscape1);
51
37
  const variant = select('Variant', ThumbnailVariant, ThumbnailVariant.squared);
52
38
  const size = sizeKnob('Size', undefined);
53
39
  const onClick = boolean('clickable?', false) ? action('onClick') : undefined;
40
+ const isLoading = boolean('Force loading', false);
41
+ const forceError = boolean('Force error', false);
54
42
 
55
43
  return (
56
44
  <Thumbnail
57
45
  alt={alt}
58
46
  align={align}
59
47
  aspectRatio={aspectRatio}
60
- crossOrigin={crossOrigin}
61
48
  fillHeight={fillHeight}
62
49
  focusPoint={focusPoint}
63
- image={image}
50
+ image={forceError ? 'foo' : image}
64
51
  size={size}
65
52
  theme={theme}
66
53
  variant={variant}
67
54
  onClick={onClick}
55
+ isLoading={isLoading}
68
56
  />
69
57
  );
70
58
  };
@@ -121,7 +109,13 @@ export const ClickableCustomLink = () => (
121
109
  );
122
110
 
123
111
  export const FillHeight = () => {
124
- const parentStyle = { width: 600, height: 240, border: '1px solid red' };
112
+ const parentStyle = {
113
+ width: 600,
114
+ height: 240,
115
+ border: '1px solid red',
116
+ overflow: 'hidden',
117
+ resize: 'both',
118
+ } as const;
125
119
  return (
126
120
  <>
127
121
  <h2>Default</h2>
@@ -213,6 +207,12 @@ export const Original = () => (
213
207
  export const Vertical = () => (
214
208
  <>
215
209
  <h1>Ratio: vertical</h1>
210
+ <h2>Default</h2>
211
+ <small>Unsupported use case (thumbnail size is undefined)</small>
212
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
213
+ <Thumbnail alt="" aspectRatio="vertical" image={IMAGES.landscape1} />
214
+ <Thumbnail alt="" aspectRatio="vertical" image={IMAGES.portrait1} />
215
+ </FlexBox>
216
216
  <h2>Constraint parent size</h2>
217
217
  <FlexBox orientation="horizontal" vAlign="center" gap="huge">
218
218
  <div className="parent" style={{ width: 220 }}>
@@ -261,6 +261,12 @@ export const Vertical = () => (
261
261
  export const Wide = () => (
262
262
  <>
263
263
  <h1>Ratio: wide</h1>
264
+ <h2>Default</h2>
265
+ <small>Unsupported use case (thumbnail size is undefined)</small>
266
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
267
+ <Thumbnail alt="" aspectRatio="wide" image={IMAGES.landscape1} />
268
+ <Thumbnail alt="" aspectRatio="wide" image={IMAGES.portrait1} />
269
+ </FlexBox>
264
270
  <h2>Constrained parent size</h2>
265
271
  <FlexBox orientation="horizontal" vAlign="center" gap="huge">
266
272
  <div className="parent" style={{ width: 220 }}>
@@ -306,26 +312,59 @@ export const Wide = () => (
306
312
  </>
307
313
  );
308
314
 
309
- export const ParentSizeConstraint = () => {
310
- const fillHeight = boolean('Fill Height', true);
311
- return Object.values(AspectRatio).map((aspectRatio) => (
312
- <FlexBox key={aspectRatio} orientation="horizontal" gap="huge">
313
- <h1>ratio: {aspectRatio}</h1>
314
-
315
- <div style={{ border: '1px solid red', width: 220, height: 400, resize: 'both', overflow: 'auto' }}>
316
- <Thumbnail alt="Grid" image="/demo-assets/grid.jpg" aspectRatio={aspectRatio} fillHeight={fillHeight} />
315
+ export const Square = () => (
316
+ <>
317
+ <h1>Ratio: square</h1>
318
+ <h2>Default</h2>
319
+ <small>Unsupported use case (thumbnail size is undefined)</small>
320
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
321
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1} />
322
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1} />
323
+ </FlexBox>
324
+ <h2>Constrained parent size</h2>
325
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
326
+ <div className="parent" style={{ width: 220 }}>
327
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1} />
317
328
  </div>
318
-
319
- <div style={{ border: '1px solid red', width: 300, height: 300, resize: 'both', overflow: 'auto' }}>
320
- <Thumbnail alt="Grid" image="/demo-assets/grid.jpg" aspectRatio={aspectRatio} fillHeight={fillHeight} />
329
+ <div className="parent" style={{ width: 220 }}>
330
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1} />
321
331
  </div>
322
-
323
- <div style={{ border: '1px solid red', width: 400, height: 200, resize: 'both', overflow: 'auto' }}>
324
- <Thumbnail alt="Grid" image="/demo-assets/grid.jpg" aspectRatio={aspectRatio} fillHeight={fillHeight} />
332
+ </FlexBox>
333
+ <h2>Constrained parent size & smaller image</h2>
334
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
335
+ <div className="parent" style={{ width: 220 }}>
336
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1s200} />
337
+ </div>
338
+ <div className="parent" style={{ width: 220 }}>
339
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1s200} />
325
340
  </div>
326
341
  </FlexBox>
327
- ));
328
- };
342
+ <h2>With size</h2>
343
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
344
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1} size="xxl" />
345
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1} size="xxl" />
346
+ </FlexBox>
347
+ <h2>With size & smaller image</h2>
348
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
349
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1s200} size="xxl" />
350
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1s200} size="xxl" />
351
+ </FlexBox>
352
+ <h2>With size & smaller image & fill height</h2>
353
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
354
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1s200} size="xxl" fillHeight />
355
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1s200} size="xxl" fillHeight />
356
+ </FlexBox>
357
+ <h2>Constrained parent size & smaller image & fill height</h2>
358
+ <FlexBox orientation="horizontal" vAlign="center" gap="huge">
359
+ <div className="parent" style={{ width: 220 }}>
360
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.landscape1s200} fillHeight />
361
+ </div>
362
+ <div className="parent" style={{ width: 220 }}>
363
+ <Thumbnail alt="" aspectRatio="square" image={IMAGES.portrait1s200} fillHeight />
364
+ </div>
365
+ </FlexBox>
366
+ </>
367
+ );
329
368
 
330
369
  export const IsLoading = ({ theme }: any) => (
331
370
  <FlexBox
@@ -338,31 +377,23 @@ export const IsLoading = ({ theme }: any) => (
338
377
  theme={theme}
339
378
  alt="Image alt text"
340
379
  image={IMAGES.landscape2}
341
- isLoading={boolean('Is loading', true)}
380
+ isLoading={boolean('Force loading', true)}
342
381
  fillHeight={boolean('Fill Height', false)}
343
382
  size={sizeKnob('Size', undefined)}
344
383
  />
345
384
  </FlexBox>
346
385
  );
347
386
 
348
- export const ErrorFallback = () => <Thumbnail alt="foo" image="foo" />;
349
-
350
- export const ErrorCustomIconFallback = () => <Thumbnail alt="foo" image="foo" fallback={mdiAbTesting} />;
351
-
352
- export const ErrorCustomFallback = () => (
353
- <Thumbnail alt="foo" image="foo" fallback={<Thumbnail alt="missing image" image="/logo.svg" />} />
354
- );
355
-
356
- export const ErrorFallbackVariants = () => {
357
- const isLoading = boolean('is loading', false);
387
+ export const ErrorFallbackVariants = ({ theme }: any) => {
388
+ const isLoading = boolean('Force loading', false);
358
389
  const variant = select('Variant', ThumbnailVariant, undefined);
359
- const base = { alt: 'foo', image: 'foo', isLoading, variant } as const;
390
+ const base = { alt: 'foo', image: 'foo', isLoading, variant, theme } as const;
360
391
  const imageFallback = <img src="/logo.svg" alt="logo" />;
361
392
  const imgProps = { width: 50, height: 50 };
393
+
362
394
  return (
363
395
  <>
364
396
  <h2>Default</h2>
365
- Default fallback | Custom icon fallback | Custom react node fallback
366
397
  <FlexBox orientation="horizontal" gap="big">
367
398
  <Thumbnail {...base} />
368
399
  <Thumbnail {...base} fallback={mdiAbTesting} />
@@ -380,7 +411,7 @@ export const ErrorFallbackVariants = () => {
380
411
  <FlexBox orientation="horizontal" gap="big">
381
412
  <Thumbnail {...base} size="xl" />
382
413
  <Thumbnail {...base} size="xl" fallback={mdiAbTesting} />
383
- <Thumbnail {...base} size="xl" fallback={imageFallback} imgProps={imgProps} />
414
+ <Thumbnail {...base} size="xl" fallback={imageFallback} />
384
415
  </FlexBox>
385
416
  <h2>With size & ratio</h2>
386
417
  <FlexBox orientation="horizontal" gap="big">
@@ -391,6 +422,7 @@ export const ErrorFallbackVariants = () => {
391
422
  <h2>
392
423
  With original size <small>(50x50)</small> & ratio
393
424
  </h2>
425
+ <small>Unsupported use case (thumbnail size is undefined)</small>
394
426
  <FlexBox orientation="horizontal" gap="big">
395
427
  <Thumbnail {...base} imgProps={imgProps} aspectRatio="wide" />
396
428
  <Thumbnail {...base} imgProps={imgProps} aspectRatio="wide" fallback={mdiAbTesting} />
@@ -9,10 +9,7 @@ import {
9
9
  Clickable,
10
10
  ClickableCustomLink,
11
11
  ClickableLink,
12
- ErrorCustomFallback,
13
12
  Default,
14
- ErrorFallback,
15
- ErrorCustomIconFallback,
16
13
  WithBadge,
17
14
  } from './Thumbnail.stories';
18
15
 
@@ -36,9 +33,6 @@ describe(`<${Thumbnail.displayName}>`, () => {
36
33
  Clickable,
37
34
  ClickableLink,
38
35
  ClickableCustomLink,
39
- ErrorFallback,
40
- ErrorCustomFallback,
41
- ErrorCustomIconFallback,
42
36
  WithBadge,
43
37
  },
44
38
  Thumbnail,