@lumx/react 2.1.9-alpha.0 → 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.
Files changed (110) hide show
  1. package/esm/_internal/AlertDialog.js +2 -1
  2. package/esm/_internal/AlertDialog.js.map +1 -1
  3. package/esm/_internal/AutocompleteMultiple.js +2 -1
  4. package/esm/_internal/AutocompleteMultiple.js.map +1 -1
  5. package/esm/_internal/Avatar2.js +1 -5
  6. package/esm/_internal/Avatar2.js.map +1 -1
  7. package/esm/_internal/Button2.js +1 -1
  8. package/esm/_internal/Checkbox2.js +2 -1
  9. package/esm/_internal/Checkbox2.js.map +1 -1
  10. package/esm/_internal/DatePickerField.js +1 -1
  11. package/esm/_internal/DragHandle.js +2 -1
  12. package/esm/_internal/DragHandle.js.map +1 -1
  13. package/esm/_internal/ExpansionPanel.js +1 -1
  14. package/esm/_internal/Icon2.js +3 -23
  15. package/esm/_internal/Icon2.js.map +1 -1
  16. package/esm/_internal/IconButton.js +1 -1
  17. package/esm/_internal/Lightbox2.js +1 -1
  18. package/esm/_internal/Link2.js +1 -1
  19. package/esm/_internal/LinkPreview.js +1 -1
  20. package/esm/_internal/LinkPreview.js.map +1 -1
  21. package/esm/_internal/List2.js.map +1 -1
  22. package/esm/_internal/Message2.js +3 -3
  23. package/esm/_internal/Message2.js.map +1 -1
  24. package/esm/_internal/Notification2.js +2 -1
  25. package/esm/_internal/Notification2.js.map +1 -1
  26. package/esm/_internal/ProgressTrackerStepPanel.js +2 -1
  27. package/esm/_internal/ProgressTrackerStepPanel.js.map +1 -1
  28. package/esm/_internal/SelectMultiple.js +2 -1
  29. package/esm/_internal/SelectMultiple.js.map +1 -1
  30. package/esm/_internal/SideNavigationItem.js +2 -1
  31. package/esm/_internal/SideNavigationItem.js.map +1 -1
  32. package/esm/_internal/SlideshowControls.js +1 -1
  33. package/esm/_internal/TabPanel.js +1 -1
  34. package/esm/_internal/TableRow.js +2 -1
  35. package/esm/_internal/TableRow.js.map +1 -1
  36. package/esm/_internal/TextField.js +2 -1
  37. package/esm/_internal/TextField.js.map +1 -1
  38. package/esm/_internal/Thumbnail2.js +36 -30
  39. package/esm/_internal/Thumbnail2.js.map +1 -1
  40. package/esm/_internal/UserBlock.js +14 -45
  41. package/esm/_internal/UserBlock.js.map +1 -1
  42. package/esm/_internal/alert-dialog.js +2 -1
  43. package/esm/_internal/alert-dialog.js.map +1 -1
  44. package/esm/_internal/autocomplete.js +2 -1
  45. package/esm/_internal/autocomplete.js.map +1 -1
  46. package/esm/_internal/avatar.js +2 -1
  47. package/esm/_internal/avatar.js.map +1 -1
  48. package/esm/_internal/button.js +1 -1
  49. package/esm/_internal/checkbox.js +2 -1
  50. package/esm/_internal/checkbox.js.map +1 -1
  51. package/esm/_internal/comment-block.js +2 -1
  52. package/esm/_internal/comment-block.js.map +1 -1
  53. package/esm/_internal/date-picker.js +2 -1
  54. package/esm/_internal/date-picker.js.map +1 -1
  55. package/esm/_internal/drag-handle.js +2 -1
  56. package/esm/_internal/drag-handle.js.map +1 -1
  57. package/esm/_internal/expansion-panel.js +2 -1
  58. package/esm/_internal/expansion-panel.js.map +1 -1
  59. package/esm/_internal/flag.js +1 -1
  60. package/esm/_internal/icon.js +1 -1
  61. package/esm/_internal/image-block.js +2 -1
  62. package/esm/_internal/image-block.js.map +1 -1
  63. package/esm/_internal/lightbox.js +2 -1
  64. package/esm/_internal/lightbox.js.map +1 -1
  65. package/esm/_internal/link-preview.js +2 -1
  66. package/esm/_internal/link-preview.js.map +1 -1
  67. package/esm/_internal/link.js +1 -1
  68. package/esm/_internal/mdi.js +22 -0
  69. package/esm/_internal/mdi.js.map +1 -0
  70. package/esm/_internal/message.js +2 -1
  71. package/esm/_internal/message.js.map +1 -1
  72. package/esm/_internal/mosaic.js +2 -1
  73. package/esm/_internal/mosaic.js.map +1 -1
  74. package/esm/_internal/notification.js +2 -1
  75. package/esm/_internal/notification.js.map +1 -1
  76. package/esm/_internal/post-block.js +2 -1
  77. package/esm/_internal/post-block.js.map +1 -1
  78. package/esm/_internal/progress-tracker.js +2 -1
  79. package/esm/_internal/progress-tracker.js.map +1 -1
  80. package/esm/_internal/select.js +2 -1
  81. package/esm/_internal/select.js.map +1 -1
  82. package/esm/_internal/side-navigation.js +2 -1
  83. package/esm/_internal/side-navigation.js.map +1 -1
  84. package/esm/_internal/slideshow.js +2 -1
  85. package/esm/_internal/slideshow.js.map +1 -1
  86. package/esm/_internal/table.js +2 -1
  87. package/esm/_internal/table.js.map +1 -1
  88. package/esm/_internal/tabs.js +1 -1
  89. package/esm/_internal/text-field.js +2 -1
  90. package/esm/_internal/text-field.js.map +1 -1
  91. package/esm/_internal/thumbnail.js +2 -1
  92. package/esm/_internal/thumbnail.js.map +1 -1
  93. package/esm/_internal/uploader.js +1 -1
  94. package/esm/_internal/user-block.js +2 -2
  95. package/esm/index.js +2 -1
  96. package/esm/index.js.map +1 -1
  97. package/package.json +4 -4
  98. package/src/components/avatar/Avatar.tsx +0 -8
  99. package/src/components/icon/Icon.tsx +0 -5
  100. package/src/components/link-preview/LinkPreview.tsx +1 -1
  101. package/src/components/link-preview/__snapshots__/LinkPreview.test.tsx.snap +2 -2
  102. package/src/components/message/Message.tsx +1 -3
  103. package/src/components/thumbnail/Thumbnail.stories.tsx +0 -21
  104. package/src/components/thumbnail/Thumbnail.test.tsx +2 -20
  105. package/src/components/thumbnail/Thumbnail.tsx +15 -40
  106. package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +6 -53
  107. package/src/components/user-block/UserBlock.stories.tsx +4 -30
  108. package/src/components/user-block/UserBlock.tsx +16 -41
  109. package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +145 -244
  110. package/types.d.ts +0 -12
@@ -2,10 +2,11 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
9
9
  import 'lodash/noop';
10
+ import './Icon2.js';
10
11
  export { M as Message } from './Message2.js';
11
12
  //# sourceMappingURL=message.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"message.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -2,13 +2,14 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
9
9
  import 'lodash/noop';
10
10
  import './constants.js';
11
11
  import './mergeRefs.js';
12
+ import './Icon2.js';
12
13
  import 'lodash/take';
13
14
  export { M as Mosaic } from './Mosaic2.js';
14
15
  import './clamp.js';
@@ -1 +1 @@
1
- {"version":3,"file":"mosaic.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"mosaic.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
@@ -14,5 +14,6 @@ import './Button2.js';
14
14
  import 'lodash/isFunction';
15
15
  import 'react-dom';
16
16
  import './useDelayedVisibility.js';
17
+ import './Icon2.js';
17
18
  export { N as Notification } from './Notification2.js';
18
19
  //# sourceMappingURL=notification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"notification.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -2,13 +2,14 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
9
9
  import 'lodash/noop';
10
10
  import './constants.js';
11
11
  import './mergeRefs.js';
12
+ import './Icon2.js';
12
13
  import 'lodash/isObject';
13
14
  export { P as PostBlock } from './PostBlock.js';
14
15
  import './clamp.js';
@@ -1 +1 @@
1
- {"version":3,"file":"post-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"post-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -2,13 +2,14 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import '../index2.js';
7
7
  import 'lodash/isBoolean';
8
8
  import 'lodash/isEmpty';
9
9
  import 'lodash/kebabCase';
10
10
  import 'lodash/noop';
11
11
  import './mergeRefs.js';
12
+ import './Icon2.js';
12
13
  import './InputHelper.js';
13
14
  import './InputLabel.js';
14
15
  import './useRovingTabIndex.js';
@@ -1 +1 @@
1
- {"version":3,"file":"progress-tracker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"progress-tracker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import '../index2.js';
7
7
  import 'lodash/isBoolean';
8
8
  import 'lodash/isEmpty';
@@ -23,6 +23,7 @@ import './ClickAwayProvider.js';
23
23
  import 'lodash/pull';
24
24
  import './List2.js';
25
25
  import './Dropdown2.js';
26
+ import './Icon2.js';
26
27
  import './InputHelper.js';
27
28
  import './InputLabel.js';
28
29
  export { a as Select, c as SelectMultiple, b as SelectMultipleField, S as SelectVariant } from './SelectMultiple.js';
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"select.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import '../index2.js';
7
7
  import 'lodash/isBoolean';
8
8
  import 'lodash/isEmpty';
@@ -19,6 +19,7 @@ import './IconButton.js';
19
19
  import 'react-dom';
20
20
  import './ClickAwayProvider.js';
21
21
  import 'lodash/pull';
22
+ import './Icon2.js';
22
23
  export { S as SideNavigation, a as SideNavigationItem } from './SideNavigationItem.js';
23
24
  import './Tooltip2.js';
24
25
  import 'lodash/debounce';
@@ -1 +1 @@
1
- {"version":3,"file":"side-navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"side-navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import '../index2.js';
7
7
  import 'lodash/isBoolean';
8
8
  import 'lodash/isEmpty';
@@ -20,6 +20,7 @@ import 'lodash/range';
20
20
  import 'react-dom';
21
21
  import './ClickAwayProvider.js';
22
22
  import 'lodash/pull';
23
+ import './Icon2.js';
23
24
  export { S as Slideshow, b as SlideshowControls, a as SlideshowItem } from './SlideshowControls.js';
24
25
  import './Tooltip2.js';
25
26
  import 'lodash/debounce';
@@ -1 +1 @@
1
- {"version":3,"file":"slideshow.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"slideshow.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,11 +2,12 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
9
9
  import 'lodash/noop';
10
10
  import 'lodash/isFunction';
11
+ import './Icon2.js';
11
12
  export { T as Table, a as TableBody, d as TableCell, c as TableCellVariant, e as TableHeader, f as TableRow, b as ThOrder } from './TableRow.js';
12
13
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"table.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -2,13 +2,13 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
6
5
  import '../index2.js';
7
6
  import 'lodash/isBoolean';
8
7
  import 'lodash/isEmpty';
9
8
  import 'lodash/kebabCase';
10
9
  import 'lodash/noop';
11
10
  import './mergeRefs.js';
11
+ import './Icon2.js';
12
12
  import './useRovingTabIndex.js';
13
13
  export { c as Tab, b as TabList, a as TabListLayout, d as TabPanel, T as TabProvider } from './TabPanel.js';
14
14
  //# sourceMappingURL=tabs.js.map
@@ -2,7 +2,7 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import '../index2.js';
7
7
  import 'lodash/isBoolean';
8
8
  import 'lodash/isEmpty';
@@ -18,6 +18,7 @@ import './IconButton.js';
18
18
  import 'react-dom';
19
19
  import './ClickAwayProvider.js';
20
20
  import 'lodash/pull';
21
+ import './Icon2.js';
21
22
  import './InputHelper.js';
22
23
  import './InputLabel.js';
23
24
  export { T as TextField } from './TextField.js';
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"text-field.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,13 +2,14 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
9
9
  import 'lodash/noop';
10
10
  import './constants.js';
11
11
  import './mergeRefs.js';
12
+ import './Icon2.js';
12
13
  import './clamp.js';
13
14
  export { T as Thumbnail } from './Thumbnail2.js';
14
15
  import 'lodash';
@@ -1 +1 @@
1
- {"version":3,"file":"thumbnail.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"thumbnail.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -2,10 +2,10 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
6
5
  import 'lodash/isBoolean';
7
6
  import 'lodash/isEmpty';
8
7
  import 'lodash/kebabCase';
9
8
  import 'lodash/noop';
9
+ import './Icon2.js';
10
10
  export { a as Uploader, U as UploaderVariant } from './Uploader2.js';
11
11
  //# sourceMappingURL=uploader.js.map
@@ -2,7 +2,7 @@ import './_rollupPluginBabelHelpers.js';
2
2
  import './components.js';
3
3
  import 'react';
4
4
  import './getRootClassName.js';
5
- import './Icon2.js';
5
+ import './mdi.js';
6
6
  import 'lodash/isBoolean';
7
7
  import 'lodash/isEmpty';
8
8
  import 'lodash/kebabCase';
@@ -10,7 +10,7 @@ import 'lodash/noop';
10
10
  import './constants.js';
11
11
  import './mergeRefs.js';
12
12
  import './Avatar2.js';
13
- import './renderLink.js';
13
+ import './Icon2.js';
14
14
  import './clamp.js';
15
15
  import './Thumbnail2.js';
16
16
  import 'lodash';
package/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import './_internal/_rollupPluginBabelHelpers.js';
2
2
  export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyInterface, TypographyTitleCustom } from './_internal/components.js';
3
3
  import 'react';
4
4
  import './_internal/getRootClassName.js';
5
- export { I as Icon } from './_internal/Icon2.js';
5
+ import './_internal/mdi.js';
6
6
  import './index2.js';
7
7
  import 'lodash/isBoolean';
8
8
  import 'lodash/isEmpty';
@@ -53,6 +53,7 @@ export { F as Flag } from './_internal/Flag2.js';
53
53
  import 'lodash/castArray';
54
54
  export { F as FlexBox } from './_internal/FlexBox.js';
55
55
  export { G as Grid, a as GridItem } from './_internal/GridItem.js';
56
+ export { I as Icon } from './_internal/Icon2.js';
56
57
  import 'lodash/isObject';
57
58
  export { a as ImageBlock, I as ImageBlockCaptionPosition } from './_internal/ImageBlock.js';
58
59
  export { I as InputHelper } from './_internal/InputHelper.js';
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -7,8 +7,8 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@juggle/resize-observer": "^3.2.0",
10
- "@lumx/core": "^2.1.9-alpha.0",
11
- "@lumx/icons": "^2.1.9-alpha.0",
10
+ "@lumx/core": "^2.1.9",
11
+ "@lumx/icons": "^2.1.9",
12
12
  "@popperjs/core": "^2.5.4",
13
13
  "body-scroll-lock": "^3.1.5",
14
14
  "classnames": "^2.2.6",
@@ -120,6 +120,6 @@
120
120
  "build:storybook": "cd storybook && ./build"
121
121
  },
122
122
  "sideEffects": false,
123
- "version": "2.1.9-alpha.0",
124
- "gitHead": "67f0df5b67d7a55fccb30b72173163bafcf7b82e"
123
+ "version": "2.1.9",
124
+ "gitHead": "fdcfec63e1d0e4e82934a34b6e27c8076f9cba8d"
125
125
  }
@@ -36,10 +36,6 @@ export interface AvatarProps extends GenericProps {
36
36
  ThumbnailProps,
37
37
  'image' | 'alt' | 'size' | 'theme' | 'align' | 'fillHeight' | 'variant' | 'aspectRatio'
38
38
  >;
39
- /** Props to pass to the link wrapping the thumbnail. */
40
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
41
- /** Custom react component for the link (can be used to inject react router Link). */
42
- linkAs?: 'a' | any;
43
39
  }
44
40
 
45
41
  /**
@@ -79,8 +75,6 @@ export const Avatar: Comp<AvatarProps, HTMLDivElement> = forwardRef((props, ref)
79
75
  size,
80
76
  theme,
81
77
  thumbnailProps,
82
- linkProps,
83
- linkAs,
84
78
  ...forwardedProps
85
79
  } = props;
86
80
 
@@ -91,8 +85,6 @@ export const Avatar: Comp<AvatarProps, HTMLDivElement> = forwardRef((props, ref)
91
85
  className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, size, theme }))}
92
86
  >
93
87
  <Thumbnail
94
- linkProps={linkProps}
95
- linkAs={linkAs}
96
88
  className={`${CLASSNAME}__thumbnail`}
97
89
  onClick={onClick}
98
90
  onKeyPress={onKeyPress}
@@ -4,7 +4,6 @@ import classNames from 'classnames';
4
4
 
5
5
  import { Color, ColorPalette, ColorVariant, Size, Theme } from '@lumx/react';
6
6
  import { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';
7
- import { mdiAlertCircle } from '@lumx/icons';
8
7
 
9
8
  export type IconSizes = Extract<Size, 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;
10
9
 
@@ -102,10 +101,6 @@ export const Icon: Comp<IconProps, HTMLElement> = forwardRef((props, ref) => {
102
101
  size: iconSize,
103
102
  }),
104
103
  !hasShape && `${CLASSNAME}--no-shape`,
105
- !hasShape &&
106
- iconColor === ColorPalette.yellow &&
107
- icon === mdiAlertCircle &&
108
- `${CLASSNAME}--has-dark-layer`,
109
104
  `${CLASSNAME}--path`,
110
105
  )}
111
106
  >
@@ -115,7 +115,7 @@ export const LinkPreview: Comp<LinkPreviewProps, HTMLDivElement> = forwardRef((p
115
115
  className={classNames(`${CLASSNAME}__link`, linkProps?.className)}
116
116
  target="_blank"
117
117
  href={link}
118
- color={theme === Theme.light ? ColorPalette.primary : ColorPalette.light}
118
+ color={theme === Theme.light ? ColorPalette.blue : ColorPalette.light}
119
119
  colorVariant={ColorVariant.N}
120
120
  >
121
121
  {link}
@@ -15,7 +15,7 @@ exports[`<LinkPreview> Snapshots and structure should render correctly 1`] = `
15
15
  >
16
16
  <Link
17
17
  className="lumx-link-preview__link"
18
- color="primary"
18
+ color="blue"
19
19
  colorVariant="N"
20
20
  target="_blank"
21
21
  />
@@ -40,7 +40,7 @@ exports[`<LinkPreview> Snapshots and structure should render correctly 2`] = `
40
40
  >
41
41
  <Link
42
42
  className="lumx-link-preview__link"
43
- color="primary"
43
+ color="blue"
44
44
  colorVariant="N"
45
45
  target="_blank"
46
46
  />
@@ -62,9 +62,7 @@ export const Message: Comp<MessageProps, HTMLDivElement> = forwardRef((props, re
62
62
  )}
63
63
  {...forwardedProps}
64
64
  >
65
- {(customIcon || icon) && (
66
- <Icon className={`${CLASSNAME}__icon`} icon={customIcon || icon} size={Size.xs} color={color} />
67
- )}
65
+ {(customIcon || icon) && <Icon className={`${CLASSNAME}__icon`} icon={customIcon || icon} size={Size.xs} />}
68
66
  <div className={`${CLASSNAME}__text`}>{children}</div>
69
67
  </div>
70
68
  );
@@ -18,7 +18,6 @@ import { boolean, select, text } from '@storybook/addon-knobs';
18
18
  import { enumKnob } from '@lumx/react/stories/knobs/enumKnob';
19
19
  import { focusKnob } from '@lumx/react/stories/knobs/focusKnob';
20
20
  import { sizeKnob } from '@lumx/react/stories/knobs/sizeKnob';
21
- import classNames from 'classnames';
22
21
 
23
22
  export default { title: 'LumX components/thumbnail/Thumbnail' };
24
23
 
@@ -26,26 +25,6 @@ export const Default = () => <Thumbnail alt="Image alt text" image={imageKnob()}
26
25
 
27
26
  export const Clickable = () => <Thumbnail alt="Click me" image={imageKnob()} size={Size.xxl} onClick={console.log} />;
28
27
 
29
- export const ClickableLink = () => (
30
- <Thumbnail alt="Click me" image={imageKnob()} size={Size.xxl} linkProps={{ href: 'https://google.fr' }} />
31
- );
32
-
33
- const CustomLinkComponent = (props: any) => (
34
- <a {...props} className={classNames('custom-link-component', props.className)}>
35
- {props.children}
36
- </a>
37
- );
38
-
39
- export const ClickableCustomLink = () => (
40
- <Thumbnail
41
- alt="Click me"
42
- image={imageKnob()}
43
- size={Size.xxl}
44
- linkAs={CustomLinkComponent}
45
- linkProps={{ href: 'https://google.fr', className: 'custom-class-name' }}
46
- />
47
- );
48
-
49
28
  export const DefaultFallback = () => <Thumbnail alt="foo" image="foo" />;
50
29
 
51
30
  export const IconFallback = () => <Thumbnail alt="foo" image="foo" fallback={mdiAbTesting} />;
@@ -5,16 +5,7 @@ import 'jest-enzyme';
5
5
  import { commonTestsSuite, itShouldRenderStories } from '@lumx/react/testing/utils';
6
6
 
7
7
  import { Thumbnail, ThumbnailProps } from './Thumbnail';
8
- import {
9
- Clickable,
10
- ClickableCustomLink,
11
- ClickableLink,
12
- CustomFallback,
13
- Default,
14
- DefaultFallback,
15
- IconFallback,
16
- WithBadge,
17
- } from './Thumbnail.stories';
8
+ import { Clickable, CustomFallback, Default, DefaultFallback, IconFallback, WithBadge } from './Thumbnail.stories';
18
9
 
19
10
  const CLASSNAME = Thumbnail.className as string;
20
11
 
@@ -31,16 +22,7 @@ describe(`<${Thumbnail.displayName}>`, () => {
31
22
  // 1. Test render via snapshot.
32
23
  describe('Snapshots and structure', () => {
33
24
  itShouldRenderStories(
34
- {
35
- Default,
36
- Clickable,
37
- ClickableLink,
38
- ClickableCustomLink,
39
- DefaultFallback,
40
- CustomFallback,
41
- IconFallback,
42
- WithBadge,
43
- },
25
+ { Default, Clickable, DefaultFallback, CustomFallback, IconFallback, WithBadge },
44
26
  Thumbnail,
45
27
  );
46
28
  });
@@ -20,6 +20,7 @@ import { isInternetExplorer } from '@lumx/react/utils/isInternetExplorer';
20
20
  import { mergeRefs } from '@lumx/react/utils/mergeRefs';
21
21
  import { useFocusPoint } from '@lumx/react/components/thumbnail/useFocusPoint';
22
22
  import { useImageLoad } from '@lumx/react/components/thumbnail/useImageLoad';
23
+ import { useClickable } from '@lumx/react/components/thumbnail/useClickable';
23
24
  import { FocusPoint, ThumbnailSize, ThumbnailVariant } from './types';
24
25
 
25
26
  type ImgHTMLProps = ImgHTMLAttributes<HTMLImageElement>;
@@ -62,10 +63,6 @@ export interface ThumbnailProps extends GenericProps {
62
63
  theme?: Theme;
63
64
  /** Variant of the component. */
64
65
  variant?: ThumbnailVariant;
65
- /** Props to pass to the link wrapping the thumbnail. */
66
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
67
- /** Custom react component for the link (can be used to inject react router Link). */
68
- linkAs?: 'a' | any;
69
66
  }
70
67
 
71
68
  /**
@@ -112,8 +109,6 @@ export const Thumbnail: Comp<ThumbnailProps> = forwardRef((props, ref) => {
112
109
  size,
113
110
  theme,
114
111
  variant,
115
- linkProps,
116
- linkAs,
117
112
  ...forwardedProps
118
113
  } = props;
119
114
  const imgRef = useRef<HTMLImageElement>(null);
@@ -124,44 +119,24 @@ export const Thumbnail: Comp<ThumbnailProps> = forwardRef((props, ref) => {
124
119
  const isLoading = loadingState === 'isLoading';
125
120
 
126
121
  const [wrapper, setWrapper] = useState<HTMLElement>();
127
-
128
- const isLink = Boolean(linkProps?.href || linkAs);
129
- const isButton = !!forwardedProps.onClick;
130
- const isClickable = isButton || isLink;
131
-
132
- let Wrapper: any = 'div';
133
- const wrapperProps = { ...forwardedProps };
134
- if (isLink) {
135
- Wrapper = linkAs || 'a';
136
- Object.assign(wrapperProps, linkProps);
137
- } else if (isButton) {
138
- Wrapper = 'button';
139
- }
122
+ const wrapperProps: any = {
123
+ ...forwardedProps,
124
+ ref: mergeRefs(setWrapper, ref),
125
+ className: classNames(
126
+ className,
127
+ handleBasicClasses({ align, aspectRatio, prefix: CLASSNAME, size, theme, variant, hasBadge: !!badge }),
128
+ isLoading && wrapper?.getBoundingClientRect()?.height && 'lumx-color-background-dark-L6',
129
+ fillHeight && `${CLASSNAME}--fill-height`,
130
+ ),
131
+ // Handle clickable Thumbnail a11y.
132
+ ...useClickable(props),
133
+ };
140
134
 
141
135
  // Update img style according to focus point and aspect ratio.
142
136
  const style = useFocusPoint({ image, focusPoint, aspectRatio, imgRef, loadingState, wrapper });
143
137
 
144
138
  return (
145
- <Wrapper
146
- {...wrapperProps}
147
- ref={mergeRefs(setWrapper, ref) as any}
148
- className={classNames(
149
- linkProps?.className,
150
- className,
151
- handleBasicClasses({
152
- align,
153
- aspectRatio,
154
- prefix: CLASSNAME,
155
- size,
156
- theme,
157
- variant,
158
- isClickable,
159
- hasBadge: !!badge,
160
- }),
161
- isLoading && wrapper?.getBoundingClientRect()?.height && 'lumx-color-background-dark-L6',
162
- fillHeight && `${CLASSNAME}--fill-height`,
163
- )}
164
- >
139
+ <div {...wrapperProps}>
165
140
  <div
166
141
  className={`${CLASSNAME}__background`}
167
142
  style={{
@@ -194,7 +169,7 @@ export const Thumbnail: Comp<ThumbnailProps> = forwardRef((props, ref) => {
194
169
  ))}
195
170
  {badge &&
196
171
  React.cloneElement(badge, { className: classNames(`${CLASSNAME}__badge`, badge.props.className) })}
197
- </Wrapper>
172
+ </div>
198
173
  );
199
174
  });
200
175
  Thumbnail.displayName = COMPONENT_NAME;