@lumx/react 3.20.1-alpha.9 → 3.21.0

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 (231) hide show
  1. package/_internal/index.js +20 -13
  2. package/_internal/index.js.map +1 -1
  3. package/index.d.ts +60 -33
  4. package/index.js +2937 -3090
  5. package/index.js.map +1 -1
  6. package/package.json +5 -9
  7. package/src/components/alert-dialog/AlertDialog.stories.tsx +1 -1
  8. package/src/components/alert-dialog/AlertDialog.test.tsx +2 -0
  9. package/src/components/autocomplete/Autocomplete.stories.tsx +1 -1
  10. package/src/components/autocomplete/Autocomplete.test.tsx +2 -0
  11. package/src/components/autocomplete/Autocomplete.tsx +1 -1
  12. package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +1 -1
  13. package/src/components/autocomplete/AutocompleteMultiple.test.tsx +2 -0
  14. package/src/components/autocomplete/AutocompleteMultiple.tsx +1 -1
  15. package/src/components/avatar/Avatar.stories.tsx +2 -0
  16. package/src/components/avatar/Avatar.test.tsx +2 -0
  17. package/src/components/avatar/Avatar.tsx +1 -1
  18. package/src/components/badge/Badge.stories.tsx +1 -0
  19. package/src/components/badge/Badge.test.tsx +2 -0
  20. package/src/components/badge/Badge.tsx +1 -1
  21. package/src/components/badge/BadgeWrapper.stories.tsx +1 -0
  22. package/src/components/badge/BadgeWrapper.test.tsx +2 -0
  23. package/src/components/badge/BadgeWrapper.tsx +1 -1
  24. package/src/components/button/Button.stories.tsx +1 -0
  25. package/src/components/button/Button.test.tsx +2 -0
  26. package/src/components/button/Button.tsx +2 -0
  27. package/src/components/button/ButtonGroup.stories.tsx +2 -0
  28. package/src/components/button/ButtonGroup.test.tsx +2 -0
  29. package/src/components/button/ButtonGroup.tsx +2 -0
  30. package/src/components/button/ButtonRoot.tsx +1 -1
  31. package/src/components/button/IconButton.test.tsx +2 -0
  32. package/src/components/button/IconButton.tsx +2 -0
  33. package/src/components/checkbox/Checkbox.test.tsx +2 -0
  34. package/src/components/chip/Chip.stories.tsx +2 -0
  35. package/src/components/chip/Chip.test.tsx +2 -0
  36. package/src/components/chip/Chip.tsx +1 -1
  37. package/src/components/chip/ChipGroup.stories.tsx +2 -0
  38. package/src/components/chip/ChipGroup.test.tsx +2 -0
  39. package/src/components/chip/ChipGroup.tsx +1 -1
  40. package/src/components/comment-block/CommentBlock.stories.tsx +1 -0
  41. package/src/components/comment-block/CommentBlock.test.tsx +1 -0
  42. package/src/components/comment-block/CommentBlock.tsx +1 -1
  43. package/src/components/date-picker/DatePicker.test.tsx +2 -0
  44. package/src/components/date-picker/DatePicker.tsx +1 -1
  45. package/src/components/date-picker/DatePickerControlled.test.tsx +2 -0
  46. package/src/components/date-picker/DatePickerField.test.tsx +2 -0
  47. package/src/components/dialog/Dialog.test.tsx +2 -0
  48. package/src/components/divider/Divider.test.tsx +2 -0
  49. package/src/components/divider/Divider.tsx +2 -0
  50. package/src/components/drag-handle/DragHandle.test.tsx +2 -0
  51. package/src/components/drag-handle/DragHandle.tsx +2 -0
  52. package/src/components/dropdown/Dropdown.stories.tsx +1 -1
  53. package/src/components/dropdown/Dropdown.tsx +1 -1
  54. package/src/components/expansion-panel/ExpansionPanel.test.tsx +2 -0
  55. package/src/components/flag/Flag.test.tsx +2 -0
  56. package/src/components/flag/Flag.tsx +2 -0
  57. package/src/components/flex-box/FlexBox.stories.tsx +2 -0
  58. package/src/components/flex-box/FlexBox.test.tsx +1 -0
  59. package/src/components/flex-box/FlexBox.tsx +1 -1
  60. package/src/components/generic-block/GenericBlock.test.tsx +1 -1
  61. package/src/components/grid/Grid.tsx +2 -0
  62. package/src/components/grid/GridItem.tsx +2 -0
  63. package/src/components/grid-column/GridColumn.stories.tsx +1 -0
  64. package/src/components/grid-column/GridColumn.test.jsx +2 -0
  65. package/src/components/grid-column/GridColumn.tsx +1 -1
  66. package/src/components/heading/Heading.stories.tsx +1 -0
  67. package/src/components/heading/Heading.test.tsx +2 -0
  68. package/src/components/heading/Heading.tsx +2 -0
  69. package/src/components/heading/HeadingLevelProvider.tsx +1 -1
  70. package/src/components/icon/Icon.test.tsx +2 -0
  71. package/src/components/icon/Icon.tsx +120 -7
  72. package/src/components/image-block/ImageBlock.stories.tsx +2 -0
  73. package/src/components/image-block/ImageBlock.test.tsx +1 -0
  74. package/src/components/image-block/ImageBlock.tsx +1 -1
  75. package/src/components/image-block/ImageCaption.tsx +1 -1
  76. package/src/components/image-lightbox/ImageLightbox.stories.tsx +1 -0
  77. package/src/components/image-lightbox/ImageLightbox.test.tsx +2 -0
  78. package/src/components/image-lightbox/types.ts +2 -0
  79. package/src/components/inline-list/InlineList.stories.tsx +1 -0
  80. package/src/components/inline-list/InlineList.test.tsx +2 -0
  81. package/src/components/inline-list/InlineList.tsx +1 -1
  82. package/src/components/input-helper/InputHelper.test.tsx +2 -0
  83. package/src/components/input-helper/InputHelper.tsx +1 -1
  84. package/src/components/input-label/InputLabel.stories.tsx +2 -0
  85. package/src/components/input-label/InputLabel.test.tsx +2 -0
  86. package/src/components/input-label/InputLabel.tsx +1 -1
  87. package/src/components/lightbox/Lightbox.test.tsx +2 -0
  88. package/src/components/lightbox/Lightbox.tsx +1 -1
  89. package/src/components/link/Link.stories.tsx +1 -0
  90. package/src/components/link/Link.test.tsx +2 -0
  91. package/src/components/link/Link.tsx +2 -0
  92. package/src/components/link-preview/LinkPreview.test.tsx +2 -0
  93. package/src/components/link-preview/LinkPreview.tsx +2 -0
  94. package/src/components/list/List.stories.tsx +1 -1
  95. package/src/components/list/List.test.tsx +2 -0
  96. package/src/components/list/List.tsx +1 -1
  97. package/src/components/list/ListDivider.test.tsx +2 -0
  98. package/src/components/list/ListDivider.tsx +2 -0
  99. package/src/components/list/ListItem.test.tsx +2 -0
  100. package/src/components/list/ListItem.tsx +1 -1
  101. package/src/components/list/ListSubheader.test.tsx +2 -0
  102. package/src/components/list/ListSubheader.tsx +1 -1
  103. package/src/components/message/Message.test.tsx +1 -0
  104. package/src/components/message/Message.tsx +1 -1
  105. package/src/components/mosaic/Mosaic.test.tsx +2 -0
  106. package/src/components/mosaic/Mosaic.tsx +1 -1
  107. package/src/components/navigation/Navigation.stories.tsx +2 -0
  108. package/src/components/navigation/Navigation.test.tsx +2 -0
  109. package/src/components/navigation/Navigation.tsx +2 -0
  110. package/src/components/navigation/NavigationItem.test.tsx +2 -0
  111. package/src/components/navigation/NavigationItem.tsx +1 -1
  112. package/src/components/navigation/NavigationSection.test.tsx +2 -0
  113. package/src/components/navigation/NavigationSection.tsx +1 -1
  114. package/src/components/notification/Notification.test.tsx +2 -0
  115. package/src/components/notification/Notification.tsx +1 -1
  116. package/src/components/popover/Popover.test.tsx +2 -0
  117. package/src/components/popover/Popover.tsx +1 -1
  118. package/src/components/popover/usePopoverStyle.tsx +1 -1
  119. package/src/components/popover-dialog/PopoverDialog.test.tsx +1 -0
  120. package/src/components/popover-dialog/PopoverDialog.tsx +2 -0
  121. package/src/components/post-block/PostBlock.test.tsx +2 -0
  122. package/src/components/post-block/PostBlock.tsx +1 -1
  123. package/src/components/progress/Progress.tsx +2 -0
  124. package/src/components/progress/ProgressCircular.stories.tsx +1 -0
  125. package/src/components/progress/ProgressCircular.test.tsx +2 -0
  126. package/src/components/progress/ProgressCircular.tsx +2 -0
  127. package/src/components/progress/ProgressLinear.test.tsx +2 -0
  128. package/src/components/progress/ProgressLinear.tsx +2 -0
  129. package/src/components/progress-tracker/ProgressTracker.stories.tsx +1 -1
  130. package/src/components/progress-tracker/ProgressTracker.test.tsx +2 -0
  131. package/src/components/progress-tracker/ProgressTrackerProvider.test.tsx +2 -0
  132. package/src/components/progress-tracker/ProgressTrackerProvider.tsx +1 -1
  133. package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +2 -0
  134. package/src/components/progress-tracker/ProgressTrackerStep.tsx +1 -1
  135. package/src/components/progress-tracker/ProgressTrackerStepPanel.test.tsx +2 -0
  136. package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +2 -0
  137. package/src/components/radio-button/RadioButton.test.tsx +2 -0
  138. package/src/components/radio-button/RadioButton.tsx +1 -1
  139. package/src/components/radio-button/RadioGroup.stories.tsx +1 -1
  140. package/src/components/radio-button/RadioGroup.test.tsx +2 -0
  141. package/src/components/radio-button/RadioGroup.tsx +1 -1
  142. package/src/components/select/Select.stories.tsx +1 -1
  143. package/src/components/select/Select.test.tsx +2 -0
  144. package/src/components/select/Select.tsx +1 -1
  145. package/src/components/select/SelectMultiple.stories.tsx +1 -1
  146. package/src/components/select/SelectMultiple.test.tsx +2 -0
  147. package/src/components/select/SelectMultiple.tsx +1 -1
  148. package/src/components/select/WithSelectContext.tsx +1 -1
  149. package/src/components/select/constants.ts +1 -1
  150. package/src/components/side-navigation/SideNavigation.test.tsx +2 -0
  151. package/src/components/side-navigation/SideNavigation.tsx +1 -1
  152. package/src/components/side-navigation/SideNavigationItem.test.tsx +2 -0
  153. package/src/components/side-navigation/SideNavigationItem.tsx +1 -1
  154. package/src/components/skeleton/SkeletonCircle.test.tsx +2 -0
  155. package/src/components/skeleton/SkeletonCircle.tsx +2 -0
  156. package/src/components/skeleton/SkeletonRectangle.test.tsx +2 -0
  157. package/src/components/skeleton/SkeletonRectangle.tsx +2 -0
  158. package/src/components/skeleton/SkeletonTypography.stories.tsx +2 -0
  159. package/src/components/skeleton/SkeletonTypography.test.tsx +2 -0
  160. package/src/components/skeleton/SkeletonTypography.tsx +1 -1
  161. package/src/components/slider/Slider.test.tsx +2 -0
  162. package/src/components/slider/Slider.tsx +1 -1
  163. package/src/components/slideshow/Slideshow.stories.tsx +1 -0
  164. package/src/components/slideshow/Slideshow.test.tsx +2 -0
  165. package/src/components/slideshow/SlideshowControls.stories.tsx +2 -0
  166. package/src/components/slideshow/SlideshowItem.tsx +2 -0
  167. package/src/components/slideshow/useSlideFocusManagement.tsx +1 -1
  168. package/src/components/switch/Switch.test.tsx +2 -0
  169. package/src/components/switch/Switch.tsx +1 -1
  170. package/src/components/table/Table.test.tsx +2 -0
  171. package/src/components/table/Table.tsx +2 -0
  172. package/src/components/table/TableBody.test.tsx +2 -0
  173. package/src/components/table/TableBody.tsx +2 -0
  174. package/src/components/table/TableCell.test.tsx +2 -0
  175. package/src/components/table/TableCell.tsx +2 -0
  176. package/src/components/table/TableHeader.test.tsx +2 -0
  177. package/src/components/table/TableHeader.tsx +2 -0
  178. package/src/components/table/TableRow.test.tsx +2 -0
  179. package/src/components/table/TableRow.tsx +2 -0
  180. package/src/components/tabs/Tab.test.tsx +2 -0
  181. package/src/components/tabs/Tab.tsx +1 -1
  182. package/src/components/tabs/TabList.test.tsx +2 -0
  183. package/src/components/tabs/TabPanel.test.tsx +2 -0
  184. package/src/components/tabs/TabPanel.tsx +2 -0
  185. package/src/components/tabs/TabProvider.test.tsx +2 -0
  186. package/src/components/tabs/TabProvider.tsx +1 -1
  187. package/src/components/tabs/Tabs.stories.tsx +1 -1
  188. package/src/components/text/Text.stories.tsx +1 -1
  189. package/src/components/text/Text.test.tsx +2 -0
  190. package/src/components/text/Text.tsx +2 -0
  191. package/src/components/text-field/RawInputText.stories.tsx +18 -0
  192. package/src/components/text-field/RawInputText.test.tsx +58 -0
  193. package/src/components/text-field/RawInputText.tsx +56 -0
  194. package/src/components/text-field/RawInputTextarea.stories.tsx +22 -0
  195. package/src/components/text-field/RawInputTextarea.test.tsx +63 -0
  196. package/src/components/text-field/RawInputTextarea.tsx +68 -0
  197. package/src/components/text-field/TextField.test.tsx +11 -2
  198. package/src/components/text-field/TextField.tsx +40 -210
  199. package/src/components/text-field/constants.ts +16 -0
  200. package/src/components/text-field/index.ts +3 -1
  201. package/src/components/text-field/useFitRowsToContent.ts +42 -0
  202. package/src/components/thumbnail/Thumbnail.test.tsx +2 -0
  203. package/src/components/toolbar/Toolbar.tsx +1 -1
  204. package/src/components/tooltip/Tooltip.stories.tsx +1 -2
  205. package/src/components/tooltip/Tooltip.test.tsx +1 -1
  206. package/src/components/uploader/Uploader.test.tsx +2 -0
  207. package/src/components/user-block/UserBlock.stories.tsx +2 -0
  208. package/src/components/user-block/UserBlock.test.tsx +2 -0
  209. package/src/hooks/useId.test.tsx +1 -0
  210. package/src/hooks/useInfiniteScroll.tsx +1 -1
  211. package/src/hooks/usePreviousValue.ts +1 -0
  212. package/src/stories/decorators/withChromaticForceScreenSize.tsx +1 -0
  213. package/src/stories/decorators/withNestedProps.tsx +1 -0
  214. package/src/stories/decorators/withThemedBackground.tsx +2 -0
  215. package/src/stories/decorators/withWrapper.tsx +2 -0
  216. package/src/stories/utils/CustomLink.tsx +1 -0
  217. package/src/testing/utils/ThemeSentinel.tsx +1 -0
  218. package/src/utils/ClickAwayProvider/ClickAwayProvider.stories.jsx +1 -1
  219. package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +1 -1
  220. package/src/utils/MaterialThemeSwitcher/MaterialThemeSwitcher.tsx +1 -1
  221. package/src/utils/Portal/Portal.test.tsx +1 -0
  222. package/src/utils/Portal/PortalProvider.stories.jsx +1 -0
  223. package/src/utils/Portal/PortalProvider.test.tsx +1 -0
  224. package/src/utils/disabled/DisabledStateProvider.stories.tsx +2 -0
  225. package/src/utils/react/OnBeforeUnmount.tsx +1 -1
  226. package/src/utils/react/RawClickable.tsx +1 -1
  227. package/src/utils/react/skipRender.tsx +2 -2
  228. package/src/utils/react/wrapChildrenIconWithSpaces.test.tsx +1 -1
  229. package/src/utils/type/HasPolymorphicAs.ts +2 -0
  230. package/utils/index.d.ts +7 -7
  231. package/utils/index.js +1 -1
@@ -1,9 +1,52 @@
1
- import { Icon as UI, IconProps, IconSizes } from '@lumx/core/js/components/Icon';
1
+ import React from 'react';
2
2
 
3
+ import classNames from 'classnames';
4
+
5
+ import { mdiAlertCircle } from '@lumx/icons';
6
+ import { ColorPalette, ColorVariant, ColorWithVariants, Size, Theme } from '@lumx/react';
7
+ import { GenericProps, HasTheme } from '@lumx/react/utils/type';
8
+ import { getRootClassName, handleBasicClasses, resolveColorWithVariants } from '@lumx/core/js/utils/className';
3
9
  import { forwardRef } from '@lumx/react/utils/react/forwardRef';
4
10
  import { useTheme } from '@lumx/react/utils/theme/ThemeContext';
5
11
 
6
- export type { IconProps, IconSizes };
12
+ export type IconSizes = Extract<Size, 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;
13
+
14
+ /**
15
+ * Defines the props of the component.
16
+ */
17
+ export interface IconProps extends GenericProps, HasTheme {
18
+ /** Color variant. */
19
+ color?: ColorWithVariants;
20
+ /** Lightened or darkened variant of the selected icon color. */
21
+ colorVariant?: ColorVariant;
22
+ /** Whether the icon has a shape. */
23
+ hasShape?: boolean;
24
+ /**
25
+ * Icon (SVG path) draw code (`d` property of the `<path>` SVG element).
26
+ * See https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
27
+ */
28
+ icon: string;
29
+ /** Size variant. */
30
+ size?: IconSizes;
31
+ /** Sets an alternative text on the svg. Will set an `img` role to the svg. */
32
+ alt?: string;
33
+ }
34
+
35
+ /**
36
+ * Component display name.
37
+ */
38
+ const COMPONENT_NAME = 'Icon';
39
+
40
+ /**
41
+ * Component default class name and class prefix.
42
+ */
43
+ const CLASSNAME = getRootClassName(COMPONENT_NAME);
44
+
45
+ /**
46
+ * Component default props.
47
+ */
48
+ const DEFAULT_PROPS: Partial<IconProps> = {};
49
+
7
50
  /**
8
51
  * Icon component.
9
52
  *
@@ -13,10 +56,80 @@ export type { IconProps, IconSizes };
13
56
  */
14
57
  export const Icon = forwardRef<IconProps, HTMLElement>((props, ref) => {
15
58
  const defaultTheme = useTheme();
59
+ const {
60
+ className,
61
+ color: propColor,
62
+ colorVariant: propColorVariant,
63
+ hasShape,
64
+ icon,
65
+ size,
66
+ theme = defaultTheme,
67
+ alt,
68
+ ...forwardedProps
69
+ } = props;
70
+ const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
16
71
 
17
- return <UI ref={ref} {...props} theme={props.theme || defaultTheme} />;
18
- });
72
+ // Color
73
+ let iconColor = color;
74
+ if (!iconColor && (hasShape || theme)) {
75
+ iconColor = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
76
+ }
77
+
78
+ // Color variant
79
+ let iconColorVariant = colorVariant;
80
+ if (!iconColorVariant && hasShape && iconColor === ColorPalette.dark) {
81
+ iconColorVariant = 'L2';
82
+ }
19
83
 
20
- Icon.displayName = UI.displayName;
21
- Icon.className = UI.className;
22
- Icon.defaultProps = UI.defaultProps;
84
+ // Size
85
+ let iconSize = size;
86
+ if (size && hasShape) {
87
+ if (size === Size.xxs || size === Size.xs) {
88
+ iconSize = Size.s;
89
+ } else if (size === Size.xxl) {
90
+ iconSize = Size.xl;
91
+ }
92
+ } else if (hasShape) {
93
+ iconSize = Size.m;
94
+ }
95
+
96
+ return (
97
+ <i
98
+ ref={ref}
99
+ {...forwardedProps}
100
+ className={classNames(
101
+ className,
102
+ handleBasicClasses({
103
+ color: iconColor,
104
+ colorVariant: iconColorVariant,
105
+ hasShape,
106
+ prefix: CLASSNAME,
107
+ theme,
108
+ size: iconSize,
109
+ }),
110
+ !hasShape && `${CLASSNAME}--no-shape`,
111
+ !hasShape &&
112
+ iconColor === ColorPalette.yellow &&
113
+ icon === mdiAlertCircle &&
114
+ `${CLASSNAME}--has-dark-layer`,
115
+ `${CLASSNAME}--path`,
116
+ )}
117
+ >
118
+ <svg
119
+ aria-hidden={alt ? undefined : 'true'}
120
+ role={alt ? 'img' : undefined}
121
+ aria-label={alt}
122
+ height="1em"
123
+ preserveAspectRatio="xMidYMid meet"
124
+ style={{ verticalAlign: '-0.125em' }}
125
+ viewBox="0 0 24 24"
126
+ width="1em"
127
+ >
128
+ <path d={icon} fill="currentColor" />
129
+ </svg>
130
+ </i>
131
+ );
132
+ });
133
+ Icon.displayName = COMPONENT_NAME;
134
+ Icon.className = CLASSNAME;
135
+ Icon.defaultProps = DEFAULT_PROPS;
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import {
2
4
  Alignment,
3
5
  AspectRatio,
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
3
 
3
4
  import { render } from '@testing-library/react';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
2
 
3
3
  import { FlexBox, HorizontalAlignment, Text, TextProps, useTheme } from '@lumx/react';
4
4
  import { HasPolymorphicAs, HasTheme } from '@lumx/react/utils/type';
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { IMAGES } from '@lumx/react/stories/controls/image';
2
3
  import { Button, Mosaic, ImageLightbox, ImageLightboxProps, Chip, ChipGroup } from '@lumx/react';
3
4
  import { withWrapper } from '@lumx/react/stories/decorators/withWrapper';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
4
  import { render, within, screen, waitFor } from '@testing-library/react';
3
5
  import { getByClassName, queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import type { IconButtonProps, LightboxProps, SlideshowProps, ThumbnailProps } from '@lumx/react';
2
4
  import type { HasClassName } from '@lumx/react/utils/type';
3
5
  import type { ImageCaptionMetadata } from '@lumx/react/components/image-block/ImageCaption';
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { mdiEarth } from '@lumx/icons';
2
3
  import { Icon, Text } from '@lumx/react';
3
4
  import { withResizableBox } from '@lumx/react/stories/decorators/withResizableBox';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
4
  import { render, screen, within } from '@testing-library/react';
3
5
  import { queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { Children, isValidElement } from 'react';
1
+ import React, { Children, isValidElement } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { Kind, Theme } from '@lumx/react';
2
4
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
3
5
  import { getByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { Typography } from '@lumx/react';
2
4
 
3
5
  import { InputLabel } from './InputLabel';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { Theme, Typography } from '@lumx/react';
2
4
  import { getByClassName } from '@lumx/react/testing/utils/queries';
3
5
  import { getTypographyClassName } from '@lumx/core/js/utils/className';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { queryByClassName } from '@lumx/react/testing/utils/queries';
3
5
  import { render, screen } from '@testing-library/react';
@@ -1,4 +1,4 @@
1
- import { RefObject, useRef, useEffect, AriaAttributes } from 'react';
1
+ import React, { RefObject, useRef, useEffect, AriaAttributes } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -10,6 +10,7 @@ import {
10
10
  TypographyTitleCustom,
11
11
  GenericBlock,
12
12
  } from '@lumx/react';
13
+ import React from 'react';
13
14
  import { getSelectArgType } from '@lumx/react/stories/controls/selectArgType';
14
15
  import { colorArgType, colorVariantArgType } from '@lumx/react/stories/controls/color';
15
16
  import { iconArgType } from '@lumx/react/stories/controls/icons';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { ColorPalette, ColorVariant, Icon, Typography } from '@lumx/react';
2
4
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
3
5
  import { getByClassName, queryAllByClassName, queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { ColorVariant, ColorWithVariants, Icon, Typography } from '@lumx/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { Size, Theme } from '@lumx/core/js/constants';
3
5
  import { Thumbnail } from '@lumx/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import {
@@ -1,4 +1,4 @@
1
- import { useRef } from 'react';
1
+ import React, { useRef } from 'react';
2
2
 
3
3
  import { mdiAccount, mdiOpenInNew } from '@lumx/icons';
4
4
  import { Icon, ListDivider, ListProps, ListSubheader, Size } from '@lumx/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
4
 
3
5
  import { render } from '@testing-library/react';
@@ -1,4 +1,4 @@
1
- import { Key, ReactNode, SyntheticEvent, useRef } from 'react';
1
+ import React, { Key, ReactNode, SyntheticEvent, useRef } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
4
 
3
5
  import { queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { GenericProps } from '@lumx/react/utils/type';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { render, screen } from '@testing-library/react';
3
5
  import { getByClassName, queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { ReactNode, Ref, SyntheticEvent, useMemo } from 'react';
1
+ import React, { ReactNode, Ref, SyntheticEvent, useMemo } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import isEmpty from 'lodash/isEmpty';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
4
  import { render } from '@testing-library/react';
3
5
  import { queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,6 +1,7 @@
1
1
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
2
  import { Kind } from '@lumx/react';
3
3
 
4
+ import React from 'react';
4
5
  import { queryByRole, render } from '@testing-library/react';
5
6
  import { getByClassName, queryByClassName } from '@lumx/react/testing/utils/queries';
6
7
  import { mdiAbTesting } from '@lumx/icons';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { Mosaic, MosaicProps } from '@lumx/react/components/mosaic/Mosaic';
2
4
  import { render, screen, within } from '@testing-library/react';
3
5
  import { getByClassName, queryAllByClassName, queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { MouseEventHandler, useMemo } from 'react';
1
+ import React, { MouseEventHandler, useMemo } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import take from 'lodash/take';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import {
2
4
  mdiHome,
3
5
  mdiMessageTextOutline,
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { render } from '@testing-library/react';
3
5
  import { getAllByClassName, getByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { HasAriaLabelOrLabelledBy, HasClassName, HasTheme } from '@lumx/react/utils/type';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
2
4
  import { render } from '@testing-library/react';
3
5
  import { getByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { ElementType, ReactNode } from 'react';
1
+ import React, { ElementType, ReactNode } from 'react';
2
2
  import { Icon, Placement, Size, Tooltip, Text } from '@lumx/react';
3
3
  import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
4
4
  import { ComponentRef, HasClassName, HasPolymorphicAs, HasRequiredLinkHref, HasTheme } from '@lumx/react/utils/type';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, RenderWrapper } from '@lumx/react/testing/utils';
2
4
  import { render, screen } from '@testing-library/react';
3
5
  import { getByClassName, queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { useRef, useState, useContext } from 'react';
1
+ import React, { useRef, useState, useContext } from 'react';
2
2
 
3
3
  import { mdiChevronDown, mdiChevronUp } from '@lumx/icons';
4
4
  import { Icon, Size, Text, Orientation, Popover, Placement, Theme } from '@lumx/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { Kind } from '@lumx/react';
2
4
  import { render, within, screen } from '@testing-library/react';
3
5
  import { queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { useRef } from 'react';
1
+ import React, { useRef } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import isFunction from 'lodash/isFunction';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { render, screen } from '@testing-library/react';
3
5
  import { ThemeSentinel } from '@lumx/react/testing/utils/ThemeSentinel';
@@ -1,4 +1,4 @@
1
- import { ReactNode, RefObject, useRef } from 'react';
1
+ import React, { ReactNode, RefObject, useRef } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,4 +1,4 @@
1
- import { useEffect, useMemo, useState } from 'react';
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
2
  import memoize from 'lodash/memoize';
3
3
  import { detectOverflow } from '@popperjs/core';
4
4
 
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { render, screen, within } from '@testing-library/react';
2
3
  import userEvent from '@testing-library/user-event';
3
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { HasAriaLabelOrLabelledBy } from '@lumx/react/utils/type';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { render } from '@testing-library/react';
3
5
  import { queryByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import isObject from 'lodash/isObject';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { Theme } from '@lumx/react';
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { ProgressCircular, ProgressCircularSize, Size, Text } from '@lumx/react';
2
3
  import { getSelectArgType } from '@lumx/react/stories/controls/selectArgType';
3
4
  import { withCombinations } from '@lumx/react/stories/decorators/withCombinations';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { getByClassName } from '@lumx/react/testing/utils/queries';
2
4
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
3
5
  import { render } from '@testing-library/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { Theme, Size } from '@lumx/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { getByClassName } from '@lumx/react/testing/utils/queries';
2
4
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
3
5
  import { render } from '@testing-library/react';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { Theme } from '@lumx/react';
@@ -10,7 +10,7 @@ import {
10
10
  } from '@lumx/react';
11
11
  import cloneDeep from 'lodash/cloneDeep';
12
12
  import set from 'lodash/set';
13
- import { useState } from 'react';
13
+ import React, { useState } from 'react';
14
14
 
15
15
  export default { title: 'LumX components/progress-tracker/Progress Tracker' };
16
16
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { ProgressTrackerStep } from '@lumx/react';
2
4
  import { render, within } from '@testing-library/react';
3
5
  import { getByClassName } from '@lumx/react/testing/utils/queries';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import {
2
4
  ProgressTracker,
3
5
  ProgressTrackerProvider,
@@ -1,4 +1,4 @@
1
- import { ReactNode, useEffect, useReducer } from 'react';
1
+ import React, { ReactNode, useEffect, useReducer } from 'react';
2
2
  import { INIT_STATE, TabProviderContext, reducer } from '../tabs/state';
3
3
 
4
4
  export interface ProgressTrackerProviderProps {
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { render, screen } from '@testing-library/react';
2
4
  import { getByClassName } from '@lumx/react/testing/utils/queries';
3
5
  import { commonTestsSuiteRTL } from '@lumx/react/testing/utils';
@@ -1,4 +1,4 @@
1
- import { FocusEventHandler, KeyboardEventHandler, useCallback } from 'react';
1
+ import React, { FocusEventHandler, KeyboardEventHandler, useCallback } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { render, screen } from '@testing-library/react';
2
4
  import { getByClassName } from '@lumx/react/testing/utils/queries';
3
5
 
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import classNames from 'classnames';
2
4
 
3
5
  import { useTabProviderContext } from '@lumx/react/components/tabs/state';
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+
1
3
  import { commonTestsSuiteRTL, SetupRenderOptions } from '@lumx/react/testing/utils';
2
4
  import { getByClassName, getByTagName, queryByClassName } from '@lumx/react/testing/utils/queries';
3
5
  import { render } from '@testing-library/react';
@@ -1,4 +1,4 @@
1
- import { ReactNode, SyntheticEvent, InputHTMLAttributes } from 'react';
1
+ import React, { ReactNode, SyntheticEvent, InputHTMLAttributes } from 'react';
2
2
 
3
3
  import classNames from 'classnames';
4
4